@knapsack/sandbox-components 4.67.2--canary.4448.804aa44.0 → 4.67.3--canary.4456.c140a9e.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/css/ks-sandbox-styles.css +48 -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 +43 -12
- package/src/react/header.tsx +27 -2
@@ -1372,15 +1372,12 @@ 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
|
-
padding-left: var(--spacing-large);
|
1382
|
-
padding-right: var(--spacing-large);
|
1383
|
-
width: 100vw;
|
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;
|
1384
1381
|
}
|
1385
1382
|
|
1386
1383
|
.header-content {
|
@@ -1388,21 +1385,53 @@ body {
|
|
1388
1385
|
align-items: center;
|
1389
1386
|
justify-content: space-between;
|
1390
1387
|
width: 100%;
|
1388
|
+
height: 100%;
|
1389
|
+
z-index: 15;
|
1390
|
+
position: relative;
|
1391
|
+
}
|
1392
|
+
|
1393
|
+
.menu {
|
1394
|
+
position: absolute;
|
1395
|
+
top: 60px;
|
1396
|
+
left: 0;
|
1397
|
+
width: 100%;
|
1398
|
+
max-height: 300px;
|
1399
|
+
background-color: #7a34ed;
|
1400
|
+
background-color: var(--brand-color);
|
1401
|
+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
1402
|
+
padding: 12px 0;
|
1403
|
+
padding: var(--spacing-medium) 0;
|
1404
|
+
z-index: 5;
|
1405
|
+
transform: translateY(-100%);
|
1406
|
+
transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
|
1407
|
+
opacity: 0;
|
1408
|
+
visibility: hidden;
|
1409
|
+
}
|
1410
|
+
|
1411
|
+
.menu.open {
|
1412
|
+
transform: translateY(0);
|
1413
|
+
opacity: 1;
|
1414
|
+
visibility: visible;
|
1391
1415
|
}
|
1392
1416
|
|
1393
|
-
.menu
|
1394
|
-
|
1395
|
-
margin
|
1417
|
+
.menu ul {
|
1418
|
+
list-style: none;
|
1419
|
+
margin: 0;
|
1420
|
+
padding: 0;
|
1396
1421
|
}
|
1397
1422
|
|
1398
|
-
.
|
1399
|
-
|
1400
|
-
|
1423
|
+
.menu li {
|
1424
|
+
padding: 8px 16px;
|
1425
|
+
padding: var(--spacing-small) var(--spacing-large);
|
1426
|
+
}
|
1427
|
+
|
1428
|
+
.menu li a {
|
1429
|
+
-webkit-text-decoration: none;
|
1430
|
+
text-decoration: none;
|
1431
|
+
color: #FFFFFF;
|
1432
|
+
display: block;
|
1401
1433
|
width: 100%;
|
1402
|
-
|
1403
|
-
background-repeat: no-repeat;
|
1404
|
-
background-position: center;
|
1405
|
-
background-size: contain;
|
1434
|
+
font-weight: 600;
|
1406
1435
|
}
|
1407
1436
|
|
1408
1437
|
.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.
|
4
|
+
"version": "4.67.3--canary.4456.c140a9e.0",
|
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.
|
41
|
-
"@knapsack/postcss-config-starter": "4.67.
|
42
|
-
"@knapsack/prettier-config": "4.67.
|
43
|
-
"@knapsack/sandbox-tokens": "4.67.
|
44
|
-
"@knapsack/typescript-config-starter": "4.67.
|
40
|
+
"@knapsack/eslint-config-starter": "4.67.3--canary.4456.c140a9e.0",
|
41
|
+
"@knapsack/postcss-config-starter": "4.67.3--canary.4456.c140a9e.0",
|
42
|
+
"@knapsack/prettier-config": "4.67.3--canary.4456.c140a9e.0",
|
43
|
+
"@knapsack/sandbox-tokens": "4.67.3--canary.4456.c140a9e.0",
|
44
|
+
"@knapsack/typescript-config-starter": "4.67.3--canary.4456.c140a9e.0",
|
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": "c140a9e038163d94e04cd46765dd63eddb29a23b"
|
63
63
|
}
|
package/src/css/header.css
CHANGED
@@ -1,8 +1,10 @@
|
|
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;
|
6
8
|
}
|
7
9
|
|
8
10
|
.header-content {
|
@@ -10,18 +12,47 @@
|
|
10
12
|
align-items: center;
|
11
13
|
justify-content: space-between;
|
12
14
|
width: 100%;
|
15
|
+
height: 100%;
|
16
|
+
z-index: 15;
|
17
|
+
position: relative;
|
18
|
+
}
|
19
|
+
|
20
|
+
.menu {
|
21
|
+
position: absolute;
|
22
|
+
top: 60px;
|
23
|
+
left: 0;
|
24
|
+
width: 100%;
|
25
|
+
max-height: 300px;
|
26
|
+
background-color: var(--brand-color);
|
27
|
+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
28
|
+
padding: var(--spacing-medium) 0;
|
29
|
+
z-index: 5;
|
30
|
+
transform: translateY(-100%);
|
31
|
+
transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
|
32
|
+
opacity: 0;
|
33
|
+
visibility: hidden;
|
34
|
+
}
|
35
|
+
|
36
|
+
.menu.open {
|
37
|
+
transform: translateY(0);
|
38
|
+
opacity: 1;
|
39
|
+
visibility: visible;
|
40
|
+
}
|
41
|
+
|
42
|
+
.menu ul {
|
43
|
+
list-style: none;
|
44
|
+
margin: 0;
|
45
|
+
padding: 0;
|
13
46
|
}
|
14
47
|
|
15
|
-
.menu
|
16
|
-
|
48
|
+
.menu li {
|
49
|
+
padding: var(--spacing-small) var(--spacing-large);
|
17
50
|
}
|
18
51
|
|
19
|
-
.
|
20
|
-
|
21
|
-
|
52
|
+
.menu li a {
|
53
|
+
text-decoration: none;
|
54
|
+
color: #FFFFFF;
|
55
|
+
display: block;
|
22
56
|
width: 100%;
|
23
|
-
|
24
|
-
background-repeat: no-repeat;
|
25
|
-
background-position: center;
|
26
|
-
background-size: contain;
|
57
|
+
font-weight: 600;
|
27
58
|
}
|
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
|
};
|