@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,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
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Navigation = void 0;
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const validator_utils_1 = require("../../utils/validator.utils");
|
|
7
|
+
require("./Navigation.css");
|
|
8
|
+
const Navigation = ({ children }) => {
|
|
9
|
+
const breadcrumbElement = react_1.Children.toArray(children).find(c => (0, validator_utils_1.isSuiteElement)(c, 'NavigationBreadcrumb'));
|
|
10
|
+
const actionsElement = react_1.Children.toArray(children).find(c => (0, validator_utils_1.isSuiteElement)(c, 'NavigationActions'));
|
|
11
|
+
// #########
|
|
12
|
+
// Rendering
|
|
13
|
+
return (React.createElement("div", { className: "navigation" },
|
|
14
|
+
breadcrumbElement,
|
|
15
|
+
React.createElement("div", { className: "navigation-divider" }),
|
|
16
|
+
actionsElement));
|
|
17
|
+
};
|
|
18
|
+
exports.Navigation = Navigation;
|
|
19
|
+
//# sourceMappingURL=Navigation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Navigation.js","sourceRoot":"","sources":["../../../src/layouts/Navigation/Navigation.tsx"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,iCAAoD;AACpD,iEAA6D;AAC7D,4BAA0B;AAEnB,MAAM,UAAU,GAAG,CAAC,EAAE,QAAQ,EAAqB,EAAE,EAAE;IAC5D,MAAM,iBAAiB,GAAG,gBAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,IAAA,gCAAc,EAAC,CAAC,EAAE,sBAAsB,CAAC,CAAC,CAAC;IAC1G,MAAM,cAAc,GAAG,gBAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,IAAA,gCAAc,EAAC,CAAC,EAAE,mBAAmB,CAAC,CAAC,CAAC;IAEpG,YAAY;IACZ,YAAY;IACZ,OAAO,CACL,6BAAK,SAAS,EAAC,YAAY;QACxB,iBAAiB;QAClB,6BAAK,SAAS,EAAC,oBAAoB,GAAG;QACrC,cAAc,CACX,CACP,CAAC;AACJ,CAAC,CAAC;AAbW,QAAA,UAAU,cAarB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Navigation.types.js","sourceRoot":"","sources":["../../../src/layouts/Navigation/Navigation.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NavigationActions = void 0;
|
|
4
|
+
const React = require("react");
|
|
5
|
+
require("./Navigation.css");
|
|
6
|
+
const NavigationActions = ({ children }) => (React.createElement("div", { className: "navigation-actions" }, children));
|
|
7
|
+
exports.NavigationActions = NavigationActions;
|
|
8
|
+
//# sourceMappingURL=NavigationActions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NavigationActions.js","sourceRoot":"","sources":["../../../src/layouts/Navigation/NavigationActions.tsx"],"names":[],"mappings":";;;AAAA,+BAA+B;AAE/B,4BAA0B;AAEnB,MAAM,iBAAiB,GAAG,CAAC,EAAE,QAAQ,EAAqB,EAAE,EAAE,CAAC,CACpE,6BAAK,SAAS,EAAC,oBAAoB,IAAE,QAAQ,CAAO,CACrD,CAAC;AAFW,QAAA,iBAAiB,qBAE5B"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { PropsWithChildren } from 'react';
|
|
3
|
+
import { NavigationBreadcrumbItemProps } from './Navigation.types';
|
|
4
|
+
import './Navigation.css';
|
|
5
|
+
export declare const NavigationBreadcrumbItem: ({ children, icon, highlight, onClick, }: PropsWithChildren<NavigationBreadcrumbItemProps>) => React.JSX.Element;
|
|
6
|
+
export declare const NavigationBreadcrumb: ({ children }: PropsWithChildren) => React.JSX.Element;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NavigationBreadcrumb = exports.NavigationBreadcrumbItem = void 0;
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const Icon_1 = require("../../components/Icon/Icon");
|
|
7
|
+
const validator_utils_1 = require("../../utils/validator.utils");
|
|
8
|
+
require("./Navigation.css");
|
|
9
|
+
const NavigationBreadcrumbItem = ({ children, icon, highlight, onClick, }) => {
|
|
10
|
+
// #########
|
|
11
|
+
// Rendering
|
|
12
|
+
return (React.createElement("div", { className: `
|
|
13
|
+
breadcrumb-item
|
|
14
|
+
${highlight ? 'breadcrumb-item--highlight' : ''} ${onClick ? 'breadcrumb-item--link' : ''}
|
|
15
|
+
`, onClick: onClick },
|
|
16
|
+
icon && (React.createElement("div", { className: "breadcrumb-item--icon" },
|
|
17
|
+
React.createElement(Icon_1.Icon, { name: icon, size: "16" }))),
|
|
18
|
+
children));
|
|
19
|
+
};
|
|
20
|
+
exports.NavigationBreadcrumbItem = NavigationBreadcrumbItem;
|
|
21
|
+
const NavigationBreadcrumb = ({ children }) => {
|
|
22
|
+
const breadcrumbItemElements = react_1.Children.toArray(children).filter(c => (0, validator_utils_1.isSuiteElement)(c, 'NavigationBreadcrumbItem'));
|
|
23
|
+
// #########
|
|
24
|
+
// Rendering
|
|
25
|
+
return (React.createElement("div", { className: "breadcrumb" }, breadcrumbItemElements.map((child, index) => (React.createElement("div", { key: index, className: "breadcrumb-container" },
|
|
26
|
+
child,
|
|
27
|
+
index !== breadcrumbItemElements.length - 1 && (React.createElement("div", { className: "breadcrumb-chevron" },
|
|
28
|
+
React.createElement(Icon_1.Icon, { name: "chevron-right" }))))))));
|
|
29
|
+
};
|
|
30
|
+
exports.NavigationBreadcrumb = NavigationBreadcrumb;
|
|
31
|
+
//# sourceMappingURL=NavigationBreadcrumb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NavigationBreadcrumb.js","sourceRoot":"","sources":["../../../src/layouts/Navigation/NavigationBreadcrumb.tsx"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,iCAAoD;AAEpD,qDAAkD;AAClD,iEAA6D;AAC7D,4BAA0B;AAEnB,MAAM,wBAAwB,GAAG,CAAC,EACvC,QAAQ,EACR,IAAI,EACJ,SAAS,EACT,OAAO,GAC0C,EAAE,EAAE;IACrD,YAAY;IACZ,YAAY;IACZ,OAAO,CACL,6BACE,SAAS,EAAE;;UAEP,SAAS,CAAC,CAAC,CAAC,4BAA4B,CAAC,CAAC,CAAC,EAAE,IAAI,OAAO,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,EAAE;OAC1F,EACD,OAAO,EAAE,OAAO;QAEf,IAAI,IAAI,CACP,6BAAK,SAAS,EAAC,uBAAuB;YACpC,oBAAC,WAAI,IAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAC,IAAI,GAAG,CAC1B,CACP;QAEA,QAAQ,CACL,CACP,CAAC;AACJ,CAAC,CAAC;AAzBW,QAAA,wBAAwB,4BAyBnC;AAEK,MAAM,oBAAoB,GAAG,CAAC,EAAE,QAAQ,EAAqB,EAAE,EAAE;IACtE,MAAM,sBAAsB,GAAG,gBAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,IAAA,gCAAc,EAAC,CAAC,EAAE,0BAA0B,CAAC,CAAC,CAAC;IAErH,YAAY;IACZ,YAAY;IACZ,OAAO,CACL,6BAAK,SAAS,EAAC,YAAY,IACxB,sBAAsB,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CAC5C,6BAAK,GAAG,EAAE,KAAK,EAAE,SAAS,EAAC,sBAAsB;QAC9C,KAAK;QAEL,KAAK,KAAK,sBAAsB,CAAC,MAAM,GAAG,CAAC,IAAI,CAC9C,6BAAK,SAAS,EAAC,oBAAoB;YACjC,oBAAC,WAAI,IAAC,IAAI,EAAC,eAAe,GAAG,CACzB,CACP,CACG,CACP,CAAC,CACE,CACP,CAAC;AACJ,CAAC,CAAC;AApBW,QAAA,oBAAoB,wBAoB/B"}
|
|
@@ -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 declare const capitalize: (str: string) => string;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.capitalize = void 0;
|
|
4
|
+
const capitalize = (str) => str.charAt(0).toUpperCase() + str.slice(1).toLowerCase();
|
|
5
|
+
exports.capitalize = capitalize;
|
|
6
|
+
//# sourceMappingURL=string.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"string.utils.js","sourceRoot":"","sources":["../../src/utils/string.utils.ts"],"names":[],"mappings":";;;AAAO,MAAM,UAAU,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;AAAvF,QAAA,UAAU,cAA6E"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isSuiteElement = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const isSuiteElement = (element, name) => {
|
|
6
|
+
return (0, react_1.isValidElement)(element) && typeof element.type === 'function' && element.type.name === name;
|
|
7
|
+
};
|
|
8
|
+
exports.isSuiteElement = isSuiteElement;
|
|
9
|
+
//# sourceMappingURL=validator.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validator.utils.js","sourceRoot":"","sources":["../../src/utils/validator.utils.ts"],"names":[],"mappings":";;;AAAA,iCAAoG;AAE7F,MAAM,cAAc,GAAG,CAC5B,OAAqH,EACrH,IAAY,EACZ,EAAE;IACF,OAAO,IAAA,sBAAc,EAAC,OAAO,CAAC,IAAI,OAAO,OAAO,CAAC,IAAI,KAAK,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC;AACrG,CAAC,CAAC;AALW,QAAA,cAAc,kBAKzB"}
|
package/package.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@dktunited-techoff/techoff-suite-ui",
|
|
3
|
+
"version": "0.8.0",
|
|
4
|
+
"main": "lib/index.js",
|
|
5
|
+
"types": "./lib",
|
|
6
|
+
"module": "esm/index.js",
|
|
7
|
+
"files": [
|
|
8
|
+
"esm",
|
|
9
|
+
"lib",
|
|
10
|
+
"src"
|
|
11
|
+
],
|
|
12
|
+
"scripts": {
|
|
13
|
+
"build": "npm run clean && npx ts-node ./bin/build.ts",
|
|
14
|
+
"build:cjs": "tsc",
|
|
15
|
+
"build:esm": "tsc -m es6 --outDir esm",
|
|
16
|
+
"build:icons": "npx ts-node ./bin/build-icons.ts",
|
|
17
|
+
"build:storybook": "storybook build",
|
|
18
|
+
"clean": "rm -rf lib && rm -rf esm",
|
|
19
|
+
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
|
20
|
+
"storybook": "storybook dev -p 6006"
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"react": "^18.2.0",
|
|
24
|
+
"react-dom": "^18.2.0"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@storybook/addon-essentials": "^7.5.3",
|
|
28
|
+
"@storybook/addon-interactions": "^7.5.3",
|
|
29
|
+
"@storybook/addon-links": "^7.5.3",
|
|
30
|
+
"@storybook/addon-onboarding": "^1.0.8",
|
|
31
|
+
"@storybook/blocks": "^7.5.3",
|
|
32
|
+
"@storybook/react": "^7.5.3",
|
|
33
|
+
"@storybook/react-vite": "^7.5.3",
|
|
34
|
+
"@storybook/testing-library": "^0.2.2",
|
|
35
|
+
"@types/fs-extra": "^11.0.4",
|
|
36
|
+
"@types/node": "^20.9.0",
|
|
37
|
+
"@types/react": "^18.2.15",
|
|
38
|
+
"@types/react-dom": "^18.2.7",
|
|
39
|
+
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
|
40
|
+
"@typescript-eslint/parser": "^6.0.0",
|
|
41
|
+
"@vitejs/plugin-react": "^4.0.3",
|
|
42
|
+
"eslint": "^8.45.0",
|
|
43
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
|
44
|
+
"eslint-plugin-react-refresh": "^0.4.3",
|
|
45
|
+
"eslint-plugin-storybook": "^0.6.15",
|
|
46
|
+
"fs-extra": "^11.1.1",
|
|
47
|
+
"storybook": "^7.5.3",
|
|
48
|
+
"typescript": "^5.0.2",
|
|
49
|
+
"vite": "^4.4.5"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
.button {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: center;
|
|
5
|
+
border: none;
|
|
6
|
+
border-radius: 6px;
|
|
7
|
+
font-size: 14px;
|
|
8
|
+
line-height: 16px;
|
|
9
|
+
font-weight: 500;
|
|
10
|
+
cursor: pointer;
|
|
11
|
+
transition: all ease 0.3s;
|
|
12
|
+
}
|
|
13
|
+
.button > div {
|
|
14
|
+
margin-right: 8px;
|
|
15
|
+
}
|
|
16
|
+
.button > div:last-child {
|
|
17
|
+
margin-right: 0px;
|
|
18
|
+
}
|
|
19
|
+
/* ####### */
|
|
20
|
+
/* BLOCK */
|
|
21
|
+
.button--block {
|
|
22
|
+
width: 100%;
|
|
23
|
+
}
|
|
24
|
+
/* ####### */
|
|
25
|
+
/* SIZES */
|
|
26
|
+
.button--md {
|
|
27
|
+
height: 32px;
|
|
28
|
+
padding: 0 14px;
|
|
29
|
+
}
|
|
30
|
+
.button--md.button--icon-only {
|
|
31
|
+
width: 32px;
|
|
32
|
+
padding: 0;
|
|
33
|
+
}
|
|
34
|
+
.button--lg {
|
|
35
|
+
height: 40px;
|
|
36
|
+
padding: 0 16px;
|
|
37
|
+
}
|
|
38
|
+
.button--lg.button--icon-only {
|
|
39
|
+
width: 40px;
|
|
40
|
+
padding: 0;
|
|
41
|
+
}
|
|
42
|
+
/* ########## */
|
|
43
|
+
/* VARIANTS */
|
|
44
|
+
.button--primary {
|
|
45
|
+
background: #007dbc;
|
|
46
|
+
color: #ffffff;
|
|
47
|
+
}
|
|
48
|
+
.button--primary:hover {
|
|
49
|
+
background: #00689d;
|
|
50
|
+
}
|
|
51
|
+
.button--secondary {
|
|
52
|
+
background: #e7f3f9;
|
|
53
|
+
color: #007dbc;
|
|
54
|
+
}
|
|
55
|
+
.button--secondary:hover {
|
|
56
|
+
background: #bedeef;
|
|
57
|
+
}
|
|
58
|
+
.button--success {
|
|
59
|
+
background: #02be8a;
|
|
60
|
+
color: #ffffff;
|
|
61
|
+
}
|
|
62
|
+
.button--success:hover {
|
|
63
|
+
background: #029e73;
|
|
64
|
+
color: #ffffff;
|
|
65
|
+
}
|
|
66
|
+
.button--ghost {
|
|
67
|
+
background: #ffffff;
|
|
68
|
+
color: #1d1d1b;
|
|
69
|
+
font-weight: 400;
|
|
70
|
+
}
|
|
71
|
+
.button--ghost:hover {
|
|
72
|
+
background: #e7f3f9;
|
|
73
|
+
}
|
|
74
|
+
.button--shadow {
|
|
75
|
+
box-shadow: 0px 12px 12px 0px #00537d1a;
|
|
76
|
+
background: #ffffff;
|
|
77
|
+
color: #4e5d6b;
|
|
78
|
+
}
|
|
79
|
+
/* ######### */
|
|
80
|
+
/* ROUNDED */
|
|
81
|
+
.button--rounded {
|
|
82
|
+
border-radius: 9999px;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/* ######### */
|
|
86
|
+
/* GLOBALS */
|
|
87
|
+
* {
|
|
88
|
+
font-size: 14px;
|
|
89
|
+
outline: none;
|
|
90
|
+
box-sizing: border-box;
|
|
91
|
+
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans',
|
|
92
|
+
'Helvetica Neue', sans-serif;
|
|
93
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { PropsWithChildren } from 'react';
|
|
3
|
+
import { Icon } from '../Icon/Icon';
|
|
4
|
+
import { ButtonProps } from './Button.types';
|
|
5
|
+
import './Button.css';
|
|
6
|
+
|
|
7
|
+
export const Button = ({
|
|
8
|
+
children,
|
|
9
|
+
icon,
|
|
10
|
+
iconDirection = 'left',
|
|
11
|
+
size = 'md',
|
|
12
|
+
variant = 'primary',
|
|
13
|
+
block,
|
|
14
|
+
rounded,
|
|
15
|
+
onClick,
|
|
16
|
+
}: PropsWithChildren<ButtonProps>) => {
|
|
17
|
+
// #########
|
|
18
|
+
// Rendering
|
|
19
|
+
return (
|
|
20
|
+
<button
|
|
21
|
+
className={`
|
|
22
|
+
button button--${size} button--${variant}
|
|
23
|
+
${block ? 'button--block' : ''}
|
|
24
|
+
${rounded ? 'button--rounded' : ''}
|
|
25
|
+
${icon && !children ? 'button--icon-only' : ''}
|
|
26
|
+
`}
|
|
27
|
+
onClick={onClick}
|
|
28
|
+
>
|
|
29
|
+
{icon && iconDirection === 'left' && <Icon name={icon} size="16" />}
|
|
30
|
+
{children && <div>{children}</div>}
|
|
31
|
+
{icon && iconDirection === 'right' && <Icon name={icon} size="16" />}
|
|
32
|
+
</button>
|
|
33
|
+
);
|
|
34
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ArgsTable, Canvas, Meta, Story } from '@storybook/blocks';
|
|
3
|
+
import { Button } from '../Button';
|
|
4
|
+
import { icons } from '../../Icon/icons';
|
|
5
|
+
|
|
6
|
+
<Meta title="Components/Button" />
|
|
7
|
+
|
|
8
|
+
export const buttonArgTypes = {
|
|
9
|
+
children: {
|
|
10
|
+
control: 'text',
|
|
11
|
+
description: 'Child of the button.',
|
|
12
|
+
},
|
|
13
|
+
icon: {
|
|
14
|
+
control: 'select',
|
|
15
|
+
options: Object.keys(icons),
|
|
16
|
+
description: 'Icon of the button.',
|
|
17
|
+
},
|
|
18
|
+
iconDirection: {
|
|
19
|
+
control: 'inline-radio',
|
|
20
|
+
options: ['left', 'right'],
|
|
21
|
+
description: 'Define the direction of the icon.',
|
|
22
|
+
table: { defaultValue: { summary: 'left' } },
|
|
23
|
+
},
|
|
24
|
+
size: {
|
|
25
|
+
control: 'inline-radio',
|
|
26
|
+
options: ['md', 'lg'],
|
|
27
|
+
description: 'Define the size of the button.',
|
|
28
|
+
table: { defaultValue: { summary: 'md' } },
|
|
29
|
+
},
|
|
30
|
+
variant: {
|
|
31
|
+
control: 'inline-radio',
|
|
32
|
+
options: ['primary', 'secondary', 'success', 'ghost', 'shadow'],
|
|
33
|
+
description: "Variant of the button defining it's color and outline.",
|
|
34
|
+
table: { defaultValue: { summary: 'primary' } },
|
|
35
|
+
},
|
|
36
|
+
block: {
|
|
37
|
+
control: 'boolean',
|
|
38
|
+
description: 'Define if the button is full width',
|
|
39
|
+
table: { defaultValue: { summary: 'false' } },
|
|
40
|
+
},
|
|
41
|
+
rounded: {
|
|
42
|
+
control: 'boolean',
|
|
43
|
+
description: 'Define if the button has its corner full rounded',
|
|
44
|
+
table: { defaultValue: { summary: 'false' } },
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
# Button
|
|
49
|
+
|
|
50
|
+
Buttons express what action will occur when the users clicks. Buttons are used to initialize an action, either in the background or foreground of an experience.
|
|
51
|
+
|
|
52
|
+
## Overview
|
|
53
|
+
|
|
54
|
+
<Canvas>
|
|
55
|
+
<Story
|
|
56
|
+
name="Overview"
|
|
57
|
+
args={{
|
|
58
|
+
children: 'Button',
|
|
59
|
+
iconDirection: 'left',
|
|
60
|
+
size: 'md',
|
|
61
|
+
variant: 'primary',
|
|
62
|
+
block: false,
|
|
63
|
+
rounded: false,
|
|
64
|
+
onClick: () => {},
|
|
65
|
+
}}
|
|
66
|
+
argTypes={buttonArgTypes}
|
|
67
|
+
>
|
|
68
|
+
{args => <Button {...args}>{args.children}</Button>}
|
|
69
|
+
</Story>
|
|
70
|
+
</Canvas>
|
|
71
|
+
|
|
72
|
+
## Props
|
|
73
|
+
|
|
74
|
+
<ArgsTable story="Overview" of={Button} />
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
.checkbox {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
cursor: pointer;
|
|
5
|
+
}
|
|
6
|
+
/* ##### */
|
|
7
|
+
/* BOX */
|
|
8
|
+
.checkbox:hover .checkbox-box {
|
|
9
|
+
background: #e7f3f9;
|
|
10
|
+
}
|
|
11
|
+
.checkbox-box {
|
|
12
|
+
position: relative;
|
|
13
|
+
display: flex;
|
|
14
|
+
align-items: center;
|
|
15
|
+
justify-content: center;
|
|
16
|
+
width: 24px;
|
|
17
|
+
height: 24px;
|
|
18
|
+
border-radius: 6px;
|
|
19
|
+
color: #007dbc;
|
|
20
|
+
transition: all ease 0.3s;
|
|
21
|
+
}
|
|
22
|
+
.checkbox-box::before {
|
|
23
|
+
content: '';
|
|
24
|
+
position: absolute;
|
|
25
|
+
width: 16px;
|
|
26
|
+
height: 16px;
|
|
27
|
+
border-radius: 6px;
|
|
28
|
+
background: #ffffff;
|
|
29
|
+
z-index: 10;
|
|
30
|
+
}
|
|
31
|
+
.checkbox-box .icon {
|
|
32
|
+
z-index: 20;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/* ################# */
|
|
36
|
+
/* LABEL / CAPTION */
|
|
37
|
+
.checkbox-container {
|
|
38
|
+
width: 100%;
|
|
39
|
+
margin-left: 4px;
|
|
40
|
+
padding: 4px 8px;
|
|
41
|
+
border-radius: 6px;
|
|
42
|
+
}
|
|
43
|
+
.checkbox-container--with-caption .checkbox-label {
|
|
44
|
+
color: #007dbc;
|
|
45
|
+
font-weight: 700;
|
|
46
|
+
}
|
|
47
|
+
.checkbox-caption {
|
|
48
|
+
color: #404040;
|
|
49
|
+
font-size: 12px;
|
|
50
|
+
font-style: italic;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/* ######### */
|
|
54
|
+
/* GLOBALS */
|
|
55
|
+
* {
|
|
56
|
+
font-size: 14px;
|
|
57
|
+
outline: none;
|
|
58
|
+
box-sizing: border-box;
|
|
59
|
+
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans',
|
|
60
|
+
'Helvetica Neue', sans-serif;
|
|
61
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Children, PropsWithChildren } from 'react';
|
|
3
|
+
import { isSuiteElement } from '../../utils/validator.utils';
|
|
4
|
+
import { Icon } from '../Icon/Icon';
|
|
5
|
+
import { CheckboxProps } from './Checkbox.types';
|
|
6
|
+
import './Checkbox.css';
|
|
7
|
+
|
|
8
|
+
export const CheckboxLabel = ({ children }: PropsWithChildren) => <div className="checkbox-label">{children}</div>;
|
|
9
|
+
export const CheckboxCaption = ({ children }: PropsWithChildren) => <div className="checkbox-caption">{children}</div>;
|
|
10
|
+
|
|
11
|
+
export const Checkbox = ({ children, checked, onChange }: PropsWithChildren<CheckboxProps>) => {
|
|
12
|
+
const labelElement = Children.toArray(children).find(c => isSuiteElement(c, 'CheckboxLabel'));
|
|
13
|
+
const captionElement = Children.toArray(children).find(c => isSuiteElement(c, 'CheckboxCaption'));
|
|
14
|
+
|
|
15
|
+
// #########
|
|
16
|
+
// Rendering
|
|
17
|
+
return (
|
|
18
|
+
<div className="checkbox" onClick={() => onChange(!checked)}>
|
|
19
|
+
<div className="checkbox-box">
|
|
20
|
+
{checked && <Icon name="square-check-filled" />}
|
|
21
|
+
{!checked && <Icon name="square" />}
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
<div className={`checkbox-container ${captionElement ? 'checkbox-container--with-caption' : ''}`}>
|
|
25
|
+
{labelElement}
|
|
26
|
+
{captionElement}
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
);
|
|
30
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type CheckboxProps = { checked?: boolean; onChange: (value: boolean) => void };
|