Skip to content

Commit 1dc33d9

Browse files
authored
Allow resizing controls (#561)
1 parent 3fd9eb8 commit 1dc33d9

File tree

7 files changed

+19
-16
lines changed

7 files changed

+19
-16
lines changed

packages/ui/src/cairo/App.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,9 @@
179179
</div>
180180

181181
<div class="flex flex-row grow">
182-
<div class="controls rounded-l-3xl w-72 flex flex-col shrink-0 justify-between h-[calc(100vh-84px)] overflow-auto">
182+
<div
183+
class="controls rounded-l-3xl min-w-72 w-72 max-w-[calc(100vw-420px)] flex flex-col shrink-0 justify-between h-[calc(100vh-84px)] overflow-auto resize-x"
184+
>
183185
<div class:hidden={tab !== 'ERC20'}>
184186
<ERC20Controls bind:opts={allOpts.ERC20} errors={errors.ERC20} />
185187
</div>

packages/ui/src/cairo_alpha/App.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,9 @@
185185
</div>
186186

187187
<div class="flex flex-row grow">
188-
<div class="controls rounded-l-3xl w-72 flex flex-col shrink-0 justify-between h-[calc(100vh-84px)] overflow-auto">
188+
<div
189+
class="controls rounded-l-3xl min-w-72 w-72 max-w-[calc(100vw-420px)] flex flex-col shrink-0 justify-between h-[calc(100vh-84px)] overflow-auto resize-x"
190+
>
189191
<div class:hidden={tab !== 'ERC20'}>
190192
<ERC20Controls bind:opts={allOpts.ERC20} errors={errors.ERC20} />
191193
</div>

packages/ui/src/common/HelpTooltip.svelte

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,11 @@
22
import Tooltip from './Tooltip.svelte';
33
44
export let link: string | undefined = undefined;
5-
export let align: 'right' | undefined = undefined;
65
export let placement: 'top' | 'bottom' | 'left' | 'right' = 'right';
76
</script>
87

98
<Tooltip let:trigger interactive {placement} theme="light border" maxWidth="22em">
10-
<svg
11-
use:trigger
12-
class="tooltip"
13-
class:ml-auto={align === 'right'}
14-
style="width: 1rem; height: 1rem;"
15-
viewBox="0 0 24 24"
16-
>
9+
<svg use:trigger class="tooltip" style="width: 1rem; height: 1rem;" viewBox="0 0 24 24">
1710
<path
1811
fill="currentColor"
1912
d="M15.07,11.25L14.17,12.17C13.45,12.89 13,13.5 13,15H11V14.5C11,13.39 11.45,12.39 12.17,11.67L13.41,10.41C13.78,10.05 14,9.55 14,9C14,7.89 13.1,7 12,7A2,2 0 0,0 10,9H8A4,4 0 0,1 12,5A4,4 0 0,1 16,9C16,9.88 15.64,10.67 15.07,11.25M13,19H11V17H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12C22,6.47 17.5,2 12,2Z"

packages/ui/src/common/ParentExpandableSection.svelte

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
<section class="controls-section">
5959
<h1>
6060
<!-- svelte-ignore a11y-label-has-associated-control -->
61-
<label class="items-center tooltip-container pr-2 grid grid-cols-[5fr,1fr]">
61+
<label class="items-center tooltip-container pr-2 flex justify-between">
6262
<div class="flex items-center">
6363
<span class="mr-2">
6464
{#if type === 'checkbox'}
@@ -76,7 +76,7 @@
7676
<div class="flex items-center">
7777
<button
7878
on:click|preventDefault={toggleExpanded}
79-
class="px-1 bg-transparent border-0"
79+
class="px-1 bg-transparent border-0 mr-2"
8080
aria-label={isExpanded ? 'Collapse section' : 'Expand section'}
8181
>
8282
{#if isExpanded}
@@ -85,7 +85,7 @@
8585
<ChevronRight />
8686
{/if}
8787
</button>
88-
<HelpTooltip align="right" link={helpLink}>
88+
<HelpTooltip link={helpLink}>
8989
{@html helpContent}
9090
</HelpTooltip>
9191
</div>

packages/ui/src/solidity/App.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,9 @@
346346
</div>
347347

348348
<div class="flex flex-row grow">
349-
<div class="controls rounded-l-3xl w-72 flex flex-col shrink-0 justify-between h-[calc(100vh-84px)] overflow-auto">
349+
<div
350+
class="controls rounded-l-3xl min-w-72 w-72 max-w-[calc(100vw-420px)] flex flex-col shrink-0 justify-between h-[calc(100vh-84px)] overflow-auto resize-x"
351+
>
350352
<div class:hidden={tab !== 'ERC20'}>
351353
<ERC20Controls bind:opts={allOpts.ERC20} errors={errors.ERC20} />
352354
</div>

packages/ui/src/stellar/App.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,9 @@
168168
</div>
169169

170170
<div class="flex flex-row grow">
171-
<div class="controls rounded-l-3xl w-72 flex flex-col shrink-0 justify-between h-[calc(100vh-84px)] overflow-auto">
171+
<div
172+
class="controls rounded-l-3xl min-w-72 w-72 max-w-[calc(100vw-420px)] flex flex-col shrink-0 justify-between h-[calc(100vh-84px)] overflow-auto resize-x"
173+
>
172174
<div class:hidden={tab !== 'Fungible'}>
173175
<FungibleControls bind:opts={allOpts.Fungible} errors={errors.Fungible} />
174176
</div>

packages/ui/src/stylus/App.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,9 @@
172172
</div>
173173

174174
<div class="flex flex-row grow">
175-
<div class="controls rounded-l-3xl w-72 flex flex-col shrink-0 justify-between h-[calc(100vh-84px)] overflow-auto">
175+
<div
176+
class="controls rounded-l-3xl min-w-72 w-72 max-w-[calc(100vw-420px)] flex flex-col shrink-0 justify-between h-[calc(100vh-84px)] overflow-auto resize-x"
177+
>
176178
<div class:hidden={tab !== 'ERC20'}>
177179
<ERC20Controls bind:opts={allOpts.ERC20} errors={errors.ERC20} />
178180
</div>

0 commit comments

Comments
 (0)