@melodicdev/components 2.0.2 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -6
- package/assets/melodic-components.js +5568 -4145
- package/assets/melodic-components.js.map +1 -1
- package/assets/melodic-components.min.js +6469 -5147
- package/lib/components/data-display/activity-feed/activity-feed-item.component.d.ts +15 -14
- package/lib/components/data-display/activity-feed/activity-feed-item.component.d.ts.map +1 -1
- package/lib/components/data-display/activity-feed/activity-feed-item.component.js +36 -16
- package/lib/components/data-display/activity-feed/activity-feed-item.styles.d.ts.map +1 -1
- package/lib/components/data-display/activity-feed/activity-feed-item.styles.js +4 -0
- package/lib/components/data-display/activity-feed/activity-feed-item.template.d.ts.map +1 -1
- package/lib/components/data-display/activity-feed/activity-feed-item.template.js +15 -14
- package/lib/components/data-display/avatar/avatar.component.d.ts +9 -4
- package/lib/components/data-display/avatar/avatar.component.d.ts.map +1 -1
- package/lib/components/data-display/avatar/avatar.component.js +12 -3
- package/lib/components/data-display/avatar/avatar.template.js +1 -1
- package/lib/components/data-display/badge/badge.component.d.ts +2 -3
- package/lib/components/data-display/badge/badge.component.d.ts.map +1 -1
- package/lib/components/data-display/badge/badge.styles.d.ts.map +1 -1
- package/lib/components/data-display/badge/badge.styles.js +56 -35
- package/lib/components/data-display/badge/badge.types.d.ts +2 -0
- package/lib/components/data-display/badge/badge.types.d.ts.map +1 -1
- package/lib/components/data-display/calendar-view/calendar-view.utils.d.ts +10 -0
- package/lib/components/data-display/calendar-view/calendar-view.utils.d.ts.map +1 -1
- package/lib/components/data-display/calendar-view/calendar-view.utils.js +59 -27
- package/lib/components/data-display/data-grid/data-grid.component.d.ts +6 -5
- package/lib/components/data-display/data-grid/data-grid.component.d.ts.map +1 -1
- package/lib/components/data-display/data-grid/data-grid.component.js +49 -110
- package/lib/components/data-display/data-grid/data-grid.template.d.ts.map +1 -1
- package/lib/components/data-display/data-grid/data-grid.template.js +2 -6
- package/lib/components/data-display/list/list-item.component.d.ts +15 -6
- package/lib/components/data-display/list/list-item.component.d.ts.map +1 -1
- package/lib/components/data-display/list/list-item.component.js +57 -6
- package/lib/components/data-display/list/list-item.styles.d.ts.map +1 -1
- package/lib/components/data-display/list/list-item.styles.js +5 -0
- package/lib/components/data-display/list/list-item.template.d.ts.map +1 -1
- package/lib/components/data-display/list/list-item.template.js +18 -12
- package/lib/components/data-display/profile-card/profile-card.component.d.ts +2 -2
- package/lib/components/data-display/profile-card/profile-card.component.d.ts.map +1 -1
- package/lib/components/data-display/profile-card/profile-card.component.js +17 -15
- package/lib/components/data-display/profile-card/profile-card.template.js +1 -1
- package/lib/components/data-display/stat-card/stat-card.component.d.ts +6 -6
- package/lib/components/data-display/stat-card/stat-card.component.d.ts.map +1 -1
- package/lib/components/data-display/stat-card/stat-card.component.js +14 -6
- package/lib/components/data-display/stat-card/stat-card.template.js +4 -4
- package/lib/components/data-display/table/table.component.d.ts +7 -5
- package/lib/components/data-display/table/table.component.d.ts.map +1 -1
- package/lib/components/data-display/table/table.component.js +40 -117
- package/lib/components/data-display/table/table.styles.d.ts.map +1 -1
- package/lib/components/data-display/table/table.styles.js +5 -2
- package/lib/components/data-display/table/table.template.d.ts.map +1 -1
- package/lib/components/data-display/table/table.template.js +1 -6
- package/lib/components/data-display/table-core/index.d.ts +3 -0
- package/lib/components/data-display/table-core/index.d.ts.map +1 -0
- package/lib/components/data-display/table-core/index.js +2 -0
- package/lib/components/data-display/table-core/table-core.d.ts +137 -0
- package/lib/components/data-display/table-core/table-core.d.ts.map +1 -0
- package/lib/components/data-display/table-core/table-core.js +225 -0
- package/lib/components/data-display/tag/tag.component.d.ts +14 -7
- package/lib/components/data-display/tag/tag.component.d.ts.map +1 -1
- package/lib/components/data-display/tag/tag.component.js +29 -5
- package/lib/components/data-display/tag/tag.template.js +2 -2
- package/lib/components/data-display/tag/tag.types.d.ts +8 -1
- package/lib/components/data-display/tag/tag.types.d.ts.map +1 -1
- package/lib/components/feedback/alert/alert.component.d.ts +6 -3
- package/lib/components/feedback/alert/alert.component.d.ts.map +1 -1
- package/lib/components/feedback/alert/alert.component.js +13 -4
- package/lib/components/feedback/alert/alert.template.js +1 -1
- package/lib/components/feedback/progress/progress.component.d.ts +4 -0
- package/lib/components/feedback/progress/progress.component.d.ts.map +1 -1
- package/lib/components/feedback/progress/progress.component.js +9 -0
- package/lib/components/feedback/progress/progress.template.d.ts.map +1 -1
- package/lib/components/feedback/progress/progress.template.js +19 -5
- package/lib/components/feedback/toast/toast.component.d.ts +6 -3
- package/lib/components/feedback/toast/toast.component.d.ts.map +1 -1
- package/lib/components/feedback/toast/toast.component.js +13 -4
- package/lib/components/feedback/toast/toast.service.d.ts.map +1 -1
- package/lib/components/feedback/toast/toast.service.js +2 -1
- package/lib/components/feedback/toast/toast.template.js +1 -1
- package/lib/components/forms/autocomplete/autocomplete.component.d.ts +12 -4
- package/lib/components/forms/autocomplete/autocomplete.component.d.ts.map +1 -1
- package/lib/components/forms/autocomplete/autocomplete.component.js +39 -30
- package/lib/components/forms/autocomplete/autocomplete.template.d.ts.map +1 -1
- package/lib/components/forms/autocomplete/autocomplete.template.js +14 -0
- package/lib/components/forms/button/button.component.d.ts +28 -3
- package/lib/components/forms/button/button.component.d.ts.map +1 -1
- package/lib/components/forms/button/button.component.js +81 -6
- package/lib/components/forms/button/button.template.js +1 -1
- package/lib/components/forms/button/button.types.d.ts +8 -1
- package/lib/components/forms/button/button.types.d.ts.map +1 -1
- package/lib/components/forms/button-group/button-group-item.component.d.ts +2 -2
- package/lib/components/forms/button-group/button-group-item.component.d.ts.map +1 -1
- package/lib/components/forms/button-group/button-group.component.d.ts +4 -2
- package/lib/components/forms/button-group/button-group.component.d.ts.map +1 -1
- package/lib/components/forms/button-group/button-group.component.js +3 -1
- package/lib/components/forms/button-group/button-group.styles.d.ts.map +1 -1
- package/lib/components/forms/button-group/button-group.styles.js +15 -1
- package/lib/components/forms/button-group/button-group.template.d.ts.map +1 -1
- package/lib/components/forms/button-group/button-group.template.js +4 -2
- package/lib/components/forms/checkbox/checkbox.component.d.ts +4 -2
- package/lib/components/forms/checkbox/checkbox.component.d.ts.map +1 -1
- package/lib/components/forms/checkbox/checkbox.component.js +3 -1
- package/lib/components/forms/checkbox/checkbox.styles.d.ts.map +1 -1
- package/lib/components/forms/checkbox/checkbox.styles.js +19 -0
- package/lib/components/forms/checkbox/checkbox.template.d.ts.map +1 -1
- package/lib/components/forms/checkbox/checkbox.template.js +4 -2
- package/lib/components/forms/date-picker/calendar.component.js +1 -1
- package/lib/components/forms/date-picker/date-picker.component.d.ts +11 -4
- package/lib/components/forms/date-picker/date-picker.component.d.ts.map +1 -1
- package/lib/components/forms/date-picker/date-picker.component.js +99 -32
- package/lib/components/forms/date-picker/date-picker.styles.d.ts.map +1 -1
- package/lib/components/forms/date-picker/date-picker.styles.js +0 -10
- package/lib/components/forms/date-picker/date-picker.template.d.ts.map +1 -1
- package/lib/components/forms/date-picker/date-picker.template.js +3 -4
- package/lib/components/forms/file-upload/file-upload-item.component.d.ts +7 -0
- package/lib/components/forms/file-upload/file-upload-item.component.d.ts.map +1 -1
- package/lib/components/forms/file-upload/file-upload-item.component.js +15 -0
- package/lib/components/forms/file-upload/file-upload.component.d.ts +15 -0
- package/lib/components/forms/file-upload/file-upload.component.d.ts.map +1 -1
- package/lib/components/forms/file-upload/file-upload.component.js +56 -0
- package/lib/components/forms/form-field/form-field.component.d.ts +12 -4
- package/lib/components/forms/form-field/form-field.component.d.ts.map +1 -1
- package/lib/components/forms/form-field/form-field.component.js +50 -31
- package/lib/components/forms/form-field/form-field.template.js +1 -1
- package/lib/components/forms/input/input.component.d.ts +2 -2
- package/lib/components/forms/input/input.component.d.ts.map +1 -1
- package/lib/components/forms/radio/radio-group.component.d.ts +6 -0
- package/lib/components/forms/radio/radio-group.component.d.ts.map +1 -1
- package/lib/components/forms/radio/radio-group.component.js +69 -2
- package/lib/components/forms/radio/radio-group.template.js +1 -1
- package/lib/components/forms/radio/radio.component.d.ts +7 -2
- package/lib/components/forms/radio/radio.component.d.ts.map +1 -1
- package/lib/components/forms/radio/radio.component.js +5 -0
- package/lib/components/forms/radio/radio.template.d.ts.map +1 -1
- package/lib/components/forms/radio/radio.template.js +1 -0
- package/lib/components/forms/select/select.component.d.ts +13 -6
- package/lib/components/forms/select/select.component.d.ts.map +1 -1
- package/lib/components/forms/select/select.component.js +32 -36
- package/lib/components/forms/select/select.template.d.ts.map +1 -1
- package/lib/components/forms/select/select.template.js +6 -2
- package/lib/components/forms/slider/slider.component.d.ts +2 -2
- package/lib/components/forms/slider/slider.component.d.ts.map +1 -1
- package/lib/components/forms/slider/slider.component.js +5 -1
- package/lib/components/forms/textarea/textarea.component.d.ts +2 -2
- package/lib/components/forms/textarea/textarea.component.d.ts.map +1 -1
- package/lib/components/forms/toggle/toggle.component.d.ts +4 -2
- package/lib/components/forms/toggle/toggle.component.d.ts.map +1 -1
- package/lib/components/forms/toggle/toggle.component.js +3 -1
- package/lib/components/forms/toggle/toggle.styles.d.ts.map +1 -1
- package/lib/components/forms/toggle/toggle.styles.js +19 -0
- package/lib/components/forms/toggle/toggle.template.d.ts.map +1 -1
- package/lib/components/forms/toggle/toggle.template.js +11 -3
- package/lib/components/foundation/card/card.component.d.ts +7 -6
- package/lib/components/foundation/card/card.component.d.ts.map +1 -1
- package/lib/components/foundation/card/card.component.js +18 -7
- package/lib/components/foundation/card/card.styles.d.ts.map +1 -1
- package/lib/components/foundation/card/card.styles.js +5 -0
- package/lib/components/foundation/card/card.template.d.ts.map +1 -1
- package/lib/components/foundation/card/card.template.js +16 -11
- package/lib/components/foundation/divider/divider.component.d.ts +5 -4
- package/lib/components/foundation/divider/divider.component.d.ts.map +1 -1
- package/lib/components/foundation/divider/divider.component.js +11 -3
- package/lib/components/foundation/divider/divider.styles.d.ts.map +1 -1
- package/lib/components/foundation/divider/divider.styles.js +6 -0
- package/lib/components/foundation/divider/divider.template.d.ts +5 -0
- package/lib/components/foundation/divider/divider.template.d.ts.map +1 -1
- package/lib/components/foundation/divider/divider.template.js +9 -6
- package/lib/components/general/icon/icon.template.d.ts.map +1 -1
- package/lib/components/general/icon/icon.template.js +3 -1
- package/lib/components/navigation/pagination/pagination.component.d.ts +5 -0
- package/lib/components/navigation/pagination/pagination.component.d.ts.map +1 -1
- package/lib/components/navigation/pagination/pagination.component.js +22 -10
- package/lib/components/navigation/pagination/pagination.styles.d.ts.map +1 -1
- package/lib/components/navigation/pagination/pagination.styles.js +6 -4
- package/lib/components/navigation/sidebar/sidebar-item.component.d.ts +4 -4
- package/lib/components/navigation/sidebar/sidebar-item.component.d.ts.map +1 -1
- package/lib/components/navigation/sidebar/sidebar-item.component.js +11 -4
- package/lib/components/navigation/sidebar/sidebar-item.template.js +2 -2
- package/lib/components/navigation/sidebar/sidebar.component.d.ts +7 -0
- package/lib/components/navigation/sidebar/sidebar.component.d.ts.map +1 -1
- package/lib/components/navigation/sidebar/sidebar.component.js +48 -5
- package/lib/components/navigation/steps/step-panel.component.d.ts +7 -0
- package/lib/components/navigation/steps/step-panel.component.d.ts.map +1 -1
- package/lib/components/navigation/steps/step-panel.component.js +7 -0
- package/lib/components/navigation/steps/step-panel.template.d.ts +1 -1
- package/lib/components/navigation/steps/step-panel.template.d.ts.map +1 -1
- package/lib/components/navigation/steps/step-panel.template.js +2 -2
- package/lib/components/navigation/steps/step.component.d.ts +2 -2
- package/lib/components/navigation/steps/step.component.d.ts.map +1 -1
- package/lib/components/navigation/steps/step.component.js +8 -2
- package/lib/components/navigation/steps/step.template.js +1 -1
- package/lib/components/navigation/steps/steps.component.d.ts +3 -1
- package/lib/components/navigation/steps/steps.component.d.ts.map +1 -1
- package/lib/components/navigation/steps/steps.component.js +47 -14
- package/lib/components/navigation/steps/steps.template.d.ts.map +1 -1
- package/lib/components/navigation/steps/steps.template.js +5 -1
- package/lib/components/navigation/tabs/tab-panel.component.d.ts +7 -0
- package/lib/components/navigation/tabs/tab-panel.component.d.ts.map +1 -1
- package/lib/components/navigation/tabs/tab-panel.component.js +7 -0
- package/lib/components/navigation/tabs/tab-panel.template.d.ts +1 -1
- package/lib/components/navigation/tabs/tab-panel.template.d.ts.map +1 -1
- package/lib/components/navigation/tabs/tab-panel.template.js +2 -2
- package/lib/components/navigation/tabs/tabs.component.d.ts +5 -3
- package/lib/components/navigation/tabs/tabs.component.d.ts.map +1 -1
- package/lib/components/navigation/tabs/tabs.component.js +49 -14
- package/lib/components/navigation/tabs/tabs.template.d.ts.map +1 -1
- package/lib/components/navigation/tabs/tabs.template.js +6 -1
- package/lib/components/overlays/dialog/dialog-ref.class.d.ts +17 -2
- package/lib/components/overlays/dialog/dialog-ref.class.d.ts.map +1 -1
- package/lib/components/overlays/dialog/dialog-ref.class.js +52 -6
- package/lib/components/overlays/dialog/dialog.component.d.ts.map +1 -1
- package/lib/components/overlays/dialog/dialog.component.js +5 -1
- package/lib/components/overlays/dialog/dialog.service.d.ts +2 -2
- package/lib/components/overlays/dialog/dialog.service.d.ts.map +1 -1
- package/lib/components/overlays/dialog/dialog.service.js +46 -18
- package/lib/components/overlays/drawer/drawer.component.d.ts +9 -2
- package/lib/components/overlays/drawer/drawer.component.d.ts.map +1 -1
- package/lib/components/overlays/drawer/drawer.component.js +34 -4
- package/lib/components/overlays/drawer/drawer.styles.d.ts.map +1 -1
- package/lib/components/overlays/drawer/drawer.styles.js +4 -0
- package/lib/components/overlays/dropdown/dropdown-item.component.d.ts +5 -2
- package/lib/components/overlays/dropdown/dropdown-item.component.d.ts.map +1 -1
- package/lib/components/overlays/dropdown/dropdown-item.component.js +18 -0
- package/lib/components/overlays/dropdown/dropdown-item.template.d.ts.map +1 -1
- package/lib/components/overlays/dropdown/dropdown-item.template.js +0 -3
- package/lib/components/overlays/dropdown/dropdown.component.d.ts +8 -4
- package/lib/components/overlays/dropdown/dropdown.component.d.ts.map +1 -1
- package/lib/components/overlays/dropdown/dropdown.component.js +61 -60
- package/lib/components/overlays/popover/popover.component.d.ts +6 -4
- package/lib/components/overlays/popover/popover.component.d.ts.map +1 -1
- package/lib/components/overlays/popover/popover.component.js +37 -51
- package/lib/components/overlays/tooltip/tooltip.component.d.ts +29 -4
- package/lib/components/overlays/tooltip/tooltip.component.d.ts.map +1 -1
- package/lib/components/overlays/tooltip/tooltip.component.js +73 -31
- package/lib/components/overlays/tooltip/tooltip.styles.d.ts.map +1 -1
- package/lib/components/overlays/tooltip/tooltip.styles.js +22 -10
- package/lib/components/overlays/tooltip/tooltip.template.d.ts.map +1 -1
- package/lib/components/overlays/tooltip/tooltip.template.js +3 -2
- package/lib/components/pages/auth/login-page.component.d.ts +11 -4
- package/lib/components/pages/auth/login-page.component.d.ts.map +1 -1
- package/lib/components/pages/auth/login-page.component.js +18 -5
- package/lib/components/pages/auth/login-page.template.d.ts.map +1 -1
- package/lib/components/pages/auth/login-page.template.js +9 -10
- package/lib/components/pages/auth/signup-page.component.d.ts +11 -4
- package/lib/components/pages/auth/signup-page.component.d.ts.map +1 -1
- package/lib/components/pages/auth/signup-page.component.js +18 -5
- package/lib/components/pages/auth/signup-page.template.d.ts.map +1 -1
- package/lib/components/pages/auth/signup-page.template.js +9 -10
- package/lib/components/pages/dashboard/dashboard-page.component.d.ts +18 -11
- package/lib/components/pages/dashboard/dashboard-page.component.d.ts.map +1 -1
- package/lib/components/pages/dashboard/dashboard-page.component.js +55 -13
- package/lib/components/pages/dashboard/dashboard-page.template.js +1 -1
- package/lib/components/sections/app-shell/app-shell.component.d.ts +6 -6
- package/lib/components/sections/app-shell/app-shell.component.d.ts.map +1 -1
- package/lib/components/sections/app-shell/app-shell.component.js +14 -6
- package/lib/components/sections/app-shell/app-shell.template.js +3 -3
- package/lib/components/sections/hero/hero-section.component.d.ts +6 -3
- package/lib/components/sections/hero/hero-section.component.d.ts.map +1 -1
- package/lib/components/sections/hero/hero-section.component.js +13 -4
- package/lib/components/sections/hero/hero-section.template.js +2 -2
- package/lib/components/sections/page-header/page-header.component.d.ts +16 -17
- package/lib/components/sections/page-header/page-header.component.d.ts.map +1 -1
- package/lib/components/sections/page-header/page-header.component.js +36 -25
- package/lib/components/sections/page-header/page-header.styles.d.ts.map +1 -1
- package/lib/components/sections/page-header/page-header.styles.js +9 -0
- package/lib/components/sections/page-header/page-header.template.d.ts +5 -0
- package/lib/components/sections/page-header/page-header.template.d.ts.map +1 -1
- package/lib/components/sections/page-header/page-header.template.js +42 -31
- package/lib/components/sections/page-section/page-section.component.d.ts +16 -12
- package/lib/components/sections/page-section/page-section.component.d.ts.map +1 -1
- package/lib/components/sections/page-section/page-section.component.js +34 -12
- package/lib/components/sections/page-section/page-section.styles.d.ts.map +1 -1
- package/lib/components/sections/page-section/page-section.styles.js +6 -0
- package/lib/components/sections/page-section/page-section.template.d.ts +6 -0
- package/lib/components/sections/page-section/page-section.template.d.ts.map +1 -1
- package/lib/components/sections/page-section/page-section.template.js +26 -15
- package/lib/components/sections/page-section/sanitize-href.function.d.ts +12 -0
- package/lib/components/sections/page-section/sanitize-href.function.d.ts.map +1 -0
- package/lib/components/sections/page-section/sanitize-href.function.js +15 -0
- package/lib/directives/tooltip.directive.d.ts +8 -2
- package/lib/directives/tooltip.directive.d.ts.map +1 -1
- package/lib/directives/tooltip.directive.js +103 -9
- package/lib/functions/deprecation.functions.d.ts +21 -0
- package/lib/functions/deprecation.functions.d.ts.map +1 -0
- package/lib/functions/deprecation.functions.js +44 -0
- package/lib/functions/index.d.ts +2 -0
- package/lib/functions/index.d.ts.map +1 -1
- package/lib/functions/index.js +2 -0
- package/lib/functions/watch-slot-presence.function.d.ts +17 -0
- package/lib/functions/watch-slot-presence.function.d.ts.map +1 -0
- package/lib/functions/watch-slot-presence.function.js +27 -0
- package/lib/theme/functions/create-theme.function.d.ts +15 -1
- package/lib/theme/functions/create-theme.function.d.ts.map +1 -1
- package/lib/theme/functions/create-theme.function.js +57 -11
- package/lib/theme/index.d.ts +1 -0
- package/lib/theme/index.d.ts.map +1 -1
- package/lib/types/index.d.ts +8 -2
- package/lib/types/index.d.ts.map +1 -1
- package/lib/utils/accessibility/focus-trap.d.ts +19 -1
- package/lib/utils/accessibility/focus-trap.d.ts.map +1 -1
- package/lib/utils/accessibility/focus-trap.js +77 -8
- package/lib/utils/accessibility/index.d.ts +2 -1
- package/lib/utils/accessibility/index.d.ts.map +1 -1
- package/lib/utils/accessibility/index.js +1 -1
- package/lib/utils/accessibility/live-region.d.ts +10 -3
- package/lib/utils/accessibility/live-region.d.ts.map +1 -1
- package/lib/utils/accessibility/live-region.js +64 -35
- package/lib/utils/directives/click-outside.directive.d.ts.map +1 -1
- package/lib/utils/directives/click-outside.directive.js +5 -3
- package/lib/utils/overlay/index.d.ts +4 -0
- package/lib/utils/overlay/index.d.ts.map +1 -0
- package/lib/utils/overlay/index.js +2 -0
- package/lib/utils/overlay/overlay-positioner.d.ts +54 -0
- package/lib/utils/overlay/overlay-positioner.d.ts.map +1 -0
- package/lib/utils/overlay/overlay-positioner.js +85 -0
- package/lib/utils/overlay/toggle-dismiss-guard.d.ts +24 -0
- package/lib/utils/overlay/toggle-dismiss-guard.d.ts.map +1 -0
- package/lib/utils/overlay/toggle-dismiss-guard.js +36 -0
- package/lib/utils/positioning/auto-update.d.ts.map +1 -1
- package/lib/utils/positioning/auto-update.js +3 -0
- package/lib/utils/positioning/compute-position.d.ts.map +1 -1
- package/lib/utils/positioning/compute-position.js +8 -4
- package/lib/utils/positioning/middlewares/flip.middleware.d.ts.map +1 -1
- package/lib/utils/positioning/middlewares/flip.middleware.js +10 -3
- package/lib/utils/positioning/middlewares/offset.middleware.d.ts +15 -0
- package/lib/utils/positioning/middlewares/offset.middleware.d.ts.map +1 -1
- package/lib/utils/positioning/middlewares/offset.middleware.js +31 -1
- package/lib/utils/positioning/middlewares/shift.middleware.d.ts +13 -3
- package/lib/utils/positioning/middlewares/shift.middleware.d.ts.map +1 -1
- package/lib/utils/positioning/middlewares/shift.middleware.js +15 -7
- package/package.json +6 -2
|
@@ -7,6 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
import { MelodicComponent } from '@melodicdev/core';
|
|
8
8
|
import { heroSectionTemplate } from './hero-section.template.js';
|
|
9
9
|
import { heroSectionStyles } from './hero-section.styles.js';
|
|
10
|
+
import { warnDeprecatedTitleOnce } from '../../../functions/index.js';
|
|
10
11
|
/**
|
|
11
12
|
* ml-hero-section - Marketing hero/header section
|
|
12
13
|
*
|
|
@@ -23,7 +24,7 @@ import { heroSectionStyles } from './hero-section.styles.js';
|
|
|
23
24
|
* ```
|
|
24
25
|
*
|
|
25
26
|
* @slot eyebrow - Small text/badge above the title
|
|
26
|
-
* @slot title - Main headline (or use `title`
|
|
27
|
+
* @slot title - Main headline (or use `hero-title` attribute)
|
|
27
28
|
* @slot description - Supporting text (or use `description` property)
|
|
28
29
|
* @slot actions - CTA buttons
|
|
29
30
|
* @slot media - Image, video, or illustration
|
|
@@ -37,18 +38,26 @@ let HeroSectionComponent = class HeroSectionComponent {
|
|
|
37
38
|
this.size = 'lg';
|
|
38
39
|
/** Background style */
|
|
39
40
|
this.background = 'none';
|
|
40
|
-
/** Headline text (alternative to title slot) */
|
|
41
|
-
this.
|
|
41
|
+
/** Headline text (attribute: hero-title; alternative to title slot) */
|
|
42
|
+
this.heroTitle = '';
|
|
42
43
|
/** Supporting text (alternative to description slot) */
|
|
43
44
|
this.description = '';
|
|
44
45
|
}
|
|
46
|
+
/** @deprecated Use `heroTitle` (attribute `hero-title`); `title` collides with the global HTML attribute. */
|
|
47
|
+
get title() {
|
|
48
|
+
return this.heroTitle;
|
|
49
|
+
}
|
|
50
|
+
set title(value) {
|
|
51
|
+
warnDeprecatedTitleOnce('ml-hero-section', 'hero-title');
|
|
52
|
+
this.heroTitle = value;
|
|
53
|
+
}
|
|
45
54
|
};
|
|
46
55
|
HeroSectionComponent = __decorate([
|
|
47
56
|
MelodicComponent({
|
|
48
57
|
selector: 'ml-hero-section',
|
|
49
58
|
template: heroSectionTemplate,
|
|
50
59
|
styles: heroSectionStyles,
|
|
51
|
-
attributes: ['variant', 'size', 'background', 'title', 'description']
|
|
60
|
+
attributes: ['variant', 'size', 'background', 'hero-title', 'title', 'description']
|
|
52
61
|
})
|
|
53
62
|
], HeroSectionComponent);
|
|
54
63
|
export { HeroSectionComponent };
|
|
@@ -17,8 +17,8 @@ export function heroSectionTemplate(c) {
|
|
|
17
17
|
</slot>
|
|
18
18
|
|
|
19
19
|
<slot name="title">
|
|
20
|
-
${when(!!c.
|
|
21
|
-
<h1 class="ml-hero__title">${c.
|
|
20
|
+
${when(!!c.heroTitle, () => html `
|
|
21
|
+
<h1 class="ml-hero__title">${c.heroTitle}</h1>
|
|
22
22
|
`)}
|
|
23
23
|
</slot>
|
|
24
24
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { IElementRef } from '@melodicdev/core';
|
|
1
|
+
import type { IElementRef, OnCreate } from '@melodicdev/core';
|
|
2
2
|
export type PageHeaderVariant = 'default' | 'compact' | 'centered';
|
|
3
3
|
/**
|
|
4
4
|
* ml-page-header - Section component for page titles with breadcrumb, description, and actions
|
|
5
5
|
*
|
|
6
6
|
* @example
|
|
7
7
|
* ```html
|
|
8
|
-
* <ml-page-header title="Dashboard" description="Overview of your account">
|
|
8
|
+
* <ml-page-header header-title="Dashboard" description="Overview of your account">
|
|
9
9
|
* <ml-breadcrumb slot="breadcrumb">
|
|
10
10
|
* <ml-breadcrumb-item href="/">Home</ml-breadcrumb-item>
|
|
11
11
|
* <ml-breadcrumb-item>Dashboard</ml-breadcrumb-item>
|
|
@@ -21,27 +21,26 @@ export type PageHeaderVariant = 'default' | 'compact' | 'centered';
|
|
|
21
21
|
* @slot tabs - Optional tab navigation below the header
|
|
22
22
|
* @slot meta - Optional metadata area (badges, status, etc.)
|
|
23
23
|
*/
|
|
24
|
-
export declare class PageHeaderComponent implements IElementRef {
|
|
24
|
+
export declare class PageHeaderComponent implements IElementRef, OnCreate {
|
|
25
25
|
elementRef: HTMLElement;
|
|
26
|
-
/** Page title text */
|
|
27
|
-
|
|
26
|
+
/** Page title text (attribute: header-title) */
|
|
27
|
+
headerTitle: string;
|
|
28
28
|
/** Page description text */
|
|
29
29
|
description: string;
|
|
30
|
+
/** @deprecated Use `headerTitle` (attribute `header-title`); `title` collides with the global HTML attribute. */
|
|
31
|
+
get title(): string;
|
|
32
|
+
set title(value: string);
|
|
30
33
|
/** Visual variant */
|
|
31
34
|
variant: PageHeaderVariant;
|
|
32
35
|
/** Show bottom border */
|
|
33
36
|
divider: boolean;
|
|
34
|
-
/**
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
/** Check if tabs slot has content */
|
|
43
|
-
get hasTabs(): boolean;
|
|
44
|
-
/** Check if meta slot has content */
|
|
45
|
-
get hasMeta(): boolean;
|
|
37
|
+
/** Slot visibility flags (toggled via slotchange so late-inserted content projects) */
|
|
38
|
+
hasBreadcrumb: boolean;
|
|
39
|
+
hasTitleSlot: boolean;
|
|
40
|
+
hasDescriptionSlot: boolean;
|
|
41
|
+
hasActions: boolean;
|
|
42
|
+
hasTabs: boolean;
|
|
43
|
+
hasMeta: boolean;
|
|
44
|
+
onCreate(): void;
|
|
46
45
|
}
|
|
47
46
|
//# sourceMappingURL=page-header.component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-header.component.d.ts","sourceRoot":"","sources":["../../../../src/components/sections/page-header/page-header.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"page-header.component.d.ts","sourceRoot":"","sources":["../../../../src/components/sections/page-header/page-header.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAK9D,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,CAAC;AAEnE;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAMa,mBAAoB,YAAW,WAAW,EAAE,QAAQ;IACzD,UAAU,EAAG,WAAW,CAAC;IAEhC,gDAAgD;IACzC,WAAW,SAAM;IAExB,4BAA4B;IACrB,WAAW,SAAM;IAExB,iHAAiH;IACjH,IAAW,KAAK,IAAI,MAAM,CAEzB;IACD,IAAW,KAAK,CAAC,KAAK,EAAE,MAAM,EAG7B;IAED,qBAAqB;IACd,OAAO,EAAE,iBAAiB,CAAa;IAE9C,yBAAyB;IAClB,OAAO,UAAQ;IAEtB,uFAAuF;IAChF,aAAa,UAAS;IACtB,YAAY,UAAS;IACrB,kBAAkB,UAAS;IAC3B,UAAU,UAAS;IACnB,OAAO,UAAS;IAChB,OAAO,UAAS;IAEhB,QAAQ,IAAI,IAAI;CAavB"}
|
|
@@ -5,6 +5,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
7
|
import { MelodicComponent } from '@melodicdev/core';
|
|
8
|
+
import { watchSlotPresence, warnDeprecatedTitleOnce } from '../../../functions/index.js';
|
|
8
9
|
import { pageHeaderTemplate } from './page-header.template.js';
|
|
9
10
|
import { pageHeaderStyles } from './page-header.styles.js';
|
|
10
11
|
/**
|
|
@@ -12,7 +13,7 @@ import { pageHeaderStyles } from './page-header.styles.js';
|
|
|
12
13
|
*
|
|
13
14
|
* @example
|
|
14
15
|
* ```html
|
|
15
|
-
* <ml-page-header title="Dashboard" description="Overview of your account">
|
|
16
|
+
* <ml-page-header header-title="Dashboard" description="Overview of your account">
|
|
16
17
|
* <ml-breadcrumb slot="breadcrumb">
|
|
17
18
|
* <ml-breadcrumb-item href="/">Home</ml-breadcrumb-item>
|
|
18
19
|
* <ml-breadcrumb-item>Dashboard</ml-breadcrumb-item>
|
|
@@ -30,38 +31,48 @@ import { pageHeaderStyles } from './page-header.styles.js';
|
|
|
30
31
|
*/
|
|
31
32
|
let PageHeaderComponent = class PageHeaderComponent {
|
|
32
33
|
constructor() {
|
|
33
|
-
/** Page title text */
|
|
34
|
-
this.
|
|
34
|
+
/** Page title text (attribute: header-title) */
|
|
35
|
+
this.headerTitle = '';
|
|
35
36
|
/** Page description text */
|
|
36
37
|
this.description = '';
|
|
37
38
|
/** Visual variant */
|
|
38
39
|
this.variant = 'default';
|
|
39
40
|
/** Show bottom border */
|
|
40
41
|
this.divider = true;
|
|
42
|
+
/** Slot visibility flags (toggled via slotchange so late-inserted content projects) */
|
|
43
|
+
this.hasBreadcrumb = false;
|
|
44
|
+
this.hasTitleSlot = false;
|
|
45
|
+
this.hasDescriptionSlot = false;
|
|
46
|
+
this.hasActions = false;
|
|
47
|
+
this.hasTabs = false;
|
|
48
|
+
this.hasMeta = false;
|
|
41
49
|
}
|
|
42
|
-
/**
|
|
43
|
-
get
|
|
44
|
-
return this.
|
|
50
|
+
/** @deprecated Use `headerTitle` (attribute `header-title`); `title` collides with the global HTML attribute. */
|
|
51
|
+
get title() {
|
|
52
|
+
return this.headerTitle;
|
|
45
53
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
54
|
+
set title(value) {
|
|
55
|
+
warnDeprecatedTitleOnce('ml-page-header', 'header-title');
|
|
56
|
+
this.headerTitle = value;
|
|
49
57
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
58
|
+
onCreate() {
|
|
59
|
+
const shadow = this.elementRef.shadowRoot;
|
|
60
|
+
if (!shadow)
|
|
61
|
+
return;
|
|
62
|
+
watchSlotPresence(shadow, (name, hasContent) => {
|
|
63
|
+
if (name === 'breadcrumb')
|
|
64
|
+
this.hasBreadcrumb = hasContent;
|
|
65
|
+
else if (name === 'title')
|
|
66
|
+
this.hasTitleSlot = hasContent;
|
|
67
|
+
else if (name === 'description')
|
|
68
|
+
this.hasDescriptionSlot = hasContent;
|
|
69
|
+
else if (name === 'actions')
|
|
70
|
+
this.hasActions = hasContent;
|
|
71
|
+
else if (name === 'tabs')
|
|
72
|
+
this.hasTabs = hasContent;
|
|
73
|
+
else if (name === 'meta')
|
|
74
|
+
this.hasMeta = hasContent;
|
|
75
|
+
});
|
|
65
76
|
}
|
|
66
77
|
};
|
|
67
78
|
PageHeaderComponent = __decorate([
|
|
@@ -69,7 +80,7 @@ PageHeaderComponent = __decorate([
|
|
|
69
80
|
selector: 'ml-page-header',
|
|
70
81
|
template: pageHeaderTemplate,
|
|
71
82
|
styles: pageHeaderStyles,
|
|
72
|
-
attributes: ['variant', 'divider', 'title', 'description']
|
|
83
|
+
attributes: ['variant', 'divider', 'header-title', 'title', 'description']
|
|
73
84
|
})
|
|
74
85
|
], PageHeaderComponent);
|
|
75
86
|
export { PageHeaderComponent };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-header.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/sections/page-header/page-header.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"page-header.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/sections/page-header/page-header.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,gBAAgB,iDAiN5B,CAAC"}
|
|
@@ -179,6 +179,15 @@ export const pageHeaderStyles = () => css `
|
|
|
179
179
|
margin-top: var(--ml-page-header-tabs-margin);
|
|
180
180
|
}
|
|
181
181
|
|
|
182
|
+
/* ============================================
|
|
183
|
+
EMPTY SECTIONS
|
|
184
|
+
Slots are always rendered (so slotchange can
|
|
185
|
+
fire); empty wrappers are hidden instead.
|
|
186
|
+
============================================ */
|
|
187
|
+
.ml-page-header__section--empty {
|
|
188
|
+
display: none;
|
|
189
|
+
}
|
|
190
|
+
|
|
182
191
|
/* ============================================
|
|
183
192
|
RESPONSIVE
|
|
184
193
|
============================================ */
|
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
import type { PageHeaderComponent } from './page-header.component.js';
|
|
2
|
+
/**
|
|
3
|
+
* All named slots are always rendered so `slotchange` fires when content is
|
|
4
|
+
* added or removed after mount (see PageHeaderComponent.onCreate). Empty
|
|
5
|
+
* sections are hidden via the `--empty` modifier instead of being omitted.
|
|
6
|
+
*/
|
|
2
7
|
export declare function pageHeaderTemplate(c: PageHeaderComponent): import("@melodicdev/core").TemplateResult;
|
|
3
8
|
//# sourceMappingURL=page-header.template.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-header.template.d.ts","sourceRoot":"","sources":["../../../../src/components/sections/page-header/page-header.template.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,mBAAmB,6CA2DxD"}
|
|
1
|
+
{"version":3,"file":"page-header.template.d.ts","sourceRoot":"","sources":["../../../../src/components/sections/page-header/page-header.template.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEtE;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,mBAAmB,6CA2DxD"}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { html, classMap, when } from '@melodicdev/core';
|
|
2
|
+
/**
|
|
3
|
+
* All named slots are always rendered so `slotchange` fires when content is
|
|
4
|
+
* added or removed after mount (see PageHeaderComponent.onCreate). Empty
|
|
5
|
+
* sections are hidden via the `--empty` modifier instead of being omitted.
|
|
6
|
+
*/
|
|
2
7
|
export function pageHeaderTemplate(c) {
|
|
3
|
-
const hasTitle = !!(c.
|
|
8
|
+
const hasTitle = !!(c.headerTitle || c.hasTitleSlot);
|
|
4
9
|
const hasDescription = !!(c.description || c.hasDescriptionSlot);
|
|
5
10
|
return html `
|
|
6
11
|
<header
|
|
@@ -10,45 +15,51 @@ export function pageHeaderTemplate(c) {
|
|
|
10
15
|
'ml-page-header--divider': c.divider
|
|
11
16
|
})}
|
|
12
17
|
>
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
<div class=${classMap({
|
|
19
|
+
'ml-page-header__breadcrumb': true,
|
|
20
|
+
'ml-page-header__section--empty': !c.hasBreadcrumb
|
|
21
|
+
})}>
|
|
22
|
+
<slot name="breadcrumb"></slot>
|
|
23
|
+
</div>
|
|
18
24
|
|
|
19
25
|
<div class="ml-page-header__main">
|
|
20
26
|
<div class="ml-page-header__content">
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
27
|
+
<div class=${classMap({
|
|
28
|
+
'ml-page-header__title': true,
|
|
29
|
+
'ml-page-header__section--empty': !hasTitle
|
|
30
|
+
})}>
|
|
31
|
+
<slot name="title">${when(!!c.headerTitle, () => html `<h1>${c.headerTitle}</h1>`)}</slot>
|
|
32
|
+
</div>
|
|
26
33
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
34
|
+
<div class=${classMap({
|
|
35
|
+
'ml-page-header__description': true,
|
|
36
|
+
'ml-page-header__section--empty': !hasDescription
|
|
37
|
+
})}>
|
|
38
|
+
<slot name="description">${when(!!c.description, () => html `<p>${c.description}</p>`)}</slot>
|
|
39
|
+
</div>
|
|
32
40
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
41
|
+
<div class=${classMap({
|
|
42
|
+
'ml-page-header__meta': true,
|
|
43
|
+
'ml-page-header__section--empty': !c.hasMeta
|
|
44
|
+
})}>
|
|
45
|
+
<slot name="meta"></slot>
|
|
46
|
+
</div>
|
|
38
47
|
</div>
|
|
39
48
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
49
|
+
<div class=${classMap({
|
|
50
|
+
'ml-page-header__actions': true,
|
|
51
|
+
'ml-page-header__section--empty': !c.hasActions
|
|
52
|
+
})}>
|
|
53
|
+
<slot name="actions"></slot>
|
|
54
|
+
</div>
|
|
45
55
|
</div>
|
|
46
56
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
57
|
+
<div class=${classMap({
|
|
58
|
+
'ml-page-header__tabs': true,
|
|
59
|
+
'ml-page-header__section--empty': !c.hasTabs
|
|
60
|
+
})}>
|
|
61
|
+
<slot name="tabs"></slot>
|
|
62
|
+
</div>
|
|
52
63
|
</header>
|
|
53
64
|
`;
|
|
54
65
|
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import type { IElementRef } from '@melodicdev/core';
|
|
1
|
+
import type { IElementRef, OnCreate } from '@melodicdev/core';
|
|
2
2
|
type SectionPadding = 'none' | 'sm' | 'md' | 'lg';
|
|
3
3
|
/**
|
|
4
4
|
* ml-page-section - Titled content section with consistent heading typography
|
|
5
5
|
*
|
|
6
6
|
* @example
|
|
7
7
|
* ```html
|
|
8
|
-
* <ml-page-section title="Recent Activity" subtitle="Last 7 days">
|
|
8
|
+
* <ml-page-section section-title="Recent Activity" subtitle="Last 7 days">
|
|
9
9
|
* <div>Section content here</div>
|
|
10
10
|
* </ml-page-section>
|
|
11
11
|
*
|
|
12
|
-
* <ml-page-section title="Members" action-label="View All" action-href="/members">
|
|
12
|
+
* <ml-page-section section-title="Members" action-label="View All" action-href="/members">
|
|
13
13
|
* <div>Members list</div>
|
|
14
14
|
* </ml-page-section>
|
|
15
15
|
* ```
|
|
@@ -20,20 +20,24 @@ type SectionPadding = 'none' | 'sm' | 'md' | 'lg';
|
|
|
20
20
|
* @cssproperty --ml-page-section-title-font - Title font family (default: 'Cormorant Garamond', serif)
|
|
21
21
|
* @cssproperty --ml-page-section-gap - Gap between header and content (default: var(--ml-space-4))
|
|
22
22
|
*/
|
|
23
|
-
export declare class PageSectionComponent implements IElementRef {
|
|
23
|
+
export declare class PageSectionComponent implements IElementRef, OnCreate {
|
|
24
24
|
elementRef: HTMLElement;
|
|
25
|
-
/** Section title */
|
|
26
|
-
|
|
25
|
+
/** Section title (attribute: section-title) */
|
|
26
|
+
sectionTitle: string;
|
|
27
27
|
/** Subtitle text */
|
|
28
28
|
subtitle: string;
|
|
29
|
-
/**
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
/** @deprecated Use `sectionTitle` (attribute `section-title`); `title` collides with the global HTML attribute. */
|
|
30
|
+
get title(): string;
|
|
31
|
+
set title(value: string);
|
|
32
|
+
/** Action link label (attribute: action-label) */
|
|
33
|
+
actionLabel: string;
|
|
34
|
+
/** Action link URL (attribute: action-href). Only http(s), relative, and fragment URLs are rendered. */
|
|
35
|
+
actionHref: string;
|
|
33
36
|
/** Content padding */
|
|
34
37
|
padding: SectionPadding;
|
|
35
|
-
/**
|
|
36
|
-
|
|
38
|
+
/** Whether the action slot has content (toggled via slotchange) */
|
|
39
|
+
hasAction: boolean;
|
|
40
|
+
onCreate(): void;
|
|
37
41
|
}
|
|
38
42
|
export {};
|
|
39
43
|
//# sourceMappingURL=page-section.component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-section.component.d.ts","sourceRoot":"","sources":["../../../../src/components/sections/page-section/page-section.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"page-section.component.d.ts","sourceRoot":"","sources":["../../../../src/components/sections/page-section/page-section.component.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAK9D,KAAK,cAAc,GAAG,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAElD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAMa,oBAAqB,YAAW,WAAW,EAAE,QAAQ;IAC1D,UAAU,EAAG,WAAW,CAAC;IAEhC,+CAA+C;IACxC,YAAY,SAAM;IAEzB,oBAAoB;IACb,QAAQ,SAAM;IAErB,mHAAmH;IACnH,IAAW,KAAK,IAAI,MAAM,CAEzB;IACD,IAAW,KAAK,CAAC,KAAK,EAAE,MAAM,EAG7B;IAED,kDAAkD;IAC3C,WAAW,SAAM;IAExB,wGAAwG;IACjG,UAAU,SAAM;IAEvB,sBAAsB;IACf,OAAO,EAAE,cAAc,CAAQ;IAEtC,mEAAmE;IAC5D,SAAS,UAAS;IAElB,QAAQ,IAAI,IAAI;CAQvB"}
|
|
@@ -5,6 +5,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
7
|
import { MelodicComponent } from '@melodicdev/core';
|
|
8
|
+
import { watchSlotPresence, warnDeprecatedTitleOnce, defineLegacyAliases } from '../../../functions/index.js';
|
|
8
9
|
import { pageSectionTemplate } from './page-section.template.js';
|
|
9
10
|
import { pageSectionStyles } from './page-section.styles.js';
|
|
10
11
|
/**
|
|
@@ -12,11 +13,11 @@ import { pageSectionStyles } from './page-section.styles.js';
|
|
|
12
13
|
*
|
|
13
14
|
* @example
|
|
14
15
|
* ```html
|
|
15
|
-
* <ml-page-section title="Recent Activity" subtitle="Last 7 days">
|
|
16
|
+
* <ml-page-section section-title="Recent Activity" subtitle="Last 7 days">
|
|
16
17
|
* <div>Section content here</div>
|
|
17
18
|
* </ml-page-section>
|
|
18
19
|
*
|
|
19
|
-
* <ml-page-section title="Members" action-label="View All" action-href="/members">
|
|
20
|
+
* <ml-page-section section-title="Members" action-label="View All" action-href="/members">
|
|
20
21
|
* <div>Members list</div>
|
|
21
22
|
* </ml-page-section>
|
|
22
23
|
* ```
|
|
@@ -29,20 +30,35 @@ import { pageSectionStyles } from './page-section.styles.js';
|
|
|
29
30
|
*/
|
|
30
31
|
let PageSectionComponent = class PageSectionComponent {
|
|
31
32
|
constructor() {
|
|
32
|
-
/** Section title */
|
|
33
|
-
this.
|
|
33
|
+
/** Section title (attribute: section-title) */
|
|
34
|
+
this.sectionTitle = '';
|
|
34
35
|
/** Subtitle text */
|
|
35
36
|
this.subtitle = '';
|
|
36
|
-
/** Action link label */
|
|
37
|
-
this
|
|
38
|
-
/** Action link URL */
|
|
39
|
-
this
|
|
37
|
+
/** Action link label (attribute: action-label) */
|
|
38
|
+
this.actionLabel = '';
|
|
39
|
+
/** Action link URL (attribute: action-href). Only http(s), relative, and fragment URLs are rendered. */
|
|
40
|
+
this.actionHref = '';
|
|
40
41
|
/** Content padding */
|
|
41
42
|
this.padding = 'md';
|
|
43
|
+
/** Whether the action slot has content (toggled via slotchange) */
|
|
44
|
+
this.hasAction = false;
|
|
42
45
|
}
|
|
43
|
-
/**
|
|
44
|
-
get
|
|
45
|
-
return this.
|
|
46
|
+
/** @deprecated Use `sectionTitle` (attribute `section-title`); `title` collides with the global HTML attribute. */
|
|
47
|
+
get title() {
|
|
48
|
+
return this.sectionTitle;
|
|
49
|
+
}
|
|
50
|
+
set title(value) {
|
|
51
|
+
warnDeprecatedTitleOnce('ml-page-section', 'section-title');
|
|
52
|
+
this.sectionTitle = value;
|
|
53
|
+
}
|
|
54
|
+
onCreate() {
|
|
55
|
+
const shadow = this.elementRef.shadowRoot;
|
|
56
|
+
if (!shadow)
|
|
57
|
+
return;
|
|
58
|
+
watchSlotPresence(shadow, (name, hasContent) => {
|
|
59
|
+
if (name === 'action')
|
|
60
|
+
this.hasAction = hasContent;
|
|
61
|
+
});
|
|
46
62
|
}
|
|
47
63
|
};
|
|
48
64
|
PageSectionComponent = __decorate([
|
|
@@ -50,7 +66,13 @@ PageSectionComponent = __decorate([
|
|
|
50
66
|
selector: 'ml-page-section',
|
|
51
67
|
template: pageSectionTemplate,
|
|
52
68
|
styles: pageSectionStyles,
|
|
53
|
-
attributes: ['title', 'subtitle', 'action-label', 'action-href', 'padding']
|
|
69
|
+
attributes: ['section-title', 'title', 'subtitle', 'action-label', 'action-href', 'padding']
|
|
54
70
|
})
|
|
55
71
|
], PageSectionComponent);
|
|
56
72
|
export { PageSectionComponent };
|
|
73
|
+
// Deprecated quoted kebab-case property aliases (warn once on first write;
|
|
74
|
+
// removed in the next major release).
|
|
75
|
+
defineLegacyAliases(PageSectionComponent.prototype, 'ml-page-section', {
|
|
76
|
+
'action-label': 'actionLabel',
|
|
77
|
+
'action-href': 'actionHref'
|
|
78
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-section.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/sections/page-section/page-section.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"page-section.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/sections/page-section/page-section.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,iDA0G7B,CAAC"}
|
|
@@ -42,6 +42,12 @@ export const pageSectionStyles = () => css `
|
|
|
42
42
|
margin-bottom: var(--ml-page-section-gap);
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
+
/* Header is always rendered (so the action slot's slotchange can fire);
|
|
46
|
+
an empty header is hidden instead of omitted. */
|
|
47
|
+
.ml-page-section__header--hidden {
|
|
48
|
+
display: none;
|
|
49
|
+
}
|
|
50
|
+
|
|
45
51
|
.ml-page-section__heading {
|
|
46
52
|
display: flex;
|
|
47
53
|
flex-direction: column;
|
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
import type { PageSectionComponent } from './page-section.component.js';
|
|
2
|
+
/**
|
|
3
|
+
* The header (and its action slot) is always rendered so `slotchange` fires
|
|
4
|
+
* when action content is added or removed after mount (see
|
|
5
|
+
* PageSectionComponent.onCreate). An empty header is hidden via the
|
|
6
|
+
* `--hidden` modifier instead of being omitted.
|
|
7
|
+
*/
|
|
2
8
|
export declare function pageSectionTemplate(c: PageSectionComponent): import("@melodicdev/core").TemplateResult;
|
|
3
9
|
//# sourceMappingURL=page-section.template.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-section.template.d.ts","sourceRoot":"","sources":["../../../../src/components/sections/page-section/page-section.template.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"page-section.template.d.ts","sourceRoot":"","sources":["../../../../src/components/sections/page-section/page-section.template.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAGxE;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,oBAAoB,6CAiC1D"}
|
|
@@ -1,27 +1,38 @@
|
|
|
1
1
|
import { html, classMap, when } from '@melodicdev/core';
|
|
2
|
+
import { sanitizeHref } from './sanitize-href.function.js';
|
|
3
|
+
/**
|
|
4
|
+
* The header (and its action slot) is always rendered so `slotchange` fires
|
|
5
|
+
* when action content is added or removed after mount (see
|
|
6
|
+
* PageSectionComponent.onCreate). An empty header is hidden via the
|
|
7
|
+
* `--hidden` modifier instead of being omitted.
|
|
8
|
+
*/
|
|
2
9
|
export function pageSectionTemplate(c) {
|
|
10
|
+
const showHeader = !!(c.sectionTitle || c.subtitle || c.actionLabel || c.hasAction);
|
|
3
11
|
return html `
|
|
4
12
|
<section class=${classMap({
|
|
5
13
|
'ml-page-section': true,
|
|
6
14
|
[`ml-page-section--pad-${c.padding}`]: true
|
|
7
15
|
})}>
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
16
|
+
<div class=${classMap({
|
|
17
|
+
'ml-page-section__header': true,
|
|
18
|
+
'ml-page-section__header--hidden': !showHeader
|
|
19
|
+
})}>
|
|
20
|
+
<div class="ml-page-section__heading">
|
|
21
|
+
${when(!!c.sectionTitle, () => html `
|
|
22
|
+
<h2 class="ml-page-section__title">${c.sectionTitle}</h2>
|
|
23
|
+
`)}
|
|
24
|
+
${when(!!c.subtitle, () => html `
|
|
25
|
+
<p class="ml-page-section__subtitle">${c.subtitle}</p>
|
|
26
|
+
`)}
|
|
27
|
+
</div>
|
|
28
|
+
<div class="ml-page-section__action">
|
|
29
|
+
<slot name="action">
|
|
30
|
+
${when(!!c.actionLabel, () => html `
|
|
31
|
+
<a class="ml-page-section__action-link" href=${sanitizeHref(c.actionHref)}>${c.actionLabel}</a>
|
|
14
32
|
`)}
|
|
15
|
-
</
|
|
16
|
-
<div class="ml-page-section__action">
|
|
17
|
-
<slot name="action">
|
|
18
|
-
${when(!!c['action-label'], () => html `
|
|
19
|
-
<a class="ml-page-section__action-link" href=${c['action-href']}>${c['action-label']}</a>
|
|
20
|
-
`)}
|
|
21
|
-
</slot>
|
|
22
|
-
</div>
|
|
33
|
+
</slot>
|
|
23
34
|
</div>
|
|
24
|
-
|
|
35
|
+
</div>
|
|
25
36
|
<div class="ml-page-section__content">
|
|
26
37
|
<slot></slot>
|
|
27
38
|
</div>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sanitize a consumer-provided href before rendering it into an anchor.
|
|
3
|
+
* Safe values pass through unchanged; unsafe values are neutralized with an
|
|
4
|
+
* `unsafe:` prefix so the resulting link is inert instead of executable.
|
|
5
|
+
*
|
|
6
|
+
* Safety is decided by the core `isSafeUrl` allowlist (one sanitizer for the
|
|
7
|
+
* whole framework): scheme-less URLs (relative path, query, fragment) and
|
|
8
|
+
* http(s) pass; any other scheme — javascript:, data:, vbscript:, ... — is
|
|
9
|
+
* blocked, including control-character obfuscations like `java\tscript:`.
|
|
10
|
+
*/
|
|
11
|
+
export declare function sanitizeHref(url: string): string;
|
|
12
|
+
//# sourceMappingURL=sanitize-href.function.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sanitize-href.function.d.ts","sourceRoot":"","sources":["../../../../src/components/sections/page-section/sanitize-href.function.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAGhD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { isSafeUrl } from '@melodicdev/core/routing';
|
|
2
|
+
/**
|
|
3
|
+
* Sanitize a consumer-provided href before rendering it into an anchor.
|
|
4
|
+
* Safe values pass through unchanged; unsafe values are neutralized with an
|
|
5
|
+
* `unsafe:` prefix so the resulting link is inert instead of executable.
|
|
6
|
+
*
|
|
7
|
+
* Safety is decided by the core `isSafeUrl` allowlist (one sanitizer for the
|
|
8
|
+
* whole framework): scheme-less URLs (relative path, query, fragment) and
|
|
9
|
+
* http(s) pass; any other scheme — javascript:, data:, vbscript:, ... — is
|
|
10
|
+
* blocked, including control-character obfuscations like `java\tscript:`.
|
|
11
|
+
*/
|
|
12
|
+
export function sanitizeHref(url) {
|
|
13
|
+
const value = String(url ?? '');
|
|
14
|
+
return isSafeUrl(value) ? value : `unsafe:${value}`;
|
|
15
|
+
}
|