@phillips/seldon 1.2.0 → 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 +34 -6
- package/dist/components/Button/Button.js +5 -4
- package/dist/components/Header/Header.d.ts +3 -3
- package/dist/components/HeroBanner/HeroBanner.d.ts +1 -1
- package/dist/components/HeroBanner/HeroBanner.js +16 -15
- package/dist/scss/{utils/_typography.scss → _typography.scss} +9 -9
- package/dist/scss/components/Button/_button.scss +1 -1
- package/dist/scss/components/HeroBanner/_heroBanner.scss +30 -1
- package/dist/scss/styles.scss +7 -7
- package/package.json +15 -6
- package/dist/assets/vite.svg +0 -1
- /package/dist/scss/{utils/_reset.scss → _reset.scss} +0 -0
- /package/dist/scss/{utils/_vars.scss → _vars.scss} +0 -0
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
|
|
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
|
|
68
|
+
import { Button } from '@phillips/seldon';
|
|
39
69
|
```
|
|
40
70
|
|
|
41
|
-
|
|
71
|
+
### Contributing Guidelines
|
|
42
72
|
|
|
43
|
-
|
|
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
|
|
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:
|
|
9
|
+
id: t,
|
|
10
10
|
...u
|
|
11
11
|
}) => /* @__PURE__ */ a(
|
|
12
12
|
"button",
|
|
13
13
|
{
|
|
14
|
-
"data-testid":
|
|
14
|
+
"data-testid": t ? `button-${t}` : "button",
|
|
15
|
+
id: t,
|
|
15
16
|
type: "button",
|
|
16
|
-
className: m(`${
|
|
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
|
|
7
|
-
onLogout
|
|
8
|
-
onCreateAccount
|
|
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;
|
|
@@ -1,32 +1,33 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { px as
|
|
3
|
-
const
|
|
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:
|
|
6
|
+
headerText: o,
|
|
7
7
|
subHeadText: c,
|
|
8
8
|
association: h,
|
|
9
|
-
background:
|
|
10
|
-
id:
|
|
11
|
-
}) => /* @__PURE__ */
|
|
9
|
+
background: p,
|
|
10
|
+
id: e
|
|
11
|
+
}) => /* @__PURE__ */ s(
|
|
12
12
|
"header",
|
|
13
13
|
{
|
|
14
|
-
"data-testid":
|
|
15
|
-
|
|
16
|
-
|
|
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__ */
|
|
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
|
-
|
|
23
|
-
|
|
23
|
+
/* @__PURE__ */ s("h1", { className: `${a}__heading`, children: [
|
|
24
|
+
o,
|
|
24
25
|
c ? /* @__PURE__ */ n("span", { children: c }) : null
|
|
25
|
-
] })
|
|
26
|
+
] }),
|
|
26
27
|
h ? /* @__PURE__ */ n("p", { children: h }) : null
|
|
27
28
|
]
|
|
28
29
|
}
|
|
29
30
|
);
|
|
30
31
|
export {
|
|
31
|
-
|
|
32
|
+
t as default
|
|
32
33
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@
|
|
1
|
+
@import './vars';
|
|
2
2
|
|
|
3
3
|
body {
|
|
4
4
|
font-family: SeroWebPro,"Helvetica Neue",Helvetica,-apple-system,".SFNSText-Regular","San Francisco",BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Helvetica,Arial,sans-serif;
|
|
@@ -24,8 +24,8 @@ p {
|
|
|
24
24
|
/** Fonts **/
|
|
25
25
|
@font-face {
|
|
26
26
|
font-family: 'DistinctDisplay';
|
|
27
|
-
src: url('
|
|
28
|
-
src: url('
|
|
27
|
+
src: url('../fonts/Distinct-Display.woff') format('woff');
|
|
28
|
+
src: url('../fonts/Distinct-Display.woff2') format('woff2');
|
|
29
29
|
}
|
|
30
30
|
@mixin DistinctDisplay {
|
|
31
31
|
font-family: $DistinctDisplay;
|
|
@@ -33,8 +33,8 @@ p {
|
|
|
33
33
|
|
|
34
34
|
@font-face {
|
|
35
35
|
font-family: 'DistinctDisplayItalic';
|
|
36
|
-
src: url('
|
|
37
|
-
src: url('
|
|
36
|
+
src: url('../fonts/Distinct-DisplayItalic.woff') format('woff');
|
|
37
|
+
src: url('../fonts/Distinct-DisplayItalic.woff2') format('woff2');
|
|
38
38
|
}
|
|
39
39
|
@mixin DistinctDisplayItalic {
|
|
40
40
|
font-family: $DistinctDisplayItalic;
|
|
@@ -42,8 +42,8 @@ p {
|
|
|
42
42
|
|
|
43
43
|
@font-face {
|
|
44
44
|
font-family: 'DistinctItalic';
|
|
45
|
-
src: url('
|
|
46
|
-
src: url('
|
|
45
|
+
src: url('../fonts/Distinct-Italic.woff') format('woff');
|
|
46
|
+
src: url('../fonts/Distinct-Italic.woff2') format('woff2');
|
|
47
47
|
}
|
|
48
48
|
@mixin DistinctItalic {
|
|
49
49
|
font-family: $DistinctItalic;
|
|
@@ -51,8 +51,8 @@ p {
|
|
|
51
51
|
|
|
52
52
|
@font-face {
|
|
53
53
|
font-family: 'DistinctText';
|
|
54
|
-
src: url('
|
|
55
|
-
src: url('
|
|
54
|
+
src: url('../fonts/Distinct-Text.woff') format('woff');
|
|
55
|
+
src: url('../fonts/Distinct-Text.woff2') format('woff2');
|
|
56
56
|
}
|
|
57
57
|
@mixin DistinctText {
|
|
58
58
|
font-family: $DistinctText;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@
|
|
1
|
+
@import '../../vars';
|
|
2
2
|
|
|
3
3
|
.#{$px}-hero-banner {
|
|
4
4
|
align-items: center;
|
|
@@ -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/dist/scss/styles.scss
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
@
|
|
1
|
+
@import './vars';
|
|
2
2
|
// @TODO: add styles when we can do a site wide regressions QA
|
|
3
|
-
// @use '
|
|
4
|
-
@
|
|
5
|
-
@
|
|
6
|
-
@
|
|
7
|
-
@
|
|
8
|
-
@
|
|
3
|
+
// @use 'reset';
|
|
4
|
+
@import './typography';
|
|
5
|
+
@import 'components/Button/button';
|
|
6
|
+
@import 'components/Header/header';
|
|
7
|
+
@import 'components/HeroBanner/heroBanner';
|
|
8
|
+
@import 'pages/page';
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@phillips/seldon",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"type": "module",
|
|
5
|
+
"main": "./dist/index.js",
|
|
5
6
|
"module": "./dist/index.js",
|
|
6
7
|
"types": "./dist/index.d.ts",
|
|
7
8
|
"exports": {
|
|
@@ -16,18 +17,18 @@
|
|
|
16
17
|
}
|
|
17
18
|
},
|
|
18
19
|
"files": [
|
|
19
|
-
"dist/**"
|
|
20
|
-
"!dist/src"
|
|
20
|
+
"dist/**"
|
|
21
21
|
],
|
|
22
22
|
"scripts": {
|
|
23
23
|
"dev": "vite",
|
|
24
|
-
"
|
|
24
|
+
"test": "jest",
|
|
25
|
+
"start": "storybook dev -p 6006",
|
|
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"
|
package/dist/assets/vite.svg
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
|
File without changes
|
|
File without changes
|