@rivetjs/cdk 0.0.0-stage → 0.1.0-alpha.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 +21 -0
- package/NOTICE +483 -0
- package/README.md +10 -2
- package/_adapters/collection.d.ts +160 -0
- package/_adapters/collection.js +235 -0
- package/_adapters/collections.d.ts +325 -0
- package/_adapters/collections.js +934 -0
- package/_adapters/dom-collection.d.ts +42 -0
- package/_adapters/dom-collection.js +228 -0
- package/_adapters/grid-selection.d.ts +115 -0
- package/_adapters/grid-selection.js +436 -0
- package/_adapters/interactions.d.ts +19 -0
- package/_adapters/interactions.js +45 -0
- package/_adapters/intl.d.ts +8 -0
- package/_adapters/intl.js +106 -0
- package/_adapters/press.d.ts +22 -0
- package/_adapters/press.js +34 -0
- package/_adapters/selectable.d.ts +132 -0
- package/_adapters/selectable.js +599 -0
- package/_adapters/selection.d.ts +120 -0
- package/_adapters/selection.js +709 -0
- package/_adapters/type-select.d.ts +8 -0
- package/_adapters/type-select.js +59 -0
- package/a11y/aria-describer.d.ts +46 -0
- package/a11y/aria-describer.js +169 -0
- package/a11y/focus-monitor.d.ts +98 -0
- package/a11y/focus-monitor.js +321 -0
- package/a11y/focus-trap.d.ts +137 -0
- package/a11y/focus-trap.js +378 -0
- package/a11y/high-contrast.d.ts +26 -0
- package/a11y/high-contrast.js +84 -0
- package/a11y/index.d.ts +37 -0
- package/a11y/index.js +97 -0
- package/a11y/interactivity-checker.d.ts +18 -0
- package/a11y/interactivity-checker.js +126 -0
- package/a11y/key-manager.d.ts +152 -0
- package/a11y/key-manager.js +397 -0
- package/a11y/live-announcer.d.ts +53 -0
- package/a11y/live-announcer.js +143 -0
- package/accordion/index.d.ts +2 -0
- package/accordion/index.jsx +10 -0
- package/announcer/index.d.ts +8 -0
- package/announcer/index.jsx +22 -0
- package/announcer/live-announcer.d.ts +15 -0
- package/announcer/live-announcer.js +123 -0
- package/autocomplete/behaviour.d.ts +94 -0
- package/autocomplete/behaviour.jsx +423 -0
- package/autocomplete/contexts.d.ts +54 -0
- package/autocomplete/contexts.js +28 -0
- package/autocomplete/index.d.ts +12 -0
- package/autocomplete/index.jsx +31 -0
- package/autocomplete/intl.d.ts +2 -0
- package/autocomplete/intl.js +36 -0
- package/bidi/bidi-dir.d.ts +23 -0
- package/bidi/bidi-dir.jsx +36 -0
- package/bidi/index.d.ts +58 -0
- package/bidi/index.js +84 -0
- package/breadcrumbs/behaviour.d.ts +6 -0
- package/breadcrumbs/behaviour.js +17 -0
- package/breadcrumbs/index.d.ts +68 -0
- package/breadcrumbs/index.jsx +224 -0
- package/breadcrumbs/intl.d.ts +3 -0
- package/breadcrumbs/intl.js +104 -0
- package/button/behaviour.d.ts +61 -0
- package/button/behaviour.js +90 -0
- package/button/index.d.ts +38 -0
- package/button/index.jsx +376 -0
- package/button/press.d.ts +25 -0
- package/button/press.js +54 -0
- package/calendar/behaviour.d.ts +250 -0
- package/calendar/behaviour.jsx +939 -0
- package/calendar/index.d.ts +157 -0
- package/calendar/index.jsx +484 -0
- package/calendar/intl.d.ts +3 -0
- package/calendar/intl.js +36 -0
- package/carousel/behaviour.d.ts +50 -0
- package/carousel/behaviour.jsx +365 -0
- package/carousel/engine/Alignment.d.ts +5 -0
- package/carousel/engine/Alignment.js +24 -0
- package/carousel/engine/Animations.d.ts +13 -0
- package/carousel/engine/Animations.js +28 -0
- package/carousel/engine/Axis.d.ts +14 -0
- package/carousel/engine/Axis.js +35 -0
- package/carousel/engine/Counter.d.ts +7 -0
- package/carousel/engine/Counter.js +32 -0
- package/carousel/engine/DragHandler.d.ts +22 -0
- package/carousel/engine/DragHandler.js +141 -0
- package/carousel/engine/DragTracker.d.ts +10 -0
- package/carousel/engine/DragTracker.js +29 -0
- package/carousel/engine/EmblaCarousel.d.ts +32 -0
- package/carousel/engine/EmblaCarousel.js +177 -0
- package/carousel/engine/Engine.d.ts +64 -0
- package/carousel/engine/Engine.js +137 -0
- package/carousel/engine/EventHandler.d.ts +27 -0
- package/carousel/engine/EventHandler.js +33 -0
- package/carousel/engine/EventStore.d.ts +9 -0
- package/carousel/engine/EventStore.js +25 -0
- package/carousel/engine/NodeRects.d.ts +12 -0
- package/carousel/engine/NodeRects.js +18 -0
- package/carousel/engine/Options.d.ts +40 -0
- package/carousel/engine/Options.js +22 -0
- package/carousel/engine/OptionsHandler.d.ts +10 -0
- package/carousel/engine/OptionsHandler.js +26 -0
- package/carousel/engine/PercentOfView.d.ts +4 -0
- package/carousel/engine/PercentOfView.js +9 -0
- package/carousel/engine/Plugins.d.ts +16 -0
- package/carousel/engine/Plugins.js +1 -0
- package/carousel/engine/PluginsHandler.d.ts +8 -0
- package/carousel/engine/PluginsHandler.js +16 -0
- package/carousel/engine/ResizeHandler.d.ts +13 -0
- package/carousel/engine/ResizeHandler.js +51 -0
- package/carousel/engine/ScrollBounds.d.ts +10 -0
- package/carousel/engine/ScrollBounds.js +41 -0
- package/carousel/engine/ScrollContain.d.ts +7 -0
- package/carousel/engine/ScrollContain.js +52 -0
- package/carousel/engine/ScrollLimit.d.ts +5 -0
- package/carousel/engine/ScrollLimit.js +13 -0
- package/carousel/engine/ScrollLooper.d.ts +6 -0
- package/carousel/engine/ScrollLooper.js +26 -0
- package/carousel/engine/ScrollProgress.d.ts +5 -0
- package/carousel/engine/ScrollProgress.js +11 -0
- package/carousel/engine/ScrollSnaps.d.ts +9 -0
- package/carousel/engine/ScrollSnaps.js +26 -0
- package/carousel/engine/ScrollTarget.d.ts +12 -0
- package/carousel/engine/ScrollTarget.js +47 -0
- package/carousel/engine/ScrollTo.d.ts +11 -0
- package/carousel/engine/ScrollTo.js +36 -0
- package/carousel/engine/SlideFocus.d.ts +13 -0
- package/carousel/engine/SlideFocus.js +39 -0
- package/carousel/engine/SlideLooper.d.ts +18 -0
- package/carousel/engine/SlideLooper.js +78 -0
- package/carousel/engine/SlideRegistry.d.ts +7 -0
- package/carousel/engine/SlideRegistry.js +31 -0
- package/carousel/engine/SlideSizes.d.ts +10 -0
- package/carousel/engine/SlideSizes.js +41 -0
- package/carousel/engine/SlidesHandler.d.ts +10 -0
- package/carousel/engine/SlidesHandler.js +36 -0
- package/carousel/engine/SlidesInView.d.ts +8 -0
- package/carousel/engine/SlidesInView.js +59 -0
- package/carousel/engine/SlidesToScroll.d.ts +7 -0
- package/carousel/engine/SlidesToScroll.js +41 -0
- package/carousel/engine/Translate.d.ts +7 -0
- package/carousel/engine/Translate.js +38 -0
- package/carousel/engine/index.d.ts +11 -0
- package/carousel/engine/index.js +1 -0
- package/carousel/engine/utils.d.ts +15 -0
- package/carousel/engine/utils.js +45 -0
- package/carousel/index.d.ts +202 -0
- package/carousel/index.jsx +469 -0
- package/carousel/plugins/auto-height/AutoHeight.d.ts +14 -0
- package/carousel/plugins/auto-height/AutoHeight.js +43 -0
- package/carousel/plugins/auto-height/Options.d.ts +2 -0
- package/carousel/plugins/auto-height/Options.js +1 -0
- package/carousel/plugins/auto-height/index.d.ts +2 -0
- package/carousel/plugins/auto-height/index.js +1 -0
- package/carousel/plugins/auto-scroll/AutoScroll.d.ts +25 -0
- package/carousel/plugins/auto-scroll/AutoScroll.js +185 -0
- package/carousel/plugins/auto-scroll/Options.d.ts +13 -0
- package/carousel/plugins/auto-scroll/Options.js +12 -0
- package/carousel/plugins/auto-scroll/index.d.ts +2 -0
- package/carousel/plugins/auto-scroll/index.js +1 -0
- package/carousel/plugins/auto-scroll/utils.d.ts +3 -0
- package/carousel/plugins/auto-scroll/utils.js +4 -0
- package/carousel/plugins/autoplay/Autoplay.d.ts +29 -0
- package/carousel/plugins/autoplay/Autoplay.js +173 -0
- package/carousel/plugins/autoplay/Options.d.ts +14 -0
- package/carousel/plugins/autoplay/Options.js +12 -0
- package/carousel/plugins/autoplay/index.d.ts +2 -0
- package/carousel/plugins/autoplay/index.js +1 -0
- package/carousel/plugins/autoplay/utils.d.ts +4 -0
- package/carousel/plugins/autoplay/utils.js +11 -0
- package/carousel/plugins/class-names/ClassNames.d.ts +14 -0
- package/carousel/plugins/class-names/ClassNames.js +98 -0
- package/carousel/plugins/class-names/Options.d.ts +13 -0
- package/carousel/plugins/class-names/Options.js +9 -0
- package/carousel/plugins/class-names/index.d.ts +2 -0
- package/carousel/plugins/class-names/index.js +1 -0
- package/carousel/plugins/class-names/utils.d.ts +4 -0
- package/carousel/plugins/class-names/utils.js +14 -0
- package/carousel/plugins/fade/Fade.d.ts +14 -0
- package/carousel/plugins/fade/Fade.js +199 -0
- package/carousel/plugins/fade/Options.d.ts +2 -0
- package/carousel/plugins/fade/Options.js +1 -0
- package/carousel/plugins/fade/index.d.ts +2 -0
- package/carousel/plugins/fade/index.js +1 -0
- package/carousel/plugins/fade/utils.d.ts +2 -0
- package/carousel/plugins/fade/utils.js +8 -0
- package/carousel/state.d.ts +81 -0
- package/carousel/state.js +71 -0
- package/chat/index.d.ts +83 -0
- package/chat/index.jsx +287 -0
- package/checkbox/behaviour.d.ts +172 -0
- package/checkbox/behaviour.jsx +412 -0
- package/checkbox/index.d.ts +168 -0
- package/checkbox/index.jsx +310 -0
- package/clipboard/index.d.ts +49 -0
- package/clipboard/index.js +136 -0
- package/coercion/index.d.ts +36 -0
- package/coercion/index.js +58 -0
- package/collections/base.d.ts +115 -0
- package/collections/base.js +346 -0
- package/collections/builder.d.ts +44 -0
- package/collections/builder.js +283 -0
- package/collections/components.d.ts +252 -0
- package/collections/components.jsx +745 -0
- package/collections/data-source.d.ts +26 -0
- package/collections/data-source.js +27 -0
- package/collections/dom.d.ts +34 -0
- package/collections/dom.js +127 -0
- package/collections/grid.d.ts +45 -0
- package/collections/grid.js +125 -0
- package/collections/hidden.d.ts +4 -0
- package/collections/hidden.js +12 -0
- package/collections/index.d.ts +45 -0
- package/collections/index.js +105 -0
- package/collections/list-state.d.ts +99 -0
- package/collections/list-state.js +156 -0
- package/collections/list.d.ts +20 -0
- package/collections/list.js +77 -0
- package/collections/nodes.d.ts +17 -0
- package/collections/nodes.js +107 -0
- package/collections/row-stamps.d.ts +17 -0
- package/collections/row-stamps.js +108 -0
- package/collections/selection-model.d.ts +93 -0
- package/collections/selection-model.js +192 -0
- package/collections/server-dev.d.ts +6 -0
- package/collections/server-dev.js +18 -0
- package/collections/server-off.d.ts +6 -0
- package/collections/server-off.js +9 -0
- package/collections/server-on.d.ts +29 -0
- package/collections/server-on.jsx +86 -0
- package/collections/table.d.ts +114 -0
- package/collections/table.js +439 -0
- package/collections/tree-state.d.ts +47 -0
- package/collections/tree-state.js +73 -0
- package/collections/tree.d.ts +20 -0
- package/collections/tree.js +66 -0
- package/collections/types.d.ts +229 -0
- package/collections/types.js +4 -0
- package/collections/unique-selection-dispatcher.d.ts +10 -0
- package/collections/unique-selection-dispatcher.js +25 -0
- package/color/area-state.d.ts +99 -0
- package/color/area-state.js +160 -0
- package/color/aria-intl.d.ts +3 -0
- package/color/aria-intl.js +274 -0
- package/color/channel-field-state.d.ts +50 -0
- package/color/channel-field-state.jsx +87 -0
- package/color/color.d.ts +78 -0
- package/color/color.js +738 -0
- package/color/field-state.d.ts +66 -0
- package/color/field-state.jsx +159 -0
- package/color/index.d.ts +58 -0
- package/color/index.js +88 -0
- package/color/intl.d.ts +3 -0
- package/color/intl.js +1328 -0
- package/color/picker-state.d.ts +20 -0
- package/color/picker-state.js +19 -0
- package/color/slider-state.d.ts +78 -0
- package/color/slider-state.jsx +98 -0
- package/color/value.d.ts +27 -0
- package/color/value.js +36 -0
- package/color/wheel-state.d.ts +77 -0
- package/color/wheel-state.js +152 -0
- package/color-area/behaviour.d.ts +161 -0
- package/color-area/behaviour.jsx +454 -0
- package/color-area/index.d.ts +34 -0
- package/color-area/index.jsx +187 -0
- package/color-field/behaviour.d.ts +112 -0
- package/color-field/behaviour.jsx +262 -0
- package/color-field/index.d.ts +72 -0
- package/color-field/index.jsx +309 -0
- package/color-picker/index.d.ts +19 -0
- package/color-picker/index.jsx +49 -0
- package/color-slider/behaviour.d.ts +103 -0
- package/color-slider/behaviour.jsx +234 -0
- package/color-slider/index.d.ts +40 -0
- package/color-slider/index.jsx +162 -0
- package/color-swatch/behaviour.d.ts +40 -0
- package/color-swatch/behaviour.js +36 -0
- package/color-swatch/index.d.ts +29 -0
- package/color-swatch/index.jsx +82 -0
- package/color-swatch-picker/index.d.ts +62 -0
- package/color-swatch-picker/index.jsx +95 -0
- package/color-swatch-picker/intl.d.ts +3 -0
- package/color-swatch-picker/intl.js +104 -0
- package/color-thumb/index.d.ts +85 -0
- package/color-thumb/index.jsx +93 -0
- package/color-wheel/behaviour.d.ts +123 -0
- package/color-wheel/behaviour.jsx +301 -0
- package/color-wheel/index.d.ts +50 -0
- package/color-wheel/index.jsx +166 -0
- package/combobox/behaviour.d.ts +120 -0
- package/combobox/behaviour.jsx +588 -0
- package/combobox/index.d.ts +101 -0
- package/combobox/index.jsx +365 -0
- package/combobox/intl.d.ts +2 -0
- package/combobox/intl.js +240 -0
- package/compare/behaviour.d.ts +101 -0
- package/compare/behaviour.js +288 -0
- package/compare/index.d.ts +58 -0
- package/compare/index.jsx +129 -0
- package/data/async-list.d.ts +78 -0
- package/data/async-list.jsx +257 -0
- package/data/index.d.ts +3 -0
- package/data/index.jsx +6 -0
- package/data/list-data.d.ts +88 -0
- package/data/list-data.jsx +210 -0
- package/data/tree-data.d.ts +59 -0
- package/data/tree-data.jsx +278 -0
- package/data-grid/behaviour.d.ts +95 -0
- package/data-grid/behaviour.js +725 -0
- package/data-grid/index.d.ts +138 -0
- package/data-grid/index.jsx +452 -0
- package/data-grid/state.d.ts +131 -0
- package/data-grid/state.js +288 -0
- package/date/CalendarDate.d.ts +207 -0
- package/date/CalendarDate.js +374 -0
- package/date/DateFormatter.d.ts +24 -0
- package/date/DateFormatter.js +175 -0
- package/date/calendars/BuddhistCalendar.d.ts +16 -0
- package/date/calendars/BuddhistCalendar.js +46 -0
- package/date/calendars/EthiopicCalendar.d.ts +45 -0
- package/date/calendars/EthiopicCalendar.js +178 -0
- package/date/calendars/GregorianCalendar.d.ts +26 -0
- package/date/calendars/GregorianCalendar.js +122 -0
- package/date/calendars/HebrewCalendar.d.ts +21 -0
- package/date/calendars/HebrewCalendar.js +174 -0
- package/date/calendars/IndianCalendar.d.ts +17 -0
- package/date/calendars/IndianCalendar.js +111 -0
- package/date/calendars/IslamicCalendar.d.ts +51 -0
- package/date/calendars/IslamicCalendar.js +205 -0
- package/date/calendars/JapaneseCalendar.d.ts +22 -0
- package/date/calendars/JapaneseCalendar.js +148 -0
- package/date/calendars/PersianCalendar.d.ts +19 -0
- package/date/calendars/PersianCalendar.js +85 -0
- package/date/calendars/TaiwanCalendar.d.ts +19 -0
- package/date/calendars/TaiwanCalendar.js +70 -0
- package/date/conversion.d.ts +45 -0
- package/date/conversion.js +269 -0
- package/date/createCalendar.d.ts +3 -0
- package/date/createCalendar.js +55 -0
- package/date/index.d.ts +20 -0
- package/date/index.js +30 -0
- package/date/manipulation.d.ts +25 -0
- package/date/manipulation.js +399 -0
- package/date/queries.d.ts +93 -0
- package/date/queries.js +303 -0
- package/date/serialize.d.ts +18 -0
- package/date/serialize.js +55 -0
- package/date/string.d.ts +36 -0
- package/date/string.js +223 -0
- package/date/types.d.ts +136 -0
- package/date/types.js +14 -0
- package/date/utils.d.ts +4 -0
- package/date/utils.js +16 -0
- package/date/weekStartData.d.ts +1 -0
- package/date/weekStartData.js +112 -0
- package/date-field/behaviour.d.ts +188 -0
- package/date-field/behaviour.jsx +1025 -0
- package/date-field/index.d.ts +150 -0
- package/date-field/index.jsx +354 -0
- package/date-field/intl.d.ts +3 -0
- package/date-field/intl.js +36 -0
- package/date-field/live-value.d.ts +22 -0
- package/date-field/live-value.jsx +44 -0
- package/date-picker/behaviour.d.ts +95 -0
- package/date-picker/behaviour.jsx +343 -0
- package/date-picker/index.d.ts +66 -0
- package/date-picker/index.jsx +243 -0
- package/dialog/behaviour.d.ts +63 -0
- package/dialog/behaviour.jsx +90 -0
- package/dialog/contexts.d.ts +12 -0
- package/dialog/contexts.js +8 -0
- package/dialog/index.d.ts +48 -0
- package/dialog/index.jsx +301 -0
- package/disclosure/behaviour.d.ts +50 -0
- package/disclosure/behaviour.jsx +128 -0
- package/disclosure/details.d.ts +21 -0
- package/disclosure/details.jsx +14 -0
- package/disclosure/index.d.ts +92 -0
- package/disclosure/index.jsx +300 -0
- package/drag-drop/cdk-index.d.ts +22 -0
- package/drag-drop/cdk-index.jsx +25 -0
- package/drag-drop/directives/assertions.d.ts +6 -0
- package/drag-drop/directives/assertions.js +13 -0
- package/drag-drop/directives/config.d.ts +30 -0
- package/drag-drop/directives/config.js +7 -0
- package/drag-drop/directives/drag-handle.d.ts +10 -0
- package/drag-drop/directives/drag-handle.js +29 -0
- package/drag-drop/directives/drag.d.ts +210 -0
- package/drag-drop/directives/drag.js +550 -0
- package/drag-drop/directives/drop-list-group.d.ts +25 -0
- package/drag-drop/directives/drop-list-group.js +55 -0
- package/drag-drop/directives/drop-list.d.ts +163 -0
- package/drag-drop/directives/drop-list.js +396 -0
- package/drag-drop/directives/registry.d.ts +32 -0
- package/drag-drop/directives/registry.js +61 -0
- package/drag-drop/dom/clone-node.d.ts +2 -0
- package/drag-drop/dom/clone-node.js +58 -0
- package/drag-drop/dom/coerce.d.ts +6 -0
- package/drag-drop/dom/coerce.js +8 -0
- package/drag-drop/dom/dom-rect.d.ts +37 -0
- package/drag-drop/dom/dom-rect.js +71 -0
- package/drag-drop/dom/fake-event.d.ts +4 -0
- package/drag-drop/dom/fake-event.js +22 -0
- package/drag-drop/dom/inherited-text.d.ts +4 -0
- package/drag-drop/dom/inherited-text.js +44 -0
- package/drag-drop/dom/layout-shift.d.ts +8 -0
- package/drag-drop/dom/layout-shift.js +87 -0
- package/drag-drop/dom/mount-content.d.ts +2 -0
- package/drag-drop/dom/mount-content.js +7 -0
- package/drag-drop/dom/parent-position-tracker.d.ts +32 -0
- package/drag-drop/dom/parent-position-tracker.js +71 -0
- package/drag-drop/dom/root-node.d.ts +21 -0
- package/drag-drop/dom/root-node.js +41 -0
- package/drag-drop/dom/shadow-dom.d.ts +4 -0
- package/drag-drop/dom/shadow-dom.js +18 -0
- package/drag-drop/dom/styling.d.ts +52 -0
- package/drag-drop/dom/styling.js +86 -0
- package/drag-drop/dom/transition-duration.d.ts +2 -0
- package/drag-drop/dom/transition-duration.js +29 -0
- package/drag-drop/drag-drop-registry.d.ts +69 -0
- package/drag-drop/drag-drop-registry.js +224 -0
- package/drag-drop/drag-drop.d.ts +19 -0
- package/drag-drop/drag-drop.js +10 -0
- package/drag-drop/drag-events.d.ts +117 -0
- package/drag-drop/drag-events.js +1 -0
- package/drag-drop/drag-handle.d.ts +18 -0
- package/drag-drop/drag-handle.jsx +53 -0
- package/drag-drop/drag-placeholder.d.ts +8 -0
- package/drag-drop/drag-placeholder.jsx +25 -0
- package/drag-drop/drag-preview.d.ts +10 -0
- package/drag-drop/drag-preview.jsx +31 -0
- package/drag-drop/drag-ref.d.ts +476 -0
- package/drag-drop/drag-ref.js +1306 -0
- package/drag-drop/drag-utils.d.ts +25 -0
- package/drag-drop/drag-utils.js +53 -0
- package/drag-drop/drag.d.ts +23 -0
- package/drag-drop/drag.jsx +128 -0
- package/drag-drop/drop-list-group.d.ts +22 -0
- package/drag-drop/drop-list-group.jsx +19 -0
- package/drag-drop/drop-list-ref.d.ts +295 -0
- package/drag-drop/drop-list-ref.js +707 -0
- package/drag-drop/drop-list.d.ts +19 -0
- package/drag-drop/drop-list.jsx +87 -0
- package/drag-drop/index.d.ts +1 -0
- package/drag-drop/index.jsx +4 -0
- package/drag-drop/lazy-refs.d.ts +28 -0
- package/drag-drop/lazy-refs.js +144 -0
- package/drag-drop/preview-ref.d.ts +38 -0
- package/drag-drop/preview-ref.js +132 -0
- package/drag-drop/sorting/drop-list-sort-strategy.d.ts +29 -0
- package/drag-drop/sorting/drop-list-sort-strategy.js +1 -0
- package/drag-drop/sorting/mixed-sort-strategy.d.ts +99 -0
- package/drag-drop/sorting/mixed-sort-strategy.js +259 -0
- package/drag-drop/sorting/single-axis-sort-strategy.d.ts +112 -0
- package/drag-drop/sorting/single-axis-sort-strategy.js +343 -0
- package/file-trigger/index.d.ts +24 -0
- package/file-trigger/index.jsx +41 -0
- package/flip/index.d.ts +59 -0
- package/flip/index.js +124 -0
- package/focus/focus-ring.d.ts +42 -0
- package/focus/focus-ring.jsx +77 -0
- package/focus/focus-scope.d.ts +51 -0
- package/focus/focus-scope.jsx +431 -0
- package/focus/focusable.d.ts +33 -0
- package/focus/focusable.jsx +93 -0
- package/focus/index.d.ts +74 -0
- package/focus/index.js +274 -0
- package/form/behaviour.d.ts +29 -0
- package/form/behaviour.js +145 -0
- package/form/field-error.d.ts +38 -0
- package/form/field-error.jsx +67 -0
- package/form/index.d.ts +77 -0
- package/form/index.jsx +116 -0
- package/grid/behaviour.d.ts +290 -0
- package/grid/behaviour.js +683 -0
- package/grid/intl.d.ts +2 -0
- package/grid/intl.js +36 -0
- package/grid/keyboard-delegate.d.ts +56 -0
- package/grid/keyboard-delegate.js +316 -0
- package/grid-list/behaviour.d.ts +248 -0
- package/grid-list/behaviour.js +616 -0
- package/grid-list/index.d.ts +204 -0
- package/grid-list/index.jsx +721 -0
- package/grid-list/row.d.ts +24 -0
- package/grid-list/row.js +57 -0
- package/group/index.d.ts +48 -0
- package/group/index.jsx +126 -0
- package/header/index.d.ts +13 -0
- package/header/index.jsx +34 -0
- package/heading/index.d.ts +19 -0
- package/heading/index.jsx +55 -0
- package/highlight/index.d.ts +12 -0
- package/highlight/index.jsx +357 -0
- package/i18n/filter.d.ts +16 -0
- package/i18n/filter.js +66 -0
- package/i18n/i18n-provider.d.ts +10 -0
- package/i18n/i18n-provider.jsx +15 -0
- package/i18n/index.d.ts +27 -0
- package/i18n/index.js +115 -0
- package/i18n/intl-cache.d.ts +4 -0
- package/i18n/intl-cache.js +40 -0
- package/i18n/list-formatter.d.ts +2 -0
- package/i18n/list-formatter.js +11 -0
- package/input/index.d.ts +51 -0
- package/input/index.jsx +95 -0
- package/interactions/controllable.d.ts +42 -0
- package/interactions/controllable.js +67 -0
- package/interactions/focus-visible.d.ts +68 -0
- package/interactions/focus-visible.jsx +291 -0
- package/interactions/focus.d.ts +58 -0
- package/interactions/focus.jsx +152 -0
- package/interactions/hover.d.ts +54 -0
- package/interactions/hover.jsx +139 -0
- package/interactions/index.d.ts +1 -0
- package/interactions/index.js +3 -0
- package/interactions/interact-outside.d.ts +24 -0
- package/interactions/interact-outside.jsx +57 -0
- package/interactions/keyboard.d.ts +28 -0
- package/interactions/keyboard.jsx +51 -0
- package/interactions/long-press.d.ts +41 -0
- package/interactions/long-press.jsx +79 -0
- package/interactions/merge-props.d.ts +54 -0
- package/interactions/merge-props.jsx +257 -0
- package/interactions/move.d.ts +48 -0
- package/interactions/move.jsx +96 -0
- package/interactions/press.d.ts +129 -0
- package/interactions/press.jsx +539 -0
- package/interactions/pressable.d.ts +22 -0
- package/interactions/pressable.jsx +93 -0
- package/interactions/scroll-wheel.d.ts +20 -0
- package/interactions/scroll-wheel.jsx +40 -0
- package/interactions/utils.d.ts +52 -0
- package/interactions/utils.js +253 -0
- package/keyboard/index.d.ts +12 -0
- package/keyboard/index.jsx +34 -0
- package/keys/index.d.ts +68 -0
- package/keys/index.js +199 -0
- package/label/behaviour.d.ts +54 -0
- package/label/behaviour.js +60 -0
- package/label/index.d.ts +35 -0
- package/label/index.jsx +85 -0
- package/landmark/index.d.ts +10 -0
- package/landmark/index.jsx +35 -0
- package/landmark/manager.d.ts +50 -0
- package/landmark/manager.js +364 -0
- package/layout/index.d.ts +90 -0
- package/layout/index.js +207 -0
- package/lightbox/behaviour.d.ts +82 -0
- package/lightbox/behaviour.js +490 -0
- package/lightbox/captions/index.d.ts +39 -0
- package/lightbox/captions/index.jsx +44 -0
- package/lightbox/counter/index.d.ts +10 -0
- package/lightbox/counter/index.jsx +10 -0
- package/lightbox/download/index.d.ts +32 -0
- package/lightbox/download/index.jsx +89 -0
- package/lightbox/embed/index.d.ts +15 -0
- package/lightbox/embed/index.jsx +58 -0
- package/lightbox/fullscreen/index.d.ts +24 -0
- package/lightbox/fullscreen/index.jsx +80 -0
- package/lightbox/index.d.ts +129 -0
- package/lightbox/index.jsx +284 -0
- package/lightbox/inline/index.d.ts +18 -0
- package/lightbox/inline/index.jsx +15 -0
- package/lightbox/pdf/index.d.ts +18 -0
- package/lightbox/pdf/index.jsx +31 -0
- package/lightbox/share/index.d.ts +29 -0
- package/lightbox/share/index.jsx +43 -0
- package/lightbox/slideshow/index.d.ts +24 -0
- package/lightbox/slideshow/index.jsx +118 -0
- package/lightbox/state.d.ts +334 -0
- package/lightbox/state.js +192 -0
- package/lightbox/thumbnails/index.d.ts +54 -0
- package/lightbox/thumbnails/index.jsx +96 -0
- package/lightbox/video/index.d.ts +13 -0
- package/lightbox/video/index.jsx +42 -0
- package/lightbox/zoom/index.d.ts +67 -0
- package/lightbox/zoom/index.jsx +456 -0
- package/link/behaviour.d.ts +41 -0
- package/link/behaviour.js +58 -0
- package/link/index.d.ts +30 -0
- package/link/index.jsx +179 -0
- package/link/router.d.ts +1 -0
- package/link/router.js +5 -0
- package/listbox/behaviour.d.ts +175 -0
- package/listbox/behaviour.jsx +515 -0
- package/listbox/index.d.ts +129 -0
- package/listbox/index.jsx +632 -0
- package/markdown/index.d.ts +82 -0
- package/markdown/index.jsx +654 -0
- package/masonry/behaviour.d.ts +121 -0
- package/masonry/behaviour.js +676 -0
- package/masonry/flip.d.ts +27 -0
- package/masonry/flip.js +61 -0
- package/masonry/geometry.d.ts +44 -0
- package/masonry/geometry.js +184 -0
- package/masonry/index.d.ts +153 -0
- package/masonry/index.jsx +833 -0
- package/masonry/justified.d.ts +49 -0
- package/masonry/justified.js +250 -0
- package/masonry/layout.d.ts +200 -0
- package/masonry/layout.js +668 -0
- package/masonry/masonry-layout.d.ts +57 -0
- package/masonry/masonry-layout.js +159 -0
- package/masonry/masonry.css +29 -0
- package/menu/behaviour.d.ts +205 -0
- package/menu/behaviour.jsx +847 -0
- package/menu/index.d.ts +171 -0
- package/menu/index.jsx +702 -0
- package/menu/intl.d.ts +2 -0
- package/menu/intl.js +36 -0
- package/menu/safely-mouse-to-submenu.d.ts +12 -0
- package/menu/safely-mouse-to-submenu.js +128 -0
- package/meter/behaviour.d.ts +18 -0
- package/meter/behaviour.jsx +17 -0
- package/meter/index.d.ts +30 -0
- package/meter/index.jsx +85 -0
- package/modal/index.d.ts +79 -0
- package/modal/index.jsx +359 -0
- package/modal/provider.d.ts +47 -0
- package/modal/provider.jsx +105 -0
- package/morph/index.d.ts +91 -0
- package/morph/index.jsx +372 -0
- package/morph/item.d.ts +89 -0
- package/morph/item.jsx +546 -0
- package/motion/Animations.d.ts +17 -0
- package/motion/Animations.js +56 -0
- package/motion/DragRelease.d.ts +22 -0
- package/motion/DragRelease.js +26 -0
- package/motion/DragTracker.d.ts +7 -0
- package/motion/DragTracker.js +43 -0
- package/motion/Limit.d.ts +12 -0
- package/motion/Limit.js +37 -0
- package/motion/Motion1D.d.ts +38 -0
- package/motion/Motion1D.js +72 -0
- package/motion/ScrollBody.d.ts +13 -0
- package/motion/ScrollBody.js +75 -0
- package/motion/Vector1d.d.ts +8 -0
- package/motion/Vector1d.js +29 -0
- package/motion/index.d.ts +8 -0
- package/motion/index.js +12 -0
- package/motion/utils.d.ts +5 -0
- package/motion/utils.js +23 -0
- package/native-select/index.d.ts +46 -0
- package/native-select/index.jsx +99 -0
- package/navigation-tree/index.d.ts +43 -0
- package/navigation-tree/index.jsx +110 -0
- package/number/NumberFormatter.d.ts +28 -0
- package/number/NumberFormatter.js +144 -0
- package/number/NumberParser.d.ts +27 -0
- package/number/NumberParser.js +316 -0
- package/number/index.d.ts +5 -0
- package/number/index.jsx +17 -0
- package/number/number-field-state.d.ts +132 -0
- package/number/number-field-state.jsx +364 -0
- package/number-field/behaviour.d.ts +165 -0
- package/number-field/behaviour.jsx +512 -0
- package/number-field/index.d.ts +52 -0
- package/number-field/index.jsx +207 -0
- package/number-field/intl.d.ts +2 -0
- package/number-field/intl.js +36 -0
- package/observers/index.d.ts +70 -0
- package/observers/index.js +279 -0
- package/overflow/index.d.ts +93 -0
- package/overflow/index.jsx +267 -0
- package/overlay/aria-hide-outside.d.ts +12 -0
- package/overlay/aria-hide-outside.js +141 -0
- package/overlay/close-on-scroll.d.ts +1 -0
- package/overlay/close-on-scroll.js +6 -0
- package/overlay/contexts.d.ts +34 -0
- package/overlay/contexts.js +21 -0
- package/overlay/dismiss-button.d.ts +10 -0
- package/overlay/dismiss-button.jsx +18 -0
- package/overlay/hover-trigger.d.ts +54 -0
- package/overlay/hover-trigger.jsx +221 -0
- package/overlay/index.d.ts +40 -0
- package/overlay/index.js +139 -0
- package/overlay/modal-overlay.d.ts +16 -0
- package/overlay/modal-overlay.js +38 -0
- package/overlay/overlay-strings.d.ts +4 -0
- package/overlay/overlay-strings.js +52 -0
- package/overlay/overlay-trigger-state.d.ts +1 -0
- package/overlay/overlay-trigger-state.js +3 -0
- package/overlay/overlay-trigger.d.ts +27 -0
- package/overlay/overlay-trigger.jsx +50 -0
- package/overlay/position.d.ts +160 -0
- package/overlay/position.js +559 -0
- package/overlay/prevent-scroll-ios.d.ts +17 -0
- package/overlay/prevent-scroll-ios.js +331 -0
- package/overlay/prevent-scroll.d.ts +18 -0
- package/overlay/prevent-scroll.js +122 -0
- package/overlay/safe-area.d.ts +28 -0
- package/overlay/safe-area.js +108 -0
- package/overlay-arrow/index.d.ts +23 -0
- package/overlay-arrow/index.jsx +59 -0
- package/overlay-service/connected-position.d.ts +163 -0
- package/overlay-service/connected-position.js +661 -0
- package/overlay-service/global-position.d.ts +34 -0
- package/overlay-service/global-position.js +154 -0
- package/overlay-service/index.d.ts +15 -0
- package/overlay-service/index.js +27 -0
- package/overlay-service/overlay-container.d.ts +27 -0
- package/overlay-service/overlay-container.js +93 -0
- package/overlay-service/overlay-dispatchers.d.ts +44 -0
- package/overlay-service/overlay-dispatchers.js +149 -0
- package/overlay-service/overlay-position-builder.d.ts +8 -0
- package/overlay-service/overlay-position-builder.js +15 -0
- package/overlay-service/overlay-ref.d.ts +155 -0
- package/overlay-service/overlay-ref.js +436 -0
- package/overlay-service/overlay-strategy.d.ts +48 -0
- package/overlay-service/overlay-strategy.js +3 -0
- package/overlay-service/overlay-viewport.d.ts +85 -0
- package/overlay-service/overlay-viewport.js +192 -0
- package/overlay-service/overlay.css +94 -0
- package/overlay-service/scroll-strategies.d.ts +71 -0
- package/overlay-service/scroll-strategies.js +185 -0
- package/package.json +754 -4
- package/platform/index.d.ts +100 -0
- package/platform/index.js +304 -0
- package/popover/behaviour.d.ts +23 -0
- package/popover/behaviour.js +39 -0
- package/popover/index.d.ts +60 -0
- package/popover/index.jsx +285 -0
- package/popover/popover-overlay.d.ts +27 -0
- package/popover/popover-overlay.jsx +60 -0
- package/popover/use-popover.d.ts +57 -0
- package/popover/use-popover.js +92 -0
- package/portal/index.d.ts +55 -0
- package/portal/index.jsx +83 -0
- package/portal/portal-mount.d.ts +8 -0
- package/portal/portal-mount.js +7 -0
- package/portal/portal-outlet.d.ts +88 -0
- package/portal/portal-outlet.js +222 -0
- package/preview-trigger/behaviour.d.ts +70 -0
- package/preview-trigger/behaviour.jsx +258 -0
- package/preview-trigger/index.d.ts +12 -0
- package/preview-trigger/index.jsx +82 -0
- package/progress-bar/behaviour.d.ts +77 -0
- package/progress-bar/behaviour.jsx +75 -0
- package/progress-bar/context.d.ts +4 -0
- package/progress-bar/context.js +7 -0
- package/progress-bar/index.d.ts +38 -0
- package/progress-bar/index.jsx +90 -0
- package/radio-group/behaviour.d.ts +11 -0
- package/radio-group/behaviour.js +85 -0
- package/radio-group/index.d.ts +82 -0
- package/radio-group/index.jsx +142 -0
- package/radio-group/parts.d.ts +223 -0
- package/radio-group/parts.jsx +425 -0
- package/range-calendar/behaviour.d.ts +2 -0
- package/range-calendar/behaviour.jsx +5 -0
- package/range-calendar/index.d.ts +2 -0
- package/range-calendar/index.jsx +4 -0
- package/resizable/engine/components/group/auto-save/getStorageKey.d.ts +1 -0
- package/resizable/engine/components/group/auto-save/getStorageKey.js +5 -0
- package/resizable/engine/components/group/compareDocumentPosition.d.ts +5 -0
- package/resizable/engine/components/group/compareDocumentPosition.js +19 -0
- package/resizable/engine/components/group/readLegacyLayout.d.ts +16 -0
- package/resizable/engine/components/group/readLegacyLayout.js +48 -0
- package/resizable/engine/components/group/sortByElementOffset.d.ts +4 -0
- package/resizable/engine/components/group/sortByElementOffset.js +28 -0
- package/resizable/engine/components/group/types.d.ts +50 -0
- package/resizable/engine/components/group/types.js +1 -0
- package/resizable/engine/components/panel/types.d.ts +90 -0
- package/resizable/engine/components/panel/types.js +4 -0
- package/resizable/engine/constants.d.ts +15 -0
- package/resizable/engine/constants.js +27 -0
- package/resizable/engine/global/cursor/getCursorStyle.d.ts +7 -0
- package/resizable/engine/global/cursor/getCursorStyle.js +94 -0
- package/resizable/engine/global/cursor/supportsAdvancedCursorStyles.d.ts +5 -0
- package/resizable/engine/global/cursor/supportsAdvancedCursorStyles.js +20 -0
- package/resizable/engine/global/cursor/updateCursorStyle.d.ts +1 -0
- package/resizable/engine/global/cursor/updateCursorStyle.js +64 -0
- package/resizable/engine/global/dom/calculateAvailableAxisSize.d.ts +4 -0
- package/resizable/engine/global/dom/calculateAvailableAxisSize.js +10 -0
- package/resizable/engine/global/dom/calculateHitRegions.d.ts +13 -0
- package/resizable/engine/global/dom/calculateHitRegions.js +153 -0
- package/resizable/engine/global/dom/calculateItemConstraints.d.ts +2 -0
- package/resizable/engine/global/dom/calculateItemConstraints.js +82 -0
- package/resizable/engine/global/event-handlers/onDocumentContextMenu.d.ts +1 -0
- package/resizable/engine/global/event-handlers/onDocumentContextMenu.js +9 -0
- package/resizable/engine/global/event-handlers/onDocumentDoubleClick.d.ts +1 -0
- package/resizable/engine/global/event-handlers/onDocumentDoubleClick.js +28 -0
- package/resizable/engine/global/event-handlers/onDocumentKeyDown.d.ts +1 -0
- package/resizable/engine/global/event-handlers/onDocumentKeyDown.js +97 -0
- package/resizable/engine/global/event-handlers/onDocumentLostPointerCapture.d.ts +1 -0
- package/resizable/engine/global/event-handlers/onDocumentLostPointerCapture.js +18 -0
- package/resizable/engine/global/event-handlers/onDocumentPointerCancel.d.ts +1 -0
- package/resizable/engine/global/event-handlers/onDocumentPointerCancel.js +8 -0
- package/resizable/engine/global/event-handlers/onDocumentPointerDown.d.ts +1 -0
- package/resizable/engine/global/event-handlers/onDocumentPointerDown.js +54 -0
- package/resizable/engine/global/event-handlers/onDocumentPointerLeave.d.ts +1 -0
- package/resizable/engine/global/event-handlers/onDocumentPointerLeave.js +22 -0
- package/resizable/engine/global/event-handlers/onDocumentPointerMove.d.ts +1 -0
- package/resizable/engine/global/event-handlers/onDocumentPointerMove.js +69 -0
- package/resizable/engine/global/event-handlers/onDocumentPointerOut.d.ts +1 -0
- package/resizable/engine/global/event-handlers/onDocumentPointerOut.js +20 -0
- package/resizable/engine/global/event-handlers/onDocumentPointerUp.d.ts +1 -0
- package/resizable/engine/global/event-handlers/onDocumentPointerUp.js +15 -0
- package/resizable/engine/global/event-handlers/onWindowBlur.d.ts +1 -0
- package/resizable/engine/global/event-handlers/onWindowBlur.js +11 -0
- package/resizable/engine/global/mountAxis.d.ts +2 -0
- package/resizable/engine/global/mountAxis.js +187 -0
- package/resizable/engine/global/mutable-state/axes.d.ts +37 -0
- package/resizable/engine/global/mutable-state/axes.js +52 -0
- package/resizable/engine/global/mutable-state/interactions.d.ts +17 -0
- package/resizable/engine/global/mutable-state/interactions.js +92 -0
- package/resizable/engine/global/mutable-state/types.d.ts +32 -0
- package/resizable/engine/global/mutable-state/types.js +1 -0
- package/resizable/engine/global/styles/convertEmToPixels.d.ts +1 -0
- package/resizable/engine/global/styles/convertEmToPixels.js +7 -0
- package/resizable/engine/global/styles/convertRemToPixels.d.ts +1 -0
- package/resizable/engine/global/styles/convertRemToPixels.js +7 -0
- package/resizable/engine/global/styles/convertVhToPixels.d.ts +1 -0
- package/resizable/engine/global/styles/convertVhToPixels.js +5 -0
- package/resizable/engine/global/styles/convertVwToPixels.d.ts +1 -0
- package/resizable/engine/global/styles/convertVwToPixels.js +5 -0
- package/resizable/engine/global/styles/parseSizeAndUnit.d.ts +2 -0
- package/resizable/engine/global/styles/parseSizeAndUnit.js +29 -0
- package/resizable/engine/global/styles/sizeStyleToPixels.d.ts +5 -0
- package/resizable/engine/global/styles/sizeStyleToPixels.js +38 -0
- package/resizable/engine/global/types.d.ts +120 -0
- package/resizable/engine/global/types.js +1 -0
- package/resizable/engine/global/utils/abortActivePointerResize.d.ts +9 -0
- package/resizable/engine/global/utils/abortActivePointerResize.js +52 -0
- package/resizable/engine/global/utils/adjustLayoutByDelta.d.ts +9 -0
- package/resizable/engine/global/utils/adjustLayoutByDelta.js +219 -0
- package/resizable/engine/global/utils/adjustLayoutForSeparator.d.ts +1 -0
- package/resizable/engine/global/utils/adjustLayoutForSeparator.js +48 -0
- package/resizable/engine/global/utils/calculateDefaultLayout.d.ts +2 -0
- package/resizable/engine/global/utils/calculateDefaultLayout.js +30 -0
- package/resizable/engine/global/utils/calculateResizePreviews.d.ts +3 -0
- package/resizable/engine/global/utils/calculateResizePreviews.js +39 -0
- package/resizable/engine/global/utils/calculateSeparatorAriaValues.d.ts +12 -0
- package/resizable/engine/global/utils/calculateSeparatorAriaValues.js +43 -0
- package/resizable/engine/global/utils/compareLayoutNumbers.d.ts +1 -0
- package/resizable/engine/global/utils/compareLayoutNumbers.js +11 -0
- package/resizable/engine/global/utils/completeActivePointerResize.d.ts +6 -0
- package/resizable/engine/global/utils/completeActivePointerResize.js +49 -0
- package/resizable/engine/global/utils/doRectsIntersect.d.ts +2 -0
- package/resizable/engine/global/utils/doRectsIntersect.js +3 -0
- package/resizable/engine/global/utils/expandHitTarget.d.ts +10 -0
- package/resizable/engine/global/utils/expandHitTarget.js +19 -0
- package/resizable/engine/global/utils/findClosestHitRegion.d.ts +9 -0
- package/resizable/engine/global/utils/findClosestHitRegion.js +35 -0
- package/resizable/engine/global/utils/findClosestRect.d.ts +6 -0
- package/resizable/engine/global/utils/findClosestRect.js +22 -0
- package/resizable/engine/global/utils/findMatchingHitRegions.d.ts +7 -0
- package/resizable/engine/global/utils/findMatchingHitRegions.js +29 -0
- package/resizable/engine/global/utils/findSeparatorAxis.d.ts +21 -0
- package/resizable/engine/global/utils/findSeparatorAxis.js +12 -0
- package/resizable/engine/global/utils/formatLayoutNumber.d.ts +1 -0
- package/resizable/engine/global/utils/formatLayoutNumber.js +5 -0
- package/resizable/engine/global/utils/getDefaultLayout.d.ts +5 -0
- package/resizable/engine/global/utils/getDefaultLayout.js +11 -0
- package/resizable/engine/global/utils/getDistanceBetweenPointAndRect.d.ts +5 -0
- package/resizable/engine/global/utils/getDistanceBetweenPointAndRect.js +6 -0
- package/resizable/engine/global/utils/getImperativeAxisMethods.d.ts +4 -0
- package/resizable/engine/global/utils/getImperativeAxisMethods.js +53 -0
- package/resizable/engine/global/utils/getImperativeItemMethods.d.ts +5 -0
- package/resizable/engine/global/utils/getImperativeItemMethods.js +169 -0
- package/resizable/engine/global/utils/isCoarsePointer.d.ts +4 -0
- package/resizable/engine/global/utils/isCoarsePointer.js +17 -0
- package/resizable/engine/global/utils/isModal.d.ts +1 -0
- package/resizable/engine/global/utils/isModal.js +11 -0
- package/resizable/engine/global/utils/isViableHitTarget.d.ts +5 -0
- package/resizable/engine/global/utils/isViableHitTarget.js +50 -0
- package/resizable/engine/global/utils/itemConstraintsEqual.d.ts +2 -0
- package/resizable/engine/global/utils/itemConstraintsEqual.js +9 -0
- package/resizable/engine/global/utils/layoutNumbersEqual.d.ts +1 -0
- package/resizable/engine/global/utils/layoutNumbersEqual.js +6 -0
- package/resizable/engine/global/utils/layoutsEqual.d.ts +2 -0
- package/resizable/engine/global/utils/layoutsEqual.js +15 -0
- package/resizable/engine/global/utils/normalizeLayout.d.ts +11 -0
- package/resizable/engine/global/utils/normalizeLayout.js +21 -0
- package/resizable/engine/global/utils/notifyItemOnResize.d.ts +2 -0
- package/resizable/engine/global/utils/notifyItemOnResize.js +23 -0
- package/resizable/engine/global/utils/objectsEqual.d.ts +1 -0
- package/resizable/engine/global/utils/objectsEqual.js +14 -0
- package/resizable/engine/global/utils/preserveFixedItemSizes.d.ts +7 -0
- package/resizable/engine/global/utils/preserveFixedItemSizes.js +53 -0
- package/resizable/engine/global/utils/recordAxisLayoutChange.d.ts +15 -0
- package/resizable/engine/global/utils/recordAxisLayoutChange.js +25 -0
- package/resizable/engine/global/utils/updateActiveHitRegion.d.ts +18 -0
- package/resizable/engine/global/utils/updateActiveHitRegion.js +119 -0
- package/resizable/engine/global/utils/validateAxisLayout.d.ts +5 -0
- package/resizable/engine/global/utils/validateAxisLayout.js +70 -0
- package/resizable/engine/global/utils/validateItemSize.d.ts +7 -0
- package/resizable/engine/global/utils/validateItemSize.js +31 -0
- package/resizable/engine/global/utils/validateLayoutKeys.d.ts +2 -0
- package/resizable/engine/global/utils/validateLayoutKeys.js +13 -0
- package/resizable/engine/types.d.ts +13 -0
- package/resizable/engine/types.js +1 -0
- package/resizable/engine/utils/EventEmitter.d.ts +11 -0
- package/resizable/engine/utils/EventEmitter.js +60 -0
- package/resizable/engine/utils/assert.d.ts +1 -0
- package/resizable/engine/utils/assert.js +7 -0
- package/resizable/engine/utils/isArrayEqual.d.ts +1 -0
- package/resizable/engine/utils/isArrayEqual.js +15 -0
- package/resizable/engine/utils/isHTMLElement.d.ts +1 -0
- package/resizable/engine/utils/isHTMLElement.js +6 -0
- package/resizable/engine/utils/isShadowRoot.d.ts +1 -0
- package/resizable/engine/utils/isShadowRoot.js +6 -0
- package/resizable/engine/vendor/stacking-order.d.ts +7 -0
- package/resizable/engine/vendor/stacking-order.js +122 -0
- package/resizable/index.d.ts +263 -0
- package/resizable/index.jsx +537 -0
- package/resizable/mount.d.ts +115 -0
- package/resizable/mount.js +540 -0
- package/scheduler/behaviour.d.ts +71 -0
- package/scheduler/behaviour.js +243 -0
- package/scheduler/context.d.ts +100 -0
- package/scheduler/context.jsx +7 -0
- package/scheduler/dates.d.ts +53 -0
- package/scheduler/dates.js +183 -0
- package/scheduler/drag.d.ts +20 -0
- package/scheduler/drag.js +361 -0
- package/scheduler/event.d.ts +26 -0
- package/scheduler/event.jsx +93 -0
- package/scheduler/index.d.ts +57 -0
- package/scheduler/index.jsx +303 -0
- package/scheduler/intl.d.ts +16 -0
- package/scheduler/intl.js +529 -0
- package/scheduler/keys-month.d.ts +7 -0
- package/scheduler/keys-month.js +110 -0
- package/scheduler/keys-time-grid.d.ts +9 -0
- package/scheduler/keys-time-grid.js +115 -0
- package/scheduler/keys.d.ts +103 -0
- package/scheduler/keys.js +527 -0
- package/scheduler/layout-index.d.ts +3 -0
- package/scheduler/layout-index.js +6 -0
- package/scheduler/layout.d.ts +285 -0
- package/scheduler/layout.js +378 -0
- package/scheduler/menus.d.ts +66 -0
- package/scheduler/menus.jsx +88 -0
- package/scheduler/month.d.ts +26 -0
- package/scheduler/month.jsx +215 -0
- package/scheduler/pointer.d.ts +64 -0
- package/scheduler/pointer.js +203 -0
- package/scheduler/select.d.ts +11 -0
- package/scheduler/select.js +64 -0
- package/scheduler/selection.d.ts +34 -0
- package/scheduler/selection.js +39 -0
- package/scheduler/state.d.ts +296 -0
- package/scheduler/state.js +496 -0
- package/scheduler/time-grid-client.d.ts +32 -0
- package/scheduler/time-grid-client.jsx +133 -0
- package/scheduler/time-grid.d.ts +26 -0
- package/scheduler/time-grid.jsx +266 -0
- package/scheduler/time.d.ts +35 -0
- package/scheduler/time.js +56 -0
- package/scheduler/toolbar.d.ts +43 -0
- package/scheduler/toolbar.jsx +38 -0
- package/scroll-area/dom.d.ts +11 -0
- package/scroll-area/dom.js +55 -0
- package/scroll-area/index.d.ts +96 -0
- package/scroll-area/index.jsx +884 -0
- package/scroll-area/presence.d.ts +12 -0
- package/scroll-area/presence.jsx +131 -0
- package/scrolling/auto-size-virtual-scroll.d.ts +53 -0
- package/scrolling/auto-size-virtual-scroll.js +213 -0
- package/scrolling/behaviour.d.ts +3 -0
- package/scrolling/behaviour.js +5 -0
- package/scrolling/emitter.d.ts +34 -0
- package/scrolling/emitter.js +144 -0
- package/scrolling/fixed-size-virtual-scroll.d.ts +28 -0
- package/scrolling/fixed-size-virtual-scroll.js +107 -0
- package/scrolling/index.d.ts +11 -0
- package/scrolling/index.jsx +13 -0
- package/scrolling/rtl.d.ts +16 -0
- package/scrolling/rtl.js +64 -0
- package/scrolling/scroll-dispatcher.d.ts +49 -0
- package/scrolling/scroll-dispatcher.js +107 -0
- package/scrolling/scrollable.d.ts +75 -0
- package/scrolling/scrollable.js +149 -0
- package/scrolling/scrolling.css +11 -0
- package/scrolling/state.d.ts +92 -0
- package/scrolling/state.js +94 -0
- package/scrolling/viewport-ruler.d.ts +47 -0
- package/scrolling/viewport-ruler.js +100 -0
- package/scrolling/viewport.d.ts +54 -0
- package/scrolling/viewport.jsx +105 -0
- package/scrolling/virtual-scroll-strategy.d.ts +41 -0
- package/scrolling/virtual-scroll-strategy.js +2 -0
- package/scrolling/virtual-scroll-viewport.d.ts +95 -0
- package/scrolling/virtual-scroll-viewport.js +370 -0
- package/search-field/behaviour.d.ts +62 -0
- package/search-field/behaviour.jsx +116 -0
- package/search-field/index.d.ts +57 -0
- package/search-field/index.jsx +158 -0
- package/search-field/intl.d.ts +2 -0
- package/search-field/intl.js +36 -0
- package/select/behaviour.d.ts +188 -0
- package/select/behaviour.jsx +445 -0
- package/select/hidden-select.d.ts +44 -0
- package/select/hidden-select.jsx +68 -0
- package/select/index.d.ts +123 -0
- package/select/index.jsx +255 -0
- package/select/intl.d.ts +2 -0
- package/select/intl.js +36 -0
- package/select/parts.d.ts +11 -0
- package/select/parts.jsx +12 -0
- package/select/select-parts.d.ts +73 -0
- package/select/select-parts.jsx +293 -0
- package/select/select-value.d.ts +58 -0
- package/select/select-value.jsx +142 -0
- package/selection/dom-utils.d.ts +25 -0
- package/selection/dom-utils.js +77 -0
- package/selection/keyed.d.ts +19 -0
- package/selection/keyed.js +66 -0
- package/selection/list-keyboard-delegate.d.ts +67 -0
- package/selection/list-keyboard-delegate.js +274 -0
- package/selection/manager.d.ts +112 -0
- package/selection/manager.js +340 -0
- package/selection/selectable-collection.d.ts +123 -0
- package/selection/selectable-collection.js +560 -0
- package/selection/selectable-item.d.ts +128 -0
- package/selection/selectable-item.js +486 -0
- package/selection/selectable-list.d.ts +42 -0
- package/selection/selectable-list.js +34 -0
- package/selection/state.d.ts +96 -0
- package/selection/state.js +131 -0
- package/selection/type-select.d.ts +37 -0
- package/selection/type-select.js +114 -0
- package/selection/utils.d.ts +23 -0
- package/selection/utils.js +38 -0
- package/selection-indicator/context.d.ts +10 -0
- package/selection-indicator/context.js +7 -0
- package/selection-indicator/index.d.ts +20 -0
- package/selection-indicator/index.jsx +25 -0
- package/separator/behaviour.d.ts +17 -0
- package/separator/behaviour.js +17 -0
- package/separator/index.d.ts +23 -0
- package/separator/index.jsx +64 -0
- package/shared-element-transition/index.d.ts +36 -0
- package/shared-element-transition/index.jsx +182 -0
- package/shared-element-transition/transition.d.ts +19 -0
- package/shared-element-transition/transition.jsx +20 -0
- package/sheet-motion/index.d.ts +82 -0
- package/sheet-motion/index.js +386 -0
- package/sidebar/index.d.ts +257 -0
- package/sidebar/index.jsx +625 -0
- package/sidebar/pages.d.ts +71 -0
- package/sidebar/pages.jsx +177 -0
- package/sidebar/resize.d.ts +69 -0
- package/sidebar/resize.js +237 -0
- package/sidebar/sheet-motion.d.ts +15 -0
- package/sidebar/sheet-motion.js +170 -0
- package/sidebar/state.d.ts +126 -0
- package/sidebar/state.js +204 -0
- package/slider/behaviour.d.ts +141 -0
- package/slider/behaviour.jsx +492 -0
- package/slider/index.d.ts +171 -0
- package/slider/index.jsx +392 -0
- package/slider/state.d.ts +203 -0
- package/slider/state.js +377 -0
- package/slots/index.d.ts +248 -0
- package/slots/index.jsx +473 -0
- package/spinbutton/behaviour.d.ts +66 -0
- package/spinbutton/behaviour.jsx +312 -0
- package/spinbutton/intl.d.ts +2 -0
- package/spinbutton/intl.js +36 -0
- package/state/autocomplete.d.ts +26 -0
- package/state/autocomplete.js +32 -0
- package/state/calendar.d.ts +284 -0
- package/state/calendar.js +755 -0
- package/state/checkbox-group.d.ts +67 -0
- package/state/checkbox-group.js +76 -0
- package/state/combobox.d.ts +238 -0
- package/state/combobox.js +708 -0
- package/state/date-field.d.ts +407 -0
- package/state/date-field.js +1117 -0
- package/state/date-intl.d.ts +3 -0
- package/state/date-intl.js +36 -0
- package/state/date-picker.d.ts +144 -0
- package/state/date-picker.js +387 -0
- package/state/disclosure.d.ts +90 -0
- package/state/disclosure.js +148 -0
- package/state/form-validation.d.ts +89 -0
- package/state/form-validation.js +158 -0
- package/state/grid.d.ts +62 -0
- package/state/grid.js +127 -0
- package/state/list.d.ts +58 -0
- package/state/list.js +124 -0
- package/state/menu.d.ts +162 -0
- package/state/menu.js +185 -0
- package/state/overlays.d.ts +35 -0
- package/state/overlays.js +29 -0
- package/state/radio-group.d.ts +58 -0
- package/state/radio-group.js +68 -0
- package/state/search-field.d.ts +20 -0
- package/state/search-field.js +21 -0
- package/state/select.d.ts +150 -0
- package/state/select.js +187 -0
- package/state/selection.d.ts +3 -0
- package/state/selection.js +5 -0
- package/state/table-column-resize.d.ts +58 -0
- package/state/table-column-resize.js +76 -0
- package/state/table.d.ts +81 -0
- package/state/table.js +114 -0
- package/state/tabs.d.ts +85 -0
- package/state/tabs.js +161 -0
- package/state/time-field.d.ts +32 -0
- package/state/time-field.js +34 -0
- package/state/toast.d.ts +80 -0
- package/state/toast.js +146 -0
- package/state/toggle-group.d.ts +70 -0
- package/state/toggle-group.js +110 -0
- package/state/toggle.d.ts +40 -0
- package/state/toggle.js +39 -0
- package/state/tooltip.d.ts +53 -0
- package/state/tooltip.js +153 -0
- package/stepper/index.d.ts +117 -0
- package/stepper/index.jsx +405 -0
- package/stepper/state.d.ts +200 -0
- package/stepper/state.js +325 -0
- package/switch/behaviour.d.ts +12 -0
- package/switch/behaviour.jsx +9 -0
- package/switch/index.d.ts +150 -0
- package/switch/index.jsx +186 -0
- package/table/behaviour.d.ts +181 -0
- package/table/behaviour.js +334 -0
- package/table/collection.d.ts +49 -0
- package/table/collection.js +259 -0
- package/table/column-resize.d.ts +48 -0
- package/table/column-resize.jsx +247 -0
- package/table/index.d.ts +339 -0
- package/table/index.jsx +1326 -0
- package/table/intl.d.ts +2 -0
- package/table/intl.js +36 -0
- package/table/keyboard-delegate.d.ts +21 -0
- package/table/keyboard-delegate.js +166 -0
- package/table/rac-intl.d.ts +2 -0
- package/table/rac-intl.js +36 -0
- package/tabs/behaviour.d.ts +49 -0
- package/tabs/behaviour.js +173 -0
- package/tabs/index.d.ts +248 -0
- package/tabs/index.jsx +577 -0
- package/tabs/keyboard-delegate.d.ts +17 -0
- package/tabs/keyboard-delegate.js +64 -0
- package/tag-group/behaviour.d.ts +59 -0
- package/tag-group/behaviour.js +112 -0
- package/tag-group/index.d.ts +138 -0
- package/tag-group/index.jsx +565 -0
- package/tag-group/intl.d.ts +2 -0
- package/tag-group/intl.js +36 -0
- package/tailwind.css +12 -0
- package/tests-components/app/src/routes/index.d.ts +4 -0
- package/tests-components/app/src/routes/index.jsx +7 -0
- package/text/index.d.ts +15 -0
- package/text/index.jsx +61 -0
- package/text-area/index.d.ts +19 -0
- package/text-area/index.jsx +76 -0
- package/text-field/autosize.d.ts +70 -0
- package/text-field/autosize.js +355 -0
- package/text-field/behaviour.d.ts +140 -0
- package/text-field/behaviour.jsx +260 -0
- package/text-field/fields.d.ts +12 -0
- package/text-field/fields.js +20 -0
- package/text-field/index.d.ts +50 -0
- package/text-field/index.jsx +174 -0
- package/text-field/text-field.css +45 -0
- package/theme.css +1006 -0
- package/time-wheels/behaviour.d.ts +29 -0
- package/time-wheels/behaviour.js +156 -0
- package/time-wheels/index.d.ts +27 -0
- package/time-wheels/index.jsx +91 -0
- package/toast/behaviour.d.ts +51 -0
- package/toast/behaviour.jsx +273 -0
- package/toast/index.d.ts +94 -0
- package/toast/index.jsx +256 -0
- package/toast/intl.d.ts +2 -0
- package/toast/intl.js +36 -0
- package/toggle-button/behaviour.d.ts +15 -0
- package/toggle-button/behaviour.js +37 -0
- package/toggle-button/index.d.ts +59 -0
- package/toggle-button/index.jsx +206 -0
- package/toggle-button-group/behaviour.d.ts +19 -0
- package/toggle-button-group/behaviour.jsx +13 -0
- package/toggle-button-group/context.d.ts +7 -0
- package/toggle-button-group/context.js +9 -0
- package/toggle-button-group/index.d.ts +39 -0
- package/toggle-button-group/index.jsx +85 -0
- package/toggle-button-group/item.d.ts +30 -0
- package/toggle-button-group/item.jsx +37 -0
- package/toolbar/behaviour.d.ts +22 -0
- package/toolbar/behaviour.js +89 -0
- package/toolbar/index.d.ts +16 -0
- package/toolbar/index.jsx +67 -0
- package/tooltip/behaviour.d.ts +93 -0
- package/tooltip/behaviour.jsx +299 -0
- package/tooltip/index.d.ts +59 -0
- package/tooltip/index.jsx +193 -0
- package/tree/behaviour.d.ts +51 -0
- package/tree/behaviour.jsx +51 -0
- package/tree/cdk-index.d.ts +2 -0
- package/tree/cdk-index.js +6 -0
- package/tree/collection.d.ts +16 -0
- package/tree/collection.js +138 -0
- package/tree/control.d.ts +125 -0
- package/tree/control.js +166 -0
- package/tree/index.d.ts +154 -0
- package/tree/index.jsx +837 -0
- package/tree/intl.d.ts +2 -0
- package/tree/intl.js +36 -0
- package/tree/navigation-context.d.ts +44 -0
- package/tree/navigation-context.jsx +63 -0
- package/tree/tree-key-manager.d.ts +149 -0
- package/tree/tree-key-manager.js +336 -0
- package/utils/animation.d.ts +32 -0
- package/utils/animation.jsx +236 -0
- package/utils/data-attrs.d.ts +73 -0
- package/utils/data-attrs.jsx +217 -0
- package/utils/dev-off.d.ts +3 -0
- package/utils/dev-off.js +7 -0
- package/utils/dev-on.d.ts +3 -0
- package/utils/dev-on.js +17 -0
- package/utils/dom-props.d.ts +44 -0
- package/utils/dom-props.js +73 -0
- package/utils/dom.d.ts +85 -0
- package/utils/dom.js +402 -0
- package/utils/id.d.ts +23 -0
- package/utils/id.js +100 -0
- package/utils/index.d.ts +43 -0
- package/utils/index.js +160 -0
- package/utils/link-state.d.ts +6 -0
- package/utils/link-state.js +6 -0
- package/utils/links.d.ts +82 -0
- package/utils/links.jsx +150 -0
- package/utils/live-element.d.ts +8 -0
- package/utils/live-element.jsx +76 -0
- package/utils/live.d.ts +53 -0
- package/utils/live.jsx +169 -0
- package/utils/load-more-sentinel.d.ts +28 -0
- package/utils/load-more-sentinel.jsx +52 -0
- package/utils/motion-token.d.ts +4 -0
- package/utils/motion-token.js +48 -0
- package/utils/render.d.ts +19 -0
- package/utils/render.js +18 -0
- package/utils/transitions.d.ts +15 -0
- package/utils/transitions.js +104 -0
- package/utils/types.d.ts +111 -0
- package/utils/types.js +1 -0
- package/virtualizer/behaviour.d.ts +129 -0
- package/virtualizer/behaviour.js +437 -0
- package/virtualizer/collection-renderer.d.ts +62 -0
- package/virtualizer/collection-renderer.jsx +190 -0
- package/virtualizer/collection.d.ts +103 -0
- package/virtualizer/collection.js +155 -0
- package/virtualizer/dom.d.ts +50 -0
- package/virtualizer/dom.js +233 -0
- package/virtualizer/engine.d.ts +21 -0
- package/virtualizer/engine.js +21 -0
- package/virtualizer/grid-layout.d.ts +50 -0
- package/virtualizer/grid-layout.js +247 -0
- package/virtualizer/index.d.ts +3 -0
- package/virtualizer/index.jsx +5 -0
- package/virtualizer/layout-info.d.ts +33 -0
- package/virtualizer/layout-info.js +54 -0
- package/virtualizer/layout.d.ts +44 -0
- package/virtualizer/layout.js +30 -0
- package/virtualizer/list-layout.d.ts +103 -0
- package/virtualizer/list-layout.js +510 -0
- package/virtualizer/overscan-manager.d.ts +9 -0
- package/virtualizer/overscan-manager.js +32 -0
- package/virtualizer/point.d.ts +13 -0
- package/virtualizer/point.js +23 -0
- package/virtualizer/rect.d.ts +49 -0
- package/virtualizer/rect.js +105 -0
- package/virtualizer/reusable-view.d.ts +29 -0
- package/virtualizer/reusable-view.js +56 -0
- package/virtualizer/scroll-anchor.d.ts +62 -0
- package/virtualizer/scroll-anchor.js +130 -0
- package/virtualizer/size.d.ts +11 -0
- package/virtualizer/size.js +21 -0
- package/virtualizer/state.d.ts +35 -0
- package/virtualizer/state.js +89 -0
- package/virtualizer/table-collection.d.ts +45 -0
- package/virtualizer/table-collection.js +80 -0
- package/virtualizer/table-column-layout.d.ts +44 -0
- package/virtualizer/table-column-layout.js +210 -0
- package/virtualizer/table-layout.d.ts +55 -0
- package/virtualizer/table-layout.js +482 -0
- package/virtualizer/types.d.ts +63 -0
- package/virtualizer/types.js +1 -0
- package/virtualizer/utils.d.ts +2 -0
- package/virtualizer/utils.js +12 -0
- package/virtualizer/virtualizer-core.d.ts +61 -0
- package/virtualizer/virtualizer-core.js +304 -0
- package/virtualizer/virtualizer.d.ts +64 -0
- package/virtualizer/virtualizer.jsx +91 -0
- package/virtualizer/waterfall-layout.d.ts +41 -0
- package/virtualizer/waterfall-layout.js +227 -0
- package/wheel-picker/behaviour.d.ts +94 -0
- package/wheel-picker/behaviour.js +482 -0
- package/wheel-picker/index.d.ts +33 -0
- package/wheel-picker/index.jsx +66 -0
package/modal/index.jsx
ADDED
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
// Ported from packages/react-aria-components/src/Modal.tsx (ModalOverlay, Modal, ModalContext), Apache-2.0, © Adobe.
|
|
2
|
+
// RAC DOM: `<ModalOverlay>` = the underlay `div.rv-ModalOverlay` in the overlay layer (`<Overlay>`:
|
|
3
|
+
// a portal with a focus scope), `<Modal>` = the modal `div.rv-Modal` inside it, the `<Dialog>`
|
|
4
|
+
// (`../dialog`) inside that. A `<Modal>` without a `<ModalOverlay>` wraps itself in one.
|
|
5
|
+
// Rivet:
|
|
6
|
+
// - presence: a `<Show>` while `state.isOpen() || isExiting()` (RAC returns null), wrapped in an own
|
|
7
|
+
// binding site (`span[data-rv-overlay-anchor]`, `display: contents`, rendered in place): on a resumed
|
|
8
|
+
// page the first open / close re-creates only the overlay, from serializable locals (context values
|
|
9
|
+
// are resolved in the outer component and passed down as props).
|
|
10
|
+
// - enter / exit: `../utils/animation.tsx` (RA useEnterAnimation / useExitAnimation) → `data-entering` /
|
|
11
|
+
// `data-exiting="true"`; `onEnter` / `onExit` promises; `isEntering` / `isExiting` props accept an
|
|
12
|
+
// accessor too (a Signal: the component runs once, RAC re-renders).
|
|
13
|
+
// - useModalOverlay → `modalOverlay(modalElement, props, state)` from a client effect while open
|
|
14
|
+
// (Escape, outside interaction, scroll lock, `inert` outside; `isEntering` → keepVisible) +
|
|
15
|
+
// `modalUnderlayPointerDown` on the underlay.
|
|
16
|
+
// - `--visual-viewport-width/height`, `--page-width/height` are set once measured in the browser (the
|
|
17
|
+
// server HTML of an open modal has none: React Aria never server-renders a modal).
|
|
18
|
+
// - the underlay keeps inline `position: fixed; inset: 0; z-index: 100` (behaviour styles, cdk rule).
|
|
19
|
+
// - the PortalProvider container is resolved in the outer component (`useContext(PortalContext)`) and
|
|
20
|
+
// handed to `<Overlay>` (re-created overlays have no provider chain).
|
|
21
|
+
// Deviations: `UNSTABLE_portalContainer` deleted (PortalProvider only, decision 12); `render` (RAC DOMRenderProps) replaces the ModalOverlay and Modal `<div>`s (inline stacking, `data-rv-overlay` and the underlay pointer-down stay);
|
|
22
|
+
// the keyboard-deferred reveal (`runAfterKeyboard(() => setIsOpen(true))`) reveals on the first client
|
|
23
|
+
// effect (the iOS keyboard module stays lazy).
|
|
24
|
+
import { computed, createContext, signal, untrack, useContext } from "@rivetjs/reactivity";
|
|
25
|
+
import { Show, clientEffect, ref as createRef } from "@rivetjs/runtime/dom";
|
|
26
|
+
import {} from "../utils/render.js";
|
|
27
|
+
import { globalDOMProps } from "../utils/dom-props.js";
|
|
28
|
+
import { dataBool } from "../utils/data-attrs.jsx";
|
|
29
|
+
import { hasLive, liveOmit, liveOptions } from "../utils/live.jsx";
|
|
30
|
+
import { liveRenderProps } from "../slots/index.jsx";
|
|
31
|
+
import { splitProps } from "@rivetjs/runtime/props";
|
|
32
|
+
import { read } from "../interactions/utils.js";
|
|
33
|
+
import { isScrollable, viewportSize } from "../utils/dom.js";
|
|
34
|
+
import { createEnterAnimation, createExitAnimationState, watchExitAnimation } from "../utils/animation.jsx";
|
|
35
|
+
import { overlayPresence } from "@rivetjs/kit/transition";
|
|
36
|
+
import { DismissButton } from "../overlay/dismiss-button.jsx";
|
|
37
|
+
import { modalOverlay, modalUnderlayPointerDown } from "../overlay/modal-overlay.js";
|
|
38
|
+
import { OverlayTriggerStateContext } from "../overlay/contexts.js";
|
|
39
|
+
import { PressResponderContext } from "../interactions/press.jsx";
|
|
40
|
+
import { Overlay, PortalContext } from "../portal/index.jsx";
|
|
41
|
+
import { closeOverlay, createOverlayTriggerState, setOpen } from "../state/overlays.js";
|
|
42
|
+
import { Provider, contextProps, mergeRefValues, renderProps, resumableContext, } from "../slots/index.jsx";
|
|
43
|
+
import { DialogContext } from "../dialog/contexts.js";
|
|
44
|
+
/** Props for the nearest `<ModalOverlay>` / `<Modal>` from a parent (RAC `ModalContext`). */
|
|
45
|
+
export const ModalContext = resumableContext(createContext(null, { id: "rv-modal-props" }));
|
|
46
|
+
/** @private What a ModalOverlay passes to its Modal (RAC `InternalModalContext`). */
|
|
47
|
+
export const InternalModalContext = resumableContext(createContext(null, { id: "rv-modal-internal" }));
|
|
48
|
+
/**
|
|
49
|
+
* Opt-in work per open (a styled layer registers it, e.g. @rivetjs/ui's overlays: the motion token): `open(overlay,
|
|
50
|
+
* modal)` runs once per open, the overlay in the document. Unset (cdk alone): nothing runs, nothing ships.
|
|
51
|
+
*/
|
|
52
|
+
export const modalHooks = {};
|
|
53
|
+
/** The motion token (`--rv-motion-spring` → inline spring timing; motion spec D17) for `modalHooks.open`. */
|
|
54
|
+
export { applyMotionToken } from "../utils/motion-token.js";
|
|
55
|
+
/** Motion presence per open-state owner (`modalExit`), see `ModalOverlayPresence`. */
|
|
56
|
+
const presences = new WeakMap();
|
|
57
|
+
/** A modal is an overlay element which blocks interaction with elements outside it (RAC `Modal`). */
|
|
58
|
+
export function Modal(props) {
|
|
59
|
+
const ctx = useContext(InternalModalContext);
|
|
60
|
+
if (ctx) {
|
|
61
|
+
if (isDev() && (props.onOpenChange || props.defaultOpen !== undefined || props.isOpen !== undefined)) {
|
|
62
|
+
// create a list of props that are passed in but not allowed when using an external ModalOverlay
|
|
63
|
+
const invalidSet = new Set([
|
|
64
|
+
"isDismissable",
|
|
65
|
+
"isKeyboardDismissDisabled",
|
|
66
|
+
"isOpen",
|
|
67
|
+
"defaultOpen",
|
|
68
|
+
"onOpenChange",
|
|
69
|
+
"isEntering",
|
|
70
|
+
"isExiting",
|
|
71
|
+
"shouldCloseOnInteractOutside",
|
|
72
|
+
]);
|
|
73
|
+
const invalidProps = Object.keys(props).filter((key) => invalidSet.has(key));
|
|
74
|
+
console.warn(`This modal is already wrapped in a ModalOverlay, props [${invalidProps.join(", ")}] should be placed on the ModalOverlay instead.`);
|
|
75
|
+
}
|
|
76
|
+
return <ModalContent props={props} ctx={ctx}/>;
|
|
77
|
+
}
|
|
78
|
+
if (hasLive(props)) {
|
|
79
|
+
// Live props (P5): the overlay keys forward unread (controlled `isOpen` / dismiss flags become accessors), the rest
|
|
80
|
+
// goes to the modal element unread.
|
|
81
|
+
const overlay = liveOptions(splitProps(props, OVERLAY_KEYS)[0], LIVE_KEYS, ["isOpen"]);
|
|
82
|
+
return resolveOverlay(overlay, undefined, liveOmit(props, OVERLAY_KEYS));
|
|
83
|
+
}
|
|
84
|
+
const { isDismissable, isKeyboardDismissDisabled, isOpen, defaultOpen, onOpenChange, isEntering, isExiting, shouldCloseOnInteractOutside, UNSTABLE_deferUntilEntered, UNSTABLE_overrideFocus, ...otherProps } = props;
|
|
85
|
+
const overlayProps = {
|
|
86
|
+
isDismissable,
|
|
87
|
+
isKeyboardDismissDisabled,
|
|
88
|
+
isOpen,
|
|
89
|
+
defaultOpen,
|
|
90
|
+
onOpenChange,
|
|
91
|
+
isEntering,
|
|
92
|
+
isExiting,
|
|
93
|
+
shouldCloseOnInteractOutside,
|
|
94
|
+
UNSTABLE_deferUntilEntered,
|
|
95
|
+
UNSTABLE_overrideFocus,
|
|
96
|
+
};
|
|
97
|
+
return resolveOverlay(overlayProps, undefined, otherProps);
|
|
98
|
+
}
|
|
99
|
+
const OVERLAY_KEYS = [
|
|
100
|
+
"isDismissable",
|
|
101
|
+
"isKeyboardDismissDisabled",
|
|
102
|
+
"isOpen",
|
|
103
|
+
"defaultOpen",
|
|
104
|
+
"onOpenChange",
|
|
105
|
+
"isEntering",
|
|
106
|
+
"isExiting",
|
|
107
|
+
"shouldCloseOnInteractOutside",
|
|
108
|
+
"UNSTABLE_deferUntilEntered",
|
|
109
|
+
"UNSTABLE_overrideFocus",
|
|
110
|
+
];
|
|
111
|
+
/** Live props (P5): dismiss flags read at interaction time when live. */
|
|
112
|
+
const LIVE_KEYS = ["isDismissable", "isKeyboardDismissDisabled", "isEntering", "isExiting"];
|
|
113
|
+
/** A ModalOverlay is a wrapper for a Modal which allows customizing the backdrop element (RAC `ModalOverlay`). */
|
|
114
|
+
export function ModalOverlay(props) {
|
|
115
|
+
const [merged, ref] = contextProps(props, props.ref, ModalContext);
|
|
116
|
+
return resolveOverlay(liveOptions(merged, LIVE_KEYS, ["isOpen"]), ref);
|
|
117
|
+
}
|
|
118
|
+
function resolveOverlay(props, ref, modal) {
|
|
119
|
+
const contextState = useContext(OverlayTriggerStateContext);
|
|
120
|
+
const localState = untrack(() => createOverlayTriggerState(props));
|
|
121
|
+
const state = untrack(() => props.isOpen != null || props.defaultOpen != null) || !contextState ? localState : contextState;
|
|
122
|
+
if (state === contextState && isDev() && (props.onOpenChange || props.defaultOpen !== undefined || props.isOpen !== undefined)) {
|
|
123
|
+
console.warn("This modals state is controlled by a trigger, place onOpenChange on the trigger instead.");
|
|
124
|
+
}
|
|
125
|
+
const portal = useContext(PortalContext);
|
|
126
|
+
const dialogContext = useContext(DialogContext);
|
|
127
|
+
// Own binding site: on a resumed page the first open re-creates only the overlay.
|
|
128
|
+
return (<span data-rv-overlay-anchor="" style={{ display: "contents" }}>
|
|
129
|
+
<ModalOverlayPresence props={props} ref={ref} state={state} portal={portal} dialogContext={dialogContext} modal={modal}/>
|
|
130
|
+
</span>);
|
|
131
|
+
}
|
|
132
|
+
function ModalOverlayPresence(resolved) {
|
|
133
|
+
const { props, state } = resolved;
|
|
134
|
+
const overlayRef = createRef();
|
|
135
|
+
const modalRef = createRef();
|
|
136
|
+
const onExit = props.onExit;
|
|
137
|
+
const modalExit = {};
|
|
138
|
+
// Object literal values, not arguments / local consts passed as arguments: the animation effects capture them (R2).
|
|
139
|
+
const fns = {
|
|
140
|
+
isOpen: () => state.isOpen(),
|
|
141
|
+
onOverlayExit: (element) => {
|
|
142
|
+
const user = onExit?.(element);
|
|
143
|
+
const exits = presences.get(modalExit)?.take();
|
|
144
|
+
return exits ? Promise.all([user, exits]).then(() => undefined) : user;
|
|
145
|
+
},
|
|
146
|
+
onModalExit: (element) => modalExit.current?.(element),
|
|
147
|
+
};
|
|
148
|
+
// Exits of nested `@rivetjs/motion` elements: a presence scope over the open state, only when Motion is in the bundle
|
|
149
|
+
// (it fills kit `overlayPresence`; nothing here otherwise). Kept in a module map keyed by `modalExit`, never
|
|
150
|
+
// captured: closures capture eagerly (resume) and the presence holds functions.
|
|
151
|
+
const presence = overlayPresence.create?.(fns.isOpen);
|
|
152
|
+
if (presence)
|
|
153
|
+
presences.set(modalExit, presence);
|
|
154
|
+
// Exit states here, their effects inside the branch (`watchExitAnimation` in ModalOverlayInner): a closed modal
|
|
155
|
+
// records no client effect, so a resumed page with a closed Modal / Drawer does not boot the runtime at load.
|
|
156
|
+
const overlayExit = createExitAnimationState(fns.isOpen);
|
|
157
|
+
const modalExitState = createExitAnimationState(fns.isOpen);
|
|
158
|
+
const isExitingProp = props.isExiting;
|
|
159
|
+
const isExiting = computed(() => overlayExit.isExiting() || modalExitState.isExiting() || !!read(isExitingProp) || false);
|
|
160
|
+
return (<Show when={() => state.isOpen() || isExiting()}>
|
|
161
|
+
{() => {
|
|
162
|
+
const inner = () => (<ModalOverlayInner {...resolved} overlayRef={overlayRef} modalRef={modalRef} isExiting={isExiting} modalExit={modalExit} exits={{ overlay: overlayExit, modal: modalExitState, onOverlayExit: fns.onOverlayExit, onModalExit: fns.onModalExit }}/>);
|
|
163
|
+
const presence = presences.get(modalExit);
|
|
164
|
+
return presence ? presence.wrap(inner) : inner();
|
|
165
|
+
}}
|
|
166
|
+
</Show>);
|
|
167
|
+
}
|
|
168
|
+
const OWNED = ["style", "onPointerDown"];
|
|
169
|
+
function ModalOverlayInner(resolved) {
|
|
170
|
+
const { props, state, overlayRef, modalRef, isExiting, modalExit, dialogContext, exits } = resolved;
|
|
171
|
+
watchExitAnimation(overlayRef, exits.overlay, exits.onOverlayExit);
|
|
172
|
+
watchExitAnimation(modalRef, exits.modal, exits.onModalExit);
|
|
173
|
+
// Motion token (`--rv-motion-spring`, `modalHooks.open`): registered by @rivetjs/ui's overlays; cdk alone pays nothing.
|
|
174
|
+
// Read through the module object (by reference on resumed pages, never captured).
|
|
175
|
+
if (modalHooks.open)
|
|
176
|
+
clientEffect(() => {
|
|
177
|
+
const overlay = overlayRef(), modal = modalRef();
|
|
178
|
+
// A microtask later: after the portal mount puts the overlay in the document, where the token inherits.
|
|
179
|
+
if (overlay && modal)
|
|
180
|
+
queueMicrotask(() => modalHooks.open?.(overlay, modal));
|
|
181
|
+
});
|
|
182
|
+
const deferUntilEntered = !!props.UNSTABLE_deferUntilEntered;
|
|
183
|
+
// RA: revealed after `runAfterKeyboard` (an auto-focused input may open the on-screen keyboard).
|
|
184
|
+
// Rivet: a server-rendered overlay is already revealed (true is serialized), so a resumed page never runs the
|
|
185
|
+
// enter animation's not-ready hide: its effects may run before this one at load, which flashed the open overlay
|
|
186
|
+
// hidden and left an empty `style=""` on the overlay / modal elements (resume fuzz `/modal-open`, ui `/drawer-open`).
|
|
187
|
+
const isOpen = signal(typeof document === "undefined");
|
|
188
|
+
clientEffect(() => {
|
|
189
|
+
isOpen.set(true);
|
|
190
|
+
});
|
|
191
|
+
const onEnter = props.onEnter;
|
|
192
|
+
const enterFns = { onEnter: (element) => onEnter?.(element) };
|
|
193
|
+
const entered = createEnterAnimation(overlayRef, isOpen, enterFns.onEnter);
|
|
194
|
+
const isEnteringProp = props.isEntering;
|
|
195
|
+
const entering = () => entered() || !!read(isEnteringProp) || false;
|
|
196
|
+
const isDeferred = () => deferUntilEntered && (!isOpen() || entering());
|
|
197
|
+
const modalOptions = {
|
|
198
|
+
isDismissable: props.isDismissable,
|
|
199
|
+
isKeyboardDismissDisabled: props.isKeyboardDismissDisabled,
|
|
200
|
+
shouldCloseOnInteractOutside: props.shouldCloseOnInteractOutside,
|
|
201
|
+
overrideFocus: props.UNSTABLE_overrideFocus,
|
|
202
|
+
};
|
|
203
|
+
// The portal move is a client effect that may run after this one (a client render: content effects first): hiding
|
|
204
|
+
// the outside before the move hid the page's siblings of the in-place anchor instead of the page around the portal
|
|
205
|
+
// (RA: createPortal places the modal before useModalOverlay's layout effect). `onPlaced` gates it.
|
|
206
|
+
const placed = signal(false);
|
|
207
|
+
// useModalOverlay while open: released on close (the exit animation runs unblocked) and on unmount.
|
|
208
|
+
clientEffect(() => {
|
|
209
|
+
const element = modalRef();
|
|
210
|
+
if (!element || !state.isOpen() || !placed())
|
|
211
|
+
return;
|
|
212
|
+
const isEntering = isDeferred();
|
|
213
|
+
return untrack(() => modalOverlay(element, { ...modalOptions, isEntering }, state));
|
|
214
|
+
});
|
|
215
|
+
// Pass the entering state to the dialog so it waits to move focus until the modal has entered.
|
|
216
|
+
const mergedDialogContext = deferUntilEntered ? mergeDialogContext(dialogContext, { isEntering: isDeferred }) : dialogContext;
|
|
217
|
+
const values = { isEntering: entering, isExiting, state };
|
|
218
|
+
const rp = renderProps({ class: props.class, style: props.style, children: props.children, values, defaultClassName: "rv-ModalOverlay" }, hasLive(props) ? liveRenderProps(props) : undefined);
|
|
219
|
+
// useViewportSize + page size (browser only).
|
|
220
|
+
const viewport = signal(null);
|
|
221
|
+
// Capture the style accessor only: `rp` also holds `children` (a JSX slot, not serializable).
|
|
222
|
+
const userStyle = rp.style;
|
|
223
|
+
clientEffect(() => untrack(() => {
|
|
224
|
+
// RA useViewportSize: the shared viewport signal, mirrored into this overlay's signal.
|
|
225
|
+
const { size, dispose } = viewportSize();
|
|
226
|
+
viewport.set(size());
|
|
227
|
+
const win = window, target = win.visualViewport ?? win;
|
|
228
|
+
const sync = () => queueMicrotask(() => viewport.set(size()));
|
|
229
|
+
target.addEventListener("resize", sync);
|
|
230
|
+
return () => {
|
|
231
|
+
target.removeEventListener("resize", sync);
|
|
232
|
+
dispose();
|
|
233
|
+
};
|
|
234
|
+
}));
|
|
235
|
+
const style = () => {
|
|
236
|
+
const vp = viewport();
|
|
237
|
+
let pageWidth, pageHeight;
|
|
238
|
+
if (vp && typeof document !== "undefined") {
|
|
239
|
+
const scrollingElement = isScrollable(document.body) ? document.body : document.scrollingElement || document.documentElement;
|
|
240
|
+
// Prevent Firefox from adding scrollbars when the page has a fractional width/height.
|
|
241
|
+
const rect = scrollingElement.getBoundingClientRect();
|
|
242
|
+
pageWidth = scrollingElement.scrollWidth - (rect.width % 1);
|
|
243
|
+
pageHeight = scrollingElement.scrollHeight - (rect.height % 1);
|
|
244
|
+
}
|
|
245
|
+
return {
|
|
246
|
+
position: "fixed",
|
|
247
|
+
inset: "0",
|
|
248
|
+
zIndex: 100,
|
|
249
|
+
...userStyle(),
|
|
250
|
+
"--visual-viewport-width": vp ? vp.width + "px" : undefined,
|
|
251
|
+
"--visual-viewport-height": vp ? vp.height + "px" : undefined,
|
|
252
|
+
"--page-width": pageWidth !== undefined ? pageWidth + "px" : undefined,
|
|
253
|
+
"--page-height": pageHeight !== undefined ? pageHeight + "px" : undefined,
|
|
254
|
+
};
|
|
255
|
+
};
|
|
256
|
+
const dom = globalDOMProps(props, OWNED);
|
|
257
|
+
const onPointerDown = props.onPointerDown;
|
|
258
|
+
const ref = mergeRefValues(overlayRef, resolved.ref);
|
|
259
|
+
const internal = { modalRef, isOpen, isExiting, isDismissable: props.isDismissable, onExit: modalExit, state };
|
|
260
|
+
const modal = resolved.modal;
|
|
261
|
+
const id = props.id, slot = props.slot ?? undefined;
|
|
262
|
+
const providerValues = () => [
|
|
263
|
+
[InternalModalContext, internal],
|
|
264
|
+
[OverlayTriggerStateContext, state],
|
|
265
|
+
[DialogContext, mergedDialogContext],
|
|
266
|
+
// RA Overlay's ClearPressResponder: the trigger's PressResponder must not reach buttons inside.
|
|
267
|
+
[PressResponderContext, { register: () => { } }],
|
|
268
|
+
];
|
|
269
|
+
const overlayAttrs = props.render && {
|
|
270
|
+
...dom,
|
|
271
|
+
id,
|
|
272
|
+
slot,
|
|
273
|
+
class: () => rp.class(),
|
|
274
|
+
style,
|
|
275
|
+
ref,
|
|
276
|
+
"data-entering": () => dataBool(entering()),
|
|
277
|
+
"data-exiting": () => dataBool(isExiting()),
|
|
278
|
+
onPointerDown: (event) => {
|
|
279
|
+
modalUnderlayPointerDown(event);
|
|
280
|
+
onPointerDown?.(event);
|
|
281
|
+
},
|
|
282
|
+
children: () => <Provider values={providerValues()}>{modal ? <ModalContent props={modal} ctx={internal}/> : rp.children()}</Provider>,
|
|
283
|
+
};
|
|
284
|
+
if (props.render)
|
|
285
|
+
return (<Overlay portalContainer={resolved.portal} shouldContainFocus isExiting={isExiting()} onPlaced={() => placed.set(true)}>
|
|
286
|
+
{props.render(overlayAttrs, values)}
|
|
287
|
+
</Overlay>);
|
|
288
|
+
return (<Overlay portalContainer={resolved.portal} shouldContainFocus isExiting={isExiting()} onPlaced={() => placed.set(true)}>
|
|
289
|
+
<div {...dom} id={id} slot={slot} class={rp.class()} style={style()} ref={ref} data-entering={dataBool(entering())} data-exiting={dataBool(isExiting())} onPointerDown={(event) => {
|
|
290
|
+
modalUnderlayPointerDown(event);
|
|
291
|
+
onPointerDown?.(event);
|
|
292
|
+
}}>
|
|
293
|
+
<Provider values={[
|
|
294
|
+
[InternalModalContext, internal],
|
|
295
|
+
[OverlayTriggerStateContext, state],
|
|
296
|
+
[DialogContext, mergedDialogContext],
|
|
297
|
+
// RA Overlay's ClearPressResponder: the trigger's PressResponder must not reach buttons inside.
|
|
298
|
+
[PressResponderContext, { register: () => { } }],
|
|
299
|
+
]}>
|
|
300
|
+
{modal ? <ModalContent props={modal} ctx={internal}/> : rp.children()}
|
|
301
|
+
</Provider>
|
|
302
|
+
</div>
|
|
303
|
+
</Overlay>);
|
|
304
|
+
}
|
|
305
|
+
function mergeDialogContext(context, props) {
|
|
306
|
+
if (context && "slots" in context && context.slots) {
|
|
307
|
+
const slots = {};
|
|
308
|
+
for (const key in context.slots)
|
|
309
|
+
slots[key] = { ...context.slots[key], ...props };
|
|
310
|
+
return { ...context, slots };
|
|
311
|
+
}
|
|
312
|
+
return { ...context, ...props };
|
|
313
|
+
}
|
|
314
|
+
/** The modal element (RAC `ModalContent`): render props, `data-entering` / `data-exiting`, DismissButton. */
|
|
315
|
+
function ModalContent(input) {
|
|
316
|
+
const { props, ctx } = input;
|
|
317
|
+
const { modalRef, isExiting, isDismissable, isOpen, state } = ctx;
|
|
318
|
+
const ref = mergeRefValues(modalRef, props.ref);
|
|
319
|
+
const onEnter = props.onEnter;
|
|
320
|
+
const enterFns = { onEnter: (element) => onEnter?.(element) };
|
|
321
|
+
const entering = createEnterAnimation(modalRef, isOpen, enterFns.onEnter);
|
|
322
|
+
// RA: `onExitRef.current = props.onExit` (layout effect) — the overlay's exit animation of this element calls it.
|
|
323
|
+
ctx.onExit.current = props.onExit;
|
|
324
|
+
const values = { isEntering: entering, isExiting, state };
|
|
325
|
+
const rp = renderProps({ class: props.class, style: props.style, children: props.children, values, defaultClassName: "rv-Modal" }, hasLive(props) ? liveRenderProps(props) : undefined);
|
|
326
|
+
const dom = globalDOMProps(props, ["style"]);
|
|
327
|
+
const id = props.id, slot = props.slot ?? undefined;
|
|
328
|
+
if (props.render) {
|
|
329
|
+
const attrs = {
|
|
330
|
+
...dom,
|
|
331
|
+
id,
|
|
332
|
+
slot,
|
|
333
|
+
class: () => rp.class(),
|
|
334
|
+
style: () => rp.style(),
|
|
335
|
+
ref,
|
|
336
|
+
"data-rv-overlay": "",
|
|
337
|
+
"data-entering": () => dataBool(entering()),
|
|
338
|
+
"data-exiting": () => dataBool(isExiting()),
|
|
339
|
+
children: () => [
|
|
340
|
+
typeof isDismissable === "function" ? (<Show when={isDismissable}>{() => <DismissButton onDismiss={() => closeOverlay(state)}/>}</Show>) : isDismissable ? (<DismissButton onDismiss={() => closeOverlay(state)}/>) : null,
|
|
341
|
+
<Provider values={[[InternalModalContext, null]]}>{rp.children()}</Provider>,
|
|
342
|
+
],
|
|
343
|
+
};
|
|
344
|
+
return props.render(attrs, values);
|
|
345
|
+
}
|
|
346
|
+
return (<div {...dom} id={id} slot={slot} class={rp.class()} style={rp.style()} ref={ref} data-rv-overlay="" data-entering={dataBool(entering())} data-exiting={dataBool(isExiting())}>
|
|
347
|
+
{typeof isDismissable === "function" ? (
|
|
348
|
+
// Live props (P5): a live `isDismissable` shows / hides the DismissButton.
|
|
349
|
+
<Show when={isDismissable}>{() => <DismissButton onDismiss={() => closeOverlay(state)}/>}</Show>) : isDismissable ? (<DismissButton onDismiss={() => closeOverlay(state)}/>) : null}
|
|
350
|
+
{/* Deviation: cleared for the content, so a nested DialogTrigger's <Modal> opens its own overlay
|
|
351
|
+
(RAC leaves it set: a nested Modal would render inline as this overlay's modal). */}
|
|
352
|
+
<Provider values={[[InternalModalContext, null]]}>{rp.children()}</Provider>
|
|
353
|
+
</div>);
|
|
354
|
+
}
|
|
355
|
+
const isDev = () => globalThis.process?.env?.NODE_ENV === "development";
|
|
356
|
+
/** @internal Opens / closes a modal state (re-exported for callers of the old API). */
|
|
357
|
+
export { setOpen };
|
|
358
|
+
// react-aria hooks (useModal / ModalProvider / OverlayContainer).
|
|
359
|
+
export * from "./provider.jsx";
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { Content } from "@rivetjs/runtime/jsx-runtime";
|
|
2
|
+
import { type PortalMount } from "../portal/index.jsx";
|
|
3
|
+
/**
|
|
4
|
+
* Children of the providers below: content (plain JSX children are a lazy compiler slot rendered
|
|
5
|
+
* under the provider, `renderSlot`) or a function returning it.
|
|
6
|
+
*/
|
|
7
|
+
export type ProviderChildren = Content | (() => Content);
|
|
8
|
+
/** Id of the enclosing modal provider element (render time). */
|
|
9
|
+
export declare const ModalProviderContext: import("@rivetjs/reactivity").Context<string | null>;
|
|
10
|
+
/** Attributes of a modal provider element: `data-overlay-container`, its id, its parent provider. */
|
|
11
|
+
export declare function modalProviderProps(id: string, parent?: string | null): Record<string, string | undefined>;
|
|
12
|
+
/**
|
|
13
|
+
* Make `children` belong to the provider element with id `id` (render it with
|
|
14
|
+
* `modalProviderProps(id, parent)`); React Aria `ModalProvider` (+ `useModalProvider`).
|
|
15
|
+
*/
|
|
16
|
+
export declare function ModalProvider(props: {
|
|
17
|
+
id: string;
|
|
18
|
+
children?: ProviderChildren;
|
|
19
|
+
}): import("@rivetjs/runtime/jsx-runtime").CompiledElement;
|
|
20
|
+
/** A root that is `aria-hidden` while a modal of a nested provider is open (React Aria `OverlayProvider`). */
|
|
21
|
+
export declare function OverlayProvider(props: {
|
|
22
|
+
id?: string;
|
|
23
|
+
class?: string;
|
|
24
|
+
children?: ProviderChildren;
|
|
25
|
+
}): import("@rivetjs/runtime/jsx-runtime").CompiledElement;
|
|
26
|
+
/**
|
|
27
|
+
* Overlays like modals rendered in a portal at the end of body (or `portalContainer`), inside their
|
|
28
|
+
* own provider; the providers around it are hidden while a modal inside is open.
|
|
29
|
+
*/
|
|
30
|
+
export declare function OverlayContainer(props: {
|
|
31
|
+
portalContainer?: PortalMount;
|
|
32
|
+
class?: string;
|
|
33
|
+
children?: ProviderChildren;
|
|
34
|
+
}): import("@rivetjs/runtime/jsx-runtime").CompiledElement;
|
|
35
|
+
export interface AriaModalOptions {
|
|
36
|
+
isDisabled?: boolean;
|
|
37
|
+
}
|
|
38
|
+
/** Attributes of the modal content element (`data-ismodal`, for the aria-modal polyfill). */
|
|
39
|
+
export declare function modalProps(options?: AriaModalOptions): {
|
|
40
|
+
"data-ismodal": boolean;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* The modal `element` opened (React Aria `useModal`): hide every provider above the one containing
|
|
44
|
+
* it (its logical parents). Returns the release function. Throws when `element` is not inside a
|
|
45
|
+
* provider, like React Aria.
|
|
46
|
+
*/
|
|
47
|
+
export declare function modal(element: Element, options?: AriaModalOptions): () => void;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
// Modal providers (React Aria `ModalProvider` / `OverlayProvider` / `OverlayContainer` / `useModal`):
|
|
2
|
+
// while a modal is open, every provider *around* the one containing it is `aria-hidden`, so only
|
|
3
|
+
// the top-most modal is reachable by screen readers. React counts modals through context; Rivet
|
|
4
|
+
// links providers at render time instead (an `OverlayContainer` records its logical parent provider
|
|
5
|
+
// in `data-rv-modal-parent`, which survives the portal move), and `modal()` — called when the modal
|
|
6
|
+
// opens, in a handler — walks that chain, counting per provider (`data-rv-modal-count`).
|
|
7
|
+
// For portaled modals (the overlay layer).
|
|
8
|
+
//
|
|
9
|
+
// Ported from @react-aria/overlays (useModal.tsx), Apache-2.0, © Adobe.
|
|
10
|
+
import { createContext, useContext } from "@rivetjs/reactivity";
|
|
11
|
+
import { resumableContext } from "@rivetjs/runtime/resume-format";
|
|
12
|
+
import { Provider } from "@rivetjs/runtime/dom";
|
|
13
|
+
import { createId } from "../utils/id.js";
|
|
14
|
+
import { Portal, PortalContext } from "../portal/index.jsx";
|
|
15
|
+
import { renderSlot } from "@rivetjs/runtime/slot";
|
|
16
|
+
const content = (children) => renderSlot(children);
|
|
17
|
+
/** Id of the enclosing modal provider element (render time). */
|
|
18
|
+
export const ModalProviderContext = resumableContext(createContext(null, { id: "rv-modal" }));
|
|
19
|
+
/** Attributes of a modal provider element: `data-overlay-container`, its id, its parent provider. */
|
|
20
|
+
export function modalProviderProps(id, parent = null) {
|
|
21
|
+
return { "data-overlay-container": "", id, "data-rv-modal-parent": parent ?? undefined };
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Make `children` belong to the provider element with id `id` (render it with
|
|
25
|
+
* `modalProviderProps(id, parent)`); React Aria `ModalProvider` (+ `useModalProvider`).
|
|
26
|
+
*/
|
|
27
|
+
export function ModalProvider(props) {
|
|
28
|
+
const children = props.children;
|
|
29
|
+
return (<Provider token={ModalProviderContext} value={props.id}>
|
|
30
|
+
{content(children)}
|
|
31
|
+
</Provider>);
|
|
32
|
+
}
|
|
33
|
+
/** A root that is `aria-hidden` while a modal of a nested provider is open (React Aria `OverlayProvider`). */
|
|
34
|
+
export function OverlayProvider(props) {
|
|
35
|
+
const id = props.id ?? createId();
|
|
36
|
+
const parent = useContext(ModalProviderContext);
|
|
37
|
+
// Read before the JSX: an element with a spread resumes as one binding over all its attributes,
|
|
38
|
+
// and reading `props` there would capture the whole props object (children included).
|
|
39
|
+
const className = props.class;
|
|
40
|
+
return (<div {...modalProviderProps(id, parent)} class={className}>
|
|
41
|
+
<ModalProvider id={id}>{props.children}</ModalProvider>
|
|
42
|
+
</div>);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Overlays like modals rendered in a portal at the end of body (or `portalContainer`), inside their
|
|
46
|
+
* own provider; the providers around it are hidden while a modal inside is open.
|
|
47
|
+
*/
|
|
48
|
+
export function OverlayContainer(props) {
|
|
49
|
+
const container = props.portalContainer ?? useContext(PortalContext);
|
|
50
|
+
return (<Portal mount={container}>
|
|
51
|
+
<OverlayProvider class={props.class}>{props.children}</OverlayProvider>
|
|
52
|
+
</Portal>);
|
|
53
|
+
}
|
|
54
|
+
/** Attributes of the modal content element (`data-ismodal`, for the aria-modal polyfill). */
|
|
55
|
+
export function modalProps(options) {
|
|
56
|
+
return { "data-ismodal": !options?.isDisabled };
|
|
57
|
+
}
|
|
58
|
+
const COUNT = "data-rv-modal-count";
|
|
59
|
+
function adjust(provider, by) {
|
|
60
|
+
const count = Math.max(0, (Number(provider.getAttribute(COUNT)) || 0) + by);
|
|
61
|
+
if (count) {
|
|
62
|
+
provider.setAttribute(COUNT, String(count));
|
|
63
|
+
provider.setAttribute("aria-hidden", "true");
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
provider.removeAttribute(COUNT);
|
|
67
|
+
provider.removeAttribute("aria-hidden");
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* The modal `element` opened (React Aria `useModal`): hide every provider above the one containing
|
|
72
|
+
* it (its logical parents). Returns the release function. Throws when `element` is not inside a
|
|
73
|
+
* provider, like React Aria.
|
|
74
|
+
*/
|
|
75
|
+
export function modal(element, options) {
|
|
76
|
+
const own = element.closest("[data-overlay-container]");
|
|
77
|
+
if (!own)
|
|
78
|
+
throw new Error("Modal is not contained within a provider");
|
|
79
|
+
if (options?.isDisabled)
|
|
80
|
+
return () => { };
|
|
81
|
+
const doc = element.ownerDocument;
|
|
82
|
+
const parents = [];
|
|
83
|
+
// The immediate provider stays visible; its parents are hidden.
|
|
84
|
+
for (let id = own.getAttribute("data-rv-modal-parent"); id;) {
|
|
85
|
+
const parent = doc.getElementById(id);
|
|
86
|
+
if (!parent || parents.includes(parent))
|
|
87
|
+
break;
|
|
88
|
+
parents.push(parent);
|
|
89
|
+
id = parent.getAttribute("data-rv-modal-parent");
|
|
90
|
+
}
|
|
91
|
+
// A provider outside any OverlayContainer: DOM ancestors are its parents.
|
|
92
|
+
if (!parents.length)
|
|
93
|
+
for (let p = own.parentElement?.closest("[data-overlay-container]"); p; p = p.parentElement?.closest("[data-overlay-container]"))
|
|
94
|
+
parents.push(p);
|
|
95
|
+
for (const parent of parents)
|
|
96
|
+
adjust(parent, 1);
|
|
97
|
+
let released = false;
|
|
98
|
+
return () => {
|
|
99
|
+
if (released)
|
|
100
|
+
return;
|
|
101
|
+
released = true;
|
|
102
|
+
for (const parent of parents)
|
|
103
|
+
adjust(parent, -1);
|
|
104
|
+
};
|
|
105
|
+
}
|
package/morph/index.d.ts
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { type Signal } from "@rivetjs/reactivity";
|
|
2
|
+
import { type ControlledState } from "../interactions/controllable.js";
|
|
3
|
+
/** Logical direction the surface grows toward (`start` / `end` mirror in RTL). */
|
|
4
|
+
export type MorphDirection = "top" | "top-end" | "end" | "bottom-end" | "bottom" | "bottom-start" | "start" | "top-start";
|
|
5
|
+
export interface MorphStateProps {
|
|
6
|
+
/** Whether the surface is expanded (controlled): a plain value, a two-way Signal or an accessor. */
|
|
7
|
+
isOpen?: boolean | Signal<boolean> | (() => boolean);
|
|
8
|
+
/** Initial expanded state (uncontrolled). @default false */
|
|
9
|
+
defaultOpen?: boolean;
|
|
10
|
+
/** Called when the open state changes. */
|
|
11
|
+
onOpenChange?: (isOpen: boolean) => void;
|
|
12
|
+
/** Whether opening is disabled. */
|
|
13
|
+
isDisabled?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface MorphState {
|
|
16
|
+
/** The open state (read `state.open.value()` in bindings). */
|
|
17
|
+
readonly open: ControlledState<boolean>;
|
|
18
|
+
readonly isDisabled: boolean;
|
|
19
|
+
}
|
|
20
|
+
/** Morph open state (react-stately `useControlledState` semantics through `controllable`). */
|
|
21
|
+
export declare function createMorphState(props?: MorphStateProps): MorphState;
|
|
22
|
+
/** Whether the morph is open (tracked read). */
|
|
23
|
+
export declare const isMorphOpen: (state: MorphState) => boolean;
|
|
24
|
+
export interface MorphMotionOptions {
|
|
25
|
+
/** Base duration (embla `duration`, fixed 60 Hz steps; lower = stiffer). @default 10 */
|
|
26
|
+
duration?: number;
|
|
27
|
+
/** Base friction (embla; lower = less damping). @default 0.6 */
|
|
28
|
+
friction?: number;
|
|
29
|
+
}
|
|
30
|
+
/** Default morph duration (embla units). */
|
|
31
|
+
export declare const MORPH_DURATION = 10;
|
|
32
|
+
/** Default morph friction. */
|
|
33
|
+
export declare const MORPH_FRICTION = 0.6;
|
|
34
|
+
/** Whether morphs on `root` jump (reduced motion or `data-animation="disabled"`). */
|
|
35
|
+
export declare function morphReducesMotion(root: Element): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Morphs `root` to its open (`true`) or collapsed state. Idempotent per target; a call mid-morph retargets the running
|
|
38
|
+
* motion (velocity kept). `onSettle` runs once the surface rests at the new target (also when jumping).
|
|
39
|
+
*/
|
|
40
|
+
export declare function morphTo(root: HTMLElement, open: boolean, options?: MorphMotionOptions & {
|
|
41
|
+
jump?: boolean;
|
|
42
|
+
onSettle?: () => void;
|
|
43
|
+
}): void;
|
|
44
|
+
/** Whether a morph is running on `root`. */
|
|
45
|
+
export declare const isMorphing: (root: Element) => boolean;
|
|
46
|
+
/** A viewport rect + corner radius (px). */
|
|
47
|
+
export interface MorphRect {
|
|
48
|
+
x: number;
|
|
49
|
+
y: number;
|
|
50
|
+
w: number;
|
|
51
|
+
h: number;
|
|
52
|
+
r: number;
|
|
53
|
+
}
|
|
54
|
+
export interface MorphRectOptions extends MorphMotionOptions {
|
|
55
|
+
/** The collapsed rect (p = 0), e.g. the source row's `getBoundingClientRect()`; read when a morph starts from rest. */
|
|
56
|
+
from: () => MorphRect;
|
|
57
|
+
/** The expanded rect (p = 1): where the surface rests open; read when a morph starts from rest. */
|
|
58
|
+
to: () => MorphRect;
|
|
59
|
+
/** Element whose inline `opacity` follows the progress (a dimming backdrop). */
|
|
60
|
+
backdrop?: HTMLElement | null;
|
|
61
|
+
/** Jump (no motion). Reduced motion / `data-animation="disabled"` on the surface jump too. */
|
|
62
|
+
jump?: boolean;
|
|
63
|
+
/** Runs once the surface rests at the new target. */
|
|
64
|
+
onSettle?: () => void;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Morphs a fixed-position `surface` between `from` (closed, p = 0) and `to` (open, p = 1): every frame writes the
|
|
68
|
+
* surface's inline `left` / `top` / `width` / `height` / `border-radius`, `--morph-progress` on it and the backdrop's
|
|
69
|
+
* `opacity` (no reads in the loop). Both rects are read once when a morph starts from rest; a call mid-morph retargets
|
|
70
|
+
* the running motion (velocity kept, no re-measure). The caller keeps the surface `position: fixed` and clips it
|
|
71
|
+
* (`overflow: hidden`).
|
|
72
|
+
*/
|
|
73
|
+
export declare function morphRectTo(surface: HTMLElement, open: boolean, options: MorphRectOptions): void;
|
|
74
|
+
/** Current progress of a rect morph (0 closed … 1 open), or `undefined` when `surface` never morphed. */
|
|
75
|
+
export declare const morphRectProgress: (surface: Element) => number | undefined;
|
|
76
|
+
/** Finds the morph root an event / element belongs to. */
|
|
77
|
+
export declare const morphRootOf: (el: EventTarget | null | undefined) => HTMLElement | null;
|
|
78
|
+
/** Sets the open state and morphs `root` (when given) with focus + dismiss handling. */
|
|
79
|
+
export declare function setMorphOpen(state: MorphState, open: boolean, root?: HTMLElement | null, motion?: MorphMotionOptions, restoreFocus?: boolean): void;
|
|
80
|
+
/** Opens the morph (`root` = the morph root or any element inside it). */
|
|
81
|
+
export declare const openMorph: (state: MorphState, el?: EventTarget | null, motion?: MorphMotionOptions) => void;
|
|
82
|
+
/** Closes the morph. */
|
|
83
|
+
export declare const closeMorph: (state: MorphState, el?: EventTarget | null, motion?: MorphMotionOptions) => void;
|
|
84
|
+
/** Toggles the morph. */
|
|
85
|
+
export declare const toggleMorph: (state: MorphState, el?: EventTarget | null, motion?: MorphMotionOptions) => void;
|
|
86
|
+
/**
|
|
87
|
+
* Morphs `root` to `open` and wires focus + dismissal: opening installs Escape / outside-press / focus-out listeners
|
|
88
|
+
* (they call `setMorphOpen(state, false, root)`), moves focus into the panel; closing removes them and returns focus to the
|
|
89
|
+
* trigger. Safe to call repeatedly (controlled state followers call it from an effect).
|
|
90
|
+
*/
|
|
91
|
+
export declare function syncMorph(state: MorphState, root: HTMLElement, open: boolean, motion?: MorphMotionOptions, restoreFocus?: boolean): void;
|