@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,395 @@
|
|
|
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, drawTooltip, HelixElement, MixinChartSource, seriesIndex, } from '@fusion.dev/helix-core';
|
|
8
|
+
import { html, nothing, svg } from 'lit';
|
|
9
|
+
import { property } from 'lit/decorators.js';
|
|
10
|
+
import '../../tooltip/index.js';
|
|
11
|
+
/** The drawing's own coordinates, square because the shape has to stay round. */
|
|
12
|
+
const BOX = 100;
|
|
13
|
+
const CENTER = BOX / 2;
|
|
14
|
+
/** The outer edge of the ring, whatever its thickness. */
|
|
15
|
+
const EDGE = 40;
|
|
16
|
+
/**
|
|
17
|
+
* The dash gap, long enough that the pattern cannot repeat.
|
|
18
|
+
*
|
|
19
|
+
* A dash array tiles. Set to `circumference - length` the pattern fills the
|
|
20
|
+
* circle exactly once and is right at rest, and wrong the moment it animates:
|
|
21
|
+
* both numbers interpolate, and while the gap is shorter than the path still to
|
|
22
|
+
* cover, a second and third copy of the slice sweep round the ring and vanish
|
|
23
|
+
* inside one transition. A constant far larger than any circumference has no
|
|
24
|
+
* second tile to draw at any point in the interpolation. It is the number
|
|
25
|
+
* `@starting-style` already uses for the same reason.
|
|
26
|
+
*/
|
|
27
|
+
const GAP = 9999;
|
|
28
|
+
/**
|
|
29
|
+
* How much of the radius the ring takes, by name.
|
|
30
|
+
*
|
|
31
|
+
* **The outer edge is fixed and the radius follows the thickness**, which is
|
|
32
|
+
* what makes `none` a pie and makes clipping impossible. The stroke sits astride
|
|
33
|
+
* its own radius, so a ring drawn at a fixed `r` grows outward as well as
|
|
34
|
+
* inward: measured against a 100 box, the old fixed `r=40` had an unstated
|
|
35
|
+
* ceiling at a thickness of 20, and anything past it crossed the view box and
|
|
36
|
+
* was cut with nothing to say so. Closing the hole that way would have needed a
|
|
37
|
+
* thickness of 80, spanning `r=0` to `r=80` in a box whose half is 50.
|
|
38
|
+
*
|
|
39
|
+
* Derived instead, `r = EDGE - thickness / 2`, the outer edge lands on `EDGE`
|
|
40
|
+
* for every value and the inner edge is `EDGE - thickness`. A pie is where the
|
|
41
|
+
* inner edge reaches the center, which solves to `thickness = EDGE`: the ring
|
|
42
|
+
* is then drawn at `r = EDGE / 2` and its stroke spans the whole radius.
|
|
43
|
+
*
|
|
44
|
+
* `EDGE * 2` was the first answer and is the trap in this arithmetic. It gives
|
|
45
|
+
* `r = 0`, and a circle of radius zero draws nothing at all, so a pie came out
|
|
46
|
+
* as an empty box. The stroke reaches `thickness / 2` either side of `r`, not
|
|
47
|
+
* `thickness`.
|
|
48
|
+
*/
|
|
49
|
+
const THICKNESS = {
|
|
50
|
+
large: 8,
|
|
51
|
+
medium: 16,
|
|
52
|
+
none: EDGE,
|
|
53
|
+
small: 26,
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* @summary Parts of a whole as a ring, read from a table.
|
|
57
|
+
*
|
|
58
|
+
* @description
|
|
59
|
+
* The chart with the narrowest honest use, so the component is narrow too.
|
|
60
|
+
*
|
|
61
|
+
* **It reads one column and treats the rows as the parts.** Every other chart
|
|
62
|
+
* here takes a column per series; a ring has one whole to divide, and a second
|
|
63
|
+
* ring inside the first is two charts sharing a picture in the most literal
|
|
64
|
+
* way. So the first column of numbers is the series and each row is a slice.
|
|
65
|
+
*
|
|
66
|
+
* **It refuses negative values rather than drawing them.** A share of a whole
|
|
67
|
+
* cannot be less than nothing, and an arc for a negative number either runs
|
|
68
|
+
* backwards over its neighbours or is silently dropped. Those rows are skipped
|
|
69
|
+
* and the total is of what is left, which is the only reading that stays true.
|
|
70
|
+
*
|
|
71
|
+
* **The shape is drawn with a dashed stroke, not with arc commands.** One
|
|
72
|
+
* `<circle>` per slice, its dash set to the slice's share of the circumference
|
|
73
|
+
* and its offset to where the slice begins. Arc paths need the sweep flag and a
|
|
74
|
+
* large-arc flag, both of which flip at values a reader never sees coming, and
|
|
75
|
+
* a slice of exactly one whole becomes a path with no length at all.
|
|
76
|
+
*
|
|
77
|
+
* **And it keeps its aspect ratio**, alone among the charts here. The others
|
|
78
|
+
* set `preserveAspectRatio="none"` so one drawing fills any box and rescue
|
|
79
|
+
* their strokes with `vector-effect`; that rescues strokes and not geometry, so
|
|
80
|
+
* a ring drawn the same way is an ellipse in anything but a square.
|
|
81
|
+
*
|
|
82
|
+
* The table is the accessible representation and this drawing is `aria-hidden`.
|
|
83
|
+
*
|
|
84
|
+
* The properties below are written by this component and read by whoever draws
|
|
85
|
+
* it. A consumer sets none of them: they carry a number this element computed
|
|
86
|
+
* and CSS cannot, which is what lets a stylesheet on this tier draw the thing
|
|
87
|
+
* without measuring anything itself.
|
|
88
|
+
*
|
|
89
|
+
* @since 0.1.0
|
|
90
|
+
* @status experimental
|
|
91
|
+
* @category charts
|
|
92
|
+
* @aliases Pie Chart, Ring Chart, Share Chart
|
|
93
|
+
* @documentation https://helix.fusion.dev/components/donut-chart
|
|
94
|
+
*
|
|
95
|
+
* @slot - Goes in the middle of the ring. A total, usually.
|
|
96
|
+
*
|
|
97
|
+
* @csspart center - The middle of the ring, holding whatever is slotted.
|
|
98
|
+
* @csspart mark - The invisible point the tooltip is anchored to.
|
|
99
|
+
* @csspart plot - The drawing.
|
|
100
|
+
* @csspart segment - One slice.
|
|
101
|
+
* @csspart segment-edge - One slice as a closed shape, for a boundary to trace.
|
|
102
|
+
* @csspart tooltip - The bubble, forwarded from `Tooltip`.
|
|
103
|
+
* @csspart tooltip-anchor - The `Tooltip` element itself.
|
|
104
|
+
* @csspart tooltip-cell - One column's name and value inside the tooltip.
|
|
105
|
+
* @csspart tooltip-label - The slice's own name inside the tooltip.
|
|
106
|
+
* @csspart tooltip-name - A column's name inside the tooltip.
|
|
107
|
+
* @csspart tooltip-value - A column's value inside the tooltip.
|
|
108
|
+
* @csspart track - The ring the slices are drawn on.
|
|
109
|
+
*
|
|
110
|
+
* @cssproperty --donut-chart-stroke - How thick the ring is drawn, derived from `hole`.
|
|
111
|
+
*/
|
|
112
|
+
let HelixHeadlessDonutChart = class HelixHeadlessDonutChart extends MixinChartSource(HelixElement) {
|
|
113
|
+
/* The slices, in table order, with anything negative dropped. */
|
|
114
|
+
/**
|
|
115
|
+
* The pointer is not mapped across this one.
|
|
116
|
+
*
|
|
117
|
+
* Every other chart lays its readings out left to right, so the nearest is
|
|
118
|
+
* arithmetic on x. A ring's slices are real elements at every angle, and x
|
|
119
|
+
* alone would answer with whichever slice shared a horizontal position with
|
|
120
|
+
* the pointer: at three o'clock and at nine o'clock it would give the same
|
|
121
|
+
* reading for opposite sides of the chart. So the slices say which one they
|
|
122
|
+
* are and this only holds the answer.
|
|
123
|
+
*
|
|
124
|
+
* Set here rather than in a constructor, and that is not a style choice. The
|
|
125
|
+
* analyzer reads `this.pointer.axis = 'none'` in a constructor body as a
|
|
126
|
+
* declaration of a public field called `axis`, and failed the build with
|
|
127
|
+
* `HelixHeadlessDonutChart.tracks has no description` for a member that does not
|
|
128
|
+
* exist on this class at all.
|
|
129
|
+
*/
|
|
130
|
+
connectedCallback() {
|
|
131
|
+
super.connectedCallback();
|
|
132
|
+
this.pointer.axis = 'none';
|
|
133
|
+
}
|
|
134
|
+
/** The fraction of the circle the shares are spread over. */
|
|
135
|
+
get span() {
|
|
136
|
+
return this.sweep === 'half' ? 0.5 : 1;
|
|
137
|
+
}
|
|
138
|
+
/** How thick the ring is drawn, in the drawing's own units. */
|
|
139
|
+
get thickness() {
|
|
140
|
+
return THICKNESS[this.hole ?? 'medium'] ?? THICKNESS.medium ?? 0;
|
|
141
|
+
}
|
|
142
|
+
/** The ring's radius, which follows its thickness so the outer edge holds. */
|
|
143
|
+
get radius() {
|
|
144
|
+
return EDGE - this.thickness / 2;
|
|
145
|
+
}
|
|
146
|
+
get shares() {
|
|
147
|
+
const series = this.series;
|
|
148
|
+
const values = (series[0]?.points ?? [])
|
|
149
|
+
.map((point) => point.value)
|
|
150
|
+
.map((value) => (Number.isFinite(value) && value > 0 ? value : 0));
|
|
151
|
+
const total = values.reduce((sum, one) => sum + one, 0);
|
|
152
|
+
if (total === 0) {
|
|
153
|
+
return [];
|
|
154
|
+
}
|
|
155
|
+
let start = 0;
|
|
156
|
+
return values.map((value) => {
|
|
157
|
+
const fraction = value / total;
|
|
158
|
+
const at = start;
|
|
159
|
+
start += fraction;
|
|
160
|
+
return { fraction, start: at };
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
render() {
|
|
164
|
+
const shares = this.shares;
|
|
165
|
+
/* No middle where there is no hole. A `center` part over a pie would put
|
|
166
|
+
slotted content on top of the slices, and a slot nobody can see is worse
|
|
167
|
+
than one that is not there: a consumer fills it and nothing happens. */
|
|
168
|
+
return html `${this.renderPlot(shares)}
|
|
169
|
+
`;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* The ring itself, behind a seam the styled tier can move.
|
|
173
|
+
*
|
|
174
|
+
* `aria-hidden`, because the table it was read from is the readable version
|
|
175
|
+
* and a screen reader hearing both hears the same numbers twice.
|
|
176
|
+
*/
|
|
177
|
+
renderPlot(shares) {
|
|
178
|
+
/* The thickness is declared here, on the box that holds both the ring and
|
|
179
|
+
the middle, and not on the slices.
|
|
180
|
+
*
|
|
181
|
+
* It was on each `<circle>`, and `[part="center"]` read it to size the hole
|
|
182
|
+
* it fills. A custom property inherits down and never sideways, so the
|
|
183
|
+
* middle, being a sibling, always got the fallback: the hole was sized as if
|
|
184
|
+
* every ring were the resting thickness. At `hole="large"` that made the
|
|
185
|
+
* middle smaller than the actual hole and the total fitted with room to
|
|
186
|
+
* spare, and at the default the two matched exactly and the total overflowed
|
|
187
|
+
* onto the slices. One reads as fine and the other as a bug, from one
|
|
188
|
+
* mistake. */
|
|
189
|
+
return html `<div
|
|
190
|
+
aria-hidden="true"
|
|
191
|
+
id="helix-chart-plot"
|
|
192
|
+
part="plot"
|
|
193
|
+
style="--donut-chart-stroke: ${this.thickness}"
|
|
194
|
+
>
|
|
195
|
+
<svg viewBox=${this.frame} xmlns="http://www.w3.org/2000/svg">
|
|
196
|
+
<circle
|
|
197
|
+
cx=${CENTER}
|
|
198
|
+
cy=${CENTER}
|
|
199
|
+
fill="none"
|
|
200
|
+
part="track"
|
|
201
|
+
r=${this.radius}
|
|
202
|
+
stroke-dasharray="${2 * Math.PI * this.radius * this.span} ${GAP}"
|
|
203
|
+
stroke-width=${this.thickness}
|
|
204
|
+
/>
|
|
205
|
+
${shares.map((share, index) => this.renderSegment(share, index))}
|
|
206
|
+
</svg>
|
|
207
|
+
${this.hole === 'none' ? nothing : html `<div part="center"><slot></slot></div>`}
|
|
208
|
+
${this.renderTooltip()}
|
|
209
|
+
</div>`;
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* The view box, cropped to what is actually drawn.
|
|
213
|
+
*
|
|
214
|
+
* A full turn uses the square. A half arc uses the band from the top of the
|
|
215
|
+
* ring down to the center line, plus the half stroke its flat ends hang
|
|
216
|
+
* below that, and cropping to it is the difference between a semi-donut and a
|
|
217
|
+
* semi-donut with an empty quarter of the box under it. The outer edge is
|
|
218
|
+
* `EDGE` from the center whatever the thickness, which is what makes this two
|
|
219
|
+
* numbers rather than a measurement.
|
|
220
|
+
*/
|
|
221
|
+
get frame() {
|
|
222
|
+
if (this.sweep !== 'half') {
|
|
223
|
+
return `0 0 ${BOX} ${BOX}`;
|
|
224
|
+
}
|
|
225
|
+
return `0 ${CENTER - EDGE} ${BOX} ${EDGE + this.thickness / 2}`;
|
|
226
|
+
}
|
|
227
|
+
/** One slice, as a dash the length of its share. */
|
|
228
|
+
renderSegment(share, index) {
|
|
229
|
+
const circumference = 2 * Math.PI * this.radius;
|
|
230
|
+
const length = share.fraction * circumference * this.span;
|
|
231
|
+
/* Negative, because `stroke-dashoffset` counts backwards along the path:
|
|
232
|
+
a positive offset would run the slices anticlockwise from twelve. The
|
|
233
|
+
rotation that puts zero at the top is the stylesheet's, since it is a
|
|
234
|
+
fact about how the picture is presented rather than about the numbers. */
|
|
235
|
+
return svg `<circle
|
|
236
|
+
cx=${CENTER}
|
|
237
|
+
cy=${CENTER}
|
|
238
|
+
data-active=${this.pointer.at === index ? '' : nothing}
|
|
239
|
+
data-series=${seriesIndex(index)}
|
|
240
|
+
fill="none"
|
|
241
|
+
style="--chart-series: var(--chart-series-${seriesIndex(index)})"
|
|
242
|
+
@pointerenter=${() => this.pointer.set(index)}
|
|
243
|
+
part="segment"
|
|
244
|
+
r=${this.radius}
|
|
245
|
+
stroke-dasharray="${length} ${GAP}"
|
|
246
|
+
stroke-dashoffset=${-share.start * circumference * this.span}
|
|
247
|
+
/>
|
|
248
|
+
${this.renderEdge(share, index)}`;
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* The same slice again, as a shape with an inside.
|
|
252
|
+
*
|
|
253
|
+
* **A stroked arc has no boundary to draw, which is why this exists.** The
|
|
254
|
+
* segment above is a dash on a circle: the mark *is* the edge, so there is
|
|
255
|
+
* nothing for an outline to trace and nothing within it to fade. Anything
|
|
256
|
+
* wanting those two separately needs the slice as a closed path, and this is
|
|
257
|
+
* it: the outer arc, a step inward, the inner arc back, closed.
|
|
258
|
+
*
|
|
259
|
+
* **Rendered always and painted only sometimes**, which is what keeps this on
|
|
260
|
+
* this tier. Whether a boundary is drawn is a styled question and the answer
|
|
261
|
+
* lives in a stylesheet; whether the geometry a boundary would need exists at
|
|
262
|
+
* all is structural, and a component cannot conjure a shape from CSS. So the
|
|
263
|
+
* path is here for every donut and is `fill: none; stroke: none` until
|
|
264
|
+
* something asks for it.
|
|
265
|
+
*
|
|
266
|
+
* **Not a replacement for the dash, which was the first plan.** The dash
|
|
267
|
+
* carries three jobs and only one of them is the shape: a share growing is a
|
|
268
|
+
* `stroke-dasharray` interpolating with no reflow, and `@starting-style` on
|
|
269
|
+
* that same property is the whole reason the ring sweeps in rather than
|
|
270
|
+
* appearing. A `d` cannot do either. CSS interpolates one only between paths
|
|
271
|
+
* of identical command structure, and the large-arc flag flips the moment a
|
|
272
|
+
* slice crosses a half turn, so a growing slice would pop partway through the
|
|
273
|
+
* transition it was meant to smooth. Both animations stay on the dash and this
|
|
274
|
+
* path follows it.
|
|
275
|
+
*
|
|
276
|
+
* The turn to twelve o'clock is arithmetic here rather than the rotation the
|
|
277
|
+
* stylesheet gives the circles. That rule uses `transform-box: fill-box`, so
|
|
278
|
+
* it spins each element about its own bounding box, which is the ring's center
|
|
279
|
+
* for a circle and is not for a sector.
|
|
280
|
+
*/
|
|
281
|
+
renderEdge(share, index) {
|
|
282
|
+
const turn = 2 * Math.PI * this.span;
|
|
283
|
+
const from = share.start * turn - Math.PI / 2;
|
|
284
|
+
const to = (share.start + share.fraction) * turn - Math.PI / 2;
|
|
285
|
+
const outer = EDGE;
|
|
286
|
+
const inner = EDGE - this.thickness;
|
|
287
|
+
const at = (radius, angle) => `${(CENTER + Math.cos(angle) * radius).toFixed(3)} ${(CENTER + Math.sin(angle) * radius).toFixed(3)}`;
|
|
288
|
+
const wide = to - from > Math.PI ? 1 : 0;
|
|
289
|
+
/* A slice that is the whole ring starts and ends at one point, and an arc
|
|
290
|
+
between a point and itself draws nothing. Split at the halfway angle so
|
|
291
|
+
each half is a real arc. */
|
|
292
|
+
const full = to - from >= 2 * Math.PI - 1e-6;
|
|
293
|
+
const mid = from + (to - from) / 2;
|
|
294
|
+
const outward = full
|
|
295
|
+
? `A ${outer} ${outer} 0 0 1 ${at(outer, mid)} A ${outer} ${outer} 0 0 1 ${at(outer, to)}`
|
|
296
|
+
: `A ${outer} ${outer} 0 ${wide} 1 ${at(outer, to)}`;
|
|
297
|
+
/* A pie has no inner arc: the radius solves to zero and the two ends meet at
|
|
298
|
+
the middle, so the step back is a line to the center and not an arc of no
|
|
299
|
+
size. */
|
|
300
|
+
const homeward = inner <= 0
|
|
301
|
+
? `L ${CENTER} ${CENTER}`
|
|
302
|
+
: full
|
|
303
|
+
? `L ${at(inner, to)} A ${inner} ${inner} 0 0 0 ${at(inner, mid)} A ${inner} ${inner} 0 0 0 ${at(inner, from)}`
|
|
304
|
+
: `L ${at(inner, to)} A ${inner} ${inner} 0 ${wide} 0 ${at(inner, from)}`;
|
|
305
|
+
const shape = `M ${at(outer, from)} ${outward} ${homeward} Z`;
|
|
306
|
+
/* **Clipped to itself, because a stroke straddles the line it is drawn on.**
|
|
307
|
+
Half of it falls outside the wedge: past the fill on both arcs, and across
|
|
308
|
+
the seam into the neighbor on both radial sides, where that neighbor is
|
|
309
|
+
drawing the same line from the other direction and the two overlap. Seen
|
|
310
|
+
as a doubled edge at every join and a halo around the ring.
|
|
311
|
+
|
|
312
|
+
Clipping to the same path keeps the inner half and drops the outer, so an
|
|
313
|
+
edge stays inside the slice it belongs to and two adjacent edges meet
|
|
314
|
+
exactly. The clip is the shape itself, so it costs no second geometry and
|
|
315
|
+
cannot drift from it.
|
|
316
|
+
|
|
317
|
+
Ids are scoped to the shadow root, so an index is enough to keep them
|
|
318
|
+
apart, and two donuts on a page cannot collide. */
|
|
319
|
+
/* **`fill="none"` as an attribute, not a rule, because this tier has
|
|
320
|
+
no rules.** An SVG path fills black by default and the styled tier
|
|
321
|
+
says `fill: none` in its own stylesheet, so the shape was invisible
|
|
322
|
+
there and four black slices covering the ring everywhere else. Caught
|
|
323
|
+
by retaking the visual baselines: the headless donut lost two of its
|
|
324
|
+
four greys to a closed shape nobody had told to stop filling.
|
|
325
|
+
|
|
326
|
+
A presentation attribute loses to any CSS rule, so the styled tier
|
|
327
|
+
still decides and a consumer can still fill this if they want one.
|
|
328
|
+
What it cannot do any more is fill by accident on the tier whose
|
|
329
|
+
whole premise is that it ships no CSS. */
|
|
330
|
+
const clip = `helix-donut-edge-${index}`;
|
|
331
|
+
return svg `<clipPath id=${clip}><path d=${shape} /></clipPath>
|
|
332
|
+
<path
|
|
333
|
+
clip-path="url(#${clip})"
|
|
334
|
+
d=${shape}
|
|
335
|
+
data-active=${this.pointer.at === index ? '' : nothing}
|
|
336
|
+
data-series=${seriesIndex(index)}
|
|
337
|
+
fill="none"
|
|
338
|
+
part="segment-edge"
|
|
339
|
+
style="--chart-series: var(--chart-series-${seriesIndex(index)})"
|
|
340
|
+
/>`;
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* What a pointer resting on a slice shows.
|
|
344
|
+
*
|
|
345
|
+
* Placed in the middle rather than along an axis, a ring having none, and the
|
|
346
|
+
* middle is where a reader is already looking: the hole usually holds a
|
|
347
|
+
* total, so a tooltip over it replaces one figure with the one being asked
|
|
348
|
+
* about rather than covering something else.
|
|
349
|
+
*/
|
|
350
|
+
renderTooltip() {
|
|
351
|
+
const at = this.pointer.at;
|
|
352
|
+
const share = this.shares[at];
|
|
353
|
+
if (!share) {
|
|
354
|
+
return drawTooltip(this.sourceRows, at, this.tag('tooltip'));
|
|
355
|
+
}
|
|
356
|
+
/* **Outside the ring, on the slice's own bearing.** Centered in the hole was
|
|
357
|
+
the first version: harmless over a donut, since the hole is empty, and it
|
|
358
|
+
covers the data on a pie, and in neither case does it say *which* slice it
|
|
359
|
+
means. Out here it does, and one rule serves both.
|
|
360
|
+
*
|
|
361
|
+
* The mid-angle, less a quarter turn because the ring is rotated to start
|
|
362
|
+
* at twelve o'clock and this arithmetic starts at three. The point is the
|
|
363
|
+
* outer edge, and the box is pushed a little further along the same bearing
|
|
364
|
+
* so its arrow rests on the ring rather than in it. */
|
|
365
|
+
const angle = (share.start + share.fraction / 2) * 2 * Math.PI - Math.PI / 2;
|
|
366
|
+
const edge = EDGE;
|
|
367
|
+
const x = CENTER + Math.cos(angle) * edge;
|
|
368
|
+
const y = CENTER + Math.sin(angle) * edge;
|
|
369
|
+
return drawTooltip(this.sourceRows, at, this.tag('tooltip'), {
|
|
370
|
+
/* The preferred side from the bearing's dominant axis, and
|
|
371
|
+
`FloatingController` moves it if that side does not fit. Four fixed
|
|
372
|
+
sides could not express a bearing at all, which is what made the arrow
|
|
373
|
+
miss the ring; a preference plus flipping can. */
|
|
374
|
+
placement: Math.abs(Math.cos(angle)) > Math.abs(Math.sin(angle))
|
|
375
|
+
? Math.cos(angle) > 0
|
|
376
|
+
? 'right'
|
|
377
|
+
: 'left'
|
|
378
|
+
: Math.sin(angle) > 0
|
|
379
|
+
? 'bottom'
|
|
380
|
+
: 'top',
|
|
381
|
+
x: `${x}%`,
|
|
382
|
+
y: `${y}%`,
|
|
383
|
+
});
|
|
384
|
+
}
|
|
385
|
+
};
|
|
386
|
+
__decorate([
|
|
387
|
+
property({ reflect: true })
|
|
388
|
+
], HelixHeadlessDonutChart.prototype, "hole", void 0);
|
|
389
|
+
__decorate([
|
|
390
|
+
property({ reflect: true })
|
|
391
|
+
], HelixHeadlessDonutChart.prototype, "sweep", void 0);
|
|
392
|
+
HelixHeadlessDonutChart = __decorate([
|
|
393
|
+
customElement('helix-headless-donut-chart')
|
|
394
|
+
], HelixHeadlessDonutChart);
|
|
395
|
+
export { HelixHeadlessDonutChart };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './root/drawer-root.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './root/drawer-root.js';
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { CommandController, HelixElement } from '@fusion.dev/helix-core';
|
|
2
|
+
import { type PropertyValues, type TemplateResult } from 'lit';
|
|
3
|
+
declare const HelixHeadlessDrawer_base: (new (...args: any[]) => import("@fusion.dev/helix-core").MixinControllerOpenInterface) & typeof HelixElement;
|
|
4
|
+
/**
|
|
5
|
+
* @summary A panel that slides in from an edge.
|
|
6
|
+
*
|
|
7
|
+
* @description
|
|
8
|
+
* Takes `MixinControllerOpen`, so `open`, `defaultOpen`, and `OpenChange` behave exactly
|
|
9
|
+
* as they do on an accordion item, and a consumer already knows the API.
|
|
10
|
+
*
|
|
11
|
+
* Modal by default, which is three things together and not one: focus is
|
|
12
|
+
* trapped inside, Escape and an outside press close it, and the page behind is
|
|
13
|
+
* covered. A panel with the look of a modal and none of its behavior is worse
|
|
14
|
+
* than an inline one, because it invites the reader to treat it as blocking.
|
|
15
|
+
*
|
|
16
|
+
* Content stays mounted when closed, so it is in the server's markup and can
|
|
17
|
+
* animate. A closed `<dialog>` is already out of the tab order and out of the
|
|
18
|
+
* accessibility tree, so nothing here writes `inert`.
|
|
19
|
+
*
|
|
20
|
+
* **This described a hand-written `inert` until 21 Aug 2026, and had done since
|
|
21
|
+
* the panel became a `<dialog>`.** The rewrite took the `role`, the
|
|
22
|
+
* `aria-modal`, the scrim and the `inert` with it, because the element brings
|
|
23
|
+
* all four, and the comments at the two call sites say so. The class doc did
|
|
24
|
+
* not, and `drawer-root.ssr.spec.ts` has asserted the panel carries no `inert`
|
|
25
|
+
* the whole time: a spec three files away existing to contradict the prose is
|
|
26
|
+
* the same shape as `Stat`'s `detail` slot, which is what `check:references`
|
|
27
|
+
* was written after and is the half it cannot see.
|
|
28
|
+
*
|
|
29
|
+
* Opened declaratively with the platform's invoker attributes:
|
|
30
|
+
*
|
|
31
|
+
* ```html
|
|
32
|
+
* <helix-button commandfor="nav" command="--toggle">Menu</helix-button>
|
|
33
|
+
* <helix-drawer id="nav">…</helix-drawer>
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* @since 0.1.0
|
|
37
|
+
* @status experimental
|
|
38
|
+
* @category overlays
|
|
39
|
+
* @aliases Sheet, Sidebar, Panel, Off-canvas
|
|
40
|
+
* @documentation https://helix.fusion.dev/components/drawer
|
|
41
|
+
*
|
|
42
|
+
* @slot - The drawer's content.
|
|
43
|
+
* @slot header - Content pinned above the scrolling area.
|
|
44
|
+
*
|
|
45
|
+
* @event {Event} close - Relayed, because the platform's own does not escape.
|
|
46
|
+
* @event {HelixBeforeCloseEvent} helix-before-close - Fired before the panel closes, and cancelable.
|
|
47
|
+
* @event {HelixBeforeOpenEvent} helix-before-open - Fired before the drawer opens or closes. Cancelable: refusing it takes the decision and nothing moves.
|
|
48
|
+
* @event {Event} toggle - Says the state moved, carrying `newState` and `oldState`.
|
|
49
|
+
*
|
|
50
|
+
* @csspart content - The scrolling content region.
|
|
51
|
+
* @csspart header - The header region.
|
|
52
|
+
* @csspart panel - The sliding panel.
|
|
53
|
+
*/
|
|
54
|
+
export declare class HelixHeadlessDrawer extends HelixHeadlessDrawer_base {
|
|
55
|
+
protected readonly commands: CommandController;
|
|
56
|
+
/**
|
|
57
|
+
* Which edge the drawer comes from.
|
|
58
|
+
*
|
|
59
|
+
* Unset is `end`, which the styled tier reads as `:host(:not([placement]))`
|
|
60
|
+
* beside `:host([placement="end"])` rather than as a value written here: a
|
|
61
|
+
* default assigned to the property would reflect onto every host and put a
|
|
62
|
+
* `placement="end"` into markup no consumer wrote.
|
|
63
|
+
*/
|
|
64
|
+
placement?: 'start' | 'end' | 'top' | 'bottom';
|
|
65
|
+
/**
|
|
66
|
+
* Accessible name for the panel.
|
|
67
|
+
*/
|
|
68
|
+
label: string;
|
|
69
|
+
/**
|
|
70
|
+
* Whether the drawer blocks the page behind it.
|
|
71
|
+
*
|
|
72
|
+
* Turning this off removes the focus trap and the scrim together, because
|
|
73
|
+
* they are one decision: a panel that traps focus without covering the page
|
|
74
|
+
* strands the reader, and one that covers without trapping lets them tab
|
|
75
|
+
* behind the cover.
|
|
76
|
+
*
|
|
77
|
+
* Not reflected. It stays `true` by default, since a drawer that silently
|
|
78
|
+
* lost its focus trap because a consumer forgot a word would be worse than an
|
|
79
|
+
* attribute on the host, and nothing selects on it: the scrim is rendered or
|
|
80
|
+
* not, rather than shown or hidden by CSS.
|
|
81
|
+
*/
|
|
82
|
+
modal: boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Which close requests the browser answers on its own.
|
|
85
|
+
*
|
|
86
|
+
* `<dialog closedby>`, forwarded, and safe to forward because every path it
|
|
87
|
+
* opens still comes back through this element: a close request fires `cancel`
|
|
88
|
+
* first, `handleCancel` prevents it, and `requestOpen` decides. So
|
|
89
|
+
* `closedby="any"` gains light dismiss without giving up the refusal, which is
|
|
90
|
+
* the property this component exists to keep.
|
|
91
|
+
*
|
|
92
|
+
* Absent by default, which is the platform's `auto` and this library's rule
|
|
93
|
+
* that a resting value is an attribute's absence.
|
|
94
|
+
*/
|
|
95
|
+
closedBy?: 'any' | 'closerequest' | 'none';
|
|
96
|
+
/**
|
|
97
|
+
* What the dialog closed with, the way `<dialog>` reports it.
|
|
98
|
+
*
|
|
99
|
+
* **The whole point of a `<dialog>` returning a value is lost behind a shadow
|
|
100
|
+
* boundary**, which is where this one is: `querySelector` does not reach the
|
|
101
|
+
* element, so a consumer could neither set the value nor read it back. A
|
|
102
|
+
* drawer asking which of its actions dismissed it is the ordinary case and had
|
|
103
|
+
* no answer.
|
|
104
|
+
*
|
|
105
|
+
* Written before `open` is set to false rather than passed to a `close(value)`
|
|
106
|
+
* call, because this component has no such method: it is driven by `open`
|
|
107
|
+
* alone, and `Dialog`'s `close()` is the one that takes the value directly.
|
|
108
|
+
*
|
|
109
|
+
* Held here as well as on the element, so a value set before the first render
|
|
110
|
+
* survives to it and a consumer reading one back gets what they wrote.
|
|
111
|
+
*/
|
|
112
|
+
get returnValue(): string;
|
|
113
|
+
set returnValue(value: string);
|
|
114
|
+
/** What a value set before the element existed is kept in. */
|
|
115
|
+
private returned;
|
|
116
|
+
/** The panel, which is a real `<dialog>`. */
|
|
117
|
+
private get panel();
|
|
118
|
+
/**
|
|
119
|
+
* Escape, routed through the request so a listener can refuse it.
|
|
120
|
+
*
|
|
121
|
+
* A native dialog closes itself on Escape, which would shut the drawer while
|
|
122
|
+
* the consumer's state still said open: the bug that makes a modal impossible
|
|
123
|
+
* to reopen. `Dialog` intercepts it for the same reason.
|
|
124
|
+
*/
|
|
125
|
+
private readonly handleCancel;
|
|
126
|
+
/** A close that happened anyway is reflected back rather than argued with. */
|
|
127
|
+
private readonly handleClose;
|
|
128
|
+
/**
|
|
129
|
+
* A press on the backdrop, which lands on the dialog element itself.
|
|
130
|
+
*
|
|
131
|
+
* The panel fills only part of the dialog's box, so a press beside it hits
|
|
132
|
+
* the dialog and not a child. A native `<dialog>` does not close on that, and
|
|
133
|
+
* it is the gesture that most obviously means close.
|
|
134
|
+
*/
|
|
135
|
+
private readonly handleBackdrop;
|
|
136
|
+
protected updated(changed: PropertyValues): void;
|
|
137
|
+
protected render(): TemplateResult;
|
|
138
|
+
}
|
|
139
|
+
declare global {
|
|
140
|
+
interface HTMLElementTagNameMap {
|
|
141
|
+
'helix-headless-drawer': HelixHeadlessDrawer;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
export {};
|