@qw-ui/core 0.3.0-next.4 → 0.3.0-next.42
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,148 @@
|
|
|
1
|
+
import { type Machine, type Service } from "@zag-js/core";
|
|
2
|
+
import type { NormalizeProps, PropTypes } from "@zag-js/types";
|
|
3
|
+
/** Logical sides: start actions sit at inline-start (left in LTR, right in RTL). */
|
|
4
|
+
export declare const SWIPE_ACTION_SIDES: readonly ["start", "end"];
|
|
5
|
+
export declare const SWIPE_ACTION_COLORS: readonly ["default", "primary", "warning", "danger"];
|
|
6
|
+
/** Stable DOM parts shared by every adapter. */
|
|
7
|
+
export declare const SWIPE_ACTION_PARTS: readonly ["root", "track", "actions", "action", "content", "status"];
|
|
8
|
+
/** Share of an action group's width that commits opening/closing; flicks commit earlier. */
|
|
9
|
+
export declare const SWIPE_ACTION_DISTANCE_RATIO = 0.4;
|
|
10
|
+
export type SwipeActionSide = (typeof SWIPE_ACTION_SIDES)[number];
|
|
11
|
+
export type SwipeActionColor = (typeof SWIPE_ACTION_COLORS)[number];
|
|
12
|
+
/** Scalar action. Rich action content is intentionally not supported so all stacks render the same button. */
|
|
13
|
+
export interface SwipeActionItem {
|
|
14
|
+
key: string;
|
|
15
|
+
text: string;
|
|
16
|
+
color?: SwipeActionColor;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export interface SwipeActionOpenChangeDetails {
|
|
20
|
+
open: SwipeActionSide | null;
|
|
21
|
+
}
|
|
22
|
+
export interface SwipeActionActionDetails {
|
|
23
|
+
key: string;
|
|
24
|
+
side: SwipeActionSide;
|
|
25
|
+
}
|
|
26
|
+
export interface QwSwipeActionProps {
|
|
27
|
+
/** Page-unique instance identity; adapters generate one when omitted. */
|
|
28
|
+
id?: string;
|
|
29
|
+
/** Actions revealed by swiping toward inline-end (antd-mobile leftActions in LTR). */
|
|
30
|
+
startActions?: readonly SwipeActionItem[];
|
|
31
|
+
/** Actions revealed by swiping toward inline-start (antd-mobile rightActions in LTR). */
|
|
32
|
+
endActions?: readonly SwipeActionItem[];
|
|
33
|
+
/** Controlled open side; null is controlled closed, undefined enables Core-owned state. */
|
|
34
|
+
open?: SwipeActionSide | null;
|
|
35
|
+
defaultOpen?: SwipeActionSide | null;
|
|
36
|
+
/** Close after an action is activated; defaults to true. */
|
|
37
|
+
closeOnAction?: boolean;
|
|
38
|
+
/** Close when the user presses outside the component; defaults to true. */
|
|
39
|
+
closeOnTouchOutside?: boolean;
|
|
40
|
+
/** Ignore gestures and disable actions; an open item closes. */
|
|
41
|
+
disabled?: boolean;
|
|
42
|
+
/** Visually hidden status while open, with {count}; defaults to 已展开 {count} 个操作. */
|
|
43
|
+
openedText?: string;
|
|
44
|
+
onOpenChange?: (details: SwipeActionOpenChangeDetails) => void;
|
|
45
|
+
onAction?: (details: SwipeActionActionDetails) => void;
|
|
46
|
+
}
|
|
47
|
+
export interface ResolvedSwipeActionItem {
|
|
48
|
+
key: string;
|
|
49
|
+
text: string;
|
|
50
|
+
color: SwipeActionColor;
|
|
51
|
+
disabled: boolean;
|
|
52
|
+
side: SwipeActionSide;
|
|
53
|
+
}
|
|
54
|
+
export interface ResolvedSwipeActionState {
|
|
55
|
+
start: ResolvedSwipeActionItem[];
|
|
56
|
+
end: ResolvedSwipeActionItem[];
|
|
57
|
+
closeOnAction: boolean;
|
|
58
|
+
closeOnTouchOutside: boolean;
|
|
59
|
+
disabled: boolean;
|
|
60
|
+
openedText: string;
|
|
61
|
+
}
|
|
62
|
+
/** Invalid/duplicate/empty actions are dropped; at most 8 per side. */
|
|
63
|
+
export declare function resolveSwipeActionState(props?: QwSwipeActionProps): ResolvedSwipeActionState;
|
|
64
|
+
/** A side can only be open when it has actions and the component is enabled. */
|
|
65
|
+
export declare function resolveSwipeActionOpen(state: ResolvedSwipeActionState, open: SwipeActionSide | null | undefined): SwipeActionSide | null;
|
|
66
|
+
/** Resting logical offset: positive reveals start actions. */
|
|
67
|
+
export declare function getSwipeActionRestOffset(open: SwipeActionSide | null, widths: {
|
|
68
|
+
start: number;
|
|
69
|
+
end: number;
|
|
70
|
+
}): number;
|
|
71
|
+
/** Logical drag offset from the resting position, clamped to the measured action widths. */
|
|
72
|
+
export declare function clampSwipeActionOffset(offset: number, widths: {
|
|
73
|
+
start: number;
|
|
74
|
+
end: number;
|
|
75
|
+
}): number;
|
|
76
|
+
/** Release decision. `delta` is the logical drag distance (positive = toward inline-end). */
|
|
77
|
+
export declare function resolveSwipeActionRelease(input: {
|
|
78
|
+
open: SwipeActionSide | null;
|
|
79
|
+
delta: number;
|
|
80
|
+
velocity: number;
|
|
81
|
+
widths: {
|
|
82
|
+
start: number;
|
|
83
|
+
end: number;
|
|
84
|
+
};
|
|
85
|
+
}): SwipeActionSide | null;
|
|
86
|
+
export declare function createSwipeActionProps(props?: QwSwipeActionProps): QwSwipeActionProps;
|
|
87
|
+
export interface QwSwipeActionSchema {
|
|
88
|
+
props: QwSwipeActionProps;
|
|
89
|
+
context: {
|
|
90
|
+
open: SwipeActionSide | null;
|
|
91
|
+
offset: number;
|
|
92
|
+
dragging: boolean;
|
|
93
|
+
startWidth: number;
|
|
94
|
+
endWidth: number;
|
|
95
|
+
};
|
|
96
|
+
state: "ready";
|
|
97
|
+
action: "setOpen" | "dragMove" | "dragEnd" | "measure" | "activate" | "close" | "closeIfDisabled";
|
|
98
|
+
effect: "trackGestures";
|
|
99
|
+
event: {
|
|
100
|
+
type: "OPEN.SET";
|
|
101
|
+
side: SwipeActionSide | null;
|
|
102
|
+
} | {
|
|
103
|
+
type: "CLOSE";
|
|
104
|
+
restoreFocus?: boolean;
|
|
105
|
+
} | {
|
|
106
|
+
type: "DRAG.MOVE";
|
|
107
|
+
offset: number;
|
|
108
|
+
} | {
|
|
109
|
+
type: "DRAG.END";
|
|
110
|
+
side: SwipeActionSide | null;
|
|
111
|
+
} | {
|
|
112
|
+
type: "MEASURE";
|
|
113
|
+
start: number;
|
|
114
|
+
end: number;
|
|
115
|
+
} | {
|
|
116
|
+
type: "ACTION";
|
|
117
|
+
key: string;
|
|
118
|
+
side: SwipeActionSide;
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
export type QwSwipeActionMachine = Machine<QwSwipeActionSchema>;
|
|
122
|
+
export type QwSwipeActionService = Service<QwSwipeActionSchema>;
|
|
123
|
+
/** Core owns gestures, axis locking, outside/close handling, focus-driven opening and cleanup. */
|
|
124
|
+
export declare const swipeActionMachine: QwSwipeActionMachine;
|
|
125
|
+
export interface QwSwipeActionApi<T extends PropTypes = PropTypes> {
|
|
126
|
+
open: SwipeActionSide | null;
|
|
127
|
+
dragging: boolean;
|
|
128
|
+
startActions: ResolvedSwipeActionItem[];
|
|
129
|
+
endActions: ResolvedSwipeActionItem[];
|
|
130
|
+
statusText: string;
|
|
131
|
+
show(side?: SwipeActionSide): void;
|
|
132
|
+
close(): void;
|
|
133
|
+
getRootProps(): T["element"];
|
|
134
|
+
getTrackProps(): T["element"];
|
|
135
|
+
getActionsProps(side: SwipeActionSide): T["element"];
|
|
136
|
+
getActionProps(item: ResolvedSwipeActionItem): T["button"];
|
|
137
|
+
getContentProps(): T["element"];
|
|
138
|
+
getStatusProps(): T["element"];
|
|
139
|
+
}
|
|
140
|
+
export interface SwipeActionDomEvent {
|
|
141
|
+
key: string;
|
|
142
|
+
defaultPrevented: boolean;
|
|
143
|
+
preventDefault(): void;
|
|
144
|
+
}
|
|
145
|
+
export interface SwipeActionConnectOptions {
|
|
146
|
+
onKeyDown?(event: SwipeActionDomEvent): void;
|
|
147
|
+
}
|
|
148
|
+
export declare function connectSwipeAction<T extends PropTypes>(service: QwSwipeActionService, normalize: NormalizeProps<T>, options?: SwipeActionConnectOptions): QwSwipeActionApi<T>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal pointer-gesture helpers shared by Swiper and SwipeAction.
|
|
3
|
+
* Pure functions only (no DOM); not exported from any index.
|
|
4
|
+
*/
|
|
5
|
+
/** Movement in CSS pixels before the gesture axis is decided. */
|
|
6
|
+
export declare const GESTURE_SLOP = 8;
|
|
7
|
+
/** Release velocity in px/ms that counts as a flick. */
|
|
8
|
+
export declare const GESTURE_FLICK_VELOCITY = 0.3;
|
|
9
|
+
/** Minimum travel in px for a flick to count. */
|
|
10
|
+
export declare const GESTURE_FLICK_DISTANCE = 12;
|
|
11
|
+
/** Velocity samples older than this window (ms) are ignored. */
|
|
12
|
+
export declare const GESTURE_VELOCITY_WINDOW = 100;
|
|
13
|
+
/** pending: still under the slop; main: the component owns the drag; cross: hand it back to native scrolling. */
|
|
14
|
+
export type GestureAxis = "pending" | "main" | "cross";
|
|
15
|
+
export interface GestureSample {
|
|
16
|
+
position: number;
|
|
17
|
+
time: number;
|
|
18
|
+
}
|
|
19
|
+
/** Decide once per gesture which axis dominates. `vertical` means the component's main axis is block. */
|
|
20
|
+
export declare function lockGestureAxis(dx: number, dy: number, vertical?: boolean, slop?: number): GestureAxis;
|
|
21
|
+
/** Keep only the recent window and return the newest-minus-oldest velocity in px/ms. */
|
|
22
|
+
export declare function sampleVelocity(samples: readonly GestureSample[], now: number, window?: number): number;
|
|
23
|
+
/**
|
|
24
|
+
* Release decision along a signed logical axis (positive = forward).
|
|
25
|
+
* Commits when travel reaches `max(GESTURE_FLICK_DISTANCE, size * ratio)`, or on a same-direction flick.
|
|
26
|
+
*/
|
|
27
|
+
export declare function resolveSwipeIntent(input: {
|
|
28
|
+
distance: number;
|
|
29
|
+
velocity: number;
|
|
30
|
+
size: number;
|
|
31
|
+
ratio: number;
|
|
32
|
+
}): -1 | 0 | 1;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./swiper.js";
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as SWIPER_MAX_SLIDES, c as clampSwiperIndex, d as getSwiperSlides, f as resolveSwiperDragOffset, h as swiperMachine, i as SWIPER_EDGE_RESISTANCE, l as connectSwiper, m as stepSwiperIndex, n as SWIPER_DIRECTIONS, o as SWIPER_MIN_AUTOPLAY_INTERVAL, p as resolveSwiperState, r as SWIPER_DISTANCE_RATIO, s as SWIPER_PARTS, t as SWIPER_DEFAULT_AUTOPLAY_INTERVAL, u as createSwiperProps } from "../swiper-BKivDkHp.js";
|
|
2
|
+
export { SWIPER_DEFAULT_AUTOPLAY_INTERVAL, SWIPER_DIRECTIONS, SWIPER_DISTANCE_RATIO, SWIPER_EDGE_RESISTANCE, SWIPER_MAX_SLIDES, SWIPER_MIN_AUTOPLAY_INTERVAL, SWIPER_PARTS, clampSwiperIndex, connectSwiper, createSwiperProps, getSwiperSlides, resolveSwiperDragOffset, resolveSwiperState, stepSwiperIndex, swiperMachine };
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { type Machine, type Service } from "@zag-js/core";
|
|
2
|
+
import type { NormalizeProps, PropTypes } from "@zag-js/types";
|
|
3
|
+
import { type IconState } from "../icon/index.js";
|
|
4
|
+
import type { PageIndicatorTone, QwPageIndicatorProps } from "../page-indicator/index.js";
|
|
5
|
+
/** Main axis of the slides. */
|
|
6
|
+
export declare const SWIPER_DIRECTIONS: readonly ["horizontal", "vertical"];
|
|
7
|
+
/** Stable DOM parts shared by every adapter. */
|
|
8
|
+
export declare const SWIPER_PARTS: readonly ["root", "viewport", "track", "slide", "prev", "next", "autoplay-toggle", "indicator"];
|
|
9
|
+
/** Slides beyond this count are ignored (keeps labels and indicator bounded). */
|
|
10
|
+
export declare const SWIPER_MAX_SLIDES = 100;
|
|
11
|
+
/** Gesture contract: share of the viewport that commits a page; flicks commit earlier (see gesture.ts). */
|
|
12
|
+
export declare const SWIPER_DISTANCE_RATIO = 0.25;
|
|
13
|
+
/** Drag resistance past a non-loop boundary. */
|
|
14
|
+
export declare const SWIPER_EDGE_RESISTANCE = 0.35;
|
|
15
|
+
export declare const SWIPER_DEFAULT_AUTOPLAY_INTERVAL = 3000;
|
|
16
|
+
export declare const SWIPER_MIN_AUTOPLAY_INTERVAL = 1000;
|
|
17
|
+
export type SwiperDirection = (typeof SWIPER_DIRECTIONS)[number];
|
|
18
|
+
/** Requested 0-based slide; controlled owners accept by updating `index`. */
|
|
19
|
+
export interface SwiperIndexChangeDetails {
|
|
20
|
+
index: number;
|
|
21
|
+
}
|
|
22
|
+
/** Scalar, SSR-safe contract. Slide content stays caller-owned; adapters pass the slide count. */
|
|
23
|
+
export interface QwSwiperProps {
|
|
24
|
+
/** Page-unique instance identity; adapters generate one when omitted. */
|
|
25
|
+
id?: string;
|
|
26
|
+
/** Number of slides rendered by the adapter (children / slots / slide channels). */
|
|
27
|
+
count?: number;
|
|
28
|
+
/** Controlled 0-based slide. Undefined enables Core-owned state. */
|
|
29
|
+
index?: number;
|
|
30
|
+
/** Initial Core-owned slide; defaults to 0. */
|
|
31
|
+
defaultIndex?: number;
|
|
32
|
+
/** Wrap from the last slide to the first (and back). Off by default. */
|
|
33
|
+
loop?: boolean;
|
|
34
|
+
direction?: SwiperDirection;
|
|
35
|
+
/** Pointer/touch dragging; defaults to true. Keyboard and buttons keep working when false. */
|
|
36
|
+
allowTouchMove?: boolean;
|
|
37
|
+
/** Carousel name; defaults to 轮播. */
|
|
38
|
+
label?: string;
|
|
39
|
+
/** Slide name with {page}/{total}; defaults to 第 {page} 张,共 {total} 张. */
|
|
40
|
+
slideLabelTemplate?: string;
|
|
41
|
+
/** Render the shared PageIndicator; defaults to true. */
|
|
42
|
+
indicator?: boolean;
|
|
43
|
+
indicatorTone?: PageIndicatorTone;
|
|
44
|
+
/** Render previous/next buttons (recommended when screen-reader users must browse slides). */
|
|
45
|
+
navigation?: boolean;
|
|
46
|
+
prevLabel?: string;
|
|
47
|
+
nextLabel?: string;
|
|
48
|
+
/** Rotate automatically; pauses on hover/focus/drag, starts stopped under reduced motion, with a stop/start button. */
|
|
49
|
+
autoplay?: boolean;
|
|
50
|
+
/** Milliseconds between rotations; defaults to 3000, minimum 1000. */
|
|
51
|
+
autoplayInterval?: number;
|
|
52
|
+
pauseLabel?: string;
|
|
53
|
+
playLabel?: string;
|
|
54
|
+
onIndexChange?: (details: SwiperIndexChangeDetails) => void;
|
|
55
|
+
}
|
|
56
|
+
export interface ResolvedSwiperState {
|
|
57
|
+
count: number;
|
|
58
|
+
loop: boolean;
|
|
59
|
+
direction: SwiperDirection;
|
|
60
|
+
allowTouchMove: boolean;
|
|
61
|
+
label: string;
|
|
62
|
+
slideLabelTemplate: string;
|
|
63
|
+
indicator: boolean;
|
|
64
|
+
indicatorTone: PageIndicatorTone;
|
|
65
|
+
navigation: boolean;
|
|
66
|
+
prevLabel: string;
|
|
67
|
+
nextLabel: string;
|
|
68
|
+
autoplay: boolean;
|
|
69
|
+
autoplayInterval: number;
|
|
70
|
+
pauseLabel: string;
|
|
71
|
+
playLabel: string;
|
|
72
|
+
}
|
|
73
|
+
export interface SwiperSlide {
|
|
74
|
+
index: number;
|
|
75
|
+
key: string;
|
|
76
|
+
label: string;
|
|
77
|
+
current: boolean;
|
|
78
|
+
}
|
|
79
|
+
export declare function resolveSwiperState(props?: QwSwiperProps): ResolvedSwiperState;
|
|
80
|
+
/** Any requested index rendered against the live count: empty is 0, otherwise clamped. */
|
|
81
|
+
export declare function clampSwiperIndex(state: Pick<ResolvedSwiperState, "count">, index: number): number;
|
|
82
|
+
/** One step forward/back. Loop wraps; otherwise the boundary holds (returns the same index). */
|
|
83
|
+
export declare function stepSwiperIndex(state: Pick<ResolvedSwiperState, "count" | "loop">, current: number, delta: -1 | 1): number;
|
|
84
|
+
/** Physical drag offset with resistance when pulling past a non-loop boundary. `progress` is the logical forward distance. */
|
|
85
|
+
export declare function resolveSwiperDragOffset(state: Pick<ResolvedSwiperState, "count" | "loop">, current: number, delta: number, progress: number): number;
|
|
86
|
+
export declare function getSwiperSlides(state: ResolvedSwiperState, current: number): SwiperSlide[];
|
|
87
|
+
export declare function createSwiperProps(props?: QwSwiperProps): QwSwiperProps;
|
|
88
|
+
export interface QwSwiperSchema {
|
|
89
|
+
props: QwSwiperProps;
|
|
90
|
+
context: {
|
|
91
|
+
index: number;
|
|
92
|
+
offset: number;
|
|
93
|
+
dragging: boolean;
|
|
94
|
+
size: number;
|
|
95
|
+
rtl: boolean;
|
|
96
|
+
hovered: boolean;
|
|
97
|
+
focused: boolean;
|
|
98
|
+
stopped: boolean;
|
|
99
|
+
};
|
|
100
|
+
refs: {
|
|
101
|
+
reschedule: (() => void) | null;
|
|
102
|
+
};
|
|
103
|
+
state: "ready";
|
|
104
|
+
action: "setIndex" | "step" | "dragMove" | "dragEnd" | "measure" | "setHovered" | "setFocused" | "toggleAutoplay" | "setStopped" | "tick" | "clampIndex" | "reschedule";
|
|
105
|
+
effect: "trackGestures" | "autoplay";
|
|
106
|
+
event: {
|
|
107
|
+
type: "INDEX.SET";
|
|
108
|
+
value: number;
|
|
109
|
+
} | {
|
|
110
|
+
type: "STEP";
|
|
111
|
+
delta: -1 | 1;
|
|
112
|
+
} | {
|
|
113
|
+
type: "DRAG.MOVE";
|
|
114
|
+
offset: number;
|
|
115
|
+
} | {
|
|
116
|
+
type: "DRAG.END";
|
|
117
|
+
intent: -1 | 0 | 1;
|
|
118
|
+
} | {
|
|
119
|
+
type: "MEASURE";
|
|
120
|
+
size: number;
|
|
121
|
+
rtl: boolean;
|
|
122
|
+
} | {
|
|
123
|
+
type: "HOVER.SET";
|
|
124
|
+
value: boolean;
|
|
125
|
+
} | {
|
|
126
|
+
type: "FOCUS.SET";
|
|
127
|
+
value: boolean;
|
|
128
|
+
} | {
|
|
129
|
+
type: "AUTOPLAY.TOGGLE";
|
|
130
|
+
} | {
|
|
131
|
+
type: "AUTOPLAY.STOP";
|
|
132
|
+
} | {
|
|
133
|
+
type: "AUTOPLAY.TICK";
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
export type QwSwiperMachine = Machine<QwSwiperSchema>;
|
|
137
|
+
export type QwSwiperService = Service<QwSwiperSchema>;
|
|
138
|
+
/** Core owns paging, gestures, measurement, autoplay timers and cleanup; adapters only render parts. */
|
|
139
|
+
export declare const swiperMachine: QwSwiperMachine;
|
|
140
|
+
export interface QwSwiperApi<T extends PropTypes = PropTypes> {
|
|
141
|
+
index: number;
|
|
142
|
+
count: number;
|
|
143
|
+
dragging: boolean;
|
|
144
|
+
direction: SwiperDirection;
|
|
145
|
+
/** Autoplay is armed (not stopped by the user). */
|
|
146
|
+
autoplaying: boolean;
|
|
147
|
+
slides: SwiperSlide[];
|
|
148
|
+
/** Ready-made PageIndicator input; adapters spread it on the shared PageIndicator component/element. */
|
|
149
|
+
indicatorProps: QwPageIndicatorProps;
|
|
150
|
+
autoplayToggleLabel: string;
|
|
151
|
+
swipeTo(index: number): void;
|
|
152
|
+
swipeNext(): void;
|
|
153
|
+
swipePrev(): void;
|
|
154
|
+
toggleAutoplay(): void;
|
|
155
|
+
getRootProps(): T["element"];
|
|
156
|
+
getViewportProps(): T["element"];
|
|
157
|
+
getTrackProps(): T["element"];
|
|
158
|
+
getSlideProps(slide: SwiperSlide): T["element"];
|
|
159
|
+
getPrevProps(): T["button"];
|
|
160
|
+
getNextProps(): T["button"];
|
|
161
|
+
getAutoplayToggleProps(): T["button"];
|
|
162
|
+
getIndicatorProps(): T["element"];
|
|
163
|
+
getPrevIconState(): IconState;
|
|
164
|
+
getNextIconState(): IconState;
|
|
165
|
+
getAutoplayIconState(): IconState;
|
|
166
|
+
}
|
|
167
|
+
export interface SwiperDomEvent {
|
|
168
|
+
key: string;
|
|
169
|
+
target: unknown;
|
|
170
|
+
currentTarget: unknown;
|
|
171
|
+
defaultPrevented: boolean;
|
|
172
|
+
preventDefault(): void;
|
|
173
|
+
}
|
|
174
|
+
export interface SwiperConnectOptions {
|
|
175
|
+
onKeyDown?(event: SwiperDomEvent): void;
|
|
176
|
+
}
|
|
177
|
+
export declare function connectSwiper<T extends PropTypes>(service: QwSwiperService, normalize: NormalizeProps<T>, options?: SwiperConnectOptions): QwSwiperApi<T>;
|