@fusion.dev/helix 0.146.0 → 0.148.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 +10225 -1400
- package/dist/accordion/item/accordion-item.css.js +4 -96
- 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 -57
- 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 +12 -207
- package/dist/badge/root/badge-root.d.ts +2 -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 +8 -2
- package/dist/breadcrumbs/breadcrumb/breadcrumb.css.js +13 -98
- package/dist/breadcrumbs/root/breadcrumbs-root.css.js +5 -42
- package/dist/breadcrumbs/root/breadcrumbs-root.d.ts +17 -0
- package/dist/breadcrumbs/root/breadcrumbs-root.js +4 -0
- package/dist/button/root/button-root.css.js +16 -197
- package/dist/button/root/button-root.d.ts +1 -0
- package/dist/button-group/root/button-group-root.css.js +11 -52
- package/dist/button-group/root/button-group-root.d.ts +29 -7
- package/dist/button-group/root/button-group-root.js +19 -0
- package/dist/callout/root/callout-root.css.js +5 -138
- package/dist/callout/root/callout-root.d.ts +4 -2
- package/dist/canvas/node/canvas-node.css.js +10 -367
- package/dist/canvas/node/canvas-node.d.ts +5 -0
- package/dist/canvas/root/canvas-root.css.js +11 -270
- package/dist/canvas/root/canvas-root.d.ts +6 -0
- package/dist/card/root/card-root.css.js +5 -134
- package/dist/card/root/card-root.d.ts +4 -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 -239
- package/dist/chat/message/chat-message.d.ts +5 -0
- package/dist/chat/root/chat-root.css.js +5 -162
- package/dist/chat/typing.css.js +9 -46
- package/dist/checkbox/root/checkbox-root.css.js +12 -177
- 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-block/root/code-block-root.css.js +22 -279
- package/dist/code-block/root/code-block-root.d.ts +7 -0
- package/dist/color-input/root/color-input-root.css.js +5 -114
- package/dist/color-picker/root/color-picker-root.css.js +39 -337
- package/dist/color-picker/root/color-picker-root.d.ts +2 -0
- package/dist/combobox/root/combobox-root.css.js +8 -147
- package/dist/combobox/root/combobox-root.js +2 -0
- package/dist/command/root/command-root.css.js +3 -74
- package/dist/copy-button/root/copy-button-root.css.js +3 -43
- package/dist/data-table/root/data-table-root.css.js +21 -245
- package/dist/data-table/root/data-table-root.d.ts +7 -0
- package/dist/date-input/root/date-input-root.css.js +8 -103
- 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 +8 -0
- package/dist/description-list/root/description-list-root.css.js +2 -34
- package/dist/description-list/root/description-list-root.d.ts +13 -0
- package/dist/description-list/root/description-list-root.js +7 -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 +5 -81
- package/dist/divider/root/divider-root.d.ts +3 -0
- package/dist/donut-chart/root/donut-chart-root.css.js +7 -193
- package/dist/drawer/root/drawer-root.css.js +11 -237
- package/dist/drilldown/item/drilldown-item.css.js +4 -51
- package/dist/drilldown/item/drilldown-item.d.ts +1 -0
- package/dist/drilldown/root/drilldown-root.css.js +6 -120
- package/dist/element-events.generated.js +5 -1
- package/dist/empty/root/empty-root.css.js +2 -42
- package/dist/file-input/root/file-input-root.css.js +7 -173
- package/dist/file-input/root/file-input-root.d.ts +4 -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 -113
- package/dist/flex/root/flex-root.css.js +4 -207
- package/dist/flex/root/flex-root.d.ts +2 -2
- package/dist/format-date/root/format-date-root.css.js +1 -13
- package/dist/format-date/root/format-date-root.d.ts +0 -1
- package/dist/format-date/root/format-date-root.js +0 -1
- package/dist/graph/root/graph-root.css.js +9 -444
- package/dist/grid/root/grid-root.css.js +1 -171
- package/dist/heatmap/root/heatmap-root.css.js +8 -156
- 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 +25 -203
- package/dist/icon-button/root/icon-button-root.d.ts +1 -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 -71
- package/dist/kbd/root/kbd-root.d.ts +7 -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 -37
- package/dist/lightbox/root/lightbox-root.css.js +38 -183
- package/dist/line-chart/root/line-chart-root.css.js +4 -170
- package/dist/line-chart/root/line-chart-root.d.ts +1 -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 +7 -111
- package/dist/listbox/root/listbox-root.d.ts +2 -0
- package/dist/listbox/root/listbox-root.js +1 -0
- package/dist/loader/root/loader-root.css.js +5 -171
- 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 +14 -352
- package/dist/map/root/map-root.d.ts +10 -0
- 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 +11 -162
- package/dist/megamenu/root/megamenu-root.d.ts +8 -0
- package/dist/menu/item/menu-item.css.js +7 -130
- 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 +17 -207
- package/dist/meter/root/meter-root.d.ts +3 -0
- package/dist/navigation/root/navigation-root.css.js +2 -54
- 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 -125
- package/dist/notifications/root/notifications-root.d.ts +7 -2
- package/dist/number-input/root/number-input-root.css.js +10 -103
- package/dist/object-inspector/root/object-inspector-root.css.js +11 -162
- 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/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/root/pagination-root.d.ts +14 -0
- package/dist/pagination/size/pagination-size.css.js +1 -22
- package/dist/pagination/size/pagination-size.d.ts +3 -0
- package/dist/pagination/summary/pagination-summary.css.js +1 -7
- package/dist/pagination/summary/pagination-summary.d.ts +3 -0
- package/dist/pin-input/root/pin-input-root.css.js +2 -73
- package/dist/pin-input/root/pin-input-root.d.ts +9 -3
- package/dist/popover/root/popover-root.css.js +6 -127
- package/dist/progress/root/progress-root.css.js +7 -230
- package/dist/progress/root/progress-root.d.ts +4 -0
- package/dist/qr-code/root/qr-code-root.css.js +1 -68
- package/dist/qr-code/root/qr-code-root.d.ts +3 -0
- package/dist/quote/root/quote-root.css.js +1 -20
- package/dist/radio/group/radio-group.css.js +1 -21
- package/dist/radio/root/radio-root.css.js +5 -208
- package/dist/rating/root/rating-root.css.js +4 -117
- package/dist/sandbox/frame.d.ts +2 -1
- package/dist/sandbox/frame.js +1 -1
- package/dist/sandbox/index.d.ts +1 -1
- package/dist/sandbox/preview/sandbox-preview.css.js +1 -12
- package/dist/sandbox/preview/sandbox-preview.d.ts +27 -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 -95
- package/dist/sandbox/source/sandbox-source.d.ts +31 -25
- package/dist/sandbox/source/sandbox-source.js +12 -5
- 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 +4 -0
- package/dist/sandbox/terminal/sandbox-terminal.js +2 -1
- package/dist/sandbox/tokens.d.ts +2 -2
- package/dist/sandbox/toolbar/sandbox-toolbar.css.js +1 -36
- package/dist/scatter-chart/root/scatter-chart-root.css.js +11 -146
- package/dist/scatter-chart/root/scatter-chart-root.d.ts +1 -0
- package/dist/scroll-area/root/scroll-area-root.css.js +14 -181
- package/dist/select/root/select-root.css.js +7 -124
- package/dist/select/root/select-root.js +2 -0
- 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/skip-link/root/skip-link-root.css.js +2 -47
- package/dist/slider/root/slider-root.css.js +19 -330
- package/dist/slider/root/slider-root.d.ts +2 -0
- package/dist/sparkline/root/sparkline-root.css.js +8 -143
- package/dist/sparkline/root/sparkline-root.d.ts +2 -0
- package/dist/speed-dial/group/speed-dial-group.css.d.ts +1 -0
- package/dist/speed-dial/group/speed-dial-group.css.js +2 -0
- package/dist/speed-dial/group/speed-dial-group.d.ts +27 -0
- package/dist/speed-dial/group/speed-dial-group.js +16 -0
- package/dist/speed-dial/index.d.ts +1 -0
- package/dist/speed-dial/index.js +1 -0
- package/dist/speed-dial/item/speed-dial-item.css.js +4 -73
- package/dist/speed-dial/item/speed-dial-item.d.ts +1 -0
- package/dist/speed-dial/root/speed-dial-root.css.js +3 -149
- package/dist/splitter/root/splitter-root.css.js +19 -176
- package/dist/splitter/root/splitter-root.d.ts +4 -0
- package/dist/stat/group/stat-group.css.js +1 -36
- package/dist/stat/root/stat-root.css.js +3 -62
- package/dist/steps/root/steps-root.css.js +7 -92
- 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/tab/tab.css.js +6 -54
- package/dist/tag/group/tag-group.css.js +1 -11
- package/dist/tag/root/tag-root.css.js +1 -166
- package/dist/tag/root/tag-root.d.ts +2 -0
- package/dist/text/root/text-root.css.js +11 -200
- package/dist/textarea/root/textarea-root.css.js +3 -71
- package/dist/time-input/root/time-input-root.css.js +7 -118
- package/dist/time-picker/root/time-picker-root.css.js +15 -134
- package/dist/time-picker/root/time-picker-root.d.ts +7 -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 +11 -250
- package/dist/toast/item/toast-item.d.ts +10 -0
- package/dist/toast/root/toast-root.css.js +1 -85
- package/dist/toast/root/toast-root.js +2 -1
- package/dist/toggle/group/toggle-group.css.js +7 -126
- package/dist/toggle/root/toggle-root.css.js +1 -23
- package/dist/toolbar/root/toolbar-root.css.js +1 -36
- package/dist/toolbar/root/toolbar-root.d.ts +11 -0
- package/dist/toolbar/root/toolbar-root.js +4 -0
- package/dist/tooltip/root/tooltip-root.css.js +5 -101
- package/dist/tooltip/root/tooltip-root.d.ts +2 -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 +12 -238
- package/dist/tree/root/tree-root.css.js +1 -40
- package/dist/trend/root/trend-root.css.js +5 -53
- 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 +3 -40
- package/lint.json +1 -1
- package/package.json +6 -6
- package/types/jsx.d.ts +4595 -777
- package/types/svelte.d.ts +2 -0
- package/types/vue.d.ts +1312 -210
|
@@ -1,96 +1,4 @@
|
|
|
1
1
|
import { createSheet } from '@fusion.dev/helix-core';
|
|
2
|
-
export const styles = createSheet(`:host {
|
|
3
|
-
display: block;
|
|
4
|
-
block-size:
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
[part="source"] {
|
|
8
|
-
background-color: var(--sandbox-source-background-color, var(--helix-color-background));
|
|
9
|
-
block-size: 100%;
|
|
10
|
-
border: none;
|
|
11
|
-
color: var(--helix-color-foreground-muted);
|
|
12
|
-
display: block;
|
|
13
|
-
font-family: var(--helix-font-mono);
|
|
14
|
-
font-size: var(--helix-text-xs);
|
|
15
|
-
inline-size: 100%;
|
|
16
|
-
line-height: var(--helix-leading-normal);
|
|
17
|
-
min-block-size: var(--sandbox-source-min-block-size, 12rem);
|
|
18
|
-
padding: var(--helix-space-sm);
|
|
19
|
-
resize: none;
|
|
20
|
-
tab-size: 2;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
[part="source"]:focus-visible {
|
|
24
|
-
background-color: var(--helix-color-surface);
|
|
25
|
-
outline: none;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
[part="field"] {
|
|
29
|
-
background-color: var(--sandbox-source-background-color, var(--helix-color-background));
|
|
30
|
-
block-size: 100%;
|
|
31
|
-
display: grid;
|
|
32
|
-
grid-template-rows: minmax(max-content, auto);
|
|
33
|
-
overflow: auto;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
[part="field"]:focus-within {
|
|
37
|
-
background-color: var(--helix-color-surface);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
[part="field"] > [part="highlight"],
|
|
41
|
-
[part="field"] > [part="source"] {
|
|
42
|
-
border: none;
|
|
43
|
-
box-sizing: border-box;
|
|
44
|
-
font-family: var(--helix-font-mono);
|
|
45
|
-
font-size: var(--helix-text-xs);
|
|
46
|
-
grid-area: 1 / 1;
|
|
47
|
-
inline-size: 100%;
|
|
48
|
-
letter-spacing: normal;
|
|
49
|
-
line-height: var(--helix-leading-normal);
|
|
50
|
-
margin: 0;
|
|
51
|
-
min-block-size: var(--sandbox-source-min-block-size, 12rem);
|
|
52
|
-
overflow-wrap: break-word;
|
|
53
|
-
padding: var(--helix-space-sm);
|
|
54
|
-
tab-size: 2;
|
|
55
|
-
white-space: pre-wrap;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
[part="field"] > [part="highlight"] {
|
|
59
|
-
color: var(--helix-color-foreground-muted);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
[part="field"] > [part="source"],
|
|
63
|
-
[part="field"] > [part="source"]:focus-visible {
|
|
64
|
-
-webkit-text-fill-color: transparent;
|
|
65
|
-
align-self: stretch;
|
|
66
|
-
background-color: transparent;
|
|
67
|
-
block-size: auto;
|
|
68
|
-
caret-color: var(--helix-color-foreground);
|
|
69
|
-
color: transparent;
|
|
70
|
-
overflow: hidden;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
[part="token"][data-kind="callable"] {
|
|
74
|
-
color: var(--sandbox-source-callable-color, var(--helix-color-syntax-callable));
|
|
75
|
-
}
|
|
76
|
-
[part="token"][data-kind="comment"] {
|
|
77
|
-
color: var(--sandbox-source-comment-color, var(--helix-color-syntax-comment));
|
|
78
|
-
}
|
|
79
|
-
[part="token"][data-kind="constant"] {
|
|
80
|
-
color: var(--sandbox-source-constant-color, var(--helix-color-syntax-constant));
|
|
81
|
-
}
|
|
82
|
-
[part="token"][data-kind="invalid"] {
|
|
83
|
-
color: var(--sandbox-source-invalid-color, var(--helix-color-syntax-invalid));
|
|
84
|
-
}
|
|
85
|
-
[part="token"][data-kind="keyword"] {
|
|
86
|
-
color: var(--sandbox-source-keyword-color, var(--helix-color-syntax-keyword));
|
|
87
|
-
}
|
|
88
|
-
[part="token"][data-kind="name"] {
|
|
89
|
-
color: var(--sandbox-source-name-color, var(--helix-color-syntax-name));
|
|
90
|
-
}
|
|
91
|
-
[part="token"][data-kind="string"] {
|
|
92
|
-
color: var(--sandbox-source-string-color, var(--helix-color-syntax-string));
|
|
93
|
-
}
|
|
94
|
-
[part="token"][data-kind="tag"] {
|
|
95
|
-
color: var(--sandbox-source-tag-color, var(--helix-color-syntax-tag));
|
|
96
|
-
}`);
|
|
2
|
+
export const styles = createSheet(`:host {display: block;block-size: 100%;}[part="highlight"],
|
|
3
|
+
[part="source"] {border: none;color: var(--helix-color-foreground-muted);font-family: var(--helix-font-mono);font-size: var(--helix-text-xs);inline-size: 100%;line-height: var(--helix-leading-normal);min-block-size: var(--sandbox-source-min-block-size, 12rem);padding: var(--helix-space-sm);tab-size: 2;}[part="source"] {background-color: var(--sandbox-source-background-color, var(--helix-color-background));block-size: 100%;display: block;resize: none;}[part="source"]:focus-visible {background-color: var(--helix-color-surface);outline: none;}[part="field"] {background-color: var(--sandbox-source-background-color, var(--helix-color-background));block-size: 100%;display: grid;grid-template-rows: minmax(max-content, auto);overflow: auto;}[part="field"]:focus-within {background-color: var(--helix-color-surface);}[part="field"] > [part] {grid-area: 1 / 1;letter-spacing: normal;margin: 0;overflow-wrap: break-word;white-space: pre-wrap;}[part="field"] > [part="source"],
|
|
4
|
+
[part="field"] > [part="source"]:focus-visible {-webkit-text-fill-color: transparent;align-self: stretch;background-color: transparent;block-size: auto;caret-color: var(--helix-color-foreground);color: transparent;overflow: hidden;}[data-kind="callable"] {color: var(--sandbox-source-callable-color, var(--helix-color-syntax-callable));}[data-kind="comment"] {color: var(--sandbox-source-comment-color, var(--helix-color-syntax-comment));}[data-kind="constant"] {color: var(--sandbox-source-constant-color, var(--helix-color-syntax-constant));}[data-kind="invalid"] {color: var(--sandbox-source-invalid-color, var(--helix-color-syntax-invalid));}[data-kind="keyword"] {color: var(--sandbox-source-keyword-color, var(--helix-color-syntax-keyword));}[data-kind="name"] {color: var(--sandbox-source-name-color, var(--helix-color-syntax-name));}[data-kind="string"] {color: var(--sandbox-source-string-color, var(--helix-color-syntax-string));}[data-kind="tag"] {color: var(--sandbox-source-tag-color, var(--helix-color-syntax-tag));}`);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HelixElement } from '@fusion.dev/helix-core';
|
|
2
2
|
import type { CSSResultGroup, TemplateResult } from 'lit';
|
|
3
|
-
import { type
|
|
3
|
+
import { type SandboxTokenizer } from '../tokens.js';
|
|
4
4
|
/**
|
|
5
5
|
* @summary An editable source pane for a sandbox preview.
|
|
6
6
|
*
|
|
@@ -12,7 +12,7 @@ import { type SandboxHighlight } from '../tokens.js';
|
|
|
12
12
|
* field, press Escape and then Tab. Shift+Tab moves focus back as it does
|
|
13
13
|
* anywhere else. The field's description says so to a screen reader.
|
|
14
14
|
*
|
|
15
|
-
* **`
|
|
15
|
+
* **`tokenize` colors the source** with a highlighter you bring, such as one
|
|
16
16
|
* built on Lezer, Prism or Shiki. It is a function from the source to runs of
|
|
17
17
|
* text, each with an optional kind, and the pane draws the runs under a
|
|
18
18
|
* transparent field, so typing, selection and undo stay the textarea's. The
|
|
@@ -20,7 +20,9 @@ import { type SandboxHighlight } from '../tokens.js';
|
|
|
20
20
|
* `string` and `tag`, each colored by the `--helix-color-syntax-*` token of
|
|
21
21
|
* its name and a hook of its own, such as `--sandbox-source-keyword-color`.
|
|
22
22
|
* A run of any other kind is drawn in the field's own color. Every run with a
|
|
23
|
-
* kind is a `token` part, and carries its kind as `data-kind`.
|
|
23
|
+
* kind is a `token` part, and carries its kind as `data-kind`. A `tokenize`
|
|
24
|
+
* that throws leaves the source drawn plain and the field editable, and the
|
|
25
|
+
* error is reported to the page as an uncaught one.
|
|
24
26
|
*
|
|
25
27
|
* @since 0.1.0
|
|
26
28
|
* @status stable
|
|
@@ -31,37 +33,27 @@ import { type SandboxHighlight } from '../tokens.js';
|
|
|
31
33
|
* @event {HelixCaretEvent} helix-caret - Fired when the cursor moves.
|
|
32
34
|
* @event {HelixEditEvent} helix-edit - Fired after the source was edited, with the new source.
|
|
33
35
|
*
|
|
34
|
-
* @csspart field - The box that scrolls the field and its colors together, under `
|
|
35
|
-
* @csspart highlight - The colored copy of the source drawn under the field, under `
|
|
36
|
+
* @csspart field - The box that scrolls the field and its colors together, under `tokenize`.
|
|
37
|
+
* @csspart highlight - The colored copy of the source drawn under the field, under `tokenize`.
|
|
36
38
|
* @csspart source - The editable region.
|
|
37
|
-
* @csspart token - One run of the source that has a kind, under `
|
|
39
|
+
* @csspart token - One run of the source that has a kind, under `tokenize`.
|
|
38
40
|
*
|
|
39
41
|
* @cssproperty --sandbox-source-background-color - Fill behind the source.
|
|
40
|
-
* @cssproperty --sandbox-source-callable-color - Color of a `callable` run, under `
|
|
41
|
-
* @cssproperty --sandbox-source-comment-color - Color of a `comment` run, under `
|
|
42
|
-
* @cssproperty --sandbox-source-constant-color - Color of a `constant` run, under `
|
|
43
|
-
* @cssproperty --sandbox-source-invalid-color - Color of an `invalid` run, under `
|
|
44
|
-
* @cssproperty --sandbox-source-keyword-color - Color of a `keyword` run, under `
|
|
42
|
+
* @cssproperty --sandbox-source-callable-color - Color of a `callable` run, under `tokenize`. Defaults to `--helix-color-syntax-callable`.
|
|
43
|
+
* @cssproperty --sandbox-source-comment-color - Color of a `comment` run, under `tokenize`. Defaults to `--helix-color-syntax-comment`.
|
|
44
|
+
* @cssproperty --sandbox-source-constant-color - Color of a `constant` run, under `tokenize`. Defaults to `--helix-color-syntax-constant`.
|
|
45
|
+
* @cssproperty --sandbox-source-invalid-color - Color of an `invalid` run, under `tokenize`. Defaults to `--helix-color-syntax-invalid`.
|
|
46
|
+
* @cssproperty --sandbox-source-keyword-color - Color of a `keyword` run, under `tokenize`. Defaults to `--helix-color-syntax-keyword`.
|
|
45
47
|
* @cssproperty --sandbox-source-min-block-size - Minimum height of the pane.
|
|
46
|
-
* @cssproperty --sandbox-source-name-color - Color of a `name` run, under `
|
|
47
|
-
* @cssproperty --sandbox-source-string-color - Color of a `string` run, under `
|
|
48
|
-
* @cssproperty --sandbox-source-tag-color - Color of a `tag` run, under `
|
|
48
|
+
* @cssproperty --sandbox-source-name-color - Color of a `name` run, under `tokenize`. Defaults to `--helix-color-syntax-name`.
|
|
49
|
+
* @cssproperty --sandbox-source-string-color - Color of a `string` run, under `tokenize`. Defaults to `--helix-color-syntax-string`.
|
|
50
|
+
* @cssproperty --sandbox-source-tag-color - Color of a `tag` run, under `tokenize`. Defaults to `--helix-color-syntax-tag`.
|
|
49
51
|
*/
|
|
50
52
|
export declare class HelixSandboxSource extends HelixElement {
|
|
51
53
|
/**
|
|
52
54
|
* The editable region's name, read by screen readers.
|
|
53
55
|
*/
|
|
54
56
|
fieldLabel: string;
|
|
55
|
-
/**
|
|
56
|
-
* Colors the source: a function from the source and the pane's `name` to
|
|
57
|
-
* runs of text, each with an optional kind, such as
|
|
58
|
-
* `[{ text: '<' }, { kind: 'tag', text: 'p' }, { text: '>' }]`.
|
|
59
|
-
*
|
|
60
|
-
* Absent, the pane is a plain field. Runs whose text does not add up to the
|
|
61
|
-
* source are drawn as the source, uncolored, so the colors never drift from
|
|
62
|
-
* the caret. Set it as a property.
|
|
63
|
-
*/
|
|
64
|
-
highlight?: SandboxHighlight;
|
|
65
57
|
/**
|
|
66
58
|
* The field's description, read by screen readers while Tab indents.
|
|
67
59
|
*/
|
|
@@ -79,6 +71,20 @@ export declare class HelixSandboxSource extends HelixElement {
|
|
|
79
71
|
* Whether Tab indents the source. When it is off, Tab moves focus.
|
|
80
72
|
*/
|
|
81
73
|
tabIndents: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Colors the source: a function from the source and the pane's `name` to
|
|
76
|
+
* runs of text, each with an optional kind, such as
|
|
77
|
+
* `[{ text: '<' }, { kind: 'tag', text: 'p' }, { text: '>' }]`.
|
|
78
|
+
*
|
|
79
|
+
* Absent, the pane is a plain field. Runs whose text does not add up to the
|
|
80
|
+
* source are drawn as the source, uncolored, so the colors never drift from
|
|
81
|
+
* the caret, and so is the source when the function throws. Set it as a
|
|
82
|
+
* property.
|
|
83
|
+
*
|
|
84
|
+
* Named for what it returns, runs of text, where Code Block's `highlight`
|
|
85
|
+
* returns markup.
|
|
86
|
+
*/
|
|
87
|
+
tokenize?: SandboxTokenizer;
|
|
82
88
|
/**
|
|
83
89
|
* The source being edited.
|
|
84
90
|
*/
|
|
@@ -123,7 +129,7 @@ export declare class HelixSandboxSource extends HelixElement {
|
|
|
123
129
|
private edit;
|
|
124
130
|
private readonly handleKeydown;
|
|
125
131
|
protected render(): TemplateResult;
|
|
126
|
-
/** The field itself and its description, which is the whole pane without `
|
|
132
|
+
/** The field itself and its description, which is the whole pane without `tokenize`. */
|
|
127
133
|
private renderField;
|
|
128
134
|
static styles: CSSResultGroup;
|
|
129
135
|
}
|
|
@@ -67,10 +67,17 @@ let HelixSandboxSource = class HelixSandboxSource extends HelixElement {
|
|
|
67
67
|
}
|
|
68
68
|
render() {
|
|
69
69
|
const field = this.renderField();
|
|
70
|
-
if (!this.
|
|
70
|
+
if (!this.tokenize) {
|
|
71
71
|
return field;
|
|
72
72
|
}
|
|
73
|
-
|
|
73
|
+
let given = [];
|
|
74
|
+
try {
|
|
75
|
+
given = this.tokenize(this.value, this.name);
|
|
76
|
+
}
|
|
77
|
+
catch (error) {
|
|
78
|
+
globalThis.reportError?.(error);
|
|
79
|
+
}
|
|
80
|
+
const runs = drawnRuns(this.value, given);
|
|
74
81
|
return html `<div part="field">
|
|
75
82
|
<pre part="highlight" aria-hidden="true">${runs.map(({ kind, text }) => kind ? html `<span part="token" data-kind=${kind}>${text}</span>` : text)}${'\n'}</pre>
|
|
76
83
|
${field}
|
|
@@ -96,9 +103,6 @@ let HelixSandboxSource = class HelixSandboxSource extends HelixElement {
|
|
|
96
103
|
__decorate([
|
|
97
104
|
property({ attribute: 'field-label' })
|
|
98
105
|
], HelixSandboxSource.prototype, "fieldLabel", void 0);
|
|
99
|
-
__decorate([
|
|
100
|
-
property({ attribute: false })
|
|
101
|
-
], HelixSandboxSource.prototype, "highlight", void 0);
|
|
102
106
|
__decorate([
|
|
103
107
|
property({ attribute: 'keys-description' })
|
|
104
108
|
], HelixSandboxSource.prototype, "keysDescription", void 0);
|
|
@@ -108,6 +112,9 @@ __decorate([
|
|
|
108
112
|
__decorate([
|
|
109
113
|
property({ attribute: 'tab-indents', converter: onUnlessFalse })
|
|
110
114
|
], HelixSandboxSource.prototype, "tabIndents", void 0);
|
|
115
|
+
__decorate([
|
|
116
|
+
property({ attribute: false })
|
|
117
|
+
], HelixSandboxSource.prototype, "tokenize", void 0);
|
|
111
118
|
__decorate([
|
|
112
119
|
property()
|
|
113
120
|
], HelixSandboxSource.prototype, "value", void 0);
|
|
@@ -1,22 +1,2 @@
|
|
|
1
1
|
import { createSheet } from '@fusion.dev/helix-core';
|
|
2
|
-
export const styles = createSheet(`:host {
|
|
3
|
-
align-items: center;
|
|
4
|
-
background-color: var(--helix-color-background);
|
|
5
|
-
border-block-start: var(--helix-border-thin) solid var(--helix-color-border);
|
|
6
|
-
color: var(--sandbox-status-bar-color, var(--helix-color-foreground-subtle));
|
|
7
|
-
display: flex;
|
|
8
|
-
font-size: var(--helix-text-xs);
|
|
9
|
-
gap: var(--helix-space-sm);
|
|
10
|
-
line-height: var(--helix-leading-tight);
|
|
11
|
-
padding: var(--helix-space-2xs) var(--helix-space-sm);
|
|
12
|
-
|
|
13
|
-
user-select: none;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
slot:not([name]) + * {
|
|
17
|
-
margin-inline-start: auto;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
[part="caret"] {
|
|
21
|
-
font-variant-numeric: tabular-nums;
|
|
22
|
-
}`);
|
|
2
|
+
export const styles = createSheet(`:host {align-items: center;background-color: var(--helix-color-background);border-block-start: var(--helix-border-thin) solid var(--helix-color-border);color: var(--sandbox-status-bar-color, var(--helix-color-foreground-subtle));display: flex;font-size: var(--helix-text-xs);gap: var(--helix-space-sm);line-height: var(--helix-leading-tight);padding: var(--helix-space-2xs) var(--helix-space-sm);user-select: none;}slot:not([name]) + * {margin-inline-start: auto;}[part="caret"] {font-variant-numeric: tabular-nums;}`);
|
|
@@ -1,107 +1,6 @@
|
|
|
1
1
|
import { createSheet } from '@fusion.dev/helix-core';
|
|
2
|
-
export const styles = createSheet(`:host {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
min-block-size: 0;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
:host([controls]) {
|
|
11
|
-
grid-template-rows: auto minmax(0, 1fr);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
[part="controls"] {
|
|
15
|
-
align-items: center;
|
|
16
|
-
border-block-end: var(--helix-border-thin) solid var(--helix-color-border);
|
|
17
|
-
display: flex;
|
|
18
|
-
font-family: var(--helix-font-sans);
|
|
19
|
-
font-size: var(--helix-text-xs);
|
|
20
|
-
gap: var(--helix-space-xs);
|
|
21
|
-
justify-content: space-between;
|
|
22
|
-
padding: var(--helix-space-2xs) var(--helix-space-sm);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
[part="filter"],
|
|
26
|
-
[part="clear"] {
|
|
27
|
-
background-color: transparent;
|
|
28
|
-
border: var(--helix-border-thin) solid var(--helix-color-border);
|
|
29
|
-
border-radius: var(--helix-radii-sm);
|
|
30
|
-
color: var(--helix-color-foreground);
|
|
31
|
-
font: inherit;
|
|
32
|
-
padding: var(--helix-space-2xs) var(--helix-space-xs);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
[part="clear"] {
|
|
36
|
-
cursor: pointer;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
[part="clear"]:hover {
|
|
40
|
-
background-color: var(--helix-color-surface-sunken);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
[part="filter"]:focus-visible,
|
|
44
|
-
[part="clear"]:focus-visible {
|
|
45
|
-
outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);
|
|
46
|
-
outline-offset: var(--helix-size-focus-offset);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
[part="log"] {
|
|
50
|
-
font-family: var(--helix-font-mono);
|
|
51
|
-
font-size: var(--helix-text-xs);
|
|
52
|
-
line-height: var(--helix-leading-normal);
|
|
53
|
-
overflow: auto;
|
|
54
|
-
padding: var(--helix-space-xs) var(--helix-space-sm);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
[part="log"]:focus-visible {
|
|
58
|
-
outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);
|
|
59
|
-
outline-offset: calc(var(--helix-size-focus-offset) * -1);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
[part="empty"] {
|
|
63
|
-
color: var(--helix-color-foreground-subtle);
|
|
64
|
-
margin: var(--helix-space-none);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
[part="entry"] {
|
|
68
|
-
align-items: baseline;
|
|
69
|
-
color: var(--helix-color-foreground-muted);
|
|
70
|
-
display: grid;
|
|
71
|
-
gap: var(--helix-space-xs);
|
|
72
|
-
grid-template-columns: 3.5rem minmax(0, 1fr) auto;
|
|
73
|
-
padding-block: var(--helix-space-2xs);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
[part="level"] {
|
|
77
|
-
color: var(--helix-color-foreground-subtle);
|
|
78
|
-
text-transform: uppercase;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
[part="message"] {
|
|
82
|
-
white-space: pre-wrap;
|
|
83
|
-
word-break: break-word;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
[part="count"] {
|
|
87
|
-
background-color: var(--helix-color-surface-sunken);
|
|
88
|
-
border-radius: var(--helix-radii-full);
|
|
89
|
-
color: var(--helix-color-foreground-subtle);
|
|
90
|
-
padding-inline: var(--helix-space-2xs);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
[part="entry"][data-level="warn"] {
|
|
94
|
-
color: var(--helix-color-warning);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
[part="entry"][data-level="warn"] [part="level"] {
|
|
98
|
-
color: var(--helix-color-warning);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
[part="entry"][data-level="error"] {
|
|
102
|
-
color: var(--helix-color-danger);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
[part="entry"][data-level="error"] [part="level"] {
|
|
106
|
-
color: var(--helix-color-danger);
|
|
107
|
-
}`);
|
|
2
|
+
export const styles = createSheet(`:host {block-size: var(--sandbox-terminal-size, 100%);display: grid;grid-template-rows: minmax(0, 1fr);min-block-size: 0;}:host([controls]) {grid-template-rows: auto minmax(0, 1fr);}[part="controls"] {align-items: center;border-block-end: var(--helix-border-thin) solid var(--helix-color-border);display: flex;font-family: var(--helix-font-sans);font-size: var(--helix-text-xs);gap: var(--helix-space-xs);justify-content: space-between;padding: var(--helix-space-2xs) var(--helix-space-sm);}[part="filter"],
|
|
3
|
+
[part="clear"] {background-color: transparent;border: var(--helix-border-thin) solid var(--helix-color-border);border-radius: var(--helix-radii-sm);color: var(--helix-color-foreground);font: inherit;padding: var(--helix-space-2xs) var(--helix-space-xs);}[part="clear"] {cursor: pointer;}[part="clear"]:hover {background-color: var(--helix-color-surface-sunken);}[part="filter"]:focus-visible,
|
|
4
|
+
[part="clear"]:focus-visible {outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);outline-offset: var(--helix-size-focus-offset);}[part="log"] {font-family: var(--helix-font-mono);font-size: var(--helix-text-xs);line-height: var(--helix-leading-normal);overflow: auto;padding: var(--helix-space-xs) var(--helix-space-sm);}[part="log"]:focus-visible {outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);outline-offset: calc(var(--helix-size-focus-offset) * -1);}[part="empty"] {color: var(--helix-color-foreground-subtle);margin: var(--helix-space-none);}[part="entry"] {align-items: baseline;color: var(--helix-color-foreground-muted);display: grid;gap: var(--helix-space-xs);grid-template-columns: 3.5rem minmax(0, 1fr) auto;padding-block: var(--helix-space-2xs);}[part="level"] {color: var(--helix-color-foreground-subtle);text-transform: uppercase;}[part="message"] {white-space: pre-wrap;word-break: break-word;}[part="count"] {background-color: var(--helix-color-surface-sunken);border-radius: var(--helix-radii-full);color: var(--helix-color-foreground-subtle);padding-inline: var(--helix-space-2xs);}[data-level="warn"],
|
|
5
|
+
[data-level="warn"] [part="level"] {color: var(--helix-color-warning);}[data-level="error"],
|
|
6
|
+
[data-level="error"] [part="level"] {color: var(--helix-color-danger);}`);
|
|
@@ -106,6 +106,10 @@ export declare class HelixSandboxTerminal extends HelixElement {
|
|
|
106
106
|
* Takes the level the reader chose in the filter, unless a listener
|
|
107
107
|
* refused it, and then says so with the select's own `change`, which stops
|
|
108
108
|
* at the shadow root otherwise. A refusal puts the select back.
|
|
109
|
+
*
|
|
110
|
+
* The select's `input` is stopped where it starts, as Pagination's is. It is
|
|
111
|
+
* composed and comes first, so it left this element before
|
|
112
|
+
* `helix-before-change` and still left it when the change was refused.
|
|
109
113
|
*/
|
|
110
114
|
private readonly handleLevel;
|
|
111
115
|
/** The clear button and the level filter, under `controls`. */
|
|
@@ -16,6 +16,7 @@ const LEVEL_WORDS = {
|
|
|
16
16
|
warn: 'Warnings and errors',
|
|
17
17
|
};
|
|
18
18
|
const LIMIT = 200;
|
|
19
|
+
const stop = (event) => event.stopPropagation();
|
|
19
20
|
let HelixSandboxTerminal = class HelixSandboxTerminal extends HelixElement {
|
|
20
21
|
constructor() {
|
|
21
22
|
super(...arguments);
|
|
@@ -77,7 +78,7 @@ let HelixSandboxTerminal = class HelixSandboxTerminal extends HelixElement {
|
|
|
77
78
|
return nothing;
|
|
78
79
|
}
|
|
79
80
|
return html `<div part="controls">
|
|
80
|
-
<select part="filter" aria-label=${this.levelLabel} @change=${this.handleLevel}>
|
|
81
|
+
<select part="filter" aria-label=${this.levelLabel} @change=${this.handleLevel} @input=${stop}>
|
|
81
82
|
${LEVELS.map((one) => html `<option value=${one} ?selected=${(this.level ?? 'log') === one}>
|
|
82
83
|
${this.levelWords?.[one] ?? LEVEL_WORDS[one]}
|
|
83
84
|
</option>`)}
|
package/dist/sandbox/tokens.d.ts
CHANGED
|
@@ -10,12 +10,12 @@ export interface SandboxToken {
|
|
|
10
10
|
text: string;
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
|
-
* Splits a pane's source into runs, for `SandboxSource.
|
|
13
|
+
* Splits a pane's source into runs, for `SandboxSource.tokenize`.
|
|
14
14
|
*
|
|
15
15
|
* Takes the source and the pane's `name`, such as `html` or `css`, so one
|
|
16
16
|
* function can serve every pane.
|
|
17
17
|
*/
|
|
18
|
-
export type
|
|
18
|
+
export type SandboxTokenizer = (source: string, name: string) => readonly SandboxToken[];
|
|
19
19
|
/** A run as the pane draws it: its text, and its kind as an attribute holds it. */
|
|
20
20
|
export interface DrawnRun {
|
|
21
21
|
/** The kind, in lowercase letters, digits and hyphens, or `undefined` for plain text. */
|
|
@@ -1,37 +1,2 @@
|
|
|
1
1
|
import { createSheet } from '@fusion.dev/helix-core';
|
|
2
|
-
export const styles = createSheet(`:host {
|
|
3
|
-
|
|
4
|
-
--helix-size-checkbox: var(--helix-size-checkbox-sm);
|
|
5
|
-
--helix-size-checkbox-loose: calc(var(--helix-size-checkbox) * 1.2);
|
|
6
|
-
--helix-size-checkbox-tight: calc(var(--helix-size-checkbox) * 0.8);
|
|
7
|
-
--helix-size-icon: var(--helix-size-icon-sm);
|
|
8
|
-
--helix-size-icon-loose: calc(var(--helix-size-icon) * 1.2);
|
|
9
|
-
--helix-size-icon-tight: calc(var(--helix-size-icon) * 0.8);
|
|
10
|
-
--helix-size-control: var(--helix-size-control-sm);
|
|
11
|
-
--helix-size-control-loose: calc(var(--helix-size-control) * 1.2);
|
|
12
|
-
--helix-size-control-tight: calc(var(--helix-size-control) * 0.8);
|
|
13
|
-
--helix-size-tag: var(--helix-size-tag-sm);
|
|
14
|
-
|
|
15
|
-
align-items: center;
|
|
16
|
-
background-color: var(--helix-color-background);
|
|
17
|
-
|
|
18
|
-
block-size: var(--sandbox-toolbar-size, var(--helix-size-control-lg));
|
|
19
|
-
|
|
20
|
-
border-block-end: var(--helix-border-thin) solid var(--helix-color-border);
|
|
21
|
-
display: flex;
|
|
22
|
-
min-block-size: 0;
|
|
23
|
-
padding-block: var(--helix-space-none);
|
|
24
|
-
|
|
25
|
-
padding-inline: var(--helix-space-md);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
slot {
|
|
29
|
-
align-items: center;
|
|
30
|
-
display: flex;
|
|
31
|
-
gap: var(--sandbox-toolbar-gap, var(--helix-space-sm));
|
|
32
|
-
min-inline-size: 0;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
slot[name="end"] {
|
|
36
|
-
margin-inline-start: auto;
|
|
37
|
-
}`);
|
|
2
|
+
export const styles = createSheet(`:host {--helix-size-checkbox: var(--helix-size-checkbox-sm);--helix-size-checkbox-loose: calc(var(--helix-size-checkbox) * 1.2);--helix-size-checkbox-tight: calc(var(--helix-size-checkbox) * 0.8);--helix-size-icon: var(--helix-size-icon-sm);--helix-size-icon-loose: calc(var(--helix-size-icon) * 1.2);--helix-size-icon-tight: calc(var(--helix-size-icon) * 0.8);--helix-size-control: var(--helix-size-control-sm);--helix-size-control-loose: calc(var(--helix-size-control) * 1.2);--helix-size-control-tight: calc(var(--helix-size-control) * 0.8);--helix-size-tag: var(--helix-size-tag-sm);align-items: center;background-color: var(--helix-color-background);block-size: var(--sandbox-toolbar-size, var(--helix-size-control-lg));border-block-end: var(--helix-border-thin) solid var(--helix-color-border);display: flex;min-block-size: 0;padding-block: var(--helix-space-none);padding-inline: var(--helix-space-md);}slot {align-items: center;display: flex;gap: var(--sandbox-toolbar-gap, var(--helix-space-sm));min-inline-size: 0;}slot[name="end"] {margin-inline-start: auto;}`);
|
|
@@ -1,152 +1,17 @@
|
|
|
1
1
|
import { createSheet } from '@fusion.dev/helix-core';
|
|
2
|
-
export const styles = createSheet(`:host {
|
|
3
|
-
container-type: inline-size;
|
|
4
|
-
display: block;
|
|
5
|
-
position: relative;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
[part="plane"] {
|
|
9
|
-
column-gap: var(--scatter-chart-gap, var(--helix-space-xs));
|
|
10
|
-
display: grid;
|
|
11
|
-
grid-template-areas:
|
|
2
|
+
export const styles = createSheet(`:host {container-type: inline-size;display: block;position: relative;}[part="plane"] {column-gap: var(--scatter-chart-gap, var(--helix-space-xs));display: grid;grid-template-areas:
|
|
12
3
|
"y-name y-name"
|
|
13
4
|
"y-axis plot"
|
|
14
5
|
". x-axis"
|
|
15
|
-
". x-name";
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
block-size: var(--scatter-chart-block-size, 14em);
|
|
22
|
-
cursor: crosshair;
|
|
23
|
-
grid-area: plot;
|
|
24
|
-
position: relative;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
[part="plot"] svg {
|
|
28
|
-
block-size: 100%;
|
|
29
|
-
inline-size: 100%;
|
|
30
|
-
overflow: visible;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
[part="trend"] {
|
|
34
|
-
fill: none;
|
|
35
|
-
stroke: var(--chart-series);
|
|
36
|
-
stroke-dasharray: var(--scatter-chart-trend-dash, 4 3);
|
|
37
|
-
stroke-linecap: round;
|
|
38
|
-
stroke-width: var(--scatter-chart-trend-width, 1.5px);
|
|
39
|
-
vector-effect: non-scaling-stroke;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
[part="gridline"] {
|
|
43
|
-
stroke: var(--scatter-chart-gridline-color, var(--helix-color-border));
|
|
44
|
-
stroke-width: var(--helix-border-thin);
|
|
45
|
-
vector-effect: non-scaling-stroke;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
[part~="point"] {
|
|
49
|
-
background-color: var(--chart-series);
|
|
50
|
-
block-size: var(--scatter-chart-point-size, 8px);
|
|
51
|
-
border-radius: var(--helix-radii-full);
|
|
52
|
-
box-shadow: 0 0 0 var(--helix-border-thin)
|
|
53
|
-
var(--scatter-chart-point-ring-color, var(--helix-color-background));
|
|
54
|
-
inline-size: var(--scatter-chart-point-size, 8px);
|
|
55
|
-
inset-block-start: var(--chart-point-y);
|
|
56
|
-
inset-inline-start: var(--chart-point-x);
|
|
57
|
-
opacity: var(--scatter-chart-point-opacity, 0.8);
|
|
58
|
-
pointer-events: none;
|
|
59
|
-
position: absolute;
|
|
60
|
-
transition:
|
|
6
|
+
". x-name";grid-template-columns: auto minmax(0, 1fr);row-gap: var(--scatter-chart-gap, var(--helix-space-xs));}[part="plot"] {block-size: var(--scatter-chart-block-size, 14em);cursor: crosshair;grid-area: plot;position: relative;}[part="plot"] svg {block-size: 100%;inline-size: 100%;overflow: visible;}[part="trend"] {fill: none;stroke: var(--chart-series);stroke-dasharray: var(--scatter-chart-trend-dash, 4 3);stroke-linecap: round;stroke-width: var(--scatter-chart-trend-width, 1.5px);vector-effect: non-scaling-stroke;}[part="gridline"] {stroke: var(--scatter-chart-gridline-color, var(--helix-color-border));stroke-width: var(--helix-border-thin);vector-effect: non-scaling-stroke;}[part~="point"] {--_scatter-chart-diameter: calc(
|
|
7
|
+
var(--scatter-chart-point-size, 8px) +
|
|
8
|
+
var(--chart-point-weight, 0) *
|
|
9
|
+
(var(--scatter-chart-bubble-size, 40px) - var(--scatter-chart-point-size, 8px))
|
|
10
|
+
);background-color: var(--chart-series);block-size: var(--_scatter-chart-diameter);border-radius: var(--helix-radii-full);box-shadow: 0 0 0 var(--helix-border-thin)
|
|
11
|
+
var(--scatter-chart-point-ring-color, var(--helix-color-background));inline-size: var(--_scatter-chart-diameter);inset-block-start: var(--chart-point-y);inset-inline-start: var(--chart-point-x);opacity: var(--scatter-chart-point-opacity, 0.8);pointer-events: none;position: absolute;transition:
|
|
61
12
|
inset-block-start var(--helix-duration-normal) var(--helix-easing-decelerate),
|
|
62
13
|
inset-inline-start var(--helix-duration-normal) var(--helix-easing-decelerate),
|
|
63
|
-
scale var(--helix-duration-fast) var(--helix-easing-decelerate);
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
[part~="point"][data-active] {
|
|
68
|
-
opacity: 1;
|
|
69
|
-
scale: 1.5;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
[part="x-axis"],
|
|
73
|
-
[part="y-axis"] {
|
|
74
|
-
display: grid;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
[part="x-axis"] {
|
|
78
|
-
grid-area: x-axis;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
[part="y-axis"] {
|
|
82
|
-
grid-area: y-axis;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
[part="x-tick"],
|
|
86
|
-
[part="y-tick"] {
|
|
87
|
-
color: var(--helix-color-foreground-muted);
|
|
88
|
-
font-size: var(--helix-text-xs);
|
|
89
|
-
font-variant-numeric: tabular-nums;
|
|
90
|
-
grid-area: 1 / 1;
|
|
91
|
-
line-height: 1;
|
|
92
|
-
position: relative;
|
|
93
|
-
white-space: nowrap;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
[part="x-tick"] {
|
|
97
|
-
inset-inline-start: var(--chart-tick);
|
|
98
|
-
justify-self: start;
|
|
99
|
-
translate: -50% 0;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
[part="y-tick"] {
|
|
103
|
-
align-self: start;
|
|
104
|
-
inset-block-start: var(--chart-tick);
|
|
105
|
-
justify-self: end;
|
|
106
|
-
translate: 0 -50%;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
@container (inline-size < 30rem) {
|
|
110
|
-
[part="x-tick"]:nth-last-child(even) {
|
|
111
|
-
visibility: hidden;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
[part="x-name"],
|
|
116
|
-
[part="y-name"] {
|
|
117
|
-
color: var(--helix-color-foreground-muted);
|
|
118
|
-
font-size: var(--helix-text-xs);
|
|
119
|
-
font-weight: var(--helix-weight-medium);
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
[part="x-name"] {
|
|
123
|
-
grid-area: x-name;
|
|
124
|
-
justify-self: end;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
[part="y-name"] {
|
|
128
|
-
grid-area: y-name;
|
|
129
|
-
justify-self: start;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
[part="summary"] {
|
|
133
|
-
block-size: 1px;
|
|
134
|
-
clip-path: inset(50%);
|
|
135
|
-
inline-size: 1px;
|
|
136
|
-
margin: var(--helix-space-none);
|
|
137
|
-
overflow: hidden;
|
|
138
|
-
position: absolute;
|
|
139
|
-
white-space: nowrap;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
@starting-style {
|
|
143
|
-
[part~="point"] {
|
|
144
|
-
opacity: 0;
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
@media print {
|
|
149
|
-
:host {
|
|
150
|
-
print-color-adjust: exact;
|
|
151
|
-
}
|
|
152
|
-
}`);
|
|
14
|
+
scale var(--helix-duration-fast) var(--helix-easing-decelerate);translate: -50% -50%;}[part~="point"][data-active] {opacity: 1;scale: 1.5;}[part="x-axis"],
|
|
15
|
+
[part="y-axis"] {display: grid;}[part="x-axis"] {grid-area: x-axis;}[part="y-axis"] {grid-area: y-axis;}[part="x-tick"],
|
|
16
|
+
[part="y-tick"] {color: var(--helix-color-foreground-muted);font-size: var(--helix-text-xs);font-variant-numeric: tabular-nums;grid-area: 1 / 1;line-height: 1;position: relative;white-space: nowrap;}[part="x-tick"] {inset-inline-start: var(--chart-tick);justify-self: start;translate: -50% 0;}[part="y-tick"] {align-self: start;inset-block-start: var(--chart-tick);justify-self: end;translate: 0 -50%;}@container (inline-size < 30rem) {[part="x-tick"]:nth-last-child(even) {visibility: hidden;}}[part="x-name"],
|
|
17
|
+
[part="y-name"] {color: var(--helix-color-foreground-muted);font-size: var(--helix-text-xs);font-weight: var(--helix-weight-medium);}[part="x-name"] {grid-area: x-name;justify-self: end;}[part="y-name"] {grid-area: y-name;justify-self: start;}[part="summary"] {block-size: 1px;clip-path: inset(50%);inline-size: 1px;margin: var(--helix-space-none);overflow: hidden;position: absolute;white-space: nowrap;}@starting-style {[part~="point"] {opacity: 0;}}@media print {:host {print-color-adjust: exact;}}`);
|
|
@@ -33,6 +33,7 @@ import '../../tooltip/index.js';
|
|
|
33
33
|
* @documentation https://fusion.dev/helix/components/scatter-chart
|
|
34
34
|
*
|
|
35
35
|
* @cssproperty --scatter-chart-block-size - Height of the drawing.
|
|
36
|
+
* @cssproperty --scatter-chart-bubble-size - Diameter of the largest point under `size-by`. The smallest is `--scatter-chart-point-size`.
|
|
36
37
|
* @cssproperty --scatter-chart-gap - Space between the drawing and its axes.
|
|
37
38
|
* @cssproperty --scatter-chart-gridline-color - Color of the gridlines across the plot, drawn when `gridlines` is set.
|
|
38
39
|
* @cssproperty --scatter-chart-point-opacity - Opacity of a point, so a cluster looks darker where it is denser.
|