0.61.2 • Published 11 months ago

@kwangure/strawberry v0.61.2

Weekly downloads
2
License
-
Repository
-
Last release
11 months ago

Strawberry

Svelte utils and components.

Installation

npm i @kwangure/strawberry

General usage

Button

<script>
	import '@kwangure/strawberry/css/button.css';

	let count = 0;
</script>

<button on:click={() => count++}>
	Increment Counter: {count}
</button>

Code

<script>
	import { javascript } from '@kwangure/strawberry/code';

	const code = 'const five = 5;\nconst thirty = five * 6';
</script>

<code>
	{#each javascript(code) as { segment, color }}
		<span class='br-token-{color}'>{segment}</span>
	{/each}
</code>

Dialog

<script>
	import { Dialog } from '@kwangure/strawberry/default/dialog';

	/** @type {false | 'modal' | 'non-modal'} */
	let open;
</script>

<Dialog bind:open>
	Nice to meet you
	<button on:click={() => open = false}>👋 Bye!</button>
</Dialog>

<button on:click={() => open = 'modal'}>Show</button>
<button on:click={() => open = 'non-modal'}>Show modal</button>

Dropdown

<script>
    import { Dropdown, Popup } from '@kwangure/strawberry/default/dropdown';
</script>

<Dropdown>
	<button slot="trigger">
		Click for dropdown
	</button>
	<Popup>
		<div class="br-focusable">Purple</div>
		<div class="br-focusable">Penguin</div>
		<div class="br-focusable">Has</div>
		<div class="br-focusable">Landed</div>
	</Popup>
</Dropdown>

Element

<script>
    import { Element } from '@kwangure/strawberry/default/element';

    const element = {
    	type: 'p',
    	props: {
    		style: 'font-style: italic; color: red;',
    	},
    	children: ['I am a dynamically generated red <p/> tag element.'],
    };
</script>

<Element {element}/>

Inputs

<script>
	import { Container } from '@kwangure/strawberry/default/input/container';
</script>

<Container let:inputId>
	<label slot='label' for={inputId}>
		This is the input label
	</label>
	<input id={inputId} placeholder="I can say anything!"/>
</Container>

<Container let:inputId>
	<label slot='label' for={inputId}>
		Pick a pizza toping.
	</label>
	<select id={inputId}>
		<option>Pineapple</option>
		<option>Pepperoni</option>
		<option>Peppers</option>
	</select>
</Container>

Switch

<script>
    import { Switch } from '$lib/default/switch';

    let checked = true;
</script>

<Switch bind:checked/> {checked ? '': 'un'}checked

License

Apache 2.0 © Kafungo Wangure

0.61.2

11 months ago

0.60.2

12 months ago

0.60.1

12 months ago

0.60.0

12 months ago

0.59.0

1 year ago

0.59.1

12 months ago

0.61.1

11 months ago

0.61.0

11 months ago

0.58.0

1 year ago

0.57.4

1 year ago

0.57.5

1 year ago

0.57.2

1 year ago

0.57.3

1 year ago

0.57.0

1 year ago

0.57.1

1 year ago

0.55.0

1 year ago

0.56.0

1 year ago

0.54.0

1 year ago

0.53.0

1 year ago

0.53.1

1 year ago

0.51.0

1 year ago

0.51.1

1 year ago

0.52.1

1 year ago

0.52.2

1 year ago

0.52.0

1 year ago

0.50.0

1 year ago

0.49.0

1 year ago

0.48.0

2 years ago

0.48.1

2 years ago

0.47.0

2 years ago

0.46.2

2 years ago

0.46.0

2 years ago

0.46.1

2 years ago

0.43.0

2 years ago

0.41.0

2 years ago

0.44.0

2 years ago

0.42.0

2 years ago

0.45.0

2 years ago

0.40.2

2 years ago

0.40.0

2 years ago

0.40.1

2 years ago

0.39.1

2 years ago

0.39.0

2 years ago

0.39.2

2 years ago

0.38.2

2 years ago

0.38.1

2 years ago

0.38.3

2 years ago

0.38.0

2 years ago

0.37.0

2 years ago

0.36.0

2 years ago

0.35.0

2 years ago

0.34.0

2 years ago

0.33.0

2 years ago

0.32.0

2 years ago

0.31.1

2 years ago

0.31.0

2 years ago

0.31.0-rc.0

3 years ago

0.30.3-rc.3

3 years ago

0.30.3-rc.2

3 years ago

0.30.3-rc.1

3 years ago

0.30.3-rc.0

3 years ago

0.30.2

3 years ago

0.30.1

3 years ago

0.30.0

3 years ago

0.29.4

3 years ago

0.29.3

3 years ago

0.29.2

3 years ago

0.29.0

3 years ago

0.29.1

3 years ago

0.28.0

3 years ago

0.27.7

3 years ago

0.27.6

3 years ago

0.27.2

3 years ago

0.27.1

3 years ago

0.27.5

3 years ago

0.27.4

3 years ago

0.27.3

3 years ago

0.27.0

3 years ago

0.26.0

3 years ago

0.25.0

3 years ago

0.24.0

3 years ago

0.23.2

3 years ago

0.23.1

3 years ago

0.23.0

3 years ago