@cashub/ui 0.27.1 → 0.29.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/assets/css/global.css +0 -1
- package/assets/icons/burger-black.png +0 -0
- package/assets/icons/burger-white.png +0 -0
- package/assets/images/bg-aside.png +0 -0
- package/index.js +24 -0
- package/layout/Aside.js +23 -0
- package/layout/AsideHeader.jsx +27 -0
- package/layout/Backdrop.js +19 -0
- package/layout/Container.js +22 -0
- package/layout/Footer.js +26 -0
- package/layout/Header.jsx +55 -0
- package/layout/Layout.jsx +80 -0
- package/layout/Logo.jsx +17 -0
- package/layout/MenuIcon.jsx +27 -0
- package/layout/Sidebar.jsx +229 -0
- package/layout/index.js +13 -0
- package/package.json +2 -1
- package/page/Disclaimer.js +12 -0
- package/page/index.js +13 -0
- package/styles/GlobalStyle.js +2 -6
- package/assets/css/normalize.css +0 -386
package/assets/css/global.css
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/index.js
CHANGED
|
@@ -295,6 +295,18 @@ Object.keys(_jsoneditor).forEach(function (key) {
|
|
|
295
295
|
}
|
|
296
296
|
});
|
|
297
297
|
});
|
|
298
|
+
var _layout = require("./layout");
|
|
299
|
+
Object.keys(_layout).forEach(function (key) {
|
|
300
|
+
if (key === "default" || key === "__esModule") return;
|
|
301
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
302
|
+
if (key in exports && exports[key] === _layout[key]) return;
|
|
303
|
+
Object.defineProperty(exports, key, {
|
|
304
|
+
enumerable: true,
|
|
305
|
+
get: function () {
|
|
306
|
+
return _layout[key];
|
|
307
|
+
}
|
|
308
|
+
});
|
|
309
|
+
});
|
|
298
310
|
var _link = require("./link");
|
|
299
311
|
Object.keys(_link).forEach(function (key) {
|
|
300
312
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -331,6 +343,18 @@ Object.keys(_modal).forEach(function (key) {
|
|
|
331
343
|
}
|
|
332
344
|
});
|
|
333
345
|
});
|
|
346
|
+
var _page = require("./page");
|
|
347
|
+
Object.keys(_page).forEach(function (key) {
|
|
348
|
+
if (key === "default" || key === "__esModule") return;
|
|
349
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
350
|
+
if (key in exports && exports[key] === _page[key]) return;
|
|
351
|
+
Object.defineProperty(exports, key, {
|
|
352
|
+
enumerable: true,
|
|
353
|
+
get: function () {
|
|
354
|
+
return _page[key];
|
|
355
|
+
}
|
|
356
|
+
});
|
|
357
|
+
});
|
|
334
358
|
var _paginate = require("./paginate");
|
|
335
359
|
Object.keys(_paginate).forEach(function (key) {
|
|
336
360
|
if (key === "default" || key === "__esModule") return;
|
package/layout/Aside.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
8
|
+
var _header = _interopRequireDefault(require("../styles/config/header.style"));
|
|
9
|
+
var _sidebar = _interopRequireDefault(require("../styles/config/sidebar.style"));
|
|
10
|
+
var _media = _interopRequireDefault(require("../styles/mixin/media"));
|
|
11
|
+
var _bgAside = _interopRequireDefault(require("../assets/images/bg-aside.png"));
|
|
12
|
+
var _templateObject, _templateObject2, _templateObject3;
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
15
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
16
|
+
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
17
|
+
const Aside = _styledComponents.default.aside(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: ", ";\n\n padding-top: var(--spacing-s);\n height: calc(100vh - ", " - var(--spacing));\n background: url(", "), var(--color-background2);\n background-size: 356px 436px;\n background-repeat: no-repeat;\n background-position: bottom;\n border-top-right-radius: var(--border-radius);\n position: fixed;\n top: calc(", " + var(--spacing));\n transition: width 0.2s;\n z-index: 60;\n\n ", ";\n"])), _ref => {
|
|
18
|
+
let {
|
|
19
|
+
$display
|
|
20
|
+
} = _ref;
|
|
21
|
+
return $display ? "".concat(_sidebar.default.open.width) : "".concat(_sidebar.default.close.width);
|
|
22
|
+
}, _header.default.height, _bgAside.default, _header.default.height, _media.default.tablet(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n height: 100%;\n top: 0;\n padding-top:0;\n border-top-right-radius:0;\n left: 0;\n box-shadow: var(--box-shadow);\n \n ", "\n "])), props => props.$display === false && (0, _styledComponents.css)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n left: -", ";\n "])), _sidebar.default.open.width)));
|
|
23
|
+
var _default = exports.default = Aside;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import headerStyle from '../styles/config/header.style';
|
|
3
|
+
import media from '../styles/mixin/media';
|
|
4
|
+
import Logo from './Logo';
|
|
5
|
+
import MenuIcon from './MenuIcon';
|
|
6
|
+
|
|
7
|
+
const AsideHeader = ({ theme, toggleSidebar }) => {
|
|
8
|
+
return (
|
|
9
|
+
<Brand>
|
|
10
|
+
<MenuIcon theme={theme} toggleSidebar={toggleSidebar} />
|
|
11
|
+
<Logo />
|
|
12
|
+
</Brand>
|
|
13
|
+
);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const Brand = styled.div`
|
|
17
|
+
display: none;
|
|
18
|
+
height: ${headerStyle.height};
|
|
19
|
+
|
|
20
|
+
${media.tablet`
|
|
21
|
+
padding: 0 var(--spacing-xs);
|
|
22
|
+
align-items: center;
|
|
23
|
+
display: flex
|
|
24
|
+
`};
|
|
25
|
+
`;
|
|
26
|
+
|
|
27
|
+
export default AsideHeader;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
8
|
+
var _backdrop = require("../backdrop");
|
|
9
|
+
var _media = _interopRequireDefault(require("../styles/mixin/media"));
|
|
10
|
+
var _templateObject, _templateObject2;
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
13
|
+
const Backdrop = (0, _styledComponents.default)(_backdrop.BaseBackdrop)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n visibility: hidden;\n\n ", "\n"])), _media.default.tablet(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n visibility: ", ";\n "])), _ref => {
|
|
14
|
+
let {
|
|
15
|
+
$display
|
|
16
|
+
} = _ref;
|
|
17
|
+
return $display === true ? 'visible' : 'hidden';
|
|
18
|
+
}));
|
|
19
|
+
var _default = exports.default = Backdrop;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
8
|
+
var _header = _interopRequireDefault(require("../styles/config/header.style"));
|
|
9
|
+
var _sidebar = _interopRequireDefault(require("../styles/config/sidebar.style"));
|
|
10
|
+
var _media = _interopRequireDefault(require("../styles/mixin/media"));
|
|
11
|
+
var _templateObject, _templateObject2, _templateObject3;
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
14
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
15
|
+
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
16
|
+
const Container = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n transition: 0.3s;\n width: calc(100% - ", ");\n margin-left: ", ";\n padding: calc(", " + var(--spacing)) var(--spacing)\n var(--spacing);\n\n ", "\n\n ", "\n"])), _sidebar.default.close.width, _sidebar.default.close.width, _header.default.height, _ref => {
|
|
17
|
+
let {
|
|
18
|
+
$display
|
|
19
|
+
} = _ref;
|
|
20
|
+
return $display === true && (0, _styledComponents.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n width: calc(100% - ", ");\n margin-left: ", ";\n "])), _sidebar.default.open.width, _sidebar.default.open.width);
|
|
21
|
+
}, _media.default.tablet(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n width: 100%;\n margin-left: 0;\n "]))));
|
|
22
|
+
var _default = exports.default = Container;
|
package/layout/Footer.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
8
|
+
var _sidebar = _interopRequireDefault(require("../styles/config/sidebar.style"));
|
|
9
|
+
var _media = _interopRequireDefault(require("../styles/mixin/media"));
|
|
10
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
13
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
|
+
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
15
|
+
const Footer = _styledComponents.default.footer(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n transition: 0.3s;\n border-top: var(--border-width) solid var(--border-color);\n color: var(--font-on-mute);\n height: 64px;\n line-height: 64px;\n font-size: var(--font-body2);\n padding: 0 var(--spacing);\n\n ", "\n\n ", "\n"])), _ref => {
|
|
16
|
+
let {
|
|
17
|
+
hasSidebar
|
|
18
|
+
} = _ref;
|
|
19
|
+
return hasSidebar === true && (0, _styledComponents.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n margin: 0 var(--spacing) 0 calc(var(--spacing) + ", ");\n\n ", "\n "])), _sidebar.default.close.width, _media.default.tablet(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n margin:0 ;\n "]))));
|
|
20
|
+
}, _ref2 => {
|
|
21
|
+
let {
|
|
22
|
+
$display
|
|
23
|
+
} = _ref2;
|
|
24
|
+
return $display && (0, _styledComponents.css)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n margin: 0 var(--spacing) 0\n calc(var(--spacing) + ", ");\n "])), _sidebar.default.open.width);
|
|
25
|
+
});
|
|
26
|
+
var _default = exports.default = Footer;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import headerStyle from '../styles/config/header.style';
|
|
3
|
+
import media from '../styles/mixin/media';
|
|
4
|
+
import MenuIcon from './MenuIcon';
|
|
5
|
+
import Logo from './Logo';
|
|
6
|
+
|
|
7
|
+
const Header = ({ theme, logo, hasSidebar, toggleSidebar, children }) => {
|
|
8
|
+
return (
|
|
9
|
+
<>
|
|
10
|
+
<Wrapper>
|
|
11
|
+
<Brand>
|
|
12
|
+
{hasSidebar && (
|
|
13
|
+
<MenuIcon theme={theme} toggleSidebar={toggleSidebar} />
|
|
14
|
+
)}
|
|
15
|
+
{logo && <Logo src={logo} />}
|
|
16
|
+
</Brand>
|
|
17
|
+
<Topbar>{children}</Topbar>
|
|
18
|
+
</Wrapper>
|
|
19
|
+
</>
|
|
20
|
+
);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const Wrapper = styled.header`
|
|
24
|
+
background: var(--color-background2);
|
|
25
|
+
display: flex;
|
|
26
|
+
justify-content: space-between;
|
|
27
|
+
align-items: center;
|
|
28
|
+
position: fixed;
|
|
29
|
+
z-index: 40;
|
|
30
|
+
width: 100%;
|
|
31
|
+
height: ${headerStyle.height};
|
|
32
|
+
padding: 0 calc(var(--spacing-s) + 0.25rem) 0 var(--spacing-s);
|
|
33
|
+
|
|
34
|
+
${media.tablet`
|
|
35
|
+
padding: 0 var(--spacing-s) 0 calc(var(--spacing-s) - 0.25rem);
|
|
36
|
+
`}
|
|
37
|
+
`;
|
|
38
|
+
|
|
39
|
+
const Brand = styled.div`
|
|
40
|
+
display: flex;
|
|
41
|
+
|
|
42
|
+
> * {
|
|
43
|
+
flex: none;
|
|
44
|
+
}
|
|
45
|
+
`;
|
|
46
|
+
|
|
47
|
+
const Topbar = styled.div`
|
|
48
|
+
display: flex;
|
|
49
|
+
|
|
50
|
+
> *:not(:last-child) {
|
|
51
|
+
margin-right: calc(var(--spacing) - 0.5rem);
|
|
52
|
+
}
|
|
53
|
+
`;
|
|
54
|
+
|
|
55
|
+
export default Header;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import { ScrollToTopButton } from '../button';
|
|
4
|
+
import Header from './Header';
|
|
5
|
+
import Container from './Container';
|
|
6
|
+
import Footer from './Footer';
|
|
7
|
+
import Sidebar from './Sidebar';
|
|
8
|
+
import Backdrop from './Backdrop';
|
|
9
|
+
|
|
10
|
+
const Layout = ({
|
|
11
|
+
mode,
|
|
12
|
+
theme,
|
|
13
|
+
logo,
|
|
14
|
+
headerContent,
|
|
15
|
+
navContent,
|
|
16
|
+
footerContent,
|
|
17
|
+
children,
|
|
18
|
+
}) => {
|
|
19
|
+
const [display, setDisplay] = useState(!!navContent);
|
|
20
|
+
|
|
21
|
+
const toggleSidebar = () => {
|
|
22
|
+
setDisplay(!display);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
// hide sidebar
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
if (mode === 'tablet') {
|
|
28
|
+
setDisplay(false);
|
|
29
|
+
}
|
|
30
|
+
}, [mode, setDisplay]);
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<Wrapper>
|
|
34
|
+
<Header
|
|
35
|
+
theme={theme}
|
|
36
|
+
logo={logo}
|
|
37
|
+
hasSidebar={!!navContent}
|
|
38
|
+
toggleSidebar={toggleSidebar}
|
|
39
|
+
>
|
|
40
|
+
{headerContent}
|
|
41
|
+
</Header>
|
|
42
|
+
|
|
43
|
+
<Main>
|
|
44
|
+
<Backdrop $display={display} onClick={toggleSidebar} />
|
|
45
|
+
|
|
46
|
+
{navContent && (
|
|
47
|
+
<Sidebar
|
|
48
|
+
theme={theme}
|
|
49
|
+
$display={display}
|
|
50
|
+
toggleSidebar={toggleSidebar}
|
|
51
|
+
>
|
|
52
|
+
{navContent}
|
|
53
|
+
</Sidebar>
|
|
54
|
+
)}
|
|
55
|
+
|
|
56
|
+
<Container $display={display}>{children}</Container>
|
|
57
|
+
|
|
58
|
+
<ScrollToTopButton />
|
|
59
|
+
</Main>
|
|
60
|
+
|
|
61
|
+
<Footer hasSidebar={!!navContent} $display={display}>
|
|
62
|
+
{footerContent}
|
|
63
|
+
</Footer>
|
|
64
|
+
</Wrapper>
|
|
65
|
+
);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const Wrapper = styled.div`
|
|
69
|
+
display: flex;
|
|
70
|
+
flex-direction: column;
|
|
71
|
+
min-height: 100vh;
|
|
72
|
+
`;
|
|
73
|
+
|
|
74
|
+
const Main = styled.div`
|
|
75
|
+
display: flex;
|
|
76
|
+
flex: 1;
|
|
77
|
+
position: relative;
|
|
78
|
+
`;
|
|
79
|
+
|
|
80
|
+
export default Layout;
|
package/layout/Logo.jsx
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import { ImageFluid } from '../image';
|
|
3
|
+
|
|
4
|
+
const Logo = ({ src }) => {
|
|
5
|
+
return (
|
|
6
|
+
<Figure>
|
|
7
|
+
<ImageFluid src={src} alt='CasHUB logo' />
|
|
8
|
+
</Figure>
|
|
9
|
+
);
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const Figure = styled.figure`
|
|
13
|
+
max-width: 220px;
|
|
14
|
+
height: 40px;
|
|
15
|
+
`;
|
|
16
|
+
|
|
17
|
+
export default Logo;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import { ImageFluid } from '../image';
|
|
3
|
+
import { IconFigure } from '../figure';
|
|
4
|
+
import { IconButton } from '../button';
|
|
5
|
+
import burgerWhite from '../assets/icons/burger-white.png';
|
|
6
|
+
import burgerBlack from '../assets/icons/burger-black.png';
|
|
7
|
+
|
|
8
|
+
const MenuIcon = ({ theme, toggleSidebar }) => {
|
|
9
|
+
return (
|
|
10
|
+
<Wrapper onClick={toggleSidebar}>
|
|
11
|
+
<IconFigure>
|
|
12
|
+
<ImageFluid
|
|
13
|
+
crossOrigin='anonymous'
|
|
14
|
+
src={theme === 'Dark' ? burgerWhite : burgerBlack}
|
|
15
|
+
alt='Sidebar toggler'
|
|
16
|
+
/>
|
|
17
|
+
</IconFigure>
|
|
18
|
+
</Wrapper>
|
|
19
|
+
);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const Wrapper = styled(IconButton)`
|
|
23
|
+
margin: 0;
|
|
24
|
+
margin-right: calc(var(--spacing) - 0.5rem);
|
|
25
|
+
`;
|
|
26
|
+
|
|
27
|
+
export default MenuIcon;
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import { useEffect, useState, useRef } from 'react';
|
|
2
|
+
import { FaCaretRight } from 'react-icons/fa';
|
|
3
|
+
import { Link, useLocation } from 'react-router-dom';
|
|
4
|
+
import { useTranslation } from 'react-i18next';
|
|
5
|
+
import styled, { css } from 'styled-components';
|
|
6
|
+
import headerStyle from '../styles/config/header.style';
|
|
7
|
+
import media from '../styles/mixin/media';
|
|
8
|
+
import scrollbar from '../styles/mixin/scrollbar';
|
|
9
|
+
import Aside from './Aside';
|
|
10
|
+
import AsideHeader from './AsideHeader';
|
|
11
|
+
|
|
12
|
+
const Sidebar = ({ theme, $display, toggleSidebar, children }) => {
|
|
13
|
+
const location = useLocation();
|
|
14
|
+
const sidebarRef = useRef(null);
|
|
15
|
+
const [hoverDisplay, setHoverDisplay] = useState(false);
|
|
16
|
+
|
|
17
|
+
const nowPath = (path) => {
|
|
18
|
+
return location.pathname.includes(path);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const handleMouseOver = () => {
|
|
22
|
+
if ($display === true) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
setHoverDisplay(true);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const handleMouseOut = (event) => {
|
|
30
|
+
if ($display === true) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (sidebarRef.current.contains(event.relatedTarget)) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
setHoverDisplay(false);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<>
|
|
43
|
+
<Aside
|
|
44
|
+
ref={sidebarRef}
|
|
45
|
+
$display={$display || hoverDisplay}
|
|
46
|
+
onMouseOver={handleMouseOver}
|
|
47
|
+
onMouseOut={handleMouseOut}
|
|
48
|
+
>
|
|
49
|
+
<AsideHeader theme={theme} toggleSidebar={toggleSidebar} />
|
|
50
|
+
<Menu>
|
|
51
|
+
{children.map((prop, key) => {
|
|
52
|
+
if (prop.parent === true) {
|
|
53
|
+
return (
|
|
54
|
+
<MenuListWithSubMenu
|
|
55
|
+
{...prop}
|
|
56
|
+
active={nowPath(prop.path)}
|
|
57
|
+
currentPath={location.pathname}
|
|
58
|
+
key={key}
|
|
59
|
+
$display={$display}
|
|
60
|
+
hoverDisplay={hoverDisplay}
|
|
61
|
+
/>
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return <MenuList {...prop} active={nowPath(prop.path)} key={key} />;
|
|
66
|
+
})}
|
|
67
|
+
</Menu>
|
|
68
|
+
</Aside>
|
|
69
|
+
</>
|
|
70
|
+
);
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
const MenuList = ({ path, name, icon, active }) => {
|
|
74
|
+
const { t: trans } = useTranslation();
|
|
75
|
+
|
|
76
|
+
return (
|
|
77
|
+
<MenuItem active={active}>
|
|
78
|
+
<MenuItemLink to={path}>
|
|
79
|
+
<img
|
|
80
|
+
crossOrigin='anonymous'
|
|
81
|
+
src={icon}
|
|
82
|
+
alt={`${name} icon`}
|
|
83
|
+
width='24px'
|
|
84
|
+
/>
|
|
85
|
+
<span>{trans(name)}</span>
|
|
86
|
+
</MenuItemLink>
|
|
87
|
+
</MenuItem>
|
|
88
|
+
);
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
const MenuListWithSubMenu = ({
|
|
92
|
+
path,
|
|
93
|
+
name,
|
|
94
|
+
icon,
|
|
95
|
+
child,
|
|
96
|
+
active,
|
|
97
|
+
currentPath,
|
|
98
|
+
$display,
|
|
99
|
+
hoverDisplay,
|
|
100
|
+
}) => {
|
|
101
|
+
const { t: trans } = useTranslation();
|
|
102
|
+
const [open, setOpen] = useState(active);
|
|
103
|
+
|
|
104
|
+
const toggleOpen = () => {
|
|
105
|
+
setOpen(!open);
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
useEffect(() => {
|
|
109
|
+
$display === false && hoverDisplay === false && setOpen(false);
|
|
110
|
+
}, [$display, hoverDisplay]);
|
|
111
|
+
|
|
112
|
+
return (
|
|
113
|
+
<>
|
|
114
|
+
<MenuItem onClick={toggleOpen}>
|
|
115
|
+
<MenuItemButton as='button' open={open}>
|
|
116
|
+
<img crossOrigin='anonymous' src={icon} alt={`${name} icon`} />
|
|
117
|
+
<span>{trans(name)}</span>
|
|
118
|
+
<span className='arrow' role='presentation' aria-hidden='true'>
|
|
119
|
+
<FaCaretRight />
|
|
120
|
+
</span>
|
|
121
|
+
</MenuItemButton>
|
|
122
|
+
</MenuItem>
|
|
123
|
+
<SubMenu open={open}>
|
|
124
|
+
{child
|
|
125
|
+
.filter((prop) => prop.name)
|
|
126
|
+
.map((prop, key) => {
|
|
127
|
+
const href = `${path}${prop.path}`;
|
|
128
|
+
const active = currentPath.includes(prop.path);
|
|
129
|
+
|
|
130
|
+
return (
|
|
131
|
+
<SubMenuItem key={key} active={active}>
|
|
132
|
+
<Link to={href}>
|
|
133
|
+
<span>{trans(prop.name)}</span>
|
|
134
|
+
</Link>
|
|
135
|
+
</SubMenuItem>
|
|
136
|
+
);
|
|
137
|
+
})}
|
|
138
|
+
</SubMenu>
|
|
139
|
+
</>
|
|
140
|
+
);
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
const Menu = styled.ul`
|
|
144
|
+
overflow-y: auto;
|
|
145
|
+
overflow-x: hidden;
|
|
146
|
+
height: 100%;
|
|
147
|
+
|
|
148
|
+
span {
|
|
149
|
+
color: var(--font-on-background);
|
|
150
|
+
font-size: var(--font-body1);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
li {
|
|
154
|
+
transition: 0.3s;
|
|
155
|
+
|
|
156
|
+
&:hover {
|
|
157
|
+
background: var(--color-hover);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
${scrollbar}
|
|
162
|
+
|
|
163
|
+
${media.tablet`
|
|
164
|
+
height: calc(100% - ${headerStyle.height});
|
|
165
|
+
`};
|
|
166
|
+
`;
|
|
167
|
+
|
|
168
|
+
const MenuItem = styled.li`
|
|
169
|
+
${(props) =>
|
|
170
|
+
props.active === true &&
|
|
171
|
+
css`
|
|
172
|
+
background: var(--color-active);
|
|
173
|
+
`};
|
|
174
|
+
`;
|
|
175
|
+
|
|
176
|
+
const MenuItemLink = styled(Link)`
|
|
177
|
+
display: flex;
|
|
178
|
+
align-items: center;
|
|
179
|
+
padding: 0 var(--spacing);
|
|
180
|
+
height: 48px;
|
|
181
|
+
|
|
182
|
+
img {
|
|
183
|
+
width: 24px;
|
|
184
|
+
height: 24px;
|
|
185
|
+
margin-right: var(--spacing);
|
|
186
|
+
flex: 0 0 24px;
|
|
187
|
+
}
|
|
188
|
+
`;
|
|
189
|
+
|
|
190
|
+
const MenuItemButton = styled(MenuItemLink)`
|
|
191
|
+
background-color: transparent;
|
|
192
|
+
border: none;
|
|
193
|
+
cursor: pointer;
|
|
194
|
+
width: 100%;
|
|
195
|
+
|
|
196
|
+
.arrow {
|
|
197
|
+
margin-left: auto;
|
|
198
|
+
color: var(--color-primary);
|
|
199
|
+
|
|
200
|
+
${({ open }) =>
|
|
201
|
+
open === true &&
|
|
202
|
+
css`
|
|
203
|
+
transform: rotate(90deg);
|
|
204
|
+
transition: all 0.4s;
|
|
205
|
+
`};
|
|
206
|
+
}
|
|
207
|
+
`;
|
|
208
|
+
|
|
209
|
+
const SubMenu = styled.ul`
|
|
210
|
+
overflow: hidden;
|
|
211
|
+
height: ${(props) => (props.open === true ? 'auto' : '0px')};
|
|
212
|
+
`;
|
|
213
|
+
|
|
214
|
+
const SubMenuItem = styled.li`
|
|
215
|
+
a {
|
|
216
|
+
display: flex;
|
|
217
|
+
align-items: center;
|
|
218
|
+
padding: 0 calc(var(--spacing) * 2 + 1.5rem);
|
|
219
|
+
height: 48px;
|
|
220
|
+
|
|
221
|
+
${({ active }) =>
|
|
222
|
+
active === true &&
|
|
223
|
+
css`
|
|
224
|
+
background: var(--color-active);
|
|
225
|
+
`};
|
|
226
|
+
}
|
|
227
|
+
`;
|
|
228
|
+
|
|
229
|
+
export default Sidebar;
|
package/layout/index.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "Layout", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _Layout.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _Layout = _interopRequireDefault(require("./Layout"));
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cashub/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.29.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "CasHUB Team",
|
|
6
6
|
"description": "CasHUB UI components library",
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
"leaflet-draw": "^1.0.4",
|
|
27
27
|
"lodash.uniqueid": "^4.0.1",
|
|
28
28
|
"moment": "^2.29.3",
|
|
29
|
+
"normalize.css": "^8.0.1",
|
|
29
30
|
"overlapping-marker-spiderfier": "^1.1.4",
|
|
30
31
|
"qrcode.react": "^3.0.2",
|
|
31
32
|
"rc-time-picker": "^3.7.3",
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
8
|
+
var _templateObject;
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
11
|
+
const Disclaimer = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n border: var(--border-width) solid var(--border-color);\n border-radius: var(--border-radius);\n color: var(--font-on-background);\n padding: var(--spacing);\n\n > article {\n line-height: 1.5;\n\n &:not(:last-child) {\n padding-bottom: var(--spacing-l);\n }\n\n > h2 {\n text-align: center;\n margin-bottom: var(--spacing-l);\n }\n\n > em {\n display: block;\n margin-bottom: var(--spacing-s);\n }\n\n > section {\n margin-bottom: var(--spacing);\n\n > h3 {\n margin-bottom: var(--spacing-xs);\n }\n\n > p {\n margin-bottom: var(--spacing-xs);\n }\n\n ul {\n margin: var(--spacing-s) 0;\n\n li {\n margin: var(--spacing-xs) 0 var(--spacing-xs) var(--spacing-s);\n\n &.disc {\n list-style: disc;\n }\n }\n }\n\n ol {\n padding: 0;\n margin: var(--spacing-xs) 0 var(--spacing-xs) var(--spacing-s);\n\n &.counter-number {\n counter-reset: number;\n }\n\n &.counter-number-alpha {\n counter-reset: number alpha;\n }\n\n &.nested-counter-number {\n counter-reset: nested-number;\n }\n\n &.ml-0 {\n margin-left: 0;\n }\n\n li {\n margin: var(--spacing-s) 0;\n\n &.decimal {\n list-style: decimal;\n }\n\n &.counter-number-increment {\n counter-increment: number;\n }\n\n &.counter-alpha-increment {\n counter-increment: alpha;\n }\n\n &.counter-number {\n display: flex;\n margin: var(--spacing-xs) 0;\n\n &::before {\n margin-right: var(--spacing-xs);\n content: counters(number, '.') ' ';\n }\n }\n\n &.counter-alpha {\n display: flex;\n margin: var(--spacing-xs) 0;\n\n &::before {\n margin-right: var(--spacing-xs);\n content: '(' counter(alpha, upper-alpha) ')';\n }\n }\n\n &.nested-counter-number-increment {\n counter-increment: nested-number;\n }\n\n &.nested-counter-number {\n display: flex;\n margin: var(--spacing-xs) 0;\n\n &::before {\n margin-right: var(--spacing-xs);\n content: counters(number, '.') '.' counters(nested-number, '.');\n }\n }\n }\n }\n }\n }\n"])));
|
|
12
|
+
var _default = exports.default = Disclaimer;
|
package/page/index.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "Disclaimer", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _Disclaimer.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _Disclaimer = _interopRequireDefault(require("./Disclaimer"));
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
package/styles/GlobalStyle.js
CHANGED
|
@@ -5,10 +5,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _styledComponents = require("styled-components");
|
|
8
|
+
require("normalize.css");
|
|
8
9
|
require("../assets/css/global.css");
|
|
9
10
|
var _templateObject;
|
|
10
11
|
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
11
|
-
const GlobalStyle = (0, _styledComponents.createGlobalStyle)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n body {\n --color-white: ", ";\n --color-dark: ", ";\n --color-grey: ", ";\n --color-primary: ", ";\n --color-success: ", ";\n --color-warning: ", ";\n --color-danger: ", ";\n --color-hover: ", ";\n --color-active: ", ";\n --color-scroll-bar: ", ";\n --color-background1: ", ";\n --color-background2: ", ";\n --color-background3: ", ";\n --color-backdrop: ", ";\n\n --font-h1: ", ";\n --font-h2: ", ";\n --font-h3: ", ";\n --font-body1: ", ";\n --font-body2: ", ";\n --font-button: ", ";\n --font-caption: ", ";\n --font-family: ", ";\n --font-normal: ", ";\n --font-bold: ", ";\n --font-on-primary: ", ";\n --font-on-success: ", ";\n --font-on-warning: ", ";\n --font-on-danger: ", ";\n --font-on-background: ", ";\n --font-on-mute: ", ";\n\n --box-shadow: ", ";\n --border-color: ", ";\n --border-width: ", ";\n --border-radius-s: ", ";\n --border-radius: ", ";\n --border-radius-l: ", ";\n --border-radius-round: ", ";\n\n --spacing-xs: ", ";\n --spacing-s: ", ";\n --spacing: ", ";\n --spacing-l: ", ";\n\n background :
|
|
12
|
+
const GlobalStyle = (0, _styledComponents.createGlobalStyle)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n body {\n --color-white: ", ";\n --color-dark: ", ";\n --color-grey: ", ";\n --color-primary: ", ";\n --color-success: ", ";\n --color-warning: ", ";\n --color-danger: ", ";\n --color-hover: ", ";\n --color-active: ", ";\n --color-scroll-bar: ", ";\n --color-background1: ", ";\n --color-background2: ", ";\n --color-background3: ", ";\n --color-backdrop: ", ";\n\n --font-h1: ", ";\n --font-h2: ", ";\n --font-h3: ", ";\n --font-body1: ", ";\n --font-body2: ", ";\n --font-button: ", ";\n --font-caption: ", ";\n --font-family: ", ";\n --font-normal: ", ";\n --font-bold: ", ";\n --font-on-primary: ", ";\n --font-on-success: ", ";\n --font-on-warning: ", ";\n --font-on-danger: ", ";\n --font-on-background: ", ";\n --font-on-mute: ", ";\n\n --box-shadow: ", ";\n --border-color: ", ";\n --border-width: ", ";\n --border-radius-s: ", ";\n --border-radius: ", ";\n --border-radius-l: ", ";\n --border-radius-round: ", ";\n\n --spacing-xs: ", ";\n --spacing-s: ", ";\n --spacing: ", ";\n --spacing-l: ", ";\n\n /* Global style */\n font-size: 16px;\n font-family: Helvetica;\n overflow-x: hidden;\n background: var(--color-background1);\n }\n\n /* Custom normalize */\n *,\n *::before,\n *::after {\n box-sizing: border-box;\n }\n\n html {\n line-height: 1;\n }\n\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n margin: 0;\n }\n \n a {\n text-decoration: none;\n }\n\n button,\n input,\n optgroup,\n select,\n textarea {\n line-height: 1;\n }\n\n ul {\n padding: 0;\n margin: 0;\n }\n\n li {\n list-style: none;\n }\n\n figure {\n margin: 0;\n }\n\n p {\n margin: 0;\n }\n\n dl,\n dt,\n dd {\n margin: 0;\n }\n\n .margin-bottom-s {\n margin-bottom: var(--spacing-s);\n }\n"])), _ref => {
|
|
12
13
|
let {
|
|
13
14
|
theme
|
|
14
15
|
} = _ref;
|
|
@@ -213,10 +214,5 @@ const GlobalStyle = (0, _styledComponents.createGlobalStyle)(_templateObject ||
|
|
|
213
214
|
theme
|
|
214
215
|
} = _ref41;
|
|
215
216
|
return theme.spacerL;
|
|
216
|
-
}, _ref42 => {
|
|
217
|
-
let {
|
|
218
|
-
theme
|
|
219
|
-
} = _ref42;
|
|
220
|
-
return theme.bgColor1;
|
|
221
217
|
});
|
|
222
218
|
var _default = exports.default = GlobalStyle;
|
package/assets/css/normalize.css
DELETED
|
@@ -1,386 +0,0 @@
|
|
|
1
|
-
/*! Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md) */
|
|
2
|
-
|
|
3
|
-
/* Document */
|
|
4
|
-
*,
|
|
5
|
-
*::before,
|
|
6
|
-
*::after {
|
|
7
|
-
box-sizing: border-box;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* 1. Correct the line height in all browsers.
|
|
12
|
-
* 2. Prevent adjustments of font size after orientation changes in iOS.
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
html {
|
|
16
|
-
line-height: 1; /* 1 */
|
|
17
|
-
-webkit-text-size-adjust: 100%; /* 2 */
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/* Sections */
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Remove the margin in all browsers.
|
|
24
|
-
*/
|
|
25
|
-
|
|
26
|
-
body {
|
|
27
|
-
margin: 0;
|
|
28
|
-
font-size: 16px;
|
|
29
|
-
font-family: Helvetica;
|
|
30
|
-
overflow-x: hidden;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Render the `main` element consistently in IE.
|
|
35
|
-
*/
|
|
36
|
-
|
|
37
|
-
main {
|
|
38
|
-
display: block;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Correct the font size and margin on `h1` elements within `section` and
|
|
43
|
-
* `article` contexts in Chrome, Firefox, and Safari.
|
|
44
|
-
*/
|
|
45
|
-
|
|
46
|
-
h1 {
|
|
47
|
-
font-size: 2em;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
h1,
|
|
51
|
-
h2,
|
|
52
|
-
h3,
|
|
53
|
-
h4,
|
|
54
|
-
h5,
|
|
55
|
-
h6 {
|
|
56
|
-
margin: 0;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/* Grouping content */
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* 1. Add the correct box sizing in Firefox.
|
|
63
|
-
* 2. Show the overflow in Edge and IE.
|
|
64
|
-
*/
|
|
65
|
-
|
|
66
|
-
hr {
|
|
67
|
-
box-sizing: content-box; /* 1 */
|
|
68
|
-
height: 0; /* 1 */
|
|
69
|
-
overflow: visible; /* 2 */
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* 1. Correct the inheritance and scaling of font size in all browsers.
|
|
74
|
-
* 2. Correct the odd `em` font sizing in all browsers.
|
|
75
|
-
*/
|
|
76
|
-
|
|
77
|
-
pre {
|
|
78
|
-
font-family: Helvetica;
|
|
79
|
-
font-size: 1em; /* 2 */
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
/* Text-level semantics */
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Remove the gray background on active links in IE 10.
|
|
86
|
-
*/
|
|
87
|
-
|
|
88
|
-
a {
|
|
89
|
-
background-color: transparent;
|
|
90
|
-
text-decoration: none;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* 1. Remove the bottom border in Chrome 57-
|
|
95
|
-
* 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
|
|
96
|
-
*/
|
|
97
|
-
|
|
98
|
-
abbr[title] {
|
|
99
|
-
border-bottom: none; /* 1 */
|
|
100
|
-
text-decoration: underline; /* 2 */
|
|
101
|
-
text-decoration: underline dotted; /* 2 */
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* Add the correct font weight in Chrome, Edge, and Safari.
|
|
106
|
-
*/
|
|
107
|
-
|
|
108
|
-
b,
|
|
109
|
-
strong {
|
|
110
|
-
font-weight: bolder;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* 1. Correct the inheritance and scaling of font size in all browsers.
|
|
115
|
-
* 2. Correct the odd `em` font sizing in all browsers.
|
|
116
|
-
*/
|
|
117
|
-
|
|
118
|
-
code,
|
|
119
|
-
kbd,
|
|
120
|
-
samp {
|
|
121
|
-
font-family: Helvetica;
|
|
122
|
-
font-size: 1em; /* 2 */
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* Add the correct font size in all browsers.
|
|
127
|
-
*/
|
|
128
|
-
|
|
129
|
-
small {
|
|
130
|
-
font-size: 80%;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* Prevent `sub` and `sup` elements from affecting the line height in
|
|
135
|
-
* all browsers.
|
|
136
|
-
*/
|
|
137
|
-
|
|
138
|
-
sub,
|
|
139
|
-
sup {
|
|
140
|
-
font-size: 75%;
|
|
141
|
-
line-height: 0;
|
|
142
|
-
position: relative;
|
|
143
|
-
vertical-align: baseline;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
sub {
|
|
147
|
-
bottom: -0.25em;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
sup {
|
|
151
|
-
top: -0.5em;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
/* Embedded content */
|
|
155
|
-
|
|
156
|
-
/**
|
|
157
|
-
* Remove the border on images inside links in IE 10.
|
|
158
|
-
*/
|
|
159
|
-
|
|
160
|
-
img {
|
|
161
|
-
border-style: none;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
/* Forms */
|
|
165
|
-
|
|
166
|
-
/**
|
|
167
|
-
* 1. Change the font styles in all browsers.
|
|
168
|
-
* 2. Remove the margin in Firefox and Safari.
|
|
169
|
-
*/
|
|
170
|
-
|
|
171
|
-
button,
|
|
172
|
-
input,
|
|
173
|
-
optgroup,
|
|
174
|
-
select,
|
|
175
|
-
textarea {
|
|
176
|
-
font-family: Helvetica;
|
|
177
|
-
font-size: 100%; /* 1 */
|
|
178
|
-
line-height: 1; /* 1 */
|
|
179
|
-
margin: 0; /* 2 */
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
/**
|
|
183
|
-
* Show the overflow in IE.
|
|
184
|
-
* 1. Show the overflow in Edge.
|
|
185
|
-
*/
|
|
186
|
-
|
|
187
|
-
button,
|
|
188
|
-
input {
|
|
189
|
-
/* 1 */
|
|
190
|
-
overflow: visible;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
/**
|
|
194
|
-
* Remove the inheritance of text transform in Edge, Firefox, and IE.
|
|
195
|
-
* 1. Remove the inheritance of text transform in Firefox.
|
|
196
|
-
*/
|
|
197
|
-
|
|
198
|
-
button,
|
|
199
|
-
select {
|
|
200
|
-
/* 1 */
|
|
201
|
-
text-transform: none;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
/**
|
|
205
|
-
* Correct the inability to style clickable types in iOS and Safari.
|
|
206
|
-
*/
|
|
207
|
-
|
|
208
|
-
button,
|
|
209
|
-
[type='button'],
|
|
210
|
-
[type='reset'],
|
|
211
|
-
[type='submit'] {
|
|
212
|
-
-webkit-appearance: button;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
/**
|
|
216
|
-
* Remove the inner border and padding in Firefox.
|
|
217
|
-
*/
|
|
218
|
-
|
|
219
|
-
button::-moz-focus-inner,
|
|
220
|
-
[type='button']::-moz-focus-inner,
|
|
221
|
-
[type='reset']::-moz-focus-inner,
|
|
222
|
-
[type='submit']::-moz-focus-inner {
|
|
223
|
-
border-style: none;
|
|
224
|
-
padding: 0;
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
/**
|
|
228
|
-
* Restore the focus styles unset by the previous rule.
|
|
229
|
-
*/
|
|
230
|
-
|
|
231
|
-
button:-moz-focusring,
|
|
232
|
-
[type='button']:-moz-focusring,
|
|
233
|
-
[type='reset']:-moz-focusring,
|
|
234
|
-
[type='submit']:-moz-focusring {
|
|
235
|
-
outline: 1px dotted ButtonText;
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
/**
|
|
239
|
-
* Correct the padding in Firefox.
|
|
240
|
-
*/
|
|
241
|
-
|
|
242
|
-
fieldset {
|
|
243
|
-
padding: 0.35em 0.75em 0.625em;
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
/**
|
|
247
|
-
* 1. Correct the text wrapping in Edge and IE.
|
|
248
|
-
* 2. Correct the color inheritance from `fieldset` elements in IE.
|
|
249
|
-
* 3. Remove the padding so developers are not caught out when they zero out
|
|
250
|
-
* `fieldset` elements in all browsers.
|
|
251
|
-
*/
|
|
252
|
-
|
|
253
|
-
legend {
|
|
254
|
-
box-sizing: border-box; /* 1 */
|
|
255
|
-
color: inherit; /* 2 */
|
|
256
|
-
display: table; /* 1 */
|
|
257
|
-
max-width: 100%; /* 1 */
|
|
258
|
-
padding: 0; /* 3 */
|
|
259
|
-
white-space: normal; /* 1 */
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
/**
|
|
263
|
-
* Add the correct vertical alignment in Chrome, Firefox, and Opera.
|
|
264
|
-
*/
|
|
265
|
-
|
|
266
|
-
progress {
|
|
267
|
-
vertical-align: baseline;
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
/**
|
|
271
|
-
* Remove the default vertical scrollbar in IE 10+.
|
|
272
|
-
*/
|
|
273
|
-
|
|
274
|
-
textarea {
|
|
275
|
-
overflow: auto;
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
/**
|
|
279
|
-
* 1. Add the correct box sizing in IE 10.
|
|
280
|
-
* 2. Remove the padding in IE 10.
|
|
281
|
-
*/
|
|
282
|
-
|
|
283
|
-
[type='checkbox'],
|
|
284
|
-
[type='radio'] {
|
|
285
|
-
box-sizing: border-box; /* 1 */
|
|
286
|
-
padding: 0; /* 2 */
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
/**
|
|
290
|
-
* Correct the cursor style of increment and decrement buttons in Chrome.
|
|
291
|
-
*/
|
|
292
|
-
|
|
293
|
-
[type='number']::-webkit-inner-spin-button,
|
|
294
|
-
[type='number']::-webkit-outer-spin-button {
|
|
295
|
-
height: auto;
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
/**
|
|
299
|
-
* 1. Correct the odd appearance in Chrome and Safari.
|
|
300
|
-
* 2. Correct the outline style in Safari.
|
|
301
|
-
*/
|
|
302
|
-
|
|
303
|
-
[type='search'] {
|
|
304
|
-
-webkit-appearance: textfield; /* 1 */
|
|
305
|
-
outline-offset: -2px; /* 2 */
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
/**
|
|
309
|
-
* Remove the inner padding in Chrome and Safari on macOS.
|
|
310
|
-
*/
|
|
311
|
-
|
|
312
|
-
[type='search']::-webkit-search-decoration {
|
|
313
|
-
-webkit-appearance: none;
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
/**
|
|
317
|
-
* 1. Correct the inability to style clickable types in iOS and Safari.
|
|
318
|
-
* 2. Change font properties to `inherit` in Safari.
|
|
319
|
-
*/
|
|
320
|
-
|
|
321
|
-
::-webkit-file-upload-button {
|
|
322
|
-
-webkit-appearance: button; /* 1 */
|
|
323
|
-
font: inherit; /* 2 */
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
/* Interactive */
|
|
327
|
-
|
|
328
|
-
/*
|
|
329
|
-
* Add the correct display in Edge, IE 10+, and Firefox.
|
|
330
|
-
*/
|
|
331
|
-
|
|
332
|
-
details {
|
|
333
|
-
display: block;
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
/*
|
|
337
|
-
* Add the correct display in all browsers.
|
|
338
|
-
*/
|
|
339
|
-
|
|
340
|
-
summary {
|
|
341
|
-
display: list-item;
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
/* Misc */
|
|
345
|
-
|
|
346
|
-
/**
|
|
347
|
-
* Add the correct display in IE 10+.
|
|
348
|
-
*/
|
|
349
|
-
|
|
350
|
-
template {
|
|
351
|
-
display: none;
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
/**
|
|
355
|
-
* Add the correct display in IE 10.
|
|
356
|
-
*/
|
|
357
|
-
|
|
358
|
-
[hidden] {
|
|
359
|
-
display: none;
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
/* Custom reset */
|
|
363
|
-
|
|
364
|
-
ul {
|
|
365
|
-
padding: 0;
|
|
366
|
-
margin: 0;
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
li {
|
|
370
|
-
list-style: none;
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
figure {
|
|
374
|
-
margin: 0;
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
p,
|
|
378
|
-
h3 {
|
|
379
|
-
margin: 0;
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
dl,
|
|
383
|
-
dt,
|
|
384
|
-
dd {
|
|
385
|
-
margin: 0;
|
|
386
|
-
}
|