@dvcol/neo-svelte 1.1.2 → 1.2.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/CHANGELOG.md +90 -0
- package/README.md +15 -7
- package/dist/badge/neo-badge.model.d.ts +1 -1
- package/dist/buttons/NeoArrowButton.svelte +4 -4
- package/dist/buttons/NeoButton.svelte +110 -24
- package/dist/buttons/NeoButtonGroup.svelte +18 -9
- package/dist/buttons/NeoButtonGroup.svelte.d.ts +1 -1
- package/dist/buttons/NeoButtonRow.svelte +137 -0
- package/dist/buttons/NeoButtonRow.svelte.d.ts +4 -0
- package/dist/buttons/NeoCancelButton.svelte +2 -2
- package/dist/buttons/NeoCheckboxButton.svelte +6 -4
- package/dist/buttons/NeoCheckboxButton.svelte.d.ts +1 -1
- package/dist/buttons/NeoCloseButton.svelte +37 -6
- package/dist/buttons/NeoCloseButton.svelte.d.ts +2 -2
- package/dist/buttons/NeoRadioButton.svelte +6 -4
- package/dist/buttons/NeoSwitchButton.svelte +5 -3
- package/dist/buttons/index.d.ts +2 -0
- package/dist/buttons/index.js +1 -0
- package/dist/buttons/neo-arrow-button.model.d.ts +3 -3
- package/dist/buttons/neo-button-group.model.d.ts +12 -3
- package/dist/buttons/neo-button-row.model.d.ts +33 -0
- package/dist/buttons/neo-button-row.model.js +1 -0
- package/dist/buttons/neo-button.model.d.ts +11 -4
- package/dist/buttons/neo-close-button.model.d.ts +13 -0
- package/dist/buttons/neo-close-button.model.js +5 -0
- package/dist/buttons/neo-icon-button.model.d.ts +2 -2
- package/dist/cards/NeoCard.svelte +22 -20
- package/dist/cards/neo-card.model.d.ts +3 -2
- package/dist/collapse/NeoAccordion.svelte +3 -1
- package/dist/collapse/NeoCollapse.svelte +2 -2
- package/dist/collapse/NeoCollapse.svelte.d.ts +3 -1
- package/dist/collapse/neo-accordion.model.d.ts +2 -1
- package/dist/containers/NeoTransitionContainer.svelte +10 -0
- package/dist/containers/neo-transition-container.model.d.ts +9 -0
- package/dist/cursor/NeoCursor.svelte.d.ts +1 -1
- package/dist/divider/NeoDivider.svelte +4 -2
- package/dist/divider/neo-divider.model.d.ts +2 -1
- package/dist/floating/common/NeoConfirm.svelte +5 -5
- package/dist/floating/common/NeoConfirm.svelte.d.ts +1 -1
- package/dist/floating/common/NeoFloatingStepper.svelte +1 -1
- package/dist/floating/common/NeoFloatingStepper.svelte.d.ts +1 -1
- package/dist/floating/common/NeoHandle.svelte +2 -1
- package/dist/floating/common/neo-confirm.model.d.ts +2 -1
- package/dist/floating/common/neo-floating-stepper.model.d.ts +1 -1
- package/dist/floating/common/neo-placement.model.d.ts +56 -4
- package/dist/floating/common/neo-placement.model.js +22 -0
- package/dist/floating/dialog/NeoDialog.svelte +23 -21
- package/dist/floating/dialog/NeoDialog.svelte.d.ts +1 -1
- package/dist/floating/dialog/NeoDialogConfirm.svelte.d.ts +1 -1
- package/dist/floating/dialog/NeoDialogStepper.svelte.d.ts +1 -1
- package/dist/floating/dialog/neo-dialog-confirm.model.d.ts +5 -5
- package/dist/floating/dialog/neo-dialog-stepper.model.d.ts +4 -4
- package/dist/floating/dialog/neo-dialog.model.d.ts +2 -1
- package/dist/floating/dialog/use-movable.svelte.js +2 -1
- package/dist/floating/drawer/NeoDrawer.svelte +9 -9
- package/dist/floating/drawer/NeoDrawer.svelte.d.ts +2 -2
- package/dist/floating/drawer/NeoDrawerConfirm.svelte +2 -4
- package/dist/floating/drawer/NeoDrawerConfirm.svelte.d.ts +2 -2
- package/dist/floating/drawer/NeoDrawerStepper.svelte +2 -4
- package/dist/floating/drawer/NeoDrawerStepper.svelte.d.ts +2 -2
- package/dist/floating/drawer/neo-drawer.model.d.ts +6 -0
- package/dist/floating/drawer/neo-drawer.model.js +1 -0
- package/dist/floating/index.d.ts +1 -0
- package/dist/floating/index.js +1 -0
- package/dist/floating/menu/NeoMenu.svelte +55 -17
- package/dist/floating/menu/NeoMenu.svelte.d.ts +1 -1
- package/dist/floating/menu/NeoMenuList.svelte +60 -67
- package/dist/floating/menu/NeoMenuListItem.svelte +157 -24
- package/dist/floating/menu/NeoMenuListItem.svelte.d.ts +1 -0
- package/dist/floating/menu/index.d.ts +1 -0
- package/dist/floating/menu/neo-menu-list-item.model.d.ts +48 -11
- package/dist/floating/menu/neo-menu-list.model.d.ts +24 -4
- package/dist/floating/menu/neo-menu.model.d.ts +3 -3
- package/dist/floating/notification/NeoNotificationItem.svelte +459 -0
- package/dist/floating/notification/NeoNotificationItem.svelte.d.ts +4 -0
- package/dist/floating/notification/NeoNotificationProvider.svelte +49 -0
- package/dist/floating/notification/NeoNotificationProvider.svelte.d.ts +4 -0
- package/dist/floating/notification/NeoNotificationStack.svelte +345 -0
- package/dist/floating/notification/NeoNotificationStack.svelte.d.ts +16 -0
- package/dist/floating/notification/NeoSimpleNotification.svelte +304 -0
- package/dist/floating/notification/NeoSimpleNotification.svelte.d.ts +4 -0
- package/dist/floating/notification/index.d.ts +8 -0
- package/dist/floating/notification/index.js +7 -0
- package/dist/floating/notification/neo-notification-item.model.d.ts +54 -0
- package/dist/floating/notification/neo-notification-item.model.js +1 -0
- package/dist/floating/notification/neo-notification-provider.model.d.ts +78 -0
- package/dist/floating/notification/neo-notification-provider.model.js +18 -0
- package/dist/floating/notification/neo-notification-stack.model.d.ts +48 -0
- package/dist/floating/notification/neo-notification-stack.model.js +1 -0
- package/dist/floating/notification/neo-notification.model.d.ts +271 -0
- package/dist/floating/notification/neo-notification.model.js +70 -0
- package/dist/floating/notification/neo-simple-notification.model.d.ts +14 -0
- package/dist/floating/notification/neo-simple-notification.model.js +1 -0
- package/dist/floating/portal/NeoPortal.svelte +11 -8
- package/dist/floating/portal/NeoPortalTarget.svelte +7 -0
- package/dist/floating/portal/NeoPortalTarget.svelte.d.ts +7 -0
- package/dist/floating/portal/neo-portal-context.svelte.d.ts +1 -1
- package/dist/floating/portal/neo-portal.model.d.ts +4 -5
- package/dist/floating/tooltips/NeoPopConfirm.svelte +2 -0
- package/dist/floating/tooltips/NeoPopConfirm.svelte.d.ts +1 -1
- package/dist/floating/tooltips/NeoPopSelect.svelte +5 -3
- package/dist/floating/tooltips/NeoPopSelect.svelte.d.ts +1 -1
- package/dist/floating/tooltips/NeoPopStepper.svelte +2 -0
- package/dist/floating/tooltips/NeoPopStepper.svelte.d.ts +1 -1
- package/dist/floating/tooltips/NeoTooltip.svelte +43 -23
- package/dist/floating/tooltips/NeoTooltip.svelte.d.ts +5 -1
- package/dist/floating/tooltips/neo-pop-confirm.model.d.ts +1 -1
- package/dist/floating/tooltips/neo-pop-select.model.d.ts +1 -3
- package/dist/floating/tooltips/neo-pop-stepper.model.d.ts +2 -2
- package/dist/floating/tooltips/neo-tooltip.model.d.ts +7 -2
- package/dist/form/NeoForm.svelte +1 -1
- package/dist/form/NeoForm.svelte.d.ts +3 -1
- package/dist/form/neo-form-context.svelte.d.ts +2 -0
- package/dist/icons/{IconAccount.svelte → NeoIconAccount.svelte} +2 -2
- package/dist/icons/NeoIconAccount.svelte.d.ts +4 -0
- package/dist/icons/{IconAdd.svelte → NeoIconAdd.svelte} +11 -6
- package/dist/icons/NeoIconAdd.svelte.d.ts +4 -0
- package/dist/icons/{IconAddress.svelte → NeoIconAddress.svelte} +2 -2
- package/dist/icons/NeoIconAddress.svelte.d.ts +4 -0
- package/dist/icons/{IconAlert.svelte → NeoIconAlert.svelte} +11 -6
- package/dist/icons/NeoIconAlert.svelte.d.ts +4 -0
- package/dist/icons/{IconAlignBottom.svelte → NeoIconAlignBottom.svelte} +11 -6
- package/dist/icons/NeoIconAlignBottom.svelte.d.ts +4 -0
- package/dist/icons/{IconAlignMiddle.svelte → NeoIconAlignMiddle.svelte} +11 -6
- package/dist/icons/NeoIconAlignMiddle.svelte.d.ts +4 -0
- package/dist/icons/{IconAlignTop.svelte → NeoIconAlignTop.svelte} +11 -6
- package/dist/icons/NeoIconAlignTop.svelte.d.ts +4 -0
- package/dist/icons/{IconArrow.svelte → NeoIconArrow.svelte} +9 -9
- package/dist/icons/NeoIconArrow.svelte.d.ts +4 -0
- package/dist/icons/NeoIconAudio.svelte +83 -0
- package/dist/icons/NeoIconAudio.svelte.d.ts +4 -0
- package/dist/icons/NeoIconBouncingDots.svelte +82 -0
- package/dist/icons/NeoIconBouncingDots.svelte.d.ts +4 -0
- package/dist/icons/{IconCalendar.svelte → NeoIconCalendar.svelte} +11 -6
- package/dist/icons/NeoIconCalendar.svelte.d.ts +4 -0
- package/dist/icons/{IconCancel.svelte → NeoIconCancel.svelte} +2 -2
- package/dist/icons/NeoIconCancel.svelte.d.ts +4 -0
- package/dist/icons/{IconCheckbox.svelte → NeoIconCheckbox.svelte} +2 -2
- package/dist/icons/NeoIconCheckbox.svelte.d.ts +4 -0
- package/dist/icons/NeoIconCircle.svelte +18 -0
- package/dist/icons/NeoIconCircle.svelte.d.ts +4 -0
- package/dist/icons/{IconCircleLoading.svelte → NeoIconCircleLoading.svelte} +2 -2
- package/dist/icons/{IconCircleLoading.svelte.d.ts → NeoIconCircleLoading.svelte.d.ts} +55 -39
- package/dist/icons/{IconClear.svelte → NeoIconClear.svelte} +11 -6
- package/dist/icons/NeoIconClear.svelte.d.ts +4 -0
- package/dist/icons/{IconClose.svelte → NeoIconClose.svelte} +2 -2
- package/dist/icons/NeoIconClose.svelte.d.ts +4 -0
- package/dist/icons/NeoIconCog.svelte +36 -0
- package/dist/icons/NeoIconCog.svelte.d.ts +4 -0
- package/dist/icons/{IconConfirm.svelte → NeoIconConfirm.svelte} +11 -6
- package/dist/icons/NeoIconConfirm.svelte.d.ts +4 -0
- package/dist/icons/NeoIconCube.svelte +31 -0
- package/dist/icons/NeoIconCube.svelte.d.ts +4 -0
- package/dist/icons/{IconDoubleChevron.svelte → NeoIconDoubleChevron.svelte} +11 -5
- package/dist/icons/NeoIconDoubleChevron.svelte.d.ts +4 -0
- package/dist/icons/{IconDoubleChevronLeft.svelte → NeoIconDoubleChevronLeft.svelte} +11 -6
- package/dist/icons/NeoIconDoubleChevronLeft.svelte.d.ts +4 -0
- package/dist/icons/{IconDoubleChevronRight.svelte → NeoIconDoubleChevronRight.svelte} +11 -6
- package/dist/icons/NeoIconDoubleChevronRight.svelte.d.ts +4 -0
- package/dist/icons/{IconDownload.svelte → NeoIconDownload.svelte} +11 -6
- package/dist/icons/NeoIconDownload.svelte.d.ts +4 -0
- package/dist/icons/NeoIconEmpty.svelte +26 -0
- package/dist/icons/NeoIconEmpty.svelte.d.ts +4 -0
- package/dist/icons/NeoIconError.svelte +30 -0
- package/dist/icons/NeoIconError.svelte.d.ts +4 -0
- package/dist/icons/{IconFileUpload.svelte → NeoIconFileUpload.svelte} +11 -6
- package/dist/icons/NeoIconFileUpload.svelte.d.ts +4 -0
- package/dist/icons/NeoIconFire.svelte +33 -0
- package/dist/icons/NeoIconFire.svelte.d.ts +4 -0
- package/dist/icons/{IconGithub.svelte → NeoIconGithub.svelte} +11 -6
- package/dist/icons/NeoIconGithub.svelte.d.ts +4 -0
- package/dist/icons/NeoIconImage.svelte +39 -0
- package/dist/icons/NeoIconImage.svelte.d.ts +4 -0
- package/dist/icons/NeoIconInfo.svelte +30 -0
- package/dist/icons/NeoIconInfo.svelte.d.ts +4 -0
- package/dist/icons/{IconList.svelte → NeoIconList.svelte} +11 -6
- package/dist/icons/NeoIconList.svelte.d.ts +4 -0
- package/dist/icons/{IconListSmall.svelte → NeoIconListSmall.svelte} +2 -2
- package/dist/icons/NeoIconListSmall.svelte.d.ts +4 -0
- package/dist/icons/{IconLoadingMatrix.svelte → NeoIconLoadingMatrix.svelte} +2 -2
- package/dist/icons/NeoIconLoadingMatrix.svelte.d.ts +4 -0
- package/dist/icons/{IconMail.svelte → NeoIconMail.svelte} +11 -6
- package/dist/icons/NeoIconMail.svelte.d.ts +4 -0
- package/dist/icons/{IconMinus.svelte → NeoIconMinus.svelte} +11 -6
- package/dist/icons/NeoIconMinus.svelte.d.ts +4 -0
- package/dist/icons/{IconPaint.svelte → NeoIconPaint.svelte} +11 -6
- package/dist/icons/NeoIconPaint.svelte.d.ts +4 -0
- package/dist/icons/{IconPencil.svelte → NeoIconPencil.svelte} +11 -6
- package/dist/icons/NeoIconPencil.svelte.d.ts +4 -0
- package/dist/icons/{IconPlayPause.svelte → NeoIconPlayPause.svelte} +2 -2
- package/dist/icons/NeoIconPlayPause.svelte.d.ts +4 -0
- package/dist/icons/{IconQuestionMark.svelte → NeoIconQuestionMark.svelte} +11 -6
- package/dist/icons/NeoIconQuestionMark.svelte.d.ts +4 -0
- package/dist/icons/{IconRadio.svelte → NeoIconRadio.svelte} +2 -2
- package/dist/icons/NeoIconRadio.svelte.d.ts +4 -0
- package/dist/icons/NeoIconRefresh.svelte +38 -0
- package/dist/icons/NeoIconRefresh.svelte.d.ts +4 -0
- package/dist/icons/NeoIconRestore.svelte +20 -0
- package/dist/icons/NeoIconRestore.svelte.d.ts +4 -0
- package/dist/icons/NeoIconSave.svelte +35 -0
- package/dist/icons/NeoIconSave.svelte.d.ts +4 -0
- package/dist/icons/NeoIconSaveOff.svelte +42 -0
- package/dist/icons/NeoIconSaveOff.svelte.d.ts +4 -0
- package/dist/icons/{IconSearch.svelte → NeoIconSearch.svelte} +11 -6
- package/dist/icons/NeoIconSearch.svelte.d.ts +4 -0
- package/dist/icons/NeoIconSuccess.svelte +26 -0
- package/dist/icons/NeoIconSuccess.svelte.d.ts +4 -0
- package/dist/icons/{IconSun.svelte → NeoIconSun.svelte} +11 -6
- package/dist/icons/NeoIconSun.svelte.d.ts +4 -0
- package/dist/icons/{IconSunMoon.svelte → NeoIconSunMoon.svelte} +11 -64
- package/dist/icons/NeoIconSunMoon.svelte.d.ts +4 -0
- package/dist/icons/{IconTextHighlight.svelte → NeoIconTextHighlight.svelte} +11 -6
- package/dist/icons/NeoIconTextHighlight.svelte.d.ts +4 -0
- package/dist/icons/NeoIconTheme.svelte +14 -0
- package/dist/icons/NeoIconTheme.svelte.d.ts +3 -0
- package/dist/icons/NeoIconTrend.svelte +39 -0
- package/dist/icons/NeoIconTrend.svelte.d.ts +4 -0
- package/dist/icons/NeoIconUnplug.svelte +63 -0
- package/dist/icons/NeoIconUnplug.svelte.d.ts +4 -0
- package/dist/icons/{IconVideo.svelte → NeoIconVideo.svelte} +11 -6
- package/dist/icons/NeoIconVideo.svelte.d.ts +4 -0
- package/dist/icons/NeoIconWarning.svelte +30 -0
- package/dist/icons/NeoIconWarning.svelte.d.ts +4 -0
- package/dist/icons/NeoIconWatch.svelte +41 -0
- package/dist/icons/NeoIconWatch.svelte.d.ts +4 -0
- package/dist/icons/NeoIconWatchOff.svelte +50 -0
- package/dist/icons/NeoIconWatchOff.svelte.d.ts +4 -0
- package/dist/icons/NeoIconWave.svelte +31 -0
- package/dist/icons/NeoIconWave.svelte.d.ts +4 -0
- package/dist/icons/index.d.ts +54 -0
- package/dist/icons/index.js +54 -0
- package/dist/icons/{icon.model.d.ts → neo-icon.model.d.ts} +41 -13
- package/dist/icons/{icon.model.js → neo-icon.model.js} +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/inputs/NeoCheckbox.svelte +6 -4
- package/dist/inputs/NeoCheckbox.svelte.d.ts +1 -1
- package/dist/inputs/NeoColorPicker.svelte +6 -3
- package/dist/inputs/NeoColorPicker.svelte.d.ts +1 -1
- package/dist/inputs/NeoColorPickerSelector.svelte +2 -2
- package/dist/inputs/NeoColorPickerSelector.svelte.d.ts +1 -1
- package/dist/inputs/NeoDateTime.svelte +6 -3
- package/dist/inputs/NeoDateTime.svelte.d.ts +1 -1
- package/dist/inputs/NeoFilePicker.svelte +11 -6
- package/dist/inputs/NeoFilePicker.svelte.d.ts +1 -1
- package/dist/inputs/NeoFilePickerCard.svelte +20 -14
- package/dist/inputs/NeoNativeSelect.svelte +6 -3
- package/dist/inputs/NeoNativeSelect.svelte.d.ts +1 -1
- package/dist/inputs/NeoNumberStep.svelte +13 -8
- package/dist/inputs/NeoNumberStep.svelte.d.ts +1 -1
- package/dist/inputs/NeoPassword.svelte +4 -4
- package/dist/inputs/NeoPassword.svelte.d.ts +1 -1
- package/dist/inputs/NeoPin.svelte +10 -10
- package/dist/inputs/NeoPin.svelte.d.ts +10 -1
- package/dist/inputs/NeoRadio.svelte +3 -3
- package/dist/inputs/NeoRadio.svelte.d.ts +1 -1
- package/dist/inputs/NeoRange.svelte +29 -27
- package/dist/inputs/NeoRange.svelte.d.ts +5 -2
- package/dist/inputs/NeoSelect.svelte +17 -8
- package/dist/inputs/NeoSelect.svelte.d.ts +1 -1
- package/dist/inputs/NeoSwitch.svelte +2 -2
- package/dist/inputs/NeoSwitch.svelte.d.ts +1 -1
- package/dist/inputs/common/NeoAffix.svelte +10 -10
- package/dist/inputs/common/NeoBaseInput.svelte +16 -2
- package/dist/inputs/common/NeoBaseInput.svelte.d.ts +1 -1
- package/dist/inputs/common/NeoInput.svelte +12 -4
- package/dist/inputs/common/NeoInput.svelte.d.ts +1 -1
- package/dist/inputs/common/NeoTextarea.svelte +18 -6
- package/dist/inputs/common/NeoTextarea.svelte.d.ts +2 -1
- package/dist/inputs/common/NeoValidation.svelte +6 -4
- package/dist/inputs/common/neo-input.model.d.ts +8 -1
- package/dist/inputs/common/neo-validation.model.d.ts +2 -1
- package/dist/inputs/neo-range.model.d.ts +2 -1
- package/dist/inputs/neo-select.model.d.ts +8 -4
- package/dist/list/NeoList.svelte +100 -62
- package/dist/list/NeoList.svelte.d.ts +5 -2
- package/dist/list/NeoListBaseItem.svelte +222 -92
- package/dist/list/NeoListBaseItem.svelte.d.ts +1 -1
- package/dist/list/NeoListBaseLoader.svelte +28 -4
- package/dist/list/NeoListBaseSection.svelte +18 -15
- package/dist/list/NeoListSearch.svelte +36 -20
- package/dist/list/NeoListSearch.svelte.d.ts +1 -1
- package/dist/list/NeoSimpleList.svelte +391 -0
- package/dist/list/NeoSimpleList.svelte.d.ts +8 -0
- package/dist/list/NeoVirtualList.svelte +388 -0
- package/dist/list/NeoVirtualList.svelte.d.ts +22 -0
- package/dist/list/index.d.ts +4 -0
- package/dist/list/index.js +2 -0
- package/dist/list/neo-list-base-item.model.d.ts +36 -7
- package/dist/list/neo-list-base-item.model.js +1 -0
- package/dist/list/neo-list-base-loader.model.d.ts +18 -1
- package/dist/list/neo-list-base-section.model.d.ts +8 -5
- package/dist/list/neo-list-search.model.d.ts +2 -2
- package/dist/list/neo-list.model.d.ts +120 -51
- package/dist/list/neo-list.model.js +18 -0
- package/dist/list/neo-simple-list.model.d.ts +124 -0
- package/dist/list/neo-simple-list.model.js +1 -0
- package/dist/list/neo-virtual-list.model.d.ts +69 -0
- package/dist/list/neo-virtual-list.model.js +6 -0
- package/dist/loading/NeoLoadingMatrix.svelte +2 -2
- package/dist/loading/neo-lazy.model.d.ts +2 -2
- package/dist/loading/neo-suspense.model.d.ts +1 -1
- package/dist/media/NeoImage.svelte +204 -0
- package/dist/media/NeoImage.svelte.d.ts +4 -0
- package/dist/media/NeoMedia.svelte +204 -0
- package/dist/media/NeoMedia.svelte.d.ts +4 -0
- package/dist/media/index.d.ts +2 -0
- package/dist/media/index.js +1 -0
- package/dist/media/neo-image.model.d.ts +67 -0
- package/dist/media/neo-image.model.js +1 -0
- package/dist/media/neo-media.model.d.ts +120 -0
- package/dist/media/neo-media.model.js +5 -0
- package/dist/nav/NeoTab.svelte +20 -15
- package/dist/nav/NeoTab.svelte.d.ts +17 -2
- package/dist/nav/NeoTabPanel.svelte +7 -5
- package/dist/nav/NeoTabPanel.svelte.d.ts +17 -2
- package/dist/nav/NeoTabs.svelte +21 -17
- package/dist/nav/NeoTabs.svelte.d.ts +19 -3
- package/dist/nav/NeoTabsCard.svelte +5 -3
- package/dist/nav/NeoTabsCard.svelte.d.ts +17 -2
- package/dist/nav/NeoTabsRow.svelte +225 -0
- package/dist/nav/NeoTabsRow.svelte.d.ts +19 -0
- package/dist/nav/index.d.ts +2 -0
- package/dist/nav/index.js +1 -0
- package/dist/nav/neo-tab-panel.model.d.ts +3 -3
- package/dist/nav/neo-tab.model.d.ts +15 -5
- package/dist/nav/neo-tabs-card.model.d.ts +3 -2
- package/dist/nav/neo-tabs-context.svelte.d.ts +35 -29
- package/dist/nav/neo-tabs-context.svelte.js +17 -3
- package/dist/nav/neo-tabs-row.model.d.ts +85 -0
- package/dist/nav/neo-tabs-row.model.js +1 -0
- package/dist/nav/neo-tabs.model.d.ts +12 -11
- package/dist/pill/NeoPill.svelte +73 -14
- package/dist/pill/neo-pill.model.d.ts +25 -1
- package/dist/progress/NeoProgress.svelte +203 -42
- package/dist/progress/NeoProgress.svelte.d.ts +8 -8
- package/dist/progress/NeoProgressBar.svelte +37 -6
- package/dist/progress/NeoProgressBar.svelte.d.ts +9 -1
- package/dist/progress/index.d.ts +1 -0
- package/dist/progress/index.js +1 -0
- package/dist/progress/neo-progress-bar.model.d.ts +11 -6
- package/dist/progress/neo-progress-service.svelte.d.ts +47 -0
- package/dist/progress/neo-progress-service.svelte.js +157 -0
- package/dist/progress/neo-progress.model.d.ts +98 -41
- package/dist/progress/neo-progress.model.js +6 -1
- package/dist/providers/NeoRememberSelector.svelte +43 -0
- package/dist/providers/NeoRememberSelector.svelte.d.ts +4 -0
- package/dist/providers/NeoResetSelector.svelte +40 -0
- package/dist/providers/NeoResetSelector.svelte.d.ts +4 -0
- package/dist/providers/NeoSourceSelector.svelte +63 -0
- package/dist/providers/NeoSourceSelector.svelte.d.ts +4 -0
- package/dist/providers/NeoThemeProvider.svelte +25 -10
- package/dist/providers/NeoThemeProvider.svelte.d.ts +1 -2
- package/dist/providers/NeoThemeSelector.svelte +26 -108
- package/dist/providers/NeoThemeSelector.svelte.d.ts +1 -1
- package/dist/providers/NeoThemeSelectors.svelte +57 -0
- package/dist/providers/NeoThemeSelectors.svelte.d.ts +4 -0
- package/dist/providers/NeoTransitionSelector.svelte +57 -0
- package/dist/providers/NeoTransitionSelector.svelte.d.ts +4 -0
- package/dist/providers/index.d.ts +10 -0
- package/dist/providers/index.js +5 -0
- package/dist/providers/neo-remember-selector.model.d.ts +9 -0
- package/dist/providers/neo-remember-selector.model.js +2 -0
- package/dist/providers/neo-reset-selector.model.d.ts +9 -0
- package/dist/providers/neo-reset-selector.model.js +1 -0
- package/dist/providers/neo-source-selector.model.d.ts +9 -0
- package/dist/providers/neo-source-selector.model.js +2 -0
- package/dist/providers/neo-theme-provider-context.svelte.d.ts +14 -3
- package/dist/providers/neo-theme-provider-context.svelte.js +94 -11
- package/dist/providers/neo-theme-provider.model.d.ts +31 -3
- package/dist/providers/neo-theme-provider.model.js +9 -0
- package/dist/providers/neo-theme-selector.model.d.ts +3 -48
- package/dist/providers/neo-theme-selector.model.js +1 -0
- package/dist/providers/neo-theme-selectors.model.d.ts +84 -0
- package/dist/providers/neo-theme-selectors.model.js +1 -0
- package/dist/providers/neo-transition-selector.model.d.ts +9 -0
- package/dist/providers/neo-transition-selector.model.js +2 -0
- package/dist/skeletons/NeoSkeletonContainer.svelte +3 -1
- package/dist/skeletons/NeoSkeletonMedia.svelte +26 -18
- package/dist/skeletons/NeoSkeletonText.svelte +5 -3
- package/dist/skeletons/neo-skeleton-container.model.d.ts +9 -0
- package/dist/skeletons/neo-skeleton-media.model.d.ts +20 -10
- package/dist/skeletons/neo-skeleton-media.model.js +7 -1
- package/dist/skeletons/neo-skeleton-text.model.d.ts +5 -0
- package/dist/stepper/NeoStepper.svelte +20 -20
- package/dist/stepper/NeoStepper.svelte.d.ts +9 -2
- package/dist/stepper/neo-stepper.model.d.ts +5 -5
- package/dist/styles/animation.scss +76 -0
- package/dist/styles/common/colors.scss +15 -9
- package/dist/styles/common/properties.css +18 -0
- package/dist/styles/common/spacing.scss +8 -4
- package/dist/styles/common/typography.scss +13 -3
- package/dist/styles/common/utils.scss +2 -2
- package/dist/styles/mixin.scss +125 -11
- package/dist/styles/theme.scss +20 -0
- package/dist/styles/transition.scss +101 -0
- package/dist/text/NeoEllipsis.svelte +1 -0
- package/dist/text/NeoHtml.svelte +26 -0
- package/dist/text/NeoHtml.svelte.d.ts +7 -0
- package/dist/text/NeoMark.svelte +18 -5
- package/dist/text/NeoTypewriter.svelte +5 -4
- package/dist/text/NeoTypewriter.svelte.d.ts +5 -1
- package/dist/text/index.d.ts +2 -0
- package/dist/text/index.js +1 -0
- package/dist/text/neo-html.model.d.ts +4 -0
- package/dist/text/neo-html.model.js +1 -0
- package/dist/text/neo-mark.model.d.ts +8 -0
- package/dist/text/typewriter.utils.d.ts +2 -2
- package/dist/text/typewriter.utils.js +8 -9
- package/dist/utils/action.utils.d.ts +1 -21
- package/dist/utils/border.utils.d.ts +13 -0
- package/dist/utils/border.utils.js +18 -0
- package/dist/utils/colors.utils.d.ts +1 -1
- package/dist/utils/error.utils.d.ts +22 -0
- package/dist/utils/error.utils.js +36 -0
- package/dist/utils/style.utils.d.ts +1 -1
- package/package.json +55 -39
- package/dist/icons/IconAccount.svelte.d.ts +0 -4
- package/dist/icons/IconAdd.svelte.d.ts +0 -26
- package/dist/icons/IconAddress.svelte.d.ts +0 -4
- package/dist/icons/IconAlert.svelte.d.ts +0 -26
- package/dist/icons/IconAlignBottom.svelte.d.ts +0 -26
- package/dist/icons/IconAlignMiddle.svelte.d.ts +0 -26
- package/dist/icons/IconAlignTop.svelte.d.ts +0 -26
- package/dist/icons/IconArrow.svelte.d.ts +0 -4
- package/dist/icons/IconBouncingDots.svelte +0 -63
- package/dist/icons/IconBouncingDots.svelte.d.ts +0 -4
- package/dist/icons/IconCalendar.svelte.d.ts +0 -26
- package/dist/icons/IconCancel.svelte.d.ts +0 -4
- package/dist/icons/IconCheckbox.svelte.d.ts +0 -4
- package/dist/icons/IconClear.svelte.d.ts +0 -26
- package/dist/icons/IconClose.svelte.d.ts +0 -4
- package/dist/icons/IconConfirm.svelte.d.ts +0 -26
- package/dist/icons/IconDoubleChevron.svelte.d.ts +0 -26
- package/dist/icons/IconDoubleChevronLeft.svelte.d.ts +0 -26
- package/dist/icons/IconDoubleChevronRight.svelte.d.ts +0 -26
- package/dist/icons/IconDownload.svelte.d.ts +0 -26
- package/dist/icons/IconEmpty.svelte +0 -18
- package/dist/icons/IconEmpty.svelte.d.ts +0 -26
- package/dist/icons/IconFileUpload.svelte.d.ts +0 -26
- package/dist/icons/IconGithub.svelte.d.ts +0 -26
- package/dist/icons/IconImage.svelte +0 -26
- package/dist/icons/IconImage.svelte.d.ts +0 -26
- package/dist/icons/IconList.svelte.d.ts +0 -26
- package/dist/icons/IconListSmall.svelte.d.ts +0 -4
- package/dist/icons/IconLoadingMatrix.svelte.d.ts +0 -4
- package/dist/icons/IconMail.svelte.d.ts +0 -26
- package/dist/icons/IconMinus.svelte.d.ts +0 -26
- package/dist/icons/IconPaint.svelte.d.ts +0 -26
- package/dist/icons/IconPencil.svelte.d.ts +0 -26
- package/dist/icons/IconPlayPause.svelte.d.ts +0 -4
- package/dist/icons/IconQuestionMark.svelte.d.ts +0 -26
- package/dist/icons/IconRadio.svelte.d.ts +0 -4
- package/dist/icons/IconSave.svelte +0 -25
- package/dist/icons/IconSave.svelte.d.ts +0 -26
- package/dist/icons/IconSaveOff.svelte +0 -32
- package/dist/icons/IconSaveOff.svelte.d.ts +0 -26
- package/dist/icons/IconSearch.svelte.d.ts +0 -26
- package/dist/icons/IconSun.svelte.d.ts +0 -26
- package/dist/icons/IconSunMoon.svelte.d.ts +0 -4
- package/dist/icons/IconTextHighlight.svelte.d.ts +0 -26
- package/dist/icons/IconVideo.svelte.d.ts +0 -26
- package/dist/icons/IconWatch.svelte +0 -29
- package/dist/icons/IconWatch.svelte.d.ts +0 -26
- package/dist/icons/IconWatchOff.svelte +0 -34
- package/dist/icons/IconWatchOff.svelte.d.ts +0 -26
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
|
|
3
|
+
import type { NeoNotificationStackService } from './neo-notification-provider.model.js';
|
|
4
|
+
import type { NeoNotificationStackProps } from './neo-notification-stack.model.js';
|
|
5
|
+
import type { NeoNotification, NeoNotificationDeQueued, NeoNotificationQueued } from './neo-notification.model.js';
|
|
6
|
+
|
|
7
|
+
import { debounce } from '@dvcol/common-utils/common/debounce';
|
|
8
|
+
import { getUUID } from '@dvcol/common-utils/common/string';
|
|
9
|
+
import { onDestroy, onMount } from 'svelte';
|
|
10
|
+
import { SvelteMap } from 'svelte/reactivity';
|
|
11
|
+
|
|
12
|
+
import { NeoNotificationPlacements } from '../common/neo-placement.model.js';
|
|
13
|
+
import { getNeoNotificationProviderContext } from './neo-notification-provider.model.js';
|
|
14
|
+
import { NeoNotificationEvent, NeoNotificationStackDirection, NeoNotificationStatus } from './neo-notification.model.js';
|
|
15
|
+
import NeoNotificationItem from './NeoNotificationItem.svelte';
|
|
16
|
+
import NeoPortal from '../portal/NeoPortal.svelte';
|
|
17
|
+
import { NeoErrorNotificationMissingId, NeoErrorNotificationNotFound } from '../../utils/error.utils.js';
|
|
18
|
+
|
|
19
|
+
let {
|
|
20
|
+
// Snippets
|
|
21
|
+
children,
|
|
22
|
+
before,
|
|
23
|
+
after,
|
|
24
|
+
|
|
25
|
+
// Stats
|
|
26
|
+
id = $bindable<string>(getUUID()),
|
|
27
|
+
ref = $bindable(),
|
|
28
|
+
tag = 'ol',
|
|
29
|
+
queue = $bindable(new SvelteMap<NonNullable<NeoNotificationQueued['id']>, NeoNotificationQueued>()),
|
|
30
|
+
paused = $bindable(false),
|
|
31
|
+
hovered = $bindable(false),
|
|
32
|
+
focused = $bindable(false),
|
|
33
|
+
expand,
|
|
34
|
+
delay = 900,
|
|
35
|
+
max = expand ? 6 : 3,
|
|
36
|
+
|
|
37
|
+
// Item Props
|
|
38
|
+
duration = 10000,
|
|
39
|
+
pauseOnHover = true,
|
|
40
|
+
draggable = true,
|
|
41
|
+
swipeable = false,
|
|
42
|
+
threshold = { x: 3, y: 2 },
|
|
43
|
+
restartOnTouch,
|
|
44
|
+
progress,
|
|
45
|
+
loading,
|
|
46
|
+
close = true,
|
|
47
|
+
|
|
48
|
+
// Style
|
|
49
|
+
elevation = 1,
|
|
50
|
+
blur,
|
|
51
|
+
color,
|
|
52
|
+
filled,
|
|
53
|
+
tinted,
|
|
54
|
+
rounded,
|
|
55
|
+
borderless,
|
|
56
|
+
|
|
57
|
+
// Position
|
|
58
|
+
placement = NeoNotificationPlacements.BottomEnd,
|
|
59
|
+
direction,
|
|
60
|
+
portal,
|
|
61
|
+
|
|
62
|
+
// Other props
|
|
63
|
+
portalProps,
|
|
64
|
+
containerProps,
|
|
65
|
+
actionProps,
|
|
66
|
+
closeProps,
|
|
67
|
+
...rest
|
|
68
|
+
}: NeoNotificationStackProps = $props();
|
|
69
|
+
|
|
70
|
+
let active = $state(false);
|
|
71
|
+
|
|
72
|
+
const debounceActive = debounce((value: boolean) => {
|
|
73
|
+
active = value;
|
|
74
|
+
}, delay);
|
|
75
|
+
|
|
76
|
+
function setActive(value: boolean): void {
|
|
77
|
+
if (value) {
|
|
78
|
+
active = true;
|
|
79
|
+
debounceActive.cancel();
|
|
80
|
+
} else {
|
|
81
|
+
debounceActive(value);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const expanded = $derived(expand ?? active);
|
|
86
|
+
|
|
87
|
+
const reverse = $derived.by(() => {
|
|
88
|
+
if (direction !== undefined) return direction === NeoNotificationStackDirection.Down;
|
|
89
|
+
return placement?.startsWith('top');
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
const visible = $derived.by(() => {
|
|
93
|
+
if (!queue) return [];
|
|
94
|
+
return Array.from(queue.values()).map((item, index) => ({ item, index })).slice(-max);
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
export function add(item: NeoNotification): NeoNotificationQueued {
|
|
98
|
+
const { promise, resolve } = Promise.withResolvers<NeoNotificationDeQueued>();
|
|
99
|
+
|
|
100
|
+
const response: NeoNotificationDeQueued = {
|
|
101
|
+
id: getUUID(),
|
|
102
|
+
duration,
|
|
103
|
+
...item,
|
|
104
|
+
status: NeoNotificationStatus.Pending,
|
|
105
|
+
added: Date.now(),
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
const queued: NeoNotificationQueued = {
|
|
109
|
+
...response,
|
|
110
|
+
promise,
|
|
111
|
+
cancel: (status = NeoNotificationStatus.Cancelled) => {
|
|
112
|
+
if (!response.id) throw new NeoErrorNotificationMissingId();
|
|
113
|
+
const item = queue.get(response.id);
|
|
114
|
+
if (!item) throw new NeoErrorNotificationNotFound(id);
|
|
115
|
+
queue.delete(response.id);
|
|
116
|
+
response.removed = Date.now();
|
|
117
|
+
response.status = status;
|
|
118
|
+
resolve(response);
|
|
119
|
+
item.onChange?.(NeoNotificationEvent.Status, item);
|
|
120
|
+
return response;
|
|
121
|
+
},
|
|
122
|
+
update: (update: Omit<NeoNotification, 'id'>): NeoNotificationQueued => {
|
|
123
|
+
if (!response.id) throw new NeoErrorNotificationMissingId();
|
|
124
|
+
const item = queue.get(response.id);
|
|
125
|
+
if (!item) throw new NeoErrorNotificationNotFound(response.id);
|
|
126
|
+
if ('id' in update) delete update.id; // Ensure we don't overwrite the id
|
|
127
|
+
Object.assign(item, update);
|
|
128
|
+
item.onChange?.(NeoNotificationEvent.Update, item);
|
|
129
|
+
if (item.duration) return item.restart();
|
|
130
|
+
return item;
|
|
131
|
+
},
|
|
132
|
+
restart: (options: { duration?: number; unshift?: boolean } = {}): NeoNotificationQueued => {
|
|
133
|
+
if (!response.id) throw new NeoErrorNotificationMissingId();
|
|
134
|
+
const item = queue.get(response.id);
|
|
135
|
+
if (!item) throw new NeoErrorNotificationNotFound(response.id);
|
|
136
|
+
|
|
137
|
+
clearTimeout(item.timeout);
|
|
138
|
+
item.duration = options.duration ?? item.duration ?? duration;
|
|
139
|
+
|
|
140
|
+
// Remove the item from the queue before restarting
|
|
141
|
+
if (options.unshift) queue.delete(response.id);
|
|
142
|
+
|
|
143
|
+
if (item.duration && !paused) {
|
|
144
|
+
item.timeout = setTimeout(() => {
|
|
145
|
+
if (!item.id) throw new NeoErrorNotificationMissingId();
|
|
146
|
+
if (!queue?.has(item.id)) return;
|
|
147
|
+
item.cancel(NeoNotificationStatus.Expired);
|
|
148
|
+
}, item.duration);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// Re-add the item to the queue
|
|
152
|
+
if (options.unshift) queue.set(response.id, item);
|
|
153
|
+
item.onChange?.(NeoNotificationEvent.Restart, item);
|
|
154
|
+
return item;
|
|
155
|
+
},
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
queue.set(response.id, queued);
|
|
159
|
+
return queued.restart();
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export function get(uuid: string): NeoNotificationQueued | undefined {
|
|
163
|
+
return queue.get(uuid);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export function remove(uuid: string, status = NeoNotificationStatus.Cancelled): NeoNotificationDeQueued {
|
|
167
|
+
const item = queue.get(uuid);
|
|
168
|
+
if (!item) throw new NeoErrorNotificationNotFound(uuid);
|
|
169
|
+
return item.cancel(status);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
export function update(uuid: string, update: Omit<NeoNotification, 'id'>): NeoNotificationQueued {
|
|
173
|
+
const item = queue.get(uuid);
|
|
174
|
+
if (!item) throw new NeoErrorNotificationNotFound(uuid);
|
|
175
|
+
return item.update(update);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
export function restart(uuid: string, options?: { duration?: number; unshift?: boolean }): NeoNotificationQueued {
|
|
179
|
+
const item = queue.get(uuid);
|
|
180
|
+
if (!item) throw new NeoErrorNotificationNotFound(uuid);
|
|
181
|
+
return item.restart(options);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export function clear(): void {
|
|
185
|
+
queue?.forEach(item => item.cancel(NeoNotificationStatus.Cancelled));
|
|
186
|
+
queue?.clear();
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
const resume = debounce(() => queue?.forEach((item) => {
|
|
190
|
+
if (!item.paused || !item.duration) return;
|
|
191
|
+
// restart the item with a duration base on item.added and item.paused
|
|
192
|
+
item.restart({ duration: item.duration - (item.paused - item.added), unshift: false });
|
|
193
|
+
delete item.paused;
|
|
194
|
+
}), delay);
|
|
195
|
+
|
|
196
|
+
export function pause(_paused: boolean = true): void | Promise<void> {
|
|
197
|
+
paused = _paused;
|
|
198
|
+
|
|
199
|
+
if (!_paused) return resume();
|
|
200
|
+
queue?.forEach((item) => {
|
|
201
|
+
if (!item.timeout) return;
|
|
202
|
+
if (!(item.pauseOnHover ?? pauseOnHover)) return;
|
|
203
|
+
item.paused = Date.now();
|
|
204
|
+
item.onChange?.(NeoNotificationEvent.Paused, item);
|
|
205
|
+
clearTimeout(item.timeout);
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
let swiped = $state(false);
|
|
210
|
+
const debounceSwiped = debounce((swipe: boolean) => {
|
|
211
|
+
swiped = swipe;
|
|
212
|
+
}, 600);
|
|
213
|
+
|
|
214
|
+
const context = getNeoNotificationProviderContext();
|
|
215
|
+
|
|
216
|
+
onMount(() => {
|
|
217
|
+
if (!context) return;
|
|
218
|
+
context.register({ id, add, get, remove, update, pause, restart, clear } satisfies NeoNotificationStackService);
|
|
219
|
+
});
|
|
220
|
+
|
|
221
|
+
onDestroy(() => {
|
|
222
|
+
context.unregister(id);
|
|
223
|
+
});
|
|
224
|
+
</script>
|
|
225
|
+
|
|
226
|
+
<NeoPortal enabled={portal} {...portalProps}>
|
|
227
|
+
<svelte:element
|
|
228
|
+
bind:this={ref}
|
|
229
|
+
this={tag}
|
|
230
|
+
id="neo-notification-stack-${id}"
|
|
231
|
+
data-max={max}
|
|
232
|
+
data-visible={visible.length}
|
|
233
|
+
data-setsize={queue.size}
|
|
234
|
+
aria-live="polite"
|
|
235
|
+
aria-relevant="additions text"
|
|
236
|
+
aria-atomic="false"
|
|
237
|
+
data-placement={placement}
|
|
238
|
+
class:neo-notification-stack={true}
|
|
239
|
+
{...rest}
|
|
240
|
+
>
|
|
241
|
+
{#each visible as { item, index }, i (item?.id)}
|
|
242
|
+
<NeoNotificationItem
|
|
243
|
+
tag={['ul', 'ol'].includes(tag) ? 'li' : 'div'}
|
|
244
|
+
|
|
245
|
+
index={i}
|
|
246
|
+
posinset={index + 1}
|
|
247
|
+
setsize={queue.size}
|
|
248
|
+
visible={visible.length}
|
|
249
|
+
|
|
250
|
+
expand={expanded}
|
|
251
|
+
{reverse}
|
|
252
|
+
{draggable}
|
|
253
|
+
{swipeable}
|
|
254
|
+
{placement}
|
|
255
|
+
{threshold}
|
|
256
|
+
{swiped}
|
|
257
|
+
|
|
258
|
+
{item}
|
|
259
|
+
{before}
|
|
260
|
+
{after}
|
|
261
|
+
{children}
|
|
262
|
+
|
|
263
|
+
{restartOnTouch}
|
|
264
|
+
{progress}
|
|
265
|
+
{loading}
|
|
266
|
+
{close}
|
|
267
|
+
|
|
268
|
+
{elevation}
|
|
269
|
+
{blur}
|
|
270
|
+
{color}
|
|
271
|
+
{filled}
|
|
272
|
+
{tinted}
|
|
273
|
+
{rounded}
|
|
274
|
+
{borderless}
|
|
275
|
+
|
|
276
|
+
{containerProps}
|
|
277
|
+
{actionProps}
|
|
278
|
+
{closeProps}
|
|
279
|
+
|
|
280
|
+
onChange={(state) => {
|
|
281
|
+
hovered = state.hovered;
|
|
282
|
+
focused = state.focused;
|
|
283
|
+
setActive(hovered || focused);
|
|
284
|
+
pause(hovered || focused);
|
|
285
|
+
}}
|
|
286
|
+
|
|
287
|
+
onCancel={({ event }) => {
|
|
288
|
+
if (!(event instanceof WheelEvent)) return;
|
|
289
|
+
swiped = true;
|
|
290
|
+
debounceSwiped.cancel();
|
|
291
|
+
debounceSwiped(false);
|
|
292
|
+
}}
|
|
293
|
+
/>
|
|
294
|
+
{/each}
|
|
295
|
+
</svelte:element>
|
|
296
|
+
</NeoPortal>
|
|
297
|
+
|
|
298
|
+
<style>.neo-notification-stack {
|
|
299
|
+
z-index: var(--neo-z-index-layer-top, 2000000000);
|
|
300
|
+
width: 0;
|
|
301
|
+
height: 0;
|
|
302
|
+
list-style: none;
|
|
303
|
+
pointer-events: none;
|
|
304
|
+
position: fixed;
|
|
305
|
+
margin: var(--neo-notification-margin, var(--neo-gap));
|
|
306
|
+
display: flex;
|
|
307
|
+
flex-direction: column;
|
|
308
|
+
}
|
|
309
|
+
.neo-notification-stack[data-placement=center] {
|
|
310
|
+
inset: 0;
|
|
311
|
+
margin: var(--neo-notification-margin, auto);
|
|
312
|
+
}
|
|
313
|
+
.neo-notification-stack[data-placement^=top], .neo-notification-stack[data-placement=right-start], .neo-notification-stack[data-placement=left-start] {
|
|
314
|
+
top: 0;
|
|
315
|
+
bottom: auto;
|
|
316
|
+
}
|
|
317
|
+
.neo-notification-stack[data-placement^=bottom], .neo-notification-stack[data-placement=right-end], .neo-notification-stack[data-placement=left-end] {
|
|
318
|
+
top: auto;
|
|
319
|
+
bottom: 0;
|
|
320
|
+
}
|
|
321
|
+
.neo-notification-stack[data-placement^=left], .neo-notification-stack[data-placement=bottom-start], .neo-notification-stack[data-placement=top-start] {
|
|
322
|
+
right: auto;
|
|
323
|
+
left: 0;
|
|
324
|
+
align-items: start;
|
|
325
|
+
}
|
|
326
|
+
.neo-notification-stack[data-placement^=right], .neo-notification-stack[data-placement=bottom-end], .neo-notification-stack[data-placement=top-end] {
|
|
327
|
+
right: 0;
|
|
328
|
+
left: auto;
|
|
329
|
+
align-items: end;
|
|
330
|
+
}
|
|
331
|
+
.neo-notification-stack[data-placement=right], .neo-notification-stack[data-placement=left] {
|
|
332
|
+
top: 0;
|
|
333
|
+
bottom: 0;
|
|
334
|
+
margin-top: var(--neo-notification-margin-top, auto);
|
|
335
|
+
margin-bottom: var(--neo-notification-margin-bottom, auto);
|
|
336
|
+
}
|
|
337
|
+
.neo-notification-stack[data-placement=top], .neo-notification-stack[data-placement=bottom] {
|
|
338
|
+
right: 0;
|
|
339
|
+
left: 0;
|
|
340
|
+
margin-right: var(--neo-notification-margin-right, auto);
|
|
341
|
+
margin-left: var(--neo-notification-margin-left, auto);
|
|
342
|
+
}
|
|
343
|
+
.neo-notification-stack[data-placement=top], .neo-notification-stack[data-placement=bottom], .neo-notification-stack[data-placement=center] {
|
|
344
|
+
align-items: center;
|
|
345
|
+
}</style>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { NeoNotificationStackProps } from './neo-notification-stack.model.js';
|
|
2
|
+
import type { NeoNotification, NeoNotificationDeQueued, NeoNotificationQueued } from './neo-notification.model.js';
|
|
3
|
+
declare const NeoNotificationStack: import("svelte").Component<NeoNotificationStackProps<"ol">, {
|
|
4
|
+
add: (item: NeoNotification) => NeoNotificationQueued;
|
|
5
|
+
get: (uuid: string) => NeoNotificationQueued | undefined;
|
|
6
|
+
remove: (uuid: string, status?: "cancelled") => NeoNotificationDeQueued;
|
|
7
|
+
update: (uuid: string, update: Omit<NeoNotification, "id">) => NeoNotificationQueued;
|
|
8
|
+
restart: (uuid: string, options?: {
|
|
9
|
+
duration?: number;
|
|
10
|
+
unshift?: boolean;
|
|
11
|
+
}) => NeoNotificationQueued;
|
|
12
|
+
clear: () => void;
|
|
13
|
+
pause: (_paused?: boolean) => void | Promise<void>;
|
|
14
|
+
}, "id" | "ref" | "hovered" | "focused" | "paused" | "queue">;
|
|
15
|
+
type NeoNotificationStack = ReturnType<typeof NeoNotificationStack>;
|
|
16
|
+
export default NeoNotificationStack;
|
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { NeoSimpleNotificationProps } from './neo-simple-notification.model.js';
|
|
3
|
+
import type { SvelteEvent } from '../../utils/html-element.utils.js';
|
|
4
|
+
|
|
5
|
+
import { scaleHeight, scaleWidth } from '@dvcol/svelte-utils/transition';
|
|
6
|
+
import { scale } from 'svelte/transition';
|
|
7
|
+
|
|
8
|
+
import NeoButton from '../../buttons/NeoButton.svelte';
|
|
9
|
+
import NeoCloseButton from '../../buttons/NeoCloseButton.svelte';
|
|
10
|
+
import { NeoNotificationStatus, NeoNotificationType } from './neo-notification.model.js';
|
|
11
|
+
import NeoIconCircleLoading from '../../icons/NeoIconCircleLoading.svelte';
|
|
12
|
+
import NeoIconError from '../../icons/NeoIconError.svelte';
|
|
13
|
+
import NeoIconInfo from '../../icons/NeoIconInfo.svelte';
|
|
14
|
+
import NeoIconSuccess from '../../icons/NeoIconSuccess.svelte';
|
|
15
|
+
import NeoIconWarning from '../../icons/NeoIconWarning.svelte';
|
|
16
|
+
import NeoProgressBar from '../../progress/NeoProgressBar.svelte';
|
|
17
|
+
import { quickDurationProps } from '../../utils/transition.utils.js';
|
|
18
|
+
|
|
19
|
+
let {
|
|
20
|
+
// Snippet
|
|
21
|
+
children,
|
|
22
|
+
before,
|
|
23
|
+
after,
|
|
24
|
+
|
|
25
|
+
// State
|
|
26
|
+
ref = $bindable(),
|
|
27
|
+
bar = $bindable(),
|
|
28
|
+
height = $bindable(0),
|
|
29
|
+
|
|
30
|
+
tag = 'div',
|
|
31
|
+
|
|
32
|
+
item,
|
|
33
|
+
index,
|
|
34
|
+
|
|
35
|
+
restartOnTouch,
|
|
36
|
+
progress,
|
|
37
|
+
loading,
|
|
38
|
+
close = true,
|
|
39
|
+
|
|
40
|
+
// Style
|
|
41
|
+
rounded,
|
|
42
|
+
|
|
43
|
+
// Events
|
|
44
|
+
onCancel,
|
|
45
|
+
|
|
46
|
+
// Other Props
|
|
47
|
+
progressProps,
|
|
48
|
+
actionProps,
|
|
49
|
+
closeProps,
|
|
50
|
+
...rest
|
|
51
|
+
}: NeoSimpleNotificationProps = $props();
|
|
52
|
+
|
|
53
|
+
const onCloseButton = (event: SvelteEvent<MouseEvent>) => {
|
|
54
|
+
item.cancel(NeoNotificationStatus.Dismissed);
|
|
55
|
+
onCancel?.({ item, index, event });
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const showClose = $derived(item.close ?? close);
|
|
59
|
+
const showAction = $derived(!!(item.actionProps || actionProps));
|
|
60
|
+
const showAfter = $derived(showClose || showAction || (item.after ?? after));
|
|
61
|
+
const showBefore = $derived((item.loading ?? loading) || !!(item.before ?? before) || (item.type && item.type !== NeoNotificationType.Default));
|
|
62
|
+
|
|
63
|
+
const notifSize = $derived.by(() => {
|
|
64
|
+
if (height <= 48) return 'sm';
|
|
65
|
+
if (height <= 96) return 'md';
|
|
66
|
+
return 'lg';
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
const iconSize = $derived.by(() => {
|
|
70
|
+
if (height <= 48) return '1.25rem';
|
|
71
|
+
if (height <= 96) return '2rem';
|
|
72
|
+
return '2.5rem';
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
const onActionButton = async (event: SvelteEvent<MouseEvent>, checked?: boolean) => {
|
|
76
|
+
const cb = item.actionProps?.onclick ?? actionProps?.onclick;
|
|
77
|
+
const result = await cb?.(event, checked);
|
|
78
|
+
if (item.paused && (item.restartOnTouch ?? restartOnTouch)) item.paused = item.added;
|
|
79
|
+
if (!result) return;
|
|
80
|
+
item.cancel(typeof result === 'string' ? result : NeoNotificationStatus.Dismissed);
|
|
81
|
+
onCancel?.({ item, index, event });
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
const defaultProgress = $derived.by(() => {
|
|
85
|
+
const duration = item.duration ? (item.duration - (Date.now() - item.added)) : undefined;
|
|
86
|
+
const step = duration ? (100 / (duration / 1000)) : undefined;
|
|
87
|
+
return {
|
|
88
|
+
step,
|
|
89
|
+
tick: 1000,
|
|
90
|
+
autoStart: { pending: !duration },
|
|
91
|
+
autoComplete: true,
|
|
92
|
+
};
|
|
93
|
+
});
|
|
94
|
+
</script>
|
|
95
|
+
|
|
96
|
+
<svelte:element
|
|
97
|
+
this={tag}
|
|
98
|
+
bind:this={ref}
|
|
99
|
+
bind:offsetHeight={height}
|
|
100
|
+
class:neo-notification={true}
|
|
101
|
+
class:neo-rounded={rounded}
|
|
102
|
+
aria-live="polite"
|
|
103
|
+
role={item.type === NeoNotificationType.Error ? 'alert' : 'status'}
|
|
104
|
+
data-size={notifSize}
|
|
105
|
+
{...rest}
|
|
106
|
+
>
|
|
107
|
+
<div class="neo-notification-body" class:neo-after={showAfter}>
|
|
108
|
+
{#if showBefore}
|
|
109
|
+
<div class="neo-notification-before" transition:scaleWidth={quickDurationProps}>
|
|
110
|
+
{#if item.loading ?? loading}
|
|
111
|
+
<NeoIconCircleLoading size={iconSize} />
|
|
112
|
+
{:else if (item.before ?? before)}
|
|
113
|
+
{@render (item.before ?? before)?.(item)}
|
|
114
|
+
{:else if item.type === NeoNotificationType.Error}
|
|
115
|
+
<NeoIconError size={iconSize} stroke={1} />
|
|
116
|
+
{:else if item.type === NeoNotificationType.Warning}
|
|
117
|
+
<NeoIconWarning size={iconSize} stroke={1} />
|
|
118
|
+
{:else if item.type === NeoNotificationType.Info}
|
|
119
|
+
<NeoIconInfo size={iconSize} stroke={1} />
|
|
120
|
+
{:else if item.type === NeoNotificationType.Success}
|
|
121
|
+
<NeoIconSuccess size={iconSize} stroke={1} />
|
|
122
|
+
{/if}
|
|
123
|
+
</div>
|
|
124
|
+
{/if}
|
|
125
|
+
<div class="neo-notification-text" class:neo-before={showBefore}>
|
|
126
|
+
{#if item.title}
|
|
127
|
+
<div class="neo-notification-title" transition:scaleHeight={quickDurationProps}>{item.title}</div>
|
|
128
|
+
{/if}
|
|
129
|
+
{#if item.subtitle}
|
|
130
|
+
<div class="neo-notification-subtitle" transition:scaleHeight={quickDurationProps}>{item.subtitle}</div>
|
|
131
|
+
{/if}
|
|
132
|
+
{#if item.content}
|
|
133
|
+
<div class="neo-notification-content" transition:scaleHeight={quickDurationProps}>
|
|
134
|
+
{item.content}
|
|
135
|
+
</div>
|
|
136
|
+
{/if}
|
|
137
|
+
{#if children}
|
|
138
|
+
{@render children(item)}
|
|
139
|
+
{/if}
|
|
140
|
+
{#if item.progress ?? progress}
|
|
141
|
+
<div class="neo-notification-progress" transition:scaleHeight={quickDurationProps}>
|
|
142
|
+
<NeoProgressBar
|
|
143
|
+
bind:ref={bar}
|
|
144
|
+
glass
|
|
145
|
+
elevation={-1}
|
|
146
|
+
aria-label="Notification progress"
|
|
147
|
+
{...defaultProgress}
|
|
148
|
+
{...progressProps}
|
|
149
|
+
{...item.progressProps}
|
|
150
|
+
/>
|
|
151
|
+
</div>
|
|
152
|
+
{/if}
|
|
153
|
+
</div>
|
|
154
|
+
</div>
|
|
155
|
+
{#if showAfter}
|
|
156
|
+
<div class="neo-notification-actions" class:neo-rounded={rounded} transition:scaleWidth={quickDurationProps}>
|
|
157
|
+
{#if item.close ?? close}
|
|
158
|
+
<NeoCloseButton
|
|
159
|
+
rounded
|
|
160
|
+
text
|
|
161
|
+
size="md"
|
|
162
|
+
inline={notifSize === 'sm'}
|
|
163
|
+
aria-label="Close notification"
|
|
164
|
+
title="Close"
|
|
165
|
+
transition={{ use: scale, props: quickDurationProps }}
|
|
166
|
+
{...closeProps}
|
|
167
|
+
{...item.closeProps}
|
|
168
|
+
onclick={onCloseButton}
|
|
169
|
+
class={['neo-notification-close-button', closeProps?.class, item.closeProps?.class]}
|
|
170
|
+
/>
|
|
171
|
+
{/if}
|
|
172
|
+
{#if item.actionProps || actionProps}
|
|
173
|
+
<NeoButton
|
|
174
|
+
{rounded}
|
|
175
|
+
elevation={0}
|
|
176
|
+
aria-label="Notification action"
|
|
177
|
+
title="Action"
|
|
178
|
+
label="action"
|
|
179
|
+
transition={{ use: scale, props: quickDurationProps }}
|
|
180
|
+
{...actionProps}
|
|
181
|
+
{...item.actionProps}
|
|
182
|
+
class={['neo-notification-action-button', actionProps?.class, item.actionProps?.class]}
|
|
183
|
+
onclick={onActionButton}
|
|
184
|
+
/>
|
|
185
|
+
{/if}
|
|
186
|
+
{#if item.after ?? after}
|
|
187
|
+
{@render (item.after ?? after)?.(item)}
|
|
188
|
+
{/if}
|
|
189
|
+
</div>
|
|
190
|
+
{/if}
|
|
191
|
+
</svelte:element>
|
|
192
|
+
|
|
193
|
+
<style>.neo-notification {
|
|
194
|
+
display: grid;
|
|
195
|
+
grid-template-columns: auto 1fr;
|
|
196
|
+
align-items: center;
|
|
197
|
+
justify-content: space-between;
|
|
198
|
+
width: 100%;
|
|
199
|
+
height: 100%;
|
|
200
|
+
}
|
|
201
|
+
.neo-notification :global(.neo-notification-close-button) {
|
|
202
|
+
margin-bottom: auto;
|
|
203
|
+
opacity: 0.5;
|
|
204
|
+
transition: opacity 0.3s ease;
|
|
205
|
+
transition-duration: 0.6s;
|
|
206
|
+
}
|
|
207
|
+
.neo-notification.neo-rounded {
|
|
208
|
+
padding-inline: var(--neo-gap-3xs, 0.3125rem);
|
|
209
|
+
}
|
|
210
|
+
.neo-notification-body {
|
|
211
|
+
display: flex;
|
|
212
|
+
flex: 1 1 auto;
|
|
213
|
+
width: max-content;
|
|
214
|
+
min-width: min(10rem, 80vw);
|
|
215
|
+
max-width: calc(100vw - 2rem);
|
|
216
|
+
padding: var(--neo-notification-padding, var(--neo-gap-xxs, 0.5rem));
|
|
217
|
+
transition: padding 0.3s ease;
|
|
218
|
+
}
|
|
219
|
+
.neo-notification-body.neo-after {
|
|
220
|
+
padding-inline-end: 0;
|
|
221
|
+
}
|
|
222
|
+
.neo-notification-before {
|
|
223
|
+
display: flex;
|
|
224
|
+
flex: 0 0 auto;
|
|
225
|
+
align-items: center;
|
|
226
|
+
justify-content: center;
|
|
227
|
+
margin-inline-end: var(--neo-gap-xxs, 0.5rem);
|
|
228
|
+
}
|
|
229
|
+
.neo-notification-text {
|
|
230
|
+
display: flex;
|
|
231
|
+
flex: 1 1 auto;
|
|
232
|
+
flex-direction: column;
|
|
233
|
+
gap: var(--neo-gap-5xs, 0.125rem);
|
|
234
|
+
}
|
|
235
|
+
.neo-notification-title {
|
|
236
|
+
font-weight: var(--neo-font-weight-xxl, 800);
|
|
237
|
+
}
|
|
238
|
+
.neo-notification-subtitle {
|
|
239
|
+
font-weight: var(--neo-font-weight-md, 500);
|
|
240
|
+
}
|
|
241
|
+
.neo-notification-subtitle, .neo-notification-content {
|
|
242
|
+
color: var(--neo-notification-color, var(--neo-text-color-secondary));
|
|
243
|
+
font-size: var(--neo-font-size-sm, 0.875rem);
|
|
244
|
+
line-height: var(--neo-line-height-sm, 1.25rem);
|
|
245
|
+
white-space: pre-line;
|
|
246
|
+
}
|
|
247
|
+
.neo-notification-title, .neo-notification-subtitle, .neo-notification-content {
|
|
248
|
+
transition: color 0.6s ease;
|
|
249
|
+
}
|
|
250
|
+
.neo-notification:hover :global(.neo-notification-close-button), .neo-notification:active :global(.neo-notification-close-button), .neo-notification:focus :global(.neo-notification-close-button), .neo-notification:focus-within :global(.neo-notification-close-button), .neo-notification:focus-visible :global(.neo-notification-close-button) {
|
|
251
|
+
opacity: 1;
|
|
252
|
+
transition-delay: 0s;
|
|
253
|
+
}
|
|
254
|
+
.neo-notification:hover .neo-notification-subtitle,
|
|
255
|
+
.neo-notification:hover .neo-notification-content, .neo-notification:active .neo-notification-subtitle,
|
|
256
|
+
.neo-notification:active .neo-notification-content, .neo-notification:focus .neo-notification-subtitle,
|
|
257
|
+
.neo-notification:focus .neo-notification-content, .neo-notification:focus-within .neo-notification-subtitle,
|
|
258
|
+
.neo-notification:focus-within .neo-notification-content, .neo-notification:focus-visible .neo-notification-subtitle,
|
|
259
|
+
.neo-notification:focus-visible .neo-notification-content {
|
|
260
|
+
color: var(--neo-notification-color-highlight, var(--neo-text-color-secondary-highlight));
|
|
261
|
+
}
|
|
262
|
+
.neo-notification-actions {
|
|
263
|
+
display: flex;
|
|
264
|
+
flex-direction: column;
|
|
265
|
+
align-items: flex-end;
|
|
266
|
+
justify-content: space-around;
|
|
267
|
+
height: 100%;
|
|
268
|
+
min-height: var(--neo-notification-height, strech);
|
|
269
|
+
transition: margin 0.3s ease;
|
|
270
|
+
}
|
|
271
|
+
.neo-notification-actions.neo-rounded :global(.neo-notification-close-button) {
|
|
272
|
+
margin-right: var(--neo-gap-xxs, 0.25rem);
|
|
273
|
+
}
|
|
274
|
+
.neo-notification-progress {
|
|
275
|
+
margin-top: var(--neo-gap-4xs, 0.25rem);
|
|
276
|
+
}
|
|
277
|
+
.neo-notification[data-size=sm] :global(.neo-notification-close-button) {
|
|
278
|
+
margin-left: var(--neo-gap-4xs, 0.25rem);
|
|
279
|
+
}
|
|
280
|
+
.neo-notification[data-size=sm].neo-rounded :global(.neo-notification-close-button) {
|
|
281
|
+
margin-top: auto;
|
|
282
|
+
margin-right: var(--neo-gap-5xs, 0.125rem);
|
|
283
|
+
}
|
|
284
|
+
.neo-notification[data-size=md] .neo-notification-body {
|
|
285
|
+
padding: var(--neo-notification-padding, var(--neo-gap-xxs, 0.5rem) var(--neo-gap-xs, 0.625rem));
|
|
286
|
+
}
|
|
287
|
+
.neo-notification[data-size=md] .neo-notification-body.neo-after {
|
|
288
|
+
padding-inline-end: 0;
|
|
289
|
+
}
|
|
290
|
+
.neo-notification[data-size=md] .neo-notification-before {
|
|
291
|
+
margin-inline-end: var(--neo-gap-xs, 0.625rem);
|
|
292
|
+
}
|
|
293
|
+
.neo-notification[data-size=lg] :global(.neo-close-button) {
|
|
294
|
+
--neo-btn-close-margin: var(--neo-gap-xs, 0.625rem);
|
|
295
|
+
}
|
|
296
|
+
.neo-notification[data-size=lg] .neo-notification-body {
|
|
297
|
+
padding: var(--neo-notification-padding, var(--neo-gap-xxs, 0.5rem) var(--neo-gap-sm, 0.75rem));
|
|
298
|
+
}
|
|
299
|
+
.neo-notification[data-size=lg] .neo-notification-body.neo-after {
|
|
300
|
+
padding-inline-end: 0;
|
|
301
|
+
}
|
|
302
|
+
.neo-notification[data-size=lg] .neo-notification-before {
|
|
303
|
+
margin-inline-end: var(--neo-gap-sm, 0.75rem);
|
|
304
|
+
}</style>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { NeoSimpleNotificationProps } from './neo-simple-notification.model.js';
|
|
2
|
+
declare const NeoSimpleNotification: import("svelte").Component<NeoSimpleNotificationProps<"div">, {}, "height" | "ref" | "bar">;
|
|
3
|
+
type NeoSimpleNotification = ReturnType<typeof NeoSimpleNotification>;
|
|
4
|
+
export default NeoSimpleNotification;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './neo-notification-stack.model.js';
|
|
2
|
+
export * from './neo-notification.model.js';
|
|
3
|
+
export * from './neo-simple-notification.model.js';
|
|
4
|
+
export type * from './neo-notification-provider.model.js';
|
|
5
|
+
export { useNotificationService } from './neo-notification-provider.model.js';
|
|
6
|
+
export { default as NeoNotificationProvider } from './NeoNotificationProvider.svelte';
|
|
7
|
+
export { default as NeoNotificationStack } from './NeoNotificationStack.svelte';
|
|
8
|
+
export { default as NeoSimpleNotification } from './NeoSimpleNotification.svelte';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './neo-notification-stack.model.js';
|
|
2
|
+
export * from './neo-notification.model.js';
|
|
3
|
+
export * from './neo-simple-notification.model.js';
|
|
4
|
+
export { useNotificationService } from './neo-notification-provider.model.js';
|
|
5
|
+
export { default as NeoNotificationProvider } from './NeoNotificationProvider.svelte';
|
|
6
|
+
export { default as NeoNotificationStack } from './NeoNotificationStack.svelte';
|
|
7
|
+
export { default as NeoSimpleNotification } from './NeoSimpleNotification.svelte';
|