@solostylist/ui-kit 1.0.167 → 1.0.169
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/{Typography-B7LOtCzI.js → Typography-C8jwvSWe.js} +1 -1
- package/dist/main.d.ts +5 -3
- package/dist/main.js +187 -173
- package/dist/s-accordion/index.js +2 -2
- package/dist/s-accordion/s-accordion.d.ts +17 -1
- package/dist/s-accordion/s-accordion.js +252 -238
- package/dist/s-action-overlay/index.js +1 -1
- package/dist/s-action-overlay/s-action-overlay.d.ts +34 -1
- package/dist/s-action-overlay/s-action-overlay.js +67 -55
- package/dist/s-ai-tool-bar/index.d.ts +2 -0
- package/dist/s-ai-tool-bar/index.js +3 -2
- package/dist/s-ai-tool-bar/s-ai-tool-bar.d.ts +33 -22
- package/dist/s-ai-tool-bar/s-ai-tool-bar.js +295 -247
- package/dist/s-autocomplete/index.js +2 -2
- package/dist/s-autocomplete/s-autocomplete.d.ts +13 -15
- package/dist/s-autocomplete/s-autocomplete.js +25 -17
- package/dist/s-avatar/index.js +2 -2
- package/dist/s-avatar/s-avatar.d.ts +16 -1
- package/dist/s-avatar/s-avatar.js +23 -10
- package/dist/s-blur-text/index.js +2 -2
- package/dist/s-blur-text/s-blur-text.d.ts +4 -13
- package/dist/s-blur-text/s-blur-text.js +57 -51
- package/dist/s-breadcrumbs/index.js +2 -2
- package/dist/s-breadcrumbs/s-breadcrumbs.d.ts +20 -1
- package/dist/s-breadcrumbs/s-breadcrumbs.js +39 -30
- package/dist/s-button/index.js +2 -2
- package/dist/s-button/s-button.d.ts +7 -1
- package/dist/s-button/s-button.js +15 -5
- package/dist/s-button-link/index.js +2 -2
- package/dist/s-button-link/s-button-link.d.ts +12 -26
- package/dist/s-button-link/s-button-link.js +36 -26
- package/dist/s-carousel/index.js +1 -1
- package/dist/s-carousel/s-carousel.d.ts +11 -1
- package/dist/s-carousel/s-carousel.js +233 -223
- package/dist/s-category-card/index.js +2 -2
- package/dist/s-category-card/s-category-card.d.ts +28 -1
- package/dist/s-category-card/s-category-card.js +77 -58
- package/dist/s-chat-input/index.js +2 -2
- package/dist/s-chat-input/s-chat-input.d.ts +12 -1
- package/dist/s-chat-input/s-chat-input.js +92 -82
- package/dist/s-chat-message/index.js +2 -2
- package/dist/s-chat-message/s-chat-message.d.ts +22 -1
- package/dist/s-chat-message/s-chat-message.js +144 -133
- package/dist/s-checkbox/index.js +2 -2
- package/dist/s-checkbox/s-checkbox.d.ts +2 -15
- package/dist/s-checkbox/s-checkbox.js +20 -10
- package/dist/s-chip/index.js +2 -2
- package/dist/s-chip/s-chip.d.ts +7 -1
- package/dist/s-chip/s-chip.js +15 -5
- package/dist/s-chips/index.js +2 -2
- package/dist/s-chips/s-chips.d.ts +5 -18
- package/dist/s-chips/s-chips.js +56 -41
- package/dist/s-comment-message/index.js +2 -2
- package/dist/s-comment-message/s-comment-message.d.ts +26 -1
- package/dist/s-comment-message/s-comment-message.js +95 -89
- package/dist/s-copyable-text/index.js +1 -1
- package/dist/s-copyable-text/s-copyable-text.d.ts +9 -36
- package/dist/s-copyable-text/s-copyable-text.js +31 -21
- package/dist/s-countdown/index.d.ts +3 -2
- package/dist/s-countdown/index.js +4 -3
- package/dist/s-countdown/s-count-box.d.ts +39 -0
- package/dist/s-countdown/s-count-box.js +112 -0
- package/dist/s-countdown/s-count-down.d.ts +6 -50
- package/dist/s-countdown/s-count-down.js +110 -175
- package/dist/s-data-table/index.js +2 -2
- package/dist/s-data-table/s-data-table.d.ts +9 -65
- package/dist/s-data-table/s-data-table.js +381 -371
- package/dist/s-date-picker/index.js +2 -2
- package/dist/s-date-picker/s-date-picker.d.ts +6 -17
- package/dist/s-date-picker/s-date-picker.js +124 -107
- package/dist/s-datetime-picker/index.js +2 -2
- package/dist/s-datetime-picker/s-datetime-picker.d.ts +5 -16
- package/dist/s-datetime-picker/s-datetime-picker.js +897 -887
- package/dist/s-dialog/index.js +2 -2
- package/dist/s-dialog/s-dialog.d.ts +3 -16
- package/dist/s-dialog/s-dialog.js +32 -23
- package/dist/s-dialog-confirm/index.js +3 -3
- package/dist/s-dialog-confirm/s-dialog-confirm.d.ts +5 -13
- package/dist/s-dialog-confirm/s-dialog-confirm.js +55 -48
- package/dist/s-dialog-message/index.js +4 -4
- package/dist/s-dialog-message/s-dialog-message.d.ts +5 -15
- package/dist/s-dialog-message/s-dialog-message.js +45 -38
- package/dist/s-empty/index.js +2 -2
- package/dist/s-empty/s-empty.d.ts +5 -20
- package/dist/s-empty/s-empty.js +14 -4
- package/dist/s-error/index.js +2 -2
- package/dist/s-error/s-error.d.ts +5 -20
- package/dist/s-error/s-error.js +16 -6
- package/dist/s-error-layout/index.js +2 -2
- package/dist/s-error-layout/s-error-layout.d.ts +6 -1
- package/dist/s-error-layout/s-error-layout.js +60 -51
- package/dist/s-file-dropzone/index.js +2 -2
- package/dist/s-file-dropzone/s-file-dropzone.d.ts +6 -51
- package/dist/s-file-dropzone/s-file-dropzone.js +64 -54
- package/dist/s-file-icon/index.js +2 -2
- package/dist/s-file-icon/s-file-icon.d.ts +5 -25
- package/dist/s-file-icon/s-file-icon.js +14 -8
- package/dist/s-flex-box/index.js +2 -2
- package/dist/s-flex-box/s-flex-box.d.ts +10 -1
- package/dist/s-flex-box/s-flex-box.js +14 -4
- package/dist/s-form/index.js +2 -2
- package/dist/s-form/s-form.d.ts +5 -14
- package/dist/s-form/s-form.js +19 -9
- package/dist/s-gallery/index.js +33 -3
- package/dist/s-gallery/s-gallery.d.ts +3 -36
- package/dist/s-gallery/s-gallery.js +108 -78
- package/dist/s-glow-button/s-glow-button.d.ts +6 -42
- package/dist/s-glow-button/s-glow-button.js +29 -47
- package/dist/s-gradient-icon/index.d.ts +1 -1
- package/dist/s-gradient-icon/index.js +1 -1
- package/dist/s-gradient-icon/s-gradient-icon.d.ts +8 -68
- package/dist/s-gradient-icon/s-gradient-icon.js +54 -44
- package/dist/s-i18n-provider/index.js +1 -1
- package/dist/s-i18n-provider/s-i18n-provider.d.ts +5 -33
- package/dist/s-i18n-provider/s-i18n-provider.js +25 -15
- package/dist/s-icon-button/index.js +2 -2
- package/dist/s-icon-button/s-icon-button.d.ts +6 -19
- package/dist/s-icon-button/s-icon-button.js +14 -4
- package/dist/s-image-comparison/s-image-comparison.js +50 -45
- package/dist/s-image-modal/index.js +3 -3
- package/dist/s-image-modal/s-image-modal.d.ts +4 -20
- package/dist/s-image-modal/s-image-modal.js +150 -135
- package/dist/s-item-not-found/index.js +2 -2
- package/dist/s-item-not-found/s-item-not-found.d.ts +14 -1
- package/dist/s-item-not-found/s-item-not-found.js +21 -10
- package/dist/s-label/index.js +2 -2
- package/dist/s-label/s-label.d.ts +9 -25
- package/dist/s-label/s-label.js +19 -9
- package/dist/s-language-switcher/index.js +3 -3
- package/dist/s-language-switcher/s-language-switcher.d.ts +20 -33
- package/dist/s-language-switcher/s-language-switcher.js +137 -115
- package/dist/s-lazy-image/index.js +10 -2
- package/dist/s-lazy-image/s-lazy-image.d.ts +12 -58
- package/dist/s-lazy-image/s-lazy-image.js +53 -58
- package/dist/s-localization-provider/index.js +2 -2
- package/dist/s-localization-provider/s-localization-provider.d.ts +6 -27
- package/dist/s-localization-provider/s-localization-provider.js +157 -149
- package/dist/s-moving-border/index.js +2 -2
- package/dist/s-moving-border/s-moving-border.d.ts +3 -33
- package/dist/s-moving-border/s-moving-border.js +65 -55
- package/dist/s-multi-select/index.js +2 -2
- package/dist/s-multi-select/s-multi-select.d.ts +5 -15
- package/dist/s-multi-select/s-multi-select.js +54 -45
- package/dist/s-no-ssr/index.js +2 -2
- package/dist/s-no-ssr/s-no-ssr.d.ts +5 -33
- package/dist/s-no-ssr/s-no-ssr.js +21 -11
- package/dist/s-overlay-scrollbar/index.js +2 -2
- package/dist/s-overlay-scrollbar/s-overlay-scrollbar.d.ts +10 -1
- package/dist/s-overlay-scrollbar/s-overlay-scrollbar.js +16 -11
- package/dist/s-pagination/index.js +2 -2
- package/dist/s-pagination/s-pagination.d.ts +5 -23
- package/dist/s-pagination/s-pagination.js +17 -11
- package/dist/s-pixel-reveal/index.js +2 -2
- package/dist/s-pixel-reveal/s-pixel-reveal.d.ts +15 -1
- package/dist/s-pixel-reveal/s-pixel-reveal.js +83 -78
- package/dist/s-radial-pulse-animate/index.js +2 -2
- package/dist/s-radial-pulse-animate/s-radial-pulse-animate.d.ts +12 -1
- package/dist/s-radial-pulse-animate/s-radial-pulse-animate.js +52 -42
- package/dist/s-rating/index.js +2 -2
- package/dist/s-rating/s-rating.d.ts +7 -1
- package/dist/s-rating/s-rating.js +15 -5
- package/dist/s-review/index.js +2 -2
- package/dist/s-review/s-review.d.ts +25 -1
- package/dist/s-review/s-review.js +104 -97
- package/dist/s-scroll-reveal/index.js +2 -2
- package/dist/s-scroll-reveal/s-scroll-reveal.d.ts +17 -36
- package/dist/s-scroll-reveal/s-scroll-reveal.js +43 -33
- package/dist/s-scroll-to-top/index.js +2 -2
- package/dist/s-scroll-to-top/s-scroll-to-top.d.ts +12 -17
- package/dist/s-scroll-to-top/s-scroll-to-top.js +20 -15
- package/dist/s-scroll-velocity/index.d.ts +6 -0
- package/dist/s-scroll-velocity/index.js +8 -0
- package/dist/s-scroll-velocity/package.json +5 -0
- package/dist/s-scroll-velocity/s-scroll-velocity.d.ts +24 -0
- package/dist/s-scroll-velocity/s-scroll-velocity.js +22 -0
- package/dist/s-scroll-velocity/scroll-velocity-container.d.ts +20 -0
- package/dist/s-scroll-velocity/scroll-velocity-container.js +40 -0
- package/dist/s-scroll-velocity/scroll-velocity-row.d.ts +27 -0
- package/dist/s-scroll-velocity/scroll-velocity-row.js +131 -0
- package/dist/s-select/index.js +2 -2
- package/dist/s-select/s-select.d.ts +3 -22
- package/dist/s-select/s-select.js +76 -72
- package/dist/s-select-list/index.js +2 -2
- package/dist/s-select-list/s-select-list.d.ts +16 -19
- package/dist/s-select-list/s-select-list.js +33 -28
- package/dist/s-skeleton/index.js +2 -2
- package/dist/s-skeleton/s-skeleton.d.ts +6 -22
- package/dist/s-skeleton/s-skeleton.js +28 -18
- package/dist/s-snackbar-message/index.js +4 -4
- package/dist/s-snackbar-message/s-snackbar-message.d.ts +5 -23
- package/dist/s-snackbar-message/s-snackbar-message.js +38 -31
- package/dist/s-spotlight-cursor/index.js +2 -2
- package/dist/s-spotlight-cursor/s-spotlight-cursor.d.ts +10 -44
- package/dist/s-spotlight-cursor/s-spotlight-cursor.js +35 -29
- package/dist/s-stripe/index.d.ts +4 -1
- package/dist/s-stripe/index.js +7 -4
- package/dist/s-stripe/s-stripe-cvc.d.ts +8 -0
- package/dist/s-stripe/s-stripe-cvc.js +15 -0
- package/dist/s-stripe/s-stripe-expiry.d.ts +8 -0
- package/dist/s-stripe/s-stripe-expiry.js +15 -0
- package/dist/s-stripe/s-stripe-number.d.ts +8 -0
- package/dist/s-stripe/s-stripe-number.js +15 -0
- package/dist/s-stripe/s-stripe.d.ts +6 -85
- package/dist/s-stripe/s-stripe.js +24 -27
- package/dist/s-stripe/stripe-input.js +22 -18
- package/dist/s-tabs/index.js +6 -6
- package/dist/s-tabs/s-tab-panel.d.ts +11 -1
- package/dist/s-tabs/s-tab-panel.js +25 -16
- package/dist/s-tabs/s-tab.js +9 -5
- package/dist/s-tabs/s-tabs.d.ts +24 -3
- package/dist/s-tabs/s-tabs.js +34 -25
- package/dist/s-text-editor/index.js +3 -3
- package/dist/s-text-editor/s-text-editor-toolbar.js +91 -76
- package/dist/s-text-editor/s-text-editor.d.ts +13 -11
- package/dist/s-text-editor/s-text-editor.js +44 -30
- package/dist/s-text-field/index.js +2 -2
- package/dist/s-text-field/s-text-field.d.ts +6 -15
- package/dist/s-text-field/s-text-field.js +38 -28
- package/dist/s-text-shimmer/index.js +2 -2
- package/dist/s-text-shimmer/s-text-shimmer.d.ts +10 -1
- package/dist/s-text-shimmer/s-text-shimmer.js +27 -18
- package/dist/s-text-truncation/index.js +2 -2
- package/dist/s-text-truncation/s-text-truncation.d.ts +9 -38
- package/dist/s-text-truncation/s-text-truncation.js +34 -20
- package/dist/s-theme-demo/s-theme-demo.js +238 -223
- package/dist/s-theme-provider/index.js +1 -1
- package/dist/s-theme-provider/s-theme-provider.d.ts +5 -17
- package/dist/s-theme-provider/s-theme-provider.js +44 -34
- package/dist/s-theme-switch/s-theme-switch.js +23 -19
- package/dist/s-tip/index.js +2 -2
- package/dist/s-tip/s-tip.d.ts +5 -22
- package/dist/s-tip/s-tip.js +22 -12
- package/dist/s-two-pane-layout/index.js +10 -2
- package/dist/s-two-pane-layout/s-two-pane-layout.d.ts +7 -1
- package/dist/s-two-pane-layout/s-two-pane-layout.js +58 -48
- package/dist/s-typewriter-text/index.js +2 -2
- package/dist/s-typewriter-text/s-typewriter-text.d.ts +17 -1
- package/dist/s-typewriter-text/s-typewriter-text.js +37 -27
- package/dist/s-zoom-image/index.js +10 -2
- package/dist/s-zoom-image/s-zoom-image.d.ts +10 -42
- package/dist/s-zoom-image/s-zoom-image.js +62 -52
- package/dist/theme/components/alert.d.ts +1436 -1436
- package/dist/theme/components/button.d.ts +2150 -2150
- package/dist/theme/components/chip.d.ts +2 -2
- package/dist/theme/customizations/data-display.js +1 -1
- package/dist/{typographyClasses-C7fhAsUD.js → typographyClasses-DDyl9mok.js} +4 -4
- package/dist/{useMobilePicker-DgxcRrRB.js → useMobilePicker-C1RZZUWr.js} +1 -1
- package/package.json +23 -6
|
@@ -5,36 +5,20 @@ import { Theme } from '../theme/types';
|
|
|
5
5
|
* Props interface for SLabel component
|
|
6
6
|
*/
|
|
7
7
|
export interface SLabelProps {
|
|
8
|
-
/**
|
|
8
|
+
/** Main label text or element to display prominently */
|
|
9
9
|
label?: string | React.ReactNode;
|
|
10
|
-
/**
|
|
10
|
+
/** Child elements to render below the label, typically form controls */
|
|
11
11
|
children?: React.ReactNode;
|
|
12
|
-
/**
|
|
12
|
+
/** Tooltip hint text shown on hover of the help icon */
|
|
13
13
|
hint?: string;
|
|
14
|
-
/** Custom
|
|
14
|
+
/** Custom styles using Material-UI sx prop for layout customization */
|
|
15
15
|
sx?: SxProps<Theme> | undefined;
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
19
|
-
* Provides consistent typography and spacing for label-content pairs throughout the application.
|
|
20
|
-
*
|
|
21
|
-
* Key features:
|
|
22
|
-
* - Primary label with medium font weight (1rem)
|
|
23
|
-
* - Secondary content with lighter weight and color (0.875rem)
|
|
24
|
-
* - Optional help tooltip with icon indicator
|
|
25
|
-
* - Flexible content support (string or React elements)
|
|
26
|
-
* - Full width container with customizable styling
|
|
27
|
-
* - Consistent line height and spacing
|
|
28
|
-
* - CSS custom property integration for theming
|
|
29
|
-
*
|
|
30
|
-
* Common use cases:
|
|
31
|
-
* - Form field labels with descriptions
|
|
32
|
-
* - Settings or configuration displays
|
|
33
|
-
* - Data presentation with context
|
|
34
|
-
* - Information cards with titles and descriptions
|
|
35
|
-
*
|
|
36
|
-
* @param props - SLabelProps with label, content, and styling options
|
|
37
|
-
* @returns JSX.Element - Styled label with content and optional help text
|
|
18
|
+
* An enhanced label component that provides structured labeling with optional hints and tooltips.
|
|
38
19
|
*/
|
|
39
|
-
declare const SLabel:
|
|
20
|
+
export declare const SLabel: {
|
|
21
|
+
({ label, children, hint, sx }: SLabelProps): React.JSX.Element;
|
|
22
|
+
displayName: string;
|
|
23
|
+
};
|
|
40
24
|
export default SLabel;
|
package/dist/s-label/s-label.js
CHANGED
|
@@ -1,15 +1,25 @@
|
|
|
1
1
|
import { j as e } from "../jsx-runtime-OVHDjVDe.js";
|
|
2
|
-
import { c as
|
|
3
|
-
import { Stack as
|
|
4
|
-
const
|
|
2
|
+
import { c as r } from "../createSvgIcon-DxwgGAVe.js";
|
|
3
|
+
import { Stack as a, Box as s, Tooltip as d } from "@mui/material";
|
|
4
|
+
const c = r(/* @__PURE__ */ e.jsx("path", {
|
|
5
5
|
d: "M11 18h2v-2h-2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4"
|
|
6
|
-
}), "HelpOutlineOutlined"),
|
|
7
|
-
/* @__PURE__ */ e.jsxs(
|
|
8
|
-
/* @__PURE__ */ e.jsx(s, { sx: { fontSize: "0.875rem", fontWeight: 500, lineHeight: 1.57, color: "text.secondary" }, children:
|
|
9
|
-
|
|
6
|
+
}), "HelpOutlineOutlined"), l = ({ label: t, children: o, hint: n, sx: i }) => /* @__PURE__ */ e.jsxs(a, { width: "100%", sx: i, children: [
|
|
7
|
+
/* @__PURE__ */ e.jsxs(a, { direction: "row", alignItems: "center", mb: 1, children: [
|
|
8
|
+
/* @__PURE__ */ e.jsx(s, { sx: { fontSize: "0.875rem", fontWeight: 500, lineHeight: 1.57, color: "text.secondary" }, children: t }),
|
|
9
|
+
n ? /* @__PURE__ */ e.jsx(d, { title: n, placement: "top", children: /* @__PURE__ */ e.jsx(c, { sx: { marginLeft: "4px", fontSize: 16, color: "text.secondary" } }) }) : null
|
|
10
10
|
] }),
|
|
11
|
-
|
|
11
|
+
o
|
|
12
12
|
] });
|
|
13
|
+
l.displayName = "SLabel";
|
|
14
|
+
try {
|
|
15
|
+
l.displayName = "SLabel", l.__docgenInfo = { description: "An enhanced label component that provides structured labeling with optional hints and tooltips.", displayName: "SLabel", props: { label: { defaultValue: null, description: "Main label text or element to display prominently", name: "label", required: !1, type: { name: "ReactNode" } }, children: { defaultValue: null, description: "Child elements to render below the label, typically form controls", name: "children", required: !1, type: { name: "ReactNode" } }, hint: { defaultValue: null, description: "Tooltip hint text shown on hover of the help icon", name: "hint", required: !1, type: { name: "string" } }, sx: { defaultValue: null, description: "Custom styles using Material-UI sx prop for layout customization", name: "sx", required: !1, type: { name: "SxProps<Theme>" } } } };
|
|
16
|
+
} catch {
|
|
17
|
+
}
|
|
18
|
+
try {
|
|
19
|
+
slabel.displayName = "slabel", slabel.__docgenInfo = { description: "An enhanced label component that provides structured labeling with optional hints and tooltips.", displayName: "slabel", props: { label: { defaultValue: null, description: "Main label text or element to display prominently", name: "label", required: !1, type: { name: "ReactNode" } }, children: { defaultValue: null, description: "Child elements to render below the label, typically form controls", name: "children", required: !1, type: { name: "ReactNode" } }, hint: { defaultValue: null, description: "Tooltip hint text shown on hover of the help icon", name: "hint", required: !1, type: { name: "string" } }, sx: { defaultValue: null, description: "Custom styles using Material-UI sx prop for layout customization", name: "sx", required: !1, type: { name: "SxProps<Theme>" } } } };
|
|
20
|
+
} catch {
|
|
21
|
+
}
|
|
13
22
|
export {
|
|
14
|
-
|
|
23
|
+
l as SLabel,
|
|
24
|
+
l as default
|
|
15
25
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { SLanguagePopover as
|
|
1
|
+
import { SLanguagePopover as g, SLanguageSwitcher as o, defaultLanguageOptions as t } from "./s-language-switcher.js";
|
|
2
2
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
g as SLanguagePopover,
|
|
4
|
+
o as default,
|
|
5
5
|
t as defaultLanguageOptions
|
|
6
6
|
};
|
|
@@ -16,48 +16,35 @@ export interface SLanguagePopoverProps {
|
|
|
16
16
|
menuWidth?: string | number;
|
|
17
17
|
flagSize?: number;
|
|
18
18
|
}
|
|
19
|
-
export declare
|
|
19
|
+
export declare const SLanguagePopover: ({ anchorEl, onClose, open, onLanguageChange, languages, currentLanguage, menuWidth, flagSize, }: SLanguagePopoverProps) => React.JSX.Element;
|
|
20
|
+
/**
|
|
21
|
+
* Props interface for SLanguageSwitcher component
|
|
22
|
+
*/
|
|
20
23
|
export interface SLanguageSwitcherProps {
|
|
21
|
-
/**
|
|
22
|
-
* Custom language options to display
|
|
23
|
-
*/
|
|
24
|
+
/** Custom language options to display */
|
|
24
25
|
languages?: SLanguageOption[];
|
|
25
|
-
/**
|
|
26
|
-
* Callback when language changes
|
|
27
|
-
* If not provided, will use i18n.changeLanguage
|
|
28
|
-
*/
|
|
26
|
+
/** Callback when language changes (if not provided, will use i18n.changeLanguage) */
|
|
29
27
|
onLanguageChange?: (languageCode: string) => void;
|
|
30
|
-
/**
|
|
31
|
-
* Current language code
|
|
32
|
-
* If not provided, will use i18n.language
|
|
33
|
-
*/
|
|
28
|
+
/** Current language code (if not provided, will use i18n.language) */
|
|
34
29
|
currentLanguage?: string;
|
|
35
|
-
/**
|
|
36
|
-
* Tooltip text for the language button
|
|
37
|
-
* If not provided and i18n is available, will use t('header:language.tooltip')
|
|
38
|
-
*/
|
|
30
|
+
/** Tooltip text for the language button */
|
|
39
31
|
tooltipText?: string;
|
|
40
|
-
/**
|
|
41
|
-
* Size of the flag icon in the button
|
|
42
|
-
*/
|
|
32
|
+
/** Size of the flag icon in the button */
|
|
43
33
|
buttonFlagSize?: number;
|
|
44
|
-
/**
|
|
45
|
-
* Size of the flag icon in the menu
|
|
46
|
-
*/
|
|
34
|
+
/** Size of the flag icon in the menu */
|
|
47
35
|
menuFlagSize?: number;
|
|
48
|
-
/**
|
|
49
|
-
* Width of the language menu
|
|
50
|
-
*/
|
|
36
|
+
/** Width of the language menu */
|
|
51
37
|
menuWidth?: string | number;
|
|
52
|
-
/**
|
|
53
|
-
* Custom styles for the icon button
|
|
54
|
-
*/
|
|
38
|
+
/** Custom styles for the icon button */
|
|
55
39
|
sx?: SxProps<Theme>;
|
|
56
|
-
/**
|
|
57
|
-
* Whether to use i18n integration
|
|
58
|
-
* @default true
|
|
59
|
-
*/
|
|
40
|
+
/** Whether to use i18n integration */
|
|
60
41
|
useI18n?: boolean;
|
|
61
42
|
}
|
|
62
|
-
|
|
43
|
+
/**
|
|
44
|
+
* A language switcher component with flag icons and dropdown menu.
|
|
45
|
+
*/
|
|
46
|
+
export declare const SLanguageSwitcher: {
|
|
47
|
+
({ languages, onLanguageChange, currentLanguage, tooltipText, buttonFlagSize, menuFlagSize, menuWidth, sx, useI18n, }: SLanguageSwitcherProps): React.JSX.Element;
|
|
48
|
+
displayName: string;
|
|
49
|
+
};
|
|
63
50
|
export default SLanguageSwitcher;
|
|
@@ -1,34 +1,35 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import * as
|
|
3
|
-
import
|
|
4
|
-
import { useTranslation as
|
|
5
|
-
import { usePopover as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { L as
|
|
9
|
-
import { g as
|
|
10
|
-
import { P as
|
|
11
|
-
import { u as E, c as
|
|
12
|
-
import { s as
|
|
13
|
-
import
|
|
14
|
-
|
|
1
|
+
import { j as o } from "../jsx-runtime-OVHDjVDe.js";
|
|
2
|
+
import * as S from "react";
|
|
3
|
+
import y from "react";
|
|
4
|
+
import { useTranslation as q } from "react-i18next";
|
|
5
|
+
import { usePopover as C } from "../hooks/use-popover.js";
|
|
6
|
+
import { SIconButton as T } from "../s-icon-button/s-icon-button.js";
|
|
7
|
+
import "../s-lazy-image/index.js";
|
|
8
|
+
import { L as z, M as j } from "../Menu-CWq-a1Wz.js";
|
|
9
|
+
import { g as N, M as k } from "../MenuItem-DY_qFSPR.js";
|
|
10
|
+
import { P as t } from "../createTheme-3Wd3hHrj.js";
|
|
11
|
+
import { u as E, c as W, a as F, m as P } from "../DefaultPropsProvider-CaCsvQaq.js";
|
|
12
|
+
import { s as O } from "../styled-B0Z4EDy9.js";
|
|
13
|
+
import L from "../s-lazy-image/s-lazy-image.js";
|
|
14
|
+
import { T as R } from "../Typography-C8jwvSWe.js";
|
|
15
|
+
const M = (e) => {
|
|
15
16
|
const {
|
|
16
|
-
alignItems:
|
|
17
|
-
classes:
|
|
17
|
+
alignItems: a,
|
|
18
|
+
classes: i
|
|
18
19
|
} = e;
|
|
19
|
-
return
|
|
20
|
-
root: ["root",
|
|
21
|
-
},
|
|
22
|
-
},
|
|
20
|
+
return F({
|
|
21
|
+
root: ["root", a === "flex-start" && "alignItemsFlexStart"]
|
|
22
|
+
}, N, i);
|
|
23
|
+
}, A = O("div", {
|
|
23
24
|
name: "MuiListItemIcon",
|
|
24
25
|
slot: "Root",
|
|
25
|
-
overridesResolver: (e,
|
|
26
|
+
overridesResolver: (e, a) => {
|
|
26
27
|
const {
|
|
27
|
-
ownerState:
|
|
28
|
+
ownerState: i
|
|
28
29
|
} = e;
|
|
29
|
-
return [
|
|
30
|
+
return [a.root, i.alignItems === "flex-start" && a.alignItemsFlexStart];
|
|
30
31
|
}
|
|
31
|
-
})(
|
|
32
|
+
})(P(({
|
|
32
33
|
theme: e
|
|
33
34
|
}) => ({
|
|
34
35
|
minWidth: 56,
|
|
@@ -43,25 +44,25 @@ const U = (e) => {
|
|
|
43
44
|
marginTop: 8
|
|
44
45
|
}
|
|
45
46
|
}]
|
|
46
|
-
}))),
|
|
47
|
-
const
|
|
48
|
-
props:
|
|
47
|
+
}))), V = /* @__PURE__ */ S.forwardRef(function(a, i) {
|
|
48
|
+
const l = E({
|
|
49
|
+
props: a,
|
|
49
50
|
name: "MuiListItemIcon"
|
|
50
51
|
}), {
|
|
51
|
-
className:
|
|
52
|
-
...
|
|
53
|
-
} =
|
|
54
|
-
...
|
|
55
|
-
alignItems:
|
|
56
|
-
},
|
|
57
|
-
return /* @__PURE__ */
|
|
58
|
-
className:
|
|
59
|
-
ownerState:
|
|
60
|
-
ref:
|
|
61
|
-
...
|
|
52
|
+
className: u,
|
|
53
|
+
...d
|
|
54
|
+
} = l, g = S.useContext(z), r = {
|
|
55
|
+
...l,
|
|
56
|
+
alignItems: g.alignItems
|
|
57
|
+
}, p = M(r);
|
|
58
|
+
return /* @__PURE__ */ o.jsx(A, {
|
|
59
|
+
className: W(p.root, u),
|
|
60
|
+
ownerState: r,
|
|
61
|
+
ref: i,
|
|
62
|
+
...d
|
|
62
63
|
});
|
|
63
64
|
});
|
|
64
|
-
process.env.NODE_ENV !== "production" && (
|
|
65
|
+
process.env.NODE_ENV !== "production" && (V.propTypes = {
|
|
65
66
|
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
66
67
|
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
67
68
|
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
|
@@ -70,127 +71,148 @@ process.env.NODE_ENV !== "production" && (y.propTypes = {
|
|
|
70
71
|
* The content of the component, normally `Icon`, `SvgIcon`,
|
|
71
72
|
* or a `@mui/icons-material` SVG icon element.
|
|
72
73
|
*/
|
|
73
|
-
children:
|
|
74
|
+
children: t.node,
|
|
74
75
|
/**
|
|
75
76
|
* Override or extend the styles applied to the component.
|
|
76
77
|
*/
|
|
77
|
-
classes:
|
|
78
|
+
classes: t.object,
|
|
78
79
|
/**
|
|
79
80
|
* @ignore
|
|
80
81
|
*/
|
|
81
|
-
className:
|
|
82
|
+
className: t.string,
|
|
82
83
|
/**
|
|
83
84
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
84
85
|
*/
|
|
85
|
-
sx:
|
|
86
|
+
sx: t.oneOfType([t.arrayOf(t.oneOfType([t.func, t.object, t.bool])), t.func, t.object])
|
|
86
87
|
});
|
|
87
|
-
const
|
|
88
|
+
const I = [
|
|
88
89
|
{ code: "en", label: "English", icon: "/assets/flag-uk.svg" },
|
|
89
90
|
{ code: "vi", label: "Vietnamese", icon: "/assets/flag-vi.svg" }
|
|
90
|
-
]
|
|
91
|
-
function B({
|
|
91
|
+
], v = ({
|
|
92
92
|
anchorEl: e,
|
|
93
|
-
onClose:
|
|
94
|
-
open:
|
|
95
|
-
onLanguageChange:
|
|
96
|
-
languages:
|
|
97
|
-
currentLanguage:
|
|
98
|
-
menuWidth:
|
|
99
|
-
flagSize:
|
|
100
|
-
}) {
|
|
101
|
-
const
|
|
102
|
-
(
|
|
103
|
-
|
|
93
|
+
onClose: a,
|
|
94
|
+
open: i = !1,
|
|
95
|
+
onLanguageChange: l,
|
|
96
|
+
languages: u = I,
|
|
97
|
+
currentLanguage: d,
|
|
98
|
+
menuWidth: g = "220px",
|
|
99
|
+
flagSize: r = 28
|
|
100
|
+
}) => {
|
|
101
|
+
const p = y.useCallback(
|
|
102
|
+
(n) => {
|
|
103
|
+
l == null || l(n), a == null || a();
|
|
104
104
|
},
|
|
105
|
-
[
|
|
105
|
+
[l, a]
|
|
106
106
|
);
|
|
107
|
-
return /* @__PURE__ */
|
|
108
|
-
|
|
107
|
+
return /* @__PURE__ */ o.jsx(
|
|
108
|
+
j,
|
|
109
109
|
{
|
|
110
110
|
anchorEl: e,
|
|
111
111
|
anchorOrigin: { horizontal: "right", vertical: "bottom" },
|
|
112
|
-
onClose:
|
|
113
|
-
open:
|
|
114
|
-
slotProps: { paper: { sx: { width:
|
|
112
|
+
onClose: a,
|
|
113
|
+
open: i,
|
|
114
|
+
slotProps: { paper: { sx: { width: g } } },
|
|
115
115
|
transformOrigin: { horizontal: "right", vertical: "top" },
|
|
116
|
-
children:
|
|
117
|
-
const
|
|
118
|
-
return /* @__PURE__ */
|
|
119
|
-
|
|
116
|
+
children: u.map((n) => {
|
|
117
|
+
const s = d === n.code;
|
|
118
|
+
return /* @__PURE__ */ o.jsxs(
|
|
119
|
+
k,
|
|
120
120
|
{
|
|
121
121
|
onClick: () => {
|
|
122
|
-
|
|
122
|
+
p(n.code);
|
|
123
123
|
},
|
|
124
|
-
selected:
|
|
124
|
+
selected: s,
|
|
125
125
|
sx: { gap: 1 },
|
|
126
126
|
children: [
|
|
127
|
-
/* @__PURE__ */
|
|
128
|
-
/* @__PURE__ */
|
|
127
|
+
/* @__PURE__ */ o.jsx(V, { children: /* @__PURE__ */ o.jsx(L, { alt: n.label, src: n.icon, height: r, width: r }) }),
|
|
128
|
+
/* @__PURE__ */ o.jsx(R, { variant: "subtitle2", children: n.label })
|
|
129
129
|
]
|
|
130
130
|
},
|
|
131
|
-
|
|
131
|
+
n.code
|
|
132
132
|
);
|
|
133
133
|
})
|
|
134
134
|
}
|
|
135
135
|
);
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
t ? t(h) : a && a.changeLanguage(h);
|
|
136
|
+
}, x = ({
|
|
137
|
+
languages: e = I,
|
|
138
|
+
onLanguageChange: a,
|
|
139
|
+
currentLanguage: i,
|
|
140
|
+
tooltipText: l,
|
|
141
|
+
buttonFlagSize: u = 24,
|
|
142
|
+
menuFlagSize: d = 28,
|
|
143
|
+
menuWidth: g = "220px",
|
|
144
|
+
sx: r,
|
|
145
|
+
useI18n: p = !0
|
|
146
|
+
}) => {
|
|
147
|
+
var b;
|
|
148
|
+
const { t: n, i18n: s } = p ? q() : { t: null, i18n: null }, m = C(), h = i || ((s == null ? void 0 : s.language) ?? ((b = e[0]) == null ? void 0 : b.code) ?? "en"), c = e.find((f) => f.code === h) || e[0], w = y.useCallback(
|
|
149
|
+
(f) => {
|
|
150
|
+
a ? a(f) : s && s.changeLanguage(f);
|
|
152
151
|
},
|
|
153
|
-
[
|
|
154
|
-
),
|
|
155
|
-
return /* @__PURE__ */
|
|
156
|
-
/* @__PURE__ */
|
|
157
|
-
|
|
152
|
+
[a, s]
|
|
153
|
+
), _ = l || (n ? n("header:language.tooltip") : "Change language");
|
|
154
|
+
return /* @__PURE__ */ o.jsxs(y.Fragment, { children: [
|
|
155
|
+
/* @__PURE__ */ o.jsx(
|
|
156
|
+
T,
|
|
158
157
|
{
|
|
159
|
-
onClick:
|
|
160
|
-
ref:
|
|
161
|
-
sx: { display: { xs: "none", lg: "inline-flex" }, ...
|
|
158
|
+
onClick: m.handleOpen,
|
|
159
|
+
ref: m.anchorRef,
|
|
160
|
+
sx: { display: { xs: "none", lg: "inline-flex" }, ...r },
|
|
162
161
|
tooltipOptions: {
|
|
163
|
-
title:
|
|
162
|
+
title: _,
|
|
164
163
|
placement: "top"
|
|
165
164
|
},
|
|
166
|
-
children: /* @__PURE__ */
|
|
167
|
-
|
|
165
|
+
children: /* @__PURE__ */ o.jsx(
|
|
166
|
+
L,
|
|
168
167
|
{
|
|
169
|
-
alt: (
|
|
170
|
-
src: (
|
|
171
|
-
height:
|
|
172
|
-
width:
|
|
168
|
+
alt: (c == null ? void 0 : c.label) || h,
|
|
169
|
+
src: (c == null ? void 0 : c.icon) || "",
|
|
170
|
+
height: u,
|
|
171
|
+
width: u
|
|
173
172
|
}
|
|
174
173
|
)
|
|
175
174
|
}
|
|
176
175
|
),
|
|
177
|
-
/* @__PURE__ */
|
|
178
|
-
|
|
176
|
+
/* @__PURE__ */ o.jsx(
|
|
177
|
+
v,
|
|
179
178
|
{
|
|
180
|
-
anchorEl:
|
|
181
|
-
onClose:
|
|
182
|
-
open:
|
|
183
|
-
onLanguageChange:
|
|
179
|
+
anchorEl: m.anchorRef.current,
|
|
180
|
+
onClose: m.handleClose,
|
|
181
|
+
open: m.open,
|
|
182
|
+
onLanguageChange: w,
|
|
184
183
|
languages: e,
|
|
185
|
-
currentLanguage:
|
|
186
|
-
menuWidth:
|
|
187
|
-
flagSize:
|
|
184
|
+
currentLanguage: h,
|
|
185
|
+
menuWidth: g,
|
|
186
|
+
flagSize: d
|
|
188
187
|
}
|
|
189
188
|
)
|
|
190
189
|
] });
|
|
190
|
+
};
|
|
191
|
+
x.displayName = "SLanguageSwitcher";
|
|
192
|
+
try {
|
|
193
|
+
v.displayName = "SLanguagePopover", v.__docgenInfo = { description: "", displayName: "SLanguagePopover", props: { anchorEl: { defaultValue: null, description: "", name: "anchorEl", required: !0, type: { name: "Element | null" } }, onClose: { defaultValue: null, description: "", name: "onClose", required: !1, type: { name: "(() => void)" } }, open: { defaultValue: { value: "false" }, description: "", name: "open", required: !1, type: { name: "boolean" } }, onLanguageChange: { defaultValue: null, description: "", name: "onLanguageChange", required: !1, type: { name: "((languageCode: string) => void)" } }, languages: { defaultValue: { value: `[
|
|
194
|
+
{ code: 'en', label: 'English', icon: '/assets/flag-uk.svg' },
|
|
195
|
+
{ code: 'vi', label: 'Vietnamese', icon: '/assets/flag-vi.svg' },
|
|
196
|
+
]` }, description: "", name: "languages", required: !1, type: { name: "SLanguageOption[]" } }, currentLanguage: { defaultValue: null, description: "", name: "currentLanguage", required: !1, type: { name: "string" } }, menuWidth: { defaultValue: { value: "220px" }, description: "", name: "menuWidth", required: !1, type: { name: "string | number" } }, flagSize: { defaultValue: { value: "28" }, description: "", name: "flagSize", required: !1, type: { name: "number" } } } };
|
|
197
|
+
} catch {
|
|
198
|
+
}
|
|
199
|
+
try {
|
|
200
|
+
x.displayName = "SLanguageSwitcher", x.__docgenInfo = { description: "A language switcher component with flag icons and dropdown menu.", displayName: "SLanguageSwitcher", props: { languages: { defaultValue: { value: `[
|
|
201
|
+
{ code: 'en', label: 'English', icon: '/assets/flag-uk.svg' },
|
|
202
|
+
{ code: 'vi', label: 'Vietnamese', icon: '/assets/flag-vi.svg' },
|
|
203
|
+
]` }, description: "Custom language options to display", name: "languages", required: !1, type: { name: "SLanguageOption[]" } }, onLanguageChange: { defaultValue: null, description: "Callback when language changes (if not provided, will use i18n.changeLanguage)", name: "onLanguageChange", required: !1, type: { name: "((languageCode: string) => void)" } }, currentLanguage: { defaultValue: null, description: "Current language code (if not provided, will use i18n.language)", name: "currentLanguage", required: !1, type: { name: "string" } }, tooltipText: { defaultValue: null, description: "Tooltip text for the language button", name: "tooltipText", required: !1, type: { name: "string" } }, buttonFlagSize: { defaultValue: { value: "24" }, description: "Size of the flag icon in the button", name: "buttonFlagSize", required: !1, type: { name: "number" } }, menuFlagSize: { defaultValue: { value: "28" }, description: "Size of the flag icon in the menu", name: "menuFlagSize", required: !1, type: { name: "number" } }, menuWidth: { defaultValue: { value: "220px" }, description: "Width of the language menu", name: "menuWidth", required: !1, type: { name: "string | number" } }, sx: { defaultValue: null, description: "Custom styles for the icon button", name: "sx", required: !1, type: { name: "SxProps<Theme>" } }, useI18n: { defaultValue: { value: "true" }, description: "Whether to use i18n integration", name: "useI18n", required: !1, type: { name: "boolean" } } } };
|
|
204
|
+
} catch {
|
|
205
|
+
}
|
|
206
|
+
try {
|
|
207
|
+
slanguageswitcher.displayName = "slanguageswitcher", slanguageswitcher.__docgenInfo = { description: "A language switcher component with flag icons and dropdown menu.", displayName: "slanguageswitcher", props: { languages: { defaultValue: { value: `[
|
|
208
|
+
{ code: 'en', label: 'English', icon: '/assets/flag-uk.svg' },
|
|
209
|
+
{ code: 'vi', label: 'Vietnamese', icon: '/assets/flag-vi.svg' },
|
|
210
|
+
]` }, description: "Custom language options to display", name: "languages", required: !1, type: { name: "SLanguageOption[]" } }, onLanguageChange: { defaultValue: null, description: "Callback when language changes (if not provided, will use i18n.changeLanguage)", name: "onLanguageChange", required: !1, type: { name: "((languageCode: string) => void)" } }, currentLanguage: { defaultValue: null, description: "Current language code (if not provided, will use i18n.language)", name: "currentLanguage", required: !1, type: { name: "string" } }, tooltipText: { defaultValue: null, description: "Tooltip text for the language button", name: "tooltipText", required: !1, type: { name: "string" } }, buttonFlagSize: { defaultValue: { value: "24" }, description: "Size of the flag icon in the button", name: "buttonFlagSize", required: !1, type: { name: "number" } }, menuFlagSize: { defaultValue: { value: "28" }, description: "Size of the flag icon in the menu", name: "menuFlagSize", required: !1, type: { name: "number" } }, menuWidth: { defaultValue: { value: "220px" }, description: "Width of the language menu", name: "menuWidth", required: !1, type: { name: "string | number" } }, sx: { defaultValue: null, description: "Custom styles for the icon button", name: "sx", required: !1, type: { name: "SxProps<Theme>" } }, useI18n: { defaultValue: { value: "true" }, description: "Whether to use i18n integration", name: "useI18n", required: !1, type: { name: "boolean" } } } };
|
|
211
|
+
} catch {
|
|
191
212
|
}
|
|
192
213
|
export {
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
214
|
+
v as SLanguagePopover,
|
|
215
|
+
x as SLanguageSwitcher,
|
|
216
|
+
x as default,
|
|
217
|
+
I as defaultLanguageOptions
|
|
196
218
|
};
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
import { default as
|
|
1
|
+
import { default as i } from "./s-lazy-image.js";
|
|
2
|
+
try {
|
|
3
|
+
slazyimage.displayName = "slazyimage", slazyimage.__docgenInfo = { description: "A lazy-loading image component with skeleton placeholder.", displayName: "slazyimage", props: { src: { defaultValue: null, description: "Image source URL", name: "src", required: !0, type: { name: "string" } }, variant: { defaultValue: { value: "rounded" }, description: "Skeleton variant while loading", name: "variant", required: !1, type: { name: "enum", value: [{ value: '"text"' }, { value: '"rectangular"' }, { value: '"rounded"' }, { value: '"circular"' }] } }, style: { defaultValue: null, description: "Custom styles applied to both skeleton and loaded image", name: "style", required: !1, type: { name: "CSSProperties" } }, height: { defaultValue: { value: "100%" }, description: "Image height", name: "height", required: !1, type: { name: "string | number" } }, width: { defaultValue: { value: "100%" }, description: "Image width", name: "width", required: !1, type: { name: "string | number" } }, minWidth: { defaultValue: { value: "auto" }, description: "Minimum width constraint", name: "minWidth", required: !1, type: { name: "string | number" } }, minHeight: { defaultValue: { value: "auto" }, description: "Minimum height constraint", name: "minHeight", required: !1, type: { name: "string | number" } } } };
|
|
4
|
+
} catch {
|
|
5
|
+
}
|
|
6
|
+
try {
|
|
7
|
+
SLazyImageProps.displayName = "SLazyImageProps", SLazyImageProps.__docgenInfo = { description: "Props for the SLazyImage component", displayName: "SLazyImageProps", props: {} };
|
|
8
|
+
} catch {
|
|
9
|
+
}
|
|
2
10
|
export {
|
|
3
|
-
|
|
11
|
+
i as default
|
|
4
12
|
};
|
|
@@ -1,75 +1,29 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { SkeletonProps } from '@mui/material';
|
|
3
3
|
/**
|
|
4
|
-
* Props
|
|
5
|
-
*
|
|
6
|
-
* Extends standard HTML image attributes while providing additional configuration
|
|
7
|
-
* for skeleton loading states, responsive dimensions, and performance optimizations.
|
|
4
|
+
* Props for the SLazyImage component
|
|
8
5
|
*/
|
|
9
6
|
export interface SLazyImageProps extends React.ImgHTMLAttributes<HTMLImageElement> {
|
|
10
|
-
/** Image source URL
|
|
7
|
+
/** Image source URL */
|
|
11
8
|
src: string;
|
|
12
|
-
/** Skeleton variant while loading
|
|
9
|
+
/** Skeleton variant while loading */
|
|
13
10
|
variant?: SkeletonProps['variant'];
|
|
14
11
|
/** Custom styles applied to both skeleton and loaded image */
|
|
15
12
|
style?: React.CSSProperties;
|
|
16
|
-
/** Image height
|
|
13
|
+
/** Image height */
|
|
17
14
|
height?: number | string;
|
|
18
|
-
/** Image width
|
|
15
|
+
/** Image width */
|
|
19
16
|
width?: number | string;
|
|
20
|
-
/** Minimum width constraint
|
|
17
|
+
/** Minimum width constraint */
|
|
21
18
|
minWidth?: number | string;
|
|
22
|
-
/** Minimum height constraint
|
|
19
|
+
/** Minimum height constraint */
|
|
23
20
|
minHeight?: number | string;
|
|
24
21
|
}
|
|
25
22
|
/**
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* This component provides a seamless loading experience by displaying a Material-UI skeleton
|
|
29
|
-
* placeholder while the image loads, then smoothly transitioning to the loaded image.
|
|
30
|
-
* Built with performance optimizations and proper theme integration.
|
|
31
|
-
*
|
|
32
|
-
* Key features:
|
|
33
|
-
* - **Performance Optimized**: Uses display toggling instead of opacity for better rendering performance
|
|
34
|
-
* - **Theme Integration**: Leverages useTheme hook for consistent border radius handling across variants
|
|
35
|
-
* - **Smooth Transitions**: Clean skeleton-to-image transition with proper dimension management
|
|
36
|
-
* - **Responsive Design**: Intelligent dimension handling with responsive fallbacks
|
|
37
|
-
* - **Customizable Variants**: Supports Material-UI skeleton variants (rectangular, rounded, circular)
|
|
38
|
-
* - **Memory Efficient**: Proper state management prevents unnecessary re-renders
|
|
39
|
-
* - **Accessibility Ready**: Maintains all standard HTML image attributes and behaviors
|
|
40
|
-
*
|
|
41
|
-
* Performance improvements:
|
|
42
|
-
* - Display toggling (display: none/block) instead of opacity transitions for better GPU performance
|
|
43
|
-
* - Direct prop usage eliminates unnecessary state and re-renders
|
|
44
|
-
* - Theme-aware border radius calculation reduces style recalculations
|
|
45
|
-
* - Simplified onLoad handler reduces execution overhead
|
|
46
|
-
*
|
|
47
|
-
* @param props - SLazyImageProps configuration object
|
|
48
|
-
* @returns JSX.Element - Optimized image component with loading state management
|
|
49
|
-
*
|
|
50
|
-
* @example
|
|
51
|
-
* ```tsx
|
|
52
|
-
* // Basic usage with skeleton loading
|
|
53
|
-
* <SLazyImage src="/image.jpg" width={300} height={200} />
|
|
54
|
-
*
|
|
55
|
-
* // Circular avatar with custom dimensions
|
|
56
|
-
* <SLazyImage
|
|
57
|
-
* src="/avatar.jpg"
|
|
58
|
-
* variant="circular"
|
|
59
|
-
* width={80}
|
|
60
|
-
* height={80}
|
|
61
|
-
* alt="User avatar"
|
|
62
|
-
* />
|
|
63
|
-
*
|
|
64
|
-
* // Responsive image with custom styling
|
|
65
|
-
* <SLazyImage
|
|
66
|
-
* src="/hero.jpg"
|
|
67
|
-
* variant="rounded"
|
|
68
|
-
* style={{ objectFit: 'cover' }}
|
|
69
|
-
* width="100%"
|
|
70
|
-
* height={400}
|
|
71
|
-
* />
|
|
72
|
-
* ```
|
|
23
|
+
* A lazy-loading image component with skeleton placeholder.
|
|
73
24
|
*/
|
|
74
|
-
declare const SLazyImage:
|
|
25
|
+
declare const SLazyImage: {
|
|
26
|
+
({ src, variant, height, width, style, minWidth, minHeight, onLoad, ...props }: SLazyImageProps): React.JSX.Element;
|
|
27
|
+
displayName: string;
|
|
28
|
+
};
|
|
75
29
|
export default SLazyImage;
|