@fusion.dev/helix-headless 0.0.0-dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/custom-elements.json +75202 -0
- package/dist/accordion/index.d.ts +2 -0
- package/dist/accordion/index.js +2 -0
- package/dist/accordion/item/accordion-item.d.ts +141 -0
- package/dist/accordion/item/accordion-item.js +214 -0
- package/dist/accordion/root/accordion-root.d.ts +57 -0
- package/dist/accordion/root/accordion-root.js +96 -0
- package/dist/announcement/index.d.ts +1 -0
- package/dist/announcement/index.js +1 -0
- package/dist/announcement/root/announcement-root.d.ts +106 -0
- package/dist/announcement/root/announcement-root.js +144 -0
- package/dist/app-header/index.d.ts +1 -0
- package/dist/app-header/index.js +1 -0
- package/dist/app-header/root/app-header-root.d.ts +113 -0
- package/dist/app-header/root/app-header-root.js +147 -0
- package/dist/avatar/group/avatar-group.d.ts +116 -0
- package/dist/avatar/group/avatar-group.js +136 -0
- package/dist/avatar/index.d.ts +2 -0
- package/dist/avatar/index.js +2 -0
- package/dist/avatar/root/avatar-root.d.ts +71 -0
- package/dist/avatar/root/avatar-root.js +147 -0
- package/dist/badge/index.d.ts +1 -0
- package/dist/badge/index.js +1 -0
- package/dist/badge/root/badge-root.d.ts +61 -0
- package/dist/badge/root/badge-root.js +121 -0
- package/dist/bar-chart/index.d.ts +1 -0
- package/dist/bar-chart/index.js +1 -0
- package/dist/bar-chart/root/bar-chart-root.d.ts +266 -0
- package/dist/bar-chart/root/bar-chart-root.js +515 -0
- package/dist/blockquote/index.d.ts +1 -0
- package/dist/blockquote/index.js +1 -0
- package/dist/blockquote/root/blockquote-root.d.ts +51 -0
- package/dist/blockquote/root/blockquote-root.js +84 -0
- package/dist/breadcrumbs/breadcrumb/breadcrumb.d.ts +104 -0
- package/dist/breadcrumbs/breadcrumb/breadcrumb.js +137 -0
- package/dist/breadcrumbs/index.d.ts +2 -0
- package/dist/breadcrumbs/index.js +2 -0
- package/dist/breadcrumbs/root/breadcrumbs-root.d.ts +77 -0
- package/dist/breadcrumbs/root/breadcrumbs-root.js +94 -0
- package/dist/button/index.d.ts +1 -0
- package/dist/button/index.js +1 -0
- package/dist/button/root/button-root.d.ts +251 -0
- package/dist/button/root/button-root.js +401 -0
- package/dist/button-group/index.d.ts +1 -0
- package/dist/button-group/index.js +1 -0
- package/dist/button-group/root/button-group-root.d.ts +62 -0
- package/dist/button-group/root/button-group-root.js +62 -0
- package/dist/callout/index.d.ts +1 -0
- package/dist/callout/index.js +1 -0
- package/dist/callout/root/callout-root.d.ts +72 -0
- package/dist/callout/root/callout-root.js +90 -0
- package/dist/card/index.d.ts +1 -0
- package/dist/card/index.js +1 -0
- package/dist/card/root/card-root.d.ts +54 -0
- package/dist/card/root/card-root.js +71 -0
- package/dist/carousel/index.d.ts +1 -0
- package/dist/carousel/index.js +1 -0
- package/dist/carousel/root/carousel-root.d.ts +399 -0
- package/dist/carousel/root/carousel-root.js +723 -0
- package/dist/chat/composer/chat-composer.d.ts +160 -0
- package/dist/chat/composer/chat-composer.js +273 -0
- package/dist/chat/index.d.ts +3 -0
- package/dist/chat/index.js +3 -0
- package/dist/chat/message/chat-message.d.ts +170 -0
- package/dist/chat/message/chat-message.js +271 -0
- package/dist/chat/root/chat-root.d.ts +216 -0
- package/dist/chat/root/chat-root.js +389 -0
- package/dist/checkbox/index.d.ts +1 -0
- package/dist/checkbox/index.js +1 -0
- package/dist/checkbox/root/checkbox-root.d.ts +108 -0
- package/dist/checkbox/root/checkbox-root.js +207 -0
- package/dist/checkbox-group/index.d.ts +1 -0
- package/dist/checkbox-group/index.js +1 -0
- package/dist/checkbox-group/root/checkbox-group-root.d.ts +155 -0
- package/dist/checkbox-group/root/checkbox-group-root.js +293 -0
- package/dist/code/index.d.ts +1 -0
- package/dist/code/index.js +1 -0
- package/dist/code/root/code-root.d.ts +36 -0
- package/dist/code/root/code-root.js +43 -0
- package/dist/code-block/index.d.ts +1 -0
- package/dist/code-block/index.js +1 -0
- package/dist/code-block/root/code-block-root.d.ts +112 -0
- package/dist/code-block/root/code-block-root.js +155 -0
- package/dist/color-input/index.d.ts +1 -0
- package/dist/color-input/index.js +1 -0
- package/dist/color-input/root/color-input-root.d.ts +227 -0
- package/dist/color-input/root/color-input-root.js +456 -0
- package/dist/color-picker/color.d.ts +74 -0
- package/dist/color-picker/color.js +238 -0
- package/dist/color-picker/index.d.ts +2 -0
- package/dist/color-picker/index.js +2 -0
- package/dist/color-picker/root/color-picker-root.d.ts +303 -0
- package/dist/color-picker/root/color-picker-root.js +576 -0
- package/dist/combobox/index.d.ts +1 -0
- package/dist/combobox/index.js +1 -0
- package/dist/combobox/root/combobox-root.d.ts +396 -0
- package/dist/combobox/root/combobox-root.js +808 -0
- package/dist/command/index.d.ts +1 -0
- package/dist/command/index.js +1 -0
- package/dist/command/root/command-root.d.ts +166 -0
- package/dist/command/root/command-root.js +353 -0
- package/dist/copy-button/index.d.ts +1 -0
- package/dist/copy-button/index.js +1 -0
- package/dist/copy-button/root/copy-button-root.d.ts +154 -0
- package/dist/copy-button/root/copy-button-root.js +225 -0
- package/dist/data-table/index.d.ts +2 -0
- package/dist/data-table/index.js +2 -0
- package/dist/data-table/root/data-table-root.d.ts +392 -0
- package/dist/data-table/root/data-table-root.js +729 -0
- package/dist/data-table/root/order.d.ts +116 -0
- package/dist/data-table/root/order.js +175 -0
- package/dist/date-input/index.d.ts +1 -0
- package/dist/date-input/index.js +1 -0
- package/dist/date-input/root/date-input-root.d.ts +361 -0
- package/dist/date-input/root/date-input-root.js +791 -0
- package/dist/date-picker/index.d.ts +1 -0
- package/dist/date-picker/index.js +1 -0
- package/dist/date-picker/root/date-picker-root.d.ts +361 -0
- package/dist/date-picker/root/date-picker-root.js +837 -0
- package/dist/dialog/index.d.ts +1 -0
- package/dist/dialog/index.js +1 -0
- package/dist/dialog/root/dialog-root.d.ts +185 -0
- package/dist/dialog/root/dialog-root.js +319 -0
- package/dist/divider/index.d.ts +1 -0
- package/dist/divider/index.js +1 -0
- package/dist/divider/root/divider-root.d.ts +68 -0
- package/dist/divider/root/divider-root.js +116 -0
- package/dist/donut-chart/index.d.ts +1 -0
- package/dist/donut-chart/index.js +1 -0
- package/dist/donut-chart/root/donut-chart-root.d.ts +209 -0
- package/dist/donut-chart/root/donut-chart-root.js +395 -0
- package/dist/drawer/index.d.ts +1 -0
- package/dist/drawer/index.js +1 -0
- package/dist/drawer/root/drawer-root.d.ts +144 -0
- package/dist/drawer/root/drawer-root.js +222 -0
- package/dist/drilldown/index.d.ts +2 -0
- package/dist/drilldown/index.js +2 -0
- package/dist/drilldown/item/drilldown-item.d.ts +87 -0
- package/dist/drilldown/item/drilldown-item.js +152 -0
- package/dist/drilldown/root/drilldown-root.d.ts +115 -0
- package/dist/drilldown/root/drilldown-root.js +263 -0
- package/dist/element-events.generated.d.ts +1 -0
- package/dist/element-events.generated.js +125 -0
- package/dist/empty/index.d.ts +1 -0
- package/dist/empty/index.js +1 -0
- package/dist/empty/root/empty-root.d.ts +47 -0
- package/dist/empty/root/empty-root.js +68 -0
- package/dist/file-input/index.d.ts +1 -0
- package/dist/file-input/index.js +1 -0
- package/dist/file-input/root/file-input-root.d.ts +196 -0
- package/dist/file-input/root/file-input-root.js +488 -0
- package/dist/format-date/index.d.ts +1 -0
- package/dist/format-date/index.js +1 -0
- package/dist/format-date/root/format-date-root.d.ts +151 -0
- package/dist/format-date/root/format-date-root.js +266 -0
- package/dist/heatmap/index.d.ts +2 -0
- package/dist/heatmap/index.js +2 -0
- package/dist/heatmap/root/buckets.d.ts +62 -0
- package/dist/heatmap/root/buckets.js +85 -0
- package/dist/heatmap/root/heatmap-root.d.ts +330 -0
- package/dist/heatmap/root/heatmap-root.js +526 -0
- package/dist/icon/index.d.ts +1 -0
- package/dist/icon/index.js +1 -0
- package/dist/icon/root/icon-root.d.ts +53 -0
- package/dist/icon/root/icon-root.js +93 -0
- package/dist/icon-button/index.d.ts +1 -0
- package/dist/icon-button/index.js +1 -0
- package/dist/icon-button/root/icon-button-root.d.ts +40 -0
- package/dist/icon-button/root/icon-button-root.js +46 -0
- package/dist/image/index.d.ts +1 -0
- package/dist/image/index.js +1 -0
- package/dist/image/root/image-root.d.ts +213 -0
- package/dist/image/root/image-root.js +335 -0
- package/dist/index.d.ts +99 -0
- package/dist/index.js +99 -0
- package/dist/input/index.d.ts +1 -0
- package/dist/input/index.js +1 -0
- package/dist/input/root/input-root.d.ts +281 -0
- package/dist/input/root/input-root.js +472 -0
- package/dist/kbd/index.d.ts +1 -0
- package/dist/kbd/index.js +1 -0
- package/dist/kbd/root/kbd-root.d.ts +98 -0
- package/dist/kbd/root/kbd-root.js +230 -0
- package/dist/legend/index.d.ts +1 -0
- package/dist/legend/index.js +1 -0
- package/dist/legend/root/legend-root.d.ts +83 -0
- package/dist/legend/root/legend-root.js +125 -0
- package/dist/line-chart/index.d.ts +1 -0
- package/dist/line-chart/index.js +1 -0
- package/dist/line-chart/root/line-chart-root.d.ts +238 -0
- package/dist/line-chart/root/line-chart-root.js +365 -0
- package/dist/list/index.d.ts +2 -0
- package/dist/list/index.js +2 -0
- package/dist/list/item/list-item.d.ts +95 -0
- package/dist/list/item/list-item.js +148 -0
- package/dist/list/root/list-root.d.ts +72 -0
- package/dist/list/root/list-root.js +61 -0
- package/dist/listbox/index.d.ts +1 -0
- package/dist/listbox/index.js +1 -0
- package/dist/listbox/root/listbox-root.d.ts +357 -0
- package/dist/listbox/root/listbox-root.js +890 -0
- package/dist/loader/index.d.ts +1 -0
- package/dist/loader/index.js +1 -0
- package/dist/loader/root/loader-root.d.ts +52 -0
- package/dist/loader/root/loader-root.js +74 -0
- package/dist/megamenu/index.d.ts +1 -0
- package/dist/megamenu/index.js +1 -0
- package/dist/megamenu/root/megamenu-root.d.ts +254 -0
- package/dist/megamenu/root/megamenu-root.js +526 -0
- package/dist/menu/index.d.ts +2 -0
- package/dist/menu/index.js +2 -0
- package/dist/menu/item/menu-item.d.ts +231 -0
- package/dist/menu/item/menu-item.js +405 -0
- package/dist/menu/root/menu-root.d.ts +158 -0
- package/dist/menu/root/menu-root.js +422 -0
- package/dist/meter/index.d.ts +1 -0
- package/dist/meter/index.js +1 -0
- package/dist/meter/root/meter-root.d.ts +234 -0
- package/dist/meter/root/meter-root.js +316 -0
- package/dist/navigation/index.d.ts +1 -0
- package/dist/navigation/index.js +1 -0
- package/dist/navigation/root/navigation-root.d.ts +55 -0
- package/dist/navigation/root/navigation-root.js +130 -0
- package/dist/notifications/index.d.ts +2 -0
- package/dist/notifications/index.js +2 -0
- package/dist/notifications/notification/notification.d.ts +181 -0
- package/dist/notifications/notification/notification.js +305 -0
- package/dist/notifications/root/notifications-root.d.ts +168 -0
- package/dist/notifications/root/notifications-root.js +291 -0
- package/dist/number-input/index.d.ts +1 -0
- package/dist/number-input/index.js +1 -0
- package/dist/number-input/root/number-input-root.d.ts +282 -0
- package/dist/number-input/root/number-input-root.js +592 -0
- package/dist/option/group/option-group.d.ts +38 -0
- package/dist/option/group/option-group.js +58 -0
- package/dist/option/index.d.ts +2 -0
- package/dist/option/index.js +2 -0
- package/dist/option/root/option-root.d.ts +194 -0
- package/dist/option/root/option-root.js +247 -0
- package/dist/outline/index.d.ts +1 -0
- package/dist/outline/index.js +1 -0
- package/dist/outline/root/outline-root.d.ts +237 -0
- package/dist/outline/root/outline-root.js +519 -0
- package/dist/pagination/index.d.ts +3 -0
- package/dist/pagination/index.js +3 -0
- package/dist/pagination/root/pagination-root.d.ts +390 -0
- package/dist/pagination/root/pagination-root.js +695 -0
- package/dist/pagination/size/pagination-size.d.ts +127 -0
- package/dist/pagination/size/pagination-size.js +232 -0
- package/dist/pagination/summary/pagination-summary.d.ts +90 -0
- package/dist/pagination/summary/pagination-summary.js +145 -0
- package/dist/pin-input/index.d.ts +1 -0
- package/dist/pin-input/index.js +1 -0
- package/dist/pin-input/root/pin-input-root.d.ts +292 -0
- package/dist/pin-input/root/pin-input-root.js +553 -0
- package/dist/popover/index.d.ts +1 -0
- package/dist/popover/index.js +1 -0
- package/dist/popover/root/popover-root.d.ts +108 -0
- package/dist/popover/root/popover-root.js +231 -0
- package/dist/progress/index.d.ts +1 -0
- package/dist/progress/index.js +1 -0
- package/dist/progress/root/progress-root.d.ts +125 -0
- package/dist/progress/root/progress-root.js +212 -0
- package/dist/qr-code/index.d.ts +1 -0
- package/dist/qr-code/index.js +1 -0
- package/dist/qr-code/root/qr-code-root.d.ts +93 -0
- package/dist/qr-code/root/qr-code-root.js +233 -0
- package/dist/quote/index.d.ts +1 -0
- package/dist/quote/index.js +1 -0
- package/dist/quote/root/quote-root.d.ts +36 -0
- package/dist/quote/root/quote-root.js +50 -0
- package/dist/radio/group/radio-group.d.ts +84 -0
- package/dist/radio/group/radio-group.js +170 -0
- package/dist/radio/index.d.ts +2 -0
- package/dist/radio/index.js +2 -0
- package/dist/radio/root/radio-root.d.ts +102 -0
- package/dist/radio/root/radio-root.js +151 -0
- package/dist/rating/index.d.ts +1 -0
- package/dist/rating/index.js +1 -0
- package/dist/rating/root/rating-root.d.ts +242 -0
- package/dist/rating/root/rating-root.js +484 -0
- package/dist/scroll-area/index.d.ts +1 -0
- package/dist/scroll-area/index.js +1 -0
- package/dist/scroll-area/root/scroll-area-root.d.ts +96 -0
- package/dist/scroll-area/root/scroll-area-root.js +215 -0
- package/dist/select/index.d.ts +1 -0
- package/dist/select/index.js +1 -0
- package/dist/select/root/select-root.d.ts +170 -0
- package/dist/select/root/select-root.js +419 -0
- package/dist/skeleton/index.d.ts +1 -0
- package/dist/skeleton/index.js +1 -0
- package/dist/skeleton/root/skeleton-root.d.ts +31 -0
- package/dist/skeleton/root/skeleton-root.js +42 -0
- package/dist/slider/index.d.ts +1 -0
- package/dist/slider/index.js +1 -0
- package/dist/slider/root/slider-root.d.ts +235 -0
- package/dist/slider/root/slider-root.js +488 -0
- package/dist/sparkline/index.d.ts +1 -0
- package/dist/sparkline/index.js +1 -0
- package/dist/sparkline/root/sparkline-root.d.ts +147 -0
- package/dist/sparkline/root/sparkline-root.js +278 -0
- package/dist/speed-dial/index.d.ts +2 -0
- package/dist/speed-dial/index.js +2 -0
- package/dist/speed-dial/item/speed-dial-item.d.ts +71 -0
- package/dist/speed-dial/item/speed-dial-item.js +113 -0
- package/dist/speed-dial/root/speed-dial-root.d.ts +122 -0
- package/dist/speed-dial/root/speed-dial-root.js +251 -0
- package/dist/splitter/index.d.ts +1 -0
- package/dist/splitter/index.js +1 -0
- package/dist/splitter/root/splitter-root.d.ts +491 -0
- package/dist/splitter/root/splitter-root.js +1030 -0
- package/dist/stat/group/stat-group.d.ts +30 -0
- package/dist/stat/group/stat-group.js +47 -0
- package/dist/stat/index.d.ts +2 -0
- package/dist/stat/index.js +2 -0
- package/dist/stat/root/stat-root.d.ts +62 -0
- package/dist/stat/root/stat-root.js +51 -0
- package/dist/steps/index.d.ts +2 -0
- package/dist/steps/index.js +2 -0
- package/dist/steps/root/steps-root.d.ts +110 -0
- package/dist/steps/root/steps-root.js +130 -0
- package/dist/steps/step/step.d.ts +139 -0
- package/dist/steps/step/step.js +215 -0
- package/dist/switch/index.d.ts +1 -0
- package/dist/switch/index.js +1 -0
- package/dist/switch/root/switch-root.d.ts +74 -0
- package/dist/switch/root/switch-root.js +153 -0
- package/dist/table/cell/table-cell.d.ts +34 -0
- package/dist/table/cell/table-cell.js +52 -0
- package/dist/table/column/table-column.d.ts +165 -0
- package/dist/table/column/table-column.js +222 -0
- package/dist/table/index.d.ts +4 -0
- package/dist/table/index.js +4 -0
- package/dist/table/root/table-root.d.ts +98 -0
- package/dist/table/root/table-root.js +161 -0
- package/dist/table/row/table-row.d.ts +27 -0
- package/dist/table/row/table-row.js +42 -0
- package/dist/tabs/index.d.ts +3 -0
- package/dist/tabs/index.js +3 -0
- package/dist/tabs/panel/tab-panel.d.ts +67 -0
- package/dist/tabs/panel/tab-panel.js +98 -0
- package/dist/tabs/root/tabs-root.d.ts +123 -0
- package/dist/tabs/root/tabs-root.js +217 -0
- package/dist/tabs/tab/tab.d.ts +64 -0
- package/dist/tabs/tab/tab.js +116 -0
- package/dist/tag/index.d.ts +1 -0
- package/dist/tag/index.js +1 -0
- package/dist/tag/root/tag-root.d.ts +41 -0
- package/dist/tag/root/tag-root.js +67 -0
- package/dist/textarea/index.d.ts +1 -0
- package/dist/textarea/index.js +1 -0
- package/dist/textarea/root/textarea-root.d.ts +215 -0
- package/dist/textarea/root/textarea-root.js +380 -0
- package/dist/time-input/index.d.ts +1 -0
- package/dist/time-input/index.js +1 -0
- package/dist/time-input/root/time-input-root.d.ts +322 -0
- package/dist/time-input/root/time-input-root.js +661 -0
- package/dist/time-picker/index.d.ts +1 -0
- package/dist/time-picker/index.js +1 -0
- package/dist/time-picker/root/time-picker-root.d.ts +380 -0
- package/dist/time-picker/root/time-picker-root.js +669 -0
- package/dist/timeline/index.d.ts +2 -0
- package/dist/timeline/index.js +2 -0
- package/dist/timeline/item/timeline-item.d.ts +81 -0
- package/dist/timeline/item/timeline-item.js +128 -0
- package/dist/timeline/root/timeline-root.d.ts +52 -0
- package/dist/timeline/root/timeline-root.js +72 -0
- package/dist/toast/index.d.ts +2 -0
- package/dist/toast/index.js +2 -0
- package/dist/toast/item/toast-item.d.ts +183 -0
- package/dist/toast/item/toast-item.js +345 -0
- package/dist/toast/root/toast-root.d.ts +72 -0
- package/dist/toast/root/toast-root.js +87 -0
- package/dist/toggle/group/toggle-group.d.ts +140 -0
- package/dist/toggle/group/toggle-group.js +278 -0
- package/dist/toggle/index.d.ts +2 -0
- package/dist/toggle/index.js +2 -0
- package/dist/toggle/root/toggle-root.d.ts +99 -0
- package/dist/toggle/root/toggle-root.js +146 -0
- package/dist/toolbar/index.d.ts +1 -0
- package/dist/toolbar/index.js +1 -0
- package/dist/toolbar/root/toolbar-root.d.ts +105 -0
- package/dist/toolbar/root/toolbar-root.js +260 -0
- package/dist/tooltip/index.d.ts +1 -0
- package/dist/tooltip/index.js +1 -0
- package/dist/tooltip/root/tooltip-root.d.ts +388 -0
- package/dist/tooltip/root/tooltip-root.js +707 -0
- package/dist/tour/index.d.ts +2 -0
- package/dist/tour/index.js +2 -0
- package/dist/tour/root/tour-root.d.ts +161 -0
- package/dist/tour/root/tour-root.js +351 -0
- package/dist/tour/stop/tour-stop.d.ts +131 -0
- package/dist/tour/stop/tour-stop.js +249 -0
- package/dist/tree/index.d.ts +2 -0
- package/dist/tree/index.js +2 -0
- package/dist/tree/item/tree-item.d.ts +208 -0
- package/dist/tree/item/tree-item.js +381 -0
- package/dist/tree/root/tree-root.d.ts +88 -0
- package/dist/tree/root/tree-root.js +287 -0
- package/dist/trend/index.d.ts +1 -0
- package/dist/trend/index.js +1 -0
- package/dist/trend/root/trend-root.d.ts +67 -0
- package/dist/trend/root/trend-root.js +106 -0
- package/dist/video/index.d.ts +1 -0
- package/dist/video/index.js +1 -0
- package/dist/video/root/video-root.d.ts +711 -0
- package/dist/video/root/video-root.js +1821 -0
- package/dist/video-playlist/index.d.ts +3 -0
- package/dist/video-playlist/index.js +3 -0
- package/dist/video-playlist/item/video-playlist-item.d.ts +101 -0
- package/dist/video-playlist/item/video-playlist-item.js +162 -0
- package/dist/video-playlist/menu/video-playlist-menu.d.ts +121 -0
- package/dist/video-playlist/menu/video-playlist-menu.js +237 -0
- package/dist/video-playlist/root/video-playlist-root.d.ts +108 -0
- package/dist/video-playlist/root/video-playlist-root.js +218 -0
- package/dist/virtual-list/index.d.ts +1 -0
- package/dist/virtual-list/index.js +1 -0
- package/dist/virtual-list/root/virtual-list-root.d.ts +121 -0
- package/dist/virtual-list/root/virtual-list-root.js +221 -0
- package/jsx.d.ts +49767 -0
- package/package.json +77 -0
- package/svelte.d.ts +129 -0
- package/vue.d.ts +9242 -0
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { customElement, HelixElement } from '@fusion.dev/helix-core';
|
|
8
|
+
import { html } from 'lit';
|
|
9
|
+
import { property } from 'lit/decorators.js';
|
|
10
|
+
/** Keys the toolbar handles, per the APG toolbar pattern. */
|
|
11
|
+
const KEYS = new Set(['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown', 'Home', 'End']);
|
|
12
|
+
/**
|
|
13
|
+
* A control that owns its tab stop rather than taking one on its host.
|
|
14
|
+
*
|
|
15
|
+
* Checked as a property rather than with `instanceof`, for the same reason the
|
|
16
|
+
* control list is: a toolbar holds anything, so the contract has to be
|
|
17
|
+
* something a foreign element can satisfy.
|
|
18
|
+
*/
|
|
19
|
+
const ownsTabStop = (node) => 'focusable' in node;
|
|
20
|
+
/**
|
|
21
|
+
* Input types with no text to move a caret through and no value an arrow moves.
|
|
22
|
+
*
|
|
23
|
+
* Everything else claims the arrows for itself: a caret in a text field, a
|
|
24
|
+
* spinner on `number`, a value on `range`, a group on `radio`.
|
|
25
|
+
*/
|
|
26
|
+
const CARETLESS = new Set(['button', 'checkbox', 'color', 'file', 'image', 'reset', 'submit']);
|
|
27
|
+
/**
|
|
28
|
+
* Whether the press was already the business of whatever it landed on.
|
|
29
|
+
*
|
|
30
|
+
* A toolbar holds anything, and some of what it holds uses the arrow keys for
|
|
31
|
+
* itself. The handler below found the control the press came from and moved the
|
|
32
|
+
* toolbar regardless, so an input in a toolbar could not be edited: pressing
|
|
33
|
+
* ArrowRight to move the caret moved the focus to the next control instead, and
|
|
34
|
+
* `preventDefault` meant the caret never moved at all.
|
|
35
|
+
*
|
|
36
|
+
* `composedPath()[0]` rather than `event.target`, which is retargeted to the
|
|
37
|
+
* control's host at the shadow boundary and cannot tell a text field inside a
|
|
38
|
+
* component from the component itself.
|
|
39
|
+
*
|
|
40
|
+
* `defaultPrevented` first, because a control that has already answered the
|
|
41
|
+
* press has said so in the way the platform provides, and a foreign control
|
|
42
|
+
* this package has never heard of has no other way to say it.
|
|
43
|
+
*/
|
|
44
|
+
const claimed = (event) => {
|
|
45
|
+
if (event.defaultPrevented) {
|
|
46
|
+
return true;
|
|
47
|
+
}
|
|
48
|
+
const inner = event.composedPath()[0];
|
|
49
|
+
if (!(inner instanceof HTMLElement)) {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
if (inner.isContentEditable || inner.localName === 'textarea' || inner.localName === 'select') {
|
|
53
|
+
return true;
|
|
54
|
+
}
|
|
55
|
+
return inner.localName === 'input' && !CARETLESS.has(inner.type);
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* @summary A group of controls that share one tab stop.
|
|
59
|
+
*
|
|
60
|
+
* @description
|
|
61
|
+
* Separate from a button group, and the difference is what it holds: a group is
|
|
62
|
+
* homogeneous, a toolbar is not. A toolbar mixes buttons, toggles, and menus,
|
|
63
|
+
* which is why it is its own component rather than a variant of something.
|
|
64
|
+
*
|
|
65
|
+
* The whole toolbar is one tab stop and the arrows move between controls, so a
|
|
66
|
+
* page with three toolbars costs three presses of Tab to get past rather than
|
|
67
|
+
* thirty. Controls are found by asking the browser what is focusable rather
|
|
68
|
+
* than by matching tag names, so a toolbar works with anything put in it,
|
|
69
|
+
* including a consumer's own elements.
|
|
70
|
+
*
|
|
71
|
+
* @since 0.1.0
|
|
72
|
+
* @status stable
|
|
73
|
+
* @category layout
|
|
74
|
+
* @aliases Actions, Action bar
|
|
75
|
+
* @documentation https://helix.fusion.dev/components/toolbar
|
|
76
|
+
*
|
|
77
|
+
* @slot - The toolbar's controls.
|
|
78
|
+
*
|
|
79
|
+
* @csspart toolbar - The toolbar container.
|
|
80
|
+
*/
|
|
81
|
+
let HelixHeadlessToolbar = class HelixHeadlessToolbar extends HelixElement {
|
|
82
|
+
constructor() {
|
|
83
|
+
super(...arguments);
|
|
84
|
+
/**
|
|
85
|
+
* Accessible name for the toolbar.
|
|
86
|
+
*/
|
|
87
|
+
this.label = 'Toolbar';
|
|
88
|
+
this.handleFocusIn = (event) => {
|
|
89
|
+
const control = this.controls.find((entry) => entry.contains(event.target));
|
|
90
|
+
if (control) {
|
|
91
|
+
this.setTabStop(control);
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* Gives the tab stop back to a control that still exists.
|
|
96
|
+
*
|
|
97
|
+
* `controls` excludes anything disabled or hidden, so disabling the control
|
|
98
|
+
* holding the stop dropped it out of the list while every other control was
|
|
99
|
+
* already at `-1`. The toolbar then had no tab stop at all and the keyboard
|
|
100
|
+
* could not reach it again, from a change as ordinary as a Save button
|
|
101
|
+
* disabling itself once the form is clean.
|
|
102
|
+
*
|
|
103
|
+
* `foreign` stays false, the same as the first claim: a control this package
|
|
104
|
+
* has never heard of that was never given `tabindex="-1"` is still in the
|
|
105
|
+
* document's own tab order, so it is never the one that gets stranded.
|
|
106
|
+
*/
|
|
107
|
+
this.restoreTabStop = () => {
|
|
108
|
+
const controls = this.controls;
|
|
109
|
+
const held = controls.some((control) => ownsTabStop(control) ? control.focusable : control.tabIndex === 0);
|
|
110
|
+
if (controls.length > 0 && !held) {
|
|
111
|
+
this.setTabStop(controls[0], false);
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
this.handleKeydown = (event) => {
|
|
115
|
+
const forward = this.axis === 'horizontal' ? 'ArrowRight' : 'ArrowDown';
|
|
116
|
+
const back = this.axis === 'horizontal' ? 'ArrowLeft' : 'ArrowUp';
|
|
117
|
+
if (!KEYS.has(event.key) || claimed(event)) {
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
const controls = this.controls;
|
|
121
|
+
const current = controls.findIndex((entry) => entry.contains(event.target));
|
|
122
|
+
if (current === -1) {
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
let next = current;
|
|
126
|
+
if (event.key === forward) {
|
|
127
|
+
next = (current + 1) % controls.length;
|
|
128
|
+
}
|
|
129
|
+
else if (event.key === back) {
|
|
130
|
+
next = (current - 1 + controls.length) % controls.length;
|
|
131
|
+
}
|
|
132
|
+
else if (event.key === 'Home') {
|
|
133
|
+
next = 0;
|
|
134
|
+
}
|
|
135
|
+
else if (event.key === 'End') {
|
|
136
|
+
next = controls.length - 1;
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
// An arrow along the other axis is not ours; leave it to the page.
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
event.preventDefault();
|
|
143
|
+
const target = controls[next];
|
|
144
|
+
this.setTabStop(target);
|
|
145
|
+
target?.focus();
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Children that can take the tab stop, in document order.
|
|
150
|
+
*
|
|
151
|
+
* Every child that is not `disabled` and not `aria-hidden`, which is
|
|
152
|
+
* deliberately a test on the element rather than a list of tag names: a
|
|
153
|
+
* toolbar holds anything, including elements this package has never heard of.
|
|
154
|
+
* Client only, there being no tree to walk on the server.
|
|
155
|
+
*
|
|
156
|
+
* **It does not ask a child whether it is focusable, and the description said
|
|
157
|
+
* it did.** That would mean reading a `focusable` property off each one, which
|
|
158
|
+
* `focus` below does when moving the stop and this does not when choosing the
|
|
159
|
+
* set. The two are separable and only one of them was ever written: an element
|
|
160
|
+
* that is neither disabled nor hidden and still cannot take focus is counted
|
|
161
|
+
* here and skipped there.
|
|
162
|
+
*/
|
|
163
|
+
get controls() {
|
|
164
|
+
return [...this.children].filter((child) => {
|
|
165
|
+
if (!(child instanceof HTMLElement)) {
|
|
166
|
+
return false;
|
|
167
|
+
}
|
|
168
|
+
return !child.hasAttribute('disabled') && child.getAttribute('aria-hidden') !== 'true';
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Moves the single tab stop to one control.
|
|
173
|
+
*
|
|
174
|
+
* Prefers the control's own `focusable` property to writing `tabindex` on it.
|
|
175
|
+
* The attribute is a change to markup the consumer rendered, which a React
|
|
176
|
+
* consumer's hydration reports and does not patch up; a control that offers
|
|
177
|
+
* the property moves the stop inside its own shadow root instead.
|
|
178
|
+
*
|
|
179
|
+
* `tabindex` stays as the fallback, because a toolbar has to hold controls
|
|
180
|
+
* this package has never heard of.
|
|
181
|
+
*/
|
|
182
|
+
setTabStop(active, foreign = true) {
|
|
183
|
+
for (const control of this.controls) {
|
|
184
|
+
const stop = control === active;
|
|
185
|
+
if (ownsTabStop(control)) {
|
|
186
|
+
control.focusable = stop;
|
|
187
|
+
}
|
|
188
|
+
else if (foreign) {
|
|
189
|
+
control.tabIndex = stop ? 0 : -1;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Sets the first tab stop once every custom control has upgraded.
|
|
195
|
+
*
|
|
196
|
+
* A custom element has no properties at all before it upgrades, so a pass
|
|
197
|
+
* that ran first would find no `focusable`, take the `tabindex` fallback, and
|
|
198
|
+
* write the very attribute this exists to avoid.
|
|
199
|
+
*/
|
|
200
|
+
async claimTabStop() {
|
|
201
|
+
const pending = [...new Set(this.controls.map((control) => control.localName))].filter((name) => name.includes('-'));
|
|
202
|
+
await Promise.all(pending.map((name) => customElements.whenDefined(name)));
|
|
203
|
+
// Foreign controls are left alone until focus arrives. Writing `tabindex`
|
|
204
|
+
// on one before any interaction changes markup the consumer rendered while
|
|
205
|
+
// React is still hydrating it, which it reports and does not patch up.
|
|
206
|
+
// Until then they keep the tab order the document already gave them, and
|
|
207
|
+
// the first `focusin` takes over from there.
|
|
208
|
+
this.setTabStop(this.controls[0], false);
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* The orientation in force.
|
|
212
|
+
*
|
|
213
|
+
* Unset is horizontal, and stays unset: the default is the absent attribute,
|
|
214
|
+
* so a reflected default cannot appear on the host after hydration.
|
|
215
|
+
*/
|
|
216
|
+
get axis() {
|
|
217
|
+
return this.orientation ?? 'horizontal';
|
|
218
|
+
}
|
|
219
|
+
connectedCallback() {
|
|
220
|
+
super.connectedCallback();
|
|
221
|
+
this.addEventListener('keydown', this.handleKeydown);
|
|
222
|
+
this.addEventListener('focusin', this.handleFocusIn);
|
|
223
|
+
/* `disabled` and `aria-hidden` are what `controls` filters on, so a change
|
|
224
|
+
to either is a change to the set the stop has to live in. Nothing else is
|
|
225
|
+
watched, which also keeps `setTabStop` writing `tabindex` from feeding
|
|
226
|
+
back into this. */
|
|
227
|
+
this.watcher = new MutationObserver(this.restoreTabStop);
|
|
228
|
+
this.watcher.observe(this, {
|
|
229
|
+
attributeFilter: ['disabled', 'aria-hidden'],
|
|
230
|
+
attributes: true,
|
|
231
|
+
subtree: true,
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
disconnectedCallback() {
|
|
235
|
+
super.disconnectedCallback();
|
|
236
|
+
this.removeEventListener('keydown', this.handleKeydown);
|
|
237
|
+
this.removeEventListener('focusin', this.handleFocusIn);
|
|
238
|
+
this.watcher?.disconnect();
|
|
239
|
+
this.watcher = undefined;
|
|
240
|
+
}
|
|
241
|
+
firstUpdated(changed) {
|
|
242
|
+
super.firstUpdated(changed);
|
|
243
|
+
void this.claimTabStop();
|
|
244
|
+
}
|
|
245
|
+
render() {
|
|
246
|
+
return html `<div part="toolbar" role="toolbar" aria-label=${this.label} aria-orientation=${this.axis}>
|
|
247
|
+
<slot @slotchange=${() => this.claimTabStop()}></slot>
|
|
248
|
+
</div>`;
|
|
249
|
+
}
|
|
250
|
+
};
|
|
251
|
+
__decorate([
|
|
252
|
+
property()
|
|
253
|
+
], HelixHeadlessToolbar.prototype, "label", void 0);
|
|
254
|
+
__decorate([
|
|
255
|
+
property({ reflect: true })
|
|
256
|
+
], HelixHeadlessToolbar.prototype, "orientation", void 0);
|
|
257
|
+
HelixHeadlessToolbar = __decorate([
|
|
258
|
+
customElement('helix-headless-toolbar')
|
|
259
|
+
], HelixHeadlessToolbar);
|
|
260
|
+
export { HelixHeadlessToolbar };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './root/tooltip-root.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './root/tooltip-root.js';
|
|
@@ -0,0 +1,388 @@
|
|
|
1
|
+
import { HelixElement, type Placement } from '@fusion.dev/helix-core';
|
|
2
|
+
import { type PropertyValues, type TemplateResult } from 'lit';
|
|
3
|
+
declare const HelixHeadlessTooltip_base: (new (...args: any[]) => import("@fusion.dev/helix-core").MixinControllerOpenInterface) & typeof HelixElement;
|
|
4
|
+
/**
|
|
5
|
+
* @summary A short description that appears beside what it describes.
|
|
6
|
+
*
|
|
7
|
+
* @description
|
|
8
|
+
* The trigger is slotted and stays the consumer's own element. The bubble is
|
|
9
|
+
* rendered here, in the top layer through the popover API, so it clears any
|
|
10
|
+
* ancestor with `overflow: hidden` without a `z-index` anywhere.
|
|
11
|
+
*
|
|
12
|
+
* Position comes from `FloatingController`, which flips to another side when
|
|
13
|
+
* the preferred one does not fit and slides along it to stay in view.
|
|
14
|
+
*
|
|
15
|
+
* **Two forms, and they are not equivalent for a screen reader.**
|
|
16
|
+
*
|
|
17
|
+
* Wrapping is the convenience form and is right where the bubble decorates a
|
|
18
|
+
* control that already says what it is. The trigger stays the consumer's own
|
|
19
|
+
* element, slotted, and nothing here can describe it: an IDREF cannot cross a
|
|
20
|
+
* shadow boundary, an element reference is valid only into the same tree or a
|
|
21
|
+
* shadow-including *ancestor* (the bubble's tree is neither, it is inward), and
|
|
22
|
+
* a string on the trigger means writing to markup the consumer server-rendered.
|
|
23
|
+
* All three measured.
|
|
24
|
+
*
|
|
25
|
+
* `for` is the form that works. The tooltip sits *beside* the trigger in the
|
|
26
|
+
* consumer's own tree and names it by id, so both are in one tree and an IDREF
|
|
27
|
+
* between them is legal in the ordinary way:
|
|
28
|
+
*
|
|
29
|
+
* ```html
|
|
30
|
+
* <helix-button id="save" aria-describedby="save-tip">Save</helix-button>
|
|
31
|
+
* <helix-tooltip id="save-tip" for="save" content="Save your work"></helix-tooltip>
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* Note that the reference points at *this host*, not at the bubble inside its
|
|
35
|
+
* shadow root: the description is computed from the flat tree, which descends
|
|
36
|
+
* into shadow content on its own.
|
|
37
|
+
*
|
|
38
|
+
* **The consumer writes that `aria-describedby`, and nothing here writes it for
|
|
39
|
+
* them.** WebAwesome and Spectrum Web Components both do write it, with
|
|
40
|
+
* `setAttribute` on the trigger at runtime, which is the one thing this library
|
|
41
|
+
* declines everywhere: React rendered that element on the server without the
|
|
42
|
+
* attribute and reports a mismatch it will not patch up. Two ids in the markup
|
|
43
|
+
* is the whole cost of the version that is correct before any JavaScript runs.
|
|
44
|
+
*
|
|
45
|
+
* Because it is the consumer's line to write, it is also theirs to forget, so
|
|
46
|
+
* `for` audits itself on first open and says so once, rather than on every
|
|
47
|
+
* open, since a warning that repeats is one people learn to filter out.
|
|
48
|
+
*
|
|
49
|
+
* It shows on hover and on focus, and hides on leave, on blur, on Escape, and
|
|
50
|
+
* once the trigger has been activated: the hint is spent when the control has
|
|
51
|
+
* been used.
|
|
52
|
+
* A tooltip that answers only the pointer is one a keyboard reader never sees.
|
|
53
|
+
*
|
|
54
|
+
* The pointer waits out `delay` first, or sweeping a row of controls flashes a
|
|
55
|
+
* tooltip for each of them. Focus does not wait: a keyboard reader landing on a
|
|
56
|
+
* control has already committed to it.
|
|
57
|
+
*
|
|
58
|
+
* Open state comes from `MixinControllerOpen`, so it announces `helix-before-open` and
|
|
59
|
+
* `helix-before-close` like every other overlay here, and a consumer can drive it with
|
|
60
|
+
* `open` where they need to.
|
|
61
|
+
*
|
|
62
|
+
* @since 0.1.0
|
|
63
|
+
* @status experimental
|
|
64
|
+
* @category overlays
|
|
65
|
+
* @aliases Hint, Popup label
|
|
66
|
+
* @documentation https://helix.fusion.dev/components/tooltip
|
|
67
|
+
*
|
|
68
|
+
* @slot - The trigger.
|
|
69
|
+
* @slot content - The bubble's content, when `content` is not enough. Anything
|
|
70
|
+
* slotted here replaces the property, which is this slot's fallback.
|
|
71
|
+
*
|
|
72
|
+
* @event {HelixBeforeCloseEvent} helix-before-close - Fired before it hides, and cancelable.
|
|
73
|
+
* @event {HelixBeforeOpenEvent} helix-before-open - Fired before the bubble shows, and cancelable.
|
|
74
|
+
* @event {Event} toggle - Says the state moved, carrying `newState` and `oldState`.
|
|
75
|
+
*
|
|
76
|
+
* @csspart arrow - The point, resting against the trigger.
|
|
77
|
+
* @csspart tooltip - The bubble.
|
|
78
|
+
*/
|
|
79
|
+
export declare class HelixHeadlessTooltip extends HelixHeadlessTooltip_base {
|
|
80
|
+
/**
|
|
81
|
+
* The text shown in the bubble.
|
|
82
|
+
*
|
|
83
|
+
* The common case, and the fallback for the `content` slot: slot something
|
|
84
|
+
* there and it replaces this. Both cannot show at once, which is the point
|
|
85
|
+
* of using fallback content rather than rendering whichever is present.
|
|
86
|
+
*/
|
|
87
|
+
content: string;
|
|
88
|
+
/**
|
|
89
|
+
* The id of the element this describes, in this tooltip's own tree.
|
|
90
|
+
*
|
|
91
|
+
* Set it and the tooltip stops wrapping: it renders no trigger, listens on
|
|
92
|
+
* the element it names, and points its bubble there. Leave it unset and the
|
|
93
|
+
* default slot is the trigger, which is the older form.
|
|
94
|
+
*
|
|
95
|
+
* Resolved through `getRootNode()`, so a tooltip inside another component's
|
|
96
|
+
* shadow root names an element in that root rather than in the document.
|
|
97
|
+
*
|
|
98
|
+
* **In React this arrives as a property and not as an attribute**, which is
|
|
99
|
+
* worth knowing before someone reads the DOM and thinks it did not take.
|
|
100
|
+
* Measured against React 19.2.8: `for` exists on the prototype, so React sets
|
|
101
|
+
* `element.for = 'save'` and writes nothing to the markup, where `content`
|
|
102
|
+
* and `placement`, which are not properties on the class at that moment, come
|
|
103
|
+
* through as attributes. Both paths reach the same place through Lit, so
|
|
104
|
+
* nothing is broken by it; a `[for]` selector would find nothing, which is
|
|
105
|
+
* why this does not reflect and nothing styles on it.
|
|
106
|
+
*/
|
|
107
|
+
for: string;
|
|
108
|
+
/**
|
|
109
|
+
* Preferred side.
|
|
110
|
+
*
|
|
111
|
+
* It moves if that side does not fit.
|
|
112
|
+
*/
|
|
113
|
+
placement: Placement;
|
|
114
|
+
/**
|
|
115
|
+
* Space between the trigger and the point of the bubble, in pixels.
|
|
116
|
+
*
|
|
117
|
+
* **Measured from the point, which is what the arrow being back changed.**
|
|
118
|
+
* The arrow is drawn half outside the bubble, so a gap measured to the
|
|
119
|
+
* bubble's edge is a smaller gap to the tip: at the default it left the point
|
|
120
|
+
* two pixels off the trigger, which reads as touching. The controller is
|
|
121
|
+
* given this plus however far the arrow actually protrudes, so eight means
|
|
122
|
+
* eight from whatever is nearest, arrow or edge, and a consumer who changes
|
|
123
|
+
* it changes the visible gap rather than a number the arrow then eats into.
|
|
124
|
+
*/
|
|
125
|
+
offset: number;
|
|
126
|
+
/**
|
|
127
|
+
* The id of a box to keep the bubble inside, instead of the viewport.
|
|
128
|
+
*
|
|
129
|
+
* Resolved the way `for` is, so an id in the same tree, which is what lets a
|
|
130
|
+
* component name a box in its own shadow root. A chart does: its bubble is
|
|
131
|
+
* centered on a reading, and the first and last readings sit at the ends of
|
|
132
|
+
* the plot, so half the box hangs past the drawing and, measured on a chart
|
|
133
|
+
* in a 320px card, three pixels past the card itself.
|
|
134
|
+
*
|
|
135
|
+
* Clamping is on the cross axis only, which is what makes this safe to point
|
|
136
|
+
* at a box the bubble genuinely does not fit inside. See `within` on
|
|
137
|
+
* `FloatingController` for what happens if it is applied to the rest.
|
|
138
|
+
*/
|
|
139
|
+
within: string;
|
|
140
|
+
/**
|
|
141
|
+
* Whether the tooltip never shows.
|
|
142
|
+
*/
|
|
143
|
+
disabled: boolean;
|
|
144
|
+
/**
|
|
145
|
+
* Whether the bubble survives the trigger being used.
|
|
146
|
+
*
|
|
147
|
+
* **Activation takes a tooltip down, because a hint about what a control will
|
|
148
|
+
* do is spent once the control has done it.** That is right for a gear that
|
|
149
|
+
* opens a drawer and wrong for a control whose tooltip *becomes* the answer:
|
|
150
|
+
* `CopyButton` swaps its content from Copy to Copied on the same click, so the
|
|
151
|
+
* bubble was being hidden at the exact moment it had something to say. What a
|
|
152
|
+
* reader saw was a flash, and the confirmation the component had carefully
|
|
153
|
+
* written was never on screen long enough to read.
|
|
154
|
+
*
|
|
155
|
+
* So this is not "keep it open", it is "the hint is not spent": set it where
|
|
156
|
+
* the words change to describe what just happened, and leave it alone
|
|
157
|
+
* everywhere else. Escape, blur and pointer-leave still close it, because
|
|
158
|
+
* those are a reader saying they are done rather than a control saying it
|
|
159
|
+
* worked.
|
|
160
|
+
*/
|
|
161
|
+
persist: boolean;
|
|
162
|
+
/**
|
|
163
|
+
* How long the pointer must rest before the bubble appears, in milliseconds.
|
|
164
|
+
*
|
|
165
|
+
* Without one, sweeping across a row of controls flashes a tooltip for each
|
|
166
|
+
* of them, which is noise rather than help. Focus opens with no delay: a
|
|
167
|
+
* keyboard reader arriving on a control has already committed to it.
|
|
168
|
+
*/
|
|
169
|
+
delay: number;
|
|
170
|
+
/**
|
|
171
|
+
* How long the bubble stays after the pointer leaves, in milliseconds.
|
|
172
|
+
*/
|
|
173
|
+
delayOut: number;
|
|
174
|
+
private timer;
|
|
175
|
+
/**
|
|
176
|
+
* What is currently keeping the bubble up.
|
|
177
|
+
*
|
|
178
|
+
* The pointer and focus are two holders and they shared one timer with
|
|
179
|
+
* nothing counting them, so whichever left last won: moving the pointer off a
|
|
180
|
+
* control that still had keyboard focus scheduled a hide and took the bubble
|
|
181
|
+
* away from under the reader. The same fault the toast timer had, and the
|
|
182
|
+
* same answer.
|
|
183
|
+
*/
|
|
184
|
+
private readonly holds;
|
|
185
|
+
/**
|
|
186
|
+
* The element the bubble points at.
|
|
187
|
+
*
|
|
188
|
+
* The trigger, not the host. The host is `display: contents` so it wraps
|
|
189
|
+
* without adding a box, and an element that generates no box measures as
|
|
190
|
+
* nothing at the document origin: the bubble was placed against the corner
|
|
191
|
+
* of the viewport rather than against the button.
|
|
192
|
+
*/
|
|
193
|
+
private get trigger();
|
|
194
|
+
/**
|
|
195
|
+
* Places the bubble again, for an anchor that moved without the page moving.
|
|
196
|
+
*
|
|
197
|
+
* Public because a chart needs it. Its mark walks from reading to reading
|
|
198
|
+
* while the page holds still, and `autoUpdate` watches scrolling, resizing
|
|
199
|
+
* and layout shift, none of which is that. Everything else floating here is
|
|
200
|
+
* anchored to something the page moves, which is why nothing wanted this
|
|
201
|
+
* until a chart did.
|
|
202
|
+
*/
|
|
203
|
+
reposition(): void;
|
|
204
|
+
/**
|
|
205
|
+
* The element `for` names, or null.
|
|
206
|
+
*
|
|
207
|
+
* `getRootNode()` rather than `document`, which is what makes this work inside
|
|
208
|
+
* another component: an id is unique to a tree, and a tooltip in a shadow root
|
|
209
|
+
* names an element in that root. Client only, since the server has no tree to
|
|
210
|
+
* search.
|
|
211
|
+
*/
|
|
212
|
+
private get named();
|
|
213
|
+
private readonly bubbleLayer;
|
|
214
|
+
/**
|
|
215
|
+
* The element `within` names, or null.
|
|
216
|
+
*
|
|
217
|
+
* Same resolution as `named`, and separate from it because they answer
|
|
218
|
+
* different questions: one is what the bubble points at and the other is what
|
|
219
|
+
* it must stay inside, and a component often has one and not the other.
|
|
220
|
+
*/
|
|
221
|
+
private get enclosure();
|
|
222
|
+
private get bubble();
|
|
223
|
+
/**
|
|
224
|
+
* Whether there is anything to show.
|
|
225
|
+
*
|
|
226
|
+
* Asked of the slot rather than of the property, because either can carry
|
|
227
|
+
* the content. `assignedNodes` without `flatten` answers what the consumer
|
|
228
|
+
* provided and not what the fallback would render, which is exactly the
|
|
229
|
+
* question: a bubble with only fallback and an empty property is empty.
|
|
230
|
+
*
|
|
231
|
+
* Text or an element, because neither alone is the test. An element on its
|
|
232
|
+
* own would count `<span slot="content"> </span>` as something to say,
|
|
233
|
+
* and text on its own would count an icon as nothing, when an icon is the
|
|
234
|
+
* whole point of slotting rather than setting the property.
|
|
235
|
+
*
|
|
236
|
+
* Client only. The server has no assignment to inspect, and nothing calls
|
|
237
|
+
* this there: a tooltip opens in response to a pointer or to focus.
|
|
238
|
+
*/
|
|
239
|
+
private get hasContent();
|
|
240
|
+
/**
|
|
241
|
+
* The bubble's words as a plain string, for naming the host.
|
|
242
|
+
*
|
|
243
|
+
* The property when it is set, otherwise whatever was slotted, flattened.
|
|
244
|
+
* Rich content collapses to its text, which is the right answer for a
|
|
245
|
+
* description: `Save ⌘ S` is what a reader needs, not the markup.
|
|
246
|
+
*/
|
|
247
|
+
private get describedText();
|
|
248
|
+
/**
|
|
249
|
+
* Re-links the description when what is in the bubble changes.
|
|
250
|
+
*
|
|
251
|
+
* `updated` alone is not enough: content arriving from the light DOM changes
|
|
252
|
+
* no property here, so nothing would schedule the update that re-reads it. A
|
|
253
|
+
* consumer rendering the bubble's content after this upgrades, which is what
|
|
254
|
+
* a framework does, would leave the trigger describing nothing.
|
|
255
|
+
*/
|
|
256
|
+
private readonly handleContentChange;
|
|
257
|
+
/** Shows the bubble, unless there is nothing to show. */
|
|
258
|
+
show(): void;
|
|
259
|
+
/**
|
|
260
|
+
* Closes the bubble, and cancels a show that had not happened yet.
|
|
261
|
+
*
|
|
262
|
+
* The timer matters as much as the state: a pointer that arrives and leaves
|
|
263
|
+
* inside the delay left one queued, and the tooltip appeared over whatever
|
|
264
|
+
* the reader had moved on to.
|
|
265
|
+
*/
|
|
266
|
+
hide(): void;
|
|
267
|
+
/** Shows after the pointer has rested for `delay`. */
|
|
268
|
+
private readonly showLater;
|
|
269
|
+
/** Hides after `delayOut`, so crossing the gap to the bubble does not close it. */
|
|
270
|
+
private readonly hideLater;
|
|
271
|
+
/**
|
|
272
|
+
* Focus opens the bubble, but only the kind of focus a reader chose.
|
|
273
|
+
*
|
|
274
|
+
* **A mouse press focuses the button it pressed**, so an unconditional focus
|
|
275
|
+
* hold meant that after any click the bubble was held up by a reader who was
|
|
276
|
+
* not asking for it: moving the pointer away released the pointer hold, found
|
|
277
|
+
* a focus hold still set, and left the tooltip on screen until something else
|
|
278
|
+
* blurred the control.
|
|
279
|
+
*
|
|
280
|
+
* It never showed until `persist` arrived, because activation used to clear
|
|
281
|
+
* every hold and hide, so the click path threw the stale hold away before
|
|
282
|
+
* anyone could see it. A tooltip that survives its own activation is the first
|
|
283
|
+
* one to hold that focus long enough to matter.
|
|
284
|
+
*
|
|
285
|
+
* `:focus-visible` is the platform's own answer to "did they mean it", and a
|
|
286
|
+
* button does not match it on a mouse press. Keyboard focus still opens with no
|
|
287
|
+
* delay, which is the case this branch exists for: a reader who tabbed to a
|
|
288
|
+
* control has already committed to it. Where it does not match there is nothing
|
|
289
|
+
* to do, the pointer having opened the bubble already if a pointer is involved.
|
|
290
|
+
*/
|
|
291
|
+
private readonly showNow;
|
|
292
|
+
private readonly releaseFocus;
|
|
293
|
+
/** Hides only once nothing is holding the bubble up. */
|
|
294
|
+
private release;
|
|
295
|
+
/**
|
|
296
|
+
* Activating the trigger closes the bubble, which nothing was doing.
|
|
297
|
+
*
|
|
298
|
+
* A tooltip is a hint about what a control will do, and once the control has
|
|
299
|
+
* been used the hint is spent. Nothing else was going to take it down either:
|
|
300
|
+
* `pointerleave` cannot fire while the pointer is still on the button it just
|
|
301
|
+
* pressed, and `focusout` does not fire when activation leaves focus where it
|
|
302
|
+
* was. So a gear that opened a drawer left its own label floating over the
|
|
303
|
+
* drawer until the reader moved the mouse away.
|
|
304
|
+
*
|
|
305
|
+
* `click` rather than `pointerdown`, because it is the one event both a mouse
|
|
306
|
+
* and a keyboard produce: Enter and Space on a focused button raise it, and a
|
|
307
|
+
* hint that outlived activation for keyboard readers alone would be the same
|
|
308
|
+
* bug with a smaller audience.
|
|
309
|
+
*
|
|
310
|
+
* Holds are cleared as well as hiding, the same as Escape. Leaving them set
|
|
311
|
+
* means the pointer is still recorded as being over the trigger, so the next
|
|
312
|
+
* `focusout` anywhere releases nothing and the bubble comes back on a
|
|
313
|
+
* `release` it should have been dropped from.
|
|
314
|
+
*
|
|
315
|
+
* `persist` opts out entirely, holds included: a tooltip whose content becomes
|
|
316
|
+
* the confirmation has not spent its hint, it has changed it, and the pointer
|
|
317
|
+
* really is still over the trigger. See the property.
|
|
318
|
+
*/
|
|
319
|
+
private readonly handleActivate;
|
|
320
|
+
/**
|
|
321
|
+
* Escape closes the bubble from wherever the reader is.
|
|
322
|
+
*
|
|
323
|
+
* On the document, not on the host, which is where it was: a tooltip opened
|
|
324
|
+
* by hover has focus somewhere else entirely, so the press never reached this
|
|
325
|
+
* element and Escape worked only for the one case that needed it least. That
|
|
326
|
+
* is the case the pattern names, a reader escaping a tooltip obscuring what
|
|
327
|
+
* is under it, and it was the case that did nothing.
|
|
328
|
+
*
|
|
329
|
+
* Not stopped from propagating: a tooltip is not what the reader was trying
|
|
330
|
+
* to escape if it sits inside something else that also closes.
|
|
331
|
+
*/
|
|
332
|
+
private readonly handleKeydown;
|
|
333
|
+
/**
|
|
334
|
+
* What the pointer and focus listeners are currently on.
|
|
335
|
+
*
|
|
336
|
+
* Held, rather than recomputed at removal time, because what `for` names can
|
|
337
|
+
* change: unbinding from wherever the element is *now* leaves a live listener
|
|
338
|
+
* on wherever it was, and a tooltip that opens from a control it no longer
|
|
339
|
+
* describes is worse than one that does not open at all.
|
|
340
|
+
*/
|
|
341
|
+
private bound;
|
|
342
|
+
/**
|
|
343
|
+
* Puts the listeners on whatever the trigger is.
|
|
344
|
+
*
|
|
345
|
+
* The host when it wraps, since the trigger is inside it and both `focusin`
|
|
346
|
+
* and `focusout` bubble. The named element when `for` is set, because then the
|
|
347
|
+
* host wraps nothing and `pointerenter` does not bubble at all.
|
|
348
|
+
*
|
|
349
|
+
* Client only, and after the first render: `for` names an element that may not
|
|
350
|
+
* have upgraded, or existed, when this one connected.
|
|
351
|
+
*/
|
|
352
|
+
private bind;
|
|
353
|
+
private unbind;
|
|
354
|
+
/** Said once per element, however many times it opens. */
|
|
355
|
+
private audited;
|
|
356
|
+
/**
|
|
357
|
+
* Checks that the trigger actually points back, and says so once if not.
|
|
358
|
+
*
|
|
359
|
+
* `for` is only half a link: this element finds the trigger, and the trigger
|
|
360
|
+
* has to name this element for a screen reader to read the two together. That
|
|
361
|
+
* second half is the consumer's line to write, deliberately, because writing
|
|
362
|
+
* it from here means `setAttribute` on markup they server-rendered. So it is
|
|
363
|
+
* theirs to forget, and a silent accessibility gap is the worst kind: the
|
|
364
|
+
* tooltip looks completely correct.
|
|
365
|
+
*
|
|
366
|
+
* On first open rather than on connect, because a framework may render the
|
|
367
|
+
* attribute after this element upgrades, and because a tooltip that never
|
|
368
|
+
* opens has described nothing eitherway.
|
|
369
|
+
*
|
|
370
|
+
* Either attribute counts. WebAwesome uses `aria-labelledby` over
|
|
371
|
+
* `aria-describedby` on purpose, their reasoning being that some screen
|
|
372
|
+
* readers want the description on the focusable element itself while a label
|
|
373
|
+
* reads on first focus regardless, and that is a live enough question that
|
|
374
|
+
* this should not be the thing to settle it.
|
|
375
|
+
*/
|
|
376
|
+
private auditDescription;
|
|
377
|
+
connectedCallback(): void;
|
|
378
|
+
disconnectedCallback(): void;
|
|
379
|
+
protected firstUpdated(changed: PropertyValues): void;
|
|
380
|
+
protected updated(changed: PropertyValues): void;
|
|
381
|
+
protected render(): TemplateResult;
|
|
382
|
+
}
|
|
383
|
+
declare global {
|
|
384
|
+
interface HTMLElementTagNameMap {
|
|
385
|
+
'helix-headless-tooltip': HelixHeadlessTooltip;
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
export {};
|