@cashub/ui-elv 1.0.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/Tab/Tab.js +28 -0
- package/Tab/TabList.js +167 -0
- package/Tab/TabPanel.js +49 -0
- package/Tab/TabTab.js +105 -0
- package/Tab/index.js +30 -0
- package/Tab/subComponent/TabContext.js +9 -0
- package/Tab/subComponent/TabListV2.js +25 -0
- package/Tab/subComponent/TabPanelV2.js +52 -0
- package/Tab/subComponent/TabTabV2.js +63 -0
- package/VerticalTab/TabList.js +27 -0
- package/VerticalTab/TabPanel.js +52 -0
- package/VerticalTab/TabTab.js +70 -0
- package/VerticalTab/VerticalTab.js +41 -0
- package/VerticalTab/index.js +16 -0
- package/VerticalTab/subComponent/TabContext.js +9 -0
- package/alert/Alert.js +29 -0
- package/alert/index.js +13 -0
- package/animate/Collapse.js +71 -0
- package/animate/Loader.js +58 -0
- package/animate/NumberCounter.js +51 -0
- package/animate/PulseRing.js +35 -0
- package/animate/Spinner.js +18 -0
- package/animate/index.js +41 -0
- package/assets/css/autocomplete.css +16 -0
- package/assets/css/font.css +4 -0
- package/assets/css/global.css +2 -0
- package/assets/font/helvetica/Helvetica.ttf +0 -0
- package/assets/font/nanumGothic/NanumGothic-Bold.ttf +0 -0
- package/assets/font/nanumGothic/NanumGothic-ExtraBold.ttf +0 -0
- package/assets/font/nanumGothic/NanumGothic-Regular.ttf +0 -0
- package/assets/icons/app-management.png +0 -0
- package/assets/icons/burger-black.png +0 -0
- package/assets/icons/burger-white.png +0 -0
- package/assets/icons/burger.png +0 -0
- package/assets/icons/file.svg +1 -0
- package/assets/icons/map_icon1.png +0 -0
- package/assets/icons/map_icon4.png +0 -0
- package/assets/images/bg-aside.png +0 -0
- package/assets/images/bg-chart-circle.png +0 -0
- package/assets/images/bg-chart-triangle.png +0 -0
- package/assets/images/cashub-logo-only.png +0 -0
- package/assets/images/default-user.jpg +0 -0
- package/assets/images/logo-cashub.png +0 -0
- package/assets/images/map.png +0 -0
- package/assets/images/qrcode.png +0 -0
- package/backdrop/BaseBackdrop.js +18 -0
- package/backdrop/LoadingBackdrop.js +17 -0
- package/backdrop/ModalBackdrop.js +15 -0
- package/backdrop/index.js +27 -0
- package/badge/Badge.js +26 -0
- package/badge/BadgeDot.js +18 -0
- package/badge/BadgeFill.js +49 -0
- package/badge/BadgeFillTriangle.js +147 -0
- package/badge/BadgeWithText.js +31 -0
- package/badge/index.js +41 -0
- package/billing/BarChart.js +51 -0
- package/billing/Grid.js +45 -0
- package/billing/Header2.js +25 -0
- package/billing/Header3.js +37 -0
- package/billing/Paragraph.js +33 -0
- package/billing/ParagraphGroup.js +22 -0
- package/billing/ParagraphText.js +26 -0
- package/billing/Section.js +50 -0
- package/billing/SectionBody.js +17 -0
- package/billing/SectionHeader.js +26 -0
- package/billing/__stories__/BarChart.stories.js_bak +46 -0
- package/billing/__stories__/Grid.stories.js_bak +57 -0
- package/billing/__stories__/Header2.stories.js_bak +62 -0
- package/billing/__stories__/Header3.stories.js_bak +69 -0
- package/billing/__stories__/Paragraph.stories.js_bak +84 -0
- package/billing/__stories__/ParagraphGroup.stories.js_bak +68 -0
- package/billing/__stories__/ParagraphText.stories.js_bak +64 -0
- package/billing/__stories__/Section.stories.js_bak +115 -0
- package/billing/__stories__/SectionBody.stories.js_bak +62 -0
- package/billing/__stories__/SectionHeader.stories.js-bak +68 -0
- package/breadcrumb/Breadcrumb.js +78 -0
- package/breadcrumb/index.js +13 -0
- package/button/Button.js +154 -0
- package/button/ButtonGroup.js +61 -0
- package/button/IconButton.js +72 -0
- package/button/ScrollToTopButton.js +54 -0
- package/button/index.js +34 -0
- package/callout/Callout.js +52 -0
- package/callout/index.js +13 -0
- package/chart/BarChart.js +148 -0
- package/chart/DoughnutChart.js +118 -0
- package/chart/LineChart.js +146 -0
- package/chart/SingleBarChart.js +42 -0
- package/chart/index.js +52 -0
- package/chart/utils/centerTextPlugin.js +62 -0
- package/chart/utils/customTooltip.js +94 -0
- package/chart/utils/htmlLegendPlugin.js +89 -0
- package/chart/utils/index.js +27 -0
- package/chart/utils/padEmptyChartBar.js +53 -0
- package/chart/utils/yAxisTopTitlePlugin.js +49 -0
- package/container/FlexContainer.js +40 -0
- package/container/index.js +13 -0
- package/cropper/Cropper.js +54 -0
- package/cropper/CropperModalHandler.js +41 -0
- package/cropper/index.js +20 -0
- package/cropper/subComponent/CropImageModal.js +79 -0
- package/datetimePicker/DatePicker.js +363 -0
- package/datetimePicker/DatePickerV2.js +407 -0
- package/datetimePicker/DatetimePicker.js +240 -0
- package/datetimePicker/DatetimePickerV2.js +395 -0
- package/datetimePicker/DatetimePickerV3.js +279 -0
- package/datetimePicker/TimeInput.js +56 -0
- package/datetimePicker/TimePicker.js +317 -0
- package/datetimePicker/TimePickerStyle.js +64 -0
- package/datetimePicker/TimePickerV2.js +208 -0
- package/datetimePicker/accordion/Month.js +254 -0
- package/datetimePicker/accordion/Year.js +284 -0
- package/datetimePicker/hooks/index.js +27 -0
- package/datetimePicker/hooks/useChangeNumber.js +42 -0
- package/datetimePicker/hooks/useDecrease.js +38 -0
- package/datetimePicker/hooks/useIncrease.js +38 -0
- package/datetimePicker/index.js +69 -0
- package/datetimePicker/provider/constant.js +43 -0
- package/datetimePicker/subComponent/Accordion.js +373 -0
- package/datetimePicker/subComponent/CustomTimeInput.js +47 -0
- package/datetimePicker/subComponent/DateTimePickerContext.js +9 -0
- package/datetimePicker/utils/GMTDate.js +15 -0
- package/datetimePicker/utils/pad.js +13 -0
- package/datetimePicker/utils/toUTC0.js +13 -0
- package/descriptionList/DescriptionDetail.js +28 -0
- package/descriptionList/DescriptionList.js +25 -0
- package/descriptionList/DescriptionTerm.js +14 -0
- package/descriptionList/index.js +27 -0
- package/divider/Divider.js +31 -0
- package/divider/index.js +13 -0
- package/dropdown/Dropdown.js +55 -0
- package/dropdown/DropdownButtonOption.js +43 -0
- package/dropdown/DropdownContent.js +90 -0
- package/dropdown/DropdownDivOption.js +26 -0
- package/dropdown/DropdownItem.js +26 -0
- package/dropdown/DropdownLinkOption.js +24 -0
- package/dropdown/DropdownToggle.js +38 -0
- package/dropdown/index.js +42 -0
- package/dropdown/subComponent/DropdownContext.js +9 -0
- package/dropzone/FileDropzone.js +479 -0
- package/dropzone/ImageDropzone.js +334 -0
- package/dropzone/index.js +20 -0
- package/dropzone/subComponent/Message.js +26 -0
- package/figure/IconFigure.js +42 -0
- package/figure/ImageFigure.js +38 -0
- package/figure/index.js +20 -0
- package/file/HiddenFileInput.js +15 -0
- package/file/index.js +13 -0
- package/form/Checkbox.js +166 -0
- package/form/Fieldset.js +18 -0
- package/form/FormItem.js +22 -0
- package/form/Input.js +66 -0
- package/form/Label.js +61 -0
- package/form/MutedText.js +21 -0
- package/form/PasswordInput.js +47 -0
- package/form/RadioButton.js +103 -0
- package/form/SearchSelect.js +181 -0
- package/form/Searchbox.js +98 -0
- package/form/Slider.js +46 -0
- package/form/SwitchButton.js +105 -0
- package/form/Textarea.js +41 -0
- package/form/TreeView.js +73 -0
- package/form/index.js +104 -0
- package/grid/Column.js +46 -0
- package/grid/Grid.js +35 -0
- package/grid/index.js +20 -0
- package/heading/Heading1.js +21 -0
- package/heading/Heading2.js +28 -0
- package/heading/Heading3.js +49 -0
- package/heading/index.js +27 -0
- package/helmet/Helmet.js +23 -0
- package/helmet/index.js +20 -0
- package/iconbox/ApplicationIconBox.js +81 -0
- package/iconbox/IconBox.js +67 -0
- package/iconbox/IconBoxV2.js +72 -0
- package/iconbox/index.js +27 -0
- package/iconbox/subComponent/IconBoxFigure.js +50 -0
- package/iconbox/subComponent/IconBoxImage.js +42 -0
- package/image/ImageFluid.js +17 -0
- package/image/UploadImage.js +250 -0
- package/image/index.js +20 -0
- package/index.js +568 -0
- package/jsoneditor/JsonEditor.js +142 -0
- package/jsoneditor/index.js +13 -0
- package/keyframe/Pulse.js +21 -0
- package/keyframe/Spin.js +13 -0
- package/layout/Aside.js +48 -0
- package/layout/AsideHeader.jsx +27 -0
- package/layout/Backdrop.js +23 -0
- package/layout/Container.js +39 -0
- package/layout/Footer.js +45 -0
- package/layout/Header.jsx +55 -0
- package/layout/Layout.jsx +84 -0
- package/layout/Logo.jsx +17 -0
- package/layout/MenuIcon.jsx +27 -0
- package/layout/Sidebar.jsx +271 -0
- package/layout/index.js +13 -0
- package/link/LinkSpan.js +69 -0
- package/link/index.js +13 -0
- package/map/GoogleMap.js +448 -0
- package/map/GoogleReverseGeolocation.js +200 -0
- package/map/LeafletMap.js +231 -0
- package/map/LeafletReverseGeolocation.js +101 -0
- package/map/index.js +34 -0
- package/map/subComponent/BasicLeafletMap.js +34 -0
- package/map/subComponent/GoogleMapContainer.js +29 -0
- package/map/subComponent/GoogleMapPopup.js +109 -0
- package/map/subComponent/GoogleMapWrapper.js +40 -0
- package/map/subComponent/LeafletDrawControl.js +127 -0
- package/map/subComponent/LeafletMapContainer.js +173 -0
- package/map/subComponent/MapSearchBoxControl.js +54 -0
- package/modal/StateModal.js +178 -0
- package/modal/TitleModal.js +250 -0
- package/modal/index.js +20 -0
- package/package.json +54 -0
- package/page/Disclaimer.js +128 -0
- package/page/index.js +13 -0
- package/paginate/Paginate.js +137 -0
- package/paginate/index.js +13 -0
- package/popover/Popover.js +91 -0
- package/popover/index.js +13 -0
- package/qrcode/QRCode.js +58 -0
- package/qrcode/QRCodeContainter.js +34 -0
- package/qrcode/index.js +20 -0
- package/ribbon/Ribbon.js +42 -0
- package/ribbon/index.js +13 -0
- package/section/Section.js +133 -0
- package/section/SectionBody.js +52 -0
- package/section/SectionHeader.js +70 -0
- package/section/SectionToolbar.js +18 -0
- package/section/SectionToolbarItem.js +17 -0
- package/section/index.js +41 -0
- package/select/InputSelect.js +270 -0
- package/select/Select.js +818 -0
- package/select/index.js +20 -0
- package/select/subComponent/Checkbox.js +48 -0
- package/select/subComponent/Footer.js +13 -0
- package/select/subComponent/ListBox.js +30 -0
- package/select/subComponent/Option.js +45 -0
- package/select/subComponent/OptionGroup.js +23 -0
- package/select/subComponent/Options.js +32 -0
- package/select/subComponent/SearchBox.js +58 -0
- package/select/subComponent/SelectedMultipleCount.js +39 -0
- package/select/subComponent/SelectedMultipleTags.js +54 -0
- package/select/subComponent/SelectedMultipleText.js +70 -0
- package/select/subComponent/SelectedSingle.js +17 -0
- package/styles/GlobalStyle.js +334 -0
- package/styles/config/breakpoint.style.js +13 -0
- package/styles/config/header.style.js +10 -0
- package/styles/config/sidebar.style.js +17 -0
- package/styles/index.js +20 -0
- package/styles/mixin/backgroundColor.js +44 -0
- package/styles/mixin/borderColor.js +37 -0
- package/styles/mixin/color.js +37 -0
- package/styles/mixin/colorOnBackground.js +37 -0
- package/styles/mixin/inputPlaceholder.js +30 -0
- package/styles/mixin/media.js +21 -0
- package/styles/mixin/rounded.js +30 -0
- package/styles/mixin/scrollbar.js +32 -0
- package/styles/theme/dark.theme.js +97 -0
- package/styles/theme/light.theme.js +97 -0
- package/styles/theme/white.theme.js +97 -0
- package/styles/themes.js +16 -0
- package/table/GridTable.js +336 -0
- package/table/ImageBox.js +45 -0
- package/table/InfiniteGridTable.js +403 -0
- package/table/PermissionTable.js +64 -0
- package/table/SimpleGridTable.js +143 -0
- package/table/Table.js +568 -0
- package/table/__mock__/columns.js +70 -0
- package/table/__mock__/data.js +536 -0
- package/table/hooks/index.js +20 -0
- package/table/hooks/useCalculateDataRange.js +28 -0
- package/table/hooks/useGenerateSort.js +39 -0
- package/table/index.js +48 -0
- package/table/subComponent/BaseTableHeadCell.js +62 -0
- package/table/subComponent/GridTableFooter.js +24 -0
- package/table/subComponent/GridTableHeadCell.js +20 -0
- package/table/subComponent/Resizer.js +77 -0
- package/table/subComponent/TableFooter.js +31 -0
- package/table/subComponent/TableFooterInfo.js +13 -0
- package/table/subComponent/TableFooterPager.js +33 -0
- package/table/subComponent/TableHeadCell.js +19 -0
- package/table/subComponent/TableSort.js +38 -0
- package/tagify/TagifyStyle.js +60 -0
- package/tagify/Tags.js +56 -0
- package/tagify/index.js +27 -0
- package/tagify/templates/getCreateButtonTemplate.js +18 -0
- package/text/Paragraph.js +86 -0
- package/text/index.js +13 -0
- package/timeline/Timeline.js +139 -0
- package/timeline/index.js +13 -0
- package/toast/CustomToastContainer.js +45 -0
- package/toast/MessageContainer.js +51 -0
- package/toast/index.js +36 -0
- package/toast/show.js +39 -0
- package/toast/style.css +1 -0
- package/tooltip/Tooltip.js +140 -0
- package/tooltip/index.js +13 -0
- package/treeView/TreeViewV2.js +38 -0
- package/treeView/TreeflexStyle.js +49 -0
- package/treeView/index.js +20 -0
- package/wizard/Wizard.js +251 -0
- package/wizard/index.js +13 -0
package/button/Button.js
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
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 _backgroundColor = _interopRequireDefault(require("../styles/mixin/backgroundColor"));
|
|
9
|
+
var _colorOnBackground = _interopRequireDefault(require("../styles/mixin/colorOnBackground"));
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
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); }
|
|
12
|
+
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; }
|
|
13
|
+
const Button = _styledComponents.default.button.attrs(() => ({
|
|
14
|
+
primary: true
|
|
15
|
+
}))`
|
|
16
|
+
display: flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
border: none;
|
|
19
|
+
font-size: var(--font-button);
|
|
20
|
+
line-height: var(--font-body1);
|
|
21
|
+
cursor: ${_ref => {
|
|
22
|
+
let {
|
|
23
|
+
disabled
|
|
24
|
+
} = _ref;
|
|
25
|
+
return disabled ? 'no-drop' : 'pointer';
|
|
26
|
+
}};
|
|
27
|
+
border-radius: var(--border-radius-l);
|
|
28
|
+
padding: 10px var(--spacing-s);
|
|
29
|
+
text-transform: uppercase;
|
|
30
|
+
|
|
31
|
+
> svg {
|
|
32
|
+
margin-right: calc(var(--spacing-s) - 0.25rem);
|
|
33
|
+
font-size: var(--font-body1);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&:hover {
|
|
37
|
+
${_ref2 => {
|
|
38
|
+
let {
|
|
39
|
+
disabled
|
|
40
|
+
} = _ref2;
|
|
41
|
+
return !disabled && (0, _styledComponents.css)`
|
|
42
|
+
transition: 0.3s;
|
|
43
|
+
box-shadow: var(--box-shadow);
|
|
44
|
+
opacity: 0.9;
|
|
45
|
+
`;
|
|
46
|
+
}}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
${_backgroundColor.default}
|
|
50
|
+
${_colorOnBackground.default}
|
|
51
|
+
|
|
52
|
+
${_ref3 => {
|
|
53
|
+
let {
|
|
54
|
+
secondary
|
|
55
|
+
} = _ref3;
|
|
56
|
+
return secondary && (0, _styledComponents.css)`
|
|
57
|
+
background: var(--color-background2);
|
|
58
|
+
color: var(--font-on-background);
|
|
59
|
+
`;
|
|
60
|
+
}}
|
|
61
|
+
|
|
62
|
+
${_ref4 => {
|
|
63
|
+
let {
|
|
64
|
+
reverse
|
|
65
|
+
} = _ref4;
|
|
66
|
+
return reverse && (0, _styledComponents.css)`
|
|
67
|
+
background: var(--color-background1);
|
|
68
|
+
color: var(--font-on-background);
|
|
69
|
+
`;
|
|
70
|
+
}}
|
|
71
|
+
|
|
72
|
+
${_ref5 => {
|
|
73
|
+
let {
|
|
74
|
+
disabled
|
|
75
|
+
} = _ref5;
|
|
76
|
+
return disabled && (0, _styledComponents.css)`
|
|
77
|
+
opacity: 0.5;
|
|
78
|
+
`;
|
|
79
|
+
}}
|
|
80
|
+
|
|
81
|
+
${_ref6 => {
|
|
82
|
+
let {
|
|
83
|
+
iconOnly
|
|
84
|
+
} = _ref6;
|
|
85
|
+
return iconOnly && (0, _styledComponents.css)`
|
|
86
|
+
padding: 10px;
|
|
87
|
+
|
|
88
|
+
> svg {
|
|
89
|
+
margin-right: 0;
|
|
90
|
+
}
|
|
91
|
+
`;
|
|
92
|
+
}}
|
|
93
|
+
|
|
94
|
+
${_ref7 => {
|
|
95
|
+
let {
|
|
96
|
+
fullWidth
|
|
97
|
+
} = _ref7;
|
|
98
|
+
return fullWidth && 'width: 100%;';
|
|
99
|
+
}}
|
|
100
|
+
|
|
101
|
+
${_ref8 => {
|
|
102
|
+
let {
|
|
103
|
+
alignCenter
|
|
104
|
+
} = _ref8;
|
|
105
|
+
return alignCenter && 'justify-content: center;';
|
|
106
|
+
}}
|
|
107
|
+
|
|
108
|
+
${_ref9 => {
|
|
109
|
+
let {
|
|
110
|
+
filterFocus
|
|
111
|
+
} = _ref9;
|
|
112
|
+
return filterFocus && (0, _styledComponents.css)`
|
|
113
|
+
border: 2px solid var(--color-danger);
|
|
114
|
+
`;
|
|
115
|
+
}}
|
|
116
|
+
|
|
117
|
+
${_ref10 => {
|
|
118
|
+
let {
|
|
119
|
+
variant,
|
|
120
|
+
selected
|
|
121
|
+
} = _ref10;
|
|
122
|
+
return variant === 'outline' && (0, _styledComponents.css)`
|
|
123
|
+
background: ${selected ? 'var(--color-primary)' : 'transparent'};
|
|
124
|
+
color: ${selected ? 'var(--font-on-primary)' : 'var(--color-primary)'};
|
|
125
|
+
border: 1px solid var(--color-primary);
|
|
126
|
+
padding: 4px var(--spacing-s);
|
|
127
|
+
text-transform: none;
|
|
128
|
+
|
|
129
|
+
&:hover {
|
|
130
|
+
box-shadow: none;
|
|
131
|
+
}
|
|
132
|
+
`;
|
|
133
|
+
}}
|
|
134
|
+
|
|
135
|
+
${_ref11 => {
|
|
136
|
+
let {
|
|
137
|
+
variant
|
|
138
|
+
} = _ref11;
|
|
139
|
+
return variant === 'link' && (0, _styledComponents.css)`
|
|
140
|
+
font-size: var(--font-body1);
|
|
141
|
+
background: transparent;
|
|
142
|
+
color: var(--color-primary);
|
|
143
|
+
border: none;
|
|
144
|
+
padding: 0;
|
|
145
|
+
text-decoration: underline;
|
|
146
|
+
text-transform: none;
|
|
147
|
+
&:hover {
|
|
148
|
+
opacity: 0.8;
|
|
149
|
+
box-shadow: none;
|
|
150
|
+
}
|
|
151
|
+
`;
|
|
152
|
+
}}
|
|
153
|
+
`;
|
|
154
|
+
var _default = exports.default = Button;
|
|
@@ -0,0 +1,61 @@
|
|
|
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
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
const ButtonGroup = _styledComponents.default.div`
|
|
10
|
+
display: flex;
|
|
11
|
+
align-items: center;
|
|
12
|
+
|
|
13
|
+
> button:not(:first-child),
|
|
14
|
+
*:not(:first-child) {
|
|
15
|
+
margin-left: var(--spacing-s);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
${_ref => {
|
|
19
|
+
let {
|
|
20
|
+
alignCenter
|
|
21
|
+
} = _ref;
|
|
22
|
+
return alignCenter && 'justify-content: center;';
|
|
23
|
+
}}
|
|
24
|
+
|
|
25
|
+
${_ref2 => {
|
|
26
|
+
let {
|
|
27
|
+
alignRight
|
|
28
|
+
} = _ref2;
|
|
29
|
+
return alignRight && 'justify-content: flex-end;';
|
|
30
|
+
}}
|
|
31
|
+
|
|
32
|
+
${_ref3 => {
|
|
33
|
+
let {
|
|
34
|
+
marginBottom
|
|
35
|
+
} = _ref3;
|
|
36
|
+
return marginBottom && 'margin-bottom: var(--spacing);';
|
|
37
|
+
}}
|
|
38
|
+
|
|
39
|
+
${_ref4 => {
|
|
40
|
+
let {
|
|
41
|
+
vertical
|
|
42
|
+
} = _ref4;
|
|
43
|
+
return vertical && `
|
|
44
|
+
flex-direction: column;
|
|
45
|
+
|
|
46
|
+
> button,
|
|
47
|
+
> * {
|
|
48
|
+
margin-left: 0 !important;
|
|
49
|
+
margin-bottom: var(--spacing-s);
|
|
50
|
+
}
|
|
51
|
+
`;
|
|
52
|
+
}}
|
|
53
|
+
|
|
54
|
+
${_ref5 => {
|
|
55
|
+
let {
|
|
56
|
+
height100
|
|
57
|
+
} = _ref5;
|
|
58
|
+
return height100 && 'height: 100%;';
|
|
59
|
+
}}
|
|
60
|
+
`;
|
|
61
|
+
var _default = exports.default = ButtonGroup;
|
|
@@ -0,0 +1,72 @@
|
|
|
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
|
+
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); }
|
|
9
|
+
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; }
|
|
10
|
+
const IconButton = _styledComponents.default.div.attrs(() => ({
|
|
11
|
+
role: 'button'
|
|
12
|
+
}))`
|
|
13
|
+
display: flex;
|
|
14
|
+
justify-content: center;
|
|
15
|
+
align-items: center;
|
|
16
|
+
width: 40px;
|
|
17
|
+
height: 40px;
|
|
18
|
+
transition: 0.3s;
|
|
19
|
+
position: relative;
|
|
20
|
+
border-radius: var(--border-radius-l);
|
|
21
|
+
color: ${_ref => {
|
|
22
|
+
let {
|
|
23
|
+
disabled
|
|
24
|
+
} = _ref;
|
|
25
|
+
return disabled ? 'var(--color-grey)' : 'var(--font-on-background)';
|
|
26
|
+
}};
|
|
27
|
+
cursor: ${_ref2 => {
|
|
28
|
+
let {
|
|
29
|
+
disabled
|
|
30
|
+
} = _ref2;
|
|
31
|
+
return disabled ? 'no-drop' : 'pointer';
|
|
32
|
+
}};
|
|
33
|
+
margin: auto;
|
|
34
|
+
|
|
35
|
+
${_ref3 => {
|
|
36
|
+
let {
|
|
37
|
+
size
|
|
38
|
+
} = _ref3;
|
|
39
|
+
return size === 'small' && (0, _styledComponents.css)`
|
|
40
|
+
width: 32px;
|
|
41
|
+
height: 32px;
|
|
42
|
+
`;
|
|
43
|
+
}}
|
|
44
|
+
|
|
45
|
+
&:hover {
|
|
46
|
+
${_ref4 => {
|
|
47
|
+
let {
|
|
48
|
+
disabled
|
|
49
|
+
} = _ref4;
|
|
50
|
+
return !disabled && 'background: var(--color-hover)';
|
|
51
|
+
}}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
> svg {
|
|
55
|
+
font-size: 1.5rem;
|
|
56
|
+
|
|
57
|
+
${_ref5 => {
|
|
58
|
+
let {
|
|
59
|
+
size
|
|
60
|
+
} = _ref5;
|
|
61
|
+
return size === 'small' && 'font-size: 1rem;';
|
|
62
|
+
}}
|
|
63
|
+
|
|
64
|
+
${_ref6 => {
|
|
65
|
+
let {
|
|
66
|
+
size
|
|
67
|
+
} = _ref6;
|
|
68
|
+
return size === 'large' && 'font-size: 2rem;';
|
|
69
|
+
}}
|
|
70
|
+
}
|
|
71
|
+
`;
|
|
72
|
+
var _default = exports.default = IconButton;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
9
|
+
var _md = require("react-icons/md");
|
|
10
|
+
var _Button = _interopRequireDefault(require("./Button"));
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
const ScrollToTopButton = () => {
|
|
14
|
+
const [$display, setDisplay] = (0, _react.useState)(false);
|
|
15
|
+
const toggleVisible = () => {
|
|
16
|
+
const scrolled = window.pageYOffset;
|
|
17
|
+
scrolled === 0 ? setDisplay(false) : setDisplay(true);
|
|
18
|
+
};
|
|
19
|
+
const scrollToTop = () => {
|
|
20
|
+
window.scrollTo({
|
|
21
|
+
top: 0,
|
|
22
|
+
behavior: 'smooth'
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
(0, _react.useEffect)(() => {
|
|
26
|
+
window.addEventListener('scroll', toggleVisible);
|
|
27
|
+
return () => {
|
|
28
|
+
window.removeEventListener('scroll', toggleVisible);
|
|
29
|
+
};
|
|
30
|
+
}, []);
|
|
31
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledScrollToTopButton, {
|
|
32
|
+
onClick: scrollToTop,
|
|
33
|
+
$display: $display,
|
|
34
|
+
iconOnly: true,
|
|
35
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_md.MdOutlineArrowBackIosNew, {})
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
const StyledScrollToTopButton = (0, _styledComponents.default)(_Button.default)`
|
|
39
|
+
position: fixed;
|
|
40
|
+
bottom: var(--spacing);
|
|
41
|
+
right: var(--spacing);
|
|
42
|
+
display: ${_ref => {
|
|
43
|
+
let {
|
|
44
|
+
$display
|
|
45
|
+
} = _ref;
|
|
46
|
+
return $display ? 'flex' : 'none';
|
|
47
|
+
}};
|
|
48
|
+
z-index: 30;
|
|
49
|
+
|
|
50
|
+
> svg {
|
|
51
|
+
transform: rotate(90deg);
|
|
52
|
+
}
|
|
53
|
+
`;
|
|
54
|
+
var _default = exports.default = ScrollToTopButton;
|
package/button/index.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "Button", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _Button.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "ButtonGroup", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _ButtonGroup.default;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "IconButton", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _IconButton.default;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "ScrollToTopButton", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _ScrollToTopButton.default;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
var _Button = _interopRequireDefault(require("./Button"));
|
|
31
|
+
var _ButtonGroup = _interopRequireDefault(require("./ButtonGroup"));
|
|
32
|
+
var _IconButton = _interopRequireDefault(require("./IconButton"));
|
|
33
|
+
var _ScrollToTopButton = _interopRequireDefault(require("./ScrollToTopButton"));
|
|
34
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -0,0 +1,52 @@
|
|
|
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
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
const Callout = _styledComponents.default.div`
|
|
10
|
+
padding: var(--spacing);
|
|
11
|
+
border-radius: var(--border-radius);
|
|
12
|
+
background: var(--color-background3);
|
|
13
|
+
margin-bottom: var(--spacing);
|
|
14
|
+
`;
|
|
15
|
+
const Body = _styledComponents.default.div`
|
|
16
|
+
display: flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
`;
|
|
19
|
+
const Content = _styledComponents.default.div`
|
|
20
|
+
flex: 2;
|
|
21
|
+
`;
|
|
22
|
+
const Title = _styledComponents.default.h3`
|
|
23
|
+
font-size: var(--font-h3);
|
|
24
|
+
font-weight: 500;
|
|
25
|
+
color: var(--font-on-background);
|
|
26
|
+
margin-bottom: var(--border-radius);
|
|
27
|
+
`;
|
|
28
|
+
const Description = _styledComponents.default.p`
|
|
29
|
+
font-size: var(--font-body1);
|
|
30
|
+
line-height: 1.5;
|
|
31
|
+
color: var(--font-on-mute);
|
|
32
|
+
padding-right: var(--spacing);
|
|
33
|
+
font-weight: 400;
|
|
34
|
+
|
|
35
|
+
&:last-child {
|
|
36
|
+
margin-bottom: 0;
|
|
37
|
+
}
|
|
38
|
+
`;
|
|
39
|
+
const Action = _styledComponents.default.div`
|
|
40
|
+
flex: 1;
|
|
41
|
+
display: flex;
|
|
42
|
+
flex-direction: column;
|
|
43
|
+
align-items: flex-end;
|
|
44
|
+
justify-content: center;
|
|
45
|
+
`;
|
|
46
|
+
var _default = exports.default = Object.assign(Callout, {
|
|
47
|
+
Body,
|
|
48
|
+
Content,
|
|
49
|
+
Title,
|
|
50
|
+
Description,
|
|
51
|
+
Action
|
|
52
|
+
});
|
package/callout/index.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "Callout", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _Callout.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _Callout = _interopRequireDefault(require("./Callout"));
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _styledComponents = require("styled-components");
|
|
9
|
+
var _reactChartjs = require("react-chartjs-2");
|
|
10
|
+
var _customTooltip = _interopRequireDefault(require("./utils/customTooltip"));
|
|
11
|
+
var _padEmptyChartBar = _interopRequireDefault(require("./utils/padEmptyChartBar"));
|
|
12
|
+
var _yAxisTopTitlePlugin = _interopRequireDefault(require("./utils/yAxisTopTitlePlugin"));
|
|
13
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
|
+
const BarChart = _ref => {
|
|
16
|
+
let {
|
|
17
|
+
height = 300,
|
|
18
|
+
data,
|
|
19
|
+
options = {},
|
|
20
|
+
...props
|
|
21
|
+
} = _ref;
|
|
22
|
+
const theme = (0, _react.useContext)(_styledComponents.ThemeContext);
|
|
23
|
+
|
|
24
|
+
// fix: read value from theme
|
|
25
|
+
_reactChartjs.defaults.font.family = theme.fontFamily;
|
|
26
|
+
_reactChartjs.defaults.font.size = 16;
|
|
27
|
+
_reactChartjs.defaults.color = theme.fontOnBg;
|
|
28
|
+
_reactChartjs.defaults.plugins.tooltip.external = (0, _customTooltip.default)(theme);
|
|
29
|
+
const customOptions = (0, _react.useMemo)(() => {
|
|
30
|
+
const {
|
|
31
|
+
yAxisTopTitle,
|
|
32
|
+
tooltips = {}
|
|
33
|
+
} = options;
|
|
34
|
+
return {
|
|
35
|
+
onlyFirstTooltips: options.onlyFirstTooltips === undefined ? true : options.onlyFirstTooltips,
|
|
36
|
+
maxBarNumber: options.maxBarNumber === undefined ? 5 : options.maxBarNumber,
|
|
37
|
+
stacked: options.stacked === undefined ? true : options.stacked,
|
|
38
|
+
suggestedMax: options.suggestedMax === undefined ? 10 : options.suggestedMax,
|
|
39
|
+
showLegend: options.showLegend === undefined ? false : options.showLegend,
|
|
40
|
+
rotateLabel: options.rotateLabel === undefined ? true : options.rotateLabel,
|
|
41
|
+
yAxisTopTitle: yAxisTopTitle ? yAxisTopTitle : '',
|
|
42
|
+
tooltipLabelPostfix: tooltips.labelPostfix || ''
|
|
43
|
+
};
|
|
44
|
+
}, [options]);
|
|
45
|
+
const defaultOptions = (0, _react.useMemo)(() => {
|
|
46
|
+
return {
|
|
47
|
+
responsive: true,
|
|
48
|
+
maintainAspectRatio: false,
|
|
49
|
+
aspectRatio: 1,
|
|
50
|
+
interaction: {
|
|
51
|
+
mode: 'nearest',
|
|
52
|
+
intersect: false
|
|
53
|
+
},
|
|
54
|
+
plugins: {
|
|
55
|
+
padEmptyChartBar: {
|
|
56
|
+
maxBarNumber: customOptions.maxBarNumber
|
|
57
|
+
},
|
|
58
|
+
legend: {
|
|
59
|
+
position: 'bottom',
|
|
60
|
+
display: customOptions.showLegend
|
|
61
|
+
},
|
|
62
|
+
tooltip: {
|
|
63
|
+
enabled: false,
|
|
64
|
+
intersect: false,
|
|
65
|
+
filter(context) {
|
|
66
|
+
return !customOptions.onlyFirstTooltips || context.datasetIndex === 0 && context.label !== 'null';
|
|
67
|
+
},
|
|
68
|
+
callbacks: {
|
|
69
|
+
title(context) {
|
|
70
|
+
return context[0] ? context[0].label.match(/(.{1,20})/g) : '';
|
|
71
|
+
},
|
|
72
|
+
label(context) {
|
|
73
|
+
const tooltipLabel = context.dataset.tooltipLabels?.[context.dataIndex];
|
|
74
|
+
if (tooltipLabel !== undefined) {
|
|
75
|
+
return `${context.dataset.label}: ${tooltipLabel}`;
|
|
76
|
+
}
|
|
77
|
+
const label = context.dataset.data[context.dataIndex];
|
|
78
|
+
if (context.dataset.customLabel) {
|
|
79
|
+
return context.dataset.customLabel[context.dataIndex].toString();
|
|
80
|
+
}
|
|
81
|
+
return `${context.dataset.label}: ${label.toString()}${customOptions.tooltipLabelPostfix}`;
|
|
82
|
+
},
|
|
83
|
+
labelTextColor(context) {
|
|
84
|
+
const {
|
|
85
|
+
color
|
|
86
|
+
} = context.dataset;
|
|
87
|
+
if (!color) {
|
|
88
|
+
return theme.fontOnPrimary;
|
|
89
|
+
}
|
|
90
|
+
if (color && Array.isArray(color)) {
|
|
91
|
+
return color[context.dataIndex % color.length];
|
|
92
|
+
}
|
|
93
|
+
return color;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
yAxisTopTitle: {
|
|
98
|
+
title: customOptions.yAxisTopTitle
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
scales: {
|
|
102
|
+
x: {
|
|
103
|
+
stacked: customOptions.stacked,
|
|
104
|
+
grid: {
|
|
105
|
+
display: false,
|
|
106
|
+
drawBorder: false
|
|
107
|
+
},
|
|
108
|
+
ticks: {
|
|
109
|
+
minRotation: customOptions.rotateLabel ? 15 : 0,
|
|
110
|
+
callback(value) {
|
|
111
|
+
const label = this.getLabelForValue(value);
|
|
112
|
+
return label && label.length > 11 ? `${label.substr(0, 11)}...` : label;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
y: {
|
|
117
|
+
beginAtZero: true,
|
|
118
|
+
suggestedMax: customOptions.suggestedMax,
|
|
119
|
+
grid: {
|
|
120
|
+
display: false,
|
|
121
|
+
drawBorder: false
|
|
122
|
+
},
|
|
123
|
+
ticks: {
|
|
124
|
+
callback(value) {
|
|
125
|
+
if (value % 1 === 0) {
|
|
126
|
+
return value;
|
|
127
|
+
}
|
|
128
|
+
return null;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
layout: {
|
|
134
|
+
padding: {
|
|
135
|
+
top: 32
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
}, [customOptions, theme.fontOnPrimary]);
|
|
140
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactChartjs.Bar, {
|
|
141
|
+
height: height,
|
|
142
|
+
data: data,
|
|
143
|
+
options: defaultOptions,
|
|
144
|
+
plugins: [_padEmptyChartBar.default, _yAxisTopTitlePlugin.default],
|
|
145
|
+
...props
|
|
146
|
+
});
|
|
147
|
+
};
|
|
148
|
+
var _default = exports.default = BarChart;
|