@undefine-ui/design-system 2.3.0 → 2.4.0
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/index.cjs +74 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +51 -1
- package/dist/index.d.ts +51 -1
- package/dist/index.js +68 -10
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -154,6 +154,35 @@ declare const SettingsProvider: ({ children, settings }: SettingsProviderProps)
|
|
|
154
154
|
*/
|
|
155
155
|
declare const useSettings: () => SettingsContextProps;
|
|
156
156
|
|
|
157
|
+
type UseSetStateReturnType<T> = {
|
|
158
|
+
state: T;
|
|
159
|
+
setState: (updateState: SetStateAction<T>) => void;
|
|
160
|
+
setField: (name: keyof T, updateValue: T[keyof T]) => void;
|
|
161
|
+
onResetState: () => void;
|
|
162
|
+
canReset: boolean;
|
|
163
|
+
};
|
|
164
|
+
/**
|
|
165
|
+
* Custom hook for managing complex object state with field-level updates.
|
|
166
|
+
* Similar to useState but optimized for objects with helper functions.
|
|
167
|
+
*
|
|
168
|
+
* @template T - The type of the state object (must be a record)
|
|
169
|
+
* @param {T} initialState - The initial state object
|
|
170
|
+
* @returns {UseSetStateReturnType<T>} Object containing:
|
|
171
|
+
* - state: Current state object
|
|
172
|
+
* - setState: Function to update state (merges with previous state)
|
|
173
|
+
* - setField: Function to update a single field
|
|
174
|
+
* - onResetState: Function to reset to initial state
|
|
175
|
+
* - canReset: Boolean indicating if state differs from initial
|
|
176
|
+
*
|
|
177
|
+
* @example
|
|
178
|
+
* const { state, setField, onResetState } = useSetState({ name: '', age: 0 });
|
|
179
|
+
*
|
|
180
|
+
* setField('name', 'John');
|
|
181
|
+
* setField('age', 25);
|
|
182
|
+
* onResetState();
|
|
183
|
+
*/
|
|
184
|
+
declare const useSetState: <T extends Record<string, any>>(initialState: T) => UseSetStateReturnType<T>;
|
|
185
|
+
|
|
157
186
|
type ReturnType = boolean;
|
|
158
187
|
type Query = 'up' | 'down' | 'between' | 'only';
|
|
159
188
|
type Value = Breakpoint | number;
|
|
@@ -294,6 +323,27 @@ declare const useCopyToClipboard: () => {
|
|
|
294
323
|
isCopied: boolean;
|
|
295
324
|
};
|
|
296
325
|
|
|
326
|
+
/**
|
|
327
|
+
* Custom hook for tracking if an element or window has scrolled past a threshold.
|
|
328
|
+
*
|
|
329
|
+
* @param {number} [top=0] - The threshold in pixels
|
|
330
|
+
* @returns {Object} Object containing:
|
|
331
|
+
* - elementRef: Ref to attach to an element for element-specific tracking
|
|
332
|
+
* - offsetTop: Boolean indicating if scrolled past threshold
|
|
333
|
+
*
|
|
334
|
+
* @example
|
|
335
|
+
* // Track global scroll position
|
|
336
|
+
* const { offsetTop } = useScrollOffSetTop(80);
|
|
337
|
+
*
|
|
338
|
+
* // Track specific element position
|
|
339
|
+
* const { offsetTop, elementRef } = useScrollOffSetTop(80);
|
|
340
|
+
* <div ref={elementRef}>Content</div>
|
|
341
|
+
*/
|
|
342
|
+
declare const useScrollOffSetTop: (top?: number) => {
|
|
343
|
+
elementRef: React.RefObject<HTMLElement | null>;
|
|
344
|
+
offsetTop: boolean;
|
|
345
|
+
};
|
|
346
|
+
|
|
297
347
|
interface RadiusOptions {
|
|
298
348
|
'radius-0': string;
|
|
299
349
|
'radius-2xs': string;
|
|
@@ -1693,4 +1743,4 @@ interface LoadingScreenProps extends BoxProps {
|
|
|
1693
1743
|
declare const LoadingScreen: ({ portal, sx, ...rest }: LoadingScreenProps) => react_jsx_runtime.JSX.Element;
|
|
1694
1744
|
declare const SplashScreen: ({ portal, sx, ...rest }: LoadingScreenProps) => react_jsx_runtime.JSX.Element;
|
|
1695
1745
|
|
|
1696
|
-
export { AnimatedLogo, CheckboxDefault, CheckboxIndeterminate, CheckboxSelect, ClipboardCheck, CloudUpload, type ColorSchema, Copy, CopyButton, type CustomShadowOptions, type CustomSpacingOptions, Eye, EyeClosed, Field, Form, Icon, type IconProps, type IconType, InfoCircleFill, InfoCircleOutline, Loader, LoadingScreen, LocalStorageAvailable, LocalStorageGetItem, Logo, LongArrowUpLeftSolid, NavArrowDown, NavArrowLeft, NavArrowRight, RHFAutocomplete, type RHFAutocompleteProps, RHFCheckbox, type RHFCheckboxProps, RHFMultiCheckbox, type RHFMultiCheckboxOption, type RHFMultiCheckboxProps, RHFMultiSwitch, RHFRadioGroup, type RHFRadioGroupProps, RHFSwitch, RHFTextField, RHFUpload, type RHFUploadProps, RadioDefault, RadioSelect, type RadiusOptions, STORAGE_KEY, Search, SettingsConsumer, SettingsContext, type SettingsContextProps, SettingsProvider, type SettingsValueProps, SplashScreen, Table, type TableNoRowsProps, TablePagination, ThemeProvider, Trash, Upload, type UploadProps, type UseBooleanReturnType, UserFill, UserOutline, XMark, XMarkSolid, action, background, baseAction, basePalette, bgBlur, bgGradient, border, borderGradient, breakpoints, colorSchemes, common, components, createPaletteChannel, createShadowColor, createTheme, customShadows, customSpacing, darkPalette, defaultSettings, error, fCurrency, fData, fNumber, fPercent, fShortenNumber, getCurrencySymbol, getInitColorSchemeScript, getStorage, grey, hexToRgbChannel, hideScrollX, hideScrollY, icon, iconClasses, info, isEqual, lightPalette, maxLine, mediaQueries, menuItem, neutral, orderBy, paper, paramCase, primary, primaryFont, pxToRem, radius, remToPx, removeStorage, responsiveFontSizes, schemeConfig, secondary, secondaryFont, sentenceCase, setFont, setStorage, shadows, snakeCase, stylesMode, success, surface, tertiaryFont, text, textGradient, typography, updateComponentsWithSettings, updateCoreWithSettings, useBoolean, useCopyToClipboard, useEventListener, useLocalStorage, useResponsive, useSettings, useWidth, varAlpha, warning };
|
|
1746
|
+
export { AnimatedLogo, CheckboxDefault, CheckboxIndeterminate, CheckboxSelect, ClipboardCheck, CloudUpload, type ColorSchema, Copy, CopyButton, type CustomShadowOptions, type CustomSpacingOptions, Eye, EyeClosed, Field, Form, Icon, type IconProps, type IconType, InfoCircleFill, InfoCircleOutline, Loader, LoadingScreen, LocalStorageAvailable, LocalStorageGetItem, Logo, LongArrowUpLeftSolid, NavArrowDown, NavArrowLeft, NavArrowRight, RHFAutocomplete, type RHFAutocompleteProps, RHFCheckbox, type RHFCheckboxProps, RHFMultiCheckbox, type RHFMultiCheckboxOption, type RHFMultiCheckboxProps, RHFMultiSwitch, RHFRadioGroup, type RHFRadioGroupProps, RHFSwitch, RHFTextField, RHFUpload, type RHFUploadProps, RadioDefault, RadioSelect, type RadiusOptions, STORAGE_KEY, Search, SettingsConsumer, SettingsContext, type SettingsContextProps, SettingsProvider, type SettingsValueProps, SplashScreen, Table, type TableNoRowsProps, TablePagination, ThemeProvider, Trash, Upload, type UploadProps, type UseBooleanReturnType, type UseSetStateReturnType, UserFill, UserOutline, XMark, XMarkSolid, action, background, baseAction, basePalette, bgBlur, bgGradient, border, borderGradient, breakpoints, colorSchemes, common, components, createPaletteChannel, createShadowColor, createTheme, customShadows, customSpacing, darkPalette, defaultSettings, error, fCurrency, fData, fNumber, fPercent, fShortenNumber, getCurrencySymbol, getInitColorSchemeScript, getStorage, grey, hexToRgbChannel, hideScrollX, hideScrollY, icon, iconClasses, info, isEqual, lightPalette, maxLine, mediaQueries, menuItem, neutral, orderBy, paper, paramCase, primary, primaryFont, pxToRem, radius, remToPx, removeStorage, responsiveFontSizes, schemeConfig, secondary, secondaryFont, sentenceCase, setFont, setStorage, shadows, snakeCase, stylesMode, success, surface, tertiaryFont, text, textGradient, typography, updateComponentsWithSettings, updateCoreWithSettings, useBoolean, useCopyToClipboard, useEventListener, useLocalStorage, useResponsive, useScrollOffSetTop, useSetState, useSettings, useWidth, varAlpha, warning };
|
package/dist/index.d.ts
CHANGED
|
@@ -154,6 +154,35 @@ declare const SettingsProvider: ({ children, settings }: SettingsProviderProps)
|
|
|
154
154
|
*/
|
|
155
155
|
declare const useSettings: () => SettingsContextProps;
|
|
156
156
|
|
|
157
|
+
type UseSetStateReturnType<T> = {
|
|
158
|
+
state: T;
|
|
159
|
+
setState: (updateState: SetStateAction<T>) => void;
|
|
160
|
+
setField: (name: keyof T, updateValue: T[keyof T]) => void;
|
|
161
|
+
onResetState: () => void;
|
|
162
|
+
canReset: boolean;
|
|
163
|
+
};
|
|
164
|
+
/**
|
|
165
|
+
* Custom hook for managing complex object state with field-level updates.
|
|
166
|
+
* Similar to useState but optimized for objects with helper functions.
|
|
167
|
+
*
|
|
168
|
+
* @template T - The type of the state object (must be a record)
|
|
169
|
+
* @param {T} initialState - The initial state object
|
|
170
|
+
* @returns {UseSetStateReturnType<T>} Object containing:
|
|
171
|
+
* - state: Current state object
|
|
172
|
+
* - setState: Function to update state (merges with previous state)
|
|
173
|
+
* - setField: Function to update a single field
|
|
174
|
+
* - onResetState: Function to reset to initial state
|
|
175
|
+
* - canReset: Boolean indicating if state differs from initial
|
|
176
|
+
*
|
|
177
|
+
* @example
|
|
178
|
+
* const { state, setField, onResetState } = useSetState({ name: '', age: 0 });
|
|
179
|
+
*
|
|
180
|
+
* setField('name', 'John');
|
|
181
|
+
* setField('age', 25);
|
|
182
|
+
* onResetState();
|
|
183
|
+
*/
|
|
184
|
+
declare const useSetState: <T extends Record<string, any>>(initialState: T) => UseSetStateReturnType<T>;
|
|
185
|
+
|
|
157
186
|
type ReturnType = boolean;
|
|
158
187
|
type Query = 'up' | 'down' | 'between' | 'only';
|
|
159
188
|
type Value = Breakpoint | number;
|
|
@@ -294,6 +323,27 @@ declare const useCopyToClipboard: () => {
|
|
|
294
323
|
isCopied: boolean;
|
|
295
324
|
};
|
|
296
325
|
|
|
326
|
+
/**
|
|
327
|
+
* Custom hook for tracking if an element or window has scrolled past a threshold.
|
|
328
|
+
*
|
|
329
|
+
* @param {number} [top=0] - The threshold in pixels
|
|
330
|
+
* @returns {Object} Object containing:
|
|
331
|
+
* - elementRef: Ref to attach to an element for element-specific tracking
|
|
332
|
+
* - offsetTop: Boolean indicating if scrolled past threshold
|
|
333
|
+
*
|
|
334
|
+
* @example
|
|
335
|
+
* // Track global scroll position
|
|
336
|
+
* const { offsetTop } = useScrollOffSetTop(80);
|
|
337
|
+
*
|
|
338
|
+
* // Track specific element position
|
|
339
|
+
* const { offsetTop, elementRef } = useScrollOffSetTop(80);
|
|
340
|
+
* <div ref={elementRef}>Content</div>
|
|
341
|
+
*/
|
|
342
|
+
declare const useScrollOffSetTop: (top?: number) => {
|
|
343
|
+
elementRef: React.RefObject<HTMLElement | null>;
|
|
344
|
+
offsetTop: boolean;
|
|
345
|
+
};
|
|
346
|
+
|
|
297
347
|
interface RadiusOptions {
|
|
298
348
|
'radius-0': string;
|
|
299
349
|
'radius-2xs': string;
|
|
@@ -1693,4 +1743,4 @@ interface LoadingScreenProps extends BoxProps {
|
|
|
1693
1743
|
declare const LoadingScreen: ({ portal, sx, ...rest }: LoadingScreenProps) => react_jsx_runtime.JSX.Element;
|
|
1694
1744
|
declare const SplashScreen: ({ portal, sx, ...rest }: LoadingScreenProps) => react_jsx_runtime.JSX.Element;
|
|
1695
1745
|
|
|
1696
|
-
export { AnimatedLogo, CheckboxDefault, CheckboxIndeterminate, CheckboxSelect, ClipboardCheck, CloudUpload, type ColorSchema, Copy, CopyButton, type CustomShadowOptions, type CustomSpacingOptions, Eye, EyeClosed, Field, Form, Icon, type IconProps, type IconType, InfoCircleFill, InfoCircleOutline, Loader, LoadingScreen, LocalStorageAvailable, LocalStorageGetItem, Logo, LongArrowUpLeftSolid, NavArrowDown, NavArrowLeft, NavArrowRight, RHFAutocomplete, type RHFAutocompleteProps, RHFCheckbox, type RHFCheckboxProps, RHFMultiCheckbox, type RHFMultiCheckboxOption, type RHFMultiCheckboxProps, RHFMultiSwitch, RHFRadioGroup, type RHFRadioGroupProps, RHFSwitch, RHFTextField, RHFUpload, type RHFUploadProps, RadioDefault, RadioSelect, type RadiusOptions, STORAGE_KEY, Search, SettingsConsumer, SettingsContext, type SettingsContextProps, SettingsProvider, type SettingsValueProps, SplashScreen, Table, type TableNoRowsProps, TablePagination, ThemeProvider, Trash, Upload, type UploadProps, type UseBooleanReturnType, UserFill, UserOutline, XMark, XMarkSolid, action, background, baseAction, basePalette, bgBlur, bgGradient, border, borderGradient, breakpoints, colorSchemes, common, components, createPaletteChannel, createShadowColor, createTheme, customShadows, customSpacing, darkPalette, defaultSettings, error, fCurrency, fData, fNumber, fPercent, fShortenNumber, getCurrencySymbol, getInitColorSchemeScript, getStorage, grey, hexToRgbChannel, hideScrollX, hideScrollY, icon, iconClasses, info, isEqual, lightPalette, maxLine, mediaQueries, menuItem, neutral, orderBy, paper, paramCase, primary, primaryFont, pxToRem, radius, remToPx, removeStorage, responsiveFontSizes, schemeConfig, secondary, secondaryFont, sentenceCase, setFont, setStorage, shadows, snakeCase, stylesMode, success, surface, tertiaryFont, text, textGradient, typography, updateComponentsWithSettings, updateCoreWithSettings, useBoolean, useCopyToClipboard, useEventListener, useLocalStorage, useResponsive, useSettings, useWidth, varAlpha, warning };
|
|
1746
|
+
export { AnimatedLogo, CheckboxDefault, CheckboxIndeterminate, CheckboxSelect, ClipboardCheck, CloudUpload, type ColorSchema, Copy, CopyButton, type CustomShadowOptions, type CustomSpacingOptions, Eye, EyeClosed, Field, Form, Icon, type IconProps, type IconType, InfoCircleFill, InfoCircleOutline, Loader, LoadingScreen, LocalStorageAvailable, LocalStorageGetItem, Logo, LongArrowUpLeftSolid, NavArrowDown, NavArrowLeft, NavArrowRight, RHFAutocomplete, type RHFAutocompleteProps, RHFCheckbox, type RHFCheckboxProps, RHFMultiCheckbox, type RHFMultiCheckboxOption, type RHFMultiCheckboxProps, RHFMultiSwitch, RHFRadioGroup, type RHFRadioGroupProps, RHFSwitch, RHFTextField, RHFUpload, type RHFUploadProps, RadioDefault, RadioSelect, type RadiusOptions, STORAGE_KEY, Search, SettingsConsumer, SettingsContext, type SettingsContextProps, SettingsProvider, type SettingsValueProps, SplashScreen, Table, type TableNoRowsProps, TablePagination, ThemeProvider, Trash, Upload, type UploadProps, type UseBooleanReturnType, type UseSetStateReturnType, UserFill, UserOutline, XMark, XMarkSolid, action, background, baseAction, basePalette, bgBlur, bgGradient, border, borderGradient, breakpoints, colorSchemes, common, components, createPaletteChannel, createShadowColor, createTheme, customShadows, customSpacing, darkPalette, defaultSettings, error, fCurrency, fData, fNumber, fPercent, fShortenNumber, getCurrencySymbol, getInitColorSchemeScript, getStorage, grey, hexToRgbChannel, hideScrollX, hideScrollY, icon, iconClasses, info, isEqual, lightPalette, maxLine, mediaQueries, menuItem, neutral, orderBy, paper, paramCase, primary, primaryFont, pxToRem, radius, remToPx, removeStorage, responsiveFontSizes, schemeConfig, secondary, secondaryFont, sentenceCase, setFont, setStorage, shadows, snakeCase, stylesMode, success, surface, tertiaryFont, text, textGradient, typography, updateComponentsWithSettings, updateCoreWithSettings, useBoolean, useCopyToClipboard, useEventListener, useLocalStorage, useResponsive, useScrollOffSetTop, useSetState, useSettings, useWidth, varAlpha, warning };
|
package/dist/index.js
CHANGED
|
@@ -554,13 +554,43 @@ var useSettings = () => {
|
|
|
554
554
|
return context;
|
|
555
555
|
};
|
|
556
556
|
|
|
557
|
+
// src/hooks/useSetState.ts
|
|
558
|
+
import { useMemo as useMemo4, useState as useState4, useCallback as useCallback4 } from "react";
|
|
559
|
+
var useSetState = (initialState) => {
|
|
560
|
+
const [state, set] = useState4(initialState);
|
|
561
|
+
const canReset = !isEqual(state, initialState);
|
|
562
|
+
const setState = useCallback4((updateState) => {
|
|
563
|
+
set((prevValue) => ({ ...prevValue, ...updateState }));
|
|
564
|
+
}, []);
|
|
565
|
+
const setField = useCallback4(
|
|
566
|
+
(name, updateValue) => {
|
|
567
|
+
setState({ [name]: updateValue });
|
|
568
|
+
},
|
|
569
|
+
[setState]
|
|
570
|
+
);
|
|
571
|
+
const onResetState = useCallback4(() => {
|
|
572
|
+
set(initialState);
|
|
573
|
+
}, [initialState]);
|
|
574
|
+
const memoizedValue = useMemo4(
|
|
575
|
+
() => ({
|
|
576
|
+
state,
|
|
577
|
+
setState,
|
|
578
|
+
setField,
|
|
579
|
+
onResetState,
|
|
580
|
+
canReset
|
|
581
|
+
}),
|
|
582
|
+
[canReset, onResetState, setField, setState, state]
|
|
583
|
+
);
|
|
584
|
+
return memoizedValue;
|
|
585
|
+
};
|
|
586
|
+
|
|
557
587
|
// src/hooks/useResponsive.ts
|
|
558
|
-
import { useMemo as
|
|
588
|
+
import { useMemo as useMemo5 } from "react";
|
|
559
589
|
import useMediaQuery from "@mui/material/useMediaQuery";
|
|
560
590
|
import { useTheme } from "@mui/material/styles";
|
|
561
591
|
var useResponsive = (query, start, end) => {
|
|
562
592
|
const theme = useTheme();
|
|
563
|
-
const getQuery =
|
|
593
|
+
const getQuery = useMemo5(() => {
|
|
564
594
|
switch (query) {
|
|
565
595
|
case "up":
|
|
566
596
|
return theme.breakpoints.up(start);
|
|
@@ -579,7 +609,7 @@ var useResponsive = (query, start, end) => {
|
|
|
579
609
|
};
|
|
580
610
|
var useWidth = () => {
|
|
581
611
|
const theme = useTheme();
|
|
582
|
-
const keys =
|
|
612
|
+
const keys = useMemo5(() => [...theme.breakpoints.keys].reverse(), [theme]);
|
|
583
613
|
const width = keys.reduce((output, key) => {
|
|
584
614
|
const matches = useMediaQuery(theme.breakpoints.up(key));
|
|
585
615
|
return !output && matches ? key : output;
|
|
@@ -614,11 +644,11 @@ var useEventListener = ({
|
|
|
614
644
|
};
|
|
615
645
|
|
|
616
646
|
// src/hooks/useCopyToClipboard.ts
|
|
617
|
-
import { useMemo as
|
|
647
|
+
import { useMemo as useMemo6, useState as useState5, useCallback as useCallback5 } from "react";
|
|
618
648
|
var useCopyToClipboard = () => {
|
|
619
|
-
const [copiedText, setCopiedText] =
|
|
620
|
-
const [isCopied, setIsCopied] =
|
|
621
|
-
const copy =
|
|
649
|
+
const [copiedText, setCopiedText] = useState5("");
|
|
650
|
+
const [isCopied, setIsCopied] = useState5(false);
|
|
651
|
+
const copy = useCallback5(
|
|
622
652
|
async (text2) => {
|
|
623
653
|
if (!navigator?.clipboard) {
|
|
624
654
|
console.warn("Clipboard not supported");
|
|
@@ -638,13 +668,39 @@ var useCopyToClipboard = () => {
|
|
|
638
668
|
},
|
|
639
669
|
[setCopiedText]
|
|
640
670
|
);
|
|
641
|
-
const memoizedValue =
|
|
671
|
+
const memoizedValue = useMemo6(
|
|
642
672
|
() => ({ copy, copiedText, isCopied }),
|
|
643
673
|
[copy, copiedText, isCopied]
|
|
644
674
|
);
|
|
645
675
|
return memoizedValue;
|
|
646
676
|
};
|
|
647
677
|
|
|
678
|
+
// src/hooks/useScrollOffsetTop.ts
|
|
679
|
+
import { useRef as useRef2, useMemo as useMemo7, useState as useState6, useEffect as useEffect3, useCallback as useCallback6 } from "react";
|
|
680
|
+
var useScrollOffSetTop = (top = 0) => {
|
|
681
|
+
const elementRef = useRef2(null);
|
|
682
|
+
const [offsetTop, setOffsetTop] = useState6(false);
|
|
683
|
+
const handleScrollChange = useCallback6(() => {
|
|
684
|
+
const scrollHeight = Math.round(window.scrollY);
|
|
685
|
+
if (elementRef?.current) {
|
|
686
|
+
const rect = elementRef.current.getBoundingClientRect();
|
|
687
|
+
const elementTop = Math.round(rect.top);
|
|
688
|
+
setOffsetTop(elementTop < top);
|
|
689
|
+
} else {
|
|
690
|
+
setOffsetTop(scrollHeight > top);
|
|
691
|
+
}
|
|
692
|
+
}, [top]);
|
|
693
|
+
useEffect3(() => {
|
|
694
|
+
handleScrollChange();
|
|
695
|
+
window.addEventListener("scroll", handleScrollChange, { passive: true });
|
|
696
|
+
return () => {
|
|
697
|
+
window.removeEventListener("scroll", handleScrollChange);
|
|
698
|
+
};
|
|
699
|
+
}, [handleScrollChange]);
|
|
700
|
+
const memoizedValue = useMemo7(() => ({ elementRef, offsetTop }), [offsetTop]);
|
|
701
|
+
return memoizedValue;
|
|
702
|
+
};
|
|
703
|
+
|
|
648
704
|
// src/theme/core/radius.ts
|
|
649
705
|
function radius(baseRadius) {
|
|
650
706
|
return {
|
|
@@ -5927,7 +5983,7 @@ var UploadProgress = ({ progress: progress2 = 20 }) => {
|
|
|
5927
5983
|
};
|
|
5928
5984
|
|
|
5929
5985
|
// src/components/Upload/components/MultiFilePreview.tsx
|
|
5930
|
-
import { useRef as
|
|
5986
|
+
import { useRef as useRef3 } from "react";
|
|
5931
5987
|
import Box9 from "@mui/material/Box";
|
|
5932
5988
|
import IconButton2 from "@mui/material/IconButton";
|
|
5933
5989
|
|
|
@@ -5995,7 +6051,7 @@ var DeleteButton = ({ sx, ...rest }) => {
|
|
|
5995
6051
|
// src/components/Upload/components/MultiFilePreview.tsx
|
|
5996
6052
|
import { jsx as jsx45, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
5997
6053
|
var MultiFilePreview = ({ files, onRemove }) => {
|
|
5998
|
-
const scrollRef =
|
|
6054
|
+
const scrollRef = useRef3(null);
|
|
5999
6055
|
const handleScroll = (direction) => {
|
|
6000
6056
|
if (scrollRef.current) {
|
|
6001
6057
|
const scrollAmount = 300;
|
|
@@ -6967,6 +7023,8 @@ export {
|
|
|
6967
7023
|
useEventListener,
|
|
6968
7024
|
useLocalStorage,
|
|
6969
7025
|
useResponsive,
|
|
7026
|
+
useScrollOffSetTop,
|
|
7027
|
+
useSetState,
|
|
6970
7028
|
useSettings,
|
|
6971
7029
|
useWidth,
|
|
6972
7030
|
varAlpha,
|