@ttoss/components 2.14.20 → 2.14.21
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
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
|
|
2
|
-
import { __name } from "../chunk-V4MHYKRI.js";
|
|
3
|
-
|
|
4
|
-
// src/components/NavList/NavList.tsx
|
|
5
2
|
import { Icon } from "@ttoss/react-icons";
|
|
6
3
|
import { Divider, Flex, Link, Text } from "@ttoss/ui";
|
|
4
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
5
|
import * as React from "react";
|
|
8
|
-
|
|
6
|
+
|
|
7
|
+
//#region src/components/NavList/NavList.tsx
|
|
8
|
+
const getVariantStyles = variant => {
|
|
9
9
|
switch (variant) {
|
|
10
10
|
case "sidebar":
|
|
11
11
|
return {
|
|
@@ -115,8 +115,8 @@ var getVariantStyles = /* @__PURE__ */__name(variant => {
|
|
|
115
115
|
default:
|
|
116
116
|
return getVariantStyles("menu");
|
|
117
117
|
}
|
|
118
|
-
}
|
|
119
|
-
|
|
118
|
+
};
|
|
119
|
+
const NavListItemComponent = ({
|
|
120
120
|
item,
|
|
121
121
|
onItemClick,
|
|
122
122
|
variantStyles,
|
|
@@ -124,57 +124,64 @@ var NavListItemComponent = /* @__PURE__ */__name(({
|
|
|
124
124
|
LinkComponent = Link,
|
|
125
125
|
showDivider = false
|
|
126
126
|
}) => {
|
|
127
|
-
const handleClick =
|
|
127
|
+
const handleClick = event => {
|
|
128
128
|
if (item.disabled) {
|
|
129
129
|
event.preventDefault();
|
|
130
130
|
return;
|
|
131
131
|
}
|
|
132
132
|
item.onClick?.(event);
|
|
133
133
|
onItemClick?.(item);
|
|
134
|
-
}
|
|
134
|
+
};
|
|
135
135
|
const itemStyles = {
|
|
136
136
|
...variantStyles.item,
|
|
137
137
|
...(item.active ? variantStyles.activeItem : {}),
|
|
138
138
|
...(item.disabled ? {
|
|
139
|
-
opacity:
|
|
139
|
+
opacity: .5,
|
|
140
140
|
cursor: "not-allowed",
|
|
141
141
|
pointerEvents: "none"
|
|
142
142
|
} : {})
|
|
143
143
|
};
|
|
144
144
|
const isDefaultLink = LinkComponent === Link;
|
|
145
|
-
const linkContent = /* @__PURE__ */
|
|
145
|
+
const linkContent = /* @__PURE__ */jsxs(Flex, {
|
|
146
146
|
sx: {
|
|
147
147
|
alignItems: "center",
|
|
148
148
|
gap: "2",
|
|
149
149
|
color: "navigation.text.primary.default"
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
150
|
+
},
|
|
151
|
+
children: [item.icon && /* @__PURE__ */jsx(Icon, {
|
|
152
|
+
icon: item.icon,
|
|
153
|
+
width: iconSize ?? variantStyles.icon.size,
|
|
154
|
+
height: iconSize ?? variantStyles.icon.size
|
|
155
|
+
}), /* @__PURE__ */jsx(Text, {
|
|
156
|
+
children: item.label
|
|
157
|
+
})]
|
|
158
|
+
});
|
|
159
|
+
return /* @__PURE__ */jsxs(Fragment, {
|
|
160
|
+
children: [isDefaultLink ? /* @__PURE__ */jsx(LinkComponent, {
|
|
161
|
+
href: item.href,
|
|
162
|
+
onClick: handleClick,
|
|
163
|
+
sx: itemStyles,
|
|
164
|
+
"aria-disabled": item.disabled,
|
|
165
|
+
"aria-current": item.active ? "page" : void 0,
|
|
166
|
+
quiet: true,
|
|
167
|
+
children: linkContent
|
|
168
|
+
}) : /* @__PURE__ */jsx(Link, {
|
|
169
|
+
as: LinkComponent,
|
|
170
|
+
href: item.href,
|
|
171
|
+
onClick: handleClick,
|
|
172
|
+
sx: itemStyles,
|
|
173
|
+
"aria-disabled": item.disabled,
|
|
174
|
+
"aria-current": item.active ? "page" : void 0,
|
|
175
|
+
quiet: true,
|
|
176
|
+
children: linkContent
|
|
177
|
+
}), showDivider && /* @__PURE__ */jsx(Divider, {
|
|
178
|
+
sx: {
|
|
179
|
+
marginY: "2"
|
|
180
|
+
}
|
|
181
|
+
})]
|
|
182
|
+
});
|
|
183
|
+
};
|
|
184
|
+
const NavList = ({
|
|
178
185
|
items = [],
|
|
179
186
|
groups = [],
|
|
180
187
|
variant = "menu",
|
|
@@ -185,15 +192,11 @@ var NavList = /* @__PURE__ */__name(({
|
|
|
185
192
|
}) => {
|
|
186
193
|
const variantStyles = getVariantStyles(variant);
|
|
187
194
|
const processedGroups = React.useMemo(() => {
|
|
188
|
-
if (groups.length > 0)
|
|
189
|
-
return groups;
|
|
190
|
-
}
|
|
195
|
+
if (groups.length > 0) return groups;
|
|
191
196
|
if (items.length > 0) {
|
|
192
197
|
const groupedItems = items.reduce((acc, item) => {
|
|
193
198
|
const groupKey = item.group || "__ungrouped__";
|
|
194
|
-
if (!acc[groupKey])
|
|
195
|
-
acc[groupKey] = [];
|
|
196
|
-
}
|
|
199
|
+
if (!acc[groupKey]) acc[groupKey] = [];
|
|
197
200
|
acc[groupKey].push(item);
|
|
198
201
|
return acc;
|
|
199
202
|
}, {});
|
|
@@ -208,39 +211,42 @@ var NavList = /* @__PURE__ */__name(({
|
|
|
208
211
|
}
|
|
209
212
|
return [];
|
|
210
213
|
}, [items, groups]);
|
|
211
|
-
return /* @__PURE__ */
|
|
214
|
+
return /* @__PURE__ */jsx(Flex, {
|
|
212
215
|
as: "nav",
|
|
213
216
|
sx: {
|
|
214
217
|
...variantStyles.container,
|
|
215
218
|
...sx
|
|
216
219
|
},
|
|
217
|
-
role: "navigation"
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
}
|
|
220
|
+
role: "navigation",
|
|
221
|
+
children: processedGroups.map((group, groupIndex) => {
|
|
222
|
+
return /* @__PURE__ */jsxs(React.Fragment, {
|
|
223
|
+
children: [group.label && /* @__PURE__ */jsx(Text, {
|
|
224
|
+
sx: variantStyles.groupLabel,
|
|
225
|
+
as: "div",
|
|
226
|
+
role: "heading",
|
|
227
|
+
children: group.label
|
|
228
|
+
}), /* @__PURE__ */jsx(Flex, {
|
|
229
|
+
sx: {
|
|
230
|
+
flexDirection: "column",
|
|
231
|
+
gap: variantStyles.container.gap
|
|
232
|
+
},
|
|
233
|
+
children: group.items.map((item, itemIndex) => {
|
|
234
|
+
const isLastItem = itemIndex === group.items.length - 1;
|
|
235
|
+
return /* @__PURE__ */jsx(NavListItemComponent, {
|
|
236
|
+
item,
|
|
237
|
+
onItemClick,
|
|
238
|
+
variantStyles,
|
|
239
|
+
iconSize,
|
|
240
|
+
LinkComponent,
|
|
241
|
+
showDivider: item.divider || isLastItem && group.divider
|
|
242
|
+
}, item.id || `${group.id}-item-${itemIndex}`);
|
|
243
|
+
})
|
|
244
|
+
})]
|
|
245
|
+
}, group.id || `group-${groupIndex}`);
|
|
246
|
+
})
|
|
247
|
+
});
|
|
248
|
+
};
|
|
245
249
|
NavList.displayName = "NavList";
|
|
250
|
+
|
|
251
|
+
//#endregion
|
|
246
252
|
export { NavList };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/components/NotificationCard/NotificationCard.d.ts
|
|
5
|
+
type NotificationType = 'success' | 'error' | 'warning' | 'info' | 'neutral';
|
|
6
|
+
type NotificationAction = {
|
|
7
|
+
action?: 'open_url';
|
|
8
|
+
url?: string;
|
|
9
|
+
label?: string;
|
|
10
|
+
};
|
|
11
|
+
type NotificationCardProps = {
|
|
12
|
+
type: NotificationType;
|
|
13
|
+
title?: string | React.ReactNode;
|
|
14
|
+
message: string | React.ReactNode;
|
|
15
|
+
actions?: NotificationAction[];
|
|
16
|
+
caption?: string | React.ReactNode;
|
|
17
|
+
tags?: string[] | React.ReactNode;
|
|
18
|
+
onClose?: () => void;
|
|
19
|
+
};
|
|
20
|
+
declare const NotificationCard: (props: NotificationCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
//#endregion
|
|
22
|
+
export { NotificationAction, NotificationCard, NotificationCardProps };
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
/** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
|
|
2
|
+
import { Icon } from "@ttoss/react-icons";
|
|
3
|
+
import { Box, Card, CloseButton, Link, Tag, Text } from "@ttoss/ui";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import "react";
|
|
6
|
+
|
|
7
|
+
//#region src/components/NotificationCard/NotificationCard.tsx
|
|
8
|
+
const NotificationCard = props => {
|
|
9
|
+
const sxMap = {
|
|
10
|
+
success: {
|
|
11
|
+
card: {
|
|
12
|
+
backgroundColor: "feedback.background.positive.default",
|
|
13
|
+
borderColor: "feedback.border.positive.default"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
error: {
|
|
17
|
+
card: {
|
|
18
|
+
backgroundColor: "feedback.background.negative.default",
|
|
19
|
+
borderColor: "feedback.border.negative.default"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
warning: {
|
|
23
|
+
card: {
|
|
24
|
+
backgroundColor: "feedback.background.caution.default",
|
|
25
|
+
borderColor: "feedback.border.caution.default"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
info: {
|
|
29
|
+
card: {
|
|
30
|
+
backgroundColor: "feedback.background.primary.default",
|
|
31
|
+
borderColor: "feedback.border.primary.default"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
neutral: {
|
|
35
|
+
card: {
|
|
36
|
+
backgroundColor: "feedback.background.primary.default",
|
|
37
|
+
borderColor: "feedback.border.primary.default"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
const icon = {
|
|
42
|
+
success: "success-circle",
|
|
43
|
+
error: "error",
|
|
44
|
+
warning: "warning-alt",
|
|
45
|
+
info: "info",
|
|
46
|
+
neutral: "info"
|
|
47
|
+
};
|
|
48
|
+
const hasCaption = Boolean(props.caption);
|
|
49
|
+
const hasActions = Boolean(props.actions && props.actions.length > 0);
|
|
50
|
+
const hasTitle = Boolean(props.title);
|
|
51
|
+
const shouldCenterVerticallyWithoutTitle = !hasCaption && !hasActions && !hasTitle;
|
|
52
|
+
const shouldCenterVerticallyWithTitle = !hasCaption && !hasActions && hasTitle;
|
|
53
|
+
const shouldAddMinHeight = !hasCaption && !hasActions;
|
|
54
|
+
return /* @__PURE__ */jsxs(Card, {
|
|
55
|
+
sx: {
|
|
56
|
+
...sxMap[props.type].card,
|
|
57
|
+
width: "full"
|
|
58
|
+
},
|
|
59
|
+
children: [props.title && /* @__PURE__ */jsxs(Card.Title, {
|
|
60
|
+
sx: {
|
|
61
|
+
display: "flex",
|
|
62
|
+
justifyContent: "space-between",
|
|
63
|
+
alignItems: "center",
|
|
64
|
+
fontSize: ["md", "xl"],
|
|
65
|
+
paddingY: ["1", "2", "4"],
|
|
66
|
+
paddingX: ["2", "4", "8"]
|
|
67
|
+
},
|
|
68
|
+
children: [/* @__PURE__ */jsxs(Text, {
|
|
69
|
+
sx: {
|
|
70
|
+
display: "inline-flex",
|
|
71
|
+
alignItems: "flex-start",
|
|
72
|
+
gap: "2",
|
|
73
|
+
flexDirection: "row",
|
|
74
|
+
flexWrap: "wrap"
|
|
75
|
+
},
|
|
76
|
+
children: [/* @__PURE__ */jsxs(Box, {
|
|
77
|
+
sx: {
|
|
78
|
+
display: "flex",
|
|
79
|
+
alignItems: "center",
|
|
80
|
+
gap: "2"
|
|
81
|
+
},
|
|
82
|
+
children: [/* @__PURE__ */jsx(Icon, {
|
|
83
|
+
icon: icon[props.type]
|
|
84
|
+
}), props.title]
|
|
85
|
+
}), props.tags && (Array.isArray(props.tags) ? props.tags.length > 0 : true) && (Array.isArray(props.tags) ? props.tags.map((tag, index) => {
|
|
86
|
+
return /* @__PURE__ */jsx(Tag, {
|
|
87
|
+
children: tag
|
|
88
|
+
}, index);
|
|
89
|
+
}) : /* @__PURE__ */jsx(Tag, {
|
|
90
|
+
children: props.tags
|
|
91
|
+
}))]
|
|
92
|
+
}), props.onClose && /* @__PURE__ */jsx(Box, {
|
|
93
|
+
sx: {
|
|
94
|
+
marginLeft: "auto"
|
|
95
|
+
},
|
|
96
|
+
children: /* @__PURE__ */jsx(CloseButton, {
|
|
97
|
+
onClick: props.onClose
|
|
98
|
+
})
|
|
99
|
+
})]
|
|
100
|
+
}), /* @__PURE__ */jsxs(Card.Body, {
|
|
101
|
+
sx: {
|
|
102
|
+
...sxMap[props.type].card,
|
|
103
|
+
display: "flex",
|
|
104
|
+
flexDirection: "column",
|
|
105
|
+
gap: "2",
|
|
106
|
+
paddingY: ["1", "2", "4"],
|
|
107
|
+
paddingX: ["2", "4", "8"]
|
|
108
|
+
},
|
|
109
|
+
children: [/* @__PURE__ */jsx(Box, {
|
|
110
|
+
sx: {
|
|
111
|
+
display: "flex",
|
|
112
|
+
justifyContent: "space-between",
|
|
113
|
+
minHeight: shouldAddMinHeight ? "40px" : "auto",
|
|
114
|
+
alignItems: shouldCenterVerticallyWithoutTitle ? "center" : shouldCenterVerticallyWithTitle ? "center" : "flex-start",
|
|
115
|
+
width: "100%",
|
|
116
|
+
gap: "4"
|
|
117
|
+
},
|
|
118
|
+
children: /* @__PURE__ */jsx(Box, {
|
|
119
|
+
sx: {
|
|
120
|
+
flex: 1
|
|
121
|
+
},
|
|
122
|
+
children: /* @__PURE__ */jsx(Text, {
|
|
123
|
+
sx: {
|
|
124
|
+
fontSize: ["sm", "md"]
|
|
125
|
+
},
|
|
126
|
+
children: props.message
|
|
127
|
+
})
|
|
128
|
+
})
|
|
129
|
+
}), props.actions && props.actions.length > 0 && /* @__PURE__ */jsx(Box, {
|
|
130
|
+
sx: {
|
|
131
|
+
display: "flex",
|
|
132
|
+
flexDirection: "column",
|
|
133
|
+
gap: 2,
|
|
134
|
+
mt: 2
|
|
135
|
+
},
|
|
136
|
+
children: props.actions.map((action, index) => {
|
|
137
|
+
return action.action === "open_url" ? /* @__PURE__ */jsx(Link, {
|
|
138
|
+
href: action.url,
|
|
139
|
+
target: "_blank",
|
|
140
|
+
rel: "noopener noreferrer",
|
|
141
|
+
sx: {
|
|
142
|
+
color: "action.text.accent.default",
|
|
143
|
+
cursor: "pointer"
|
|
144
|
+
},
|
|
145
|
+
children: action.label || "Acessar"
|
|
146
|
+
}, index) : null;
|
|
147
|
+
})
|
|
148
|
+
}), props.caption && /* @__PURE__ */jsx(Box, {
|
|
149
|
+
sx: {
|
|
150
|
+
whiteSpace: "nowrap",
|
|
151
|
+
mt: 6
|
|
152
|
+
},
|
|
153
|
+
children: /* @__PURE__ */jsx(Text, {
|
|
154
|
+
sx: {
|
|
155
|
+
fontSize: "xs",
|
|
156
|
+
color: "text.secondary"
|
|
157
|
+
},
|
|
158
|
+
children: props.caption
|
|
159
|
+
})
|
|
160
|
+
}), !props.title && props.onClose && /* @__PURE__ */jsx(Box, {
|
|
161
|
+
sx: {
|
|
162
|
+
alignSelf: "flex-end"
|
|
163
|
+
},
|
|
164
|
+
children: /* @__PURE__ */jsx(CloseButton, {
|
|
165
|
+
onClick: props.onClose
|
|
166
|
+
})
|
|
167
|
+
})]
|
|
168
|
+
})]
|
|
169
|
+
});
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
//#endregion
|
|
173
|
+
export { NotificationCard };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/components/NotificationCard/NotificationCard.d.ts
|
|
5
|
+
type NotificationType = 'success' | 'error' | 'warning' | 'info' | 'neutral';
|
|
6
|
+
type NotificationAction = {
|
|
7
|
+
action?: 'open_url';
|
|
8
|
+
url?: string;
|
|
9
|
+
label?: string;
|
|
10
|
+
};
|
|
11
|
+
type NotificationCardProps = {
|
|
12
|
+
type: NotificationType;
|
|
13
|
+
title?: string | React.ReactNode;
|
|
14
|
+
message: string | React.ReactNode;
|
|
15
|
+
actions?: NotificationAction[];
|
|
16
|
+
caption?: string | React.ReactNode;
|
|
17
|
+
tags?: string[] | React.ReactNode;
|
|
18
|
+
onClose?: () => void;
|
|
19
|
+
};
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region src/components/NotificationsMenu/NotificationsMenu.d.ts
|
|
22
|
+
type Notification = NotificationCardProps & {
|
|
23
|
+
id: string;
|
|
24
|
+
group?: string;
|
|
25
|
+
};
|
|
26
|
+
type Props = {
|
|
27
|
+
notifications: Notification[];
|
|
28
|
+
defaultOpen?: boolean;
|
|
29
|
+
hasMore?: boolean;
|
|
30
|
+
count: number;
|
|
31
|
+
onLoadMore?: () => void;
|
|
32
|
+
onOpenChange?: (isOpen: boolean) => void;
|
|
33
|
+
onClose?: () => void;
|
|
34
|
+
onClearAll?: () => void;
|
|
35
|
+
};
|
|
36
|
+
declare const NotificationsMenu: ({
|
|
37
|
+
notifications,
|
|
38
|
+
defaultOpen,
|
|
39
|
+
hasMore,
|
|
40
|
+
onLoadMore,
|
|
41
|
+
onOpenChange,
|
|
42
|
+
count,
|
|
43
|
+
onClose,
|
|
44
|
+
onClearAll
|
|
45
|
+
}: Props) => import("react/jsx-runtime").JSX.Element;
|
|
46
|
+
//#endregion
|
|
47
|
+
export { Notification, NotificationsMenu };
|