@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,36 @@
|
|
|
1
|
+
import { HelixElement } from '@fusion.dev/helix-core';
|
|
2
|
+
import { type TemplateResult } from 'lit';
|
|
3
|
+
/**
|
|
4
|
+
* @summary A fragment of code inside a line of prose.
|
|
5
|
+
*
|
|
6
|
+
* @description
|
|
7
|
+
* **A real `<code>`, because the element is the meaning.** A styled span reads
|
|
8
|
+
* as code and is not: a screen reader announces nothing about it, a translation
|
|
9
|
+
* tool will happily translate it, and a search that understands documents
|
|
10
|
+
* cannot tell it from emphasis. The tag is the whole point, which is also why
|
|
11
|
+
* this component is so small.
|
|
12
|
+
*
|
|
13
|
+
* **Inline, and only inline.** A block of code is `CodeBlock`, a separate
|
|
14
|
+
* family rather than a variant here. The two differ in more than presentation:
|
|
15
|
+
* one flows with a sentence and must never scroll, the other is a figure with
|
|
16
|
+
* its own box, its own overflow and something to copy. Namespacing them
|
|
17
|
+
* together would say `CodeBlock` is part of `Code`, and it is not.
|
|
18
|
+
*
|
|
19
|
+
* @since 0.1.0
|
|
20
|
+
* @status stable
|
|
21
|
+
* @category typography
|
|
22
|
+
* @aliases Inline code, Kbd
|
|
23
|
+
* @documentation https://helix.fusion.dev/components/code
|
|
24
|
+
*
|
|
25
|
+
* @slot - The code.
|
|
26
|
+
*
|
|
27
|
+
* @csspart code - The `<code>` element.
|
|
28
|
+
*/
|
|
29
|
+
export declare class HelixHeadlessCode extends HelixElement {
|
|
30
|
+
protected render(): TemplateResult;
|
|
31
|
+
}
|
|
32
|
+
declare global {
|
|
33
|
+
interface HTMLElementTagNameMap {
|
|
34
|
+
'helix-headless-code': HelixHeadlessCode;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
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 } from 'lit';
|
|
9
|
+
/**
|
|
10
|
+
* @summary A fragment of code inside a line of prose.
|
|
11
|
+
*
|
|
12
|
+
* @description
|
|
13
|
+
* **A real `<code>`, because the element is the meaning.** A styled span reads
|
|
14
|
+
* as code and is not: a screen reader announces nothing about it, a translation
|
|
15
|
+
* tool will happily translate it, and a search that understands documents
|
|
16
|
+
* cannot tell it from emphasis. The tag is the whole point, which is also why
|
|
17
|
+
* this component is so small.
|
|
18
|
+
*
|
|
19
|
+
* **Inline, and only inline.** A block of code is `CodeBlock`, a separate
|
|
20
|
+
* family rather than a variant here. The two differ in more than presentation:
|
|
21
|
+
* one flows with a sentence and must never scroll, the other is a figure with
|
|
22
|
+
* its own box, its own overflow and something to copy. Namespacing them
|
|
23
|
+
* together would say `CodeBlock` is part of `Code`, and it is not.
|
|
24
|
+
*
|
|
25
|
+
* @since 0.1.0
|
|
26
|
+
* @status stable
|
|
27
|
+
* @category typography
|
|
28
|
+
* @aliases Inline code, Kbd
|
|
29
|
+
* @documentation https://helix.fusion.dev/components/code
|
|
30
|
+
*
|
|
31
|
+
* @slot - The code.
|
|
32
|
+
*
|
|
33
|
+
* @csspart code - The `<code>` element.
|
|
34
|
+
*/
|
|
35
|
+
let HelixHeadlessCode = class HelixHeadlessCode extends HelixElement {
|
|
36
|
+
render() {
|
|
37
|
+
return html `<code part="code"><slot></slot></code>`;
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
HelixHeadlessCode = __decorate([
|
|
41
|
+
customElement('helix-headless-code')
|
|
42
|
+
], HelixHeadlessCode);
|
|
43
|
+
export { HelixHeadlessCode };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './root/code-block-root.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './root/code-block-root.js';
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { HelixElement } from '@fusion.dev/helix-core';
|
|
2
|
+
import { type TemplateResult } from 'lit';
|
|
3
|
+
import '../../copy-button/index.js';
|
|
4
|
+
/**
|
|
5
|
+
* @summary A block of code, with somewhere to put its name and a way to take it.
|
|
6
|
+
*
|
|
7
|
+
* @description
|
|
8
|
+
* **`<pre><code>` and nothing cleverer.** The pair is what the platform means
|
|
9
|
+
* by a block of code: `pre` keeps the whitespace, `code` says what the
|
|
10
|
+
* whitespace is for, and losing either one loses something no styling puts
|
|
11
|
+
* back. Indentation in a `div` is a paragraph with odd spacing.
|
|
12
|
+
*
|
|
13
|
+
* **It scrolls rather than wraps.** A wrapped line of code is a lie about where
|
|
14
|
+
* the line ends, and in a language where a line break can be significant it is
|
|
15
|
+
* a lie that costs someone an afternoon. The box takes its own scrollbar.
|
|
16
|
+
*
|
|
17
|
+
* **The copy button is here because the alternative is selecting it by hand.**
|
|
18
|
+
* Every consumer would otherwise put one there, slightly differently, and the
|
|
19
|
+
* one that forgot would be the one with the longest snippet. It is on unless
|
|
20
|
+
* `no-copy` says otherwise, and takes its text from the slot rather than from a
|
|
21
|
+
* property, so there is no second copy of the code to keep in step.
|
|
22
|
+
*
|
|
23
|
+
* A `Code` for a fragment inside a sentence. Separate families, because one
|
|
24
|
+
* flows with prose and the other is a figure.
|
|
25
|
+
*
|
|
26
|
+
* @since 0.1.0
|
|
27
|
+
* @status stable
|
|
28
|
+
* @category typography
|
|
29
|
+
* @aliases Code block, Snippet, Pre
|
|
30
|
+
* @documentation https://helix.fusion.dev/components/code-block
|
|
31
|
+
*
|
|
32
|
+
* @slot - The code.
|
|
33
|
+
*
|
|
34
|
+
* @csspart block - The scrolling `<pre>`.
|
|
35
|
+
* @csspart code - The `<code>` inside it.
|
|
36
|
+
* @csspart copy - The copy button.
|
|
37
|
+
* @csspart copy-button - The inner button.
|
|
38
|
+
* @csspart copy-mark - The clipboard glyph, and the confirmation that replaces it.
|
|
39
|
+
* @csspart copy-tooltip - The bubble, forwarded from the tooltip inside.
|
|
40
|
+
* @csspart copy-tooltip-arrow - The point, resting against the trigger.
|
|
41
|
+
* @csspart frame - The code and the copy button beside it.
|
|
42
|
+
* @csspart header - The bar carrying the name, where there is one.
|
|
43
|
+
* @csspart label - The file name or language, where one is given.
|
|
44
|
+
*/
|
|
45
|
+
export declare class HelixHeadlessCodeBlock extends HelixElement {
|
|
46
|
+
/**
|
|
47
|
+
* What to call this block, usually a file name or a language.
|
|
48
|
+
*/
|
|
49
|
+
label: string;
|
|
50
|
+
/**
|
|
51
|
+
* Whether to leave the copy button off.
|
|
52
|
+
*
|
|
53
|
+
* Negative, which is not a style choice. A boolean attribute is true whenever
|
|
54
|
+
* it is *present*, so a `copyable` defaulting to true could never be turned
|
|
55
|
+
* off from markup: `copyable="false"` is the string "false", which is
|
|
56
|
+
* present, which is true. Measured, and it is why this is named the other way
|
|
57
|
+
* round. The platform already writes booleans like this for the same reason,
|
|
58
|
+
* `novalidate` and `nomodule` and `noreferrer` among them.
|
|
59
|
+
*
|
|
60
|
+
* **Reflected, because the gutter is a stylesheet rule.** `code-block.css`
|
|
61
|
+
* reserves the copy button's width with `:host(:not([no-copy]))`, so the
|
|
62
|
+
* attribute is what decides whether the block pays for a control. Set from
|
|
63
|
+
* script the button went away, `render` reading the property, and the 40px it
|
|
64
|
+
* stood in stayed reserved: the exact waste that rule was written to stop,
|
|
65
|
+
* arrived at from the other side.
|
|
66
|
+
*
|
|
67
|
+
* A false boolean reflects as the attribute's absence, so this costs no
|
|
68
|
+
* `no-copy=""` on hosts that never asked for one, and the rule about a
|
|
69
|
+
* reflected property taking no default is satisfied by the default being
|
|
70
|
+
* `false`.
|
|
71
|
+
*/
|
|
72
|
+
noCopy: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* The code as text, read from the slot rather than stored.
|
|
75
|
+
*
|
|
76
|
+
* Client only, and it has to be: the server has no children to read. The
|
|
77
|
+
* copy button is a client-side affordance anyway, so nothing is lost, and
|
|
78
|
+
* taking the text from a property instead would be a second copy of the code
|
|
79
|
+
* that goes stale the moment the slot changes.
|
|
80
|
+
*/
|
|
81
|
+
private get text();
|
|
82
|
+
/**
|
|
83
|
+
* One more render, once there is a slot to read.
|
|
84
|
+
*
|
|
85
|
+
* The first render has no shadow children yet, so `text` is empty and the
|
|
86
|
+
* copy button is bound to nothing. `slotchange` normally schedules the render
|
|
87
|
+
* that fixes it, and leaning on that alone was measured to leave the button
|
|
88
|
+
* empty through four update cycles: the event is not guaranteed to have
|
|
89
|
+
* arrived, and in one environment never arrives at all. A component should not
|
|
90
|
+
* need an event to show its own content, so it asks for the second render
|
|
91
|
+
* itself and `slotchange` is left to handle the case it is actually for, which
|
|
92
|
+
* is content changing later.
|
|
93
|
+
*/
|
|
94
|
+
protected firstUpdated(): void;
|
|
95
|
+
protected render(): TemplateResult;
|
|
96
|
+
/**
|
|
97
|
+
* The button that takes the code, behind a seam the styled tier can move.
|
|
98
|
+
*
|
|
99
|
+
* A method rather than a fragment inline, so a tier above can render its own
|
|
100
|
+
* copy control, wrap this one, or pass it something the base does not know
|
|
101
|
+
* about, without reimplementing the whole template to do it. The tag is
|
|
102
|
+
* interpolated rather than written, so `tier` resolves it: this renders the
|
|
103
|
+
* base button, and a styled subclass that sets `tier` renders the styled one
|
|
104
|
+
* from the same template.
|
|
105
|
+
*/
|
|
106
|
+
protected renderCopyButton(): TemplateResult;
|
|
107
|
+
}
|
|
108
|
+
declare global {
|
|
109
|
+
interface HTMLElementTagNameMap {
|
|
110
|
+
'helix-headless-code-block': HelixHeadlessCodeBlock;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
@@ -0,0 +1,155 @@
|
|
|
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 { nothing } from 'lit';
|
|
9
|
+
import { property } from 'lit/decorators.js';
|
|
10
|
+
import { html } from 'lit/static-html.js';
|
|
11
|
+
import '../../copy-button/index.js';
|
|
12
|
+
/**
|
|
13
|
+
* @summary A block of code, with somewhere to put its name and a way to take it.
|
|
14
|
+
*
|
|
15
|
+
* @description
|
|
16
|
+
* **`<pre><code>` and nothing cleverer.** The pair is what the platform means
|
|
17
|
+
* by a block of code: `pre` keeps the whitespace, `code` says what the
|
|
18
|
+
* whitespace is for, and losing either one loses something no styling puts
|
|
19
|
+
* back. Indentation in a `div` is a paragraph with odd spacing.
|
|
20
|
+
*
|
|
21
|
+
* **It scrolls rather than wraps.** A wrapped line of code is a lie about where
|
|
22
|
+
* the line ends, and in a language where a line break can be significant it is
|
|
23
|
+
* a lie that costs someone an afternoon. The box takes its own scrollbar.
|
|
24
|
+
*
|
|
25
|
+
* **The copy button is here because the alternative is selecting it by hand.**
|
|
26
|
+
* Every consumer would otherwise put one there, slightly differently, and the
|
|
27
|
+
* one that forgot would be the one with the longest snippet. It is on unless
|
|
28
|
+
* `no-copy` says otherwise, and takes its text from the slot rather than from a
|
|
29
|
+
* property, so there is no second copy of the code to keep in step.
|
|
30
|
+
*
|
|
31
|
+
* A `Code` for a fragment inside a sentence. Separate families, because one
|
|
32
|
+
* flows with prose and the other is a figure.
|
|
33
|
+
*
|
|
34
|
+
* @since 0.1.0
|
|
35
|
+
* @status stable
|
|
36
|
+
* @category typography
|
|
37
|
+
* @aliases Code block, Snippet, Pre
|
|
38
|
+
* @documentation https://helix.fusion.dev/components/code-block
|
|
39
|
+
*
|
|
40
|
+
* @slot - The code.
|
|
41
|
+
*
|
|
42
|
+
* @csspart block - The scrolling `<pre>`.
|
|
43
|
+
* @csspart code - The `<code>` inside it.
|
|
44
|
+
* @csspart copy - The copy button.
|
|
45
|
+
* @csspart copy-button - The inner button.
|
|
46
|
+
* @csspart copy-mark - The clipboard glyph, and the confirmation that replaces it.
|
|
47
|
+
* @csspart copy-tooltip - The bubble, forwarded from the tooltip inside.
|
|
48
|
+
* @csspart copy-tooltip-arrow - The point, resting against the trigger.
|
|
49
|
+
* @csspart frame - The code and the copy button beside it.
|
|
50
|
+
* @csspart header - The bar carrying the name, where there is one.
|
|
51
|
+
* @csspart label - The file name or language, where one is given.
|
|
52
|
+
*/
|
|
53
|
+
let HelixHeadlessCodeBlock = class HelixHeadlessCodeBlock extends HelixElement {
|
|
54
|
+
constructor() {
|
|
55
|
+
super(...arguments);
|
|
56
|
+
/**
|
|
57
|
+
* What to call this block, usually a file name or a language.
|
|
58
|
+
*/
|
|
59
|
+
this.label = '';
|
|
60
|
+
/**
|
|
61
|
+
* Whether to leave the copy button off.
|
|
62
|
+
*
|
|
63
|
+
* Negative, which is not a style choice. A boolean attribute is true whenever
|
|
64
|
+
* it is *present*, so a `copyable` defaulting to true could never be turned
|
|
65
|
+
* off from markup: `copyable="false"` is the string "false", which is
|
|
66
|
+
* present, which is true. Measured, and it is why this is named the other way
|
|
67
|
+
* round. The platform already writes booleans like this for the same reason,
|
|
68
|
+
* `novalidate` and `nomodule` and `noreferrer` among them.
|
|
69
|
+
*
|
|
70
|
+
* **Reflected, because the gutter is a stylesheet rule.** `code-block.css`
|
|
71
|
+
* reserves the copy button's width with `:host(:not([no-copy]))`, so the
|
|
72
|
+
* attribute is what decides whether the block pays for a control. Set from
|
|
73
|
+
* script the button went away, `render` reading the property, and the 40px it
|
|
74
|
+
* stood in stayed reserved: the exact waste that rule was written to stop,
|
|
75
|
+
* arrived at from the other side.
|
|
76
|
+
*
|
|
77
|
+
* A false boolean reflects as the attribute's absence, so this costs no
|
|
78
|
+
* `no-copy=""` on hosts that never asked for one, and the rule about a
|
|
79
|
+
* reflected property taking no default is satisfied by the default being
|
|
80
|
+
* `false`.
|
|
81
|
+
*/
|
|
82
|
+
this.noCopy = false;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* The code as text, read from the slot rather than stored.
|
|
86
|
+
*
|
|
87
|
+
* Client only, and it has to be: the server has no children to read. The
|
|
88
|
+
* copy button is a client-side affordance anyway, so nothing is lost, and
|
|
89
|
+
* taking the text from a property instead would be a second copy of the code
|
|
90
|
+
* that goes stale the moment the slot changes.
|
|
91
|
+
*/
|
|
92
|
+
get text() {
|
|
93
|
+
const slot = this.renderRoot?.querySelector('slot');
|
|
94
|
+
return (slot?.assignedNodes() ?? []).map((node) => node.textContent ?? '').join('');
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* One more render, once there is a slot to read.
|
|
98
|
+
*
|
|
99
|
+
* The first render has no shadow children yet, so `text` is empty and the
|
|
100
|
+
* copy button is bound to nothing. `slotchange` normally schedules the render
|
|
101
|
+
* that fixes it, and leaning on that alone was measured to leave the button
|
|
102
|
+
* empty through four update cycles: the event is not guaranteed to have
|
|
103
|
+
* arrived, and in one environment never arrives at all. A component should not
|
|
104
|
+
* need an event to show its own content, so it asks for the second render
|
|
105
|
+
* itself and `slotchange` is left to handle the case it is actually for, which
|
|
106
|
+
* is content changing later.
|
|
107
|
+
*/
|
|
108
|
+
firstUpdated() {
|
|
109
|
+
this.requestUpdate();
|
|
110
|
+
}
|
|
111
|
+
render() {
|
|
112
|
+
/* The copy button sits beside the code, not in a bar above it.
|
|
113
|
+
*
|
|
114
|
+
* It was in the header, which meant a block with nothing to call itself
|
|
115
|
+
* still drew a full-width bar to hold one button: an empty strip above
|
|
116
|
+
* every snippet, which is what a `Usage` section of one-line imports looked
|
|
117
|
+
* like. Beside the code it needs no bar at all, so a block with no `label`
|
|
118
|
+
* is just the code and a way to take it, and the header exists only when
|
|
119
|
+
* there is a name to put in it. One less appearance to choose between. */
|
|
120
|
+
return html `${this.label ? html `<div part="header"><span part="label">${this.label}</span></div>` : nothing}
|
|
121
|
+
<div part="frame">
|
|
122
|
+
<pre part="block"><code part="code"><slot @slotchange=${() => this.requestUpdate()}></slot></code></pre>
|
|
123
|
+
${this.noCopy ? nothing : this.renderCopyButton()}
|
|
124
|
+
</div>`;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* The button that takes the code, behind a seam the styled tier can move.
|
|
128
|
+
*
|
|
129
|
+
* A method rather than a fragment inline, so a tier above can render its own
|
|
130
|
+
* copy control, wrap this one, or pass it something the base does not know
|
|
131
|
+
* about, without reimplementing the whole template to do it. The tag is
|
|
132
|
+
* interpolated rather than written, so `tier` resolves it: this renders the
|
|
133
|
+
* base button, and a styled subclass that sets `tier` renders the styled one
|
|
134
|
+
* from the same template.
|
|
135
|
+
*/
|
|
136
|
+
renderCopyButton() {
|
|
137
|
+
return html `<${this.tag('copy-button')}
|
|
138
|
+
part="copy"
|
|
139
|
+
exportparts="button: copy-button, mark: copy-mark, tooltip: copy-tooltip,
|
|
140
|
+
tooltip-arrow: copy-tooltip-arrow"
|
|
141
|
+
label="Copy code"
|
|
142
|
+
.value=${this.text}
|
|
143
|
+
></${this.tag('copy-button')}>`;
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
__decorate([
|
|
147
|
+
property()
|
|
148
|
+
], HelixHeadlessCodeBlock.prototype, "label", void 0);
|
|
149
|
+
__decorate([
|
|
150
|
+
property({ attribute: 'no-copy', reflect: true, type: Boolean })
|
|
151
|
+
], HelixHeadlessCodeBlock.prototype, "noCopy", void 0);
|
|
152
|
+
HelixHeadlessCodeBlock = __decorate([
|
|
153
|
+
customElement('helix-headless-code-block')
|
|
154
|
+
], HelixHeadlessCodeBlock);
|
|
155
|
+
export { HelixHeadlessCodeBlock };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './root/color-input-root.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './root/color-input-root.js';
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import { AriaForwardController, HelixFormElement, PopoverController } from '@fusion.dev/helix-core';
|
|
2
|
+
import { type PropertyValues, type TemplateResult } from 'lit';
|
|
3
|
+
import '../../color-picker/index.js';
|
|
4
|
+
import { type ColorFormat } from '../../color-picker/color.js';
|
|
5
|
+
declare const HelixHeadlessColorInput_base: (new (...args: any[]) => import("@fusion.dev/helix-core").MixinControllerOpenInterface) & (new (...args: any[]) => import("@fusion.dev/helix-core").MixinControllerValueInterface) & (new (...args: any[]) => import("@fusion.dev/helix-core").MixinFieldInterface) & typeof HelixFormElement;
|
|
6
|
+
/**
|
|
7
|
+
* @summary A color, typed in any syntax or picked from a panel.
|
|
8
|
+
*
|
|
9
|
+
* @description
|
|
10
|
+
* **The picker is `helix-color-picker`, not a second one written here.** It owns the
|
|
11
|
+
* square, the ramps, the eyedropper and the syntax toggle, and it is worth
|
|
12
|
+
* having on its own: a settings pane wants a picker flat on the page with
|
|
13
|
+
* nothing to open. This element is the field, the overlay, and the form.
|
|
14
|
+
* Exactly the arrangement Date Input has with `helix-date-picker`.
|
|
15
|
+
*
|
|
16
|
+
* **Typed as well as picked, and the typing is the reason this is not
|
|
17
|
+
* `<input type="color">`.** The native control gives a free picker and takes
|
|
18
|
+
* nearly all styling with it, which is a fair trade until a product needs the
|
|
19
|
+
* panel to match everything around it. What is kept from the native one is the
|
|
20
|
+
* part worth keeping: a real text field, so a reader who has the hex pastes it
|
|
21
|
+
* and never opens anything.
|
|
22
|
+
*
|
|
23
|
+
* **Every syntax is read; the one `format` names is written.** `#f00`,
|
|
24
|
+
* `#ff0000`, `rgb(255 0 0)`, `rgba(255,0,0,.5)`, `rgb(255 0 0 / 50%)` and
|
|
25
|
+
* `hsl(0 100% 50%)` are all colors, and a field that refuses one because it
|
|
26
|
+
* prefers another is arguing with the person using it. What the field *shows* is
|
|
27
|
+
* the value itself, for the reason Date Input gives about its dates: half-typed
|
|
28
|
+
* input does not survive a round trip through a formatter.
|
|
29
|
+
*
|
|
30
|
+
* The properties below are written by this component and read by whoever draws
|
|
31
|
+
* it. A consumer sets none of them: they carry a number this element computed
|
|
32
|
+
* and CSS cannot, which is what lets a stylesheet on this tier draw the thing
|
|
33
|
+
* without measuring anything itself.
|
|
34
|
+
*
|
|
35
|
+
* @since 0.1.0
|
|
36
|
+
* @status experimental
|
|
37
|
+
* @category forms
|
|
38
|
+
* @aliases ColorField, ColourInput, InputColor
|
|
39
|
+
* @documentation https://helix.fusion.dev/components/color-input
|
|
40
|
+
*
|
|
41
|
+
* @slot end - Content at the trailing end, before the trigger.
|
|
42
|
+
* @slot feedback - What is wrong with it.
|
|
43
|
+
* @slot hint - Help under the field.
|
|
44
|
+
* @slot start - Content at the leading end of the field, inside its border.
|
|
45
|
+
* @slot trigger - The mark on the field saying a panel opens.
|
|
46
|
+
*
|
|
47
|
+
* @event {Event} change - Announced once the value has moved.
|
|
48
|
+
* @event {HelixBeforeChangeEvent} helix-before-change - Fired before the color changes. Cancelable: refusing it takes the decision and nothing moves.
|
|
49
|
+
* @event {HelixBeforeCloseEvent} helix-before-close - Fired before it closes. Cancelable: refusing it takes the decision and nothing moves.
|
|
50
|
+
* @event {HelixBeforeOpenEvent} helix-before-open - Fired before the panel opens. Cancelable: refusing it takes the decision and nothing moves.
|
|
51
|
+
* @event {Event} input - Announced once the value has moved.
|
|
52
|
+
* @event {Event} toggle - Says the state moved, carrying `newState` and `oldState`.
|
|
53
|
+
*
|
|
54
|
+
* @csspart control - The text input carrying the value. Absent in `swatch`.
|
|
55
|
+
* @csspart feedback - What is wrong with it.
|
|
56
|
+
* @csspart field - The box holding the text and the trigger.
|
|
57
|
+
* @csspart hint - Help under the field, while nothing is wrong.
|
|
58
|
+
* @csspart label - The question, over the field.
|
|
59
|
+
* @csspart picker - The color picker inside it.
|
|
60
|
+
* @csspart picker-actions - The group holding the eyedropper and the syntax toggle.
|
|
61
|
+
* @csspart picker-channel - One ramp.
|
|
62
|
+
* @csspart picker-channel-control - The range input.
|
|
63
|
+
* @csspart picker-channel-feedback - What is wrong with it.
|
|
64
|
+
* @csspart picker-channel-field - The row: the control and its readout.
|
|
65
|
+
* @csspart picker-channel-hint - Help under the track, while nothing is wrong.
|
|
66
|
+
* @csspart picker-channel-label - The question, over the track.
|
|
67
|
+
* @csspart picker-channel-marker - One mark.
|
|
68
|
+
* @csspart picker-channel-marker-label - The value a mark stands at, when `marker-labels` is set.
|
|
69
|
+
* @csspart picker-channel-markers - The row of marks along the track.
|
|
70
|
+
* @csspart picker-channel-output - The current value, shown beside it.
|
|
71
|
+
* @csspart picker-channels - The ramps beside it.
|
|
72
|
+
* @csspart picker-controls - The row under the square.
|
|
73
|
+
* @csspart picker-eyedropper - The control that samples a color from the screen.
|
|
74
|
+
* @csspart picker-eyedropper-button - The inner control.
|
|
75
|
+
* @csspart picker-footer - The row holding the value and the tools.
|
|
76
|
+
* @csspart picker-format - The control that changes the syntax the value is written in.
|
|
77
|
+
* @csspart picker-format-button - The inner control.
|
|
78
|
+
* @csspart picker-grid - The saturation and brightness square.
|
|
79
|
+
* @csspart picker-grid-brightness - The range input for its vertical axis.
|
|
80
|
+
* @csspart picker-grid-handle - The mark showing where in the square the color sits.
|
|
81
|
+
* @csspart picker-grid-saturation - The range input for the square's horizontal axis.
|
|
82
|
+
* @csspart picker-icon - A glyph this component draws.
|
|
83
|
+
* @csspart picker-sample - The chip of the current color, which copies it when pressed.
|
|
84
|
+
* @csspart picker-swatch - One preset.
|
|
85
|
+
* @csspart picker-swatches - The row of presets.
|
|
86
|
+
* @csspart picker-value - The color as text, which can be typed or pasted.
|
|
87
|
+
* @csspart preview - The chip showing the color, inside the trigger.
|
|
88
|
+
* @csspart surface - The floating panel.
|
|
89
|
+
* @csspart trigger - The control that opens the panel.
|
|
90
|
+
*
|
|
91
|
+
* @cssproperty --color-input-swatch - The chosen color, to paint over the transparency check.
|
|
92
|
+
*/
|
|
93
|
+
export declare class HelixHeadlessColorInput extends HelixHeadlessColorInput_base {
|
|
94
|
+
protected readonly aria: AriaForwardController;
|
|
95
|
+
/**
|
|
96
|
+
* What the browser may autofill in the text field, as a platform token.
|
|
97
|
+
*
|
|
98
|
+
* **Defaults to `off`, which is not the platform's default and is the
|
|
99
|
+
* point.** The field filters a list rather than collecting a value, so a
|
|
100
|
+
* browser offering to fill it with a saved address is competing for the same
|
|
101
|
+
* keystrokes as the listbox. A consumer who wants autofill can still ask.
|
|
102
|
+
*/
|
|
103
|
+
autocomplete: string;
|
|
104
|
+
/**
|
|
105
|
+
* Whether the field is a text box with a swatch on it, or only the swatch.
|
|
106
|
+
*
|
|
107
|
+
* `swatch` is the native control's shape: a block of color that opens a
|
|
108
|
+
* picker, with no text beside it. It is what a toolbar wants, and a form that
|
|
109
|
+
* asks for a color among twenty other questions, where a hex in a box is
|
|
110
|
+
* eleven characters of noise next to the thing itself.
|
|
111
|
+
*
|
|
112
|
+
* It also settles where the value is stated. The default field *is* the input,
|
|
113
|
+
* so the panel is told `no-value` and would otherwise show a second one. A
|
|
114
|
+
* swatch states nothing, so the panel keeps its own row and the value is
|
|
115
|
+
* readable and typeable exactly once, in whichever of the two is present.
|
|
116
|
+
*
|
|
117
|
+
* The trade is real and is the reason this is not the default: a swatch cannot
|
|
118
|
+
* be read or pasted into without opening the panel, which is worse for a form
|
|
119
|
+
* where the color is the answer rather than a setting.
|
|
120
|
+
*/
|
|
121
|
+
variant?: 'swatch';
|
|
122
|
+
/**
|
|
123
|
+
* Whether the color carries an alpha channel.
|
|
124
|
+
*/
|
|
125
|
+
alpha: boolean;
|
|
126
|
+
/**
|
|
127
|
+
* The syntax the value is written in: `hex`, `rgb` or `hsl`.
|
|
128
|
+
*
|
|
129
|
+
* **Undefaulted, because it reflects.** The two together are what stamp an
|
|
130
|
+
* attribute onto every host anybody renders, including the ones nobody
|
|
131
|
+
* configured: the server wrote `format="hex"` on every color input on the
|
|
132
|
+
* page, and React, holding no such prop, reported a hydration mismatch for
|
|
133
|
+
* each one. That is the fault `Tree.chevronPlacement` had and the reason the
|
|
134
|
+
* area rules say a reflected property takes no default. Hex is still what an
|
|
135
|
+
* unset one writes; the difference is that the resting arrangement is the
|
|
136
|
+
* attribute's absence rather than a value spelled out.
|
|
137
|
+
*/
|
|
138
|
+
format?: ColorFormat;
|
|
139
|
+
/**
|
|
140
|
+
* Whether the reader may change the format from the panel.
|
|
141
|
+
*/
|
|
142
|
+
noFormat: boolean;
|
|
143
|
+
/**
|
|
144
|
+
* What the field says before a color is in it.
|
|
145
|
+
*/
|
|
146
|
+
placeholder: string;
|
|
147
|
+
/**
|
|
148
|
+
* Colors offered under the picker, as a comma-separated list.
|
|
149
|
+
*/
|
|
150
|
+
swatches: string;
|
|
151
|
+
/**
|
|
152
|
+
* Accessible name for the control that opens the panel.
|
|
153
|
+
*/
|
|
154
|
+
triggerLabel: string;
|
|
155
|
+
/** The overlay, placed against the field for the reason Date Input gives. */
|
|
156
|
+
protected readonly panel: PopoverController;
|
|
157
|
+
/**
|
|
158
|
+
* The last value that was a color.
|
|
159
|
+
*
|
|
160
|
+
* Half-typed input reaches here on every keystroke and most of it is not a
|
|
161
|
+
* color, so the picker is given the last thing that was one rather than a
|
|
162
|
+
* fallback. Typing `#00ff00` one character at a time goes `#`, `#0`, `#00`,
|
|
163
|
+
* `#00f`, `#00ff`, `#00ff0`, `#00ff00`: measured, the square went red, red,
|
|
164
|
+
* red, blue, blue, **red**, green, because two of those are colors and the
|
|
165
|
+
* ones between are not. Holding the last good one takes the flicker out and
|
|
166
|
+
* leaves the square on blue until green arrives.
|
|
167
|
+
*
|
|
168
|
+
* Not state, because it is only ever read on a render the value already
|
|
169
|
+
* caused. The same reasoning Date Input records for its calendar, which will
|
|
170
|
+
* not follow a date until the field says something complete.
|
|
171
|
+
*/
|
|
172
|
+
private settled;
|
|
173
|
+
/**
|
|
174
|
+
* What the label points at and validity hangs off.
|
|
175
|
+
*
|
|
176
|
+
* The input where there is one, the trigger where there is not. `setValidity`
|
|
177
|
+
* needs an element to anchor the message to and a label needs something
|
|
178
|
+
* focusable to name, and in `swatch` the trigger is the only control in the
|
|
179
|
+
* field. It carries `id="control"` there for the same reason.
|
|
180
|
+
*/
|
|
181
|
+
private get anchor();
|
|
182
|
+
private get control();
|
|
183
|
+
/** What the picker should show, which is only ever a color. */
|
|
184
|
+
private get picked();
|
|
185
|
+
/** What the trigger's swatch paints, which is only ever a color. */
|
|
186
|
+
private get painted();
|
|
187
|
+
/** Relayed under this element's name, so a consumer hears one control. */
|
|
188
|
+
private readonly handleInput;
|
|
189
|
+
private readonly handlePickerChange;
|
|
190
|
+
/**
|
|
191
|
+
* The picker is about to take the pointer over, so the panel gets out of the
|
|
192
|
+
* way and comes back after.
|
|
193
|
+
*
|
|
194
|
+
* `helix-color-picker` says what it is doing rather than reaching for a panel it
|
|
195
|
+
* cannot know it is in. A floating panel left up during an eyedropper is one
|
|
196
|
+
* the reader cannot dismiss and may well be trying to sample from underneath.
|
|
197
|
+
*/
|
|
198
|
+
private readonly handleSampleStart;
|
|
199
|
+
private readonly handleSampleEnd;
|
|
200
|
+
private restore;
|
|
201
|
+
/** Reports the value and the validity the host stands behind. */
|
|
202
|
+
private sync;
|
|
203
|
+
/** Escape shuts the panel without moving the color. */
|
|
204
|
+
private readonly handleKeydown;
|
|
205
|
+
protected firstUpdated(changed: PropertyValues): void;
|
|
206
|
+
protected updated(changed: PropertyValues): void;
|
|
207
|
+
/** Puts the caret in the field, the way a label pointing at one would. */
|
|
208
|
+
focus(options?: FocusOptions): void;
|
|
209
|
+
/**
|
|
210
|
+
* The picker the field opens, behind a seam the styled tier can move.
|
|
211
|
+
*
|
|
212
|
+
* A method rather than a fragment inline, so a tier above can render its own,
|
|
213
|
+
* wrap this one, pass it a property the base does not know about, or leave it
|
|
214
|
+
* out, without reimplementing the whole template to do any of them. The tag is
|
|
215
|
+
* interpolated rather than written, so `tier` resolves it: this renders the
|
|
216
|
+
* headless element, and a styled subclass that sets `tier` renders the styled one
|
|
217
|
+
* from the same template.
|
|
218
|
+
*/
|
|
219
|
+
protected renderPicker(): TemplateResult;
|
|
220
|
+
protected render(): TemplateResult;
|
|
221
|
+
}
|
|
222
|
+
declare global {
|
|
223
|
+
interface HTMLElementTagNameMap {
|
|
224
|
+
'helix-headless-color-input': HelixHeadlessColorInput;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
export {};
|