@prestack/thread-ui 0.0.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/CHANGELOG.md +348 -0
- package/dist/attach.d.ts +1 -0
- package/dist/attach.js +1 -0
- package/dist/ui/animations/anm_appear.d.ts +16 -0
- package/dist/ui/animations/anm_appear.js +10 -0
- package/dist/ui/animations/anm_blur_in.d.ts +22 -0
- package/dist/ui/animations/anm_blur_in.js +16 -0
- package/dist/ui/animations/anm_blur_out.d.ts +22 -0
- package/dist/ui/animations/anm_blur_out.js +16 -0
- package/dist/ui/animations/anm_dismiss.d.ts +22 -0
- package/dist/ui/animations/anm_dismiss.js +16 -0
- package/dist/ui/animations/anm_drop.d.ts +22 -0
- package/dist/ui/animations/anm_drop.js +16 -0
- package/dist/ui/animations/anm_fall.d.ts +22 -0
- package/dist/ui/animations/anm_fall.js +16 -0
- package/dist/ui/animations/anm_flash.d.ts +19 -0
- package/dist/ui/animations/anm_flash.js +16 -0
- package/dist/ui/animations/anm_glow.d.ts +16 -0
- package/dist/ui/animations/anm_glow.js +14 -0
- package/dist/ui/animations/anm_lift.d.ts +16 -0
- package/dist/ui/animations/anm_lift.js +14 -0
- package/dist/ui/animations/anm_nudge.d.ts +16 -0
- package/dist/ui/animations/anm_nudge.js +14 -0
- package/dist/ui/animations/anm_pop_in.d.ts +29 -0
- package/dist/ui/animations/anm_pop_in.js +20 -0
- package/dist/ui/animations/anm_pop_out.d.ts +29 -0
- package/dist/ui/animations/anm_pop_out.js +20 -0
- package/dist/ui/animations/anm_press.d.ts +19 -0
- package/dist/ui/animations/anm_press.js +10 -0
- package/dist/ui/animations/anm_pulse.d.ts +20 -0
- package/dist/ui/animations/anm_pulse.js +11 -0
- package/dist/ui/animations/anm_rise.d.ts +22 -0
- package/dist/ui/animations/anm_rise.js +16 -0
- package/dist/ui/animations/anm_shake.d.ts +23 -0
- package/dist/ui/animations/anm_shake.js +11 -0
- package/dist/ui/animations/anm_slide_in_left.d.ts +22 -0
- package/dist/ui/animations/anm_slide_in_left.js +16 -0
- package/dist/ui/animations/anm_slide_in_right.d.ts +22 -0
- package/dist/ui/animations/anm_slide_in_right.js +16 -0
- package/dist/ui/animations/anm_slide_out_left.d.ts +22 -0
- package/dist/ui/animations/anm_slide_out_left.js +16 -0
- package/dist/ui/animations/anm_slide_out_right.d.ts +22 -0
- package/dist/ui/animations/anm_slide_out_right.js +16 -0
- package/dist/ui/animations/anm_spin.d.ts +16 -0
- package/dist/ui/animations/anm_spin.js +10 -0
- package/dist/ui/animations/anm_swell.d.ts +16 -0
- package/dist/ui/animations/anm_swell.js +14 -0
- package/dist/ui/animations/anm_wobble.d.ts +27 -0
- package/dist/ui/animations/anm_wobble.js +22 -0
- package/dist/ui/animations/anm_zoom_in.d.ts +22 -0
- package/dist/ui/animations/anm_zoom_in.js +16 -0
- package/dist/ui/animations/anm_zoom_out.d.ts +22 -0
- package/dist/ui/animations/anm_zoom_out.js +16 -0
- package/dist/ui/animations.d.ts +59 -0
- package/dist/ui/animations.js +227 -0
- package/dist/ui/attach.d.ts +3 -0
- package/dist/ui/attach.js +497 -0
- package/dist/ui/charts.d.ts +32 -0
- package/dist/ui/charts.js +35 -0
- package/dist/ui/checked.d.ts +19 -0
- package/dist/ui/checked.js +3 -0
- package/dist/ui/collector.d.ts +32 -0
- package/dist/ui/collector.js +75 -0
- package/dist/ui/compositions.d.ts +21 -0
- package/dist/ui/compositions.js +305 -0
- package/dist/ui/consent.d.ts +22 -0
- package/dist/ui/consent.js +44 -0
- package/dist/ui/content.d.ts +9 -0
- package/dist/ui/content.js +11 -0
- package/dist/ui/contrast.d.ts +3 -0
- package/dist/ui/contrast.js +23 -0
- package/dist/ui/controls.d.ts +14 -0
- package/dist/ui/controls.js +2 -0
- package/dist/ui/disclosure.d.ts +14 -0
- package/dist/ui/disclosure.js +2 -0
- package/dist/ui/dismiss-layer.d.ts +14 -0
- package/dist/ui/dismiss-layer.js +66 -0
- package/dist/ui/door.d.ts +40 -0
- package/dist/ui/door.js +100 -0
- package/dist/ui/drag.d.ts +82 -0
- package/dist/ui/drag.js +212 -0
- package/dist/ui/elements/accordion.d.ts +12 -0
- package/dist/ui/elements/accordion.js +16 -0
- package/dist/ui/elements/accordion.works.d.ts +22 -0
- package/dist/ui/elements/accordion.works.js +44 -0
- package/dist/ui/elements/aspect-ratio.d.ts +10 -0
- package/dist/ui/elements/aspect-ratio.js +9 -0
- package/dist/ui/elements/aspect-ratio.works.d.ts +2 -0
- package/dist/ui/elements/aspect-ratio.works.js +3 -0
- package/dist/ui/elements/avatar.d.ts +11 -0
- package/dist/ui/elements/avatar.js +10 -0
- package/dist/ui/elements/avatar.works.d.ts +4 -0
- package/dist/ui/elements/avatar.works.js +16 -0
- package/dist/ui/elements/badge.d.ts +11 -0
- package/dist/ui/elements/badge.js +10 -0
- package/dist/ui/elements/badge.works.d.ts +5 -0
- package/dist/ui/elements/badge.works.js +6 -0
- package/dist/ui/elements/bars.d.ts +14 -0
- package/dist/ui/elements/bars.js +17 -0
- package/dist/ui/elements/bars.works.d.ts +12 -0
- package/dist/ui/elements/bars.works.js +20 -0
- package/dist/ui/elements/box.d.ts +12 -0
- package/dist/ui/elements/box.js +11 -0
- package/dist/ui/elements/breadcrumb.d.ts +10 -0
- package/dist/ui/elements/breadcrumb.js +12 -0
- package/dist/ui/elements/breadcrumb.works.d.ts +7 -0
- package/dist/ui/elements/breadcrumb.works.js +21 -0
- package/dist/ui/elements/button.d.ts +17 -0
- package/dist/ui/elements/button.js +16 -0
- package/dist/ui/elements/button.works.d.ts +17 -0
- package/dist/ui/elements/button.works.js +34 -0
- package/dist/ui/elements/column.d.ts +9 -0
- package/dist/ui/elements/column.js +8 -0
- package/dist/ui/elements/consent.d.ts +13 -0
- package/dist/ui/elements/consent.js +21 -0
- package/dist/ui/elements/consent.works.d.ts +41 -0
- package/dist/ui/elements/consent.works.js +79 -0
- package/dist/ui/elements/donut.d.ts +13 -0
- package/dist/ui/elements/donut.js +16 -0
- package/dist/ui/elements/donut.works.d.ts +11 -0
- package/dist/ui/elements/donut.works.js +28 -0
- package/dist/ui/elements/each.d.ts +14 -0
- package/dist/ui/elements/each.js +9 -0
- package/dist/ui/elements/each.works.d.ts +3 -0
- package/dist/ui/elements/each.works.js +68 -0
- package/dist/ui/elements/empty.d.ts +9 -0
- package/dist/ui/elements/empty.js +12 -0
- package/dist/ui/elements/field.d.ts +16 -0
- package/dist/ui/elements/field.js +15 -0
- package/dist/ui/elements/field.works.d.ts +17 -0
- package/dist/ui/elements/field.works.js +45 -0
- package/dist/ui/elements/funnel.d.ts +14 -0
- package/dist/ui/elements/funnel.js +17 -0
- package/dist/ui/elements/funnel.works.d.ts +12 -0
- package/dist/ui/elements/funnel.works.js +23 -0
- package/dist/ui/elements/gauge.d.ts +12 -0
- package/dist/ui/elements/gauge.js +15 -0
- package/dist/ui/elements/gauge.works.d.ts +11 -0
- package/dist/ui/elements/gauge.works.js +31 -0
- package/dist/ui/elements/glyph.d.ts +10 -0
- package/dist/ui/elements/glyph.js +9 -0
- package/dist/ui/elements/glyph.works.d.ts +5 -0
- package/dist/ui/elements/glyph.works.js +16 -0
- package/dist/ui/elements/grid.d.ts +9 -0
- package/dist/ui/elements/grid.js +8 -0
- package/dist/ui/elements/heatmap.d.ts +15 -0
- package/dist/ui/elements/heatmap.js +17 -0
- package/dist/ui/elements/heatmap.works.d.ts +11 -0
- package/dist/ui/elements/heatmap.works.js +11 -0
- package/dist/ui/elements/hit-box.d.ts +19 -0
- package/dist/ui/elements/hit-box.js +15 -0
- package/dist/ui/elements/hit-box.works.d.ts +87 -0
- package/dist/ui/elements/hit-box.works.js +451 -0
- package/dist/ui/elements/image.d.ts +10 -0
- package/dist/ui/elements/image.js +9 -0
- package/dist/ui/elements/line-chart.d.ts +13 -0
- package/dist/ui/elements/line-chart.js +16 -0
- package/dist/ui/elements/line-chart.works.d.ts +12 -0
- package/dist/ui/elements/line-chart.works.js +27 -0
- package/dist/ui/elements/link.d.ts +12 -0
- package/dist/ui/elements/link.js +15 -0
- package/dist/ui/elements/link.works.d.ts +10 -0
- package/dist/ui/elements/link.works.js +15 -0
- package/dist/ui/elements/media.d.ts +11 -0
- package/dist/ui/elements/media.js +22 -0
- package/dist/ui/elements/menu.d.ts +12 -0
- package/dist/ui/elements/menu.js +18 -0
- package/dist/ui/elements/menu.works.d.ts +50 -0
- package/dist/ui/elements/menu.works.js +100 -0
- package/dist/ui/elements/money.d.ts +10 -0
- package/dist/ui/elements/money.js +9 -0
- package/dist/ui/elements/money.works.d.ts +4 -0
- package/dist/ui/elements/money.works.js +4 -0
- package/dist/ui/elements/pagination.d.ts +11 -0
- package/dist/ui/elements/pagination.js +12 -0
- package/dist/ui/elements/pagination.works.d.ts +5 -0
- package/dist/ui/elements/pagination.works.js +15 -0
- package/dist/ui/elements/progress.d.ts +11 -0
- package/dist/ui/elements/progress.js +11 -0
- package/dist/ui/elements/progress.works.d.ts +2 -0
- package/dist/ui/elements/progress.works.js +6 -0
- package/dist/ui/elements/radio-group.d.ts +15 -0
- package/dist/ui/elements/radio-group.js +16 -0
- package/dist/ui/elements/radio-group.works.d.ts +10 -0
- package/dist/ui/elements/radio-group.works.js +22 -0
- package/dist/ui/elements/row.d.ts +9 -0
- package/dist/ui/elements/row.js +8 -0
- package/dist/ui/elements/scatter.d.ts +13 -0
- package/dist/ui/elements/scatter.js +15 -0
- package/dist/ui/elements/scatter.works.d.ts +11 -0
- package/dist/ui/elements/scatter.works.js +24 -0
- package/dist/ui/elements/select.d.ts +13 -0
- package/dist/ui/elements/select.js +11 -0
- package/dist/ui/elements/select.works.d.ts +4 -0
- package/dist/ui/elements/select.works.js +3 -0
- package/dist/ui/elements/separator.d.ts +10 -0
- package/dist/ui/elements/separator.js +9 -0
- package/dist/ui/elements/skeleton.d.ts +8 -0
- package/dist/ui/elements/skeleton.js +9 -0
- package/dist/ui/elements/slider.d.ts +14 -0
- package/dist/ui/elements/slider.js +10 -0
- package/dist/ui/elements/slider.works.d.ts +4 -0
- package/dist/ui/elements/slider.works.js +3 -0
- package/dist/ui/elements/sparkline.d.ts +10 -0
- package/dist/ui/elements/sparkline.js +15 -0
- package/dist/ui/elements/sparkline.works.d.ts +10 -0
- package/dist/ui/elements/sparkline.works.js +19 -0
- package/dist/ui/elements/spinner.d.ts +9 -0
- package/dist/ui/elements/spinner.js +12 -0
- package/dist/ui/elements/stack.d.ts +9 -0
- package/dist/ui/elements/stack.js +8 -0
- package/dist/ui/elements/stat.d.ts +12 -0
- package/dist/ui/elements/stat.js +10 -0
- package/dist/ui/elements/stat.works.d.ts +3 -0
- package/dist/ui/elements/stat.works.js +10 -0
- package/dist/ui/elements/surface.d.ts +9 -0
- package/dist/ui/elements/surface.js +15 -0
- package/dist/ui/elements/surface.works.d.ts +7 -0
- package/dist/ui/elements/surface.works.js +4 -0
- package/dist/ui/elements/table.d.ts +13 -0
- package/dist/ui/elements/table.js +16 -0
- package/dist/ui/elements/table.works.d.ts +11 -0
- package/dist/ui/elements/table.works.js +15 -0
- package/dist/ui/elements/tabs.d.ts +12 -0
- package/dist/ui/elements/tabs.js +16 -0
- package/dist/ui/elements/tabs.works.d.ts +25 -0
- package/dist/ui/elements/tabs.works.js +53 -0
- package/dist/ui/elements/text.d.ts +13 -0
- package/dist/ui/elements/text.js +9 -0
- package/dist/ui/elements/textarea.d.ts +14 -0
- package/dist/ui/elements/textarea.js +11 -0
- package/dist/ui/elements/textarea.works.d.ts +4 -0
- package/dist/ui/elements/textarea.works.js +3 -0
- package/dist/ui/elements/time.d.ts +11 -0
- package/dist/ui/elements/time.js +14 -0
- package/dist/ui/elements/time.works.d.ts +11 -0
- package/dist/ui/elements/time.works.js +16 -0
- package/dist/ui/elements/toggle.d.ts +11 -0
- package/dist/ui/elements/toggle.js +10 -0
- package/dist/ui/elements/toggle.works.d.ts +4 -0
- package/dist/ui/elements/toggle.works.js +3 -0
- package/dist/ui/elements/tooltip.d.ts +12 -0
- package/dist/ui/elements/tooltip.js +15 -0
- package/dist/ui/elements/tooltip.works.d.ts +28 -0
- package/dist/ui/elements/tooltip.works.js +54 -0
- package/dist/ui/elements/value.d.ts +12 -0
- package/dist/ui/elements/value.js +9 -0
- package/dist/ui/elements/value.works.d.ts +4 -0
- package/dist/ui/elements/value.works.js +4 -0
- package/dist/ui/elements.d.ts +1143 -0
- package/dist/ui/elements.js +68 -0
- package/dist/ui/focus-scope.d.ts +7 -0
- package/dist/ui/focus-scope.js +109 -0
- package/dist/ui/fonts.d.ts +103 -0
- package/dist/ui/fonts.js +243 -0
- package/dist/ui/generators/dev.d.ts +2 -0
- package/dist/ui/generators/dev.js +61 -0
- package/dist/ui/generators/elements.d.ts +31 -0
- package/dist/ui/generators/elements.js +520 -0
- package/dist/ui/generators/i18n.d.ts +5 -0
- package/dist/ui/generators/i18n.js +264 -0
- package/dist/ui/generators/icons.d.ts +1 -0
- package/dist/ui/generators/icons.js +187 -0
- package/dist/ui/generators/react.d.ts +26 -0
- package/dist/ui/generators/react.js +218 -0
- package/dist/ui/generators/routes.d.ts +11 -0
- package/dist/ui/generators/routes.js +597 -0
- package/dist/ui/generators/show.d.ts +1 -0
- package/dist/ui/generators/show.js +231 -0
- package/dist/ui/generators/styles.d.ts +1 -0
- package/dist/ui/generators/styles.js +502 -0
- package/dist/ui/generators/variants.d.ts +12 -0
- package/dist/ui/generators/variants.js +162 -0
- package/dist/ui/i18n/catalogs/en.d.ts +172 -0
- package/dist/ui/i18n/catalogs/en.js +148 -0
- package/dist/ui/i18n/format.d.ts +13 -0
- package/dist/ui/i18n/format.js +161 -0
- package/dist/ui/i18n/locales.d.ts +9 -0
- package/dist/ui/i18n/locales.js +20 -0
- package/dist/ui/i18n/parse.d.ts +45 -0
- package/dist/ui/i18n/parse.js +249 -0
- package/dist/ui/i18n/translator.d.ts +10 -0
- package/dist/ui/i18n/translator.js +22 -0
- package/dist/ui/i18n/types.d.ts +33 -0
- package/dist/ui/i18n/types.js +9 -0
- package/dist/ui/icons.d.ts +67 -0
- package/dist/ui/icons.js +249 -0
- package/dist/ui/islands/map.d.ts +33 -0
- package/dist/ui/islands/map.js +44 -0
- package/dist/ui/localizations.d.ts +33 -0
- package/dist/ui/localizations.js +51 -0
- package/dist/ui/makers/message.d.ts +1 -0
- package/dist/ui/makers/message.js +230 -0
- package/dist/ui/material.d.ts +83 -0
- package/dist/ui/material.js +95 -0
- package/dist/ui/materials/mat_bordered.d.ts +22 -0
- package/dist/ui/materials/mat_bordered.js +12 -0
- package/dist/ui/materials/mat_ceramic.d.ts +22 -0
- package/dist/ui/materials/mat_ceramic.js +12 -0
- package/dist/ui/materials/mat_clay.d.ts +22 -0
- package/dist/ui/materials/mat_clay.js +12 -0
- package/dist/ui/materials/mat_elevated.d.ts +32 -0
- package/dist/ui/materials/mat_elevated.js +23 -0
- package/dist/ui/materials/mat_flat.d.ts +50 -0
- package/dist/ui/materials/mat_flat.js +33 -0
- package/dist/ui/materials/mat_glass.d.ts +32 -0
- package/dist/ui/materials/mat_glass.js +19 -0
- package/dist/ui/materials/mat_lit.d.ts +22 -0
- package/dist/ui/materials/mat_lit.js +12 -0
- package/dist/ui/materials/mat_moulded.d.ts +16 -0
- package/dist/ui/materials/mat_moulded.js +10 -0
- package/dist/ui/materials.d.ts +56 -0
- package/dist/ui/materials.js +175 -0
- package/dist/ui/modes.d.ts +25 -0
- package/dist/ui/modes.js +25 -0
- package/dist/ui/navigation.d.ts +3 -0
- package/dist/ui/navigation.js +24 -0
- package/dist/ui/positioning.d.ts +24 -0
- package/dist/ui/positioning.js +48 -0
- package/dist/ui/presented.d.ts +10 -0
- package/dist/ui/presented.js +81 -0
- package/dist/ui/provider.d.ts +31 -0
- package/dist/ui/provider.js +104 -0
- package/dist/ui/render-loop.d.ts +12 -0
- package/dist/ui/render-loop.js +94 -0
- package/dist/ui/roving-focus.d.ts +15 -0
- package/dist/ui/roving-focus.js +143 -0
- package/dist/ui/screens.d.ts +17 -0
- package/dist/ui/screens.js +112 -0
- package/dist/ui/scroll-lock.d.ts +2 -0
- package/dist/ui/scroll-lock.js +24 -0
- package/dist/ui/series.d.ts +9 -0
- package/dist/ui/series.js +67 -0
- package/dist/ui/signals.d.ts +120 -0
- package/dist/ui/signals.js +286 -0
- package/dist/ui/styleguide.d.ts +27 -0
- package/dist/ui/styleguide.js +138 -0
- package/dist/ui/styleguides.d.ts +11 -0
- package/dist/ui/styleguides.js +299 -0
- package/dist/ui/themes.d.ts +5 -0
- package/dist/ui/themes.js +16 -0
- package/dist/ui/token.d.ts +16 -0
- package/dist/ui/token.js +37 -0
- package/dist/ui/tokens/shadow.d.ts +6 -0
- package/dist/ui/tokens/shadow.js +17 -0
- package/dist/ui/tokens.d.ts +180 -0
- package/dist/ui/tokens.js +200 -0
- package/dist/ui/validators.d.ts +37 -0
- package/dist/ui/validators.js +184 -0
- package/dist/ui/variant.d.ts +122 -0
- package/dist/ui/variant.js +201 -0
- package/dist/ui/variants/var_avatar-round.d.ts +23 -0
- package/dist/ui/variants/var_avatar-round.js +13 -0
- package/dist/ui/variants/var_bubble-me.d.ts +21 -0
- package/dist/ui/variants/var_bubble-me.js +13 -0
- package/dist/ui/variants/var_bubble-them.d.ts +18 -0
- package/dist/ui/variants/var_bubble-them.js +12 -0
- package/dist/ui/variants/var_button-border.d.ts +116 -0
- package/dist/ui/variants/var_button-border.js +75 -0
- package/dist/ui/variants/var_button-cta.d.ts +116 -0
- package/dist/ui/variants/var_button-cta.js +75 -0
- package/dist/ui/variants/var_button-destructive-ghost.d.ts +113 -0
- package/dist/ui/variants/var_button-destructive-ghost.js +71 -0
- package/dist/ui/variants/var_button-destructive.d.ts +116 -0
- package/dist/ui/variants/var_button-destructive.js +75 -0
- package/dist/ui/variants/var_button-fill.d.ts +116 -0
- package/dist/ui/variants/var_button-fill.js +75 -0
- package/dist/ui/variants/var_button-ghost.d.ts +113 -0
- package/dist/ui/variants/var_button-ghost.js +71 -0
- package/dist/ui/variants/var_button-glass.d.ts +84 -0
- package/dist/ui/variants/var_button-glass.js +54 -0
- package/dist/ui/variants/var_button-normal.d.ts +116 -0
- package/dist/ui/variants/var_button-normal.js +75 -0
- package/dist/ui/variants/var_button-quiet.d.ts +119 -0
- package/dist/ui/variants/var_button-quiet.js +73 -0
- package/dist/ui/variants/var_card.d.ts +30 -0
- package/dist/ui/variants/var_card.js +16 -0
- package/dist/ui/variants/var_chip.d.ts +18 -0
- package/dist/ui/variants/var_chip.js +12 -0
- package/dist/ui/variants/var_choice.d.ts +26 -0
- package/dist/ui/variants/var_choice.js +14 -0
- package/dist/ui/variants/var_framed.d.ts +11 -0
- package/dist/ui/variants/var_framed.js +9 -0
- package/dist/ui/variants/var_glyph-plain.d.ts +14 -0
- package/dist/ui/variants/var_glyph-plain.js +10 -0
- package/dist/ui/variants/var_input.d.ts +61 -0
- package/dist/ui/variants/var_input.js +42 -0
- package/dist/ui/variants/var_link-inline.d.ts +39 -0
- package/dist/ui/variants/var_link-inline.js +28 -0
- package/dist/ui/variants/var_list-row.d.ts +47 -0
- package/dist/ui/variants/var_list-row.js +33 -0
- package/dist/ui/variants/var_rule.d.ts +11 -0
- package/dist/ui/variants/var_rule.js +9 -0
- package/dist/ui/variants/var_skeleton-block.d.ts +17 -0
- package/dist/ui/variants/var_skeleton-block.js +11 -0
- package/dist/ui/variants/var_spinner-turning.d.ts +17 -0
- package/dist/ui/variants/var_spinner-turning.js +11 -0
- package/dist/ui/variants/var_stat-tile.d.ts +18 -0
- package/dist/ui/variants/var_stat-tile.js +12 -0
- package/dist/ui/variants/var_tab-bar.d.ts +24 -0
- package/dist/ui/variants/var_tab-bar.js +14 -0
- package/dist/ui/variants/var_tap-target.d.ts +33 -0
- package/dist/ui/variants/var_tap-target.js +24 -0
- package/dist/ui/variants.d.ts +174 -0
- package/dist/ui/variants.js +50 -0
- package/dist/ui/wrappers.d.ts +128 -0
- package/dist/ui/wrappers.js +220 -0
- package/package.json +16 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { Surface } from '../door.ts';
|
|
3
|
+
import type { FieldProps } from './field.tsx';
|
|
4
|
+
export declare function uses(props: FieldProps): {
|
|
5
|
+
readonly holds?: readonly string[];
|
|
6
|
+
readonly animates?: boolean;
|
|
7
|
+
readonly on?: Readonly<Record<string, unknown>>;
|
|
8
|
+
readonly wrong: string | null;
|
|
9
|
+
readonly said: (to: string | null) => void;
|
|
10
|
+
};
|
|
11
|
+
export declare function entry(props: FieldProps, kept: {
|
|
12
|
+
readonly wrong: string | null;
|
|
13
|
+
readonly said: (to: string | null) => void;
|
|
14
|
+
}): Readonly<Record<string, unknown>>;
|
|
15
|
+
export declare function shown(_props: FieldProps, surface: Surface, kept: {
|
|
16
|
+
readonly wrong: string | null;
|
|
17
|
+
}): Readonly<Record<string, ReactNode>>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { acceptsKeystroke, applyMask, entryConstraints, evaluateMoney, runValidator } from "../validators.js";
|
|
3
|
+
export function uses(props) {
|
|
4
|
+
const [wrong, said] = useState(null);
|
|
5
|
+
return { ...(props.disabled === true ? { holds: ['disabled'] } : {}), wrong, said };
|
|
6
|
+
}
|
|
7
|
+
export function entry(props, kept) {
|
|
8
|
+
const rules = entryConstraints(props.validator, props.context ?? {});
|
|
9
|
+
return {
|
|
10
|
+
name: props.name,
|
|
11
|
+
...(rules.secret === true ? { type: 'password' } : {}),
|
|
12
|
+
...(props.autocomplete ?? rules.autocomplete === undefined
|
|
13
|
+
? {}
|
|
14
|
+
: { autoComplete: props.autocomplete ?? rules.autocomplete }),
|
|
15
|
+
...(rules.keyboard === 'text' ? {} : { inputMode: rules.keyboard }),
|
|
16
|
+
...(rules.maxChars === undefined ? {} : { maxLength: rules.maxChars }),
|
|
17
|
+
value: props.value ?? '',
|
|
18
|
+
...(kept.wrong === null ? {} : { 'aria-invalid': true }),
|
|
19
|
+
onChange: (event) => {
|
|
20
|
+
let kept_ = '';
|
|
21
|
+
for (const ch of event.target.value) {
|
|
22
|
+
if (acceptsKeystroke(props.validator, kept_, ch))
|
|
23
|
+
kept_ += ch;
|
|
24
|
+
}
|
|
25
|
+
props.onValue?.(applyMask(props.validator, kept_));
|
|
26
|
+
},
|
|
27
|
+
onBlur: () => {
|
|
28
|
+
const text = props.value ?? '';
|
|
29
|
+
let judged = text;
|
|
30
|
+
if (rules.entry === 'calculator') {
|
|
31
|
+
const currency = props.context?.['currency'];
|
|
32
|
+
const resolved = typeof currency === 'string' ? evaluateMoney(text, currency) : undefined;
|
|
33
|
+
if (resolved !== undefined) {
|
|
34
|
+
judged = { amount: resolved.amount, currency };
|
|
35
|
+
props.onValue?.(String(resolved.amount));
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
const result = runValidator(props.validator, judged, props.context ?? {});
|
|
39
|
+
kept.said(result.ok ? null : result.errorKey);
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
export function shown(_props, surface, kept) {
|
|
44
|
+
return { fault: kept.wrong === null ? null : surface.text(kept.wrong) };
|
|
45
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { MessageKey } from '../content.tsx';
|
|
2
|
+
import type { Row } from '../charts.tsx';
|
|
3
|
+
import { type Element } from '../wrappers.tsx';
|
|
4
|
+
export interface FunnelProps {
|
|
5
|
+
readonly rows: readonly Row[];
|
|
6
|
+
readonly by: string;
|
|
7
|
+
readonly value: string;
|
|
8
|
+
readonly format?: string;
|
|
9
|
+
readonly titleKey?: MessageKey;
|
|
10
|
+
readonly dispatch?: string;
|
|
11
|
+
readonly input?: Readonly<Record<string, unknown>>;
|
|
12
|
+
readonly invokeOn?: 'press' | 'shown';
|
|
13
|
+
}
|
|
14
|
+
export declare const Funnel: Element<'Funnel', FunnelProps>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { roleClass } from "../fonts.js";
|
|
4
|
+
import { measured as marking } from "../charts.js";
|
|
5
|
+
import { element, useSurface } from "../wrappers.js";
|
|
6
|
+
import { Each } from "./each.js";
|
|
7
|
+
import { shown, sized, uses } from "./funnel.works.js";
|
|
8
|
+
export const Funnel = element('Funnel', (props, className) => {
|
|
9
|
+
const kept = uses(props);
|
|
10
|
+
const surface = useSurface({ className: roleClass(undefined, className),
|
|
11
|
+
invokes: { ...(props.dispatch === undefined ? {} : { dispatch: props.dispatch }), ...(props.input === undefined ? {} : { input: props.input }), ...(props.invokeOn === undefined ? {} : { on: props.invokeOn }) },
|
|
12
|
+
holds: [
|
|
13
|
+
...(kept.holds ?? []),
|
|
14
|
+
],
|
|
15
|
+
...(kept.animates === undefined ? {} : { animates: kept.animates }), });
|
|
16
|
+
return (_jsx("div", { className: surface.className, ...surface.marks, ...surface.invokes, ...surface.a11y, ...(kept.on ?? {}), role: "img", ...(props.titleKey === undefined ? {} : { 'aria-label': surface.text(props.titleKey) }), children: _jsx(Each, { rows: props.rows, by: props.by, children: (each0, at) => (_jsxs("span", { style: marking(sized(props, kept, each0, at)), children: [_jsx("span", { children: shown(props, each0, surface, kept).label }), _jsx("span", { children: shown(props, each0, surface, kept).amount })] })) }) }));
|
|
17
|
+
}, 'e-funnel');
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type Row } from '../charts.tsx';
|
|
2
|
+
import type { FunnelProps } from './funnel.tsx';
|
|
3
|
+
export declare function uses(props: FunnelProps): {
|
|
4
|
+
readonly holds?: readonly string[];
|
|
5
|
+
readonly animates?: boolean;
|
|
6
|
+
readonly on?: Readonly<Record<string, unknown>>;
|
|
7
|
+
readonly ramp: readonly string[];
|
|
8
|
+
};
|
|
9
|
+
export declare function sized(props: FunnelProps, kept: {
|
|
10
|
+
readonly ramp: readonly string[];
|
|
11
|
+
}, row: Row, at: number): Readonly<Record<string, string | number>>;
|
|
12
|
+
export declare function shown(props: FunnelProps, row: Row, _surface: unknown, _kept?: unknown): Readonly<Record<string, string>>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { formatValue } from "../validators.js";
|
|
2
|
+
import { seriesColour } from "../series.js";
|
|
3
|
+
import { num, str, useRamp } from "../charts.js";
|
|
4
|
+
export function uses(props) {
|
|
5
|
+
const ramp = useRamp(props.rows.length);
|
|
6
|
+
return { ...(props.rows.length === 0 ? { holds: ['empty'] } : {}), ramp };
|
|
7
|
+
}
|
|
8
|
+
export function sized(props, kept, row, at) {
|
|
9
|
+
const top = num(props.rows[0], props.value) || 1;
|
|
10
|
+
const before = at === 0 ? null : num(props.rows[at - 1], props.value);
|
|
11
|
+
const drop = before === null || before === 0 ? null : 1 - num(row, props.value) / before;
|
|
12
|
+
return {
|
|
13
|
+
series: seriesColour(kept.ramp, at),
|
|
14
|
+
fraction: `${((num(row, props.value) / top) * 100).toFixed(1)}%`,
|
|
15
|
+
...(drop === null ? {} : { drop: `${(drop * 100).toFixed(1)}%` }),
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export function shown(props, row, _surface, _kept) {
|
|
19
|
+
return {
|
|
20
|
+
label: str(row, props.by),
|
|
21
|
+
amount: String(formatValue(props.format ?? 'number', num(row, props.value))),
|
|
22
|
+
};
|
|
23
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { MessageKey } from '../content.tsx';
|
|
2
|
+
import { type Element } from '../wrappers.tsx';
|
|
3
|
+
export interface GaugeProps {
|
|
4
|
+
readonly value?: number;
|
|
5
|
+
readonly min?: number;
|
|
6
|
+
readonly max?: number;
|
|
7
|
+
readonly labelKey: MessageKey;
|
|
8
|
+
readonly dispatch?: string;
|
|
9
|
+
readonly input?: Readonly<Record<string, unknown>>;
|
|
10
|
+
readonly invokeOn?: 'press' | 'shown';
|
|
11
|
+
}
|
|
12
|
+
export declare const Gauge: Element<'Gauge', GaugeProps>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { roleClass } from "../fonts.js";
|
|
4
|
+
import { element, useSurface } from "../wrappers.js";
|
|
5
|
+
import { track, needle, uses } from "./gauge.works.js";
|
|
6
|
+
export const Gauge = element('Gauge', (props, className) => {
|
|
7
|
+
const kept = uses(props);
|
|
8
|
+
const surface = useSurface({ className: roleClass(undefined, className),
|
|
9
|
+
invokes: { ...(props.dispatch === undefined ? {} : { dispatch: props.dispatch }), ...(props.input === undefined ? {} : { input: props.input }), ...(props.invokeOn === undefined ? {} : { on: props.invokeOn }) },
|
|
10
|
+
holds: [
|
|
11
|
+
...(kept.holds ?? []),
|
|
12
|
+
],
|
|
13
|
+
...(kept.animates === undefined ? {} : { animates: kept.animates }), });
|
|
14
|
+
return (_jsxs("svg", { className: surface.className, ...surface.marks, ...surface.invokes, ...surface.a11y, ...(kept.on ?? {}), role: "img", "aria-label": surface.text(props.labelKey), children: [_jsx("path", { ...track(props, kept) }), _jsx("path", { ...needle(props, kept) })] }));
|
|
15
|
+
}, 'e-gauge');
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { GaugeProps } from './gauge.tsx';
|
|
2
|
+
export declare function uses(_props: GaugeProps): {
|
|
3
|
+
readonly holds?: readonly string[];
|
|
4
|
+
readonly animates?: boolean;
|
|
5
|
+
readonly on?: Readonly<Record<string, unknown>>;
|
|
6
|
+
readonly ramp: readonly string[];
|
|
7
|
+
};
|
|
8
|
+
export declare function track(_props: GaugeProps, _kept: unknown): Readonly<Record<string, string | number>>;
|
|
9
|
+
export declare function needle(props: GaugeProps, kept: {
|
|
10
|
+
readonly ramp: readonly string[];
|
|
11
|
+
}): Readonly<Record<string, string | number>>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { useRamp } from "../charts.js";
|
|
2
|
+
const LEFT = 10;
|
|
3
|
+
const RIGHT = 90;
|
|
4
|
+
const MIDDLE = 50;
|
|
5
|
+
const RADIUS = 40;
|
|
6
|
+
export function uses(_props) {
|
|
7
|
+
return { on: { viewBox: `0 0 100 56` }, ramp: useRamp(1) };
|
|
8
|
+
}
|
|
9
|
+
export function track(_props, _kept) {
|
|
10
|
+
return {
|
|
11
|
+
d: `M ${String(LEFT)} ${String(MIDDLE)} A ${String(RADIUS)} ${String(RADIUS)} 0 0 1 ${String(RIGHT)} ${String(MIDDLE)}`,
|
|
12
|
+
fill: 'none',
|
|
13
|
+
stroke: 'currentColor',
|
|
14
|
+
strokeOpacity: 0.15,
|
|
15
|
+
strokeWidth: 8,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export function needle(props, kept) {
|
|
19
|
+
const least = props.min ?? 0;
|
|
20
|
+
const most = props.max ?? 0;
|
|
21
|
+
const span = most - least;
|
|
22
|
+
const part = span <= 0 ? 0 : Math.min(1, Math.max(0, ((props.value ?? 0) - least) / span));
|
|
23
|
+
const angle = Math.PI * (1 - part);
|
|
24
|
+
return {
|
|
25
|
+
d: `M ${String(LEFT)} ${String(MIDDLE)} A ${String(RADIUS)} ${String(RADIUS)} 0 0 1 ` +
|
|
26
|
+
`${(MIDDLE + RADIUS * Math.cos(angle)).toFixed(2)} ${(MIDDLE - RADIUS * Math.sin(angle)).toFixed(2)}`,
|
|
27
|
+
fill: 'none',
|
|
28
|
+
stroke: kept.ramp[0] ?? 'currentColor',
|
|
29
|
+
strokeWidth: 8,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { MessageKey } from '../content.tsx';
|
|
2
|
+
import { type Element } from '../wrappers.tsx';
|
|
3
|
+
export interface GlyphProps {
|
|
4
|
+
readonly name: string;
|
|
5
|
+
readonly labelKey?: MessageKey;
|
|
6
|
+
readonly dispatch?: string;
|
|
7
|
+
readonly input?: Readonly<Record<string, unknown>>;
|
|
8
|
+
readonly invokeOn?: 'press' | 'shown';
|
|
9
|
+
}
|
|
10
|
+
export declare const Glyph: Element<'Glyph', GlyphProps>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { roleClass } from "../fonts.js";
|
|
3
|
+
import { element, useSurface } from "../wrappers.js";
|
|
4
|
+
import { shows } from "./glyph.works.js";
|
|
5
|
+
export const Glyph = element('Glyph', (props, className) => {
|
|
6
|
+
const surface = useSurface({ className: roleClass(undefined, className),
|
|
7
|
+
invokes: { ...(props.dispatch === undefined ? {} : { dispatch: props.dispatch }), ...(props.input === undefined ? {} : { input: props.input }), ...(props.invokeOn === undefined ? {} : { on: props.invokeOn }) }, });
|
|
8
|
+
return (shows(props, surface));
|
|
9
|
+
}, 'e-glyph');
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { Surface } from '../door.ts';
|
|
3
|
+
import type { GlyphProps } from './glyph.tsx';
|
|
4
|
+
export declare function drawn(name: string, semantics: Readonly<Record<string, unknown>>, className?: string): ReactNode;
|
|
5
|
+
export declare function shows(props: GlyphProps, surface: Surface): ReactNode;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { drawnFor, iconSize, installedSet, strokeFor } from "../icons.js";
|
|
3
|
+
export function drawn(name, semantics, className) {
|
|
4
|
+
const Symbol = drawnFor(name);
|
|
5
|
+
const set = installedSet();
|
|
6
|
+
const stroke = set === undefined ? undefined : strokeFor(set);
|
|
7
|
+
return (_jsx(Symbol, { size: iconSize(), ...(className === undefined ? {} : { className }), ...(stroke === undefined ? {} : { strokeWidth: stroke }), ...semantics }));
|
|
8
|
+
}
|
|
9
|
+
export function shows(props, surface) {
|
|
10
|
+
return drawn(props.name, {
|
|
11
|
+
...surface.marks,
|
|
12
|
+
...(props.labelKey === undefined
|
|
13
|
+
? { 'aria-hidden': true }
|
|
14
|
+
: { role: 'img', 'aria-label': surface.text(props.labelKey) }),
|
|
15
|
+
}, surface.className);
|
|
16
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import { type Element } from '../wrappers.tsx';
|
|
3
|
+
export interface GridProps {
|
|
4
|
+
readonly children: ReactNode;
|
|
5
|
+
readonly dispatch?: string;
|
|
6
|
+
readonly input?: Readonly<Record<string, unknown>>;
|
|
7
|
+
readonly invokeOn?: 'press' | 'shown';
|
|
8
|
+
}
|
|
9
|
+
export declare const Grid: Element<'Grid', GridProps>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { element, useSurface } from "../wrappers.js";
|
|
4
|
+
export const Grid = element('Grid', (props, className) => {
|
|
5
|
+
const surface = useSurface({ className,
|
|
6
|
+
invokes: { ...(props.dispatch === undefined ? {} : { dispatch: props.dispatch }), ...(props.input === undefined ? {} : { input: props.input }), ...(props.invokeOn === undefined ? {} : { on: props.invokeOn }) }, });
|
|
7
|
+
return (_jsx("div", { className: surface.className, ...surface.marks, ...surface.invokes, ...surface.a11y, children: props.children }));
|
|
8
|
+
}, 'e-grid');
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { MessageKey } from '../content.tsx';
|
|
2
|
+
import type { Row } from '../charts.tsx';
|
|
3
|
+
import { type Element } from '../wrappers.tsx';
|
|
4
|
+
export interface HeatmapProps {
|
|
5
|
+
readonly rows: readonly Row[];
|
|
6
|
+
readonly by: string;
|
|
7
|
+
readonly x: string;
|
|
8
|
+
readonly y: string;
|
|
9
|
+
readonly value?: string;
|
|
10
|
+
readonly titleKey?: MessageKey;
|
|
11
|
+
readonly dispatch?: string;
|
|
12
|
+
readonly input?: Readonly<Record<string, unknown>>;
|
|
13
|
+
readonly invokeOn?: 'press' | 'shown';
|
|
14
|
+
}
|
|
15
|
+
export declare const Heatmap: Element<'Heatmap', HeatmapProps>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { roleClass } from "../fonts.js";
|
|
4
|
+
import { measured as marking } from "../charts.js";
|
|
5
|
+
import { element, useSurface } from "../wrappers.js";
|
|
6
|
+
import { Each } from "./each.js";
|
|
7
|
+
import { sized, uses } from "./heatmap.works.js";
|
|
8
|
+
export const Heatmap = element('Heatmap', (props, className) => {
|
|
9
|
+
const kept = uses(props);
|
|
10
|
+
const surface = useSurface({ className: roleClass(undefined, className),
|
|
11
|
+
invokes: { ...(props.dispatch === undefined ? {} : { dispatch: props.dispatch }), ...(props.input === undefined ? {} : { input: props.input }), ...(props.invokeOn === undefined ? {} : { on: props.invokeOn }) },
|
|
12
|
+
holds: [
|
|
13
|
+
...(kept.holds ?? []),
|
|
14
|
+
],
|
|
15
|
+
...(kept.animates === undefined ? {} : { animates: kept.animates }), });
|
|
16
|
+
return (_jsx("div", { className: surface.className, ...surface.marks, ...surface.invokes, ...surface.a11y, ...(kept.on ?? {}), role: "img", ...(props.titleKey === undefined ? {} : { 'aria-label': surface.text(props.titleKey) }), children: _jsx(Each, { rows: props.rows, by: props.by, children: (each0, at) => (_jsx("span", { style: marking(sized(props, kept, each0, at)) })) }) }));
|
|
17
|
+
}, 'e-heatmap');
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type Row } from '../charts.tsx';
|
|
2
|
+
import type { HeatmapProps } from './heatmap.tsx';
|
|
3
|
+
export declare function uses(props: HeatmapProps): {
|
|
4
|
+
readonly holds?: readonly string[];
|
|
5
|
+
readonly animates?: boolean;
|
|
6
|
+
readonly on?: Readonly<Record<string, unknown>>;
|
|
7
|
+
readonly ramp: readonly string[];
|
|
8
|
+
};
|
|
9
|
+
export declare function sized(props: HeatmapProps, kept: {
|
|
10
|
+
readonly ramp: readonly string[];
|
|
11
|
+
}, row: Row, _at: number): Readonly<Record<string, string | number>>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { num, useRamp } from "../charts.js";
|
|
2
|
+
export function uses(props) {
|
|
3
|
+
const ramp = useRamp(1);
|
|
4
|
+
return { ...(props.rows.length === 0 ? { holds: ['empty'] } : {}), ramp };
|
|
5
|
+
}
|
|
6
|
+
export function sized(props, kept, row, _at) {
|
|
7
|
+
const readings = props.rows.map((one) => (props.value === undefined ? 1 : num(one, props.value)));
|
|
8
|
+
const most = Math.max(...readings, 0) || 1;
|
|
9
|
+
const here = props.value === undefined ? 1 : num(row, props.value);
|
|
10
|
+
return { series: kept.ramp[0] ?? '', share: Math.max(0.08, here / most) };
|
|
11
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { Subject } from '../drag.ts';
|
|
3
|
+
import { type Element } from '../wrappers.tsx';
|
|
4
|
+
export interface HitBoxProps {
|
|
5
|
+
readonly children: ReactNode;
|
|
6
|
+
readonly gesture: string;
|
|
7
|
+
readonly tuning?: Readonly<Record<string, number>>;
|
|
8
|
+
readonly axis?: string;
|
|
9
|
+
readonly grabs?: Subject | readonly Subject[];
|
|
10
|
+
readonly accepts: readonly string[];
|
|
11
|
+
readonly collects?: Subject | readonly Subject[];
|
|
12
|
+
readonly dwell?: number;
|
|
13
|
+
readonly moves?: boolean;
|
|
14
|
+
readonly onDrop?: () => void;
|
|
15
|
+
readonly dispatch?: string;
|
|
16
|
+
readonly input?: Readonly<Record<string, unknown>>;
|
|
17
|
+
readonly invokeOn?: 'press' | 'shown';
|
|
18
|
+
}
|
|
19
|
+
export declare const HitBox: Element<'HitBox', HitBoxProps>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { element, useSurface } from "../wrappers.js";
|
|
4
|
+
import { shown, uses, wires } from "./hit-box.works.js";
|
|
5
|
+
export const HitBox = element('HitBox', (props, className) => {
|
|
6
|
+
const kept = uses(props);
|
|
7
|
+
const surface = useSurface({ className,
|
|
8
|
+
invokes: { ...(props.dispatch === undefined ? {} : { dispatch: props.dispatch }), ...(props.input === undefined ? {} : { input: props.input }), ...(props.invokeOn === undefined ? {} : { on: props.invokeOn }) },
|
|
9
|
+
holds: [
|
|
10
|
+
...(kept.holds ?? []),
|
|
11
|
+
],
|
|
12
|
+
...(kept.animates === undefined ? {} : { animates: kept.animates }), });
|
|
13
|
+
const wired = wires(props, kept, surface);
|
|
14
|
+
return (_jsxs("div", { className: surface.className, ...surface.marks, ...surface.invokes, ...surface.a11y, ...(kept.on ?? {}), ...(wired.on ?? {}), children: [props.children, _jsx("div", { className: "e-hit-box-carried", children: shown(props, surface, kept, wired).carried })] }));
|
|
15
|
+
}, 'e-hit-box');
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { type GesturePhase } from '../signals.ts';
|
|
2
|
+
import { type PointerEvent, type ReactNode } from 'react';
|
|
3
|
+
import { type DragStatus, type Subject } from '../drag.ts';
|
|
4
|
+
import { useSurface } from '../wrappers.tsx';
|
|
5
|
+
import type { HitBoxProps } from './hit-box.tsx';
|
|
6
|
+
export type Axis = 'x' | 'y' | 'both';
|
|
7
|
+
interface Tracked {
|
|
8
|
+
readonly id: number;
|
|
9
|
+
x: number;
|
|
10
|
+
y: number;
|
|
11
|
+
readonly startX: number;
|
|
12
|
+
readonly startY: number;
|
|
13
|
+
readonly startT: number;
|
|
14
|
+
down: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare function uses(props: HitBoxProps): {
|
|
17
|
+
on: {};
|
|
18
|
+
pull: {
|
|
19
|
+
readonly band?: number;
|
|
20
|
+
readonly speed?: number;
|
|
21
|
+
} | undefined;
|
|
22
|
+
animates: boolean;
|
|
23
|
+
holds: ("scrolling" | "disabled" | "loading" | "empty" | "spinner" | "hover" | "active" | "focus" | "invalid" | "leaving" | "arriving" | "carrying" | "draggedOver" | "refusing" | "tapped" | "doubleTapped" | "pressing" | "dragging" | "swiping" | "pinching" | "rotating")[];
|
|
24
|
+
id: string;
|
|
25
|
+
claimed: import("../signals.ts").GestureEntry;
|
|
26
|
+
down: boolean;
|
|
27
|
+
setDown: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
28
|
+
phase: GesturePhase;
|
|
29
|
+
setPhase: import("react").Dispatch<import("react").SetStateAction<GesturePhase>>;
|
|
30
|
+
produced: Readonly<Record<string, number>>;
|
|
31
|
+
setProduced: import("react").Dispatch<import("react").SetStateAction<Readonly<Record<string, number>>>>;
|
|
32
|
+
released: import("react").RefObject<number>;
|
|
33
|
+
took: import("react").RefObject<{
|
|
34
|
+
readonly width: number;
|
|
35
|
+
readonly height: number;
|
|
36
|
+
readonly gripX: number;
|
|
37
|
+
readonly gripY: number;
|
|
38
|
+
} | null>;
|
|
39
|
+
pointer: {
|
|
40
|
+
readonly x: number;
|
|
41
|
+
readonly y: number;
|
|
42
|
+
} | null;
|
|
43
|
+
setPointer: import("react").Dispatch<import("react").SetStateAction<{
|
|
44
|
+
readonly x: number;
|
|
45
|
+
readonly y: number;
|
|
46
|
+
} | null>>;
|
|
47
|
+
settling: boolean;
|
|
48
|
+
setSettling: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
49
|
+
speed: import("react").RefObject<number>;
|
|
50
|
+
moved: import("react").RefObject<number>;
|
|
51
|
+
lean: number;
|
|
52
|
+
setLean: import("react").Dispatch<import("react").SetStateAction<number>>;
|
|
53
|
+
leanSpeed: import("react").RefObject<number>;
|
|
54
|
+
lastTick: import("react").RefObject<number>;
|
|
55
|
+
grabbed: import("react").RefObject<Subject | readonly Subject[] | undefined>;
|
|
56
|
+
grabsKey: string;
|
|
57
|
+
tuned: import("react").RefObject<Readonly<Record<string, number>> | undefined>;
|
|
58
|
+
tuningKey: string;
|
|
59
|
+
node: import("react").RefObject<HTMLDivElement | null>;
|
|
60
|
+
clockNow: import("react").RefObject<number>;
|
|
61
|
+
wants: boolean;
|
|
62
|
+
synthesised: import("react").RefObject<number | null>;
|
|
63
|
+
tracked: import("react").RefObject<Map<number, Tracked>>;
|
|
64
|
+
at: import("react").RefObject<{
|
|
65
|
+
x: number;
|
|
66
|
+
y: number;
|
|
67
|
+
}>;
|
|
68
|
+
lastFrame: import("react").RefObject<number>;
|
|
69
|
+
key: string;
|
|
70
|
+
status: DragStatus;
|
|
71
|
+
carrying: boolean;
|
|
72
|
+
raises: readonly import("../signals.ts").SignalEntry[];
|
|
73
|
+
};
|
|
74
|
+
export declare function wires(props: HitBoxProps, kept: ReturnType<typeof uses>, surface: ReturnType<typeof useSurface>): {
|
|
75
|
+
on: {
|
|
76
|
+
ref: import("react").RefObject<HTMLDivElement | null>;
|
|
77
|
+
'data-hitbox': string;
|
|
78
|
+
style: Record<string, string | number>;
|
|
79
|
+
onPointerDown: (e: PointerEvent<HTMLDivElement>) => void;
|
|
80
|
+
onPointerMove: (e: PointerEvent<HTMLDivElement>) => void;
|
|
81
|
+
onPointerUp: (e: PointerEvent<HTMLDivElement>) => void;
|
|
82
|
+
onPointerCancel: (e: PointerEvent<HTMLDivElement>) => void;
|
|
83
|
+
};
|
|
84
|
+
layer: import("react").JSX.Element | null;
|
|
85
|
+
};
|
|
86
|
+
export declare function shown(_props: HitBoxProps, _surface: ReturnType<typeof useSurface>, _kept: ReturnType<typeof uses>, wired: ReturnType<typeof wires>): Readonly<Record<string, ReactNode>>;
|
|
87
|
+
export {};
|