@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,389 @@
|
|
|
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, HelixBeforePinEvent, HelixElement, hostAria, MixinCollection, requestChange, } from '@fusion.dev/helix-core';
|
|
8
|
+
import { html, nothing } from 'lit';
|
|
9
|
+
import { property, state } from 'lit/decorators.js';
|
|
10
|
+
/**
|
|
11
|
+
* The regions a consumer fills, in the order they are rendered.
|
|
12
|
+
*
|
|
13
|
+
* Named once because two things read the list: the manual assignment that puts
|
|
14
|
+
* a child in the region its `slot` names, and the emptiness each region is
|
|
15
|
+
* hidden on. They went out of step the first time they were written twice.
|
|
16
|
+
*/
|
|
17
|
+
const REGIONS = ['header', 'actions', 'resume', 'status', 'composer'];
|
|
18
|
+
/**
|
|
19
|
+
* @summary A conversation: the turns, and where the reader is in them.
|
|
20
|
+
*
|
|
21
|
+
* @description
|
|
22
|
+
* **It has no opinion about where it sits.** A chat is asked for as a floating
|
|
23
|
+
* button, a page, a palette, a sidebar, a modal and an inline block, and none of
|
|
24
|
+
* those is a variant of a conversation: they are containers a conversation is
|
|
25
|
+
* put in, and the containers already exist. `Popover` and `SpeedDial` make the
|
|
26
|
+
* floating one, `Drawer` the sidebar, `Dialog` the modal, `Command` the palette,
|
|
27
|
+
* and a page is a page. Nothing here is positioned, nothing here has a backdrop,
|
|
28
|
+
* and nothing here owns a trigger, because a trigger opens a container and
|
|
29
|
+
* containers own their own. If a form factor needs a mode on this element, the
|
|
30
|
+
* split is wrong.
|
|
31
|
+
*
|
|
32
|
+
* **Scroll ownership is the behavior everything else depends on, and it is the
|
|
33
|
+
* most-got-wrong thing in the category.** A transcript that grows wants to stay
|
|
34
|
+
* at the bottom, except when the reader has scrolled up to read, where pinning
|
|
35
|
+
* is hostile. The rule: pin while the reader is within `threshold` of the
|
|
36
|
+
* bottom, release the moment they leave it, and offer a way back. **Never scroll
|
|
37
|
+
* a reader who is reading.**
|
|
38
|
+
*
|
|
39
|
+
* The element owns it, because it is the only party that knows a message arrived
|
|
40
|
+
* and where the viewport was when it did. `pinned` is a controlled property like
|
|
41
|
+
* any other, so a consumer who wants to own it can.
|
|
42
|
+
*
|
|
43
|
+
* **The live region announces on completion, not on arrival.** The transcript is
|
|
44
|
+
* `role="log"` with `aria-live="polite"`, and a streaming message carries
|
|
45
|
+
* `aria-busy` while it arrives: a screen reader reading a stream token by token
|
|
46
|
+
* is unusable, and holding the announcement until the flag clears is the only
|
|
47
|
+
* arrangement that works. Somebody typing is a separate status region, so it
|
|
48
|
+
* never interleaves with what was said.
|
|
49
|
+
*
|
|
50
|
+
* **Not a client.** No transport, no protocol, no model. It renders a
|
|
51
|
+
* conversation and reports what the reader did.
|
|
52
|
+
*
|
|
53
|
+
* @since 0.1.0
|
|
54
|
+
* @status experimental
|
|
55
|
+
* @category feedback
|
|
56
|
+
* @aliases Conversation, Transcript, Thread, Messages
|
|
57
|
+
* @documentation https://helix.fusion.dev/components/chat
|
|
58
|
+
*
|
|
59
|
+
* @slot - The turns, as `helix-chat-message` children.
|
|
60
|
+
* @slot actions - Beside the header: what can be done to the conversation itself.
|
|
61
|
+
* @slot composer - Below the transcript, where the reader writes.
|
|
62
|
+
* @slot header - Above the transcript: what this conversation is.
|
|
63
|
+
* @slot resume - The way back to the bottom, shown while the reader has scrolled away.
|
|
64
|
+
* @slot status - Beside the composer: somebody typing, connection lost.
|
|
65
|
+
*
|
|
66
|
+
* @event {HelixBeforePinEvent} helix-before-pin - Fired when the reader pins or unpins the transcript by scrolling. Cancelable.
|
|
67
|
+
*
|
|
68
|
+
* @csspart actions - The controls for the conversation, at the header's trailing edge.
|
|
69
|
+
* @csspart composer - The region the composer sits in.
|
|
70
|
+
* @csspart empty - Shown when the conversation has no turns.
|
|
71
|
+
* @csspart header - The region above the transcript.
|
|
72
|
+
* @csspart loading - Shown while the history is still on its way.
|
|
73
|
+
* @csspart log - The transcript, which is the thing that scrolls.
|
|
74
|
+
* @csspart resume - The affordance offered while the reader is away from the bottom.
|
|
75
|
+
* @csspart status - The status region, which is not part of the log.
|
|
76
|
+
*/
|
|
77
|
+
let HelixHeadlessChat = class HelixHeadlessChat extends MixinCollection(HelixElement) {
|
|
78
|
+
constructor() {
|
|
79
|
+
super(...arguments);
|
|
80
|
+
/**
|
|
81
|
+
* Accessible name for the conversation.
|
|
82
|
+
*/
|
|
83
|
+
this.label = '';
|
|
84
|
+
/**
|
|
85
|
+
* How near the bottom still counts as being at it, in pixels.
|
|
86
|
+
*
|
|
87
|
+
* A hook rather than a constant, because the right number depends on how tall
|
|
88
|
+
* a turn is: a transcript of one-line replies wants a smaller threshold than
|
|
89
|
+
* one of paragraphs, and a reader who has scrolled up by half a message has
|
|
90
|
+
* not left.
|
|
91
|
+
*/
|
|
92
|
+
this.threshold = 48;
|
|
93
|
+
/**
|
|
94
|
+
* Whether to open pinned, where nothing declared it.
|
|
95
|
+
*/
|
|
96
|
+
this.defaultPinned = true;
|
|
97
|
+
this.pinnedState = undefined;
|
|
98
|
+
/** Watches for turns arriving, since a manual slot hears nothing about them. */
|
|
99
|
+
this.watcher = undefined;
|
|
100
|
+
/**
|
|
101
|
+
* Which regions were given something, or undefined where nobody has counted.
|
|
102
|
+
*
|
|
103
|
+
* **A slot that is assigned by hand has no children, so no stylesheet can ask
|
|
104
|
+
* whether it was filled.** `[part="header"]:not(:has(> slot:has(*)))` is the
|
|
105
|
+
* rule every other collection here hides an empty region with, and `:has()`
|
|
106
|
+
* walks the DOM tree: with `slotAssignment: 'manual'` the assigned elements
|
|
107
|
+
* are children of this host and never of the slot, so the test was false for
|
|
108
|
+
* a filled header exactly as often as for an empty one and the rule never
|
|
109
|
+
* matched. Measured on a chat with nothing slotted at all: the header was 25
|
|
110
|
+
* pixels tall and drew its hairline under nothing, and so did the composer.
|
|
111
|
+
*
|
|
112
|
+
* Undefined rather than empty on the way in, for `MixinCollection`'s reason:
|
|
113
|
+
* the server has no children to count, and an unknown answer is not "empty".
|
|
114
|
+
* It serves every region and the first assignment on the client settles them,
|
|
115
|
+
* which is a shadow-root attribute rather than a host one and so is nothing a
|
|
116
|
+
* consumer's hydration compares.
|
|
117
|
+
*/
|
|
118
|
+
this.filled = undefined;
|
|
119
|
+
/**
|
|
120
|
+
* A press anywhere in the way back takes the reader back.
|
|
121
|
+
*
|
|
122
|
+
* **The affordance was inert, in the component and in every example.** The
|
|
123
|
+
* control is slotted so the consumer picks the words, and `resume()` was
|
|
124
|
+
* public "because the control offering it is the consumer's and needs
|
|
125
|
+
* something to call". True, and it left a button this element positions, lifts
|
|
126
|
+
* and shows and hides doing nothing at all until somebody wired it, which none
|
|
127
|
+
* of the five examples did: the one control whose whole job is to undo a
|
|
128
|
+
* scroll shipped as decoration.
|
|
129
|
+
*
|
|
130
|
+
* The region exists for exactly one purpose, so a press inside it has exactly
|
|
131
|
+
* one meaning and this element is entitled to act on it. `resume()` stays
|
|
132
|
+
* public for the other callers it was always for: a keyboard shortcut, or a
|
|
133
|
+
* consumer's own control somewhere else on the page.
|
|
134
|
+
*/
|
|
135
|
+
this.handleResume = () => {
|
|
136
|
+
this.resume();
|
|
137
|
+
};
|
|
138
|
+
this.handleSlotChange = () => {
|
|
139
|
+
this.assign();
|
|
140
|
+
this.requestUpdate();
|
|
141
|
+
};
|
|
142
|
+
/**
|
|
143
|
+
* The reader's own scrolling, which is the only thing that unpins.
|
|
144
|
+
*
|
|
145
|
+
* **Bound to the transcript in the template, and it has to be.** This was a
|
|
146
|
+
* capture listener on the host, on the reasoning that `scroll` does not bubble
|
|
147
|
+
* so the capture phase is the only phase that reaches it. Not bubbling is not
|
|
148
|
+
* the problem: `scroll` is not *composed*, and a non-composed event's
|
|
149
|
+
* propagation path stops at the shadow root and never includes the host, in
|
|
150
|
+
* any phase. So the listener never ran once, the pin never released, and a
|
|
151
|
+
* reader who scrolled up to re-read was pulled back to the bottom by the next
|
|
152
|
+
* turn to arrive, which this element's own description calls the most
|
|
153
|
+
* got-wrong thing in the category.
|
|
154
|
+
*
|
|
155
|
+
* Measured by dispatching both shapes at the transcript: with
|
|
156
|
+
* `composed: false`, which is what the platform sends, the host saw zero and
|
|
157
|
+
* `pinned` stayed true; with `composed: true` the host saw one and `pinned`
|
|
158
|
+
* went false. Bound here, the phase and the bubbling never come up.
|
|
159
|
+
*
|
|
160
|
+
* **The scroll this element does itself must not unpin it**, which is the
|
|
161
|
+
* subtle half: `scrollTop = scrollHeight` fires the same event a reader's
|
|
162
|
+
* wheel does. Reading the position rather than counting events is what makes
|
|
163
|
+
* that harmless, since after a programmatic scroll the position is the bottom
|
|
164
|
+
* and the answer is the one that was already true.
|
|
165
|
+
*/
|
|
166
|
+
this.handleScroll = () => {
|
|
167
|
+
const wanted = this.atBottom;
|
|
168
|
+
if (wanted !== this.pinned) {
|
|
169
|
+
this.requestPinned(wanted);
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Nothing is assigned by name, so the turns land in the log and the rest does not.
|
|
175
|
+
*
|
|
176
|
+
* The messages are ordinary children a consumer writes with no `slot`, and a
|
|
177
|
+
* `role="log"` whose turns are somewhere else is a log of nothing. Manual
|
|
178
|
+
* assignment is the only way to wrap them without editing the consumer's
|
|
179
|
+
* markup, which is a change a React consumer's hydration reports and does not
|
|
180
|
+
* patch up.
|
|
181
|
+
*/
|
|
182
|
+
static { this.shadowRootOptions = {
|
|
183
|
+
...HelixElement.shadowRootOptions,
|
|
184
|
+
slotAssignment: 'manual',
|
|
185
|
+
}; }
|
|
186
|
+
/**
|
|
187
|
+
* Whether the transcript follows new turns to the bottom.
|
|
188
|
+
*
|
|
189
|
+
* Set it and this element defers: the reader's scrolling fires `helix-change`
|
|
190
|
+
* and moves nothing until a new value arrives. `default-pinned` seeds a state
|
|
191
|
+
* this element then owns, and it defaults to pinned because a conversation
|
|
192
|
+
* opens at its most recent turn.
|
|
193
|
+
*
|
|
194
|
+
* **Not reflected, and the default is why.** A reflected property that
|
|
195
|
+
* defaults to true writes its attribute on upgrade whether or not the
|
|
196
|
+
* consumer wrote one, so the server serves `<helix-chat label="x">` and the
|
|
197
|
+
* client turns it into `<helix-chat label="x" pinned>`: a hydration mismatch a
|
|
198
|
+
* React consumer reports and does not patch up. Nothing needs the attribute
|
|
199
|
+
* either, because the one thing that changes with the pin is the way back, and
|
|
200
|
+
* that is a part inside the shadow tree where a stylesheet can already reach
|
|
201
|
+
* it. Measured rather than assumed: `label, pinned` after upgrade against
|
|
202
|
+
* `label` from the server.
|
|
203
|
+
*
|
|
204
|
+
*
|
|
205
|
+
*/
|
|
206
|
+
get pinned() {
|
|
207
|
+
return this.pinnedState ?? this.defaultPinned;
|
|
208
|
+
}
|
|
209
|
+
set pinned(next) {
|
|
210
|
+
const previous = this.pinned;
|
|
211
|
+
this.pinnedState = next;
|
|
212
|
+
this.requestUpdate('pinned', previous);
|
|
213
|
+
}
|
|
214
|
+
/** Whether a region has something in it, taking unknown for yes. */
|
|
215
|
+
has(name) {
|
|
216
|
+
return this.filled?.has(name) ?? true;
|
|
217
|
+
}
|
|
218
|
+
/** The turns declared as children, in the order they are written. */
|
|
219
|
+
get messages() {
|
|
220
|
+
/* `?? []` is the server: Lit's element shim carries attributes and not a
|
|
221
|
+
tree, so `children` is undefined there and spreading it throws. */
|
|
222
|
+
return [...(this.children ?? [])].filter((child) => 'isChatMessage' in child && child.isChatMessage === true);
|
|
223
|
+
}
|
|
224
|
+
/** The element that scrolls, once there is one. */
|
|
225
|
+
get log() {
|
|
226
|
+
return this.renderRoot?.querySelector?.('[part="log"]') ?? null;
|
|
227
|
+
}
|
|
228
|
+
/** Whether the reader is within `threshold` of the bottom right now. */
|
|
229
|
+
get atBottom() {
|
|
230
|
+
const log = this.log;
|
|
231
|
+
if (!log) {
|
|
232
|
+
return true;
|
|
233
|
+
}
|
|
234
|
+
return log.scrollHeight - log.scrollTop - log.clientHeight <= Math.max(0, this.threshold);
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Puts the transcript back at its most recent turn.
|
|
238
|
+
*
|
|
239
|
+
* Public because the way back is a slot, so the control offering it is the
|
|
240
|
+
* consumer's and needs something to call. Pins again on the way, which is what
|
|
241
|
+
* a reader asking to go to the bottom means.
|
|
242
|
+
*/
|
|
243
|
+
resume() {
|
|
244
|
+
const log = this.log;
|
|
245
|
+
if (log) {
|
|
246
|
+
log.scrollTop = log.scrollHeight;
|
|
247
|
+
}
|
|
248
|
+
this.requestPinned(true);
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* Asks to pin or unpin, and reports whether the request stood.
|
|
252
|
+
*
|
|
253
|
+
* Announced before it is applied, so a consumer owning the pin hears the
|
|
254
|
+
* reader's scroll and decides. `property` names it, which is what
|
|
255
|
+
* `helix-before-pin`'s detail is for: a listener switching on the name is
|
|
256
|
+
* switching on something with one meaning.
|
|
257
|
+
*/
|
|
258
|
+
requestPinned(next) {
|
|
259
|
+
if (next === this.pinned) {
|
|
260
|
+
return false;
|
|
261
|
+
}
|
|
262
|
+
return requestChange({
|
|
263
|
+
apply: (value) => {
|
|
264
|
+
const previous = this.pinned;
|
|
265
|
+
this.pinnedState = value;
|
|
266
|
+
this.requestUpdate('pinned', previous);
|
|
267
|
+
},
|
|
268
|
+
event: (value) => new HelixBeforePinEvent({ value: String(value) }),
|
|
269
|
+
host: this,
|
|
270
|
+
next,
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
assign() {
|
|
274
|
+
const root = this.renderRoot;
|
|
275
|
+
const log = root?.querySelector?.('slot[name="messages"]');
|
|
276
|
+
if (!log?.assign) {
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
const messages = this.messages;
|
|
280
|
+
log.assign(...messages);
|
|
281
|
+
const filled = new Set();
|
|
282
|
+
for (const name of REGIONS) {
|
|
283
|
+
const given = [...this.children].filter((child) => child.getAttribute('slot') === name);
|
|
284
|
+
root?.querySelector?.(`slot[name="${name}"]`)?.assign?.(...given);
|
|
285
|
+
if (given.length > 0) {
|
|
286
|
+
filled.add(name);
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
/* Compared before it is set, because this runs from `updated` and a new Set
|
|
290
|
+
every render is a new value every render, which is a render loop. */
|
|
291
|
+
const previous = this.filled;
|
|
292
|
+
if (!previous ||
|
|
293
|
+
previous.size !== filled.size ||
|
|
294
|
+
[...filled].some((name) => !previous.has(name))) {
|
|
295
|
+
this.filled = filled;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
connectedCallback() {
|
|
299
|
+
super.connectedCallback();
|
|
300
|
+
/* **A turn that arrives after first paint reaches nothing on its own.**
|
|
301
|
+
Slots are assigned by hand here, so appending a child assigns it to
|
|
302
|
+
nothing, fires no `slotchange`, and schedules no render: the transcript
|
|
303
|
+
went on showing "Nothing to show" over six children it already had, and
|
|
304
|
+
the one thing a conversation does is grow. Measured with `assignedElements()`
|
|
305
|
+
at zero against `children` at nine.
|
|
306
|
+
|
|
307
|
+
`childList` and not `subtree`, which is the difference between watching a
|
|
308
|
+
conversation and watching every token of it: a streaming turn rewrites its
|
|
309
|
+
own text on every frame, and a subtree observer would re-render the whole
|
|
310
|
+
transcript each time for a change inside a child that owns it. */
|
|
311
|
+
this.watcher = new MutationObserver(this.handleSlotChange);
|
|
312
|
+
this.watcher.observe(this, { childList: true });
|
|
313
|
+
}
|
|
314
|
+
disconnectedCallback() {
|
|
315
|
+
super.disconnectedCallback();
|
|
316
|
+
this.watcher?.disconnect();
|
|
317
|
+
this.watcher = undefined;
|
|
318
|
+
}
|
|
319
|
+
willUpdate(changed) {
|
|
320
|
+
super.willUpdate(changed);
|
|
321
|
+
hostAria(this.internals, { label: this.label || 'Conversation', role: 'region' });
|
|
322
|
+
}
|
|
323
|
+
updated(changed) {
|
|
324
|
+
super.updated(changed);
|
|
325
|
+
this.assign();
|
|
326
|
+
/* After the render that added the turn, because the scroll height it is
|
|
327
|
+
being sent to does not exist until then. */
|
|
328
|
+
if (this.pinned) {
|
|
329
|
+
const log = this.log;
|
|
330
|
+
if (log) {
|
|
331
|
+
log.scrollTop = log.scrollHeight;
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
render() {
|
|
336
|
+
const away = !this.pinned;
|
|
337
|
+
/* The header stands while either half of it is filled: a conversation with
|
|
338
|
+
no title and a single control still needs the row that control sits in. */
|
|
339
|
+
const titled = this.has('header') || this.has('actions');
|
|
340
|
+
return html `<div part="header" ?hidden=${!titled}>
|
|
341
|
+
<slot name="header"></slot>
|
|
342
|
+
<span part="actions" ?hidden=${!this.has('actions')}>
|
|
343
|
+
<slot name="actions"></slot>
|
|
344
|
+
</span>
|
|
345
|
+
</div>
|
|
346
|
+
<div
|
|
347
|
+
part="log"
|
|
348
|
+
role="log"
|
|
349
|
+
aria-live="polite"
|
|
350
|
+
aria-label=${this.label || 'Conversation'}
|
|
351
|
+
aria-busy=${this.loading ? 'true' : nothing}
|
|
352
|
+
@scroll=${this.handleScroll}
|
|
353
|
+
>
|
|
354
|
+
<slot name="messages" @slotchange=${this.handleSlotChange}></slot>
|
|
355
|
+
${this.renderStatus(this.messages.length > 0)}
|
|
356
|
+
</div>
|
|
357
|
+
<div part="resume" ?hidden=${!away || !this.has('resume')} @click=${this.handleResume}>
|
|
358
|
+
<slot name="resume"></slot>
|
|
359
|
+
</div>
|
|
360
|
+
<div part="status" role="status" ?hidden=${!this.has('status')}>
|
|
361
|
+
<slot name="status"></slot>
|
|
362
|
+
</div>
|
|
363
|
+
<div part="composer" ?hidden=${!this.has('composer')}>
|
|
364
|
+
<slot name="composer"></slot>
|
|
365
|
+
</div>`;
|
|
366
|
+
}
|
|
367
|
+
};
|
|
368
|
+
__decorate([
|
|
369
|
+
property()
|
|
370
|
+
], HelixHeadlessChat.prototype, "label", void 0);
|
|
371
|
+
__decorate([
|
|
372
|
+
property({ type: Number })
|
|
373
|
+
], HelixHeadlessChat.prototype, "threshold", void 0);
|
|
374
|
+
__decorate([
|
|
375
|
+
property({ type: Boolean })
|
|
376
|
+
], HelixHeadlessChat.prototype, "pinned", null);
|
|
377
|
+
__decorate([
|
|
378
|
+
property({ attribute: 'default-pinned', type: Boolean })
|
|
379
|
+
], HelixHeadlessChat.prototype, "defaultPinned", void 0);
|
|
380
|
+
__decorate([
|
|
381
|
+
state()
|
|
382
|
+
], HelixHeadlessChat.prototype, "pinnedState", void 0);
|
|
383
|
+
__decorate([
|
|
384
|
+
state()
|
|
385
|
+
], HelixHeadlessChat.prototype, "filled", void 0);
|
|
386
|
+
HelixHeadlessChat = __decorate([
|
|
387
|
+
customElement('helix-headless-chat')
|
|
388
|
+
], HelixHeadlessChat);
|
|
389
|
+
export { HelixHeadlessChat };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './root/checkbox-root.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './root/checkbox-root.js';
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { AriaForwardController, HelixFormElement } from '@fusion.dev/helix-core';
|
|
2
|
+
import { type PropertyValues, type TemplateResult } from 'lit';
|
|
3
|
+
declare const HelixHeadlessCheckbox_base: (new (...args: any[]) => import("@fusion.dev/helix-core").MixinControllerCheckedInterface) & (new (...args: any[]) => import("@fusion.dev/helix-core").MixinFieldInterface) & typeof HelixFormElement;
|
|
4
|
+
/**
|
|
5
|
+
* @summary A box that is ticked, or not, or neither.
|
|
6
|
+
*
|
|
7
|
+
* @description
|
|
8
|
+
* Renders a real `<input type="checkbox">`, so the space key, the focus ring,
|
|
9
|
+
* and the indeterminate glyph come from the platform. `delegatesFocus` puts
|
|
10
|
+
* focus on it, and it serializes into the server's markup, so the control is
|
|
11
|
+
* reachable before any script loads.
|
|
12
|
+
*
|
|
13
|
+
* **The input inside a shadow root submits nothing**, because the form is on
|
|
14
|
+
* the other side of the boundary. The host is form-associated instead and
|
|
15
|
+
* reports its own value through `ElementInternals`, which is also what carries
|
|
16
|
+
* validity and what answers a form reset.
|
|
17
|
+
*
|
|
18
|
+
* A checked box submits its `value`, and an unchecked one submits nothing at
|
|
19
|
+
* all. That is what a native checkbox does, and a form built around one reads
|
|
20
|
+
* the absence rather than a `false`.
|
|
21
|
+
*
|
|
22
|
+
* `indeterminate` is presentation and nothing else. It is neither checked nor
|
|
23
|
+
* unchecked to a reader, it never submits, and the first click resolves it: a
|
|
24
|
+
* third state that survives interaction is a control nobody can finish.
|
|
25
|
+
*
|
|
26
|
+
* @since 0.1.0
|
|
27
|
+
* @status experimental
|
|
28
|
+
* @category forms
|
|
29
|
+
* @aliases Tickbox, Toggle
|
|
30
|
+
* @documentation https://helix.fusion.dev/components/checkbox
|
|
31
|
+
*
|
|
32
|
+
* @slot - The label.
|
|
33
|
+
*
|
|
34
|
+
* @event {Event} change - Relayed from the input once the state has changed.
|
|
35
|
+
* @event {HelixBeforeToggleEvent} helix-before-toggle - Fired before the state changes, and cancelable.
|
|
36
|
+
* @event {Event} input - Announced once the state has moved.
|
|
37
|
+
*
|
|
38
|
+
* @csspart box - The frame the input is painted as, and the mark sits over.
|
|
39
|
+
* @csspart control - The input.
|
|
40
|
+
* @csspart feedback - What is wrong with it.
|
|
41
|
+
* @csspart field - The row the box and its label share, and the surface the card appearance draws.
|
|
42
|
+
* @csspart hint - Help under the control, while nothing is wrong.
|
|
43
|
+
* @csspart label - The label beside it.
|
|
44
|
+
* @csspart mark - The tick, or the dash when the box is indeterminate.
|
|
45
|
+
*/
|
|
46
|
+
export declare class HelixHeadlessCheckbox extends HelixHeadlessCheckbox_base {
|
|
47
|
+
protected readonly aria: AriaForwardController;
|
|
48
|
+
/**
|
|
49
|
+
* Value submitted when the box is checked.
|
|
50
|
+
*/
|
|
51
|
+
value: string;
|
|
52
|
+
/**
|
|
53
|
+
* Whether the box shows as neither checked nor unchecked.
|
|
54
|
+
*
|
|
55
|
+
* Presentation only. It never submits, and the first change resolves it.
|
|
56
|
+
*/
|
|
57
|
+
indeterminate: boolean;
|
|
58
|
+
/** Focus is delegated to the input, so the host is never the focus target. */
|
|
59
|
+
static shadowRootOptions: ShadowRootInit;
|
|
60
|
+
private readonly handleChange;
|
|
61
|
+
/** Reports the value and the validity the host stands behind. */
|
|
62
|
+
private sync;
|
|
63
|
+
/** Returns the box to the state its markup declared. */
|
|
64
|
+
formResetCallback(): void;
|
|
65
|
+
protected willUpdate(changed: PropertyValues): void;
|
|
66
|
+
protected updated(changed: PropertyValues): void;
|
|
67
|
+
/**
|
|
68
|
+
* Whether there is a label to leave room for, written to the host.
|
|
69
|
+
*
|
|
70
|
+
* The row is a flex line with a gap in it, so a label span rendered empty is
|
|
71
|
+
* still a box and still takes that gap: an unlabelled box came out with eight
|
|
72
|
+
* pixels of nothing after it. The input answers this by not rendering the
|
|
73
|
+
* element, which cannot work here, because a checkbox is named by its own
|
|
74
|
+
* content and the property is only that slot's fallback. Gating on the
|
|
75
|
+
* property would unlabel every `<helix-checkbox>Text</helix-checkbox>` ever
|
|
76
|
+
* written.
|
|
77
|
+
*
|
|
78
|
+
* So the slot is asked instead, the same way `Tooltip` asks its own: with
|
|
79
|
+
* `flatten`, because here the fallback counts, being where the property
|
|
80
|
+
* renders. Client only, so a server-rendered unlabelled checkbox carries the
|
|
81
|
+
* gap for one frame. That is a control with no accessible name, which has a
|
|
82
|
+
* worse problem than its spacing.
|
|
83
|
+
*/
|
|
84
|
+
private readonly handleLabelChange;
|
|
85
|
+
/**
|
|
86
|
+
* Asks the slot, and records the answer as a state.
|
|
87
|
+
*
|
|
88
|
+
* Called on `slotchange` and after every update, and the second is not
|
|
89
|
+
* belt-and-braces: **`slotchange` does not fire when nothing is assigned.**
|
|
90
|
+
* So a checkbox labeled only by its property, which is most of them, never
|
|
91
|
+
* heard about its own label and rendered without one. Caught by the spec that
|
|
92
|
+
* asks a labeled row to be wider than a bare one.
|
|
93
|
+
*
|
|
94
|
+
* **`:state(has-label)` and not `data-has-label`, since 27 Aug 2026.** This
|
|
95
|
+
* one could never have been in server output whatever it was called, the
|
|
96
|
+
* answer coming from `assignedNodes` and a server having no tree to ask, so
|
|
97
|
+
* it was an attribute that appeared on every labeled checkbox the instant it
|
|
98
|
+
* upgraded and on none that any server sent. See `HelixElement.toggleState`.
|
|
99
|
+
*/
|
|
100
|
+
private syncLabelPresence;
|
|
101
|
+
protected render(): TemplateResult;
|
|
102
|
+
}
|
|
103
|
+
declare global {
|
|
104
|
+
interface HTMLElementTagNameMap {
|
|
105
|
+
'helix-headless-checkbox': HelixHeadlessCheckbox;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
export {};
|