mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-07 07:21:17 +08:00
In 6.5 the `framework` config option was one of `react`, `angular`, etc. and included Webpack settings. In the 7.0, we’ve updated it so that these are now called `renderers`, and are builder-independent. Now, frameworks contain specific builder information, such as `cra` or `nextjs` (for specific app environments) or `react-webpack5` / `react-vite` (for custom apps). This fixes the `sb init` CLI command to use renderer-specific templates. I also call out some follow-up work to fix automigrations & telemetry
43 lines
869 B
Svelte
43 lines
869 B
Svelte
<script>
|
|
import './button.css';
|
|
import { createEventDispatcher } from 'svelte';
|
|
/**
|
|
* Is this the principal call to action on the page?
|
|
*/
|
|
export let primary = false;
|
|
|
|
/**
|
|
* What background color to use
|
|
*/
|
|
export let backgroundColor;
|
|
/**
|
|
* How large should the button be?
|
|
*/
|
|
export let size = 'medium';
|
|
/**
|
|
* Button contents
|
|
*/
|
|
export let label = '';
|
|
|
|
let mode = primary ? 'storybook-button--primary' : 'storybook-button--secondary';
|
|
|
|
let style = backgroundColor ? `background-color: ${backgroundColor}` : '';
|
|
|
|
const dispatch = createEventDispatcher();
|
|
|
|
/**
|
|
* Optional click handler
|
|
*/
|
|
function onClick(event) {
|
|
dispatch('click', event);
|
|
}
|
|
</script>
|
|
|
|
<button
|
|
type="button"
|
|
class={['storybook-button', `storybook-button--${size}`, mode].join(' ')}
|
|
{style}
|
|
on:click={onClick}>
|
|
{label}
|
|
</button>
|