Skip to content

Commit 93cb5d6

Browse files
committed
add AST toggle UI
1 parent 49b12d8 commit 93cb5d6

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

packages/repl/src/lib/Output/AstView.svelte

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<script lang="ts">
2+
import { Checkbox } from '@sveltejs/site-kit/components';
23
import Message from '../Message.svelte';
34
import AstNode from './AstNode.svelte';
45
import type { CompileResult } from 'svelte/compiler';
@@ -65,7 +66,20 @@
6566
{/if}
6667
</code>
6768
</pre>
69+
6870
<Message kind="info">The AST is not public API and may change at any point in time</Message>
71+
72+
<label>
73+
modern
74+
75+
<!-- TODO wire up -->
76+
<Checkbox
77+
checked={false}
78+
onchange={(value) => {
79+
// TODO
80+
}}
81+
/>
82+
</label>
6983
</div>
7084

7185
<style>
@@ -99,4 +113,14 @@
99113
margin: 0;
100114
list-style-type: none;
101115
}
116+
117+
label {
118+
position: absolute;
119+
top: 1rem;
120+
right: 1rem;
121+
display: inline-flex;
122+
gap: 1rem;
123+
align-items: center;
124+
font: var(--sk-font-ui-small);
125+
}
102126
</style>

packages/site-kit/src/lib/components/Checkbox.svelte

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
/* display: block; */
1313
position: relative;
1414
height: 1em;
15-
width: calc(100% - 0.6em);
16-
max-width: 2em;
15+
width: 2em;
1716
top: -2px;
1817
border-radius: 0.5em;
1918
-webkit-appearance: none;

0 commit comments

Comments
 (0)