@ui-sdk/web 0.0.0-stage → 0.1.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/README.md +10 -2
- package/browser/web/accordion.js +1 -0
- package/browser/web/alert-dialog.js +1 -0
- package/browser/web/autocomplete.js +1 -0
- package/browser/web/avatar.js +1 -0
- package/browser/web/button.js +1 -0
- package/browser/web/calendar.js +1 -0
- package/browser/web/carousel.js +1 -0
- package/browser/web/checkbox.js +1 -0
- package/browser/web/chunks/0eRGibL6.js +1 -0
- package/browser/web/chunks/2bIEUO6_.js +1 -0
- package/browser/web/chunks/5A9w2ULz.js +1 -0
- package/browser/web/chunks/5RSyydjV.js +1 -0
- package/browser/web/chunks/9pWTy2wl.js +1 -0
- package/browser/web/chunks/B0f2j6zz.js +1 -0
- package/browser/web/chunks/B1rux6br.js +1 -0
- package/browser/web/chunks/B3-APaNf.js +1 -0
- package/browser/web/chunks/B7EgSgjQ.js +1 -0
- package/browser/web/chunks/B8QcOzJU.js +1 -0
- package/browser/web/chunks/BFueEkwm.js +3 -0
- package/browser/web/chunks/BJj3oS29.js +1 -0
- package/browser/web/chunks/BNSvTCpr.js +1 -0
- package/browser/web/chunks/BPD0kAZB.js +1 -0
- package/browser/web/chunks/BQeduZqT.js +1 -0
- package/browser/web/chunks/B_CVFyiz.js +1 -0
- package/browser/web/chunks/B_ns1YHO.js +1 -0
- package/browser/web/chunks/BcwkVTsR.js +1 -0
- package/browser/web/chunks/BeaQ6TYM.js +1 -0
- package/browser/web/chunks/BgBB013u.js +1 -0
- package/browser/web/chunks/BgsKhHDm.js +1 -0
- package/browser/web/chunks/BjMcbuhi.js +9 -0
- package/browser/web/chunks/Bjiy_F2N.js +1 -0
- package/browser/web/chunks/BqScCLwv.js +1 -0
- package/browser/web/chunks/BqX3Utqx.js +1 -0
- package/browser/web/chunks/BtVkQf3z.js +1 -0
- package/browser/web/chunks/By30h-7B.js +1 -0
- package/browser/web/chunks/C1zqYpy2.js +1 -0
- package/browser/web/chunks/C436juFf.js +1 -0
- package/browser/web/chunks/C4_bULs1.js +1 -0
- package/browser/web/chunks/C4omqJEz.js +1 -0
- package/browser/web/chunks/C7tt0T3n.js +1 -0
- package/browser/web/chunks/C8w7s5dg.js +1 -0
- package/browser/web/chunks/CElY4erO.js +1 -0
- package/browser/web/chunks/CFODo-m2.js +1 -0
- package/browser/web/chunks/CL4wjam9.js +1 -0
- package/browser/web/chunks/CMg-8UVf.js +1 -0
- package/browser/web/chunks/COWKfakj.js +1 -0
- package/browser/web/chunks/CQBU0qZ4.js +1 -0
- package/browser/web/chunks/CV6uABgc.js +1 -0
- package/browser/web/chunks/C_SWFpWQ.js +1 -0
- package/browser/web/chunks/C_Uanbrl.js +1 -0
- package/browser/web/chunks/Ce_CSanC.js +1 -0
- package/browser/web/chunks/Cg-ZmRhS.js +1 -0
- package/browser/web/chunks/Cgf2wPI_.js +1 -0
- package/browser/web/chunks/Cuep_3Vf.js +1 -0
- package/browser/web/chunks/D02PaHn6.js +1 -0
- package/browser/web/chunks/D5LiaI5R.js +1 -0
- package/browser/web/chunks/D9UgVYvF.js +1 -0
- package/browser/web/chunks/DC08tnkE.js +2 -0
- package/browser/web/chunks/DG8YGSvu.js +1 -0
- package/browser/web/chunks/DIQd0FYD.js +1 -0
- package/browser/web/chunks/DMLqacE8.js +1 -0
- package/browser/web/chunks/DSUI3yI-.js +1 -0
- package/browser/web/chunks/DT3Hb76X.js +1 -0
- package/browser/web/chunks/DY75g3-W.js +1 -0
- package/browser/web/chunks/DZpNQKZ9.js +1 -0
- package/browser/web/chunks/Db-W1wrC.js +1 -0
- package/browser/web/chunks/Dc1xK3Ii.js +1 -0
- package/browser/web/chunks/DdF6awFs.js +1 -0
- package/browser/web/chunks/DdaCLml8.js +1 -0
- package/browser/web/chunks/Dh8MLjQO.js +1 -0
- package/browser/web/chunks/DiuslJRy.js +1 -0
- package/browser/web/chunks/DjRcw3Y0.js +1 -0
- package/browser/web/chunks/Djdv-16J.js +1 -0
- package/browser/web/chunks/DnFXe_lF.js +1 -0
- package/browser/web/chunks/DneGv1oC.js +1 -0
- package/browser/web/chunks/DsVxP-p-.js +1 -0
- package/browser/web/chunks/DwDilCo2.js +1 -0
- package/browser/web/chunks/DwV48AXv.js +1 -0
- package/browser/web/chunks/F37aF4-L.js +1 -0
- package/browser/web/chunks/LyB6XIbN.js +1 -0
- package/browser/web/chunks/NKnbYGjC.js +1 -0
- package/browser/web/chunks/Vk-rVi16.js +1 -0
- package/browser/web/chunks/XsM0J1Ex.js +1 -0
- package/browser/web/chunks/asSN9iEp.js +1 -0
- package/browser/web/chunks/c-AjHfdF.js +1 -0
- package/browser/web/chunks/dR-12TPY.js +1 -0
- package/browser/web/chunks/hR4xM0EC.js +1 -0
- package/browser/web/chunks/hqOaBxAg.js +1 -0
- package/browser/web/chunks/kMKqqeG4.js +1 -0
- package/browser/web/chunks/kXboBcfi.js +1 -0
- package/browser/web/chunks/l4aQIg22.js +1 -0
- package/browser/web/chunks/tJC0JSU4.js +1 -0
- package/browser/web/chunks/wHdS_QYM.js +1 -0
- package/browser/web/chunks/yv8dTvNI.js +1 -0
- package/browser/web/chunks/yw9M3nfi.js +1 -0
- package/browser/web/collapsible.js +1 -0
- package/browser/web/color-picker.js +1 -0
- package/browser/web/combobox.js +2 -0
- package/browser/web/command.js +1 -0
- package/browser/web/core.js +5 -0
- package/browser/web/date-input.js +1 -0
- package/browser/web/date-picker.js +1 -0
- package/browser/web/dialog.js +1 -0
- package/browser/web/drawer.js +1 -0
- package/browser/web/field.js +1 -0
- package/browser/web/file-input.js +1 -0
- package/browser/web/hover-card.js +1 -0
- package/browser/web/image-cropper.js +1 -0
- package/browser/web/input.js +1 -0
- package/browser/web/label.js +1 -0
- package/browser/web/listbox.js +1 -0
- package/browser/web/menu.js +1 -0
- package/browser/web/menubar.js +1 -0
- package/browser/web/meter.js +1 -0
- package/browser/web/navigation-menu.js +1 -0
- package/browser/web/number-input.js +1 -0
- package/browser/web/otp-input.js +2 -0
- package/browser/web/overlays.js +1 -0
- package/browser/web/pagination.js +1 -0
- package/browser/web/password-input.js +1 -0
- package/browser/web/popover.js +1 -0
- package/browser/web/preferences.js +1 -0
- package/browser/web/progress.js +1 -0
- package/browser/web/radio.js +1 -0
- package/browser/web/rating.js +1 -0
- package/browser/web/resizable.js +1 -0
- package/browser/web/scroll-area.js +1 -0
- package/browser/web/segmented-control.js +1 -0
- package/browser/web/select.js +1 -0
- package/browser/web/separator.js +1 -0
- package/browser/web/slider.js +1 -0
- package/browser/web/switch.js +1 -0
- package/browser/web/tabs.js +1 -0
- package/browser/web/textarea.js +1 -0
- package/browser/web/time-input.js +1 -0
- package/browser/web/timeline.js +1 -0
- package/browser/web/toast.js +1 -0
- package/browser/web/toggle.js +1 -0
- package/browser/web/token-input.js +8 -0
- package/browser/web/toolbar.js +1 -0
- package/browser/web/tooltip.js +1 -0
- package/browser/web/tree.js +1 -0
- package/browser/web/trigger-menu.js +4 -0
- package/browser/web/waterfall.js +1 -0
- package/browser/web.css +3378 -0
- package/browser/web.js +3 -0
- package/custom-elements.json +32315 -0
- package/dist/accordion.d.ts +2 -0
- package/dist/accordion.js +57 -0
- package/dist/action.d.ts +16 -0
- package/dist/action.js +39 -0
- package/dist/agent.d.ts +2 -0
- package/dist/agent.js +7 -0
- package/dist/autocomplete.d.ts +2 -0
- package/dist/autocomplete.js +120 -0
- package/dist/autoload.d.ts +18 -0
- package/dist/autoload.js +63 -0
- package/dist/avatar.d.ts +2 -0
- package/dist/avatar.js +27 -0
- package/dist/browser-core.d.ts +2 -0
- package/dist/browser-core.js +8 -0
- package/dist/button.d.ts +2 -0
- package/dist/button.js +35 -0
- package/dist/calendar.d.ts +23 -0
- package/dist/calendar.js +429 -0
- package/dist/carousel.d.ts +2 -0
- package/dist/carousel.js +54 -0
- package/dist/checkbox.d.ts +4 -0
- package/dist/checkbox.js +75 -0
- package/dist/collapsible.d.ts +2 -0
- package/dist/collapsible.js +28 -0
- package/dist/color-picker.d.ts +2 -0
- package/dist/color-picker.js +64 -0
- package/dist/combobox.d.ts +2 -0
- package/dist/combobox.js +334 -0
- package/dist/command.d.ts +2 -0
- package/dist/command.js +122 -0
- package/dist/date-input.d.ts +3 -0
- package/dist/date-input.js +87 -0
- package/dist/date-picker.d.ts +2 -0
- package/dist/date-picker.js +174 -0
- package/dist/default-text.d.ts +3 -0
- package/dist/default-text.js +24 -0
- package/dist/define-element.d.ts +404 -0
- package/dist/define-element.js +1489 -0
- package/dist/dialog.d.ts +3 -0
- package/dist/dialog.js +94 -0
- package/dist/drawer.d.ts +2 -0
- package/dist/drawer.js +96 -0
- package/dist/entries/accordion.d.ts +3 -0
- package/dist/entries/accordion.js +7 -0
- package/dist/entries/alert-dialog.d.ts +3 -0
- package/dist/entries/alert-dialog.js +13 -0
- package/dist/entries/autocomplete.d.ts +3 -0
- package/dist/entries/autocomplete.js +7 -0
- package/dist/entries/avatar.d.ts +2 -0
- package/dist/entries/avatar.js +3 -0
- package/dist/entries/button.d.ts +2 -0
- package/dist/entries/button.js +3 -0
- package/dist/entries/calendar.d.ts +3 -0
- package/dist/entries/calendar.js +7 -0
- package/dist/entries/carousel.d.ts +3 -0
- package/dist/entries/carousel.js +7 -0
- package/dist/entries/checkbox.d.ts +3 -0
- package/dist/entries/checkbox.js +15 -0
- package/dist/entries/collapsible.d.ts +3 -0
- package/dist/entries/collapsible.js +7 -0
- package/dist/entries/color-picker.d.ts +3 -0
- package/dist/entries/color-picker.js +7 -0
- package/dist/entries/combobox.d.ts +3 -0
- package/dist/entries/combobox.js +7 -0
- package/dist/entries/command.d.ts +3 -0
- package/dist/entries/command.js +7 -0
- package/dist/entries/date-input.d.ts +3 -0
- package/dist/entries/date-input.js +7 -0
- package/dist/entries/date-picker.d.ts +3 -0
- package/dist/entries/date-picker.js +7 -0
- package/dist/entries/dialog.d.ts +3 -0
- package/dist/entries/dialog.js +7 -0
- package/dist/entries/drawer.d.ts +3 -0
- package/dist/entries/drawer.js +8 -0
- package/dist/entries/field.d.ts +2 -0
- package/dist/entries/field.js +3 -0
- package/dist/entries/file-input.d.ts +3 -0
- package/dist/entries/file-input.js +13 -0
- package/dist/entries/hover-card.d.ts +3 -0
- package/dist/entries/hover-card.js +7 -0
- package/dist/entries/image-cropper.d.ts +3 -0
- package/dist/entries/image-cropper.js +7 -0
- package/dist/entries/input.d.ts +3 -0
- package/dist/entries/input.js +8 -0
- package/dist/entries/label.d.ts +2 -0
- package/dist/entries/label.js +3 -0
- package/dist/entries/listbox.d.ts +3 -0
- package/dist/entries/listbox.js +7 -0
- package/dist/entries/menu.d.ts +3 -0
- package/dist/entries/menu.js +7 -0
- package/dist/entries/menubar.d.ts +3 -0
- package/dist/entries/menubar.js +7 -0
- package/dist/entries/meter.d.ts +2 -0
- package/dist/entries/meter.js +3 -0
- package/dist/entries/navigation-menu.d.ts +3 -0
- package/dist/entries/navigation-menu.js +7 -0
- package/dist/entries/number-input.d.ts +3 -0
- package/dist/entries/number-input.js +7 -0
- package/dist/entries/otp-input.d.ts +3 -0
- package/dist/entries/otp-input.js +7 -0
- package/dist/entries/overlays.d.ts +2 -0
- package/dist/entries/overlays.js +3 -0
- package/dist/entries/pagination.d.ts +3 -0
- package/dist/entries/pagination.js +11 -0
- package/dist/entries/password-input.d.ts +3 -0
- package/dist/entries/password-input.js +7 -0
- package/dist/entries/popover.d.ts +3 -0
- package/dist/entries/popover.js +7 -0
- package/dist/entries/preferences.d.ts +3 -0
- package/dist/entries/preferences.js +13 -0
- package/dist/entries/progress.d.ts +2 -0
- package/dist/entries/progress.js +3 -0
- package/dist/entries/radio.d.ts +3 -0
- package/dist/entries/radio.js +7 -0
- package/dist/entries/rating.d.ts +3 -0
- package/dist/entries/rating.js +8 -0
- package/dist/entries/resizable.d.ts +3 -0
- package/dist/entries/resizable.js +11 -0
- package/dist/entries/scroll-area.d.ts +3 -0
- package/dist/entries/scroll-area.js +7 -0
- package/dist/entries/segmented-control.d.ts +3 -0
- package/dist/entries/segmented-control.js +7 -0
- package/dist/entries/select.d.ts +3 -0
- package/dist/entries/select.js +7 -0
- package/dist/entries/separator.d.ts +2 -0
- package/dist/entries/separator.js +3 -0
- package/dist/entries/slider.d.ts +3 -0
- package/dist/entries/slider.js +7 -0
- package/dist/entries/switch.d.ts +3 -0
- package/dist/entries/switch.js +7 -0
- package/dist/entries/tabs.d.ts +3 -0
- package/dist/entries/tabs.js +7 -0
- package/dist/entries/textarea.d.ts +3 -0
- package/dist/entries/textarea.js +7 -0
- package/dist/entries/time-input.d.ts +3 -0
- package/dist/entries/time-input.js +7 -0
- package/dist/entries/timeline.d.ts +3 -0
- package/dist/entries/timeline.js +7 -0
- package/dist/entries/toast.d.ts +2 -0
- package/dist/entries/toast.js +3 -0
- package/dist/entries/toggle.d.ts +3 -0
- package/dist/entries/toggle.js +12 -0
- package/dist/entries/token-input.d.ts +3 -0
- package/dist/entries/token-input.js +17 -0
- package/dist/entries/toolbar.d.ts +3 -0
- package/dist/entries/toolbar.js +7 -0
- package/dist/entries/tooltip.d.ts +3 -0
- package/dist/entries/tooltip.js +7 -0
- package/dist/entries/tree.d.ts +3 -0
- package/dist/entries/tree.js +17 -0
- package/dist/entries/trigger-menu.d.ts +3 -0
- package/dist/entries/trigger-menu.js +11 -0
- package/dist/entries/waterfall.d.ts +3 -0
- package/dist/entries/waterfall.js +11 -0
- package/dist/events.d.ts +1658 -0
- package/dist/events.js +0 -0
- package/dist/field.d.ts +2 -0
- package/dist/field.js +101 -0
- package/dist/file-input.d.ts +2 -0
- package/dist/file-input.js +140 -0
- package/dist/forward-attributes.d.ts +2 -0
- package/dist/forward-attributes.js +22 -0
- package/dist/history.d.ts +2 -0
- package/dist/history.js +11 -0
- package/dist/hover-card.d.ts +2 -0
- package/dist/hover-card.js +31 -0
- package/dist/image-cropper.d.ts +2 -0
- package/dist/image-cropper.js +66 -0
- package/dist/index.d.ts +66 -0
- package/dist/index.js +269 -0
- package/dist/input.d.ts +3 -0
- package/dist/input.js +69 -0
- package/dist/label.d.ts +2 -0
- package/dist/label.js +11 -0
- package/dist/list.d.ts +40 -0
- package/dist/list.js +192 -0
- package/dist/listbox.d.ts +2 -0
- package/dist/listbox.js +84 -0
- package/dist/menu.d.ts +4 -0
- package/dist/menu.js +295 -0
- package/dist/menubar.d.ts +4 -0
- package/dist/menubar.js +30 -0
- package/dist/meter.d.ts +2 -0
- package/dist/meter.js +22 -0
- package/dist/navigation-menu.d.ts +2 -0
- package/dist/navigation-menu.js +114 -0
- package/dist/number-input.d.ts +2 -0
- package/dist/number-input.js +73 -0
- package/dist/observe.d.ts +2 -0
- package/dist/observe.js +7 -0
- package/dist/otp-input.d.ts +2 -0
- package/dist/otp-input.js +72 -0
- package/dist/overlays.d.ts +13 -0
- package/dist/overlays.js +156 -0
- package/dist/pagination.d.ts +2 -0
- package/dist/pagination.js +127 -0
- package/dist/password-input.d.ts +2 -0
- package/dist/password-input.js +57 -0
- package/dist/popover.d.ts +2 -0
- package/dist/popover.js +64 -0
- package/dist/popup.d.ts +40 -0
- package/dist/popup.js +112 -0
- package/dist/preferences.d.ts +2 -0
- package/dist/preferences.js +56 -0
- package/dist/progress.d.ts +2 -0
- package/dist/progress.js +22 -0
- package/dist/radio.d.ts +2 -0
- package/dist/radio.js +33 -0
- package/dist/rating.d.ts +2 -0
- package/dist/rating.js +64 -0
- package/dist/resizable.d.ts +2 -0
- package/dist/resizable.js +42 -0
- package/dist/scroll-area.d.ts +2 -0
- package/dist/scroll-area.js +45 -0
- package/dist/segmented-control.d.ts +2 -0
- package/dist/segmented-control.js +28 -0
- package/dist/select.d.ts +2 -0
- package/dist/select.js +239 -0
- package/dist/separator.d.ts +2 -0
- package/dist/separator.js +11 -0
- package/dist/slider.d.ts +2 -0
- package/dist/slider.js +77 -0
- package/dist/tabs.d.ts +2 -0
- package/dist/tabs.js +37 -0
- package/dist/timeline.d.ts +2 -0
- package/dist/timeline.js +27 -0
- package/dist/toast.d.ts +20 -0
- package/dist/toast.js +177 -0
- package/dist/toggle.d.ts +3 -0
- package/dist/toggle.js +64 -0
- package/dist/token-input.d.ts +2 -0
- package/dist/token-input.js +103 -0
- package/dist/toolbar.d.ts +2 -0
- package/dist/toolbar.js +36 -0
- package/dist/tooltip.d.ts +2 -0
- package/dist/tooltip.js +35 -0
- package/dist/tree.d.ts +2 -0
- package/dist/tree.js +147 -0
- package/dist/trigger-menu.d.ts +2 -0
- package/dist/trigger-menu.js +133 -0
- package/dist/waterfall.d.ts +2 -0
- package/dist/waterfall.js +140 -0
- package/docs/README.md +89 -0
- package/docs/agents.md +1523 -0
- package/docs/components/accordion.md +1401 -0
- package/docs/components/alert-dialog.md +788 -0
- package/docs/components/autocomplete.md +1692 -0
- package/docs/components/avatar.md +261 -0
- package/docs/components/button.md +441 -0
- package/docs/components/calendar.md +1536 -0
- package/docs/components/carousel.md +1055 -0
- package/docs/components/checkbox.md +1045 -0
- package/docs/components/collapsible.md +535 -0
- package/docs/components/color-picker.md +651 -0
- package/docs/components/combobox.md +3274 -0
- package/docs/components/command.md +1431 -0
- package/docs/components/date-input.md +563 -0
- package/docs/components/date-picker.md +1136 -0
- package/docs/components/dialog.md +1360 -0
- package/docs/components/drawer.md +1201 -0
- package/docs/components/field.md +519 -0
- package/docs/components/file-input.md +617 -0
- package/docs/components/hover-card.md +486 -0
- package/docs/components/image-cropper.md +489 -0
- package/docs/components/input.md +327 -0
- package/docs/components/label.md +208 -0
- package/docs/components/listbox.md +1015 -0
- package/docs/components/menu.md +1212 -0
- package/docs/components/menubar.md +460 -0
- package/docs/components/meter.md +298 -0
- package/docs/components/navigation-menu.md +1573 -0
- package/docs/components/number-input.md +1087 -0
- package/docs/components/otp-input.md +558 -0
- package/docs/components/pagination.md +639 -0
- package/docs/components/password-input.md +649 -0
- package/docs/components/popover.md +1433 -0
- package/docs/components/preferences.md +243 -0
- package/docs/components/progress.md +406 -0
- package/docs/components/radio.md +855 -0
- package/docs/components/rating.md +431 -0
- package/docs/components/resizable.md +866 -0
- package/docs/components/scroll-area.md +898 -0
- package/docs/components/segmented-control.md +421 -0
- package/docs/components/select.md +1957 -0
- package/docs/components/separator.md +238 -0
- package/docs/components/slider.md +1018 -0
- package/docs/components/switch.md +583 -0
- package/docs/components/tabs.md +948 -0
- package/docs/components/textarea.md +331 -0
- package/docs/components/time-input.md +235 -0
- package/docs/components/timeline.md +622 -0
- package/docs/components/toast.md +1223 -0
- package/docs/components/toggle.md +522 -0
- package/docs/components/token-input.md +854 -0
- package/docs/components/toolbar.md +815 -0
- package/docs/components/tooltip.md +860 -0
- package/docs/components/tree.md +1243 -0
- package/docs/components/trigger-menu.md +1110 -0
- package/docs/components/waterfall.md +709 -0
- package/docs/controllers.md +66 -0
- package/docs/core.md +8027 -0
- package/docs/custom-parts.md +91 -0
- package/docs/first-component.md +88 -0
- package/docs/forms.md +125 -0
- package/docs/installation.md +141 -0
- package/docs/introduction.md +32 -0
- package/docs/lists-and-menus.md +166 -0
- package/docs/llms.txt +1566 -0
- package/docs/parts-and-composition.md +57 -0
- package/docs/popups.md +92 -0
- package/docs/rendering.md +71 -0
- package/docs/server-rendering.md +118 -0
- package/docs/state-and-events.md +134 -0
- package/docs/styling-and-animation.md +104 -0
- package/docs/utilities/async-options.md +332 -0
- package/docs/utilities/shortcuts.md +184 -0
- package/html-custom-data.json +14792 -0
- package/package.json +302 -3
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
// src/trigger-menu.ts
|
|
2
|
+
import {
|
|
3
|
+
triggerMenu
|
|
4
|
+
} from "@ui-sdk/core/trigger-menu";
|
|
5
|
+
import {
|
|
6
|
+
createParts,
|
|
7
|
+
findOwner,
|
|
8
|
+
instanceOf,
|
|
9
|
+
wrappedChild
|
|
10
|
+
} from "./define-element.js";
|
|
11
|
+
import { copy, renderListItems, stashedEmpty, templateOf } from "./list.js";
|
|
12
|
+
import { popupKinds, popupPortal, popupState } from "./popup.js";
|
|
13
|
+
var owner = "ui-trigger-menu";
|
|
14
|
+
var automatic = /* @__PURE__ */ new WeakSet();
|
|
15
|
+
var automaticText = {
|
|
16
|
+
render(el) {
|
|
17
|
+
if (!el.childNodes.length) {
|
|
18
|
+
automatic.add(el);
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
context: (el) => ({ text: automatic.has(el) }),
|
|
22
|
+
kinds: { text: null }
|
|
23
|
+
};
|
|
24
|
+
function defineTriggerMenuElements() {
|
|
25
|
+
createParts(triggerMenu, {
|
|
26
|
+
root: {
|
|
27
|
+
tag: owner,
|
|
28
|
+
defaults: { autoHighlight: true, loop: true, dismissible: true },
|
|
29
|
+
display: "contents",
|
|
30
|
+
kinds: popupKinds,
|
|
31
|
+
options: (el) => {
|
|
32
|
+
const menu = el;
|
|
33
|
+
return {
|
|
34
|
+
triggers: menu.triggers ?? [],
|
|
35
|
+
// Nesting is the default: a menu inside a token input uses its editor.
|
|
36
|
+
editor: menu.editor ?? tokenInputEditor(el),
|
|
37
|
+
container: void 0
|
|
38
|
+
};
|
|
39
|
+
},
|
|
40
|
+
state: popupState,
|
|
41
|
+
api: [
|
|
42
|
+
"isOpen",
|
|
43
|
+
"setOpen",
|
|
44
|
+
"open",
|
|
45
|
+
"close",
|
|
46
|
+
"getQuery",
|
|
47
|
+
"getMatch",
|
|
48
|
+
"insert",
|
|
49
|
+
"focus"
|
|
50
|
+
],
|
|
51
|
+
// The field's own `select`, for selected text, bubbles up here.
|
|
52
|
+
events: { onSelect: "itemselect" },
|
|
53
|
+
portal: popupPortal,
|
|
54
|
+
// Data items follow the trigger, the level and the query.
|
|
55
|
+
render(el, { api, subscribe }) {
|
|
56
|
+
renderData(el, api);
|
|
57
|
+
return subscribe(() => renderData(el, api));
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
// A wrapper, so the field stays a real textarea or input.
|
|
61
|
+
input: {
|
|
62
|
+
tag: "ui-trigger-menu-input",
|
|
63
|
+
display: "contents",
|
|
64
|
+
target: wrappedChild("textarea, input")
|
|
65
|
+
},
|
|
66
|
+
content: { tag: "ui-trigger-menu-content", kinds: popupKinds },
|
|
67
|
+
list: { tag: "ui-trigger-menu-list", display: "block" },
|
|
68
|
+
item: { tag: "ui-trigger-menu-item", display: "block" },
|
|
69
|
+
// An icon inside a suggestion. Screen readers and filtering skip it.
|
|
70
|
+
"item-icon": "ui-trigger-menu-item-icon",
|
|
71
|
+
group: { tag: "ui-trigger-menu-group", display: "block" },
|
|
72
|
+
"group-label": { tag: "ui-trigger-menu-group-label", display: "block" },
|
|
73
|
+
separator: { tag: "ui-trigger-menu-separator", display: "block" },
|
|
74
|
+
empty: { tag: "ui-trigger-menu-empty", ...stashedEmpty },
|
|
75
|
+
// Without content, the status says the count and the keys.
|
|
76
|
+
status: {
|
|
77
|
+
tag: "ui-trigger-menu-status",
|
|
78
|
+
display: "block",
|
|
79
|
+
...automaticText
|
|
80
|
+
},
|
|
81
|
+
// Without content, the hint shows the arguments to type.
|
|
82
|
+
hint: { tag: "ui-trigger-menu-hint", ...automaticText }
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
function tokenInputEditor(el) {
|
|
86
|
+
return instanceOf(
|
|
87
|
+
findOwner(el, "ui-token-input")
|
|
88
|
+
)?.api.editor;
|
|
89
|
+
}
|
|
90
|
+
var generatedItems = /* @__PURE__ */ new WeakSet();
|
|
91
|
+
var rendered = /* @__PURE__ */ new WeakMap();
|
|
92
|
+
var contents = /* @__PURE__ */ new WeakMap();
|
|
93
|
+
function renderData(el, api) {
|
|
94
|
+
const template = templateOf(el);
|
|
95
|
+
let content = el.querySelector(":scope > ui-trigger-menu-content") ?? contents.get(el);
|
|
96
|
+
if (!content) {
|
|
97
|
+
content = copy(template, "ui-trigger-menu-content", false);
|
|
98
|
+
content.append(copy(template, "ui-trigger-menu-list", false));
|
|
99
|
+
el.append(content);
|
|
100
|
+
}
|
|
101
|
+
contents.set(el, content);
|
|
102
|
+
const list = content.querySelector("ui-trigger-menu-list");
|
|
103
|
+
if (!list) {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
const own = Array.from(list.querySelectorAll("ui-trigger-menu-item")).some(
|
|
107
|
+
(item) => {
|
|
108
|
+
const group = item.closest("ui-trigger-menu-group");
|
|
109
|
+
return !generatedItems.has(item) && !(group && generatedItems.has(group));
|
|
110
|
+
}
|
|
111
|
+
);
|
|
112
|
+
const visible = api.internal.listbox.visibleData()?.list ?? [];
|
|
113
|
+
if (own || rendered.get(list) === visible) {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
rendered.set(list, visible);
|
|
117
|
+
for (const child of Array.from(list.children)) {
|
|
118
|
+
if (generatedItems.has(child)) {
|
|
119
|
+
child.remove();
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
const fresh = renderListItems(
|
|
123
|
+
"ui-trigger-menu",
|
|
124
|
+
visible,
|
|
125
|
+
api.internal.keyOf,
|
|
126
|
+
template
|
|
127
|
+
);
|
|
128
|
+
fresh.forEach((item) => generatedItems.add(item));
|
|
129
|
+
list.prepend(...fresh);
|
|
130
|
+
}
|
|
131
|
+
export {
|
|
132
|
+
defineTriggerMenuElements
|
|
133
|
+
};
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
// src/waterfall.ts
|
|
2
|
+
import { partState } from "@ui-sdk/core/renderer";
|
|
3
|
+
import {
|
|
4
|
+
waterfall
|
|
5
|
+
} from "@ui-sdk/core/waterfall";
|
|
6
|
+
import { createParts } from "./define-element.js";
|
|
7
|
+
import { copy, templateOf } from "./list.js";
|
|
8
|
+
var owner = "ui-waterfall";
|
|
9
|
+
var generated = /* @__PURE__ */ new WeakSet();
|
|
10
|
+
var renderedItems = /* @__PURE__ */ new WeakMap();
|
|
11
|
+
var shownTicks = /* @__PURE__ */ new WeakMap();
|
|
12
|
+
var labeledTicks = /* @__PURE__ */ new WeakSet();
|
|
13
|
+
function renderRows(api, template) {
|
|
14
|
+
return api.internal.all().map((item) => {
|
|
15
|
+
const row = copy(template, "ui-waterfall-row", false);
|
|
16
|
+
row.setAttribute("value", item.value);
|
|
17
|
+
const header = copy(template, "ui-waterfall-row-header", false);
|
|
18
|
+
if (item.children) {
|
|
19
|
+
header.append(copy(template, "ui-waterfall-indicator"));
|
|
20
|
+
}
|
|
21
|
+
header.append(item.label);
|
|
22
|
+
row.append(header, copy(template, "ui-waterfall-bar"));
|
|
23
|
+
generated.add(row);
|
|
24
|
+
return row;
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
var own = (el) => Array.from(el.children).some((child) => !generated.has(child));
|
|
28
|
+
function renderTicks(el, instance) {
|
|
29
|
+
const axes = Array.from(
|
|
30
|
+
el.querySelectorAll("ui-waterfall-axis")
|
|
31
|
+
).filter((axis) => axis.closest(owner) === el && !own(axis));
|
|
32
|
+
for (const axis of axes) {
|
|
33
|
+
const max = Number(axis.getAttribute("max-ticks")) || void 0;
|
|
34
|
+
const { ticks } = partState(
|
|
35
|
+
instance.part("axis", { maxTicks: max })
|
|
36
|
+
);
|
|
37
|
+
const shown = ticks.map((tick) => `${tick.time}:${tick.label}`).join(",");
|
|
38
|
+
if (shownTicks.get(axis) === shown) {
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
shownTicks.set(axis, shown);
|
|
42
|
+
axis.replaceChildren(
|
|
43
|
+
...ticks.map((tick) => {
|
|
44
|
+
const child = axis.ownerDocument.createElement("ui-waterfall-tick");
|
|
45
|
+
child.setAttribute("time", String(tick.time));
|
|
46
|
+
child.textContent = tick.label;
|
|
47
|
+
generated.add(child);
|
|
48
|
+
return child;
|
|
49
|
+
})
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
for (const tick of el.querySelectorAll("ui-waterfall-tick")) {
|
|
53
|
+
if (tick.closest(owner) !== el || generated.has(tick) || !labeledTicks.has(tick) && tick.childNodes.length) {
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
labeledTicks.add(tick);
|
|
57
|
+
const { label } = partState(
|
|
58
|
+
instance.part("tick", { time: Number(tick.getAttribute("time")) })
|
|
59
|
+
);
|
|
60
|
+
if (tick.textContent !== label) {
|
|
61
|
+
tick.textContent = label;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
function defineWaterfallElements() {
|
|
66
|
+
createParts(waterfall, {
|
|
67
|
+
root: {
|
|
68
|
+
tag: owner,
|
|
69
|
+
display: "block",
|
|
70
|
+
state: {
|
|
71
|
+
value: {
|
|
72
|
+
get: (api) => api.getValue(),
|
|
73
|
+
set: (api, value) => api.setValue(value || null)
|
|
74
|
+
},
|
|
75
|
+
expanded: {
|
|
76
|
+
get: (api) => api.getExpanded(),
|
|
77
|
+
set: (api, value) => api.setExpanded(
|
|
78
|
+
typeof value === "string" ? value.split(",").map((item) => item.trim()).filter(Boolean) : value ?? []
|
|
79
|
+
)
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
api: [
|
|
83
|
+
"getValue",
|
|
84
|
+
"setValue",
|
|
85
|
+
"getExpanded",
|
|
86
|
+
"setExpanded",
|
|
87
|
+
"isExpanded",
|
|
88
|
+
"expand",
|
|
89
|
+
"collapse",
|
|
90
|
+
"toggle",
|
|
91
|
+
"expandAll",
|
|
92
|
+
"collapseAll",
|
|
93
|
+
"reveal",
|
|
94
|
+
"focus"
|
|
95
|
+
],
|
|
96
|
+
// Runs again whenever a property like `items` or `range` is set, so
|
|
97
|
+
// rows are rebuilt only for new `items`.
|
|
98
|
+
render(el, instance) {
|
|
99
|
+
const api = instance.api;
|
|
100
|
+
const items = api.internal.items();
|
|
101
|
+
if (renderedItems.get(el) !== items) {
|
|
102
|
+
renderedItems.set(el, items);
|
|
103
|
+
for (const child of Array.from(el.children)) {
|
|
104
|
+
if (generated.has(child) && child.localName === "ui-waterfall-row") {
|
|
105
|
+
child.remove();
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
if (!el.querySelector(":scope > ui-waterfall-row")) {
|
|
109
|
+
el.append(...renderRows(api, templateOf(el)));
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
const update = () => renderTicks(el, instance);
|
|
113
|
+
update();
|
|
114
|
+
const observer = new MutationObserver(update);
|
|
115
|
+
observer.observe(el, {
|
|
116
|
+
subtree: true,
|
|
117
|
+
attributeFilter: ["max-ticks", "time"]
|
|
118
|
+
});
|
|
119
|
+
const unsubscribe = instance.subscribe(update);
|
|
120
|
+
return () => {
|
|
121
|
+
observer.disconnect();
|
|
122
|
+
unsubscribe();
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
"header-row": { tag: "ui-waterfall-header-row", display: "block" },
|
|
127
|
+
"column-header": { tag: "ui-waterfall-column-header", display: "block" },
|
|
128
|
+
axis: { tag: "ui-waterfall-axis", display: "block" },
|
|
129
|
+
tick: "ui-waterfall-tick",
|
|
130
|
+
mark: "ui-waterfall-mark",
|
|
131
|
+
row: { tag: "ui-waterfall-row", display: "block" },
|
|
132
|
+
"row-header": { tag: "ui-waterfall-row-header", display: "block" },
|
|
133
|
+
indicator: "ui-waterfall-indicator",
|
|
134
|
+
cell: { tag: "ui-waterfall-cell", display: "block" },
|
|
135
|
+
bar: { tag: "ui-waterfall-bar", display: "block" }
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
export {
|
|
139
|
+
defineWaterfallElements
|
|
140
|
+
};
|
package/docs/README.md
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# @ui-sdk/web docs
|
|
2
|
+
|
|
3
|
+
The ui-sdk docs for Web Components, as Markdown. Every page here is generated from the same source as the docs site, for the release this package came from.
|
|
4
|
+
|
|
5
|
+
Start with [llms.txt](./llms.txt): how the components fit together, then an index of every component, in one file for an agent's context. Each page below has the rest.
|
|
6
|
+
|
|
7
|
+
## Core and Agents
|
|
8
|
+
|
|
9
|
+
- [Core](./core.md): Give your agents the behaviors to build headless and accessible components, with keyboard, focus and screen reader support built in. Every Core page in one file.
|
|
10
|
+
- [Agents](./agents.md): ui-sdk gives agents the building blocks to create components and the tools to use them. Every Agents page in one file.
|
|
11
|
+
|
|
12
|
+
## Components
|
|
13
|
+
|
|
14
|
+
- [Accordion](./components/accordion.md): Show and hide sections of content from their headings.
|
|
15
|
+
- [Alert Dialog](./components/alert-dialog.md): Ask someone to confirm an action before you continue.
|
|
16
|
+
- [Autocomplete](./components/autocomplete.md): Suggest text while someone types, without limiting what they can enter.
|
|
17
|
+
- [Avatar](./components/avatar.md): Show an image with a fallback while it loads or if it fails.
|
|
18
|
+
- [Button](./components/button.md): Run an action, show that it's working, and keep it reachable when disabled.
|
|
19
|
+
- [Calendar](./components/calendar.md): Choose one date, several dates, or a range from a month grid.
|
|
20
|
+
- [Carousel](./components/carousel.md): Page through slides with native scrolling, keyboard controls, and optional rotation.
|
|
21
|
+
- [Checkbox](./components/checkbox.md): Choose one or more options, individually or as a group.
|
|
22
|
+
- [Collapsible](./components/collapsible.md): Show and hide a panel, preserve its contents, and animate its height.
|
|
23
|
+
- [Color Picker](./components/color-picker.md): Choose a color by dragging across an area and along sliders, typing any CSS color, or picking a preset.
|
|
24
|
+
- [Combobox](./components/combobox.md): Search a list of options and choose one or several values.
|
|
25
|
+
- [Command](./components/command.md): Search commands, run actions, and open pages of more choices.
|
|
26
|
+
- [Date Input](./components/date-input.md): Type a date one part at a time, in the order your user's language writes it.
|
|
27
|
+
- [Date Picker](./components/date-picker.md): Type a date or choose one from a calendar, with support for ranges and forms.
|
|
28
|
+
- [Dialog](./components/dialog.md): Open a focused task over the page.
|
|
29
|
+
- [Drawer](./components/drawer.md): A sheet you can open, drag, and resize from an edge of the screen.
|
|
30
|
+
- [Field](./components/field.md): Connect a form control to its label, description, and validation errors.
|
|
31
|
+
- [File Input](./components/file-input.md): Choose, drop, or paste files, validate them, and submit them with a form.
|
|
32
|
+
- [Hover Card](./components/hover-card.md): Preview a link on hover or keyboard focus while keeping its normal navigation.
|
|
33
|
+
- [Image Cropper](./components/image-cropper.md): Choose the part of an image to keep by moving and resizing a selection, or by panning and zooming the image under it.
|
|
34
|
+
- [Input](./components/input.md): Enter text, add a clear button, and connect the value to your form or state.
|
|
35
|
+
- [Label](./components/label.md): Name any control with a label, and let a press on the label reach it.
|
|
36
|
+
- [Listbox](./components/listbox.md): Choose one or several options from an always-visible list.
|
|
37
|
+
- [Menu](./components/menu.md): Choose actions and settings from a button or a context menu.
|
|
38
|
+
- [Menubar](./components/menubar.md): Move between an application’s menus with one tab stop.
|
|
39
|
+
- [Meter](./components/meter.md): Show a measurement within a known range, such as storage used or an account quota.
|
|
40
|
+
- [Navigation Menu](./components/navigation-menu.md): Groups site links into panels that open from a row of triggers.
|
|
41
|
+
- [Number Input](./components/number-input.md): Enter numbers, step through values, and format them for a locale.
|
|
42
|
+
- [OTP Input](./components/otp-input.md): Enter a one-time code with support for pasting, autofill, and native form validation.
|
|
43
|
+
- [Pagination](./components/pagination.md): Navigate pages with buttons, links, or your router.
|
|
44
|
+
- [Password Input](./components/password-input.md): Enter a password, show or hide it, and use it in a native form.
|
|
45
|
+
- [Popover](./components/popover.md): Edit or explore something beside its trigger.
|
|
46
|
+
- [Preferences](./components/preferences.md): Apply user preferences to data attributes so your styles can follow them.
|
|
47
|
+
- [Progress](./components/progress.md): Show a task’s progress, or an indeterminate state while its progress is unknown.
|
|
48
|
+
- [Radio](./components/radio.md): Choose one option, move the selection with arrow keys, and submit it with a form.
|
|
49
|
+
- [Rating](./components/rating.md): Pick a score from a row of stars, whole or half, with a preview as the pointer moves over them.
|
|
50
|
+
- [Resizable](./components/resizable.md): Resize, collapse, and save panel layouts with pointer and keyboard controls.
|
|
51
|
+
- [Scroll Area](./components/scroll-area.md): Add styled scrollbars, edge indicators, and follow-to-end behavior to native scrolling.
|
|
52
|
+
- [Segmented Control](./components/segmented-control.md): Pick one of a few options from a row of buttons, with an indicator that slides to the choice.
|
|
53
|
+
- [Select](./components/select.md): Choose one value or several from a popup list.
|
|
54
|
+
- [Separator](./components/separator.md): Divide groups of content with a horizontal or vertical line.
|
|
55
|
+
- [Slider](./components/slider.md): Adjust a number or a range with draggable thumbs and keyboard controls.
|
|
56
|
+
- [Switch](./components/switch.md): Turn a setting on or off.
|
|
57
|
+
- [Tabs](./components/tabs.md): Switch between related panels with one tab selected at a time.
|
|
58
|
+
- [Textarea](./components/textarea.md): Enter multiple lines of text, grow the field as you type, and connect it to a form.
|
|
59
|
+
- [Time Input](./components/time-input.md): Type a time one part at a time, on the clock your user's language uses.
|
|
60
|
+
- [Timeline](./components/timeline.md): Show dated events in order, like an activity feed, a changelog or an order's progress, with arrow keys between them.
|
|
61
|
+
- [Toast](./components/toast.md): Show notifications with actions, timed dismissal, and screen reader announcements.
|
|
62
|
+
- [Toggle](./components/toggle.md): Keep a button pressed, or group toggles with a shared value and arrow-key navigation.
|
|
63
|
+
- [Token Input](./components/token-input.md): Mix editable text with tokens for files, people, tags, and other references.
|
|
64
|
+
- [Toolbar](./components/toolbar.md): Give buttons, toggles, menus and fields one tab stop with arrow-key navigation.
|
|
65
|
+
- [Tooltip](./components/tooltip.md): Name a control or add a short hint on hover and keyboard focus.
|
|
66
|
+
- [Tree](./components/tree.md): Browse a hierarchy of files, pages, or choices with expandable branches.
|
|
67
|
+
- [Trigger Menu](./components/trigger-menu.md): "Opens suggestions at the caret when you type a trigger such as @, /, or #."
|
|
68
|
+
- [Waterfall](./components/waterfall.md): Show a trace or a page's requests as bars on a shared time axis, with spans that expand to show what they started.
|
|
69
|
+
|
|
70
|
+
## Utilities
|
|
71
|
+
|
|
72
|
+
- [Async Options](./utilities/async-options.md): Load search results, cancel stale requests, and fetch the next page.
|
|
73
|
+
- [Shortcuts](./utilities/shortcuts.md): Register keyboard shortcuts and show the right keys for the user's platform.
|
|
74
|
+
|
|
75
|
+
## Framework Guides
|
|
76
|
+
|
|
77
|
+
- [Introduction](./introduction.md): Use unstyled custom elements with keyboard, focus, and screen reader support built in.
|
|
78
|
+
- [Installation](./installation.md): Install UI SDK and register its custom elements.
|
|
79
|
+
- [First Component](./first-component.md): Add a component to your page and style its state.
|
|
80
|
+
- [Parts and Composition](./parts-and-composition.md): Put a component's parts together and choose the elements they bind.
|
|
81
|
+
- [State and Events](./state-and-events.md): Set initial state, change properties, and respond to DOM events.
|
|
82
|
+
- [Styling and Animation](./styling-and-animation.md): Style the rendered elements and add entry and exit transitions.
|
|
83
|
+
- [Controllers](./controllers.md): Read and change a component from outside its parts.
|
|
84
|
+
- [Popups](./popups.md): Place popup content, control dismissal, and choose its container.
|
|
85
|
+
- [Lists and Menus](./lists-and-menus.md): Supply options as data, load them from a server, and define menu actions.
|
|
86
|
+
- [Forms](./forms.md): Submit custom element values, label controls, and show validation errors.
|
|
87
|
+
- [Server Rendering](./server-rendering.md): Send HTML from the server and upgrade custom elements in the browser.
|
|
88
|
+
- [Rendering Primitives](./rendering.md): Turn a Core primitive into custom elements with createParts.
|
|
89
|
+
- [Custom Parts](./custom-parts.md): Choose a binding target and expose the state of a custom element.
|