@tendaui/components 1.0.0 → 1.2.3
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 -21
- package/README.md +176 -176
- package/alert/Alert.tsx +3 -2
- package/button/_example/base.tsx +10 -0
- package/button/_example/icon.tsx +20 -0
- package/color-picker/ColorPickPanel.tsx +9 -0
- package/color-picker/ColorPicker.tsx +67 -0
- package/color-picker/components/panel/alpha.tsx +32 -0
- package/color-picker/components/panel/format/index.tsx +47 -0
- package/color-picker/components/panel/format/inputs.tsx +119 -0
- package/color-picker/components/panel/header.tsx +37 -0
- package/color-picker/components/panel/hue.tsx +20 -0
- package/color-picker/components/panel/index.tsx +191 -0
- package/color-picker/components/panel/saturation.tsx +81 -0
- package/color-picker/components/panel/slider.tsx +76 -0
- package/color-picker/components/panel/swatches.tsx +84 -0
- package/color-picker/components/trigger.tsx +49 -0
- package/color-picker/defaultProps.ts +7 -0
- package/color-picker/helpers.ts +53 -0
- package/color-picker/hooks/useClassNames.ts +9 -0
- package/color-picker/hooks/useStyles.ts +39 -0
- package/color-picker/index.ts +12 -0
- package/color-picker/style/css.js +1 -0
- package/color-picker/style/index.js +1 -0
- package/color-picker/type.ts +143 -0
- package/color-picker/utils/color-picker/cmyk.ts +89 -0
- package/color-picker/utils/color-picker/color.ts +467 -0
- package/color-picker/utils/color-picker/constants.ts +187 -0
- package/color-picker/utils/color-picker/draggable.ts +100 -0
- package/color-picker/utils/color-picker/format.ts +95 -0
- package/color-picker/utils/color-picker/gradient.ts +243 -0
- package/color-picker/utils/color-picker/index.ts +7 -0
- package/color-picker/utils/color-picker/types.ts +33 -0
- package/common/observe.ts +33 -0
- package/common.ts +20 -0
- package/config-provider/ConfigContext.tsx +4 -1
- package/config-provider/index.ts +1 -1
- package/dialog/DialogCard.tsx +4 -6
- package/dialog/hooks/useDialogPosition.ts +1 -2
- package/dialog/plugin.tsx +3 -2
- package/drawer/Drawer.tsx +264 -0
- package/drawer/defaultProps.ts +19 -0
- package/drawer/hooks/useDrag.ts +98 -0
- package/drawer/hooks/useLockStyle.ts +36 -0
- package/drawer/index.ts +5 -0
- package/drawer/style/css.js +1 -0
- package/drawer/style/index.js +1 -0
- package/drawer/type.ts +193 -0
- package/drawer/utils/index.ts +76 -0
- package/fireworks/Fireworks.tsx +138 -0
- package/fireworks/index.ts +10 -0
- package/fireworks/style/css.js +0 -0
- package/fireworks/style/index.js +0 -0
- package/fireworks/type.ts +72 -0
- package/form/FormItem.tsx +5 -5
- package/form/easing.ts +10 -0
- package/form/scroll.ts +124 -0
- package/form/type.ts +519 -519
- package/global-config/default-config.ts +95 -0
- package/global-config/locale/ar_KW.ts +270 -0
- package/global-config/locale/en_US.ts +280 -0
- package/global-config/locale/it_IT.ts +287 -0
- package/global-config/locale/ja_JP.ts +279 -0
- package/global-config/locale/ko_KR.ts +279 -0
- package/global-config/locale/ru_RU.ts +288 -0
- package/global-config/locale/zh_CN.ts +279 -0
- package/global-config/locale/zh_TW.ts +279 -0
- package/global-config/mobile/default-config.ts +6 -0
- package/global-config/mobile/locale/ar_KW.ts +113 -0
- package/global-config/mobile/locale/en_US.ts +114 -0
- package/global-config/mobile/locale/it_IT.ts +114 -0
- package/global-config/mobile/locale/ja_JP.ts +101 -0
- package/global-config/mobile/locale/ko_KR.ts +101 -0
- package/global-config/mobile/locale/ru_RU.ts +113 -0
- package/global-config/mobile/locale/zh_CN.ts +101 -0
- package/global-config/mobile/locale/zh_TW.ts +101 -0
- package/global-config/t.ts +111 -0
- package/hooks/useControlled.ts +3 -3
- package/hooks/useDeepEffect.ts +32 -0
- package/hooks/useGlobalIcon.ts +10 -3
- package/hooks/useLastest.ts +2 -6
- package/hooks/useResizeObserve.ts +36 -0
- package/index.ts +10 -7
- package/input/Input.tsx +4 -1
- package/input/defaultProps.ts +0 -2
- package/input/type.ts +1 -6
- package/input-number/InputNumber.tsx +124 -0
- package/input-number/defaultProps.ts +17 -0
- package/input-number/index.ts +9 -0
- package/input-number/style/css.js +1 -0
- package/input-number/style/index.js +1 -0
- package/input-number/type.ts +147 -0
- package/input-number/useInputNumber.tsx +270 -0
- package/ip-input/IPInput.tsx +516 -0
- package/ip-input/defaultProps.ts +11 -0
- package/ip-input/index.ts +3 -0
- package/ip-input/style/css.js +1 -0
- package/ip-input/style/index.js +1 -0
- package/ip-input/type.ts +115 -0
- package/ip-input/utils.ts +112 -0
- package/layout/Aside.tsx +38 -0
- package/layout/Layout.tsx +104 -0
- package/layout/defaultProps.ts +9 -0
- package/layout/index.ts +9 -0
- package/layout/style/css.js +1 -0
- package/layout/style/index.js +1 -0
- package/layout/type.ts +43 -0
- package/list/List.tsx +144 -0
- package/list/ListItem.tsx +36 -0
- package/list/ListItemMeta.tsx +40 -0
- package/list/defaultProps.ts +11 -0
- package/list/hooks/useListVirtualScroll.ts +82 -0
- package/list/index.ts +11 -0
- package/list/style/css.js +1 -0
- package/list/style/index.js +1 -0
- package/list/type.ts +93 -0
- package/locale/LocalReceiver.ts +55 -0
- package/locale/ar_KW.ts +7 -0
- package/locale/en_US.ts +7 -0
- package/locale/it_IT.ts +6 -0
- package/locale/ja_JP.ts +6 -0
- package/locale/ko_KR.ts +6 -0
- package/locale/ru_RU.ts +6 -0
- package/locale/zh_CN.ts +5 -0
- package/locale/zh_TW.ts +7 -0
- package/notification/NotifyContainer.tsx +2 -2
- package/notification/NotifyContext.tsx +1 -0
- package/package.json +6 -3
- package/popup/Popup.tsx +34 -10
- package/radio/Radio.tsx +24 -0
- package/radio/RadioGroup.tsx +159 -0
- package/radio/defaultProps.ts +18 -0
- package/radio/index.ts +12 -0
- package/radio/style/css.js +0 -0
- package/radio/style/index.js +1 -0
- package/radio/type.ts +115 -0
- package/radio/useKeyboard.ts +36 -0
- package/select/hooks/useOptions.ts +10 -7
- package/select/hooks/usePanelVirtualScroll.ts +1 -1
- package/select/type.ts +382 -382
- package/select-input/type.ts +280 -280
- package/slider/Slider.tsx +270 -0
- package/slider/SliderHandleButton.tsx +50 -0
- package/slider/defaultProps.ts +15 -0
- package/slider/index.ts +9 -0
- package/slider/style/css.js +1 -0
- package/slider/style/index.js +1 -0
- package/slider/type.ts +77 -0
- package/style/all.js +26 -0
- package/styles/_global.scss +39 -39
- package/styles/_vars.scss +358 -386
- package/styles/components/alert/_index.scss +175 -175
- package/styles/components/alert/_vars.scss +39 -39
- package/styles/components/badge/_index.scss +70 -70
- package/styles/components/badge/_vars.scss +25 -25
- package/styles/components/button/_index.scss +499 -511
- package/styles/components/button/_mixins.scss +39 -39
- package/styles/components/button/_vars.scss +120 -122
- package/styles/components/checkbox/_index.scss +158 -158
- package/styles/components/checkbox/_var.scss +60 -60
- package/styles/components/color-picker/_index.scss +586 -0
- package/styles/components/color-picker/_mixins.scss +0 -0
- package/styles/components/color-picker/_vars.scss +84 -0
- package/styles/components/dialog/_animate.scss +135 -135
- package/styles/components/dialog/_index.scss +311 -311
- package/styles/components/dialog/_vars.scss +59 -59
- package/styles/components/drawer/_index.scss +205 -0
- package/styles/components/drawer/_mixins.scss +1 -0
- package/styles/components/drawer/_var.scss +53 -0
- package/styles/components/fireworks/_index.scss +86 -0
- package/styles/components/fireworks/_vars.scss +4 -0
- package/styles/components/form/_index.scss +174 -174
- package/styles/components/form/_mixins.scss +76 -76
- package/styles/components/form/_vars.scss +100 -100
- package/styles/components/input/_index.scss +349 -349
- package/styles/components/input/_mixins.scss +116 -116
- package/styles/components/input/_vars.scss +134 -134
- package/styles/components/input-number/_index.scss +353 -0
- package/styles/components/input-number/_mixins.scss +0 -0
- package/styles/components/input-number/_vars.scss +65 -0
- package/styles/components/ip-input/_index.scss +280 -0
- package/styles/components/layout/_index.scss +47 -0
- package/styles/components/layout/_mixin.scss +0 -0
- package/styles/components/layout/_vars.scss +18 -0
- package/styles/components/layout/doc.scss +74 -0
- package/styles/components/list/_index.scss +172 -0
- package/styles/components/list/_mixins.scss +0 -0
- package/styles/components/list/_vars.scss +41 -0
- package/styles/components/loading/_index.scss +112 -112
- package/styles/components/loading/_vars.scss +39 -39
- package/styles/components/notification/_index.scss +160 -160
- package/styles/components/notification/_mixins.scss +12 -12
- package/styles/components/notification/_vars.scss +59 -59
- package/styles/components/popup/_index.scss +82 -82
- package/styles/components/popup/_mixin.scss +149 -149
- package/styles/components/popup/_var.scss +31 -31
- package/styles/components/radio/_index.scss +376 -0
- package/styles/components/radio/_mixins.scss +0 -0
- package/styles/components/radio/_var.scss +92 -0
- package/styles/components/select/_index.scss +290 -290
- package/styles/components/select/_var.scss +65 -65
- package/styles/components/select-input/_index.scss +5 -5
- package/styles/components/select-input/_var.scss +3 -3
- package/styles/components/slider/_index.scss +241 -0
- package/styles/components/slider/_mixins.scss +0 -0
- package/styles/components/slider/_vars.scss +50 -0
- package/styles/components/switch/_index.scss +279 -279
- package/styles/components/switch/_vars.scss +61 -61
- package/styles/components/table/_index.scss +193 -0
- package/styles/components/table/_var.scss +52 -0
- package/styles/components/tabs/_index.scss +165 -0
- package/styles/components/tabs/_mixins.scss +11 -0
- package/styles/components/tabs/_vars.scss +71 -0
- package/styles/components/tag/_index.scss +316 -316
- package/styles/components/tag/_var.scss +85 -85
- package/styles/components/tag-input/_index.scss +163 -163
- package/styles/components/tag-input/_vars.scss +16 -16
- package/styles/globals.css +250 -250
- package/styles/mixins/_focus.scss +7 -7
- package/styles/mixins/_layout.scss +32 -32
- package/styles/mixins/_reset.scss +10 -10
- package/styles/mixins/_scrollbar.scss +31 -31
- package/styles/mixins/_text.scss +48 -48
- package/styles/rillple.css +16 -16
- package/styles/scrollbar.css +41 -41
- package/styles/themes/_dark.scss +191 -191
- package/styles/themes/_font.scss +69 -79
- package/styles/themes/_index.scss +5 -5
- package/styles/themes/_light.scss +190 -190
- package/styles/themes/_radius.scss +9 -9
- package/styles/themes/_size.scss +68 -68
- package/styles/themes.css +66 -66
- package/styles/utilities/_animation.scss +57 -57
- package/styles/utilities/_tips.scss +9 -9
- package/tab/TabBar.tsx +85 -0
- package/tab/TabNav.tsx +103 -0
- package/tab/TabNavItem.tsx +80 -0
- package/tab/TabPanel.tsx +42 -0
- package/tab/Tabs.tsx +71 -0
- package/tab/defaultProps.ts +19 -0
- package/tab/index.ts +7 -0
- package/tab/style/index.js +1 -0
- package/tab/type.ts +125 -0
- package/tab/useTabClass.ts +20 -0
- package/table/Cell.tsx +109 -0
- package/table/TBody.tsx +77 -0
- package/table/THead.tsx +63 -0
- package/table/TR.tsx +78 -0
- package/table/Table.tsx +73 -0
- package/table/defaultProps.ts +14 -0
- package/table/hooks/index.ts +4 -0
- package/table/hooks/useTableClassName.ts +63 -0
- package/table/hooks/useTableStyle.ts +93 -0
- package/table/index.ts +7 -0
- package/table/style/css.js +1 -0
- package/table/style/index.js +1 -0
- package/table/type.ts +192 -0
- package/tag/Tag.tsx +1 -1
- package/tag-input/hooks/useTagList.tsx +1 -1
- package/utils/dom.ts +4 -0
- package/utils/forwardRefWithStatics.ts +1 -4
- package/utils/input-number/large-number.ts +423 -0
- package/utils/input-number/number.ts +257 -0
- package/utils/isFragment.ts +6 -6
- package/utils/log/index.ts +3 -0
- package/utils/log/log.ts +30 -0
- package/utils/log/types.ts +12 -0
- package/utils/number.ts +21 -0
- package/utils/scroll.ts +26 -0
- package/utils/style.ts +2 -4
|
@@ -0,0 +1,376 @@
|
|
|
1
|
+
// 组件允许单个组件打包,因此默认引入公共基础样式
|
|
2
|
+
|
|
3
|
+
@import "../../vars.scss";
|
|
4
|
+
@import "./_var.scss";
|
|
5
|
+
@import "./_mixins.scss";
|
|
6
|
+
@import "../../mixins/_reset.scss";
|
|
7
|
+
@import "../../mixins/_scrollbar.scss";
|
|
8
|
+
@import "../../mixins/_focus.scss";
|
|
9
|
+
|
|
10
|
+
// <name> 替换为组件名
|
|
11
|
+
.#{$radio-cls}-group {
|
|
12
|
+
@include reset;
|
|
13
|
+
|
|
14
|
+
display: inline-flex;
|
|
15
|
+
align-items: center;
|
|
16
|
+
width: fit-content;
|
|
17
|
+
max-width: 100%;
|
|
18
|
+
border-radius: $border-radius-default;
|
|
19
|
+
flex-wrap: wrap;
|
|
20
|
+
@include scrollbar(4px);
|
|
21
|
+
|
|
22
|
+
.#{$radio-cls} {
|
|
23
|
+
margin-right: $radio-margin-right;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&.#{$radio-cls}-group__outline {
|
|
27
|
+
flex-wrap: wrap;
|
|
28
|
+
row-gap: $comp-margin-xs;
|
|
29
|
+
|
|
30
|
+
&.#{$prefix}-size-s {
|
|
31
|
+
.#{$radio-button--cls} {
|
|
32
|
+
height: $radio-outline-height-small;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&.#{$prefix}-size-m {
|
|
37
|
+
.#{$radio-button--cls} {
|
|
38
|
+
height: $radio-outline-height-medium;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&.#{$prefix}-size-l {
|
|
43
|
+
.#{$radio-button--cls} {
|
|
44
|
+
height: $radio-outline-height-large;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.#{$radio-button--cls} {
|
|
49
|
+
&:first-child {
|
|
50
|
+
border-radius: $border-radius-default 0 0 $border-radius-default;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&:last-child {
|
|
54
|
+
border-radius: 0 $border-radius-default $border-radius-default 0;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&:only-child {
|
|
58
|
+
border-radius: $border-radius-default;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
&.#{$prefix}-is-checked {
|
|
62
|
+
color: $radio-button-color-outline-checked;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&.#{$prefix}-is-disabled {
|
|
66
|
+
&.#{$prefix}-is-checked {
|
|
67
|
+
color: $brand-color-disabled;
|
|
68
|
+
border-color: $brand-color-disabled;
|
|
69
|
+
background-color: $radio-button-background-color-outline-disabled-checked;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
&.#{$radio-cls}-group--filled {
|
|
76
|
+
border-color: $radio-button-group-background-color-filled;
|
|
77
|
+
padding: $radio-group-padding;
|
|
78
|
+
border-radius: $border-radius-default;
|
|
79
|
+
background-color: $radio-button-group-background-color-filled;
|
|
80
|
+
position: relative;
|
|
81
|
+
|
|
82
|
+
.#{$radio-cls}-group__bg-block {
|
|
83
|
+
position: absolute;
|
|
84
|
+
left: $radio-group-filled-bg-block-left;
|
|
85
|
+
top: $radio-group-filled-bg-block-top;
|
|
86
|
+
width: 0;
|
|
87
|
+
height: calc(100% - 4px);
|
|
88
|
+
background-color: $radio-button-background-color-default-filled-checked;
|
|
89
|
+
transition: $radio-group-transition;
|
|
90
|
+
border-radius: $radio-button-border-radius;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.#{$radio-button--cls} {
|
|
94
|
+
color: $radio-button-color-filled;
|
|
95
|
+
border: 0;
|
|
96
|
+
background-color: transparent;
|
|
97
|
+
|
|
98
|
+
&:hover {
|
|
99
|
+
color: $radio-button-color-filled-hover;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&::before {
|
|
103
|
+
content: "";
|
|
104
|
+
position: absolute;
|
|
105
|
+
left: $radio-button-before-left;
|
|
106
|
+
top: $radio-button-before-top;
|
|
107
|
+
transform: $radio-button-before-transition;
|
|
108
|
+
width: $radio-button-before-width;
|
|
109
|
+
height: calc(100% - 16px);
|
|
110
|
+
background-color: $component-border;
|
|
111
|
+
transition: opacity $anim-duration-base $anim-time-fn-ease-out;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
&:first-child {
|
|
115
|
+
&::before {
|
|
116
|
+
opacity: $radio-opacity-transparent;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
&.#{$prefix}-is-checked {
|
|
121
|
+
position: relative;
|
|
122
|
+
color: $radio-button-color-default-filled-checked;
|
|
123
|
+
z-index: 1;
|
|
124
|
+
border: 0;
|
|
125
|
+
transition: color $anim-duration-base linear;
|
|
126
|
+
|
|
127
|
+
&::before {
|
|
128
|
+
opacity: $radio-opacity-transparent;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
& + label {
|
|
132
|
+
&::before {
|
|
133
|
+
opacity: $radio-opacity-transparent;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
&.#{$prefix}-is-disabled {
|
|
139
|
+
background-color: transparent;
|
|
140
|
+
|
|
141
|
+
&.#{$prefix}-is-checked {
|
|
142
|
+
color: $radio-button-color-default-filled-disabled-checked;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
&.#{$prefix}-is-checked ~ .#{$radio-cls}-group__bg-block {
|
|
146
|
+
background-color: $radio-button-background-color-default-filled-disabled-checked;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
&.#{$radio-cls}-group--primary-filled {
|
|
153
|
+
.#{$radio-cls}-group__bg-block {
|
|
154
|
+
background-color: $radio-button-background-color-primary-filled-checked;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.#{$radio-button--cls} {
|
|
158
|
+
&.#{$prefix}-is-checked {
|
|
159
|
+
color: $radio-button-color-primary-filled-checked;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
&.#{$prefix}-is-disabled {
|
|
163
|
+
&.#{$prefix}-is-checked {
|
|
164
|
+
color: $radio-button-color-primary-filled-checked;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
&.#{$prefix}-is-checked ~ .#{$radio-cls}-group__bg-block {
|
|
168
|
+
background-color: $radio-button-background-color-primary-filled-disabled-checked;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
&.#{$prefix}-size-s {
|
|
175
|
+
.#{$radio-button--cls} {
|
|
176
|
+
height: $radio-height-small;
|
|
177
|
+
padding: $radio-button-padding-small;
|
|
178
|
+
font: $radio-button-font-small;
|
|
179
|
+
|
|
180
|
+
&::before {
|
|
181
|
+
height: calc(100% - 16px);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
&.#{$prefix}-size-m {
|
|
187
|
+
.#{$radio-button--cls} {
|
|
188
|
+
height: $radio-height-medium;
|
|
189
|
+
padding: $radio-button-padding-medium;
|
|
190
|
+
font: $radio-button-font-medium;
|
|
191
|
+
|
|
192
|
+
&::before {
|
|
193
|
+
height: calc(100% - 20px);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
&.#{$prefix}-size-l {
|
|
199
|
+
.#{$radio-button--cls} {
|
|
200
|
+
height: $radio-height-large;
|
|
201
|
+
padding: $radio-button-padding-large;
|
|
202
|
+
font: $radio-button-font-large;
|
|
203
|
+
|
|
204
|
+
&::before {
|
|
205
|
+
height: calc(100% - 24px);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.#{$radio-button--cls} {
|
|
211
|
+
cursor: pointer;
|
|
212
|
+
position: relative;
|
|
213
|
+
border: $radio-button-border;
|
|
214
|
+
border-color: $radio-button-border-color-default;
|
|
215
|
+
border-right: 0;
|
|
216
|
+
display: inline-flex;
|
|
217
|
+
align-items: center;
|
|
218
|
+
transition: $radio-button-transition;
|
|
219
|
+
color: $radio-label-color;
|
|
220
|
+
white-space: nowrap;
|
|
221
|
+
box-sizing: border-box;
|
|
222
|
+
|
|
223
|
+
&:first-child {
|
|
224
|
+
border-radius: $radio-button-border-radius 0 0 $radio-button-border-radius;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
&:last-child {
|
|
228
|
+
border-right: $radio-button-border;
|
|
229
|
+
border-right-color: $radio-button-border-color-default;
|
|
230
|
+
border-radius: 0 $radio-button-border-radius $radio-button-border-radius 0;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
&__former {
|
|
234
|
+
opacity: $radio-opacity-transparent;
|
|
235
|
+
height: 0;
|
|
236
|
+
width: 0;
|
|
237
|
+
@include reset;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
&:hover {
|
|
241
|
+
color: $radio-button-color-outline-checked;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
&.#{$prefix}-is-checked {
|
|
245
|
+
border-right: $radio-button-border;
|
|
246
|
+
border-color: $radio-button-border-color-checked;
|
|
247
|
+
transition: border-color $anim-duration-base $anim-time-fn-ease-out;
|
|
248
|
+
|
|
249
|
+
& + .#{$radio-button--cls} {
|
|
250
|
+
border-left: 0;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
&.#{$prefix}-is-disabled {
|
|
255
|
+
cursor: not-allowed;
|
|
256
|
+
color: $radio-button-color-disabled;
|
|
257
|
+
background-color: $radio-button-background-color-disabled;
|
|
258
|
+
|
|
259
|
+
&:hover {
|
|
260
|
+
border-color: $radio-button-border-color-default;
|
|
261
|
+
color: $radio-button-color-disabled;
|
|
262
|
+
|
|
263
|
+
&::after {
|
|
264
|
+
width: 0;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
&.#{$prefix}-is-checked {
|
|
269
|
+
color: $radio-button-color-disabled-checked;
|
|
270
|
+
|
|
271
|
+
&::after {
|
|
272
|
+
width: 0;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
.#{$radio-cls} {
|
|
280
|
+
@include reset;
|
|
281
|
+
|
|
282
|
+
position: relative;
|
|
283
|
+
cursor: pointer;
|
|
284
|
+
display: inline-block;
|
|
285
|
+
|
|
286
|
+
&__former {
|
|
287
|
+
@include reset;
|
|
288
|
+
opacity: $radio-opacity-transparent;
|
|
289
|
+
position: absolute;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
&__input {
|
|
293
|
+
position: relative;
|
|
294
|
+
display: inline-block;
|
|
295
|
+
width: $radio-size;
|
|
296
|
+
height: $radio-size;
|
|
297
|
+
vertical-align: middle;
|
|
298
|
+
border-radius: $border-radius-circle;
|
|
299
|
+
border: $radio-input-border;
|
|
300
|
+
background-color: $radio-input-color;
|
|
301
|
+
transition: $radio-input-transition;
|
|
302
|
+
|
|
303
|
+
&::after {
|
|
304
|
+
content: "";
|
|
305
|
+
position: absolute;
|
|
306
|
+
top: 50%;
|
|
307
|
+
left: 50%;
|
|
308
|
+
width: $radio-size;
|
|
309
|
+
height: $radio-size;
|
|
310
|
+
margin-top: -$radio-dot-size;
|
|
311
|
+
margin-left: -$radio-dot-size;
|
|
312
|
+
transform: scale(0.5);
|
|
313
|
+
opacity: $radio-opacity-transparent;
|
|
314
|
+
border-radius: $border-radius-circle;
|
|
315
|
+
background-color: $radio-dot-color;
|
|
316
|
+
transition: all $anim-duration-base $anim-time-fn-ease-out;
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
&__label {
|
|
321
|
+
display: inline-block;
|
|
322
|
+
margin-left: $radio-input-label-spacer;
|
|
323
|
+
color: $radio-label-color;
|
|
324
|
+
vertical-align: middle;
|
|
325
|
+
font: $radio-font;
|
|
326
|
+
white-space: nowrap;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
&:hover {
|
|
330
|
+
.#{$radio-cls}__input {
|
|
331
|
+
border-color: $radio-dot-color;
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
&.#{$prefix}-is-checked {
|
|
336
|
+
.#{$radio-cls}__input {
|
|
337
|
+
border-color: $radio-dot-color;
|
|
338
|
+
|
|
339
|
+
&::after {
|
|
340
|
+
opacity: 1;
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
&.#{$prefix}-is-disabled {
|
|
346
|
+
cursor: not-allowed;
|
|
347
|
+
|
|
348
|
+
.#{$radio-cls}__label {
|
|
349
|
+
color: $radio-button-color-disabled;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
.#{$radio-cls}__input {
|
|
353
|
+
background-color: $radio-input-color-disabled;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
&:hover {
|
|
357
|
+
.#{$radio-cls}__input {
|
|
358
|
+
border-color: $radio-border-color;
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
&.#{$prefix}-is-checked {
|
|
363
|
+
.#{$radio-cls}__input {
|
|
364
|
+
border-color: $radio-border-color;
|
|
365
|
+
|
|
366
|
+
&::after {
|
|
367
|
+
background-color: $radio-dot-color-disabled-checked;
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
.#{$prefix}-radio:focus-visible {
|
|
375
|
+
@include tab-focus-style-rect;
|
|
376
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,92 @@
|
|
|
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
|
+
$radio-cls: "#{$prefix}-radio";
|
|
15
|
+
$radio-button--cls: "#{$prefix}-radio-button";
|
|
16
|
+
|
|
17
|
+
// 颜色
|
|
18
|
+
$radio-border-color: $border-level-2-color;
|
|
19
|
+
|
|
20
|
+
$radio-input-color: $bg-color-container;
|
|
21
|
+
$radio-input-color-disabled: $bg-color-component-disabled;
|
|
22
|
+
|
|
23
|
+
$radio-dot-color: $brand-color;
|
|
24
|
+
$radio-dot-color-disabled: $bg-color-component-disabled;
|
|
25
|
+
$radio-dot-color-disabled-checked: $text-color-disabled;
|
|
26
|
+
|
|
27
|
+
$radio-label-color: $text-color-primary;
|
|
28
|
+
|
|
29
|
+
$radio-button-border-color-default: $border-level-2-color;
|
|
30
|
+
$radio-button-border-color-hover: $brand-color-hover;
|
|
31
|
+
$radio-button-color-outline-hover: $brand-color-hover;
|
|
32
|
+
$radio-button-border-color-checked: $brand-color;
|
|
33
|
+
$radio-button-color-outline-checked: $brand-color;
|
|
34
|
+
$radio-button-background-color-disabled: $bg-color-component-disabled;
|
|
35
|
+
$radio-button-color-disabled: $text-color-disabled;
|
|
36
|
+
$radio-button-background-color-outline-disabled-checked: $bg-color-specialcomponent;
|
|
37
|
+
$radio-button-color-disabled-checked: $text-color-disabled;
|
|
38
|
+
|
|
39
|
+
$radio-button-group-background-color-filled: $bg-color-component;
|
|
40
|
+
$radio-button-color-filled: $text-color-secondary;
|
|
41
|
+
$radio-button-color-filled-hover: $text-color-primary;
|
|
42
|
+
$radio-button-color-default-filled-checked: $text-color-primary;
|
|
43
|
+
$radio-button-color-primary-filled-checked: $text-color-anti;
|
|
44
|
+
$radio-button-color-default-filled-disabled-checked: $text-color-disabled;
|
|
45
|
+
$radio-button-background-color-default-filled-checked: $bg-color-container-select;
|
|
46
|
+
$radio-button-background-color-primary-filled-checked: $brand-color;
|
|
47
|
+
$radio-button-background-color-default-filled-disabled-checked: $bg-color-component-disabled;
|
|
48
|
+
$radio-button-background-color-primary-filled-disabled-checked: $brand-color-disabled;
|
|
49
|
+
|
|
50
|
+
// 尺寸
|
|
51
|
+
$radio-size: 16px;
|
|
52
|
+
$radio-dot-size: ($radio-size / 2);
|
|
53
|
+
$radio-margin-right: $comp-margin-xxl;
|
|
54
|
+
$radio-button-border-radius: $border-radius-small;
|
|
55
|
+
$radio-outline-height-small: $comp-size-xs;
|
|
56
|
+
$radio-outline-height-medium: $comp-size-m;
|
|
57
|
+
$radio-outline-height-large: $comp-size-xl;
|
|
58
|
+
$radio-height-small: calc($comp-size-xs - ($comp-paddingTB-xxs * 2));
|
|
59
|
+
$radio-height-medium: calc($comp-size-m - ($comp-paddingTB-xxs * 2));
|
|
60
|
+
$radio-height-large: calc($comp-size-xl - ($comp-paddingTB-xxs * 2));
|
|
61
|
+
$radio-button-before-width: 1px;
|
|
62
|
+
|
|
63
|
+
// 字号
|
|
64
|
+
$radio-font: $font-body-medium;
|
|
65
|
+
$radio-button-font-small: $font-body-small;
|
|
66
|
+
$radio-button-font-medium: $font-body-medium;
|
|
67
|
+
$radio-button-font-large: $font-body-large;
|
|
68
|
+
|
|
69
|
+
// padding
|
|
70
|
+
$radio-input-label-spacer: $comp-margin-s;
|
|
71
|
+
$radio-button-padding-small: 0px $comp-paddingLR-s;
|
|
72
|
+
$radio-button-padding-medium: $comp-paddingTB-xs $comp-paddingLR-l;
|
|
73
|
+
$radio-button-padding-large: $comp-paddingTB-s $comp-paddingLR-xl;
|
|
74
|
+
$radio-button-before-left: 0px;
|
|
75
|
+
$radio-button-before-top: 50%;
|
|
76
|
+
$radio-button-border: 1px solid;
|
|
77
|
+
|
|
78
|
+
$radio-group-padding: $comp-paddingTB-xxs $comp-paddingLR-xxs;
|
|
79
|
+
$radio-group-filled-bg-block-left: 2px;
|
|
80
|
+
$radio-group-filled-bg-block-top: 2px;
|
|
81
|
+
|
|
82
|
+
// 动画&过渡
|
|
83
|
+
$radio-group-transition: all $anim-duration-base $anim-time-fn-easing;
|
|
84
|
+
$radio-button-before-transition: translateY(-50%);
|
|
85
|
+
$radio-button-transition: color $anim-duration-base $anim-time-fn-ease-out;
|
|
86
|
+
$radio-input-transition: border $anim-duration-base $anim-time-fn-ease-out;
|
|
87
|
+
|
|
88
|
+
// 透明度
|
|
89
|
+
$radio-opacity-transparent: 0; // 全透明
|
|
90
|
+
|
|
91
|
+
// 边框
|
|
92
|
+
$radio-input-border: 1px solid $radio-border-color;
|