@solostylist/ui-kit 1.0.103 → 1.0.105
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/hooks/use-scroll-animation.d.ts +52 -0
- package/dist/hooks/use-scroll-animation.js +57 -0
- package/dist/main.d.ts +8 -0
- package/dist/main.js +142 -134
- package/dist/s-action-overlay/index.d.ts +2 -0
- package/dist/s-action-overlay/index.js +4 -0
- package/dist/s-action-overlay/package.json +5 -0
- package/dist/s-action-overlay/s-action-overlay.d.ts +29 -0
- package/dist/s-action-overlay/s-action-overlay.js +112 -0
- package/dist/s-blur-text/index.d.ts +2 -0
- package/dist/s-blur-text/index.js +4 -0
- package/dist/s-blur-text/package.json +5 -0
- package/dist/s-blur-text/s-blur-text.d.ts +43 -0
- package/dist/s-blur-text/s-blur-text.js +80 -0
- package/dist/s-chat-message/s-chat-message.js +18 -18
- package/dist/s-flex-box/index.d.ts +2 -0
- package/dist/s-flex-box/index.js +4 -0
- package/dist/s-flex-box/package.json +5 -0
- package/dist/s-flex-box/s-flex-box.d.ts +5 -0
- package/dist/s-flex-box/s-flex-box.js +6 -0
- package/dist/s-radial-pulse-animate/s-radial-pulse-animate.js +11 -11
- package/dist/s-scroll-reveal/index.d.ts +2 -0
- package/dist/s-scroll-reveal/index.js +4 -0
- package/dist/s-scroll-reveal/package.json +6 -0
- package/dist/s-scroll-reveal/s-scroll-reveal.d.ts +56 -0
- package/dist/s-scroll-reveal/s-scroll-reveal.js +63 -0
- package/dist/s-typewriter-text/index.d.ts +2 -0
- package/dist/s-typewriter-text/index.js +4 -0
- package/dist/s-typewriter-text/package.json +6 -0
- package/dist/s-typewriter-text/s-typewriter-text.d.ts +12 -0
- package/dist/s-typewriter-text/s-typewriter-text.js +44 -0
- package/dist/theme/customizations/inputs.js +0 -1
- package/dist/theme/theme-primitives.d.ts +54 -0
- package/dist/theme/theme-primitives.js +105 -55
- package/package.json +1 -1
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
interface UseScrollAnimationOptions {
|
|
2
|
+
threshold?: number;
|
|
3
|
+
rootMargin?: string;
|
|
4
|
+
delay?: number;
|
|
5
|
+
direction?: 'up' | 'down' | 'left' | 'right';
|
|
6
|
+
distance?: number;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* A React hook that provides scroll-triggered animation capabilities using Intersection Observer API.
|
|
10
|
+
*
|
|
11
|
+
* This hook monitors when an element enters the viewport and provides animation state and positioning
|
|
12
|
+
* data that can be used with CSS transitions, Framer Motion, or other animation libraries.
|
|
13
|
+
*
|
|
14
|
+
* @param options - Configuration options for the scroll animation
|
|
15
|
+
* @param options.threshold - A number between 0 and 1 indicating the percentage of the target that must be visible within the root element for the callback to be executed. Defaults to 0.1 (10%)
|
|
16
|
+
* @param options.rootMargin - Margin around the root element (similar to CSS margin). Defaults to '0px'
|
|
17
|
+
* @param options.delay - Delay in milliseconds before triggering the animation. Defaults to 0
|
|
18
|
+
* @param options.direction - The direction from which the element should animate in. Defaults to 'up'
|
|
19
|
+
* @param options.distance - The distance in pixels the element should animate from. Defaults to 50
|
|
20
|
+
*
|
|
21
|
+
* @returns An object containing:
|
|
22
|
+
* - ref: React ref to attach to the target element
|
|
23
|
+
* - isInView: Boolean indicating if the element is currently in view
|
|
24
|
+
* - initialPosition: Object with initial x/y coordinates and opacity for animation
|
|
25
|
+
* - finalPosition: Object with final x/y coordinates and opacity for animation
|
|
26
|
+
* - animate: Boolean indicating if animation should be triggered (same as isInView)
|
|
27
|
+
*
|
|
28
|
+
*/
|
|
29
|
+
export declare function useScrollAnimation(options?: UseScrollAnimationOptions): {
|
|
30
|
+
ref: import('react').RefObject<HTMLElement | null>;
|
|
31
|
+
isInView: boolean;
|
|
32
|
+
initialPosition: {
|
|
33
|
+
y: number;
|
|
34
|
+
opacity: number;
|
|
35
|
+
x?: undefined;
|
|
36
|
+
} | {
|
|
37
|
+
x: number;
|
|
38
|
+
opacity: number;
|
|
39
|
+
y?: undefined;
|
|
40
|
+
};
|
|
41
|
+
finalPosition: {
|
|
42
|
+
y: number;
|
|
43
|
+
opacity: number;
|
|
44
|
+
x?: undefined;
|
|
45
|
+
} | {
|
|
46
|
+
x: number;
|
|
47
|
+
opacity: number;
|
|
48
|
+
y?: undefined;
|
|
49
|
+
};
|
|
50
|
+
animate: boolean;
|
|
51
|
+
};
|
|
52
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { useState as m, useRef as f, useEffect as w } from "react";
|
|
2
|
+
function I(p = {}) {
|
|
3
|
+
const { threshold: o = 0.1, rootMargin: s = "0px", delay: i = 0, direction: a = "up", distance: t = 50 } = p, [l, r] = m(!1), c = f(null), e = f(null);
|
|
4
|
+
w(() => {
|
|
5
|
+
if (!c.current) return;
|
|
6
|
+
if (!("IntersectionObserver" in window)) {
|
|
7
|
+
r(!0);
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
const n = new IntersectionObserver(
|
|
11
|
+
([u]) => {
|
|
12
|
+
u.isIntersecting ? (e.current && (clearTimeout(e.current), e.current = null), i > 0 ? e.current = setTimeout(() => {
|
|
13
|
+
r(!0), n.unobserve(u.target);
|
|
14
|
+
}, i) : (r(!0), n.unobserve(u.target))) : (e.current && (clearTimeout(e.current), e.current = null), r(!1));
|
|
15
|
+
},
|
|
16
|
+
{ threshold: o, rootMargin: s }
|
|
17
|
+
);
|
|
18
|
+
return n.observe(c.current), () => {
|
|
19
|
+
e.current && (clearTimeout(e.current), e.current = null), n.disconnect();
|
|
20
|
+
};
|
|
21
|
+
}, [o, s, i]);
|
|
22
|
+
const y = () => {
|
|
23
|
+
switch (a) {
|
|
24
|
+
case "up":
|
|
25
|
+
return { y: t, opacity: 0 };
|
|
26
|
+
case "down":
|
|
27
|
+
return { y: -t, opacity: 0 };
|
|
28
|
+
case "left":
|
|
29
|
+
return { x: t, opacity: 0 };
|
|
30
|
+
case "right":
|
|
31
|
+
return { x: -t, opacity: 0 };
|
|
32
|
+
default:
|
|
33
|
+
return { y: t, opacity: 0 };
|
|
34
|
+
}
|
|
35
|
+
}, d = () => {
|
|
36
|
+
switch (a) {
|
|
37
|
+
case "up":
|
|
38
|
+
case "down":
|
|
39
|
+
return { y: 0, opacity: 1 };
|
|
40
|
+
case "left":
|
|
41
|
+
case "right":
|
|
42
|
+
return { x: 0, opacity: 1 };
|
|
43
|
+
default:
|
|
44
|
+
return { y: 0, opacity: 1 };
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
return {
|
|
48
|
+
ref: c,
|
|
49
|
+
isInView: l,
|
|
50
|
+
initialPosition: y(),
|
|
51
|
+
finalPosition: d(),
|
|
52
|
+
animate: l
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
export {
|
|
56
|
+
I as useScrollAnimation
|
|
57
|
+
};
|
package/dist/main.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export { default as SAccordion } from './s-accordion/index';
|
|
2
2
|
export type { SAccordionProps } from './s-accordion/index';
|
|
3
|
+
export { default as SActionOverlay } from './s-action-overlay/index';
|
|
4
|
+
export type { SActionOverlayProps, IActionOverlay } from './s-action-overlay/index';
|
|
3
5
|
export { default as SAutocomplete } from './s-autocomplete/index';
|
|
4
6
|
export type { SAutocompleteProps } from './s-autocomplete/index';
|
|
5
7
|
export { default as SAvatar } from './s-avatar/index';
|
|
@@ -31,6 +33,8 @@ export type { DialogMessageContextProps, DialogMessageOpenOptions } from './s-di
|
|
|
31
33
|
export { default as SError } from './s-error/index';
|
|
32
34
|
export { default as SEmpty } from './s-empty/index';
|
|
33
35
|
export type { SEmptyProps } from './s-empty/index';
|
|
36
|
+
export { default as SFlexBox } from './s-flex-box/index';
|
|
37
|
+
export type { SFlexBoxProps } from './s-flex-box/index';
|
|
34
38
|
export { default as SDialog } from './s-dialog/index';
|
|
35
39
|
export type { SDialogProps } from './s-dialog/index';
|
|
36
40
|
export { default as SFileDropzone } from './s-file-dropzone/index';
|
|
@@ -82,6 +86,8 @@ export { default as SGlowButton } from './s-glow-button/index';
|
|
|
82
86
|
export type { SGlowButtonProps } from './s-glow-button/index';
|
|
83
87
|
export { default as SMovingBorder } from './s-moving-border/index';
|
|
84
88
|
export type { SMovingBorderProps } from './s-moving-border/index';
|
|
89
|
+
export { default as SScrollReveal } from './s-scroll-reveal/index';
|
|
90
|
+
export type { SScrollRevealProps } from './s-scroll-reveal/index';
|
|
85
91
|
export { default as SSpotlightCursor } from './s-spotlight-cursor/index';
|
|
86
92
|
export type { SSpotlightCursorProps, SpotlightConfig } from './s-spotlight-cursor/index';
|
|
87
93
|
export { default as SCopyableText } from './s-copyable-text/index';
|
|
@@ -105,5 +111,7 @@ export { STabs, STab, STabPanel } from './s-tabs/index';
|
|
|
105
111
|
export type { STabsProps, STabItem, STabProps, STabPanelProps } from './s-tabs/index';
|
|
106
112
|
export { default as STextShimmer } from './s-text-shimmer/index';
|
|
107
113
|
export type { STextShimmerProps } from './s-text-shimmer/index';
|
|
114
|
+
export { default as STypewriterText } from './s-typewriter-text/index';
|
|
115
|
+
export type { STypewriterTextProps } from './s-typewriter-text/index';
|
|
108
116
|
export * from './hooks';
|
|
109
117
|
export * from './utils';
|
package/dist/main.js
CHANGED
|
@@ -1,140 +1,148 @@
|
|
|
1
1
|
import { default as t } from "./s-accordion/s-accordion.js";
|
|
2
|
-
import { default as f } from "./s-
|
|
3
|
-
import { default as s } from "./s-
|
|
4
|
-
import { default as p } from "./s-
|
|
5
|
-
import { default as S } from "./s-button
|
|
6
|
-
import { default as
|
|
7
|
-
import { default as n } from "./s-
|
|
8
|
-
import { default as c } from "./s-chat-
|
|
9
|
-
import { default as
|
|
2
|
+
import { default as f } from "./s-action-overlay/s-action-overlay.js";
|
|
3
|
+
import { default as s } from "./s-autocomplete/s-autocomplete.js";
|
|
4
|
+
import { default as p } from "./s-avatar/s-avatar.js";
|
|
5
|
+
import { default as S } from "./s-button/s-button.js";
|
|
6
|
+
import { default as u } from "./s-button-link/s-button-link.js";
|
|
7
|
+
import { default as n } from "./s-carousel/s-carousel.js";
|
|
8
|
+
import { default as c } from "./s-chat-input/s-chat-input.js";
|
|
9
|
+
import { default as v } from "./s-chat-message/s-chat-message.js";
|
|
10
|
+
import { default as P } from "./s-text-editor/s-text-editor.js";
|
|
10
11
|
import "./s-text-editor/s-text-editor-toolbar.js";
|
|
11
|
-
import { default as
|
|
12
|
-
import { default as
|
|
13
|
-
import { default as
|
|
14
|
-
import { default as
|
|
15
|
-
import { DialogConfirmProvider as
|
|
16
|
-
import { DialogMessageProvider as
|
|
17
|
-
import { default as
|
|
18
|
-
import { default as
|
|
19
|
-
import { default as
|
|
20
|
-
import { default as
|
|
21
|
-
import { default as
|
|
22
|
-
import { default as
|
|
23
|
-
import { default as
|
|
24
|
-
import { default as
|
|
25
|
-
import { default as
|
|
26
|
-
import { default as
|
|
27
|
-
import { default as
|
|
28
|
-
import { default as
|
|
29
|
-
import { default as
|
|
30
|
-
import { default as
|
|
31
|
-
import { default as
|
|
32
|
-
import { default as
|
|
33
|
-
import { default as
|
|
34
|
-
import { default as Ce } from "./s-
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import { default as
|
|
40
|
-
import { default as
|
|
41
|
-
import { default as
|
|
42
|
-
import { default as
|
|
43
|
-
import { default as
|
|
44
|
-
import { default as
|
|
45
|
-
import { default as
|
|
46
|
-
import { default as
|
|
47
|
-
import {
|
|
48
|
-
import { default as
|
|
49
|
-
import { default as
|
|
50
|
-
import { default as
|
|
51
|
-
import { default as
|
|
52
|
-
import { default as
|
|
53
|
-
import { default as
|
|
54
|
-
import { default as
|
|
55
|
-
import { default as
|
|
56
|
-
import { default as
|
|
57
|
-
import { default as
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
12
|
+
import { default as b } from "./s-checkbox/s-checkbox.js";
|
|
13
|
+
import { default as I } from "./s-chip/s-chip.js";
|
|
14
|
+
import { default as h } from "./s-chips/s-chips.js";
|
|
15
|
+
import { default as L } from "./s-data-table/s-data-table.js";
|
|
16
|
+
import { DialogConfirmProvider as B, default as A, useDialogConfirm as z } from "./s-dialog-confirm/s-dialog-confirm.js";
|
|
17
|
+
import { DialogMessageProvider as R, default as w, useDialogMessage as G } from "./s-dialog-message/s-dialog-message.js";
|
|
18
|
+
import { default as j } from "./s-error/s-error.js";
|
|
19
|
+
import { default as O } from "./s-empty/s-empty.js";
|
|
20
|
+
import { default as q } from "./s-flex-box/s-flex-box.js";
|
|
21
|
+
import { default as J } from "./s-dialog/s-dialog.js";
|
|
22
|
+
import { default as U } from "./s-file-dropzone/s-file-dropzone.js";
|
|
23
|
+
import { default as X } from "./s-file-icon/s-file-icon.js";
|
|
24
|
+
import { default as Z } from "./s-i18n-provider/s-i18n-provider.js";
|
|
25
|
+
import { default as $ } from "./s-icon-button/s-icon-button.js";
|
|
26
|
+
import { default as oe } from "./s-label/s-label.js";
|
|
27
|
+
import { default as te } from "./s-multi-select/s-multi-select.js";
|
|
28
|
+
import { default as fe } from "./s-no-ssr/s-no-ssr.js";
|
|
29
|
+
import { default as se } from "./s-text-field/s-text-field.js";
|
|
30
|
+
import { default as pe } from "./s-pagination/s-pagination.js";
|
|
31
|
+
import { default as Se } from "./s-select/s-select.js";
|
|
32
|
+
import { default as ue } from "./s-skeleton/s-skeleton.js";
|
|
33
|
+
import { default as ne } from "./s-tip/s-tip.js";
|
|
34
|
+
import { default as ce } from "./s-text-truncation/s-text-truncation.js";
|
|
35
|
+
import { default as ve, SnackbarMessageProvider as Ce, useSnackbarMessage as Pe } from "./s-snackbar-message/s-snackbar-message.js";
|
|
36
|
+
import { default as be } from "./s-form/s-form.js";
|
|
37
|
+
import { SSmartTextField as Ie } from "./s-smart-text-field/s-smart-text-field.js";
|
|
38
|
+
import { SCopilotKitProvider as he } from "./s-copilot-kit-provider/s-copilot-kit-provider.js";
|
|
39
|
+
import { SStripeCVC as Le, SStripeExpiry as Fe, SStripeNumber as Be, StripeTextField as Ae } from "./s-stripe/s-stripe.js";
|
|
40
|
+
import { default as Ee } from "./s-theme-provider/s-theme-provider.js";
|
|
41
|
+
import { default as we } from "./s-datetime-picker/s-datetime-picker.js";
|
|
42
|
+
import { default as Ne } from "./s-date-picker/s-date-picker.js";
|
|
43
|
+
import { default as Ke } from "./s-localization-provider/s-localization-provider.js";
|
|
44
|
+
import { default as Ve } from "./s-gradient-icon/s-gradient-icon.js";
|
|
45
|
+
import { default as He } from "./s-glow-button/s-glow-button.js";
|
|
46
|
+
import { default as Qe } from "./s-moving-border/s-moving-border.js";
|
|
47
|
+
import { default as We } from "./s-scroll-reveal/s-scroll-reveal.js";
|
|
48
|
+
import { default as Ye } from "./s-spotlight-cursor/s-spotlight-cursor.js";
|
|
49
|
+
import { default as _e } from "./s-copyable-text/s-copyable-text.js";
|
|
50
|
+
import { MediaItem as eo, default as oo } from "./s-interactive-gallery/s-interactive-gallery.js";
|
|
51
|
+
import { default as to } from "./s-image-modal/s-image-modal.js";
|
|
52
|
+
import { default as fo } from "./s-lazy-image/s-lazy-image.js";
|
|
53
|
+
import { default as so } from "./s-image-comparison/s-image-comparison.js";
|
|
54
|
+
import { default as po } from "./s-radial-pulse-animate/s-radial-pulse-animate.js";
|
|
55
|
+
import { default as So } from "./s-rating/s-rating.js";
|
|
56
|
+
import { default as io } from "./s-review/s-review.js";
|
|
57
|
+
import { default as go } from "./s-tabs/s-tabs.js";
|
|
58
|
+
import { default as To } from "./s-tabs/s-tab.js";
|
|
59
|
+
import { default as Co } from "./s-tabs/s-tab-panel.js";
|
|
60
|
+
import { default as Do } from "./s-text-shimmer/s-text-shimmer.js";
|
|
61
|
+
import { default as Mo } from "./s-typewriter-text/s-typewriter-text.js";
|
|
62
|
+
import { useDialog as yo } from "./hooks/use-dialog.js";
|
|
63
|
+
import { usePopover as ko } from "./hooks/use-popover.js";
|
|
64
|
+
import { formatDatePosted as Fo } from "./utils/dayjs.js";
|
|
65
|
+
import { bytesToSize as Ao } from "./utils/bytes-to-size.js";
|
|
66
|
+
import { LogLevel as Eo, Logger as Ro, createLogger as wo, logger as Go } from "./utils/logger.js";
|
|
67
|
+
import { default as jo } from "dayjs";
|
|
64
68
|
export {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
69
|
+
B as DialogConfirmProvider,
|
|
70
|
+
R as DialogMessageProvider,
|
|
71
|
+
Eo as LogLevel,
|
|
72
|
+
Ro as Logger,
|
|
73
|
+
eo as MediaItem,
|
|
70
74
|
t as SAccordion,
|
|
71
|
-
f as
|
|
72
|
-
s as
|
|
73
|
-
p as
|
|
74
|
-
S as
|
|
75
|
-
|
|
76
|
-
n as
|
|
77
|
-
c as
|
|
78
|
-
v as
|
|
79
|
-
b as
|
|
80
|
-
I as
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
Ie as
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
go as
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
75
|
+
f as SActionOverlay,
|
|
76
|
+
s as SAutocomplete,
|
|
77
|
+
p as SAvatar,
|
|
78
|
+
S as SButton,
|
|
79
|
+
u as SButtonLink,
|
|
80
|
+
n as SCarousel,
|
|
81
|
+
c as SChatInput,
|
|
82
|
+
v as SChatMessage,
|
|
83
|
+
b as SCheckbox,
|
|
84
|
+
I as SChip,
|
|
85
|
+
h as SChips,
|
|
86
|
+
he as SCopilotKitProvider,
|
|
87
|
+
_e as SCopyableText,
|
|
88
|
+
L as SDataTable,
|
|
89
|
+
Ne as SDatePicker,
|
|
90
|
+
we as SDateTimePicker,
|
|
91
|
+
J as SDialog,
|
|
92
|
+
A as SDialogConfirm,
|
|
93
|
+
w as SDialogMessage,
|
|
94
|
+
O as SEmpty,
|
|
95
|
+
j as SError,
|
|
96
|
+
U as SFileDropzone,
|
|
97
|
+
X as SFileIcon,
|
|
98
|
+
q as SFlexBox,
|
|
99
|
+
be as SForm,
|
|
100
|
+
He as SGlowButton,
|
|
101
|
+
Ve as SGradientIcon,
|
|
102
|
+
Z as SI18nProvider,
|
|
103
|
+
$ as SIconButton,
|
|
104
|
+
so as SImageComparison,
|
|
105
|
+
to as SImageModal,
|
|
106
|
+
oo as SInteractiveGallery,
|
|
107
|
+
oe as SLabel,
|
|
108
|
+
fo as SLazyImage,
|
|
109
|
+
Ke as SLocalizationProvider,
|
|
110
|
+
Qe as SMovingBorder,
|
|
111
|
+
te as SMultiSelect,
|
|
112
|
+
fe as SNoSsr,
|
|
113
|
+
pe as SPagination,
|
|
114
|
+
po as SRadialPulseAnimate,
|
|
115
|
+
So as SRating,
|
|
116
|
+
io as SReview,
|
|
117
|
+
We as SScrollReveal,
|
|
118
|
+
Se as SSelect,
|
|
119
|
+
ue as SSkeleton,
|
|
120
|
+
Ie as SSmartTextField,
|
|
121
|
+
ve as SSnackbarMessage,
|
|
122
|
+
Ye as SSpotlightCursor,
|
|
123
|
+
Le as SStripeCVC,
|
|
124
|
+
Fe as SStripeExpiry,
|
|
125
|
+
Be as SStripeNumber,
|
|
126
|
+
To as STab,
|
|
127
|
+
Co as STabPanel,
|
|
128
|
+
go as STabs,
|
|
129
|
+
P as STextEditor,
|
|
130
|
+
se as STextField,
|
|
131
|
+
Do as STextShimmer,
|
|
132
|
+
ce as STextTruncation,
|
|
133
|
+
Ee as SThemeProvider,
|
|
134
|
+
ne as STip,
|
|
135
|
+
Mo as STypewriterText,
|
|
136
|
+
Ce as SnackbarMessageProvider,
|
|
137
|
+
Ae as StripeTextField,
|
|
138
|
+
Ao as bytesToSize,
|
|
139
|
+
wo as createLogger,
|
|
140
|
+
jo as dayjs,
|
|
141
|
+
Fo as formatDatePosted,
|
|
142
|
+
Go as logger,
|
|
143
|
+
yo as useDialog,
|
|
144
|
+
z as useDialogConfirm,
|
|
137
145
|
G as useDialogMessage,
|
|
138
|
-
|
|
139
|
-
|
|
146
|
+
ko as usePopover,
|
|
147
|
+
Pe as useSnackbarMessage
|
|
140
148
|
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { SxProps, Theme } from '@mui/material';
|
|
3
|
+
import { SIconButtonProps } from '../s-icon-button';
|
|
4
|
+
export interface IActionOverlay {
|
|
5
|
+
icon: ReactNode;
|
|
6
|
+
tooltip: string;
|
|
7
|
+
onClick?: () => void;
|
|
8
|
+
isActive?: boolean;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
color?: 'inherit' | 'default' | 'primary' | 'secondary' | 'error' | 'info' | 'success' | 'warning';
|
|
11
|
+
iconButtonProps?: SIconButtonProps;
|
|
12
|
+
}
|
|
13
|
+
export interface SActionOverlayProps {
|
|
14
|
+
actions: IActionOverlay[];
|
|
15
|
+
maxWidth?: number | string;
|
|
16
|
+
columns?: number;
|
|
17
|
+
children: ReactNode;
|
|
18
|
+
showOnHover?: boolean;
|
|
19
|
+
visible?: boolean;
|
|
20
|
+
position?: 'center' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
21
|
+
backdropColor?: string;
|
|
22
|
+
backdropOpacity?: number;
|
|
23
|
+
blurAmount?: number;
|
|
24
|
+
borderRadius?: number | string;
|
|
25
|
+
overlaySx?: SxProps<Theme>;
|
|
26
|
+
onVisibilityChange?: (visible: boolean) => void;
|
|
27
|
+
}
|
|
28
|
+
declare const SActionOverlay: ({ actions, maxWidth, columns, children, showOnHover, visible: controlledVisible, position, backdropColor, backdropOpacity, blurAmount, borderRadius, overlaySx, onVisibilityChange, }: SActionOverlayProps) => import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export default SActionOverlay;
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { j as r } from "../jsx-runtime-DywqP_6a.js";
|
|
2
|
+
import { useState as _ } from "react";
|
|
3
|
+
import { Box as l, Grid as c } from "@mui/material";
|
|
4
|
+
import b from "../s-icon-button/s-icon-button.js";
|
|
5
|
+
const T = 40, B = 16, R = ({
|
|
6
|
+
actions: u,
|
|
7
|
+
maxWidth: d,
|
|
8
|
+
columns: s = 3,
|
|
9
|
+
children: p,
|
|
10
|
+
showOnHover: n = !0,
|
|
11
|
+
visible: o,
|
|
12
|
+
position: a = "center",
|
|
13
|
+
backdropColor: x = "divider",
|
|
14
|
+
backdropOpacity: m = 1,
|
|
15
|
+
blurAmount: j = 10,
|
|
16
|
+
borderRadius: v = 0,
|
|
17
|
+
overlaySx: g,
|
|
18
|
+
onVisibilityChange: e
|
|
19
|
+
}) => {
|
|
20
|
+
const [I, i] = _(!1), h = o !== void 0 ? o : n && I, y = () => {
|
|
21
|
+
n && o === void 0 && (i(!0), e == null || e(!0));
|
|
22
|
+
}, A = () => {
|
|
23
|
+
n && o === void 0 && (i(!1), e == null || e(!1));
|
|
24
|
+
}, E = () => {
|
|
25
|
+
switch (a) {
|
|
26
|
+
case "top-left":
|
|
27
|
+
return { justifyContent: "flex-start", alignItems: "flex-start" };
|
|
28
|
+
case "top-right":
|
|
29
|
+
return { justifyContent: "flex-end", alignItems: "flex-start" };
|
|
30
|
+
case "bottom-left":
|
|
31
|
+
return { justifyContent: "flex-start", alignItems: "flex-end" };
|
|
32
|
+
case "bottom-right":
|
|
33
|
+
return { justifyContent: "flex-end", alignItems: "flex-end" };
|
|
34
|
+
case "center":
|
|
35
|
+
default:
|
|
36
|
+
return { justifyContent: "center", alignItems: "center" };
|
|
37
|
+
}
|
|
38
|
+
}, M = () => {
|
|
39
|
+
switch (a) {
|
|
40
|
+
case "top-left":
|
|
41
|
+
return "flex-start";
|
|
42
|
+
case "top-right":
|
|
43
|
+
return "flex-end";
|
|
44
|
+
case "bottom-left":
|
|
45
|
+
return "flex-start";
|
|
46
|
+
case "bottom-right":
|
|
47
|
+
return "flex-end";
|
|
48
|
+
case "center":
|
|
49
|
+
default:
|
|
50
|
+
return "center";
|
|
51
|
+
}
|
|
52
|
+
}, k = () => {
|
|
53
|
+
let t = d;
|
|
54
|
+
return s && (t = s * T + (s - 1) * B + s * 16), t;
|
|
55
|
+
};
|
|
56
|
+
return (
|
|
57
|
+
// Main container with flex to center the children
|
|
58
|
+
/* @__PURE__ */ r.jsx(l, { display: "flex", children: /* @__PURE__ */ r.jsxs(l, { position: "relative", onMouseEnter: y, onMouseLeave: A, children: [
|
|
59
|
+
p,
|
|
60
|
+
h && /* @__PURE__ */ r.jsx(
|
|
61
|
+
l,
|
|
62
|
+
{
|
|
63
|
+
position: "absolute",
|
|
64
|
+
top: 0,
|
|
65
|
+
left: 0,
|
|
66
|
+
width: "100%",
|
|
67
|
+
height: "100%",
|
|
68
|
+
display: "flex",
|
|
69
|
+
bgcolor: x,
|
|
70
|
+
sx: {
|
|
71
|
+
opacity: m,
|
|
72
|
+
backdropFilter: `blur(${j}px)`,
|
|
73
|
+
transform: "translateZ(0)",
|
|
74
|
+
willChange: "transform",
|
|
75
|
+
transition: "opacity 0.2s ease-in-out",
|
|
76
|
+
...E(),
|
|
77
|
+
...g
|
|
78
|
+
},
|
|
79
|
+
borderRadius: v,
|
|
80
|
+
children: /* @__PURE__ */ r.jsx(c, { container: !0, spacing: 2, justifyContent: M(), maxWidth: k(), children: u.map((t, C) => {
|
|
81
|
+
var f;
|
|
82
|
+
return /* @__PURE__ */ r.jsx(c, { display: "flex", justifyContent: "center", children: /* @__PURE__ */ r.jsx(
|
|
83
|
+
b,
|
|
84
|
+
{
|
|
85
|
+
tooltipOptions: { title: t.tooltip, placement: "top" },
|
|
86
|
+
onClick: t.onClick,
|
|
87
|
+
disabled: t.disabled,
|
|
88
|
+
color: t.color,
|
|
89
|
+
size: "small",
|
|
90
|
+
sx: {
|
|
91
|
+
margin: 1,
|
|
92
|
+
backgroundColor: t.isActive ? "primary.main" : void 0,
|
|
93
|
+
transition: "all 0.2s cubic-bezier(0.4, 0, 0.2, 1)",
|
|
94
|
+
opacity: t.disabled ? 0.5 : 1,
|
|
95
|
+
"&:hover": {
|
|
96
|
+
backgroundColor: t.isActive ? "primary.dark" : void 0
|
|
97
|
+
},
|
|
98
|
+
...(f = t.iconButtonProps) == null ? void 0 : f.sx
|
|
99
|
+
},
|
|
100
|
+
...t.iconButtonProps,
|
|
101
|
+
children: t.icon
|
|
102
|
+
}
|
|
103
|
+
) }, `${t.tooltip}-${C}`);
|
|
104
|
+
}) })
|
|
105
|
+
}
|
|
106
|
+
)
|
|
107
|
+
] }) })
|
|
108
|
+
);
|
|
109
|
+
};
|
|
110
|
+
export {
|
|
111
|
+
R as default
|
|
112
|
+
};
|