diginet-core-ui 1.3.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/avatar/default.svg +3 -0
- package/assets/images/menu/dhr/Default.svg +13 -0
- package/assets/images/menu/dhr/MHRM00N0001.svg +14 -0
- package/assets/images/menu/dhr/MHRM09N0001.svg +1 -0
- package/assets/images/menu/dhr/MHRM09N0002.svg +3 -0
- package/assets/images/menu/dhr/MHRM09N0003.svg +25 -0
- package/assets/images/menu/dhr/MHRM25N0001.svg +26 -0
- package/assets/images/menu/dhr/MHRM29N0001.svg +30 -0
- package/assets/images/menu/dhr/MHRM29N0015.svg +63 -0
- package/assets/images/menu/dhr/MHRM39N0012.svg +43 -0
- package/assets/images/menu/dhr/MHRM39N0013.svg +24 -0
- package/assets/images/menu/dhr/MHRM39N0014.svg +14 -0
- package/assets/images/menu/dhr/MHRM39N0015.svg +36 -0
- package/assets/images/menu/dhr/MHRM39N0016.svg +23 -0
- package/assets/images/menu/dhr/MHRM77N0001.svg +28 -0
- package/assets/images/menu/dhr/MHRM84N0001.svg +27 -0
- package/assets/images/menu/dhr/MHRM84N0002.svg +24 -0
- package/assets/images/menu/dhr/MHRM89N0001.svg +16 -0
- package/assets/images/menu/dhr/MHRP00N0001.svg +10 -0
- package/assets/images/menu/dhr/MHRP09N0001.svg +22 -0
- package/assets/images/menu/dhr/MHRP09N0002.svg +19 -0
- package/assets/images/menu/dhr/MHRP09N0003.svg +12 -0
- package/assets/images/menu/dhr/MHRP09N0004.svg +6 -0
- package/assets/images/menu/dhr/MHRP09N0005.svg +10 -0
- package/assets/images/menu/dhr/MHRP09N0006.svg +17 -0
- package/assets/images/menu/dhr/MHRP09N0007.svg +15 -0
- package/assets/images/menu/dhr/MHRP09N0008.svg +8 -0
- package/assets/images/menu/dhr/MHRP09N0009.svg +10 -0
- package/assets/images/menu/dhr/MHRP09N0010.svg +12 -0
- package/assets/images/menu/dhr/MHRP09N0011.svg +16 -0
- package/assets/images/menu/dhr/MHRP09N0012.svg +6 -0
- package/assets/images/menu/dhr/MHRP09N0013.svg +8 -0
- package/assets/images/menu/dhr/MHRP09N0014.svg +11 -0
- package/assets/images/menu/dhr/MHRP09N0015.svg +12 -0
- package/assets/images/menu/dhr/MHRP09N0016.svg +18 -0
- package/assets/images/menu/dhr/MHRP09N0017.svg +18 -0
- package/assets/images/menu/dhr/MHRP09N0018.svg +12 -0
- package/assets/images/menu/dhr/MHRP09N0019.svg +13 -0
- package/assets/images/menu/dhr/MHRP09N0020.svg +17 -0
- package/assets/images/menu/dhr/MHRP09N0021.svg +10 -0
- package/assets/images/menu/dhr/MHRP09N0022.svg +16 -0
- package/assets/images/menu/dhr/MHRP09N0023.svg +8 -0
- package/assets/images/menu/dhr/MHRP09N0024.svg +15 -0
- package/assets/images/menu/dhr/MHRP09N0025.svg +16 -0
- package/assets/images/menu/dhr/MHRP09N0026.svg +13 -0
- package/assets/images/menu/dhr/MHRP09N0027.svg +10 -0
- package/assets/images/menu/dhr/MHRP13N0001.svg +9 -0
- package/assets/images/menu/dhr/MHRP21N0001.svg +12 -0
- package/assets/images/menu/dhr/MHRP21N0002.svg +13 -0
- package/assets/images/menu/dhr/MHRP25N0001.svg +13 -0
- package/assets/images/menu/dhr/MHRP25N0002.svg +16 -0
- package/assets/images/menu/dhr/MHRP25N0003.svg +38 -0
- package/assets/images/menu/dhr/MHRP25N0004.svg +17 -0
- package/assets/images/menu/dhr/MHRP25N0005.svg +20 -0
- package/assets/images/menu/dhr/MHRP29N0001.svg +18 -0
- package/assets/images/menu/dhr/MHRP29N0002.svg +15 -0
- package/assets/images/menu/dhr/MHRP29N0003.svg +20 -0
- package/assets/images/menu/dhr/MHRP29N0004.svg +21 -0
- package/assets/images/menu/dhr/MHRP29N0005.svg +21 -0
- package/assets/images/menu/dhr/MHRP29N0006.svg +14 -0
- package/assets/images/menu/dhr/MHRP29N0007.svg +19 -0
- package/assets/images/menu/dhr/MHRP29N0008.svg +20 -0
- package/assets/images/menu/dhr/MHRP29N0009.svg +11 -0
- package/assets/images/menu/dhr/MHRP29N0010.svg +11 -0
- package/assets/images/menu/dhr/MHRP29N0011.svg +12 -0
- package/assets/images/menu/dhr/MHRP29N0013.svg +27 -0
- package/assets/images/menu/dhr/MHRP29N0014.svg +32 -0
- package/assets/images/menu/dhr/MHRP29N0016.svg +54 -0
- package/assets/images/menu/dhr/MHRP29N0017.svg +24 -0
- package/assets/images/menu/dhr/MHRP29N0018.svg +44 -0
- package/assets/images/menu/dhr/MHRP29N0019.svg +17 -0
- package/assets/images/menu/dhr/MHRP29N0020.svg +11 -0
- package/assets/images/menu/dhr/MHRP38N0001.svg +13 -0
- package/assets/images/menu/dhr/MHRP38N0002.svg +14 -0
- package/assets/images/menu/dhr/MHRP39N0001.svg +15 -0
- package/assets/images/menu/dhr/MHRP39N0002.svg +13 -0
- package/assets/images/menu/dhr/MHRP39N0003.svg +16 -0
- package/assets/images/menu/dhr/MHRP39N0004.svg +22 -0
- package/assets/images/menu/dhr/MHRP39N0005.svg +16 -0
- package/assets/images/menu/dhr/MHRP39N0006.svg +17 -0
- package/assets/images/menu/dhr/MHRP39N0007.svg +13 -0
- package/assets/images/menu/dhr/MHRP39N0008.svg +3 -0
- package/assets/images/menu/dhr/MHRP39N0009.svg +3 -0
- package/assets/images/menu/dhr/MHRP39N0010.svg +7 -0
- package/assets/images/menu/dhr/MHRP39N0011.svg +14 -0
- package/assets/images/menu/dhr/MHRP39N0013.svg +10 -0
- package/assets/images/menu/dhr/MHRP39N0014.svg +11 -0
- package/assets/images/menu/dhr/MHRP39N1222.svg +12 -0
- package/assets/images/menu/dhr/MHRP51N0001.svg +9 -0
- package/assets/images/menu/dhr/MHRP51N0002.svg +13 -0
- package/assets/images/menu/dhr/MHRP52N0001.svg +21 -0
- package/assets/images/menu/dhr/MHRP52N0002.svg +21 -0
- package/assets/images/menu/dhr/MHRP52N0003.svg +16 -0
- package/assets/images/menu/dhr/MHRP75N0001.svg +19 -0
- package/assets/images/menu/dhr/MHRP75N0002.svg +25 -0
- package/assets/images/menu/dhr/MHRP75N0003.svg +3 -0
- package/assets/images/menu/dhr/MHRP75N0006.svg +14 -0
- package/assets/images/menu/dhr/MHRP75N0007.svg +19 -0
- package/assets/images/menu/dhr/MHRP75N0008.svg +19 -0
- package/assets/images/menu/dhr/MHRP77N0007.svg +28 -0
- package/assets/images/menu/dhr/MHRP77N0008.svg +17 -0
- package/assets/images/menu/dhr/MHRP77N0009.svg +19 -0
- package/assets/images/menu/dhr/MHRP77N0010.svg +20 -0
- package/assets/images/menu/dhr/MHRP89N1000.svg +6 -0
- package/assets/images/menu/dhr/MHRP89N1001.svg +6 -0
- package/assets/images/menu/dhr/W00F0001.svg +3 -0
- package/assets/images/menu/dhr/W00F0002.svg +3 -0
- package/assets/images/menu/dhr/W00F0003.svg +3 -0
- package/assets/images/menu/dhr/W00F0004.svg +3 -0
- package/assets/images/menu/dhr/W00F0005.svg +1 -0
- package/assets/images/menu/dhr/W09F2000-WEB5.svg +17 -0
- package/assets/images/menu/dhr/W09F2000.svg +6 -0
- package/assets/images/menu/dhr/W09F2002-WEB5.svg +21 -0
- package/assets/images/menu/dhr/W09F2005-WEB5.svg +13 -0
- package/assets/images/menu/dhr/W09F2020-WEB5.svg +16 -0
- package/assets/images/menu/dhr/W09F2022-WEB5.svg +20 -0
- package/assets/images/menu/dhr/W09F2150-WEB5.svg +16 -0
- package/assets/images/menu/dhr/W09F2152-WEB5.svg +20 -0
- package/assets/images/menu/dhr/W09F2160-WEB5.svg +14 -0
- package/assets/images/menu/dhr/W09F2162-WEB5.svg +18 -0
- package/assets/images/menu/dhr/W29F4006-WEB5.svg +19 -0
- package/assets/images/menu/dhr/W75F2260-WEB5.svg +15 -0
- package/assets/images/menu/dhr/W75F2261-WEB5.svg +19 -0
- package/assets/images/menu/dhr/W75F3005-WEB5.svg +13 -0
- package/assets/images/menu/dhr/W75F4070-WEB5.svg +21 -0
- package/assets/images/menu/dhr/W75F4071-WEB5.svg +17 -0
- package/assets/images/menu/dhr/W75F4100-WEB5.svg +14 -0
- package/assets/images/menu/dhr/W77F1011.svg +19 -0
- package/assets/images/menu/dhr/W77F1013.svg +22 -0
- package/assets/images/menu/erp/W00F0001.svg +3 -0
- package/assets/images/menu/erp/W00F0002.svg +3 -0
- package/assets/images/menu/erp/W00F0003.svg +3 -0
- package/assets/images/menu/erp/W00F0004.svg +3 -0
- package/assets/images/menu/erp/W05F0001.svg +16 -0
- package/assets/images/menu/erp/W05F0001N0000.svg +16 -0
- package/assets/images/menu/erp/W05F0004N0000.svg +6 -0
- package/assets/images/menu/erp/W05F0006.svg +30 -0
- package/assets/images/menu/erp/W05F0007N0000.svg +6 -0
- package/assets/images/menu/erp/W05F0008.svg +14 -0
- package/assets/images/menu/erp/W05F4000.svg +9 -0
- package/assets/images/menu/erp/W06F0001.svg +17 -0
- package/assets/images/menu/erp/W06F0001N0000.svg +17 -0
- package/assets/images/menu/erp/W06F0004N0000.svg +22 -0
- package/assets/images/menu/erp/W06F0005.svg +22 -0
- package/assets/images/menu/erp/W06F0006.svg +55 -0
- package/assets/images/menu/erp/W06F0008.svg +17 -0
- package/assets/images/menu/erp/WA3F1025.svg +5 -0
- package/assets/images/menu/erp/WA3F2100.svg +10 -0
- package/components/accordion/context.js +6 -0
- package/components/accordion/css.js +159 -0
- package/components/accordion/details.js +60 -0
- package/components/accordion/group.js +122 -0
- package/components/accordion/index.js +117 -0
- package/components/accordion/summary.js +175 -0
- package/components/alert/index.js +264 -0
- package/components/alert/notify.js +192 -0
- package/components/avatar/index.js +556 -0
- package/components/badge/index.js +223 -0
- package/components/button/icon.js +493 -0
- package/components/button/index.js +653 -0
- package/components/button/more.js +135 -0
- package/components/button/ripple-effect.js +85 -0
- package/components/card/body-card.js +67 -0
- package/components/card/card.js +127 -0
- package/components/card/context.js +6 -0
- package/components/card/index.js +50 -0
- package/components/chart/Pie/Circle.js +50 -0
- package/components/chart/Pie/Sector.js +142 -0
- package/components/chart/Pie/Sectors.js +91 -0
- package/components/chart/Pie/index.js +311 -0
- package/components/chart/Pie-v2/Circle.js +50 -0
- package/components/chart/Pie-v2/Sector.js +128 -0
- package/components/chart/Pie-v2/Sectors.js +224 -0
- package/components/chart/Pie-v2/index.js +397 -0
- package/components/chart/bar/Axis.js +79 -0
- package/components/chart/bar/Bar.js +365 -0
- package/components/chart/bar/Grid.js +115 -0
- package/components/chart/bar/Labels.js +175 -0
- package/components/chart/bar/Points.js +111 -0
- package/components/chart/bar/index.js +172 -0
- package/components/chart/bar-v2/Axis.js +79 -0
- package/components/chart/bar-v2/Bar.js +374 -0
- package/components/chart/bar-v2/Grid.js +115 -0
- package/components/chart/bar-v2/Labels.js +175 -0
- package/components/chart/bar-v2/Points.js +111 -0
- package/components/chart/bar-v2/index.js +172 -0
- package/components/chart/line/Axis.js +79 -0
- package/components/chart/line/Grid.js +115 -0
- package/components/chart/line/Labels.js +172 -0
- package/components/chart/line/Path.js +163 -0
- package/components/chart/line/Point.js +348 -0
- package/components/chart/line/Title.js +56 -0
- package/components/chart/line/index.js +174 -0
- package/components/chart/line-v2/Axis.js +79 -0
- package/components/chart/line-v2/Grid.js +115 -0
- package/components/chart/line-v2/Labels.js +172 -0
- package/components/chart/line-v2/Path.js +163 -0
- package/components/chart/line-v2/Point.js +354 -0
- package/components/chart/line-v2/Title.js +56 -0
- package/components/chart/line-v2/index.js +174 -0
- package/components/check-text/index.js +157 -0
- package/components/check-text/interview-confirmation.js +172 -0
- package/components/check-text/interview-status.js +138 -0
- package/components/chip/attach.js +180 -0
- package/components/chip/index.js +340 -0
- package/components/collapse/index.js +67 -0
- package/components/dialogs/colors.js +11 -0
- package/components/divider/index.js +71 -0
- package/components/divider/style.js +12 -0
- package/components/form-control/attachment/index.js +1890 -0
- package/components/form-control/calendar/function.js +673 -0
- package/components/form-control/calendar/index.js +248 -0
- package/components/form-control/calendar/range.js +293 -0
- package/components/form-control/checkbox/index.js +306 -0
- package/components/form-control/control/index.js +92 -0
- package/components/form-control/date-picker/index-old.js +953 -0
- package/components/form-control/date-picker/index.js +676 -0
- package/components/form-control/date-range-picker/index.js +1305 -0
- package/components/form-control/dropdown/index.js +1865 -0
- package/components/form-control/dropdown-box/index.js +292 -0
- package/components/form-control/form/context.js +5 -0
- package/components/form-control/form/index.js +41 -0
- package/components/form-control/form-group/index.js +118 -0
- package/components/form-control/helper-text/index.js +71 -0
- package/components/form-control/input-base/index.js +733 -0
- package/components/form-control/label/index.js +73 -0
- package/components/form-control/money-input/index.js +491 -0
- package/components/form-control/number-input/index.js +633 -0
- package/components/form-control/phone-input/index.js +433 -0
- package/components/form-control/radio/index.js +263 -0
- package/components/form-control/text-input/index.js +523 -0
- package/components/form-control/time-picker/index.js +829 -0
- package/components/form-control/time-picker/swiper.js +590 -0
- package/components/form-control/toggle/index.js +250 -0
- package/components/form-view/helper-text.js +33 -0
- package/components/form-view/index.js +107 -0
- package/components/form-view/input.js +129 -0
- package/components/form-view/label.js +38 -0
- package/components/index.js +100 -0
- package/components/list/list-item-action.js +82 -0
- package/components/list/list-item-icon.js +76 -0
- package/components/list/list-item-text.js +57 -0
- package/components/list/list-item.js +114 -0
- package/components/list/list.js +155 -0
- package/components/list/sub-header.js +61 -0
- package/components/modal/body.js +71 -0
- package/components/modal/context.js +6 -0
- package/components/modal/footer.js +63 -0
- package/components/modal/header.js +108 -0
- package/components/modal/index.js +69 -0
- package/components/modal/modal.js +339 -0
- package/components/others/extra/index.js +124 -0
- package/components/others/scrollbar/index.js +95 -0
- package/components/paging/page-info.js +298 -0
- package/components/paging/page-selector.js +281 -0
- package/components/paper/index.js +119 -0
- package/components/popover/index.js +417 -0
- package/components/popup/danger_popup.js +215 -0
- package/components/popup/index.js +469 -0
- package/components/popup/proposals_popup.js +364 -0
- package/components/popup/v2/danger-popup.js +17 -0
- package/components/popup/v2/index.js +460 -0
- package/components/popup/v2/info-popup.js +17 -0
- package/components/popup/v2/success-popup.js +17 -0
- package/components/popup/v2/warning-popup.js +17 -0
- package/components/popup/v2/yes-no-popup.js +20 -0
- package/components/progress/circular.js +414 -0
- package/components/progress/linear.js +327 -0
- package/components/rating/index.js +392 -0
- package/components/slider/slider-container.js +356 -0
- package/components/slider/slider-item.js +183 -0
- package/components/status/index.js +123 -0
- package/components/tab/context.js +3 -0
- package/components/tab/tab-container.js +83 -0
- package/components/tab/tab-header.js +133 -0
- package/components/tab/tab-panel.js +51 -0
- package/components/tab/tab.js +206 -0
- package/components/tooltip/index.js +602 -0
- package/components/tooltip/portal.js +13 -0
- package/components/transfer/index.js +489 -0
- package/components/tree-view/css.js +94 -0
- package/components/tree-view/index.js +1009 -0
- package/components/typography/index.js +218 -0
- package/css/styles.css +1 -0
- package/css/styles.css.map +1 -0
- package/global/index.js +175 -0
- package/icons/basic.js +6326 -0
- package/icons/effect.js +171 -0
- package/icons/general/clock/clock.js +21 -0
- package/icons/general/color-handler/background.js +41 -0
- package/icons/general/color-handler/text.js +41 -0
- package/icons/general/emoji/emoji.js +35 -0
- package/icons/general/font-properties/bold.js +21 -0
- package/icons/general/font-properties/font-family.js +35 -0
- package/icons/general/font-properties/font-size.js +27 -0
- package/icons/general/font-properties/italic.js +21 -0
- package/icons/general/font-properties/underline.js +31 -0
- package/icons/general/hyperlink/hyperlink.js +38 -0
- package/icons/general/indent/decrease.js +55 -0
- package/icons/general/indent/increase.js +55 -0
- package/icons/general/index.js +21 -0
- package/icons/general/list/bullets.js +77 -0
- package/icons/general/list/numbering.js +71 -0
- package/icons/general/picture/picture.js +21 -0
- package/icons/general/steps/redo.js +21 -0
- package/icons/general/steps/undo.js +21 -0
- package/icons/general/text-align/center.js +21 -0
- package/icons/general/text-align/justify.js +21 -0
- package/icons/general/text-align/left.js +21 -0
- package/icons/general/text-align/right.js +21 -0
- package/icons/index.js +3 -0
- package/icons/menu/dhr.js +2440 -0
- package/icons/menu/erp.js +490 -0
- package/icons/menu/index.js +5 -0
- package/icons/menu/v2/index.js +52 -0
- package/locale/index.js +11 -0
- package/package.json +45 -0
- package/readme.md +517 -0
- package/styles/animation.js +890 -0
- package/styles/color-helper.js +504 -0
- package/styles/colors.js +306 -0
- package/styles/general.js +48 -0
- package/styles/media-queries.js +10 -0
- package/styles/typography.js +122 -0
- package/styles/utils.js +10 -0
- package/theme/index.js +5 -0
- package/theme/make-styles.js +95 -0
- package/theme/set-theme.js +39 -0
- package/theme/settings.js +230 -0
- package/theme/theme-provider.js +68 -0
- package/theme/theme.js +56 -0
- package/theme/with-styles.js +17 -0
- package/theme/with-theme.js +11 -0
- package/utils/array/array.js +186 -0
- package/utils/console.js +34 -0
- package/utils/date.js +471 -0
- package/utils/error/error.js +62 -0
- package/utils/error/errors.js +247 -0
- package/utils/getFileType.js +32 -0
- package/utils/index.js +23 -0
- package/utils/iterator.js +45 -0
- package/utils/map-parent.js +53 -0
- package/utils/number.js +64 -0
- package/utils/object/extend.js +57 -0
- package/utils/object/object.js +68 -0
- package/utils/parseHTML.js +8 -0
- package/utils/promisify.js +38 -0
- package/utils/randomString.js +33 -0
- package/utils/remove-unicode.js +6 -0
- package/utils/render-portal.js +90 -0
- package/utils/renderHTML.js +21 -0
- package/utils/renderIcon.js +57 -0
- package/utils/string/capitalize.js +3 -0
- package/utils/string/capitalizeSentenceCase.js +10 -0
- package/utils/string/string.js +81 -0
- package/utils/type.js +90 -0
- package/utils/updatePosition.js +36 -0
- package/utils/useOnClickOutside.js +23 -0
- package/utils/usePortal.js +56 -0
- package/utils/validate.js +149 -0
package/styles/utils.js
ADDED
package/theme/index.js
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { css } from '@emotion/core';
|
|
2
|
+
import theme from './settings';
|
|
3
|
+
export const makeStylesEls = [];
|
|
4
|
+
|
|
5
|
+
const makeStyle = obj => {
|
|
6
|
+
if (typeof obj === 'function') {
|
|
7
|
+
obj = obj(theme);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
return props => {
|
|
11
|
+
const classes = {};
|
|
12
|
+
Object.keys(obj).forEach(key => {
|
|
13
|
+
let CSS = obj[key];
|
|
14
|
+
|
|
15
|
+
if (typeof CSS === 'function') {
|
|
16
|
+
CSS = CSS(props);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
CSS = css(CSS);
|
|
20
|
+
const className = `css-${CSS.name}`;
|
|
21
|
+
const style = CSS.styles;
|
|
22
|
+
separateStyle(className, style);
|
|
23
|
+
classes[key] = className;
|
|
24
|
+
});
|
|
25
|
+
return classes;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const separateStyle = (className, style) => {
|
|
30
|
+
const styles = [];
|
|
31
|
+
|
|
32
|
+
while (style.includes('{')) {
|
|
33
|
+
const start = style.match(/[^;]+\{/).index;
|
|
34
|
+
const end = getEndBraces(style, style.indexOf('{') + 1);
|
|
35
|
+
styles.push(style.slice(start, end + 1));
|
|
36
|
+
style = style.slice(0, start) + style.slice(end + 1);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (style) {
|
|
40
|
+
if (style.includes('content:;')) {
|
|
41
|
+
style = style.replace('content:;', 'content:"";');
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
createStyle(className, style);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if (styles.length) {
|
|
48
|
+
styles.forEach(style => {
|
|
49
|
+
const indexBraces = style.indexOf('{');
|
|
50
|
+
const childClass = style.slice(0, indexBraces);
|
|
51
|
+
style = style.slice(indexBraces + 1, style.length - 1);
|
|
52
|
+
const separateClass = (childClass[0] === '&' ? '' : ' ') + childClass.replace('&', '');
|
|
53
|
+
let newClass = '';
|
|
54
|
+
|
|
55
|
+
if (separateClass.includes('@media')) {
|
|
56
|
+
newClass = separateClass + '{.' + className;
|
|
57
|
+
style += '}';
|
|
58
|
+
} else {
|
|
59
|
+
newClass = className + separateClass;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
separateStyle(newClass, style);
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
const createStyle = (className, style) => {
|
|
68
|
+
const styleEl = document.createElement('style');
|
|
69
|
+
styleEl.type = 'text/css';
|
|
70
|
+
styleEl.dataMeta = 'makeStyles';
|
|
71
|
+
document.head.appendChild(styleEl);
|
|
72
|
+
styleEl.appendChild(document.createTextNode(`${/@media/.test(className) ? '' : '.'}${className} {${style}}`));
|
|
73
|
+
makeStylesEls.push(styleEl);
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
const getEndBraces = (str, start) => {
|
|
77
|
+
let temp = 0;
|
|
78
|
+
|
|
79
|
+
for (let i = start; i < str.length; i++) {
|
|
80
|
+
if (str[i] === '}') {
|
|
81
|
+
if (!temp) {
|
|
82
|
+
temp = i;
|
|
83
|
+
break;
|
|
84
|
+
} else {
|
|
85
|
+
temp--;
|
|
86
|
+
}
|
|
87
|
+
} else if (str[i] === '{') {
|
|
88
|
+
temp++;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
return temp;
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
export default makeStyle;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import Settings from './settings';
|
|
2
|
+
|
|
3
|
+
const saveNewTheme = (newTheme, ingredient) => {
|
|
4
|
+
if (typeof newTheme === 'object' && typeof ingredient === 'object') {
|
|
5
|
+
const newThemeArr = Object.keys(newTheme); // const ingredientArr = Object.keys(ingredient);
|
|
6
|
+
|
|
7
|
+
newThemeArr.forEach(key => {
|
|
8
|
+
if (newTheme[key] && ingredient[key]) {
|
|
9
|
+
if (typeof newTheme[key] === 'object' && typeof ingredient[key] === 'object') {
|
|
10
|
+
saveNewTheme(newTheme[key], ingredient[key]);
|
|
11
|
+
} else if (typeof newTheme[key] === 'string' && typeof ingredient[key] === 'string') {
|
|
12
|
+
ingredient[key] = newTheme[key];
|
|
13
|
+
}
|
|
14
|
+
} else {
|
|
15
|
+
ingredient[key] = newTheme[key];
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* set theme setting as global
|
|
22
|
+
* @param {Object} theme
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
export const setTheme = theme => {
|
|
27
|
+
if (theme && typeof theme === 'object') {
|
|
28
|
+
const themeKeys = Object.keys(theme);
|
|
29
|
+
themeKeys.forEach(key => {
|
|
30
|
+
const newTheme = theme[key];
|
|
31
|
+
const ingredient = Settings[key];
|
|
32
|
+
|
|
33
|
+
if (newTheme && ingredient) {
|
|
34
|
+
saveNewTheme(newTheme, ingredient);
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
export const useTheme = () => Settings;
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import { fontSize, fontFamily, fontFamilyMedium, fontFamilyBold } from '../styles/typography';
|
|
2
|
+
import * as colors from '../styles/colors';
|
|
3
|
+
const settings = {
|
|
4
|
+
border: {
|
|
5
|
+
radius: '4px',
|
|
6
|
+
style: 'solid'
|
|
7
|
+
},
|
|
8
|
+
boxShadows: {
|
|
9
|
+
large: '0 4px 4px 0 rgba(0, 0, 0, 0.25)',
|
|
10
|
+
small: '0 2px 2px 0 rgba(0, 0, 0, 0.25)'
|
|
11
|
+
},
|
|
12
|
+
colors: {
|
|
13
|
+
bgDisabled: colors.dark12,
|
|
14
|
+
bgProgress: colors.brand12,
|
|
15
|
+
border: colors.dark6,
|
|
16
|
+
borderFocus: colors.info5,
|
|
17
|
+
borderHover: colors.brand,
|
|
18
|
+
borderTab: colors.dark2,
|
|
19
|
+
danger: colors.danger5,
|
|
20
|
+
default: colors.dark,
|
|
21
|
+
disabled: colors.dark4,
|
|
22
|
+
divider: colors.dark4,
|
|
23
|
+
focus: colors.blue4,
|
|
24
|
+
// 'rgba(21, 26, 48, 0.1)',
|
|
25
|
+
hover: colors.blue13,
|
|
26
|
+
info: colors.info5,
|
|
27
|
+
input: colors.dark,
|
|
28
|
+
inputHover: colors.brand,
|
|
29
|
+
label: colors.dark8,
|
|
30
|
+
link: colors.info5,
|
|
31
|
+
linkHover: colors.info6,
|
|
32
|
+
placeholder: colors.dark6,
|
|
33
|
+
pressing: colors.blue6,
|
|
34
|
+
primary: colors.brand,
|
|
35
|
+
scrollbar: colors.brand13,
|
|
36
|
+
scrollbarHover: colors.brand15,
|
|
37
|
+
secondary: colors.dark6,
|
|
38
|
+
success: colors.success5,
|
|
39
|
+
text: colors.dark,
|
|
40
|
+
warning: colors.warning5,
|
|
41
|
+
white: colors.white,
|
|
42
|
+
button: {
|
|
43
|
+
bgFilledHover: {
|
|
44
|
+
danger: colors.danger6,
|
|
45
|
+
info: colors.info6,
|
|
46
|
+
primary: '#0C1550',
|
|
47
|
+
success: colors.success6,
|
|
48
|
+
warning: colors.warning6
|
|
49
|
+
},
|
|
50
|
+
bgHover: {
|
|
51
|
+
danger: colors.danger1,
|
|
52
|
+
info: colors.info1,
|
|
53
|
+
primary: colors.blue13,
|
|
54
|
+
success: colors.success1,
|
|
55
|
+
warning: colors.warning1
|
|
56
|
+
},
|
|
57
|
+
borderHover: {
|
|
58
|
+
danger: colors.danger6,
|
|
59
|
+
info: colors.info6,
|
|
60
|
+
primary: '#0C1550',
|
|
61
|
+
success: colors.success6,
|
|
62
|
+
warning: colors.warning6
|
|
63
|
+
},
|
|
64
|
+
colorHover: {
|
|
65
|
+
danger: colors.danger6,
|
|
66
|
+
info: colors.info6,
|
|
67
|
+
primary: '#0C1550',
|
|
68
|
+
success: colors.success6,
|
|
69
|
+
warning: colors.warning6
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
calendar: {
|
|
73
|
+
table: {
|
|
74
|
+
bgDefault: colors.white
|
|
75
|
+
},
|
|
76
|
+
day: {
|
|
77
|
+
default: colors.dark,
|
|
78
|
+
saturday: colors.info8,
|
|
79
|
+
sunday: colors.danger8
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
accordion: {
|
|
83
|
+
labelColor: colors.info5,
|
|
84
|
+
background: colors.brand12
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
typography: {
|
|
88
|
+
fontFamily,
|
|
89
|
+
fontFamilyMedium,
|
|
90
|
+
fontFamilyBold,
|
|
91
|
+
fontSize,
|
|
92
|
+
title1: {
|
|
93
|
+
fontStyle: 'normal',
|
|
94
|
+
fontWeight: 'bold',
|
|
95
|
+
fontSize: '28px',
|
|
96
|
+
lineHeight: '32px'
|
|
97
|
+
},
|
|
98
|
+
title2: {
|
|
99
|
+
fontStyle: 'normal',
|
|
100
|
+
fontWeight: 'bold',
|
|
101
|
+
fontSize: '26px',
|
|
102
|
+
lineHeight: '30px'
|
|
103
|
+
},
|
|
104
|
+
title3: {
|
|
105
|
+
fontStyle: 'normal',
|
|
106
|
+
fontWeight: 'bold',
|
|
107
|
+
fontSize: '24px',
|
|
108
|
+
lineHeight: '28px'
|
|
109
|
+
},
|
|
110
|
+
title4: {
|
|
111
|
+
fontStyle: 'normal',
|
|
112
|
+
fontWeight: 'bold',
|
|
113
|
+
fontSize: '22px',
|
|
114
|
+
lineHeight: '26px'
|
|
115
|
+
},
|
|
116
|
+
h1: {
|
|
117
|
+
fontStyle: 'normal',
|
|
118
|
+
fontWeight: 'bold',
|
|
119
|
+
fontSize: '20px',
|
|
120
|
+
lineHeight: '24px'
|
|
121
|
+
},
|
|
122
|
+
h2: {
|
|
123
|
+
fontStyle: 'normal',
|
|
124
|
+
fontWeight: 'bold',
|
|
125
|
+
fontSize: '18px',
|
|
126
|
+
lineHeight: '22px'
|
|
127
|
+
},
|
|
128
|
+
h3: {
|
|
129
|
+
fontStyle: 'normal',
|
|
130
|
+
fontWeight: 'bold',
|
|
131
|
+
fontSize: '16px',
|
|
132
|
+
lineHeight: '20px'
|
|
133
|
+
},
|
|
134
|
+
h4: {
|
|
135
|
+
fontStyle: 'normal',
|
|
136
|
+
fontWeight: 'bold',
|
|
137
|
+
fontSize: '14px',
|
|
138
|
+
lineHeight: '18px'
|
|
139
|
+
},
|
|
140
|
+
h5: {
|
|
141
|
+
fontStyle: 'normal',
|
|
142
|
+
fontWeight: 'bold',
|
|
143
|
+
fontSize: '12px',
|
|
144
|
+
lineHeight: '16px'
|
|
145
|
+
},
|
|
146
|
+
h6: {
|
|
147
|
+
fontStyle: 'normal',
|
|
148
|
+
fontWeight: 500,
|
|
149
|
+
fontSize: '12px',
|
|
150
|
+
lineHeight: '16px'
|
|
151
|
+
},
|
|
152
|
+
p1: {
|
|
153
|
+
fontStyle: 'normal',
|
|
154
|
+
fontWeight: 'normal',
|
|
155
|
+
fontSize: '16px',
|
|
156
|
+
lineHeight: '20px'
|
|
157
|
+
},
|
|
158
|
+
p2: {
|
|
159
|
+
fontStyle: 'normal',
|
|
160
|
+
fontWeight: 'normal',
|
|
161
|
+
fontSize: '14px',
|
|
162
|
+
lineHeight: '18px'
|
|
163
|
+
},
|
|
164
|
+
p3: {
|
|
165
|
+
fontStyle: 'normal',
|
|
166
|
+
fontWeight: 'normal',
|
|
167
|
+
fontSize: '12px',
|
|
168
|
+
lineHeight: '16px'
|
|
169
|
+
},
|
|
170
|
+
button: {
|
|
171
|
+
textTransform: 'uppercase'
|
|
172
|
+
},
|
|
173
|
+
label: {
|
|
174
|
+
fontSize: 12,
|
|
175
|
+
fontFamily,
|
|
176
|
+
fontWeight: 'bold'
|
|
177
|
+
},
|
|
178
|
+
helperText: {
|
|
179
|
+
fontSize: 12,
|
|
180
|
+
fontFamily,
|
|
181
|
+
fontWeight: 'normal'
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
breakpoints: {
|
|
185
|
+
values: {
|
|
186
|
+
xs: 0,
|
|
187
|
+
sm: 600,
|
|
188
|
+
md: 960,
|
|
189
|
+
lg: 1280,
|
|
190
|
+
xl: 1920
|
|
191
|
+
},
|
|
192
|
+
down: value => getMedia(value, 'max'),
|
|
193
|
+
up: value => getMedia(value, 'min'),
|
|
194
|
+
only: value => getMedia(value, 'min', value),
|
|
195
|
+
between: (start, end) => getMedia(start, 'min', end)
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
const getMedia = (value, type, value2 = '') => {
|
|
200
|
+
const values = settings.breakpoints.values;
|
|
201
|
+
let px1,
|
|
202
|
+
px2 = '';
|
|
203
|
+
|
|
204
|
+
if (typeof value === 'number') {
|
|
205
|
+
px1 = value + 'px';
|
|
206
|
+
} else if (/^xs|sm|md|lg|xl$/) {
|
|
207
|
+
px1 = values[value] - (type === 'max' ? 0.05 : 0) + 'px';
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
if (value2) {
|
|
211
|
+
const keys = Object.keys(values);
|
|
212
|
+
|
|
213
|
+
if (value2 === value) {
|
|
214
|
+
// only
|
|
215
|
+
value2 = values[keys[keys.indexOf(value) + 1]] - 0.05 + 'px';
|
|
216
|
+
} else {
|
|
217
|
+
if (typeof value2 === 'number') {
|
|
218
|
+
value2 += 'px';
|
|
219
|
+
} else if (/^xs|sm|md|lg|xl$/) {
|
|
220
|
+
value2 = values[keys[keys.indexOf(value2) + 1]] - 0.05 + 'px';
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
px2 = ` and (max-width: ${value2})`;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
return `@media (${type}-width: ${px1}${px2})`;
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
export default settings;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/** @jsxRuntime classic */
|
|
2
|
+
|
|
3
|
+
/** @jsx jsx */
|
|
4
|
+
import { memo, useEffect } from 'react';
|
|
5
|
+
import { jsx, css } from '@emotion/core';
|
|
6
|
+
import { setTheme } from './set-theme';
|
|
7
|
+
import { makeStylesEls } from './make-styles';
|
|
8
|
+
import { fontFamilyLink, fontFamilyMediumLink, fontFamilyBoldLink } from '../styles/typography';
|
|
9
|
+
import { string, object, node } from 'prop-types';
|
|
10
|
+
const ThemeProviderRoot = css`
|
|
11
|
+
@font-face {
|
|
12
|
+
font-family: 'SF Pro Display Bold';
|
|
13
|
+
src: url('${fontFamilyBoldLink}') format('opentype');
|
|
14
|
+
}
|
|
15
|
+
@font-face {
|
|
16
|
+
font-family: 'SF Pro Display Medium';
|
|
17
|
+
src: url('${fontFamilyMediumLink}') format('opentype');
|
|
18
|
+
}
|
|
19
|
+
@font-face {
|
|
20
|
+
font-family: 'SF Pro Display Regular';
|
|
21
|
+
src: url('${fontFamilyLink}') format('opentype');
|
|
22
|
+
}
|
|
23
|
+
@font-face {
|
|
24
|
+
font-family: 'SF Pro Display';
|
|
25
|
+
font-weight: 400;
|
|
26
|
+
src: url('${fontFamilyLink}') format('opentype');
|
|
27
|
+
}
|
|
28
|
+
@font-face {
|
|
29
|
+
font-family: 'SF Pro Display';
|
|
30
|
+
font-weight: 500;
|
|
31
|
+
src: url('${fontFamilyMediumLink}') format('opentype');
|
|
32
|
+
}
|
|
33
|
+
@font-face {
|
|
34
|
+
font-family: 'SF Pro Display';
|
|
35
|
+
font-weight: 700;
|
|
36
|
+
src: url('${fontFamilyBoldLink}') format('opentype');
|
|
37
|
+
}
|
|
38
|
+
`;
|
|
39
|
+
const ThemeProvider = /*#__PURE__*/memo(({
|
|
40
|
+
theme,
|
|
41
|
+
className,
|
|
42
|
+
children
|
|
43
|
+
}) => {
|
|
44
|
+
useEffect(() => {
|
|
45
|
+
return () => {
|
|
46
|
+
if (makeStylesEls.length) {
|
|
47
|
+
makeStylesEls.forEach(el => el && el.remove && el.remove());
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
}, []);
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
setTheme(theme);
|
|
53
|
+
}, [theme]);
|
|
54
|
+
return jsx("div", {
|
|
55
|
+
css: ThemeProviderRoot,
|
|
56
|
+
className: ['DGN-UI-Theme', className].join(' ').trim()
|
|
57
|
+
}, children);
|
|
58
|
+
});
|
|
59
|
+
ThemeProvider.defaultProps = {
|
|
60
|
+
theme: {},
|
|
61
|
+
className: ''
|
|
62
|
+
};
|
|
63
|
+
ThemeProvider.propTypes = {
|
|
64
|
+
theme: object,
|
|
65
|
+
className: string,
|
|
66
|
+
children: node
|
|
67
|
+
};
|
|
68
|
+
export default ThemeProvider;
|