@solostylist/ui-kit 1.0.230 → 2.0.1
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/colors-CNjL5fhq.js +180 -0
- package/dist/gradients-DSnBONEQ.js +199 -0
- package/dist/hooks/index.d.ts +0 -1
- package/dist/hooks/index.js +4 -5
- package/dist/hooks/use-countdown.js +69 -47
- package/dist/main.d.ts +7 -2
- package/dist/main.js +2 -0
- package/dist/palettes/index.d.ts +11 -0
- package/dist/palettes/index.js +2 -0
- package/dist/palettes-CJLuEy1m.js +1765 -0
- package/dist/s-accordion/index.d.ts +2 -1
- package/dist/s-accordion/index.js +1 -1
- package/dist/s-accordion/s-accordion.d.ts +39 -19
- package/dist/s-accordion/s-accordion.js +70 -2
- package/dist/s-action-overlay/index.d.ts +2 -1
- package/dist/s-action-overlay/s-action-overlay.d.ts +52 -51
- package/dist/s-action-overlay/s-action-overlay.js +106 -107
- package/dist/s-autocomplete/index.d.ts +2 -1
- package/dist/s-autocomplete/s-autocomplete.d.ts +25 -8
- package/dist/s-autocomplete/s-autocomplete.js +33 -22
- package/dist/s-avatar/index.d.ts +2 -1
- package/dist/s-avatar/s-avatar.d.ts +36 -18
- package/dist/s-avatar/s-avatar.js +53 -27
- package/dist/s-blur-text/index.d.ts +1 -0
- package/dist/s-blur-text/s-blur-text.d.ts +3 -3
- package/dist/s-blur-text/s-blur-text.js +68 -40
- package/dist/s-brand-logo/index.d.ts +3 -0
- package/dist/s-brand-logo/index.js +2 -0
- package/dist/s-brand-logo/s-brand-logo.d.ts +15 -0
- package/dist/s-brand-logo/s-brand-logo.js +2 -0
- package/dist/s-brand-logo-CErW9Slg.js +123 -0
- package/dist/s-breadcrumbs/index.d.ts +2 -1
- package/dist/s-breadcrumbs/s-breadcrumbs.d.ts +5 -1
- package/dist/s-breadcrumbs/s-breadcrumbs.js +71 -36
- package/dist/s-button/s-button.d.ts +3 -5
- package/dist/s-button/s-button.js +3 -9
- package/dist/s-carousel/index.d.ts +3 -1
- package/dist/s-carousel/index.js +1 -1
- package/dist/s-carousel/s-carousel.d.ts +18 -8
- package/dist/s-carousel/s-carousel.js +184 -2
- package/dist/s-category-card/index.d.ts +2 -1
- package/dist/s-category-card/s-category-card.d.ts +38 -51
- package/dist/s-category-card/s-category-card.js +88 -56
- package/dist/s-chat-input/index.d.ts +2 -1
- package/dist/s-chat-input/index.js +1 -1
- package/dist/s-chat-input/s-chat-input.d.ts +41 -6
- package/dist/s-chat-input/s-chat-input.js +398 -2
- package/dist/s-chat-message/index.d.ts +2 -1
- package/dist/s-chat-message/index.js +1 -1
- package/dist/s-chat-message/s-chat-message.d.ts +6 -3
- package/dist/s-chat-message/s-chat-message.js +314 -2
- package/dist/s-checkbox/index.d.ts +2 -1
- package/dist/s-checkbox/s-checkbox.d.ts +33 -11
- package/dist/s-checkbox/s-checkbox.js +44 -34
- package/dist/s-chip/s-chip.d.ts +3 -5
- package/dist/s-chip/s-chip.js +3 -9
- package/dist/s-chips/index.d.ts +2 -1
- package/dist/s-chips/index.js +1 -1
- package/dist/s-chips/s-chips.d.ts +50 -28
- package/dist/s-chips/s-chips.js +174 -2
- package/dist/s-code-block/index.d.ts +3 -1
- package/dist/s-code-block/index.js +1 -1
- package/dist/s-code-block/s-code-block.d.ts +30 -28
- package/dist/s-code-block/s-code-block.js +103 -2
- package/dist/s-comment-message/index.d.ts +1 -0
- package/dist/s-comment-message/index.js +1 -1
- package/dist/s-comment-message/s-comment-message.d.ts +6 -8
- package/dist/s-comment-message/s-comment-message.js +189 -2
- package/dist/s-copyable-text/index.d.ts +2 -1
- package/dist/s-copyable-text/s-copyable-text.d.ts +34 -17
- package/dist/s-copyable-text/s-copyable-text.js +55 -33
- package/dist/s-countdown/index.d.ts +4 -3
- package/dist/s-countdown/index.js +1 -1
- package/dist/s-countdown/s-count-box.d.ts +39 -32
- package/dist/s-countdown/s-count-box.js +104 -87
- package/dist/s-countdown/s-countdown.d.ts +3 -10
- package/dist/s-countdown/s-countdown.js +86 -70
- package/dist/s-data-table/index.d.ts +2 -1
- package/dist/s-data-table/index.js +1 -1
- package/dist/s-data-table/s-data-table.d.ts +15 -7
- package/dist/s-data-table/s-data-table.js +213 -2
- package/dist/s-date-picker/index.d.ts +3 -1
- package/dist/s-date-picker/index.js +1 -1
- package/dist/s-date-picker/picker-action-bar.js +43 -42
- package/dist/s-date-picker/s-date-picker.d.ts +9 -5
- package/dist/s-date-picker/s-date-picker.js +106 -2
- package/dist/s-datetime-picker/index.d.ts +3 -1
- package/dist/s-datetime-picker/index.js +1 -1
- package/dist/s-datetime-picker/s-datetime-picker.d.ts +9 -5
- package/dist/s-datetime-picker/s-datetime-picker.js +108 -2
- package/dist/s-dialog/index.d.ts +2 -1
- package/dist/s-dialog/s-dialog.d.ts +44 -22
- package/dist/s-dialog/s-dialog.js +76 -39
- package/dist/s-dialog-confirm/index.d.ts +2 -1
- package/dist/s-dialog-confirm/s-dialog-confirm.d.ts +46 -62
- package/dist/s-dialog-confirm/s-dialog-confirm.js +89 -71
- package/dist/s-dialog-message/index.d.ts +2 -1
- package/dist/s-dialog-message/s-dialog-message.d.ts +34 -51
- package/dist/s-dialog-message/s-dialog-message.js +74 -67
- package/dist/s-empty/index.d.ts +1 -0
- package/dist/s-empty/s-empty.d.ts +5 -10
- package/dist/s-empty/s-empty.js +27 -9
- package/dist/s-file-dropzone/index.d.ts +3 -1
- package/dist/s-file-dropzone/index.js +1 -1
- package/dist/s-file-dropzone/s-file-dropzone.d.ts +49 -26
- package/dist/s-file-dropzone/s-file-dropzone.js +219 -2
- package/dist/s-file-icon/index.d.ts +1 -0
- package/dist/s-file-icon/s-file-icon.d.ts +3 -5
- package/dist/s-file-icon/s-file-icon.js +118 -98
- package/dist/s-flex-box/index.d.ts +2 -1
- package/dist/s-flex-box/s-flex-box.d.ts +12 -14
- package/dist/s-flex-box/s-flex-box.js +19 -19
- package/dist/s-form/index.d.ts +2 -1
- package/dist/s-form/s-form.d.ts +33 -18
- package/dist/s-form/s-form.js +50 -21
- package/dist/s-gallery/gallery-grid-item.d.ts +3 -1
- package/dist/s-gallery/gallery-grid-item.js +128 -99
- package/dist/s-gallery/gallery-layout.d.ts +1 -1
- package/dist/s-gallery/gallery-media-item.d.ts +3 -3
- package/dist/s-gallery/gallery-media-item.js +45 -50
- package/dist/s-gallery/index.d.ts +2 -1
- package/dist/s-gallery/s-gallery.d.ts +14 -3
- package/dist/s-gallery/s-gallery.js +70 -51
- package/dist/s-glow-button/index.d.ts +2 -1
- package/dist/s-glow-button/index.js +1 -1
- package/dist/s-glow-button/s-glow-button.d.ts +14 -9
- package/dist/s-glow-button/s-glow-button.js +46 -25
- package/dist/s-gradient-icon/index.d.ts +2 -1
- package/dist/s-gradient-icon/s-gradient-icon.d.ts +17 -9
- package/dist/s-gradient-icon/s-gradient-icon.js +81 -69
- package/dist/s-icon-button/index.d.ts +2 -1
- package/dist/s-icon-button/s-icon-button.d.ts +31 -13
- package/dist/s-icon-button/s-icon-button.js +47 -9
- package/dist/s-image-comparison/index.d.ts +2 -1
- package/dist/s-image-comparison/index.js +1 -1
- package/dist/s-image-comparison/s-image-comparison.d.ts +13 -3
- package/dist/s-image-comparison/s-image-comparison.js +195 -98
- package/dist/{s-image-modal → s-image-viewer}/default-media-item.d.ts +0 -1
- package/dist/s-image-viewer/default-media-item.js +30 -0
- package/dist/s-image-viewer/image-viewer-thumbnail-dock.d.ts +12 -0
- package/dist/s-image-viewer/image-viewer-thumbnail-dock.js +102 -0
- package/dist/s-image-viewer/index.d.ts +4 -0
- package/dist/s-image-viewer/index.js +3 -0
- package/dist/s-image-viewer/s-image-viewer.d.ts +4 -0
- package/dist/s-image-viewer/s-image-viewer.js +266 -0
- package/dist/{s-image-modal → s-image-viewer}/types.d.ts +27 -10
- package/dist/s-image-viewer/use-image-viewer-navigation.d.ts +29 -0
- package/dist/s-image-viewer/use-image-viewer-navigation.js +75 -0
- package/dist/s-label/index.d.ts +2 -1
- package/dist/s-label/s-label.d.ts +35 -18
- package/dist/s-label/s-label.js +64 -23
- package/dist/s-language-switcher/index.d.ts +2 -1
- package/dist/s-language-switcher/index.js +2 -2
- package/dist/s-language-switcher/s-language-switcher.d.ts +25 -18
- package/dist/s-language-switcher/s-language-switcher.js +150 -2
- package/dist/s-lazy-image/index.d.ts +2 -1
- package/dist/s-lazy-image/index.js +1 -1
- package/dist/s-lazy-image/s-lazy-image.d.ts +45 -24
- package/dist/s-lazy-image/s-lazy-image.js +77 -40
- package/dist/s-link/s-link.d.ts +4 -33
- package/dist/s-link/s-link.js +3 -35
- package/dist/s-localization-provider/index.js +1 -1
- package/dist/s-localization-provider/s-localization-provider.d.ts +3 -5
- package/dist/s-localization-provider/s-localization-provider.js +12 -2
- package/dist/s-moving-border/index.d.ts +2 -1
- package/dist/s-moving-border/s-moving-border.d.ts +8 -2
- package/dist/s-moving-border/s-moving-border.js +100 -71
- package/dist/s-nav-item/index.d.ts +2 -1
- package/dist/s-nav-item/s-nav-item.d.ts +39 -31
- package/dist/s-nav-item/s-nav-item.js +65 -66
- package/dist/s-nav-items/index.d.ts +2 -1
- package/dist/s-nav-items/s-nav-items.d.ts +13 -10
- package/dist/s-nav-items/s-nav-items.js +95 -79
- package/dist/s-no-ssr/s-no-ssr.d.ts +4 -16
- package/dist/s-no-ssr/s-no-ssr.js +3 -13
- package/dist/s-overlay-scrollbar/index.d.ts +3 -1
- package/dist/s-overlay-scrollbar/s-overlay-scrollbar.d.ts +10 -8
- package/dist/s-overlay-scrollbar/s-overlay-scrollbar.js +28 -16
- package/dist/s-pagination/index.d.ts +2 -1
- package/dist/s-pagination/s-pagination.d.ts +14 -49
- package/dist/s-pagination/s-pagination.js +70 -35
- package/dist/s-pagination/types.d.ts +23 -1
- package/dist/s-pagination/types.js +8 -4
- package/dist/s-pixel-reveal/index.d.ts +2 -1
- package/dist/s-pixel-reveal/s-pixel-reveal.d.ts +10 -2
- package/dist/s-pixel-reveal/s-pixel-reveal.js +124 -86
- package/dist/s-quantity-input/index.d.ts +3 -0
- package/dist/s-quantity-input/index.js +2 -0
- package/dist/s-quantity-input/s-quantity-input.d.ts +114 -0
- package/dist/s-quantity-input/s-quantity-input.js +246 -0
- package/dist/s-radial-pulse-animate/index.d.ts +2 -1
- package/dist/s-radial-pulse-animate/s-radial-pulse-animate.d.ts +7 -7
- package/dist/s-radial-pulse-animate/s-radial-pulse-animate.js +50 -52
- package/dist/s-rating/s-rating.d.ts +3 -5
- package/dist/s-rating/s-rating.js +3 -9
- package/dist/s-review/index.d.ts +2 -1
- package/dist/s-review/index.js +1 -1
- package/dist/s-review/s-review.d.ts +25 -10
- package/dist/s-review/s-review.js +272 -2
- package/dist/s-scroll-reveal/index.d.ts +3 -1
- package/dist/s-scroll-reveal/s-scroll-reveal.d.ts +14 -6
- package/dist/s-scroll-reveal/s-scroll-reveal.js +78 -60
- package/dist/s-scroll-to-top/index.d.ts +2 -1
- package/dist/s-scroll-to-top/s-scroll-to-top.d.ts +15 -16
- package/dist/s-scroll-to-top/s-scroll-to-top.js +55 -28
- package/dist/s-scroll-velocity/index.d.ts +2 -1
- package/dist/s-scroll-velocity/s-scroll-velocity.d.ts +11 -7
- package/dist/s-scroll-velocity/s-scroll-velocity.js +27 -10
- package/dist/s-scroll-velocity/scroll-velocity-container.d.ts +2 -2
- package/dist/s-scroll-velocity/scroll-velocity-container.js +18 -18
- package/dist/s-scroll-velocity/scroll-velocity-row.d.ts +5 -3
- package/dist/s-scroll-velocity/scroll-velocity-row.js +81 -67
- package/dist/s-select/index.d.ts +2 -1
- package/dist/s-select/index.js +1 -1
- package/dist/s-select/s-select.d.ts +25 -11
- package/dist/s-select/s-select.js +201 -2
- package/dist/s-select-list/index.d.ts +2 -1
- package/dist/s-select-list/s-select-list.d.ts +57 -18
- package/dist/s-select-list/s-select-list.js +156 -32
- package/dist/s-skeleton/index.d.ts +2 -1
- package/dist/s-skeleton/s-skeleton.d.ts +21 -22
- package/dist/s-skeleton/s-skeleton.js +40 -39
- package/dist/s-snackbar-message/index.d.ts +2 -1
- package/dist/s-snackbar-message/s-snackbar-message.d.ts +40 -51
- package/dist/s-snackbar-message/s-snackbar-message.js +81 -44
- package/dist/s-spotlight-cursor/index.d.ts +2 -1
- package/dist/s-spotlight-cursor/s-spotlight-cursor.d.ts +23 -20
- package/dist/s-spotlight-cursor/s-spotlight-cursor.js +83 -58
- package/dist/s-status-illustration/index.d.ts +3 -0
- package/dist/s-status-illustration/index.js +2 -0
- package/dist/s-status-illustration/s-status-illustration.d.ts +57 -0
- package/dist/s-status-illustration/s-status-illustration.js +429 -0
- package/dist/s-stripe/index.d.ts +6 -1
- package/dist/s-stripe/s-stripe-cvc.d.ts +3 -1
- package/dist/s-stripe/s-stripe-expiry.d.ts +3 -1
- package/dist/s-stripe/s-stripe-number.d.ts +3 -1
- package/dist/s-stripe/s-stripe.d.ts +10 -3
- package/dist/s-stripe/s-stripe.js +53 -27
- package/dist/s-stripe/stripe-input.js +48 -20
- package/dist/s-switch/index.d.ts +2 -1
- package/dist/s-switch/s-switch.d.ts +33 -11
- package/dist/s-switch/s-switch.js +44 -34
- package/dist/s-tabs/index.d.ts +5 -3
- package/dist/s-tabs/index.js +5 -4
- package/dist/s-tabs/s-tab-panel.d.ts +12 -10
- package/dist/s-tabs/s-tab-panel.js +26 -19
- package/dist/s-tabs/s-tab.d.ts +3 -2
- package/dist/s-tabs/s-tab.js +3 -9
- package/dist/s-tabs/s-tabs.d.ts +46 -32
- package/dist/s-tabs/s-tabs.js +76 -37
- package/dist/s-tabs/tab-ids.d.ts +3 -0
- package/dist/s-tabs/tab-ids.js +9 -0
- package/dist/s-text-editor/index.d.ts +4 -2
- package/dist/s-text-editor/index.js +1 -1
- package/dist/s-text-editor/s-text-editor-toolbar.d.ts +9 -2
- package/dist/s-text-editor/s-text-editor-toolbar.js +216 -2
- package/dist/s-text-editor/s-text-editor.d.ts +7 -2
- package/dist/s-text-editor/s-text-editor.js +62 -39
- package/dist/s-text-field/index.d.ts +2 -1
- package/dist/s-text-field/index.js +1 -1
- package/dist/s-text-field/s-text-field.d.ts +6 -11
- package/dist/s-text-field/s-text-field.js +52 -2
- package/dist/s-text-shimmer/index.d.ts +2 -1
- package/dist/s-text-shimmer/s-text-shimmer.d.ts +16 -2
- package/dist/s-text-shimmer/s-text-shimmer.js +48 -25
- package/dist/s-text-truncation/index.d.ts +2 -1
- package/dist/s-text-truncation/s-text-truncation.d.ts +38 -14
- package/dist/s-text-truncation/s-text-truncation.js +105 -58
- package/dist/s-theme-demo/index.d.ts +2 -1
- package/dist/s-theme-demo/index.js +1 -1
- package/dist/s-theme-demo/s-theme-demo.d.ts +2 -12
- package/dist/s-theme-demo/s-theme-demo.js +77 -2
- package/dist/s-theme-demo/theme-demo-color-palette-section.d.ts +5 -0
- package/dist/s-theme-demo/theme-demo-color-palette-section.js +185 -0
- package/dist/s-theme-demo/theme-demo-color-ramps-section.d.ts +5 -0
- package/dist/s-theme-demo/theme-demo-color-ramps-section.js +125 -0
- package/dist/s-theme-demo/theme-demo-components-section.d.ts +2 -0
- package/dist/s-theme-demo/theme-demo-components-section.js +265 -0
- package/dist/s-theme-demo/theme-demo-data.d.ts +7 -0
- package/dist/s-theme-demo/theme-demo-data.js +45 -0
- package/dist/s-theme-demo/theme-demo-interactive-section.d.ts +2 -0
- package/dist/s-theme-demo/theme-demo-interactive-section.js +95 -0
- package/dist/s-theme-demo/theme-demo-shadow-section.d.ts +5 -0
- package/dist/s-theme-demo/theme-demo-shadow-section.js +52 -0
- package/dist/s-theme-demo/theme-demo-typography-section.d.ts +5 -0
- package/dist/s-theme-demo/theme-demo-typography-section.js +129 -0
- package/dist/s-theme-demo/types.d.ts +17 -0
- package/dist/s-theme-demo/types.js +0 -0
- package/dist/s-theme-demo/utils.d.ts +2 -0
- package/dist/s-theme-demo/utils.js +9 -0
- package/dist/s-theme-provider/index.d.ts +1 -0
- package/dist/s-theme-provider/s-theme-provider.js +30 -31
- package/dist/s-theme-switch/index.d.ts +2 -1
- package/dist/s-theme-switch/index.js +1 -1
- package/dist/s-theme-switch/s-theme-switch.d.ts +6 -4
- package/dist/s-theme-switch/s-theme-switch.js +60 -2
- package/dist/s-tip/index.d.ts +2 -1
- package/dist/s-tip/index.js +1 -1
- package/dist/s-tip/s-tip.d.ts +29 -11
- package/dist/s-tip/s-tip.js +61 -2
- package/dist/s-toggle-button/index.d.ts +2 -0
- package/dist/s-toggle-button/index.js +2 -0
- package/dist/s-toggle-button/s-toggle-button.d.ts +6 -0
- package/dist/s-toggle-button/s-toggle-button.js +5 -0
- package/dist/s-tool-bar/index.d.ts +2 -1
- package/dist/s-tool-bar/s-tool-bar.d.ts +2 -5
- package/dist/s-tool-bar/s-tool-bar.js +101 -72
- package/dist/s-tool-bar/tool-bar-action-buttons.d.ts +3 -3
- package/dist/s-tool-bar/tool-bar-action-buttons.js +55 -2
- package/dist/s-tool-bar/tool-bar-image-input.d.ts +2 -2
- package/dist/s-tool-bar/tool-bar-image-input.js +148 -2
- package/dist/s-tool-bar/tool-bar-inputs.js +139 -112
- package/dist/s-tool-bar/types.d.ts +45 -35
- package/dist/s-tool-bar/utils.d.ts +1 -0
- package/dist/s-tool-bar/utils.js +10 -7
- package/dist/s-tool-item/index.d.ts +2 -1
- package/dist/s-tool-item/s-tool-item.d.ts +35 -30
- package/dist/s-tool-item/s-tool-item.js +111 -56
- package/dist/s-two-pane-layout/index.d.ts +3 -1
- package/dist/s-two-pane-layout/s-two-pane-layout.d.ts +56 -50
- package/dist/s-two-pane-layout/s-two-pane-layout.js +154 -85
- package/dist/s-typewriter-text/index.d.ts +2 -1
- package/dist/s-typewriter-text/s-typewriter-text.d.ts +16 -5
- package/dist/s-typewriter-text/s-typewriter-text.js +50 -27
- package/dist/s-zoom-image/index.d.ts +2 -1
- package/dist/s-zoom-image/s-zoom-image.d.ts +14 -5
- package/dist/s-zoom-image/s-zoom-image.js +65 -44
- package/dist/theme/component-augmentation.d.ts +265 -0
- package/dist/theme/component-augmentation.js +0 -0
- package/dist/theme/components/accordion-summary.d.ts +41 -38
- package/dist/theme/components/accordion-summary.js +7 -7
- package/dist/theme/components/accordion.d.ts +21 -13
- package/dist/theme/components/accordion.js +15 -12
- package/dist/theme/components/action-styles.d.ts +1075 -0
- package/dist/theme/components/action-styles.js +71 -0
- package/dist/theme/components/alert.d.ts +169 -140
- package/dist/theme/components/alert.js +15 -4
- package/dist/theme/components/app-bar.d.ts +2 -2
- package/dist/theme/components/autocomplete.js +43 -2
- package/dist/theme/components/avatar.js +9 -2
- package/dist/theme/components/backdrop.js +1 -1
- package/dist/theme/components/button-base.d.ts +0 -5
- package/dist/theme/components/button-base.js +1 -10
- package/dist/theme/components/button.d.ts +111 -5275
- package/dist/theme/components/button.js +58 -74
- package/dist/theme/components/card.d.ts +69 -69
- package/dist/theme/components/card.js +11 -10
- package/dist/theme/components/checkbox.d.ts +34 -34
- package/dist/theme/components/checkbox.js +90 -2
- package/dist/theme/components/chip.d.ts +1 -7
- package/dist/theme/components/chip.js +91 -67
- package/dist/theme/components/components.js +22 -22
- package/dist/theme/components/date-calendar.js +1 -0
- package/dist/theme/components/day-calendar.js +1 -0
- package/dist/theme/components/dialog-title.d.ts +2 -2
- package/dist/theme/components/field-label-styles.d.ts +9 -0
- package/dist/theme/components/field-label-styles.js +19 -0
- package/dist/theme/components/form-control.d.ts +1 -1
- package/dist/theme/components/form-control.js +1 -1
- package/dist/theme/components/form-label.d.ts +2 -2
- package/dist/theme/components/form-label.js +1 -1
- package/dist/theme/components/icon-button.d.ts +85 -5228
- package/dist/theme/components/icon-button.js +27 -47
- package/dist/theme/components/input-adornment.d.ts +2 -2
- package/dist/theme/components/linear-progress.d.ts +35 -35
- package/dist/theme/components/linear-progress.js +5 -6
- package/dist/theme/components/link.d.ts +2 -2
- package/dist/theme/components/link.js +7 -9
- package/dist/theme/components/list-item-button.d.ts +120 -46
- package/dist/theme/components/list-item-button.js +27 -20
- package/dist/theme/components/list-item.d.ts +61 -24
- package/dist/theme/components/list-item.js +7 -7
- package/dist/theme/components/list-subheader.d.ts +2 -2
- package/dist/theme/components/month-calendar.d.ts +1049 -6
- package/dist/theme/components/month-calendar.js +25 -15
- package/dist/theme/components/multi-section-digital-clock-section.d.ts +2 -0
- package/dist/theme/components/multi-section-digital-clock-section.js +16 -17
- package/dist/theme/components/outlined-input.d.ts +42 -8
- package/dist/theme/components/outlined-input.js +41 -30
- package/dist/theme/components/pagination-item.d.ts +1038 -1043
- package/dist/theme/components/pagination-item.js +21 -53
- package/dist/theme/components/pagination.js +2 -2
- package/dist/theme/components/picker-day.d.ts +1034 -5
- package/dist/theme/components/picker-day.js +12 -13
- package/dist/theme/components/pickers-arrow-switcher.js +1 -0
- package/dist/theme/components/pickers-calendar-header.d.ts +51 -19
- package/dist/theme/components/pickers-calendar-header.js +49 -25
- package/dist/theme/components/rating.d.ts +12 -0
- package/dist/theme/components/rating.js +4 -1
- package/dist/theme/components/select.js +6 -6
- package/dist/theme/components/slider.d.ts +4 -4
- package/dist/theme/components/step-icon.d.ts +34 -34
- package/dist/theme/components/step-icon.js +9 -10
- package/dist/theme/components/step-label.d.ts +36 -36
- package/dist/theme/components/switch.d.ts +36 -36
- package/dist/theme/components/switch.js +48 -2
- package/dist/theme/components/tab.d.ts +14 -1015
- package/dist/theme/components/tab.js +18 -17
- package/dist/theme/components/table-pagination.js +1 -1
- package/dist/theme/components/tabs.d.ts +20 -1030
- package/dist/theme/components/tabs.js +14 -14
- package/dist/theme/components/toggle-button-group.d.ts +1 -1013
- package/dist/theme/components/toggle-button-group.js +3 -1
- package/dist/theme/components/toggle-button.d.ts +1135 -1014
- package/dist/theme/components/toggle-button.js +93 -2
- package/dist/theme/components/year-calendar.d.ts +1051 -6
- package/dist/theme/components/year-calendar.js +39 -29
- package/dist/theme/optional-component-augmentations/s-carousel.d.ts +14 -0
- package/dist/theme/optional-component-augmentations/s-carousel.js +0 -0
- package/dist/theme/optional-component-augmentations/s-code-block.d.ts +14 -0
- package/dist/theme/optional-component-augmentations/s-code-block.js +0 -0
- package/dist/theme/optional-component-augmentations/s-date-picker.d.ts +14 -0
- package/dist/theme/optional-component-augmentations/s-date-picker.js +0 -0
- package/dist/theme/optional-component-augmentations/s-datetime-picker.d.ts +14 -0
- package/dist/theme/optional-component-augmentations/s-datetime-picker.js +0 -0
- package/dist/theme/optional-component-augmentations/s-file-dropzone.d.ts +14 -0
- package/dist/theme/optional-component-augmentations/s-file-dropzone.js +0 -0
- package/dist/theme/optional-component-augmentations/s-overlay-scrollbar.d.ts +14 -0
- package/dist/theme/optional-component-augmentations/s-overlay-scrollbar.js +0 -0
- package/dist/theme/optional-component-augmentations/s-scroll-reveal.d.ts +14 -0
- package/dist/theme/optional-component-augmentations/s-scroll-reveal.js +0 -0
- package/dist/theme/optional-component-augmentations/s-stripe.d.ts +14 -0
- package/dist/theme/optional-component-augmentations/s-stripe.js +0 -0
- package/dist/theme/optional-component-augmentations/s-text-editor.d.ts +18 -0
- package/dist/theme/optional-component-augmentations/s-text-editor.js +0 -0
- package/dist/theme/optional-component-augmentations/s-two-pane-layout.d.ts +14 -0
- package/dist/theme/optional-component-augmentations/s-two-pane-layout.js +0 -0
- package/dist/theme/theme-primitives.d.ts +51 -8
- package/dist/theme/theme-primitives.js +3 -2
- package/dist/theme-primitives-CRfnMsNy.js +254 -0
- package/dist/utils/canvas-color.d.ts +7 -0
- package/dist/utils/canvas-color.js +62 -0
- package/dist/utils/dayjs.js +9 -146
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/index.js +6 -3
- package/dist/utils/slots.d.ts +12 -0
- package/dist/utils/slots.js +6 -0
- package/dist/utils/sx.d.ts +11 -0
- package/dist/utils/sx.js +4 -0
- package/package.json +1 -1
- package/dist/ArrowUpward-CNiENJp2.js +0 -6
- package/dist/Box-BlmynALm.js +0 -45
- package/dist/ButtonBase-BDefit5I.js +0 -720
- package/dist/ChevronRight-gZJ3kc6N.js +0 -6
- package/dist/Close-CJu3iF1p.js +0 -6
- package/dist/Collapse-JUd84Z9O.js +0 -261
- package/dist/ContentCopy-BMQ2JTA0.js +0 -6
- package/dist/Download-SNal6U7j.js +0 -6
- package/dist/ExpandMore-DIsT5FOp.js +0 -6
- package/dist/Favorite-CbvuQfe4.js +0 -6
- package/dist/FormControl-DsRIRfTs.js +0 -686
- package/dist/InfoOutlined-BCzG-5py.js +0 -6
- package/dist/MenuItem-IOMcBScJ.js +0 -220
- package/dist/MenuList-vtqACjea.js +0 -403
- package/dist/Modal-CLdC2-Th.js +0 -1027
- package/dist/Paper-CPC6sMxx.js +0 -133
- package/dist/Popover-ZneFWo2r.js +0 -333
- package/dist/Stack-BQkLmLFp.js +0 -157
- package/dist/Typography-CZ_MYa-E.js +0 -166
- package/dist/UnfoldMoreRounded-tvqQS6eb.js +0 -6
- package/dist/assets/stripe-input.css +0 -1
- package/dist/autocomplete-Dd4zjpaF.js +0 -43
- package/dist/avatar-DFQ5F7pY.js +0 -10
- package/dist/buttonBaseClasses-BVDyR-hz.js +0 -13
- package/dist/checkbox-DC-OoGvh.js +0 -74
- package/dist/checkboxClasses-DANc9lnq.js +0 -18
- package/dist/chunk-C_CI6nMA.js +0 -13
- package/dist/clsx-Bv8WXdlr.js +0 -34
- package/dist/createSimplePaletteValueFilter-5v48HHyU.js +0 -14
- package/dist/createSvgIcon-HW-tbFcL.js +0 -153
- package/dist/createTheme-Bnw5w28O.js +0 -2506
- package/dist/defaultTheme-Bi3OTfLN.js +0 -5
- package/dist/extends-DM-C9PwL.js +0 -12
- package/dist/formLabelClasses-LXZqWZfM.js +0 -18
- package/dist/generateUtilityClass-tRYNDrlH.js +0 -34
- package/dist/generateUtilityClasses-XrPHiTcM.js +0 -10
- package/dist/hooks/use-is-passed-position.d.ts +0 -1
- package/dist/hooks/use-is-passed-position.js +0 -21
- package/dist/iconButtonClasses-LyjwljJq.js +0 -27
- package/dist/inputAdornmentClasses-ZoGTcUz5.js +0 -19
- package/dist/memoTheme-QMocAblm.js +0 -150
- package/dist/mergeSlotProps-slENzJO5.js +0 -45
- package/dist/monthCalendarClasses-BLfBep-t.js +0 -14
- package/dist/objectWithoutPropertiesLoose-kj3TmhoA.js +0 -12
- package/dist/outlinedInputClasses-DPwt_pSZ.js +0 -38
- package/dist/resolveProps-DrnBChYC.js +0 -30
- package/dist/s-accordion-xPDelTvP.js +0 -453
- package/dist/s-carousel-CvmWl6Sc.js +0 -1324
- package/dist/s-chat-input-BHMymKij.js +0 -352
- package/dist/s-chat-message-C-d9amiC.js +0 -270
- package/dist/s-chips-CAC_vVd0.js +0 -99
- package/dist/s-code-block-DEojINTt.js +0 -630
- package/dist/s-comment-message-Dum0P6de.js +0 -169
- package/dist/s-data-table-DfGYIIvn.js +0 -951
- package/dist/s-date-picker-C06rlE6_.js +0 -640
- package/dist/s-datetime-picker-DnIK-QnQ.js +0 -3837
- package/dist/s-error/index.d.ts +0 -1
- package/dist/s-error/index.js +0 -2
- package/dist/s-error/s-error.d.ts +0 -6
- package/dist/s-error/s-error.js +0 -33
- package/dist/s-error-layout/index.d.ts +0 -2
- package/dist/s-error-layout/index.js +0 -2
- package/dist/s-error-layout/s-error-layout.d.ts +0 -58
- package/dist/s-error-layout/s-error-layout.js +0 -81
- package/dist/s-file-dropzone-C4_hCsN8.js +0 -139
- package/dist/s-image-modal/default-media-item.js +0 -34
- package/dist/s-image-modal/image-modal-thumbnail-dock.d.ts +0 -11
- package/dist/s-image-modal/image-modal-thumbnail-dock.js +0 -102
- package/dist/s-image-modal/index.d.ts +0 -3
- package/dist/s-image-modal/index.js +0 -3
- package/dist/s-image-modal/s-image-modal.d.ts +0 -4
- package/dist/s-image-modal/s-image-modal.js +0 -2
- package/dist/s-image-modal/use-image-modal-navigation.d.ts +0 -29
- package/dist/s-image-modal/use-image-modal-navigation.js +0 -57
- package/dist/s-image-modal-D-Jh-5b3.js +0 -243
- package/dist/s-item-not-found/index.d.ts +0 -2
- package/dist/s-item-not-found/index.js +0 -2
- package/dist/s-item-not-found/s-item-not-found.d.ts +0 -20
- package/dist/s-item-not-found/s-item-not-found.js +0 -243
- package/dist/s-language-switcher-B96dUknj.js +0 -192
- package/dist/s-localization-provider-l5J7myJJ.js +0 -519
- package/dist/s-review-CvTVBxTZ.js +0 -223
- package/dist/s-select-HMWY7frm.js +0 -149
- package/dist/s-text-editor-toolbar-ChtNCg2A.js +0 -2253
- package/dist/s-text-field-DD6nnwwU.js +0 -42
- package/dist/s-theme-demo-Bnv7lPIh.js +0 -867
- package/dist/s-theme-switch-DzXoVmQH.js +0 -37
- package/dist/s-tip-BOGEH1v8.js +0 -34
- package/dist/selectClasses-C-QpiLPi.js +0 -22
- package/dist/styled-BTDmdi4c.js +0 -164
- package/dist/styled-engine-DOxAQ3qw.js +0 -190
- package/dist/svgIconClasses-BtHvkhy5.js +0 -20
- package/dist/switch-BSg1TGWH.js +0 -62
- package/dist/tabClasses-CmFw6sbs.js +0 -20
- package/dist/theme-primitives-CiQYd9Cc.js +0 -431
- package/dist/toggle-button-TmtJ4nSp.js +0 -26
- package/dist/toggle-button-group-BCkdd3Jj.js +0 -26
- package/dist/tool-bar-action-buttons-CSXNDen6.js +0 -50
- package/dist/tool-bar-image-input-IdA6l71Y.js +0 -138
- package/dist/typographyClasses-CiDYRanL.js +0 -31
- package/dist/useControlled-BtZNCHV0.js +0 -5
- package/dist/useControlled-DuSwFVhD.js +0 -29
- package/dist/useEnhancedEffect-Dsu5K7-Z.js +0 -5
- package/dist/useForkRef-yOYCJHzF.js +0 -29
- package/dist/useFormControl-CUs308br.js +0 -18
- package/dist/useMobilePicker-CQA6fYLQ.js +0 -9864
- package/dist/useSlot-IwEDsR9t.js +0 -171
- package/dist/useThemeProps-D4jtjo2I.js +0 -19
- package/dist/utils-CU6O7jrX.js +0 -214
- package/dist/warning-CFMmJJnf.js +0 -111
- package/dist/yearCalendarClasses-DypEe_Vn.js +0 -14
- /package/dist/{s-image-modal → s-image-viewer}/types.js +0 -0
- /package/dist/{utils-B5Rl6Zwv.js → utils-CMeAWSRO.js} +0 -0
|
@@ -1,2 +1,148 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { actionHoverMedia as e, getFocusVisibleStyle as t } from "../theme/components/action-styles.js";
|
|
2
|
+
import { getImageInputFiles as n } from "./utils.js";
|
|
3
|
+
import { SIconButton as r } from "../s-icon-button/s-icon-button.js";
|
|
4
|
+
import i, { useEffect as a } from "react";
|
|
5
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
6
|
+
import { Box as c, ButtonBase as l } from "@mui/material";
|
|
7
|
+
import u from "@mui/icons-material/AddPhotoAlternate";
|
|
8
|
+
import d from "@mui/icons-material/Close";
|
|
9
|
+
//#region lib/s-tool-bar/tool-bar-image-input.tsx
|
|
10
|
+
var f = i.memo(({ input: f, value: p, onChange: m, disabled: h }) => {
|
|
11
|
+
let g = i.useRef(null), [_, v] = i.useState([]), y = f.multiple ?? !1, b = f.maxImages ?? 5;
|
|
12
|
+
a(() => {
|
|
13
|
+
let e = [];
|
|
14
|
+
return v(((t) => {
|
|
15
|
+
if (!t) return [];
|
|
16
|
+
let n = Array.isArray(t) ? t : [t], r = [], i = /* @__PURE__ */ new Map();
|
|
17
|
+
return n.forEach((t) => {
|
|
18
|
+
if (t instanceof File) {
|
|
19
|
+
let n = URL.createObjectURL(t);
|
|
20
|
+
e.push(n);
|
|
21
|
+
let a = `file:${t.name}:${t.size}:${t.lastModified}`, o = i.get(a) ?? 0;
|
|
22
|
+
i.set(a, o + 1), r.push({
|
|
23
|
+
key: o > 0 ? `${a}:${o}` : a,
|
|
24
|
+
src: n
|
|
25
|
+
});
|
|
26
|
+
} else if (typeof t == "string") {
|
|
27
|
+
let e = `url:${t}`, n = i.get(e) ?? 0;
|
|
28
|
+
i.set(e, n + 1), r.push({
|
|
29
|
+
key: n > 0 ? `${e}:${n}` : e,
|
|
30
|
+
src: t
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
}), r;
|
|
34
|
+
})(p)), () => {
|
|
35
|
+
e.forEach((e) => URL.revokeObjectURL(e));
|
|
36
|
+
};
|
|
37
|
+
}, [p]);
|
|
38
|
+
let x = (e) => {
|
|
39
|
+
let t = e.target.files;
|
|
40
|
+
if (!(!t || t.length === 0)) {
|
|
41
|
+
if (y) {
|
|
42
|
+
let r = n(p), i = Array.from(t).slice(0, b - r.length);
|
|
43
|
+
m(e, [...r, ...i], i[0]);
|
|
44
|
+
} else m(e, t[0], t[0]);
|
|
45
|
+
e.target.value = "";
|
|
46
|
+
}
|
|
47
|
+
}, S = (e, t) => {
|
|
48
|
+
if (e.stopPropagation(), y && Array.isArray(p)) {
|
|
49
|
+
let n = p.filter((e, n) => n !== t);
|
|
50
|
+
m(e, n.length > 0 ? n : null);
|
|
51
|
+
} else m(e, null);
|
|
52
|
+
}, C = () => {
|
|
53
|
+
h || y && _.length >= b || g.current?.click();
|
|
54
|
+
}, w = y && _.length < b;
|
|
55
|
+
return /* @__PURE__ */ s(c, {
|
|
56
|
+
sx: {
|
|
57
|
+
display: "flex",
|
|
58
|
+
alignItems: "center",
|
|
59
|
+
gap: .75
|
|
60
|
+
},
|
|
61
|
+
children: [
|
|
62
|
+
/* @__PURE__ */ o("input", {
|
|
63
|
+
type: "file",
|
|
64
|
+
accept: "image/*",
|
|
65
|
+
...f.slotProps?.image ?? {},
|
|
66
|
+
ref: g,
|
|
67
|
+
multiple: y,
|
|
68
|
+
onChange: x,
|
|
69
|
+
disabled: h,
|
|
70
|
+
style: { display: "none" }
|
|
71
|
+
}),
|
|
72
|
+
_.map((t, n) => /* @__PURE__ */ s(c, {
|
|
73
|
+
sx: {
|
|
74
|
+
width: 50,
|
|
75
|
+
height: 50,
|
|
76
|
+
border: 1,
|
|
77
|
+
borderColor: h ? "action.disabled" : "divider",
|
|
78
|
+
borderRadius: 1,
|
|
79
|
+
display: "flex",
|
|
80
|
+
alignItems: "center",
|
|
81
|
+
justifyContent: "center",
|
|
82
|
+
cursor: h ? "not-allowed" : "default",
|
|
83
|
+
position: "relative",
|
|
84
|
+
overflow: "hidden",
|
|
85
|
+
"& .SToolBar-removeImageOverlay": { opacity: 1 },
|
|
86
|
+
"&:focus-within .SToolBar-removeImageOverlay": { opacity: 1 },
|
|
87
|
+
[e]: {
|
|
88
|
+
"& .SToolBar-removeImageOverlay": { opacity: 0 },
|
|
89
|
+
"&:hover .SToolBar-removeImageOverlay, &:focus-within .SToolBar-removeImageOverlay": { opacity: 1 }
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
children: [/* @__PURE__ */ o(c, {
|
|
93
|
+
component: "img",
|
|
94
|
+
src: t.src,
|
|
95
|
+
alt: `Preview ${n + 1}`,
|
|
96
|
+
sx: {
|
|
97
|
+
width: "100%",
|
|
98
|
+
height: "100%",
|
|
99
|
+
objectFit: "cover"
|
|
100
|
+
}
|
|
101
|
+
}), !h && /* @__PURE__ */ o(c, {
|
|
102
|
+
className: "SToolBar-removeImageOverlay",
|
|
103
|
+
sx: (e) => ({
|
|
104
|
+
position: "absolute",
|
|
105
|
+
inset: 0,
|
|
106
|
+
display: "flex",
|
|
107
|
+
alignItems: "center",
|
|
108
|
+
justifyContent: "center",
|
|
109
|
+
pointerEvents: "none",
|
|
110
|
+
transition: e.transitions.create("opacity", { duration: e.transitions.duration.shorter }),
|
|
111
|
+
"@media (prefers-reduced-motion: reduce)": { transition: "none" }
|
|
112
|
+
}),
|
|
113
|
+
children: /* @__PURE__ */ o(r, {
|
|
114
|
+
"aria-label": `Remove image ${n + 1}`,
|
|
115
|
+
onClick: (e) => S(e, n),
|
|
116
|
+
size: "small",
|
|
117
|
+
sx: { pointerEvents: "auto" },
|
|
118
|
+
variant: "overlay",
|
|
119
|
+
children: /* @__PURE__ */ o(d, { fontSize: "small" })
|
|
120
|
+
})
|
|
121
|
+
})]
|
|
122
|
+
}, t.key)),
|
|
123
|
+
(_.length === 0 || w) && /* @__PURE__ */ o(l, {
|
|
124
|
+
"aria-label": "Add image",
|
|
125
|
+
disabled: h,
|
|
126
|
+
onClick: C,
|
|
127
|
+
sx: (e) => ({
|
|
128
|
+
width: 50,
|
|
129
|
+
height: 50,
|
|
130
|
+
border: 1,
|
|
131
|
+
borderColor: h ? "action.disabled" : "divider",
|
|
132
|
+
borderRadius: 1,
|
|
133
|
+
color: h ? "action.disabled" : "action.active",
|
|
134
|
+
display: "flex",
|
|
135
|
+
alignItems: "center",
|
|
136
|
+
justifyContent: "center",
|
|
137
|
+
transition: e.transitions.create(["background-color", "border-color"], { duration: e.transitions.duration.shorter }),
|
|
138
|
+
"@media (hover: hover) and (pointer: fine)": { "&:hover": { bgcolor: "action.hover" } },
|
|
139
|
+
"&.Mui-focusVisible": t(e),
|
|
140
|
+
"@media (prefers-reduced-motion: reduce)": { transition: "none" }
|
|
141
|
+
}),
|
|
142
|
+
children: /* @__PURE__ */ o(u, { sx: { fontSize: 20 } })
|
|
143
|
+
})
|
|
144
|
+
]
|
|
145
|
+
});
|
|
146
|
+
});
|
|
147
|
+
//#endregion
|
|
148
|
+
export { f as ImageInput };
|
|
@@ -1,32 +1,41 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t } from "../s-select-
|
|
3
|
-
import n from "
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
1
|
+
import { toSxArray as e } from "../utils/sx.js";
|
|
2
|
+
import { SSelect as t } from "../s-select/s-select.js";
|
|
3
|
+
import { ImageInput as n } from "./tool-bar-image-input.js";
|
|
4
|
+
import r from "react";
|
|
5
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
|
+
import { Box as o, Slider as s, TextField as c, Typography as l, outlinedInputClasses as u } from "@mui/material";
|
|
7
|
+
import { mergeSlotProps as d } from "@mui/material/utils";
|
|
6
8
|
//#region lib/s-tool-bar/tool-bar-inputs.tsx
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
9
|
+
var f = r.memo(({ input: e, value: t, onChange: n, onFocus: r, onBlur: a, disabled: o }) => {
|
|
10
|
+
let { slotProps: s, ...l } = e.slotProps?.textarea ?? {};
|
|
11
|
+
return /* @__PURE__ */ i(c, {
|
|
12
|
+
value: t ?? "",
|
|
13
|
+
onChange: (e) => n(e, e.target.value),
|
|
14
|
+
onFocus: r,
|
|
15
|
+
onBlur: a,
|
|
16
|
+
placeholder: e.placeholder ?? e.label,
|
|
17
|
+
disabled: o,
|
|
18
|
+
multiline: !0,
|
|
19
|
+
minRows: e.minRows ?? 2,
|
|
20
|
+
maxRows: e.maxRows ?? 5,
|
|
21
|
+
fullWidth: !0,
|
|
22
|
+
variant: "outlined",
|
|
23
|
+
...l,
|
|
24
|
+
slotProps: {
|
|
25
|
+
...s,
|
|
26
|
+
htmlInput: d(s?.htmlInput, { "aria-label": e.label }),
|
|
27
|
+
input: d(s?.input, { sx: {
|
|
28
|
+
backgroundColor: "transparent",
|
|
29
|
+
border: "none",
|
|
30
|
+
padding: 0,
|
|
31
|
+
[`&.${u.focused}`]: { outline: "none" },
|
|
32
|
+
"& fieldset": { border: "none" },
|
|
33
|
+
"&:hover fieldset": { border: "none" },
|
|
34
|
+
"&.Mui-focused fieldset": { border: "none" }
|
|
35
|
+
} })
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
}), p = r.memo((e) => /* @__PURE__ */ i(l, {
|
|
30
39
|
variant: "subtitle2",
|
|
31
40
|
sx: {
|
|
32
41
|
whiteSpace: "nowrap",
|
|
@@ -35,105 +44,123 @@ var u = n.memo(({ input: e, value: t, onChange: n, onFocus: i, onBlur: a, disabl
|
|
|
35
44
|
width: "100% !important"
|
|
36
45
|
},
|
|
37
46
|
children: e.label
|
|
38
|
-
})),
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
47
|
+
})), m = r.memo(({ input: e, value: t, onChange: n, onFocus: r, onBlur: s, disabled: l }) => {
|
|
48
|
+
let { slotProps: u, ...f } = e.slotProps?.number ?? {};
|
|
49
|
+
return /* @__PURE__ */ a(o, {
|
|
50
|
+
sx: {
|
|
51
|
+
width: 80,
|
|
52
|
+
display: "flex",
|
|
53
|
+
flexDirection: "column"
|
|
54
|
+
},
|
|
55
|
+
children: [/* @__PURE__ */ i(p, { label: e.label }), /* @__PURE__ */ i(c, {
|
|
56
|
+
type: "number",
|
|
57
|
+
value: typeof t == "number" ? t : "",
|
|
58
|
+
onChange: (e) => n(e, Number(e.target.value)),
|
|
59
|
+
onFocus: r,
|
|
60
|
+
onBlur: s,
|
|
61
|
+
disabled: l,
|
|
62
|
+
...f,
|
|
63
|
+
slotProps: {
|
|
64
|
+
...u,
|
|
65
|
+
htmlInput: d(u?.htmlInput, {
|
|
66
|
+
"aria-label": e.label,
|
|
67
|
+
min: e.min,
|
|
68
|
+
max: e.max,
|
|
69
|
+
step: e.step
|
|
70
|
+
})
|
|
71
|
+
}
|
|
72
|
+
})]
|
|
73
|
+
});
|
|
74
|
+
}), h = r.memo(({ input: e, value: n, onChange: r, onFocus: s, onBlur: c, disabled: l }) => {
|
|
75
|
+
let { inputProps: u, ...d } = e.slotProps?.select ?? {};
|
|
76
|
+
return /* @__PURE__ */ a(o, {
|
|
77
|
+
sx: {
|
|
78
|
+
width: 180,
|
|
79
|
+
display: "flex",
|
|
80
|
+
flexDirection: "column"
|
|
81
|
+
},
|
|
82
|
+
children: [/* @__PURE__ */ i(p, { label: e.label }), /* @__PURE__ */ i(t, {
|
|
83
|
+
value: n ?? "",
|
|
84
|
+
onChange: (e) => r(e, e.target.value),
|
|
85
|
+
onFocus: s,
|
|
86
|
+
onBlur: c,
|
|
87
|
+
disabled: l,
|
|
88
|
+
placeholder: e.placeholder,
|
|
89
|
+
options: e.options ?? [],
|
|
90
|
+
optionLabel: e.optionLabel,
|
|
91
|
+
optionValue: e.optionValue,
|
|
92
|
+
searchable: e.searchable,
|
|
93
|
+
searchPlaceholder: e.searchPlaceholder,
|
|
94
|
+
...d,
|
|
95
|
+
inputProps: {
|
|
96
|
+
"aria-label": e.label,
|
|
97
|
+
...u
|
|
98
|
+
}
|
|
99
|
+
})]
|
|
100
|
+
});
|
|
101
|
+
}), g = r.memo(({ input: t, value: n, onChange: r, onFocus: c, onBlur: u, disabled: d }) => {
|
|
102
|
+
let { sx: f, ...m } = t.slotProps?.slider ?? {};
|
|
103
|
+
return /* @__PURE__ */ a(o, {
|
|
85
104
|
sx: {
|
|
105
|
+
width: 160,
|
|
86
106
|
display: "flex",
|
|
87
|
-
|
|
88
|
-
height: 36
|
|
107
|
+
flexDirection: "column"
|
|
89
108
|
},
|
|
90
|
-
children: [/* @__PURE__ */
|
|
91
|
-
value: t ?? e.defaultValue ?? e.min ?? 0,
|
|
92
|
-
onChange: (e, t) => n(t),
|
|
93
|
-
onMouseDown: s,
|
|
94
|
-
onMouseUp: l,
|
|
95
|
-
disabled: u,
|
|
96
|
-
min: e.min ?? 0,
|
|
97
|
-
max: e.max ?? 100,
|
|
98
|
-
step: e.step ?? 1,
|
|
99
|
-
sx: { flex: 1 },
|
|
100
|
-
...e.componentProps?.slider ?? {}
|
|
101
|
-
}), /* @__PURE__ */ r(c, {
|
|
102
|
-
variant: "body2",
|
|
109
|
+
children: [/* @__PURE__ */ i(p, { label: t.label }), /* @__PURE__ */ a(o, {
|
|
103
110
|
sx: {
|
|
104
|
-
|
|
105
|
-
|
|
111
|
+
display: "flex",
|
|
112
|
+
alignItems: "center",
|
|
113
|
+
height: 36
|
|
106
114
|
},
|
|
107
|
-
children:
|
|
115
|
+
children: [/* @__PURE__ */ i(s, {
|
|
116
|
+
"aria-label": t.label,
|
|
117
|
+
value: typeof n == "number" ? n : t.min ?? 0,
|
|
118
|
+
onChange: (e, t) => r(e, t),
|
|
119
|
+
onMouseDown: c,
|
|
120
|
+
onMouseUp: u,
|
|
121
|
+
disabled: d,
|
|
122
|
+
min: t.min ?? 0,
|
|
123
|
+
max: t.max ?? 100,
|
|
124
|
+
step: t.step ?? 1,
|
|
125
|
+
...m,
|
|
126
|
+
sx: [{ flex: 1 }, ...e(f)]
|
|
127
|
+
}), /* @__PURE__ */ i(l, {
|
|
128
|
+
variant: "body2",
|
|
129
|
+
sx: {
|
|
130
|
+
minWidth: 60,
|
|
131
|
+
textAlign: "center"
|
|
132
|
+
},
|
|
133
|
+
children: typeof n == "number" ? n : t.min ?? 0
|
|
134
|
+
})]
|
|
108
135
|
})]
|
|
109
|
-
})
|
|
110
|
-
})
|
|
111
|
-
switch (
|
|
112
|
-
case "textarea": return /* @__PURE__ */
|
|
113
|
-
case "number": return /* @__PURE__ */
|
|
114
|
-
case "slider": return /* @__PURE__ */
|
|
115
|
-
case "select": return /* @__PURE__ */
|
|
116
|
-
case "image": return /* @__PURE__ */
|
|
117
|
-
input:
|
|
118
|
-
value:
|
|
119
|
-
onChange:
|
|
120
|
-
disabled:
|
|
136
|
+
});
|
|
137
|
+
}), _ = (e) => {
|
|
138
|
+
switch (e.input.type) {
|
|
139
|
+
case "textarea": return /* @__PURE__ */ i(f, { ...e });
|
|
140
|
+
case "number": return /* @__PURE__ */ i(m, { ...e });
|
|
141
|
+
case "slider": return /* @__PURE__ */ i(g, { ...e });
|
|
142
|
+
case "select": return /* @__PURE__ */ i(h, { ...e });
|
|
143
|
+
case "image": return /* @__PURE__ */ i(n, {
|
|
144
|
+
input: e.input,
|
|
145
|
+
value: e.value,
|
|
146
|
+
onChange: e.onChange,
|
|
147
|
+
disabled: e.disabled
|
|
121
148
|
});
|
|
122
149
|
default: return null;
|
|
123
150
|
}
|
|
124
|
-
},
|
|
151
|
+
}, v = r.memo(({ input: e, value: t, disabled: n, onChange: r, onFocus: a, onBlur: s }) => e.renderInput ? /* @__PURE__ */ i(o, { children: e.renderInput({
|
|
125
152
|
value: t,
|
|
126
|
-
onChange:
|
|
127
|
-
onFocus:
|
|
153
|
+
onChange: r,
|
|
154
|
+
onFocus: a,
|
|
128
155
|
onBlur: s,
|
|
129
156
|
disabled: n
|
|
130
|
-
}) }) : /* @__PURE__ */
|
|
157
|
+
}) }) : /* @__PURE__ */ i(_, {
|
|
131
158
|
input: e,
|
|
132
159
|
value: t,
|
|
133
|
-
onChange:
|
|
134
|
-
onFocus:
|
|
160
|
+
onChange: r,
|
|
161
|
+
onFocus: a,
|
|
135
162
|
onBlur: s,
|
|
136
163
|
disabled: n
|
|
137
164
|
}));
|
|
138
165
|
//#endregion
|
|
139
|
-
export {
|
|
166
|
+
export { v as ToolbarInputItem };
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { BoxProps, DialogContentProps, DialogProps, DialogTitleProps, SliderProps, TextFieldProps } from '@mui/material';
|
|
3
|
+
import { SSelectProps } from '../s-select';
|
|
4
|
+
import { OwnerStateSlotProps as MuiOwnerStateSlotProps } from '../utils/slots';
|
|
4
5
|
/**
|
|
5
6
|
* Possible value types for SToolBar inputs
|
|
6
7
|
*/
|
|
7
8
|
export type SToolBarValue = string | number | File | (string | File)[] | null;
|
|
9
|
+
/** Source event emitted by native, React, or MUI input controls. */
|
|
10
|
+
export type SToolBarChangeEvent = Event | React.SyntheticEvent;
|
|
8
11
|
/**
|
|
9
12
|
* Base type constraint for select options
|
|
10
13
|
*/
|
|
@@ -63,13 +66,13 @@ export interface SToolBarInput {
|
|
|
63
66
|
*
|
|
64
67
|
* Only the props relevant to the current `type` are used.
|
|
65
68
|
*/
|
|
66
|
-
|
|
69
|
+
slotProps?: SToolBarInputSlotProps;
|
|
67
70
|
/** Custom renderer for the input */
|
|
68
71
|
renderInput?: (props: {
|
|
69
72
|
value: SToolBarValue;
|
|
70
|
-
onChange: (value: SToolBarValue) => void;
|
|
71
|
-
onFocus: () => void;
|
|
72
|
-
onBlur: () => void;
|
|
73
|
+
onChange: (event: SToolBarChangeEvent, value: SToolBarValue, file?: File) => void;
|
|
74
|
+
onFocus: (event: SToolBarChangeEvent) => void;
|
|
75
|
+
onBlur: (event: SToolBarChangeEvent) => void;
|
|
73
76
|
disabled?: boolean;
|
|
74
77
|
}) => React.ReactNode;
|
|
75
78
|
}
|
|
@@ -77,28 +80,15 @@ export interface SToolBarInput {
|
|
|
77
80
|
* Per-type overrides forwarded to the underlying child components.
|
|
78
81
|
* Omit props that are already managed by SToolBar to avoid conflicts.
|
|
79
82
|
*/
|
|
80
|
-
export interface
|
|
83
|
+
export interface SToolBarInputSlotProps {
|
|
81
84
|
/** Extra props for the MUI TextField used in `textarea` inputs */
|
|
82
85
|
textarea?: Omit<TextFieldProps, 'value' | 'onChange' | 'onFocus' | 'onBlur' | 'disabled' | 'multiline' | 'minRows' | 'maxRows' | 'fullWidth' | 'placeholder'>;
|
|
83
86
|
/** Extra props for the MUI TextField used in `number` inputs */
|
|
84
|
-
number?: Omit<TextFieldProps, 'value' | 'onChange' | 'onFocus' | 'onBlur' | 'disabled' | 'type'
|
|
87
|
+
number?: Omit<TextFieldProps, 'value' | 'onChange' | 'onFocus' | 'onBlur' | 'disabled' | 'type'>;
|
|
85
88
|
/** Extra props for the MUI Slider used in `slider` inputs */
|
|
86
89
|
slider?: Omit<SliderProps, 'value' | 'onChange' | 'onMouseDown' | 'onMouseUp' | 'disabled' | 'min' | 'max' | 'step'>;
|
|
87
90
|
/** Extra props for SSelect used in `select` inputs */
|
|
88
|
-
select?: Omit<
|
|
89
|
-
/** Field label displayed above the select */
|
|
90
|
-
label?: string | React.ReactNode;
|
|
91
|
-
/** Error message to display below the field */
|
|
92
|
-
error?: string;
|
|
93
|
-
/** Whether the field is required */
|
|
94
|
-
required?: boolean;
|
|
95
|
-
/** Whether to use simple value rendering */
|
|
96
|
-
simple?: boolean;
|
|
97
|
-
/** HTML id attribute for the select element */
|
|
98
|
-
htmlFor?: string;
|
|
99
|
-
/** Custom render function for dropdown options */
|
|
100
|
-
renderOption?: (option: SToolBarOption) => React.ReactNode;
|
|
101
|
-
};
|
|
91
|
+
select?: Omit<SSelectProps<SToolBarOption>, 'disabled' | 'onBlur' | 'onChange' | 'onFocus' | 'optionLabel' | 'options' | 'optionValue' | 'placeholder' | 'ref' | 'searchable' | 'searchPlaceholder' | 'value'>;
|
|
102
92
|
/** Extra props for the native `<input type="file">` element used in `image` inputs */
|
|
103
93
|
image?: Omit<React.InputHTMLAttributes<HTMLInputElement>, 'ref' | 'type' | 'multiple' | 'onChange' | 'disabled' | 'style'>;
|
|
104
94
|
}
|
|
@@ -111,26 +101,45 @@ export interface SToolBarInputControlProps {
|
|
|
111
101
|
/** Current value of the input */
|
|
112
102
|
value: SToolBarValue;
|
|
113
103
|
/** Callback when the value changes */
|
|
114
|
-
onChange: (value: SToolBarValue) => void;
|
|
104
|
+
onChange: (event: SToolBarChangeEvent, value: SToolBarValue, file?: File) => void;
|
|
115
105
|
/** Callback when the input gains focus */
|
|
116
|
-
onFocus: () => void;
|
|
106
|
+
onFocus: (event: SToolBarChangeEvent) => void;
|
|
117
107
|
/** Callback when the input loses focus */
|
|
118
|
-
onBlur: () => void;
|
|
108
|
+
onBlur: (event: SToolBarChangeEvent) => void;
|
|
119
109
|
/** Whether the input is disabled */
|
|
120
110
|
disabled?: boolean;
|
|
121
111
|
}
|
|
122
112
|
/**
|
|
123
113
|
* Props interface for SToolBar component
|
|
124
114
|
*/
|
|
125
|
-
export
|
|
115
|
+
export type SToolBarOwnerState = SToolBarProps & {
|
|
116
|
+
position: 'bottom' | 'top';
|
|
117
|
+
processing: boolean;
|
|
118
|
+
relative: boolean;
|
|
119
|
+
uploading: boolean;
|
|
120
|
+
};
|
|
121
|
+
type OwnerStateSlotProps<Props> = MuiOwnerStateSlotProps<Props, SToolBarOwnerState>;
|
|
122
|
+
export interface SToolBarSlots {
|
|
123
|
+
dialog?: React.ElementType;
|
|
124
|
+
dialogContent?: React.ElementType;
|
|
125
|
+
dialogTitle?: React.ElementType;
|
|
126
|
+
toolbar?: React.ElementType;
|
|
127
|
+
}
|
|
128
|
+
export interface SToolBarSlotProps {
|
|
129
|
+
dialog?: OwnerStateSlotProps<Omit<DialogProps, 'children' | 'open'>>;
|
|
130
|
+
dialogContent?: OwnerStateSlotProps<DialogContentProps>;
|
|
131
|
+
dialogTitle?: OwnerStateSlotProps<DialogTitleProps>;
|
|
132
|
+
toolbar?: OwnerStateSlotProps<BoxProps>;
|
|
133
|
+
}
|
|
134
|
+
export interface SToolBarProps extends Omit<BoxProps, 'children' | 'component' | 'onReset'> {
|
|
126
135
|
/** Configuration for input fields */
|
|
127
136
|
inputs?: SToolBarInput[];
|
|
128
137
|
/** Callback when process button is clicked */
|
|
129
|
-
onProcess?:
|
|
138
|
+
onProcess?: React.MouseEventHandler<HTMLButtonElement>;
|
|
130
139
|
/** Callback when reset button is clicked */
|
|
131
|
-
onReset?:
|
|
140
|
+
onReset?: React.MouseEventHandler<HTMLButtonElement>;
|
|
132
141
|
/** Callback when download button is clicked */
|
|
133
|
-
onDownload?:
|
|
142
|
+
onDownload?: React.MouseEventHandler<HTMLButtonElement>;
|
|
134
143
|
/** Whether the toolbar is in processing state */
|
|
135
144
|
processing?: boolean;
|
|
136
145
|
/** Whether the toolbar is in uploading state */
|
|
@@ -138,9 +147,9 @@ export interface SToolBarProps {
|
|
|
138
147
|
/** Input values controlled externally */
|
|
139
148
|
inputValues?: Record<string, SToolBarValue>;
|
|
140
149
|
/** Callback when input values change */
|
|
141
|
-
onInputChange?: (key: string, value: SToolBarValue, file?: File) => void;
|
|
150
|
+
onInputChange?: (event: SToolBarChangeEvent, key: string, value: SToolBarValue, file?: File) => void;
|
|
142
151
|
/** Custom action buttons between inputs and standard actions */
|
|
143
|
-
|
|
152
|
+
actions?: React.ReactNode;
|
|
144
153
|
/** Hide the main process button */
|
|
145
154
|
hideProcessButton?: boolean;
|
|
146
155
|
/** Override to disable the process button */
|
|
@@ -163,8 +172,9 @@ export interface SToolBarProps {
|
|
|
163
172
|
position?: 'bottom' | 'top';
|
|
164
173
|
/** Use relative positioning within container instead of fixed viewport positioning */
|
|
165
174
|
relative?: boolean;
|
|
166
|
-
/**
|
|
167
|
-
|
|
168
|
-
/**
|
|
169
|
-
|
|
175
|
+
/** Components used for the toolbar and info-dialog slots. */
|
|
176
|
+
slots?: SToolBarSlots;
|
|
177
|
+
/** Props or owner-state callbacks for component slots. */
|
|
178
|
+
slotProps?: SToolBarSlotProps;
|
|
170
179
|
}
|
|
180
|
+
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { SToolBarInput, SToolBarValue } from './types';
|
|
2
2
|
export declare function isRequiredInputFilled(input: SToolBarInput, value: SToolBarValue): boolean;
|
|
3
3
|
export declare function getImageInputFiles(value: SToolBarValue): Array<string | File>;
|
|
4
|
+
export declare function getToolBarInputValue(input: SToolBarInput, inputValues: Record<string, SToolBarValue>): SToolBarValue;
|
|
4
5
|
export declare function groupInputsByType(inputs: SToolBarInput[]): {
|
|
5
6
|
imageInputs: SToolBarInput[];
|
|
6
7
|
textareaInputs: SToolBarInput[];
|
package/dist/s-tool-bar/utils.js
CHANGED
|
@@ -1,22 +1,25 @@
|
|
|
1
1
|
//#region lib/s-tool-bar/utils.ts
|
|
2
|
-
function e(e,
|
|
3
|
-
return e.required ? e.type === "textarea" ? typeof
|
|
2
|
+
function e(e, n) {
|
|
3
|
+
return e.required ? e.type === "textarea" ? typeof n == "string" && n.trim() !== "" : e.type === "number" || e.type === "slider" ? n != null : e.type === "select" ? n != null && n !== "" : e.type === "image" ? t(n).length > 0 : !0 : !0;
|
|
4
4
|
}
|
|
5
5
|
function t(e) {
|
|
6
|
-
return Array.isArray(e) ? e : e instanceof File || typeof e == "string" ? [e] : [];
|
|
6
|
+
return Array.isArray(e) ? e.filter((e) => e instanceof File || typeof e == "string" && e.trim() !== "") : e instanceof File || typeof e == "string" && e.trim() !== "" ? [e] : [];
|
|
7
7
|
}
|
|
8
|
-
function n(e) {
|
|
8
|
+
function n(e, t) {
|
|
9
|
+
return Object.prototype.hasOwnProperty.call(t, e.key) ? t[e.key] : e.defaultValue ?? null;
|
|
10
|
+
}
|
|
11
|
+
function r(e) {
|
|
9
12
|
return e.reduce((e, t) => (t.type === "image" ? e.imageInputs.push(t) : t.type === "textarea" ? e.textareaInputs.push(t) : e.paramInputs.push(t), e), {
|
|
10
13
|
imageInputs: [],
|
|
11
14
|
textareaInputs: [],
|
|
12
15
|
paramInputs: []
|
|
13
16
|
});
|
|
14
17
|
}
|
|
15
|
-
function
|
|
18
|
+
function i(e, t) {
|
|
16
19
|
return e.length > 0 || t.length > 0;
|
|
17
20
|
}
|
|
18
|
-
function
|
|
21
|
+
function a(e, t, n, r) {
|
|
19
22
|
return e || !t || n || r;
|
|
20
23
|
}
|
|
21
24
|
//#endregion
|
|
22
|
-
export { t as getImageInputFiles, n as
|
|
25
|
+
export { t as getImageInputFiles, n as getToolBarInputValue, r as groupInputsByType, i as hasVisibleInputSection, a as isProcessActionDisabled, e as isRequiredInputFilled };
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
export { default, default as SToolItem } from './s-tool-item';
|
|
2
|
-
export type { SToolItemProps } from './s-tool-item';
|
|
2
|
+
export type { SToolItemOwnerState, SToolItemProps, SToolItemSlotProps, SToolItemSlots } from './s-tool-item';
|
|
3
|
+
export type {} from '../theme/component-augmentation';
|