@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,71 @@
|
|
|
1
|
+
import { HelixElement } from '@fusion.dev/helix-core';
|
|
2
|
+
import { type PropertyValues, type TemplateResult } from 'lit';
|
|
3
|
+
/** Initials for a name: first letter of the first and last words. */
|
|
4
|
+
export declare const initialsOf: (name: string) => string;
|
|
5
|
+
/**
|
|
6
|
+
* @summary Represents a person or entity with an image or their initials.
|
|
7
|
+
*
|
|
8
|
+
* @description
|
|
9
|
+
* Shows `src` until it fails to load. Without an image, or after a failure,
|
|
10
|
+
* the default slot is shown; its own fallback is the initials.
|
|
11
|
+
*
|
|
12
|
+
* The host carries the accessible name, taken from `name`, so the `<img>` has an
|
|
13
|
+
* empty `alt` and the initials are hidden from assistive technology. Announcing
|
|
14
|
+
* either would repeat the name. An `aria-label` on the host overrides `name`,
|
|
15
|
+
* for an avatar standing for something a person's name does not describe.
|
|
16
|
+
*
|
|
17
|
+
* `load` and `error` are relayed from the host. They are not composed, so they
|
|
18
|
+
* stop at the shadow boundary otherwise.
|
|
19
|
+
*
|
|
20
|
+
* @since 0.1.0
|
|
21
|
+
* @status stable
|
|
22
|
+
* @category media
|
|
23
|
+
* @aliases Profile picture, Gravatar
|
|
24
|
+
* @documentation https://helix.fusion.dev/components/avatar
|
|
25
|
+
*
|
|
26
|
+
* @slot - Shown when there is no usable image, in place of the initials.
|
|
27
|
+
*
|
|
28
|
+
* @event {Event} error - Relayed from the image when it fails.
|
|
29
|
+
* @event {Event} load - Relayed from the image once it has loaded.
|
|
30
|
+
*
|
|
31
|
+
* @csspart image - The image, when one is loading or loaded.
|
|
32
|
+
* @csspart initials - The initials shown when there is no usable image.
|
|
33
|
+
*/
|
|
34
|
+
export declare class HelixHeadlessAvatar extends HelixElement {
|
|
35
|
+
/**
|
|
36
|
+
* Image to show.
|
|
37
|
+
*
|
|
38
|
+
* Falls back to the slot, or to initials, if it fails.
|
|
39
|
+
*/
|
|
40
|
+
src: string;
|
|
41
|
+
/**
|
|
42
|
+
* Name of the person or entity.
|
|
43
|
+
*
|
|
44
|
+
* Used for the label and the initials.
|
|
45
|
+
*/
|
|
46
|
+
name: string;
|
|
47
|
+
/**
|
|
48
|
+
* Whether the image failed.
|
|
49
|
+
*
|
|
50
|
+
* The element's own observation, never set.
|
|
51
|
+
*/
|
|
52
|
+
private failed;
|
|
53
|
+
private readonly handleError;
|
|
54
|
+
private readonly handleLoad;
|
|
55
|
+
protected willUpdate(changed: PropertyValues): void;
|
|
56
|
+
protected render(): TemplateResult;
|
|
57
|
+
/**
|
|
58
|
+
* The mark shown where no image loaded, behind a seam a tier can move.
|
|
59
|
+
*
|
|
60
|
+
* A consumer replaces it by slotting something; a tier above replaces it by
|
|
61
|
+
* overriding this, and those answer different people. Written inline it
|
|
62
|
+
* answered only the first, and a styled tier wanting initials drawn its own
|
|
63
|
+
* way had to reimplement the whole template to reach three elements.
|
|
64
|
+
*/
|
|
65
|
+
protected renderInitials(): TemplateResult;
|
|
66
|
+
}
|
|
67
|
+
declare global {
|
|
68
|
+
interface HTMLElementTagNameMap {
|
|
69
|
+
'helix-headless-avatar': HelixHeadlessAvatar;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -0,0 +1,147 @@
|
|
|
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, state } from 'lit/decorators.js';
|
|
10
|
+
/** Initials for a name: first letter of the first and last words. */
|
|
11
|
+
export const initialsOf = (name) => {
|
|
12
|
+
const words = name.trim().split(/\s+/).filter(Boolean);
|
|
13
|
+
if (words.length === 0) {
|
|
14
|
+
return '';
|
|
15
|
+
}
|
|
16
|
+
/* By code point, not by code unit.
|
|
17
|
+
*
|
|
18
|
+
* `word[0]` indexes UTF-16, so a name beginning with anything outside the
|
|
19
|
+
* basic plane, an emoji or most of the world's less common scripts, yields a
|
|
20
|
+
* lone surrogate and the avatar paints U+FFFD. Spreading a string iterates
|
|
21
|
+
* code points, which is what a first letter means. */
|
|
22
|
+
const initial = (word) => [...(word ?? '')][0] ?? '';
|
|
23
|
+
const first = initial(words[0]);
|
|
24
|
+
const last = words.length > 1 ? initial(words[words.length - 1]) : '';
|
|
25
|
+
return (first + last).toUpperCase();
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* @summary Represents a person or entity with an image or their initials.
|
|
29
|
+
*
|
|
30
|
+
* @description
|
|
31
|
+
* Shows `src` until it fails to load. Without an image, or after a failure,
|
|
32
|
+
* the default slot is shown; its own fallback is the initials.
|
|
33
|
+
*
|
|
34
|
+
* The host carries the accessible name, taken from `name`, so the `<img>` has an
|
|
35
|
+
* empty `alt` and the initials are hidden from assistive technology. Announcing
|
|
36
|
+
* either would repeat the name. An `aria-label` on the host overrides `name`,
|
|
37
|
+
* for an avatar standing for something a person's name does not describe.
|
|
38
|
+
*
|
|
39
|
+
* `load` and `error` are relayed from the host. They are not composed, so they
|
|
40
|
+
* stop at the shadow boundary otherwise.
|
|
41
|
+
*
|
|
42
|
+
* @since 0.1.0
|
|
43
|
+
* @status stable
|
|
44
|
+
* @category media
|
|
45
|
+
* @aliases Profile picture, Gravatar
|
|
46
|
+
* @documentation https://helix.fusion.dev/components/avatar
|
|
47
|
+
*
|
|
48
|
+
* @slot - Shown when there is no usable image, in place of the initials.
|
|
49
|
+
*
|
|
50
|
+
* @event {Event} error - Relayed from the image when it fails.
|
|
51
|
+
* @event {Event} load - Relayed from the image once it has loaded.
|
|
52
|
+
*
|
|
53
|
+
* @csspart image - The image, when one is loading or loaded.
|
|
54
|
+
* @csspart initials - The initials shown when there is no usable image.
|
|
55
|
+
*/
|
|
56
|
+
let HelixHeadlessAvatar = class HelixHeadlessAvatar extends HelixElement {
|
|
57
|
+
constructor() {
|
|
58
|
+
super(...arguments);
|
|
59
|
+
/**
|
|
60
|
+
* Image to show.
|
|
61
|
+
*
|
|
62
|
+
* Falls back to the slot, or to initials, if it fails.
|
|
63
|
+
*/
|
|
64
|
+
this.src = '';
|
|
65
|
+
/**
|
|
66
|
+
* Name of the person or entity.
|
|
67
|
+
*
|
|
68
|
+
* Used for the label and the initials.
|
|
69
|
+
*/
|
|
70
|
+
this.name = '';
|
|
71
|
+
/**
|
|
72
|
+
* Whether the image failed.
|
|
73
|
+
*
|
|
74
|
+
* The element's own observation, never set.
|
|
75
|
+
*/
|
|
76
|
+
this.failed = false;
|
|
77
|
+
this.handleError = (event) => {
|
|
78
|
+
this.failed = true;
|
|
79
|
+
this.relayNativeEvent(event);
|
|
80
|
+
};
|
|
81
|
+
this.handleLoad = (event) => {
|
|
82
|
+
this.relayNativeEvent(event);
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
willUpdate(changed) {
|
|
86
|
+
super.willUpdate(changed);
|
|
87
|
+
/* A new source is a new attempt.
|
|
88
|
+
*
|
|
89
|
+
* `failed` is an observation about the image that was loading, and it
|
|
90
|
+
* outlived the image: it latched on the first error and nothing ever
|
|
91
|
+
* cleared it, so an avatar that failed once fell back to initials for the
|
|
92
|
+
* life of the element. A consumer swapping a broken URL for a good one, or
|
|
93
|
+
* a list reusing an avatar for the next person, got the initials forever
|
|
94
|
+
* and no error to say why. */
|
|
95
|
+
if (changed.has('src')) {
|
|
96
|
+
this.failed = false;
|
|
97
|
+
}
|
|
98
|
+
/* A role only where there is a name to carry.
|
|
99
|
+
*
|
|
100
|
+
* `role="img"` was asserted unconditionally, so an avatar with no `name`
|
|
101
|
+
* was an unnamed image: a screen reader announces "image" and stops, which
|
|
102
|
+
* is worse than announcing nothing, because nothing is what a decorative
|
|
103
|
+
* mark should be. With a name it is content and needs the role to hold it. */
|
|
104
|
+
hostAria(this.internals, {
|
|
105
|
+
label: this.name,
|
|
106
|
+
role: this.name === '' ? '' : 'img',
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
render() {
|
|
110
|
+
if (this.src !== '' && !this.failed) {
|
|
111
|
+
return html `<img
|
|
112
|
+
part="image"
|
|
113
|
+
src=${this.src}
|
|
114
|
+
alt=""
|
|
115
|
+
@error=${this.handleError}
|
|
116
|
+
@load=${this.handleLoad}
|
|
117
|
+
/>`;
|
|
118
|
+
}
|
|
119
|
+
return this.renderInitials();
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* The mark shown where no image loaded, behind a seam a tier can move.
|
|
123
|
+
*
|
|
124
|
+
* A consumer replaces it by slotting something; a tier above replaces it by
|
|
125
|
+
* overriding this, and those answer different people. Written inline it
|
|
126
|
+
* answered only the first, and a styled tier wanting initials drawn its own
|
|
127
|
+
* way had to reimplement the whole template to reach three elements.
|
|
128
|
+
*/
|
|
129
|
+
renderInitials() {
|
|
130
|
+
return html `<slot>
|
|
131
|
+
<span part="initials" aria-hidden="true">${initialsOf(this.name)}</span>
|
|
132
|
+
</slot>`;
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
__decorate([
|
|
136
|
+
property()
|
|
137
|
+
], HelixHeadlessAvatar.prototype, "src", void 0);
|
|
138
|
+
__decorate([
|
|
139
|
+
property()
|
|
140
|
+
], HelixHeadlessAvatar.prototype, "name", void 0);
|
|
141
|
+
__decorate([
|
|
142
|
+
state()
|
|
143
|
+
], HelixHeadlessAvatar.prototype, "failed", void 0);
|
|
144
|
+
HelixHeadlessAvatar = __decorate([
|
|
145
|
+
customElement('helix-headless-avatar')
|
|
146
|
+
], HelixHeadlessAvatar);
|
|
147
|
+
export { HelixHeadlessAvatar };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './root/badge-root.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './root/badge-root.js';
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { HelixElement } from '@fusion.dev/helix-core';
|
|
2
|
+
import { type TemplateResult } from 'lit';
|
|
3
|
+
/**
|
|
4
|
+
* @summary Attaches a count or a presence mark to another element.
|
|
5
|
+
*
|
|
6
|
+
* @description
|
|
7
|
+
* Wraps whatever it decorates and pins the indicator to its corner, so the
|
|
8
|
+
* thing being counted stays the thing in the layout: a badge is an annotation,
|
|
9
|
+
* not a container that happens to hold an icon.
|
|
10
|
+
*
|
|
11
|
+
* The indicator says how many, and none is none. A `value` that reads as zero
|
|
12
|
+
* shows no mark at all, an absent one shows a bare dot, and any other value
|
|
13
|
+
* shows the value. `max` caps the top: past it the indicator reads `{max}+`
|
|
14
|
+
* rather than growing to fit, since a corner mark that widens with its value
|
|
15
|
+
* pushes the layout around.
|
|
16
|
+
*
|
|
17
|
+
* **A dot needs a label.** Without one it is a colored circle that announces
|
|
18
|
+
* nothing, which tells a sighted reader there is something new and tells
|
|
19
|
+
* everyone else there is not. The label is required in that form, and the
|
|
20
|
+
* indicator is hidden from assistive technology when a number already says it.
|
|
21
|
+
*
|
|
22
|
+
* @since 0.1.0
|
|
23
|
+
* @status stable
|
|
24
|
+
* @category markers
|
|
25
|
+
* @aliases Count, Indicator, Pip
|
|
26
|
+
* @documentation https://helix.fusion.dev/components/badge
|
|
27
|
+
*
|
|
28
|
+
* @slot - The element being decorated.
|
|
29
|
+
*
|
|
30
|
+
* @csspart indicator - The count, or the dot when there is no value.
|
|
31
|
+
*/
|
|
32
|
+
export declare class HelixHeadlessBadge extends HelixElement {
|
|
33
|
+
/**
|
|
34
|
+
* The count or short text to show.
|
|
35
|
+
*
|
|
36
|
+
* Absent shows a dot, zero shows nothing.
|
|
37
|
+
*/
|
|
38
|
+
value: string;
|
|
39
|
+
/**
|
|
40
|
+
* Cap for a numeric value.
|
|
41
|
+
*
|
|
42
|
+
* Past it the indicator reads `{max}+`.
|
|
43
|
+
*/
|
|
44
|
+
max?: number;
|
|
45
|
+
/**
|
|
46
|
+
* Accessible name.
|
|
47
|
+
*
|
|
48
|
+
* Required for a dot, which has no text to read.
|
|
49
|
+
*/
|
|
50
|
+
label: string;
|
|
51
|
+
/** Whether the value counts nothing, in which case there is no mark. */
|
|
52
|
+
private get blank();
|
|
53
|
+
/** What the indicator reads, once the cap has been applied. */
|
|
54
|
+
private get text();
|
|
55
|
+
protected render(): TemplateResult;
|
|
56
|
+
}
|
|
57
|
+
declare global {
|
|
58
|
+
interface HTMLElementTagNameMap {
|
|
59
|
+
'helix-headless-badge': HelixHeadlessBadge;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { customElement, HelixElement } from '@fusion.dev/helix-core';
|
|
8
|
+
import { html, nothing } from 'lit';
|
|
9
|
+
import { property } from 'lit/decorators.js';
|
|
10
|
+
/**
|
|
11
|
+
* @summary Attaches a count or a presence mark to another element.
|
|
12
|
+
*
|
|
13
|
+
* @description
|
|
14
|
+
* Wraps whatever it decorates and pins the indicator to its corner, so the
|
|
15
|
+
* thing being counted stays the thing in the layout: a badge is an annotation,
|
|
16
|
+
* not a container that happens to hold an icon.
|
|
17
|
+
*
|
|
18
|
+
* The indicator says how many, and none is none. A `value` that reads as zero
|
|
19
|
+
* shows no mark at all, an absent one shows a bare dot, and any other value
|
|
20
|
+
* shows the value. `max` caps the top: past it the indicator reads `{max}+`
|
|
21
|
+
* rather than growing to fit, since a corner mark that widens with its value
|
|
22
|
+
* pushes the layout around.
|
|
23
|
+
*
|
|
24
|
+
* **A dot needs a label.** Without one it is a colored circle that announces
|
|
25
|
+
* nothing, which tells a sighted reader there is something new and tells
|
|
26
|
+
* everyone else there is not. The label is required in that form, and the
|
|
27
|
+
* indicator is hidden from assistive technology when a number already says it.
|
|
28
|
+
*
|
|
29
|
+
* @since 0.1.0
|
|
30
|
+
* @status stable
|
|
31
|
+
* @category markers
|
|
32
|
+
* @aliases Count, Indicator, Pip
|
|
33
|
+
* @documentation https://helix.fusion.dev/components/badge
|
|
34
|
+
*
|
|
35
|
+
* @slot - The element being decorated.
|
|
36
|
+
*
|
|
37
|
+
* @csspart indicator - The count, or the dot when there is no value.
|
|
38
|
+
*/
|
|
39
|
+
let HelixHeadlessBadge = class HelixHeadlessBadge extends HelixElement {
|
|
40
|
+
constructor() {
|
|
41
|
+
super(...arguments);
|
|
42
|
+
/**
|
|
43
|
+
* The count or short text to show.
|
|
44
|
+
*
|
|
45
|
+
* Absent shows a dot, zero shows nothing.
|
|
46
|
+
*/
|
|
47
|
+
this.value = '';
|
|
48
|
+
/**
|
|
49
|
+
* Accessible name.
|
|
50
|
+
*
|
|
51
|
+
* Required for a dot, which has no text to read.
|
|
52
|
+
*/
|
|
53
|
+
this.label = '';
|
|
54
|
+
}
|
|
55
|
+
/** Whether the value counts nothing, in which case there is no mark. */
|
|
56
|
+
get blank() {
|
|
57
|
+
return this.value.trim() !== '' && Number(this.value) === 0;
|
|
58
|
+
}
|
|
59
|
+
/** What the indicator reads, once the cap has been applied. */
|
|
60
|
+
get text() {
|
|
61
|
+
const count = Number(this.value);
|
|
62
|
+
if (this.max !== undefined && Number.isFinite(count) && count > this.max) {
|
|
63
|
+
return `${this.max}+`;
|
|
64
|
+
}
|
|
65
|
+
return this.value;
|
|
66
|
+
}
|
|
67
|
+
render() {
|
|
68
|
+
const blank = this.blank;
|
|
69
|
+
const text = this.text;
|
|
70
|
+
/* A mark with text is content and is announced; a dot is decoration and is
|
|
71
|
+
not.
|
|
72
|
+
*
|
|
73
|
+
* This asked for a `label` as well, so a badge showing a count and no label
|
|
74
|
+
* was `aria-hidden` and the number it exists to show reached nobody using a
|
|
75
|
+
* screen reader. The number is its own name where none is given, which is
|
|
76
|
+
* why `aria-label` is now conditional on the label rather than on this: a
|
|
77
|
+
* `4` announces as "4" from the text, and `label="4 unread"` says the
|
|
78
|
+
* better thing.
|
|
79
|
+
*
|
|
80
|
+
* A dot with no label still says nothing, which is the deliberate half: a
|
|
81
|
+
* dot means "something here" and cannot say what, so naming it is the
|
|
82
|
+
* consumer's to do and silence is better than "badge". */
|
|
83
|
+
const announced = !blank && (text !== '' || this.label !== '');
|
|
84
|
+
// The indicator holds the text and nothing else, so an absent value leaves
|
|
85
|
+
// it empty and `[part="indicator"]:empty` is what draws the dot. Lit's
|
|
86
|
+
// marker comments do not affect `:empty`, but a whitespace text node does,
|
|
87
|
+
// which is why the tags close the way they do.
|
|
88
|
+
//
|
|
89
|
+
// It stays mounted when there is nothing to show, so the styled tier can
|
|
90
|
+
// transition it out rather than having it vanish between frames. Both
|
|
91
|
+
// markers are on the shadow content, not the host, so they cost no
|
|
92
|
+
// attribute a consumer's server markup would have to match.
|
|
93
|
+
//
|
|
94
|
+
// `single` is what lets a one-character mark be a circle. Whether the text
|
|
95
|
+
// fits inside the square is a fact about the string, and CSS cannot count
|
|
96
|
+
// characters.
|
|
97
|
+
return html `<slot></slot>
|
|
98
|
+
<span
|
|
99
|
+
part="indicator"
|
|
100
|
+
data-blank=${blank ? '' : nothing}
|
|
101
|
+
data-single=${text.length <= 1 ? '' : nothing}
|
|
102
|
+
role=${announced ? 'status' : nothing}
|
|
103
|
+
aria-label=${this.label !== '' && announced ? this.label : nothing}
|
|
104
|
+
aria-hidden=${announced ? nothing : 'true'}
|
|
105
|
+
>${text}</span
|
|
106
|
+
>`;
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
__decorate([
|
|
110
|
+
property()
|
|
111
|
+
], HelixHeadlessBadge.prototype, "value", void 0);
|
|
112
|
+
__decorate([
|
|
113
|
+
property({ type: Number })
|
|
114
|
+
], HelixHeadlessBadge.prototype, "max", void 0);
|
|
115
|
+
__decorate([
|
|
116
|
+
property()
|
|
117
|
+
], HelixHeadlessBadge.prototype, "label", void 0);
|
|
118
|
+
HelixHeadlessBadge = __decorate([
|
|
119
|
+
customElement('helix-headless-badge')
|
|
120
|
+
], HelixHeadlessBadge);
|
|
121
|
+
export { HelixHeadlessBadge };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './root/bar-chart-root.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './root/bar-chart-root.js';
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
import { HelixElement, type Series } from '@fusion.dev/helix-core';
|
|
2
|
+
import { nothing, type PropertyValues, type TemplateResult } from 'lit';
|
|
3
|
+
import '../../tooltip/index.js';
|
|
4
|
+
declare const HelixHeadlessBarChart_base: typeof HelixElement & (new (...args: any[]) => import("@fusion.dev/helix-core").MixinChartSourceInterface);
|
|
5
|
+
/**
|
|
6
|
+
* @summary Categories as columns, read from a table.
|
|
7
|
+
*
|
|
8
|
+
* @description
|
|
9
|
+
* The chart most often asked for and the one most often drawn wrongly, so two
|
|
10
|
+
* decisions are made here rather than left to a consumer.
|
|
11
|
+
*
|
|
12
|
+
* **It measures from zero and there is no property to change that.** A bar's
|
|
13
|
+
* length *is* its value, so a baseline anywhere else makes the lengths
|
|
14
|
+
* proportional to nothing. That is the oldest misleading chart there is, and a
|
|
15
|
+
* design system that ships the switch has shipped the mistake. A reader who
|
|
16
|
+
* wants the differences between values rather than the values should be drawing
|
|
17
|
+
* a line, which claims only a shape.
|
|
18
|
+
*
|
|
19
|
+
* **The labels are HTML beside the drawing rather than `<text>` inside it.** An
|
|
20
|
+
* `<svg>` that fills its box scales everything in it, including type: the same
|
|
21
|
+
* `font-size` comes out at 10px in a narrow chart and 43px in a wide one, and
|
|
22
|
+
* there is no non-scaling-font to answer it the way `vector-effect` answers
|
|
23
|
+
* strokes. So the columns are drawn and the words are written around them.
|
|
24
|
+
*
|
|
25
|
+
* The table is the accessible representation and this drawing is `aria-hidden`.
|
|
26
|
+
* A reader who wants the numbers gets the numbers, not a described picture of
|
|
27
|
+
* them.
|
|
28
|
+
*
|
|
29
|
+
* The properties below are written by this component and read by whoever draws
|
|
30
|
+
* it. A consumer sets none of them: they carry a number this element computed
|
|
31
|
+
* and CSS cannot, which is what lets a stylesheet on this tier draw the thing
|
|
32
|
+
* without measuring anything itself.
|
|
33
|
+
*
|
|
34
|
+
* @since 0.1.0
|
|
35
|
+
* @status experimental
|
|
36
|
+
* @category charts
|
|
37
|
+
* @aliases Column Chart, Categorical Chart
|
|
38
|
+
* @documentation https://helix.fusion.dev/components/bar-chart
|
|
39
|
+
*
|
|
40
|
+
* @csspart axis - One scale's numbers, drawn only when `secondary` splits them.
|
|
41
|
+
* @csspart band - The slot the pointer is resting in.
|
|
42
|
+
* @csspart bar - One column.
|
|
43
|
+
* @csspart bar-wash-end - The far stop of a bar's gradient, where one is used.
|
|
44
|
+
* @csspart bar-wash-start - The stop of a bar's gradient at its base.
|
|
45
|
+
* @csspart baseline - The rule the columns stand on.
|
|
46
|
+
* @csspart gridline - One rule across the plot, under `gridlines`.
|
|
47
|
+
* @csspart group - One category's columns, together.
|
|
48
|
+
* @csspart label - One category's name.
|
|
49
|
+
* @csspart labels - The row of category names.
|
|
50
|
+
* @csspart line - A series drawn as a line rather than as columns, under `lines`.
|
|
51
|
+
* @csspart mark - The invisible point the tooltip is anchored to.
|
|
52
|
+
* @csspart plot - The drawing.
|
|
53
|
+
* @csspart svg - The drawing surface the bars and lines sit on.
|
|
54
|
+
* @csspart tick - One number on an axis.
|
|
55
|
+
* @csspart tooltip - The bubble, forwarded from `Tooltip`.
|
|
56
|
+
* @csspart tooltip-anchor - The `Tooltip` element itself.
|
|
57
|
+
* @csspart tooltip-cell - One column's name and value inside the tooltip.
|
|
58
|
+
* @csspart tooltip-label - The reading's own name inside the tooltip.
|
|
59
|
+
* @csspart tooltip-name - A column's name inside the tooltip.
|
|
60
|
+
* @csspart tooltip-value - A column's value inside the tooltip.
|
|
61
|
+
*
|
|
62
|
+
* @cssproperty --bar-chart-axis - The color of a single-series axis, taken from that series.
|
|
63
|
+
* @cssproperty --bar-chart-secondary - The color of the secondary axis when one series owns it. It resolves a `--helix-color-series-*` token, so on the headless tier alone it names something that is not there. #138.
|
|
64
|
+
* @cssproperty --chart-bar-wash - The gradient a bar would take, named per bar so the
|
|
65
|
+
* styled tier can point `fill` at it. Drawn whatever the treatment and used only where
|
|
66
|
+
* `wash="gradient"` asks for it.
|
|
67
|
+
*/
|
|
68
|
+
export declare class HelixHeadlessBarChart extends HelixHeadlessBarChart_base {
|
|
69
|
+
/**
|
|
70
|
+
* Whether the categories run down the side rather than along the bottom.
|
|
71
|
+
*
|
|
72
|
+
* Absent is columns. `horizontal` is the one to reach for when the category
|
|
73
|
+
* names are words rather than dates: a row of long names either overlaps or
|
|
74
|
+
* turns on its side, and neither is as readable as putting them down the left
|
|
75
|
+
* where they read normally.
|
|
76
|
+
*/
|
|
77
|
+
direction?: 'horizontal';
|
|
78
|
+
/**
|
|
79
|
+
* Which rules are drawn across the plot, if any.
|
|
80
|
+
*
|
|
81
|
+
* Absent draws none. `value` rules the axis the columns are *measured* on,
|
|
82
|
+
* `category` rules the axis they are *arranged* on with one through each
|
|
83
|
+
* group, and `both` draws both. Which of those is horizontal turns with
|
|
84
|
+
* `direction`, because a rule belongs to an axis and not to a screen edge.
|
|
85
|
+
*
|
|
86
|
+
* **A bare `gridlines` means `value`**, and so does anything unrecognised: an
|
|
87
|
+
* unrecognised value that draws nothing is indistinguishable from the
|
|
88
|
+
* attribute being absent, which is the one thing a reader cannot debug.
|
|
89
|
+
*
|
|
90
|
+
* `category` is the quieter half of this on a bar chart and is here for
|
|
91
|
+
* completeness rather than because it is usually right: columns already
|
|
92
|
+
* divide the categories by being separate columns, and a rule through each
|
|
93
|
+
* one is a second statement of the same fact. It earns its place on a chart
|
|
94
|
+
* of many thin bars, where the eye has stopped counting.
|
|
95
|
+
*
|
|
96
|
+
* Furniture rather than data, so the rules are inside the `aria-hidden` plot
|
|
97
|
+
* and reach no reader through the table.
|
|
98
|
+
*/
|
|
99
|
+
gridlines?: 'both' | 'category' | 'value';
|
|
100
|
+
/**
|
|
101
|
+
* Which series are drawn as a line instead of as columns, by name.
|
|
102
|
+
*
|
|
103
|
+
* Space separated, matched against the column headings the table gives, so a
|
|
104
|
+
* chart says `lines="Margin"` rather than counting columns. Names because
|
|
105
|
+
* they are what the table already carries and what the legend already shows:
|
|
106
|
+
* an index is a fourth place the column order is written down and the first
|
|
107
|
+
* one to go stale when somebody moves a column.
|
|
108
|
+
*
|
|
109
|
+
* **A combination chart is one scale, and that is the honest half of it.**
|
|
110
|
+
* Both marks are measured against the same domain, so a line here says
|
|
111
|
+
* something comparable to the columns beside it. The usual reason to reach
|
|
112
|
+
* for a combination chart is the other thing, a count against a percentage on
|
|
113
|
+
* a second axis, and that is deliberately not this: two scales on one frame
|
|
114
|
+
* let the author put any two shapes in any relation by choosing the ranges,
|
|
115
|
+
* and the reader has no way to see it happening.
|
|
116
|
+
*
|
|
117
|
+
* A line among columns still measures from zero, because the columns do and
|
|
118
|
+
* they share the axis. That is the trade for comparability, and it is why
|
|
119
|
+
* this is a bar chart that can carry a line rather than a line chart that can
|
|
120
|
+
* carry columns.
|
|
121
|
+
*/
|
|
122
|
+
lines?: string;
|
|
123
|
+
/**
|
|
124
|
+
* Which series are measured against a scale of their own, by name.
|
|
125
|
+
*
|
|
126
|
+
* Space separated and matched the way `lines` is, against the column headings
|
|
127
|
+
* the table gives. Opt in: absent, every series shares one domain, which is
|
|
128
|
+
* what makes a chart comparable and is the right default.
|
|
129
|
+
*
|
|
130
|
+
* **Two scales on one frame let an author put any two shapes in any relation
|
|
131
|
+
* by choosing the ranges, and a reader cannot see it happening.** That is not
|
|
132
|
+
* a caveat, it is what the feature does: a line that crosses the columns
|
|
133
|
+
* twice and a line that never touches them can be the same two series drawn
|
|
134
|
+
* against different ranges. It earns its place when the two quantities are
|
|
135
|
+
* genuinely incomparable, a count against a percentage, and it is a way to
|
|
136
|
+
* mislead in every other case.
|
|
137
|
+
*
|
|
138
|
+
* **So it draws its axes**, and that is not optional here. The chart renders
|
|
139
|
+
* no value axis at all when there is one scale, because the columns are
|
|
140
|
+
* measured against each other and a reader needs no numbers to do that. With
|
|
141
|
+
* two, a reader has no way of knowing there are two, let alone which series
|
|
142
|
+
* is on which, so both scales are labeled the moment this is set. An
|
|
143
|
+
* unlabelled second axis is the deceptive case rather than the tidy one.
|
|
144
|
+
*
|
|
145
|
+
* The grid stays on the primary axis, since a rule measured against two
|
|
146
|
+
* scales at once is a rule that means nothing. The tooltip is unaffected: it
|
|
147
|
+
* has always shown every column's own number, which is the reader's way out
|
|
148
|
+
* of any scale question the picture raises.
|
|
149
|
+
*/
|
|
150
|
+
secondary?: string;
|
|
151
|
+
/** The series names on the second scale, lowercased and trimmed. */
|
|
152
|
+
private get scaled();
|
|
153
|
+
/** The series names drawn as a line, lowercased and trimmed for matching. */
|
|
154
|
+
private get lined();
|
|
155
|
+
/** Whether the levels are ruled, which is every value but `category`. */
|
|
156
|
+
protected get rulesValue(): boolean;
|
|
157
|
+
/** Whether each category is ruled, which only two values ask for. */
|
|
158
|
+
protected get rulesCategory(): boolean;
|
|
159
|
+
/**
|
|
160
|
+
* Tells the pointer which way the categories run.
|
|
161
|
+
*
|
|
162
|
+
* In `willUpdate` because `direction` is a property a consumer can change at
|
|
163
|
+
* any time, and the controller resolves a reading from whichever axis it was
|
|
164
|
+
* last told about: set once at connect, a chart turned sideways after that
|
|
165
|
+
* would go on reading x and answer with the same row wherever the pointer
|
|
166
|
+
* went. That is the bug this pair was written for, one step later.
|
|
167
|
+
*
|
|
168
|
+
* `willUpdate` and not `updated`, because SSR calls the first and not the
|
|
169
|
+
* second, and a value the server and the client disagree about is worse than
|
|
170
|
+
* one neither has.
|
|
171
|
+
*/
|
|
172
|
+
protected willUpdate(changed: PropertyValues<this>): void;
|
|
173
|
+
protected render(): TemplateResult;
|
|
174
|
+
/**
|
|
175
|
+
* The columns themselves, behind a seam the styled tier can move.
|
|
176
|
+
*
|
|
177
|
+
* `aria-hidden`, because the table it was read from is the readable version
|
|
178
|
+
* and a screen reader hearing both hears the same numbers twice.
|
|
179
|
+
*/
|
|
180
|
+
protected renderPlot(series: Series[], categories: string[], y: (value: number) => number, domain: [number, number], floor: number, z?: (value: number) => number): TemplateResult;
|
|
181
|
+
/**
|
|
182
|
+
* The numbers along one scale, drawn only where there are two of them.
|
|
183
|
+
*
|
|
184
|
+
* **A chart with one scale renders no axis, on purpose.** Columns measured
|
|
185
|
+
* against each other need no numbers to be compared, and a row of them beside
|
|
186
|
+
* a small chart is furniture that makes the drawing smaller for no reading a
|
|
187
|
+
* reader was going to do. With two scales that argument inverts: a reader
|
|
188
|
+
* cannot tell there are two, cannot tell which series is on which, and cannot
|
|
189
|
+
* recover either from the picture. So this appears with `secondary` and never
|
|
190
|
+
* without it.
|
|
191
|
+
*
|
|
192
|
+
* **Beside the plot and not inside it**, which is the second thing this got
|
|
193
|
+
* wrong. Inside, the numbers are drawn over the drawing, and a horizontal
|
|
194
|
+
* chart shows it immediately: its value axis runs along the bottom, which is
|
|
195
|
+
* where the last row of bars is. The vertical case has the same fault and
|
|
196
|
+
* enough slack to hide it. The plot is also the pointer's catchment and the
|
|
197
|
+
* tooltip's containing block, both measured from its box, so padding it to
|
|
198
|
+
* make room would move every reading half an axis to the right.
|
|
199
|
+
*
|
|
200
|
+
* A column of the host grid instead, which the stylesheet grows only when
|
|
201
|
+
* `secondary` is set. That is what the property reflects for.
|
|
202
|
+
*
|
|
203
|
+
* The primary hugs the edge the drawing starts at and the secondary the edge
|
|
204
|
+
* it ends at: down the two sides for columns, along the bottom and top for
|
|
205
|
+
* bars, which is where each axis is when the chart is turned.
|
|
206
|
+
*/
|
|
207
|
+
protected renderAxis(scale: (value: number) => number, domain: [number, number], which: 'primary' | 'secondary', sideways: boolean, widest: number, tint?: string): TemplateResult;
|
|
208
|
+
/**
|
|
209
|
+
* The grid, behind everything, or nothing at all.
|
|
210
|
+
*
|
|
211
|
+
* Across the measured axis, which turns with `direction`: a rule belongs to
|
|
212
|
+
* the axis the bars are measured on and not the one they are arranged on, so
|
|
213
|
+
* columns get horizontal rules and rows get vertical ones. Getting that
|
|
214
|
+
* backwards draws a grid that divides the categories, which are already
|
|
215
|
+
* divided by being separate bars.
|
|
216
|
+
*
|
|
217
|
+
* Drawn before the baseline, so where a gridline and zero coincide the
|
|
218
|
+
* baseline is what shows: zero is a fact about the data and a gridline is a
|
|
219
|
+
* ruler.
|
|
220
|
+
*/
|
|
221
|
+
protected renderGridlines(y: (value: number) => number, domain: [number, number], sideways: boolean, count: number): TemplateResult | typeof nothing;
|
|
222
|
+
/**
|
|
223
|
+
* The slot the pointer is resting in, drawn behind the columns.
|
|
224
|
+
*
|
|
225
|
+
* **The honest version of the fade.** A group under the pointer already sets
|
|
226
|
+
* `data-active` and the stylesheet dims the others, which says which group is
|
|
227
|
+
* meant by making four of five quieter: it reads as the chart losing
|
|
228
|
+
* confidence rather than as one column being pointed at. A band says the same
|
|
229
|
+
* thing by lighting the region the pointer is actually in, and the region is
|
|
230
|
+
* the whole slot, because that is the catchment the pointer resolves against.
|
|
231
|
+
*
|
|
232
|
+
* Both are kept. The fade separates the active group from its neighbours and
|
|
233
|
+
* the band says where the neighbourhood is, and on a chart of two categories
|
|
234
|
+
* the fade alone is ambiguous about which half is lit.
|
|
235
|
+
*/
|
|
236
|
+
protected renderBand(count: number, sideways: boolean): TemplateResult | typeof nothing;
|
|
237
|
+
protected renderLabels(categories: string[]): TemplateResult;
|
|
238
|
+
/**
|
|
239
|
+
* One series drawn as a line across the categories, behind a seam.
|
|
240
|
+
*
|
|
241
|
+
* Through the middle of each slot, which is where the group stands, so a
|
|
242
|
+
* point sits over its own columns rather than over the gap between two of
|
|
243
|
+
* them. The same arithmetic the category gridlines use, and for the same
|
|
244
|
+
* reason: the reading is the thing, the boundary is only where the pointer
|
|
245
|
+
* changes its mind.
|
|
246
|
+
*
|
|
247
|
+
* `data-series` keeps the index the series has among *all* of them, not among
|
|
248
|
+
* the lines, so the color a line takes is the color the legend gives it and
|
|
249
|
+
* moving a column between marks does not repaint the chart.
|
|
250
|
+
*/
|
|
251
|
+
protected renderLine(one: Series, depth: number, slot: number, y: (value: number) => number, sideways: boolean): TemplateResult;
|
|
252
|
+
/**
|
|
253
|
+
* What a pointer resting on a reading shows.
|
|
254
|
+
*
|
|
255
|
+
* A seam over `drawTooltip`, which holds the markup every chart shares. The
|
|
256
|
+
* usual reason to override is arrangement: every cell of the row is already
|
|
257
|
+
* there, including the columns nothing was plotted from.
|
|
258
|
+
*/
|
|
259
|
+
protected renderTooltip(): TemplateResult | typeof nothing;
|
|
260
|
+
}
|
|
261
|
+
declare global {
|
|
262
|
+
interface HTMLElementTagNameMap {
|
|
263
|
+
'helix-headless-bar-chart': HelixHeadlessBarChart;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
export {};
|