@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,215 @@
|
|
|
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, HelixSelectEvent, hostAria } from '@fusion.dev/helix-core';
|
|
8
|
+
import { check, circle, record } from '@fusion.dev/helix-icons';
|
|
9
|
+
import { property } from 'lit/decorators.js';
|
|
10
|
+
import { unsafeSVG } from 'lit/directives/unsafe-svg.js';
|
|
11
|
+
import { html } from 'lit/static-html.js';
|
|
12
|
+
/* Side-effect import, because this renders a button and a custom element
|
|
13
|
+
registers on import. The path is relative, so this registers the base button
|
|
14
|
+
and the styled file's identical import registers the styled one; `tier` picks
|
|
15
|
+
which name the template asks for. `check:composed` enforces both. */
|
|
16
|
+
import '../../button/index.js';
|
|
17
|
+
/**
|
|
18
|
+
* @summary One stage in a sequence.
|
|
19
|
+
*
|
|
20
|
+
* @description
|
|
21
|
+
* **The name is a button, and only the name.** A stepper is something a reader
|
|
22
|
+
* goes back through, and the thing they reach for is the name of the stage. The
|
|
23
|
+
* marker is `aria-hidden` decoration, so wrapping it in the button would add
|
|
24
|
+
* hit area and no meaning: the accessible name would be the text either way,
|
|
25
|
+
* and what is pressable would stop being the same shape as what is readable.
|
|
26
|
+
*
|
|
27
|
+
* It is `helix-button`, not a `<button>` this element resets and dresses. The
|
|
28
|
+
* hover wash, the focus ring, the disabled treatment and the way the label sits
|
|
29
|
+
* against an icon are all decisions the button already carries, and a second
|
|
30
|
+
* copy of them here is a second copy to keep in step. `ghost` is the quiet
|
|
31
|
+
* shape: transparent until it is pointed at.
|
|
32
|
+
*
|
|
33
|
+
* It says nothing about where a reader may go. Every step is pressable and
|
|
34
|
+
* announces itself with `helix-select`; refusing the ones ahead is `disabled`,
|
|
35
|
+
* which the consumer sets because only the consumer knows whether a form can be
|
|
36
|
+
* skipped. A component that guessed would be wrong on the first wizard that
|
|
37
|
+
* lets you jump to the end.
|
|
38
|
+
*
|
|
39
|
+
* **The marker is a slot whose fallback is the state.** A finished stage shows
|
|
40
|
+
* a check, the current one a target, and one not yet reached an empty ring:
|
|
41
|
+
* three marks that say what a reader wants to know without a legend. A consumer
|
|
42
|
+
* who wants their own fills the slot instead.
|
|
43
|
+
*
|
|
44
|
+
* The step renders exactly one of the three, chosen from its own two booleans.
|
|
45
|
+
* Rendering all three and hiding two in CSS would work and is worse: the
|
|
46
|
+
* accessibility tree would carry marks that are not there, and the markup would
|
|
47
|
+
* say three things about a stage that is one.
|
|
48
|
+
*
|
|
49
|
+
* Numbering is a separate question and belongs to the tier above. `numeric`
|
|
50
|
+
* hides the mark and shows a CSS counter, which the browser resolves at layout,
|
|
51
|
+
* so the digit costs no script and is right in the server's markup however the
|
|
52
|
+
* steps are ordered. Nothing here knows which appearance is in use, and does
|
|
53
|
+
* not need to.
|
|
54
|
+
*
|
|
55
|
+
* **`complete` and `current` are separate, and both can be false.** A stage
|
|
56
|
+
* that is neither is one the reader has not reached, which is the majority of
|
|
57
|
+
* any sequence and therefore the state that needs no attribute. They can also
|
|
58
|
+
* both be true: a reader who steps back into a finished stage is in it and has
|
|
59
|
+
* finished it, and a stepper that forgets the second is one that loses its
|
|
60
|
+
* checks the moment somebody reviews their answers.
|
|
61
|
+
*
|
|
62
|
+
* **The `content` slot opens on the current step, and only down a column.** A
|
|
63
|
+
* row has no room under a step to put a form in, and stretching one to fit
|
|
64
|
+
* would set every step's height by the tallest. `current` is what opens it, so
|
|
65
|
+
* the state that says where the reader is is also the state that shows them the
|
|
66
|
+
* stage: one attribute, no second flag to keep in step with it, and it renders
|
|
67
|
+
* open on the server rather than after hydration.
|
|
68
|
+
*
|
|
69
|
+
* @since 0.1.0
|
|
70
|
+
* @status experimental
|
|
71
|
+
* @aliases Stage
|
|
72
|
+
* @documentation https://helix.fusion.dev/components/steps
|
|
73
|
+
*
|
|
74
|
+
* @slot - The step's name.
|
|
75
|
+
* @slot content - What the stage holds, shown while it is the current one.
|
|
76
|
+
* @slot description - A line under the name, for what the stage is for.
|
|
77
|
+
* @slot marker - Replaces the number, or the check a complete step shows.
|
|
78
|
+
*
|
|
79
|
+
* @event {HelixSelectEvent} helix-select - Fired when the step is pressed. Cancelable: refusing it takes the decision and nothing moves.
|
|
80
|
+
*
|
|
81
|
+
* @csspart body - The name and its description.
|
|
82
|
+
* @csspart content - What the stage holds, while it is open.
|
|
83
|
+
* @csspart description - The line under it.
|
|
84
|
+
* @csspart label - The step's name, which is a `helix-button`.
|
|
85
|
+
* @csspart label-button - The inner control.
|
|
86
|
+
* @csspart lead - The half line arriving from the step before.
|
|
87
|
+
* @csspart mark - The glyph inside the marker: a tick, a dot, or an empty ring.
|
|
88
|
+
* @csspart marker - The shape carrying the number or the check.
|
|
89
|
+
* @csspart trail - The half line running on to the next.
|
|
90
|
+
*/
|
|
91
|
+
let HelixHeadlessStep = class HelixHeadlessStep extends HelixElement {
|
|
92
|
+
constructor() {
|
|
93
|
+
super(...arguments);
|
|
94
|
+
/**
|
|
95
|
+
* Whether the reader has finished this stage.
|
|
96
|
+
*/
|
|
97
|
+
this.complete = false;
|
|
98
|
+
/**
|
|
99
|
+
* Whether this is the stage the reader is in.
|
|
100
|
+
*/
|
|
101
|
+
this.current = false;
|
|
102
|
+
/**
|
|
103
|
+
* Whether the reader may go to this stage.
|
|
104
|
+
*/
|
|
105
|
+
this.disabled = false;
|
|
106
|
+
/**
|
|
107
|
+
* What this stage is called when it announces itself.
|
|
108
|
+
*/
|
|
109
|
+
this.value = '';
|
|
110
|
+
}
|
|
111
|
+
/** Announces the step, unless it is refusing. */
|
|
112
|
+
select() {
|
|
113
|
+
if (this.disabled) {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
this.dispatchEvent(new HelixSelectEvent({ value: this.value }));
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* The mark this stage's state calls for.
|
|
120
|
+
*
|
|
121
|
+
* `complete` first, so a stage a reader has stepped back into keeps its check
|
|
122
|
+
* rather than losing it to the target: they did finish it, and the name and
|
|
123
|
+
* the rule below still say which one is open.
|
|
124
|
+
*
|
|
125
|
+
* **Three shapes, and the reader can tell them apart with the color off.**
|
|
126
|
+
* An outline circle for a stage nobody has reached, the same circle with a
|
|
127
|
+
* center for the one they are standing on, a bare check for one that is done.
|
|
128
|
+
* The first two are one shape filling in, which is the progression, and the
|
|
129
|
+
* check is the only mark that leaves the family because finishing is the only
|
|
130
|
+
* state that is not a position in the sequence.
|
|
131
|
+
*
|
|
132
|
+
* What went was the coin around the check: a filled disc carrying a check
|
|
133
|
+
* beside a filled disc carrying a ring put two of the three inside the same
|
|
134
|
+
* container, and left hue doing most of the work of telling them apart.
|
|
135
|
+
*
|
|
136
|
+
* The bare check is `Timeline`'s, deliberately: the two components report the
|
|
137
|
+
* same kind of thing, a sequence with marks down it, and a check floating on
|
|
138
|
+
* a hairline in one beside a check inside a green coin in the other was two
|
|
139
|
+
* answers to one question. Timeline's rings came off the same day.
|
|
140
|
+
*/
|
|
141
|
+
renderMarker() {
|
|
142
|
+
const icon = this.complete ? check : this.current ? record : circle;
|
|
143
|
+
return html `<slot name="marker"
|
|
144
|
+
><svg part="mark" fill="currentColor" viewBox=${icon.viewBox}
|
|
145
|
+
>${unsafeSVG(icon.content)}</svg
|
|
146
|
+
></slot
|
|
147
|
+
>`;
|
|
148
|
+
}
|
|
149
|
+
willUpdate(changed) {
|
|
150
|
+
super.willUpdate(changed);
|
|
151
|
+
hostAria(this.internals, { role: 'listitem' });
|
|
152
|
+
this.internals.ariaCurrent = this.current ? 'step' : null;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* The step's own label, which is a control because a step can be gone to, behind a seam the styled tier can move.
|
|
156
|
+
*
|
|
157
|
+
* A method rather than a fragment inline, so a tier above can render its own,
|
|
158
|
+
* wrap this one, pass it a property the base does not know about, or leave it
|
|
159
|
+
* out, without reimplementing the whole template to do any of them. The tag is
|
|
160
|
+
* interpolated rather than written, so `tier` resolves it: this renders the
|
|
161
|
+
* headless element, and a styled subclass that sets `tier` renders the styled one
|
|
162
|
+
* from the same template.
|
|
163
|
+
*/
|
|
164
|
+
renderLabel() {
|
|
165
|
+
return html `<${this.tag('button')}
|
|
166
|
+
part="label"
|
|
167
|
+
exportparts="button: label-button"
|
|
168
|
+
appearance="ghost"
|
|
169
|
+
?disabled=${this.disabled}
|
|
170
|
+
@click=${this.select}
|
|
171
|
+
>
|
|
172
|
+
<slot></slot>
|
|
173
|
+
</${this.tag('button')}>`;
|
|
174
|
+
}
|
|
175
|
+
render() {
|
|
176
|
+
/* Two half lines, one either side of the mark, rather than one line running
|
|
177
|
+
the whole way to the next step.
|
|
178
|
+
A single line was tried twice. Drawn to the next marker it has to know
|
|
179
|
+
how far away that is, which is the next step's size, and a step knows
|
|
180
|
+
only its own. Drawn across the gap alone it is a stub. Two halves need
|
|
181
|
+
neither: each reaches from the mark to its own step's edge and half the
|
|
182
|
+
gap beyond, so it meets the one coming the other way in the middle of the
|
|
183
|
+
gap and the rule reads as continuous however wide the steps are or how
|
|
184
|
+
differently they are filled.
|
|
185
|
+
The first has nothing on its leading side and the last nothing on its
|
|
186
|
+
trailing one, which `:host(:first-child)` and `:host(:last-child)` say
|
|
187
|
+
with no index and no parent counting its children. */
|
|
188
|
+
return html `<span part="lead" aria-hidden="true"></span>
|
|
189
|
+
<span part="trail" aria-hidden="true"></span>
|
|
190
|
+
<span part="marker" aria-hidden="true">
|
|
191
|
+
${this.renderMarker()}
|
|
192
|
+
</span>
|
|
193
|
+
<span part="body">
|
|
194
|
+
${this.renderLabel()}
|
|
195
|
+
<span part="description"><slot name="description"></slot></span>
|
|
196
|
+
</span>
|
|
197
|
+
<div part="content"><slot name="content"></slot></div>`;
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
__decorate([
|
|
201
|
+
property({ reflect: true, type: Boolean })
|
|
202
|
+
], HelixHeadlessStep.prototype, "complete", void 0);
|
|
203
|
+
__decorate([
|
|
204
|
+
property({ reflect: true, type: Boolean })
|
|
205
|
+
], HelixHeadlessStep.prototype, "current", void 0);
|
|
206
|
+
__decorate([
|
|
207
|
+
property({ reflect: true, type: Boolean })
|
|
208
|
+
], HelixHeadlessStep.prototype, "disabled", void 0);
|
|
209
|
+
__decorate([
|
|
210
|
+
property()
|
|
211
|
+
], HelixHeadlessStep.prototype, "value", void 0);
|
|
212
|
+
HelixHeadlessStep = __decorate([
|
|
213
|
+
customElement('helix-headless-step')
|
|
214
|
+
], HelixHeadlessStep);
|
|
215
|
+
export { HelixHeadlessStep };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './root/switch-root.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './root/switch-root.js';
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { AriaForwardController, HelixFormElement } from '@fusion.dev/helix-core';
|
|
2
|
+
import { type PropertyValues, type TemplateResult } from 'lit';
|
|
3
|
+
declare const HelixHeadlessSwitch_base: (new (...args: any[]) => import("@fusion.dev/helix-core").MixinControllerCheckedInterface) & (new (...args: any[]) => import("@fusion.dev/helix-core").MixinFieldInterface) & typeof HelixFormElement;
|
|
4
|
+
/**
|
|
5
|
+
* @summary A control that turns something on or off.
|
|
6
|
+
*
|
|
7
|
+
* @description
|
|
8
|
+
* **A switch is not a checkbox with a different shape.** A checkbox is an
|
|
9
|
+
* answer to a question the form asks when it is submitted; a switch is a thing
|
|
10
|
+
* happening now. That is why `role="switch"` exists and why a switch belongs
|
|
11
|
+
* outside a form as often as in one: it says "on" and "off" rather than
|
|
12
|
+
* "ticked" and "unticked", and a reader expects the effect immediately rather
|
|
13
|
+
* than on Save.
|
|
14
|
+
*
|
|
15
|
+
* Rendered as a real `<input type="checkbox">` carrying `role="switch"`, which
|
|
16
|
+
* is the pairing ARIA describes: the input is what a form submits and what a
|
|
17
|
+
* label forwards a press to, and the role is what a screen reader announces.
|
|
18
|
+
* Neither half can be got from the other.
|
|
19
|
+
*
|
|
20
|
+
* The label sits beside it, inside the `<label>` that forwards the press, the
|
|
21
|
+
* way a checkbox's does. The hint and the message go under the row, because
|
|
22
|
+
* there is no above: the switch and the words naming it are one line.
|
|
23
|
+
*
|
|
24
|
+
* @since 0.1.0
|
|
25
|
+
* @status stable
|
|
26
|
+
* @category forms
|
|
27
|
+
* @aliases Toggle switch, On/off
|
|
28
|
+
* @documentation https://helix.fusion.dev/components/switch
|
|
29
|
+
*
|
|
30
|
+
* @slot - The words naming what this turns on.
|
|
31
|
+
*
|
|
32
|
+
* @event {Event} change - Relayed from the input once the state has changed.
|
|
33
|
+
* @event {HelixBeforeToggleEvent} helix-before-toggle - Fired before the state changes, and cancelable.
|
|
34
|
+
* @event {Event} input - Announced once the state has moved.
|
|
35
|
+
*
|
|
36
|
+
* @csspart control - The input.
|
|
37
|
+
* @csspart feedback - What is wrong with it.
|
|
38
|
+
* @csspart field - The row: the track and its label.
|
|
39
|
+
* @csspart hint - Help under the control, while nothing is wrong.
|
|
40
|
+
* @csspart label - The words beside it.
|
|
41
|
+
* @csspart thumb - The part that moves.
|
|
42
|
+
* @csspart track - The groove the thumb travels in.
|
|
43
|
+
*/
|
|
44
|
+
export declare class HelixHeadlessSwitch extends HelixHeadlessSwitch_base {
|
|
45
|
+
protected readonly aria: AriaForwardController;
|
|
46
|
+
/**
|
|
47
|
+
* Value submitted when the switch is on.
|
|
48
|
+
*/
|
|
49
|
+
value: string;
|
|
50
|
+
private readonly handleChange;
|
|
51
|
+
/** Reports what the form would submit, and the verdict on it. */
|
|
52
|
+
private sync;
|
|
53
|
+
/** Returns the switch to the state its markup declared. */
|
|
54
|
+
formResetCallback(): void;
|
|
55
|
+
protected updated(changed: PropertyValues): void;
|
|
56
|
+
/**
|
|
57
|
+
* Says on the `label` region whether anything is in it.
|
|
58
|
+
*
|
|
59
|
+
* An empty region is not free: it is still a flex item, so it still takes the
|
|
60
|
+
* container's gap. There is no selector that can ask, `slot:empty` being
|
|
61
|
+
* about a slot's fallback rather than its assigned nodes, so the component
|
|
62
|
+
* asks and says so, on the region inside this shadow root rather than on the
|
|
63
|
+
* host: an attribute written onto the host is a change to markup the consumer
|
|
64
|
+
* rendered, which React reports on hydration and does not patch up.
|
|
65
|
+
*/
|
|
66
|
+
private markEmpty;
|
|
67
|
+
protected render(): TemplateResult;
|
|
68
|
+
}
|
|
69
|
+
declare global {
|
|
70
|
+
interface HTMLElementTagNameMap {
|
|
71
|
+
'helix-headless-switch': HelixHeadlessSwitch;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
export {};
|
|
@@ -0,0 +1,153 @@
|
|
|
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 { AriaForwardController, customElement, HelixFormElement, MixinControllerChecked, MixinField, slotFilled, } from '@fusion.dev/helix-core';
|
|
8
|
+
import { html, nothing } from 'lit';
|
|
9
|
+
import { property } from 'lit/decorators.js';
|
|
10
|
+
/**
|
|
11
|
+
* @summary A control that turns something on or off.
|
|
12
|
+
*
|
|
13
|
+
* @description
|
|
14
|
+
* **A switch is not a checkbox with a different shape.** A checkbox is an
|
|
15
|
+
* answer to a question the form asks when it is submitted; a switch is a thing
|
|
16
|
+
* happening now. That is why `role="switch"` exists and why a switch belongs
|
|
17
|
+
* outside a form as often as in one: it says "on" and "off" rather than
|
|
18
|
+
* "ticked" and "unticked", and a reader expects the effect immediately rather
|
|
19
|
+
* than on Save.
|
|
20
|
+
*
|
|
21
|
+
* Rendered as a real `<input type="checkbox">` carrying `role="switch"`, which
|
|
22
|
+
* is the pairing ARIA describes: the input is what a form submits and what a
|
|
23
|
+
* label forwards a press to, and the role is what a screen reader announces.
|
|
24
|
+
* Neither half can be got from the other.
|
|
25
|
+
*
|
|
26
|
+
* The label sits beside it, inside the `<label>` that forwards the press, the
|
|
27
|
+
* way a checkbox's does. The hint and the message go under the row, because
|
|
28
|
+
* there is no above: the switch and the words naming it are one line.
|
|
29
|
+
*
|
|
30
|
+
* @since 0.1.0
|
|
31
|
+
* @status stable
|
|
32
|
+
* @category forms
|
|
33
|
+
* @aliases Toggle switch, On/off
|
|
34
|
+
* @documentation https://helix.fusion.dev/components/switch
|
|
35
|
+
*
|
|
36
|
+
* @slot - The words naming what this turns on.
|
|
37
|
+
*
|
|
38
|
+
* @event {Event} change - Relayed from the input once the state has changed.
|
|
39
|
+
* @event {HelixBeforeToggleEvent} helix-before-toggle - Fired before the state changes, and cancelable.
|
|
40
|
+
* @event {Event} input - Announced once the state has moved.
|
|
41
|
+
*
|
|
42
|
+
* @csspart control - The input.
|
|
43
|
+
* @csspart feedback - What is wrong with it.
|
|
44
|
+
* @csspart field - The row: the track and its label.
|
|
45
|
+
* @csspart hint - Help under the control, while nothing is wrong.
|
|
46
|
+
* @csspart label - The words beside it.
|
|
47
|
+
* @csspart thumb - The part that moves.
|
|
48
|
+
* @csspart track - The groove the thumb travels in.
|
|
49
|
+
*/
|
|
50
|
+
let HelixHeadlessSwitch = class HelixHeadlessSwitch extends MixinControllerChecked(MixinField(HelixFormElement)) {
|
|
51
|
+
constructor() {
|
|
52
|
+
super(...arguments);
|
|
53
|
+
/* A consumer's `aria-describedby` names ids in their own tree and the control
|
|
54
|
+
is in this shadow root, so the reference has to be carried down as an
|
|
55
|
+
element rather than copied as an id. See `AriaForwardController`: measured
|
|
56
|
+
in Chrome's own tree, the host held the description and the control the
|
|
57
|
+
reader is actually on was exposed without it. */
|
|
58
|
+
this.aria = new AriaForwardController(this, {
|
|
59
|
+
target: () => this.renderRoot?.querySelector('[part="control"]') ?? null,
|
|
60
|
+
});
|
|
61
|
+
/**
|
|
62
|
+
* Value submitted when the switch is on.
|
|
63
|
+
*/
|
|
64
|
+
this.value = 'on';
|
|
65
|
+
this.handleChange = (event) => {
|
|
66
|
+
event.stopPropagation();
|
|
67
|
+
const control = event.target;
|
|
68
|
+
const taken = this.requestChecked(control.checked);
|
|
69
|
+
/* The input follows the element, always, not only where the change was
|
|
70
|
+
refused.
|
|
71
|
+
*
|
|
72
|
+
* A controlled switch takes the request and applies nothing: it has
|
|
73
|
+
announced where it would go and is waiting to be told. The input had
|
|
74
|
+
already flipped itself, so until the consumer answered, the switch showed
|
|
75
|
+
one state and held the other, and a consumer who never answers showed the
|
|
76
|
+
wrong one for good. Putting it back costs nothing where the change was
|
|
77
|
+
taken, since `this.checked` is then the new value anyway. */
|
|
78
|
+
control.checked = this.checked;
|
|
79
|
+
if (!taken) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
this.dispatchEvent(new Event('change', { bubbles: true, composed: false }));
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
/** Reports what the form would submit, and the verdict on it. */
|
|
86
|
+
sync() {
|
|
87
|
+
// `null` rather than the value when it is off, which is how a checkbox
|
|
88
|
+
// behaves: an unticked box submits nothing rather than a blank.
|
|
89
|
+
this.internals.setFormValue(this.checked ? this.value : null);
|
|
90
|
+
this.reportRequired(!this.checked, 'Turn this on to continue.', 'control');
|
|
91
|
+
}
|
|
92
|
+
/** Returns the switch to the state its markup declared. */
|
|
93
|
+
formResetCallback() {
|
|
94
|
+
// `resetChecked` drops both halves now, the consumer's and the element's,
|
|
95
|
+
// so there is nothing to clear before it.
|
|
96
|
+
this.resetChecked();
|
|
97
|
+
}
|
|
98
|
+
updated(changed) {
|
|
99
|
+
super.updated(changed);
|
|
100
|
+
this.markEmpty();
|
|
101
|
+
this.sync();
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Says on the `label` region whether anything is in it.
|
|
105
|
+
*
|
|
106
|
+
* An empty region is not free: it is still a flex item, so it still takes the
|
|
107
|
+
* container's gap. There is no selector that can ask, `slot:empty` being
|
|
108
|
+
* about a slot's fallback rather than its assigned nodes, so the component
|
|
109
|
+
* asks and says so, on the region inside this shadow root rather than on the
|
|
110
|
+
* host: an attribute written onto the host is a change to markup the consumer
|
|
111
|
+
* rendered, which React reports on hydration and does not patch up.
|
|
112
|
+
*/
|
|
113
|
+
markEmpty() {
|
|
114
|
+
const region = this.renderRoot?.querySelector('[part="label"]');
|
|
115
|
+
const empty = !slotFilled(this.renderRoot?.querySelector('[part="label"] slot'));
|
|
116
|
+
region?.toggleAttribute('data-empty', empty);
|
|
117
|
+
/* `hidden` beside the mirror, because `data-empty` is a hook the styled
|
|
118
|
+
sheet reads and this tier has no sheet: an empty region left in the box
|
|
119
|
+
tree is a gap a consumer cannot close without knowing to look for it. The
|
|
120
|
+
styled rule stays, because that sheet sets `display` on this part and so
|
|
121
|
+
outranks the UA one. */
|
|
122
|
+
region?.toggleAttribute('hidden', empty);
|
|
123
|
+
}
|
|
124
|
+
render() {
|
|
125
|
+
/* A real `<label>` around both, so pressing the words works with no click
|
|
126
|
+
handler: the browser does the forwarding. */
|
|
127
|
+
return html `<label part="field">
|
|
128
|
+
<span part="track">
|
|
129
|
+
<input
|
|
130
|
+
part="control"
|
|
131
|
+
type="checkbox"
|
|
132
|
+
role="switch"
|
|
133
|
+
.checked=${this.checked}
|
|
134
|
+
?disabled=${this.isDisabled}
|
|
135
|
+
?required=${this.required}
|
|
136
|
+
aria-describedby=${this.describedBy ?? nothing}
|
|
137
|
+
@change=${this.handleChange}
|
|
138
|
+
@input=${this.stopInner}
|
|
139
|
+
/>
|
|
140
|
+
<span part="thumb" aria-hidden="true"></span>
|
|
141
|
+
</span>
|
|
142
|
+
<span part="label"><slot>${this.label}</slot></span>
|
|
143
|
+
</label>
|
|
144
|
+
${this.renderHint()}${this.renderFeedback()}`;
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
__decorate([
|
|
148
|
+
property()
|
|
149
|
+
], HelixHeadlessSwitch.prototype, "value", void 0);
|
|
150
|
+
HelixHeadlessSwitch = __decorate([
|
|
151
|
+
customElement('helix-headless-switch')
|
|
152
|
+
], HelixHeadlessSwitch);
|
|
153
|
+
export { HelixHeadlessSwitch };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { HelixElement } from '@fusion.dev/helix-core';
|
|
2
|
+
import { type PropertyValues, type TemplateResult } from 'lit';
|
|
3
|
+
/**
|
|
4
|
+
* @summary One cell of a table.
|
|
5
|
+
*
|
|
6
|
+
* @description
|
|
7
|
+
* Carries its own role, because a grid of divs is not a table to anything
|
|
8
|
+
* reading it. `header` makes the cell a `columnheader`, which is what lets a
|
|
9
|
+
* screen reader announce "Attribute, appearance" rather than just the value.
|
|
10
|
+
*
|
|
11
|
+
* The role goes on the host rather than inside the shadow root, because the
|
|
12
|
+
* cell has to be a child of its row in the flat tree for the table's structure
|
|
13
|
+
* to hold together.
|
|
14
|
+
*
|
|
15
|
+
* @since 0.1.0
|
|
16
|
+
* @status experimental
|
|
17
|
+
* @aliases Cell, TableCell
|
|
18
|
+
* @documentation https://helix.fusion.dev/components/table
|
|
19
|
+
*
|
|
20
|
+
* @slot - The cell's content.
|
|
21
|
+
*/
|
|
22
|
+
export declare class HelixHeadlessTableCell extends HelixElement {
|
|
23
|
+
/**
|
|
24
|
+
* Whether the cell heads its column.
|
|
25
|
+
*/
|
|
26
|
+
header: boolean;
|
|
27
|
+
protected willUpdate(changed: PropertyValues): void;
|
|
28
|
+
protected render(): TemplateResult;
|
|
29
|
+
}
|
|
30
|
+
declare global {
|
|
31
|
+
interface HTMLElementTagNameMap {
|
|
32
|
+
'helix-headless-table-cell': HelixHeadlessTableCell;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { customElement, HelixElement, hostAria } from '@fusion.dev/helix-core';
|
|
8
|
+
import { html } from 'lit';
|
|
9
|
+
import { property } from 'lit/decorators.js';
|
|
10
|
+
/**
|
|
11
|
+
* @summary One cell of a table.
|
|
12
|
+
*
|
|
13
|
+
* @description
|
|
14
|
+
* Carries its own role, because a grid of divs is not a table to anything
|
|
15
|
+
* reading it. `header` makes the cell a `columnheader`, which is what lets a
|
|
16
|
+
* screen reader announce "Attribute, appearance" rather than just the value.
|
|
17
|
+
*
|
|
18
|
+
* The role goes on the host rather than inside the shadow root, because the
|
|
19
|
+
* cell has to be a child of its row in the flat tree for the table's structure
|
|
20
|
+
* to hold together.
|
|
21
|
+
*
|
|
22
|
+
* @since 0.1.0
|
|
23
|
+
* @status experimental
|
|
24
|
+
* @aliases Cell, TableCell
|
|
25
|
+
* @documentation https://helix.fusion.dev/components/table
|
|
26
|
+
*
|
|
27
|
+
* @slot - The cell's content.
|
|
28
|
+
*/
|
|
29
|
+
let HelixHeadlessTableCell = class HelixHeadlessTableCell extends HelixElement {
|
|
30
|
+
constructor() {
|
|
31
|
+
super(...arguments);
|
|
32
|
+
/**
|
|
33
|
+
* Whether the cell heads its column.
|
|
34
|
+
*/
|
|
35
|
+
this.header = false;
|
|
36
|
+
}
|
|
37
|
+
willUpdate(changed) {
|
|
38
|
+
super.willUpdate(changed);
|
|
39
|
+
// In `willUpdate`, which the server does call, unlike `connectedCallback`.
|
|
40
|
+
hostAria(this.internals, { role: this.header ? 'columnheader' : 'cell' });
|
|
41
|
+
}
|
|
42
|
+
render() {
|
|
43
|
+
return html `<slot></slot>`;
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
__decorate([
|
|
47
|
+
property({ reflect: true, type: Boolean })
|
|
48
|
+
], HelixHeadlessTableCell.prototype, "header", void 0);
|
|
49
|
+
HelixHeadlessTableCell = __decorate([
|
|
50
|
+
customElement('helix-headless-table-cell')
|
|
51
|
+
], HelixHeadlessTableCell);
|
|
52
|
+
export { HelixHeadlessTableCell };
|