@qw-ui/core 0.3.0-next.8 → 0.3.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 +21 -37
- package/dist/action-sheet/action-sheet.d.ts +110 -0
- package/dist/action-sheet/index.d.ts +2 -0
- package/dist/action-sheet/index.js +2 -0
- package/dist/action-sheet-Cvcr1S_m.js +183 -0
- package/dist/action-sheet-Cvcr1S_m.js.map +1 -0
- package/dist/area-picker/area-picker.d.ts +113 -0
- package/dist/area-picker/index.d.ts +1 -0
- package/dist/area-picker/index.js +348 -0
- package/dist/area-picker/index.js.map +1 -0
- package/dist/aria-description-CimD2M_C.js +13 -0
- package/dist/aria-description-CimD2M_C.js.map +1 -0
- package/dist/aria-description.d.ts +2 -0
- package/dist/avatar/avatar-load.d.ts +76 -0
- package/dist/avatar/avatar.d.ts +22 -5
- package/dist/avatar/index.d.ts +1 -0
- package/dist/avatar/index.js +57 -18
- package/dist/avatar/index.js.map +1 -1
- package/dist/avatar-load-w9dq05oV.js +139 -0
- package/dist/avatar-load-w9dq05oV.js.map +1 -0
- package/dist/back-top/back-top.d.ts +77 -0
- package/dist/back-top/index.d.ts +1 -0
- package/dist/back-top/index.js +189 -0
- package/dist/back-top/index.js.map +1 -0
- package/dist/badge/badge.d.ts +85 -0
- package/dist/badge/index.d.ts +1 -0
- package/dist/badge/index.js +88 -0
- package/dist/badge/index.js.map +1 -0
- package/dist/button/button.d.ts +13 -0
- package/dist/button/index.js +3 -5
- package/dist/button/index.js.map +1 -1
- package/dist/calendar/calendar.d.ts +100 -0
- package/dist/calendar/index.d.ts +1 -0
- package/dist/calendar/index.js +2 -0
- package/dist/calendar-CmpK3stz.js +363 -0
- package/dist/calendar-CmpK3stz.js.map +1 -0
- package/dist/card/card.d.ts +68 -0
- package/dist/card/index.d.ts +2 -0
- package/dist/card/index.js +2 -0
- package/dist/card-DRtWa6Cr.js +107 -0
- package/dist/card-DRtWa6Cr.js.map +1 -0
- package/dist/cascader/cascader.d.ts +115 -0
- package/dist/cascader/index.d.ts +1 -0
- package/dist/cascader/index.js +2 -0
- package/dist/cascader-D-xMjs7P.js +333 -0
- package/dist/cascader-D-xMjs7P.js.map +1 -0
- package/dist/cell/cell.d.ts +41 -0
- package/dist/cell/index.d.ts +1 -0
- package/dist/cell/index.js +43 -0
- package/dist/cell/index.js.map +1 -0
- package/dist/check-list/check-list.d.ts +78 -0
- package/dist/check-list/index.d.ts +2 -0
- package/dist/check-list/index.js +2 -0
- package/dist/check-list-BvZHQt5w.js +60 -0
- package/dist/check-list-BvZHQt5w.js.map +1 -0
- package/dist/checkbox/checkbox.d.ts +59 -0
- package/dist/checkbox/index.d.ts +2 -0
- package/dist/checkbox/index.js +2 -0
- package/dist/checkbox-BlndJrz5.js +127 -0
- package/dist/checkbox-BlndJrz5.js.map +1 -0
- package/dist/checkbox-group/checkbox-group.d.ts +86 -0
- package/dist/checkbox-group/index.d.ts +3 -0
- package/dist/checkbox-group/index.js +2 -0
- package/dist/checkbox-group-gGfsTv-e.js +223 -0
- package/dist/checkbox-group-gGfsTv-e.js.map +1 -0
- package/dist/choice-group-C4c9m0qe.js +373 -0
- package/dist/choice-group-C4c9m0qe.js.map +1 -0
- package/dist/circle/circle.d.ts +97 -0
- package/dist/circle/index.d.ts +1 -0
- package/dist/circle/index.js +119 -0
- package/dist/circle/index.js.map +1 -0
- package/dist/collapse/collapse.d.ts +98 -0
- package/dist/collapse/index.d.ts +2 -0
- package/dist/collapse/index.js +2 -0
- package/dist/collapse-B969h7-H.js +226 -0
- package/dist/collapse-B969h7-H.js.map +1 -0
- package/dist/countdown/countdown.d.ts +114 -0
- package/dist/countdown/index.d.ts +1 -0
- package/dist/countdown/index.js +309 -0
- package/dist/countdown/index.js.map +1 -0
- package/dist/date-picker/date-picker.d.ts +168 -0
- package/dist/date-picker/index.d.ts +1 -0
- package/dist/date-picker/index.js +401 -0
- package/dist/date-picker/index.js.map +1 -0
- package/dist/descriptions/descriptions.d.ts +69 -0
- package/dist/descriptions/index.d.ts +1 -0
- package/dist/descriptions/index.js +86 -0
- package/dist/descriptions/index.js.map +1 -0
- package/dist/dialog/dialog.d.ts +61 -43
- package/dist/dialog/index.js +73 -19
- package/dist/dialog/index.js.map +1 -1
- package/dist/divider/divider.d.ts +18 -2
- package/dist/divider/index.js +20 -2
- package/dist/divider/index.js.map +1 -1
- package/dist/dropdown/dropdown.d.ts +172 -0
- package/dist/dropdown/index.d.ts +2 -0
- package/dist/dropdown/index.js +467 -0
- package/dist/dropdown/index.js.map +1 -0
- package/dist/ellipsis/ellipsis-layout.d.ts +34 -0
- package/dist/ellipsis/ellipsis.d.ts +88 -0
- package/dist/ellipsis/index.d.ts +2 -0
- package/dist/ellipsis/index.js +320 -0
- package/dist/ellipsis/index.js.map +1 -0
- package/dist/empty/empty-illustration.d.ts +3 -0
- package/dist/empty/empty.d.ts +43 -1
- package/dist/empty/index.js +2 -21
- package/dist/empty-CAgyvhUI.js +166 -0
- package/dist/empty-CAgyvhUI.js.map +1 -0
- package/dist/field/field.d.ts +95 -0
- package/dist/field/index.d.ts +2 -0
- package/dist/field/index.js +2 -0
- package/dist/field-DMHGIMZF.js +241 -0
- package/dist/field-DMHGIMZF.js.map +1 -0
- package/dist/floating-bubble/floating-bubble.d.ts +116 -0
- package/dist/floating-bubble/index.d.ts +1 -0
- package/dist/floating-bubble/index.js +333 -0
- package/dist/floating-bubble/index.js.map +1 -0
- package/dist/floating-panel/floating-panel.d.ts +80 -0
- package/dist/floating-panel/index.d.ts +2 -0
- package/dist/floating-panel/index.js +2 -0
- package/dist/floating-panel-Cbm5njBJ.js +363 -0
- package/dist/floating-panel-Cbm5njBJ.js.map +1 -0
- package/dist/footer/footer.d.ts +94 -0
- package/dist/footer/index.d.ts +1 -0
- package/dist/footer/index.js +154 -0
- package/dist/footer/index.js.map +1 -0
- package/dist/form/connect.d.ts +6 -0
- package/dist/form/form.d.ts +100 -0
- package/dist/form/ids.d.ts +14 -0
- package/dist/form/index.d.ts +13 -0
- package/dist/form/index.js +3 -0
- package/dist/form/methods.d.ts +5 -0
- package/dist/form/model.d.ts +24 -0
- package/dist/form/native.d.ts +25 -0
- package/dist/form/rules.d.ts +40 -0
- package/dist/form/ssr.d.ts +7 -0
- package/dist/form/types.d.ts +150 -0
- package/dist/form-BAGkIEMY.js +1354 -0
- package/dist/form-BAGkIEMY.js.map +1 -0
- package/dist/format-BDUY0C_c.js +89 -0
- package/dist/format-BDUY0C_c.js.map +1 -0
- package/dist/gesture-_SRHIvBm.js +30 -0
- package/dist/gesture-_SRHIvBm.js.map +1 -0
- package/dist/grid/grid-item.d.ts +22 -0
- package/dist/grid/grid.d.ts +42 -0
- package/dist/grid/index.d.ts +2 -0
- package/dist/grid/index.js +73 -0
- package/dist/grid/index.js.map +1 -0
- package/dist/icon/icon.d.ts +37 -1
- package/dist/icon/identity.d.ts +3 -0
- package/dist/icon/index.js +2 -20
- package/dist/icon-Cgdbnk1u.js +77 -0
- package/dist/icon-Cgdbnk1u.js.map +1 -0
- package/dist/image/image-load.d.ts +24 -0
- package/dist/image/image.d.ts +45 -8
- package/dist/image/index.d.ts +1 -0
- package/dist/image/index.js +116 -14
- package/dist/image/index.js.map +1 -1
- package/dist/image-preview/image-preview.d.ts +124 -0
- package/dist/image-preview/index.d.ts +1 -0
- package/dist/image-preview/index.js +450 -0
- package/dist/image-preview/index.js.map +1 -0
- package/dist/index-bar/index-bar.d.ts +121 -0
- package/dist/index-bar/index.d.ts +1 -0
- package/dist/index-bar/index.js +386 -0
- package/dist/index-bar/index.js.map +1 -0
- package/dist/index.d.ts +115 -10
- package/dist/index.js +151 -11
- package/dist/index.js.map +1 -0
- package/dist/infinite-scroll/index.d.ts +1 -0
- package/dist/infinite-scroll/index.js +248 -0
- package/dist/infinite-scroll/index.js.map +1 -0
- package/dist/infinite-scroll/infinite-scroll.d.ts +95 -0
- package/dist/input/index.js +181 -22
- package/dist/input/index.js.map +1 -1
- package/dist/input/input.d.ts +44 -1
- package/dist/layer-IpFrl5--.js +414 -0
- package/dist/layer-IpFrl5--.js.map +1 -0
- package/dist/layout-BRSqi4AQ.js +43 -0
- package/dist/layout-BRSqi4AQ.js.map +1 -0
- package/dist/layout.d.ts +13 -0
- package/dist/list/index.d.ts +2 -0
- package/dist/list/index.js +2 -0
- package/dist/list/list.d.ts +30 -0
- package/dist/list-6-iz-Irh.js +28 -0
- package/dist/list-6-iz-Irh.js.map +1 -0
- package/dist/loading/index.js +45 -2
- package/dist/loading/index.js.map +1 -1
- package/dist/loading/loading.d.ts +45 -2
- package/dist/modal-dialog-machine-CF9_z3Dm.js +487 -0
- package/dist/modal-dialog-machine-CF9_z3Dm.js.map +1 -0
- package/dist/modal-dialog-machine.d.ts +21 -0
- package/dist/modal-dismissable-lifetime.d.ts +21 -0
- package/dist/modal-registry.d.ts +24 -0
- package/dist/modal-render-hydration.d.ts +35 -0
- package/dist/modal-render-runtime.d.ts +19 -0
- package/dist/modal-render-scope.d.ts +63 -0
- package/dist/nav-bar/index.d.ts +1 -0
- package/dist/nav-bar/index.js +115 -0
- package/dist/nav-bar/index.js.map +1 -0
- package/dist/nav-bar/nav-bar.d.ts +76 -0
- package/dist/notice-bar/index.d.ts +2 -0
- package/dist/notice-bar/index.js +2 -0
- package/dist/notice-bar/notice-bar.d.ts +103 -0
- package/dist/notice-bar-DMpwLvRb.js +231 -0
- package/dist/notice-bar-DMpwLvRb.js.map +1 -0
- package/dist/notify/index.d.ts +1 -0
- package/dist/notify/index.js +251 -0
- package/dist/notify/index.js.map +1 -0
- package/dist/notify/notify.d.ts +123 -0
- package/dist/number-keyboard/index.d.ts +1 -0
- package/dist/number-keyboard/index.js +333 -0
- package/dist/number-keyboard/index.js.map +1 -0
- package/dist/number-keyboard/number-keyboard.d.ts +141 -0
- package/dist/overlay-panel/index.d.ts +2 -0
- package/dist/overlay-panel/index.js +2 -0
- package/dist/overlay-panel/overlay-panel.d.ts +20 -0
- package/dist/overlay-panel-Z_qdKeBj.js +26 -0
- package/dist/overlay-panel-Z_qdKeBj.js.map +1 -0
- package/dist/page-indicator/index.d.ts +1 -0
- package/dist/page-indicator/index.js +138 -0
- package/dist/page-indicator/index.js.map +1 -0
- package/dist/page-indicator/page-indicator.d.ts +93 -0
- package/dist/pagination/index.d.ts +1 -0
- package/dist/pagination/index.js +198 -0
- package/dist/pagination/index.js.map +1 -0
- package/dist/pagination/pagination.d.ts +125 -0
- package/dist/password-input/index.d.ts +1 -0
- package/dist/password-input/index.js +317 -0
- package/dist/password-input/index.js.map +1 -0
- package/dist/password-input/password-input.d.ts +144 -0
- package/dist/picker/index.d.ts +8 -0
- package/dist/picker/index.js +2 -0
- package/dist/picker/picker-machine.d.ts +80 -0
- package/dist/picker/picker.d.ts +121 -0
- package/dist/picker/platform.d.ts +84 -0
- package/dist/picker/selection-connect.d.ts +90 -0
- package/dist/picker/selection-model.d.ts +211 -0
- package/dist/picker-BykFntQN.js +1675 -0
- package/dist/picker-BykFntQN.js.map +1 -0
- package/dist/popover/index.d.ts +3 -0
- package/dist/popover/index.js +253 -0
- package/dist/popover/index.js.map +1 -0
- package/dist/popover/layer.d.ts +44 -0
- package/dist/popover/popover.d.ts +104 -0
- package/dist/popover/positioning.d.ts +132 -0
- package/dist/popup/index.d.ts +2 -0
- package/dist/popup/index.js +2 -0
- package/dist/popup/popup.d.ts +60 -0
- package/dist/popup-z5d8IYCt.js +576 -0
- package/dist/popup-z5d8IYCt.js.map +1 -0
- package/dist/portal-BHCNTWhg.js +78 -0
- package/dist/portal-BHCNTWhg.js.map +1 -0
- package/dist/portal.d.ts +61 -0
- package/dist/price/format.d.ts +19 -0
- package/dist/price/index.d.ts +1 -0
- package/dist/price/index.js +154 -0
- package/dist/price/index.js.map +1 -0
- package/dist/price/price.d.ts +88 -0
- package/dist/progress/index.d.ts +1 -0
- package/dist/progress/index.js +2 -0
- package/dist/progress/progress.d.ts +32 -0
- package/dist/progress-f3iYEfdA.js +37 -0
- package/dist/progress-f3iYEfdA.js.map +1 -0
- package/dist/pull-refresh/index.d.ts +1 -0
- package/dist/pull-refresh/index.js +414 -0
- package/dist/pull-refresh/index.js.map +1 -0
- package/dist/pull-refresh/pull-refresh.d.ts +118 -0
- package/dist/radio-group/index.d.ts +3 -0
- package/dist/radio-group/index.js +2 -0
- package/dist/radio-group/radio-group.d.ts +78 -0
- package/dist/radio-group-BOIMuqnS.js +230 -0
- package/dist/radio-group-BOIMuqnS.js.map +1 -0
- package/dist/rate/index.d.ts +1 -0
- package/dist/rate/index.js +2 -0
- package/dist/rate/rate-form.d.ts +28 -0
- package/dist/rate/rate.d.ts +144 -0
- package/dist/rate-5XsU2QkY.js +631 -0
- package/dist/rate-5XsU2QkY.js.map +1 -0
- package/dist/reorder/index.d.ts +1 -0
- package/dist/reorder/index.js +720 -0
- package/dist/reorder/index.js.map +1 -0
- package/dist/reorder/reorder.d.ts +190 -0
- package/dist/result/index.d.ts +1 -0
- package/dist/result/index.js +123 -0
- package/dist/result/index.js.map +1 -0
- package/dist/result/result.d.ts +88 -0
- package/dist/safe-area/index.d.ts +1 -0
- package/dist/safe-area/index.js +42 -0
- package/dist/safe-area/index.js.map +1 -0
- package/dist/safe-area/safe-area.d.ts +28 -0
- package/dist/search-bar/index.js +4 -2
- package/dist/search-bar/index.js.map +1 -1
- package/dist/search-bar/search-bar.d.ts +6 -0
- package/dist/segmented/index.d.ts +2 -0
- package/dist/segmented/index.js +2 -0
- package/dist/segmented/segmented.d.ts +127 -0
- package/dist/segmented-BaU38_L4.js +367 -0
- package/dist/segmented-BaU38_L4.js.map +1 -0
- package/dist/selection-form-BOM_odUk.js +88 -0
- package/dist/selection-form-BOM_odUk.js.map +1 -0
- package/dist/selection-form.d.ts +27 -0
- package/dist/selection-ivXqO1eu.js +55 -0
- package/dist/selection-ivXqO1eu.js.map +1 -0
- package/dist/selection.d.ts +29 -0
- package/dist/selector/choice-group.d.ts +114 -0
- package/dist/selector/index.d.ts +2 -0
- package/dist/selector/index.js +2 -0
- package/dist/selector/selector.d.ts +90 -0
- package/dist/selector-BU2MMJ4N.js +93 -0
- package/dist/selector-BU2MMJ4N.js.map +1 -0
- package/dist/share-sheet/index.d.ts +1 -0
- package/dist/share-sheet/index.js +138 -0
- package/dist/share-sheet/index.js.map +1 -0
- package/dist/share-sheet/share-sheet.d.ts +139 -0
- package/dist/side-nav/index.d.ts +1 -0
- package/dist/side-nav/index.js +99 -0
- package/dist/side-nav/index.js.map +1 -0
- package/dist/side-nav/side-nav.d.ts +94 -0
- package/dist/skeleton/index.js +51 -2
- package/dist/skeleton/index.js.map +1 -1
- package/dist/skeleton/skeleton.d.ts +34 -3
- package/dist/slider/index.d.ts +1 -0
- package/dist/slider/index.js +482 -0
- package/dist/slider/index.js.map +1 -0
- package/dist/slider/slider.d.ts +174 -0
- package/dist/space/index.d.ts +1 -0
- package/dist/space/index.js +52 -0
- package/dist/space/index.js.map +1 -0
- package/dist/space/space.d.ts +46 -0
- package/dist/statistic/index.d.ts +1 -0
- package/dist/statistic/index.js +152 -0
- package/dist/statistic/index.js.map +1 -0
- package/dist/statistic/statistic.d.ts +101 -0
- package/dist/stepper/index.d.ts +1 -0
- package/dist/stepper/index.js +172 -0
- package/dist/stepper/index.js.map +1 -0
- package/dist/stepper/stepper.d.ts +161 -0
- package/dist/steps/index.d.ts +1 -0
- package/dist/steps/index.js +72 -0
- package/dist/steps/index.js.map +1 -0
- package/dist/steps/steps.d.ts +67 -0
- package/dist/sticky/index.d.ts +1 -0
- package/dist/sticky/index.js +145 -0
- package/dist/sticky/index.js.map +1 -0
- package/dist/sticky/sticky.d.ts +70 -0
- package/dist/swipe-action/index.d.ts +1 -0
- package/dist/swipe-action/index.js +417 -0
- package/dist/swipe-action/index.js.map +1 -0
- package/dist/swipe-action/swipe-action.d.ts +148 -0
- package/dist/swiper/gesture.d.ts +32 -0
- package/dist/swiper/index.d.ts +1 -0
- package/dist/swiper/index.js +2 -0
- package/dist/swiper/swiper.d.ts +177 -0
- package/dist/swiper-BKivDkHp.js +550 -0
- package/dist/swiper-BKivDkHp.js.map +1 -0
- package/dist/switch/index.d.ts +1 -0
- package/dist/switch/index.js +168 -0
- package/dist/switch/index.js.map +1 -0
- package/dist/switch/switch.d.ts +142 -0
- package/dist/tabbar/index.d.ts +1 -0
- package/dist/tabbar/index.js +95 -0
- package/dist/tabbar/index.js.map +1 -0
- package/dist/tabbar/tabbar.d.ts +119 -0
- package/dist/tabs/index.js +22 -1
- package/dist/tabs/index.js.map +1 -1
- package/dist/tabs/tabs.d.ts +12 -8
- package/dist/tag/index.js +123 -2
- package/dist/tag/index.js.map +1 -1
- package/dist/tag/tag.d.ts +67 -1
- package/dist/textarea/index.d.ts +2 -0
- package/dist/textarea/index.js +2 -242
- package/dist/textarea/platform.d.ts +22 -0
- package/dist/textarea/textarea.d.ts +169 -46
- package/dist/textarea-qbnruDUG.js +775 -0
- package/dist/textarea-qbnruDUG.js.map +1 -0
- package/dist/time-picker/index.d.ts +1 -0
- package/dist/time-picker/index.js +228 -0
- package/dist/time-picker/index.js.map +1 -0
- package/dist/time-picker/time-picker.d.ts +83 -0
- package/dist/timeline/index.d.ts +1 -0
- package/dist/timeline/index.js +131 -0
- package/dist/timeline/index.js.map +1 -0
- package/dist/timeline/timeline.d.ts +79 -0
- package/dist/toast/index.js +47 -4
- package/dist/toast/index.js.map +1 -1
- package/dist/toast/toast.d.ts +26 -3
- package/dist/top-bar/index.js +16 -2
- package/dist/top-bar/index.js.map +1 -1
- package/dist/top-bar/top-bar.d.ts +13 -2
- package/dist/tree-select/index.d.ts +1 -0
- package/dist/tree-select/index.js +512 -0
- package/dist/tree-select/index.js.map +1 -0
- package/dist/tree-select/tree-select.d.ts +215 -0
- package/dist/typography/index.d.ts +1 -0
- package/dist/typography/index.js +82 -0
- package/dist/typography/index.js.map +1 -0
- package/dist/typography/typography.d.ts +54 -0
- package/dist/upload/index.d.ts +1 -0
- package/dist/upload/index.js +458 -0
- package/dist/upload/index.js.map +1 -0
- package/dist/upload/upload.d.ts +172 -0
- package/dist/virtual-list/index.d.ts +1 -0
- package/dist/virtual-list/index.js +445 -0
- package/dist/virtual-list/index.js.map +1 -0
- package/dist/virtual-list/virtual-list.d.ts +160 -0
- package/dist/visual-manifest.d.ts +27 -0
- package/dist/watermark/index.d.ts +1 -0
- package/dist/watermark/index.js +260 -0
- package/dist/watermark/index.js.map +1 -0
- package/dist/watermark/watermark.d.ts +106 -0
- package/package.json +417 -44
- package/dist/empty/index.js.map +0 -1
- package/dist/icon/index.js.map +0 -1
- package/dist/textarea/index.js.map +0 -1
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import { o as resolveIconState } from "./icon-Cgdbnk1u.js";
|
|
2
|
+
import { createMachine } from "@zag-js/core";
|
|
3
|
+
import { addDomEvent, dataAttr } from "@zag-js/dom-query";
|
|
4
|
+
//#region src/notice-bar/notice-bar.ts
|
|
5
|
+
/** Existing T3 status roles. */
|
|
6
|
+
const NOTICE_BAR_TONES = [
|
|
7
|
+
"info",
|
|
8
|
+
"warning",
|
|
9
|
+
"danger",
|
|
10
|
+
"success"
|
|
11
|
+
];
|
|
12
|
+
/** Stable DOM parts shared by every adapter. */
|
|
13
|
+
const NOTICE_BAR_PARTS = [
|
|
14
|
+
"root",
|
|
15
|
+
"icon",
|
|
16
|
+
"content",
|
|
17
|
+
"text",
|
|
18
|
+
"extra",
|
|
19
|
+
"close"
|
|
20
|
+
];
|
|
21
|
+
const NOTICE_BAR_DEFAULT_SPEED = 50;
|
|
22
|
+
const NOTICE_BAR_DEFAULT_DELAY = 2e3;
|
|
23
|
+
function resolveNoticeBarSpeed(speed) {
|
|
24
|
+
return typeof speed === "number" && Number.isFinite(speed) && speed > 0 ? speed : 50;
|
|
25
|
+
}
|
|
26
|
+
function resolveNoticeBarDelay(delay) {
|
|
27
|
+
return typeof delay === "number" && Number.isFinite(delay) && delay >= 0 ? delay : NOTICE_BAR_DEFAULT_DELAY;
|
|
28
|
+
}
|
|
29
|
+
/** Pure marquee geometry: CSS variables for the current phase, or null when static. */
|
|
30
|
+
function resolveNoticeBarMarquee(phase, geometry, speed) {
|
|
31
|
+
if (phase === "idle") return null;
|
|
32
|
+
const from = phase === "first" ? 0 : geometry.container, distance = from + geometry.text;
|
|
33
|
+
return {
|
|
34
|
+
from,
|
|
35
|
+
to: -geometry.text,
|
|
36
|
+
duration: Math.max(distance / resolveNoticeBarSpeed(speed), .001)
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
function createNoticeBarProps(props) {
|
|
40
|
+
if (typeof props.content !== "string" || !props.content.trim()) throw new TypeError("NoticeBar requires nonempty content text");
|
|
41
|
+
if (props.id !== void 0 && (typeof props.id !== "string" || !props.id.trim())) throw new TypeError("NoticeBar requires a nonempty instance id when provided");
|
|
42
|
+
return {
|
|
43
|
+
...props,
|
|
44
|
+
tone: NOTICE_BAR_TONES.includes(props.tone) ? props.tone : "warning",
|
|
45
|
+
icon: props.icon || "info",
|
|
46
|
+
showIcon: props.showIcon ?? true,
|
|
47
|
+
speed: resolveNoticeBarSpeed(props.speed),
|
|
48
|
+
delay: resolveNoticeBarDelay(props.delay),
|
|
49
|
+
closeLabel: props.closeLabel?.trim() ? props.closeLabel : "关闭",
|
|
50
|
+
defaultOpen: props.defaultOpen ?? true
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
const rootId = (service) => `notice-bar:${service.scope.id}`;
|
|
54
|
+
const contentId = (service) => `${rootId(service)}:content`;
|
|
55
|
+
const textId = (service) => `${rootId(service)}:text`;
|
|
56
|
+
const sameGeometry = (a, b) => !!b && a.container === b.container && a.text === b.text;
|
|
57
|
+
/** Core owns close requests, overflow measurement, reduced-motion reads, delay timer and phase changes. */
|
|
58
|
+
const noticeBarMachine = createMachine({
|
|
59
|
+
props: ({ props }) => createNoticeBarProps({
|
|
60
|
+
...props,
|
|
61
|
+
content: props.content ?? ""
|
|
62
|
+
}),
|
|
63
|
+
initialState: () => "ready",
|
|
64
|
+
context({ prop, bindable }) {
|
|
65
|
+
return {
|
|
66
|
+
open: bindable(() => ({
|
|
67
|
+
defaultValue: prop("defaultOpen"),
|
|
68
|
+
value: prop("open"),
|
|
69
|
+
onChange: (open) => {
|
|
70
|
+
if (!open) prop("onClose")?.();
|
|
71
|
+
}
|
|
72
|
+
})),
|
|
73
|
+
overflow: bindable(() => ({ defaultValue: false })),
|
|
74
|
+
reduced: bindable(() => ({ defaultValue: false })),
|
|
75
|
+
phase: bindable(() => ({ defaultValue: "idle" })),
|
|
76
|
+
geometry: bindable(() => ({
|
|
77
|
+
defaultValue: {
|
|
78
|
+
container: 0,
|
|
79
|
+
text: 0
|
|
80
|
+
},
|
|
81
|
+
isEqual: sameGeometry
|
|
82
|
+
}))
|
|
83
|
+
};
|
|
84
|
+
},
|
|
85
|
+
watch({ track, prop, action }) {
|
|
86
|
+
track([
|
|
87
|
+
() => prop("content"),
|
|
88
|
+
() => prop("marquee"),
|
|
89
|
+
() => prop("wrap"),
|
|
90
|
+
() => prop("delay"),
|
|
91
|
+
() => prop("speed")
|
|
92
|
+
], () => action(["restart"]));
|
|
93
|
+
},
|
|
94
|
+
on: { CLOSE: { actions: ["close"] } },
|
|
95
|
+
states: { ready: {
|
|
96
|
+
effects: ["trackLayout"],
|
|
97
|
+
on: { "LAYOUT.RESET": {
|
|
98
|
+
target: "ready",
|
|
99
|
+
reenter: true,
|
|
100
|
+
actions: ["resetPhase"]
|
|
101
|
+
} }
|
|
102
|
+
} },
|
|
103
|
+
implementations: {
|
|
104
|
+
actions: {
|
|
105
|
+
close({ context }) {
|
|
106
|
+
context.set("open", false);
|
|
107
|
+
},
|
|
108
|
+
restart({ send }) {
|
|
109
|
+
send({ type: "LAYOUT.RESET" });
|
|
110
|
+
},
|
|
111
|
+
resetPhase({ context }) {
|
|
112
|
+
context.set("phase", "idle");
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
effects: { trackLayout(params) {
|
|
116
|
+
const { scope, context, prop } = params;
|
|
117
|
+
const win = scope.getWin();
|
|
118
|
+
const cleanups = [];
|
|
119
|
+
const reduced = typeof win.matchMedia === "function" ? win.matchMedia("(prefers-reduced-motion: reduce)") : void 0;
|
|
120
|
+
const readReduced = () => context.set("reduced", !!reduced?.matches);
|
|
121
|
+
readReduced();
|
|
122
|
+
if (reduced?.addEventListener) {
|
|
123
|
+
reduced.addEventListener("change", readReduced);
|
|
124
|
+
cleanups.push(() => reduced.removeEventListener("change", readReduced));
|
|
125
|
+
}
|
|
126
|
+
const measure = () => {
|
|
127
|
+
const container = scope.getById(contentId(params)), text = scope.getById(textId(params));
|
|
128
|
+
if (!container || !text) return;
|
|
129
|
+
const width = container.clientWidth;
|
|
130
|
+
context.set("geometry", {
|
|
131
|
+
container: width,
|
|
132
|
+
text: Math.ceil(text.getBoundingClientRect().width)
|
|
133
|
+
});
|
|
134
|
+
context.set("overflow", container.scrollWidth > width + 1);
|
|
135
|
+
};
|
|
136
|
+
measure();
|
|
137
|
+
if (typeof win.ResizeObserver === "function") {
|
|
138
|
+
const observer = new win.ResizeObserver(() => measure());
|
|
139
|
+
for (const id of [contentId(params), textId(params)]) {
|
|
140
|
+
const element = scope.getById(id);
|
|
141
|
+
if (element) observer.observe(element);
|
|
142
|
+
}
|
|
143
|
+
cleanups.push(() => observer.disconnect());
|
|
144
|
+
}
|
|
145
|
+
if (prop("marquee") && !prop("wrap")) {
|
|
146
|
+
const timer = win.setTimeout(() => {
|
|
147
|
+
measure();
|
|
148
|
+
context.set("phase", "first");
|
|
149
|
+
}, prop("delay"));
|
|
150
|
+
cleanups.push(() => win.clearTimeout(timer));
|
|
151
|
+
const text = scope.getById(textId(params));
|
|
152
|
+
if (text) cleanups.push(addDomEvent(text, "animationend", (event) => {
|
|
153
|
+
if (event.target === text && context.get("phase") === "first") context.set("phase", "loop");
|
|
154
|
+
}));
|
|
155
|
+
}
|
|
156
|
+
return () => {
|
|
157
|
+
cleanups.splice(0).forEach((cleanup) => cleanup());
|
|
158
|
+
};
|
|
159
|
+
} }
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
/** SSR-pure getters. Without measurement SSR renders the static, complete text. */
|
|
163
|
+
function connectNoticeBar(service, normalize) {
|
|
164
|
+
const id = rootId(service), open = service.context.get("open"), overflow = service.context.get("overflow"), reduced = service.context.get("reduced");
|
|
165
|
+
const wrap = !!service.prop("wrap") || !!service.prop("marquee") && reduced;
|
|
166
|
+
const motion = !!service.prop("marquee") && !wrap && overflow ? resolveNoticeBarMarquee(service.context.get("phase"), service.context.get("geometry"), service.prop("speed")) : null;
|
|
167
|
+
const part = (name) => ({
|
|
168
|
+
"data-scope": "notice-bar",
|
|
169
|
+
"data-part": name
|
|
170
|
+
});
|
|
171
|
+
return {
|
|
172
|
+
open,
|
|
173
|
+
content: service.prop("content"),
|
|
174
|
+
tone: service.prop("tone"),
|
|
175
|
+
overflow,
|
|
176
|
+
scrolling: !!motion,
|
|
177
|
+
close: () => service.send({ type: "CLOSE" }),
|
|
178
|
+
getRootProps: () => normalize.element({
|
|
179
|
+
...part("root"),
|
|
180
|
+
id,
|
|
181
|
+
hidden: !open,
|
|
182
|
+
"data-tone": service.prop("tone"),
|
|
183
|
+
"data-wrap": dataAttr(wrap),
|
|
184
|
+
"data-overflow": dataAttr(overflow),
|
|
185
|
+
"data-marquee": dataAttr(!!service.prop("marquee")),
|
|
186
|
+
"data-reduced-motion": dataAttr(reduced)
|
|
187
|
+
}),
|
|
188
|
+
getIconProps: () => normalize.element({
|
|
189
|
+
...part("icon"),
|
|
190
|
+
"aria-hidden": true,
|
|
191
|
+
hidden: !service.prop("showIcon")
|
|
192
|
+
}),
|
|
193
|
+
getIconState: () => resolveIconState({
|
|
194
|
+
id: `${id}:icon`,
|
|
195
|
+
name: service.prop("icon")
|
|
196
|
+
}),
|
|
197
|
+
getContentProps: () => normalize.element({
|
|
198
|
+
...part("content"),
|
|
199
|
+
id: contentId(service)
|
|
200
|
+
}),
|
|
201
|
+
getTextProps: () => normalize.element({
|
|
202
|
+
...part("text"),
|
|
203
|
+
id: textId(service),
|
|
204
|
+
"data-phase": motion ? service.context.get("phase") : void 0,
|
|
205
|
+
style: motion ? {
|
|
206
|
+
"--qw-notice-bar-from": `${motion.from}px`,
|
|
207
|
+
"--qw-notice-bar-to": `${motion.to}px`,
|
|
208
|
+
"--qw-notice-bar-duration": `${motion.duration}s`
|
|
209
|
+
} : void 0
|
|
210
|
+
}),
|
|
211
|
+
getExtraProps: () => normalize.element(part("extra")),
|
|
212
|
+
getCloseProps: () => normalize.button({
|
|
213
|
+
...part("close"),
|
|
214
|
+
type: "button",
|
|
215
|
+
hidden: !service.prop("closeable"),
|
|
216
|
+
"aria-label": service.prop("closeLabel"),
|
|
217
|
+
"aria-controls": id,
|
|
218
|
+
onClick(event) {
|
|
219
|
+
if (!event.defaultPrevented) service.send({ type: "CLOSE" });
|
|
220
|
+
}
|
|
221
|
+
}),
|
|
222
|
+
getCloseIconState: () => resolveIconState({
|
|
223
|
+
id: `${id}:close`,
|
|
224
|
+
name: "close"
|
|
225
|
+
})
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
//#endregion
|
|
229
|
+
export { connectNoticeBar as a, resolveNoticeBarDelay as c, NOTICE_BAR_TONES as i, resolveNoticeBarMarquee as l, NOTICE_BAR_DEFAULT_SPEED as n, createNoticeBarProps as o, NOTICE_BAR_PARTS as r, noticeBarMachine as s, NOTICE_BAR_DEFAULT_DELAY as t, resolveNoticeBarSpeed as u };
|
|
230
|
+
|
|
231
|
+
//# sourceMappingURL=notice-bar-DMpwLvRb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notice-bar-DMpwLvRb.js","names":[],"sources":["../src/notice-bar/notice-bar.ts"],"sourcesContent":["import { createMachine, type Machine, type Service } from \"@zag-js/core\";\nimport { addDomEvent, dataAttr } from \"@zag-js/dom-query\";\nimport type { NormalizeProps, PropTypes } from \"@zag-js/types\";\nimport { resolveIconState, type IconNameInput, type IconState } from \"../icon/index.js\";\n\n/** Existing T3 status roles. */\nexport const NOTICE_BAR_TONES = [\"info\", \"warning\", \"danger\", \"success\"] as const;\n/** Stable DOM parts shared by every adapter. */\nexport const NOTICE_BAR_PARTS = [\"root\", \"icon\", \"content\", \"text\", \"extra\", \"close\"] as const;\nexport const NOTICE_BAR_DEFAULT_SPEED = 50;\nexport const NOTICE_BAR_DEFAULT_DELAY = 2000;\nexport type NoticeBarTone = (typeof NOTICE_BAR_TONES)[number];\nexport type NoticeBarPart = (typeof NOTICE_BAR_PARTS)[number];\n/** idle: static/waiting; first: 0 → −text; loop: container → −text, infinite. */\nexport type NoticeBarMarqueePhase = \"idle\" | \"first\" | \"loop\";\nexport interface QwNoticeBarProps {\n id?: string;\n /** Required full announcement text; always present once in the DOM. */\n content: string;\n tone?: NoticeBarTone;\n /** System icon name; defaults \"info\". */\n icon?: IconNameInput;\n /** Defaults true. */\n showIcon?: boolean;\n /** Show every line instead of a single truncated line. Disables marquee. */\n wrap?: boolean;\n /** Scroll horizontally only while the text overflows; never under reduced motion. */\n marquee?: boolean;\n /** Pixels per second; non-finite/≤0 uses 50. */\n speed?: number;\n /** Milliseconds before the first pass; negative/non-finite uses 2000. */\n delay?: number;\n closeable?: boolean;\n /** Close button accessible name; defaults 「关闭」 (not translated by the component). */\n closeLabel?: string;\n /** Controlled visibility; closing only calls onClose. */\n open?: boolean;\n /** Initial uncontrolled visibility; defaults true. */\n defaultOpen?: boolean;\n onClose?: () => void;\n}\ninterface Geometry { container: number; text: number }\nexport interface QwNoticeBarSchema {\n props: Omit<QwNoticeBarProps, \"icon\"> & { tone: NoticeBarTone; icon: string; showIcon: boolean; speed: number; delay: number; closeLabel: string; defaultOpen: boolean };\n context: { open: boolean; overflow: boolean; reduced: boolean; phase: NoticeBarMarqueePhase; geometry: Geometry };\n state: \"ready\";\n action: \"close\" | \"restart\" | \"resetPhase\";\n effect: \"trackLayout\";\n event: { type: \"CLOSE\" } | { type: \"LAYOUT.RESET\" };\n}\nexport type QwNoticeBarMachine = Machine<QwNoticeBarSchema>;\nexport type QwNoticeBarService = Service<QwNoticeBarSchema>;\n\nexport function resolveNoticeBarSpeed(speed: unknown): number { return typeof speed === \"number\" && Number.isFinite(speed) && speed > 0 ? speed : NOTICE_BAR_DEFAULT_SPEED; }\nexport function resolveNoticeBarDelay(delay: unknown): number { return typeof delay === \"number\" && Number.isFinite(delay) && delay >= 0 ? delay : NOTICE_BAR_DEFAULT_DELAY; }\n/** Pure marquee geometry: CSS variables for the current phase, or null when static. */\nexport function resolveNoticeBarMarquee(phase: NoticeBarMarqueePhase, geometry: Geometry, speed: number): { from: number; to: number; duration: number } | null {\n if (phase === \"idle\") return null;\n const from = phase === \"first\" ? 0 : geometry.container, distance = from + geometry.text;\n return { from, to: -geometry.text, duration: Math.max(distance / resolveNoticeBarSpeed(speed), 0.001) };\n}\nexport function createNoticeBarProps(props: QwNoticeBarProps): QwNoticeBarSchema[\"props\"] {\n if (typeof props.content !== \"string\" || !props.content.trim()) throw new TypeError(\"NoticeBar requires nonempty content text\");\n if (props.id !== undefined && (typeof props.id !== \"string\" || !props.id.trim())) throw new TypeError(\"NoticeBar requires a nonempty instance id when provided\");\n return { ...props, tone: NOTICE_BAR_TONES.includes(props.tone!) ? props.tone! : \"warning\", icon: (props.icon || \"info\") as string, showIcon: props.showIcon ?? true,\n speed: resolveNoticeBarSpeed(props.speed), delay: resolveNoticeBarDelay(props.delay), closeLabel: props.closeLabel?.trim() ? props.closeLabel : \"关闭\", defaultOpen: props.defaultOpen ?? true };\n}\n\nconst rootId = (service: Pick<QwNoticeBarService, \"scope\">) => `notice-bar:${service.scope.id}`;\nconst contentId = (service: Pick<QwNoticeBarService, \"scope\">) => `${rootId(service)}:content`;\nconst textId = (service: Pick<QwNoticeBarService, \"scope\">) => `${rootId(service)}:text`;\nconst sameGeometry = (a: Geometry, b: Geometry | undefined) => !!b && a.container === b.container && a.text === b.text;\n\n/** Core owns close requests, overflow measurement, reduced-motion reads, delay timer and phase changes. */\nexport const noticeBarMachine: QwNoticeBarMachine = createMachine<QwNoticeBarSchema>({\n props: ({ props }) => createNoticeBarProps({ ...props, content: props.content ?? \"\" } as QwNoticeBarProps),\n initialState: () => \"ready\",\n context({ prop, bindable }) {\n return {\n open: bindable(() => ({ defaultValue: prop(\"defaultOpen\"), value: prop(\"open\"), onChange: (open) => { if (!open) prop(\"onClose\")?.(); } })),\n overflow: bindable(() => ({ defaultValue: false })),\n reduced: bindable(() => ({ defaultValue: false })),\n phase: bindable<NoticeBarMarqueePhase>(() => ({ defaultValue: \"idle\" })),\n geometry: bindable<Geometry>(() => ({ defaultValue: { container: 0, text: 0 }, isEqual: sameGeometry })),\n };\n },\n watch({ track, prop, action }) {\n track([() => prop(\"content\"), () => prop(\"marquee\"), () => prop(\"wrap\"), () => prop(\"delay\"), () => prop(\"speed\")], () => action([\"restart\"]));\n },\n on: { CLOSE: { actions: [\"close\"] } },\n states: { ready: { effects: [\"trackLayout\"], on: { \"LAYOUT.RESET\": { target: \"ready\", reenter: true, actions: [\"resetPhase\"] } } } },\n implementations: {\n actions: {\n close({ context }) { context.set(\"open\", false); },\n restart({ send }) { send({ type: \"LAYOUT.RESET\" }); },\n resetPhase({ context }) { context.set(\"phase\", \"idle\"); },\n },\n effects: {\n trackLayout(params) {\n const { scope, context, prop } = params;\n const win = scope.getWin();\n const cleanups: Array<() => void> = [];\n const reduced = typeof win.matchMedia === \"function\" ? win.matchMedia(\"(prefers-reduced-motion: reduce)\") : undefined;\n const readReduced = () => context.set(\"reduced\", !!reduced?.matches);\n readReduced();\n if (reduced?.addEventListener) { reduced.addEventListener(\"change\", readReduced); cleanups.push(() => reduced.removeEventListener(\"change\", readReduced)); }\n const measure = () => {\n const container = scope.getById(contentId(params)), text = scope.getById(textId(params));\n if (!container || !text) return;\n const width = container.clientWidth;\n context.set(\"geometry\", { container: width, text: Math.ceil(text.getBoundingClientRect().width) });\n context.set(\"overflow\", container.scrollWidth > width + 1);\n };\n measure();\n if (typeof win.ResizeObserver === \"function\") {\n const observer = new win.ResizeObserver(() => measure());\n for (const id of [contentId(params), textId(params)]) { const element = scope.getById(id); if (element) observer.observe(element); }\n cleanups.push(() => observer.disconnect());\n }\n if (prop(\"marquee\") && !prop(\"wrap\")) {\n const timer = win.setTimeout(() => { measure(); context.set(\"phase\", \"first\"); }, prop(\"delay\"));\n cleanups.push(() => win.clearTimeout(timer));\n const text = scope.getById(textId(params));\n if (text) cleanups.push(addDomEvent(text, \"animationend\", (event) => { if (event.target === text && context.get(\"phase\") === \"first\") context.set(\"phase\", \"loop\"); }));\n }\n return () => { cleanups.splice(0).forEach((cleanup) => cleanup()); };\n },\n },\n },\n});\n\nexport interface QwNoticeBarApi<T extends PropTypes = PropTypes> {\n open: boolean;\n content: string;\n tone: NoticeBarTone;\n /** Text currently overflows its single-line container (static truncation or marquee). */\n overflow: boolean;\n /** Marquee animation is running (requested, overflowing, not wrapped, motion allowed, delay elapsed). */\n scrolling: boolean;\n close(): void;\n getRootProps(): T[\"element\"];\n getIconProps(): T[\"element\"];\n getIconState(): IconState;\n getContentProps(): T[\"element\"];\n getTextProps(): T[\"element\"];\n getExtraProps(): T[\"element\"];\n getCloseProps(): T[\"button\"];\n getCloseIconState(): IconState;\n}\n/** SSR-pure getters. Without measurement SSR renders the static, complete text. */\nexport function connectNoticeBar<T extends PropTypes>(service: QwNoticeBarService, normalize: NormalizeProps<T>): QwNoticeBarApi<T> {\n const id = rootId(service), open = service.context.get(\"open\"), overflow = service.context.get(\"overflow\"), reduced = service.context.get(\"reduced\");\n const wrap = !!service.prop(\"wrap\") || (!!service.prop(\"marquee\") && reduced);\n const allowed = !!service.prop(\"marquee\") && !wrap && overflow;\n const motion = allowed ? resolveNoticeBarMarquee(service.context.get(\"phase\"), service.context.get(\"geometry\"), service.prop(\"speed\")) : null;\n const part = (name: string) => ({ \"data-scope\": \"notice-bar\", \"data-part\": name });\n return {\n open, content: service.prop(\"content\"), tone: service.prop(\"tone\"), overflow, scrolling: !!motion,\n close: () => service.send({ type: \"CLOSE\" }),\n getRootProps: () => normalize.element({ ...part(\"root\"), id, hidden: !open, \"data-tone\": service.prop(\"tone\"), \"data-wrap\": dataAttr(wrap), \"data-overflow\": dataAttr(overflow), \"data-marquee\": dataAttr(!!service.prop(\"marquee\")), \"data-reduced-motion\": dataAttr(reduced) }),\n getIconProps: () => normalize.element({ ...part(\"icon\"), \"aria-hidden\": true, hidden: !service.prop(\"showIcon\") }),\n getIconState: () => resolveIconState({ id: `${id}:icon`, name: service.prop(\"icon\") }),\n getContentProps: () => normalize.element({ ...part(\"content\"), id: contentId(service) }),\n getTextProps: () => normalize.element({ ...part(\"text\"), id: textId(service), \"data-phase\": motion ? service.context.get(\"phase\") : undefined,\n style: motion ? { \"--qw-notice-bar-from\": `${motion.from}px`, \"--qw-notice-bar-to\": `${motion.to}px`, \"--qw-notice-bar-duration\": `${motion.duration}s` } : undefined }),\n getExtraProps: () => normalize.element(part(\"extra\")),\n getCloseProps: () => normalize.button({ ...part(\"close\"), type: \"button\", hidden: !service.prop(\"closeable\"), \"aria-label\": service.prop(\"closeLabel\"), \"aria-controls\": id,\n onClick(event) { if (!event.defaultPrevented) service.send({ type: \"CLOSE\" }); } }),\n getCloseIconState: () => resolveIconState({ id: `${id}:close`, name: \"close\" }),\n };\n}\n"],"mappings":";;;;;AAMA,MAAa,mBAAmB;CAAC;CAAQ;CAAW;CAAU;AAAS;;AAEvE,MAAa,mBAAmB;CAAC;CAAQ;CAAQ;CAAW;CAAQ;CAAS;AAAO;AACpF,MAAa,2BAA2B;AACxC,MAAa,2BAA2B;AA2CxC,SAAgB,sBAAsB,OAAwB;CAAE,OAAO,OAAO,UAAU,YAAY,OAAO,SAAS,KAAK,KAAK,QAAQ,IAAI,QAAA;AAAkC;AAC5K,SAAgB,sBAAsB,OAAwB;CAAE,OAAO,OAAO,UAAU,YAAY,OAAO,SAAS,KAAK,KAAK,SAAS,IAAI,QAAQ;AAA0B;;AAE7K,SAAgB,wBAAwB,OAA8B,UAAoB,OAAsE;CAC9J,IAAI,UAAU,QAAQ,OAAO;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E,GAAG,KAAK,MAAM;GAAG,IAAI,OAAO,OAAO;GAAG,cAAc,SAAS,QAAQ,QAAQ,IAAI,OAAO,IAAI,KAAA;GAClI,OAAO,SAAS;IAAE,wBAAwB,GAAG,OAAO,KAAK;IAAK,sBAAsB,GAAG,OAAO,GAAG;IAAK,4BAA4B,GAAG,OAAO,SAAS;GAAG,IAAI,KAAA;EAAU,CAAC;EACzK,qBAAqB,UAAU,QAAQ,KAAK,OAAO,CAAC;EACpD,qBAAqB,UAAU,OAAO;GAAE,GAAG,KAAK,OAAO;GAAG,MAAM;GAAU,QAAQ,CAAC,QAAQ,KAAK,WAAW;GAAG,cAAc,QAAQ,KAAK,YAAY;GAAG,iBAAiB;GACvK,QAAQ,OAAO;IAAE,IAAI,CAAC,MAAM,kBAAkB,QAAQ,KAAK,EAAE,MAAM,QAAQ,CAAC;GAAG;EAAE,CAAC;EACpF,yBAAyB,iBAAiB;GAAE,IAAI,GAAG,GAAG;GAAS,MAAM;EAAQ,CAAC;CAChF;AACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./notify.js";
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
import { o as resolveIconState } from "../icon-Cgdbnk1u.js";
|
|
2
|
+
import { createMachine } from "@zag-js/core";
|
|
3
|
+
//#region src/notify/notify.ts
|
|
4
|
+
/** Stable DOM parts shared by every adapter. */
|
|
5
|
+
const NOTIFY_PARTS = [
|
|
6
|
+
"root",
|
|
7
|
+
"message",
|
|
8
|
+
"action",
|
|
9
|
+
"close"
|
|
10
|
+
];
|
|
11
|
+
/** Four semantic types; primary doubles as the neutral/info tone. */
|
|
12
|
+
const NOTIFY_TYPES = [
|
|
13
|
+
"primary",
|
|
14
|
+
"success",
|
|
15
|
+
"warning",
|
|
16
|
+
"danger"
|
|
17
|
+
];
|
|
18
|
+
const NOTIFY_DEFAULT_DURATION = 3e3;
|
|
19
|
+
const text = (value, fallback) => typeof value === "string" && value.trim() ? value : fallback;
|
|
20
|
+
function resolveNotifyState(props = {}) {
|
|
21
|
+
const duration = props.duration;
|
|
22
|
+
return {
|
|
23
|
+
type: NOTIFY_TYPES.includes(props.type) ? props.type : "primary",
|
|
24
|
+
message: typeof props.message === "string" ? props.message : "",
|
|
25
|
+
actionText: typeof props.actionText === "string" ? props.actionText.trim() : "",
|
|
26
|
+
closeOnAction: props.closeOnAction !== false,
|
|
27
|
+
closable: props.closable !== false,
|
|
28
|
+
closeLabel: text(props.closeLabel, "关闭通知"),
|
|
29
|
+
duration: typeof duration === "number" && Number.isFinite(duration) && duration >= 0 ? duration : NOTIFY_DEFAULT_DURATION
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
function createNotifyProps(props = {}) {
|
|
33
|
+
if (props.id !== void 0 && (typeof props.id !== "string" || !props.id.trim())) throw new TypeError("Notify requires a nonempty instance id when provided");
|
|
34
|
+
return {
|
|
35
|
+
...props,
|
|
36
|
+
open: typeof props.open === "boolean" ? props.open : void 0,
|
|
37
|
+
defaultOpen: props.defaultOpen === true
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
const live = (prop) => resolveNotifyState({
|
|
41
|
+
type: prop("type"),
|
|
42
|
+
message: prop("message"),
|
|
43
|
+
actionText: prop("actionText"),
|
|
44
|
+
closeOnAction: prop("closeOnAction"),
|
|
45
|
+
closable: prop("closable"),
|
|
46
|
+
closeLabel: prop("closeLabel"),
|
|
47
|
+
duration: prop("duration")
|
|
48
|
+
});
|
|
49
|
+
const clear = (refs) => {
|
|
50
|
+
const timer = refs.get("timer");
|
|
51
|
+
if (timer !== void 0) clearTimeout(timer);
|
|
52
|
+
refs.set("timer", void 0);
|
|
53
|
+
};
|
|
54
|
+
const paused = (refs) => refs.get("hovered") || refs.get("focused");
|
|
55
|
+
function arm(refs, send) {
|
|
56
|
+
clear(refs);
|
|
57
|
+
const remaining = refs.get("remaining");
|
|
58
|
+
if (remaining <= 0 || paused(refs)) return;
|
|
59
|
+
refs.set("startedAt", Date.now());
|
|
60
|
+
refs.set("timer", setTimeout(() => {
|
|
61
|
+
refs.set("timer", void 0);
|
|
62
|
+
send({ type: "TIMEOUT" });
|
|
63
|
+
}, remaining));
|
|
64
|
+
}
|
|
65
|
+
function request(context, prop, open, reason) {
|
|
66
|
+
if (context.get("open") === open) return;
|
|
67
|
+
context.set("open", open);
|
|
68
|
+
prop("onOpenChange")?.({
|
|
69
|
+
open,
|
|
70
|
+
reason
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
/** Core owns visibility requests, the auto-dismiss timer, hover/focus pause, content-replacement restarts and cleanup. */
|
|
74
|
+
const notifyMachine = createMachine({
|
|
75
|
+
props: ({ props }) => createNotifyProps(props),
|
|
76
|
+
initialState: () => "ready",
|
|
77
|
+
context: ({ bindable, prop }) => ({ open: bindable(() => ({
|
|
78
|
+
defaultValue: prop("defaultOpen") ?? false,
|
|
79
|
+
value: prop("open")
|
|
80
|
+
})) }),
|
|
81
|
+
refs: () => ({
|
|
82
|
+
timer: void 0,
|
|
83
|
+
remaining: 0,
|
|
84
|
+
startedAt: 0,
|
|
85
|
+
hovered: false,
|
|
86
|
+
focused: false
|
|
87
|
+
}),
|
|
88
|
+
watch({ track, prop, context, send }) {
|
|
89
|
+
track([
|
|
90
|
+
() => context.get("open"),
|
|
91
|
+
() => prop("message"),
|
|
92
|
+
() => prop("type"),
|
|
93
|
+
() => prop("actionText"),
|
|
94
|
+
() => prop("duration")
|
|
95
|
+
], () => send({ type: "RESTART" }));
|
|
96
|
+
},
|
|
97
|
+
effects: ["lifecycle"],
|
|
98
|
+
on: {
|
|
99
|
+
SHOW: { actions: ["show"] },
|
|
100
|
+
CLOSE: { actions: ["close"] },
|
|
101
|
+
ACTION: { actions: ["action"] },
|
|
102
|
+
RESTART: { actions: ["restart"] },
|
|
103
|
+
TIMEOUT: { actions: ["expire"] },
|
|
104
|
+
HOVER: { actions: ["pause"] },
|
|
105
|
+
FOCUS: { actions: ["pause"] }
|
|
106
|
+
},
|
|
107
|
+
states: { ready: {} },
|
|
108
|
+
implementations: {
|
|
109
|
+
actions: {
|
|
110
|
+
show({ context, prop, refs, send }) {
|
|
111
|
+
request(context, prop, true, "api");
|
|
112
|
+
if (context.get("open")) {
|
|
113
|
+
refs.set("remaining", live(prop).duration);
|
|
114
|
+
arm(refs, send);
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
close({ context, prop, event, refs }) {
|
|
118
|
+
if (event.type !== "CLOSE") return;
|
|
119
|
+
clear(refs);
|
|
120
|
+
request(context, prop, false, event.reason);
|
|
121
|
+
},
|
|
122
|
+
action({ context, prop, refs }) {
|
|
123
|
+
if (!context.get("open")) return;
|
|
124
|
+
prop("onAction")?.();
|
|
125
|
+
if (live(prop).closeOnAction) {
|
|
126
|
+
clear(refs);
|
|
127
|
+
request(context, prop, false, "action");
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
restart({ context, prop, refs, send }) {
|
|
131
|
+
clear(refs);
|
|
132
|
+
refs.set("remaining", live(prop).duration);
|
|
133
|
+
if (context.get("open")) arm(refs, send);
|
|
134
|
+
},
|
|
135
|
+
expire({ context, prop, refs }) {
|
|
136
|
+
clear(refs);
|
|
137
|
+
if (context.get("open") && live(prop).duration > 0) request(context, prop, false, "timeout");
|
|
138
|
+
},
|
|
139
|
+
pause({ event, refs, context, send }) {
|
|
140
|
+
if (event.type !== "HOVER" && event.type !== "FOCUS") return;
|
|
141
|
+
const was = paused(refs);
|
|
142
|
+
refs.set(event.type === "HOVER" ? "hovered" : "focused", event.value);
|
|
143
|
+
if (!was && paused(refs) && refs.get("timer") !== void 0) {
|
|
144
|
+
refs.set("remaining", Math.max(0, refs.get("remaining") - (Date.now() - refs.get("startedAt"))));
|
|
145
|
+
clear(refs);
|
|
146
|
+
} else if (was && !paused(refs) && context.get("open")) arm(refs, send);
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
effects: { lifecycle({ context, prop, refs, send }) {
|
|
150
|
+
refs.set("remaining", live(prop).duration);
|
|
151
|
+
if (context.get("open")) arm(refs, send);
|
|
152
|
+
return () => clear(refs);
|
|
153
|
+
} }
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
function run(handlers, event) {
|
|
157
|
+
const list = typeof handlers === "function" ? [handlers] : handlers ?? [];
|
|
158
|
+
for (const handler of list) if (typeof handler === "function") handler(event);
|
|
159
|
+
return !event.defaultPrevented;
|
|
160
|
+
}
|
|
161
|
+
const contains = (owner, node) => !!node && typeof owner?.contains === "function" && owner.contains(node);
|
|
162
|
+
function connectNotify(service, normalize, options = {}) {
|
|
163
|
+
const state = live(service.prop), open = service.context.get("open"), { send } = service;
|
|
164
|
+
const part = (name) => ({
|
|
165
|
+
"data-scope": "notify",
|
|
166
|
+
"data-part": name,
|
|
167
|
+
"data-type": state.type
|
|
168
|
+
});
|
|
169
|
+
const root = options.root ?? {};
|
|
170
|
+
const hover = (value) => send({
|
|
171
|
+
type: "HOVER",
|
|
172
|
+
value
|
|
173
|
+
}), focus = (value) => send({
|
|
174
|
+
type: "FOCUS",
|
|
175
|
+
value
|
|
176
|
+
});
|
|
177
|
+
const show = () => send({ type: "SHOW" }), close = () => send({
|
|
178
|
+
type: "CLOSE",
|
|
179
|
+
reason: "api"
|
|
180
|
+
});
|
|
181
|
+
return {
|
|
182
|
+
open,
|
|
183
|
+
type: state.type,
|
|
184
|
+
message: open ? state.message : "",
|
|
185
|
+
actionText: state.actionText,
|
|
186
|
+
closable: state.closable,
|
|
187
|
+
closeLabel: state.closeLabel,
|
|
188
|
+
show,
|
|
189
|
+
close,
|
|
190
|
+
getRootProps: () => normalize.element({
|
|
191
|
+
...part("root"),
|
|
192
|
+
id: `notify:${service.scope.id}`,
|
|
193
|
+
"data-state": open ? "open" : "closed",
|
|
194
|
+
hidden: !open || void 0,
|
|
195
|
+
onPointerEnter(event) {
|
|
196
|
+
if (run(root.onPointerEnter, event) && event.pointerType !== "touch") hover(true);
|
|
197
|
+
},
|
|
198
|
+
onPointerLeave(event) {
|
|
199
|
+
if (run(root.onPointerLeave, event) && event.pointerType !== "touch") hover(false);
|
|
200
|
+
},
|
|
201
|
+
onFocus(event) {
|
|
202
|
+
if (run(root.onFocus, event)) focus(true);
|
|
203
|
+
},
|
|
204
|
+
onBlur(event) {
|
|
205
|
+
if (run(root.onBlur, event) && !contains(event.currentTarget, event.relatedTarget)) focus(false);
|
|
206
|
+
},
|
|
207
|
+
onKeyDown(event) {
|
|
208
|
+
if (!run(root.onKeyDown, event) || event.key !== "Escape" || !state.closable || !open) return;
|
|
209
|
+
event.preventDefault?.();
|
|
210
|
+
send({
|
|
211
|
+
type: "CLOSE",
|
|
212
|
+
reason: "close"
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
}),
|
|
216
|
+
getMessageProps: () => normalize.element({
|
|
217
|
+
...part("message"),
|
|
218
|
+
role: state.type === "danger" ? "alert" : "status",
|
|
219
|
+
"aria-live": state.type === "danger" ? "assertive" : "polite",
|
|
220
|
+
"aria-atomic": true
|
|
221
|
+
}),
|
|
222
|
+
getActionProps: () => normalize.button({
|
|
223
|
+
...part("action"),
|
|
224
|
+
type: "button",
|
|
225
|
+
hidden: !state.actionText || void 0,
|
|
226
|
+
onClick(event) {
|
|
227
|
+
if (!event.defaultPrevented) send({ type: "ACTION" });
|
|
228
|
+
}
|
|
229
|
+
}),
|
|
230
|
+
getCloseIconState: () => resolveIconState({
|
|
231
|
+
id: `notify:${service.scope.id}:close`,
|
|
232
|
+
name: "close"
|
|
233
|
+
}),
|
|
234
|
+
getCloseProps: () => normalize.button({
|
|
235
|
+
...part("close"),
|
|
236
|
+
type: "button",
|
|
237
|
+
"aria-label": state.closeLabel,
|
|
238
|
+
hidden: !state.closable || void 0,
|
|
239
|
+
onClick(event) {
|
|
240
|
+
if (!event.defaultPrevented) send({
|
|
241
|
+
type: "CLOSE",
|
|
242
|
+
reason: "close"
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
})
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
//#endregion
|
|
249
|
+
export { NOTIFY_DEFAULT_DURATION, NOTIFY_PARTS, NOTIFY_TYPES, connectNotify, createNotifyProps, notifyMachine, resolveNotifyState };
|
|
250
|
+
|
|
251
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/notify/notify.ts"],"sourcesContent":["import { createMachine, type Machine, type Service } from \"@zag-js/core\";\nimport type { NormalizeProps, PropTypes } from \"@zag-js/types\";\nimport { resolveIconState, type IconState } from \"../icon/index.js\";\n\n/** Stable DOM parts shared by every adapter. */\nexport const NOTIFY_PARTS = [\"root\", \"message\", \"action\", \"close\"] as const;\n/** Four semantic types; primary doubles as the neutral/info tone. */\nexport const NOTIFY_TYPES = [\"primary\", \"success\", \"warning\", \"danger\"] as const;\nexport type NotifyType = (typeof NOTIFY_TYPES)[number];\nexport const NOTIFY_DEFAULT_DURATION = 3000;\n/** Why the open state changed: timer expiry, close button / Escape, action activation, or an imperative show/close. */\nexport type NotifyOpenChangeReason = \"timeout\" | \"close\" | \"action\" | \"api\";\nexport interface NotifyOpenChangeDetails { open: boolean; reason: NotifyOpenChangeReason }\n\nexport interface QwNotifyProps {\n /** Page-unique instance identity; adapters generate one when omitted. */\n id?: string;\n /** Controlled visibility; undefined lets Core own it (seeded by defaultOpen). */\n open?: boolean;\n defaultOpen?: boolean;\n /** Called for every open request; controlled owners accept by updating `open`. */\n onOpenChange?: (details: NotifyOpenChangeDetails) => void;\n /** Semantic type; default primary. danger is announced assertively (role=alert). */\n type?: NotifyType;\n /** Notification text. Changing it while open replaces the content and restarts the timer. */\n message?: string;\n /** Optional action button text; omitted hides the action. */\n actionText?: string;\n /** The action button was activated (before the optional close). */\n onAction?: () => void;\n /** Close after the action; default true. */\n closeOnAction?: boolean;\n /** Show the close button (and allow Escape); default true. */\n closable?: boolean;\n /** Accessible name of the close button; default 关闭通知. */\n closeLabel?: string;\n /** Auto-dismiss delay in ms; 0 keeps it open; invalid uses 3000. Paused on hover and while focus is inside. */\n duration?: number;\n}\nexport interface ResolvedNotifyState {\n type: NotifyType; message: string; actionText: string; closeOnAction: boolean; closable: boolean; closeLabel: string; duration: number;\n}\nconst text = (value: string | undefined, fallback: string): string => typeof value === \"string\" && value.trim() ? value : fallback;\nexport function resolveNotifyState(props: QwNotifyProps = {}): ResolvedNotifyState {\n const duration = props.duration;\n return {\n type: NOTIFY_TYPES.includes(props.type as NotifyType) ? props.type as NotifyType : \"primary\",\n message: typeof props.message === \"string\" ? props.message : \"\",\n actionText: typeof props.actionText === \"string\" ? props.actionText.trim() : \"\",\n closeOnAction: props.closeOnAction !== false, closable: props.closable !== false, closeLabel: text(props.closeLabel, \"关闭通知\"),\n duration: typeof duration === \"number\" && Number.isFinite(duration) && duration >= 0 ? duration : NOTIFY_DEFAULT_DURATION,\n };\n}\nexport function createNotifyProps(props: QwNotifyProps = {}): QwNotifyProps {\n if (props.id !== undefined && (typeof props.id !== \"string\" || !props.id.trim())) throw new TypeError(\"Notify requires a nonempty instance id when provided\");\n return { ...props, open: typeof props.open === \"boolean\" ? props.open : undefined, defaultOpen: props.defaultOpen === true };\n}\n\n/** Minimal event surface shared by React, Vue and native events. */\nexport interface NotifyDomEvent {\n readonly defaultPrevented: boolean; readonly type?: string; readonly key?: string; readonly pointerType?: string;\n readonly currentTarget?: unknown; readonly relatedTarget?: unknown; preventDefault?(): void;\n}\nexport type NotifyEventHandler = (event: NotifyDomEvent) => void;\ntype RootHandler = \"onPointerEnter\" | \"onPointerLeave\" | \"onFocus\" | \"onBlur\" | \"onKeyDown\";\n/** Caller handlers for the root run first; Core's own handler is skipped when the caller calls preventDefault(). */\nexport interface NotifyConnectOptions { root?: Partial<Record<RootHandler, NotifyEventHandler | readonly NotifyEventHandler[] | undefined>> }\n\nexport interface QwNotifySchema {\n props: QwNotifyProps;\n context: { open: boolean };\n refs: { timer: ReturnType<typeof setTimeout> | undefined; remaining: number; startedAt: number; hovered: boolean; focused: boolean };\n state: \"ready\";\n action: \"show\" | \"close\" | \"action\" | \"restart\" | \"pause\" | \"expire\";\n effect: \"lifecycle\";\n event:\n | { type: \"SHOW\" }\n | { type: \"CLOSE\"; reason: NotifyOpenChangeReason }\n | { type: \"ACTION\" }\n | { type: \"RESTART\" }\n | { type: \"TIMEOUT\" }\n | { type: \"HOVER\"; value: boolean }\n | { type: \"FOCUS\"; value: boolean };\n}\nexport type QwNotifyMachine = Machine<QwNotifySchema>;\nexport type QwNotifyService = Service<QwNotifySchema>;\ntype Refs = QwNotifyService[\"refs\"];\nconst live = (prop: QwNotifyService[\"prop\"]) => resolveNotifyState({\n type: prop(\"type\"), message: prop(\"message\"), actionText: prop(\"actionText\"), closeOnAction: prop(\"closeOnAction\"), closable: prop(\"closable\"), closeLabel: prop(\"closeLabel\"), duration: prop(\"duration\"),\n});\nconst clear = (refs: Refs) => { const timer = refs.get(\"timer\"); if (timer !== undefined) clearTimeout(timer); refs.set(\"timer\", undefined); };\nconst paused = (refs: Refs) => refs.get(\"hovered\") || refs.get(\"focused\");\nfunction arm(refs: Refs, send: QwNotifyService[\"send\"]) {\n clear(refs);\n const remaining = refs.get(\"remaining\");\n if (remaining <= 0 || paused(refs)) return;\n refs.set(\"startedAt\", Date.now());\n refs.set(\"timer\", setTimeout(() => { refs.set(\"timer\", undefined); send({ type: \"TIMEOUT\" }); }, remaining));\n}\nfunction request(context: QwNotifyService[\"context\"], prop: QwNotifyService[\"prop\"], open: boolean, reason: NotifyOpenChangeReason) {\n if (context.get(\"open\") === open) return;\n context.set(\"open\", open);\n prop(\"onOpenChange\")?.({ open, reason });\n}\n\n/** Core owns visibility requests, the auto-dismiss timer, hover/focus pause, content-replacement restarts and cleanup. */\nexport const notifyMachine: QwNotifyMachine = createMachine<QwNotifySchema>({\n props: ({ props }) => createNotifyProps(props), initialState: () => \"ready\",\n context: ({ bindable, prop }) => ({ open: bindable<boolean>(() => ({ defaultValue: prop(\"defaultOpen\") ?? false, value: prop(\"open\") })) }),\n refs: () => ({ timer: undefined, remaining: 0, startedAt: 0, hovered: false, focused: false }),\n watch({ track, prop, context, send }) {\n // Opening, replacing the content or changing the delay restarts the countdown from the full duration.\n track([() => context.get(\"open\"), () => prop(\"message\"), () => prop(\"type\"), () => prop(\"actionText\"), () => prop(\"duration\")], () => send({ type: \"RESTART\" }));\n },\n effects: [\"lifecycle\"],\n on: {\n SHOW: { actions: [\"show\"] }, CLOSE: { actions: [\"close\"] }, ACTION: { actions: [\"action\"] }, RESTART: { actions: [\"restart\"] },\n TIMEOUT: { actions: [\"expire\"] }, HOVER: { actions: [\"pause\"] }, FOCUS: { actions: [\"pause\"] },\n },\n states: { ready: {} },\n implementations: {\n actions: {\n show({ context, prop, refs, send }) { request(context, prop, true, \"api\"); if (context.get(\"open\")) { refs.set(\"remaining\", live(prop).duration); arm(refs, send); } },\n close({ context, prop, event, refs }) { if (event.type !== \"CLOSE\") return; clear(refs); request(context, prop, false, event.reason); },\n action({ context, prop, refs }) {\n if (!context.get(\"open\")) return;\n prop(\"onAction\")?.();\n if (live(prop).closeOnAction) { clear(refs); request(context, prop, false, \"action\"); }\n },\n restart({ context, prop, refs, send }) { clear(refs); refs.set(\"remaining\", live(prop).duration); if (context.get(\"open\")) arm(refs, send); },\n expire({ context, prop, refs }) { clear(refs); if (context.get(\"open\") && live(prop).duration > 0) request(context, prop, false, \"timeout\"); },\n // Hover and focus-within pause the countdown keeping the remaining time; leaving both resumes it.\n pause({ event, refs, context, send }) {\n if (event.type !== \"HOVER\" && event.type !== \"FOCUS\") return;\n const was = paused(refs);\n refs.set(event.type === \"HOVER\" ? \"hovered\" : \"focused\", event.value);\n if (!was && paused(refs) && refs.get(\"timer\") !== undefined) {\n refs.set(\"remaining\", Math.max(0, refs.get(\"remaining\") - (Date.now() - refs.get(\"startedAt\")))); clear(refs);\n } else if (was && !paused(refs) && context.get(\"open\")) arm(refs, send);\n },\n },\n effects: {\n lifecycle({ context, prop, refs, send }) {\n refs.set(\"remaining\", live(prop).duration);\n if (context.get(\"open\")) arm(refs, send);\n return () => clear(refs);\n },\n },\n },\n});\n\nexport interface QwNotifyApi<T extends PropTypes = PropTypes> {\n open: boolean; type: NotifyType; message: string; actionText: string; closable: boolean; closeLabel: string;\n show(): void;\n close(): void;\n getRootProps(): T[\"element\"];\n getMessageProps(): T[\"element\"];\n getActionProps(): T[\"button\"];\n getCloseProps(): T[\"button\"];\n /** Decorative close glyph rendered inside the close button. */\n getCloseIconState(): IconState;\n}\nfunction run(handlers: NotifyEventHandler | readonly NotifyEventHandler[] | undefined, event: NotifyDomEvent): boolean {\n const list = typeof handlers === \"function\" ? [handlers] : handlers ?? [];\n for (const handler of list) if (typeof handler === \"function\") handler(event);\n return !event.defaultPrevented;\n}\nconst contains = (owner: unknown, node: unknown) => !!node && typeof (owner as Node | null)?.contains === \"function\" && (owner as Node).contains(node as Node);\n\nexport function connectNotify<T extends PropTypes>(service: QwNotifyService, normalize: NormalizeProps<T>, options: NotifyConnectOptions = {}): QwNotifyApi<T> {\n const state = live(service.prop), open = service.context.get(\"open\"), { send } = service;\n const part = (name: string) => ({ \"data-scope\": \"notify\", \"data-part\": name, \"data-type\": state.type });\n const root = options.root ?? {};\n const hover = (value: boolean) => send({ type: \"HOVER\", value }), focus = (value: boolean) => send({ type: \"FOCUS\", value });\n const show = () => send({ type: \"SHOW\" }), close = () => send({ type: \"CLOSE\", reason: \"api\" });\n return {\n // The message is only rendered while open, so (re)opening inserts text into the live region and is announced.\n open, type: state.type, message: open ? state.message : \"\", actionText: state.actionText, closable: state.closable, closeLabel: state.closeLabel, show, close,\n getRootProps: () => normalize.element({\n ...part(\"root\"), id: `notify:${service.scope.id}`, \"data-state\": open ? \"open\" : \"closed\", hidden: !open || undefined,\n onPointerEnter(event: NotifyDomEvent) { if (run(root.onPointerEnter, event) && event.pointerType !== \"touch\") hover(true); },\n onPointerLeave(event: NotifyDomEvent) { if (run(root.onPointerLeave, event) && event.pointerType !== \"touch\") hover(false); },\n onFocus(event: NotifyDomEvent) { if (run(root.onFocus, event)) focus(true); },\n onBlur(event: NotifyDomEvent) { if (run(root.onBlur, event) && !contains(event.currentTarget, event.relatedTarget)) focus(false); },\n onKeyDown(event: NotifyDomEvent) {\n if (!run(root.onKeyDown, event) || event.key !== \"Escape\" || !state.closable || !open) return;\n event.preventDefault?.(); send({ type: \"CLOSE\", reason: \"close\" });\n },\n }),\n // The live region is the message only, so buttons are not re-read and focus never moves.\n getMessageProps: () => normalize.element({ ...part(\"message\"), role: state.type === \"danger\" ? \"alert\" : \"status\", \"aria-live\": state.type === \"danger\" ? \"assertive\" : \"polite\", \"aria-atomic\": true }),\n getActionProps: () => normalize.button({ ...part(\"action\"), type: \"button\", hidden: !state.actionText || undefined,\n onClick(event: NotifyDomEvent) { if (!event.defaultPrevented) send({ type: \"ACTION\" }); } }),\n getCloseIconState: () => resolveIconState({ id: `notify:${service.scope.id}:close`, name: \"close\" }),\n getCloseProps: () => normalize.button({ ...part(\"close\"), type: \"button\", \"aria-label\": state.closeLabel, hidden: !state.closable || undefined,\n onClick(event: NotifyDomEvent) { if (!event.defaultPrevented) send({ type: \"CLOSE\", reason: \"close\" }); } }),\n };\n}\n"],"mappings":";;;;AAKA,MAAa,eAAe;CAAC;CAAQ;CAAW;CAAU;AAAO;;AAEjE,MAAa,eAAe;CAAC;CAAW;CAAW;CAAW;AAAQ;AAEtE,MAAa,0BAA0B;AAiCvC,MAAM,QAAQ,OAA2B,aAA6B,OAAO,UAAU,YAAY,MAAM,KAAK,IAAI,QAAQ;AAC1H,SAAgB,mBAAmB,QAAuB,CAAC,GAAwB;CACjF,MAAM,WAAW,MAAM;CACvB,OAAO;EACL,MAAM,aAAa,SAAS,MAAM,IAAkB,IAAI,MAAM,OAAqB;EACnF,SAAS,OAAO,MAAM,YAAY,WAAW,MAAM,UAAU;EAC7D,YAAY,OAAO,MAAM,eAAe,WAAW,MAAM,WAAW,KAAK,IAAI;EAC7E,eAAe,MAAM,kBAAkB;EAAO,UAAU,MA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