@ttoss/components 2.14.20 → 2.14.22
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/Accordion/index.d.mts +157 -0
- package/dist/Accordion/index.mjs +175 -0
- package/dist/DatePicker/index.d.mts +26 -0
- package/dist/DatePicker/index.mjs +339 -0
- package/dist/Drawer/index.d.mts +17 -0
- package/dist/{esm/Drawer/index.js → Drawer/index.mjs} +21 -14
- package/dist/EnhancedTitle/{index.d.ts → index.d.mts} +57 -47
- package/dist/EnhancedTitle/index.mjs +234 -0
- package/dist/FileUploader/index.d.mts +77 -0
- package/dist/FileUploader/index.mjs +386 -0
- package/dist/InstallPwa/index.d.mts +13 -0
- package/dist/InstallPwa/index.mjs +64 -0
- package/dist/JsonEditor/index.d.mts +3 -0
- package/dist/{esm/JsonEditor/index.js → JsonEditor/index.mjs} +0 -3
- package/dist/JsonView/index.d.mts +3 -0
- package/dist/{esm/JsonView/index.js → JsonView/index.mjs} +0 -3
- package/dist/List/{index.d.ts → index.d.mts} +9 -6
- package/dist/List/index.mjs +34 -0
- package/dist/LockedOverlay/index.d.mts +162 -0
- package/dist/LockedOverlay/index.mjs +386 -0
- package/dist/Markdown/index.d.mts +16 -0
- package/dist/Markdown/index.mjs +26 -0
- package/dist/Menu/index.d.mts +16 -0
- package/dist/{esm/Menu/index.js → Menu/index.mjs} +56 -51
- package/dist/MetricCard/index.d.mts +153 -0
- package/dist/MetricCard/index.mjs +408 -0
- package/dist/Modal/index.d.mts +11 -0
- package/dist/{esm/Modal/index.js → Modal/index.mjs} +11 -12
- package/dist/NavList/index.d.mts +64 -0
- package/dist/{esm/NavList/index.js → NavList/index.mjs} +79 -73
- package/dist/NotificationCard/index.d.mts +22 -0
- package/dist/NotificationCard/index.mjs +173 -0
- package/dist/NotificationsMenu/index.d.mts +47 -0
- package/dist/NotificationsMenu/index.mjs +380 -0
- package/dist/Search/index.d.mts +18 -0
- package/dist/{esm/Search/index.js → Search/index.mjs} +11 -9
- package/dist/SpotlightCard/index.d.mts +36 -0
- package/dist/SpotlightCard/index.mjs +219 -0
- package/dist/Table/index.d.mts +17 -0
- package/dist/Table/index.mjs +64 -0
- package/dist/Tabs/index.d.mts +17 -0
- package/dist/{esm/Tabs/index.js → Tabs/index.mjs} +24 -12
- package/dist/Toast/index.d.mts +8 -0
- package/dist/Toast/index.mjs +43 -0
- package/package.json +15 -15
- package/dist/Accordion/index.d.ts +0 -148
- package/dist/DatePicker/index.d.ts +0 -20
- package/dist/Drawer/index.d.ts +0 -12
- package/dist/LockedOverlay/index.d.ts +0 -151
- package/dist/Markdown/index.d.ts +0 -11
- package/dist/Menu/index.d.ts +0 -11
- package/dist/MetricCard/index.d.ts +0 -148
- package/dist/Modal/index.d.ts +0 -10
- package/dist/NavList/index.d.ts +0 -55
- package/dist/NotificationCard/index.d.ts +0 -21
- package/dist/NotificationsMenu/index.d.ts +0 -36
- package/dist/Search/index.d.ts +0 -11
- package/dist/SpotlightCard/index.d.ts +0 -27
- package/dist/Table/index.d.ts +0 -16
- package/dist/esm/Accordion/index.js +0 -119
- package/dist/esm/DatePicker/index.js +0 -331
- package/dist/esm/EnhancedTitle/index.js +0 -190
- package/dist/esm/FileUploader/index.js +0 -401
- package/dist/esm/InstallPwa/index.js +0 -61
- package/dist/esm/List/index.js +0 -30
- package/dist/esm/LockedOverlay/index.js +0 -316
- package/dist/esm/Markdown/index.js +0 -23
- package/dist/esm/MetricCard/index.js +0 -327
- package/dist/esm/NotificationCard/index.js +0 -156
- package/dist/esm/NotificationsMenu/index.js +0 -359
- package/dist/esm/SpotlightCard/index.js +0 -212
- package/dist/esm/Table/index.js +0 -63
- package/dist/esm/Toast/index.js +0 -38
- package/dist/esm/chunk-V4MHYKRI.js +0 -7
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
|
|
2
|
+
import { BoxProps } from "@ttoss/ui";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import DrawerUi from "react-modern-drawer";
|
|
5
|
+
|
|
6
|
+
//#region src/components/Drawer/Drawer.d.ts
|
|
7
|
+
type DrawerUiProps = React.ComponentProps<typeof DrawerUi>;
|
|
8
|
+
type DrawerProps = DrawerUiProps & {
|
|
9
|
+
sx?: BoxProps['sx'];
|
|
10
|
+
};
|
|
11
|
+
declare const Drawer: ({
|
|
12
|
+
children,
|
|
13
|
+
sx,
|
|
14
|
+
...props
|
|
15
|
+
}: DrawerProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { Drawer, DrawerProps };
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
|
|
2
|
-
import { __name } from "../chunk-V4MHYKRI.js";
|
|
3
|
-
|
|
4
|
-
// src/components/Drawer/Drawer.tsx
|
|
5
2
|
import { Box } from "@ttoss/ui";
|
|
6
|
-
import
|
|
3
|
+
import "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
5
|
import DrawerUi from "react-modern-drawer";
|
|
8
|
-
|
|
6
|
+
|
|
7
|
+
//#region src/components/Drawer/Drawer.tsx
|
|
8
|
+
const Drawer = ({
|
|
9
9
|
children,
|
|
10
10
|
sx,
|
|
11
11
|
...props
|
|
12
12
|
}) => {
|
|
13
|
-
return /* @__PURE__ */
|
|
13
|
+
return /* @__PURE__ */jsx(Box, {
|
|
14
14
|
"data-testid": "drawer-container",
|
|
15
15
|
sx: {
|
|
16
16
|
/**
|
|
@@ -48,12 +48,19 @@ var Drawer = /* @__PURE__ */__name(({
|
|
|
48
48
|
overflowY: "auto"
|
|
49
49
|
},
|
|
50
50
|
...sx
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
},
|
|
51
|
+
},
|
|
52
|
+
children: /* @__PURE__ */jsx(DrawerUi, {
|
|
53
|
+
...props,
|
|
54
|
+
children: /* @__PURE__ */jsx(Box, {
|
|
55
|
+
sx: {
|
|
56
|
+
width: "100%",
|
|
57
|
+
height: "100%"
|
|
58
|
+
},
|
|
59
|
+
children
|
|
60
|
+
})
|
|
61
|
+
})
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
//#endregion
|
|
59
66
|
export { Drawer };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { BadgeProps } from '@ttoss/ui';
|
|
3
1
|
|
|
2
|
+
import { BadgeProps } from "@ttoss/ui";
|
|
3
|
+
|
|
4
|
+
//#region src/components/EnhancedTitle/EnhancedTitle.types.d.ts
|
|
4
5
|
/**
|
|
5
6
|
* Visual variant for the icon wrapper.
|
|
6
7
|
*/
|
|
@@ -9,54 +10,55 @@ type EnhancedTitleVariant = 'spotlight-accent' | 'spotlight-primary' | 'primary'
|
|
|
9
10
|
* Badge configuration for top and bottom badge sections.
|
|
10
11
|
*/
|
|
11
12
|
interface EnhancedTitleBadge {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Icon to display in the badge.
|
|
15
|
+
*/
|
|
16
|
+
icon?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Badge label text.
|
|
19
|
+
*/
|
|
20
|
+
label: string;
|
|
21
|
+
/**
|
|
22
|
+
* Badge visual variant.
|
|
23
|
+
*/
|
|
24
|
+
variant?: BadgeProps['variant'];
|
|
24
25
|
}
|
|
25
26
|
/**
|
|
26
27
|
* Props for the EnhancedTitle component.
|
|
27
28
|
*/
|
|
28
29
|
interface EnhancedTitleProps {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
30
|
+
/**
|
|
31
|
+
* Visual variant for the icon wrapper.
|
|
32
|
+
* @default 'primary'
|
|
33
|
+
*/
|
|
34
|
+
variant?: EnhancedTitleVariant;
|
|
35
|
+
/**
|
|
36
|
+
* Icon to display next to the title.
|
|
37
|
+
*/
|
|
38
|
+
icon?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Main title text (heading).
|
|
41
|
+
*/
|
|
42
|
+
title: string;
|
|
43
|
+
/**
|
|
44
|
+
* Optional subtitle/description text.
|
|
45
|
+
*/
|
|
46
|
+
description?: string;
|
|
47
|
+
/**
|
|
48
|
+
* Optional text displayed next to the title (e.g., price, metadata).
|
|
49
|
+
*/
|
|
50
|
+
frontTitle?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Badges to display above the title.
|
|
53
|
+
*/
|
|
54
|
+
topBadges?: EnhancedTitleBadge[];
|
|
55
|
+
/**
|
|
56
|
+
* Badges to display below the title.
|
|
57
|
+
*/
|
|
58
|
+
bottomBadges?: EnhancedTitleBadge[];
|
|
58
59
|
}
|
|
59
|
-
|
|
60
|
+
//#endregion
|
|
61
|
+
//#region src/components/EnhancedTitle/EnhancedTitle.d.ts
|
|
60
62
|
/**
|
|
61
63
|
* EnhancedTitle component renders a structured title section with icon, badges, and metadata.
|
|
62
64
|
*
|
|
@@ -92,6 +94,14 @@ interface EnhancedTitleProps {
|
|
|
92
94
|
* />
|
|
93
95
|
* ```
|
|
94
96
|
*/
|
|
95
|
-
declare const EnhancedTitle: ({
|
|
96
|
-
|
|
97
|
-
|
|
97
|
+
declare const EnhancedTitle: ({
|
|
98
|
+
variant,
|
|
99
|
+
icon,
|
|
100
|
+
title,
|
|
101
|
+
description,
|
|
102
|
+
frontTitle,
|
|
103
|
+
topBadges,
|
|
104
|
+
bottomBadges
|
|
105
|
+
}: EnhancedTitleProps) => import("react/jsx-runtime").JSX.Element;
|
|
106
|
+
//#endregion
|
|
107
|
+
export { EnhancedTitle, EnhancedTitleBadge, EnhancedTitleProps, EnhancedTitleVariant };
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
/** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
|
|
2
|
+
import { Badge, Flex, Heading, Stack, Text, keyframes } from "@ttoss/ui";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { Icon } from "@ttoss/react-icons";
|
|
5
|
+
|
|
6
|
+
//#region src/components/EnhancedTitle/EnhancedTitle.styles.ts
|
|
7
|
+
const gradientFlow = keyframes({
|
|
8
|
+
"0%": {
|
|
9
|
+
backgroundPosition: "0% 50%"
|
|
10
|
+
},
|
|
11
|
+
"50%": {
|
|
12
|
+
backgroundPosition: "100% 50%"
|
|
13
|
+
},
|
|
14
|
+
"100%": {
|
|
15
|
+
backgroundPosition: "0% 50%"
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
const getAccentGradientBackground = t => {
|
|
19
|
+
const theme = t;
|
|
20
|
+
const start = theme.colors?.action?.background?.accent?.default || theme.colors?.input?.background?.accent?.default;
|
|
21
|
+
if (!start) return void 0;
|
|
22
|
+
return `linear-gradient(270deg, ${start}, ${theme.colors?.action?.background?.accent?.active || theme.colors?.input?.background?.accent?.active || start}, ${start})`;
|
|
23
|
+
};
|
|
24
|
+
const getPrimaryGradientBackground = t => {
|
|
25
|
+
const theme = t;
|
|
26
|
+
const start = theme.colors?.action?.background?.primary?.default;
|
|
27
|
+
if (!start) return void 0;
|
|
28
|
+
return `linear-gradient(270deg, ${start}, ${theme.colors?.action?.background?.secondary?.default || start}, ${start})`;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Returns style configuration for the icon wrapper based on variant.
|
|
32
|
+
*/
|
|
33
|
+
const getEnhancedTitleIconSx = variant => {
|
|
34
|
+
return {
|
|
35
|
+
flexShrink: 0,
|
|
36
|
+
alignItems: "center",
|
|
37
|
+
justifyContent: "center",
|
|
38
|
+
borderRadius: "2xl",
|
|
39
|
+
border: "md",
|
|
40
|
+
width: "56px",
|
|
41
|
+
height: "56px",
|
|
42
|
+
...{
|
|
43
|
+
"spotlight-accent": {
|
|
44
|
+
backgroundColor: "input.background.accent.default",
|
|
45
|
+
color: "action.text.accent.default",
|
|
46
|
+
borderColor: "display.border.muted.default",
|
|
47
|
+
background: getAccentGradientBackground,
|
|
48
|
+
backgroundSize: "400% 400%",
|
|
49
|
+
animation: `${gradientFlow} 6s ease infinite`
|
|
50
|
+
},
|
|
51
|
+
"spotlight-primary": {
|
|
52
|
+
backgroundColor: "action.background.primary.default",
|
|
53
|
+
color: "display.text.accent.default",
|
|
54
|
+
borderColor: "display.border.muted.default",
|
|
55
|
+
background: getPrimaryGradientBackground,
|
|
56
|
+
backgroundSize: "400% 400%",
|
|
57
|
+
animation: `${gradientFlow} 6s ease infinite`
|
|
58
|
+
},
|
|
59
|
+
primary: {
|
|
60
|
+
backgroundColor: "action.background.primary.default",
|
|
61
|
+
color: "action.text.primary.default",
|
|
62
|
+
borderColor: "display.border.muted.default"
|
|
63
|
+
},
|
|
64
|
+
secondary: {
|
|
65
|
+
backgroundColor: "action.background.secondary.default",
|
|
66
|
+
color: "action.text.primary.default",
|
|
67
|
+
borderColor: "display.border.muted.default"
|
|
68
|
+
},
|
|
69
|
+
accent: {
|
|
70
|
+
backgroundColor: "action.background.accent.default",
|
|
71
|
+
color: "action.text.accent.default",
|
|
72
|
+
borderColor: "display.border.muted.default"
|
|
73
|
+
},
|
|
74
|
+
positive: {
|
|
75
|
+
backgroundColor: "display.bg.positive.boldest",
|
|
76
|
+
color: "display.fg.positive.bolder",
|
|
77
|
+
borderColor: "display.border.muted.default"
|
|
78
|
+
},
|
|
79
|
+
negative: {
|
|
80
|
+
backgroundColor: "display.bg.negative.boldest",
|
|
81
|
+
color: "display.fg.negative.bolder",
|
|
82
|
+
borderColor: "display.border.muted.default"
|
|
83
|
+
},
|
|
84
|
+
informative: {
|
|
85
|
+
backgroundColor: "display.bg.informative.boldest",
|
|
86
|
+
color: "display.fg.informative.bolder",
|
|
87
|
+
borderColor: "display.border.muted.default"
|
|
88
|
+
},
|
|
89
|
+
muted: {
|
|
90
|
+
backgroundColor: "display.bg.muted.boldest",
|
|
91
|
+
color: "display.fg.muted.bolder",
|
|
92
|
+
borderColor: "display.border.muted.default"
|
|
93
|
+
}
|
|
94
|
+
}[variant]
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
//#endregion
|
|
99
|
+
//#region src/components/EnhancedTitle/EnhancedTitle.tsx
|
|
100
|
+
/**
|
|
101
|
+
* EnhancedTitle component renders a structured title section with icon, badges, and metadata.
|
|
102
|
+
*
|
|
103
|
+
* This component is useful for displaying rich title sections with status indicators,
|
|
104
|
+
* feature tags, and supplementary information in a consistent layout.
|
|
105
|
+
*
|
|
106
|
+
* @example
|
|
107
|
+
* ```tsx
|
|
108
|
+
* <EnhancedTitle
|
|
109
|
+
* icon="fluent:shield-24-filled"
|
|
110
|
+
* title="Starter Plan"
|
|
111
|
+
* frontTitle="R$ 49,90/mês"
|
|
112
|
+
* description="Perfect for small teams"
|
|
113
|
+
* variant="primary"
|
|
114
|
+
* topBadges={[
|
|
115
|
+
* { label: 'Active', variant: 'positive', icon: 'fluent:checkmark-circle-24-filled' }
|
|
116
|
+
* ]}
|
|
117
|
+
* bottomBadges={[
|
|
118
|
+
* { label: 'OneClick Tracking', icon: 'fluent:checkmark-24-filled' }
|
|
119
|
+
* ]}
|
|
120
|
+
* />
|
|
121
|
+
* ```
|
|
122
|
+
*
|
|
123
|
+
* @example
|
|
124
|
+
* ```tsx
|
|
125
|
+
* <EnhancedTitle
|
|
126
|
+
* title="Pro Plan"
|
|
127
|
+
* frontTitle="$99/month"
|
|
128
|
+
* variant="accent"
|
|
129
|
+
* topBadges={[
|
|
130
|
+
* { label: 'Most Popular', variant: 'informative' }
|
|
131
|
+
* ]}
|
|
132
|
+
* />
|
|
133
|
+
* ```
|
|
134
|
+
*/
|
|
135
|
+
const EnhancedTitle = ({
|
|
136
|
+
variant = "spotlight-primary",
|
|
137
|
+
icon,
|
|
138
|
+
title,
|
|
139
|
+
description,
|
|
140
|
+
frontTitle,
|
|
141
|
+
topBadges = [],
|
|
142
|
+
bottomBadges = []
|
|
143
|
+
}) => {
|
|
144
|
+
return /* @__PURE__ */jsx(Stack, {
|
|
145
|
+
sx: {
|
|
146
|
+
paddingY: "6",
|
|
147
|
+
paddingX: "6",
|
|
148
|
+
width: "full"
|
|
149
|
+
},
|
|
150
|
+
children: /* @__PURE__ */jsxs(Flex, {
|
|
151
|
+
sx: {
|
|
152
|
+
gap: "6",
|
|
153
|
+
alignItems: "flex-start",
|
|
154
|
+
flexDirection: ["column", "row"]
|
|
155
|
+
},
|
|
156
|
+
children: [icon && /* @__PURE__ */jsx(Flex, {
|
|
157
|
+
sx: getEnhancedTitleIconSx(variant),
|
|
158
|
+
children: /* @__PURE__ */jsx(Icon, {
|
|
159
|
+
icon,
|
|
160
|
+
width: 24,
|
|
161
|
+
height: 24
|
|
162
|
+
})
|
|
163
|
+
}), /* @__PURE__ */jsxs(Flex, {
|
|
164
|
+
sx: {
|
|
165
|
+
flexDirection: "column",
|
|
166
|
+
gap: ["4", "5"],
|
|
167
|
+
flex: 1
|
|
168
|
+
},
|
|
169
|
+
children: [topBadges.length > 0 && /* @__PURE__ */jsx(Flex, {
|
|
170
|
+
sx: {
|
|
171
|
+
flexWrap: "wrap",
|
|
172
|
+
gap: "2",
|
|
173
|
+
alignItems: "center"
|
|
174
|
+
},
|
|
175
|
+
children: topBadges.map((badge, index) => {
|
|
176
|
+
return /* @__PURE__ */jsx(Badge, {
|
|
177
|
+
icon: badge.icon,
|
|
178
|
+
variant: badge.variant ?? "muted",
|
|
179
|
+
sx: {
|
|
180
|
+
borderRadius: "full"
|
|
181
|
+
},
|
|
182
|
+
children: badge.label
|
|
183
|
+
}, index);
|
|
184
|
+
})
|
|
185
|
+
}), /* @__PURE__ */jsxs(Flex, {
|
|
186
|
+
sx: {
|
|
187
|
+
flexDirection: ["column", "row"],
|
|
188
|
+
alignItems: ["flex-start", "baseline"],
|
|
189
|
+
gap: ["1", "3"]
|
|
190
|
+
},
|
|
191
|
+
children: [/* @__PURE__ */jsx(Heading, {
|
|
192
|
+
as: "h2",
|
|
193
|
+
sx: {
|
|
194
|
+
fontSize: "4xl",
|
|
195
|
+
fontWeight: "semibold",
|
|
196
|
+
color: "display.text.primary.default"
|
|
197
|
+
},
|
|
198
|
+
children: title
|
|
199
|
+
}), frontTitle && /* @__PURE__ */jsx(Text, {
|
|
200
|
+
sx: {
|
|
201
|
+
fontSize: "xl",
|
|
202
|
+
color: "display.text.secondary.default"
|
|
203
|
+
},
|
|
204
|
+
children: frontTitle
|
|
205
|
+
})]
|
|
206
|
+
}), description && /* @__PURE__ */jsx(Text, {
|
|
207
|
+
sx: {
|
|
208
|
+
fontSize: "md",
|
|
209
|
+
color: "display.text.secondary.default"
|
|
210
|
+
},
|
|
211
|
+
children: description
|
|
212
|
+
}), bottomBadges.length > 0 && /* @__PURE__ */jsx(Flex, {
|
|
213
|
+
sx: {
|
|
214
|
+
flexWrap: "wrap",
|
|
215
|
+
gap: "2"
|
|
216
|
+
},
|
|
217
|
+
children: bottomBadges.map((badge, index) => {
|
|
218
|
+
return /* @__PURE__ */jsx(Badge, {
|
|
219
|
+
icon: badge.icon ?? "fluent:checkmark-24-filled",
|
|
220
|
+
variant: badge.variant ?? "muted",
|
|
221
|
+
sx: {
|
|
222
|
+
borderRadius: "full"
|
|
223
|
+
},
|
|
224
|
+
children: badge.label
|
|
225
|
+
}, index);
|
|
226
|
+
})
|
|
227
|
+
})]
|
|
228
|
+
})]
|
|
229
|
+
})
|
|
230
|
+
});
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
//#endregion
|
|
234
|
+
export { EnhancedTitle };
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/components/FileUploader/FileUploader.d.ts
|
|
5
|
+
type UploadResult = {
|
|
6
|
+
url: string;
|
|
7
|
+
id: string | number;
|
|
8
|
+
};
|
|
9
|
+
type FileUploadState = {
|
|
10
|
+
file: File;
|
|
11
|
+
status: 'pending' | 'uploading' | 'completed' | 'error';
|
|
12
|
+
progress?: number;
|
|
13
|
+
result?: UploadResult;
|
|
14
|
+
error?: Error;
|
|
15
|
+
};
|
|
16
|
+
type OnUpload = (file: File, onProgress?: (progress: number) => void) => Promise<UploadResult>;
|
|
17
|
+
type OnUploadStart = (file: File) => void;
|
|
18
|
+
type OnUploadProgress = (file: File, progress: number) => void;
|
|
19
|
+
type OnUploadComplete = (file: File, result: UploadResult) => void;
|
|
20
|
+
type OnUploadError = (file: File, error: Error) => void;
|
|
21
|
+
type OnFilesChange = (files: FileUploadState[]) => void;
|
|
22
|
+
type OnRemove = (file: UploadedFile, index: number) => void;
|
|
23
|
+
type UploadedFile = {
|
|
24
|
+
id: string | number;
|
|
25
|
+
name: string;
|
|
26
|
+
imageUrl?: string;
|
|
27
|
+
url: string;
|
|
28
|
+
};
|
|
29
|
+
type FileUploaderProps = {
|
|
30
|
+
onUpload: OnUpload;
|
|
31
|
+
onUploadStart?: OnUploadStart;
|
|
32
|
+
onUploadProgress?: OnUploadProgress;
|
|
33
|
+
onUploadComplete?: OnUploadComplete;
|
|
34
|
+
onUploadError?: OnUploadError;
|
|
35
|
+
onFilesChange?: OnFilesChange;
|
|
36
|
+
onRemove?: OnRemove;
|
|
37
|
+
accept?: string;
|
|
38
|
+
multiple?: boolean;
|
|
39
|
+
maxSize?: number;
|
|
40
|
+
maxFiles?: number;
|
|
41
|
+
disabled?: boolean;
|
|
42
|
+
autoUpload?: boolean;
|
|
43
|
+
retryAttempts?: number;
|
|
44
|
+
placeholder?: string;
|
|
45
|
+
error?: string;
|
|
46
|
+
children?: React.ReactNode;
|
|
47
|
+
showFileList?: boolean;
|
|
48
|
+
FileListComponent?: (props: {
|
|
49
|
+
files: UploadedFile[];
|
|
50
|
+
onRemove: (index: number) => void;
|
|
51
|
+
}) => React.ReactNode;
|
|
52
|
+
files?: UploadedFile[];
|
|
53
|
+
};
|
|
54
|
+
declare const FileUploader: ({
|
|
55
|
+
onUpload,
|
|
56
|
+
onUploadStart,
|
|
57
|
+
onUploadProgress,
|
|
58
|
+
onUploadComplete,
|
|
59
|
+
onUploadError,
|
|
60
|
+
onFilesChange,
|
|
61
|
+
onRemove,
|
|
62
|
+
accept,
|
|
63
|
+
multiple,
|
|
64
|
+
maxSize,
|
|
65
|
+
maxFiles,
|
|
66
|
+
disabled,
|
|
67
|
+
autoUpload,
|
|
68
|
+
retryAttempts,
|
|
69
|
+
placeholder,
|
|
70
|
+
error,
|
|
71
|
+
children,
|
|
72
|
+
showFileList,
|
|
73
|
+
FileListComponent,
|
|
74
|
+
files: uploadedFiles
|
|
75
|
+
}: FileUploaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
76
|
+
//#endregion
|
|
77
|
+
export { FileUploadState, FileUploader, FileUploaderProps, OnFilesChange, OnRemove, OnUpload, OnUploadComplete, OnUploadError, OnUploadProgress, OnUploadStart, UploadResult, UploadedFile };
|