@dktunited-techoff/techoff-suite-ui 0.8.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 +1 -0
- package/esm/assets/fonts/Montserrat-Medium.ttf +0 -0
- package/esm/components/Button/Button.css +93 -0
- package/esm/components/Button/Button.d.ts +5 -0
- package/esm/components/Button/Button.js +17 -0
- package/esm/components/Button/Button.js.map +1 -0
- package/esm/components/Button/Button.types.d.ts +9 -0
- package/esm/components/Button/Button.types.js +2 -0
- package/esm/components/Button/Button.types.js.map +1 -0
- package/esm/components/Button/__stories__/Button.stories.mdx +74 -0
- package/esm/components/Checkbox/Checkbox.css +61 -0
- package/esm/components/Checkbox/Checkbox.d.ts +7 -0
- package/esm/components/Checkbox/Checkbox.js +21 -0
- package/esm/components/Checkbox/Checkbox.js.map +1 -0
- package/esm/components/Checkbox/Checkbox.types.d.ts +4 -0
- package/esm/components/Checkbox/Checkbox.types.js +2 -0
- package/esm/components/Checkbox/Checkbox.types.js.map +1 -0
- package/esm/components/Checkbox/__stories__/Checkbox.stories.mdx +43 -0
- package/esm/components/Icon/Icon.css +26 -0
- package/esm/components/Icon/Icon.d.ts +4 -0
- package/esm/components/Icon/Icon.js +12 -0
- package/esm/components/Icon/Icon.js.map +1 -0
- package/esm/components/Icon/Icon.types.d.ts +4 -0
- package/esm/components/Icon/Icon.types.js +2 -0
- package/esm/components/Icon/Icon.types.js.map +1 -0
- package/esm/components/Icon/__stories__/Icon.stories.mdx +86 -0
- package/esm/components/Icon/icons/check.svg +4 -0
- package/esm/components/Icon/icons/chevron-down.svg +4 -0
- package/esm/components/Icon/icons/chevron-left.svg +4 -0
- package/esm/components/Icon/icons/chevron-right.svg +4 -0
- package/esm/components/Icon/icons/chevron-up.svg +4 -0
- package/esm/components/Icon/icons/heart-filled.svg +4 -0
- package/esm/components/Icon/icons/heart.svg +4 -0
- package/esm/components/Icon/icons/home.svg +6 -0
- package/esm/components/Icon/icons/index.d.ts +3 -0
- package/esm/components/Icon/icons/index.js +16 -0
- package/esm/components/Icon/icons/index.js.map +1 -0
- package/esm/components/Icon/icons/index.ts +15 -0
- package/esm/components/Icon/icons/plus.svg +5 -0
- package/esm/components/Icon/icons/search.svg +5 -0
- package/esm/components/Icon/icons/square-check-filled.svg +1 -0
- package/esm/components/Icon/icons/square.svg +1 -0
- package/esm/components/Icon/icons/user.svg +5 -0
- package/esm/components/Inputs/BooleanInput/BooleanInput.css +51 -0
- package/esm/components/Inputs/BooleanInput/BooleanInput.d.ts +4 -0
- package/esm/components/Inputs/BooleanInput/BooleanInput.js +13 -0
- package/esm/components/Inputs/BooleanInput/BooleanInput.js.map +1 -0
- package/esm/components/Inputs/BooleanInput/BooleanInput.tsx +24 -0
- package/esm/components/Inputs/BooleanInput/BooleanInput.types.d.ts +7 -0
- package/esm/components/Inputs/BooleanInput/BooleanInput.types.js +2 -0
- package/esm/components/Inputs/BooleanInput/BooleanInput.types.js.map +1 -0
- package/esm/components/Inputs/BooleanInput/BooleanInput.types.ts +7 -0
- package/esm/components/Inputs/BooleanInput/__stories__/BooleanInput.stories.mdx +44 -0
- package/esm/components/Inputs/TextInput/TextInput.css +42 -0
- package/esm/components/Inputs/TextInput/TextInput.d.ts +4 -0
- package/esm/components/Inputs/TextInput/TextInput.js +16 -0
- package/esm/components/Inputs/TextInput/TextInput.js.map +1 -0
- package/esm/components/Inputs/TextInput/TextInput.tsx +24 -0
- package/esm/components/Inputs/TextInput/TextInput.types.d.ts +8 -0
- package/esm/components/Inputs/TextInput/TextInput.types.js +2 -0
- package/esm/components/Inputs/TextInput/TextInput.types.js.map +1 -0
- package/esm/components/Inputs/TextInput/TextInput.types.ts +8 -0
- package/esm/components/Inputs/TextInput/__stories__/TextInput.stories.mdx +55 -0
- package/esm/components/Loader/Loader.css +42 -0
- package/esm/components/Loader/Loader.d.ts +4 -0
- package/esm/components/Loader/Loader.js +6 -0
- package/esm/components/Loader/Loader.js.map +1 -0
- package/esm/components/Loader/Loader.types.d.ts +3 -0
- package/esm/components/Loader/Loader.types.js +2 -0
- package/esm/components/Loader/Loader.types.js.map +1 -0
- package/esm/components/Loader/__stories__/Loader.stories.mdx +30 -0
- package/esm/index.d.ts +9 -0
- package/esm/index.js +10 -0
- package/esm/index.js.map +1 -0
- package/esm/layouts/Header/Header.css +83 -0
- package/esm/layouts/Header/Header.d.ts +4 -0
- package/esm/layouts/Header/Header.js +14 -0
- package/esm/layouts/Header/Header.js.map +1 -0
- package/esm/layouts/Header/Header.types.d.ts +4 -0
- package/esm/layouts/Header/Header.types.js +2 -0
- package/esm/layouts/Header/Header.types.js.map +1 -0
- package/esm/layouts/Header/HeaderActions.d.ts +3 -0
- package/esm/layouts/Header/HeaderActions.js +7 -0
- package/esm/layouts/Header/HeaderActions.js.map +1 -0
- package/esm/layouts/Header/HeaderProfile.d.ts +3 -0
- package/esm/layouts/Header/HeaderProfile.js +16 -0
- package/esm/layouts/Header/HeaderProfile.js.map +1 -0
- package/esm/layouts/Header/HeaderTitle.d.ts +3 -0
- package/esm/layouts/Header/HeaderTitle.js +11 -0
- package/esm/layouts/Header/HeaderTitle.js.map +1 -0
- package/esm/layouts/Header/__stories__/Header.stories.mdx +36 -0
- package/esm/layouts/Navigation/Navigation.css +74 -0
- package/esm/layouts/Navigation/Navigation.d.ts +4 -0
- package/esm/layouts/Navigation/Navigation.js +15 -0
- package/esm/layouts/Navigation/Navigation.js.map +1 -0
- package/esm/layouts/Navigation/Navigation.types.d.ts +5 -0
- package/esm/layouts/Navigation/Navigation.types.js +2 -0
- package/esm/layouts/Navigation/Navigation.types.js.map +1 -0
- package/esm/layouts/Navigation/NavigationActions.d.ts +4 -0
- package/esm/layouts/Navigation/NavigationActions.js +4 -0
- package/esm/layouts/Navigation/NavigationActions.js.map +1 -0
- package/esm/layouts/Navigation/NavigationBreadcrumb.d.ts +6 -0
- package/esm/layouts/Navigation/NavigationBreadcrumb.js +26 -0
- package/esm/layouts/Navigation/NavigationBreadcrumb.js.map +1 -0
- package/esm/layouts/Navigation/__stories__/Navigation.stories.mdx +46 -0
- package/esm/utils/string.utils.d.ts +1 -0
- package/esm/utils/string.utils.js +2 -0
- package/esm/utils/string.utils.js.map +1 -0
- package/esm/utils/validator.utils.d.ts +2 -0
- package/esm/utils/validator.utils.js +5 -0
- package/esm/utils/validator.utils.js.map +1 -0
- package/lib/assets/fonts/Montserrat-Medium.ttf +0 -0
- package/lib/components/Button/Button.css +93 -0
- package/lib/components/Button/Button.d.ts +5 -0
- package/lib/components/Button/Button.js +21 -0
- package/lib/components/Button/Button.js.map +1 -0
- package/lib/components/Button/Button.types.d.ts +9 -0
- package/lib/components/Button/Button.types.js +3 -0
- package/lib/components/Button/Button.types.js.map +1 -0
- package/lib/components/Button/__stories__/Button.stories.mdx +74 -0
- package/lib/components/Checkbox/Checkbox.css +61 -0
- package/lib/components/Checkbox/Checkbox.d.ts +7 -0
- package/lib/components/Checkbox/Checkbox.js +27 -0
- package/lib/components/Checkbox/Checkbox.js.map +1 -0
- package/lib/components/Checkbox/Checkbox.types.d.ts +4 -0
- package/lib/components/Checkbox/Checkbox.types.js +3 -0
- package/lib/components/Checkbox/Checkbox.types.js.map +1 -0
- package/lib/components/Checkbox/__stories__/Checkbox.stories.mdx +43 -0
- package/lib/components/Icon/Icon.css +26 -0
- package/lib/components/Icon/Icon.d.ts +4 -0
- package/lib/components/Icon/Icon.js +16 -0
- package/lib/components/Icon/Icon.js.map +1 -0
- package/lib/components/Icon/Icon.types.d.ts +4 -0
- package/lib/components/Icon/Icon.types.js +3 -0
- package/lib/components/Icon/Icon.types.js.map +1 -0
- package/lib/components/Icon/__stories__/Icon.stories.mdx +86 -0
- package/lib/components/Icon/icons/check.svg +4 -0
- package/lib/components/Icon/icons/chevron-down.svg +4 -0
- package/lib/components/Icon/icons/chevron-left.svg +4 -0
- package/lib/components/Icon/icons/chevron-right.svg +4 -0
- package/lib/components/Icon/icons/chevron-up.svg +4 -0
- package/lib/components/Icon/icons/heart-filled.svg +4 -0
- package/lib/components/Icon/icons/heart.svg +4 -0
- package/lib/components/Icon/icons/home.svg +6 -0
- package/lib/components/Icon/icons/index.d.ts +3 -0
- package/lib/components/Icon/icons/index.js +19 -0
- package/lib/components/Icon/icons/index.js.map +1 -0
- package/lib/components/Icon/icons/index.ts +15 -0
- package/lib/components/Icon/icons/plus.svg +5 -0
- package/lib/components/Icon/icons/search.svg +5 -0
- package/lib/components/Icon/icons/square-check-filled.svg +1 -0
- package/lib/components/Icon/icons/square.svg +1 -0
- package/lib/components/Icon/icons/user.svg +5 -0
- package/lib/components/Inputs/BooleanInput/BooleanInput.css +51 -0
- package/lib/components/Inputs/BooleanInput/BooleanInput.d.ts +4 -0
- package/lib/components/Inputs/BooleanInput/BooleanInput.js +17 -0
- package/lib/components/Inputs/BooleanInput/BooleanInput.js.map +1 -0
- package/lib/components/Inputs/BooleanInput/BooleanInput.tsx +24 -0
- package/lib/components/Inputs/BooleanInput/BooleanInput.types.d.ts +7 -0
- package/lib/components/Inputs/BooleanInput/BooleanInput.types.js +3 -0
- package/lib/components/Inputs/BooleanInput/BooleanInput.types.js.map +1 -0
- package/lib/components/Inputs/BooleanInput/BooleanInput.types.ts +7 -0
- package/lib/components/Inputs/BooleanInput/__stories__/BooleanInput.stories.mdx +44 -0
- package/lib/components/Inputs/TextInput/TextInput.css +42 -0
- package/lib/components/Inputs/TextInput/TextInput.d.ts +4 -0
- package/lib/components/Inputs/TextInput/TextInput.js +20 -0
- package/lib/components/Inputs/TextInput/TextInput.js.map +1 -0
- package/lib/components/Inputs/TextInput/TextInput.tsx +24 -0
- package/lib/components/Inputs/TextInput/TextInput.types.d.ts +8 -0
- package/lib/components/Inputs/TextInput/TextInput.types.js +3 -0
- package/lib/components/Inputs/TextInput/TextInput.types.js.map +1 -0
- package/lib/components/Inputs/TextInput/TextInput.types.ts +8 -0
- package/lib/components/Inputs/TextInput/__stories__/TextInput.stories.mdx +55 -0
- package/lib/components/Loader/Loader.css +42 -0
- package/lib/components/Loader/Loader.d.ts +4 -0
- package/lib/components/Loader/Loader.js +10 -0
- package/lib/components/Loader/Loader.js.map +1 -0
- package/lib/components/Loader/Loader.types.d.ts +3 -0
- package/lib/components/Loader/Loader.types.js +3 -0
- package/lib/components/Loader/Loader.types.js.map +1 -0
- package/lib/components/Loader/__stories__/Loader.stories.mdx +30 -0
- package/lib/index.d.ts +9 -0
- package/lib/index.js +26 -0
- package/lib/index.js.map +1 -0
- package/lib/layouts/Header/Header.css +83 -0
- package/lib/layouts/Header/Header.d.ts +4 -0
- package/lib/layouts/Header/Header.js +18 -0
- package/lib/layouts/Header/Header.js.map +1 -0
- package/lib/layouts/Header/Header.types.d.ts +4 -0
- package/lib/layouts/Header/Header.types.js +3 -0
- package/lib/layouts/Header/Header.types.js.map +1 -0
- package/lib/layouts/Header/HeaderActions.d.ts +3 -0
- package/lib/layouts/Header/HeaderActions.js +11 -0
- package/lib/layouts/Header/HeaderActions.js.map +1 -0
- package/lib/layouts/Header/HeaderProfile.d.ts +3 -0
- package/lib/layouts/Header/HeaderProfile.js +20 -0
- package/lib/layouts/Header/HeaderProfile.js.map +1 -0
- package/lib/layouts/Header/HeaderTitle.d.ts +3 -0
- package/lib/layouts/Header/HeaderTitle.js +15 -0
- package/lib/layouts/Header/HeaderTitle.js.map +1 -0
- package/lib/layouts/Header/__stories__/Header.stories.mdx +36 -0
- package/lib/layouts/Navigation/Navigation.css +74 -0
- package/lib/layouts/Navigation/Navigation.d.ts +4 -0
- package/lib/layouts/Navigation/Navigation.js +19 -0
- package/lib/layouts/Navigation/Navigation.js.map +1 -0
- package/lib/layouts/Navigation/Navigation.types.d.ts +5 -0
- package/lib/layouts/Navigation/Navigation.types.js +3 -0
- package/lib/layouts/Navigation/Navigation.types.js.map +1 -0
- package/lib/layouts/Navigation/NavigationActions.d.ts +4 -0
- package/lib/layouts/Navigation/NavigationActions.js +8 -0
- package/lib/layouts/Navigation/NavigationActions.js.map +1 -0
- package/lib/layouts/Navigation/NavigationBreadcrumb.d.ts +6 -0
- package/lib/layouts/Navigation/NavigationBreadcrumb.js +31 -0
- package/lib/layouts/Navigation/NavigationBreadcrumb.js.map +1 -0
- package/lib/layouts/Navigation/__stories__/Navigation.stories.mdx +46 -0
- package/lib/utils/string.utils.d.ts +1 -0
- package/lib/utils/string.utils.js +6 -0
- package/lib/utils/string.utils.js.map +1 -0
- package/lib/utils/validator.utils.d.ts +2 -0
- package/lib/utils/validator.utils.js +9 -0
- package/lib/utils/validator.utils.js.map +1 -0
- package/package.json +51 -0
- package/src/assets/fonts/Montserrat-Medium.ttf +0 -0
- package/src/components/Button/Button.css +93 -0
- package/src/components/Button/Button.tsx +34 -0
- package/src/components/Button/Button.types.ts +9 -0
- package/src/components/Button/__stories__/Button.stories.mdx +74 -0
- package/src/components/Checkbox/Checkbox.css +61 -0
- package/src/components/Checkbox/Checkbox.tsx +30 -0
- package/src/components/Checkbox/Checkbox.types.ts +1 -0
- package/src/components/Checkbox/__stories__/Checkbox.stories.mdx +43 -0
- package/src/components/Icon/Icon.css +26 -0
- package/src/components/Icon/Icon.tsx +13 -0
- package/src/components/Icon/Icon.types.ts +1 -0
- package/src/components/Icon/__stories__/Icon.stories.mdx +86 -0
- package/src/components/Icon/icons/check.svg +4 -0
- package/src/components/Icon/icons/chevron-down.svg +4 -0
- package/src/components/Icon/icons/chevron-left.svg +4 -0
- package/src/components/Icon/icons/chevron-right.svg +4 -0
- package/src/components/Icon/icons/chevron-up.svg +4 -0
- package/src/components/Icon/icons/heart-filled.svg +4 -0
- package/src/components/Icon/icons/heart.svg +4 -0
- package/src/components/Icon/icons/home.svg +6 -0
- package/src/components/Icon/icons/index.ts +15 -0
- package/src/components/Icon/icons/plus.svg +5 -0
- package/src/components/Icon/icons/search.svg +5 -0
- package/src/components/Icon/icons/square-check-filled.svg +1 -0
- package/src/components/Icon/icons/square.svg +1 -0
- package/src/components/Icon/icons/user.svg +5 -0
- package/src/components/Inputs/BooleanInput/BooleanInput.css +51 -0
- package/src/components/Inputs/BooleanInput/BooleanInput.tsx +24 -0
- package/src/components/Inputs/BooleanInput/BooleanInput.types.ts +7 -0
- package/src/components/Inputs/BooleanInput/__stories__/BooleanInput.stories.mdx +44 -0
- package/src/components/Inputs/TextInput/TextInput.css +42 -0
- package/src/components/Inputs/TextInput/TextInput.tsx +24 -0
- package/src/components/Inputs/TextInput/TextInput.types.ts +8 -0
- package/src/components/Inputs/TextInput/__stories__/TextInput.stories.mdx +55 -0
- package/src/components/Loader/Loader.css +42 -0
- package/src/components/Loader/Loader.tsx +7 -0
- package/src/components/Loader/Loader.types.ts +1 -0
- package/src/components/Loader/__stories__/Loader.stories.mdx +30 -0
- package/src/index.ts +10 -0
- package/src/layouts/Header/Header.css +83 -0
- package/src/layouts/Header/Header.tsx +18 -0
- package/src/layouts/Header/Header.types.ts +1 -0
- package/src/layouts/Header/HeaderActions.tsx +8 -0
- package/src/layouts/Header/HeaderProfile.tsx +20 -0
- package/src/layouts/Header/HeaderTitle.tsx +17 -0
- package/src/layouts/Header/__stories__/Header.stories.mdx +36 -0
- package/src/layouts/Navigation/Navigation.css +74 -0
- package/src/layouts/Navigation/Navigation.tsx +19 -0
- package/src/layouts/Navigation/Navigation.types.ts +1 -0
- package/src/layouts/Navigation/NavigationActions.tsx +7 -0
- package/src/layouts/Navigation/NavigationBreadcrumb.tsx +55 -0
- package/src/layouts/Navigation/__stories__/Navigation.stories.mdx +46 -0
- package/src/utils/string.utils.ts +1 -0
- package/src/utils/validator.utils.ts +8 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
@font-face {
|
|
2
|
+
font-family: 'Montserrat';
|
|
3
|
+
src: url('../../assets/fonts/Montserrat-Medium.ttf');
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
/* ######## */
|
|
7
|
+
/* HEADER */
|
|
8
|
+
header {
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
justify-content: space-between;
|
|
12
|
+
width: 100%;
|
|
13
|
+
height: 64px;
|
|
14
|
+
padding: 0 24px;
|
|
15
|
+
}
|
|
16
|
+
.header-actions {
|
|
17
|
+
display: flex;
|
|
18
|
+
}
|
|
19
|
+
.header-actions > * {
|
|
20
|
+
margin-left: 12px;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/* ############## */
|
|
24
|
+
/* HEADER TITLE */
|
|
25
|
+
.header-title-container {
|
|
26
|
+
display: flex;
|
|
27
|
+
align-items: flex-end;
|
|
28
|
+
height: 30px;
|
|
29
|
+
}
|
|
30
|
+
.header-title {
|
|
31
|
+
font-family: 'Montserrat';
|
|
32
|
+
font-size: 25px;
|
|
33
|
+
line-height: 19px;
|
|
34
|
+
text-transform: uppercase;
|
|
35
|
+
}
|
|
36
|
+
.header-by {
|
|
37
|
+
margin-left: 15px;
|
|
38
|
+
font-family: 'Montserrat';
|
|
39
|
+
font-size: 12px;
|
|
40
|
+
line-height: 10px;
|
|
41
|
+
text-transform: uppercase;
|
|
42
|
+
}
|
|
43
|
+
.header-techoff {
|
|
44
|
+
width: 64px;
|
|
45
|
+
margin-left: 4px;
|
|
46
|
+
margin-bottom: -2px;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/* ################ */
|
|
50
|
+
/* HEADER PROFILE */
|
|
51
|
+
.header-profile {
|
|
52
|
+
display: flex;
|
|
53
|
+
align-items: center;
|
|
54
|
+
height: 40px;
|
|
55
|
+
padding: 0 4px;
|
|
56
|
+
border-radius: 9999px;
|
|
57
|
+
box-shadow: 0px 12px 12px 0px #00537d1a;
|
|
58
|
+
background: white;
|
|
59
|
+
}
|
|
60
|
+
.header-profile--icon {
|
|
61
|
+
display: flex;
|
|
62
|
+
align-items: center;
|
|
63
|
+
justify-content: center;
|
|
64
|
+
width: 32px;
|
|
65
|
+
height: 32px;
|
|
66
|
+
border-radius: 9999px;
|
|
67
|
+
background: #e5e5e5;
|
|
68
|
+
}
|
|
69
|
+
.header-profile--name {
|
|
70
|
+
padding-left: 8px;
|
|
71
|
+
padding-right: 12px;
|
|
72
|
+
color: #4e5d6b;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/* ######### */
|
|
76
|
+
/* GLOBALS */
|
|
77
|
+
* {
|
|
78
|
+
font-size: 14px;
|
|
79
|
+
outline: none;
|
|
80
|
+
box-sizing: border-box;
|
|
81
|
+
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans',
|
|
82
|
+
'Helvetica Neue', sans-serif;
|
|
83
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Children, PropsWithChildren } from 'react';
|
|
3
|
+
import { isSuiteElement } from '../../utils/validator.utils';
|
|
4
|
+
import './Header.css';
|
|
5
|
+
|
|
6
|
+
export const Header = ({ children }: PropsWithChildren) => {
|
|
7
|
+
const titleElement = Children.toArray(children).find(c => isSuiteElement(c, 'HeaderTitle'));
|
|
8
|
+
const actionsElement = Children.toArray(children).find(c => isSuiteElement(c, 'HeaderActions'));
|
|
9
|
+
|
|
10
|
+
// #########
|
|
11
|
+
// Rendering
|
|
12
|
+
return (
|
|
13
|
+
<header>
|
|
14
|
+
<div>{titleElement}</div>
|
|
15
|
+
<div>{actionsElement}</div>
|
|
16
|
+
</header>
|
|
17
|
+
);
|
|
18
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type HeaderProfileProps = { firstname: string; lastname: string };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Icon } from '../../components/Icon/Icon';
|
|
3
|
+
import { capitalize } from '../../utils/string.utils';
|
|
4
|
+
import { HeaderProfileProps } from './Header.types';
|
|
5
|
+
|
|
6
|
+
export const HeaderProfile = ({ firstname, lastname }: HeaderProfileProps) => {
|
|
7
|
+
// #########
|
|
8
|
+
// Rendering
|
|
9
|
+
return (
|
|
10
|
+
<div className="header-profile">
|
|
11
|
+
<div className="header-profile--icon">
|
|
12
|
+
<Icon name="user" size="16" />
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
<div className="header-profile--name">
|
|
16
|
+
{capitalize(firstname)} {lastname.charAt(0).toUpperCase()}.
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
);
|
|
20
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { PropsWithChildren } from 'react';
|
|
3
|
+
|
|
4
|
+
const svg =
|
|
5
|
+
'<?xml version="1.0" encoding="utf-8"?><!-- Generator: Adobe Illustrator 27.3.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) --><svg version="1.1" id="Calque_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 335 62.6" style="enable-background:new 0 0 335 62.6;" xml:space="preserve"><style type="text/css"> .st0{fill:#0883C4;} .st1{fill:#FFFFFF;}</style><path d="M126.2,24.4c-3.1-3.3-7.4-5.3-12.4-5.3c-9.2,0-16,6.8-16,16.1c0,9.3,6.7,16.2,16,16.2c5.3,0,9.6-2.4,12.6-6l8.1,7.3 c-5.4,6.5-12.1,9.8-20.7,9.8C98,62.6,86.4,51,86.4,35.3C86.4,19.5,98,8,113.8,8c8.2,0,15.4,3,20.3,8.5L126.2,24.4z"/><polygon points="46.8,9.5 80.3,9.5 80.3,19.9 58,19.9 58,30.8 77.3,30.8 77.3,40.9 58,40.9 58,52.1 80.3,52.1 80.3,62.6 46.8,62.6 "/><polygon points="265.4,8.7 297,8.7 297,19.2 276.6,19.2 276.6,32.6 294,32.6 294,42.8 276.6,42.8 276.6,61.8 265.4,61.8 "/><polygon points="303.4,8.7 335,8.7 335,19.2 314.6,19.2 314.6,32.6 332,32.6 332,42.8 314.6,42.8 314.6,61.8 303.4,61.8 "/><polygon points="174.5,40.1 152,40.1 152,61.8 140.8,61.8 140.8,8.7 152,8.7 152,29.2 174.5,29.2 174.5,8.7 185.7,8.7 185.7,61.8 174.5,61.8 "/><polygon points="0,9.5 40.3,9.5 40.3,20.4 25.8,20.4 25.8,62.6 14.6,62.6 14.6,20.4 0,20.4 "/><polyline points="188.4,15.9 198.6,0 209.9,0 199.7,15.9 188.4,15.9 "/><path d="M231.7,8c-15.8,0-27.4,11.5-27.4,27.3c0,15.8,11.6,27.3,27.4,27.3c15.7,0,27.2-11.5,27.2-27.3C258.9,19.5,247.4,8,231.7,8z" /><polygon class="st0" points="208,36.3 243.1,15.9 243,56.6 "/><polygon class="st1" points="231.1,56.7 230.6,37.4 214.2,47.6 "/></svg>';
|
|
6
|
+
|
|
7
|
+
export const HeaderTitle = ({ children }: PropsWithChildren) => {
|
|
8
|
+
// #########
|
|
9
|
+
// Rendering
|
|
10
|
+
return (
|
|
11
|
+
<div className="header-title-container">
|
|
12
|
+
<div className="header-title">{children}</div>
|
|
13
|
+
<div className="header-by">BY</div>
|
|
14
|
+
<div className="header-techoff" dangerouslySetInnerHTML={{ __html: svg }} />
|
|
15
|
+
</div>
|
|
16
|
+
);
|
|
17
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ArgsTable, Canvas, Meta, Story } from '@storybook/blocks';
|
|
3
|
+
import { Header } from '../Header';
|
|
4
|
+
import { HeaderActions } from '../HeaderActions';
|
|
5
|
+
import { HeaderTitle } from '../HeaderTitle';
|
|
6
|
+
import { HeaderProfile } from '../HeaderProfile';
|
|
7
|
+
import { Button } from '../../../components/Button/Button';
|
|
8
|
+
|
|
9
|
+
<Meta title="Layouts/Header" />
|
|
10
|
+
|
|
11
|
+
# Header
|
|
12
|
+
|
|
13
|
+
The header will allow users to quickly find the information they need at a glance but also make some actions. The header is therefore central in the design of each application: it contains all the essential information, obvious shortcuts, which will help boost Deacthlon Techoff brand image.
|
|
14
|
+
|
|
15
|
+
## Overview
|
|
16
|
+
|
|
17
|
+
<Canvas>
|
|
18
|
+
<Story
|
|
19
|
+
name="Overview"
|
|
20
|
+
args={{
|
|
21
|
+
children: [
|
|
22
|
+
<HeaderTitle>Techoff Suite UI</HeaderTitle>,
|
|
23
|
+
<HeaderActions>
|
|
24
|
+
<Button icon="plus" size="lg" variant="shadow" rounded onClick={() => {}} />
|
|
25
|
+
<HeaderProfile firstname="John" lastname="Doe" />
|
|
26
|
+
</HeaderActions>,
|
|
27
|
+
],
|
|
28
|
+
}}
|
|
29
|
+
>
|
|
30
|
+
{args => <Header>{args.children}</Header>}
|
|
31
|
+
</Story>
|
|
32
|
+
</Canvas>
|
|
33
|
+
|
|
34
|
+
## Props
|
|
35
|
+
|
|
36
|
+
<ArgsTable story="Overview" of={Header} />
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
.navigation {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
height: 32px;
|
|
5
|
+
padding: 0 24px;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/* ############ */
|
|
9
|
+
/* BREADCRUMB */
|
|
10
|
+
.breadcrumb {
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
padding-right: 20px;
|
|
14
|
+
}
|
|
15
|
+
.breadcrumb-container {
|
|
16
|
+
display: flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
}
|
|
19
|
+
.breadcrumb-chevron {
|
|
20
|
+
padding: 0 8px;
|
|
21
|
+
color: #00689d;
|
|
22
|
+
}
|
|
23
|
+
.breadcrumb-item {
|
|
24
|
+
display: flex;
|
|
25
|
+
align-items: center;
|
|
26
|
+
height: 32px;
|
|
27
|
+
border-radius: 9999px;
|
|
28
|
+
color: #00689d;
|
|
29
|
+
}
|
|
30
|
+
.breadcrumb-item--highlight {
|
|
31
|
+
padding: 0 20px;
|
|
32
|
+
box-shadow: 0px 6px 6px 0px #00537d1a;
|
|
33
|
+
background: linear-gradient(270.22deg, #007dbc 43.94%, #7ebee0 114.83%);
|
|
34
|
+
color: #ffffff;
|
|
35
|
+
}
|
|
36
|
+
.breadcrumb-item--link {
|
|
37
|
+
cursor: pointer;
|
|
38
|
+
}
|
|
39
|
+
.breadcrumb-item--link:hover {
|
|
40
|
+
text-decoration: underline;
|
|
41
|
+
}
|
|
42
|
+
.breadcrumb-item--icon {
|
|
43
|
+
padding-right: 8px;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/* ######### */
|
|
47
|
+
/* DIVIDER */
|
|
48
|
+
.navigation-divider {
|
|
49
|
+
flex: 1;
|
|
50
|
+
height: 1px;
|
|
51
|
+
margin: 4px 0;
|
|
52
|
+
background: #b3bac3;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/* ######### */
|
|
56
|
+
/* ACTIONS */
|
|
57
|
+
.navigation-actions {
|
|
58
|
+
/* flex items-center [&>*]:ml-4 */
|
|
59
|
+
display: flex;
|
|
60
|
+
align-items: center;
|
|
61
|
+
}
|
|
62
|
+
.navigation-actions > * {
|
|
63
|
+
margin-left: 16px;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/* ######### */
|
|
67
|
+
/* GLOBALS */
|
|
68
|
+
* {
|
|
69
|
+
font-size: 14px;
|
|
70
|
+
outline: none;
|
|
71
|
+
box-sizing: border-box;
|
|
72
|
+
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans',
|
|
73
|
+
'Helvetica Neue', sans-serif;
|
|
74
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Children, PropsWithChildren } from 'react';
|
|
3
|
+
import { isSuiteElement } from '../../utils/validator.utils';
|
|
4
|
+
import './Navigation.css';
|
|
5
|
+
|
|
6
|
+
export const Navigation = ({ children }: PropsWithChildren) => {
|
|
7
|
+
const breadcrumbElement = Children.toArray(children).find(c => isSuiteElement(c, 'NavigationBreadcrumb'));
|
|
8
|
+
const actionsElement = Children.toArray(children).find(c => isSuiteElement(c, 'NavigationActions'));
|
|
9
|
+
|
|
10
|
+
// #########
|
|
11
|
+
// Rendering
|
|
12
|
+
return (
|
|
13
|
+
<div className="navigation">
|
|
14
|
+
{breadcrumbElement}
|
|
15
|
+
<div className="navigation-divider" />
|
|
16
|
+
{actionsElement}
|
|
17
|
+
</div>
|
|
18
|
+
);
|
|
19
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type NavigationBreadcrumbItemProps = { icon?: string; highlight?: boolean; onClick?: () => void };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Children, PropsWithChildren } from 'react';
|
|
3
|
+
import { NavigationBreadcrumbItemProps } from './Navigation.types';
|
|
4
|
+
import { Icon } from '../../components/Icon/Icon';
|
|
5
|
+
import { isSuiteElement } from '../../utils/validator.utils';
|
|
6
|
+
import './Navigation.css';
|
|
7
|
+
|
|
8
|
+
export const NavigationBreadcrumbItem = ({
|
|
9
|
+
children,
|
|
10
|
+
icon,
|
|
11
|
+
highlight,
|
|
12
|
+
onClick,
|
|
13
|
+
}: PropsWithChildren<NavigationBreadcrumbItemProps>) => {
|
|
14
|
+
// #########
|
|
15
|
+
// Rendering
|
|
16
|
+
return (
|
|
17
|
+
<div
|
|
18
|
+
className={`
|
|
19
|
+
breadcrumb-item
|
|
20
|
+
${highlight ? 'breadcrumb-item--highlight' : ''} ${onClick ? 'breadcrumb-item--link' : ''}
|
|
21
|
+
`}
|
|
22
|
+
onClick={onClick}
|
|
23
|
+
>
|
|
24
|
+
{icon && (
|
|
25
|
+
<div className="breadcrumb-item--icon">
|
|
26
|
+
<Icon name={icon} size="16" />
|
|
27
|
+
</div>
|
|
28
|
+
)}
|
|
29
|
+
|
|
30
|
+
{children}
|
|
31
|
+
</div>
|
|
32
|
+
);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const NavigationBreadcrumb = ({ children }: PropsWithChildren) => {
|
|
36
|
+
const breadcrumbItemElements = Children.toArray(children).filter(c => isSuiteElement(c, 'NavigationBreadcrumbItem'));
|
|
37
|
+
|
|
38
|
+
// #########
|
|
39
|
+
// Rendering
|
|
40
|
+
return (
|
|
41
|
+
<div className="breadcrumb">
|
|
42
|
+
{breadcrumbItemElements.map((child, index) => (
|
|
43
|
+
<div key={index} className="breadcrumb-container">
|
|
44
|
+
{child}
|
|
45
|
+
|
|
46
|
+
{index !== breadcrumbItemElements.length - 1 && (
|
|
47
|
+
<div className="breadcrumb-chevron">
|
|
48
|
+
<Icon name="chevron-right" />
|
|
49
|
+
</div>
|
|
50
|
+
)}
|
|
51
|
+
</div>
|
|
52
|
+
))}
|
|
53
|
+
</div>
|
|
54
|
+
);
|
|
55
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ArgsTable, Canvas, Meta, Story } from '@storybook/blocks';
|
|
3
|
+
import { Navigation } from '../Navigation';
|
|
4
|
+
import { NavigationBreadcrumb, NavigationBreadcrumbItem } from '../NavigationBreadcrumb';
|
|
5
|
+
import { NavigationActions } from '../NavigationActions';
|
|
6
|
+
import { Button } from '../../../components/Button/Button';
|
|
7
|
+
import { icons } from '../../../components/Icon/icons';
|
|
8
|
+
|
|
9
|
+
<Meta title="Layouts/Navigation" />
|
|
10
|
+
|
|
11
|
+
# Navigation
|
|
12
|
+
|
|
13
|
+
Breadcrumbs are an important navigation component that shows content hierarchy. They allow users to be aware of their current location in the hierarchical structure of the application. Breadcrumbs enable users to quickly move up to a parent level. Moreover this navigation component allows user to make some actions.
|
|
14
|
+
|
|
15
|
+
## Overview
|
|
16
|
+
|
|
17
|
+
<Canvas>
|
|
18
|
+
<Story
|
|
19
|
+
name="Overview"
|
|
20
|
+
args={{
|
|
21
|
+
children: [
|
|
22
|
+
<NavigationBreadcrumb>
|
|
23
|
+
<NavigationBreadcrumbItem icon="home" onClick={() => {}}>
|
|
24
|
+
Home
|
|
25
|
+
</NavigationBreadcrumbItem>
|
|
26
|
+
<NavigationBreadcrumbItem onClick={() => {}}>Menu Item 1</NavigationBreadcrumbItem>
|
|
27
|
+
<NavigationBreadcrumbItem highlight>Menu Item 2</NavigationBreadcrumbItem>
|
|
28
|
+
</NavigationBreadcrumb>,
|
|
29
|
+
<NavigationActions>
|
|
30
|
+
<Button icon="check" onClick={() => {}}>
|
|
31
|
+
Action 1
|
|
32
|
+
</Button>
|
|
33
|
+
<Button icon="plus" onClick={() => {}}>
|
|
34
|
+
Action 2
|
|
35
|
+
</Button>
|
|
36
|
+
</NavigationActions>,
|
|
37
|
+
],
|
|
38
|
+
}}
|
|
39
|
+
>
|
|
40
|
+
{args => <Navigation>{args.children}</Navigation>}
|
|
41
|
+
</Story>
|
|
42
|
+
</Canvas>
|
|
43
|
+
|
|
44
|
+
## Props
|
|
45
|
+
|
|
46
|
+
<ArgsTable story="Overview" of={Navigation} />
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const capitalize = (str: string) => str.charAt(0).toUpperCase() + str.slice(1).toLowerCase();
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { JSXElementConstructor, ReactElement, ReactNode, ReactPortal, isValidElement } from 'react';
|
|
2
|
+
|
|
3
|
+
export const isSuiteElement = (
|
|
4
|
+
element: string | number | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal,
|
|
5
|
+
name: string,
|
|
6
|
+
) => {
|
|
7
|
+
return isValidElement(element) && typeof element.type === 'function' && element.type.name === name;
|
|
8
|
+
};
|