willba-component-library 0.1.13 → 0.1.15
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/.nvmrc +1 -1
- package/.storybook/main.ts +19 -19
- package/.storybook/preview.ts +15 -15
- package/README.md +57 -57
- package/lib/index.esm.js +13 -13
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +13 -13
- package/lib/index.js.map +1 -1
- package/lib/index.umd.js +13 -13
- package/lib/index.umd.js.map +1 -1
- package/package.json +51 -51
- package/prettier.config.js +6 -6
- package/rollup.config.mjs +61 -61
- 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 +83 -83
- package/src/components/FilterBar/FilterBar.stories.tsx +47 -47
- package/src/components/FilterBar/FilterBar.tsx +180 -180
- package/src/components/FilterBar/FilterBarTypes.ts +25 -25
- package/src/components/FilterBar/components/buttons/close-button/CloseButton.css +33 -33
- package/src/components/FilterBar/components/buttons/close-button/CloseButton.tsx +16 -16
- package/src/components/FilterBar/components/buttons/select-button/SelectButton.css +36 -36
- package/src/components/FilterBar/components/buttons/select-button/SelectButton.tsx +24 -24
- package/src/components/FilterBar/components/buttons/submit-button/SubmitButton.css +27 -27
- package/src/components/FilterBar/components/buttons/submit-button/SubmitButton.tsx +18 -18
- package/src/components/FilterBar/components/calendar/Calendar.css +76 -76
- package/src/components/FilterBar/components/calendar/Calendar.tsx +52 -52
- package/src/components/FilterBar/components/categories/Categories.css +21 -21
- package/src/components/FilterBar/components/categories/Categories.tsx +41 -41
- package/src/components/FilterBar/components/divider/Divider.css +14 -14
- package/src/components/FilterBar/components/divider/Divider.tsx +7 -7
- package/src/components/FilterBar/components/guests/GuestCount/GuestCount.css +53 -53
- package/src/components/FilterBar/components/guests/GuestCount/GuestCount.tsx +51 -51
- package/src/components/FilterBar/components/guests/Guests.css +27 -27
- package/src/components/FilterBar/components/guests/Guests.tsx +38 -38
- package/src/components/FilterBar/hooks/useFilterBar.tsx +106 -106
- package/src/components/FilterBar/index.ts +1 -1
- package/src/i18n.ts +25 -25
- package/src/index.ts +4 -4
- package/src/locales/en/filterBar.json +20 -20
- package/src/locales/fi/filterBar.json +20 -20
- package/src/themes/Default.css +42 -42
- package/src/themes/useTheme.tsx +24 -24
- 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 +27 -27
- package/lib/components/FilterBar/components/close-button/CloseButton.d.ts +0 -7
- package/lib/components/FilterBar/components/select-button/SelectButton.d.ts +0 -3
- package/lib/components/FilterBar/components/submit-button/SubmitButton.d.ts +0 -3
package/src/themes/Default.css
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap');
|
|
2
|
-
|
|
3
|
-
.will-root * {
|
|
4
|
-
font-family: 'Montserrat', sans-serif;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
.will-root {
|
|
8
|
-
|
|
9
|
-
box-sizing: border-box;
|
|
10
|
-
font-size: 14px;
|
|
11
|
-
|
|
12
|
-
color: #1E1E1E;
|
|
13
|
-
|
|
14
|
-
/* Pallete */
|
|
15
|
-
--will-primary: #374269;
|
|
16
|
-
--will-secondary: #374269;
|
|
17
|
-
--will-grey: #ABA7AF;
|
|
18
|
-
--will-white: #fff;
|
|
19
|
-
--will-onahau: #CDEEFF;
|
|
20
|
-
--will-text: #5A5959;
|
|
21
|
-
|
|
22
|
-
/* Confines */
|
|
23
|
-
--will-box-shadow: 0px 6px 11px 0px #a7a4a480;
|
|
24
|
-
|
|
25
|
-
/* Breakpoints */
|
|
26
|
-
|
|
27
|
-
--will-lg: 1140px;
|
|
28
|
-
--will-md: 960px;
|
|
29
|
-
--will-sm: 600px;
|
|
30
|
-
--will-xl: 1280px;
|
|
31
|
-
--will-xs: 0px;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/* Typography */
|
|
35
|
-
|
|
36
|
-
.will-root h1, h2, h3, h4, h5, h6 {
|
|
37
|
-
font-weight: 700;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.will-root p, h1, h2, h3, h4, h5, h6, span {
|
|
41
|
-
margin: 0;
|
|
42
|
-
padding: 0;
|
|
1
|
+
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap');
|
|
2
|
+
|
|
3
|
+
.will-root * {
|
|
4
|
+
font-family: 'Montserrat', sans-serif;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.will-root {
|
|
8
|
+
|
|
9
|
+
box-sizing: border-box;
|
|
10
|
+
font-size: 14px;
|
|
11
|
+
|
|
12
|
+
color: #1E1E1E;
|
|
13
|
+
|
|
14
|
+
/* Pallete */
|
|
15
|
+
--will-primary: #374269;
|
|
16
|
+
--will-secondary: #374269;
|
|
17
|
+
--will-grey: #ABA7AF;
|
|
18
|
+
--will-white: #fff;
|
|
19
|
+
--will-onahau: #CDEEFF;
|
|
20
|
+
--will-text: #5A5959;
|
|
21
|
+
|
|
22
|
+
/* Confines */
|
|
23
|
+
--will-box-shadow: 0px 6px 11px 0px #a7a4a480;
|
|
24
|
+
|
|
25
|
+
/* Breakpoints */
|
|
26
|
+
|
|
27
|
+
--will-lg: 1140px;
|
|
28
|
+
--will-md: 960px;
|
|
29
|
+
--will-sm: 600px;
|
|
30
|
+
--will-xl: 1280px;
|
|
31
|
+
--will-xs: 0px;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/* Typography */
|
|
35
|
+
|
|
36
|
+
.will-root h1, h2, h3, h4, h5, h6 {
|
|
37
|
+
font-weight: 700;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.will-root p, h1, h2, h3, h4, h5, h6, span {
|
|
41
|
+
margin: 0;
|
|
42
|
+
padding: 0;
|
|
43
43
|
}
|
package/src/themes/useTheme.tsx
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { CSSProperties } from 'react'
|
|
2
|
-
|
|
3
|
-
export interface Palette {
|
|
4
|
-
primary: string
|
|
5
|
-
secondary: string
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export interface ThemeProps {
|
|
9
|
-
palette?: Palette
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
interface CustomPaletteTypes extends CSSProperties {
|
|
13
|
-
'--will-primary'?: string
|
|
14
|
-
'--will-secondary'?: string
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export default function useTheme({ palette }: ThemeProps) {
|
|
18
|
-
const themePalette: CustomPaletteTypes = {
|
|
19
|
-
'--will-primary': palette?.primary,
|
|
20
|
-
'--will-secondary': palette?.secondary,
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
return themePalette
|
|
24
|
-
}
|
|
1
|
+
import { CSSProperties } from 'react'
|
|
2
|
+
|
|
3
|
+
export interface Palette {
|
|
4
|
+
primary: string
|
|
5
|
+
secondary: string
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface ThemeProps {
|
|
9
|
+
palette?: Palette
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
interface CustomPaletteTypes extends CSSProperties {
|
|
13
|
+
'--will-primary'?: string
|
|
14
|
+
'--will-secondary'?: string
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default function useTheme({ palette }: ThemeProps) {
|
|
18
|
+
const themePalette: CustomPaletteTypes = {
|
|
19
|
+
'--will-primary': palette?.primary,
|
|
20
|
+
'--will-secondary': palette?.secondary,
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return themePalette
|
|
24
|
+
}
|
|
@@ -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
|
+
};
|