feat: start switching to blaze and svelte

This commit is contained in:
rvcas
2024-09-03 14:11:34 -04:00
committed by Lucas
parent 94ff20253b
commit 7c1cd81554
39 changed files with 10185 additions and 1424 deletions

View File

@@ -0,0 +1,16 @@
<script lang="ts">
import type { Snippet } from 'svelte';
import type { HTMLButtonAttributes } from 'svelte/elements';
interface Props extends HTMLButtonAttributes {
children: Snippet;
}
let { children, ...props }: Props = $props();
</script>
<button
{...props}
class="group inline-flex items-center justify-center rounded-full bg-blue-600 px-4 py-2 text-sm font-semibold text-white hover:bg-blue-500 focus:outline-none active:bg-blue-800 active:text-blue-100"
>{@render children()}</button
>

View File

@@ -0,0 +1,21 @@
<script lang="ts">
import type { Snippet } from 'svelte';
import type { HTMLInputAttributes } from 'svelte/elements';
interface Props extends HTMLInputAttributes {
children: Snippet<[]>;
}
let { id, children, ...props }: Props = $props();
</script>
<div>
<label for={id} class="mb-3 block text-sm font-medium text-gray-700">
{@render children()}
</label>
<input
{...props}
{id}
class="block w-full appearance-none rounded-md border border-gray-200 bg-gray-50 px-3 py-2 text-gray-900 placeholder-gray-400 focus:border-blue-500 focus:bg-white focus:outline-none focus:ring-blue-500 sm:text-sm"
/>
</div>

View File

@@ -0,0 +1 @@
// place files you want to import through the `$lib` alias in this folder.

View File

@@ -0,0 +1,17 @@
import blueprint from '../../plutus.json' assert { type: 'json' };
export type Validators = {
giftCard: string;
};
export function readValidators(): Validators {
const giftCard = blueprint.validators.find((v) => v.title === 'oneshot.gift_card.spend');
if (!giftCard) {
throw new Error('Gift Card validator not found');
}
return {
giftCard: giftCard.compiledCode
};
}