@undefine-ui/design-system 2.11.0 → 2.13.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/README.md +124 -7
- package/dist/index.cjs +465 -176
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +182 -2
- package/dist/index.d.ts +182 -2
- package/dist/index.js +457 -171
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { SetStateAction, ElementType } from 'react';
|
|
2
|
+
import { SetStateAction, ElementType, CSSProperties, ReactNode, SyntheticEvent } from 'react';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import { Breakpoint, Shadows, Components, Theme, SxProps as SxProps$1 } from '@mui/material/styles';
|
|
5
5
|
import * as _mui_material from '@mui/material';
|
|
@@ -234,6 +234,115 @@ type UseSetStateReturnType<T> = {
|
|
|
234
234
|
*/
|
|
235
235
|
declare const useSetState: <T extends Record<string, any>>(initialState: T) => UseSetStateReturnType<T>;
|
|
236
236
|
|
|
237
|
+
interface CountdownState {
|
|
238
|
+
days: string;
|
|
239
|
+
hours: string;
|
|
240
|
+
minutes: string;
|
|
241
|
+
seconds: string;
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* A custom hook for creating a countdown timer to a specific date/time.
|
|
245
|
+
*
|
|
246
|
+
* Calculates and returns the time remaining until a target date, automatically
|
|
247
|
+
* updating every second. Returns zero values when the target time is reached.
|
|
248
|
+
*
|
|
249
|
+
* @param date - The target date/time as a Date object, ISO string, or Unix timestamp
|
|
250
|
+
*
|
|
251
|
+
* @returns An object containing:
|
|
252
|
+
* - `days` (string): Days remaining, zero-padded (e.g., "00", "05", "12")
|
|
253
|
+
* - `hours` (string): Hours remaining, zero-padded (e.g., "00", "23")
|
|
254
|
+
* - `minutes` (string): Minutes remaining, zero-padded (e.g., "00", "59")
|
|
255
|
+
* - `seconds` (string): Seconds remaining, zero-padded (e.g., "00", "59")
|
|
256
|
+
*
|
|
257
|
+
* @example
|
|
258
|
+
* ```tsx
|
|
259
|
+
* function EventCountdown() {
|
|
260
|
+
* const countdown = useCountdownDate(new Date('2025-12-31T23:59:59'));
|
|
261
|
+
*
|
|
262
|
+
* return (
|
|
263
|
+
* <div>
|
|
264
|
+
* <h2>Time Until New Year:</h2>
|
|
265
|
+
* <p>
|
|
266
|
+
* {countdown.days} days, {countdown.hours} hours,
|
|
267
|
+
* {countdown.minutes} minutes, {countdown.seconds} seconds
|
|
268
|
+
* </p>
|
|
269
|
+
* </div>
|
|
270
|
+
* );
|
|
271
|
+
* }
|
|
272
|
+
* ```
|
|
273
|
+
*
|
|
274
|
+
* @example
|
|
275
|
+
* ```tsx
|
|
276
|
+
* // Using Unix timestamp
|
|
277
|
+
* const countdown = useCountdownDate(1735689599000);
|
|
278
|
+
*
|
|
279
|
+
* // Using ISO string
|
|
280
|
+
* const countdown = useCountdownDate('2025-12-31T23:59:59Z');
|
|
281
|
+
* ```
|
|
282
|
+
*/
|
|
283
|
+
declare const useCountdownDate: (date: Date | string | number) => CountdownState;
|
|
284
|
+
interface UseCountdownSecondsReturn {
|
|
285
|
+
counting: boolean;
|
|
286
|
+
countdown: number;
|
|
287
|
+
startCountdown: () => void;
|
|
288
|
+
setCountdown: React.Dispatch<React.SetStateAction<number>>;
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* A custom hook for creating a countdown timer that counts down from a specified number of seconds.
|
|
292
|
+
*
|
|
293
|
+
* Provides manual control to start the countdown and tracks whether counting is in progress.
|
|
294
|
+
* Automatically cleans up intervals on unmount.
|
|
295
|
+
*
|
|
296
|
+
* @param initCountdown - Initial number of seconds for the countdown
|
|
297
|
+
*
|
|
298
|
+
* @returns An object containing:
|
|
299
|
+
* - `counting` (boolean): Whether countdown is actively running (between 0 and initCountdown)
|
|
300
|
+
* - `countdown` (number): Current countdown value in seconds
|
|
301
|
+
* - `startCountdown` (function): Function to start or restart the countdown
|
|
302
|
+
* - `setCountdown` (function): Direct setter for the countdown value
|
|
303
|
+
*
|
|
304
|
+
* @example
|
|
305
|
+
* ```tsx
|
|
306
|
+
* function OTPTimer() {
|
|
307
|
+
* const { countdown, counting, startCountdown } = useCountdownSeconds(60);
|
|
308
|
+
*
|
|
309
|
+
* return (
|
|
310
|
+
* <div>
|
|
311
|
+
* <p>Resend code in: {countdown}s</p>
|
|
312
|
+
* <button onClick={startCountdown} disabled={counting}>
|
|
313
|
+
* {counting ? 'Waiting...' : 'Resend Code'}
|
|
314
|
+
* </button>
|
|
315
|
+
* </div>
|
|
316
|
+
* );
|
|
317
|
+
* }
|
|
318
|
+
* ```
|
|
319
|
+
*
|
|
320
|
+
* @example
|
|
321
|
+
* ```tsx
|
|
322
|
+
* function SessionTimer() {
|
|
323
|
+
* const { countdown, counting, startCountdown, setCountdown } = useCountdownSeconds(300);
|
|
324
|
+
*
|
|
325
|
+
* useEffect(() => {
|
|
326
|
+
* // Start countdown when component mounts
|
|
327
|
+
* startCountdown();
|
|
328
|
+
* }, [startCountdown]);
|
|
329
|
+
*
|
|
330
|
+
* const extendSession = () => {
|
|
331
|
+
* // Add 60 more seconds
|
|
332
|
+
* setCountdown((prev) => prev + 60);
|
|
333
|
+
* };
|
|
334
|
+
*
|
|
335
|
+
* return (
|
|
336
|
+
* <div>
|
|
337
|
+
* <p>Session expires in: {Math.floor(countdown / 60)}:{countdown % 60}</p>
|
|
338
|
+
* <button onClick={extendSession}>Extend Session</button>
|
|
339
|
+
* </div>
|
|
340
|
+
* );
|
|
341
|
+
* }
|
|
342
|
+
* ```
|
|
343
|
+
*/
|
|
344
|
+
declare const useCountdownSeconds: (initCountdown: number) => UseCountdownSecondsReturn;
|
|
345
|
+
|
|
237
346
|
type ReturnType = boolean;
|
|
238
347
|
type Query = 'up' | 'down' | 'between' | 'only';
|
|
239
348
|
type Value = Breakpoint | number;
|
|
@@ -1648,6 +1757,77 @@ interface LogoProps extends BoxProps {
|
|
|
1648
1757
|
declare const Logo: ({ sx, isFull, isWhite, isBlack, disableLink, LinkComponent, href, src, alt, ...rest }: LogoProps) => react_jsx_runtime.JSX.Element;
|
|
1649
1758
|
declare const AnimatedLogo: () => react_jsx_runtime.JSX.Element;
|
|
1650
1759
|
|
|
1760
|
+
type ImageStatus = 'idle' | 'loading' | 'loaded' | 'error';
|
|
1761
|
+
interface ImageProps extends Omit<BoxProps, 'component' | 'children' | 'position'> {
|
|
1762
|
+
src: string;
|
|
1763
|
+
alt: string;
|
|
1764
|
+
/**
|
|
1765
|
+
* Load the image only when it enters the viewport.
|
|
1766
|
+
* Defaults to true.
|
|
1767
|
+
*/
|
|
1768
|
+
lazy?: boolean;
|
|
1769
|
+
/**
|
|
1770
|
+
* Fallback URL used when the main source fails to load.
|
|
1771
|
+
*/
|
|
1772
|
+
fallbackSrc?: string;
|
|
1773
|
+
/**
|
|
1774
|
+
* Responsive image sources for different screen sizes/resolutions.
|
|
1775
|
+
* Example: "image-320w.jpg 320w, image-640w.jpg 640w, image-1280w.jpg 1280w"
|
|
1776
|
+
*/
|
|
1777
|
+
srcSet?: string;
|
|
1778
|
+
/**
|
|
1779
|
+
* Sizes attribute for responsive images. Defines which image size to use at different viewport widths.
|
|
1780
|
+
* Example: "(max-width: 600px) 100vw, (max-width: 1200px) 50vw, 33vw"
|
|
1781
|
+
*/
|
|
1782
|
+
sizes?: string;
|
|
1783
|
+
/**
|
|
1784
|
+
* Aspect ratio (e.g. "16 / 9" or 1.5) applied to the wrapper to avoid layout shift.
|
|
1785
|
+
*/
|
|
1786
|
+
aspectRatio?: number | string;
|
|
1787
|
+
/**
|
|
1788
|
+
* Controls object-fit of the underlying image. Defaults to "cover".
|
|
1789
|
+
*/
|
|
1790
|
+
fit?: CSSProperties['objectFit'];
|
|
1791
|
+
/**
|
|
1792
|
+
* Controls object-position of the underlying image. Defaults to "center".
|
|
1793
|
+
*/
|
|
1794
|
+
position?: CSSProperties['objectPosition'];
|
|
1795
|
+
/**
|
|
1796
|
+
* Optional overlay content rendered above the image.
|
|
1797
|
+
*/
|
|
1798
|
+
overlay?: ReactNode;
|
|
1799
|
+
/**
|
|
1800
|
+
* Enables overlay even when overlay content is not provided.
|
|
1801
|
+
*/
|
|
1802
|
+
withOverlay?: boolean;
|
|
1803
|
+
/**
|
|
1804
|
+
* Custom loading indicator shown before the image is loaded.
|
|
1805
|
+
*/
|
|
1806
|
+
loadingIndicator?: ReactNode;
|
|
1807
|
+
/**
|
|
1808
|
+
* Custom error fallback content when both src and fallbackSrc fail.
|
|
1809
|
+
*/
|
|
1810
|
+
renderError?: ReactNode;
|
|
1811
|
+
/**
|
|
1812
|
+
* Additional styles for the underlying image element.
|
|
1813
|
+
*/
|
|
1814
|
+
imgSx?: BoxProps['sx'];
|
|
1815
|
+
/**
|
|
1816
|
+
* Additional props for the underlying image element.
|
|
1817
|
+
*/
|
|
1818
|
+
imgProps?: Omit<BoxProps<'img'>, 'component' | 'sx' | 'ref' | 'src' | 'alt' | 'children'>;
|
|
1819
|
+
/**
|
|
1820
|
+
* Root margin passed to the IntersectionObserver. Defaults to "200px".
|
|
1821
|
+
*/
|
|
1822
|
+
observerMargin?: string;
|
|
1823
|
+
/**
|
|
1824
|
+
* Callback fired when the image fails to load.
|
|
1825
|
+
*/
|
|
1826
|
+
onError?: (event: SyntheticEvent<HTMLImageElement, Event>) => void;
|
|
1827
|
+
}
|
|
1828
|
+
|
|
1829
|
+
declare const Image: react.ForwardRefExoticComponent<Omit<ImageProps, "ref"> & react.RefAttributes<HTMLImageElement>>;
|
|
1830
|
+
|
|
1651
1831
|
interface UploadProps extends DropzoneOptions {
|
|
1652
1832
|
error?: boolean;
|
|
1653
1833
|
sx?: SxProps$1<Theme>;
|
|
@@ -1817,4 +1997,4 @@ interface LoadingScreenProps extends BoxProps {
|
|
|
1817
1997
|
declare const LoadingScreen: ({ portal, sx, ...rest }: LoadingScreenProps) => react_jsx_runtime.JSX.Element;
|
|
1818
1998
|
declare const SplashScreen: ({ portal, sx, ...rest }: LoadingScreenProps) => react_jsx_runtime.JSX.Element;
|
|
1819
1999
|
|
|
1820
|
-
export { AnimatedLogo, BellNotification, CheckboxDefault, CheckboxIndeterminate, CheckboxSelect, ClipboardCheck, CloudUpload, type ColorSchema, Copy, CopyButton, type CustomShadowOptions, type CustomSpacingOptions, Eye, EyeClosed, Field, Form, Icon, type IconProps, type IconType, InfoCircleFill, InfoCircleOutline, KeyCommand, Loader, LoadingScreen, LocalStorageAvailable, LocalStorageGetItem, Logo, LongArrowUpLeftSolid, NavArrowDown, NavArrowLeft, NavArrowRight, OTPInput, type OTPInputProps, RHFAutocomplete, type RHFAutocompleteProps, RHFCheckbox, type RHFCheckboxProps, RHFMultiCheckbox, type RHFMultiCheckboxOption, type RHFMultiCheckboxProps, RHFMultiSwitch, RHFOTPInput, type RHFOTPInputProps, RHFRadioGroup, type RHFRadioGroupProps, RHFSwitch, RHFTextField, RHFUpload, type RHFUploadProps, RadioDefault, RadioSelect, type RadiusOptions, STORAGE_KEY, Search, Settings, 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, formatFullname, getCurrencySymbol, getInitColorSchemeScript, getInitials, 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, splitFullname, stylesMode, success, surface, tertiaryFont, text, textGradient, typography, updateComponentsWithSettings, updateCoreWithSettings, useBoolean, useCopyToClipboard, useEventListener, useLocalStorage, usePopover, useResponsive, useScrollOffSetTop, useSetState, useSettings, useWidth, varAlpha, warning };
|
|
2000
|
+
export { AnimatedLogo, BellNotification, CheckboxDefault, CheckboxIndeterminate, CheckboxSelect, ClipboardCheck, CloudUpload, type ColorSchema, Copy, CopyButton, type CustomShadowOptions, type CustomSpacingOptions, Eye, EyeClosed, Field, Form, Icon, type IconProps, type IconType, Image, type ImageProps, type ImageStatus, InfoCircleFill, InfoCircleOutline, KeyCommand, Loader, LoadingScreen, LocalStorageAvailable, LocalStorageGetItem, Logo, LongArrowUpLeftSolid, NavArrowDown, NavArrowLeft, NavArrowRight, OTPInput, type OTPInputProps, RHFAutocomplete, type RHFAutocompleteProps, RHFCheckbox, type RHFCheckboxProps, RHFMultiCheckbox, type RHFMultiCheckboxOption, type RHFMultiCheckboxProps, RHFMultiSwitch, RHFOTPInput, type RHFOTPInputProps, RHFRadioGroup, type RHFRadioGroupProps, RHFSwitch, RHFTextField, RHFUpload, type RHFUploadProps, RadioDefault, RadioSelect, type RadiusOptions, STORAGE_KEY, Search, Settings, 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, formatFullname, getCurrencySymbol, getInitColorSchemeScript, getInitials, 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, splitFullname, stylesMode, success, surface, tertiaryFont, text, textGradient, typography, updateComponentsWithSettings, updateCoreWithSettings, useBoolean, useCopyToClipboard, useCountdownDate, useCountdownSeconds, useEventListener, useLocalStorage, usePopover, useResponsive, useScrollOffSetTop, useSetState, useSettings, useWidth, varAlpha, warning };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { SetStateAction, ElementType } from 'react';
|
|
2
|
+
import { SetStateAction, ElementType, CSSProperties, ReactNode, SyntheticEvent } from 'react';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import { Breakpoint, Shadows, Components, Theme, SxProps as SxProps$1 } from '@mui/material/styles';
|
|
5
5
|
import * as _mui_material from '@mui/material';
|
|
@@ -234,6 +234,115 @@ type UseSetStateReturnType<T> = {
|
|
|
234
234
|
*/
|
|
235
235
|
declare const useSetState: <T extends Record<string, any>>(initialState: T) => UseSetStateReturnType<T>;
|
|
236
236
|
|
|
237
|
+
interface CountdownState {
|
|
238
|
+
days: string;
|
|
239
|
+
hours: string;
|
|
240
|
+
minutes: string;
|
|
241
|
+
seconds: string;
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* A custom hook for creating a countdown timer to a specific date/time.
|
|
245
|
+
*
|
|
246
|
+
* Calculates and returns the time remaining until a target date, automatically
|
|
247
|
+
* updating every second. Returns zero values when the target time is reached.
|
|
248
|
+
*
|
|
249
|
+
* @param date - The target date/time as a Date object, ISO string, or Unix timestamp
|
|
250
|
+
*
|
|
251
|
+
* @returns An object containing:
|
|
252
|
+
* - `days` (string): Days remaining, zero-padded (e.g., "00", "05", "12")
|
|
253
|
+
* - `hours` (string): Hours remaining, zero-padded (e.g., "00", "23")
|
|
254
|
+
* - `minutes` (string): Minutes remaining, zero-padded (e.g., "00", "59")
|
|
255
|
+
* - `seconds` (string): Seconds remaining, zero-padded (e.g., "00", "59")
|
|
256
|
+
*
|
|
257
|
+
* @example
|
|
258
|
+
* ```tsx
|
|
259
|
+
* function EventCountdown() {
|
|
260
|
+
* const countdown = useCountdownDate(new Date('2025-12-31T23:59:59'));
|
|
261
|
+
*
|
|
262
|
+
* return (
|
|
263
|
+
* <div>
|
|
264
|
+
* <h2>Time Until New Year:</h2>
|
|
265
|
+
* <p>
|
|
266
|
+
* {countdown.days} days, {countdown.hours} hours,
|
|
267
|
+
* {countdown.minutes} minutes, {countdown.seconds} seconds
|
|
268
|
+
* </p>
|
|
269
|
+
* </div>
|
|
270
|
+
* );
|
|
271
|
+
* }
|
|
272
|
+
* ```
|
|
273
|
+
*
|
|
274
|
+
* @example
|
|
275
|
+
* ```tsx
|
|
276
|
+
* // Using Unix timestamp
|
|
277
|
+
* const countdown = useCountdownDate(1735689599000);
|
|
278
|
+
*
|
|
279
|
+
* // Using ISO string
|
|
280
|
+
* const countdown = useCountdownDate('2025-12-31T23:59:59Z');
|
|
281
|
+
* ```
|
|
282
|
+
*/
|
|
283
|
+
declare const useCountdownDate: (date: Date | string | number) => CountdownState;
|
|
284
|
+
interface UseCountdownSecondsReturn {
|
|
285
|
+
counting: boolean;
|
|
286
|
+
countdown: number;
|
|
287
|
+
startCountdown: () => void;
|
|
288
|
+
setCountdown: React.Dispatch<React.SetStateAction<number>>;
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* A custom hook for creating a countdown timer that counts down from a specified number of seconds.
|
|
292
|
+
*
|
|
293
|
+
* Provides manual control to start the countdown and tracks whether counting is in progress.
|
|
294
|
+
* Automatically cleans up intervals on unmount.
|
|
295
|
+
*
|
|
296
|
+
* @param initCountdown - Initial number of seconds for the countdown
|
|
297
|
+
*
|
|
298
|
+
* @returns An object containing:
|
|
299
|
+
* - `counting` (boolean): Whether countdown is actively running (between 0 and initCountdown)
|
|
300
|
+
* - `countdown` (number): Current countdown value in seconds
|
|
301
|
+
* - `startCountdown` (function): Function to start or restart the countdown
|
|
302
|
+
* - `setCountdown` (function): Direct setter for the countdown value
|
|
303
|
+
*
|
|
304
|
+
* @example
|
|
305
|
+
* ```tsx
|
|
306
|
+
* function OTPTimer() {
|
|
307
|
+
* const { countdown, counting, startCountdown } = useCountdownSeconds(60);
|
|
308
|
+
*
|
|
309
|
+
* return (
|
|
310
|
+
* <div>
|
|
311
|
+
* <p>Resend code in: {countdown}s</p>
|
|
312
|
+
* <button onClick={startCountdown} disabled={counting}>
|
|
313
|
+
* {counting ? 'Waiting...' : 'Resend Code'}
|
|
314
|
+
* </button>
|
|
315
|
+
* </div>
|
|
316
|
+
* );
|
|
317
|
+
* }
|
|
318
|
+
* ```
|
|
319
|
+
*
|
|
320
|
+
* @example
|
|
321
|
+
* ```tsx
|
|
322
|
+
* function SessionTimer() {
|
|
323
|
+
* const { countdown, counting, startCountdown, setCountdown } = useCountdownSeconds(300);
|
|
324
|
+
*
|
|
325
|
+
* useEffect(() => {
|
|
326
|
+
* // Start countdown when component mounts
|
|
327
|
+
* startCountdown();
|
|
328
|
+
* }, [startCountdown]);
|
|
329
|
+
*
|
|
330
|
+
* const extendSession = () => {
|
|
331
|
+
* // Add 60 more seconds
|
|
332
|
+
* setCountdown((prev) => prev + 60);
|
|
333
|
+
* };
|
|
334
|
+
*
|
|
335
|
+
* return (
|
|
336
|
+
* <div>
|
|
337
|
+
* <p>Session expires in: {Math.floor(countdown / 60)}:{countdown % 60}</p>
|
|
338
|
+
* <button onClick={extendSession}>Extend Session</button>
|
|
339
|
+
* </div>
|
|
340
|
+
* );
|
|
341
|
+
* }
|
|
342
|
+
* ```
|
|
343
|
+
*/
|
|
344
|
+
declare const useCountdownSeconds: (initCountdown: number) => UseCountdownSecondsReturn;
|
|
345
|
+
|
|
237
346
|
type ReturnType = boolean;
|
|
238
347
|
type Query = 'up' | 'down' | 'between' | 'only';
|
|
239
348
|
type Value = Breakpoint | number;
|
|
@@ -1648,6 +1757,77 @@ interface LogoProps extends BoxProps {
|
|
|
1648
1757
|
declare const Logo: ({ sx, isFull, isWhite, isBlack, disableLink, LinkComponent, href, src, alt, ...rest }: LogoProps) => react_jsx_runtime.JSX.Element;
|
|
1649
1758
|
declare const AnimatedLogo: () => react_jsx_runtime.JSX.Element;
|
|
1650
1759
|
|
|
1760
|
+
type ImageStatus = 'idle' | 'loading' | 'loaded' | 'error';
|
|
1761
|
+
interface ImageProps extends Omit<BoxProps, 'component' | 'children' | 'position'> {
|
|
1762
|
+
src: string;
|
|
1763
|
+
alt: string;
|
|
1764
|
+
/**
|
|
1765
|
+
* Load the image only when it enters the viewport.
|
|
1766
|
+
* Defaults to true.
|
|
1767
|
+
*/
|
|
1768
|
+
lazy?: boolean;
|
|
1769
|
+
/**
|
|
1770
|
+
* Fallback URL used when the main source fails to load.
|
|
1771
|
+
*/
|
|
1772
|
+
fallbackSrc?: string;
|
|
1773
|
+
/**
|
|
1774
|
+
* Responsive image sources for different screen sizes/resolutions.
|
|
1775
|
+
* Example: "image-320w.jpg 320w, image-640w.jpg 640w, image-1280w.jpg 1280w"
|
|
1776
|
+
*/
|
|
1777
|
+
srcSet?: string;
|
|
1778
|
+
/**
|
|
1779
|
+
* Sizes attribute for responsive images. Defines which image size to use at different viewport widths.
|
|
1780
|
+
* Example: "(max-width: 600px) 100vw, (max-width: 1200px) 50vw, 33vw"
|
|
1781
|
+
*/
|
|
1782
|
+
sizes?: string;
|
|
1783
|
+
/**
|
|
1784
|
+
* Aspect ratio (e.g. "16 / 9" or 1.5) applied to the wrapper to avoid layout shift.
|
|
1785
|
+
*/
|
|
1786
|
+
aspectRatio?: number | string;
|
|
1787
|
+
/**
|
|
1788
|
+
* Controls object-fit of the underlying image. Defaults to "cover".
|
|
1789
|
+
*/
|
|
1790
|
+
fit?: CSSProperties['objectFit'];
|
|
1791
|
+
/**
|
|
1792
|
+
* Controls object-position of the underlying image. Defaults to "center".
|
|
1793
|
+
*/
|
|
1794
|
+
position?: CSSProperties['objectPosition'];
|
|
1795
|
+
/**
|
|
1796
|
+
* Optional overlay content rendered above the image.
|
|
1797
|
+
*/
|
|
1798
|
+
overlay?: ReactNode;
|
|
1799
|
+
/**
|
|
1800
|
+
* Enables overlay even when overlay content is not provided.
|
|
1801
|
+
*/
|
|
1802
|
+
withOverlay?: boolean;
|
|
1803
|
+
/**
|
|
1804
|
+
* Custom loading indicator shown before the image is loaded.
|
|
1805
|
+
*/
|
|
1806
|
+
loadingIndicator?: ReactNode;
|
|
1807
|
+
/**
|
|
1808
|
+
* Custom error fallback content when both src and fallbackSrc fail.
|
|
1809
|
+
*/
|
|
1810
|
+
renderError?: ReactNode;
|
|
1811
|
+
/**
|
|
1812
|
+
* Additional styles for the underlying image element.
|
|
1813
|
+
*/
|
|
1814
|
+
imgSx?: BoxProps['sx'];
|
|
1815
|
+
/**
|
|
1816
|
+
* Additional props for the underlying image element.
|
|
1817
|
+
*/
|
|
1818
|
+
imgProps?: Omit<BoxProps<'img'>, 'component' | 'sx' | 'ref' | 'src' | 'alt' | 'children'>;
|
|
1819
|
+
/**
|
|
1820
|
+
* Root margin passed to the IntersectionObserver. Defaults to "200px".
|
|
1821
|
+
*/
|
|
1822
|
+
observerMargin?: string;
|
|
1823
|
+
/**
|
|
1824
|
+
* Callback fired when the image fails to load.
|
|
1825
|
+
*/
|
|
1826
|
+
onError?: (event: SyntheticEvent<HTMLImageElement, Event>) => void;
|
|
1827
|
+
}
|
|
1828
|
+
|
|
1829
|
+
declare const Image: react.ForwardRefExoticComponent<Omit<ImageProps, "ref"> & react.RefAttributes<HTMLImageElement>>;
|
|
1830
|
+
|
|
1651
1831
|
interface UploadProps extends DropzoneOptions {
|
|
1652
1832
|
error?: boolean;
|
|
1653
1833
|
sx?: SxProps$1<Theme>;
|
|
@@ -1817,4 +1997,4 @@ interface LoadingScreenProps extends BoxProps {
|
|
|
1817
1997
|
declare const LoadingScreen: ({ portal, sx, ...rest }: LoadingScreenProps) => react_jsx_runtime.JSX.Element;
|
|
1818
1998
|
declare const SplashScreen: ({ portal, sx, ...rest }: LoadingScreenProps) => react_jsx_runtime.JSX.Element;
|
|
1819
1999
|
|
|
1820
|
-
export { AnimatedLogo, BellNotification, CheckboxDefault, CheckboxIndeterminate, CheckboxSelect, ClipboardCheck, CloudUpload, type ColorSchema, Copy, CopyButton, type CustomShadowOptions, type CustomSpacingOptions, Eye, EyeClosed, Field, Form, Icon, type IconProps, type IconType, InfoCircleFill, InfoCircleOutline, KeyCommand, Loader, LoadingScreen, LocalStorageAvailable, LocalStorageGetItem, Logo, LongArrowUpLeftSolid, NavArrowDown, NavArrowLeft, NavArrowRight, OTPInput, type OTPInputProps, RHFAutocomplete, type RHFAutocompleteProps, RHFCheckbox, type RHFCheckboxProps, RHFMultiCheckbox, type RHFMultiCheckboxOption, type RHFMultiCheckboxProps, RHFMultiSwitch, RHFOTPInput, type RHFOTPInputProps, RHFRadioGroup, type RHFRadioGroupProps, RHFSwitch, RHFTextField, RHFUpload, type RHFUploadProps, RadioDefault, RadioSelect, type RadiusOptions, STORAGE_KEY, Search, Settings, 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, formatFullname, getCurrencySymbol, getInitColorSchemeScript, getInitials, 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, splitFullname, stylesMode, success, surface, tertiaryFont, text, textGradient, typography, updateComponentsWithSettings, updateCoreWithSettings, useBoolean, useCopyToClipboard, useEventListener, useLocalStorage, usePopover, useResponsive, useScrollOffSetTop, useSetState, useSettings, useWidth, varAlpha, warning };
|
|
2000
|
+
export { AnimatedLogo, BellNotification, CheckboxDefault, CheckboxIndeterminate, CheckboxSelect, ClipboardCheck, CloudUpload, type ColorSchema, Copy, CopyButton, type CustomShadowOptions, type CustomSpacingOptions, Eye, EyeClosed, Field, Form, Icon, type IconProps, type IconType, Image, type ImageProps, type ImageStatus, InfoCircleFill, InfoCircleOutline, KeyCommand, Loader, LoadingScreen, LocalStorageAvailable, LocalStorageGetItem, Logo, LongArrowUpLeftSolid, NavArrowDown, NavArrowLeft, NavArrowRight, OTPInput, type OTPInputProps, RHFAutocomplete, type RHFAutocompleteProps, RHFCheckbox, type RHFCheckboxProps, RHFMultiCheckbox, type RHFMultiCheckboxOption, type RHFMultiCheckboxProps, RHFMultiSwitch, RHFOTPInput, type RHFOTPInputProps, RHFRadioGroup, type RHFRadioGroupProps, RHFSwitch, RHFTextField, RHFUpload, type RHFUploadProps, RadioDefault, RadioSelect, type RadiusOptions, STORAGE_KEY, Search, Settings, 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, formatFullname, getCurrencySymbol, getInitColorSchemeScript, getInitials, 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, splitFullname, stylesMode, success, surface, tertiaryFont, text, textGradient, typography, updateComponentsWithSettings, updateCoreWithSettings, useBoolean, useCopyToClipboard, useCountdownDate, useCountdownSeconds, useEventListener, useLocalStorage, usePopover, useResponsive, useScrollOffSetTop, useSetState, useSettings, useWidth, varAlpha, warning };
|