storybook-solidjs-vite 10.7.0 → 10.7.1
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/package.json
CHANGED
|
@@ -1,29 +1,22 @@
|
|
|
1
|
-
import { mergeProps, splitProps } from 'solid-js';
|
|
2
|
-
|
|
3
1
|
import './button.css';
|
|
4
2
|
|
|
5
3
|
/** Primary UI component for user interaction */
|
|
6
|
-
export const Button = (
|
|
7
|
-
const [props, rest] = splitProps(
|
|
8
|
-
mergeProps({ primary: false, backgroundColor: null, size: 'medium' }, _props),
|
|
9
|
-
['primary', 'backgroundColor', 'size', 'label']
|
|
10
|
-
);
|
|
11
|
-
|
|
4
|
+
export const Button = (props) => {
|
|
12
5
|
const mode = () => props.primary ? 'storybook-button--primary' : 'storybook-button--secondary';
|
|
6
|
+
const size = () => props.size ?? 'medium';
|
|
13
7
|
|
|
14
8
|
return (
|
|
15
9
|
<button
|
|
16
10
|
type="button"
|
|
17
11
|
class={ [
|
|
18
12
|
'storybook-button',
|
|
19
|
-
`storybook-button--${
|
|
13
|
+
`storybook-button--${ size() }`,
|
|
20
14
|
mode(),
|
|
21
15
|
].join(' ') }
|
|
22
16
|
style={ props.backgroundColor ? { 'background-color': props.backgroundColor } : undefined }
|
|
23
|
-
{
|
|
17
|
+
onClick={ props.onClick }
|
|
24
18
|
>
|
|
25
19
|
{props.label}
|
|
26
20
|
</button>
|
|
27
21
|
);
|
|
28
22
|
};
|
|
29
|
-
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { Button } from './Button';
|
|
3
2
|
import './header.css';
|
|
4
3
|
|
|
5
|
-
export const Header = (
|
|
6
|
-
const props = mergeProps({ user: undefined }, _props);
|
|
7
|
-
|
|
4
|
+
export const Header = (props) => {
|
|
8
5
|
return (
|
|
9
6
|
<header>
|
|
10
7
|
<div class="storybook-header">
|
|
@@ -51,4 +48,3 @@ export const Header = (_props) => {
|
|
|
51
48
|
</header>
|
|
52
49
|
);
|
|
53
50
|
};
|
|
54
|
-
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { mergeProps, splitProps } from 'solid-js';
|
|
2
|
-
|
|
3
1
|
import './button.css';
|
|
4
2
|
|
|
5
3
|
export interface ButtonProps {
|
|
@@ -7,31 +5,26 @@ export interface ButtonProps {
|
|
|
7
5
|
backgroundColor?: string;
|
|
8
6
|
size?: 'small' | 'medium' | 'large';
|
|
9
7
|
label: string;
|
|
10
|
-
|
|
8
|
+
onClick?: () => void;
|
|
11
9
|
}
|
|
12
10
|
|
|
13
11
|
/** Primary UI component for user interaction */
|
|
14
|
-
export const Button = (
|
|
15
|
-
const [props, rest] = splitProps(
|
|
16
|
-
mergeProps({ primary: false, backgroundColor: null, size: 'medium' }, _props),
|
|
17
|
-
['primary', 'backgroundColor', 'size', 'label']
|
|
18
|
-
);
|
|
19
|
-
|
|
12
|
+
export const Button = (props: ButtonProps) => {
|
|
20
13
|
const mode = () => props.primary ? 'storybook-button--primary' : 'storybook-button--secondary';
|
|
14
|
+
const size = () => props.size ?? 'medium';
|
|
21
15
|
|
|
22
16
|
return (
|
|
23
17
|
<button
|
|
24
18
|
type="button"
|
|
25
19
|
class={ [
|
|
26
20
|
'storybook-button',
|
|
27
|
-
`storybook-button--${
|
|
21
|
+
`storybook-button--${ size() }`,
|
|
28
22
|
mode(),
|
|
29
23
|
].join(' ') }
|
|
30
24
|
style={ props.backgroundColor ? { 'background-color': props.backgroundColor } : undefined }
|
|
31
|
-
{
|
|
25
|
+
onClick={ props.onClick }
|
|
32
26
|
>
|
|
33
27
|
{props.label}
|
|
34
28
|
</button>
|
|
35
29
|
);
|
|
36
30
|
};
|
|
37
|
-
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { mergeProps } from 'solid-js';
|
|
2
|
-
|
|
3
1
|
import { Button } from './Button';
|
|
4
2
|
import './header.css';
|
|
5
3
|
|
|
@@ -8,12 +6,9 @@ export interface HeaderProps {
|
|
|
8
6
|
onLogin: () => void;
|
|
9
7
|
onLogout: () => void;
|
|
10
8
|
onCreateAccount: () => void;
|
|
11
|
-
[key: string]: any;
|
|
12
9
|
}
|
|
13
10
|
|
|
14
|
-
export const Header = (
|
|
15
|
-
const props = mergeProps({ user: undefined }, _props);
|
|
16
|
-
|
|
11
|
+
export const Header = (props: HeaderProps) => {
|
|
17
12
|
return (
|
|
18
13
|
<header>
|
|
19
14
|
<div class="storybook-header">
|
|
@@ -60,4 +55,3 @@ export const Header = (_props: HeaderProps) => {
|
|
|
60
55
|
</header>
|
|
61
56
|
);
|
|
62
57
|
};
|
|
63
|
-
|