willba-component-library 0.0.28 → 0.0.33

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.
Files changed (61) hide show
  1. package/.storybook/main.ts +19 -19
  2. package/.storybook/preview.ts +15 -15
  3. package/lib/components/FilterBar/FilterBar.d.ts +2 -2
  4. package/lib/components/FilterBar/components/Callendar.d.ts +2 -0
  5. package/lib/components/FilterBar/components/Divider.d.ts +2 -0
  6. package/lib/components/FilterBar/components/SelectButton.d.ts +2 -0
  7. package/lib/components/FilterBar/components/SubmitButton.d.ts +2 -0
  8. package/lib/components/FilterBar/components/calendar/Calendar.d.ts +3 -0
  9. package/lib/components/FilterBar/components/categories/Categories.d.ts +3 -0
  10. package/lib/components/FilterBar/components/divider/Divider.d.ts +3 -0
  11. package/lib/components/FilterBar/components/guests/Guests.d.ts +3 -0
  12. package/lib/components/FilterBar/components/select-button/SelectButton.d.ts +3 -0
  13. package/lib/components/FilterBar/components/submit-button/SubmitButton.d.ts +3 -0
  14. package/lib/components/FilterBar/hooks/useFilterBar.d.ts +13 -0
  15. package/lib/index.esm.js +5695 -84
  16. package/lib/index.esm.js.map +1 -1
  17. package/lib/index.js +5735 -106
  18. package/lib/index.js.map +1 -1
  19. package/lib/index.umd.js +5736 -107
  20. package/lib/index.umd.js.map +1 -1
  21. package/package.json +8 -6
  22. package/prettier.config.js +6 -0
  23. package/rollup.config.mjs +59 -59
  24. package/src/components/Button/Button.stories.tsx +34 -34
  25. package/src/components/Button/Button.tsx +56 -56
  26. package/src/components/Button/button.css +29 -29
  27. package/src/components/Button/index.ts +1 -1
  28. package/src/components/FilterBar/FilterBar.css +5 -99
  29. package/src/components/FilterBar/FilterBar.stories.tsx +20 -20
  30. package/src/components/FilterBar/FilterBar.tsx +28 -140
  31. package/src/components/FilterBar/components/calendar/Calendar.css +0 -0
  32. package/src/components/FilterBar/components/calendar/Calendar.tsx +41 -0
  33. package/src/components/FilterBar/components/categories/Categories.css +15 -0
  34. package/src/components/FilterBar/components/categories/Categories.tsx +37 -0
  35. package/src/components/FilterBar/components/divider/Divider.css +6 -0
  36. package/src/components/FilterBar/components/divider/Divider.tsx +7 -0
  37. package/src/components/FilterBar/components/guests/Guests.css +44 -0
  38. package/src/components/FilterBar/components/guests/Guests.tsx +42 -0
  39. package/src/components/FilterBar/components/select-button/SelectButton.css +9 -0
  40. package/src/components/FilterBar/components/select-button/SelectButton.tsx +11 -0
  41. package/src/components/FilterBar/components/submit-button/SubmitButton.css +11 -0
  42. package/src/components/FilterBar/components/submit-button/SubmitButton.tsx +11 -0
  43. package/src/components/FilterBar/hooks/useFilterBar.tsx +49 -0
  44. package/src/components/FilterBar/index.ts +1 -1
  45. package/src/index.ts +4 -4
  46. package/stories/Button.stories.ts +50 -50
  47. package/stories/Button.tsx +48 -48
  48. package/stories/Configure.mdx +364 -364
  49. package/stories/Header.stories.ts +27 -27
  50. package/stories/Header.tsx +56 -56
  51. package/stories/Page.stories.ts +29 -29
  52. package/stories/Page.tsx +73 -73
  53. package/stories/assets/accessibility.svg +4 -4
  54. package/stories/assets/discord.svg +15 -15
  55. package/stories/assets/github.svg +3 -3
  56. package/stories/assets/tutorials.svg +12 -12
  57. package/stories/assets/youtube.svg +4 -4
  58. package/stories/button.css +30 -30
  59. package/stories/header.css +32 -32
  60. package/stories/page.css +69 -69
  61. package/tsconfig.json +22 -22
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "willba-component-library",
3
- "version": "0.0.28",
3
+ "version": "0.0.33",
4
4
  "description": "A stroybook 6 with TypeScript demo",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.esm.js",
@@ -14,11 +14,13 @@
14
14
  "author": "Willba",
15
15
  "license": "MIT",
16
16
  "dependencies": {
17
- "classnames": "^2.3.2"
17
+ "classnames": "^2.3.2",
18
+ "date-fns": "^2.30.0",
19
+ "react-day-picker": "^8.8.0"
18
20
  },
19
21
  "peerDependencies": {
20
- "react": "^17.0.2",
21
- "react-dom": "^17.0.2"
22
+ "react": "^18.2.0",
23
+ "react-dom": "^18.2.0"
22
24
  },
23
25
  "devDependencies": {
24
26
  "@rollup/plugin-commonjs": "^25.0.3",
@@ -34,8 +36,8 @@
34
36
  "@storybook/testing-library": "^0.2.0",
35
37
  "@types/react": "^18.2.19",
36
38
  "postcss": "^8.4.27",
37
- "react": "^17.0.2",
38
- "react-dom": "^17.0.2",
39
+ "react": "^18.2.0",
40
+ "react-dom": "^18.2.0",
39
41
  "rollup": "^3.28.0",
40
42
  "rollup-plugin-dts": "^5.3.1",
41
43
  "rollup-plugin-peer-deps-external": "^2.2.4",
@@ -0,0 +1,6 @@
1
+ module.exports = {
2
+ arrowParens: 'always',
3
+ semi: false,
4
+ singleQuote: true,
5
+ trailingComma: 'es5',
6
+ }
package/rollup.config.mjs CHANGED
@@ -1,59 +1,59 @@
1
- import peerDepsExternal from "rollup-plugin-peer-deps-external";
2
- import resolve from "@rollup/plugin-node-resolve";
3
- import commonjs from "@rollup/plugin-commonjs";
4
- import typescript from "@rollup/plugin-typescript";
5
- import postcss from "rollup-plugin-postcss";
6
- import dts from "rollup-plugin-dts";
7
-
8
- // This is required to read package.json file when
9
- // using Native ES modules in Node.js
10
- // https://rollupjs.org/command-line-interface/#importing-package-json
11
- import { createRequire } from "node:module";
12
- const requireFile = createRequire(import.meta.url);
13
- const packageJson = requireFile("./package.json");
14
-
15
- const globals = {
16
- react: "React",
17
- "react-dom": "ReactDOM",
18
- "react-query": "ReactQuery",
19
- };
20
-
21
- export default [
22
- {
23
- input: "src/index.ts",
24
- output: [
25
- {
26
- file: packageJson.main,
27
- format: "cjs",
28
- sourcemap: true,
29
- },
30
- {
31
- file: packageJson.module,
32
- format: "esm",
33
- sourcemap: true,
34
- },
35
- {
36
- name: "MyComponentLibrary",
37
- file: `lib/index.umd.js`,
38
- format: "umd",
39
- sourcemap: true,
40
- globals,
41
- },
42
- ],
43
- plugins: [
44
- peerDepsExternal(),
45
- resolve(),
46
- commonjs(),
47
- typescript(),
48
- postcss({
49
- extensions: [".css"],
50
- }),
51
- ],
52
- },
53
- {
54
- input: "lib/index.d.ts",
55
- output: [{ file: "lib/index.d.ts", format: "es" }],
56
- plugins: [dts()],
57
- external: [/\.css$/],
58
- },
59
- ];
1
+ import peerDepsExternal from "rollup-plugin-peer-deps-external";
2
+ import resolve from "@rollup/plugin-node-resolve";
3
+ import commonjs from "@rollup/plugin-commonjs";
4
+ import typescript from "@rollup/plugin-typescript";
5
+ import postcss from "rollup-plugin-postcss";
6
+ import dts from "rollup-plugin-dts";
7
+
8
+ // This is required to read package.json file when
9
+ // using Native ES modules in Node.js
10
+ // https://rollupjs.org/command-line-interface/#importing-package-json
11
+ import { createRequire } from "node:module";
12
+ const requireFile = createRequire(import.meta.url);
13
+ const packageJson = requireFile("./package.json");
14
+
15
+ const globals = {
16
+ react: "React",
17
+ "react-dom": "ReactDOM",
18
+ "react-query": "ReactQuery",
19
+ };
20
+
21
+ export default [
22
+ {
23
+ input: "src/index.ts",
24
+ output: [
25
+ {
26
+ file: packageJson.main,
27
+ format: "cjs",
28
+ sourcemap: true,
29
+ },
30
+ {
31
+ file: packageJson.module,
32
+ format: "esm",
33
+ sourcemap: true,
34
+ },
35
+ {
36
+ name: "WillbaComponentLibrary",
37
+ file: `lib/index.umd.js`,
38
+ format: "umd",
39
+ sourcemap: true,
40
+ globals,
41
+ },
42
+ ],
43
+ plugins: [
44
+ peerDepsExternal(),
45
+ resolve(),
46
+ commonjs(),
47
+ typescript(),
48
+ postcss({
49
+ extensions: [".css"],
50
+ }),
51
+ ],
52
+ },
53
+ {
54
+ input: "lib/index.d.ts",
55
+ output: [{ file: "lib/index.d.ts", format: "es" }],
56
+ plugins: [dts()],
57
+ external: [/\.css$/],
58
+ },
59
+ ];
@@ -1,34 +1,34 @@
1
- import React from "react";
2
- import type { Meta, StoryObj } from "@storybook/react";
3
- import Button from "./Button";
4
-
5
- // Default metadata of the story https://storybook.js.org/docs/react/api/csf#default-export
6
- const meta: Meta<typeof Button> = {
7
- title: "Components/Button",
8
- component: Button,
9
- argTypes: {
10
- textColor: { control: "color" },
11
- onClick: { action: "clicked" },
12
- },
13
- };
14
-
15
- export default meta;
16
-
17
- // The story type for the component https://storybook.js.org/docs/react/api/csf#named-story-exports
18
- type Story = StoryObj<typeof Button>;
19
-
20
- export const Primary: Story = {
21
- args: {
22
- label: "Primary 😃",
23
- size: "large",
24
- type: "primary",
25
- },
26
- };
27
-
28
- export const Secondary: Story = {
29
- args: {
30
- ...Primary.args,
31
- type: "secondary",
32
- label: "Secondary 😇",
33
- },
34
- };
1
+ import React from "react";
2
+ import type { Meta, StoryObj } from "@storybook/react";
3
+ import Button from "./Button";
4
+
5
+ // Default metadata of the story https://storybook.js.org/docs/react/api/csf#default-export
6
+ const meta: Meta<typeof Button> = {
7
+ title: "Components/Button",
8
+ component: Button,
9
+ argTypes: {
10
+ textColor: { control: "color" },
11
+ onClick: { action: "clicked" },
12
+ },
13
+ };
14
+
15
+ export default meta;
16
+
17
+ // The story type for the component https://storybook.js.org/docs/react/api/csf#named-story-exports
18
+ type Story = StoryObj<typeof Button>;
19
+
20
+ export const Primary: Story = {
21
+ args: {
22
+ label: "Primary 😃",
23
+ size: "large",
24
+ type: "primary",
25
+ },
26
+ };
27
+
28
+ export const Secondary: Story = {
29
+ args: {
30
+ ...Primary.args,
31
+ type: "secondary",
32
+ label: "Secondary 😇",
33
+ },
34
+ };
@@ -1,56 +1,56 @@
1
- import React, { useState } from "react";
2
- import classNames from "classnames";
3
- import "./button.css";
4
-
5
- export interface ButtonProps {
6
- /**
7
- * Is this the principal call to action on the page?
8
- */
9
- type?: "primary" | "secondary";
10
- /**
11
- * What background color to use
12
- */
13
- textColor?: string;
14
- /**
15
- * How large should the button be?
16
- */
17
- size?: "small" | "medium" | "large";
18
- /**
19
- * Button contents
20
- */
21
- label: string;
22
- /**
23
- * Optional click handler
24
- */
25
- onClick?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
26
- }
27
-
28
- /**
29
- * Primary UI component for user interaction
30
- */
31
- const Button = ({
32
- type = "primary",
33
- textColor,
34
- size = "medium",
35
- onClick,
36
- label,
37
- }: ButtonProps) => {
38
- const [theState, setTheState] = useState(4);
39
-
40
- return (
41
- <button
42
- type="button"
43
- className={classNames(
44
- "storybook-button",
45
- `storybook-button--${size}`,
46
- `storybook-button--${type}`
47
- )}
48
- style={textColor ? { color: textColor } : {}}
49
- onClick={onClick}
50
- >
51
- {`${label} ${theState}`}
52
- </button>
53
- );
54
- };
55
-
56
- export default Button;
1
+ import React, { useState } from "react";
2
+ import classNames from "classnames";
3
+ import "./button.css";
4
+
5
+ export interface ButtonProps {
6
+ /**
7
+ * Is this the principal call to action on the page?
8
+ */
9
+ type?: "primary" | "secondary";
10
+ /**
11
+ * What background color to use
12
+ */
13
+ textColor?: string;
14
+ /**
15
+ * How large should the button be?
16
+ */
17
+ size?: "small" | "medium" | "large";
18
+ /**
19
+ * Button contents
20
+ */
21
+ label: string;
22
+ /**
23
+ * Optional click handler
24
+ */
25
+ onClick?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
26
+ }
27
+
28
+ /**
29
+ * Primary UI component for user interaction
30
+ */
31
+ const Button = ({
32
+ type = "primary",
33
+ textColor,
34
+ size = "medium",
35
+ onClick,
36
+ label,
37
+ }: ButtonProps) => {
38
+ const [theState, setTheState] = useState(4);
39
+
40
+ return (
41
+ <button
42
+ type="button"
43
+ className={classNames(
44
+ "storybook-button",
45
+ `storybook-button--${size}`,
46
+ `storybook-button--${type}`
47
+ )}
48
+ style={textColor ? { color: textColor } : {}}
49
+ onClick={onClick}
50
+ >
51
+ {`${label} ${theState}`}
52
+ </button>
53
+ );
54
+ };
55
+
56
+ export default Button;
@@ -1,30 +1,30 @@
1
- .storybook-button {
2
- font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
3
- font-weight: 700;
4
- border: 0;
5
- border-radius: 3em;
6
- cursor: pointer;
7
- display: inline-block;
8
- line-height: 1;
9
- }
10
- .storybook-button--primary {
11
- color: white;
12
- background-color: #1ea7fd;
13
- }
14
- .storybook-button--secondary {
15
- color: #333;
16
- background-color: transparent;
17
- box-shadow: rgba(0, 0, 0, 0.15) 0px 0px 0px 1px inset;
18
- }
19
- .storybook-button--small {
20
- font-size: 12px;
21
- padding: 10px 16px;
22
- }
23
- .storybook-button--medium {
24
- font-size: 14px;
25
- padding: 11px 20px;
26
- }
27
- .storybook-button--large {
28
- font-size: 16px;
29
- padding: 12px 24px;
1
+ .storybook-button {
2
+ font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
3
+ font-weight: 700;
4
+ border: 0;
5
+ border-radius: 3em;
6
+ cursor: pointer;
7
+ display: inline-block;
8
+ line-height: 1;
9
+ }
10
+ .storybook-button--primary {
11
+ color: white;
12
+ background-color: #1ea7fd;
13
+ }
14
+ .storybook-button--secondary {
15
+ color: #333;
16
+ background-color: transparent;
17
+ box-shadow: rgba(0, 0, 0, 0.15) 0px 0px 0px 1px inset;
18
+ }
19
+ .storybook-button--small {
20
+ font-size: 12px;
21
+ padding: 10px 16px;
22
+ }
23
+ .storybook-button--medium {
24
+ font-size: 14px;
25
+ padding: 11px 20px;
26
+ }
27
+ .storybook-button--large {
28
+ font-size: 16px;
29
+ padding: 12px 24px;
30
30
  }
@@ -1 +1 @@
1
- export { default } from "./Button";
1
+ export { default } from "./Button";
@@ -1,16 +1,10 @@
1
- /* Structure ---------------------------- */
2
-
3
- .root {
4
- width: 100%;
5
- }
6
-
7
- .search-widget {
1
+ .filter-bar {
8
2
  box-sizing: border-box;
9
3
  max-width: 1100px;
10
4
  position: relative;
11
5
  }
12
6
 
13
- .search-widget-header {
7
+ .filter-bar-header {
14
8
  display: flex;
15
9
  justify-content: space-between;
16
10
  align-items: center;
@@ -19,12 +13,12 @@
19
13
  z-index: 222;
20
14
 
21
15
  border-radius: 40px;
22
- background-color: #ecf1f4;
16
+ background-color: #fff;
23
17
  box-shadow: 0px 6px 11px 0px #a7a4a480;
24
18
  }
25
19
 
26
- .search-widget-container {
27
- background-color: #ecf1f4;
20
+ .filter-bar-container {
21
+ background-color: #fff;
28
22
  min-height: 100px;
29
23
 
30
24
  padding: 90px 40px 30px 40px;
@@ -36,96 +30,8 @@
36
30
  box-shadow: 0px 6px 11px 0px #a7a4a480;
37
31
  }
38
32
 
39
- .search-widget-divider {
40
- width: 1px;
41
- margin: 0 10px;
42
- height: 35px;
43
- background-color: #384265;
44
- }
45
-
46
- .search-widget-submit-button {
47
- width: auto;
48
- height: auto;
49
- background-color: #384265;
50
- color: #fff;
51
- padding: 10px 20px;
52
- border-radius: 20px;
53
- cursor: pointer;
54
- border: none;
55
- }
56
-
57
- .search-widget-select-button {
58
- width: auto;
59
- height: auto;
60
- background-color: transparent;
61
- border: none;
62
- padding: 10px 20px;
63
- border-radius: 20px;
64
- cursor: pointer;
65
- }
66
-
67
- /* Filters - Guests ---------------------------- */
68
-
69
- .search-widget-guests {
70
- text-align: initial;
71
- }
72
33
 
73
- .guests-filter-container {
74
- display: flex;
75
- margin-top: 30px;
76
- }
77
34
 
78
- .guests-filter-inner {
79
- display: flex;
80
- align-items: center;
81
- }
82
35
 
83
- .guests-filter-inner:not(:last-child) {
84
- margin-right: 50px;
85
- }
86
36
 
87
- .guests-filter-inner > span {
88
- display: block;
89
- margin-right: 20px;
90
- font-weight: bold;
91
- }
92
-
93
- .guests-filter-inner > div {
94
- display: flex;
95
- align-items: center;
96
- }
97
-
98
- .guests-filter-inner > div > span {
99
- margin: 0 10px;
100
- }
101
-
102
- .guests-filter-inner > div button {
103
- border-radius: 50%;
104
- border: none;
105
- background-color: #CDEEFF;
106
- width: 25px;
107
- height: 25px;
108
- display: flex;
109
- justify-content: center;
110
- align-items: center;
111
- font-size: 20px;
112
- }
113
-
114
- /* Filters - Categories ---------------------------- */
115
-
116
- .search-widget-categories {
117
- text-align: center;
118
- }
119
-
120
- .categories-filter-inner {
121
- display: flex;
122
- align-items: center;
123
- justify-content: center;
124
- gap: 20px;
125
- }
126
-
127
- .categories-filter-inner input {
128
- cursor: pointer;
129
- margin-right: 10px;
130
- }
131
37
 
@@ -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
+ };