@tendaui/components 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/LICENSE +21 -0
- package/README.md +176 -0
- package/alert/Alert.tsx +147 -0
- package/alert/defaultProps.ts +3 -0
- package/alert/index.ts +9 -0
- package/alert/style/css.js +1 -0
- package/alert/style/index.js +1 -0
- package/alert/type.ts +44 -0
- package/badge/Badge.tsx +85 -0
- package/badge/defaultProps.ts +10 -0
- package/badge/index.ts +9 -0
- package/badge/style/css.js +1 -0
- package/badge/style/index.js +1 -0
- package/badge/type.ts +51 -0
- package/button/Button.tsx +95 -0
- package/button/defaultProps.ts +13 -0
- package/button/index.ts +7 -0
- package/button/style/css.js +1 -0
- package/button/style/index.js +1 -0
- package/button/type.ts +82 -0
- package/checkbox/Checkbox.tsx +19 -0
- package/checkbox/CheckboxGroup.tsx +207 -0
- package/checkbox/defaultProps.ts +14 -0
- package/checkbox/index.ts +10 -0
- package/checkbox/style/css.js +1 -0
- package/checkbox/style/index.js +1 -0
- package/checkbox/type.ts +117 -0
- package/common/Check.tsx +131 -0
- package/common/FakeArrow.tsx +36 -0
- package/common/PluginContainer.tsx +21 -0
- package/common/Portal.tsx +67 -0
- package/common.ts +76 -0
- package/config-provider/ConfigContext.tsx +21 -0
- package/config-provider/ConfigProvider.tsx +53 -0
- package/config-provider/index.ts +9 -0
- package/config-provider/type.ts +1062 -0
- package/dialog/Dialog.tsx +254 -0
- package/dialog/DialogCard.tsx +152 -0
- package/dialog/defaultProps.ts +25 -0
- package/dialog/hooks/useDialogDrag.ts +50 -0
- package/dialog/hooks/useDialogEsc.ts +31 -0
- package/dialog/hooks/useDialogPosition.ts +36 -0
- package/dialog/hooks/useLockStyle.ts +54 -0
- package/dialog/index.ts +13 -0
- package/dialog/plugin.tsx +78 -0
- package/dialog/style/css.js +1 -0
- package/dialog/style/index.js +1 -0
- package/dialog/type.ts +241 -0
- package/dialog/utils.ts +4 -0
- package/form/Form.tsx +136 -0
- package/form/FormContext.tsx +64 -0
- package/form/FormItem.tsx +554 -0
- package/form/FormList.tsx +303 -0
- package/form/const.ts +6 -0
- package/form/defaultProps.ts +26 -0
- package/form/formModel.ts +117 -0
- package/form/hooks/interface.ts +20 -0
- package/form/hooks/useForm.ts +122 -0
- package/form/hooks/useFormItemInitialData.ts +95 -0
- package/form/hooks/useFormItemStyle.tsx +122 -0
- package/form/hooks/useInstance.tsx +275 -0
- package/form/hooks/useWatch.ts +42 -0
- package/form/index.ts +11 -0
- package/form/style/css.js +1 -0
- package/form/style/index.js +1 -0
- package/form/type.ts +519 -0
- package/form/utils/index.ts +69 -0
- package/hooks/useAttach.ts +24 -0
- package/hooks/useCommonClassName.ts +45 -0
- package/hooks/useConfig.ts +3 -0
- package/hooks/useControlled.ts +39 -0
- package/hooks/useDefaultProps.ts +16 -0
- package/hooks/useDomCallback.ts +13 -0
- package/hooks/useDomRefCallback.ts +12 -0
- package/hooks/useDragSorter.tsx +151 -0
- package/hooks/useEventCallback.ts +47 -0
- package/hooks/useGlobalConfig.ts +14 -0
- package/hooks/useGlobalIcon.ts +14 -0
- package/hooks/useLastest.ts +13 -0
- package/hooks/useLayoutEffect.ts +7 -0
- package/hooks/useMouseEvent.ts +142 -0
- package/hooks/useMutationObserver.ts +56 -0
- package/hooks/usePopper.ts +189 -0
- package/hooks/useRipple.ts +0 -0
- package/hooks/useSetState.ts +25 -0
- package/hooks/useVirtualScroll.ts +246 -0
- package/hooks/useWindowSize.ts +31 -0
- package/index.ts +70 -0
- package/input/Input.tsx +383 -0
- package/input/InputGroup.tsx +29 -0
- package/input/defaultProps.ts +22 -0
- package/input/index.ts +11 -0
- package/input/style/css.js +1 -0
- package/input/style/index.js +1 -0
- package/input/type.ts +219 -0
- package/loading/Gradient.tsx +36 -0
- package/loading/Loading.tsx +169 -0
- package/loading/circleAdapter.ts +44 -0
- package/loading/defaultProps.ts +12 -0
- package/loading/index.ts +13 -0
- package/loading/style/css.js +1 -0
- package/loading/style/index.js +1 -0
- package/loading/type.ts +71 -0
- package/loading/utils/setStyle.ts +13 -0
- package/myform/index.ts +0 -0
- package/notification/Notify.ts +24 -0
- package/notification/NotifyContainer.tsx +90 -0
- package/notification/NotifyContext.tsx +173 -0
- package/notification/NotifyItem.tsx +121 -0
- package/notification/index.ts +3 -0
- package/notification/style/css.js +1 -0
- package/notification/style/index.js +1 -0
- package/notification/type.ts +23 -0
- package/package.json +52 -0
- package/popup/Popup.tsx +264 -0
- package/popup/defaultProps.ts +13 -0
- package/popup/hooks/useTrigger.ts +276 -0
- package/popup/index.ts +6 -0
- package/popup/style/css.js +1 -0
- package/popup/style/index.js +1 -0
- package/popup/type.ts +130 -0
- package/portal/Portal.tsx +63 -0
- package/portal/index.ts +1 -0
- package/select/Option.tsx +162 -0
- package/select/OptionGroup.tsx +30 -0
- package/select/PopupContent.tsx +271 -0
- package/select/Select.tsx +586 -0
- package/select/defaultProps.ts +27 -0
- package/select/hooks/useOptions.ts +120 -0
- package/select/hooks/usePanelVirtualScroll.ts +111 -0
- package/select/index.ts +9 -0
- package/select/style/css.js +1 -0
- package/select/style/index.js +2 -0
- package/select/type.ts +382 -0
- package/select/utils/helper.ts +256 -0
- package/select-input/SelectInput.tsx +98 -0
- package/select-input/defaultProps.ts +15 -0
- package/select-input/hook/useMultiple.tsx +100 -0
- package/select-input/hook/useOverlayInnerStyle.ts +84 -0
- package/select-input/hook/useSingle.tsx +112 -0
- package/select-input/index.ts +6 -0
- package/select-input/interface.ts +18 -0
- package/select-input/style/css.js +1 -0
- package/select-input/style/index.js +1 -0
- package/select-input/type.ts +280 -0
- package/space/defaultProps.ts +0 -0
- package/space/index.ts +0 -0
- package/space/type.ts +0 -0
- package/style/index.js +2 -0
- package/styles/_global.scss +39 -0
- package/styles/_vars.scss +386 -0
- package/styles/components/alert/_index.scss +175 -0
- package/styles/components/alert/_vars.scss +39 -0
- package/styles/components/badge/_index.scss +70 -0
- package/styles/components/badge/_vars.scss +25 -0
- package/styles/components/button/_index.scss +511 -0
- package/styles/components/button/_mixins.scss +39 -0
- package/styles/components/button/_vars.scss +122 -0
- package/styles/components/checkbox/_index.scss +158 -0
- package/styles/components/checkbox/_mixin.scss +0 -0
- package/styles/components/checkbox/_var.scss +60 -0
- package/styles/components/dialog/_animate.scss +135 -0
- package/styles/components/dialog/_index.scss +311 -0
- package/styles/components/dialog/_mixins.scss +0 -0
- package/styles/components/dialog/_vars.scss +59 -0
- package/styles/components/form/_index.scss +174 -0
- package/styles/components/form/_mixins.scss +76 -0
- package/styles/components/form/_vars.scss +100 -0
- package/styles/components/input/_index.scss +349 -0
- package/styles/components/input/_map.scss +0 -0
- package/styles/components/input/_mixins.scss +116 -0
- package/styles/components/input/_vars.scss +134 -0
- package/styles/components/loading/_index.scss +112 -0
- package/styles/components/loading/_vars.scss +39 -0
- package/styles/components/notification/_index.scss +160 -0
- package/styles/components/notification/_mixins.scss +12 -0
- package/styles/components/notification/_vars.scss +59 -0
- package/styles/components/popup/_index.scss +82 -0
- package/styles/components/popup/_mixin.scss +149 -0
- package/styles/components/popup/_var.scss +31 -0
- package/styles/components/select/_index.scss +290 -0
- package/styles/components/select/_var.scss +65 -0
- package/styles/components/select-input/_index.scss +5 -0
- package/styles/components/select-input/_var.scss +3 -0
- package/styles/components/switch/_index.scss +279 -0
- package/styles/components/switch/_mixins.scss +0 -0
- package/styles/components/switch/_vars.scss +61 -0
- package/styles/components/tag/_index.scss +316 -0
- package/styles/components/tag/_var.scss +85 -0
- package/styles/components/tag-input/_index.scss +163 -0
- package/styles/components/tag-input/_vars.scss +16 -0
- package/styles/globals.css +250 -0
- package/styles/mixins/_focus.scss +7 -0
- package/styles/mixins/_layout.scss +32 -0
- package/styles/mixins/_reset.scss +10 -0
- package/styles/mixins/_scrollbar.scss +31 -0
- package/styles/mixins/_text.scss +48 -0
- package/styles/rillple.css +16 -0
- package/styles/scrollbar.css +42 -0
- package/styles/themes/_dark.scss +191 -0
- package/styles/themes/_font.scss +79 -0
- package/styles/themes/_index.scss +5 -0
- package/styles/themes/_light.scss +190 -0
- package/styles/themes/_radius.scss +9 -0
- package/styles/themes/_size.scss +68 -0
- package/styles/themes.css +66 -0
- package/styles/utilities/_animation.scss +57 -0
- package/styles/utilities/_tips.scss +9 -0
- package/switch/Switch.tsx +120 -0
- package/switch/defaultProps.ts +3 -0
- package/switch/index.ts +7 -0
- package/switch/style/css.js +1 -0
- package/switch/style/index.js +1 -0
- package/switch/type.ts +46 -0
- package/tag/Tag.tsx +149 -0
- package/tag/defaultProps.ts +19 -0
- package/tag/index.ts +8 -0
- package/tag/style/css.js +1 -0
- package/tag/style/index.js +1 -0
- package/tag/type.ts +170 -0
- package/tag-input/TagInput.tsx +215 -0
- package/tag-input/defaultProps.ts +15 -0
- package/tag-input/hooks/useHover.ts +28 -0
- package/tag-input/hooks/useTagList.tsx +131 -0
- package/tag-input/hooks/useTagScroll.ts +105 -0
- package/tag-input/index.ts +9 -0
- package/tag-input/style/css.js +1 -0
- package/tag-input/style/index.js +1 -0
- package/tag-input/type.ts +224 -0
- package/tag-input/useTagList.tsx +131 -0
- package/utils/composeRefs.ts +14 -0
- package/utils/dom.ts +29 -0
- package/utils/forwardRefWithStatics.ts +12 -0
- package/utils/getScrollbarWidth.ts +11 -0
- package/utils/helper.ts +161 -0
- package/utils/isFragment.ts +22 -0
- package/utils/listener.ts +37 -0
- package/utils/noop.ts +3 -0
- package/utils/parentTNode.ts +38 -0
- package/utils/parseTNode.ts +38 -0
- package/utils/react-render.ts +108 -0
- package/utils/ref.ts +6 -0
- package/utils/refs.ts +81 -0
- package/utils/style.ts +60 -0
- package/utils/transition.ts +28 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// 组件变量
|
|
2
|
+
// 名称可按如下规则定义:
|
|
3
|
+
// <component>-[type]-[attrtype]-<attr>-[status]
|
|
4
|
+
|
|
5
|
+
// component:组件名,如button,
|
|
6
|
+
// type: 组件类型,如 button 的次要按钮(line)
|
|
7
|
+
// attrtype: 属性的具体应用场景。如颜色,用于背景(bg)、文本(text)、边框(border)等
|
|
8
|
+
// attr: 属性名称,如color、height、radius等
|
|
9
|
+
// status: 表示组件状态或尺寸,如 hover、disabled、s、l 等
|
|
10
|
+
|
|
11
|
+
// 如:$button-line-bg-color-hover
|
|
12
|
+
// 如:$button-line-height-s
|
|
13
|
+
|
|
14
|
+
//颜色
|
|
15
|
+
$loading-color: $brand-color;
|
|
16
|
+
$loading-mask-color: $mask-disabled;
|
|
17
|
+
$loading-gradient-color: $brand-color;
|
|
18
|
+
|
|
19
|
+
// 字号
|
|
20
|
+
$loading-text-size: $font-body-medium;
|
|
21
|
+
$loading-icon-size: $comp-size-l;
|
|
22
|
+
$loading-icon-size-small: $comp-size-xxxs;
|
|
23
|
+
$loading-icon-size-large: $comp-size-xxxl;
|
|
24
|
+
$loading-fullscreen-icon-size: $loading-icon-size;
|
|
25
|
+
|
|
26
|
+
// 间距
|
|
27
|
+
$loading-text-margin-left: $comp-margin-xs;
|
|
28
|
+
$loading-gradient-padding-s: 1px;
|
|
29
|
+
$loading-gradient-padding-m: 3px;
|
|
30
|
+
$loading-gradient-padding-l: 5px;
|
|
31
|
+
|
|
32
|
+
// Size
|
|
33
|
+
$loading-gradient-size-s: $comp-size-xxxs;
|
|
34
|
+
$loading-gradient-size-m: $comp-size-xl;
|
|
35
|
+
$loading-gradient-size-l: $comp-size-xxxl;
|
|
36
|
+
|
|
37
|
+
$loading-gradient-mask-size-s: 5.5px;
|
|
38
|
+
$loading-gradient-mask-size-m: 11.5px;
|
|
39
|
+
$loading-gradient-mask-size-l: 15.5px;
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
// 组件允许单个组件打包,因此默认引入公共基础样式
|
|
2
|
+
@import '../../vars.scss';
|
|
3
|
+
|
|
4
|
+
@import './_vars.scss';
|
|
5
|
+
|
|
6
|
+
@import './_mixins.scss';
|
|
7
|
+
|
|
8
|
+
@import '../../mixins/_reset.scss';
|
|
9
|
+
|
|
10
|
+
.#{$prefix}-notify {
|
|
11
|
+
&[data-x-position='right'] {
|
|
12
|
+
right: 8px;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
&[data-x-position='left'] {
|
|
16
|
+
left: 8px;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&[data-x-position='center'] {
|
|
20
|
+
left: 50%;
|
|
21
|
+
transform: translateX(-50%);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&[data-y-position='top'] {
|
|
25
|
+
top: 10px;
|
|
26
|
+
}
|
|
27
|
+
@include reset;
|
|
28
|
+
position: fixed;
|
|
29
|
+
z-index: $z-index-Notification;
|
|
30
|
+
width: $notification-width-default;
|
|
31
|
+
&__container {
|
|
32
|
+
position: relative;
|
|
33
|
+
width: 100%;
|
|
34
|
+
height: 100%;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&__item {
|
|
38
|
+
border-radius: $notification-detail-item-border-radius;
|
|
39
|
+
padding: $notification-padding-default;
|
|
40
|
+
background-color: $notification-color-block;
|
|
41
|
+
color: $notification-content-color;
|
|
42
|
+
box-shadow: $notification-shadow;
|
|
43
|
+
overflow: hidden;
|
|
44
|
+
&:hover {
|
|
45
|
+
background-color: $bg-color-container-hover;
|
|
46
|
+
color: $notification-detail-item-color-hover;
|
|
47
|
+
}
|
|
48
|
+
&:active {
|
|
49
|
+
background-color: $bg-color-container-active;
|
|
50
|
+
color: $notification-detail-item-color-active;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
--y: translateY(-100%);
|
|
54
|
+
transform: var(--y);
|
|
55
|
+
transition:
|
|
56
|
+
transform 400ms,
|
|
57
|
+
opacity 400ms,
|
|
58
|
+
height 400ms,
|
|
59
|
+
box-shadow 200ms;
|
|
60
|
+
z-index: var(--z-index);
|
|
61
|
+
|
|
62
|
+
&[data-mounted='true'] {
|
|
63
|
+
&[data-expanded='false'] {
|
|
64
|
+
--y: translateY(calc(var(--gap) * var(--index)))
|
|
65
|
+
scale(calc(1 - var(--index) * 0.05));
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
&[data-expanded='true'] {
|
|
69
|
+
--y: translateY(var(--offset)) scale(1);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
&[data-removed='true'] {
|
|
73
|
+
&[data-front='true'] {
|
|
74
|
+
--y: translateY(-100%);
|
|
75
|
+
opacity: 0;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
&[data-front='false'] {
|
|
79
|
+
--y: translateY(-40%);
|
|
80
|
+
opacity: 0;
|
|
81
|
+
transition:
|
|
82
|
+
transform 400ms,
|
|
83
|
+
opacity 200ms;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
&__icon {
|
|
90
|
+
width: $notification-icon-width;
|
|
91
|
+
text-align: center;
|
|
92
|
+
margin-right: $notification-icon-margin-right;
|
|
93
|
+
|
|
94
|
+
.t-icon {
|
|
95
|
+
font-size: $notification-icon-font-size;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// icon theme
|
|
100
|
+
.t-icon.#{$prefix}-is-info {
|
|
101
|
+
color: $notification-icon-info-color;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.t-icon.#{$prefix}-is-success {
|
|
105
|
+
color: $notification-icon-success-color;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.t-icon.#{$prefix}-is-warning {
|
|
109
|
+
color: $notification-icon-warning-color;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.t-icon.#{$prefix}-is-error {
|
|
113
|
+
color: $notification-icon-error-color;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
&__main {
|
|
117
|
+
flex: 1;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
&__title__wrap {
|
|
121
|
+
display: flex;
|
|
122
|
+
justify-content: space-between;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
&__title {
|
|
126
|
+
font: $notification-title-font;
|
|
127
|
+
color: $notification-title-color;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.t-icon-close {
|
|
131
|
+
cursor: pointer;
|
|
132
|
+
font-size: $notification-icon-close-font-size;
|
|
133
|
+
border-radius: $border-radius-default;
|
|
134
|
+
color: $notification-close-icon-color;
|
|
135
|
+
|
|
136
|
+
&:hover {
|
|
137
|
+
background: $notification-close-bg-color-hover;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
&:active {
|
|
141
|
+
background: $notification-close-bg-color-active;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
&__content {
|
|
146
|
+
font: $notification-content-font;
|
|
147
|
+
color: $notification-content-color;
|
|
148
|
+
margin-top: $notification-content-margin-top;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
&__header {
|
|
152
|
+
display: flex;
|
|
153
|
+
}
|
|
154
|
+
&__detail {
|
|
155
|
+
font: $notification-content-font;
|
|
156
|
+
color: $notification-content-color;
|
|
157
|
+
margin-top: $notification-content-margin-top;
|
|
158
|
+
word-break: break-all;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
@mixin notification() {
|
|
2
|
+
font: $notification-font;
|
|
3
|
+
outline: 0;
|
|
4
|
+
border: 0;
|
|
5
|
+
background-color: $notification-color-block;
|
|
6
|
+
display: flex;
|
|
7
|
+
box-shadow: $notification-shadow;
|
|
8
|
+
box-sizing: border-box;
|
|
9
|
+
border-radius: $border-radius-medium;
|
|
10
|
+
width: $notification-width-default;
|
|
11
|
+
padding: $notification-padding-default;
|
|
12
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// 组件变量
|
|
2
|
+
// 名称可按如下规则定义:
|
|
3
|
+
// <component>-[type]-[attrtype]-<attr>-[status]
|
|
4
|
+
|
|
5
|
+
// component:组件名,如button,
|
|
6
|
+
// type: 组件类型,如 button 的次要按钮(line)
|
|
7
|
+
// attrtype: 属性的具体应用场景。如颜色,用于背景(bg)、文本(text)、边框(border)等
|
|
8
|
+
// attr: 属性名称,如color、height、radius等
|
|
9
|
+
// status: 表示组件状态或尺寸,如 hover、disabled、s、l 等
|
|
10
|
+
|
|
11
|
+
// 如:$button-line-bg-color-hover
|
|
12
|
+
// 如:$button-line-height-s
|
|
13
|
+
|
|
14
|
+
// 颜色
|
|
15
|
+
$notification-close-icon-color: $text-color-secondary;
|
|
16
|
+
$notification-color-block: $bg-color-container;
|
|
17
|
+
$notification-title-color: $text-color-primary;
|
|
18
|
+
$notification-content-color: $text-color-secondary;
|
|
19
|
+
$notification-detail-item-color-hover: inherit;
|
|
20
|
+
$notification-detail-item-bg-color-hover: $bg-color-container-hover;
|
|
21
|
+
$notification-detail-item-color-active: inherit;
|
|
22
|
+
$notification-detail-item-bg-color-active: $bg-color-container-active;
|
|
23
|
+
$notification-detail-item-is-active-color: $brand-color;
|
|
24
|
+
$notification-icon-info-color: $brand-color;
|
|
25
|
+
$notification-icon-success-color: $success-color;
|
|
26
|
+
$notification-icon-warning-color: $warning-color;
|
|
27
|
+
$notification-icon-error-color: $error-color-6;
|
|
28
|
+
$notification-detail-item-color: inherit;
|
|
29
|
+
$notification-close-bg-color-hover: $bg-color-container-hover;
|
|
30
|
+
$notification-close-bg-color-active: $bg-color-container-active;
|
|
31
|
+
|
|
32
|
+
// 尺寸
|
|
33
|
+
$notification-width-default: 360px;
|
|
34
|
+
$notification-content-max-height: 66px;
|
|
35
|
+
$notification-icon-width: calc($font-size-l + 8px);
|
|
36
|
+
$notification-icon-font-size: calc($font-size-l + 8px);
|
|
37
|
+
$notification-icon-close-font-size: $font-size-l;
|
|
38
|
+
|
|
39
|
+
// 圆角
|
|
40
|
+
$notification-detail-item-border-radius: $border-radius-medium;
|
|
41
|
+
$notification-close-border-radius: $border-radius-medium;
|
|
42
|
+
|
|
43
|
+
// 阴影
|
|
44
|
+
$notification-shadow: $shadow-2-inset;
|
|
45
|
+
|
|
46
|
+
//字号
|
|
47
|
+
$notification-font: $font-body-medium;
|
|
48
|
+
$notification-detail-font: $font-body-medium;
|
|
49
|
+
$notification-content-font: $font-body-medium;
|
|
50
|
+
$notification-title-font: $font-title-medium;
|
|
51
|
+
|
|
52
|
+
// padding
|
|
53
|
+
$notification-padding-default: $comp-paddingTB-l $comp-paddingLR-l;
|
|
54
|
+
|
|
55
|
+
//margin
|
|
56
|
+
$notification-detail-margin-top: $comp-margin-l;
|
|
57
|
+
$notification-content-margin-top: $comp-margin-s;
|
|
58
|
+
$notification-icon-margin-right: $comp-margin-s;
|
|
59
|
+
$notification-detail-item-margin-left: $comp-margin-s;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
// 组件允许单个组件打包,因此默认引入公共基础样式
|
|
2
|
+
|
|
3
|
+
@import '../../vars.scss';
|
|
4
|
+
|
|
5
|
+
@import './_var.scss';
|
|
6
|
+
|
|
7
|
+
@import './_mixin.scss';
|
|
8
|
+
|
|
9
|
+
@import '../../mixins/_layout.scss';
|
|
10
|
+
|
|
11
|
+
@import '../../mixins/_reset.scss';
|
|
12
|
+
|
|
13
|
+
.#{$prefix}-popup {
|
|
14
|
+
@include reset;
|
|
15
|
+
|
|
16
|
+
color: $popup-text-color;
|
|
17
|
+
display: inline-block;
|
|
18
|
+
z-index: $z-index-Popup;
|
|
19
|
+
|
|
20
|
+
&__content {
|
|
21
|
+
position: relative;
|
|
22
|
+
background: $popup-bg;
|
|
23
|
+
box-shadow: $popup-shadow;
|
|
24
|
+
border-radius: $border-radius-medium;
|
|
25
|
+
padding: $popup-padding;
|
|
26
|
+
font-size: $popup-content-font-size;
|
|
27
|
+
line-height: $popup-content-line-height;
|
|
28
|
+
box-sizing: border-box;
|
|
29
|
+
word-break: break-all;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.#{$prefix}-popup__arrow {
|
|
34
|
+
position: absolute;
|
|
35
|
+
z-index: 1;
|
|
36
|
+
width: $popup-arrow-width;
|
|
37
|
+
height: $popup-arrow-height;
|
|
38
|
+
|
|
39
|
+
&::before {
|
|
40
|
+
position: absolute;
|
|
41
|
+
content: '';
|
|
42
|
+
width: $popup-arrow-width;
|
|
43
|
+
height: $popup-arrow-height;
|
|
44
|
+
transform: rotate(45deg);
|
|
45
|
+
background: $arrow-bg;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
@include content-placement-top();
|
|
49
|
+
@include content-placement-bottom();
|
|
50
|
+
@include content-placement-left();
|
|
51
|
+
@include content-placement-right();
|
|
52
|
+
|
|
53
|
+
@include arrow-placement-top();
|
|
54
|
+
@include arrow-placement-bottom();
|
|
55
|
+
@include arrow-placement-left();
|
|
56
|
+
@include arrow-placement-right();
|
|
57
|
+
|
|
58
|
+
// animation
|
|
59
|
+
.#{$popup-flow}-enter,
|
|
60
|
+
.#{$popup-flow}-enter-from,
|
|
61
|
+
.#{$popup-flow}-exiting,
|
|
62
|
+
.#{$popup-flow}-leave-to {
|
|
63
|
+
opacity: 0;
|
|
64
|
+
visibility: hidden;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.#{$popup-flow}-enter-to,
|
|
68
|
+
.#{$popup-flow}-entering,
|
|
69
|
+
.#{$popup-flow}-leave-from,
|
|
70
|
+
.#{$popup-flow}-leave {
|
|
71
|
+
opacity: 1;
|
|
72
|
+
visibility: visible;
|
|
73
|
+
transform: none;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.#{$popup-flow}-enter-active {
|
|
77
|
+
transition: $popup-flow-transition-enter;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.#{$popup-flow}-leave-active {
|
|
81
|
+
transition: $popup-flow-transition-leave;
|
|
82
|
+
}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
@mixin content-placement-top {
|
|
2
|
+
.#{$prefix}-popup[data-popper-placement^="top"] {
|
|
3
|
+
.#{$prefix}-popup__content {
|
|
4
|
+
margin-bottom: $popup-content-margin;
|
|
5
|
+
|
|
6
|
+
&--arrow {
|
|
7
|
+
margin-bottom: $popup-content-arrow-spacer;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@mixin content-placement-bottom {
|
|
14
|
+
.#{$prefix}-popup[data-popper-placement^="bottom"] {
|
|
15
|
+
.#{$prefix}-popup__content {
|
|
16
|
+
margin-top: $popup-content-margin;
|
|
17
|
+
|
|
18
|
+
&--arrow {
|
|
19
|
+
margin-top: $popup-content-arrow-spacer;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@mixin content-placement-left {
|
|
26
|
+
.#{$prefix}-popup[data-popper-placement^="left"] {
|
|
27
|
+
.#{$prefix}-popup__content {
|
|
28
|
+
margin-right: $popup-content-margin;
|
|
29
|
+
|
|
30
|
+
&--arrow {
|
|
31
|
+
margin-right: $popup-content-arrow-spacer;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&--text {
|
|
35
|
+
max-width: 480px;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@mixin content-placement-right {
|
|
42
|
+
.#{$prefix}-popup[data-popper-placement^="right"] {
|
|
43
|
+
.#{$prefix}-popup__content {
|
|
44
|
+
margin-left: $popup-content-margin;
|
|
45
|
+
|
|
46
|
+
&--arrow {
|
|
47
|
+
margin-left: $popup-content-arrow-spacer;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&--text {
|
|
51
|
+
max-width: 480px;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
@mixin arrow-placement-top() {
|
|
58
|
+
.#{$prefix}-popup[data-popper-placement^="top"] .#{$prefix}-popup__arrow {
|
|
59
|
+
&::before {
|
|
60
|
+
border-top-left-radius: 100%;
|
|
61
|
+
box-shadow: $popup-top-arrow-shadow;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.#{$prefix}-popup[data-popper-placement="top-start"] .#{$prefix}-popup__arrow {
|
|
66
|
+
left: $popup-arrow-width;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.#{$prefix}-popup[data-popper-placement="top"] .#{$prefix}-popup__arrow {
|
|
70
|
+
left: 50%;
|
|
71
|
+
margin-left: calc(-#{$popup-arrow-width} / 2);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.#{$prefix}-popup[data-popper-placement="top-end"] .#{$prefix}-popup__arrow {
|
|
75
|
+
left: calc(100% - $popup-arrow-width * 2);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
@mixin arrow-placement-bottom() {
|
|
80
|
+
.#{$prefix}-popup[data-popper-placement^="bottom"] .#{$prefix}-popup__arrow {
|
|
81
|
+
top: calc(-#{$popup-arrow-width} / 2);
|
|
82
|
+
|
|
83
|
+
&::before {
|
|
84
|
+
border-bottom-right-radius: 100%;
|
|
85
|
+
box-shadow: $popup-bottom-arrow-shadow;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.#{$prefix}-popup[data-popper-placement="bottom-start"] .#{$prefix}-popup__arrow {
|
|
90
|
+
left: $popup-arrow-width;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.#{$prefix}-popup[data-popper-placement="bottom"] .#{$prefix}-popup__arrow {
|
|
94
|
+
left: 50%;
|
|
95
|
+
margin-left: calc(-#{$popup-arrow-width} / 2);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.#{$prefix}-popup[data-popper-placement="bottom-end"] .#{$prefix}-popup__arrow {
|
|
99
|
+
left: calc(100% - $popup-arrow-width * 2);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
@mixin arrow-placement-left() {
|
|
104
|
+
.#{$prefix}-popup[data-popper-placement^="left"] .#{$prefix}-popup__arrow {
|
|
105
|
+
right: calc(-#{$popup-arrow-width} / 2);
|
|
106
|
+
|
|
107
|
+
&::before {
|
|
108
|
+
box-shadow: $popup-left-arrow-shadow;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.#{$prefix}-popup[data-popper-placement="left-start"] .#{$prefix}-popup__arrow {
|
|
113
|
+
top: $popup-arrow-width;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.#{$prefix}-popup[data-popper-placement="left"] .#{$prefix}-popup__arrow {
|
|
117
|
+
top: 50%;
|
|
118
|
+
margin-top: calc(-#{$popup-arrow-width} / 2);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.#{$prefix}-popup[data-popper-placement="left-end"] .#{$prefix}-popup__arrow {
|
|
122
|
+
top: calc(100% - $popup-arrow-width * 2);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
@mixin arrow-placement-right() {
|
|
127
|
+
.#{$prefix}-popup[data-popper-placement^="right"] .#{$prefix}-popup__arrow {
|
|
128
|
+
left: calc(-#{$popup-arrow-width} / 2);
|
|
129
|
+
|
|
130
|
+
&::before {
|
|
131
|
+
box-shadow: $popup-right-arrow-shadow;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.#{$prefix}-popup[data-popper-placement="right-start"] .#{$prefix}-popup__arrow {
|
|
136
|
+
top: $popup-arrow-width;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.#{$prefix}-popup[data-popper-placement="right"] .#{$prefix}-popup__arrow {
|
|
140
|
+
top: 50%;
|
|
141
|
+
margin-top: calc(-#{$popup-arrow-width} / 2);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.#{$prefix}-popup[data-popper-placement="right-end"] .#{$prefix}-popup__arrow {
|
|
145
|
+
top: calc(100% - $popup-arrow-width * 2);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// 颜色
|
|
2
|
+
$popup-bg: $bg-color-container;
|
|
3
|
+
$arrow-bg: $bg-color-container;
|
|
4
|
+
$popup-text-color: $text-color-primary;
|
|
5
|
+
|
|
6
|
+
// 间距
|
|
7
|
+
$popup-padding: $comp-paddingTB-xs $comp-paddingLR-s;
|
|
8
|
+
$popup-content-line-height: $text-line-height-base;
|
|
9
|
+
$popup-arrow-width: 8px;
|
|
10
|
+
$popup-arrow-height: 8px;
|
|
11
|
+
$popup-content-arrow-spacer: $comp-margin-l;
|
|
12
|
+
$popup-content-margin: $comp-margin-s;
|
|
13
|
+
|
|
14
|
+
// 箭头位置偏移量
|
|
15
|
+
$popup-arrow-position: $popup-arrow-width;
|
|
16
|
+
$popup-content-font-size: $font-size-base;
|
|
17
|
+
|
|
18
|
+
// 阴影
|
|
19
|
+
$popup-shadow: $shadow-2-inset;
|
|
20
|
+
$popup-top-arrow-shadow: $shadow-inset-left, $shadow-inset-bottom;
|
|
21
|
+
$popup-left-arrow-shadow: $shadow-inset-left, $shadow-inset-top;
|
|
22
|
+
$popup-bottom-arrow-shadow: $shadow-inset-top, $shadow-inset-right;
|
|
23
|
+
$popup-right-arrow-shadow: $shadow-inset-right, $shadow-inset-bottom;
|
|
24
|
+
|
|
25
|
+
// 动画
|
|
26
|
+
$popup-flow: "#{prefix}-popup--animation";
|
|
27
|
+
$popup-flow-duration: $anim-duration-base;
|
|
28
|
+
$popup-flow-fn: $anim-time-fn-ease-in;
|
|
29
|
+
$popup-flow-transition-enter: opacity $popup-flow-duration linear;
|
|
30
|
+
$popup-flow-transition-leave: opacity $popup-flow-duration $anim-time-fn-ease-out,
|
|
31
|
+
visibility $popup-flow-duration $popup-flow-fn;
|