@digitalc/dxp-ui 0.0.5-alpha.15 → 0.0.5-alpha.17
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 +81 -47
- package/es/assets/token.json +128 -102
- package/es/components/Accordion/designTokens.d.ts +3 -3
- package/es/components/Accordion/designTokens.js +22 -14
- package/es/components/Accordion/index.js +8 -4
- package/es/components/Amount/designTokens.d.ts +2 -2
- package/es/components/Amount/designTokens.js +12 -8
- package/es/components/Amount/index.d.ts +3 -10
- package/es/components/Amount/index.js +122 -136
- package/es/components/Button/designTokens.d.ts +18 -3
- package/es/components/Button/designTokens.js +136 -122
- package/es/components/Button/index.d.ts +16 -5
- package/es/components/Button/index.js +89 -94
- package/es/components/Button/style/index.less +1 -1
- package/es/components/Card/designTokens.d.ts +9 -0
- package/es/components/Card/designTokens.js +14 -0
- package/es/components/Card/index.d.ts +15 -0
- package/es/components/Card/index.js +66 -0
- package/es/components/Card/style/index.less +45 -0
- package/es/components/Card/style/variables.less +4 -0
- package/es/components/Chip/designTokens.d.ts +2 -2
- package/es/components/Chip/designTokens.js +25 -21
- package/es/components/Chip/index.js +9 -8
- package/es/components/Divider/designTokens.d.ts +4 -0
- package/es/components/Divider/designTokens.js +9 -0
- package/es/components/Divider/index.d.ts +3 -8
- package/es/components/Divider/index.js +31 -49
- package/es/components/Drawer/designTokens.d.ts +2 -2
- package/es/components/Drawer/designTokens.js +30 -26
- package/es/components/Drawer/index.d.ts +6 -2
- package/es/components/Drawer/index.js +71 -68
- package/es/components/Drawer/style/index.less +13 -7
- package/es/components/GlobalTokenProvider/index.d.ts +11 -0
- package/es/components/GlobalTokenProvider/index.js +16 -0
- package/es/components/Icon/designTokens.d.ts +3 -3
- package/es/components/Icon/designTokens.js +11 -6
- package/es/components/Icon/index.js +6 -2
- package/es/components/IconButton/designTokens.d.ts +3 -4
- package/es/components/IconButton/designTokens.js +38 -32
- package/es/components/IconButton/index.d.ts +1 -1
- package/es/components/IconButton/index.js +7 -7
- package/es/components/Image/index.d.ts +1 -1
- package/es/components/Image/index.js +4 -3
- package/es/components/ListItem/designTokens.d.ts +4 -2
- package/es/components/ListItem/designTokens.js +36 -30
- package/es/components/ListItem/index.d.ts +12 -2
- package/es/components/ListItem/index.js +95 -30
- package/es/components/ListItem/style/index.less +42 -9
- package/es/components/Modal/designTokens.d.ts +11 -20
- package/es/components/Modal/designTokens.js +39 -30
- package/es/components/Modal/index.js +24 -11
- package/es/components/Navigation/designTokens.d.ts +9 -8
- package/es/components/Navigation/designTokens.js +24 -18
- package/es/components/Navigation/index.d.ts +1 -0
- package/es/components/Navigation/index.js +14 -10
- package/es/components/Notification/designTokens.d.ts +9 -0
- package/es/components/Notification/designTokens.js +14 -0
- package/es/components/Notification/index.d.ts +12 -0
- package/es/components/Notification/index.js +54 -0
- package/es/components/Notification/style/index.less +45 -0
- package/es/components/Notification/style/variables.less +4 -0
- package/es/components/Search/designTokens.d.ts +4 -4
- package/es/components/Search/designTokens.js +57 -46
- package/es/components/Search/index.js +15 -9
- package/es/components/Stepper/designTokens.d.ts +4 -5
- package/es/components/Stepper/designTokens.js +48 -40
- package/es/components/Stepper/index.d.ts +9 -10
- package/es/components/Stepper/index.js +139 -135
- package/es/components/Stepper/style/index.less +27 -12
- package/es/components/StickyFooter/designTokens.d.ts +2 -2
- package/es/components/StickyFooter/designTokens.js +20 -16
- package/es/components/StickyFooter/index.d.ts +2 -2
- package/es/components/StickyFooter/index.js +68 -39
- package/es/components/StickyFooter/style/index.less +5 -3
- package/es/components/Tabs/designTokens.d.ts +6 -6
- package/es/components/Tabs/designTokens.js +77 -60
- package/es/components/Tabs/index.js +11 -6
- package/es/components/Tag/designTokens.d.ts +42 -42
- package/es/components/Tag/designTokens.js +139 -95
- package/es/components/Tag/index.d.ts +1 -1
- package/es/components/Tag/index.js +16 -3
- package/es/components/Text/designTokens.d.ts +19 -10
- package/es/components/Text/designTokens.js +65 -51
- package/es/components/Text/index.d.ts +2 -1
- package/es/components/Text/index.js +42 -12
- package/es/components/TextInputInside/designTokens.d.ts +3 -12
- package/es/components/TextInputInside/designTokens.js +59 -57
- package/es/components/TextInputInside/index.js +10 -7
- package/es/components/TextInputOutside/designTokens.d.ts +5 -5
- package/es/components/TextInputOutside/designTokens.js +77 -61
- package/es/components/TextInputOutside/index.js +12 -7
- package/es/components/TextLink/designTokens.d.ts +2 -2
- package/es/components/TextLink/designTokens.js +14 -10
- package/es/components/TextLink/index.js +2 -1
- package/es/components/Toast/designTokens.d.ts +2 -2
- package/es/components/Toast/designTokens.js +20 -19
- package/es/components/Toast/index.js +2 -1
- package/es/components/Toggle/designTokens.d.ts +2 -2
- package/es/components/Toggle/designTokens.js +16 -12
- package/es/components/Toggle/index.js +2 -1
- package/es/components/index.d.ts +7 -1
- package/es/components/index.js +6 -2
- package/es/constants/index.d.ts +4 -1
- package/es/constants/index.js +5 -1
- package/es/index.d.ts +2 -0
- package/es/index.js +4 -0
- package/es/tokens/DXPGlobal.d.ts +27 -19
- package/es/tokens/DXPGlobal.js +3 -2
- package/es/utils/TokenContext.d.ts +14 -0
- package/es/utils/TokenContext.js +91 -0
- package/es/utils/deviceType.d.ts +14 -0
- package/es/utils/deviceType.js +65 -0
- package/es/utils/index.d.ts +9 -0
- package/es/utils/index.js +9 -0
- package/es/utils/tokenHelper.js +2 -5
- package/es/utils/tokenManager.d.ts +82 -20
- package/es/utils/tokenManager.js +857 -779
- package/lib/assets/token.json +128 -102
- package/lib/components/Accordion/designTokens.d.ts +3 -3
- package/lib/components/Accordion/designTokens.js +25 -17
- package/lib/components/Accordion/index.js +8 -4
- package/lib/components/Amount/designTokens.d.ts +2 -2
- package/lib/components/Amount/designTokens.js +13 -9
- package/lib/components/Amount/index.d.ts +3 -10
- package/lib/components/Amount/index.js +84 -90
- package/lib/components/Button/designTokens.d.ts +18 -3
- package/lib/components/Button/designTokens.js +120 -114
- package/lib/components/Button/index.d.ts +16 -5
- package/lib/components/Button/index.js +59 -51
- package/lib/components/Button/style/index.less +1 -1
- package/lib/components/Card/designTokens.d.ts +9 -0
- package/lib/components/Card/designTokens.js +37 -0
- package/lib/components/Card/index.d.ts +15 -0
- package/lib/components/Card/index.js +156 -0
- package/lib/components/Card/style/index.less +45 -0
- package/lib/components/Card/style/variables.less +4 -0
- package/lib/components/Chip/designTokens.d.ts +2 -2
- package/lib/components/Chip/designTokens.js +25 -21
- package/lib/components/Chip/index.js +8 -5
- package/lib/components/Divider/designTokens.d.ts +4 -0
- package/lib/components/Divider/designTokens.js +32 -0
- package/lib/components/Divider/index.d.ts +3 -8
- package/lib/components/Divider/index.js +41 -43
- package/lib/components/Drawer/designTokens.d.ts +2 -2
- package/lib/components/Drawer/designTokens.js +31 -38
- package/lib/components/Drawer/index.d.ts +6 -2
- package/lib/components/Drawer/index.js +80 -53
- package/lib/components/Drawer/style/index.less +13 -7
- package/lib/components/GlobalTokenProvider/index.d.ts +11 -0
- package/lib/components/GlobalTokenProvider/index.js +40 -0
- package/lib/components/Icon/designTokens.d.ts +3 -3
- package/lib/components/Icon/designTokens.js +11 -17
- package/lib/components/Icon/index.js +5 -4
- package/lib/components/IconButton/designTokens.d.ts +3 -4
- package/lib/components/IconButton/designTokens.js +41 -34
- package/lib/components/IconButton/index.d.ts +1 -1
- package/lib/components/IconButton/index.js +25 -23
- package/lib/components/Image/index.d.ts +1 -1
- package/lib/components/Image/index.js +4 -4
- package/lib/components/ListItem/designTokens.d.ts +4 -2
- package/lib/components/ListItem/designTokens.js +36 -41
- package/lib/components/ListItem/index.d.ts +12 -2
- package/lib/components/ListItem/index.js +115 -46
- package/lib/components/ListItem/style/index.less +42 -9
- package/lib/components/Modal/designTokens.d.ts +11 -20
- package/lib/components/Modal/designTokens.js +44 -60
- package/lib/components/Modal/index.js +63 -16
- package/lib/components/Navigation/designTokens.d.ts +9 -8
- package/lib/components/Navigation/designTokens.js +24 -29
- package/lib/components/Navigation/index.d.ts +1 -0
- package/lib/components/Navigation/index.js +13 -12
- package/lib/components/Notification/designTokens.d.ts +9 -0
- package/lib/components/Notification/designTokens.js +37 -0
- package/lib/components/Notification/index.d.ts +12 -0
- package/lib/components/Notification/index.js +110 -0
- package/lib/components/Notification/style/index.less +45 -0
- package/lib/components/Notification/style/variables.less +4 -0
- package/lib/components/Search/designTokens.d.ts +4 -4
- package/lib/components/Search/designTokens.js +61 -49
- package/lib/components/Search/index.js +31 -9
- package/lib/components/Stepper/designTokens.d.ts +4 -5
- package/lib/components/Stepper/designTokens.js +70 -62
- package/lib/components/Stepper/index.d.ts +9 -10
- package/lib/components/Stepper/index.js +104 -53
- package/lib/components/Stepper/style/index.less +27 -12
- package/lib/components/StickyFooter/designTokens.d.ts +2 -2
- package/lib/components/StickyFooter/designTokens.js +21 -17
- package/lib/components/StickyFooter/index.d.ts +2 -2
- package/lib/components/StickyFooter/index.js +50 -18
- package/lib/components/StickyFooter/style/index.less +5 -3
- package/lib/components/Tabs/designTokens.d.ts +6 -6
- package/lib/components/Tabs/designTokens.js +80 -63
- package/lib/components/Tabs/index.js +19 -12
- package/lib/components/Tag/designTokens.d.ts +42 -42
- package/lib/components/Tag/designTokens.js +159 -115
- package/lib/components/Tag/index.d.ts +1 -1
- package/lib/components/Tag/index.js +27 -14
- package/lib/components/Text/designTokens.d.ts +19 -10
- package/lib/components/Text/designTokens.js +65 -51
- package/lib/components/Text/index.d.ts +2 -1
- package/lib/components/Text/index.js +407 -297
- package/lib/components/TextInputInside/designTokens.d.ts +3 -12
- package/lib/components/TextInputInside/designTokens.js +62 -75
- package/lib/components/TextInputInside/index.js +10 -7
- package/lib/components/TextInputOutside/designTokens.d.ts +5 -5
- package/lib/components/TextInputOutside/designTokens.js +82 -66
- package/lib/components/TextInputOutside/index.js +12 -8
- package/lib/components/TextLink/designTokens.d.ts +2 -2
- package/lib/components/TextLink/designTokens.js +14 -21
- package/lib/components/TextLink/index.js +3 -2
- package/lib/components/Toast/designTokens.d.ts +2 -2
- package/lib/components/Toast/designTokens.js +20 -16
- package/lib/components/Toast/index.js +7 -6
- package/lib/components/Toggle/designTokens.d.ts +2 -2
- package/lib/components/Toggle/designTokens.js +16 -23
- package/lib/components/Toggle/index.js +3 -2
- package/lib/components/index.d.ts +7 -1
- package/lib/components/index.js +10 -2
- package/lib/constants/index.d.ts +4 -1
- package/lib/constants/index.js +5 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.js +22 -0
- package/lib/tokens/DXPGlobal.d.ts +27 -19
- package/lib/tokens/DXPGlobal.js +1 -1
- package/lib/utils/TokenContext.d.ts +14 -0
- package/lib/utils/TokenContext.js +85 -0
- package/lib/utils/deviceType.d.ts +14 -0
- package/lib/utils/deviceType.js +56 -0
- package/lib/utils/index.d.ts +9 -0
- package/lib/utils/index.js +44 -0
- package/lib/utils/tokenHelper.js +2 -12
- package/lib/utils/tokenManager.d.ts +82 -20
- package/lib/utils/tokenManager.js +840 -777
- package/package.json +14 -11
- package/umd/dxp-ui.min.css +1 -1
- package/umd/dxp-ui.min.js +1 -1
- package/lib/components/Button/demo/index.d.ts +0 -3
- package/lib/components/Button/demo/index.js +0 -138
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["listType", "leftIcon", "leftImageSrc", "title", "subTitle", "onToggleChange", "toggleChecked", "showToggle", "showLink", "LinkName", "onLinkClick", "showStatus", "statusIconName", "statusIconColor", "subTitleUp", "tagName", "showTag", "subIconObj", "leftThumbnail", "showRightBtn", "onRightBtnClick", "rightBtnTxt", "showRightIcon", "rightIconName", "onRightIconClick", "tappableArea", "tappableAreaClick"];
|
|
3
|
+
var _excluded = ["size", "listType", "leftIcon", "leftImageSrc", "title", "subTitle", "onToggleChange", "toggleChecked", "showToggle", "showLink", "LinkName", "onLinkClick", "showStatus", "statusIconName", "statusIconColor", "subTitleUp", "tagName", "showTag", "subIconObj", "leftThumbnail", "showRightBtn", "onRightBtnClick", "rightBtnTxt", "showRightIcon", "rightIconName", "onRightIconClick", "tappableArea", "tappableAreaClick", "children", "className", "showRightText", "rightText", "rightChildren", "leftChildren", "prefix"];
|
|
4
4
|
import React from 'react';
|
|
5
|
-
import
|
|
5
|
+
import { useDesignTokens } from "./designTokens";
|
|
6
6
|
import { useStyleRegister } from '@ant-design/cssinjs';
|
|
7
7
|
import { isEmpty } from 'lodash';
|
|
8
8
|
import { theme } from "../../utils/theme";
|
|
9
|
-
import { Icon, Image, Text, Toggle, TextLink, TextLinkEnum, Tag,
|
|
9
|
+
import { Icon, Image, Text, Toggle, TextLink, TextLinkEnum, Tag, BackImageEnum, Button } from "../index";
|
|
10
10
|
import { cssClasses } from "../../constants";
|
|
11
11
|
import "./style/index.less";
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
export var ListItemTypes = {
|
|
14
14
|
ListItemIcon: 'ListItemIcon',
|
|
15
|
+
// 见设计稿 左侧ICON
|
|
15
16
|
ListItemImage: 'ListItemImage',
|
|
16
|
-
|
|
17
|
+
// 见设计稿 左侧 Image(铺满)
|
|
18
|
+
ListItemOther: 'ListItemOther',
|
|
19
|
+
// 见设计稿 左侧thumbImage
|
|
20
|
+
ListItemDefault: 'ListItemDefault',
|
|
21
|
+
// 左右 文字
|
|
22
|
+
ListItemCustom: 'ListItemCustom' // 只有一个壳子 内容纯自定义
|
|
17
23
|
};
|
|
18
24
|
export var TAPPABLE_AREAS = {
|
|
19
25
|
ALL: 'ALL',
|
|
@@ -27,7 +33,10 @@ export var ListItemRightTypes = {
|
|
|
27
33
|
Default: 'Default'
|
|
28
34
|
};
|
|
29
35
|
var ListItem = function ListItem(_ref) {
|
|
30
|
-
var
|
|
36
|
+
var _ref$size = _ref.size,
|
|
37
|
+
size = _ref$size === void 0 ? '' : _ref$size,
|
|
38
|
+
_ref$listType = _ref.listType,
|
|
39
|
+
listType = _ref$listType === void 0 ? ListItemTypes.ListItemDefault : _ref$listType,
|
|
31
40
|
leftIcon = _ref.leftIcon,
|
|
32
41
|
leftImageSrc = _ref.leftImageSrc,
|
|
33
42
|
title = _ref.title,
|
|
@@ -60,7 +69,17 @@ var ListItem = function ListItem(_ref) {
|
|
|
60
69
|
onRightIconClick = _ref.onRightIconClick,
|
|
61
70
|
tappableArea = _ref.tappableArea,
|
|
62
71
|
tappableAreaClick = _ref.tappableAreaClick,
|
|
72
|
+
children = _ref.children,
|
|
73
|
+
_ref$className = _ref.className,
|
|
74
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
75
|
+
showRightText = _ref.showRightText,
|
|
76
|
+
rightText = _ref.rightText,
|
|
77
|
+
rightChildren = _ref.rightChildren,
|
|
78
|
+
leftChildren = _ref.leftChildren,
|
|
79
|
+
_ref$prefix = _ref.prefix,
|
|
80
|
+
prefix = _ref$prefix === void 0 ? "".concat(cssClasses.PREFIX, "-list-item") : _ref$prefix,
|
|
63
81
|
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
82
|
+
var designTokens = useDesignTokens();
|
|
64
83
|
var sizingListItemImageImage = designTokens.sizingListItemImageImage,
|
|
65
84
|
borderRadiusListItem = designTokens.borderRadiusListItem,
|
|
66
85
|
colorListItemBackground = designTokens.colorListItemBackground,
|
|
@@ -74,7 +93,9 @@ var ListItem = function ListItem(_ref) {
|
|
|
74
93
|
spacingListItemImageIconPaddingRight = designTokens.spacingListItemImageIconPaddingRight,
|
|
75
94
|
colorListItemTextPoints = designTokens.colorListItemTextPoints,
|
|
76
95
|
sizingListItemImageThumbnail = designTokens.sizingListItemImageThumbnail,
|
|
77
|
-
sizingListItemIconLg = designTokens.sizingListItemIconLg
|
|
96
|
+
sizingListItemIconLg = designTokens.sizingListItemIconLg,
|
|
97
|
+
spacingListItemTextVerticalGapMd = designTokens.spacingListItemTextVerticalGapMd,
|
|
98
|
+
spacingListItemTextVerticalGapSm = designTokens.spacingListItemTextVerticalGapSm;
|
|
78
99
|
|
|
79
100
|
// console.log('designTokens', designTokens);
|
|
80
101
|
|
|
@@ -82,9 +103,9 @@ var ListItem = function ListItem(_ref) {
|
|
|
82
103
|
var hashId = useStyleRegister({
|
|
83
104
|
theme: theme,
|
|
84
105
|
token: {},
|
|
85
|
-
path: ["".concat(
|
|
106
|
+
path: ["".concat(prefix)]
|
|
86
107
|
}, function () {
|
|
87
|
-
return "\n .".concat(
|
|
108
|
+
return "\n .".concat(prefix, " {\n box-shadow: 0px 3px 8px 0px rgba(0, 0, 0, 0.12);\n border-radius: ").concat(borderRadiusListItem || 8, "px;\n background-color:").concat(colorListItemBackground || 'transparent', ";\n &.noShadow{\n box-shadow:none !important;\n }\n &.").concat(prefix, "-M {\n padding: ").concat(spacingListItemTextVerticalGapMd / 2, "px 0;\n }\n &.").concat(prefix, "-S {\n padding: ").concat(spacingListItemTextVerticalGapSm / 2, "px 0;\n }\n .").concat(prefix, "-icon-container {\n background:").concat(colorListItemIconBackground || '#F5F5F8', ";\n margin-right:").concat(spacingListItemTextPaddingHorizontal, "px;\n }\n .").concat(prefix, "-image-container {\n margin-right:").concat(spacingListItemTextPaddingHorizontal, "px;\n }\n }\n .").concat(prefix, "-right {\n padding-right:").concat(spacingListItemTextPaddingHorizontal, "px;\n &.noPaddingRight{\n padding-right: 0px;\n }\n }\n .").concat(prefix, "-status-warp {\n padding-left: ").concat(spacingListItemTextPaddingHorizontal, "px;\n }\n .").concat(prefix, "-title {\n color:").concat(colorListItemTextTitle, ";\n }\n .").concat(prefix, "-right-title{\n color:").concat(colorListItemTextTitle, ";\n }\n .").concat(prefix, "-subTitle {\n color:").concat(colorListItemTextSubtitle, ";\n }\n \n .").concat(prefix, "-sub-icon-title {\n color:").concat(colorListItemTextPoints, ";\n margin-left:").concat(spacingListItemImageIconPaddingRight, "px;\n }\n .").concat(prefix, "-right-btn {\n min-width:60px !important;\n }\n ");
|
|
88
109
|
});
|
|
89
110
|
return hashId;
|
|
90
111
|
};
|
|
@@ -114,21 +135,61 @@ var ListItem = function ListItem(_ref) {
|
|
|
114
135
|
onToggleChange(checked, event);
|
|
115
136
|
}
|
|
116
137
|
};
|
|
138
|
+
if (listType === ListItemTypes.ListItemCustom) {
|
|
139
|
+
return /*#__PURE__*/_jsx("div", _objectSpread(_objectSpread({
|
|
140
|
+
className: "".concat(prefix, " ").concat(className),
|
|
141
|
+
onClick: tappableAreaClick
|
|
142
|
+
}, restProps), {}, {
|
|
143
|
+
children: children
|
|
144
|
+
}));
|
|
145
|
+
}
|
|
146
|
+
;
|
|
147
|
+
if (listType === ListItemTypes.ListItemDefault) {
|
|
148
|
+
return /*#__PURE__*/_jsxs("div", _objectSpread(_objectSpread({
|
|
149
|
+
className: "".concat(prefix, " ").concat(prefix, "-").concat(size, " noShadow default ").concat(className || ""),
|
|
150
|
+
onClick: onAllClick
|
|
151
|
+
}, restProps), {}, {
|
|
152
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
153
|
+
className: "".concat(prefix, "-default-left"),
|
|
154
|
+
children: [subTitleUp && subTitle && /*#__PURE__*/_jsx(Text, {
|
|
155
|
+
size: "ContentC12Regular",
|
|
156
|
+
className: "".concat(prefix, "-subTitle"),
|
|
157
|
+
children: subTitle
|
|
158
|
+
}), title && /*#__PURE__*/_jsx(Text, {
|
|
159
|
+
size: "ContentC14Regular",
|
|
160
|
+
className: "".concat(prefix, "-title ").concat(subTitle ? 'line1' : 'line2'),
|
|
161
|
+
children: title
|
|
162
|
+
}), !subTitleUp && subTitle && /*#__PURE__*/_jsx(Text, {
|
|
163
|
+
size: "ContentC12Regular",
|
|
164
|
+
className: "".concat(prefix, "-subTitle"),
|
|
165
|
+
children: subTitle
|
|
166
|
+
}), leftChildren]
|
|
167
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
168
|
+
className: "".concat(prefix, "-default-right"),
|
|
169
|
+
children: [!isEmpty(rightText) && /*#__PURE__*/_jsx(Text, {
|
|
170
|
+
className: "".concat(prefix, "-right-title"),
|
|
171
|
+
size: "TitleT14Bold",
|
|
172
|
+
children: rightText
|
|
173
|
+
}), rightChildren]
|
|
174
|
+
})]
|
|
175
|
+
}));
|
|
176
|
+
}
|
|
177
|
+
;
|
|
117
178
|
return /*#__PURE__*/_jsxs("div", _objectSpread(_objectSpread({
|
|
118
|
-
className: "
|
|
179
|
+
className: "".concat(prefix, " ").concat(prefix, "-").concat(size, " ").concat(listType === ListItemTypes.ListItemOther ? 'noShadow' : "", " ").concat(className || ""),
|
|
180
|
+
onClick: onAllClick
|
|
119
181
|
}, restProps), {}, {
|
|
120
|
-
onClick: onAllClick,
|
|
121
182
|
children: [/*#__PURE__*/_jsxs("div", {
|
|
122
|
-
className: "
|
|
183
|
+
className: "".concat(prefix, "-left"),
|
|
123
184
|
children: [listType === ListItemTypes.ListItemIcon && !isEmpty(leftIcon) && /*#__PURE__*/_jsx("div", {
|
|
124
|
-
className: "".concat(
|
|
185
|
+
className: "".concat(prefix, "-icon-container"),
|
|
125
186
|
children: /*#__PURE__*/_jsx(Icon, {
|
|
126
187
|
name: leftIcon ? leftIcon.iconName : '',
|
|
127
188
|
size: sizingListItemIconIcon,
|
|
128
189
|
style: leftIcon ? leftIcon.iconStyle : {}
|
|
129
190
|
})
|
|
130
191
|
}), listType === ListItemTypes.ListItemImage && leftImageSrc && /*#__PURE__*/_jsxs("div", {
|
|
131
|
-
className: "".concat(
|
|
192
|
+
className: "".concat(prefix, "-image-container"),
|
|
132
193
|
children: [/*#__PURE__*/_jsx(Image, {
|
|
133
194
|
radio: 1,
|
|
134
195
|
src: leftImageSrc,
|
|
@@ -146,9 +207,9 @@ var ListItem = function ListItem(_ref) {
|
|
|
146
207
|
children: tagName
|
|
147
208
|
})]
|
|
148
209
|
}), listType === ListItemTypes.ListItemOther && leftThumbnail && /*#__PURE__*/_jsx("div", {
|
|
149
|
-
className: "".concat(
|
|
210
|
+
className: "".concat(prefix, "-image-container"),
|
|
150
211
|
children: /*#__PURE__*/_jsx(Image, {
|
|
151
|
-
radio:
|
|
212
|
+
radio: BackImageEnum.whRadio1,
|
|
152
213
|
src: leftThumbnail,
|
|
153
214
|
imageSize: sizingListItemImageThumbnail || 56,
|
|
154
215
|
style: {
|
|
@@ -158,42 +219,42 @@ var ListItem = function ListItem(_ref) {
|
|
|
158
219
|
})
|
|
159
220
|
})]
|
|
160
221
|
}), /*#__PURE__*/_jsxs("div", {
|
|
161
|
-
className: "
|
|
222
|
+
className: "".concat(prefix, "-right ").concat(showRightText || rightChildren || listType === ListItemTypes.ListItemOther ? 'noPaddingRight' : ''),
|
|
162
223
|
onClick: onExceptImgClick,
|
|
163
224
|
children: [/*#__PURE__*/_jsxs("div", {
|
|
164
|
-
className: "".concat(
|
|
165
|
-
children: [subTitleUp && /*#__PURE__*/_jsx(Text, {
|
|
225
|
+
className: "".concat(prefix, "-title-sub-warp"),
|
|
226
|
+
children: [subTitleUp && subTitle && /*#__PURE__*/_jsx(Text, {
|
|
166
227
|
size: "ContentC12Regular",
|
|
167
|
-
className: "".concat(
|
|
228
|
+
className: "".concat(prefix, "-subTitle"),
|
|
168
229
|
children: subTitle
|
|
169
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
230
|
+
}), title && /*#__PURE__*/_jsx(Text, {
|
|
170
231
|
size: "ContentC14Bold",
|
|
171
|
-
className: "".concat(
|
|
232
|
+
className: "".concat(prefix, "-title ").concat(subTitle ? 'line1' : 'line2'),
|
|
172
233
|
children: title
|
|
173
|
-
}), !subTitleUp && /*#__PURE__*/_jsx(Text, {
|
|
234
|
+
}), !subTitleUp && subTitle && /*#__PURE__*/_jsx(Text, {
|
|
174
235
|
size: "ContentC12Regular",
|
|
175
|
-
className: "".concat(
|
|
236
|
+
className: "".concat(prefix, "-subTitle"),
|
|
176
237
|
children: subTitle
|
|
177
238
|
}), !isEmpty(subIconObj) && /*#__PURE__*/_jsxs("div", {
|
|
178
|
-
className: "".concat(
|
|
239
|
+
className: "".concat(prefix, "-sub-icon"),
|
|
179
240
|
children: [/*#__PURE__*/_jsx(Icon, {
|
|
180
241
|
name: subIconObj.iconName,
|
|
181
242
|
color: colorListItemIconSubtle,
|
|
182
243
|
size: sizingListItemImageIcon || 20
|
|
183
244
|
}), /*#__PURE__*/_jsx(Text, {
|
|
184
245
|
size: "ContentC12Regular",
|
|
185
|
-
className: "".concat(
|
|
246
|
+
className: "".concat(prefix, "-sub-icon-title"),
|
|
186
247
|
children: subIconObj.value
|
|
187
248
|
})]
|
|
188
|
-
})]
|
|
249
|
+
}), leftChildren]
|
|
189
250
|
}), /*#__PURE__*/_jsxs("div", {
|
|
190
|
-
className: "".concat(
|
|
251
|
+
className: "".concat(prefix, "-status-warp"),
|
|
191
252
|
children: [showToggle && /*#__PURE__*/_jsx(Toggle, {
|
|
192
253
|
size: "small",
|
|
193
254
|
checked: toggleChecked,
|
|
194
255
|
onChange: onSwicthChange
|
|
195
256
|
}), showLink && /*#__PURE__*/_jsx(TextLink, {
|
|
196
|
-
className: "".concat(
|
|
257
|
+
className: "".concat(prefix, "-right-link"),
|
|
197
258
|
type: TextLinkEnum.default,
|
|
198
259
|
text: LinkName,
|
|
199
260
|
onClick: onTextLinkClick
|
|
@@ -202,7 +263,7 @@ var ListItem = function ListItem(_ref) {
|
|
|
202
263
|
size: sizingListItemIconIcon,
|
|
203
264
|
color: statusIconColor
|
|
204
265
|
}), showRightBtn && /*#__PURE__*/_jsx(Button, {
|
|
205
|
-
className: "".concat(
|
|
266
|
+
className: "".concat(prefix, "-right-btn"),
|
|
206
267
|
onClick: function onClick(e) {
|
|
207
268
|
e.stopPropagation();
|
|
208
269
|
if (onRightBtnClick) {
|
|
@@ -219,7 +280,11 @@ var ListItem = function ListItem(_ref) {
|
|
|
219
280
|
onRightIconClick();
|
|
220
281
|
}
|
|
221
282
|
}
|
|
222
|
-
})
|
|
283
|
+
}), showRightText && /*#__PURE__*/_jsx(Text, {
|
|
284
|
+
className: "".concat(prefix, "-right-title"),
|
|
285
|
+
size: "TitleT14Bold",
|
|
286
|
+
children: rightText
|
|
287
|
+
}), rightChildren]
|
|
223
288
|
})]
|
|
224
289
|
})]
|
|
225
290
|
}));
|
|
@@ -1,14 +1,47 @@
|
|
|
1
1
|
@import './variables.less';
|
|
2
|
+
@component: list-item;
|
|
2
3
|
|
|
3
|
-
.@{prefix}
|
|
4
|
+
.@{prefix}-@{component} {
|
|
4
5
|
display: flex;
|
|
5
6
|
flex-direction: row;
|
|
6
7
|
align-items: center;
|
|
7
8
|
overflow: hidden;
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
&.default {
|
|
11
|
+
justify-content: space-between;
|
|
12
|
+
|
|
13
|
+
.@{prefix}-@{component}-title {
|
|
14
|
+
display: block;
|
|
15
|
+
overflow: hidden;
|
|
16
|
+
text-overflow: ellipsis;
|
|
17
|
+
-webkit-box-orient: vertical;
|
|
18
|
+
|
|
19
|
+
&.line1 {
|
|
20
|
+
display: -webkit-box;
|
|
21
|
+
-webkit-line-clamp: 1;
|
|
22
|
+
-webkit-box-orient: vertical;
|
|
23
|
+
overflow: hidden;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&.line2 {
|
|
27
|
+
display: -webkit-box;
|
|
28
|
+
-webkit-line-clamp: 2;
|
|
29
|
+
-webkit-box-orient: vertical;
|
|
30
|
+
overflow: hidden;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.@{prefix}-@{component}-subTitle {
|
|
35
|
+
display: block;
|
|
36
|
+
white-space: nowrap;
|
|
37
|
+
overflow: hidden;
|
|
38
|
+
text-overflow: ellipsis;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.@{prefix}-@{component}-left {
|
|
10
43
|
|
|
11
|
-
.@{prefix}-icon-container {
|
|
44
|
+
.@{prefix}-@{component}-icon-container {
|
|
12
45
|
width: 80px;
|
|
13
46
|
height: 80px;
|
|
14
47
|
display: flex;
|
|
@@ -17,7 +50,7 @@
|
|
|
17
50
|
flex-shrink: 0;
|
|
18
51
|
}
|
|
19
52
|
|
|
20
|
-
.@{prefix}-image-container {
|
|
53
|
+
.@{prefix}-@{component}-image-container {
|
|
21
54
|
display: flex;
|
|
22
55
|
align-items: center;
|
|
23
56
|
justify-content: center;
|
|
@@ -27,7 +60,7 @@
|
|
|
27
60
|
|
|
28
61
|
}
|
|
29
62
|
|
|
30
|
-
.@{prefix}-
|
|
63
|
+
.@{prefix}-@{component}-right {
|
|
31
64
|
display: flex;
|
|
32
65
|
flex: 1;
|
|
33
66
|
min-width: 0;
|
|
@@ -35,11 +68,11 @@
|
|
|
35
68
|
align-items: center;
|
|
36
69
|
justify-content: space-between;
|
|
37
70
|
|
|
38
|
-
.@{prefix}-title-sub-warp {
|
|
71
|
+
.@{prefix}-@{component}-title-sub-warp {
|
|
39
72
|
flex: 1;
|
|
40
73
|
overflow: hidden;
|
|
41
74
|
|
|
42
|
-
.@{prefix}-
|
|
75
|
+
.@{prefix}-@{component}-title {
|
|
43
76
|
display: block;
|
|
44
77
|
overflow: hidden;
|
|
45
78
|
text-overflow: ellipsis;
|
|
@@ -60,7 +93,7 @@
|
|
|
60
93
|
}
|
|
61
94
|
}
|
|
62
95
|
|
|
63
|
-
.@{prefix}-
|
|
96
|
+
.@{prefix}-@{component}-subTitle {
|
|
64
97
|
display: block;
|
|
65
98
|
white-space: nowrap;
|
|
66
99
|
overflow: hidden;
|
|
@@ -68,7 +101,7 @@
|
|
|
68
101
|
}
|
|
69
102
|
}
|
|
70
103
|
|
|
71
|
-
.@{prefix}-sub-icon {
|
|
104
|
+
.@{prefix}-@{component}-sub-icon {
|
|
72
105
|
display: flex;
|
|
73
106
|
align-items: center;
|
|
74
107
|
}
|
|
@@ -1,31 +1,22 @@
|
|
|
1
|
-
declare const
|
|
1
|
+
declare const useDesignTokens: () => {
|
|
2
2
|
borderRadiusLG: any;
|
|
3
3
|
titleColor: any;
|
|
4
4
|
contentBg: any;
|
|
5
5
|
headerBg: any;
|
|
6
6
|
colorText: any;
|
|
7
7
|
colorBgMask: any;
|
|
8
|
+
colorIcon: any;
|
|
8
9
|
};
|
|
9
|
-
declare const
|
|
10
|
+
declare const useOtherDesignTokens: () => {
|
|
10
11
|
width: string;
|
|
11
|
-
spacingModalCardPaddingTop:
|
|
12
|
-
spacingModalButtonStickyPaddingVertical:
|
|
13
|
-
spacingModalCardVerticalGap:
|
|
14
|
-
spacingModalCardPaddingHorizontal:
|
|
12
|
+
spacingModalCardPaddingTop: number;
|
|
13
|
+
spacingModalButtonStickyPaddingVertical: number;
|
|
14
|
+
spacingModalCardVerticalGap: number;
|
|
15
|
+
spacingModalCardPaddingHorizontal: number;
|
|
16
|
+
spacingModalButtonStickyPaddingHorizontal: number;
|
|
17
|
+
spacingModalCardPaddingBottom: number;
|
|
15
18
|
};
|
|
16
|
-
declare const
|
|
19
|
+
declare const useCommonToken: () => {
|
|
17
20
|
[x: string]: string | number;
|
|
18
21
|
};
|
|
19
|
-
|
|
20
|
-
[x: string]: string | number;
|
|
21
|
-
};
|
|
22
|
-
declare const stickyFooterStyleToken: {
|
|
23
|
-
[x: string]: string | number;
|
|
24
|
-
};
|
|
25
|
-
declare const stickyHeaderFooterStyleToken: {
|
|
26
|
-
[x: string]: string | number;
|
|
27
|
-
};
|
|
28
|
-
declare const stickyHeaderStyleToken: {
|
|
29
|
-
[x: string]: string | number;
|
|
30
|
-
};
|
|
31
|
-
export { designTokens, otherDesignTokens, styleToken, stickyFooterStyleToken, stickyHeaderStyleToken, stickyHeaderFooterStyleToken, commonToken };
|
|
22
|
+
export { useDesignTokens, useOtherDesignTokens, useCommonToken };
|
|
@@ -1,35 +1,44 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
-
import {
|
|
2
|
+
import { useDynamicTokens } from "../../utils";
|
|
3
|
+
import { wSacle } from "../../utils/scaleTool";
|
|
3
4
|
import { cssClasses } from "../../constants";
|
|
4
5
|
var prefixCls = cssClasses.PREFIX + '-modal';
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
6
|
+
var useDesignTokens = function useDesignTokens() {
|
|
7
|
+
var getToken = useDynamicTokens();
|
|
8
|
+
var designTokens = {
|
|
9
|
+
borderRadiusLG: getToken('borderRadiusModal'),
|
|
10
|
+
// 圆角
|
|
11
|
+
titleColor: getToken('colorModalTextHeader'),
|
|
12
|
+
// header文本颜色
|
|
13
|
+
contentBg: getToken('colorModalBackground'),
|
|
14
|
+
// 背景
|
|
15
|
+
headerBg: getToken('colorModalBackground'),
|
|
16
|
+
// 背景
|
|
17
|
+
colorText: getToken('colorModalTextBody'),
|
|
18
|
+
// 内容文本颜色
|
|
19
|
+
colorBgMask: getToken('colorModalOverlay'),
|
|
20
|
+
// 遮罩颜色
|
|
21
|
+
colorIcon: getToken('colorModalIcon') // icon颜色
|
|
22
|
+
};
|
|
23
|
+
return designTokens;
|
|
17
24
|
};
|
|
18
|
-
var
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
+
var useOtherDesignTokens = function useOtherDesignTokens() {
|
|
26
|
+
var getToken = useDynamicTokens();
|
|
27
|
+
var otherDesignTokens = {
|
|
28
|
+
width: "calc(100vw - ".concat(wSacle(getToken('spacingModalPaddingHorizontal')), "px - ").concat(wSacle(getToken('spacingModalPaddingHorizontal')), "px)"),
|
|
29
|
+
// 宽度
|
|
30
|
+
spacingModalCardPaddingTop: wSacle(getToken('spacingModalCardPaddingTop')),
|
|
31
|
+
spacingModalButtonStickyPaddingVertical: wSacle(getToken('spacingModalButtonStickyPaddingVertical')),
|
|
32
|
+
spacingModalCardVerticalGap: wSacle(getToken('spacingModalCardVerticalGap')),
|
|
33
|
+
spacingModalCardPaddingHorizontal: wSacle(getToken('spacingModalCardPaddingHorizontal')),
|
|
34
|
+
spacingModalButtonStickyPaddingHorizontal: wSacle(getToken('spacingModalButtonStickyPaddingHorizontal')),
|
|
35
|
+
spacingModalCardPaddingBottom: wSacle(getToken('spacingModalCardPaddingBottom'))
|
|
36
|
+
};
|
|
37
|
+
return otherDesignTokens;
|
|
25
38
|
};
|
|
26
|
-
var
|
|
27
|
-
|
|
28
|
-
var
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
var stickyHeaderFooterStyleToken = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "--".concat(prefixCls, "-content-padding"), "".concat(otherDesignTokens.spacingModalCardPaddingTop, "px ").concat(otherDesignTokens.spacingModalCardPaddingHorizontal, "px ").concat(40 + getToken('spacingModalButtonStickyPaddingVertical') + getToken('spacingModalButtonStickyPaddingHorizontal'), "px ").concat(otherDesignTokens.spacingModalCardPaddingHorizontal, "px")), "--".concat(prefixCls, "-footer-padding"), "".concat(otherDesignTokens.spacingModalButtonStickyPaddingVertical, "px ").concat(getToken('spacingModalButtonStickyPaddingHorizontal'), "px")), "--".concat(prefixCls, "-footer-border-top"), '1px solid #E1E1E1'), "--".concat(prefixCls, "-body-padding"), 0), "--".concat(prefixCls, "-header-margin-bottom"), "".concat(otherDesignTokens.spacingModalCardVerticalGap, "px"));
|
|
33
|
-
// content和footer随滚动条滚, header不滚
|
|
34
|
-
var stickyHeaderStyleToken = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "--".concat(prefixCls, "-content-padding"), "0 ".concat(otherDesignTokens.spacingModalCardPaddingHorizontal, "px ").concat(getToken('spacingModalCardPaddingBottom'), "px ").concat(otherDesignTokens.spacingModalCardPaddingHorizontal, "px")), "--".concat(prefixCls, "-footer-padding"), "".concat(otherDesignTokens.spacingModalCardVerticalGap, "px 0 0")), "--".concat(prefixCls, "-footer-border-top"), 'none'), "--".concat(prefixCls, "-body-padding"), "".concat(otherDesignTokens.spacingModalCardPaddingTop * 2 + 26, "px 0 0 0")), "--".concat(prefixCls, "-header-margin-bottom"), 0), "--".concat(prefixCls, "-header-padding"), "".concat(otherDesignTokens.spacingModalCardPaddingTop, "px ").concat(otherDesignTokens.spacingModalCardPaddingHorizontal, "px"));
|
|
35
|
-
export { designTokens, otherDesignTokens, styleToken, stickyFooterStyleToken, stickyHeaderStyleToken, stickyHeaderFooterStyleToken, commonToken };
|
|
39
|
+
var useCommonToken = function useCommonToken() {
|
|
40
|
+
var getToken = useDynamicTokens();
|
|
41
|
+
var commonToken = _defineProperty(_defineProperty({}, "--".concat(prefixCls, "-footer-margin-top"), 0), "--".concat(prefixCls, "-footer-padding"), "".concat(wSacle(getToken('spacingModalButtonPaddingTop')), "px 0 0"));
|
|
42
|
+
return commonToken;
|
|
43
|
+
};
|
|
44
|
+
export { useDesignTokens, useOtherDesignTokens, useCommonToken };
|
|
@@ -3,13 +3,14 @@ import _ConfigProvider from "antd/es/config-provider";
|
|
|
3
3
|
import "antd/es/modal/style";
|
|
4
4
|
import _Modal from "antd/es/modal";
|
|
5
5
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
6
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
6
7
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
7
|
-
var _excluded = ["title", "style", "children", "type", "breakpoint", "size", "prefix", "footerAlign", "footer"];
|
|
8
|
+
var _excluded = ["title", "style", "children", "type", "breakpoint", "size", "prefix", "footerAlign", "footer", "className"];
|
|
8
9
|
import React from 'react';
|
|
9
10
|
import { useStyleRegister } from '@ant-design/cssinjs';
|
|
10
11
|
import { theme } from "../../utils/theme";
|
|
11
12
|
import { cssClasses } from "../../constants";
|
|
12
|
-
import {
|
|
13
|
+
import { useDesignTokens, useOtherDesignTokens, useCommonToken } from "./designTokens";
|
|
13
14
|
import Text from "../Text";
|
|
14
15
|
import "./style/index.less";
|
|
15
16
|
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
@@ -29,18 +30,31 @@ var Modal = function Modal(props) {
|
|
|
29
30
|
footerAlign = _props$footerAlign === void 0 ? 'right' : _props$footerAlign,
|
|
30
31
|
_props$footer = props.footer,
|
|
31
32
|
footer = _props$footer === void 0 ? null : _props$footer,
|
|
33
|
+
_props$className = props.className,
|
|
34
|
+
className = _props$className === void 0 ? '' : _props$className,
|
|
32
35
|
attr = _objectWithoutProperties(props, _excluded);
|
|
36
|
+
var designTokens = useDesignTokens();
|
|
37
|
+
var otherDesignTokens = useOtherDesignTokens();
|
|
38
|
+
var commonToken = useCommonToken();
|
|
33
39
|
var spacingModalCardPaddingTop = otherDesignTokens.spacingModalCardPaddingTop,
|
|
34
|
-
spacingModalButtonStickyPaddingVertical = otherDesignTokens.spacingModalButtonStickyPaddingVertical
|
|
40
|
+
spacingModalButtonStickyPaddingVertical = otherDesignTokens.spacingModalButtonStickyPaddingVertical,
|
|
41
|
+
spacingModalCardPaddingHorizontal = otherDesignTokens.spacingModalCardPaddingHorizontal;
|
|
42
|
+
|
|
43
|
+
// header content footer都随滚动条滚
|
|
44
|
+
var styleToken = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "--".concat(prefix, "-content-padding"), "".concat(otherDesignTokens.spacingModalCardPaddingTop, "px ").concat(otherDesignTokens.spacingModalCardPaddingHorizontal, "px ").concat(otherDesignTokens.spacingModalCardPaddingBottom, "px ").concat(otherDesignTokens.spacingModalCardPaddingHorizontal, "px")), "--".concat(prefix, "-footer-border-top"), 'none'), "--".concat(prefix, "-footer-padding"), 0), "--".concat(prefix, "-body-padding"), "".concat(otherDesignTokens.spacingModalCardVerticalGap, "px 0")), "--".concat(prefix, "-header-margin-bottom"), 0);
|
|
45
|
+
// header content都随滚动条滚, footer不滚
|
|
46
|
+
var stickyFooterStyleToken = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "--".concat(prefix, "-content-padding"), "".concat(otherDesignTokens.spacingModalCardPaddingTop, "px ").concat(otherDesignTokens.spacingModalCardPaddingHorizontal, "px ").concat(40 + otherDesignTokens.spacingModalButtonStickyPaddingVertical + otherDesignTokens.spacingModalButtonStickyPaddingHorizontal, "px ").concat(otherDesignTokens.spacingModalCardPaddingHorizontal, "px")), "--".concat(prefix, "-footer-padding"), "".concat(otherDesignTokens.spacingModalButtonStickyPaddingVertical, "px ").concat(otherDesignTokens.spacingModalButtonStickyPaddingHorizontal, "px")), "--".concat(prefix, "-footer-border-top"), '1px solid #E1E1E1'), "--".concat(prefix, "-body-padding"), "".concat(otherDesignTokens.spacingModalCardVerticalGap, "px 0")), "--".concat(prefix, "-header-margin-bottom"), 0);
|
|
47
|
+
// content随滚动条滚, header和footer不滚
|
|
48
|
+
var stickyHeaderFooterStyleToken = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "--".concat(prefix, "-content-padding"), "".concat(otherDesignTokens.spacingModalCardPaddingTop, "px ").concat(otherDesignTokens.spacingModalCardPaddingHorizontal, "px ").concat(40 + otherDesignTokens.spacingModalButtonStickyPaddingVertical + otherDesignTokens.spacingModalButtonStickyPaddingHorizontal, "px ").concat(otherDesignTokens.spacingModalCardPaddingHorizontal, "px")), "--".concat(prefix, "-footer-padding"), "".concat(otherDesignTokens.spacingModalButtonStickyPaddingVertical, "px ").concat(otherDesignTokens.spacingModalButtonStickyPaddingHorizontal, "px")), "--".concat(prefix, "-footer-border-top"), '1px solid #E1E1E1'), "--".concat(prefix, "-body-padding"), 0), "--".concat(prefix, "-header-margin-bottom"), "".concat(otherDesignTokens.spacingModalCardVerticalGap, "px"));
|
|
49
|
+
// content和footer随滚动条滚, header不滚
|
|
50
|
+
var stickyHeaderStyleToken = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "--".concat(prefix, "-content-padding"), "0 ".concat(otherDesignTokens.spacingModalCardPaddingHorizontal, "px ").concat(otherDesignTokens.spacingModalCardPaddingBottom, "px ").concat(otherDesignTokens.spacingModalCardPaddingHorizontal, "px")), "--".concat(prefix, "-footer-padding"), "".concat(otherDesignTokens.spacingModalCardVerticalGap, "px 0 0")), "--".concat(prefix, "-footer-border-top"), 'none'), "--".concat(prefix, "-body-padding"), "".concat(otherDesignTokens.spacingModalCardPaddingTop * 2 + 26, "px 0 0 0")), "--".concat(prefix, "-header-margin-bottom"), 0), "--".concat(prefix, "-header-padding"), "".concat(otherDesignTokens.spacingModalCardPaddingTop, "px ").concat(otherDesignTokens.spacingModalCardPaddingHorizontal, "px"));
|
|
35
51
|
var useCustomButtonStyle = function useCustomButtonStyle() {
|
|
36
52
|
var hashId = useStyleRegister({
|
|
37
53
|
theme: theme,
|
|
38
|
-
token: {
|
|
39
|
-
baseColor: 'blue'
|
|
40
|
-
},
|
|
54
|
+
token: {},
|
|
41
55
|
path: ["".concat(prefix)]
|
|
42
56
|
}, function () {
|
|
43
|
-
return "\n .".concat(prefix, "-sticky-headers .").concat(prefix, "-header {\n }\n .").concat(prefix, "-sticky-header.").concat(prefix, "-sticky-footer .").concat(prefix, "-body {\n overflow-y: auto;\n -ms-overflow-style: none;\n scrollbar-width: none;\n max-height: calc(80vh - ").concat(spacingModalCardPaddingTop * 2, "px - 26px - ").concat(spacingModalButtonStickyPaddingVertical * 2, "px - 40px - 16px);\n }\n .").concat(prefix, "-sticky-header.").concat(prefix, "-sticky-footer .").concat(prefix, "-body::-webkit-scrollbar {\n display: none;\n }\n .").concat(prefix, "-left .").concat(prefix, "-footer {\n text-align: left;\n }\n .").concat(prefix, "-right .").concat(prefix, "-footer {\n text-align: right;\n }\n .").concat(prefix, "-center .").concat(prefix, "-footer {\n text-align: center;\n }\n ");
|
|
57
|
+
return "\n .".concat(prefix, "-sticky-headers .").concat(prefix, "-header {\n }\n .").concat(prefix, "-sticky-header.").concat(prefix, "-sticky-footer .").concat(prefix, "-body {\n overflow-y: auto;\n -ms-overflow-style: none;\n scrollbar-width: none;\n max-height: calc(80vh - ").concat(spacingModalCardPaddingTop * 2, "px - 26px - ").concat(spacingModalButtonStickyPaddingVertical * 2, "px - 40px - 16px);\n }\n .").concat(prefix, "-sticky-header.").concat(prefix, "-sticky-footer .").concat(prefix, "-body::-webkit-scrollbar {\n display: none;\n }\n .").concat(prefix, "-left .").concat(prefix, "-footer {\n text-align: left;\n }\n .").concat(prefix, "-right .").concat(prefix, "-footer {\n text-align: right;\n }\n .").concat(prefix, "-center .").concat(prefix, "-footer {\n text-align: center;\n }\n .").concat(prefix, " .").concat(prefix, "-close {\n top: ").concat(spacingModalCardPaddingHorizontal - 4, "px\n }\n .").concat(prefix, "-mobile .").concat(prefix, "-close-x {\n font-size: 24px;\n }\n .").concat(prefix, "-desktop .").concat(prefix, "-close-x {\n font-size: 16px;\n }\n ");
|
|
44
58
|
});
|
|
45
59
|
return hashId;
|
|
46
60
|
};
|
|
@@ -78,18 +92,17 @@ var Modal = function Modal(props) {
|
|
|
78
92
|
cssVar: true,
|
|
79
93
|
hashed: false
|
|
80
94
|
},
|
|
81
|
-
children: /*#__PURE__*/_jsx(_Modal, _objectSpread(_objectSpread({
|
|
95
|
+
children: /*#__PURE__*/_jsx(_Modal, _objectSpread(_objectSpread({}, attr), {}, {
|
|
82
96
|
width: breakpoint === 'desktop' ? size : otherDesignTokens.width,
|
|
83
97
|
title: /*#__PURE__*/_jsx(Text, {
|
|
84
98
|
size: "TitleT21Bold",
|
|
85
99
|
children: title
|
|
86
100
|
}),
|
|
101
|
+
footer: footer,
|
|
102
|
+
className: "".concat(stickyFooterClass, " ").concat(prefix, "-").concat(breakpoint, " ").concat(prefix, "-").concat(footerAlign, " ").concat(stickyHeaderClass, " ").concat(stickyHeaderFooterClass, " ").concat(className),
|
|
87
103
|
style: _objectSpread(_objectSpread(_objectSpread({
|
|
88
104
|
top: '10%'
|
|
89
105
|
}, commonStyle), customStyle), style),
|
|
90
|
-
footer: footer,
|
|
91
|
-
className: "".concat(stickyFooterClass, " ").concat(prefix, "-").concat(breakpoint, " ").concat(prefix, "-").concat(footerAlign, " ").concat(stickyHeaderClass, " ").concat(stickyHeaderFooterClass)
|
|
92
|
-
}, attr), {}, {
|
|
93
106
|
children: /*#__PURE__*/_jsx(Text, {
|
|
94
107
|
size: "ContentC14Regular",
|
|
95
108
|
children: children
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
declare const
|
|
2
|
-
spacingTopNavigationPaddingHorizontal:
|
|
3
|
-
spacingTopNavigationPaddingBottom:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
declare const useDesignTokens: () => {
|
|
2
|
+
spacingTopNavigationPaddingHorizontal: number;
|
|
3
|
+
spacingTopNavigationPaddingBottom: number;
|
|
4
|
+
spacingTopNavigationPaddingTop: number;
|
|
5
|
+
spacingTopNavigationHorizontalGap: number;
|
|
6
|
+
spacingTopNavigationIconButtonHorizontalGap: number;
|
|
7
|
+
spacingTopNavigationTextLinkPaddingRight: number;
|
|
8
|
+
spacingTopNavigationTitlePaddingVertical: number;
|
|
8
9
|
colorTopNavigationTitleStandard: any;
|
|
9
10
|
colorTopNavigationTitleInverse: any;
|
|
10
11
|
colorTopNavigationGradient: any;
|
|
@@ -13,4 +14,4 @@ declare const designTokens: {
|
|
|
13
14
|
colorTopNavigationBackgroundHaze: any;
|
|
14
15
|
colorTopNavigationBackgroundInverse: any;
|
|
15
16
|
};
|
|
16
|
-
export
|
|
17
|
+
export { useDesignTokens };
|
|
@@ -1,19 +1,25 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
import { wSacle } from "../../utils/scaleTool";
|
|
2
|
+
import { useDynamicTokens } from "../../utils";
|
|
3
|
+
var useDesignTokens = function useDesignTokens() {
|
|
4
|
+
var getToken = useDynamicTokens();
|
|
5
|
+
var designTokens = {
|
|
6
|
+
spacingTopNavigationPaddingHorizontal: wSacle(getToken('spacingTopNavigationPaddingHorizontal')),
|
|
7
|
+
// 左右padding
|
|
8
|
+
spacingTopNavigationPaddingBottom: wSacle(getToken('spacingTopNavigationPaddingBottom')),
|
|
9
|
+
//底部padding
|
|
10
|
+
spacingTopNavigationPaddingTop: wSacle(getToken('spacingTopNavigationPaddingTop')),
|
|
11
|
+
spacingTopNavigationHorizontalGap: wSacle(getToken('spacingTopNavigationHorizontalGap')),
|
|
12
|
+
spacingTopNavigationIconButtonHorizontalGap: wSacle(getToken('spacingTopNavigationIconButtonHorizontalGap')),
|
|
13
|
+
spacingTopNavigationTextLinkPaddingRight: wSacle(getToken('spacingTopNavigationTextLinkPaddingRight')),
|
|
14
|
+
spacingTopNavigationTitlePaddingVertical: wSacle(getToken('spacingTopNavigationTitlePaddingVertical')),
|
|
15
|
+
colorTopNavigationTitleStandard: getToken('colorTopNavigationTitleStandard'),
|
|
16
|
+
colorTopNavigationTitleInverse: getToken('colorTopNavigationTitleInverse'),
|
|
17
|
+
colorTopNavigationGradient: getToken('colorTopNavigationGradient'),
|
|
18
|
+
colorTopNavigationBackground: getToken('colorTopNavigationBackground'),
|
|
19
|
+
colorTopNavigationBorderBottom: getToken('colorTopNavigationBorderBottom'),
|
|
20
|
+
colorTopNavigationBackgroundHaze: getToken('colorTopNavigationBackgroundHaze'),
|
|
21
|
+
colorTopNavigationBackgroundInverse: getToken('colorTopNavigationBackgroundInverse')
|
|
22
|
+
};
|
|
23
|
+
return designTokens;
|
|
18
24
|
};
|
|
19
|
-
export
|
|
25
|
+
export { useDesignTokens };
|