@solostylist/ui-kit 1.0.150 → 1.0.152
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/ArrowUpward-DvTpkKgd.js +8 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.js +8 -6
- package/dist/hooks/use-is-passed-position.d.ts +1 -0
- package/dist/hooks/use-is-passed-position.js +21 -0
- package/dist/main.d.ts +4 -0
- package/dist/main.js +138 -132
- package/dist/s-chat-input/s-chat-input.js +36 -37
- package/dist/s-error-layout/index.d.ts +2 -0
- package/dist/s-error-layout/index.js +4 -0
- package/dist/s-error-layout/package.json +5 -0
- package/dist/s-error-layout/s-error-layout.d.ts +56 -0
- package/dist/s-error-layout/s-error-layout.js +1346 -0
- package/dist/s-scroll-to-top/index.d.ts +2 -0
- package/dist/s-scroll-to-top/index.js +4 -0
- package/dist/s-scroll-to-top/package.json +5 -0
- package/dist/s-scroll-to-top/s-scroll-to-top.d.ts +27 -0
- package/dist/s-scroll-to-top/s-scroll-to-top.js +50 -0
- package/package.json +1 -1
package/dist/hooks/index.d.ts
CHANGED
package/dist/hooks/index.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { useDialog as
|
|
2
|
-
import { usePopover as
|
|
1
|
+
import { useDialog as s } from "./use-dialog.js";
|
|
2
|
+
import { usePopover as i } from "./use-popover.js";
|
|
3
3
|
import "react";
|
|
4
|
-
import { useScrollAnimation as
|
|
4
|
+
import { useScrollAnimation as p } from "./use-scroll-animation.js";
|
|
5
|
+
import { useIsPassedPosition as u } from "./use-is-passed-position.js";
|
|
5
6
|
export {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
s as useDialog,
|
|
8
|
+
u as useIsPassedPosition,
|
|
9
|
+
i as usePopover,
|
|
10
|
+
p as useScrollAnimation
|
|
9
11
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useIsPassedPosition(el: React.RefObject<HTMLElement> | string | Window, positionY: number): boolean;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { useState as f, useEffect as d } from "react";
|
|
2
|
+
function a(s, r) {
|
|
3
|
+
const [c, l] = f(!1);
|
|
4
|
+
return d(() => {
|
|
5
|
+
let e = null;
|
|
6
|
+
if (typeof s == "string" ? e = document.getElementById(s) ?? null : s instanceof Window ? e = s : s != null && s.current && (e = s.current), !e || !("addEventListener" in e)) return;
|
|
7
|
+
const n = () => {
|
|
8
|
+
let t = 0;
|
|
9
|
+
e instanceof Window ? t = e.scrollY : e instanceof HTMLElement && (t = e.scrollTop), l((o) => {
|
|
10
|
+
const i = t > r;
|
|
11
|
+
return o !== i ? i : o;
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
return n(), e.addEventListener("scroll", n), () => {
|
|
15
|
+
e == null || e.removeEventListener("scroll", n);
|
|
16
|
+
};
|
|
17
|
+
}, [s, r]), c;
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
a as useIsPassedPosition
|
|
21
|
+
};
|
package/dist/main.d.ts
CHANGED
|
@@ -37,8 +37,12 @@ export { default as SEmpty } from './s-empty/index';
|
|
|
37
37
|
export type { SEmptyProps } from './s-empty/index';
|
|
38
38
|
export { default as SFlexBox } from './s-flex-box/index';
|
|
39
39
|
export type { SFlexBoxProps } from './s-flex-box/index';
|
|
40
|
+
export { default as STwoPaneLayout } from './s-two-pane-layout/index';
|
|
41
|
+
export type { STwoPaneLayoutProps } from './s-two-pane-layout/index';
|
|
40
42
|
export { default as SDialog } from './s-dialog/index';
|
|
41
43
|
export type { SDialogProps } from './s-dialog/index';
|
|
44
|
+
export { default as SErrorLayout } from './s-error-layout/index';
|
|
45
|
+
export type { SErrorLayoutProps } from './s-error-layout/index';
|
|
42
46
|
export { default as SFileDropzone } from './s-file-dropzone/index';
|
|
43
47
|
export type { CustomFile, SFileDropzoneProps } from './s-file-dropzone/index';
|
|
44
48
|
export { default as SFileIcon } from './s-file-icon/index';
|
package/dist/main.js
CHANGED
|
@@ -1,165 +1,171 @@
|
|
|
1
1
|
import { default as t } from "./s-accordion/s-accordion.js";
|
|
2
2
|
import { default as l } from "./s-action-overlay/s-action-overlay.js";
|
|
3
|
-
import { default as
|
|
4
|
-
import { default as
|
|
3
|
+
import { default as m } from "./s-autocomplete/s-autocomplete.js";
|
|
4
|
+
import { default as u } from "./s-avatar/s-avatar.js";
|
|
5
5
|
import { default as d } from "./s-button/s-button.js";
|
|
6
6
|
import { default as i } from "./s-button-link/s-button-link.js";
|
|
7
7
|
import { default as g } from "./s-carousel/s-carousel.js";
|
|
8
8
|
import { default as T } from "./s-chat-input/s-chat-input.js";
|
|
9
|
-
import { default as
|
|
9
|
+
import { default as P } from "./s-chat-message/s-chat-message.js";
|
|
10
10
|
import { default as b } from "./s-comment-message/s-comment-message.js";
|
|
11
|
-
import { default as
|
|
11
|
+
import { default as D } from "./s-text-editor/s-text-editor.js";
|
|
12
12
|
import "./s-text-editor/s-text-editor-toolbar.js";
|
|
13
|
-
import { default as
|
|
13
|
+
import { default as M } from "./s-checkbox/s-checkbox.js";
|
|
14
14
|
import { default as I } from "./s-chip/s-chip.js";
|
|
15
15
|
import { default as F } from "./s-chips/s-chips.js";
|
|
16
|
-
import { default as
|
|
17
|
-
import { DialogConfirmProvider as
|
|
16
|
+
import { default as A } from "./s-data-table/s-data-table.js";
|
|
17
|
+
import { DialogConfirmProvider as E, default as z, useDialogConfirm as R } from "./s-dialog-confirm/s-dialog-confirm.js";
|
|
18
18
|
import { DialogMessageProvider as N, default as O, useDialogMessage as j } from "./s-dialog-message/s-dialog-message.js";
|
|
19
19
|
import { default as V } from "./s-error/s-error.js";
|
|
20
20
|
import { default as H } from "./s-empty/s-empty.js";
|
|
21
21
|
import { default as Q } from "./s-flex-box/s-flex-box.js";
|
|
22
|
-
import { default as W } from "./s-
|
|
23
|
-
import { default as Y } from "./s-
|
|
24
|
-
import { default as _ } from "./s-
|
|
25
|
-
import { default as ee } from "./s-
|
|
26
|
-
import { default as re } from "./s-icon
|
|
27
|
-
import { default as te } from "./s-
|
|
28
|
-
import { default as le } from "./s-
|
|
29
|
-
import { default as
|
|
30
|
-
import { default as
|
|
31
|
-
import { default as de } from "./s-
|
|
32
|
-
import { default as ie } from "./s-
|
|
33
|
-
import { default as ge } from "./s-
|
|
34
|
-
import { default as Te } from "./s-
|
|
35
|
-
import { default as
|
|
36
|
-
import { default as be } from "./s-
|
|
37
|
-
import { default as
|
|
38
|
-
import { default as
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import { default as qe } from "./s-
|
|
45
|
-
import { default as Je } from "./s-
|
|
46
|
-
import { default as Ue } from "./s-
|
|
47
|
-
import { default as Xe } from "./s-
|
|
48
|
-
import { default as Ze } from "./s-
|
|
49
|
-
import { default as $e } from "./s-
|
|
50
|
-
import { default as oo } from "./s-
|
|
51
|
-
import { default as ao } from "./s-
|
|
52
|
-
import { default as fo } from "./s-
|
|
53
|
-
import {
|
|
54
|
-
import { default as
|
|
55
|
-
import { default as xo } from "./s-
|
|
56
|
-
import { default as no } from "./s-image-
|
|
57
|
-
import { default as co } from "./s-
|
|
58
|
-
import { default as Co } from "./s-
|
|
59
|
-
import { default as
|
|
60
|
-
import { default as
|
|
61
|
-
import { default as
|
|
62
|
-
import { default as
|
|
63
|
-
import { default as ko } from "./s-
|
|
64
|
-
import { default as
|
|
65
|
-
import { default as
|
|
66
|
-
import { default as
|
|
67
|
-
import {
|
|
68
|
-
import {
|
|
69
|
-
import {
|
|
22
|
+
import { default as W } from "./s-two-pane-layout/s-two-pane-layout.js";
|
|
23
|
+
import { default as Y } from "./s-dialog/s-dialog.js";
|
|
24
|
+
import { default as _ } from "./s-error-layout/s-error-layout.js";
|
|
25
|
+
import { default as ee } from "./s-file-dropzone/s-file-dropzone.js";
|
|
26
|
+
import { default as re } from "./s-file-icon/s-file-icon.js";
|
|
27
|
+
import { default as te } from "./s-i18n-provider/s-i18n-provider.js";
|
|
28
|
+
import { default as le } from "./s-icon-button/s-icon-button.js";
|
|
29
|
+
import { default as me } from "./s-label/s-label.js";
|
|
30
|
+
import { default as ue } from "./s-multi-select/s-multi-select.js";
|
|
31
|
+
import { default as de } from "./s-no-ssr/s-no-ssr.js";
|
|
32
|
+
import { default as ie } from "./s-overlay-scrollbar/s-overlay-scrollbar.js";
|
|
33
|
+
import { default as ge } from "./s-text-field/s-text-field.js";
|
|
34
|
+
import { default as Te } from "./s-pagination/s-pagination.js";
|
|
35
|
+
import { default as Pe } from "./s-select/s-select.js";
|
|
36
|
+
import { default as be } from "./s-skeleton/s-skeleton.js";
|
|
37
|
+
import { default as De } from "./s-tip/s-tip.js";
|
|
38
|
+
import { default as Me } from "./s-text-truncation/s-text-truncation.js";
|
|
39
|
+
import { default as Ie, SnackbarMessageProvider as ke, useSnackbarMessage as Fe } from "./s-snackbar-message/s-snackbar-message.js";
|
|
40
|
+
import { default as Ae } from "./s-form/s-form.js";
|
|
41
|
+
import { SSmartTextField as Ee } from "./s-smart-text-field/s-smart-text-field.js";
|
|
42
|
+
import { SCopilotKitProvider as Re } from "./s-copilot-kit-provider/s-copilot-kit-provider.js";
|
|
43
|
+
import { SStripeCVC as Ne, SStripeExpiry as Oe, SStripeNumber as je, StripeTextField as Ke } from "./s-stripe/s-stripe.js";
|
|
44
|
+
import { default as qe } from "./s-theme-provider/s-theme-provider.js";
|
|
45
|
+
import { default as Je } from "./s-theme-switch/s-theme-switch.js";
|
|
46
|
+
import { default as Ue } from "./s-datetime-picker/s-datetime-picker.js";
|
|
47
|
+
import { default as Xe } from "./s-date-picker/s-date-picker.js";
|
|
48
|
+
import { default as Ze } from "./s-localization-provider/s-localization-provider.js";
|
|
49
|
+
import { default as $e } from "./s-gradient-icon/s-gradient-icon.js";
|
|
50
|
+
import { default as oo } from "./s-glow-button/s-glow-button.js";
|
|
51
|
+
import { default as ao } from "./s-moving-border/s-moving-border.js";
|
|
52
|
+
import { default as fo } from "./s-scroll-reveal/s-scroll-reveal.js";
|
|
53
|
+
import { default as so } from "./s-spotlight-cursor/s-spotlight-cursor.js";
|
|
54
|
+
import { default as po } from "./s-copyable-text/s-copyable-text.js";
|
|
55
|
+
import { MediaItem as So, default as xo } from "./s-gallery/s-gallery.js";
|
|
56
|
+
import { default as no } from "./s-image-modal/s-image-modal.js";
|
|
57
|
+
import { default as co } from "./s-lazy-image/s-lazy-image.js";
|
|
58
|
+
import { default as Co } from "./s-image-comparison/s-image-comparison.js";
|
|
59
|
+
import { default as vo } from "./s-item-not-found/s-item-not-found.js";
|
|
60
|
+
import { default as yo } from "./s-category-card/s-category-card.js";
|
|
61
|
+
import { default as Lo } from "./s-radial-pulse-animate/s-radial-pulse-animate.js";
|
|
62
|
+
import { default as ho } from "./s-rating/s-rating.js";
|
|
63
|
+
import { default as ko } from "./s-review/s-review.js";
|
|
64
|
+
import { default as wo } from "./s-tabs/s-tabs.js";
|
|
65
|
+
import { default as Bo } from "./s-tabs/s-tab.js";
|
|
66
|
+
import { default as zo } from "./s-tabs/s-tab-panel.js";
|
|
67
|
+
import { default as Go } from "./s-text-shimmer/s-text-shimmer.js";
|
|
68
|
+
import { default as Oo } from "./s-typewriter-text/s-typewriter-text.js";
|
|
69
|
+
import { SLanguagePopover as Ko, default as Vo, defaultLanguageOptions as qo } from "./s-language-switcher/s-language-switcher.js";
|
|
70
|
+
import { useDialog as Jo } from "./hooks/use-dialog.js";
|
|
71
|
+
import { usePopover as Uo } from "./hooks/use-popover.js";
|
|
70
72
|
import "react";
|
|
71
|
-
import { useScrollAnimation as
|
|
72
|
-
import {
|
|
73
|
-
import {
|
|
74
|
-
import {
|
|
75
|
-
import {
|
|
73
|
+
import { useScrollAnimation as Xo } from "./hooks/use-scroll-animation.js";
|
|
74
|
+
import { useIsPassedPosition as Zo } from "./hooks/use-is-passed-position.js";
|
|
75
|
+
import { formatDatePosted as $o } from "./utils/dayjs.js";
|
|
76
|
+
import { bytesToSize as or } from "./utils/bytes-to-size.js";
|
|
77
|
+
import { LogLevel as ar, Logger as tr, createLogger as fr, logger as lr } from "./utils/logger.js";
|
|
78
|
+
import { default as mr } from "dayjs";
|
|
76
79
|
export {
|
|
77
|
-
|
|
80
|
+
E as DialogConfirmProvider,
|
|
78
81
|
N as DialogMessageProvider,
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
+
ar as LogLevel,
|
|
83
|
+
tr as Logger,
|
|
84
|
+
So as MediaItem,
|
|
82
85
|
t as SAccordion,
|
|
83
86
|
l as SActionOverlay,
|
|
84
|
-
|
|
85
|
-
|
|
87
|
+
m as SAutocomplete,
|
|
88
|
+
u as SAvatar,
|
|
86
89
|
d as SButton,
|
|
87
90
|
i as SButtonLink,
|
|
88
91
|
g as SCarousel,
|
|
89
|
-
|
|
92
|
+
yo as SCategoryCard,
|
|
90
93
|
T as SChatInput,
|
|
91
|
-
|
|
92
|
-
|
|
94
|
+
P as SChatMessage,
|
|
95
|
+
M as SCheckbox,
|
|
93
96
|
I as SChip,
|
|
94
97
|
F as SChips,
|
|
95
98
|
b as SCommentMessage,
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
99
|
+
Re as SCopilotKitProvider,
|
|
100
|
+
po as SCopyableText,
|
|
101
|
+
A as SDataTable,
|
|
102
|
+
Xe as SDatePicker,
|
|
103
|
+
Ue as SDateTimePicker,
|
|
104
|
+
Y as SDialog,
|
|
105
|
+
z as SDialogConfirm,
|
|
103
106
|
O as SDialogMessage,
|
|
104
107
|
H as SEmpty,
|
|
105
108
|
V as SError,
|
|
106
|
-
|
|
107
|
-
|
|
109
|
+
_ as SErrorLayout,
|
|
110
|
+
ee as SFileDropzone,
|
|
111
|
+
re as SFileIcon,
|
|
108
112
|
Q as SFlexBox,
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
113
|
+
Ae as SForm,
|
|
114
|
+
xo as SGallery,
|
|
115
|
+
oo as SGlowButton,
|
|
116
|
+
$e as SGradientIcon,
|
|
117
|
+
te as SI18nProvider,
|
|
118
|
+
le as SIconButton,
|
|
119
|
+
Co as SImageComparison,
|
|
120
|
+
no as SImageModal,
|
|
121
|
+
vo as SItemNotFound,
|
|
122
|
+
me as SLabel,
|
|
123
|
+
Ko as SLanguagePopover,
|
|
124
|
+
Vo as SLanguageSwitcher,
|
|
125
|
+
co as SLazyImage,
|
|
126
|
+
Ze as SLocalizationProvider,
|
|
127
|
+
ao as SMovingBorder,
|
|
128
|
+
ue as SMultiSelect,
|
|
129
|
+
de as SNoSsr,
|
|
130
|
+
ie as SOverlayScrollbar,
|
|
131
|
+
Te as SPagination,
|
|
132
|
+
Lo as SRadialPulseAnimate,
|
|
133
|
+
ho as SRating,
|
|
134
|
+
ko as SReview,
|
|
135
|
+
fo as SScrollReveal,
|
|
136
|
+
Pe as SSelect,
|
|
137
|
+
be as SSkeleton,
|
|
138
|
+
Ee as SSmartTextField,
|
|
139
|
+
Ie as SSnackbarMessage,
|
|
140
|
+
so as SSpotlightCursor,
|
|
141
|
+
Ne as SStripeCVC,
|
|
142
|
+
Oe as SStripeExpiry,
|
|
143
|
+
je as SStripeNumber,
|
|
144
|
+
Bo as STab,
|
|
145
|
+
zo as STabPanel,
|
|
146
|
+
wo as STabs,
|
|
147
|
+
D as STextEditor,
|
|
148
|
+
ge as STextField,
|
|
149
|
+
Go as STextShimmer,
|
|
150
|
+
Me as STextTruncation,
|
|
151
|
+
qe as SThemeProvider,
|
|
152
|
+
Je as SThemeSwitch,
|
|
153
|
+
De as STip,
|
|
154
|
+
W as STwoPaneLayout,
|
|
155
|
+
Oo as STypewriterText,
|
|
156
|
+
ke as SnackbarMessageProvider,
|
|
157
|
+
Ke as StripeTextField,
|
|
158
|
+
or as bytesToSize,
|
|
159
|
+
fr as createLogger,
|
|
160
|
+
mr as dayjs,
|
|
161
|
+
qo as defaultLanguageOptions,
|
|
162
|
+
$o as formatDatePosted,
|
|
163
|
+
lr as logger,
|
|
164
|
+
Jo as useDialog,
|
|
160
165
|
R as useDialogConfirm,
|
|
161
166
|
j as useDialogMessage,
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
167
|
+
Zo as useIsPassedPosition,
|
|
168
|
+
Uo as usePopover,
|
|
169
|
+
Xo as useScrollAnimation,
|
|
170
|
+
Fe as useSnackbarMessage
|
|
165
171
|
};
|
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
import { j as r } from "../jsx-runtime-OVHDjVDe.js";
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { Box as s, outlinedInputClasses as D, Typography as
|
|
2
|
+
import { forwardRef as K, useState as c, useRef as T, useId as V, useEffect as B } from "react";
|
|
3
|
+
import { Box as s, outlinedInputClasses as D, Typography as I, Popper as W, ClickAwayListener as H } from "@mui/material";
|
|
4
4
|
import _ from "emoji-picker-react";
|
|
5
5
|
import q from "../s-file-icon/s-file-icon.js";
|
|
6
6
|
import d from "../s-icon-button/s-icon-button.js";
|
|
7
7
|
import G from "../s-text-field/s-text-field.js";
|
|
8
8
|
import { C as J } from "../Close-D4kX7Vbc.js";
|
|
9
|
-
import { c as
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}), "ArrowUpward"), Q = v(/* @__PURE__ */ r.jsx("path", {
|
|
9
|
+
import { c as E } from "../createSvgIcon-Dq42_0tn.js";
|
|
10
|
+
import { A as N } from "../ArrowUpward-DvTpkKgd.js";
|
|
11
|
+
const Q = E(/* @__PURE__ */ r.jsx("path", {
|
|
13
12
|
d: "M16.5 6v11.5c0 2.21-1.79 4-4 4s-4-1.79-4-4V5c0-1.38 1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5v10.5c0 .55-.45 1-1 1s-1-.45-1-1V6H10v9.5c0 1.38 1.12 2.5 2.5 2.5s2.5-1.12 2.5-2.5V5c0-2.21-1.79-4-4-4S7 2.79 7 5v12.5c0 3.04 2.46 5.5 5.5 5.5s5.5-2.46 5.5-5.5V6z"
|
|
14
|
-
}), "AttachFile"), X =
|
|
13
|
+
}), "AttachFile"), X = E(/* @__PURE__ */ r.jsx("path", {
|
|
15
14
|
d: "M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M8.5 8c.83 0 1.5.67 1.5 1.5S9.33 11 8.5 11 7 10.33 7 9.5 7.67 8 8.5 8M12 18c-2.28 0-4.22-1.66-5-4h10c-.78 2.34-2.72 4-5 4m3.5-7c-.83 0-1.5-.67-1.5-1.5S14.67 8 15.5 8s1.5.67 1.5 1.5-.67 1.5-1.5 1.5"
|
|
16
|
-
}), "EmojiEmotions"),
|
|
17
|
-
({ onSubmit: p, onFileSelect: m, disabled: a, acceptedFileTypes: M, maxFileSize:
|
|
18
|
-
const [u, h] = c(""), [l, x] = c([]), [i, f] = c(/* @__PURE__ */ new Map()), [
|
|
15
|
+
}), "EmojiEmotions"), le = K(
|
|
16
|
+
({ onSubmit: p, onFileSelect: m, disabled: a, acceptedFileTypes: M, maxFileSize: v, ...z }, U) => {
|
|
17
|
+
const [u, h] = c(""), [l, x] = c([]), [i, f] = c(/* @__PURE__ */ new Map()), [k, g] = c(!1), C = T(null), y = V(), b = (e) => e.type.startsWith("image/"), $ = (e) => {
|
|
19
18
|
const o = `${e.name}-${e.size}-${e.lastModified}`;
|
|
20
19
|
if (i.has(o))
|
|
21
20
|
return i.get(o);
|
|
@@ -24,29 +23,29 @@ const N = v(/* @__PURE__ */ r.jsx("path", {
|
|
|
24
23
|
return f((t) => new Map(t).set(o, n)), n;
|
|
25
24
|
}
|
|
26
25
|
return "";
|
|
27
|
-
}, $ = (e) => {
|
|
28
|
-
h(e.target.value);
|
|
29
26
|
}, P = (e) => {
|
|
27
|
+
h(e.target.value);
|
|
28
|
+
}, L = (e) => {
|
|
30
29
|
h((o) => o + e.emoji), g(!1);
|
|
31
|
-
},
|
|
32
|
-
g(!
|
|
33
|
-
},
|
|
30
|
+
}, A = () => {
|
|
31
|
+
g(!k);
|
|
32
|
+
}, w = () => {
|
|
34
33
|
a || u.trim().length === 0 && l.length === 0 || (p == null || p(u, l), h(""), i.forEach((e) => URL.revokeObjectURL(e)), f(/* @__PURE__ */ new Map()), x([]));
|
|
35
|
-
}, A = (e) => {
|
|
36
|
-
const n = Array.from(e.target.files || []).filter((t) => !(k && t.size > k));
|
|
37
|
-
x((t) => [...t, ...n]), m == null || m(n), e.target.value = "";
|
|
38
34
|
}, F = (e) => {
|
|
35
|
+
const n = Array.from(e.target.files || []).filter((t) => !(v && t.size > v));
|
|
36
|
+
x((t) => [...t, ...n]), m == null || m(n), e.target.value = "";
|
|
37
|
+
}, O = (e) => {
|
|
39
38
|
const o = l[e];
|
|
40
39
|
if (o && b(o)) {
|
|
41
40
|
const n = `${o.name}-${o.size}-${o.lastModified}`, t = i.get(n);
|
|
42
41
|
t && (URL.revokeObjectURL(t), f((j) => {
|
|
43
|
-
const
|
|
44
|
-
return
|
|
42
|
+
const R = new Map(j);
|
|
43
|
+
return R.delete(n), R;
|
|
45
44
|
}));
|
|
46
45
|
}
|
|
47
46
|
x((n) => n.filter((t, j) => j !== e));
|
|
48
|
-
},
|
|
49
|
-
e.key === "Enter" && !e.shiftKey && (e.preventDefault(),
|
|
47
|
+
}, S = (e) => {
|
|
48
|
+
e.key === "Enter" && !e.shiftKey && (e.preventDefault(), w());
|
|
50
49
|
};
|
|
51
50
|
return B(() => () => {
|
|
52
51
|
i.forEach((e) => URL.revokeObjectURL(e));
|
|
@@ -57,8 +56,8 @@ const N = v(/* @__PURE__ */ r.jsx("path", {
|
|
|
57
56
|
placeholder: "Enter your message here...",
|
|
58
57
|
disabled: a,
|
|
59
58
|
value: u,
|
|
60
|
-
onChange:
|
|
61
|
-
onKeyDown:
|
|
59
|
+
onChange: P,
|
|
60
|
+
onKeyDown: S,
|
|
62
61
|
multiline: !0,
|
|
63
62
|
minRows: 1,
|
|
64
63
|
maxRows: 10,
|
|
@@ -113,7 +112,7 @@ const N = v(/* @__PURE__ */ r.jsx("path", {
|
|
|
113
112
|
s,
|
|
114
113
|
{
|
|
115
114
|
component: "img",
|
|
116
|
-
src:
|
|
115
|
+
src: $(e),
|
|
117
116
|
alt: e.name,
|
|
118
117
|
sx: {
|
|
119
118
|
width: 40,
|
|
@@ -126,15 +125,15 @@ const N = v(/* @__PURE__ */ r.jsx("path", {
|
|
|
126
125
|
}
|
|
127
126
|
) : /* @__PURE__ */ r.jsx(q, { extension: t }),
|
|
128
127
|
/* @__PURE__ */ r.jsxs(s, { display: "flex", flexDirection: "row", alignItems: "center", gap: 1, children: [
|
|
129
|
-
/* @__PURE__ */ r.jsx(
|
|
130
|
-
/* @__PURE__ */ r.jsx("div", { children: /* @__PURE__ */ r.jsxs(
|
|
128
|
+
/* @__PURE__ */ r.jsx(I, { variant: "subtitle2", textOverflow: "ellipsis", overflow: "hidden", whiteSpace: "nowrap", children: e.name }),
|
|
129
|
+
/* @__PURE__ */ r.jsx("div", { children: /* @__PURE__ */ r.jsxs(I, { variant: "caption", color: "text.secondary", children: [
|
|
131
130
|
"(",
|
|
132
131
|
Math.round(e.size / 1024),
|
|
133
132
|
" KB)"
|
|
134
133
|
] }) })
|
|
135
134
|
] })
|
|
136
135
|
] }),
|
|
137
|
-
/* @__PURE__ */ r.jsx(d, { size: "small", onClick: () =>
|
|
136
|
+
/* @__PURE__ */ r.jsx(d, { size: "small", onClick: () => O(o), sx: { minWidth: "auto", p: 0.5 }, children: /* @__PURE__ */ r.jsx(J, {}) })
|
|
138
137
|
]
|
|
139
138
|
},
|
|
140
139
|
`${e.name}-${o}`
|
|
@@ -148,13 +147,13 @@ const N = v(/* @__PURE__ */ r.jsx("path", {
|
|
|
148
147
|
type: "file",
|
|
149
148
|
multiple: !0,
|
|
150
149
|
accept: M,
|
|
151
|
-
onChange:
|
|
150
|
+
onChange: F,
|
|
152
151
|
style: { display: "none" },
|
|
153
|
-
id: `file-attachment-input-${
|
|
152
|
+
id: `file-attachment-input-${y}`,
|
|
154
153
|
disabled: a
|
|
155
154
|
}
|
|
156
155
|
),
|
|
157
|
-
/* @__PURE__ */ r.jsx("label", { htmlFor: `file-attachment-input-${
|
|
156
|
+
/* @__PURE__ */ r.jsx("label", { htmlFor: `file-attachment-input-${y}`, children: /* @__PURE__ */ r.jsx(
|
|
158
157
|
d,
|
|
159
158
|
{
|
|
160
159
|
component: "span",
|
|
@@ -172,8 +171,8 @@ const N = v(/* @__PURE__ */ r.jsx("path", {
|
|
|
172
171
|
/* @__PURE__ */ r.jsx(
|
|
173
172
|
d,
|
|
174
173
|
{
|
|
175
|
-
ref:
|
|
176
|
-
onClick:
|
|
174
|
+
ref: C,
|
|
175
|
+
onClick: A,
|
|
177
176
|
disabled: a,
|
|
178
177
|
size: "small",
|
|
179
178
|
sx: {
|
|
@@ -189,7 +188,7 @@ const N = v(/* @__PURE__ */ r.jsx("path", {
|
|
|
189
188
|
/* @__PURE__ */ r.jsx(
|
|
190
189
|
d,
|
|
191
190
|
{
|
|
192
|
-
onClick:
|
|
191
|
+
onClick: w,
|
|
193
192
|
disabled: a,
|
|
194
193
|
size: "small",
|
|
195
194
|
sx: {
|
|
@@ -202,7 +201,7 @@ const N = v(/* @__PURE__ */ r.jsx("path", {
|
|
|
202
201
|
}
|
|
203
202
|
)
|
|
204
203
|
] }),
|
|
205
|
-
/* @__PURE__ */ r.jsx(W, { open:
|
|
204
|
+
/* @__PURE__ */ r.jsx(W, { open: k, anchorEl: C.current, placement: "top-start", sx: { zIndex: 1300 }, children: /* @__PURE__ */ r.jsx(H, { onClickAway: () => g(!1), children: /* @__PURE__ */ r.jsx(
|
|
206
205
|
s,
|
|
207
206
|
{
|
|
208
207
|
sx: {
|
|
@@ -295,7 +294,7 @@ const N = v(/* @__PURE__ */ r.jsx("path", {
|
|
|
295
294
|
children: /* @__PURE__ */ r.jsx(
|
|
296
295
|
_,
|
|
297
296
|
{
|
|
298
|
-
onEmojiClick:
|
|
297
|
+
onEmojiClick: L,
|
|
299
298
|
width: 300,
|
|
300
299
|
height: 400,
|
|
301
300
|
searchDisabled: !1,
|
|
@@ -309,5 +308,5 @@ const N = v(/* @__PURE__ */ r.jsx("path", {
|
|
|
309
308
|
}
|
|
310
309
|
);
|
|
311
310
|
export {
|
|
312
|
-
|
|
311
|
+
le as default
|
|
313
312
|
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { default as React, ReactNode } from 'react';
|
|
2
|
+
import { ButtonProps, SxProps, Theme, TypographyProps } from '@mui/material';
|
|
3
|
+
export interface SErrorLayoutProps {
|
|
4
|
+
/** Source URL for the error image */
|
|
5
|
+
imageSrc: string;
|
|
6
|
+
/** Alt text for the error image */
|
|
7
|
+
imageAlt: string;
|
|
8
|
+
/** Main error title text */
|
|
9
|
+
title: string;
|
|
10
|
+
/** Error description text */
|
|
11
|
+
description: string | ReactNode;
|
|
12
|
+
/** Text for the action button. If not provided, button will not be shown */
|
|
13
|
+
buttonText?: string;
|
|
14
|
+
/** Link destination for the button. Default: '#' */
|
|
15
|
+
buttonHref?: string;
|
|
16
|
+
/** Image width. Default: '200px' */
|
|
17
|
+
imageWidth?: string | number;
|
|
18
|
+
/** Image height. Default: 'auto' */
|
|
19
|
+
imageHeight?: string | number;
|
|
20
|
+
/** Container max width. Default: 'lg' */
|
|
21
|
+
maxWidth?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | false;
|
|
22
|
+
/** Main container height. Default: '100vh' */
|
|
23
|
+
height?: string | number;
|
|
24
|
+
/** Vertical padding. Default: 8 (64px) */
|
|
25
|
+
py?: number | string;
|
|
26
|
+
/** Spacing between elements. Default: 6 */
|
|
27
|
+
spacing?: number;
|
|
28
|
+
/** Title typography variant. Default: 'h4' */
|
|
29
|
+
titleVariant?: TypographyProps['variant'];
|
|
30
|
+
/** Description typography variant. Default: 'body1' */
|
|
31
|
+
descriptionVariant?: TypographyProps['variant'];
|
|
32
|
+
/** Button variant. Default: 'contained' */
|
|
33
|
+
buttonVariant?: ButtonProps['variant'];
|
|
34
|
+
/** Button color. Default: 'primary' */
|
|
35
|
+
buttonColor?: ButtonProps['color'];
|
|
36
|
+
/** Custom styles for the main container */
|
|
37
|
+
containerSx?: SxProps<Theme>;
|
|
38
|
+
/** Custom styles for the image container */
|
|
39
|
+
imageContainerSx?: SxProps<Theme>;
|
|
40
|
+
/** Custom styles for the content stack */
|
|
41
|
+
contentSx?: SxProps<Theme>;
|
|
42
|
+
/** Custom styles for the title */
|
|
43
|
+
titleSx?: SxProps<Theme>;
|
|
44
|
+
/** Custom styles for the description */
|
|
45
|
+
descriptionSx?: SxProps<Theme>;
|
|
46
|
+
/** Custom styles for the button container */
|
|
47
|
+
buttonContainerSx?: SxProps<Theme>;
|
|
48
|
+
/** Additional button props */
|
|
49
|
+
buttonProps?: Partial<ButtonProps>;
|
|
50
|
+
/** Hide image. Default: false */
|
|
51
|
+
hideImage?: boolean;
|
|
52
|
+
/** Custom content to render instead of the button */
|
|
53
|
+
customActions?: ReactNode;
|
|
54
|
+
}
|
|
55
|
+
declare function SErrorLayout({ imageSrc, imageAlt, title, description, buttonText, buttonHref, imageWidth, imageHeight, maxWidth, height, py, spacing, titleVariant, descriptionVariant, buttonVariant, buttonColor, containerSx, imageContainerSx, contentSx, titleSx, descriptionSx, buttonContainerSx, buttonProps, hideImage, customActions, }: SErrorLayoutProps): React.JSX.Element;
|
|
56
|
+
export default SErrorLayout;
|