willba-component-library 0.0.27 → 0.0.31
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/.storybook/main.ts +19 -19
- package/.storybook/preview.ts +15 -15
- package/lib/components/FilterBar/components/Callendar.d.ts +2 -0
- package/lib/components/FilterBar/components/Divider.d.ts +2 -0
- package/lib/components/FilterBar/components/SelectButton.d.ts +2 -0
- package/lib/components/FilterBar/components/SubmitButton.d.ts +2 -0
- package/lib/index.d.ts +3 -1
- package/lib/index.esm.js +110 -3
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +110 -2
- package/lib/index.js.map +1 -1
- package/lib/index.umd.js +111 -3
- package/lib/index.umd.js.map +1 -1
- package/package.json +5 -5
- package/rollup.config.mjs +59 -59
- package/src/components/Button/Button.stories.tsx +34 -34
- package/src/components/Button/Button.tsx +56 -56
- package/src/components/Button/button.css +29 -29
- package/src/components/Button/index.ts +1 -1
- package/src/components/FilterBar/FilterBar.css +2 -2
- package/src/components/FilterBar/FilterBar.stories.tsx +20 -20
- package/src/components/FilterBar/FilterBar.tsx +6 -21
- package/src/components/FilterBar/components/Callendar.tsx +5 -0
- package/src/components/FilterBar/components/Divider.tsx +5 -0
- package/src/components/FilterBar/components/SelectButton.tsx +9 -0
- package/src/components/FilterBar/components/SubmitButton.tsx +9 -0
- package/src/components/FilterBar/index.ts +1 -1
- package/src/index.ts +4 -3
- package/stories/Button.stories.ts +50 -50
- package/stories/Button.tsx +48 -48
- package/stories/Configure.mdx +364 -364
- package/stories/Header.stories.ts +27 -27
- package/stories/Header.tsx +56 -56
- package/stories/Page.stories.ts +29 -29
- package/stories/Page.tsx +73 -73
- package/stories/assets/accessibility.svg +4 -4
- package/stories/assets/discord.svg +15 -15
- package/stories/assets/github.svg +3 -3
- package/stories/assets/tutorials.svg +12 -12
- package/stories/assets/youtube.svg +4 -4
- package/stories/button.css +30 -30
- package/stories/header.css +32 -32
- package/stories/page.css +69 -69
- package/tsconfig.json +22 -22
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
3
|
-
import FilterBar from "./FilterBar";
|
|
4
|
-
|
|
5
|
-
// Default metadata of the story https://storybook.js.org/docs/react/api/csf#default-export
|
|
6
|
-
const meta: Meta<typeof FilterBar> = {
|
|
7
|
-
title: "Components/FilterBar",
|
|
8
|
-
component: FilterBar,
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export default meta;
|
|
12
|
-
|
|
13
|
-
// The story type for the component https://storybook.js.org/docs/react/api/csf#named-story-exports
|
|
14
|
-
type Story = StoryObj<typeof FilterBar>;
|
|
15
|
-
|
|
16
|
-
export const Primary: Story = {
|
|
17
|
-
args: {
|
|
18
|
-
label: "Primary 😃",
|
|
19
|
-
},
|
|
20
|
-
};
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
3
|
+
import FilterBar from "./FilterBar";
|
|
4
|
+
|
|
5
|
+
// Default metadata of the story https://storybook.js.org/docs/react/api/csf#default-export
|
|
6
|
+
const meta: Meta<typeof FilterBar> = {
|
|
7
|
+
title: "Components/FilterBar",
|
|
8
|
+
component: FilterBar,
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export default meta;
|
|
12
|
+
|
|
13
|
+
// The story type for the component https://storybook.js.org/docs/react/api/csf#named-story-exports
|
|
14
|
+
type Story = StoryObj<typeof FilterBar>;
|
|
15
|
+
|
|
16
|
+
export const Primary: Story = {
|
|
17
|
+
args: {
|
|
18
|
+
label: "Primary 😃",
|
|
19
|
+
},
|
|
20
|
+
};
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import React, { useState } from "react";
|
|
2
|
+
|
|
3
|
+
import Divider from "./components/Divider";
|
|
4
|
+
import SelectButton from "./components/SelectButton";
|
|
5
|
+
import SubmitButton from "./components/SubmitButton";
|
|
6
|
+
|
|
2
7
|
import "./FilterBar.css";
|
|
3
8
|
|
|
4
9
|
export default function FilterBar() {
|
|
5
10
|
const [selectedFilter, setSelectedFilter] = useState<number | boolean>(false);
|
|
6
11
|
// const [startDate, setStartDate] = useState(0);
|
|
7
12
|
// const [endDate, setEndDate] = useState(0);
|
|
8
|
-
const [guestsAdults, setGuestsAdults] = useState(
|
|
13
|
+
const [guestsAdults, setGuestsAdults] = useState(1);
|
|
9
14
|
const [guestsKids, setGuestsKids] = useState(0);
|
|
10
15
|
const [categories, setCategories] = useState(0);
|
|
11
16
|
|
|
@@ -80,26 +85,6 @@ export default function FilterBar() {
|
|
|
80
85
|
);
|
|
81
86
|
}
|
|
82
87
|
|
|
83
|
-
const Divider = () => {
|
|
84
|
-
return <div className="search-widget-divider" />;
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
const SubmitButton = ({ onClick }: any) => {
|
|
88
|
-
return (
|
|
89
|
-
<button className="search-widget-submit-button" onClick={onClick}>
|
|
90
|
-
Apply filters
|
|
91
|
-
</button>
|
|
92
|
-
);
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
const SelectButton = ({ label, onClick }: any) => {
|
|
96
|
-
return (
|
|
97
|
-
<button className="search-widget-select-button" onClick={onClick}>
|
|
98
|
-
{label}
|
|
99
|
-
</button>
|
|
100
|
-
);
|
|
101
|
-
};
|
|
102
|
-
|
|
103
88
|
const StartDate = () => {
|
|
104
89
|
return <div>Start date</div>;
|
|
105
90
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from "./FilterBar";
|
|
1
|
+
export { default } from "./FilterBar";
|
package/src/index.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import Button from "./components/Button";
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import Button from "./components/Button";
|
|
2
|
+
import FilterBar from "./components/FilterBar";
|
|
3
|
+
|
|
4
|
+
export { Button, FilterBar };
|
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
|
|
3
|
-
import { Button } from './Button';
|
|
4
|
-
|
|
5
|
-
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
6
|
-
const meta = {
|
|
7
|
-
title: 'Example/Button',
|
|
8
|
-
component: Button,
|
|
9
|
-
parameters: {
|
|
10
|
-
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/react/configure/story-layout
|
|
11
|
-
layout: 'centered',
|
|
12
|
-
},
|
|
13
|
-
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
|
|
14
|
-
tags: ['autodocs'],
|
|
15
|
-
// More on argTypes: https://storybook.js.org/docs/react/api/argtypes
|
|
16
|
-
argTypes: {
|
|
17
|
-
backgroundColor: { control: 'color' },
|
|
18
|
-
},
|
|
19
|
-
} satisfies Meta<typeof Button>;
|
|
20
|
-
|
|
21
|
-
export default meta;
|
|
22
|
-
type Story = StoryObj<typeof meta>;
|
|
23
|
-
|
|
24
|
-
// More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
|
|
25
|
-
export const Primary: Story = {
|
|
26
|
-
args: {
|
|
27
|
-
primary: true,
|
|
28
|
-
label: 'Button',
|
|
29
|
-
},
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export const Secondary: Story = {
|
|
33
|
-
args: {
|
|
34
|
-
label: 'Button',
|
|
35
|
-
},
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export const Large: Story = {
|
|
39
|
-
args: {
|
|
40
|
-
size: 'large',
|
|
41
|
-
label: 'Button',
|
|
42
|
-
},
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
export const Small: Story = {
|
|
46
|
-
args: {
|
|
47
|
-
size: 'small',
|
|
48
|
-
label: 'Button',
|
|
49
|
-
},
|
|
50
|
-
};
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
|
|
3
|
+
import { Button } from './Button';
|
|
4
|
+
|
|
5
|
+
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
6
|
+
const meta = {
|
|
7
|
+
title: 'Example/Button',
|
|
8
|
+
component: Button,
|
|
9
|
+
parameters: {
|
|
10
|
+
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/react/configure/story-layout
|
|
11
|
+
layout: 'centered',
|
|
12
|
+
},
|
|
13
|
+
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
|
|
14
|
+
tags: ['autodocs'],
|
|
15
|
+
// More on argTypes: https://storybook.js.org/docs/react/api/argtypes
|
|
16
|
+
argTypes: {
|
|
17
|
+
backgroundColor: { control: 'color' },
|
|
18
|
+
},
|
|
19
|
+
} satisfies Meta<typeof Button>;
|
|
20
|
+
|
|
21
|
+
export default meta;
|
|
22
|
+
type Story = StoryObj<typeof meta>;
|
|
23
|
+
|
|
24
|
+
// More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
|
|
25
|
+
export const Primary: Story = {
|
|
26
|
+
args: {
|
|
27
|
+
primary: true,
|
|
28
|
+
label: 'Button',
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export const Secondary: Story = {
|
|
33
|
+
args: {
|
|
34
|
+
label: 'Button',
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export const Large: Story = {
|
|
39
|
+
args: {
|
|
40
|
+
size: 'large',
|
|
41
|
+
label: 'Button',
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const Small: Story = {
|
|
46
|
+
args: {
|
|
47
|
+
size: 'small',
|
|
48
|
+
label: 'Button',
|
|
49
|
+
},
|
|
50
|
+
};
|
package/stories/Button.tsx
CHANGED
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import './button.css';
|
|
3
|
-
|
|
4
|
-
interface ButtonProps {
|
|
5
|
-
/**
|
|
6
|
-
* Is this the principal call to action on the page?
|
|
7
|
-
*/
|
|
8
|
-
primary?: boolean;
|
|
9
|
-
/**
|
|
10
|
-
* What background color to use
|
|
11
|
-
*/
|
|
12
|
-
backgroundColor?: string;
|
|
13
|
-
/**
|
|
14
|
-
* How large should the button be?
|
|
15
|
-
*/
|
|
16
|
-
size?: 'small' | 'medium' | 'large';
|
|
17
|
-
/**
|
|
18
|
-
* Button contents
|
|
19
|
-
*/
|
|
20
|
-
label: string;
|
|
21
|
-
/**
|
|
22
|
-
* Optional click handler
|
|
23
|
-
*/
|
|
24
|
-
onClick?: () => void;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Primary UI component for user interaction
|
|
29
|
-
*/
|
|
30
|
-
export const Button = ({
|
|
31
|
-
primary = false,
|
|
32
|
-
size = 'medium',
|
|
33
|
-
backgroundColor,
|
|
34
|
-
label,
|
|
35
|
-
...props
|
|
36
|
-
}: ButtonProps) => {
|
|
37
|
-
const mode = primary ? 'storybook-button--primary' : 'storybook-button--secondary';
|
|
38
|
-
return (
|
|
39
|
-
<button
|
|
40
|
-
type="button"
|
|
41
|
-
className={['storybook-button', `storybook-button--${size}`, mode].join(' ')}
|
|
42
|
-
style={{ backgroundColor }}
|
|
43
|
-
{...props}
|
|
44
|
-
>
|
|
45
|
-
{label}
|
|
46
|
-
</button>
|
|
47
|
-
);
|
|
48
|
-
};
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './button.css';
|
|
3
|
+
|
|
4
|
+
interface ButtonProps {
|
|
5
|
+
/**
|
|
6
|
+
* Is this the principal call to action on the page?
|
|
7
|
+
*/
|
|
8
|
+
primary?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* What background color to use
|
|
11
|
+
*/
|
|
12
|
+
backgroundColor?: string;
|
|
13
|
+
/**
|
|
14
|
+
* How large should the button be?
|
|
15
|
+
*/
|
|
16
|
+
size?: 'small' | 'medium' | 'large';
|
|
17
|
+
/**
|
|
18
|
+
* Button contents
|
|
19
|
+
*/
|
|
20
|
+
label: string;
|
|
21
|
+
/**
|
|
22
|
+
* Optional click handler
|
|
23
|
+
*/
|
|
24
|
+
onClick?: () => void;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Primary UI component for user interaction
|
|
29
|
+
*/
|
|
30
|
+
export const Button = ({
|
|
31
|
+
primary = false,
|
|
32
|
+
size = 'medium',
|
|
33
|
+
backgroundColor,
|
|
34
|
+
label,
|
|
35
|
+
...props
|
|
36
|
+
}: ButtonProps) => {
|
|
37
|
+
const mode = primary ? 'storybook-button--primary' : 'storybook-button--secondary';
|
|
38
|
+
return (
|
|
39
|
+
<button
|
|
40
|
+
type="button"
|
|
41
|
+
className={['storybook-button', `storybook-button--${size}`, mode].join(' ')}
|
|
42
|
+
style={{ backgroundColor }}
|
|
43
|
+
{...props}
|
|
44
|
+
>
|
|
45
|
+
{label}
|
|
46
|
+
</button>
|
|
47
|
+
);
|
|
48
|
+
};
|