@storybook/sveltekit 7.0.0-alpha.58

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1 @@
1
+ # Storybook for SvelteKit
@@ -0,0 +1 @@
1
+ export * from '@storybook/svelte-vite';
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ var a=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var p=(r,o,f,x)=>{if(o&&typeof o=="object"||typeof o=="function")for(let e of c(o))!d.call(r,e)&&e!==f&&a(r,e,{get:()=>o[e],enumerable:!(x=b(o,e))||x.enumerable});return r},t=(r,o,f)=>(p(r,o,"default"),f&&p(f,o,"default"));var g=r=>p(a({},"__esModule",{value:!0}),r);var m={};module.exports=g(m);t(m,require("@storybook/svelte-vite"),module.exports);
package/dist/index.mjs ADDED
@@ -0,0 +1 @@
1
+ export*from"@storybook/svelte-vite";
@@ -0,0 +1,6 @@
1
+ import { StorybookConfig } from '@storybook/svelte-vite';
2
+
3
+ declare const core: StorybookConfig['core'];
4
+ declare const viteFinal: NonNullable<StorybookConfig['viteFinal']>;
5
+
6
+ export { core, viteFinal };
package/dist/preset.js ADDED
@@ -0,0 +1 @@
1
+ var n=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var u=(t,o)=>{for(var e in o)n(t,e,{get:o[e],enumerable:!0})},v=(t,o,e,i)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of b(o))!p.call(t,r)&&r!==e&&n(t,r,{get:()=>o[r],enumerable:!(i=a(o,r))||i.enumerable});return t};var f=t=>v(n({},"__esModule",{value:!0}),t);var c={};u(c,{core:()=>g,viteFinal:()=>y});module.exports=f(c);var l=require("@storybook/svelte-vite/preset"),s=require("@storybook/builder-vite"),g={builder:"@storybook/builder-vite",renderer:"@storybook/svelte"},y=async(t,o)=>{let e=await(0,l.viteFinal)(t,o),{plugins:i=[]}=e;return i=(0,s.withoutVitePlugins)(i,["vite-plugin-svelte-kit"]),{...e,plugins:i}};0&&(module.exports={core,viteFinal});
@@ -0,0 +1 @@
1
+ import{viteFinal as svelteViteFinal}from"@storybook/svelte-vite/preset";import{withoutVitePlugins}from"@storybook/builder-vite";var core={builder:"@storybook/builder-vite",renderer:"@storybook/svelte"},viteFinal=async(config,options)=>{let baseConfig=await svelteViteFinal(config,options),{plugins=[]}=baseConfig;return plugins=withoutVitePlugins(plugins,["vite-plugin-svelte-kit"]),{...baseConfig,plugins}};export{core,viteFinal};
package/jest.config.js ADDED
@@ -0,0 +1,7 @@
1
+ const path = require('path');
2
+ const baseConfig = require('../../jest.config.node');
3
+
4
+ module.exports = {
5
+ ...baseConfig,
6
+ displayName: __dirname.split(path.sep).slice(-2).join(path.posix.sep),
7
+ };
package/package.json ADDED
@@ -0,0 +1,84 @@
1
+ {
2
+ "name": "@storybook/sveltekit",
3
+ "version": "7.0.0-alpha.58",
4
+ "description": "Storybook for SvelteKit",
5
+ "keywords": [
6
+ "storybook",
7
+ "svelte",
8
+ "sveltekit",
9
+ "svelte-kit"
10
+ ],
11
+ "homepage": "https://github.com/storybookjs/storybook/tree/next/code/frameworks/sveltekit",
12
+ "bugs": {
13
+ "url": "https://github.com/storybookjs/storybook/issues"
14
+ },
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "https://github.com/storybookjs/storybook.git",
18
+ "directory": "code/frameworks/sveltekit"
19
+ },
20
+ "funding": {
21
+ "type": "opencollective",
22
+ "url": "https://opencollective.com/storybook"
23
+ },
24
+ "license": "MIT",
25
+ "exports": {
26
+ ".": {
27
+ "require": "./dist/index.js",
28
+ "import": "./dist/index.mjs",
29
+ "types": "./dist/index.d.ts"
30
+ },
31
+ "./preset": {
32
+ "require": "./dist/preset.js",
33
+ "import": "./dist/preset.mjs",
34
+ "types": "./dist/preset.d.ts"
35
+ },
36
+ "./package.json": "./package.json"
37
+ },
38
+ "main": "dist/index.js",
39
+ "module": "dist/index.mjs",
40
+ "types": "dist/index.d.ts",
41
+ "files": [
42
+ "dist/**/*",
43
+ "template/**/*",
44
+ "types/**/*",
45
+ "README.md",
46
+ "*.js",
47
+ "*.d.ts"
48
+ ],
49
+ "scripts": {
50
+ "check": "tsc --noEmit",
51
+ "prep": "../../../scripts/prepare/bundle.ts"
52
+ },
53
+ "dependencies": {
54
+ "@storybook/builder-vite": "7.0.0-alpha.58",
55
+ "@storybook/svelte-vite": "7.0.0-alpha.58"
56
+ },
57
+ "devDependencies": {
58
+ "@types/node": "^16.0.0",
59
+ "typescript": "^4.9.3",
60
+ "vite": "^3.1.3"
61
+ },
62
+ "peerDependencies": {
63
+ "@storybook/addon-svelte-csf": "^2.0.0"
64
+ },
65
+ "peerDependenciesMeta": {
66
+ "@storybook/addon-svelte-csf": {
67
+ "optional": true
68
+ }
69
+ },
70
+ "engines": {
71
+ "node": "^14.18 || >=16"
72
+ },
73
+ "publishConfig": {
74
+ "access": "public"
75
+ },
76
+ "bundler": {
77
+ "entries": [
78
+ "./src/index.ts",
79
+ "./src/preset.ts"
80
+ ],
81
+ "platform": "node"
82
+ },
83
+ "gitHead": "c7f8e3e8486ab5caf3da0ef016acfd2065f0dc05"
84
+ }
package/preset.js ADDED
@@ -0,0 +1 @@
1
+ module.exports = require('./dist/preset');
@@ -0,0 +1,39 @@
1
+ import Button from './Button.svelte';
2
+
3
+ // More on how to set up stories at: https://storybook.js.org/docs/7.0/svelte/writing-stories/introduction
4
+ export default {
5
+ title: 'Example/Button',
6
+ component: Button,
7
+ tags: ['docsPage'],
8
+ argTypes: {
9
+ backgroundColor: { control: 'color' },
10
+ },
11
+ };
12
+
13
+ // More on writing stories with args: https://storybook.js.org/docs/7.0/svelte/writing-stories/args
14
+ export const Primary = {
15
+ args: {
16
+ primary: true,
17
+ label: 'Button',
18
+ },
19
+ };
20
+
21
+ export const Secondary = {
22
+ args: {
23
+ label: 'Button',
24
+ },
25
+ };
26
+
27
+ export const Large = {
28
+ args: {
29
+ size: 'large',
30
+ label: 'Button',
31
+ },
32
+ };
33
+
34
+ export const Small = {
35
+ args: {
36
+ size: 'small',
37
+ label: 'Button',
38
+ },
39
+ };
@@ -0,0 +1,34 @@
1
+ <script>
2
+ import './button.css';
3
+
4
+ /**
5
+ * Is this the principal call to action on the page?
6
+ */
7
+ export let primary = false;
8
+
9
+ /**
10
+ * What background color to use
11
+ */
12
+ export let backgroundColor = undefined;
13
+ /**
14
+ * How large should the button be?
15
+ */
16
+ export let size = 'medium';
17
+ /**
18
+ * Button contents
19
+ */
20
+ export let label;
21
+
22
+ $: mode = primary ? 'storybook-button--primary' : 'storybook-button--secondary';
23
+
24
+ $: style = backgroundColor ? `background-color: ${backgroundColor}` : '';
25
+ </script>
26
+
27
+ <button
28
+ type="button"
29
+ class={['storybook-button', `storybook-button--${size}`, mode].join(' ')}
30
+ {style}
31
+ on:click
32
+ >
33
+ {label}
34
+ </button>