@fusion.dev/helix 0.145.0 → 0.147.0
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/custom-elements.json +13218 -3717
- package/dist/accordion/item/accordion-item.css.js +4 -92
- package/dist/accordion/item/accordion-item.d.ts +8 -0
- package/dist/accordion/root/accordion-root.css.js +2 -28
- package/dist/announcement/root/announcement-root.css.js +10 -154
- package/dist/announcement/root/announcement-root.d.ts +3 -0
- package/dist/app-header/root/app-header-root.css.js +2 -118
- package/dist/area-chart/root/area-chart-root.css.js +4 -94
- package/dist/area-chart/root/area-chart-root.d.ts +1 -0
- package/dist/aura/root/aura-root.css.js +2 -54
- package/dist/aura/root/aura-root.d.ts +21 -9
- package/dist/aura/root/aura-root.js +23 -12
- package/dist/avatar/group/avatar-group.css.js +5 -36
- package/dist/avatar/group/avatar-group.d.ts +3 -0
- package/dist/avatar/root/avatar-root.css.js +1 -53
- package/dist/avatar/root/avatar-root.d.ts +2 -0
- package/dist/badge/root/badge-root.css.js +17 -142
- package/dist/badge/root/badge-root.d.ts +20 -0
- package/dist/badge/root/badge-root.js +6 -0
- package/dist/bar-chart/root/bar-chart-root.css.js +8 -292
- package/dist/blockquote/root/blockquote-root.css.js +1 -43
- package/dist/blockquote/root/blockquote-root.d.ts +2 -0
- package/dist/breadcrumbs/breadcrumb/breadcrumb.css.js +13 -98
- package/dist/breadcrumbs/root/breadcrumbs-root.css.js +7 -21
- package/dist/breadcrumbs/root/breadcrumbs-root.d.ts +18 -0
- package/dist/breadcrumbs/root/breadcrumbs-root.js +4 -0
- package/dist/button/root/button-root.css.js +16 -196
- package/dist/button/root/button-root.d.ts +3 -0
- package/dist/button-group/root/button-group-root.css.js +2 -52
- package/dist/callout/root/callout-root.css.js +5 -137
- package/dist/callout/root/callout-root.d.ts +8 -2
- package/dist/canvas/node/canvas-node.css.js +10 -367
- package/dist/canvas/root/canvas-root.css.js +7 -270
- package/dist/card/root/card-root.css.js +5 -134
- package/dist/card/root/card-root.d.ts +6 -0
- package/dist/carousel/root/carousel-root.css.js +20 -386
- package/dist/chat/composer/chat-composer.css.js +4 -105
- package/dist/chat/message/chat-message.css.js +5 -301
- package/dist/chat/message/chat-message.d.ts +5 -0
- package/dist/chat/message/chat-message.js +2 -1
- package/dist/chat/root/chat-root.css.js +5 -155
- package/dist/chat/root/chat-root.d.ts +2 -0
- package/dist/chat/root/chat-root.js +2 -1
- package/dist/chat/typing.css.d.ts +1 -0
- package/dist/chat/typing.css.js +25 -0
- package/dist/checkbox/root/checkbox-root.css.js +12 -162
- package/dist/checkbox/root/checkbox-root.d.ts +2 -1
- package/dist/checkbox-group/root/checkbox-group-root.css.js +1 -27
- package/dist/code/root/code-root.css.js +3 -25
- package/dist/code/root/code-root.d.ts +2 -0
- package/dist/code-block/root/code-block-root.css.js +9 -250
- package/dist/code-block/root/code-block-root.d.ts +2 -1
- package/dist/color-input/root/color-input-root.css.js +5 -104
- package/dist/color-picker/root/color-picker-root.css.js +39 -329
- package/dist/color-picker/root/color-picker-root.d.ts +3 -0
- package/dist/combobox/root/combobox-root.css.js +8 -147
- package/dist/command/root/command-root.css.js +3 -74
- package/dist/copy-button/root/copy-button-root.css.js +5 -36
- package/dist/copy-button/root/copy-button-root.d.ts +7 -0
- package/dist/data-table/root/data-table-root.css.js +24 -241
- package/dist/data-table/root/data-table-root.d.ts +12 -0
- package/dist/date-input/root/date-input-root.css.js +8 -93
- package/dist/date-picker/root/date-picker-root.css.js +16 -278
- package/dist/date-picker/root/date-picker-root.d.ts +1 -0
- package/dist/description-list/item/description-list-item.css.js +1 -41
- package/dist/description-list/item/description-list-item.d.ts +7 -0
- package/dist/description-list/root/description-list-root.css.js +1 -34
- package/dist/description-list/root/description-list-root.d.ts +1 -0
- package/dist/dialog/root/dialog-root.css.js +7 -221
- package/dist/dialog/root/dialog-root.d.ts +3 -0
- package/dist/divider/root/divider-root.css.js +6 -81
- package/dist/donut-chart/root/donut-chart-root.css.js +7 -174
- package/dist/donut-chart/root/donut-chart-root.d.ts +3 -0
- package/dist/drawer/root/drawer-root.css.js +14 -193
- package/dist/drawer/root/drawer-root.d.ts +5 -0
- package/dist/drilldown/item/drilldown-item.css.js +4 -51
- package/dist/drilldown/item/drilldown-item.d.ts +7 -0
- package/dist/drilldown/root/drilldown-root.css.js +8 -109
- package/dist/drilldown/root/drilldown-root.d.ts +10 -0
- package/dist/element-events.generated.js +19 -6
- package/dist/empty/root/empty-root.css.js +2 -42
- package/dist/file-input/root/file-input-root.css.js +7 -172
- package/dist/file-input/root/file-input-root.d.ts +15 -0
- package/dist/filter-input/chip/filter-chip.css.js +2 -84
- package/dist/filter-input/field/filter-field.css.js +1 -3
- package/dist/filter-input/menu/filter-menu.css.js +1 -3
- package/dist/filter-input/operator/filter-operator.css.js +1 -3
- package/dist/filter-input/root/filter-input-root.css.js +6 -112
- package/dist/filter-input/root/filter-input-root.d.ts +5 -0
- package/dist/flex/root/flex-root.css.js +4 -198
- package/dist/flex/root/flex-root.d.ts +19 -8
- package/dist/format-date/root/format-date-root.css.js +1 -13
- package/dist/graph/root/graph-root.css.js +12 -444
- package/dist/graph/root/graph-root.d.ts +8 -0
- package/dist/grid/root/grid-root.css.js +1 -171
- package/dist/grid/root/grid-root.d.ts +4 -1
- package/dist/heatmap/root/heatmap-root.css.js +8 -155
- package/dist/heatmap/root/heatmap-root.d.ts +2 -0
- package/dist/icon/index.d.ts +1 -1
- package/dist/icon/root/icon-root.css.js +1 -18
- package/dist/icon/root/index.d.ts +1 -1
- package/dist/icon-button/root/icon-button-root.css.js +63 -186
- package/dist/icon-button/root/icon-button-root.d.ts +5 -0
- package/dist/image/root/image-root.css.js +7 -65
- package/dist/image/root/image-root.d.ts +3 -0
- package/dist/input/root/input-root.css.js +6 -79
- package/dist/kbd/root/kbd-root.css.js +2 -44
- package/dist/kbd/root/kbd-root.d.ts +9 -0
- package/dist/legend/root/legend-root.css.js +9 -106
- package/dist/legend/root/legend-root.d.ts +2 -0
- package/dist/lightbox/item/lightbox-item.css.js +1 -33
- package/dist/lightbox/root/lightbox-root.css.js +40 -144
- package/dist/line-chart/root/line-chart-root.css.js +4 -154
- package/dist/line-chart/root/line-chart-root.d.ts +3 -0
- package/dist/list/item/list-item.css.js +2 -94
- package/dist/list/root/list-root.css.js +4 -88
- package/dist/listbox/root/listbox-root.css.js +4 -102
- package/dist/listbox/root/listbox-root.d.ts +1 -0
- package/dist/loader/root/loader-root.css.js +5 -171
- package/dist/loader/root/loader-root.d.ts +2 -0
- package/dist/map/area/map-area.css.js +1 -23
- package/dist/map/buildings/map-buildings.css.js +1 -26
- package/dist/map/contours/map-contours.css.js +2 -5
- package/dist/map/landcover/map-landcover.css.js +1 -4
- package/dist/map/marker/map-marker.css.js +14 -327
- package/dist/map/points/map-points.css.js +1 -86
- package/dist/map/position/map-position.css.js +8 -227
- package/dist/map/raster/map-raster.css.js +1 -3
- package/dist/map/root/map-root.css.js +10 -352
- package/dist/map/route/map-route.css.js +1 -24
- package/dist/map/terrain/map-terrain.css.js +3 -7
- package/dist/megamenu/root/megamenu-root.css.js +15 -163
- package/dist/megamenu/root/megamenu-root.d.ts +19 -0
- package/dist/menu/item/menu-item.css.js +9 -111
- package/dist/menu/item/menu-item.d.ts +1 -0
- package/dist/menu/root/menu-root.css.js +1 -110
- package/dist/menu/section/menu-section.css.js +1 -13
- package/dist/meter/root/meter-root.css.js +20 -207
- package/dist/meter/root/meter-root.d.ts +4 -0
- package/dist/navigation/root/navigation-root.css.js +2 -54
- package/dist/navigation/root/navigation-root.d.ts +7 -0
- package/dist/notifications/group/notification-group.css.js +1 -61
- package/dist/notifications/notification/notification.css.js +17 -264
- package/dist/notifications/root/notifications-root.css.js +7 -119
- package/dist/notifications/root/notifications-root.d.ts +3 -1
- package/dist/number-input/root/number-input-root.css.js +10 -100
- package/dist/number-input/root/number-input-root.d.ts +8 -0
- package/dist/object-inspector/root/object-inspector-root.css.js +11 -166
- package/dist/option/group/option-group.css.js +1 -22
- package/dist/option/index.d.ts +1 -0
- package/dist/option/index.js +1 -0
- package/dist/option/root/option-root.css.js +3 -85
- package/dist/option/separator/option-separator.css.d.ts +1 -0
- package/dist/option/separator/option-separator.css.js +3 -0
- package/dist/option/separator/option-separator.d.ts +26 -0
- package/dist/option/separator/option-separator.js +16 -0
- package/dist/orb/root/orb-root.css.js +1 -41
- package/dist/orb/root/orb-root.d.ts +14 -6
- package/dist/orb/root/orb-root.js +16 -27
- package/dist/outline/root/outline-root.css.js +24 -122
- package/dist/outline/root/outline-root.d.ts +17 -4
- package/dist/pagination/root/pagination-root.css.js +9 -105
- package/dist/pagination/size/pagination-size.css.js +1 -22
- package/dist/pagination/summary/pagination-summary.css.js +1 -7
- package/dist/pin-input/root/pin-input-root.css.js +2 -73
- package/dist/pin-input/root/pin-input-root.d.ts +12 -2
- package/dist/popover/root/popover-root.css.js +6 -127
- package/dist/progress/root/progress-root.css.js +7 -228
- package/dist/progress/root/progress-root.d.ts +5 -0
- package/dist/qr-code/root/qr-code-root.css.js +1 -57
- package/dist/quote/root/quote-root.css.js +1 -17
- package/dist/quote/root/quote-root.d.ts +2 -0
- package/dist/radio/group/radio-group.css.js +1 -21
- package/dist/radio/root/radio-root.css.js +5 -192
- package/dist/radio/root/radio-root.d.ts +2 -1
- package/dist/rating/root/rating-root.css.js +4 -117
- package/dist/sandbox/frame.d.ts +5 -3
- package/dist/sandbox/frame.js +20 -6
- package/dist/sandbox/index.d.ts +1 -0
- package/dist/sandbox/preview/sandbox-preview.css.js +1 -12
- package/dist/sandbox/preview/sandbox-preview.d.ts +19 -3
- package/dist/sandbox/preview/sandbox-preview.js +17 -11
- package/dist/sandbox/root/sandbox-root.css.js +3 -70
- package/dist/sandbox/root/sandbox-root.d.ts +16 -4
- package/dist/sandbox/root/sandbox-root.js +29 -50
- package/dist/sandbox/source/sandbox-source.css.js +3 -25
- package/dist/sandbox/source/sandbox-source.d.ts +40 -0
- package/dist/sandbox/source/sandbox-source.js +22 -0
- package/dist/sandbox/status-bar/sandbox-status-bar.css.js +1 -21
- package/dist/sandbox/terminal/sandbox-terminal.css.js +5 -106
- package/dist/sandbox/terminal/sandbox-terminal.d.ts +14 -2
- package/dist/sandbox/terminal/sandbox-terminal.js +20 -6
- package/dist/sandbox/tokens.d.ts +39 -0
- package/dist/sandbox/tokens.js +9 -0
- package/dist/sandbox/toolbar/sandbox-toolbar.css.js +1 -36
- package/dist/scatter-chart/root/scatter-chart-root.css.js +11 -137
- package/dist/scatter-chart/root/scatter-chart-root.d.ts +3 -0
- package/dist/scroll-area/root/scroll-area-root.css.js +14 -181
- package/dist/select/root/select-root.css.js +4 -124
- package/dist/shared/chart/series.css.js +1 -36
- package/dist/shared/chart/terminus.css.js +1 -47
- package/dist/shared/chart/tooltip.css.js +1 -68
- package/dist/shared/collection/state.css.js +1 -9
- package/dist/shared/field/field-frame.css.js +3 -33
- package/dist/shared/field/field-inline.css.js +1 -4
- package/dist/shared/field/field-segments.css.js +1 -39
- package/dist/shared/field/field-stacked.css.js +1 -5
- package/dist/shared/field/field.css.js +3 -57
- package/dist/shared/floating/entrance.css.js +3 -34
- package/dist/shared/floating/panel.css.js +2 -17
- package/dist/shared/glyph/glyph.css.js +1 -5
- package/dist/shared/live/live.css.js +1 -8
- package/dist/shared/tags/tags.css.js +1 -39
- package/dist/shared/viewport/viewport.css.js +8 -135
- package/dist/skeleton/root/skeleton-root.css.js +12 -120
- package/dist/skeleton/root/skeleton-root.d.ts +1 -0
- package/dist/skip-link/root/skip-link-root.css.js +2 -35
- package/dist/skip-link/root/skip-link-root.d.ts +3 -3
- package/dist/slider/root/slider-root.css.js +35 -320
- package/dist/slider/root/slider-root.d.ts +2 -0
- package/dist/sparkline/root/sparkline-root.css.js +10 -96
- package/dist/sparkline/root/sparkline-root.d.ts +8 -0
- package/dist/sparkline/root/sparkline-root.js +2 -1
- package/dist/speed-dial/item/speed-dial-item.css.js +6 -74
- package/dist/speed-dial/item/speed-dial-item.d.ts +3 -0
- package/dist/speed-dial/root/speed-dial-root.css.js +3 -144
- package/dist/speed-dial/root/speed-dial-root.d.ts +7 -1
- package/dist/speed-dial/root/speed-dial-root.js +0 -1
- package/dist/splitter/root/splitter-root.css.js +11 -176
- package/dist/stat/group/stat-group.css.js +1 -36
- package/dist/stat/root/stat-root.css.js +3 -58
- package/dist/steps/root/steps-root.css.js +13 -70
- package/dist/steps/root/steps-root.d.ts +5 -0
- package/dist/steps/step/step.css.js +5 -156
- package/dist/switch/root/switch-root.css.js +2 -110
- package/dist/table/cell/table-cell.css.js +1 -33
- package/dist/table/column/table-column.css.js +7 -105
- package/dist/table/root/table-root.css.js +1 -43
- package/dist/table/row/table-row.css.js +6 -18
- package/dist/table/row/table-row.d.ts +2 -0
- package/dist/tabs/panel/tab-panel.css.js +2 -17
- package/dist/tabs/root/tabs-root.css.js +6 -177
- package/dist/tabs/root/tabs-root.d.ts +4 -0
- package/dist/tabs/tab/tab.css.js +10 -51
- package/dist/tabs/tab/tab.d.ts +7 -0
- package/dist/tag/group/tag-group.css.js +1 -5
- package/dist/tag/root/tag-root.css.js +1 -166
- package/dist/tag/root/tag-root.d.ts +2 -0
- package/dist/text/clamp.d.ts +5 -2
- package/dist/text/clamp.js +3 -1
- package/dist/text/root/text-root.css.js +11 -206
- package/dist/text/root/text-root.d.ts +2 -1
- package/dist/textarea/root/textarea-root.css.js +3 -44
- package/dist/time-input/root/time-input-root.css.js +7 -106
- package/dist/time-picker/root/time-picker-root.css.js +10 -134
- package/dist/time-picker/root/time-picker-root.d.ts +1 -0
- package/dist/timeline/group/timeline-group.css.js +1 -31
- package/dist/timeline/item/timeline-item.css.js +3 -134
- package/dist/timeline/root/timeline-root.css.js +1 -66
- package/dist/toast/item/toast-item.css.js +8 -240
- package/dist/toast/root/toast-root.css.js +1 -85
- package/dist/toast/root/toast-root.d.ts +1 -0
- package/dist/toast/root/toast-root.js +3 -1
- package/dist/toggle/group/toggle-group.css.js +9 -125
- package/dist/toggle/group/toggle-group.d.ts +6 -1
- package/dist/toggle/root/toggle-root.css.js +1 -23
- package/dist/toggle/root/toggle-root.d.ts +6 -0
- package/dist/toolbar/root/toolbar-root.css.js +1 -35
- package/dist/toolbar/root/toolbar-root.d.ts +4 -0
- package/dist/tooltip/root/tooltip-root.css.js +5 -101
- package/dist/tooltip/root/tooltip-root.d.ts +6 -0
- package/dist/tour/root/tour-root.css.js +2 -28
- package/dist/tour/stop/tour-stop.css.js +2 -109
- package/dist/tree/item/tree-item.css.js +14 -230
- package/dist/tree/item/tree-item.d.ts +9 -0
- package/dist/tree/root/tree-root.css.js +1 -40
- package/dist/trend/root/trend-root.css.js +5 -55
- package/dist/trend/root/trend-root.d.ts +2 -2
- package/dist/video/root/video-root.css.js +16 -398
- package/dist/video-playlist/item/video-playlist-item.css.js +12 -86
- package/dist/video-playlist/item/video-playlist-item.d.ts +12 -0
- package/dist/video-playlist/menu/video-playlist-menu.css.js +1 -41
- package/dist/video-playlist/root/video-playlist-root.css.js +1 -19
- package/dist/video-playlist/root/video-playlist-root.d.ts +2 -0
- package/dist/virtual-list/root/virtual-list-root.css.js +5 -28
- package/dist/virtual-list/root/virtual-list-root.d.ts +7 -1
- package/lint.json +1 -1
- package/package.json +9 -9
- package/types/jsx.d.ts +6997 -1154
- package/types/svelte.d.ts +1 -0
- package/types/vue.d.ts +2081 -271
|
@@ -40,7 +40,9 @@ import type { CSSResultGroup, PropertyValues, TemplateResult } from 'lit';
|
|
|
40
40
|
*
|
|
41
41
|
* **The colors are the theme's, and each has a hook**: `--aura-ground`,
|
|
42
42
|
* `--aura-haze`, `--aura-glow` and `--aura-peak`, read by the shader and by the
|
|
43
|
-
* fallback gradient alike, from wherever on the page you set them.
|
|
43
|
+
* fallback gradient alike, from wherever on the page you set them. A hook
|
|
44
|
+
* changed while the aura draws, by a class, a style or the color mode,
|
|
45
|
+
* reaches the shader on the next frame.
|
|
44
46
|
*
|
|
45
47
|
* Where the gradient shows in place of the shader, the aura matches
|
|
46
48
|
* `:state(fallback)` and sends `helix-aura-fallback` with the reason.
|
|
@@ -197,18 +199,25 @@ export declare class HelixAura extends HelixElement {
|
|
|
197
199
|
* states.
|
|
198
200
|
*/
|
|
199
201
|
variant?: 'aurora' | 'braid' | 'caustics' | 'flow' | 'fracture' | 'lattice' | 'particles' | 'rays' | 'streaks' | 'threads' | 'waves';
|
|
200
|
-
constructor();
|
|
201
202
|
/**
|
|
202
203
|
* The four ramp stops, resolved.
|
|
203
204
|
*
|
|
204
|
-
* **
|
|
205
|
-
*
|
|
206
|
-
*
|
|
207
|
-
*
|
|
208
|
-
*
|
|
209
|
-
*
|
|
205
|
+
* **Read on every frame drawn, and converted only when they moved.** A hook
|
|
206
|
+
* can change anywhere above the aura at any time: a class on a section, a
|
|
207
|
+
* style written by script, a scoped theme, the color mode. Each frame reads
|
|
208
|
+
* the five colors the canvas carries off its live computed style, which is
|
|
209
|
+
* a string compare while nothing changed, and `paletteOf` converts them only
|
|
210
|
+
* when the text differs. Converting on every frame was the cost: a style
|
|
211
|
+
* recalc and a canvas readback per stop, forever, for values that rarely
|
|
212
|
+
* move.
|
|
213
|
+
*
|
|
214
|
+
* A stopped loop draws no frame to read in, so a change of any of the five
|
|
215
|
+
* also runs a short transition on the canvas, and its end paints one frame.
|
|
216
|
+
* That covers a reader who asked for no motion.
|
|
210
217
|
*/
|
|
211
218
|
private palette;
|
|
219
|
+
/** The canvas's live computed style, and the five colors it last carried. */
|
|
220
|
+
private carried;
|
|
212
221
|
/** Why the gradient shows, while it does, or `undefined` while the shader draws. */
|
|
213
222
|
private fallback;
|
|
214
223
|
/** Why the last `build` drew nothing, for the fallback it leads to. */
|
|
@@ -458,7 +467,8 @@ export declare class HelixAura extends HelixElement {
|
|
|
458
467
|
*/
|
|
459
468
|
private readonly handleRestored;
|
|
460
469
|
/**
|
|
461
|
-
* Resolves the ramp
|
|
470
|
+
* Resolves the ramp, converting only when the colors the canvas carries
|
|
471
|
+
* moved since the last read.
|
|
462
472
|
*
|
|
463
473
|
* From the canvas's own computed style, which carries each stop on a color
|
|
464
474
|
* property: the `--aura-*` hook where a page set one, and the token
|
|
@@ -466,6 +476,8 @@ export declare class HelixAura extends HelixElement {
|
|
|
466
476
|
* chosen for a light page or a dark one.
|
|
467
477
|
*/
|
|
468
478
|
private readPalette;
|
|
479
|
+
/** One frame for a stopped loop, once a color the canvas carries has moved. */
|
|
480
|
+
private readonly handleRestyle;
|
|
469
481
|
private link;
|
|
470
482
|
/**
|
|
471
483
|
* Re-reads the box and resizes the drawing buffer to match.
|
|
@@ -5,7 +5,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
7
|
var HelixAura_1;
|
|
8
|
-
import { customElement, HelixAuraFallbackEvent, HelixElement, MAX_FRAME_STEP, PaintGateController, readColor,
|
|
8
|
+
import { customElement, HelixAuraFallbackEvent, HelixElement, MAX_FRAME_STEP, PaintGateController, readColor, } from '@fusion.dev/helix-core';
|
|
9
9
|
import { html } from 'lit';
|
|
10
10
|
import { property } from 'lit/decorators.js';
|
|
11
11
|
import { tiltFor } from '../axis.js';
|
|
@@ -17,10 +17,8 @@ const MAX_CANVAS_PIXELS = 4_194_304;
|
|
|
17
17
|
const OPENING_PATIENCE = 500;
|
|
18
18
|
const SOFTWARE_RENDERER = /swiftshader|llvmpipe|softpipe|software rasterizer|basic render/i;
|
|
19
19
|
let HelixAura = class HelixAura extends HelixElement {
|
|
20
|
-
static { HelixAura_1 = this; }
|
|
21
|
-
static { this.styles = styles; }
|
|
22
20
|
constructor() {
|
|
23
|
-
super();
|
|
21
|
+
super(...arguments);
|
|
24
22
|
this.bloom = 0.5;
|
|
25
23
|
this.drift = 0;
|
|
26
24
|
this.gain = 1;
|
|
@@ -31,6 +29,7 @@ let HelixAura = class HelixAura extends HelixElement {
|
|
|
31
29
|
this.tilt = 14;
|
|
32
30
|
this.variance = 1;
|
|
33
31
|
this.palette = { ...RESTING_PALETTE };
|
|
32
|
+
this.carried = null;
|
|
34
33
|
this.refused = 'unavailable';
|
|
35
34
|
this.canvas = null;
|
|
36
35
|
this.gl = null;
|
|
@@ -99,6 +98,9 @@ let HelixAura = class HelixAura extends HelixElement {
|
|
|
99
98
|
this.open();
|
|
100
99
|
}
|
|
101
100
|
};
|
|
101
|
+
this.handleRestyle = () => {
|
|
102
|
+
this.paintOnce();
|
|
103
|
+
};
|
|
102
104
|
this.held = 0;
|
|
103
105
|
this.handlePointer = (event) => {
|
|
104
106
|
if (this.gate.reduced) {
|
|
@@ -117,11 +119,9 @@ let HelixAura = class HelixAura extends HelixElement {
|
|
|
117
119
|
const rect = this.getBoundingClientRect();
|
|
118
120
|
this.box = { ...this.box, left: rect.left, top: rect.top };
|
|
119
121
|
};
|
|
120
|
-
new TokenColorController(this, () => {
|
|
121
|
-
this.readPalette();
|
|
122
|
-
this.paintOnce();
|
|
123
|
-
});
|
|
124
122
|
}
|
|
123
|
+
static { HelixAura_1 = this; }
|
|
124
|
+
static { this.styles = styles; }
|
|
125
125
|
static { this.CONTEXT = {
|
|
126
126
|
alpha: true,
|
|
127
127
|
antialias: false,
|
|
@@ -154,11 +154,11 @@ let HelixAura = class HelixAura extends HelixElement {
|
|
|
154
154
|
}
|
|
155
155
|
this.canvas?.addEventListener('webglcontextlost', this.handleLost);
|
|
156
156
|
this.canvas?.addEventListener('webglcontextrestored', this.handleRestored);
|
|
157
|
+
this.canvas?.addEventListener('transitionend', this.handleRestyle);
|
|
157
158
|
this.addEventListener('pointermove', this.handlePointer);
|
|
158
159
|
this.addEventListener('pointerleave', this.handleLeave);
|
|
159
160
|
this.gate.watch();
|
|
160
161
|
window.addEventListener('scroll', this.handleScroll, { capture: true, passive: true });
|
|
161
|
-
this.readPalette();
|
|
162
162
|
if (this.measure() || (this.width && !this.opened)) {
|
|
163
163
|
this.open();
|
|
164
164
|
}
|
|
@@ -262,6 +262,7 @@ let HelixAura = class HelixAura extends HelixElement {
|
|
|
262
262
|
}
|
|
263
263
|
this.canvas?.removeEventListener('webglcontextlost', this.handleLost);
|
|
264
264
|
this.canvas?.removeEventListener('webglcontextrestored', this.handleRestored);
|
|
265
|
+
this.canvas?.removeEventListener('transitionend', this.handleRestyle);
|
|
265
266
|
this.removeEventListener('pointermove', this.handlePointer);
|
|
266
267
|
this.removeEventListener('pointerleave', this.handleLeave);
|
|
267
268
|
window.removeEventListener('scroll', this.handleScroll, { capture: true });
|
|
@@ -276,9 +277,18 @@ let HelixAura = class HelixAura extends HelixElement {
|
|
|
276
277
|
this.dispatchEvent(new HelixAuraFallbackEvent({ reason }));
|
|
277
278
|
}
|
|
278
279
|
readPalette() {
|
|
279
|
-
const canvas = this.
|
|
280
|
-
if (canvas) {
|
|
281
|
-
|
|
280
|
+
const canvas = this.canvas;
|
|
281
|
+
if (!canvas) {
|
|
282
|
+
return;
|
|
283
|
+
}
|
|
284
|
+
if (this.carried?.canvas !== canvas) {
|
|
285
|
+
this.carried = { canvas, style: getComputedStyle(canvas), text: '' };
|
|
286
|
+
}
|
|
287
|
+
const { style } = this.carried;
|
|
288
|
+
const text = `${style.color} ${style.textDecorationColor} ${style.outlineColor} ${style.columnRuleColor} ${style.caretColor}`;
|
|
289
|
+
if (text !== this.carried.text) {
|
|
290
|
+
this.carried.text = text;
|
|
291
|
+
this.palette = paletteOf(style, readColor);
|
|
282
292
|
}
|
|
283
293
|
}
|
|
284
294
|
link(vertex, fragment) {
|
|
@@ -356,6 +366,7 @@ let HelixAura = class HelixAura extends HelixElement {
|
|
|
356
366
|
if (!gl || !this.program || !this.width) {
|
|
357
367
|
return;
|
|
358
368
|
}
|
|
369
|
+
this.readPalette();
|
|
359
370
|
const { glow, ground, haze, peak } = this.palette;
|
|
360
371
|
gl.uniform3fv(uniforms.uGround ?? null, ground);
|
|
361
372
|
gl.uniform3fv(uniforms.uHaze ?? null, haze);
|
|
@@ -1,20 +1,5 @@
|
|
|
1
1
|
import { createSheet } from '@fusion.dev/helix-core';
|
|
2
|
-
export const styles = createSheet(`:host {
|
|
3
|
-
--_avatar-group-ring: var(--avatar-group-ring-color, var(--helix-color-background));
|
|
4
|
-
align-items: center;
|
|
5
|
-
display: flex;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
::slotted(*) {
|
|
9
|
-
box-shadow: 0 0 0 var(--helix-border-thick) var(--_avatar-group-ring);
|
|
10
|
-
flex: 0 0 auto;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
::slotted(*:not(:first-child)) {
|
|
14
|
-
margin-inline-start: calc(-1 * var(--avatar-group-overlap, var(--helix-space-sm)));
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
:host([max="1"]) ::slotted(:nth-child(n + 2)),
|
|
2
|
+
export const styles = createSheet(`:host {--_avatar-group-ring: var(--avatar-group-ring-color, var(--helix-color-background));align-items: center;display: flex;}::slotted(*) {box-shadow: 0 0 0 var(--helix-border-thick) var(--_avatar-group-ring);flex: 0 0 auto;}::slotted(*:not(:first-child)) {margin-inline-start: calc(-1 * var(--avatar-group-overlap, var(--helix-space-sm)));}:host([max="1"]) ::slotted(:nth-child(n + 2)),
|
|
18
3
|
:host([max="2"]) ::slotted(:nth-child(n + 3)),
|
|
19
4
|
:host([max="3"]) ::slotted(:nth-child(n + 4)),
|
|
20
5
|
:host([max="4"]) ::slotted(:nth-child(n + 5)),
|
|
@@ -25,23 +10,7 @@ margin-inline-start: calc(-1 * var(--avatar-group-overlap, var(--helix-space-sm)
|
|
|
25
10
|
:host([max="9"]) ::slotted(:nth-child(n + 10)),
|
|
26
11
|
:host([max="10"]) ::slotted(:nth-child(n + 11)),
|
|
27
12
|
:host([max="11"]) ::slotted(:nth-child(n + 12)),
|
|
28
|
-
:host([max="12"]) ::slotted(:nth-child(n + 13)) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
[part="overflow"] {
|
|
33
|
-
align-items: center;
|
|
34
|
-
margin-inline-start: calc(-1 * var(--avatar-group-overlap, var(--helix-space-sm)));
|
|
35
|
-
background-color: var(--helix-color-surface-sunken);
|
|
36
|
-
block-size: var(--avatar-size, var(--helix-size-control-md));
|
|
37
|
-
border-radius: var(--helix-radii-full);
|
|
38
|
-
box-shadow: 0 0 0 var(--helix-border-thick) var(--_avatar-group-ring);
|
|
39
|
-
color: var(--helix-color-foreground-muted);
|
|
40
|
-
display: inline-flex;
|
|
41
|
-
flex: 0 0 auto;
|
|
42
|
-
font-family: var(--helix-font-sans);
|
|
43
|
-
font-size: var(--helix-text-xs);
|
|
44
|
-
font-weight: var(--helix-weight-medium);
|
|
45
|
-
inline-size: var(--avatar-size, var(--helix-size-control-md));
|
|
46
|
-
justify-content: center;
|
|
47
|
-
}`);
|
|
13
|
+
:host([max="12"]) ::slotted(:nth-child(n + 13)) {display: none;}[part="overflow"] {align-items: center;margin-inline-start: calc(-1 * var(--avatar-group-overlap, var(--helix-space-sm)));background-color: var(
|
|
14
|
+
--avatar-group-overflow-background-color,
|
|
15
|
+
var(--helix-color-surface-sunken)
|
|
16
|
+
);block-size: var(--avatar-size, var(--helix-size-control-md));border-radius: var(--helix-radii-full);box-shadow: 0 0 0 var(--helix-border-thick) var(--_avatar-group-ring);color: var(--avatar-group-overflow-color, var(--helix-color-foreground-muted));display: inline-flex;flex: 0 0 auto;font-family: var(--helix-font-sans);font-size: var(--avatar-group-overflow-font-size, var(--helix-text-xs));font-weight: var(--helix-weight-medium);inline-size: var(--avatar-size, var(--helix-size-control-md));justify-content: center;}`);
|
|
@@ -18,6 +18,9 @@ import type { CSSResultGroup } from 'lit';
|
|
|
18
18
|
* @aliases Avatar stack, Facepile
|
|
19
19
|
* @documentation https://fusion.dev/helix/components/avatar
|
|
20
20
|
*
|
|
21
|
+
* @cssproperty --avatar-group-overflow-background-color - The fill of the count of avatars past `max`.
|
|
22
|
+
* @cssproperty --avatar-group-overflow-color - The color of the count of avatars past `max`.
|
|
23
|
+
* @cssproperty --avatar-group-overflow-font-size - The type size of the count of avatars past `max`.
|
|
21
24
|
* @cssproperty --avatar-group-overlap - How far each avatar sits over the one before it.
|
|
22
25
|
* @cssproperty --avatar-group-ring-color - Color of the ring that separates one avatar from the next.
|
|
23
26
|
*/
|
|
@@ -1,54 +1,2 @@
|
|
|
1
1
|
import { createSheet } from '@fusion.dev/helix-core';
|
|
2
|
-
export const styles = createSheet(`:host {
|
|
3
|
-
--_avatar-size: var(--avatar-size, var(--helix-size-avatar));
|
|
4
|
-
|
|
5
|
-
align-items: center;
|
|
6
|
-
|
|
7
|
-
background-color: var(--avatar-background-color, var(--helix-color-surface-raised));
|
|
8
|
-
block-size: var(--_avatar-size);
|
|
9
|
-
border-radius: var(--helix-radii-full);
|
|
10
|
-
color: var(--helix-color-foreground);
|
|
11
|
-
display: inline-flex;
|
|
12
|
-
flex: 0 0 auto;
|
|
13
|
-
inline-size: var(--_avatar-size);
|
|
14
|
-
justify-content: center;
|
|
15
|
-
overflow: hidden;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
:host([size="sm"]) {
|
|
19
|
-
--_avatar-size: var(--avatar-size, var(--helix-size-avatar-sm));
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
:host([size="lg"]) {
|
|
23
|
-
--_avatar-size: var(--avatar-size, var(--helix-size-avatar-lg));
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
:host([shape="rounded"]) {
|
|
27
|
-
border-radius: var(--helix-radii-md);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
::slotted(*) {
|
|
31
|
-
block-size: 100%;
|
|
32
|
-
inline-size: 100%;
|
|
33
|
-
object-fit: cover;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
[part="image"] {
|
|
37
|
-
block-size: 100%;
|
|
38
|
-
inline-size: 100%;
|
|
39
|
-
object-fit: cover;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
[part="initials"] {
|
|
43
|
-
font-size: calc(var(--_avatar-size) * 0.4);
|
|
44
|
-
font-weight: var(--helix-weight-medium);
|
|
45
|
-
letter-spacing: var(--helix-tracking-wide);
|
|
46
|
-
line-height: 1;
|
|
47
|
-
user-select: none;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
@media print {
|
|
51
|
-
:host {
|
|
52
|
-
print-color-adjust: economy;
|
|
53
|
-
}
|
|
54
|
-
}`);
|
|
2
|
+
export const styles = createSheet(`:host {--_avatar-size: var(--avatar-size, var(--helix-size-avatar));align-items: center;background-color: var(--avatar-background-color, var(--helix-color-surface-raised));block-size: var(--_avatar-size);border-radius: var(--helix-radii-full);color: var(--avatar-color, var(--helix-color-foreground));display: inline-flex;flex: 0 0 auto;inline-size: var(--_avatar-size);justify-content: center;overflow: hidden;}:host([size="sm"]) {--_avatar-size: var(--avatar-size, var(--helix-size-avatar-sm));}:host([size="lg"]) {--_avatar-size: var(--avatar-size, var(--helix-size-avatar-lg));}:host([shape="rounded"]) {border-radius: var(--helix-radii-md);}::slotted(*) {block-size: 100%;inline-size: 100%;object-fit: cover;}[part="image"] {block-size: 100%;inline-size: 100%;object-fit: cover;}[part="initials"] {font-size: calc(var(--_avatar-size) * 0.4);font-weight: var(--avatar-font-weight, var(--helix-weight-medium));letter-spacing: var(--helix-tracking-wide);line-height: 1;user-select: none;}@media print {:host {print-color-adjust: economy;}}`);
|
|
@@ -20,6 +20,8 @@ import type { CSSResultGroup } from 'lit';
|
|
|
20
20
|
* @csspart initials - The initials shown when there is no usable image.
|
|
21
21
|
*
|
|
22
22
|
* @cssproperty --avatar-background-color - Fill behind the initials.
|
|
23
|
+
* @cssproperty --avatar-color - The color of the initials.
|
|
24
|
+
* @cssproperty --avatar-font-weight - The weight of the initials.
|
|
23
25
|
* @cssproperty --avatar-size - Edge length of the avatar.
|
|
24
26
|
*/
|
|
25
27
|
export declare class HelixAvatar extends HelixHeadlessAvatar {
|
|
@@ -1,147 +1,22 @@
|
|
|
1
1
|
import { createSheet } from '@fusion.dev/helix-core';
|
|
2
|
-
export const styles = createSheet(`:host {
|
|
3
|
-
|
|
4
|
-
--_badge-size: var(--helix-size-badge);
|
|
5
|
-
--_badge-text: var(--helix-text-xs);
|
|
6
|
-
--_badge-inset: var(--helix-space-2xs);
|
|
7
|
-
--_badge-dot: var(--helix-space-xs);
|
|
8
|
-
|
|
9
|
-
--_badge-on: var(--helix-color-foreground-on-primary);
|
|
10
|
-
display: inline-flex;
|
|
11
|
-
position: relative;
|
|
12
|
-
vertical-align: middle;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
[part="indicator"] {
|
|
16
|
-
align-items: center;
|
|
17
|
-
|
|
18
|
-
background-color: var(--badge-background-color, var(--helix-color-primary-surface));
|
|
19
|
-
block-size: var(--_badge-size);
|
|
20
|
-
border-radius: var(--helix-radii-full);
|
|
21
|
-
|
|
22
|
-
box-shadow: 0 0 0 var(--helix-border-thick) var(--badge-ring-color, var(--helix-color-background));
|
|
23
|
-
|
|
24
|
-
color: var(--badge-color, var(--_badge-on));
|
|
25
|
-
display: inline-flex;
|
|
26
|
-
font-size: var(--_badge-text);
|
|
27
|
-
font-weight: var(--helix-weight-semibold);
|
|
28
|
-
|
|
29
|
-
inset-block-start: var(--badge-offset, calc(var(--_badge-size) / 4));
|
|
30
|
-
inset-inline-end: var(--badge-offset, calc(var(--_badge-size) / 4));
|
|
31
|
-
justify-content: center;
|
|
32
|
-
line-height: 1;
|
|
33
|
-
|
|
34
|
-
min-inline-size: var(--_badge-size);
|
|
35
|
-
padding-inline: var(--_badge-inset);
|
|
36
|
-
|
|
37
|
-
pointer-events: none;
|
|
38
|
-
position: absolute;
|
|
39
|
-
translate: 50% -50%;
|
|
40
|
-
white-space: nowrap;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
[part="indicator"]:empty {
|
|
44
|
-
block-size: var(--_badge-dot);
|
|
45
|
-
min-inline-size: var(--_badge-dot);
|
|
46
|
-
padding-inline: var(--helix-space-none);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
[part="indicator"][data-single] {
|
|
50
|
-
padding-inline: var(--helix-space-none);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
[part="indicator"] {
|
|
54
|
-
scale: 1;
|
|
55
|
-
transition:
|
|
2
|
+
export const styles = createSheet(`:host {--_badge-size: var(--helix-size-badge);--_badge-text: var(--helix-text-xs);--_badge-inset: var(--helix-space-2xs);--_badge-dot: var(--helix-space-xs);--_badge-on: var(--helix-color-foreground-on-primary);--_badge-fill: var(--helix-color-primary-surface);display: inline-flex;position: relative;vertical-align: middle;}[part="indicator"] {align-items: center;background-color: var(--badge-background-color, var(--_badge-fill));block-size: var(--_badge-size);border-radius: var(--badge-radius, var(--helix-radii-full));box-shadow: 0 0 0 var(--helix-border-thick) var(--badge-ring-color, var(--helix-color-background));color: var(--badge-color, var(--_badge-on));display: inline-flex;font-size: var(--_badge-text);font-weight: var(--badge-font-weight, var(--helix-weight-semibold));inset-block-start: var(--badge-offset, calc(var(--_badge-size) / 4));inset-inline-end: var(--badge-offset, calc(var(--_badge-size) / 4));justify-content: center;line-height: 1;min-inline-size: var(--_badge-size);padding-inline: var(--_badge-inset);pointer-events: none;position: absolute;translate: 50% -50%;white-space: nowrap;}[part="indicator"]:empty {block-size: var(--_badge-dot);min-inline-size: var(--_badge-dot);padding-inline: var(--helix-space-none);}[part="indicator"][data-single] {padding-inline: var(--helix-space-none);}[part="indicator"] {scale: 1;transition:
|
|
56
3
|
opacity var(--helix-duration-fast) var(--helix-easing-standard),
|
|
57
|
-
scale var(--helix-duration-normal) var(--helix-easing-emphasized);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
[part="indicator"][data-blank] {
|
|
61
|
-
opacity: 0;
|
|
62
|
-
scale: 0;
|
|
63
|
-
transition:
|
|
4
|
+
scale var(--helix-duration-normal) var(--helix-easing-emphasized);}[part="indicator"][data-blank] {opacity: 0;scale: 0;transition:
|
|
64
5
|
opacity var(--helix-duration-fast) var(--helix-easing-standard),
|
|
65
|
-
scale var(--helix-duration-fast) var(--helix-easing-accelerate);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
:host([tone="primary"]) [part="indicator"] {
|
|
69
|
-
background-color: var(--badge-background-color, var(--helix-color-primary-surface));
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
:host([tone="accent"]) [part="indicator"] {
|
|
73
|
-
background-color: var(--badge-background-color, var(--helix-color-accent-surface));
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
:host([tone="accent"]) {
|
|
77
|
-
--_badge-on: var(--helix-color-foreground-on-accent);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
:host([tone="danger"]),
|
|
6
|
+
scale var(--helix-duration-fast) var(--helix-easing-accelerate);}:host([tone="primary"]) {--_badge-fill: var(--helix-color-primary-surface);}:host([tone="accent"]) {--_badge-fill: var(--helix-color-accent-surface);}:host([tone="accent"]) {--_badge-on: var(--helix-color-foreground-on-accent);}:host([tone="danger"]),
|
|
81
7
|
:host([tone="info"]),
|
|
82
8
|
:host([tone="success"]),
|
|
83
|
-
:host([tone="warning"]) {
|
|
84
|
-
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
:host([
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
:
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
:host([
|
|
96
|
-
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
:host([tone="danger"]) [part="indicator"] {
|
|
100
|
-
background-color: var(--badge-background-color, var(--helix-color-danger-surface));
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
:host([tone="neutral"]) [part="indicator"] {
|
|
104
|
-
background-color: var(--badge-background-color, var(--helix-color-surface-raised));
|
|
105
|
-
color: var(--badge-color, var(--helix-color-foreground));
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
:host([placement="top-start"]) [part="indicator"],
|
|
109
|
-
:host([placement="bottom-start"]) [part="indicator"] {
|
|
110
|
-
inset-inline-end: auto;
|
|
111
|
-
inset-inline-start: var(--badge-offset, calc(var(--_badge-size) / 4));
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
:host([placement="bottom-end"]) [part="indicator"],
|
|
115
|
-
:host([placement="bottom-start"]) [part="indicator"] {
|
|
116
|
-
inset-block-end: var(--badge-offset, calc(var(--_badge-size) / 4));
|
|
117
|
-
inset-block-start: auto;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
:host([placement="top-start"]) [part="indicator"] {
|
|
121
|
-
translate: -50% -50%;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
:host([placement="bottom-end"]) [part="indicator"] {
|
|
125
|
-
translate: 50% 50%;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
:host([placement="bottom-start"]) [part="indicator"] {
|
|
129
|
-
translate: -50% 50%;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
:host([placement="inline"]) {
|
|
133
|
-
align-items: center;
|
|
134
|
-
gap: var(--badge-gap, var(--helix-space-2xs));
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
:host([placement="inline"]) [part="indicator"] {
|
|
138
|
-
box-shadow: none;
|
|
139
|
-
position: static;
|
|
140
|
-
translate: none;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
@media print {
|
|
144
|
-
:host {
|
|
145
|
-
box-shadow: none;
|
|
146
|
-
}
|
|
147
|
-
}`);
|
|
9
|
+
:host([tone="warning"]) {--_badge-on: var(--helix-color-foreground-on-status);}:host([tone="info"]) {--_badge-fill: var(--helix-color-info-surface);}:host([tone="success"]) {--_badge-fill: var(--helix-color-success-surface);}:host([tone="warning"]) {--_badge-fill: var(--helix-color-warning-surface);}:host([tone="danger"]) {--_badge-fill: var(--helix-color-danger-surface);}:host([tone="neutral"]) {--_badge-fill: var(--helix-color-surface-raised);--_badge-on: var(--helix-color-foreground);}:host([placement="top-start"]) [part="indicator"],
|
|
10
|
+
:host([placement="bottom-start"]) [part="indicator"] {inset-inline-end: auto;inset-inline-start: var(--badge-offset, calc(var(--_badge-size) / 4));}:host([placement="bottom-end"]) [part="indicator"],
|
|
11
|
+
:host([placement="bottom-start"]) [part="indicator"] {inset-block-end: var(--badge-offset, calc(var(--_badge-size) / 4));inset-block-start: auto;}:host([placement="top-start"]) [part="indicator"] {translate: -50% -50%;}:host([placement="bottom-end"]) [part="indicator"] {translate: 50% 50%;}:host([placement="bottom-start"]) [part="indicator"] {translate: -50% 50%;}:host([placement="inline"]) {align-items: center;gap: var(--badge-gap, var(--helix-space-2xs));}:host([placement="inline"]) [part="indicator"] {box-shadow: none;position: static;translate: none;}:host([emphasis="outlined"]) [part="indicator"] {background-color: var(--badge-background-color, var(--helix-color-background));box-shadow:
|
|
12
|
+
inset 0 0 0 var(--helix-border-thick) var(--_badge-fill),
|
|
13
|
+
0 0 0 var(--helix-border-thick) var(--badge-ring-color, var(--helix-color-background));color: var(--badge-color, var(--helix-color-foreground));}:host([emphasis="subtle"]) [part="indicator"] {background-color: var(
|
|
14
|
+
--badge-background-color,
|
|
15
|
+
color-mix(in oklab, var(--_badge-fill) 22%, var(--helix-color-background))
|
|
16
|
+
);color: var(--badge-color, var(--helix-color-foreground));}:host([emphasis="outlined"][placement="inline"]) [part="indicator"] {box-shadow: inset 0 0 0 var(--helix-border-thick) var(--_badge-fill);}:host([attention="pulse"]) [part="indicator"]:not([data-blank]) {animation: badge-pulse var(--badge-attention-duration, 1.5s) var(--helix-easing-standard) infinite;}:host([attention="bounce"]) [part="indicator"]:not([data-blank]) {animation: badge-bounce var(--badge-attention-duration, 1s) var(--helix-easing-standard) infinite;}@keyframes badge-pulse {0%,
|
|
17
|
+
100% {transform: scale(1);}50% {transform: scale(1.18);}}@keyframes badge-bounce {0%,
|
|
18
|
+
20%,
|
|
19
|
+
53%,
|
|
20
|
+
100% {transform: translateY(0);}40%,
|
|
21
|
+
43% {transform: translateY(-30%);}70% {transform: translateY(-15%);}90% {transform: translateY(-4%);}}@media (prefers-reduced-motion: reduce) {:host([attention="pulse"]) [part="indicator"]:not([data-blank]),
|
|
22
|
+
:host([attention="bounce"]) [part="indicator"]:not([data-blank]) {animation: none;}}@media print {:host {box-shadow: none;}}`);
|
|
@@ -20,13 +20,33 @@ import type { CSSResultGroup } from 'lit';
|
|
|
20
20
|
* @aliases Count, Indicator, Pip
|
|
21
21
|
* @documentation https://fusion.dev/helix/components/badge
|
|
22
22
|
*
|
|
23
|
+
* @cssproperty --badge-attention-duration - How long one beat of `attention` takes.
|
|
23
24
|
* @cssproperty --badge-background-color - The fill of the indicator.
|
|
24
25
|
* @cssproperty --badge-color - The color of the count, to pair with a fill set through `--badge-background-color`.
|
|
26
|
+
* @cssproperty --badge-font-weight - The weight of the count.
|
|
25
27
|
* @cssproperty --badge-gap - The space between the content and the count under `placement="inline"`.
|
|
26
28
|
* @cssproperty --badge-offset - Pulls the mark in from the corner, along both axes.
|
|
29
|
+
* @cssproperty --badge-radius - How far the indicator's corners are rounded.
|
|
27
30
|
* @cssproperty --badge-ring-color - The color of the ring between the indicator and what is behind it.
|
|
28
31
|
*/
|
|
29
32
|
export declare class HelixBadge extends HelixHeadlessBadge {
|
|
33
|
+
/**
|
|
34
|
+
* An effect that draws the eye to the mark: `pulse` swells it in a loop and
|
|
35
|
+
* `bounce` hops it, as Web Awesome's badge does.
|
|
36
|
+
*
|
|
37
|
+
* Absent is still, which is right for almost every count: a mark that moves
|
|
38
|
+
* is a mark that interrupts. Still for a reader who asked the system for
|
|
39
|
+
* less motion, and while the mark is going away.
|
|
40
|
+
*/
|
|
41
|
+
attention?: 'bounce' | 'pulse';
|
|
42
|
+
/**
|
|
43
|
+
* How strongly the mark is drawn: `solid`, `outlined` or `subtle`, `Tag`'s
|
|
44
|
+
* axis.
|
|
45
|
+
*
|
|
46
|
+
* Absent is `solid`, the tone's fill. `outlined` draws the fill as a ring on
|
|
47
|
+
* the page's ground and `subtle` as a tint, both with the page's ink.
|
|
48
|
+
*/
|
|
49
|
+
emphasis?: 'outlined' | 'solid' | 'subtle';
|
|
30
50
|
/**
|
|
31
51
|
* Where the mark sits: a corner, `top-start`, `bottom-end` or `bottom-start`,
|
|
32
52
|
* or `inline`, in the line after the content.
|
|
@@ -11,6 +11,12 @@ import { styles } from './badge-root.css.js';
|
|
|
11
11
|
let HelixBadge = class HelixBadge extends HelixHeadlessBadge {
|
|
12
12
|
static { this.styles = styles; }
|
|
13
13
|
};
|
|
14
|
+
__decorate([
|
|
15
|
+
property({ reflect: true })
|
|
16
|
+
], HelixBadge.prototype, "attention", void 0);
|
|
17
|
+
__decorate([
|
|
18
|
+
property({ reflect: true })
|
|
19
|
+
], HelixBadge.prototype, "emphasis", void 0);
|
|
14
20
|
__decorate([
|
|
15
21
|
property({ reflect: true })
|
|
16
22
|
], HelixBadge.prototype, "placement", void 0);
|