@g9tm/lynxcontrols 0.0.0-stage → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -2
- package/dist/.tsbuildinfo +1 -0
- package/dist/base/base.css +16 -0
- package/dist/base/base.css.map +1 -0
- package/dist/base/control.d.ts +44 -0
- package/dist/base/control.d.ts.map +1 -0
- package/dist/base/control.jsx +24 -0
- package/dist/base/control.jsx.map +1 -0
- package/dist/base/corner-badge.d.ts +35 -0
- package/dist/base/corner-badge.d.ts.map +1 -0
- package/dist/base/corner-badge.jsx +45 -0
- package/dist/base/corner-badge.jsx.map +1 -0
- package/dist/base/disposer.d.ts +28 -0
- package/dist/base/disposer.d.ts.map +1 -0
- package/dist/base/disposer.jsx +61 -0
- package/dist/base/disposer.jsx.map +1 -0
- package/dist/base/index.d.ts +10 -0
- package/dist/base/index.d.ts.map +1 -0
- package/dist/base/index.jsx +9 -0
- package/dist/base/press.d.ts +38 -0
- package/dist/base/press.d.ts.map +1 -0
- package/dist/base/press.jsx +73 -0
- package/dist/base/press.jsx.map +1 -0
- package/dist/base/pressable.d.ts +25 -0
- package/dist/base/pressable.d.ts.map +1 -0
- package/dist/base/pressable.jsx +38 -0
- package/dist/base/pressable.jsx.map +1 -0
- package/dist/base/selection-item.d.ts +29 -0
- package/dist/base/selection-item.d.ts.map +1 -0
- package/dist/base/selection-item.jsx +6 -0
- package/dist/base/selection-item.jsx.map +1 -0
- package/dist/base/timers.d.ts +7 -0
- package/dist/base/timers.d.ts.map +1 -0
- package/dist/base/timers.jsx +10 -0
- package/dist/base/timers.jsx.map +1 -0
- package/dist/base/use-controllable-state.d.ts +30 -0
- package/dist/base/use-controllable-state.d.ts.map +1 -0
- package/dist/base/use-controllable-state.jsx +49 -0
- package/dist/base/use-controllable-state.jsx.map +1 -0
- package/dist/base/use-stable-callback.d.ts +8 -0
- package/dist/base/use-stable-callback.d.ts.map +1 -0
- package/dist/base/use-stable-callback.jsx +12 -0
- package/dist/base/use-stable-callback.jsx.map +1 -0
- package/dist/button/button.css +162 -0
- package/dist/button/button.css.map +1 -0
- package/dist/button/button.d.ts +52 -0
- package/dist/button/button.d.ts.map +1 -0
- package/dist/button/button.jsx +87 -0
- package/dist/button/button.jsx.map +1 -0
- package/dist/button/header-action-button.d.ts +34 -0
- package/dist/button/header-action-button.d.ts.map +1 -0
- package/dist/button/header-action-button.jsx +51 -0
- package/dist/button/header-action-button.jsx.map +1 -0
- package/dist/button/icon-button.d.ts +46 -0
- package/dist/button/icon-button.d.ts.map +1 -0
- package/dist/button/icon-button.jsx +69 -0
- package/dist/button/icon-button.jsx.map +1 -0
- package/dist/button/index.d.ts +9 -0
- package/dist/button/index.d.ts.map +1 -0
- package/dist/button/index.jsx +8 -0
- package/dist/button/nav-card.d.ts +58 -0
- package/dist/button/nav-card.d.ts.map +1 -0
- package/dist/button/nav-card.jsx +95 -0
- package/dist/button/nav-card.jsx.map +1 -0
- package/dist/button/safe-tap.d.ts +27 -0
- package/dist/button/safe-tap.d.ts.map +1 -0
- package/dist/button/safe-tap.jsx +46 -0
- package/dist/button/safe-tap.jsx.map +1 -0
- package/dist/button/safe.d.ts +84 -0
- package/dist/button/safe.d.ts.map +1 -0
- package/dist/button/safe.jsx +116 -0
- package/dist/button/safe.jsx.map +1 -0
- package/dist/button/vertical-icon-text-button.d.ts +18 -0
- package/dist/button/vertical-icon-text-button.d.ts.map +1 -0
- package/dist/button/vertical-icon-text-button.jsx +21 -0
- package/dist/button/vertical-icon-text-button.jsx.map +1 -0
- package/dist/button/visuals.d.ts +53 -0
- package/dist/button/visuals.d.ts.map +1 -0
- package/dist/button/visuals.jsx +92 -0
- package/dist/button/visuals.jsx.map +1 -0
- package/dist/cascade/cascade-panel.d.ts +80 -0
- package/dist/cascade/cascade-panel.d.ts.map +1 -0
- package/dist/cascade/cascade-panel.jsx +179 -0
- package/dist/cascade/cascade-panel.jsx.map +1 -0
- package/dist/cascade/cascade.css +70 -0
- package/dist/cascade/cascade.css.map +1 -0
- package/dist/cascade/index.d.ts +3 -0
- package/dist/cascade/index.d.ts.map +1 -0
- package/dist/cascade/index.jsx +2 -0
- package/dist/cascade/model.d.ts +68 -0
- package/dist/cascade/model.d.ts.map +1 -0
- package/dist/cascade/model.jsx +161 -0
- package/dist/cascade/model.jsx.map +1 -0
- package/dist/deferred/deferred-content.d.ts +82 -0
- package/dist/deferred/deferred-content.d.ts.map +1 -0
- package/dist/deferred/deferred-content.jsx +263 -0
- package/dist/deferred/deferred-content.jsx.map +1 -0
- package/dist/deferred/deferred.css +62 -0
- package/dist/deferred/deferred.css.map +1 -0
- package/dist/deferred/index.d.ts +3 -0
- package/dist/deferred/index.d.ts.map +1 -0
- package/dist/deferred/index.jsx +2 -0
- package/dist/deferred/readiness-signal.d.ts +16 -0
- package/dist/deferred/readiness-signal.d.ts.map +1 -0
- package/dist/deferred/readiness-signal.jsx +29 -0
- package/dist/deferred/readiness-signal.jsx.map +1 -0
- package/dist/display/activity-indicator.d.ts +21 -0
- package/dist/display/activity-indicator.d.ts.map +1 -0
- package/dist/display/activity-indicator.jsx +22 -0
- package/dist/display/activity-indicator.jsx.map +1 -0
- package/dist/display/culture-date-time-label.d.ts +64 -0
- package/dist/display/culture-date-time-label.d.ts.map +1 -0
- package/dist/display/culture-date-time-label.jsx +71 -0
- package/dist/display/culture-date-time-label.jsx.map +1 -0
- package/dist/display/display.css +217 -0
- package/dist/display/display.css.map +1 -0
- package/dist/display/index.d.ts +7 -0
- package/dist/display/index.d.ts.map +1 -0
- package/dist/display/index.jsx +6 -0
- package/dist/display/progress-bar.d.ts +38 -0
- package/dist/display/progress-bar.d.ts.map +1 -0
- package/dist/display/progress-bar.jsx +57 -0
- package/dist/display/progress-bar.jsx.map +1 -0
- package/dist/display/separator.d.ts +30 -0
- package/dist/display/separator.d.ts.map +1 -0
- package/dist/display/separator.jsx +55 -0
- package/dist/display/separator.jsx.map +1 -0
- package/dist/display/shimmer.d.ts +41 -0
- package/dist/display/shimmer.d.ts.map +1 -0
- package/dist/display/shimmer.jsx +41 -0
- package/dist/display/shimmer.jsx.map +1 -0
- package/dist/display/title-with-line.d.ts +13 -0
- package/dist/display/title-with-line.d.ts.map +1 -0
- package/dist/display/title-with-line.jsx +21 -0
- package/dist/display/title-with-line.jsx.map +1 -0
- package/dist/edge-panel/edge-panel.css +132 -0
- package/dist/edge-panel/edge-panel.css.map +1 -0
- package/dist/edge-panel/edge-panel.d.ts +87 -0
- package/dist/edge-panel/edge-panel.d.ts.map +1 -0
- package/dist/edge-panel/edge-panel.jsx +326 -0
- package/dist/edge-panel/edge-panel.jsx.map +1 -0
- package/dist/edge-panel/helper.d.ts +27 -0
- package/dist/edge-panel/helper.d.ts.map +1 -0
- package/dist/edge-panel/helper.jsx +118 -0
- package/dist/edge-panel/helper.jsx.map +1 -0
- package/dist/edge-panel/index.d.ts +4 -0
- package/dist/edge-panel/index.d.ts.map +1 -0
- package/dist/edge-panel/index.jsx +3 -0
- package/dist/edge-panel/types.d.ts +155 -0
- package/dist/edge-panel/types.d.ts.map +1 -0
- package/dist/edge-panel/types.jsx +139 -0
- package/dist/edge-panel/types.jsx.map +1 -0
- package/dist/expander/expander.css +54 -0
- package/dist/expander/expander.css.map +1 -0
- package/dist/expander/expander.d.ts +46 -0
- package/dist/expander/expander.d.ts.map +1 -0
- package/dist/expander/expander.jsx +110 -0
- package/dist/expander/expander.jsx.map +1 -0
- package/dist/expander/index.d.ts +2 -0
- package/dist/expander/index.d.ts.map +1 -0
- package/dist/expander/index.jsx +1 -0
- package/dist/fields/dictation.d.ts +43 -0
- package/dist/fields/dictation.d.ts.map +1 -0
- package/dist/fields/dictation.jsx +124 -0
- package/dist/fields/dictation.jsx.map +1 -0
- package/dist/fields/editor.d.ts +26 -0
- package/dist/fields/editor.d.ts.map +1 -0
- package/dist/fields/editor.jsx +46 -0
- package/dist/fields/editor.jsx.map +1 -0
- package/dist/fields/fields.css +156 -0
- package/dist/fields/fields.css.map +1 -0
- package/dist/fields/index.d.ts +12 -0
- package/dist/fields/index.d.ts.map +1 -0
- package/dist/fields/index.jsx +11 -0
- package/dist/fields/input-policy.d.ts +48 -0
- package/dist/fields/input-policy.d.ts.map +1 -0
- package/dist/fields/input-policy.jsx +215 -0
- package/dist/fields/input-policy.jsx.map +1 -0
- package/dist/fields/outlined-field.d.ts +146 -0
- package/dist/fields/outlined-field.d.ts.map +1 -0
- package/dist/fields/outlined-field.jsx +196 -0
- package/dist/fields/outlined-field.jsx.map +1 -0
- package/dist/fields/pin-entry.d.ts +63 -0
- package/dist/fields/pin-entry.d.ts.map +1 -0
- package/dist/fields/pin-entry.jsx +293 -0
- package/dist/fields/pin-entry.jsx.map +1 -0
- package/dist/fields/search-entry.d.ts +35 -0
- package/dist/fields/search-entry.d.ts.map +1 -0
- package/dist/fields/search-entry.jsx +118 -0
- package/dist/fields/search-entry.jsx.map +1 -0
- package/dist/fields/slot-layout.d.ts +33 -0
- package/dist/fields/slot-layout.d.ts.map +1 -0
- package/dist/fields/slot-layout.jsx +33 -0
- package/dist/fields/slot-layout.jsx.map +1 -0
- package/dist/fields/text-entry.d.ts +62 -0
- package/dist/fields/text-entry.d.ts.map +1 -0
- package/dist/fields/text-entry.jsx +72 -0
- package/dist/fields/text-entry.jsx.map +1 -0
- package/dist/fields/use-dictation.d.ts +34 -0
- package/dist/fields/use-dictation.d.ts.map +1 -0
- package/dist/fields/use-dictation.jsx +80 -0
- package/dist/fields/use-dictation.jsx.map +1 -0
- package/dist/fields/use-text-input.d.ts +150 -0
- package/dist/fields/use-text-input.d.ts.map +1 -0
- package/dist/fields/use-text-input.jsx +237 -0
- package/dist/fields/use-text-input.jsx.map +1 -0
- package/dist/fields/validator.d.ts +14 -0
- package/dist/fields/validator.d.ts.map +1 -0
- package/dist/fields/validator.jsx +20 -0
- package/dist/fields/validator.jsx.map +1 -0
- package/dist/host/back.d.ts +42 -0
- package/dist/host/back.d.ts.map +1 -0
- package/dist/host/back.jsx +47 -0
- package/dist/host/back.jsx.map +1 -0
- package/dist/host/hooks.d.ts +85 -0
- package/dist/host/hooks.d.ts.map +1 -0
- package/dist/host/hooks.jsx +163 -0
- package/dist/host/hooks.jsx.map +1 -0
- package/dist/host/host.css +81 -0
- package/dist/host/host.css.map +1 -0
- package/dist/host/host.d.ts +70 -0
- package/dist/host/host.d.ts.map +1 -0
- package/dist/host/host.jsx +229 -0
- package/dist/host/host.jsx.map +1 -0
- package/dist/host/index.d.ts +9 -0
- package/dist/host/index.d.ts.map +1 -0
- package/dist/host/index.jsx +8 -0
- package/dist/host/keyboard.d.ts +24 -0
- package/dist/host/keyboard.d.ts.map +1 -0
- package/dist/host/keyboard.jsx +28 -0
- package/dist/host/keyboard.jsx.map +1 -0
- package/dist/host/layers.d.ts +69 -0
- package/dist/host/layers.d.ts.map +1 -0
- package/dist/host/layers.jsx +111 -0
- package/dist/host/layers.jsx.map +1 -0
- package/dist/host/page-loading-overlay.d.ts +17 -0
- package/dist/host/page-loading-overlay.d.ts.map +1 -0
- package/dist/host/page-loading-overlay.jsx +16 -0
- package/dist/host/page-loading-overlay.jsx.map +1 -0
- package/dist/host/readiness.d.ts +57 -0
- package/dist/host/readiness.d.ts.map +1 -0
- package/dist/host/readiness.jsx +138 -0
- package/dist/host/readiness.jsx.map +1 -0
- package/dist/host/registry.d.ts +106 -0
- package/dist/host/registry.d.ts.map +1 -0
- package/dist/host/registry.jsx +93 -0
- package/dist/host/registry.jsx.map +1 -0
- package/dist/icon/icon.css +39 -0
- package/dist/icon/icon.css.map +1 -0
- package/dist/icon/icon.d.ts +57 -0
- package/dist/icon/icon.d.ts.map +1 -0
- package/dist/icon/icon.jsx +115 -0
- package/dist/icon/icon.jsx.map +1 -0
- package/dist/icon/index.d.ts +4 -0
- package/dist/icon/index.d.ts.map +1 -0
- package/dist/icon/index.jsx +3 -0
- package/dist/icon/slot.d.ts +45 -0
- package/dist/icon/slot.d.ts.map +1 -0
- package/dist/icon/slot.jsx +61 -0
- package/dist/icon/slot.jsx.map +1 -0
- package/dist/icon/swatch.d.ts +29 -0
- package/dist/icon/swatch.d.ts.map +1 -0
- package/dist/icon/swatch.jsx +25 -0
- package/dist/icon/swatch.jsx.map +1 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.jsx +1 -0
- package/dist/pickers/combo-box.d.ts +42 -0
- package/dist/pickers/combo-box.d.ts.map +1 -0
- package/dist/pickers/combo-box.jsx +129 -0
- package/dist/pickers/combo-box.jsx.map +1 -0
- package/dist/pickers/date-time-picker.d.ts +63 -0
- package/dist/pickers/date-time-picker.d.ts.map +1 -0
- package/dist/pickers/date-time-picker.jsx +141 -0
- package/dist/pickers/date-time-picker.jsx.map +1 -0
- package/dist/pickers/date-time.d.ts +82 -0
- package/dist/pickers/date-time.d.ts.map +1 -0
- package/dist/pickers/date-time.jsx +130 -0
- package/dist/pickers/date-time.jsx.map +1 -0
- package/dist/pickers/index.d.ts +10 -0
- package/dist/pickers/index.d.ts.map +1 -0
- package/dist/pickers/index.jsx +9 -0
- package/dist/pickers/picker-sheet.d.ts +21 -0
- package/dist/pickers/picker-sheet.d.ts.map +1 -0
- package/dist/pickers/picker-sheet.jsx +61 -0
- package/dist/pickers/picker-sheet.jsx.map +1 -0
- package/dist/pickers/picker.d.ts +32 -0
- package/dist/pickers/picker.d.ts.map +1 -0
- package/dist/pickers/picker.jsx +72 -0
- package/dist/pickers/picker.jsx.map +1 -0
- package/dist/pickers/pickers.css +219 -0
- package/dist/pickers/pickers.css.map +1 -0
- package/dist/pickers/timespan-picker.d.ts +36 -0
- package/dist/pickers/timespan-picker.d.ts.map +1 -0
- package/dist/pickers/timespan-picker.jsx +99 -0
- package/dist/pickers/timespan-picker.jsx.map +1 -0
- package/dist/pickers/timespan.d.ts +38 -0
- package/dist/pickers/timespan.d.ts.map +1 -0
- package/dist/pickers/timespan.jsx +49 -0
- package/dist/pickers/timespan.jsx.map +1 -0
- package/dist/pickers/trigger.d.ts +34 -0
- package/dist/pickers/trigger.d.ts.map +1 -0
- package/dist/pickers/trigger.jsx +77 -0
- package/dist/pickers/trigger.jsx.map +1 -0
- package/dist/pickers/wheel-column.d.ts +32 -0
- package/dist/pickers/wheel-column.d.ts.map +1 -0
- package/dist/pickers/wheel-column.jsx +99 -0
- package/dist/pickers/wheel-column.jsx.map +1 -0
- package/dist/plus-button/index.d.ts +3 -0
- package/dist/plus-button/index.d.ts.map +1 -0
- package/dist/plus-button/index.jsx +2 -0
- package/dist/plus-button/model.d.ts +65 -0
- package/dist/plus-button/model.d.ts.map +1 -0
- package/dist/plus-button/model.jsx +86 -0
- package/dist/plus-button/model.jsx.map +1 -0
- package/dist/plus-button/plus-button.css +67 -0
- package/dist/plus-button/plus-button.css.map +1 -0
- package/dist/plus-button/plus-button.d.ts +38 -0
- package/dist/plus-button/plus-button.d.ts.map +1 -0
- package/dist/plus-button/plus-button.jsx +155 -0
- package/dist/plus-button/plus-button.jsx.map +1 -0
- package/dist/popup/frame.d.ts +101 -0
- package/dist/popup/frame.d.ts.map +1 -0
- package/dist/popup/frame.jsx +244 -0
- package/dist/popup/frame.jsx.map +1 -0
- package/dist/popup/index.d.ts +8 -0
- package/dist/popup/index.d.ts.map +1 -0
- package/dist/popup/index.jsx +7 -0
- package/dist/popup/input-form.d.ts +35 -0
- package/dist/popup/input-form.d.ts.map +1 -0
- package/dist/popup/input-form.jsx +160 -0
- package/dist/popup/input-form.jsx.map +1 -0
- package/dist/popup/input.d.ts +175 -0
- package/dist/popup/input.d.ts.map +1 -0
- package/dist/popup/input.jsx +176 -0
- package/dist/popup/input.jsx.map +1 -0
- package/dist/popup/popup-view.d.ts +25 -0
- package/dist/popup/popup-view.d.ts.map +1 -0
- package/dist/popup/popup-view.jsx +67 -0
- package/dist/popup/popup-view.jsx.map +1 -0
- package/dist/popup/popup.css +203 -0
- package/dist/popup/popup.css.map +1 -0
- package/dist/popup/queue.d.ts +90 -0
- package/dist/popup/queue.d.ts.map +1 -0
- package/dist/popup/queue.jsx +309 -0
- package/dist/popup/queue.jsx.map +1 -0
- package/dist/popup/service.d.ts +60 -0
- package/dist/popup/service.d.ts.map +1 -0
- package/dist/popup/service.jsx +342 -0
- package/dist/popup/service.jsx.map +1 -0
- package/dist/popup/types.d.ts +211 -0
- package/dist/popup/types.d.ts.map +1 -0
- package/dist/popup/types.jsx +218 -0
- package/dist/popup/types.jsx.map +1 -0
- package/dist/provider/contexts.d.ts +41 -0
- package/dist/provider/contexts.d.ts.map +1 -0
- package/dist/provider/contexts.jsx +11 -0
- package/dist/provider/contexts.jsx.map +1 -0
- package/dist/provider/global-events.d.ts +8 -0
- package/dist/provider/global-events.d.ts.map +1 -0
- package/dist/provider/global-events.jsx +17 -0
- package/dist/provider/global-events.jsx.map +1 -0
- package/dist/provider/hooks.d.ts +49 -0
- package/dist/provider/hooks.d.ts.map +1 -0
- package/dist/provider/hooks.jsx +72 -0
- package/dist/provider/hooks.jsx.map +1 -0
- package/dist/provider/index.d.ts +5 -0
- package/dist/provider/index.d.ts.map +1 -0
- package/dist/provider/index.jsx +3 -0
- package/dist/provider/provider.css +18 -0
- package/dist/provider/provider.css.map +1 -0
- package/dist/provider/provider.d.ts +51 -0
- package/dist/provider/provider.d.ts.map +1 -0
- package/dist/provider/provider.jsx +290 -0
- package/dist/provider/provider.jsx.map +1 -0
- package/dist/provider/settings.d.ts +99 -0
- package/dist/provider/settings.d.ts.map +1 -0
- package/dist/provider/settings.jsx +45 -0
- package/dist/provider/settings.jsx.map +1 -0
- package/dist/provider/theme-css.d.ts +12 -0
- package/dist/provider/theme-css.d.ts.map +1 -0
- package/dist/provider/theme-css.jsx +19 -0
- package/dist/provider/theme-css.jsx.map +1 -0
- package/dist/provider/theme-root.d.ts +10 -0
- package/dist/provider/theme-root.d.ts.map +1 -0
- package/dist/provider/theme-root.jsx +24 -0
- package/dist/provider/theme-root.jsx.map +1 -0
- package/dist/provider/theme.css +473 -0
- package/dist/provider/theme.css.map +1 -0
- package/dist/range-slider/index.d.ts +3 -0
- package/dist/range-slider/index.d.ts.map +1 -0
- package/dist/range-slider/index.jsx +2 -0
- package/dist/range-slider/math.d.ts +23 -0
- package/dist/range-slider/math.d.ts.map +1 -0
- package/dist/range-slider/math.jsx +71 -0
- package/dist/range-slider/math.jsx.map +1 -0
- package/dist/range-slider/range-slider.css +90 -0
- package/dist/range-slider/range-slider.css.map +1 -0
- package/dist/range-slider/range-slider.d.ts +52 -0
- package/dist/range-slider/range-slider.d.ts.map +1 -0
- package/dist/range-slider/range-slider.jsx +159 -0
- package/dist/range-slider/range-slider.jsx.map +1 -0
- package/dist/selection/index.d.ts +5 -0
- package/dist/selection/index.d.ts.map +1 -0
- package/dist/selection/index.jsx +3 -0
- package/dist/selection/model.d.ts +53 -0
- package/dist/selection/model.d.ts.map +1 -0
- package/dist/selection/model.jsx +69 -0
- package/dist/selection/model.jsx.map +1 -0
- package/dist/selection/selection-sheet.d.ts +80 -0
- package/dist/selection/selection-sheet.d.ts.map +1 -0
- package/dist/selection/selection-sheet.jsx +362 -0
- package/dist/selection/selection-sheet.jsx.map +1 -0
- package/dist/selection/selection.css +75 -0
- package/dist/selection/selection.css.map +1 -0
- package/dist/selection/use-selection-model.d.ts +9 -0
- package/dist/selection/use-selection-model.d.ts.map +1 -0
- package/dist/selection/use-selection-model.jsx +22 -0
- package/dist/selection/use-selection-model.jsx.map +1 -0
- package/dist/sheet/frame.d.ts +45 -0
- package/dist/sheet/frame.d.ts.map +1 -0
- package/dist/sheet/frame.jsx +205 -0
- package/dist/sheet/frame.jsx.map +1 -0
- package/dist/sheet/header.d.ts +35 -0
- package/dist/sheet/header.d.ts.map +1 -0
- package/dist/sheet/header.jsx +145 -0
- package/dist/sheet/header.jsx.map +1 -0
- package/dist/sheet/height-memo.d.ts +47 -0
- package/dist/sheet/height-memo.d.ts.map +1 -0
- package/dist/sheet/height-memo.jsx +100 -0
- package/dist/sheet/height-memo.jsx.map +1 -0
- package/dist/sheet/index.d.ts +11 -0
- package/dist/sheet/index.d.ts.map +1 -0
- package/dist/sheet/index.jsx +10 -0
- package/dist/sheet/loadable.d.ts +35 -0
- package/dist/sheet/loadable.d.ts.map +1 -0
- package/dist/sheet/loadable.jsx +65 -0
- package/dist/sheet/loadable.jsx.map +1 -0
- package/dist/sheet/options.d.ts +220 -0
- package/dist/sheet/options.d.ts.map +1 -0
- package/dist/sheet/options.jsx +91 -0
- package/dist/sheet/options.jsx.map +1 -0
- package/dist/sheet/processing.d.ts +22 -0
- package/dist/sheet/processing.d.ts.map +1 -0
- package/dist/sheet/processing.jsx +66 -0
- package/dist/sheet/processing.jsx.map +1 -0
- package/dist/sheet/service.d.ts +55 -0
- package/dist/sheet/service.d.ts.map +1 -0
- package/dist/sheet/service.jsx +143 -0
- package/dist/sheet/service.jsx.map +1 -0
- package/dist/sheet/sheet.css +195 -0
- package/dist/sheet/sheet.css.map +1 -0
- package/dist/sheet/sheet.d.ts +19 -0
- package/dist/sheet/sheet.d.ts.map +1 -0
- package/dist/sheet/sheet.jsx +40 -0
- package/dist/sheet/sheet.jsx.map +1 -0
- package/dist/sheet/sizing.d.ts +69 -0
- package/dist/sheet/sizing.d.ts.map +1 -0
- package/dist/sheet/sizing.jsx +146 -0
- package/dist/sheet/sizing.jsx.map +1 -0
- package/dist/sheet/stack.d.ts +161 -0
- package/dist/sheet/stack.d.ts.map +1 -0
- package/dist/sheet/stack.jsx +378 -0
- package/dist/sheet/stack.jsx.map +1 -0
- package/dist/swipe/index.d.ts +3 -0
- package/dist/swipe/index.d.ts.map +1 -0
- package/dist/swipe/index.jsx +2 -0
- package/dist/swipe/model.d.ts +72 -0
- package/dist/swipe/model.d.ts.map +1 -0
- package/dist/swipe/model.jsx +66 -0
- package/dist/swipe/model.jsx.map +1 -0
- package/dist/swipe/swipe-view.d.ts +40 -0
- package/dist/swipe/swipe-view.d.ts.map +1 -0
- package/dist/swipe/swipe-view.jsx +163 -0
- package/dist/swipe/swipe-view.jsx.map +1 -0
- package/dist/swipe/swipe.css +34 -0
- package/dist/swipe/swipe.css.map +1 -0
- package/dist/tab-bar/index.d.ts +4 -0
- package/dist/tab-bar/index.d.ts.map +1 -0
- package/dist/tab-bar/index.jsx +3 -0
- package/dist/tab-bar/metrics.d.ts +230 -0
- package/dist/tab-bar/metrics.d.ts.map +1 -0
- package/dist/tab-bar/metrics.jsx +221 -0
- package/dist/tab-bar/metrics.jsx.map +1 -0
- package/dist/tab-bar/model.d.ts +170 -0
- package/dist/tab-bar/model.d.ts.map +1 -0
- package/dist/tab-bar/model.jsx +349 -0
- package/dist/tab-bar/model.jsx.map +1 -0
- package/dist/tab-bar/tab-bar.css +173 -0
- package/dist/tab-bar/tab-bar.css.map +1 -0
- package/dist/tab-bar/tab-bar.d.ts +56 -0
- package/dist/tab-bar/tab-bar.d.ts.map +1 -0
- package/dist/tab-bar/tab-bar.jsx +343 -0
- package/dist/tab-bar/tab-bar.jsx.map +1 -0
- package/dist/tabs/index.d.ts +3 -0
- package/dist/tabs/index.d.ts.map +1 -0
- package/dist/tabs/index.jsx +2 -0
- package/dist/tabs/model.d.ts +83 -0
- package/dist/tabs/model.d.ts.map +1 -0
- package/dist/tabs/model.jsx +113 -0
- package/dist/tabs/model.jsx.map +1 -0
- package/dist/tabs/tab-view.d.ts +47 -0
- package/dist/tabs/tab-view.d.ts.map +1 -0
- package/dist/tabs/tab-view.jsx +227 -0
- package/dist/tabs/tab-view.jsx.map +1 -0
- package/dist/tabs/tabs.css +182 -0
- package/dist/tabs/tabs.css.map +1 -0
- package/dist/toast/index.d.ts +3 -0
- package/dist/toast/index.d.ts.map +1 -0
- package/dist/toast/index.jsx +2 -0
- package/dist/toast/service.d.ts +48 -0
- package/dist/toast/service.d.ts.map +1 -0
- package/dist/toast/service.jsx +201 -0
- package/dist/toast/service.jsx.map +1 -0
- package/dist/toast/store.d.ts +174 -0
- package/dist/toast/store.d.ts.map +1 -0
- package/dist/toast/store.jsx +353 -0
- package/dist/toast/store.jsx.map +1 -0
- package/dist/toast/toast.css +152 -0
- package/dist/toast/toast.css.map +1 -0
- package/dist/toggle/checkbox-math.d.ts +52 -0
- package/dist/toggle/checkbox-math.d.ts.map +1 -0
- package/dist/toggle/checkbox-math.jsx +111 -0
- package/dist/toggle/checkbox-math.jsx.map +1 -0
- package/dist/toggle/checkbox.d.ts +56 -0
- package/dist/toggle/checkbox.d.ts.map +1 -0
- package/dist/toggle/checkbox.jsx +152 -0
- package/dist/toggle/checkbox.jsx.map +1 -0
- package/dist/toggle/chip-group.d.ts +50 -0
- package/dist/toggle/chip-group.d.ts.map +1 -0
- package/dist/toggle/chip-group.jsx +107 -0
- package/dist/toggle/chip-group.jsx.map +1 -0
- package/dist/toggle/index.d.ts +5 -0
- package/dist/toggle/index.d.ts.map +1 -0
- package/dist/toggle/index.jsx +4 -0
- package/dist/toggle/switch.d.ts +52 -0
- package/dist/toggle/switch.d.ts.map +1 -0
- package/dist/toggle/switch.jsx +192 -0
- package/dist/toggle/switch.jsx.map +1 -0
- package/dist/toggle/toggle.css +189 -0
- package/dist/toggle/toggle.css.map +1 -0
- package/package.json +155 -4
- package/rspeedy/index.d.ts +21 -0
- package/rspeedy/index.mjs +75 -0
- package/rspeedy/index.test.mjs +52 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import './pickers.css';
|
|
2
|
+
import { type ReactNode } from '@lynx-js/react';
|
|
3
|
+
import type { G9WheelItem } from './date-time.js';
|
|
4
|
+
/** Row height of a wheel (MAUI `G9Metrics.DrumRowHeight`). */
|
|
5
|
+
export declare const g9WheelRowHeight = 40;
|
|
6
|
+
/** Rows a wheel shows (the selected row is the middle one). */
|
|
7
|
+
export declare const g9WheelVisibleRows = 5;
|
|
8
|
+
/** The row a scroll offset rests on: the nearest row, clamped to the list. */
|
|
9
|
+
export declare function wheelIndexAt(scrollTop: number, rowHeight: number, count: number): number;
|
|
10
|
+
/** Props of {@link G9WheelColumn}. */
|
|
11
|
+
export interface G9WheelColumnProps<V extends string | number> {
|
|
12
|
+
readonly items: ReadonlyArray<G9WheelItem<V>>;
|
|
13
|
+
readonly value: V;
|
|
14
|
+
/** The user brought another row to rest in the band (after the snap). */
|
|
15
|
+
readonly onValueChange: (value: V) => void;
|
|
16
|
+
/** Caption above the column (Day, Month, …). */
|
|
17
|
+
readonly label?: string;
|
|
18
|
+
readonly rowHeight?: number;
|
|
19
|
+
readonly visibleRows?: number;
|
|
20
|
+
/** The resting row is within two rows of an end (the year window grows there). */
|
|
21
|
+
readonly onNearEdge?: (edge: 'start' | 'end') => void;
|
|
22
|
+
readonly accessibilityLabel?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* One drum of the date/time and duration pickers (MAUI `G9DrumColumn`): a vertical `scroll-view` of fixed-height
|
|
26
|
+
* rows behind a selection band. The highlighted row follows the scroll live; when the scroll ends (finger lifted and
|
|
27
|
+
* the fling done — Lynx reports it, so MAUI's 16 ms settle polling is not needed) the column glides to the nearest
|
|
28
|
+
* row and reports its value. A tap on a row selects it. A new `value` from the parent rolls the column to it
|
|
29
|
+
* (animated once mounted); the column never echoes a value it reported itself.
|
|
30
|
+
*/
|
|
31
|
+
export declare function G9WheelColumn<V extends string | number>(props: G9WheelColumnProps<V>): ReactNode;
|
|
32
|
+
//# sourceMappingURL=wheel-column.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wheel-column.d.ts","sourceRoot":"","sources":["../../src/pickers/wheel-column.tsx"],"names":[],"mappings":"AAAA,OAAO,eAAe,CAAC;AACvB,OAAO,EAAE,KAAK,SAAS,EAA+B,MAAM,gBAAgB,CAAC;AAG7E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,8DAA8D;AAC9D,eAAO,MAAM,gBAAgB,KAAK,CAAC;AACnC,+DAA+D;AAC/D,eAAO,MAAM,kBAAkB,IAAI,CAAC;AAEpC,8EAA8E;AAC9E,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAGxF;AAED,sCAAsC;AACtC,MAAM,WAAW,kBAAkB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IAC3D,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9C,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC;IAClB,yEAAyE;IACzE,QAAQ,CAAC,aAAa,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;IAC3C,gDAAgD;IAChD,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,kFAAkF;IAClF,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,GAAG,KAAK,KAAK,IAAI,CAAC;IACtD,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;CACtC;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,KAAK,EAAE,kBAAkB,CAAC,CAAC,CAAC,GAAG,SAAS,CAmGhG"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import "./pickers.css";
|
|
2
|
+
import { useEffect, useRef, useState } from "@lynx-js/react";
|
|
3
|
+
import { invokeNodeWhenReady } from "../fields/use-text-input.jsx";
|
|
4
|
+
const g9WheelRowHeight = 40;
|
|
5
|
+
const g9WheelVisibleRows = 5;
|
|
6
|
+
function wheelIndexAt(scrollTop, rowHeight, count) {
|
|
7
|
+
if (count <= 0) return 0;
|
|
8
|
+
return Math.min(count - 1, Math.max(0, Math.round(scrollTop / rowHeight)));
|
|
9
|
+
}
|
|
10
|
+
function G9WheelColumn(props) {
|
|
11
|
+
var _props_rowHeight, _props_visibleRows, _ref, _props_accessibilityLabel;
|
|
12
|
+
const rowHeight = null != (_props_rowHeight = props.rowHeight) ? _props_rowHeight : g9WheelRowHeight;
|
|
13
|
+
const visible = null != (_props_visibleRows = props.visibleRows) ? _props_visibleRows : g9WheelVisibleRows;
|
|
14
|
+
const pad = rowHeight * Math.floor(visible / 2);
|
|
15
|
+
const count = props.items.length;
|
|
16
|
+
const valueIndex = Math.max(0, props.items.findIndex((i)=>i.value === props.value));
|
|
17
|
+
const [live, setLive] = useState(valueIndex);
|
|
18
|
+
const node = useRef(null);
|
|
19
|
+
const scrollTop = useRef(valueIndex * rowHeight);
|
|
20
|
+
const reported = useRef(null);
|
|
21
|
+
const mounted = useRef(false);
|
|
22
|
+
const latest = useRef(props);
|
|
23
|
+
latest.current = props;
|
|
24
|
+
const scrollToIndex = (index, smooth)=>{
|
|
25
|
+
scrollTop.current = index * rowHeight;
|
|
26
|
+
invokeNodeWhenReady(node, 'scrollTo', {
|
|
27
|
+
offset: index * rowHeight,
|
|
28
|
+
smooth
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
useEffect(()=>{
|
|
32
|
+
if (null !== reported.current && reported.current === props.value) {
|
|
33
|
+
reported.current = null;
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
reported.current = null;
|
|
37
|
+
setLive(valueIndex);
|
|
38
|
+
scrollToIndex(valueIndex, mounted.current);
|
|
39
|
+
mounted.current = true;
|
|
40
|
+
}, [
|
|
41
|
+
props.value,
|
|
42
|
+
count
|
|
43
|
+
]);
|
|
44
|
+
const settle = (index)=>{
|
|
45
|
+
var _latest_current_onNearEdge, _latest_current, _latest_current_onNearEdge1, _latest_current1;
|
|
46
|
+
const item = latest.current.items[index];
|
|
47
|
+
scrollToIndex(index, true);
|
|
48
|
+
setLive(index);
|
|
49
|
+
if (index <= 2) null == (_latest_current_onNearEdge = (_latest_current = latest.current).onNearEdge) || _latest_current_onNearEdge.call(_latest_current, 'start');
|
|
50
|
+
if (index >= latest.current.items.length - 3) null == (_latest_current_onNearEdge1 = (_latest_current1 = latest.current).onNearEdge) || _latest_current_onNearEdge1.call(_latest_current1, 'end');
|
|
51
|
+
if (!item || item.value === latest.current.value) return;
|
|
52
|
+
reported.current = item.value;
|
|
53
|
+
latest.current.onValueChange(item.value);
|
|
54
|
+
};
|
|
55
|
+
const onScroll = (e)=>{
|
|
56
|
+
var _e_detail;
|
|
57
|
+
const top = null == (_e_detail = e.detail) ? void 0 : _e_detail.scrollTop;
|
|
58
|
+
if ('number' != typeof top) return;
|
|
59
|
+
scrollTop.current = top;
|
|
60
|
+
const index = wheelIndexAt(top, rowHeight, latest.current.items.length);
|
|
61
|
+
setLive((prev)=>prev === index ? prev : index);
|
|
62
|
+
};
|
|
63
|
+
const onScrollEnd = ()=>settle(wheelIndexAt(scrollTop.current, rowHeight, latest.current.items.length));
|
|
64
|
+
return <view className="g9-wheel" accessibility-label={null != (_ref = null != (_props_accessibilityLabel = props.accessibilityLabel) ? _props_accessibilityLabel : props.label) ? _ref : ''}>
|
|
65
|
+
{props.label ? <text className="g9-wheel__label" text-maxline="1">
|
|
66
|
+
{props.label}
|
|
67
|
+
</text> : null}
|
|
68
|
+
<view className="g9-wheel__viewport" style={{
|
|
69
|
+
height: `${rowHeight * visible}px`
|
|
70
|
+
}}>
|
|
71
|
+
<view className="g9-wheel__band" user-interaction-enabled={false} style={{
|
|
72
|
+
top: `${pad}px`,
|
|
73
|
+
height: `${rowHeight}px`
|
|
74
|
+
}}/>
|
|
75
|
+
<scroll-view ref={(n)=>{
|
|
76
|
+
node.current = n;
|
|
77
|
+
}} className="g9-wheel__scroll" scroll-orientation="vertical" style={{
|
|
78
|
+
height: `${rowHeight * visible}px`
|
|
79
|
+
}} bindscroll={onScroll} bindscrollend={onScrollEnd}>
|
|
80
|
+
<view style={{
|
|
81
|
+
height: `${pad}px`
|
|
82
|
+
}}/>
|
|
83
|
+
{props.items.map((item, i)=><view key={String(item.value)} className={`g9-wheel__row${i === live ? ' g9-wheel__row--selected' : ''}`} style={{
|
|
84
|
+
height: `${rowHeight}px`
|
|
85
|
+
}} accessibility-element={true} accessibility-traits="button" accessibility-value={i === live ? 'selected' : ''} accessibility-label={item.text} bindtap={()=>settle(i)}>
|
|
86
|
+
<text className="g9-wheel__text" text-maxline="1">
|
|
87
|
+
{item.text}
|
|
88
|
+
</text>
|
|
89
|
+
</view>)}
|
|
90
|
+
<view style={{
|
|
91
|
+
height: `${pad}px`
|
|
92
|
+
}}/>
|
|
93
|
+
</scroll-view>
|
|
94
|
+
</view>
|
|
95
|
+
</view>;
|
|
96
|
+
}
|
|
97
|
+
export { G9WheelColumn, g9WheelRowHeight, g9WheelVisibleRows, wheelIndexAt };
|
|
98
|
+
|
|
99
|
+
//# sourceMappingURL=wheel-column.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pickers/wheel-column.jsx","sources":["../../src/pickers/wheel-column.tsx"],"sourcesContent":["import './pickers.css';\nimport { type ReactNode, useEffect, useRef, useState } from '@lynx-js/react';\nimport type { NodesRef } from '@lynx-js/types';\nimport { invokeNodeWhenReady } from '../fields/use-text-input';\nimport type { G9WheelItem } from './date-time';\n\n/** Row height of a wheel (MAUI `G9Metrics.DrumRowHeight`). */\nexport const g9WheelRowHeight = 40;\n/** Rows a wheel shows (the selected row is the middle one). */\nexport const g9WheelVisibleRows = 5;\n\n/** The row a scroll offset rests on: the nearest row, clamped to the list. */\nexport function wheelIndexAt(scrollTop: number, rowHeight: number, count: number): number {\n if (count <= 0) return 0;\n return Math.min(count - 1, Math.max(0, Math.round(scrollTop / rowHeight)));\n}\n\n/** Props of {@link G9WheelColumn}. */\nexport interface G9WheelColumnProps<V extends string | number> {\n readonly items: ReadonlyArray<G9WheelItem<V>>;\n readonly value: V;\n /** The user brought another row to rest in the band (after the snap). */\n readonly onValueChange: (value: V) => void;\n /** Caption above the column (Day, Month, …). */\n readonly label?: string;\n readonly rowHeight?: number;\n readonly visibleRows?: number;\n /** The resting row is within two rows of an end (the year window grows there). */\n readonly onNearEdge?: (edge: 'start' | 'end') => void;\n readonly accessibilityLabel?: string;\n}\n\n/**\n * One drum of the date/time and duration pickers (MAUI `G9DrumColumn`): a vertical `scroll-view` of fixed-height\n * rows behind a selection band. The highlighted row follows the scroll live; when the scroll ends (finger lifted and\n * the fling done — Lynx reports it, so MAUI's 16 ms settle polling is not needed) the column glides to the nearest\n * row and reports its value. A tap on a row selects it. A new `value` from the parent rolls the column to it\n * (animated once mounted); the column never echoes a value it reported itself.\n */\nexport function G9WheelColumn<V extends string | number>(props: G9WheelColumnProps<V>): ReactNode {\n const rowHeight = props.rowHeight ?? g9WheelRowHeight;\n const visible = props.visibleRows ?? g9WheelVisibleRows;\n const pad = rowHeight * Math.floor(visible / 2);\n const count = props.items.length;\n const valueIndex = Math.max(\n 0,\n props.items.findIndex((i) => i.value === props.value),\n );\n const [live, setLive] = useState(valueIndex);\n const node = useRef<NodesRef | null>(null);\n const scrollTop = useRef(valueIndex * rowHeight);\n const reported = useRef<V | null>(null);\n const mounted = useRef(false);\n const latest = useRef(props);\n latest.current = props;\n\n const scrollToIndex = (index: number, smooth: boolean) => {\n scrollTop.current = index * rowHeight;\n invokeNodeWhenReady(node, 'scrollTo', { offset: index * rowHeight, smooth });\n };\n\n // Follow the parent's value (and item changes) unless it is the one this column just reported.\n useEffect(() => {\n if (reported.current !== null && reported.current === props.value) {\n reported.current = null;\n return;\n }\n reported.current = null;\n setLive(valueIndex);\n scrollToIndex(valueIndex, mounted.current);\n mounted.current = true;\n }, [props.value, count]);\n\n const settle = (index: number) => {\n const item = latest.current.items[index];\n scrollToIndex(index, true);\n setLive(index);\n if (index <= 2) latest.current.onNearEdge?.('start');\n if (index >= latest.current.items.length - 3) latest.current.onNearEdge?.('end');\n if (!item || item.value === latest.current.value) return;\n reported.current = item.value;\n latest.current.onValueChange(item.value);\n };\n\n const onScroll = (e: { detail?: { scrollTop?: number } }) => {\n const top = e.detail?.scrollTop;\n if (typeof top !== 'number') return;\n scrollTop.current = top;\n const index = wheelIndexAt(top, rowHeight, latest.current.items.length);\n setLive((prev) => (prev === index ? prev : index));\n };\n const onScrollEnd = () => settle(wheelIndexAt(scrollTop.current, rowHeight, latest.current.items.length));\n\n return (\n <view className=\"g9-wheel\" accessibility-label={props.accessibilityLabel ?? props.label ?? ''}>\n {props.label ? (\n <text className=\"g9-wheel__label\" text-maxline=\"1\">\n {props.label}\n </text>\n ) : null}\n <view className=\"g9-wheel__viewport\" style={{ height: `${rowHeight * visible}px` }}>\n <view\n className=\"g9-wheel__band\"\n user-interaction-enabled={false}\n style={{ top: `${pad}px`, height: `${rowHeight}px` }}\n />\n <scroll-view\n ref={(n: NodesRef | null) => {\n node.current = n;\n }}\n className=\"g9-wheel__scroll\"\n scroll-orientation=\"vertical\"\n style={{ height: `${rowHeight * visible}px` }}\n bindscroll={onScroll}\n bindscrollend={onScrollEnd}\n >\n <view style={{ height: `${pad}px` }} />\n {props.items.map((item, i) => (\n <view\n key={String(item.value)}\n className={`g9-wheel__row${i === live ? ' g9-wheel__row--selected' : ''}`}\n style={{ height: `${rowHeight}px` }}\n accessibility-element={true}\n accessibility-traits=\"button\"\n accessibility-value={i === live ? 'selected' : ''}\n accessibility-label={item.text}\n bindtap={() => settle(i)}\n >\n <text className=\"g9-wheel__text\" text-maxline=\"1\">\n {item.text}\n </text>\n </view>\n ))}\n <view style={{ height: `${pad}px` }} />\n </scroll-view>\n </view>\n </view>\n );\n}\n"],"names":["g9WheelRowHeight","g9WheelVisibleRows","wheelIndexAt","scrollTop","rowHeight","count","Math","G9WheelColumn","props","_props_rowHeight","_props_visibleRows","_ref","visible","pad","valueIndex","i","live","setLive","useState","node","useRef","reported","mounted","latest","scrollToIndex","index","smooth","invokeNodeWhenReady","useEffect","settle","_latest_current","_latest_current1","item","onScroll","e","_e_detail","top","prev","onScrollEnd","view","text","scroll-view","n","String"],"mappings":";;;AAOO,MAAMA,mBAAmB;AAEzB,MAAMC,qBAAqB;AAG3B,SAASC,aAAaC,SAAiB,EAAEC,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KAAK;IACT,EAAEA;AAEN"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { type G9PlusButtonItem, type G9PlusButtonItemSchedule, type G9PlusButtonSchedule, type G9PlusButtonTiming, g9PlusButtonDefaults, plusButtonHitHeight, plusButtonSchedule, } from './model.js';
|
|
2
|
+
export { createPlusButtonController, G9PlusButton, type G9PlusButtonController, type G9PlusButtonProps, usePlusButton, } from './plus-button.js';
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plus-button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,0BAA0B,EAC1B,YAAY,EACZ,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,aAAa,GACd,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { G9IconInput } from '../icon/icon.js';
|
|
2
|
+
/** One menu entry of a {@link G9PlusButton} (MAUI `G9PlusButtonItem`). */
|
|
3
|
+
export interface G9PlusButtonItem {
|
|
4
|
+
readonly icon: G9IconInput;
|
|
5
|
+
readonly text: string;
|
|
6
|
+
/** Close the menu after `onSelected` settles. Default true. */
|
|
7
|
+
readonly closeMenuOnSelect?: boolean;
|
|
8
|
+
/** Runs through the provider's safe executor (errors show the error popup, MAUI `ShowErrorG9Popup`). */
|
|
9
|
+
readonly onSelected: (item: G9PlusButtonItem) => void | Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
/** Sizes and timings of the expand / collapse choreography (MAUI `G9PlusButton` properties and their defaults). */
|
|
12
|
+
export interface G9PlusButtonTiming {
|
|
13
|
+
readonly mainSizeCollapsed: number;
|
|
14
|
+
readonly mainSizeExpanded: number;
|
|
15
|
+
readonly itemVerticalOffset: number;
|
|
16
|
+
readonly textBorderTargetWidth: number;
|
|
17
|
+
readonly itemsStartDelayMs: number;
|
|
18
|
+
readonly itemStaggerMs: number;
|
|
19
|
+
readonly phase1AnimationDurationMs: number;
|
|
20
|
+
readonly phase2DelayDurationMs: number;
|
|
21
|
+
readonly phase2AnimationDurationMs: number;
|
|
22
|
+
readonly phase3DelayDurationMs: number;
|
|
23
|
+
readonly phase3AnimationDurationMs: number;
|
|
24
|
+
readonly mainAnimationDurationMs: number;
|
|
25
|
+
readonly mainIconRotationExpanded: number;
|
|
26
|
+
}
|
|
27
|
+
/** The MAUI `G9PlusButton` sizes and timings (px, ms) every plus button starts from. */
|
|
28
|
+
export declare const g9PlusButtonDefaults: G9PlusButtonTiming;
|
|
29
|
+
/** When each part of one item moves (ms from the toggle). */
|
|
30
|
+
export interface G9PlusButtonItemSchedule {
|
|
31
|
+
/** Phase 1: the item slides to / from its row (translateY). */
|
|
32
|
+
readonly slide: {
|
|
33
|
+
readonly delay: number;
|
|
34
|
+
readonly duration: number;
|
|
35
|
+
};
|
|
36
|
+
/** Phase 2: the label pill grows / shrinks (width). */
|
|
37
|
+
readonly pill: {
|
|
38
|
+
readonly delay: number;
|
|
39
|
+
readonly duration: number;
|
|
40
|
+
};
|
|
41
|
+
/** Phase 3: the label fades (opacity). */
|
|
42
|
+
readonly label: {
|
|
43
|
+
readonly delay: number;
|
|
44
|
+
readonly duration: number;
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
/** When each part of the expand/collapse sequence starts and how long it runs (ms): the main button, then each item. */
|
|
48
|
+
export interface G9PlusButtonSchedule {
|
|
49
|
+
readonly main: {
|
|
50
|
+
readonly delay: number;
|
|
51
|
+
readonly duration: number;
|
|
52
|
+
};
|
|
53
|
+
readonly items: readonly G9PlusButtonItemSchedule[];
|
|
54
|
+
/** When the whole sequence has settled. */
|
|
55
|
+
readonly totalMs: number;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* The MAUI choreography as start times. Expand: the main button shrinks and turns, then after `itemsStartDelayMs`
|
|
59
|
+
* each item (staggered by `itemStaggerMs`, first item first) slides up, then its pill grows, then its label fades in.
|
|
60
|
+
* Collapse runs the phases backwards, last item first, and the main button returns last.
|
|
61
|
+
*/
|
|
62
|
+
export declare function plusButtonSchedule(timing: G9PlusButtonTiming, count: number, expand: boolean): G9PlusButtonSchedule;
|
|
63
|
+
/** Hit-area height: the main button plus, while expanded, the item rows above it. */
|
|
64
|
+
export declare function plusButtonHitHeight(timing: G9PlusButtonTiming, count: number, expanded: boolean): number;
|
|
65
|
+
//# sourceMappingURL=model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../src/plus-button/model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,0EAA0E;AAC1E,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,+DAA+D;IAC/D,QAAQ,CAAC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IACrC,wGAAwG;IACxG,QAAQ,CAAC,UAAU,EAAE,CAAC,IAAI,EAAE,gBAAgB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACvE;AAED,mHAAmH;AACnH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;IACpC,QAAQ,CAAC,qBAAqB,EAAE,MAAM,CAAC;IACvC,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAA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BAAkB,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,oBAAoB,CAwCnH;AAED,qFAAqF;AACrF,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,kBAAkB,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,GAAG,MAAM,CAExG"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
const g9PlusButtonDefaults = Object.freeze({
|
|
2
|
+
mainSizeCollapsed: 69,
|
|
3
|
+
mainSizeExpanded: 49,
|
|
4
|
+
itemVerticalOffset: 55,
|
|
5
|
+
textBorderTargetWidth: 139,
|
|
6
|
+
itemsStartDelayMs: 50,
|
|
7
|
+
itemStaggerMs: 40,
|
|
8
|
+
phase1AnimationDurationMs: 200,
|
|
9
|
+
phase2DelayDurationMs: 30,
|
|
10
|
+
phase2AnimationDurationMs: 180,
|
|
11
|
+
phase3DelayDurationMs: 20,
|
|
12
|
+
phase3AnimationDurationMs: 150,
|
|
13
|
+
mainAnimationDurationMs: 180,
|
|
14
|
+
mainIconRotationExpanded: 45
|
|
15
|
+
});
|
|
16
|
+
function plusButtonSchedule(timing, count, expand) {
|
|
17
|
+
const t = timing;
|
|
18
|
+
const items = [];
|
|
19
|
+
let end = 0;
|
|
20
|
+
if (expand) {
|
|
21
|
+
const base = t.mainAnimationDurationMs + t.itemsStartDelayMs;
|
|
22
|
+
for(let i = 0; i < count; i++){
|
|
23
|
+
const start = base + i * t.itemStaggerMs;
|
|
24
|
+
const pill = start + t.phase1AnimationDurationMs + t.phase2DelayDurationMs;
|
|
25
|
+
const label = pill + t.phase2AnimationDurationMs + t.phase3DelayDurationMs;
|
|
26
|
+
items.push({
|
|
27
|
+
slide: {
|
|
28
|
+
delay: start,
|
|
29
|
+
duration: t.phase1AnimationDurationMs
|
|
30
|
+
},
|
|
31
|
+
pill: {
|
|
32
|
+
delay: pill,
|
|
33
|
+
duration: t.phase2AnimationDurationMs
|
|
34
|
+
},
|
|
35
|
+
label: {
|
|
36
|
+
delay: label,
|
|
37
|
+
duration: t.phase3AnimationDurationMs
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
end = Math.max(end, label + t.phase3AnimationDurationMs);
|
|
41
|
+
}
|
|
42
|
+
return {
|
|
43
|
+
main: {
|
|
44
|
+
delay: 0,
|
|
45
|
+
duration: t.mainAnimationDurationMs
|
|
46
|
+
},
|
|
47
|
+
items,
|
|
48
|
+
totalMs: Math.max(end, t.mainAnimationDurationMs)
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
for(let i = 0; i < count; i++){
|
|
52
|
+
const start = (count - 1 - i) * t.itemStaggerMs;
|
|
53
|
+
const pill = start + t.phase3AnimationDurationMs + t.phase3DelayDurationMs;
|
|
54
|
+
const slide = pill + t.phase2AnimationDurationMs + t.phase2DelayDurationMs;
|
|
55
|
+
items.push({
|
|
56
|
+
slide: {
|
|
57
|
+
delay: slide,
|
|
58
|
+
duration: t.phase1AnimationDurationMs
|
|
59
|
+
},
|
|
60
|
+
pill: {
|
|
61
|
+
delay: pill,
|
|
62
|
+
duration: t.phase2AnimationDurationMs
|
|
63
|
+
},
|
|
64
|
+
label: {
|
|
65
|
+
delay: start,
|
|
66
|
+
duration: t.phase3AnimationDurationMs
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
end = Math.max(end, slide + t.phase1AnimationDurationMs);
|
|
70
|
+
}
|
|
71
|
+
const mainDelay = (count > 0 ? end : 0) + t.itemsStartDelayMs;
|
|
72
|
+
return {
|
|
73
|
+
main: {
|
|
74
|
+
delay: mainDelay,
|
|
75
|
+
duration: t.mainAnimationDurationMs
|
|
76
|
+
},
|
|
77
|
+
items,
|
|
78
|
+
totalMs: mainDelay + t.mainAnimationDurationMs
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
function plusButtonHitHeight(timing, count, expanded) {
|
|
82
|
+
return expanded ? timing.mainSizeCollapsed + count * timing.itemVerticalOffset : timing.mainSizeCollapsed;
|
|
83
|
+
}
|
|
84
|
+
export { g9PlusButtonDefaults, plusButtonHitHeight, plusButtonSchedule };
|
|
85
|
+
|
|
86
|
+
//# sourceMappingURL=model.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plus-button/model.jsx","sources":["../../src/plus-button/model.ts"],"sourcesContent":["import type { G9IconInput } from '../icon/icon';\n\n/** One menu entry of a {@link G9PlusButton} (MAUI `G9PlusButtonItem`). */\nexport interface G9PlusButtonItem {\n readonly icon: G9IconInput;\n readonly text: string;\n /** Close the menu after `onSelected` settles. Default true. */\n readonly closeMenuOnSelect?: boolean;\n /** Runs through the provider's safe executor (errors show the error popup, MAUI `ShowErrorG9Popup`). */\n readonly onSelected: (item: G9PlusButtonItem) => void | Promise<void>;\n}\n\n/** Sizes and timings of the expand / collapse choreography (MAUI `G9PlusButton` properties and their defaults). */\nexport interface G9PlusButtonTiming {\n readonly mainSizeCollapsed: number;\n readonly mainSizeExpanded: number;\n readonly itemVerticalOffset: number;\n readonly textBorderTargetWidth: number;\n readonly itemsStartDelayMs: number;\n readonly itemStaggerMs: number;\n readonly phase1AnimationDurationMs: number;\n readonly phase2DelayDurationMs: number;\n readonly phase2AnimationDurationMs: number;\n readonly phase3DelayDurationMs: number;\n readonly phase3AnimationDurationMs: number;\n readonly mainAnimationDurationMs: number;\n readonly mainIconRotationExpanded: number;\n}\n\n/** The MAUI `G9PlusButton` sizes and timings (px, ms) every plus button starts from. */\nexport const g9PlusButtonDefaults: G9PlusButtonTiming = Object.freeze({\n mainSizeCollapsed: 69,\n mainSizeExpanded: 49,\n itemVerticalOffset: 55,\n textBorderTargetWidth: 139,\n itemsStartDelayMs: 50,\n itemStaggerMs: 40,\n phase1AnimationDurationMs: 200,\n phase2DelayDurationMs: 30,\n phase2AnimationDurationMs: 180,\n phase3DelayDurationMs: 20,\n phase3AnimationDurationMs: 150,\n mainAnimationDurationMs: 180,\n mainIconRotationExpanded: 45,\n});\n\n/** When each part of one item moves (ms from the toggle). */\nexport interface G9PlusButtonItemSchedule {\n /** Phase 1: the item slides to / from its row (translateY). */\n readonly slide: { readonly delay: number; readonly duration: number };\n /** Phase 2: the label pill grows / shrinks (width). */\n readonly pill: { readonly delay: number; readonly duration: number };\n /** Phase 3: the label fades (opacity). */\n readonly label: { readonly delay: number; readonly duration: number };\n}\n\n/** When each part of the expand/collapse sequence starts and how long it runs (ms): the main button, then each item. */\nexport interface G9PlusButtonSchedule {\n readonly main: { readonly delay: number; readonly duration: number };\n readonly items: readonly G9PlusButtonItemSchedule[];\n /** When the whole sequence has settled. */\n readonly totalMs: number;\n}\n\n/**\n * The MAUI choreography as start times. Expand: the main button shrinks and turns, then after `itemsStartDelayMs`\n * each item (staggered by `itemStaggerMs`, first item first) slides up, then its pill grows, then its label fades in.\n * Collapse runs the phases backwards, last item first, and the main button returns last.\n */\nexport function plusButtonSchedule(timing: G9PlusButtonTiming, count: number, expand: boolean): G9PlusButtonSchedule {\n const t = timing;\n const items: G9PlusButtonItemSchedule[] = [];\n let end = 0;\n if (expand) {\n const base = t.mainAnimationDurationMs + t.itemsStartDelayMs;\n for (let i = 0; i < count; i++) {\n const start = base + i * t.itemStaggerMs;\n const pill = start + t.phase1AnimationDurationMs + t.phase2DelayDurationMs;\n const label = pill + t.phase2AnimationDurationMs + t.phase3DelayDurationMs;\n items.push({\n slide: { delay: start, duration: t.phase1AnimationDurationMs },\n pill: { delay: pill, duration: t.phase2AnimationDurationMs },\n label: { delay: label, duration: t.phase3AnimationDurationMs },\n });\n end = Math.max(end, label + t.phase3AnimationDurationMs);\n }\n return {\n main: { delay: 0, duration: t.mainAnimationDurationMs },\n items,\n totalMs: Math.max(end, t.mainAnimationDurationMs),\n };\n }\n for (let i = 0; i < count; i++) {\n const start = (count - 1 - i) * t.itemStaggerMs;\n const pill = start + t.phase3AnimationDurationMs + t.phase3DelayDurationMs;\n const slide = pill + t.phase2AnimationDurationMs + t.phase2DelayDurationMs;\n items.push({\n slide: { delay: slide, duration: t.phase1AnimationDurationMs },\n pill: { delay: pill, duration: t.phase2AnimationDurationMs },\n label: { delay: start, duration: t.phase3AnimationDurationMs },\n });\n end = Math.max(end, slide + t.phase1AnimationDurationMs);\n }\n const mainDelay = (count > 0 ? end : 0) + t.itemsStartDelayMs;\n return {\n main: { delay: mainDelay, duration: t.mainAnimationDurationMs },\n items,\n totalMs: mainDelay + t.mainAnimationDurationMs,\n };\n}\n\n/** Hit-area height: the main button plus, while expanded, the item rows above it. */\nexport function plusButtonHitHeight(timing: G9PlusButtonTiming, count: number, expanded: boolean): number {\n return expanded ? timing.mainSizeCollapsed + count * timing.itemVerticalOffset : timing.mainSizeCollapsed;\n}\n"],"names":["g9PlusButtonDefaults","Object","plusButtonSchedule","timing","count","expand","t","items","end","base","i","start","pill","label","Math","slide","mainDelay","plusButtonHitHeight","expanded"],"mappings":"AA8BO,MAAMA,uBAA2CC,OAAO,MAAM,CAAC;IACpE,mBAAmB;IACnB,kBAAkB;IAClB,oBAAoB;IACpB,uBAAuB;IACvB,mBAAmB;IACnB,eAAe;IACf,2BAA2B;IAC3B,uBAAuB;IACvB,2BAA2B;IAC3B,uBAAuB;IACvB,2BAA2B;IAC3B,yBAAyB;IACzB,0BAA0B;AAC5B;AAyBO,SAASC,mBAAmBC,MAA0B,EAAEC,KAAa,EAAEC,MAAe;IAC3F,MAAMC,IAAIH;IACV,MAAMI,QAAoC,EAAE;IAC5C,IAAIC,MAAM;IACV,IAAIH,QAAQ;QACV,MAAMI,OAAOH,EAAE,uBAAuB,GAAGA,EAAE,iBAAiB;QAC5D,IAAK,IAAII,IAAI,GAAGA,IAAIN,OAAOM,IAAK;YAC9B,MAAMC,QAAQF,OAAOC,IAAIJ,EAAE,aAAa;YACxC,MAAMM,OAAOD,QAAQL,EAAE,yBAAyB,GAAGA,EAAE,qBAAqB;YAC1E,MAAMO,QAAQD,OAAON,EAAE,yBAAyB,GAAGA,EAAE,qBAAqB;YAC1EC,MAAM,IAAI,CAAC;gBACT,OAAO;oB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AAQD,OAAO,kBAAkB,GAAGA,OAAO,iBAAiB;AAC3G"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
.g9-plus-button {
|
|
2
|
+
position: relative;
|
|
3
|
+
overflow: visible;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.g9-plus-button__items {
|
|
7
|
+
width: 179px;
|
|
8
|
+
height: 69px;
|
|
9
|
+
position: absolute;
|
|
10
|
+
bottom: 0;
|
|
11
|
+
overflow: visible;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.g9-plus-button__item {
|
|
15
|
+
align-items: center;
|
|
16
|
+
width: 179px;
|
|
17
|
+
height: 46px;
|
|
18
|
+
display: flex;
|
|
19
|
+
position: absolute;
|
|
20
|
+
bottom: 11px;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.g9-plus-button__pill {
|
|
24
|
+
background-color: var(--g9-primary);
|
|
25
|
+
border: 1px solid var(--g9-primary-border);
|
|
26
|
+
align-items: center;
|
|
27
|
+
display: flex;
|
|
28
|
+
position: absolute;
|
|
29
|
+
top: 4px;
|
|
30
|
+
bottom: 4px;
|
|
31
|
+
overflow: hidden;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.g9-plus-button__label {
|
|
35
|
+
color: var(--g9-on-primary);
|
|
36
|
+
font-size: 16px;
|
|
37
|
+
font-weight: 700;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.g9-plus-button__item-icon {
|
|
41
|
+
border: 5px solid var(--g9-primary-border);
|
|
42
|
+
background-color: var(--g9-primary);
|
|
43
|
+
border-radius: 99px;
|
|
44
|
+
justify-content: center;
|
|
45
|
+
align-items: center;
|
|
46
|
+
padding: 2.9px;
|
|
47
|
+
display: flex;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.g9-plus-button__main {
|
|
51
|
+
background-color: var(--g9-primary);
|
|
52
|
+
border: 6.9px solid var(--g9-primary-border);
|
|
53
|
+
justify-content: center;
|
|
54
|
+
align-items: center;
|
|
55
|
+
display: flex;
|
|
56
|
+
position: absolute;
|
|
57
|
+
bottom: 0;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.g9-plus-button__main-icon {
|
|
61
|
+
justify-content: center;
|
|
62
|
+
align-items: center;
|
|
63
|
+
display: flex;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
/*# sourceMappingURL=plus-button.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["webpack://./src/plus-button/plus-button.css"],"names":[],"mappings":"AACA;EAAE,kBAAkB;EAClB,iBAAiB;AACnB;;AAGA;EAAE,YAAY;EACZ,YAAY;EACZ,kBAAkB;EAClB,SAAS;EACT,iBAAiB;AACnB;;AAGA;EAAE,mBAAmB;EACnB,YAAY;EACZ,YAAY;EACZ,aAAa;EACb,kBAAkB;EAClB,YAAY;AACd;;AAGA;EAAE,mCAAmC;EACnC,0CAA0C;EAC1C,mBAAmB;EACnB,aAAa;EACb,kBAAkB;EAClB,QAAQ;EACR,WAAW;EACX,gBAAgB;AAClB;;AAGA;EAAE,2BAA2B;EAC3B,eAAe;EACf,gBAAgB;AAClB;;AAGA;EAAE,0CAA0C;EAC1C,mCAAmC;EACnC,mBAAmB;EACnB,uBAAuB;EACvB,mBAAmB;EACnB,cAAc;EACd,aAAa;AACf;;AAGA;EAAE,mCAAmC;EACnC,4CAA4C;EAC5C,uBAAuB;EACvB,mBAAmB;EACnB,aAAa;EACb,kBAAkB;EAClB,SAAS;AACX;;AAGA;EAAE,uBAAuB;EACvB,mBAAmB;EACnB,aAAa;AACf","sourcesContent":["/* G9PlusButton (MAUI G9PlusButton + G9G9PlusButtonItemView): a round add button unfolding labelled actions. */\n.g9-plus-button {\n position: relative;\n overflow: visible;\n}\n\n.g9-plus-button__items {\n position: absolute;\n bottom: 0;\n width: 179px;\n height: 69px;\n overflow: visible;\n}\n\n.g9-plus-button__item {\n position: absolute;\n bottom: 11px;\n width: 179px;\n height: 46px;\n display: flex;\n align-items: center;\n}\n\n.g9-plus-button__pill {\n position: absolute;\n top: 4px;\n bottom: 4px;\n display: flex;\n align-items: center;\n overflow: hidden;\n background-color: var(--g9-primary);\n border: 1px solid var(--g9-primary-border);\n}\n\n.g9-plus-button__label {\n font-size: 16px;\n font-weight: 700;\n color: var(--g9-on-primary);\n}\n\n.g9-plus-button__item-icon {\n padding: 2.9px;\n border-radius: 99px;\n border: 5px solid var(--g9-primary-border);\n background-color: var(--g9-primary);\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.g9-plus-button__main {\n position: absolute;\n bottom: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: var(--g9-primary);\n border: 6.9px solid var(--g9-primary-border);\n}\n\n.g9-plus-button__main-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n"],"sourceRoot":""}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import './plus-button.css';
|
|
2
|
+
import { type ReactNode } from '@lynx-js/react';
|
|
3
|
+
import { type G9PlusButtonItem, type G9PlusButtonTiming } from './model.js';
|
|
4
|
+
/** Imperative handle of a plus button (MAUI `ToggleAsync`), from {@link usePlusButton}. */
|
|
5
|
+
export interface G9PlusButtonController {
|
|
6
|
+
/** Toggles expanded / collapsed; resolves when the sequence has settled. Retargets a running sequence. */
|
|
7
|
+
toggle(): Promise<void>;
|
|
8
|
+
readonly isExpanded: boolean;
|
|
9
|
+
/** @internal set by the mounted button */
|
|
10
|
+
bind(target: {
|
|
11
|
+
toggle(): Promise<void>;
|
|
12
|
+
expanded(): boolean;
|
|
13
|
+
}): () => void;
|
|
14
|
+
}
|
|
15
|
+
/** Creates a controller outside React. */
|
|
16
|
+
export declare function createPlusButtonController(): G9PlusButtonController;
|
|
17
|
+
/** A stable controller for a `G9PlusButton`. */
|
|
18
|
+
export declare function usePlusButton(): G9PlusButtonController;
|
|
19
|
+
/** Props of {@link G9PlusButton}: the items, the state, and every MAUI size / timing property. */
|
|
20
|
+
export interface G9PlusButtonProps extends Partial<G9PlusButtonTiming> {
|
|
21
|
+
/** Menu entries, bottom (closest to the button) first (MAUI `Items`). */
|
|
22
|
+
readonly items: readonly G9PlusButtonItem[];
|
|
23
|
+
/** Controlled expanded state. */
|
|
24
|
+
readonly expanded?: boolean;
|
|
25
|
+
readonly defaultExpanded?: boolean;
|
|
26
|
+
readonly onExpandedChange?: (expanded: boolean) => void;
|
|
27
|
+
readonly controller?: G9PlusButtonController;
|
|
28
|
+
/** Menu side and label direction (MAUI `MenuFlowDirection`). Default: the app direction. */
|
|
29
|
+
readonly menuFlowDirection?: 'ltr' | 'rtl';
|
|
30
|
+
readonly className?: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* A round add button that unfolds a column of labelled actions (MAUI `G9PlusButton`): the button shrinks and its plus
|
|
34
|
+
* turns into a ×, then each item slides up, grows its label pill and fades its label in, staggered; collapsing plays
|
|
35
|
+
* it backwards. Every size and timing is a prop with the MAUI default. Item actions run through the safe executor.
|
|
36
|
+
*/
|
|
37
|
+
export declare function G9PlusButton(props: G9PlusButtonProps): ReactNode;
|
|
38
|
+
//# sourceMappingURL=plus-button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plus-button.d.ts","sourceRoot":"","sources":["../../src/plus-button/plus-button.tsx"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,CAAC;AAC3B,OAAO,EAAE,KAAK,SAAS,EAAqB,MAAM,gBAAgB,CAAC;AAKnE,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EAIxB,MAAM,SAAS,CAAC;AAEjB,2FAA2F;AAC3F,MAAM,WAAW,sBAAsB;IACrC,0GAA0G;IAC1G,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACxB,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,0CAA0C;IAC1C,IAAI,CAAC,MAAM,EAAE;QAAE,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;QAAC,QAAQ,IAAI,OAAO,CAAA;KAAE,GAAG,MAAM,IAAI,CAAC;CAC5E;AAED,0CAA0C;AAC1C,wBAAgB,0BAA0B,IAAI,sBAAsB,CAcnE;AAED,gDAAgD;AAChD,wBAAgB,aAAa,IAAI,sBAAsB,CAItD;AAED,kGAAkG;AAClG,MAAM,WAAW,iBAAkB,SAAQ,OAAO,CAAC,kBAAkB,CAAC;IACpE,yEAAyE;IACzE,QAAQ,CAAC,KAAK,EAAE,SAAS,gBAAgB,EAAE,CAAC;IAC5C,iCAAiC;IACjC,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC;IACnC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IACxD,QAAQ,CAAC,UAAU,CAAC,EAAE,sBAAsB,CAAC;IAC7C,4FAA4F;IAC5F,QAAQ,CAAC,iBAAiB,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC;IAC3C,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAID;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,SAAS,CA4IhE"}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import "./plus-button.css";
|
|
2
|
+
import { useEffect, useRef } from "@lynx-js/react";
|
|
3
|
+
import { startTimer, stopTimer } from "../base/timers.jsx";
|
|
4
|
+
import { useControllableState } from "../base/use-controllable-state.jsx";
|
|
5
|
+
import { G9Icon } from "../icon/icon.jsx";
|
|
6
|
+
import { useG9Direction, useG9Executor } from "../provider/hooks.jsx";
|
|
7
|
+
import { g9PlusButtonDefaults, plusButtonHitHeight, plusButtonSchedule } from "./model.jsx";
|
|
8
|
+
function createPlusButtonController() {
|
|
9
|
+
let target = null;
|
|
10
|
+
return {
|
|
11
|
+
toggle: ()=>target ? target.toggle() : Promise.resolve(),
|
|
12
|
+
get isExpanded () {
|
|
13
|
+
return target ? target.expanded() : false;
|
|
14
|
+
},
|
|
15
|
+
bind (next) {
|
|
16
|
+
target = next;
|
|
17
|
+
return ()=>{
|
|
18
|
+
if (target === next) target = null;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
function usePlusButton() {
|
|
24
|
+
const ref = useRef(null);
|
|
25
|
+
if (null === ref.current) ref.current = createPlusButtonController();
|
|
26
|
+
return ref.current;
|
|
27
|
+
}
|
|
28
|
+
const CUBIC_OUT = 'cubic-bezier(0.215, 0.61, 0.355, 1)';
|
|
29
|
+
function G9PlusButton(props) {
|
|
30
|
+
var _props_defaultExpanded, _props_menuFlowDirection, _props_className;
|
|
31
|
+
const timing = {
|
|
32
|
+
...g9PlusButtonDefaults
|
|
33
|
+
};
|
|
34
|
+
for (const key of Object.keys(g9PlusButtonDefaults)){
|
|
35
|
+
const value = props[key];
|
|
36
|
+
if (void 0 !== value) timing[key] = value;
|
|
37
|
+
}
|
|
38
|
+
const [expanded, setExpanded] = useControllableState({
|
|
39
|
+
value: props.expanded,
|
|
40
|
+
defaultValue: null != (_props_defaultExpanded = props.defaultExpanded) ? _props_defaultExpanded : false,
|
|
41
|
+
onChange: props.onExpandedChange,
|
|
42
|
+
name: 'G9PlusButton.expanded'
|
|
43
|
+
});
|
|
44
|
+
const appRtl = 'rtl' === useG9Direction();
|
|
45
|
+
const rtl = (null != (_props_menuFlowDirection = props.menuFlowDirection) ? _props_menuFlowDirection : appRtl ? 'rtl' : 'ltr') === 'rtl';
|
|
46
|
+
const executor = useG9Executor();
|
|
47
|
+
const items = props.items;
|
|
48
|
+
const schedule = plusButtonSchedule(timing, items.length, expanded);
|
|
49
|
+
const settle = useRef({
|
|
50
|
+
timer: null,
|
|
51
|
+
resolve: null
|
|
52
|
+
});
|
|
53
|
+
const latest = useRef(null);
|
|
54
|
+
latest.current = {
|
|
55
|
+
expanded,
|
|
56
|
+
totalOf: (next)=>plusButtonSchedule(timing, items.length, next).totalMs
|
|
57
|
+
};
|
|
58
|
+
const toggle = ()=>{
|
|
59
|
+
var _settle_current_resolve, _settle_current;
|
|
60
|
+
const next = !latest.current.expanded;
|
|
61
|
+
latest.current = {
|
|
62
|
+
...latest.current,
|
|
63
|
+
expanded: next
|
|
64
|
+
};
|
|
65
|
+
stopTimer(settle.current.timer);
|
|
66
|
+
null == (_settle_current_resolve = (_settle_current = settle.current).resolve) || _settle_current_resolve.call(_settle_current);
|
|
67
|
+
setExpanded(next);
|
|
68
|
+
return new Promise((resolve)=>{
|
|
69
|
+
settle.current.resolve = resolve;
|
|
70
|
+
settle.current.timer = startTimer(()=>{
|
|
71
|
+
settle.current.resolve = null;
|
|
72
|
+
resolve();
|
|
73
|
+
}, latest.current.totalOf(next));
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
useEffect(()=>{
|
|
77
|
+
var _props_controller;
|
|
78
|
+
return null == (_props_controller = props.controller) ? void 0 : _props_controller.bind({
|
|
79
|
+
toggle,
|
|
80
|
+
expanded: ()=>latest.current.expanded
|
|
81
|
+
});
|
|
82
|
+
}, [
|
|
83
|
+
props.controller
|
|
84
|
+
]);
|
|
85
|
+
useEffect(()=>()=>{
|
|
86
|
+
var _settle_current_resolve, _settle_current;
|
|
87
|
+
stopTimer(settle.current.timer);
|
|
88
|
+
null == (_settle_current_resolve = (_settle_current = settle.current).resolve) || _settle_current_resolve.call(_settle_current);
|
|
89
|
+
}, []);
|
|
90
|
+
const select = (item)=>{
|
|
91
|
+
executor.run(async ()=>{
|
|
92
|
+
await item.onSelected(item);
|
|
93
|
+
if (false !== item.closeMenuOnSelect && latest.current.expanded) await toggle();
|
|
94
|
+
}, {
|
|
95
|
+
source: 'G9PlusButtonItem',
|
|
96
|
+
showErrorPopup: true
|
|
97
|
+
});
|
|
98
|
+
};
|
|
99
|
+
const size = expanded ? timing.mainSizeExpanded : timing.mainSizeCollapsed;
|
|
100
|
+
const main = schedule.main;
|
|
101
|
+
const side = rtl ? 'right' : 'left';
|
|
102
|
+
return <view className={`g9-plus-button${expanded ? ' g9-plus-button--expanded' : ''} ${null != (_props_className = props.className) ? _props_className : ''}`} style={{
|
|
103
|
+
width: `${timing.mainSizeCollapsed + (expanded ? timing.textBorderTargetWidth : 0)}px`,
|
|
104
|
+
height: `${plusButtonHitHeight(timing, items.length, expanded)}px`
|
|
105
|
+
}}>
|
|
106
|
+
<view className="g9-plus-button__items" style={{
|
|
107
|
+
[side]: '0px'
|
|
108
|
+
}}>
|
|
109
|
+
{items.map((item, i)=>{
|
|
110
|
+
const s = schedule.items[i];
|
|
111
|
+
return <view key={`${i}-${item.text}`} className="g9-plus-button__item" style={{
|
|
112
|
+
[side]: '0px',
|
|
113
|
+
transform: `translateY(${expanded ? -timing.itemVerticalOffset * (i + 1) : 0}px)`,
|
|
114
|
+
transition: `transform ${s.slide.duration}ms ${CUBIC_OUT} ${s.slide.delay}ms`,
|
|
115
|
+
flexDirection: rtl ? 'row-reverse' : 'row'
|
|
116
|
+
}} accessibility-element={expanded} accessibility-traits="button" accessibility-label={item.text} bindtap={expanded ? ()=>select(item) : void 0}>
|
|
117
|
+
<view className="g9-plus-button__pill" style={{
|
|
118
|
+
width: `${expanded ? timing.textBorderTargetWidth : 0}px`,
|
|
119
|
+
[side]: '26px',
|
|
120
|
+
borderRadius: rtl ? '29px 9px 9px 29px' : '9px 29px 29px 9px',
|
|
121
|
+
transition: `width ${s.pill.duration}ms ${CUBIC_OUT} ${s.pill.delay}ms`
|
|
122
|
+
}}>
|
|
123
|
+
<text className="g9-plus-button__label" text-maxline="1" style={{
|
|
124
|
+
[rtl ? 'marginRight' : 'marginLeft']: '25px',
|
|
125
|
+
opacity: expanded ? 1 : 0,
|
|
126
|
+
transition: `opacity ${s.label.duration}ms ease-out ${s.label.delay}ms`
|
|
127
|
+
}}>
|
|
128
|
+
{item.text}
|
|
129
|
+
</text>
|
|
130
|
+
</view>
|
|
131
|
+
<view className="g9-plus-button__item-icon">
|
|
132
|
+
<G9Icon icon={item.icon} size={32} color="var(--g9-on-primary)"/>
|
|
133
|
+
</view>
|
|
134
|
+
</view>;
|
|
135
|
+
})}
|
|
136
|
+
</view>
|
|
137
|
+
<view className="g9-plus-button__main" style={{
|
|
138
|
+
[side]: '0px',
|
|
139
|
+
width: `${size}px`,
|
|
140
|
+
height: `${size}px`,
|
|
141
|
+
borderRadius: `${size / 2}px`,
|
|
142
|
+
transition: `width ${main.duration}ms ${CUBIC_OUT} ${main.delay}ms, height ${main.duration}ms ${CUBIC_OUT} ${main.delay}ms`
|
|
143
|
+
}} accessibility-element accessibility-traits="button" bindtap={()=>void toggle()}>
|
|
144
|
+
<view className="g9-plus-button__main-icon" style={{
|
|
145
|
+
transform: `rotate(${expanded ? timing.mainIconRotationExpanded : 0}deg)`,
|
|
146
|
+
transition: `transform ${main.duration}ms ${CUBIC_OUT} ${main.delay}ms`
|
|
147
|
+
}}>
|
|
148
|
+
<G9Icon icon="plus" size={40} color="var(--g9-on-primary)"/>
|
|
149
|
+
</view>
|
|
150
|
+
</view>
|
|
151
|
+
</view>;
|
|
152
|
+
}
|
|
153
|
+
export { G9PlusButton, createPlusButtonController, usePlusButton };
|
|
154
|
+
|
|
155
|
+
//# sourceMappingURL=plus-button.jsx.map
|