@phillips/seldon 1.2.1 → 1.3.0

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 CHANGED
@@ -16,6 +16,36 @@ yarn add @phillips/seldon
16
16
 
17
17
  ## What's included
18
18
 
19
+ ```
20
+ @phillips/seldon/
21
+ ├── components
22
+ │ └── HeroBanner
23
+ │ └── HeroBanner.d.ts
24
+ │ └── HeroBanner.js
25
+ │ └── ...
26
+ ├── Pages
27
+ │ └── HomePage
28
+ │ └── HomePage.d.ts
29
+ │ └── HomePage.js
30
+ │ └── ...
31
+ ├── scss
32
+ │ └── components
33
+ │ └── HeroBanner
34
+ │ └── _HeroBanner.scss
35
+ │ └── ...
36
+ │ └── Pages
37
+ │ └── HomePage
38
+ │ └── _HomePage.scss
39
+ │ └── ...
40
+ │ └── _reset.scss
41
+ │ └── _typography_.scss
42
+ │ └── _vars.scss
43
+ │ └── styles.scss (sass entrypoint)
44
+ ├── utils
45
+ ├── index.d.ts
46
+ ├── index.js
47
+ ```
48
+
19
49
  ### Styling
20
50
 
21
51
  The project contains a `scss` folder. Here you will find the main export of our sass styles. This will include all the styles bundled with this package, including resets and typography styles.
@@ -32,14 +62,12 @@ If you wish to only import specific component styles you can find them in their
32
62
 
33
63
  ### Components
34
64
 
35
- Each component can be imported in your project by referencing the component name inside the `components` directory.
65
+ Each component can be imported in your project by referencing the named exports from main index file.
36
66
 
37
67
  ```js
38
- import Button from '@phillips/seldon/dist/components/Button/Button';
68
+ import { Button } from '@phillips/seldon';
39
69
  ```
40
70
 
41
- You can also use named exports for multiple component imports from main index file.
71
+ ### Contributing Guidelines
42
72
 
43
- ```js
44
- import { Button } from '@phillips/seldon';
45
- ```
73
+ Before you start contributing to this project please check out our guidelines found [here](/src/docs/CONTRIBUTING.md)
@@ -1,19 +1,20 @@
1
1
  import { jsx as a } from "react/jsx-runtime";
2
2
  import m from "../../node_modules/classnames/index.js";
3
- import { px as t } from "../../utils/index.js";
3
+ import { px as o } from "../../utils/index.js";
4
4
  const c = ({
5
5
  primary: n = !1,
6
6
  size: e = "medium",
7
7
  backgroundColor: s,
8
8
  label: r,
9
- id: o,
9
+ id: t,
10
10
  ...u
11
11
  }) => /* @__PURE__ */ a(
12
12
  "button",
13
13
  {
14
- "data-testid": o ? `button-${o}` : "button",
14
+ "data-testid": t ? `button-${t}` : "button",
15
+ id: t,
15
16
  type: "button",
16
- className: m(`${t}-button`, `${t}-button--${e}`, { [`${t}-button--secondary`]: !n }),
17
+ className: m(`${o}-button`, `${o}-button--${e}`, { [`${o}-button--secondary`]: !n }),
17
18
  style: { backgroundColor: s },
18
19
  ...u,
19
20
  children: r
@@ -3,9 +3,9 @@ type User = {
3
3
  };
4
4
  interface HeaderProps {
5
5
  user?: User;
6
- onLogin: () => void;
7
- onLogout: () => void;
8
- onCreateAccount: () => void;
6
+ onLogin?: () => void;
7
+ onLogout?: () => void;
8
+ onCreateAccount?: () => void;
9
9
  }
10
10
  declare const Header: ({ user, onLogin, onLogout, onCreateAccount }: HeaderProps) => import("react/jsx-runtime").JSX.Element;
11
11
  export default Header;
@@ -24,7 +24,7 @@ interface HeroBannerProps {
24
24
  */
25
25
  background?: string;
26
26
  /**
27
- * Unique id for component
27
+ * Unique id for component testing
28
28
  */
29
29
  id?: string;
30
30
  }
@@ -1,32 +1,33 @@
1
- import { jsxs as e, jsx as n } from "react/jsx-runtime";
2
- import { px as p } from "../../utils/index.js";
3
- const s = `${p}-hero-banner`, m = ({
1
+ import { jsxs as s, jsx as n } from "react/jsx-runtime";
2
+ import { px as d } from "../../utils/index.js";
3
+ const a = `${d}-hero-banner`, t = ({
4
4
  prehead: l,
5
5
  date: r,
6
- headerText: a,
6
+ headerText: o,
7
7
  subHeadText: c,
8
8
  association: h,
9
- background: i,
10
- id: o
11
- }) => /* @__PURE__ */ e(
9
+ background: p,
10
+ id: e
11
+ }) => /* @__PURE__ */ s(
12
12
  "header",
13
13
  {
14
- "data-testid": o ? `hero-banner-${o}` : "hero-banner",
15
- className: s,
16
- style: { "--background": i },
14
+ "data-testid": e ? `hero-banner-${e}` : "hero-banner",
15
+ id: e,
16
+ className: a,
17
+ style: { "--background": p },
17
18
  children: [
18
- l || r ? /* @__PURE__ */ e("p", { className: `${s}__pre-head`, children: [
19
+ l || r ? /* @__PURE__ */ s("p", { className: `${a}__pre-head`, children: [
19
20
  l ? /* @__PURE__ */ n("span", { children: l }) : null,
20
21
  r ? /* @__PURE__ */ n("span", { children: r }) : null
21
22
  ] }) : null,
22
- a ? /* @__PURE__ */ e("h1", { className: `${s}__heading`, children: [
23
- a,
23
+ /* @__PURE__ */ s("h1", { className: `${a}__heading`, children: [
24
+ o,
24
25
  c ? /* @__PURE__ */ n("span", { children: c }) : null
25
- ] }) : null,
26
+ ] }),
26
27
  h ? /* @__PURE__ */ n("p", { children: h }) : null
27
28
  ]
28
29
  }
29
30
  );
30
31
  export {
31
- m as default
32
+ t as default
32
33
  };
@@ -13,6 +13,25 @@
13
13
  padding: 1rem;
14
14
  width: 100%;
15
15
 
16
+ @media (max-width: 28.8125rem) {
17
+ flex-direction: column;
18
+ align-items: center;
19
+ gap: 1.875rem;
20
+ align-self: stretch;
21
+ padding: 1.875rem 0.9375rem;
22
+ background: $pure-black;
23
+
24
+ &::before{
25
+ content: '';
26
+ background: var(--background);
27
+ width: 100%;
28
+ height: 12rem;
29
+ background-size: cover;
30
+ background-repeat: no-repeat;
31
+ background-position: center center;
32
+ }
33
+ }
34
+
16
35
  h1,
17
36
  h1 span,
18
37
  p {
@@ -39,6 +58,12 @@
39
58
  @media (min-width: 28.8125rem) {
40
59
  font-size: 0.875rem;
41
60
  }
61
+
62
+ @media (max-width: 28.8125rem) {
63
+ flex-direction: column;
64
+ gap: 1rem;
65
+ align-items: center;
66
+ }
42
67
  }
43
68
 
44
69
  & .#{$px}-hero-banner__heading {
@@ -54,6 +79,10 @@
54
79
  font-size: 2.375rem;
55
80
  }
56
81
 
82
+ @media (max-width: 28.8125rem) {
83
+ margin: 0;
84
+ }
85
+
57
86
  span {
58
87
  font-size: 1.625rem;
59
88
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phillips/seldon",
3
- "version": "1.2.1",
3
+ "version": "1.3.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -21,13 +21,14 @@
21
21
  ],
22
22
  "scripts": {
23
23
  "dev": "vite",
24
+ "test": "jest",
25
+ "start": "storybook dev -p 6006",
24
26
  "build": "npm run clean && tsc && vite build",
25
27
  "build:storybook": "storybook build",
28
+ "preview": "npx http-server storybook-static",
26
29
  "clean": "rimraf './dist'",
27
30
  "clean:stories": "rimraf './storybook-static'",
28
31
  "lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
29
- "start": "storybook dev -p 6006",
30
- "preview": "npx http-server storybook-static",
31
32
  "prepare": "husky install"
32
33
  },
33
34
  "dependencies": {
@@ -47,7 +48,11 @@
47
48
  "@storybook/react": "^7.0.22",
48
49
  "@storybook/react-vite": "^7.0.22",
49
50
  "@storybook/testing-library": "^0.0.14-next.2",
51
+ "@testing-library/jest-dom": "^5.17.0",
52
+ "@testing-library/react": "^14.0.0",
53
+ "@testing-library/user-event": "^14.4.3",
50
54
  "@types/color": "^3.0.3",
55
+ "@types/jest": "^29.5.3",
51
56
  "@types/react": "^18.0.37",
52
57
  "@types/react-dom": "^18.0.11",
53
58
  "@typescript-eslint/eslint-plugin": "^5.59.0",
@@ -60,6 +65,8 @@
60
65
  "eslint-plugin-react-refresh": "^0.3.4",
61
66
  "eslint-plugin-storybook": "^0.6.12",
62
67
  "husky": "^8.0.3",
68
+ "jest": "^29.6.1",
69
+ "jest-environment-jsdom": "^29.6.1",
63
70
  "prop-types": "^15.8.1",
64
71
  "rimraf": "^5.0.1",
65
72
  "rollup-plugin-copy": "^3.4.0",
@@ -67,6 +74,8 @@
67
74
  "sass": "^1.63.4",
68
75
  "semantic-release": "^21.0.5",
69
76
  "storybook": "^7.0.22",
77
+ "ts-jest": "^29.1.1",
78
+ "ts-node": "^10.9.1",
70
79
  "typescript": "^5.0.2",
71
80
  "vite": "^4.3.9",
72
81
  "vite-plugin-dts": "^2.3.0"