@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,40 @@
|
|
|
1
|
+
export declare const PRESENTATIONS: readonly ["page", "sheet", "popover", "overlay", "toast"];
|
|
2
|
+
export type Presentation = (typeof PRESENTATIONS)[number];
|
|
3
|
+
export declare const PRESENTATION_BEHAVIOUR: Readonly<Record<Presentation, {
|
|
4
|
+
readonly portal: boolean;
|
|
5
|
+
readonly backdrop: boolean;
|
|
6
|
+
readonly trapFocus: boolean;
|
|
7
|
+
readonly returnFocus: boolean;
|
|
8
|
+
readonly dismissOnEscape: boolean;
|
|
9
|
+
readonly dismissOnOutside: boolean;
|
|
10
|
+
}>>;
|
|
11
|
+
export interface ClockSubscriber {
|
|
12
|
+
(t: number): void;
|
|
13
|
+
}
|
|
14
|
+
export declare class Ticker {
|
|
15
|
+
#private;
|
|
16
|
+
constructor(every?: (fn: () => void) => () => void);
|
|
17
|
+
get running(): boolean;
|
|
18
|
+
subscribe(fn: () => void): () => void;
|
|
19
|
+
tick(): void;
|
|
20
|
+
}
|
|
21
|
+
export declare class Clock {
|
|
22
|
+
#private;
|
|
23
|
+
constructor(schedule?: (fn: () => void) => void);
|
|
24
|
+
get ticks(): number;
|
|
25
|
+
get running(): boolean;
|
|
26
|
+
subscribe(fn: ClockSubscriber): () => void;
|
|
27
|
+
setVisible(visible: boolean): void;
|
|
28
|
+
tick(dt: number): void;
|
|
29
|
+
}
|
|
30
|
+
export interface Surface {
|
|
31
|
+
readonly className?: string;
|
|
32
|
+
readonly holds: readonly string[];
|
|
33
|
+
readonly marks: Readonly<Record<string, boolean>>;
|
|
34
|
+
readonly invokes: Readonly<Record<string, unknown>>;
|
|
35
|
+
readonly marked: (signal: string) => boolean;
|
|
36
|
+
readonly text: (key: string, params?: Readonly<Record<string, unknown>>) => string;
|
|
37
|
+
readonly a11y: Readonly<Record<string, string | boolean | number>>;
|
|
38
|
+
readonly measures: Readonly<Record<string, string | number>>;
|
|
39
|
+
readonly t: number;
|
|
40
|
+
}
|
package/dist/ui/door.js
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
export const PRESENTATIONS = ['page', 'sheet', 'popover', 'overlay', 'toast'];
|
|
2
|
+
export const PRESENTATION_BEHAVIOUR = {
|
|
3
|
+
page: { portal: false, backdrop: false, trapFocus: false, returnFocus: false, dismissOnEscape: false, dismissOnOutside: false },
|
|
4
|
+
sheet: { portal: true, backdrop: true, trapFocus: true, returnFocus: true, dismissOnEscape: true, dismissOnOutside: true },
|
|
5
|
+
overlay: { portal: true, backdrop: true, trapFocus: true, returnFocus: true, dismissOnEscape: true, dismissOnOutside: true },
|
|
6
|
+
popover: { portal: true, backdrop: false, trapFocus: false, returnFocus: true, dismissOnEscape: true, dismissOnOutside: true },
|
|
7
|
+
toast: { portal: true, backdrop: false, trapFocus: false, returnFocus: false, dismissOnEscape: false, dismissOnOutside: false },
|
|
8
|
+
};
|
|
9
|
+
export class Ticker {
|
|
10
|
+
#subscribers = new Set();
|
|
11
|
+
#stop;
|
|
12
|
+
#every;
|
|
13
|
+
constructor(every) {
|
|
14
|
+
this.#every =
|
|
15
|
+
every ??
|
|
16
|
+
((fn) => {
|
|
17
|
+
const id = setInterval(fn, 1000);
|
|
18
|
+
return () => clearInterval(id);
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
get running() {
|
|
22
|
+
return this.#stop !== undefined;
|
|
23
|
+
}
|
|
24
|
+
subscribe(fn) {
|
|
25
|
+
this.#subscribers.add(fn);
|
|
26
|
+
if (this.#stop === undefined)
|
|
27
|
+
this.#stop = this.#every(() => this.tick());
|
|
28
|
+
return () => {
|
|
29
|
+
this.#subscribers.delete(fn);
|
|
30
|
+
if (this.#subscribers.size === 0) {
|
|
31
|
+
this.#stop?.();
|
|
32
|
+
this.#stop = undefined;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
tick() {
|
|
37
|
+
for (const fn of this.#subscribers)
|
|
38
|
+
fn();
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
export class Clock {
|
|
42
|
+
#subscribers = new Set();
|
|
43
|
+
#visible = true;
|
|
44
|
+
#running = false;
|
|
45
|
+
#t = 0;
|
|
46
|
+
#ticks = 0;
|
|
47
|
+
#schedule;
|
|
48
|
+
constructor(schedule) {
|
|
49
|
+
this.#schedule =
|
|
50
|
+
schedule ??
|
|
51
|
+
((fn) => {
|
|
52
|
+
if (typeof requestAnimationFrame === 'function')
|
|
53
|
+
requestAnimationFrame(() => fn());
|
|
54
|
+
else
|
|
55
|
+
setTimeout(fn, 16);
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
get ticks() {
|
|
59
|
+
return this.#ticks;
|
|
60
|
+
}
|
|
61
|
+
get running() {
|
|
62
|
+
return this.#running;
|
|
63
|
+
}
|
|
64
|
+
subscribe(fn) {
|
|
65
|
+
this.#subscribers.add(fn);
|
|
66
|
+
this.#maybeStart();
|
|
67
|
+
return () => {
|
|
68
|
+
this.#subscribers.delete(fn);
|
|
69
|
+
if (this.#subscribers.size === 0)
|
|
70
|
+
this.#running = false;
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
setVisible(visible) {
|
|
74
|
+
this.#visible = visible;
|
|
75
|
+
if (visible)
|
|
76
|
+
this.#maybeStart();
|
|
77
|
+
else
|
|
78
|
+
this.#running = false;
|
|
79
|
+
}
|
|
80
|
+
tick(dt) {
|
|
81
|
+
if (!this.#visible)
|
|
82
|
+
return;
|
|
83
|
+
this.#t += dt;
|
|
84
|
+
this.#ticks += 1;
|
|
85
|
+
for (const fn of this.#subscribers)
|
|
86
|
+
fn(this.#t);
|
|
87
|
+
}
|
|
88
|
+
#maybeStart() {
|
|
89
|
+
if (this.#running || !this.#visible || this.#subscribers.size === 0)
|
|
90
|
+
return;
|
|
91
|
+
this.#running = true;
|
|
92
|
+
const loop = () => {
|
|
93
|
+
if (!this.#running)
|
|
94
|
+
return;
|
|
95
|
+
this.tick(1 / 60);
|
|
96
|
+
this.#schedule(loop);
|
|
97
|
+
};
|
|
98
|
+
this.#schedule(loop);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
export declare const EDGE_SCROLL_DEFAULTS: {
|
|
2
|
+
readonly band: 48;
|
|
3
|
+
readonly speed: 900;
|
|
4
|
+
};
|
|
5
|
+
export interface Subject {
|
|
6
|
+
readonly kind: string;
|
|
7
|
+
readonly id: string;
|
|
8
|
+
}
|
|
9
|
+
export interface DragSession {
|
|
10
|
+
readonly gesture: string;
|
|
11
|
+
readonly subject: readonly Subject[];
|
|
12
|
+
readonly from: string;
|
|
13
|
+
readonly x: number;
|
|
14
|
+
readonly y: number;
|
|
15
|
+
readonly startedAt: number;
|
|
16
|
+
readonly at: number;
|
|
17
|
+
readonly over?: string;
|
|
18
|
+
readonly overSince: number;
|
|
19
|
+
}
|
|
20
|
+
export declare function dragSession(): DragSession | undefined;
|
|
21
|
+
export declare function subscribeDrag(listener: () => void): () => void;
|
|
22
|
+
export type DragStatus = 'idle' | 'carrying' | 'over' | 'refusing' | 'elsewhere';
|
|
23
|
+
export declare function dragStatusOf(hitBox: string, accepts: readonly string[] | undefined): DragStatus;
|
|
24
|
+
export interface Scroller {
|
|
25
|
+
readonly top: number;
|
|
26
|
+
readonly bottom: number;
|
|
27
|
+
readonly left: number;
|
|
28
|
+
readonly right: number;
|
|
29
|
+
readonly scrollsVertically: boolean;
|
|
30
|
+
readonly scrollsHorizontally: boolean;
|
|
31
|
+
readonly scrollBy: (dx: number, dy: number) => void;
|
|
32
|
+
}
|
|
33
|
+
export interface Layout {
|
|
34
|
+
readonly hitBoxesAt: (x: number, y: number) => readonly string[];
|
|
35
|
+
readonly scrollersAt: (x: number, y: number) => readonly Scroller[];
|
|
36
|
+
}
|
|
37
|
+
export declare const DOM_LAYOUT: Layout;
|
|
38
|
+
export declare function setLayout(layout: Layout): () => void;
|
|
39
|
+
export declare function currentLayout(): Layout;
|
|
40
|
+
export declare function claimGesture(hitBox: string): boolean;
|
|
41
|
+
export declare function releaseGesture(hitBox: string): void;
|
|
42
|
+
export declare function gestureClaim(): string | undefined;
|
|
43
|
+
export interface DropTarget {
|
|
44
|
+
readonly id: string;
|
|
45
|
+
readonly accepts?: readonly string[];
|
|
46
|
+
readonly collects?: () => Subject | readonly Subject[];
|
|
47
|
+
readonly dwell?: number;
|
|
48
|
+
readonly onDrop?: (session: DragSession) => void;
|
|
49
|
+
}
|
|
50
|
+
export declare function registerTarget(target: DropTarget): () => void;
|
|
51
|
+
export declare function targetFor(id: string): DropTarget | undefined;
|
|
52
|
+
export declare function innermostTarget(stack: readonly string[], session?: DragSession | undefined): DropTarget | undefined;
|
|
53
|
+
export interface BeginDrag {
|
|
54
|
+
readonly gesture: string;
|
|
55
|
+
readonly subject: Subject | readonly Subject[];
|
|
56
|
+
readonly from: string;
|
|
57
|
+
readonly x: number;
|
|
58
|
+
readonly y: number;
|
|
59
|
+
readonly t: number;
|
|
60
|
+
}
|
|
61
|
+
export declare function beginDrag(input: BeginDrag): DragSession;
|
|
62
|
+
export interface MoveDrag {
|
|
63
|
+
readonly x: number;
|
|
64
|
+
readonly y: number;
|
|
65
|
+
readonly over?: string;
|
|
66
|
+
readonly t: number;
|
|
67
|
+
}
|
|
68
|
+
export declare function moveDrag(input: MoveDrag): DragSession | undefined;
|
|
69
|
+
export declare function collect(more: Subject | readonly Subject[]): DragSession | undefined;
|
|
70
|
+
export declare function endDrag(): DragSession | undefined;
|
|
71
|
+
export declare function resetDrag(): void;
|
|
72
|
+
export declare function dwell(session?: DragSession | undefined): number;
|
|
73
|
+
export declare function accepted(kinds: readonly string[] | undefined, session?: DragSession | undefined): boolean;
|
|
74
|
+
export interface EdgeScrollTuning {
|
|
75
|
+
readonly band?: number;
|
|
76
|
+
readonly speed?: number;
|
|
77
|
+
}
|
|
78
|
+
export declare function edgeScroll(pointer: number, start: number, end: number, dt: number, { band, speed }?: EdgeScrollTuning): number;
|
|
79
|
+
export declare function pullEdges(x: number, y: number, dt: number, tuning?: EdgeScrollTuning, layout?: Layout): {
|
|
80
|
+
dx: number;
|
|
81
|
+
dy: number;
|
|
82
|
+
};
|
package/dist/ui/drag.js
ADDED
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
export const EDGE_SCROLL_DEFAULTS = {
|
|
2
|
+
band: 48,
|
|
3
|
+
speed: 900,
|
|
4
|
+
};
|
|
5
|
+
let SESSION;
|
|
6
|
+
export function dragSession() {
|
|
7
|
+
return SESSION;
|
|
8
|
+
}
|
|
9
|
+
const LISTENERS = new Set();
|
|
10
|
+
export function subscribeDrag(listener) {
|
|
11
|
+
LISTENERS.add(listener);
|
|
12
|
+
return () => {
|
|
13
|
+
LISTENERS.delete(listener);
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
function announce() {
|
|
17
|
+
for (const listener of LISTENERS)
|
|
18
|
+
listener();
|
|
19
|
+
}
|
|
20
|
+
export function dragStatusOf(hitBox, accepts) {
|
|
21
|
+
const session = SESSION;
|
|
22
|
+
if (session === undefined)
|
|
23
|
+
return 'idle';
|
|
24
|
+
if (session.from === hitBox)
|
|
25
|
+
return 'carrying';
|
|
26
|
+
if (session.over !== hitBox)
|
|
27
|
+
return 'elsewhere';
|
|
28
|
+
return accepted(accepts, session) ? 'over' : 'refusing';
|
|
29
|
+
}
|
|
30
|
+
export const DOM_LAYOUT = {
|
|
31
|
+
hitBoxesAt: (x, y) => {
|
|
32
|
+
if (typeof document === 'undefined' || typeof document.elementsFromPoint !== 'function')
|
|
33
|
+
return [];
|
|
34
|
+
const found = [];
|
|
35
|
+
for (const el of document.elementsFromPoint(x, y)) {
|
|
36
|
+
const id = el.getAttribute('data-hitbox');
|
|
37
|
+
if (id !== null)
|
|
38
|
+
found.push(id);
|
|
39
|
+
}
|
|
40
|
+
return found;
|
|
41
|
+
},
|
|
42
|
+
scrollersAt: (x, y) => {
|
|
43
|
+
if (typeof document === 'undefined' || typeof document.elementsFromPoint !== 'function')
|
|
44
|
+
return [];
|
|
45
|
+
const found = [];
|
|
46
|
+
for (const el of document.elementsFromPoint(x, y)) {
|
|
47
|
+
if (!(el instanceof HTMLElement))
|
|
48
|
+
continue;
|
|
49
|
+
const box = el.getBoundingClientRect();
|
|
50
|
+
found.push({
|
|
51
|
+
top: box.top,
|
|
52
|
+
bottom: box.bottom,
|
|
53
|
+
left: box.left,
|
|
54
|
+
right: box.right,
|
|
55
|
+
scrollsVertically: el.scrollHeight > el.clientHeight,
|
|
56
|
+
scrollsHorizontally: el.scrollWidth > el.clientWidth,
|
|
57
|
+
scrollBy: (dx, dy) => {
|
|
58
|
+
el.scrollLeft += dx;
|
|
59
|
+
el.scrollTop += dy;
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
return found;
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
let LAYOUT = DOM_LAYOUT;
|
|
67
|
+
export function setLayout(layout) {
|
|
68
|
+
const previous = LAYOUT;
|
|
69
|
+
LAYOUT = layout;
|
|
70
|
+
return () => {
|
|
71
|
+
LAYOUT = previous;
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
export function currentLayout() {
|
|
75
|
+
return LAYOUT;
|
|
76
|
+
}
|
|
77
|
+
let CLAIM;
|
|
78
|
+
export function claimGesture(hitBox) {
|
|
79
|
+
if (CLAIM !== undefined && CLAIM !== hitBox)
|
|
80
|
+
return false;
|
|
81
|
+
CLAIM = hitBox;
|
|
82
|
+
return true;
|
|
83
|
+
}
|
|
84
|
+
export function releaseGesture(hitBox) {
|
|
85
|
+
if (CLAIM === hitBox)
|
|
86
|
+
CLAIM = undefined;
|
|
87
|
+
}
|
|
88
|
+
export function gestureClaim() {
|
|
89
|
+
return CLAIM;
|
|
90
|
+
}
|
|
91
|
+
const TARGETS = new Map();
|
|
92
|
+
export function registerTarget(target) {
|
|
93
|
+
TARGETS.set(target.id, target);
|
|
94
|
+
return () => {
|
|
95
|
+
TARGETS.delete(target.id);
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
export function targetFor(id) {
|
|
99
|
+
return TARGETS.get(id);
|
|
100
|
+
}
|
|
101
|
+
export function innermostTarget(stack, session = SESSION) {
|
|
102
|
+
if (session === undefined)
|
|
103
|
+
return undefined;
|
|
104
|
+
for (const id of stack) {
|
|
105
|
+
const target = TARGETS.get(id);
|
|
106
|
+
if (target !== undefined && accepted(target.accepts, session))
|
|
107
|
+
return target;
|
|
108
|
+
}
|
|
109
|
+
return undefined;
|
|
110
|
+
}
|
|
111
|
+
export function beginDrag(input) {
|
|
112
|
+
if (SESSION !== undefined) {
|
|
113
|
+
throw new Error(`a drag from "${SESSION.from}" is already in progress, so "${input.from}" cannot start one. ` +
|
|
114
|
+
'Two live sessions would both receive moves and the drop would commit whichever wrote last.');
|
|
115
|
+
}
|
|
116
|
+
const subject = Array.isArray(input.subject) ? [...input.subject] : [input.subject];
|
|
117
|
+
if (subject.length === 0)
|
|
118
|
+
throw new Error('a drag carries something — beginDrag was given an empty subject');
|
|
119
|
+
SESSION = {
|
|
120
|
+
gesture: input.gesture,
|
|
121
|
+
subject,
|
|
122
|
+
from: input.from,
|
|
123
|
+
x: input.x,
|
|
124
|
+
y: input.y,
|
|
125
|
+
startedAt: input.t,
|
|
126
|
+
at: input.t,
|
|
127
|
+
overSince: input.t,
|
|
128
|
+
};
|
|
129
|
+
announce();
|
|
130
|
+
return SESSION;
|
|
131
|
+
}
|
|
132
|
+
export function moveDrag(input) {
|
|
133
|
+
if (SESSION === undefined)
|
|
134
|
+
return undefined;
|
|
135
|
+
const arrived = input.over !== SESSION.over;
|
|
136
|
+
SESSION = {
|
|
137
|
+
...SESSION,
|
|
138
|
+
x: input.x,
|
|
139
|
+
y: input.y,
|
|
140
|
+
at: input.t,
|
|
141
|
+
...(input.over === undefined ? { over: undefined } : { over: input.over }),
|
|
142
|
+
overSince: arrived ? input.t : SESSION.overSince,
|
|
143
|
+
};
|
|
144
|
+
announce();
|
|
145
|
+
return SESSION;
|
|
146
|
+
}
|
|
147
|
+
export function collect(more) {
|
|
148
|
+
if (SESSION === undefined)
|
|
149
|
+
return undefined;
|
|
150
|
+
const added = Array.isArray(more) ? more : [more];
|
|
151
|
+
const have = new Set(SESSION.subject.map((s) => `${s.kind}:${s.id}`));
|
|
152
|
+
const fresh = added.filter((s) => !have.has(`${s.kind}:${s.id}`));
|
|
153
|
+
if (fresh.length === 0)
|
|
154
|
+
return SESSION;
|
|
155
|
+
SESSION = { ...SESSION, subject: [...SESSION.subject, ...fresh] };
|
|
156
|
+
announce();
|
|
157
|
+
return SESSION;
|
|
158
|
+
}
|
|
159
|
+
export function endDrag() {
|
|
160
|
+
const finished = SESSION;
|
|
161
|
+
SESSION = undefined;
|
|
162
|
+
announce();
|
|
163
|
+
return finished;
|
|
164
|
+
}
|
|
165
|
+
export function resetDrag() {
|
|
166
|
+
SESSION = undefined;
|
|
167
|
+
CLAIM = undefined;
|
|
168
|
+
TARGETS.clear();
|
|
169
|
+
announce();
|
|
170
|
+
}
|
|
171
|
+
export function dwell(session = SESSION) {
|
|
172
|
+
if (session?.over === undefined)
|
|
173
|
+
return 0;
|
|
174
|
+
return Math.max(0, session.at - session.overSince);
|
|
175
|
+
}
|
|
176
|
+
export function accepted(kinds, session = SESSION) {
|
|
177
|
+
if (kinds === undefined || session === undefined)
|
|
178
|
+
return false;
|
|
179
|
+
return session.subject.every((s) => kinds.includes(s.kind));
|
|
180
|
+
}
|
|
181
|
+
export function edgeScroll(pointer, start, end, dt, { band = EDGE_SCROLL_DEFAULTS.band, speed = EDGE_SCROLL_DEFAULTS.speed } = {}) {
|
|
182
|
+
const extent = end - start;
|
|
183
|
+
if (extent <= 0 || speed <= 0 || band <= 0 || dt <= 0)
|
|
184
|
+
return 0;
|
|
185
|
+
const reach = Math.min(band, extent / 2);
|
|
186
|
+
const intoStart = start + reach - pointer;
|
|
187
|
+
if (intoStart > 0)
|
|
188
|
+
return -Math.min(1, intoStart / reach) * speed * dt;
|
|
189
|
+
const intoEnd = pointer - (end - reach);
|
|
190
|
+
if (intoEnd > 0)
|
|
191
|
+
return Math.min(1, intoEnd / reach) * speed * dt;
|
|
192
|
+
return 0;
|
|
193
|
+
}
|
|
194
|
+
export function pullEdges(x, y, dt, tuning = {}, layout = LAYOUT) {
|
|
195
|
+
for (const scroller of layout.scrollersAt(x, y)) {
|
|
196
|
+
if (scroller.scrollsVertically) {
|
|
197
|
+
const dy = edgeScroll(y, scroller.top, scroller.bottom, dt, tuning);
|
|
198
|
+
if (dy !== 0) {
|
|
199
|
+
scroller.scrollBy(0, dy);
|
|
200
|
+
return { dx: 0, dy };
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
if (scroller.scrollsHorizontally) {
|
|
204
|
+
const dx = edgeScroll(x, scroller.left, scroller.right, dt, tuning);
|
|
205
|
+
if (dx !== 0) {
|
|
206
|
+
scroller.scrollBy(dx, 0);
|
|
207
|
+
return { dx, dy: 0 };
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
return { dx: 0, dy: 0 };
|
|
212
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { TabItem } from '../disclosure.tsx';
|
|
2
|
+
import { type Element } from '../wrappers.tsx';
|
|
3
|
+
export interface AccordionProps {
|
|
4
|
+
readonly items: readonly TabItem[];
|
|
5
|
+
readonly initial: readonly string[];
|
|
6
|
+
readonly exclusive?: boolean;
|
|
7
|
+
readonly onChange?: (said: readonly string[]) => void;
|
|
8
|
+
readonly dispatch?: string;
|
|
9
|
+
readonly input?: Readonly<Record<string, unknown>>;
|
|
10
|
+
readonly invokeOn?: 'press' | 'shown';
|
|
11
|
+
}
|
|
12
|
+
export declare const Accordion: Element<'Accordion', AccordionProps>;
|
|
@@ -0,0 +1,16 @@
|
|
|
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 { Each } from "./each.js";
|
|
6
|
+
import { shown, section, header, region, uses } from "./accordion.works.js";
|
|
7
|
+
export const Accordion = element('Accordion', (props, className) => {
|
|
8
|
+
const kept = uses(props);
|
|
9
|
+
const surface = useSurface({ className: roleClass(undefined, className),
|
|
10
|
+
invokes: { ...(props.dispatch === undefined ? {} : { dispatch: props.dispatch }), ...(props.input === undefined ? {} : { input: props.input }), ...(props.invokeOn === undefined ? {} : { on: props.invokeOn }) },
|
|
11
|
+
holds: [
|
|
12
|
+
...(kept.holds ?? []),
|
|
13
|
+
],
|
|
14
|
+
...(kept.animates === undefined ? {} : { animates: kept.animates }), });
|
|
15
|
+
return (_jsx("div", { className: surface.className, ...surface.marks, ...surface.invokes, ...surface.a11y, ...(kept.on ?? {}), children: _jsx(Each, { rows: props.items, by: 'id', children: (each0, at) => (_jsxs("div", { ...section(props, kept, each0, at), children: [_jsx("button", { ...header(props, kept, each0, at), children: shown(props, each0, surface, kept).label }), _jsx("div", { ...region(props, kept, each0, at), children: shown(props, each0, surface, kept).inside })] })) }) }));
|
|
16
|
+
}, 'e-accordion');
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { Row } from '../charts.tsx';
|
|
3
|
+
import type { Surface } from '../door.ts';
|
|
4
|
+
import type { AccordionProps } from './accordion.tsx';
|
|
5
|
+
type Kept = {
|
|
6
|
+
readonly base: string;
|
|
7
|
+
readonly open: readonly string[];
|
|
8
|
+
readonly toggle: (id: string) => void;
|
|
9
|
+
};
|
|
10
|
+
export declare function uses(props: AccordionProps): {
|
|
11
|
+
readonly holds?: readonly string[];
|
|
12
|
+
readonly animates?: boolean;
|
|
13
|
+
readonly on?: Readonly<Record<string, unknown>>;
|
|
14
|
+
readonly base: string;
|
|
15
|
+
readonly open: readonly string[];
|
|
16
|
+
readonly toggle: (id: string) => void;
|
|
17
|
+
};
|
|
18
|
+
export declare function section(_props: AccordionProps, kept: Kept, row: Row, _at: number): Readonly<Record<string, unknown>>;
|
|
19
|
+
export declare function header(_props: AccordionProps, kept: Kept, row: Row, _at: number): Readonly<Record<string, unknown>>;
|
|
20
|
+
export declare function region(_props: AccordionProps, kept: Kept, row: Row, _at: number): Readonly<Record<string, unknown>>;
|
|
21
|
+
export declare function shown(_props: AccordionProps, row: Row, surface: Surface, _kept: unknown): Readonly<Record<string, ReactNode>>;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { useId, useState } from 'react';
|
|
2
|
+
export function uses(props) {
|
|
3
|
+
const base = useId();
|
|
4
|
+
const [open, setOpen] = useState(props.initial ?? []);
|
|
5
|
+
return {
|
|
6
|
+
base,
|
|
7
|
+
open,
|
|
8
|
+
toggle: (id) => {
|
|
9
|
+
const next = open.includes(id)
|
|
10
|
+
? open.filter((one) => one !== id)
|
|
11
|
+
: props.exclusive === true
|
|
12
|
+
? [id]
|
|
13
|
+
: [...open, id];
|
|
14
|
+
setOpen(next);
|
|
15
|
+
props.onChange?.(next);
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export function section(_props, kept, row, _at) {
|
|
20
|
+
return { 'data-open': kept.open.includes(String(row['id'])) };
|
|
21
|
+
}
|
|
22
|
+
export function header(_props, kept, row, _at) {
|
|
23
|
+
const id = String(row['id']);
|
|
24
|
+
return {
|
|
25
|
+
type: 'button',
|
|
26
|
+
id: `${kept.base}-header-${id}`,
|
|
27
|
+
'aria-controls': `${kept.base}-region-${id}`,
|
|
28
|
+
'aria-expanded': kept.open.includes(id),
|
|
29
|
+
disabled: row['disabled'] === true,
|
|
30
|
+
onClick: () => kept.toggle(id),
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export function region(_props, kept, row, _at) {
|
|
34
|
+
const id = String(row['id']);
|
|
35
|
+
return {
|
|
36
|
+
role: 'region',
|
|
37
|
+
id: `${kept.base}-region-${id}`,
|
|
38
|
+
'aria-labelledby': `${kept.base}-header-${id}`,
|
|
39
|
+
hidden: !kept.open.includes(id),
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
export function shown(_props, row, surface, _kept) {
|
|
43
|
+
return { label: surface.text(String(row['labelKey'])), inside: row['content'] };
|
|
44
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import { type Element } from '../wrappers.tsx';
|
|
3
|
+
export interface AspectRatioProps {
|
|
4
|
+
readonly children: ReactNode;
|
|
5
|
+
readonly ratio: number;
|
|
6
|
+
readonly dispatch?: string;
|
|
7
|
+
readonly input?: Readonly<Record<string, unknown>>;
|
|
8
|
+
readonly invokeOn?: 'press' | 'shown';
|
|
9
|
+
}
|
|
10
|
+
export declare const AspectRatio: Element<'AspectRatio', AspectRatioProps>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { element, useSurface } from "../wrappers.js";
|
|
4
|
+
export const AspectRatio = element('AspectRatio', (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
|
+
measures: { "ratio": String(props.ratio ?? '') }, });
|
|
8
|
+
return (_jsx("div", { className: surface.className, ...surface.marks, ...surface.invokes, ...surface.a11y, style: surface.measures, children: props.children }));
|
|
9
|
+
}, 'e-aspect-ratio');
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { MessageKey } from '../content.tsx';
|
|
2
|
+
import { type Element } from '../wrappers.tsx';
|
|
3
|
+
export interface AvatarProps {
|
|
4
|
+
readonly labelKey: MessageKey;
|
|
5
|
+
readonly src?: string;
|
|
6
|
+
readonly initials?: string;
|
|
7
|
+
readonly dispatch?: string;
|
|
8
|
+
readonly input?: Readonly<Record<string, unknown>>;
|
|
9
|
+
readonly invokeOn?: 'press' | 'shown';
|
|
10
|
+
}
|
|
11
|
+
export declare const Avatar: Element<'Avatar', AvatarProps>;
|
|
@@ -0,0 +1,10 @@
|
|
|
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 { shown } from "./avatar.works.js";
|
|
6
|
+
export const Avatar = element('Avatar', (props, className) => {
|
|
7
|
+
const surface = useSurface({ className: roleClass(undefined, className),
|
|
8
|
+
invokes: { ...(props.dispatch === undefined ? {} : { dispatch: props.dispatch }), ...(props.input === undefined ? {} : { input: props.input }), ...(props.invokeOn === undefined ? {} : { on: props.invokeOn }) }, });
|
|
9
|
+
return (_jsxs("span", { className: surface.className, ...surface.marks, ...surface.invokes, ...surface.a11y, role: "img", "aria-label": surface.text(props.labelKey), children: [props.src === undefined ? null : _jsx("img", { src: props.src, alt: "" }), _jsx("span", { children: shown(props, surface).lettering })] }));
|
|
10
|
+
}, 'e-avatar');
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export function shown(props, surface) {
|
|
2
|
+
if (props.src !== undefined)
|
|
3
|
+
return { lettering: null };
|
|
4
|
+
const said = props.initials;
|
|
5
|
+
if (said !== undefined)
|
|
6
|
+
return { lettering: said };
|
|
7
|
+
return {
|
|
8
|
+
lettering: surface
|
|
9
|
+
.text(props.labelKey)
|
|
10
|
+
.split(/\s+/)
|
|
11
|
+
.filter(Boolean)
|
|
12
|
+
.slice(0, 2)
|
|
13
|
+
.map((part) => part.charAt(0).toUpperCase())
|
|
14
|
+
.join(''),
|
|
15
|
+
};
|
|
16
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { MessageKey } from '../content.tsx';
|
|
2
|
+
import { type Element } from '../wrappers.tsx';
|
|
3
|
+
export interface BadgeProps {
|
|
4
|
+
readonly labelKey: MessageKey;
|
|
5
|
+
readonly count?: number;
|
|
6
|
+
readonly max?: number;
|
|
7
|
+
readonly dispatch?: string;
|
|
8
|
+
readonly input?: Readonly<Record<string, unknown>>;
|
|
9
|
+
readonly invokeOn?: 'press' | 'shown';
|
|
10
|
+
}
|
|
11
|
+
export declare const Badge: Element<'Badge', BadgeProps>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { roleClass } from "../fonts.js";
|
|
4
|
+
import { element, useSurface } from "../wrappers.js";
|
|
5
|
+
import { shows } from "./badge.works.js";
|
|
6
|
+
export const Badge = element('Badge', (props, className) => {
|
|
7
|
+
const surface = useSurface({ className: roleClass(undefined, className),
|
|
8
|
+
invokes: { ...(props.dispatch === undefined ? {} : { dispatch: props.dispatch }), ...(props.input === undefined ? {} : { input: props.input }), ...(props.invokeOn === undefined ? {} : { on: props.invokeOn }) }, });
|
|
9
|
+
return (_jsx("span", { className: surface.className, ...surface.marks, ...surface.invokes, ...surface.a11y, children: shows(props, surface) }));
|
|
10
|
+
}, 'e-badge');
|
|
@@ -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 BarsProps {
|
|
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 Bars: Element<'Bars', BarsProps>;
|