@knapsack/sandbox-components 4.67.3--canary.aa8dfe6.0 → 4.67.3
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +16 -0
- package/dist/css/ks-sandbox-styles.css +58 -19
- package/dist/react/header.d.ts.map +1 -1
- package/dist/react/header.js +6 -1
- package/dist/react/header.js.map +1 -1
- package/package.json +7 -7
- package/src/css/header.css +52 -12
- package/src/react/header.tsx +27 -2
package/CHANGELOG.md
CHANGED
@@ -1,3 +1,19 @@
|
|
1
|
+
# v4.67.3 (Wed Aug 07 2024)
|
2
|
+
|
3
|
+
#### 🐛 Bug Fix
|
4
|
+
|
5
|
+
- KSP-5370: Add menu to header sandbox component [#4456](https://github.com/knapsack-labs/app-monorepo/pull/4456) ([@brittanysmart](https://github.com/brittanysmart))
|
6
|
+
- Merge branch 'latest' into feature/add-menu-component ([@brittanysmart](https://github.com/brittanysmart))
|
7
|
+
- remove duplicate background-image in .logo class ([@brittanysmart](https://github.com/brittanysmart))
|
8
|
+
- add back logo class to header.css ([@brittanysmart](https://github.com/brittanysmart))
|
9
|
+
- update header styles and add menu functionality to header component ([@brittanysmart](https://github.com/brittanysmart))
|
10
|
+
|
11
|
+
#### Authors: 1
|
12
|
+
|
13
|
+
- Brittany Smart ([@brittanysmart](https://github.com/brittanysmart))
|
14
|
+
|
15
|
+
---
|
16
|
+
|
1
17
|
# v4.67.0 (Tue Aug 06 2024)
|
2
18
|
|
3
19
|
#### 🐛 Bug Fix
|
@@ -1372,15 +1372,22 @@ body {
|
|
1372
1372
|
.header {
|
1373
1373
|
background-color: #7a34ed;
|
1374
1374
|
background-color: var(--brand-color);
|
1375
|
-
padding
|
1376
|
-
padding
|
1377
|
-
|
1378
|
-
|
1379
|
-
|
1380
|
-
|
1381
|
-
|
1382
|
-
|
1383
|
-
|
1375
|
+
padding: 8px 16px;
|
1376
|
+
padding: var(--spacing-small) var(--spacing-large);
|
1377
|
+
width: 100%;
|
1378
|
+
position: relative;
|
1379
|
+
height: 60px;
|
1380
|
+
z-index: 10;
|
1381
|
+
}
|
1382
|
+
|
1383
|
+
.logo {
|
1384
|
+
background-image: url('https://knapsack.imgix.net/site/ks-sandbox/logo-arcadia-4id5a3sy3ysvg');
|
1385
|
+
background-image: var(--brand-logo);
|
1386
|
+
width: 100%;
|
1387
|
+
height: 28px;
|
1388
|
+
background-repeat: no-repeat;
|
1389
|
+
background-position: center;
|
1390
|
+
background-size: contain;
|
1384
1391
|
}
|
1385
1392
|
|
1386
1393
|
.header-content {
|
@@ -1388,21 +1395,53 @@ body {
|
|
1388
1395
|
align-items: center;
|
1389
1396
|
justify-content: space-between;
|
1390
1397
|
width: 100%;
|
1398
|
+
height: 100%;
|
1399
|
+
z-index: 15;
|
1400
|
+
position: relative;
|
1401
|
+
}
|
1402
|
+
|
1403
|
+
.menu {
|
1404
|
+
position: absolute;
|
1405
|
+
top: 60px;
|
1406
|
+
left: 0;
|
1407
|
+
width: 100%;
|
1408
|
+
max-height: 300px;
|
1409
|
+
background-color: #7a34ed;
|
1410
|
+
background-color: var(--brand-color);
|
1411
|
+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
1412
|
+
padding: 12px 0;
|
1413
|
+
padding: var(--spacing-medium) 0;
|
1414
|
+
z-index: 5;
|
1415
|
+
transform: translateY(-100%);
|
1416
|
+
transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
|
1417
|
+
opacity: 0;
|
1418
|
+
visibility: hidden;
|
1391
1419
|
}
|
1392
1420
|
|
1393
|
-
.menu
|
1394
|
-
|
1395
|
-
|
1421
|
+
.menu.open {
|
1422
|
+
transform: translateY(0);
|
1423
|
+
opacity: 1;
|
1424
|
+
visibility: visible;
|
1396
1425
|
}
|
1397
1426
|
|
1398
|
-
.
|
1399
|
-
|
1400
|
-
|
1427
|
+
.menu ul {
|
1428
|
+
list-style: none;
|
1429
|
+
margin: 0;
|
1430
|
+
padding: 0;
|
1431
|
+
}
|
1432
|
+
|
1433
|
+
.menu li {
|
1434
|
+
padding: 8px 16px;
|
1435
|
+
padding: var(--spacing-small) var(--spacing-large);
|
1436
|
+
}
|
1437
|
+
|
1438
|
+
.menu li a {
|
1439
|
+
-webkit-text-decoration: none;
|
1440
|
+
text-decoration: none;
|
1441
|
+
color: #FFFFFF;
|
1442
|
+
display: block;
|
1401
1443
|
width: 100%;
|
1402
|
-
|
1403
|
-
background-repeat: no-repeat;
|
1404
|
-
background-position: center;
|
1405
|
-
background-size: contain;
|
1444
|
+
font-weight: 600;
|
1406
1445
|
}
|
1407
1446
|
|
1408
1447
|
.hero {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../src/react/header.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
1
|
+
{"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../src/react/header.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAIxC,MAAM,MAAM,WAAW,GAAG;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAgDxC,CAAC"}
|
package/dist/react/header.js
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
+
import { useState } from 'react';
|
2
3
|
import clsx from 'clsx';
|
3
4
|
import { Button } from './button.js';
|
4
5
|
export const Header = ({ className }) => {
|
5
|
-
|
6
|
+
const [isMenuOpen, setIsMenuOpen] = useState(false);
|
7
|
+
const toggleMenu = () => {
|
8
|
+
setIsMenuOpen(!isMenuOpen);
|
9
|
+
};
|
10
|
+
return (_jsxs("header", { className: clsx('header', className, { 'menu-open': isMenuOpen }), children: [_jsxs("div", { className: "header-content", children: [_jsx("svg", { onClick: toggleMenu, width: "24", height: "19", viewBox: "0 0 24 19", fill: "none", xmlns: "http://www.w3.org/2000/svg", style: { cursor: 'pointer' }, children: _jsx("path", { d: "M24 9.5C24 9.76522 23.8946 10.0196 23.7071 10.2071C23.5196 10.3946 23.2652 10.5 23 10.5H1C0.734784 10.5 0.48043 10.3946 0.292893 10.2071C0.105357 10.0196 0 9.76522 0 9.5C0 9.23478 0.105357 8.98043 0.292893 8.79289C0.48043 8.60536 0.734784 8.5 1 8.5H23C23.2652 8.5 23.5196 8.60536 23.7071 8.79289C23.8946 8.98043 24 9.23478 24 9.5ZM1 2.5H23C23.2652 2.5 23.5196 2.39464 23.7071 2.20711C23.8946 2.01957 24 1.76522 24 1.5C24 1.23478 23.8946 0.98043 23.7071 0.792893C23.5196 0.605357 23.2652 0.5 23 0.5H1C0.734784 0.5 0.48043 0.605357 0.292893 0.792893C0.105357 0.98043 0 1.23478 0 1.5C0 1.76522 0.105357 2.01957 0.292893 2.20711C0.48043 2.39464 0.734784 2.5 1 2.5ZM23 16.5H1C0.734784 16.5 0.48043 16.6054 0.292893 16.7929C0.105357 16.9804 0 17.2348 0 17.5C0 17.7652 0.105357 18.0196 0.292893 18.2071C0.48043 18.3946 0.734784 18.5 1 18.5H23C23.2652 18.5 23.5196 18.3946 23.7071 18.2071C23.8946 18.0196 24 17.7652 24 17.5C24 17.2348 23.8946 16.9804 23.7071 16.7929C23.5196 16.6054 23.2652 16.5 23 16.5Z", fill: "white" }) }), _jsx("div", { className: "logo" }), _jsx(Button, { type: "outlined", size: "medium", label: "Login" })] }), _jsx("div", { className: clsx('menu', { open: isMenuOpen }), children: _jsxs("ul", { children: [_jsx("li", { children: _jsx("a", { href: "#home", children: "Home" }) }), _jsx("li", { children: _jsx("a", { href: "#about", children: "About" }) }), _jsx("li", { children: _jsx("a", { href: "#services", children: "Services" }) }), _jsx("li", { children: _jsx("a", { href: "#contact", children: "Contact" }) })] }) })] }));
|
6
11
|
};
|
7
12
|
//# sourceMappingURL=header.js.map
|
package/dist/react/header.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"header.js","sourceRoot":"","sources":["../../src/react/header.tsx"],"names":[],"mappings":";
|
1
|
+
{"version":3,"file":"header.js","sourceRoot":"","sources":["../../src/react/header.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAMrC,MAAM,CAAC,MAAM,MAAM,GAA0B,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE;IAC7D,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAEpD,MAAM,UAAU,GAAG,GAAG,EAAE;QACtB,aAAa,CAAC,CAAC,UAAU,CAAC,CAAC;IAC7B,CAAC,CAAC;IAEF,OAAO,CACL,kBAAQ,SAAS,EAAE,IAAI,CAAC,QAAQ,EAAE,SAAS,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC,aACvE,eAAK,SAAS,EAAC,gBAAgB,aAC7B,cACE,OAAO,EAAE,UAAU,EACnB,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B,EAClC,KAAK,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,YAE5B,eACE,CAAC,EAAC,s+BAAs+B,EACx+B,IAAI,EAAC,OAAO,GACZ,GACE,EAEN,cAAK,SAAS,EAAC,MAAM,GAAG,EAExB,KAAC,MAAM,IAAC,IAAI,EAAC,UAAU,EAAC,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAC,OAAO,GAAG,IAClD,EAEN,cAAK,SAAS,EAAE,IAAI,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,YAChD,yBACE,uBACE,YAAG,IAAI,EAAC,OAAO,qBAAS,GACrB,EACL,uBACE,YAAG,IAAI,EAAC,QAAQ,sBAAU,GACvB,EACL,uBACE,YAAG,IAAI,EAAC,WAAW,yBAAa,GAC7B,EACL,uBACE,YAAG,IAAI,EAAC,UAAU,wBAAY,GAC3B,IACF,GACD,IACC,CACV,CAAC;AACJ,CAAC,CAAC"}
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@knapsack/sandbox-components",
|
3
3
|
"description": "",
|
4
|
-
"version": "4.67.3
|
4
|
+
"version": "4.67.3",
|
5
5
|
"type": "module",
|
6
6
|
"exports": {
|
7
7
|
"./css": "./dist/css/ks-sandbox-styles.css",
|
@@ -37,11 +37,11 @@
|
|
37
37
|
"vue": "^3.4.27"
|
38
38
|
},
|
39
39
|
"devDependencies": {
|
40
|
-
"@knapsack/eslint-config-starter": "4.67.3
|
41
|
-
"@knapsack/postcss-config-starter": "4.67.3
|
42
|
-
"@knapsack/prettier-config": "4.67.3
|
43
|
-
"@knapsack/sandbox-tokens": "4.67.3
|
44
|
-
"@knapsack/typescript-config-starter": "4.67.3
|
40
|
+
"@knapsack/eslint-config-starter": "4.67.3",
|
41
|
+
"@knapsack/postcss-config-starter": "4.67.3",
|
42
|
+
"@knapsack/prettier-config": "4.67.3",
|
43
|
+
"@knapsack/sandbox-tokens": "4.67.3",
|
44
|
+
"@knapsack/typescript-config-starter": "4.67.3",
|
45
45
|
"@types/node": "^20.12.12",
|
46
46
|
"@types/react": "^18.3.3",
|
47
47
|
"eslint": "^8.57.0",
|
@@ -59,5 +59,5 @@
|
|
59
59
|
"directory": "apps/ui/libs/sandbox-components",
|
60
60
|
"type": "git"
|
61
61
|
},
|
62
|
-
"gitHead": "
|
62
|
+
"gitHead": "78feeb1a9a2b72b3572e0f684604e6cda8402743"
|
63
63
|
}
|
package/src/css/header.css
CHANGED
@@ -1,8 +1,19 @@
|
|
1
1
|
.header {
|
2
2
|
background-color: var(--brand-color);
|
3
|
-
padding
|
4
|
-
|
5
|
-
|
3
|
+
padding: var(--spacing-small) var(--spacing-large);
|
4
|
+
width: 100%;
|
5
|
+
position: relative;
|
6
|
+
height: 60px;
|
7
|
+
z-index: 10;
|
8
|
+
}
|
9
|
+
|
10
|
+
.logo {
|
11
|
+
background-image: var(--brand-logo);
|
12
|
+
width: 100%;
|
13
|
+
height: 28px;
|
14
|
+
background-repeat: no-repeat;
|
15
|
+
background-position: center;
|
16
|
+
background-size: contain;
|
6
17
|
}
|
7
18
|
|
8
19
|
.header-content {
|
@@ -10,18 +21,47 @@
|
|
10
21
|
align-items: center;
|
11
22
|
justify-content: space-between;
|
12
23
|
width: 100%;
|
24
|
+
height: 100%;
|
25
|
+
z-index: 15;
|
26
|
+
position: relative;
|
13
27
|
}
|
14
28
|
|
15
|
-
.menu
|
16
|
-
|
29
|
+
.menu {
|
30
|
+
position: absolute;
|
31
|
+
top: 60px;
|
32
|
+
left: 0;
|
33
|
+
width: 100%;
|
34
|
+
max-height: 300px;
|
35
|
+
background-color: var(--brand-color);
|
36
|
+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
37
|
+
padding: var(--spacing-medium) 0;
|
38
|
+
z-index: 5;
|
39
|
+
transform: translateY(-100%);
|
40
|
+
transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
|
41
|
+
opacity: 0;
|
42
|
+
visibility: hidden;
|
17
43
|
}
|
18
44
|
|
19
|
-
.
|
20
|
-
|
21
|
-
|
45
|
+
.menu.open {
|
46
|
+
transform: translateY(0);
|
47
|
+
opacity: 1;
|
48
|
+
visibility: visible;
|
49
|
+
}
|
50
|
+
|
51
|
+
.menu ul {
|
52
|
+
list-style: none;
|
53
|
+
margin: 0;
|
54
|
+
padding: 0;
|
55
|
+
}
|
56
|
+
|
57
|
+
.menu li {
|
58
|
+
padding: var(--spacing-small) var(--spacing-large);
|
59
|
+
}
|
60
|
+
|
61
|
+
.menu li a {
|
62
|
+
text-decoration: none;
|
63
|
+
color: #FFFFFF;
|
64
|
+
display: block;
|
22
65
|
width: 100%;
|
23
|
-
|
24
|
-
background-repeat: no-repeat;
|
25
|
-
background-position: center;
|
26
|
-
background-size: contain;
|
66
|
+
font-weight: 600;
|
27
67
|
}
|
package/src/react/header.tsx
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import React from 'react';
|
1
|
+
import React, { useState } from 'react';
|
2
2
|
import clsx from 'clsx';
|
3
3
|
import { Button } from './button.js';
|
4
4
|
|
@@ -7,15 +7,23 @@ export type HeaderProps = {
|
|
7
7
|
};
|
8
8
|
|
9
9
|
export const Header: React.FC<HeaderProps> = ({ className }) => {
|
10
|
+
const [isMenuOpen, setIsMenuOpen] = useState(false);
|
11
|
+
|
12
|
+
const toggleMenu = () => {
|
13
|
+
setIsMenuOpen(!isMenuOpen);
|
14
|
+
};
|
15
|
+
|
10
16
|
return (
|
11
|
-
<header className={clsx('header', className)}>
|
17
|
+
<header className={clsx('header', className, { 'menu-open': isMenuOpen })}>
|
12
18
|
<div className="header-content">
|
13
19
|
<svg
|
20
|
+
onClick={toggleMenu}
|
14
21
|
width="24"
|
15
22
|
height="19"
|
16
23
|
viewBox="0 0 24 19"
|
17
24
|
fill="none"
|
18
25
|
xmlns="http://www.w3.org/2000/svg"
|
26
|
+
style={{ cursor: 'pointer' }}
|
19
27
|
>
|
20
28
|
<path
|
21
29
|
d="M24 9.5C24 9.76522 23.8946 10.0196 23.7071 10.2071C23.5196 10.3946 23.2652 10.5 23 10.5H1C0.734784 10.5 0.48043 10.3946 0.292893 10.2071C0.105357 10.0196 0 9.76522 0 9.5C0 9.23478 0.105357 8.98043 0.292893 8.79289C0.48043 8.60536 0.734784 8.5 1 8.5H23C23.2652 8.5 23.5196 8.60536 23.7071 8.79289C23.8946 8.98043 24 9.23478 24 9.5ZM1 2.5H23C23.2652 2.5 23.5196 2.39464 23.7071 2.20711C23.8946 2.01957 24 1.76522 24 1.5C24 1.23478 23.8946 0.98043 23.7071 0.792893C23.5196 0.605357 23.2652 0.5 23 0.5H1C0.734784 0.5 0.48043 0.605357 0.292893 0.792893C0.105357 0.98043 0 1.23478 0 1.5C0 1.76522 0.105357 2.01957 0.292893 2.20711C0.48043 2.39464 0.734784 2.5 1 2.5ZM23 16.5H1C0.734784 16.5 0.48043 16.6054 0.292893 16.7929C0.105357 16.9804 0 17.2348 0 17.5C0 17.7652 0.105357 18.0196 0.292893 18.2071C0.48043 18.3946 0.734784 18.5 1 18.5H23C23.2652 18.5 23.5196 18.3946 23.7071 18.2071C23.8946 18.0196 24 17.7652 24 17.5C24 17.2348 23.8946 16.9804 23.7071 16.7929C23.5196 16.6054 23.2652 16.5 23 16.5Z"
|
@@ -27,6 +35,23 @@ export const Header: React.FC<HeaderProps> = ({ className }) => {
|
|
27
35
|
|
28
36
|
<Button type="outlined" size="medium" label="Login" />
|
29
37
|
</div>
|
38
|
+
|
39
|
+
<div className={clsx('menu', { open: isMenuOpen })}>
|
40
|
+
<ul>
|
41
|
+
<li>
|
42
|
+
<a href="#home">Home</a>
|
43
|
+
</li>
|
44
|
+
<li>
|
45
|
+
<a href="#about">About</a>
|
46
|
+
</li>
|
47
|
+
<li>
|
48
|
+
<a href="#services">Services</a>
|
49
|
+
</li>
|
50
|
+
<li>
|
51
|
+
<a href="#contact">Contact</a>
|
52
|
+
</li>
|
53
|
+
</ul>
|
54
|
+
</div>
|
30
55
|
</header>
|
31
56
|
);
|
32
57
|
};
|