This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { JSX } from 'react' | |
import styled, { css } from 'styled-components' | |
/** | |
* Stack component for flexible layouts using flexbox | |
* | |
* @example | |
* Basic usage: | |
* <Stack gap={16}> | |
* <div>Item 1</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Simple function that checks if a set of coordinates are intersecting with another set of coordinates | |
// Useful for checking if a selection net intersects with nodes on a canvas | |
function isIntersecting(a: Coordinates, b: Coordinates) { | |
if (a.x1 > b.x0 && a.x0 < b.x1 && a.y1 > b.y0 && a.y0 < b.y1) { | |
return true | |
} | |
return false | |
} | |
interface Coordinates { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ShortcutsGallery.swift | |
// | |
import SwiftUI | |
struct ShortcutsGallery: View { | |
var body: some View { | |
NavigationView { |