@kopexa/sight 17.12.1 → 17.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-5LLYOCGQ.mjs +153 -0
- package/dist/chunk-6IAHC3UK.mjs +1 -0
- package/dist/chunk-6XUZNN3X.mjs +1 -0
- package/dist/chunk-7KISSD3Q.mjs +1 -0
- package/dist/chunk-BJ7QPNKW.mjs +242 -0
- package/dist/chunk-CZNF6WPR.mjs +33 -0
- package/dist/chunk-DU3OVIBY.mjs +16 -0
- package/dist/chunk-DWZQIPCX.mjs +301 -0
- package/dist/chunk-EAJ3DTJ3.mjs +59 -0
- package/dist/chunk-FBTSAODG.mjs +25 -0
- package/dist/chunk-G57FFIKP.mjs +48 -0
- package/dist/chunk-GR3VEF4M.mjs +1 -0
- package/dist/chunk-HISY6ZIK.mjs +1 -0
- package/dist/chunk-HUHVPC6T.mjs +17 -0
- package/dist/chunk-HVOS7SXF.mjs +15 -0
- package/dist/chunk-PKG2E3MX.mjs +1 -0
- package/dist/chunk-POVIOFVF.mjs +18 -0
- package/dist/chunk-RK7G2GYB.mjs +45 -0
- package/dist/chunk-SHETEVHO.mjs +178 -0
- package/dist/chunk-UWC3Z7SY.mjs +1 -0
- package/dist/chunk-UWQG4HGJ.mjs +13 -0
- package/dist/chunk-XL2RCXMY.mjs +26 -0
- package/dist/chunk-XPDEN2RV.mjs +1 -0
- package/dist/components/blankstate/blankstate.d.mts +14 -0
- package/dist/components/blankstate/blankstate.d.ts +14 -0
- package/dist/components/blankstate/blankstate.js +69 -0
- package/dist/components/blankstate/blankstate.mjs +7 -0
- package/dist/components/blankstate/index.d.mts +4 -0
- package/dist/components/blankstate/index.d.ts +4 -0
- package/dist/components/blankstate/index.js +71 -0
- package/dist/components/blankstate/index.mjs +8 -0
- package/dist/components/code/code.d.mts +9 -0
- package/dist/components/code/code.d.ts +9 -0
- package/dist/components/code/code.js +49 -0
- package/dist/components/code/code.mjs +7 -0
- package/dist/components/code/index.d.mts +4 -0
- package/dist/components/code/index.d.ts +4 -0
- package/dist/components/code/index.js +51 -0
- package/dist/components/code/index.mjs +8 -0
- package/dist/components/dialog/dialog.d.mts +44 -0
- package/dist/components/dialog/dialog.d.ts +44 -0
- package/dist/components/dialog/dialog.js +213 -0
- package/dist/components/dialog/dialog.mjs +31 -0
- package/dist/components/dialog/index.d.mts +22 -0
- package/dist/components/dialog/index.d.ts +22 -0
- package/dist/components/dialog/index.js +232 -0
- package/dist/components/dialog/index.mjs +35 -0
- package/dist/components/dialog/namespace.d.mts +5 -0
- package/dist/components/dialog/namespace.d.ts +5 -0
- package/dist/components/dialog/namespace.js +213 -0
- package/dist/components/dialog/namespace.mjs +29 -0
- package/dist/components/dialog/transition.d.mts +5 -0
- package/dist/components/dialog/transition.d.ts +5 -0
- package/dist/components/dialog/transition.js +132 -0
- package/dist/components/dialog/transition.mjs +106 -0
- package/dist/components/file-upload/avatar-upload.d.mts +54 -0
- package/dist/components/file-upload/avatar-upload.d.ts +54 -0
- package/dist/components/file-upload/avatar-upload.js +841 -0
- package/dist/components/file-upload/avatar-upload.mjs +15 -0
- package/dist/components/file-upload/index.d.mts +5 -0
- package/dist/components/file-upload/index.d.ts +5 -0
- package/dist/components/file-upload/index.js +843 -0
- package/dist/components/file-upload/index.mjs +16 -0
- package/dist/components/file-upload/messages.d.mts +39 -0
- package/dist/components/file-upload/messages.d.ts +39 -0
- package/dist/components/file-upload/messages.js +68 -0
- package/dist/components/file-upload/messages.mjs +7 -0
- package/dist/components/file-upload/utils/data-url-to-file.d.mts +3 -0
- package/dist/components/file-upload/utils/data-url-to-file.d.ts +3 -0
- package/dist/components/file-upload/utils/data-url-to-file.js +38 -0
- package/dist/components/file-upload/utils/data-url-to-file.mjs +7 -0
- package/dist/components/file-upload/utils/format-accept-types.d.mts +8 -0
- package/dist/components/file-upload/utils/format-accept-types.d.ts +8 -0
- package/dist/components/file-upload/utils/format-accept-types.js +82 -0
- package/dist/components/file-upload/utils/format-accept-types.mjs +7 -0
- package/dist/components/file-upload/utils/is-image-like.d.mts +3 -0
- package/dist/components/file-upload/utils/is-image-like.d.ts +3 -0
- package/dist/components/file-upload/utils/is-image-like.js +36 -0
- package/dist/components/file-upload/utils/is-image-like.mjs +7 -0
- package/dist/components/index.d.mts +67 -0
- package/dist/components/index.d.ts +67 -0
- package/dist/components/index.js +1137 -0
- package/dist/components/index.mjs +92 -0
- package/dist/components/skeleton/index.d.mts +5 -0
- package/dist/components/skeleton/index.d.ts +5 -0
- package/dist/components/skeleton/index.js +53 -0
- package/dist/components/skeleton/index.mjs +12 -0
- package/dist/components/skeleton/skeleton-avatar.d.mts +9 -0
- package/dist/components/skeleton/skeleton-avatar.d.ts +9 -0
- package/dist/components/skeleton/skeleton-avatar.js +51 -0
- package/dist/components/skeleton/skeleton-avatar.mjs +8 -0
- package/dist/components/skeleton/skeleton.d.mts +7 -0
- package/dist/components/skeleton/skeleton.d.ts +7 -0
- package/dist/components/skeleton/skeleton.js +39 -0
- package/dist/components/skeleton/skeleton.mjs +7 -0
- package/dist/components/stat/index.d.mts +4 -0
- package/dist/components/stat/index.d.ts +4 -0
- package/dist/components/stat/index.js +186 -0
- package/dist/components/stat/index.mjs +24 -0
- package/dist/components/stat/stat.d.mts +36 -0
- package/dist/components/stat/stat.d.ts +36 -0
- package/dist/components/stat/stat.js +185 -0
- package/dist/components/stat/stat.mjs +24 -0
- package/dist/components/textarea/index.d.mts +4 -0
- package/dist/components/textarea/index.d.ts +4 -0
- package/dist/components/textarea/index.js +42 -0
- package/dist/components/textarea/index.mjs +8 -0
- package/dist/components/textarea/textarea.d.mts +8 -0
- package/dist/components/textarea/textarea.d.ts +8 -0
- package/dist/components/textarea/textarea.js +40 -0
- package/dist/components/textarea/textarea.mjs +7 -0
- package/dist/hooks/index.d.mts +2 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.js +341 -0
- package/dist/hooks/index.mjs +9 -0
- package/dist/hooks/use-file-upload/index.d.mts +47 -0
- package/dist/hooks/use-file-upload/index.d.ts +47 -0
- package/dist/hooks/use-file-upload/index.js +340 -0
- package/dist/hooks/use-file-upload/index.mjs +9 -0
- package/dist/hooks/use-file-upload/messages.d.mts +19 -0
- package/dist/hooks/use-file-upload/messages.d.ts +19 -0
- package/dist/hooks/use-file-upload/messages.js +48 -0
- package/dist/hooks/use-file-upload/messages.mjs +7 -0
- package/dist/index.d.mts +14 -8
- package/dist/index.d.ts +14 -8
- package/dist/index.js +1108 -32
- package/dist/index.mjs +82 -18
- package/dist/index.ts.backup.d.mts +14 -8
- package/dist/index.ts.backup.d.ts +14 -8
- package/dist/index.ts.backup.js +1108 -32
- package/dist/index.ts.backup.mjs +82 -18
- package/package.json +60 -64
package/dist/index.js
CHANGED
|
@@ -30,7 +30,8 @@ __export(index_exports, {
|
|
|
30
30
|
AlertDialog: () => import_alert_dialog.AlertDialog,
|
|
31
31
|
AuditInfo: () => import_audit_info.AuditInfo,
|
|
32
32
|
Autocomplete: () => import_autocomplete.Autocomplete,
|
|
33
|
-
AvatarUpload: () =>
|
|
33
|
+
AvatarUpload: () => AvatarUpload,
|
|
34
|
+
Blankstate: () => Blankstate,
|
|
34
35
|
Breadcrumb: () => import_navigation.Breadcrumb,
|
|
35
36
|
BreadcrumbEllipsis: () => import_navigation.BreadcrumbEllipsis,
|
|
36
37
|
BreadcrumbItem: () => import_navigation.BreadcrumbItem,
|
|
@@ -48,14 +49,28 @@ __export(index_exports, {
|
|
|
48
49
|
CardTitle: () => import_card.CardTitle,
|
|
49
50
|
CardToolbar: () => import_card.CardToolbar,
|
|
50
51
|
Chip: () => import_chip.Chip,
|
|
52
|
+
Code: () => Code,
|
|
51
53
|
Combobox: () => import_combobox.Combobox,
|
|
52
54
|
ConfirmDialogProvider: () => import_alert_dialog.ConfirmDialogProvider,
|
|
53
55
|
Conversation: () => import_assistant.Conversation,
|
|
54
56
|
ConversationContent: () => import_assistant.ConversationContent,
|
|
55
57
|
ConversationEmptyState: () => import_assistant.ConversationEmptyState,
|
|
56
58
|
ConversationScrollButton: () => import_assistant.ConversationScrollButton,
|
|
57
|
-
Cropper: () =>
|
|
59
|
+
Cropper: () => import_image_crop2.Cropper,
|
|
58
60
|
DataGrid: () => import_data_grid.DataGrid,
|
|
61
|
+
Dialog: () => Dialog,
|
|
62
|
+
DialogBody: () => DialogBody,
|
|
63
|
+
DialogClose: () => DialogClose,
|
|
64
|
+
DialogCloseTrigger: () => DialogCloseTrigger,
|
|
65
|
+
DialogContent: () => DialogContent,
|
|
66
|
+
DialogDescription: () => DialogDescription,
|
|
67
|
+
DialogFooter: () => DialogFooter,
|
|
68
|
+
DialogHeader: () => DialogHeader,
|
|
69
|
+
DialogOverlay: () => DialogOverlay,
|
|
70
|
+
DialogPortal: () => DialogPortal,
|
|
71
|
+
DialogRoot: () => DialogRoot,
|
|
72
|
+
DialogTitle: () => DialogTitle,
|
|
73
|
+
DialogTrigger: () => DialogTrigger,
|
|
59
74
|
EditableText: () => import_editable_text.EditableText,
|
|
60
75
|
Filter: () => import_filter.Filter,
|
|
61
76
|
FilterActive: () => import_filter.FilterActive,
|
|
@@ -66,10 +81,10 @@ __export(index_exports, {
|
|
|
66
81
|
FilterMenuSeparator: () => import_filter.FilterMenuSeparator,
|
|
67
82
|
FilterTrigger: () => import_filter.FilterTrigger,
|
|
68
83
|
FilterValueEditor: () => import_filter.FilterValueEditor,
|
|
69
|
-
ImageCrop: () =>
|
|
70
|
-
ImageCropApply: () =>
|
|
71
|
-
ImageCropContent: () =>
|
|
72
|
-
ImageCropReset: () =>
|
|
84
|
+
ImageCrop: () => import_image_crop2.ImageCrop,
|
|
85
|
+
ImageCropApply: () => import_image_crop2.ImageCropApply,
|
|
86
|
+
ImageCropContent: () => import_image_crop2.ImageCropContent,
|
|
87
|
+
ImageCropReset: () => import_image_crop2.ImageCropReset,
|
|
73
88
|
IntegrationCard: () => import_integration_card.IntegrationCard,
|
|
74
89
|
Label: () => import_label.Label,
|
|
75
90
|
LoadingPage: () => import_loading.LoadingPage,
|
|
@@ -91,29 +106,33 @@ __export(index_exports, {
|
|
|
91
106
|
ScrollBar: () => import_scroll_area.ScrollBar,
|
|
92
107
|
SearchFilterBar: () => import_filter.SearchFilterBar,
|
|
93
108
|
Select: () => import_select.Select,
|
|
109
|
+
Skeleton: () => Skeleton,
|
|
110
|
+
SkeletonAvatar: () => SkeletonAvatar,
|
|
94
111
|
StandardChip: () => import_chip.StandardChip,
|
|
95
|
-
Stat: () =>
|
|
96
|
-
StatDownIndicator: () =>
|
|
97
|
-
StatGroup: () =>
|
|
98
|
-
StatHelpText: () =>
|
|
99
|
-
StatLabel: () =>
|
|
100
|
-
StatRoot: () =>
|
|
101
|
-
StatUpIndicator: () =>
|
|
102
|
-
StatValueText: () =>
|
|
103
|
-
StatValueUnit: () =>
|
|
112
|
+
Stat: () => Stat,
|
|
113
|
+
StatDownIndicator: () => StatDownIndicator,
|
|
114
|
+
StatGroup: () => StatGroup,
|
|
115
|
+
StatHelpText: () => StatHelpText,
|
|
116
|
+
StatLabel: () => StatLabel,
|
|
117
|
+
StatRoot: () => StatRoot,
|
|
118
|
+
StatUpIndicator: () => StatUpIndicator,
|
|
119
|
+
StatValueText: () => StatValueText,
|
|
120
|
+
StatValueUnit: () => StatValueUnit,
|
|
104
121
|
Switch: () => import_switch.Switch,
|
|
105
122
|
Tabs: () => import_tabs.Tabs,
|
|
106
|
-
Textarea: () =>
|
|
123
|
+
Textarea: () => Textarea,
|
|
107
124
|
ToggleRow: () => import_toggle_row.ToggleRow,
|
|
108
125
|
Toolbar: () => import_toolbar.Toolbar,
|
|
109
126
|
ToolbarButton: () => import_toolbar.ToolbarButton,
|
|
110
127
|
ToolbarGroup: () => import_toolbar.ToolbarGroup,
|
|
111
128
|
ToolbarSeparator: () => import_toolbar.ToolbarSeparator,
|
|
112
129
|
auditInfoMessages: () => import_audit_info.auditInfoMessages,
|
|
113
|
-
cn: () =>
|
|
130
|
+
cn: () => import_shared_utils8.cn,
|
|
114
131
|
filterBarMessages: () => import_filter.filterBarMessages,
|
|
115
132
|
filterMessages: () => import_filter.filterMessages,
|
|
116
133
|
useConfirm: () => import_alert_dialog.useConfirm,
|
|
134
|
+
useDialogContext: () => useDialogContext,
|
|
135
|
+
useFileUpload: () => useFileUpload,
|
|
117
136
|
useFilterContext: () => import_filter.useFilterContext
|
|
118
137
|
});
|
|
119
138
|
module.exports = __toCommonJS(index_exports);
|
|
@@ -123,29 +142,24 @@ var import_assistant = require("@kopexa/assistant");
|
|
|
123
142
|
var import_audit_info = require("@kopexa/audit-info");
|
|
124
143
|
var import_autocomplete = require("@kopexa/autocomplete");
|
|
125
144
|
__reExport(index_exports, require("@kopexa/avatar"), module.exports);
|
|
126
|
-
__reExport(index_exports, require("@kopexa/blankstate"), module.exports);
|
|
127
145
|
__reExport(index_exports, require("@kopexa/button"), module.exports);
|
|
128
146
|
__reExport(index_exports, require("@kopexa/calendar"), module.exports);
|
|
129
147
|
__reExport(index_exports, require("@kopexa/callout"), module.exports);
|
|
130
148
|
var import_card = require("@kopexa/card");
|
|
131
149
|
__reExport(index_exports, require("@kopexa/checkbox"), module.exports);
|
|
132
150
|
var import_chip = require("@kopexa/chip");
|
|
133
|
-
__reExport(index_exports, require("@kopexa/code"), module.exports);
|
|
134
151
|
__reExport(index_exports, require("@kopexa/color-picker"), module.exports);
|
|
135
152
|
var import_combobox = require("@kopexa/combobox");
|
|
136
153
|
__reExport(index_exports, require("@kopexa/command"), module.exports);
|
|
137
154
|
var import_data_grid = require("@kopexa/data-grid");
|
|
138
|
-
__reExport(index_exports, require("@kopexa/data-table"), module.exports);
|
|
139
155
|
__reExport(index_exports, require("@kopexa/date-picker"), module.exports);
|
|
140
|
-
__reExport(index_exports, require("@kopexa/dialog"), module.exports);
|
|
141
156
|
__reExport(index_exports, require("@kopexa/drawer"), module.exports);
|
|
142
157
|
__reExport(index_exports, require("@kopexa/dropdown-menu"), module.exports);
|
|
143
158
|
var import_editable_text = require("@kopexa/editable-text");
|
|
144
|
-
var import_file_upload = require("@kopexa/file-upload");
|
|
145
159
|
var import_filter = require("@kopexa/filter");
|
|
146
160
|
__reExport(index_exports, require("@kopexa/heading"), module.exports);
|
|
147
161
|
__reExport(index_exports, require("@kopexa/hover-card"), module.exports);
|
|
148
|
-
var
|
|
162
|
+
var import_image_crop2 = require("@kopexa/image-crop");
|
|
149
163
|
__reExport(index_exports, require("@kopexa/infotip"), module.exports);
|
|
150
164
|
__reExport(index_exports, require("@kopexa/input"), module.exports);
|
|
151
165
|
var import_integration_card = require("@kopexa/integration-card");
|
|
@@ -164,20 +178,1068 @@ var import_scroll_area = require("@kopexa/scroll-area");
|
|
|
164
178
|
__reExport(index_exports, require("@kopexa/section-row"), module.exports);
|
|
165
179
|
var import_select = require("@kopexa/select");
|
|
166
180
|
__reExport(index_exports, require("@kopexa/separator"), module.exports);
|
|
167
|
-
var
|
|
181
|
+
var import_shared_utils8 = require("@kopexa/shared-utils");
|
|
168
182
|
__reExport(index_exports, require("@kopexa/sidebar"), module.exports);
|
|
169
|
-
__reExport(index_exports, require("@kopexa/skeleton"), module.exports);
|
|
170
183
|
__reExport(index_exports, require("@kopexa/spinner"), module.exports);
|
|
171
184
|
__reExport(index_exports, require("@kopexa/split-page-layout"), module.exports);
|
|
172
|
-
var import_stat = require("@kopexa/stat");
|
|
173
185
|
var import_switch = require("@kopexa/switch");
|
|
174
186
|
__reExport(index_exports, require("@kopexa/tab-nav"), module.exports);
|
|
175
187
|
__reExport(index_exports, require("@kopexa/table"), module.exports);
|
|
176
188
|
var import_tabs = require("@kopexa/tabs");
|
|
177
|
-
var import_textarea = require("@kopexa/textarea");
|
|
178
189
|
var import_toggle_row = require("@kopexa/toggle-row");
|
|
179
190
|
var import_toolbar = require("@kopexa/toolbar");
|
|
180
191
|
__reExport(index_exports, require("@kopexa/tooltip"), module.exports);
|
|
192
|
+
|
|
193
|
+
// src/components/blankstate/blankstate.tsx
|
|
194
|
+
var import_shared_utils = require("@kopexa/shared-utils");
|
|
195
|
+
var import_theme = require("@kopexa/theme");
|
|
196
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
197
|
+
var Blankstate = (props) => {
|
|
198
|
+
const {
|
|
199
|
+
className,
|
|
200
|
+
children,
|
|
201
|
+
classNames,
|
|
202
|
+
icon,
|
|
203
|
+
title,
|
|
204
|
+
description,
|
|
205
|
+
size,
|
|
206
|
+
bordered,
|
|
207
|
+
narrow,
|
|
208
|
+
...rest
|
|
209
|
+
} = props;
|
|
210
|
+
const styles = (0, import_theme.blankstate)({ size, bordered, narrow });
|
|
211
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
212
|
+
"div",
|
|
213
|
+
{
|
|
214
|
+
className: styles.root({ className: (0, import_shared_utils.cn)(classNames == null ? void 0 : classNames.root, className) }),
|
|
215
|
+
...rest,
|
|
216
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: styles.container({ className: classNames == null ? void 0 : classNames.container }), children: [
|
|
217
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: styles.icon({ className: classNames == null ? void 0 : classNames.icon }), children: icon }),
|
|
218
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { className: styles.title({ className: classNames == null ? void 0 : classNames.title }), children: title }),
|
|
219
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
220
|
+
"div",
|
|
221
|
+
{
|
|
222
|
+
className: styles.description({
|
|
223
|
+
className: classNames == null ? void 0 : classNames.description
|
|
224
|
+
}),
|
|
225
|
+
children: description
|
|
226
|
+
}
|
|
227
|
+
),
|
|
228
|
+
children && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: styles.actions({ className: classNames == null ? void 0 : classNames.actions }), children })
|
|
229
|
+
] })
|
|
230
|
+
}
|
|
231
|
+
);
|
|
232
|
+
};
|
|
233
|
+
|
|
234
|
+
// src/components/code/code.tsx
|
|
235
|
+
var import_shared_utils2 = require("@kopexa/shared-utils");
|
|
236
|
+
var import_theme2 = require("@kopexa/theme");
|
|
237
|
+
var import_react = require("react");
|
|
238
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
239
|
+
var Code = (originalProps) => {
|
|
240
|
+
const [props, variantProps] = (0, import_shared_utils2.mapPropsVariants)(
|
|
241
|
+
originalProps,
|
|
242
|
+
import_theme2.code.variantKeys
|
|
243
|
+
);
|
|
244
|
+
const { children, className, ...otherProps } = props;
|
|
245
|
+
const styles = (0, import_react.useMemo)(
|
|
246
|
+
() => (0, import_theme2.code)({
|
|
247
|
+
...variantProps,
|
|
248
|
+
className
|
|
249
|
+
}),
|
|
250
|
+
[(0, import_shared_utils2.objectToDeps)(variantProps), className]
|
|
251
|
+
);
|
|
252
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("code", { className: styles, ...otherProps, children });
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
// src/components/dialog/dialog.tsx
|
|
256
|
+
var import_dialog = require("@base-ui/react/dialog");
|
|
257
|
+
var import_icons = require("@kopexa/icons");
|
|
258
|
+
var import_react_utils = require("@kopexa/react-utils");
|
|
259
|
+
var import_shared_utils3 = require("@kopexa/shared-utils");
|
|
260
|
+
var import_theme3 = require("@kopexa/theme");
|
|
261
|
+
var import_use_controllable_state = require("@kopexa/use-controllable-state");
|
|
262
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
263
|
+
var [DialogProvider, useDialogContext] = (0, import_react_utils.createContext)();
|
|
264
|
+
var DialogRoot = (props) => {
|
|
265
|
+
const {
|
|
266
|
+
open: openProp,
|
|
267
|
+
onOpenChange,
|
|
268
|
+
size,
|
|
269
|
+
radius,
|
|
270
|
+
placement,
|
|
271
|
+
scrollBehavior,
|
|
272
|
+
...restProps
|
|
273
|
+
} = props;
|
|
274
|
+
const [open, setOpen] = (0, import_use_controllable_state.useControllableState)({
|
|
275
|
+
value: openProp,
|
|
276
|
+
onChange: onOpenChange,
|
|
277
|
+
defaultValue: false
|
|
278
|
+
});
|
|
279
|
+
const styles = (0, import_theme3.dialog)({ size, radius, placement, scrollBehavior });
|
|
280
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(DialogProvider, { value: { styles, open, placement, size, radius }, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
281
|
+
import_dialog.Dialog.Root,
|
|
282
|
+
{
|
|
283
|
+
"data-slot": "dialog",
|
|
284
|
+
open,
|
|
285
|
+
onOpenChange: (open2) => setOpen(open2),
|
|
286
|
+
...restProps
|
|
287
|
+
}
|
|
288
|
+
) });
|
|
289
|
+
};
|
|
290
|
+
function DialogTrigger({ ...props }) {
|
|
291
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_dialog.Dialog.Trigger, { "data-slot": "dialog-trigger", ...props });
|
|
292
|
+
}
|
|
293
|
+
function DialogPortal({ ...props }) {
|
|
294
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_dialog.Dialog.Portal, { "data-slot": "dialog-portal", ...props });
|
|
295
|
+
}
|
|
296
|
+
function DialogClose({ ...props }) {
|
|
297
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_dialog.Dialog.Close, { "data-slot": "dialog-close", ...props });
|
|
298
|
+
}
|
|
299
|
+
function DialogOverlay({ className, ...props }) {
|
|
300
|
+
const { styles } = useDialogContext();
|
|
301
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
302
|
+
import_dialog.Dialog.Backdrop,
|
|
303
|
+
{
|
|
304
|
+
"data-slot": "dialog-overlay",
|
|
305
|
+
className: (0, import_shared_utils3.cn)(styles.overlay(), className),
|
|
306
|
+
...props
|
|
307
|
+
}
|
|
308
|
+
);
|
|
309
|
+
}
|
|
310
|
+
function DialogContent({
|
|
311
|
+
className,
|
|
312
|
+
children,
|
|
313
|
+
showCloseButton = true,
|
|
314
|
+
...props
|
|
315
|
+
}) {
|
|
316
|
+
const { styles } = useDialogContext();
|
|
317
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(DialogPortal, { "data-slot": "dialog-portal", children: [
|
|
318
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(DialogOverlay, {}),
|
|
319
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
320
|
+
import_dialog.Dialog.Popup,
|
|
321
|
+
{
|
|
322
|
+
"data-slot": "dialog-content",
|
|
323
|
+
className: (0, import_shared_utils3.cn)(styles.content(), className),
|
|
324
|
+
...props,
|
|
325
|
+
children: [
|
|
326
|
+
children,
|
|
327
|
+
showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
328
|
+
import_dialog.Dialog.Close,
|
|
329
|
+
{
|
|
330
|
+
"data-slot": "dialog-close",
|
|
331
|
+
className: styles.close(),
|
|
332
|
+
children: [
|
|
333
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_icons.CloseIcon, {}),
|
|
334
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "sr-only", children: "Close" })
|
|
335
|
+
]
|
|
336
|
+
}
|
|
337
|
+
)
|
|
338
|
+
]
|
|
339
|
+
}
|
|
340
|
+
)
|
|
341
|
+
] });
|
|
342
|
+
}
|
|
343
|
+
function DialogHeader({ className, ...props }) {
|
|
344
|
+
const { styles } = useDialogContext();
|
|
345
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
346
|
+
"div",
|
|
347
|
+
{
|
|
348
|
+
"data-slot": "dialog-header",
|
|
349
|
+
className: styles.header({ className }),
|
|
350
|
+
...props
|
|
351
|
+
}
|
|
352
|
+
);
|
|
353
|
+
}
|
|
354
|
+
function DialogFooter({ className, ...props }) {
|
|
355
|
+
const { styles } = useDialogContext();
|
|
356
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
357
|
+
"div",
|
|
358
|
+
{
|
|
359
|
+
"data-slot": "dialog-footer",
|
|
360
|
+
className: styles.footer({ className }),
|
|
361
|
+
...props
|
|
362
|
+
}
|
|
363
|
+
);
|
|
364
|
+
}
|
|
365
|
+
function DialogBody({ className, ...props }) {
|
|
366
|
+
const { styles } = useDialogContext();
|
|
367
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
368
|
+
"div",
|
|
369
|
+
{
|
|
370
|
+
"data-slot": "dialog-body",
|
|
371
|
+
className: styles.body({ className }),
|
|
372
|
+
...props
|
|
373
|
+
}
|
|
374
|
+
);
|
|
375
|
+
}
|
|
376
|
+
function DialogTitle({ className, ...props }) {
|
|
377
|
+
const { styles } = useDialogContext();
|
|
378
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
379
|
+
import_dialog.Dialog.Title,
|
|
380
|
+
{
|
|
381
|
+
"data-slot": "dialog-title",
|
|
382
|
+
className: (0, import_shared_utils3.cn)(styles.title(), className),
|
|
383
|
+
...props
|
|
384
|
+
}
|
|
385
|
+
);
|
|
386
|
+
}
|
|
387
|
+
function DialogDescription({
|
|
388
|
+
className,
|
|
389
|
+
...props
|
|
390
|
+
}) {
|
|
391
|
+
const { styles } = useDialogContext();
|
|
392
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
393
|
+
import_dialog.Dialog.Description,
|
|
394
|
+
{
|
|
395
|
+
"data-slot": "dialog-description",
|
|
396
|
+
className: (0, import_shared_utils3.cn)(styles.description(), className),
|
|
397
|
+
...props
|
|
398
|
+
}
|
|
399
|
+
);
|
|
400
|
+
}
|
|
401
|
+
function DialogCloseTrigger({
|
|
402
|
+
className,
|
|
403
|
+
...props
|
|
404
|
+
}) {
|
|
405
|
+
const { styles } = useDialogContext();
|
|
406
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
407
|
+
import_dialog.Dialog.Close,
|
|
408
|
+
{
|
|
409
|
+
"data-slot": "dialog-close-trigger",
|
|
410
|
+
className: (0, import_shared_utils3.cn)(styles.closeTrigger(), className),
|
|
411
|
+
...props
|
|
412
|
+
}
|
|
413
|
+
);
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
// src/components/dialog/index.ts
|
|
417
|
+
var Dialog = Object.assign(DialogRoot, {
|
|
418
|
+
Root: DialogRoot,
|
|
419
|
+
Body: DialogBody,
|
|
420
|
+
CloseTrigger: DialogCloseTrigger,
|
|
421
|
+
Content: DialogContent,
|
|
422
|
+
Description: DialogDescription,
|
|
423
|
+
Footer: DialogFooter,
|
|
424
|
+
Header: DialogHeader,
|
|
425
|
+
Overlay: DialogOverlay,
|
|
426
|
+
Portal: DialogPortal,
|
|
427
|
+
Title: DialogTitle,
|
|
428
|
+
Trigger: DialogTrigger
|
|
429
|
+
});
|
|
430
|
+
|
|
431
|
+
// src/components/file-upload/avatar-upload.tsx
|
|
432
|
+
var import_button = require("@kopexa/button");
|
|
433
|
+
var import_callout = require("@kopexa/callout");
|
|
434
|
+
var import_i18n4 = require("@kopexa/i18n");
|
|
435
|
+
var import_icons2 = require("@kopexa/icons");
|
|
436
|
+
var import_image_crop = require("@kopexa/image-crop");
|
|
437
|
+
var import_shared_utils5 = require("@kopexa/shared-utils");
|
|
438
|
+
var import_theme4 = require("@kopexa/theme");
|
|
439
|
+
var import_react3 = require("react");
|
|
440
|
+
|
|
441
|
+
// src/hooks/use-file-upload/index.ts
|
|
442
|
+
var import_i18n2 = require("@kopexa/i18n");
|
|
443
|
+
var import_shared_utils4 = require("@kopexa/shared-utils");
|
|
444
|
+
var import_react2 = require("react");
|
|
445
|
+
|
|
446
|
+
// src/hooks/use-file-upload/messages.ts
|
|
447
|
+
var import_i18n = require("@kopexa/i18n");
|
|
448
|
+
var messages = (0, import_i18n.defineMessages)({
|
|
449
|
+
file_exceeds_max: {
|
|
450
|
+
id: "use_file_upload.file_exceeds_max",
|
|
451
|
+
defaultMessage: `File "{name}" exceeds the maximum size of {max}.`,
|
|
452
|
+
description: "Shown when a single file is larger than allowed"
|
|
453
|
+
},
|
|
454
|
+
file_not_accepted: {
|
|
455
|
+
id: "use_file_upload.file_not_accepted",
|
|
456
|
+
defaultMessage: `File "{name}" is not an accepted file type.`,
|
|
457
|
+
description: "Shown when file type/extension doesn't match accept"
|
|
458
|
+
},
|
|
459
|
+
too_many_files: {
|
|
460
|
+
id: "file_upload.too_many_files",
|
|
461
|
+
defaultMessage: "You can only upload a maximum of {max} files.",
|
|
462
|
+
description: "Shown when maxFiles would be exceeded"
|
|
463
|
+
}
|
|
464
|
+
});
|
|
465
|
+
|
|
466
|
+
// src/hooks/use-file-upload/index.ts
|
|
467
|
+
var useFileUpload = (options = {}) => {
|
|
468
|
+
const {
|
|
469
|
+
maxFiles = Number.POSITIVE_INFINITY,
|
|
470
|
+
maxSize = Number.POSITIVE_INFINITY,
|
|
471
|
+
accept = "*",
|
|
472
|
+
multiple = false,
|
|
473
|
+
initialFiles = [],
|
|
474
|
+
onFilesChange,
|
|
475
|
+
onFilesAdded,
|
|
476
|
+
onError
|
|
477
|
+
} = options;
|
|
478
|
+
const t = (0, import_i18n2.useSafeIntl)();
|
|
479
|
+
const [state, setState] = (0, import_react2.useState)({
|
|
480
|
+
files: initialFiles.map((file) => ({
|
|
481
|
+
file,
|
|
482
|
+
id: file.id,
|
|
483
|
+
preview: file.url
|
|
484
|
+
})),
|
|
485
|
+
isDragging: false,
|
|
486
|
+
errors: []
|
|
487
|
+
});
|
|
488
|
+
const inputRef = (0, import_react2.useRef)(null);
|
|
489
|
+
const validateFile = (0, import_react2.useCallback)(
|
|
490
|
+
(file) => {
|
|
491
|
+
if (file instanceof File) {
|
|
492
|
+
if (file.size > maxSize) {
|
|
493
|
+
return t.formatMessage(messages.file_exceeds_max, {
|
|
494
|
+
name: file.name,
|
|
495
|
+
max: (0, import_shared_utils4.formatBytes)(maxSize)
|
|
496
|
+
});
|
|
497
|
+
}
|
|
498
|
+
} else {
|
|
499
|
+
if (file.size > maxSize) {
|
|
500
|
+
return t.formatMessage(messages.file_exceeds_max, {
|
|
501
|
+
name: file.name,
|
|
502
|
+
max: (0, import_shared_utils4.formatBytes)(maxSize)
|
|
503
|
+
});
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
if (accept !== "*") {
|
|
507
|
+
const acceptedTypes = accept.split(",").map((type) => type.trim());
|
|
508
|
+
const fileType = file instanceof File ? file.type || "" : file.type;
|
|
509
|
+
const fileExtension = `.${file instanceof File ? file.name.split(".").pop() : file.name.split(".").pop()}`;
|
|
510
|
+
const isAccepted = acceptedTypes.some((type) => {
|
|
511
|
+
if (type.startsWith(".")) {
|
|
512
|
+
return fileExtension.toLowerCase() === type.toLowerCase();
|
|
513
|
+
}
|
|
514
|
+
if (type.endsWith("/*")) {
|
|
515
|
+
const baseType = type.split("/")[0];
|
|
516
|
+
return fileType.startsWith(`${baseType}/`);
|
|
517
|
+
}
|
|
518
|
+
return fileType === type;
|
|
519
|
+
});
|
|
520
|
+
if (!isAccepted) {
|
|
521
|
+
return t.formatMessage(messages.file_not_accepted, {
|
|
522
|
+
name: file instanceof File ? file.name : file.name
|
|
523
|
+
});
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
return null;
|
|
527
|
+
},
|
|
528
|
+
[accept, maxSize, t.formatMessage]
|
|
529
|
+
);
|
|
530
|
+
const createPreview = (0, import_react2.useCallback)(
|
|
531
|
+
(file) => {
|
|
532
|
+
if (file instanceof File) {
|
|
533
|
+
return URL.createObjectURL(file);
|
|
534
|
+
}
|
|
535
|
+
return file.url;
|
|
536
|
+
},
|
|
537
|
+
[]
|
|
538
|
+
);
|
|
539
|
+
const generateUniqueId = (0, import_react2.useCallback)((file) => {
|
|
540
|
+
if (file instanceof File) {
|
|
541
|
+
return `${file.name}-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`;
|
|
542
|
+
}
|
|
543
|
+
return file.id;
|
|
544
|
+
}, []);
|
|
545
|
+
const clearFiles = (0, import_react2.useCallback)(() => {
|
|
546
|
+
setState((prev) => {
|
|
547
|
+
for (const file of prev.files) {
|
|
548
|
+
if (file.preview && file.file instanceof File && file.file.type.startsWith("image/")) {
|
|
549
|
+
URL.revokeObjectURL(file.preview);
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
if (inputRef.current) {
|
|
553
|
+
inputRef.current.value = "";
|
|
554
|
+
}
|
|
555
|
+
const newState = {
|
|
556
|
+
...prev,
|
|
557
|
+
files: [],
|
|
558
|
+
errors: []
|
|
559
|
+
};
|
|
560
|
+
onFilesChange == null ? void 0 : onFilesChange(newState.files);
|
|
561
|
+
return newState;
|
|
562
|
+
});
|
|
563
|
+
}, [onFilesChange]);
|
|
564
|
+
const addFiles = (0, import_react2.useCallback)(
|
|
565
|
+
(newFiles) => {
|
|
566
|
+
if (!newFiles || newFiles.length === 0) return;
|
|
567
|
+
const newFilesArray = Array.from(newFiles);
|
|
568
|
+
const errors = [];
|
|
569
|
+
setState((prev) => ({ ...prev, errors: [] }));
|
|
570
|
+
if (!multiple) {
|
|
571
|
+
clearFiles();
|
|
572
|
+
}
|
|
573
|
+
if (multiple && maxFiles !== Number.POSITIVE_INFINITY && state.files.length + newFilesArray.length > maxFiles) {
|
|
574
|
+
errors.push(
|
|
575
|
+
t.formatMessage(messages.too_many_files, {
|
|
576
|
+
max: maxFiles
|
|
577
|
+
})
|
|
578
|
+
);
|
|
579
|
+
onError == null ? void 0 : onError(errors);
|
|
580
|
+
setState((prev) => ({ ...prev, errors }));
|
|
581
|
+
return;
|
|
582
|
+
}
|
|
583
|
+
const validFiles = [];
|
|
584
|
+
for (const file of newFilesArray) {
|
|
585
|
+
if (multiple) {
|
|
586
|
+
const isDuplicate = state.files.some(
|
|
587
|
+
(existingFile) => existingFile.file.name === file.name && existingFile.file.size === file.size
|
|
588
|
+
);
|
|
589
|
+
if (isDuplicate) {
|
|
590
|
+
return;
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
if (file.size > maxSize) {
|
|
594
|
+
errors.push(
|
|
595
|
+
multiple ? `Some files exceed the maximum size of ${(0, import_shared_utils4.formatBytes)(maxSize)}.` : `File exceeds the maximum size of ${(0, import_shared_utils4.formatBytes)(maxSize)}.`
|
|
596
|
+
);
|
|
597
|
+
continue;
|
|
598
|
+
}
|
|
599
|
+
const error = validateFile(file);
|
|
600
|
+
if (error) {
|
|
601
|
+
errors.push(error);
|
|
602
|
+
} else {
|
|
603
|
+
validFiles.push({
|
|
604
|
+
file,
|
|
605
|
+
id: generateUniqueId(file),
|
|
606
|
+
preview: createPreview(file)
|
|
607
|
+
});
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
if (validFiles.length > 0) {
|
|
611
|
+
onFilesAdded == null ? void 0 : onFilesAdded(validFiles);
|
|
612
|
+
setState((prev) => {
|
|
613
|
+
const newFiles2 = !multiple ? validFiles : [...prev.files, ...validFiles];
|
|
614
|
+
onFilesChange == null ? void 0 : onFilesChange(newFiles2);
|
|
615
|
+
return {
|
|
616
|
+
...prev,
|
|
617
|
+
files: newFiles2,
|
|
618
|
+
errors
|
|
619
|
+
};
|
|
620
|
+
});
|
|
621
|
+
} else if (errors.length > 0) {
|
|
622
|
+
onError == null ? void 0 : onError(errors);
|
|
623
|
+
setState((prev) => ({
|
|
624
|
+
...prev,
|
|
625
|
+
errors
|
|
626
|
+
}));
|
|
627
|
+
}
|
|
628
|
+
if (inputRef.current) {
|
|
629
|
+
inputRef.current.value = "";
|
|
630
|
+
}
|
|
631
|
+
},
|
|
632
|
+
[
|
|
633
|
+
onError,
|
|
634
|
+
state.files,
|
|
635
|
+
maxFiles,
|
|
636
|
+
multiple,
|
|
637
|
+
maxSize,
|
|
638
|
+
validateFile,
|
|
639
|
+
createPreview,
|
|
640
|
+
generateUniqueId,
|
|
641
|
+
clearFiles,
|
|
642
|
+
onFilesChange,
|
|
643
|
+
onFilesAdded,
|
|
644
|
+
t.formatMessage
|
|
645
|
+
]
|
|
646
|
+
);
|
|
647
|
+
const removeFile = (0, import_react2.useCallback)(
|
|
648
|
+
(id) => {
|
|
649
|
+
setState((prev) => {
|
|
650
|
+
const fileToRemove = prev.files.find((file) => file.id === id);
|
|
651
|
+
if ((fileToRemove == null ? void 0 : fileToRemove.preview) && fileToRemove.file instanceof File && fileToRemove.file.type.startsWith("image/")) {
|
|
652
|
+
URL.revokeObjectURL(fileToRemove.preview);
|
|
653
|
+
}
|
|
654
|
+
const newFiles = prev.files.filter((file) => file.id !== id);
|
|
655
|
+
onFilesChange == null ? void 0 : onFilesChange(newFiles);
|
|
656
|
+
return {
|
|
657
|
+
...prev,
|
|
658
|
+
files: newFiles,
|
|
659
|
+
errors: []
|
|
660
|
+
};
|
|
661
|
+
});
|
|
662
|
+
},
|
|
663
|
+
[onFilesChange]
|
|
664
|
+
);
|
|
665
|
+
const clearErrors = (0, import_react2.useCallback)(() => {
|
|
666
|
+
setState((prev) => ({
|
|
667
|
+
...prev,
|
|
668
|
+
errors: []
|
|
669
|
+
}));
|
|
670
|
+
}, []);
|
|
671
|
+
const handleDragEnter = (0, import_react2.useCallback)((e) => {
|
|
672
|
+
e.preventDefault();
|
|
673
|
+
e.stopPropagation();
|
|
674
|
+
setState((prev) => ({ ...prev, isDragging: true }));
|
|
675
|
+
}, []);
|
|
676
|
+
const handleDragLeave = (0, import_react2.useCallback)((e) => {
|
|
677
|
+
e.preventDefault();
|
|
678
|
+
e.stopPropagation();
|
|
679
|
+
if (e.currentTarget.contains(e.relatedTarget)) {
|
|
680
|
+
return;
|
|
681
|
+
}
|
|
682
|
+
setState((prev) => ({ ...prev, isDragging: false }));
|
|
683
|
+
}, []);
|
|
684
|
+
const handleDragOver = (0, import_react2.useCallback)((e) => {
|
|
685
|
+
e.preventDefault();
|
|
686
|
+
e.stopPropagation();
|
|
687
|
+
}, []);
|
|
688
|
+
const handleDrop = (0, import_react2.useCallback)(
|
|
689
|
+
(e) => {
|
|
690
|
+
var _a;
|
|
691
|
+
e.preventDefault();
|
|
692
|
+
e.stopPropagation();
|
|
693
|
+
setState((prev) => ({ ...prev, isDragging: false }));
|
|
694
|
+
if ((_a = inputRef.current) == null ? void 0 : _a.disabled) {
|
|
695
|
+
return;
|
|
696
|
+
}
|
|
697
|
+
if (e.dataTransfer.files && e.dataTransfer.files.length > 0) {
|
|
698
|
+
if (!multiple) {
|
|
699
|
+
const file = e.dataTransfer.files[0];
|
|
700
|
+
addFiles([file]);
|
|
701
|
+
} else {
|
|
702
|
+
addFiles(e.dataTransfer.files);
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
},
|
|
706
|
+
[addFiles, multiple]
|
|
707
|
+
);
|
|
708
|
+
const handleFileChange = (0, import_react2.useCallback)(
|
|
709
|
+
(e) => {
|
|
710
|
+
if (e.target.files && e.target.files.length > 0) {
|
|
711
|
+
addFiles(e.target.files);
|
|
712
|
+
}
|
|
713
|
+
},
|
|
714
|
+
[addFiles]
|
|
715
|
+
);
|
|
716
|
+
const openFileDialog = (0, import_react2.useCallback)(() => {
|
|
717
|
+
if (inputRef.current) {
|
|
718
|
+
inputRef.current.click();
|
|
719
|
+
}
|
|
720
|
+
}, []);
|
|
721
|
+
const getInputProps = (0, import_react2.useCallback)(
|
|
722
|
+
(props = {}) => {
|
|
723
|
+
return {
|
|
724
|
+
...props,
|
|
725
|
+
type: "file",
|
|
726
|
+
onChange: handleFileChange,
|
|
727
|
+
accept: props.accept || accept,
|
|
728
|
+
multiple: props.multiple !== void 0 ? props.multiple : multiple,
|
|
729
|
+
ref: inputRef
|
|
730
|
+
};
|
|
731
|
+
},
|
|
732
|
+
[accept, multiple, handleFileChange]
|
|
733
|
+
);
|
|
734
|
+
return [
|
|
735
|
+
state,
|
|
736
|
+
{
|
|
737
|
+
addFiles,
|
|
738
|
+
removeFile,
|
|
739
|
+
clearFiles,
|
|
740
|
+
clearErrors,
|
|
741
|
+
handleDragEnter,
|
|
742
|
+
handleDragLeave,
|
|
743
|
+
handleDragOver,
|
|
744
|
+
handleDrop,
|
|
745
|
+
handleFileChange,
|
|
746
|
+
openFileDialog,
|
|
747
|
+
getInputProps
|
|
748
|
+
}
|
|
749
|
+
];
|
|
750
|
+
};
|
|
751
|
+
|
|
752
|
+
// src/components/file-upload/messages.ts
|
|
753
|
+
var import_i18n3 = require("@kopexa/i18n");
|
|
754
|
+
var messages2 = (0, import_i18n3.defineMessages)({
|
|
755
|
+
change_avatar: {
|
|
756
|
+
id: "file_upload.change_avatar",
|
|
757
|
+
defaultMessage: "Change Avatar",
|
|
758
|
+
description: "Label for changing the avatar image"
|
|
759
|
+
},
|
|
760
|
+
upload_avatar: {
|
|
761
|
+
id: "file_upload.upload_avatar",
|
|
762
|
+
defaultMessage: "Upload Avatar",
|
|
763
|
+
description: "Label for uploading a new avatar image"
|
|
764
|
+
},
|
|
765
|
+
remove_avatar: {
|
|
766
|
+
id: "file_upload.remove_avatar",
|
|
767
|
+
defaultMessage: "Remove Avatar",
|
|
768
|
+
description: "Label for removing the current avatar image"
|
|
769
|
+
},
|
|
770
|
+
avatar_uploaded: {
|
|
771
|
+
id: "file_upload.avatar_uploaded",
|
|
772
|
+
defaultMessage: "Avatar uploaded",
|
|
773
|
+
description: "Message displayed when the avatar is uploaded successfully"
|
|
774
|
+
},
|
|
775
|
+
accepted_file_types: {
|
|
776
|
+
id: "file_upload.accepted_file_types",
|
|
777
|
+
defaultMessage: "{types}{size, select, none {} other { up to {size}}}",
|
|
778
|
+
description: "Message indicating the accepted file types for upload"
|
|
779
|
+
},
|
|
780
|
+
cancel: {
|
|
781
|
+
id: "file_upload.cancel",
|
|
782
|
+
defaultMessage: "Cancel",
|
|
783
|
+
description: "Label for canceling the file upload"
|
|
784
|
+
},
|
|
785
|
+
apply_crop: {
|
|
786
|
+
id: "file_upload.apply_crop",
|
|
787
|
+
defaultMessage: "Apply",
|
|
788
|
+
description: "Label for applying the crop to the image"
|
|
789
|
+
}
|
|
790
|
+
});
|
|
791
|
+
|
|
792
|
+
// src/components/file-upload/utils/data-url-to-file.ts
|
|
793
|
+
async function dataUrlToFile(dataUrl, fileName, typeHint) {
|
|
794
|
+
const res = await fetch(dataUrl);
|
|
795
|
+
const blob = await res.blob();
|
|
796
|
+
const type = typeHint || blob.type || "image/png";
|
|
797
|
+
const ext = type.includes("jpeg") ? "jpg" : type.split("/")[1] || "png";
|
|
798
|
+
const safeName = fileName.replace(/\.[^.]+$/, "");
|
|
799
|
+
return new File([blob], `${safeName}-cropped.${ext}`, { type });
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
// src/components/file-upload/utils/format-accept-types.ts
|
|
803
|
+
var WILDCARD_GROUPS = {
|
|
804
|
+
"image/*": "common image formats",
|
|
805
|
+
"audio/*": "common audio formats",
|
|
806
|
+
"video/*": "common video formats",
|
|
807
|
+
"application/*": "common document formats"
|
|
808
|
+
};
|
|
809
|
+
var MIME_TO_LABEL = {
|
|
810
|
+
"image/png": "PNG",
|
|
811
|
+
"image/jpeg": "JPG",
|
|
812
|
+
"image/jpg": "JPG",
|
|
813
|
+
"application/pdf": "PDF",
|
|
814
|
+
"text/csv": "CSV",
|
|
815
|
+
"text/plain": "TXT"
|
|
816
|
+
};
|
|
817
|
+
var EXT_TO_LABEL = {
|
|
818
|
+
".png": "PNG",
|
|
819
|
+
".jpg": "JPG",
|
|
820
|
+
".jpeg": "JPG",
|
|
821
|
+
".pdf": "PDF",
|
|
822
|
+
".csv": "CSV",
|
|
823
|
+
".txt": "TXT"
|
|
824
|
+
};
|
|
825
|
+
function normalizeToken(token) {
|
|
826
|
+
return token.trim().toLowerCase();
|
|
827
|
+
}
|
|
828
|
+
function formatAcceptedTypes(accept) {
|
|
829
|
+
var _a, _b;
|
|
830
|
+
if (!accept || typeof accept !== "string") return "";
|
|
831
|
+
const tokens = accept.split(",").map(normalizeToken).filter(Boolean);
|
|
832
|
+
const labels = [];
|
|
833
|
+
for (const token of tokens) {
|
|
834
|
+
if (WILDCARD_GROUPS[token]) {
|
|
835
|
+
labels.push(WILDCARD_GROUPS[token]);
|
|
836
|
+
continue;
|
|
837
|
+
}
|
|
838
|
+
if (token.startsWith(".")) {
|
|
839
|
+
labels.push(
|
|
840
|
+
(_a = EXT_TO_LABEL[token]) != null ? _a : token.replace(/^\./, "").toUpperCase()
|
|
841
|
+
);
|
|
842
|
+
continue;
|
|
843
|
+
}
|
|
844
|
+
if (token.includes("/")) {
|
|
845
|
+
labels.push((_b = MIME_TO_LABEL[token]) != null ? _b : token.split("/")[1].toUpperCase());
|
|
846
|
+
}
|
|
847
|
+
}
|
|
848
|
+
const seen = /* @__PURE__ */ new Set();
|
|
849
|
+
return labels.filter((x) => {
|
|
850
|
+
if (seen.has(x)) return false;
|
|
851
|
+
seen.add(x);
|
|
852
|
+
return true;
|
|
853
|
+
}).join(", ");
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
// src/components/file-upload/utils/is-image-like.ts
|
|
857
|
+
function isImageLike(file) {
|
|
858
|
+
var _a, _b;
|
|
859
|
+
if ((_a = file.type) == null ? void 0 : _a.startsWith("image/")) return true;
|
|
860
|
+
const name = ((_b = file.name) == null ? void 0 : _b.toLowerCase()) || "";
|
|
861
|
+
return name.endsWith(".png") || name.endsWith(".jpg") || name.endsWith(".jpeg") || name.endsWith(".webp");
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
// src/components/file-upload/avatar-upload.tsx
|
|
865
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
866
|
+
var defaultMaxSize = 2 * 1024 * 1024;
|
|
867
|
+
var AvatarUpload = (props) => {
|
|
868
|
+
const {
|
|
869
|
+
maxSize = defaultMaxSize,
|
|
870
|
+
className,
|
|
871
|
+
onFileChange,
|
|
872
|
+
defaultAvatar,
|
|
873
|
+
orientation,
|
|
874
|
+
size,
|
|
875
|
+
shape,
|
|
876
|
+
accept = ".png,.jpg",
|
|
877
|
+
cropperEnabled = true,
|
|
878
|
+
cropAspect = 1,
|
|
879
|
+
cropMaxImageSize = defaultMaxSize,
|
|
880
|
+
onCroppedFile,
|
|
881
|
+
...rest
|
|
882
|
+
} = props;
|
|
883
|
+
const t = (0, import_i18n4.useSafeIntl)();
|
|
884
|
+
const [cropOpen, setCropOpen] = (0, import_react3.useState)(false);
|
|
885
|
+
const [cropSourceFile, setCropSourceFile] = (0, import_react3.useState)(null);
|
|
886
|
+
const pendingOriginalId = (0, import_react3.useRef)(null);
|
|
887
|
+
const [
|
|
888
|
+
{ files, isDragging, errors },
|
|
889
|
+
{
|
|
890
|
+
removeFile,
|
|
891
|
+
handleDragEnter,
|
|
892
|
+
handleDragLeave,
|
|
893
|
+
handleDragOver,
|
|
894
|
+
handleDrop,
|
|
895
|
+
openFileDialog,
|
|
896
|
+
getInputProps,
|
|
897
|
+
clearErrors,
|
|
898
|
+
addFiles
|
|
899
|
+
}
|
|
900
|
+
] = useFileUpload({
|
|
901
|
+
maxFiles: 1,
|
|
902
|
+
maxSize,
|
|
903
|
+
accept,
|
|
904
|
+
multiple: false,
|
|
905
|
+
onFilesChange: (files2) => {
|
|
906
|
+
onFileChange == null ? void 0 : onFileChange(files2[0] || null);
|
|
907
|
+
},
|
|
908
|
+
onFilesAdded: (added) => {
|
|
909
|
+
var _a;
|
|
910
|
+
if (!cropperEnabled) return;
|
|
911
|
+
const raw = (_a = added[0]) == null ? void 0 : _a.file;
|
|
912
|
+
if (raw instanceof File && isImageLike(raw)) {
|
|
913
|
+
pendingOriginalId.current = added[0].id;
|
|
914
|
+
setCropSourceFile(raw);
|
|
915
|
+
setCropOpen(true);
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
});
|
|
919
|
+
const currentFile = files[0];
|
|
920
|
+
const previewUrl = (currentFile == null ? void 0 : currentFile.preview) || defaultAvatar;
|
|
921
|
+
const handleRemove = () => {
|
|
922
|
+
if (currentFile) {
|
|
923
|
+
removeFile(currentFile.id);
|
|
924
|
+
clearErrors();
|
|
925
|
+
}
|
|
926
|
+
};
|
|
927
|
+
const styles = (0, import_theme4.avatarUpload)({
|
|
928
|
+
size,
|
|
929
|
+
shape,
|
|
930
|
+
orientation
|
|
931
|
+
});
|
|
932
|
+
const typesLabel = formatAcceptedTypes(accept);
|
|
933
|
+
const handleCropCancel = (0, import_react3.useCallback)(() => {
|
|
934
|
+
setCropOpen(false);
|
|
935
|
+
setCropSourceFile(null);
|
|
936
|
+
pendingOriginalId.current = null;
|
|
937
|
+
}, []);
|
|
938
|
+
const handleCropApply = (0, import_react3.useCallback)(
|
|
939
|
+
async (croppedDataUrl) => {
|
|
940
|
+
if (!croppedDataUrl || !cropSourceFile) {
|
|
941
|
+
handleCropCancel();
|
|
942
|
+
return;
|
|
943
|
+
}
|
|
944
|
+
const newFile = await dataUrlToFile(
|
|
945
|
+
croppedDataUrl,
|
|
946
|
+
cropSourceFile.name,
|
|
947
|
+
cropSourceFile.type
|
|
948
|
+
);
|
|
949
|
+
if (pendingOriginalId.current) {
|
|
950
|
+
removeFile(pendingOriginalId.current);
|
|
951
|
+
pendingOriginalId.current = null;
|
|
952
|
+
}
|
|
953
|
+
addFiles([newFile]);
|
|
954
|
+
onCroppedFile == null ? void 0 : onCroppedFile(newFile);
|
|
955
|
+
setCropOpen(false);
|
|
956
|
+
setCropSourceFile(null);
|
|
957
|
+
},
|
|
958
|
+
[cropSourceFile, addFiles, removeFile, onCroppedFile, handleCropCancel]
|
|
959
|
+
);
|
|
960
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
|
|
961
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
962
|
+
"div",
|
|
963
|
+
{
|
|
964
|
+
"data-slot": "avatar-upload",
|
|
965
|
+
className: styles.root({ className }),
|
|
966
|
+
...rest,
|
|
967
|
+
children: [
|
|
968
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: styles.previewAndText(), children: [
|
|
969
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: styles.previewContainer(), children: [
|
|
970
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
971
|
+
"button",
|
|
972
|
+
{
|
|
973
|
+
type: "button",
|
|
974
|
+
"aria-label": previewUrl ? t.formatMessage(messages2.change_avatar) : t.formatMessage(messages2.upload_avatar),
|
|
975
|
+
"data-dragging": (0, import_shared_utils5.dataAttr)(isDragging),
|
|
976
|
+
"data-hasimage": (0, import_shared_utils5.dataAttr)(!!previewUrl),
|
|
977
|
+
className: styles.preview(),
|
|
978
|
+
onDragEnter: handleDragEnter,
|
|
979
|
+
onDragLeave: handleDragLeave,
|
|
980
|
+
onDragOver: handleDragOver,
|
|
981
|
+
onDrop: handleDrop,
|
|
982
|
+
onClick: openFileDialog,
|
|
983
|
+
children: [
|
|
984
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("input", { ...getInputProps(), className: "sr-only" }),
|
|
985
|
+
previewUrl ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
986
|
+
"img",
|
|
987
|
+
{
|
|
988
|
+
src: previewUrl,
|
|
989
|
+
alt: "Avatar",
|
|
990
|
+
className: styles.previewImg()
|
|
991
|
+
}
|
|
992
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: styles.placeholderWrapper(), children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_icons2.UserCircleIcon, { className: styles.placeholder() }) })
|
|
993
|
+
]
|
|
994
|
+
}
|
|
995
|
+
),
|
|
996
|
+
currentFile && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
997
|
+
import_button.IconButton,
|
|
998
|
+
{
|
|
999
|
+
variant: "outline",
|
|
1000
|
+
color: "default",
|
|
1001
|
+
onClick: handleRemove,
|
|
1002
|
+
size: "sm",
|
|
1003
|
+
className: styles.removeButton(),
|
|
1004
|
+
"aria-label": t.formatMessage(messages2.remove_avatar),
|
|
1005
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_icons2.CloseIcon, {})
|
|
1006
|
+
}
|
|
1007
|
+
)
|
|
1008
|
+
] }),
|
|
1009
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: styles.instructionsContainer(), children: [
|
|
1010
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: styles.instructions(), children: currentFile ? t.formatMessage(messages2.avatar_uploaded) : t.formatMessage(messages2.upload_avatar) }),
|
|
1011
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: styles.acceptedFiles(), children: t.formatMessage(messages2.accepted_file_types, {
|
|
1012
|
+
types: typesLabel || "-",
|
|
1013
|
+
size: maxSize ? (0, import_shared_utils5.formatBytes)(maxSize) : "none"
|
|
1014
|
+
}) })
|
|
1015
|
+
] })
|
|
1016
|
+
] }),
|
|
1017
|
+
errors.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_callout.Callout, { variant: "destructive", children: errors.map((error, index) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: styles.errorItem(), children: error }, index.toString())) })
|
|
1018
|
+
]
|
|
1019
|
+
}
|
|
1020
|
+
),
|
|
1021
|
+
cropperEnabled && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
1022
|
+
Dialog.Root,
|
|
1023
|
+
{
|
|
1024
|
+
open: cropOpen,
|
|
1025
|
+
onOpenChange: (v) => !v ? handleCropCancel() : null,
|
|
1026
|
+
size: "2xl",
|
|
1027
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Dialog.Content, { children: [
|
|
1028
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Dialog.Header, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Dialog.Title, { children: t.formatMessage(messages2.change_avatar) }) }),
|
|
1029
|
+
cropSourceFile && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
1030
|
+
import_image_crop.ImageCrop,
|
|
1031
|
+
{
|
|
1032
|
+
aspect: cropAspect,
|
|
1033
|
+
file: cropSourceFile,
|
|
1034
|
+
maxImageSize: cropMaxImageSize,
|
|
1035
|
+
onCrop: handleCropApply,
|
|
1036
|
+
children: [
|
|
1037
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Dialog.Body, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_image_crop.ImageCropContent, { className: "max-w-md" }) }),
|
|
1038
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Dialog.Footer, { children: [
|
|
1039
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
1040
|
+
Dialog.CloseTrigger,
|
|
1041
|
+
{
|
|
1042
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
1043
|
+
import_button.Button,
|
|
1044
|
+
{
|
|
1045
|
+
variant: "ghost",
|
|
1046
|
+
color: "default",
|
|
1047
|
+
startContent: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_icons2.CloseIcon, {}),
|
|
1048
|
+
children: t.formatMessage(messages2.cancel)
|
|
1049
|
+
}
|
|
1050
|
+
)
|
|
1051
|
+
}
|
|
1052
|
+
),
|
|
1053
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
1054
|
+
import_image_crop.ImageCropApply,
|
|
1055
|
+
{
|
|
1056
|
+
color: "primary",
|
|
1057
|
+
variant: "solid",
|
|
1058
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_button.Button, { startContent: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_icons2.CropIcon, {}), children: t.formatMessage(messages2.apply_crop) })
|
|
1059
|
+
}
|
|
1060
|
+
)
|
|
1061
|
+
] })
|
|
1062
|
+
]
|
|
1063
|
+
}
|
|
1064
|
+
)
|
|
1065
|
+
] })
|
|
1066
|
+
}
|
|
1067
|
+
)
|
|
1068
|
+
] });
|
|
1069
|
+
};
|
|
1070
|
+
|
|
1071
|
+
// src/components/skeleton/skeleton.tsx
|
|
1072
|
+
var import_theme5 = require("@kopexa/theme");
|
|
1073
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
1074
|
+
var Skeleton = (props) => {
|
|
1075
|
+
const { className, children, ...rest } = props;
|
|
1076
|
+
const styles = (0, import_theme5.skeleton)({
|
|
1077
|
+
className
|
|
1078
|
+
});
|
|
1079
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: styles, ...rest, children });
|
|
1080
|
+
};
|
|
1081
|
+
|
|
1082
|
+
// src/components/skeleton/skeleton-avatar.tsx
|
|
1083
|
+
var import_shared_utils6 = require("@kopexa/shared-utils");
|
|
1084
|
+
var import_theme6 = require("@kopexa/theme");
|
|
1085
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
1086
|
+
var SkeletonAvatar = (props) => {
|
|
1087
|
+
const { size, className, ...restProps } = props;
|
|
1088
|
+
const baseStyle = (0, import_theme6.skeletonAvatar)({ size });
|
|
1089
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Skeleton, { ...restProps, className: (0, import_shared_utils6.cn)(baseStyle, className) });
|
|
1090
|
+
};
|
|
1091
|
+
|
|
1092
|
+
// src/components/stat/stat.tsx
|
|
1093
|
+
var import_icons3 = require("@kopexa/icons");
|
|
1094
|
+
var import_shared_utils7 = require("@kopexa/shared-utils");
|
|
1095
|
+
var import_theme7 = require("@kopexa/theme");
|
|
1096
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1097
|
+
function StatRoot({
|
|
1098
|
+
className,
|
|
1099
|
+
size,
|
|
1100
|
+
trend,
|
|
1101
|
+
children,
|
|
1102
|
+
...props
|
|
1103
|
+
}) {
|
|
1104
|
+
const styles = (0, import_theme7.stat)({ size, trend });
|
|
1105
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("dl", { "data-slot": "stat", className: (0, import_shared_utils7.cn)(styles.root(), className), ...props, children });
|
|
1106
|
+
}
|
|
1107
|
+
function StatLabel({ className, children, ...props }) {
|
|
1108
|
+
const styles = (0, import_theme7.stat)();
|
|
1109
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1110
|
+
"dt",
|
|
1111
|
+
{
|
|
1112
|
+
"data-slot": "stat-label",
|
|
1113
|
+
className: (0, import_shared_utils7.cn)(styles.label(), className),
|
|
1114
|
+
...props,
|
|
1115
|
+
children
|
|
1116
|
+
}
|
|
1117
|
+
);
|
|
1118
|
+
}
|
|
1119
|
+
function StatValueText({
|
|
1120
|
+
className,
|
|
1121
|
+
size,
|
|
1122
|
+
children,
|
|
1123
|
+
...props
|
|
1124
|
+
}) {
|
|
1125
|
+
const styles = (0, import_theme7.stat)({ size });
|
|
1126
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1127
|
+
"dd",
|
|
1128
|
+
{
|
|
1129
|
+
"data-slot": "stat-value",
|
|
1130
|
+
className: (0, import_shared_utils7.cn)(styles.valueText(), className),
|
|
1131
|
+
...props,
|
|
1132
|
+
children
|
|
1133
|
+
}
|
|
1134
|
+
);
|
|
1135
|
+
}
|
|
1136
|
+
function StatValueUnit({
|
|
1137
|
+
className,
|
|
1138
|
+
children,
|
|
1139
|
+
...props
|
|
1140
|
+
}) {
|
|
1141
|
+
const styles = (0, import_theme7.stat)();
|
|
1142
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1143
|
+
"span",
|
|
1144
|
+
{
|
|
1145
|
+
"data-slot": "stat-value-unit",
|
|
1146
|
+
className: (0, import_shared_utils7.cn)(styles.valueUnit(), className),
|
|
1147
|
+
...props,
|
|
1148
|
+
children
|
|
1149
|
+
}
|
|
1150
|
+
);
|
|
1151
|
+
}
|
|
1152
|
+
function StatHelpText({
|
|
1153
|
+
className,
|
|
1154
|
+
children,
|
|
1155
|
+
...props
|
|
1156
|
+
}) {
|
|
1157
|
+
const styles = (0, import_theme7.stat)();
|
|
1158
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1159
|
+
"span",
|
|
1160
|
+
{
|
|
1161
|
+
"data-slot": "stat-help-text",
|
|
1162
|
+
className: (0, import_shared_utils7.cn)(styles.helpText(), className),
|
|
1163
|
+
...props,
|
|
1164
|
+
children
|
|
1165
|
+
}
|
|
1166
|
+
);
|
|
1167
|
+
}
|
|
1168
|
+
function StatUpIndicator({
|
|
1169
|
+
className,
|
|
1170
|
+
icon,
|
|
1171
|
+
children,
|
|
1172
|
+
...props
|
|
1173
|
+
}) {
|
|
1174
|
+
const styles = (0, import_theme7.stat)({ trend: "up" });
|
|
1175
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
1176
|
+
"span",
|
|
1177
|
+
{
|
|
1178
|
+
"data-slot": "stat-indicator",
|
|
1179
|
+
"data-type": "up",
|
|
1180
|
+
className: (0, import_shared_utils7.cn)(styles.indicator(), className),
|
|
1181
|
+
...props,
|
|
1182
|
+
children: [
|
|
1183
|
+
icon != null ? icon : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_icons3.ArrowUp, {}),
|
|
1184
|
+
children
|
|
1185
|
+
]
|
|
1186
|
+
}
|
|
1187
|
+
);
|
|
1188
|
+
}
|
|
1189
|
+
function StatDownIndicator({
|
|
1190
|
+
className,
|
|
1191
|
+
icon,
|
|
1192
|
+
children,
|
|
1193
|
+
...props
|
|
1194
|
+
}) {
|
|
1195
|
+
const styles = (0, import_theme7.stat)({ trend: "down" });
|
|
1196
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
1197
|
+
"span",
|
|
1198
|
+
{
|
|
1199
|
+
"data-slot": "stat-indicator",
|
|
1200
|
+
"data-type": "down",
|
|
1201
|
+
className: (0, import_shared_utils7.cn)(styles.indicator(), className),
|
|
1202
|
+
...props,
|
|
1203
|
+
children: [
|
|
1204
|
+
icon != null ? icon : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_icons3.ArrowDown, {}),
|
|
1205
|
+
children
|
|
1206
|
+
]
|
|
1207
|
+
}
|
|
1208
|
+
);
|
|
1209
|
+
}
|
|
1210
|
+
function StatGroup({ className, children, ...props }) {
|
|
1211
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1212
|
+
"div",
|
|
1213
|
+
{
|
|
1214
|
+
"data-slot": "stat-group",
|
|
1215
|
+
className: (0, import_shared_utils7.cn)("flex flex-wrap justify-around gap-4", className),
|
|
1216
|
+
...props,
|
|
1217
|
+
children
|
|
1218
|
+
}
|
|
1219
|
+
);
|
|
1220
|
+
}
|
|
1221
|
+
var Stat = Object.assign(StatRoot, {
|
|
1222
|
+
Root: StatRoot,
|
|
1223
|
+
Label: StatLabel,
|
|
1224
|
+
ValueText: StatValueText,
|
|
1225
|
+
ValueUnit: StatValueUnit,
|
|
1226
|
+
HelpText: StatHelpText,
|
|
1227
|
+
UpIndicator: StatUpIndicator,
|
|
1228
|
+
DownIndicator: StatDownIndicator,
|
|
1229
|
+
Group: StatGroup
|
|
1230
|
+
});
|
|
1231
|
+
|
|
1232
|
+
// src/components/textarea/textarea.tsx
|
|
1233
|
+
var import_theme8 = require("@kopexa/theme");
|
|
1234
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1235
|
+
var Textarea = (props) => {
|
|
1236
|
+
const { className, size, ...rest } = props;
|
|
1237
|
+
const styles = (0, import_theme8.textarea)({
|
|
1238
|
+
className,
|
|
1239
|
+
size
|
|
1240
|
+
});
|
|
1241
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("textarea", { "data-slot": "textarea", className: styles, ...rest });
|
|
1242
|
+
};
|
|
181
1243
|
// Annotate the CommonJS export names for ESM import in node:
|
|
182
1244
|
0 && (module.exports = {
|
|
183
1245
|
Accordion,
|
|
@@ -189,6 +1251,7 @@ __reExport(index_exports, require("@kopexa/tooltip"), module.exports);
|
|
|
189
1251
|
AuditInfo,
|
|
190
1252
|
Autocomplete,
|
|
191
1253
|
AvatarUpload,
|
|
1254
|
+
Blankstate,
|
|
192
1255
|
Breadcrumb,
|
|
193
1256
|
BreadcrumbEllipsis,
|
|
194
1257
|
BreadcrumbItem,
|
|
@@ -206,6 +1269,7 @@ __reExport(index_exports, require("@kopexa/tooltip"), module.exports);
|
|
|
206
1269
|
CardTitle,
|
|
207
1270
|
CardToolbar,
|
|
208
1271
|
Chip,
|
|
1272
|
+
Code,
|
|
209
1273
|
Combobox,
|
|
210
1274
|
ConfirmDialogProvider,
|
|
211
1275
|
Conversation,
|
|
@@ -214,6 +1278,19 @@ __reExport(index_exports, require("@kopexa/tooltip"), module.exports);
|
|
|
214
1278
|
ConversationScrollButton,
|
|
215
1279
|
Cropper,
|
|
216
1280
|
DataGrid,
|
|
1281
|
+
Dialog,
|
|
1282
|
+
DialogBody,
|
|
1283
|
+
DialogClose,
|
|
1284
|
+
DialogCloseTrigger,
|
|
1285
|
+
DialogContent,
|
|
1286
|
+
DialogDescription,
|
|
1287
|
+
DialogFooter,
|
|
1288
|
+
DialogHeader,
|
|
1289
|
+
DialogOverlay,
|
|
1290
|
+
DialogPortal,
|
|
1291
|
+
DialogRoot,
|
|
1292
|
+
DialogTitle,
|
|
1293
|
+
DialogTrigger,
|
|
217
1294
|
EditableText,
|
|
218
1295
|
Filter,
|
|
219
1296
|
FilterActive,
|
|
@@ -249,6 +1326,8 @@ __reExport(index_exports, require("@kopexa/tooltip"), module.exports);
|
|
|
249
1326
|
ScrollBar,
|
|
250
1327
|
SearchFilterBar,
|
|
251
1328
|
Select,
|
|
1329
|
+
Skeleton,
|
|
1330
|
+
SkeletonAvatar,
|
|
252
1331
|
StandardChip,
|
|
253
1332
|
Stat,
|
|
254
1333
|
StatDownIndicator,
|
|
@@ -272,19 +1351,17 @@ __reExport(index_exports, require("@kopexa/tooltip"), module.exports);
|
|
|
272
1351
|
filterBarMessages,
|
|
273
1352
|
filterMessages,
|
|
274
1353
|
useConfirm,
|
|
1354
|
+
useDialogContext,
|
|
1355
|
+
useFileUpload,
|
|
275
1356
|
useFilterContext,
|
|
276
1357
|
...require("@kopexa/avatar"),
|
|
277
|
-
...require("@kopexa/blankstate"),
|
|
278
1358
|
...require("@kopexa/button"),
|
|
279
1359
|
...require("@kopexa/calendar"),
|
|
280
1360
|
...require("@kopexa/callout"),
|
|
281
1361
|
...require("@kopexa/checkbox"),
|
|
282
|
-
...require("@kopexa/code"),
|
|
283
1362
|
...require("@kopexa/color-picker"),
|
|
284
1363
|
...require("@kopexa/command"),
|
|
285
|
-
...require("@kopexa/data-table"),
|
|
286
1364
|
...require("@kopexa/date-picker"),
|
|
287
|
-
...require("@kopexa/dialog"),
|
|
288
1365
|
...require("@kopexa/drawer"),
|
|
289
1366
|
...require("@kopexa/dropdown-menu"),
|
|
290
1367
|
...require("@kopexa/heading"),
|
|
@@ -302,7 +1379,6 @@ __reExport(index_exports, require("@kopexa/tooltip"), module.exports);
|
|
|
302
1379
|
...require("@kopexa/section-row"),
|
|
303
1380
|
...require("@kopexa/separator"),
|
|
304
1381
|
...require("@kopexa/sidebar"),
|
|
305
|
-
...require("@kopexa/skeleton"),
|
|
306
1382
|
...require("@kopexa/spinner"),
|
|
307
1383
|
...require("@kopexa/split-page-layout"),
|
|
308
1384
|
...require("@kopexa/tab-nav"),
|