@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,231 @@
|
|
|
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 { anchorElement, CommandController, customElement, deepActiveElement, HelixElement, MixinControllerOpen, PopoverController, tellDisclosure, } from '@fusion.dev/helix-core';
|
|
8
|
+
import { html } from 'lit';
|
|
9
|
+
import { property } from 'lit/decorators.js';
|
|
10
|
+
/**
|
|
11
|
+
* @summary A panel that opens against a trigger and holds anything.
|
|
12
|
+
*
|
|
13
|
+
* @description
|
|
14
|
+
* The general case the specific overlays are versions of. `Menu` holds
|
|
15
|
+
* commands, `Select` holds options, `Tooltip` holds a description; this holds
|
|
16
|
+
* whatever the consumer puts in it, which is why it has no keyboard of its own
|
|
17
|
+
* and no opinion about what is inside.
|
|
18
|
+
*
|
|
19
|
+
* **The trigger is slotted and stays the consumer's own element.** Nothing is
|
|
20
|
+
* written onto it: no `aria-expanded`, no `id`, no `tabindex`. A component that
|
|
21
|
+
* decorates a consumer's markup after upgrading is a component whose output a
|
|
22
|
+
* React consumer's hydration disagrees with, and the attribute they would care
|
|
23
|
+
* about most is the one that changes on every open.
|
|
24
|
+
*
|
|
25
|
+
* **The panel is in the top layer**, through the popover API, so it clears any
|
|
26
|
+
* ancestor with `overflow: hidden` without a `z-index` fight. `position: fixed`
|
|
27
|
+
* does not do that: it is still clipped by `overflow`, and re-anchored entirely
|
|
28
|
+
* by an ancestor carrying `transform`, `filter` or `contain`.
|
|
29
|
+
*
|
|
30
|
+
* **It opens on click, and from a command.** `command="--show"` and its
|
|
31
|
+
* siblings work here the way they do on `Dialog` and `Drawer`, so a trigger
|
|
32
|
+
* elsewhere on the page can open it without a line of script and without being
|
|
33
|
+
* slotted into it.
|
|
34
|
+
*
|
|
35
|
+
* @since 0.1.0
|
|
36
|
+
* @status stable
|
|
37
|
+
* @category overlays
|
|
38
|
+
* @aliases Popper, Flyout, Overlay
|
|
39
|
+
* @documentation https://helix.fusion.dev/components/popover
|
|
40
|
+
*
|
|
41
|
+
* @slot - The contents of the panel.
|
|
42
|
+
* @slot trigger - What opens it.
|
|
43
|
+
*
|
|
44
|
+
* @event {HelixBeforeCloseEvent} helix-before-close - Fired before it closes, and cancelable.
|
|
45
|
+
* @event {HelixBeforeOpenEvent} helix-before-open - Fired before it opens, and cancelable.
|
|
46
|
+
* @event {Event} toggle - Says the state moved, carrying `newState` and `oldState`.
|
|
47
|
+
*
|
|
48
|
+
* @csspart content - The scrolling region inside the panel.
|
|
49
|
+
* @csspart popover - The panel.
|
|
50
|
+
*/
|
|
51
|
+
let HelixHeadlessPopover = class HelixHeadlessPopover extends MixinControllerOpen(HelixElement) {
|
|
52
|
+
constructor() {
|
|
53
|
+
super(...arguments);
|
|
54
|
+
/**
|
|
55
|
+
* Accessible name for the panel.
|
|
56
|
+
*/
|
|
57
|
+
this.label = 'Popover';
|
|
58
|
+
/**
|
|
59
|
+
* Space between the trigger and the panel, in pixels.
|
|
60
|
+
*/
|
|
61
|
+
this.offset = 4;
|
|
62
|
+
/**
|
|
63
|
+
* Preferred side.
|
|
64
|
+
*
|
|
65
|
+
* It moves if that side does not fit.
|
|
66
|
+
*/
|
|
67
|
+
this.placement = 'bottom-start';
|
|
68
|
+
/* The panel, plus everything that has to happen around it: one controller
|
|
69
|
+
rather than the three this took at every call site, which is what let
|
|
70
|
+
`Select` quietly never reach the top layer at all.
|
|
71
|
+
*
|
|
72
|
+
* Called `panel` rather than `popover`, because `HTMLElement.popover` is the
|
|
73
|
+
* popover API's own IDL attribute and a field of that name shadows it with
|
|
74
|
+
* something of a different type. TypeScript objects; what it would have done
|
|
75
|
+
* at runtime is break the API this is built on. */
|
|
76
|
+
this.panel = new PopoverController(this, {
|
|
77
|
+
anchor: () => this.trigger,
|
|
78
|
+
/* The host, not the panel. `display: contents` leaves it without a box, so
|
|
79
|
+
a press on the trigger is inside the host and outside the panel, and a
|
|
80
|
+
boundary of the panel alone would close on the very press that opened
|
|
81
|
+
it. */
|
|
82
|
+
/* The host *and* whatever invoked it. An outside press is measured against
|
|
83
|
+
this, and a `--toggle` button outside the host is part of the control by
|
|
84
|
+
any reading a reader would give it: pressing it while the panel is open
|
|
85
|
+
should close it once, not close it on `pointerdown` and reopen it on the
|
|
86
|
+
`click` that follows. */
|
|
87
|
+
boundary: () => [this, this.invoker],
|
|
88
|
+
offset: () => this.offset,
|
|
89
|
+
onDismiss: () => this.hide(),
|
|
90
|
+
placement: () => this.placement,
|
|
91
|
+
surface: () => this.renderRoot?.querySelector('[part="popover"]'),
|
|
92
|
+
});
|
|
93
|
+
this.commands = new CommandController(this, {
|
|
94
|
+
commands: {
|
|
95
|
+
'--close': () => this.hide(),
|
|
96
|
+
'--show': (source) => {
|
|
97
|
+
this.invoker = source instanceof HTMLElement ? source : undefined;
|
|
98
|
+
this.show();
|
|
99
|
+
},
|
|
100
|
+
'--toggle': (source) => {
|
|
101
|
+
this.invoker = source instanceof HTMLElement ? source : undefined;
|
|
102
|
+
if (this.open) {
|
|
103
|
+
this.hide();
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
this.show();
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
});
|
|
111
|
+
this.handleTriggerClick = () => {
|
|
112
|
+
if (this.open) {
|
|
113
|
+
this.hide();
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
this.show();
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
/** The element the panel opens against. */
|
|
121
|
+
get trigger() {
|
|
122
|
+
/* The invoker first, where there is one: a command names the element the
|
|
123
|
+
reader actually pressed, and it is a better anchor than a slotted trigger
|
|
124
|
+
the consumer may not have provided at all. */
|
|
125
|
+
return (this.invoker ??
|
|
126
|
+
anchorElement(this.renderRoot?.querySelector('slot[name="trigger"]'), this));
|
|
127
|
+
}
|
|
128
|
+
/** Opens the panel. */
|
|
129
|
+
show() {
|
|
130
|
+
if (this.open || !this.requestOpen(true)) {
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
// The raising happens in `updated()`, which `requestOpen` has just
|
|
134
|
+
// scheduled: one path for both the imperative and the declarative case.
|
|
135
|
+
}
|
|
136
|
+
/** Closes the panel and puts focus back on the trigger. */
|
|
137
|
+
hide() {
|
|
138
|
+
if (!this.open || !this.requestOpen(false)) {
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
this.panel.hide();
|
|
142
|
+
/* Only when focus is inside the panel that is going away. A popover
|
|
143
|
+
dismissed by a press somewhere else has not taken focus with it, and
|
|
144
|
+
pulling focus back to the trigger would move a reader who was already
|
|
145
|
+
somewhere else on purpose. */
|
|
146
|
+
/* `deepActiveElement`, which walks into shadow roots. `document.activeElement`
|
|
147
|
+
stops at the outermost host, so a popover living inside another
|
|
148
|
+
component's shadow root never saw its own focus and never gave it back to
|
|
149
|
+
the trigger. The util exists for this. */
|
|
150
|
+
if (this.contains(deepActiveElement())) {
|
|
151
|
+
this.trigger.focus();
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
/** Tells a slotted trigger the disclosure state, by property. See `tellDisclosure`. */
|
|
155
|
+
tellTrigger() {
|
|
156
|
+
const slot = this.renderRoot?.querySelector('slot[name="trigger"]');
|
|
157
|
+
tellDisclosure(slot?.assignedElements({ flatten: false })[0], this.open);
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Puts the panel where `open` says it should be, however it got there.
|
|
161
|
+
*
|
|
162
|
+
* `show()` and `hide()` raised and lowered it, and nothing else did, so a
|
|
163
|
+
* panel opened by *declaring* `open` (or `default-open`, or a consumer
|
|
164
|
+
* assigning the property) rendered visible and was never in the top layer and
|
|
165
|
+
* never anchored. Every imperative path worked and every declarative one was
|
|
166
|
+
* quietly half-open: clipped by the first ancestor with `overflow`, and
|
|
167
|
+
* positioned wherever normal flow left it.
|
|
168
|
+
*
|
|
169
|
+
* Driving the controller from the resolved state rather than from the two
|
|
170
|
+
* methods is what makes the two paths the same path. The controller ignores a
|
|
171
|
+
* `show()` on something already raised, so this costs nothing when the
|
|
172
|
+
* methods did the work.
|
|
173
|
+
*/
|
|
174
|
+
updated(changed) {
|
|
175
|
+
super.updated(changed);
|
|
176
|
+
/* Every update, not only the ones that move `open`: a trigger slotted after
|
|
177
|
+
the first render has to be told too, and a slot change is not a property
|
|
178
|
+
change. Idempotent, so saying it twice costs an assignment Lit compares
|
|
179
|
+
and discards. */
|
|
180
|
+
this.tellTrigger();
|
|
181
|
+
if (!changed.has('open')) {
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
/* Raised here rather than a microtask later, and `updated()` is what makes
|
|
185
|
+
that safe: the render has already been written, so the panel is no longer
|
|
186
|
+
`display: none` and `showPopover` will not throw on it. The old
|
|
187
|
+
`show()` deferred to `updateComplete` precisely because it ran *before*
|
|
188
|
+
the render; from here there is nothing left to wait for. */
|
|
189
|
+
if (this.open) {
|
|
190
|
+
this.panel.show();
|
|
191
|
+
}
|
|
192
|
+
else {
|
|
193
|
+
this.panel.hide();
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
willUpdate(changed) {
|
|
197
|
+
super.willUpdate(changed);
|
|
198
|
+
/* The name is the panel's, not the host's.
|
|
199
|
+
*
|
|
200
|
+
* `label` is documented as the panel's accessible name and was written to
|
|
201
|
+
* the host's internals, and the host carries no role at all: the name
|
|
202
|
+
* landed on a generic element while the panel it names rendered with none.
|
|
203
|
+
* A `dialog` role goes with it, because a name needs something to be the
|
|
204
|
+
* name of, and that is what a popover is. */
|
|
205
|
+
}
|
|
206
|
+
render() {
|
|
207
|
+
return html `<slot name="trigger" @click=${this.handleTriggerClick}></slot>
|
|
208
|
+
<div
|
|
209
|
+
part="popover"
|
|
210
|
+
popover="manual"
|
|
211
|
+
role="dialog"
|
|
212
|
+
aria-label=${this.label}
|
|
213
|
+
?hidden=${!this.open}
|
|
214
|
+
>
|
|
215
|
+
<div part="content"><slot></slot></div>
|
|
216
|
+
</div>`;
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
__decorate([
|
|
220
|
+
property()
|
|
221
|
+
], HelixHeadlessPopover.prototype, "label", void 0);
|
|
222
|
+
__decorate([
|
|
223
|
+
property({ type: Number })
|
|
224
|
+
], HelixHeadlessPopover.prototype, "offset", void 0);
|
|
225
|
+
__decorate([
|
|
226
|
+
property()
|
|
227
|
+
], HelixHeadlessPopover.prototype, "placement", void 0);
|
|
228
|
+
HelixHeadlessPopover = __decorate([
|
|
229
|
+
customElement('helix-headless-popover')
|
|
230
|
+
], HelixHeadlessPopover);
|
|
231
|
+
export { HelixHeadlessPopover };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './root/progress-root.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './root/progress-root.js';
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { HelixElement } from '@fusion.dev/helix-core';
|
|
2
|
+
import { type PropertyValues, type TemplateResult } from 'lit';
|
|
3
|
+
/**
|
|
4
|
+
* @summary Shows how far along a task is, when that is known.
|
|
5
|
+
*
|
|
6
|
+
* @description
|
|
7
|
+
* Determinate by default, and `indeterminate` for a task whose total is not
|
|
8
|
+
* known yet. `Loader` is still the right answer where the wait is short or has
|
|
9
|
+
* no place of its own on the page; a bar earns its width where the work is the
|
|
10
|
+
* subject of the region it sits in.
|
|
11
|
+
*
|
|
12
|
+
* A bar that fills at a made-up rate would be a bar that lies, so the
|
|
13
|
+
* indeterminate one does not fill: it runs a segment across the track, which
|
|
14
|
+
* says work is happening and claims no proportion at all. `aria-valuenow` is
|
|
15
|
+
* omitted with it, which is the platform's own signal for the same thing.
|
|
16
|
+
*
|
|
17
|
+
* **The fill is a percentage of the track, written as a custom property.** It
|
|
18
|
+
* is derived from `value` and `max` rather than measured, so it renders on a
|
|
19
|
+
* server with no layout and needs nothing after upgrade. That is what keeps it
|
|
20
|
+
* out of the class of geometry this library writes only on the client.
|
|
21
|
+
*
|
|
22
|
+
* **`value` is clamped, and out-of-range input is not an error.** A count that
|
|
23
|
+
* runs past its own total is ordinary in real applications, and a bar that
|
|
24
|
+
* overflows its track or reports `aria-valuenow` above `aria-valuemax` is worse
|
|
25
|
+
* than one that reads as finished.
|
|
26
|
+
*
|
|
27
|
+
* Semantics are on the host through `ElementInternals`, the same as everywhere
|
|
28
|
+
* else: a `role` in the shadow root announces correctly and leaves the host
|
|
29
|
+
* anonymous to anything walking the light DOM, and a `role` written onto the
|
|
30
|
+
* host as an attribute is one a server's markup never had.
|
|
31
|
+
*
|
|
32
|
+
* The properties below are written by this component and read by whoever draws
|
|
33
|
+
* it. A consumer sets none of them: they carry a number this element computed
|
|
34
|
+
* and CSS cannot, which is what lets a stylesheet on this tier draw the thing
|
|
35
|
+
* without measuring anything itself.
|
|
36
|
+
*
|
|
37
|
+
* @since 0.1.0
|
|
38
|
+
* @status stable
|
|
39
|
+
* @category feedback
|
|
40
|
+
* @aliases Progress bar, Loading bar
|
|
41
|
+
* @documentation https://helix.fusion.dev/components/progress
|
|
42
|
+
*
|
|
43
|
+
* @csspart groove - The unfilled circle, under the ring's own sweep.
|
|
44
|
+
* @csspart indicator - The part of it that is done.
|
|
45
|
+
* @csspart track - The full length the work is measured against.
|
|
46
|
+
* @csspart value - The reading beside the bar, under `show-value`.
|
|
47
|
+
*
|
|
48
|
+
* @cssproperty --progress-fraction - The value as a fraction of the range, 0 to 1. Absent while indeterminate.
|
|
49
|
+
*/
|
|
50
|
+
export declare class HelixHeadlessProgress extends HelixElement {
|
|
51
|
+
/**
|
|
52
|
+
* Accessible name for what is in progress.
|
|
53
|
+
*/
|
|
54
|
+
label: string;
|
|
55
|
+
/**
|
|
56
|
+
* Whether the work has a knowable end.
|
|
57
|
+
*
|
|
58
|
+
* On the headless tier rather than as a treatment, because it is
|
|
59
|
+
* semantics before it is a picture: a progressbar with no `aria-valuenow` is
|
|
60
|
+
* how the platform says "running, and nobody knows how far", and a reader on
|
|
61
|
+
* a screen reader is told that rather than being read a number that means
|
|
62
|
+
* nothing. `value` and `max` are ignored while it is set.
|
|
63
|
+
*
|
|
64
|
+
* Not `Loader`, which is the other thing this could be. A loader says the
|
|
65
|
+
* page is busy; a bar says a named piece of work is running, and keeps its
|
|
66
|
+
* place in the layout when the answer arrives and it becomes determinate.
|
|
67
|
+
*/
|
|
68
|
+
indeterminate: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* The total the work is measured against.
|
|
71
|
+
*/
|
|
72
|
+
max: number;
|
|
73
|
+
/**
|
|
74
|
+
* Whether the value is drawn as a bar or as a ring.
|
|
75
|
+
*
|
|
76
|
+
* **On this tier because it changes the markup**, which is the headless tier's to
|
|
77
|
+
* own. A bar is two boxes and a ring is an SVG with two circles in it, and no
|
|
78
|
+
* stylesheet turns one into the other: the styled tier tried, with a conic
|
|
79
|
+
* gradient and a mask, and the thing it could not do was the round end the
|
|
80
|
+
* loader has, because a gradient has hard radial edges and no notion of a
|
|
81
|
+
* cap. `Skeleton.shape` is the same word for the same kind of decision.
|
|
82
|
+
*
|
|
83
|
+
* The value, the ARIA and the form participation are untouched by it. What
|
|
84
|
+
* changes is only which shape carries the fraction.
|
|
85
|
+
*/
|
|
86
|
+
shape?: 'ring';
|
|
87
|
+
/**
|
|
88
|
+
* Whether the reading is shown beside the bar.
|
|
89
|
+
*
|
|
90
|
+
* The same name and shape `Slider` uses, because it is the same question:
|
|
91
|
+
* a control that holds a number can either show it or leave it to whatever is
|
|
92
|
+
* around it. Off by default, since most bars sit under a label that already
|
|
93
|
+
* says what is happening and a second number is noise.
|
|
94
|
+
*
|
|
95
|
+
* Nothing under `indeterminate`, where there is no reading to show: a percent
|
|
96
|
+
* that does not move is worse than none, and `valueText` is the property for
|
|
97
|
+
* saying "uploading" while the bar runs.
|
|
98
|
+
*/
|
|
99
|
+
showValue: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* What has been done so far, in the same units as `max`.
|
|
102
|
+
*
|
|
103
|
+
* Clamped between zero and `max` for both the fill and the announcement, so
|
|
104
|
+
* the two can never disagree about what is on screen.
|
|
105
|
+
*/
|
|
106
|
+
value: number;
|
|
107
|
+
/**
|
|
108
|
+
* A reading for the value, where the number alone does not say enough.
|
|
109
|
+
*
|
|
110
|
+
* "3 of 8 files" rather than "37". Announced instead of the percentage, and
|
|
111
|
+
* never instead of the value itself: `aria-valuenow` still carries the
|
|
112
|
+
* number, because assistive technology that ignores the text still has to
|
|
113
|
+
* report progress.
|
|
114
|
+
*/
|
|
115
|
+
valueText: string;
|
|
116
|
+
/** What is done, as a fraction of the whole, between 0 and 1. */
|
|
117
|
+
get fraction(): number;
|
|
118
|
+
protected willUpdate(changed: PropertyValues): void;
|
|
119
|
+
protected render(): TemplateResult;
|
|
120
|
+
}
|
|
121
|
+
declare global {
|
|
122
|
+
interface HTMLElementTagNameMap {
|
|
123
|
+
'helix-headless-progress': HelixHeadlessProgress;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
@@ -0,0 +1,212 @@
|
|
|
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, hostAria } from '@fusion.dev/helix-core';
|
|
8
|
+
import { html } from 'lit';
|
|
9
|
+
import { property } from 'lit/decorators.js';
|
|
10
|
+
/**
|
|
11
|
+
* @summary Shows how far along a task is, when that is known.
|
|
12
|
+
*
|
|
13
|
+
* @description
|
|
14
|
+
* Determinate by default, and `indeterminate` for a task whose total is not
|
|
15
|
+
* known yet. `Loader` is still the right answer where the wait is short or has
|
|
16
|
+
* no place of its own on the page; a bar earns its width where the work is the
|
|
17
|
+
* subject of the region it sits in.
|
|
18
|
+
*
|
|
19
|
+
* A bar that fills at a made-up rate would be a bar that lies, so the
|
|
20
|
+
* indeterminate one does not fill: it runs a segment across the track, which
|
|
21
|
+
* says work is happening and claims no proportion at all. `aria-valuenow` is
|
|
22
|
+
* omitted with it, which is the platform's own signal for the same thing.
|
|
23
|
+
*
|
|
24
|
+
* **The fill is a percentage of the track, written as a custom property.** It
|
|
25
|
+
* is derived from `value` and `max` rather than measured, so it renders on a
|
|
26
|
+
* server with no layout and needs nothing after upgrade. That is what keeps it
|
|
27
|
+
* out of the class of geometry this library writes only on the client.
|
|
28
|
+
*
|
|
29
|
+
* **`value` is clamped, and out-of-range input is not an error.** A count that
|
|
30
|
+
* runs past its own total is ordinary in real applications, and a bar that
|
|
31
|
+
* overflows its track or reports `aria-valuenow` above `aria-valuemax` is worse
|
|
32
|
+
* than one that reads as finished.
|
|
33
|
+
*
|
|
34
|
+
* Semantics are on the host through `ElementInternals`, the same as everywhere
|
|
35
|
+
* else: a `role` in the shadow root announces correctly and leaves the host
|
|
36
|
+
* anonymous to anything walking the light DOM, and a `role` written onto the
|
|
37
|
+
* host as an attribute is one a server's markup never had.
|
|
38
|
+
*
|
|
39
|
+
* The properties below are written by this component and read by whoever draws
|
|
40
|
+
* it. A consumer sets none of them: they carry a number this element computed
|
|
41
|
+
* and CSS cannot, which is what lets a stylesheet on this tier draw the thing
|
|
42
|
+
* without measuring anything itself.
|
|
43
|
+
*
|
|
44
|
+
* @since 0.1.0
|
|
45
|
+
* @status stable
|
|
46
|
+
* @category feedback
|
|
47
|
+
* @aliases Progress bar, Loading bar
|
|
48
|
+
* @documentation https://helix.fusion.dev/components/progress
|
|
49
|
+
*
|
|
50
|
+
* @csspart groove - The unfilled circle, under the ring's own sweep.
|
|
51
|
+
* @csspart indicator - The part of it that is done.
|
|
52
|
+
* @csspart track - The full length the work is measured against.
|
|
53
|
+
* @csspart value - The reading beside the bar, under `show-value`.
|
|
54
|
+
*
|
|
55
|
+
* @cssproperty --progress-fraction - The value as a fraction of the range, 0 to 1. Absent while indeterminate.
|
|
56
|
+
*/
|
|
57
|
+
let HelixHeadlessProgress = class HelixHeadlessProgress extends HelixElement {
|
|
58
|
+
constructor() {
|
|
59
|
+
super(...arguments);
|
|
60
|
+
/**
|
|
61
|
+
* Accessible name for what is in progress.
|
|
62
|
+
*/
|
|
63
|
+
this.label = 'Progress';
|
|
64
|
+
/**
|
|
65
|
+
* Whether the work has a knowable end.
|
|
66
|
+
*
|
|
67
|
+
* On the headless tier rather than as a treatment, because it is
|
|
68
|
+
* semantics before it is a picture: a progressbar with no `aria-valuenow` is
|
|
69
|
+
* how the platform says "running, and nobody knows how far", and a reader on
|
|
70
|
+
* a screen reader is told that rather than being read a number that means
|
|
71
|
+
* nothing. `value` and `max` are ignored while it is set.
|
|
72
|
+
*
|
|
73
|
+
* Not `Loader`, which is the other thing this could be. A loader says the
|
|
74
|
+
* page is busy; a bar says a named piece of work is running, and keeps its
|
|
75
|
+
* place in the layout when the answer arrives and it becomes determinate.
|
|
76
|
+
*/
|
|
77
|
+
this.indeterminate = false;
|
|
78
|
+
/**
|
|
79
|
+
* The total the work is measured against.
|
|
80
|
+
*/
|
|
81
|
+
this.max = 100;
|
|
82
|
+
/**
|
|
83
|
+
* Whether the reading is shown beside the bar.
|
|
84
|
+
*
|
|
85
|
+
* The same name and shape `Slider` uses, because it is the same question:
|
|
86
|
+
* a control that holds a number can either show it or leave it to whatever is
|
|
87
|
+
* around it. Off by default, since most bars sit under a label that already
|
|
88
|
+
* says what is happening and a second number is noise.
|
|
89
|
+
*
|
|
90
|
+
* Nothing under `indeterminate`, where there is no reading to show: a percent
|
|
91
|
+
* that does not move is worse than none, and `valueText` is the property for
|
|
92
|
+
* saying "uploading" while the bar runs.
|
|
93
|
+
*/
|
|
94
|
+
this.showValue = false;
|
|
95
|
+
/**
|
|
96
|
+
* What has been done so far, in the same units as `max`.
|
|
97
|
+
*
|
|
98
|
+
* Clamped between zero and `max` for both the fill and the announcement, so
|
|
99
|
+
* the two can never disagree about what is on screen.
|
|
100
|
+
*/
|
|
101
|
+
this.value = 0;
|
|
102
|
+
/**
|
|
103
|
+
* A reading for the value, where the number alone does not say enough.
|
|
104
|
+
*
|
|
105
|
+
* "3 of 8 files" rather than "37". Announced instead of the percentage, and
|
|
106
|
+
* never instead of the value itself: `aria-valuenow` still carries the
|
|
107
|
+
* number, because assistive technology that ignores the text still has to
|
|
108
|
+
* report progress.
|
|
109
|
+
*/
|
|
110
|
+
this.valueText = '';
|
|
111
|
+
}
|
|
112
|
+
/** What is done, as a fraction of the whole, between 0 and 1. */
|
|
113
|
+
get fraction() {
|
|
114
|
+
const max = this.max > 0 ? this.max : 100;
|
|
115
|
+
/* `|| 0` catches the value that is not a number.
|
|
116
|
+
*
|
|
117
|
+
* `undefined / 100` is `NaN`, `Math.min(Math.max(NaN, 0), 1)` is `NaN`, and
|
|
118
|
+
* `NaN` reached CSS as `scale: NaN`, which is an invalid value the
|
|
119
|
+
* declaration is dropped for: the bar fell back to its unscaled width and
|
|
120
|
+
* painted COMPLETE for a value nobody had given. `aria-valuenow` announced
|
|
121
|
+
* the string "NaN" beside it. Empty means nothing done, which is the only
|
|
122
|
+
* reading that is not a claim. */
|
|
123
|
+
return Math.min(Math.max(this.value / max, 0), 1) || 0;
|
|
124
|
+
}
|
|
125
|
+
willUpdate(changed) {
|
|
126
|
+
super.willUpdate(changed);
|
|
127
|
+
hostAria(this.internals, { label: this.label, role: 'progressbar' });
|
|
128
|
+
/* The clamped value, not the given one, so what is announced is what is
|
|
129
|
+
drawn. Written as strings because that is what `ElementInternals` takes;
|
|
130
|
+
a number assigned here is stringified anyway and reads as though the
|
|
131
|
+
type were checked. */
|
|
132
|
+
this.internals.ariaValueMin = '0';
|
|
133
|
+
this.internals.ariaValueMax = String(this.max > 0 ? this.max : 100);
|
|
134
|
+
/* Absent, not zero. An omitted `aria-valuenow` is the platform's own signal
|
|
135
|
+
for indeterminate, and it is the only one: `aria-busy` says the element
|
|
136
|
+
is being updated, which is a different claim. Reporting 0 would announce
|
|
137
|
+
"0 percent" for work that is running, which is worse than saying nothing
|
|
138
|
+
because it is wrong rather than unknown. */
|
|
139
|
+
/* The clamped value itself, not the fraction multiplied back up.
|
|
140
|
+
*
|
|
141
|
+
* Dividing by `max` and then multiplying by it is a round trip through a
|
|
142
|
+
* float, and for roughly one integer pair in sixteen it does not come back:
|
|
143
|
+
* `1/3*3` is `0.9999999999999998`, which is what the accessibility tree
|
|
144
|
+
* carried and what a screen reader read out. Clamping the value directly
|
|
145
|
+
* says the same thing without the detour. */
|
|
146
|
+
const ceiling = this.max > 0 ? this.max : 100;
|
|
147
|
+
this.internals.ariaValueNow = this.indeterminate
|
|
148
|
+
? null
|
|
149
|
+
: String(Math.min(Math.max(this.value || 0, 0), ceiling));
|
|
150
|
+
this.internals.ariaValueText = this.valueText || null;
|
|
151
|
+
}
|
|
152
|
+
render() {
|
|
153
|
+
/* A custom property rather than a width, so the styled tier decides what
|
|
154
|
+
the number means: a bar fills along it, and a ring would sweep. */
|
|
155
|
+
const fraction = this.indeterminate ? 1 : this.fraction;
|
|
156
|
+
/* Two circles and `pathLength`, which is what makes the arithmetic go away.
|
|
157
|
+
*
|
|
158
|
+
* Declaring the path 100 units long lets `stroke-dasharray` be written as
|
|
159
|
+
* the percentage itself, so nothing here or in the stylesheet needs the
|
|
160
|
+
* circumference, the radius or pi. The geometry is CSS as well: `r` and the
|
|
161
|
+
* stroke both read the ring's own custom properties, so a consumer changing
|
|
162
|
+
* the thickness moves the circle that carries it without the component
|
|
163
|
+
* recalculating anything.
|
|
164
|
+
*
|
|
165
|
+
* `aria-hidden`, because the host is the `progressbar` and carries the
|
|
166
|
+
* value. The drawing is a picture of what it already says. */
|
|
167
|
+
const ring = html `<svg part="track" aria-hidden="true">
|
|
168
|
+
<circle part="groove" />
|
|
169
|
+
<circle part="indicator" pathLength="100" style="--progress-fraction: ${fraction}" />
|
|
170
|
+
</svg>`;
|
|
171
|
+
return html `${this.shape === 'ring'
|
|
172
|
+
? ring
|
|
173
|
+
: html `<div part="track">
|
|
174
|
+
<div part="indicator" style="--progress-fraction: ${fraction}"></div>
|
|
175
|
+
</div>`}
|
|
176
|
+
${
|
|
177
|
+
/* `aria-hidden`, because the bar already reports this. The host carries
|
|
178
|
+
`role="progressbar"` with `aria-valuenow` and `aria-valuetext`, so a
|
|
179
|
+
readable copy of the same number is a second announcement of one
|
|
180
|
+
fact. It is here to be looked at, not to be read out. */
|
|
181
|
+
this.showValue && !this.indeterminate
|
|
182
|
+
? html `<span part="value" aria-hidden="true"
|
|
183
|
+
>${this.valueText || `${Math.round(this.fraction * 100)}%`}</span
|
|
184
|
+
>`
|
|
185
|
+
: ''}`;
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
__decorate([
|
|
189
|
+
property()
|
|
190
|
+
], HelixHeadlessProgress.prototype, "label", void 0);
|
|
191
|
+
__decorate([
|
|
192
|
+
property({ reflect: true, type: Boolean })
|
|
193
|
+
], HelixHeadlessProgress.prototype, "indeterminate", void 0);
|
|
194
|
+
__decorate([
|
|
195
|
+
property({ type: Number })
|
|
196
|
+
], HelixHeadlessProgress.prototype, "max", void 0);
|
|
197
|
+
__decorate([
|
|
198
|
+
property({ reflect: true })
|
|
199
|
+
], HelixHeadlessProgress.prototype, "shape", void 0);
|
|
200
|
+
__decorate([
|
|
201
|
+
property({ attribute: 'show-value', reflect: true, type: Boolean })
|
|
202
|
+
], HelixHeadlessProgress.prototype, "showValue", void 0);
|
|
203
|
+
__decorate([
|
|
204
|
+
property({ type: Number })
|
|
205
|
+
], HelixHeadlessProgress.prototype, "value", void 0);
|
|
206
|
+
__decorate([
|
|
207
|
+
property({ attribute: 'value-text' })
|
|
208
|
+
], HelixHeadlessProgress.prototype, "valueText", void 0);
|
|
209
|
+
HelixHeadlessProgress = __decorate([
|
|
210
|
+
customElement('helix-headless-progress')
|
|
211
|
+
], HelixHeadlessProgress);
|
|
212
|
+
export { HelixHeadlessProgress };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { HelixHeadlessQrCode, type QrCorrection } from './root/qr-code-root.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { HelixHeadlessQrCode } from './root/qr-code-root.js';
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { HelixElement } from '@fusion.dev/helix-core';
|
|
2
|
+
import { type TemplateResult } from 'lit';
|
|
3
|
+
/** How much of the code can be lost and still read. */
|
|
4
|
+
export type QrCorrection = 'H' | 'L' | 'M' | 'Q';
|
|
5
|
+
/** How the modules are drawn. */
|
|
6
|
+
export type QrStyle = 'dots' | 'rounded' | 'square';
|
|
7
|
+
/**
|
|
8
|
+
* @summary Encodes a short piece of text as a scannable square.
|
|
9
|
+
*
|
|
10
|
+
* @description
|
|
11
|
+
* **The picture is one `<path>`, not a grid of squares.** A code of any useful
|
|
12
|
+
* length is a thousand modules, and drawing each as its own rect is a thousand
|
|
13
|
+
* nodes for one image. Runs of adjacent dark modules are joined, so a row of
|
|
14
|
+
* eight is one horizontal move rather than eight squares.
|
|
15
|
+
*
|
|
16
|
+
* **It is an image and says so.** `role="img"` with a name, because what a
|
|
17
|
+
* reader with a screen reader needs is what the code is *for*, and no amount of
|
|
18
|
+
* describing the pattern gives them that. Where nothing is passed the value
|
|
19
|
+
* itself is the name, which is right far more often than it looks: most codes
|
|
20
|
+
* hold a URL, and a URL read aloud is the destination.
|
|
21
|
+
*
|
|
22
|
+
* **The quiet zone is part of the code.** Four modules of margin are required
|
|
23
|
+
* by the specification, not a design choice, and a scanner will refuse a code
|
|
24
|
+
* that is cropped to its edge. It is drawn inside the `viewBox` so it survives
|
|
25
|
+
* any size the component is given, including one set in CSS.
|
|
26
|
+
*
|
|
27
|
+
* `correction` is what buys the middle slot. A code at `H` can lose thirty
|
|
28
|
+
* percent of itself and still read, which is what makes covering the center
|
|
29
|
+
* with a mark safe; at `L` the same mark makes the code unscannable. That is
|
|
30
|
+
* why the slot exists on the same element as the property, and why the default
|
|
31
|
+
* moves when the slot is filled.
|
|
32
|
+
*
|
|
33
|
+
* @since 0.1.0
|
|
34
|
+
* @status stable
|
|
35
|
+
* @category media
|
|
36
|
+
* @aliases QR, Barcode, Scan code
|
|
37
|
+
* @documentation https://helix.fusion.dev/components/qr-code
|
|
38
|
+
*
|
|
39
|
+
* @slot logo - A mark for the center, which only reads at a high correction.
|
|
40
|
+
*
|
|
41
|
+
* @csspart code - The square itself.
|
|
42
|
+
* @csspart finders - The three corner squares, which can take their own color.
|
|
43
|
+
* @csspart logo - The box holding the center mark.
|
|
44
|
+
* @csspart modules - Everything but the three corner squares.
|
|
45
|
+
*/
|
|
46
|
+
export declare class HelixHeadlessQrCode extends HelixElement {
|
|
47
|
+
/**
|
|
48
|
+
* What the code encodes, which is usually a URL.
|
|
49
|
+
*/
|
|
50
|
+
value: string;
|
|
51
|
+
/**
|
|
52
|
+
* What the image is called.
|
|
53
|
+
*
|
|
54
|
+
* Falling back to the value is deliberate: a code almost always holds a URL,
|
|
55
|
+
* and a URL is a better name than "QR code" for a reader who cannot see it.
|
|
56
|
+
*/
|
|
57
|
+
label: string;
|
|
58
|
+
/**
|
|
59
|
+
* How the modules are drawn.
|
|
60
|
+
*
|
|
61
|
+
* `square` is the default and the only one that joins runs of adjacent
|
|
62
|
+
* modules into a single subpath, which is what keeps a thousand modules to a
|
|
63
|
+
* handful of nodes. `rounded` and `dots` draw each module on its own, because
|
|
64
|
+
* the corners are the thing being drawn and a joined run has none in the
|
|
65
|
+
* middle. That cost is paid only by a code that asks for them.
|
|
66
|
+
*
|
|
67
|
+
* A scanner reads contrast between cells, not their shape, so all three
|
|
68
|
+
* scan. `dots` sits a little under half a module so neighbours do not touch,
|
|
69
|
+
* which is what makes it read as dots rather than as a softened square code.
|
|
70
|
+
*/
|
|
71
|
+
shape: QrStyle;
|
|
72
|
+
/**
|
|
73
|
+
* How much of the code can be lost and still read.
|
|
74
|
+
*
|
|
75
|
+
* `M` by default, which is the level almost every code in the world uses and
|
|
76
|
+
* costs about fifteen percent redundancy. `H` where a mark covers the center,
|
|
77
|
+
* chosen automatically when the slot is filled: it is the level that makes
|
|
78
|
+
* covering safe, and a consumer who fills the slot has said what they want
|
|
79
|
+
* without having to know that.
|
|
80
|
+
*/
|
|
81
|
+
correction?: QrCorrection;
|
|
82
|
+
/** Whether anything is slotted into the middle. */
|
|
83
|
+
private logo;
|
|
84
|
+
/** The level actually used, which the slot can raise. */
|
|
85
|
+
private get level();
|
|
86
|
+
private renderCode;
|
|
87
|
+
protected render(): TemplateResult;
|
|
88
|
+
}
|
|
89
|
+
declare global {
|
|
90
|
+
interface HTMLElementTagNameMap {
|
|
91
|
+
'helix-headless-qr-code': HelixHeadlessQrCode;
|
|
92
|
+
}
|
|
93
|
+
}
|