@tiny-design/react 1.4.0 → 1.5.1

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.
Files changed (198) hide show
  1. package/es/alert/alert.js +2 -2
  2. package/es/alert/alert.js.map +1 -1
  3. package/es/alert/style/_index.scss +8 -4
  4. package/es/alert/style/index.css +7 -4
  5. package/es/auto-complete/style/_index.scss +4 -5
  6. package/es/auto-complete/style/index.css +4 -5
  7. package/es/breadcrumb/style/index.css +1 -1
  8. package/es/breadcrumb/types.d.ts +1 -1
  9. package/es/button/style/index.css +14 -14
  10. package/es/calendar/style/_index.scss +9 -9
  11. package/es/calendar/style/index.css +9 -9
  12. package/es/card/style/index.css +3 -3
  13. package/es/cascader/style/_index.scss +9 -9
  14. package/es/cascader/style/index.css +9 -9
  15. package/es/checkbox/style/_index.scss +9 -12
  16. package/es/checkbox/style/index.css +9 -12
  17. package/es/collapse/collapse-panel.js +20 -20
  18. package/es/collapse/collapse-panel.js.map +1 -1
  19. package/es/collapse/style/_index.scss +27 -10
  20. package/es/collapse/style/index.css +27 -12
  21. package/es/color-picker/style/_index.scss +7 -7
  22. package/es/color-picker/style/index.css +4 -4
  23. package/es/date-picker/style/_index.scss +1 -1
  24. package/es/date-picker/style/index.css +1 -1
  25. package/es/descriptions/style/_index.scss +5 -6
  26. package/es/descriptions/style/index.css +6 -6
  27. package/es/empty/style/_index.scss +1 -1
  28. package/es/empty/style/index.css +1 -1
  29. package/es/form/style/_index.scss +5 -6
  30. package/es/form/style/index.css +4 -4
  31. package/es/index.d.ts +2 -1
  32. package/es/index.js +2 -1
  33. package/es/input/style/_index.scss +5 -4
  34. package/es/input/style/_mixin.scss +1 -1
  35. package/es/input/style/index.css +21 -20
  36. package/es/input-number/input-number.js +11 -5
  37. package/es/input-number/input-number.js.map +1 -1
  38. package/es/input-number/style/_index.scss +5 -3
  39. package/es/input-number/style/index.css +13 -11
  40. package/es/input-otp/input-otp.js +5 -7
  41. package/es/input-otp/input-otp.js.map +1 -1
  42. package/es/input-otp/style/_index.scss +1 -1
  43. package/es/input-otp/style/index.css +8 -8
  44. package/es/list/list.js +2 -2
  45. package/es/list/list.js.map +1 -1
  46. package/es/list/style/_index.scss +3 -3
  47. package/es/list/style/index.css +3 -3
  48. package/es/marquee/index.d.ts +1 -0
  49. package/es/marquee/index.js +9 -0
  50. package/es/marquee/index.js.map +1 -0
  51. package/es/marquee/marquee.d.ts +8 -0
  52. package/es/marquee/marquee.js +42 -0
  53. package/es/marquee/marquee.js.map +1 -0
  54. package/es/marquee/style/_index.scss +77 -0
  55. package/es/marquee/style/index.css +64 -0
  56. package/es/marquee/style/index.d.ts +1 -0
  57. package/es/marquee/style/index.js +1 -0
  58. package/es/marquee/types.d.ts +21 -0
  59. package/es/native-select/style/index.css +4 -4
  60. package/es/notification/style/_index.scss +1 -1
  61. package/es/notification/style/index.css +1 -1
  62. package/es/pop-confirm/style/_index.scss +1 -1
  63. package/es/pop-confirm/style/index.css +1 -1
  64. package/es/popup/style/_index.scss +9 -9
  65. package/es/popup/style/index.css +10 -10
  66. package/es/radio/style/_index.scss +5 -8
  67. package/es/radio/style/index.css +5 -8
  68. package/es/segmented/style/_index.scss +10 -10
  69. package/es/segmented/style/index.css +9 -9
  70. package/es/select/style/_index.scss +16 -17
  71. package/es/select/style/index.css +15 -16
  72. package/es/speed-dial/style/_index.scss +2 -2
  73. package/es/speed-dial/style/index.css +2 -2
  74. package/es/statistic/style/_index.scss +2 -2
  75. package/es/statistic/style/index.css +2 -2
  76. package/es/strength-indicator/strength-indicator.js +4 -3
  77. package/es/strength-indicator/strength-indicator.js.map +1 -1
  78. package/es/style/_component.scss +1 -0
  79. package/es/style/base.css +57 -0
  80. package/es/table/style/_index.scss +6 -6
  81. package/es/table/style/index.css +5 -5
  82. package/es/tag/style/index.css +1 -1
  83. package/es/tag/tag.js +5 -5
  84. package/es/tag/tag.js.map +1 -1
  85. package/es/textarea/style/index.css +2 -2
  86. package/es/time-picker/style/_index.scss +1 -1
  87. package/es/time-picker/style/index.css +1 -1
  88. package/es/timeline/style/_index.scss +3 -3
  89. package/es/timeline/style/index.css +3 -3
  90. package/es/tooltip/style/index.css +1 -1
  91. package/es/transfer/style/_index.scss +4 -4
  92. package/es/transfer/style/index.css +4 -4
  93. package/es/tree/style/index.css +1 -1
  94. package/es/typography/style/_index.scss +2 -2
  95. package/es/typography/style/index.css +2 -2
  96. package/es/upload/style/_index.scss +4 -4
  97. package/es/upload/style/index.css +4 -4
  98. package/es/waterfall/waterfall.js +7 -2
  99. package/es/waterfall/waterfall.js.map +1 -1
  100. package/lib/alert/alert.js +2 -2
  101. package/lib/alert/alert.js.map +1 -1
  102. package/lib/alert/style/_index.scss +8 -4
  103. package/lib/alert/style/index.css +7 -4
  104. package/lib/auto-complete/style/_index.scss +4 -5
  105. package/lib/auto-complete/style/index.css +4 -5
  106. package/lib/breadcrumb/style/index.css +1 -1
  107. package/lib/breadcrumb/types.d.ts +1 -1
  108. package/lib/button/style/index.css +14 -14
  109. package/lib/calendar/style/_index.scss +9 -9
  110. package/lib/calendar/style/index.css +9 -9
  111. package/lib/card/style/index.css +3 -3
  112. package/lib/cascader/style/_index.scss +9 -9
  113. package/lib/cascader/style/index.css +9 -9
  114. package/lib/checkbox/style/_index.scss +9 -12
  115. package/lib/checkbox/style/index.css +9 -12
  116. package/lib/collapse/collapse-panel.js +20 -20
  117. package/lib/collapse/collapse-panel.js.map +1 -1
  118. package/lib/collapse/style/_index.scss +27 -10
  119. package/lib/collapse/style/index.css +27 -12
  120. package/lib/color-picker/style/_index.scss +7 -7
  121. package/lib/color-picker/style/index.css +4 -4
  122. package/lib/date-picker/style/_index.scss +1 -1
  123. package/lib/date-picker/style/index.css +1 -1
  124. package/lib/descriptions/style/_index.scss +5 -6
  125. package/lib/descriptions/style/index.css +6 -6
  126. package/lib/empty/style/_index.scss +1 -1
  127. package/lib/empty/style/index.css +1 -1
  128. package/lib/form/style/_index.scss +5 -6
  129. package/lib/form/style/index.css +4 -4
  130. package/lib/index.d.ts +2 -1
  131. package/lib/index.js +76 -74
  132. package/lib/input/style/_index.scss +5 -4
  133. package/lib/input/style/_mixin.scss +1 -1
  134. package/lib/input/style/index.css +21 -20
  135. package/lib/input-number/input-number.js +11 -5
  136. package/lib/input-number/input-number.js.map +1 -1
  137. package/lib/input-number/style/_index.scss +5 -3
  138. package/lib/input-number/style/index.css +13 -11
  139. package/lib/input-otp/input-otp.js +5 -7
  140. package/lib/input-otp/input-otp.js.map +1 -1
  141. package/lib/input-otp/style/_index.scss +1 -1
  142. package/lib/input-otp/style/index.css +8 -8
  143. package/lib/list/list.js +2 -2
  144. package/lib/list/list.js.map +1 -1
  145. package/lib/list/style/_index.scss +3 -3
  146. package/lib/list/style/index.css +3 -3
  147. package/lib/marquee/index.js +8 -0
  148. package/lib/marquee/index.js.map +1 -0
  149. package/lib/marquee/marquee.d.ts +8 -0
  150. package/lib/marquee/marquee.js +45 -0
  151. package/lib/marquee/marquee.js.map +1 -0
  152. package/lib/marquee/style/_index.scss +77 -0
  153. package/lib/marquee/style/index.css +64 -0
  154. package/lib/marquee/style/index.d.ts +1 -0
  155. package/lib/marquee/style/index.js +1 -0
  156. package/lib/marquee/types.d.ts +21 -0
  157. package/lib/native-select/style/index.css +4 -4
  158. package/lib/notification/style/_index.scss +1 -1
  159. package/lib/notification/style/index.css +1 -1
  160. package/lib/pop-confirm/style/_index.scss +1 -1
  161. package/lib/pop-confirm/style/index.css +1 -1
  162. package/lib/popup/style/_index.scss +9 -9
  163. package/lib/popup/style/index.css +10 -10
  164. package/lib/radio/style/_index.scss +5 -8
  165. package/lib/radio/style/index.css +5 -8
  166. package/lib/segmented/style/_index.scss +10 -10
  167. package/lib/segmented/style/index.css +9 -9
  168. package/lib/select/style/_index.scss +16 -17
  169. package/lib/select/style/index.css +15 -16
  170. package/lib/speed-dial/style/_index.scss +2 -2
  171. package/lib/speed-dial/style/index.css +2 -2
  172. package/lib/statistic/style/_index.scss +2 -2
  173. package/lib/statistic/style/index.css +2 -2
  174. package/lib/strength-indicator/strength-indicator.js +4 -3
  175. package/lib/strength-indicator/strength-indicator.js.map +1 -1
  176. package/lib/style/_component.scss +1 -0
  177. package/lib/style/base.css +57 -0
  178. package/lib/table/style/_index.scss +6 -6
  179. package/lib/table/style/index.css +5 -5
  180. package/lib/tag/style/index.css +1 -1
  181. package/lib/tag/tag.js +5 -5
  182. package/lib/tag/tag.js.map +1 -1
  183. package/lib/textarea/style/index.css +2 -2
  184. package/lib/time-picker/style/_index.scss +1 -1
  185. package/lib/time-picker/style/index.css +1 -1
  186. package/lib/timeline/style/_index.scss +3 -3
  187. package/lib/timeline/style/index.css +3 -3
  188. package/lib/tooltip/style/index.css +1 -1
  189. package/lib/transfer/style/_index.scss +4 -4
  190. package/lib/transfer/style/index.css +4 -4
  191. package/lib/tree/style/index.css +1 -1
  192. package/lib/typography/style/_index.scss +2 -2
  193. package/lib/typography/style/index.css +2 -2
  194. package/lib/upload/style/_index.scss +4 -4
  195. package/lib/upload/style/index.css +4 -4
  196. package/lib/waterfall/waterfall.js +7 -2
  197. package/lib/waterfall/waterfall.js.map +1 -1
  198. package/package.json +3 -3
@@ -5,7 +5,7 @@
5
5
  align-items: center;
6
6
  padding: 2px;
7
7
  background: var(--ty-segmented-bg, #{$gray-200});
8
- border-radius: $border-radius;
8
+ border-radius: var(--ty-border-radius);
9
9
  box-sizing: border-box;
10
10
 
11
11
  &_block {
@@ -30,20 +30,20 @@
30
30
 
31
31
  &_sm .#{$prefix}-segmented__item {
32
32
  padding: 0 8px;
33
- height: calc(#{$height-sm} - 4px);
34
- font-size: $font-size-sm;
33
+ height: calc(var(--ty-height-sm) - 4px);
34
+ font-size: var(--ty-font-size-sm);
35
35
  }
36
36
 
37
37
  &_md .#{$prefix}-segmented__item {
38
38
  padding: 0 12px;
39
- height: calc(#{$height-md} - 4px);
40
- font-size: $font-size-base;
39
+ height: calc(var(--ty-height-md) - 4px);
40
+ font-size: var(--ty-font-size-base);
41
41
  }
42
42
 
43
43
  &_lg .#{$prefix}-segmented__item {
44
44
  padding: 0 16px;
45
- height: calc(#{$height-lg} - 4px);
46
- font-size: $font-size-lg;
45
+ height: calc(var(--ty-height-lg) - 4px);
46
+ font-size: var(--ty-font-size-lg);
47
47
  }
48
48
 
49
49
  &__item {
@@ -52,19 +52,19 @@
52
52
  align-items: center;
53
53
  gap: 4px;
54
54
  cursor: pointer;
55
- border-radius: $border-radius;
55
+ border-radius: var(--ty-border-radius);
56
56
  transition: all 0.2s;
57
57
  user-select: none;
58
58
  white-space: nowrap;
59
59
 
60
- &:hover:not(&_active):not(&_disabled) {
60
+ &:hover:not(&_active, &_disabled) {
61
61
  color: var(--ty-color-text, #{$gray-900});
62
62
  }
63
63
 
64
64
  &_active {
65
65
  background: var(--ty-segmented-active-bg, #fff);
66
66
  color: var(--ty-color-text, #{$gray-900});
67
- box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.06), 0 1px 3px 0 rgba(0, 0, 0, 0.1);
67
+ box-shadow: 0 1px 2px 0 rgb(0 0 0 / 6%), 0 1px 3px 0 rgb(0 0 0 / 10%);
68
68
  font-weight: 500;
69
69
  }
70
70
 
@@ -3,7 +3,7 @@
3
3
  align-items: center;
4
4
  padding: 2px;
5
5
  background: var(--ty-segmented-bg, #e9ecef);
6
- border-radius: 2px;
6
+ border-radius: var(--ty-border-radius);
7
7
  box-sizing: border-box;
8
8
  }
9
9
  .ty-segmented_block {
@@ -24,18 +24,18 @@
24
24
  }
25
25
  .ty-segmented_sm .ty-segmented__item {
26
26
  padding: 0 8px;
27
- height: calc(24px - 4px);
28
- font-size: 0.875rem;
27
+ height: calc(var(--ty-height-sm) - 4px);
28
+ font-size: var(--ty-font-size-sm);
29
29
  }
30
30
  .ty-segmented_md .ty-segmented__item {
31
31
  padding: 0 12px;
32
- height: calc(32px - 4px);
33
- font-size: 1rem;
32
+ height: calc(var(--ty-height-md) - 4px);
33
+ font-size: var(--ty-font-size-base);
34
34
  }
35
35
  .ty-segmented_lg .ty-segmented__item {
36
36
  padding: 0 16px;
37
- height: calc(42px - 4px);
38
- font-size: 1.25rem;
37
+ height: calc(var(--ty-height-lg) - 4px);
38
+ font-size: var(--ty-font-size-lg);
39
39
  }
40
40
  .ty-segmented__item {
41
41
  position: relative;
@@ -43,14 +43,14 @@
43
43
  align-items: center;
44
44
  gap: 4px;
45
45
  cursor: pointer;
46
- border-radius: 2px;
46
+ border-radius: var(--ty-border-radius);
47
47
  transition: all 0.2s;
48
48
  -webkit-user-select: none;
49
49
  -moz-user-select: none;
50
50
  user-select: none;
51
51
  white-space: nowrap;
52
52
  }
53
- .ty-segmented__item:hover:not(.ty-segmented__item_active):not(.ty-segmented__item_disabled) {
53
+ .ty-segmented__item:hover:not(.ty-segmented__item_active, .ty-segmented__item_disabled) {
54
54
  color: var(--ty-color-text, #212529);
55
55
  }
56
56
  .ty-segmented__item_active {
@@ -4,7 +4,7 @@
4
4
  position: relative;
5
5
  display: inline-block;
6
6
  width: 100%;
7
- font-size: $font-size-base;
7
+ font-size: var(--ty-font-size-base);
8
8
  cursor: pointer;
9
9
  outline: none;
10
10
 
@@ -20,20 +20,20 @@
20
20
 
21
21
  // Sizes
22
22
  &_sm .#{$prefix}-select__selector {
23
- min-height: $height-sm;
24
- font-size: $font-size-sm;
23
+ min-height: var(--ty-height-sm);
24
+ font-size: var(--ty-font-size-sm);
25
25
  padding: 0 24px 0 8px;
26
26
  }
27
27
 
28
28
  &_md .#{$prefix}-select__selector {
29
- min-height: $height-md;
30
- font-size: $font-size-base;
29
+ min-height: var(--ty-height-md);
30
+ font-size: var(--ty-font-size-base);
31
31
  padding: 0 28px 0 10px;
32
32
  }
33
33
 
34
34
  &_lg .#{$prefix}-select__selector {
35
- min-height: $height-lg;
36
- font-size: $font-size-lg;
35
+ min-height: var(--ty-height-lg);
36
+ font-size: var(--ty-font-size-lg);
37
37
  padding: 0 32px 0 12px;
38
38
  }
39
39
 
@@ -62,7 +62,7 @@
62
62
  align-items: center;
63
63
  width: 100%;
64
64
  border: $border-width solid var(--ty-input-border);
65
- border-radius: $border-radius;
65
+ border-radius: var(--ty-border-radius);
66
66
  background-color: var(--ty-input-bg);
67
67
  box-sizing: border-box;
68
68
  transition: all 0.3s;
@@ -173,9 +173,9 @@
173
173
  max-width: 100%;
174
174
  height: 22px;
175
175
  padding: 0 4px 0 8px;
176
- border-radius: $border-radius;
176
+ border-radius: var(--ty-border-radius);
177
177
  background-color: var(--ty-color-fill-secondary);
178
- font-size: $font-size-sm;
178
+ font-size: var(--ty-font-size-sm);
179
179
  line-height: 20px;
180
180
  color: var(--ty-color-text);
181
181
  box-sizing: border-box;
@@ -212,12 +212,11 @@
212
212
  list-style-type: none;
213
213
  background-color: var(--ty-select-dropdown-bg);
214
214
  box-sizing: border-box;
215
- overflow-x: hidden;
216
- overflow-y: auto;
215
+ overflow: hidden auto;
217
216
  z-index: 10;
218
217
  box-shadow: var(--ty-shadow-popup);
219
- border-radius: $border-radius;
220
- font-size: $font-size-base;
218
+ border-radius: var(--ty-border-radius);
219
+ font-size: var(--ty-font-size-base);
221
220
  max-height: $select-dropdown-max-height;
222
221
  }
223
222
 
@@ -238,7 +237,7 @@
238
237
  padding: 16px;
239
238
  text-align: center;
240
239
  color: var(--ty-color-text-quaternary);
241
- font-size: $font-size-sm;
240
+ font-size: var(--ty-font-size-sm);
242
241
  }
243
242
  }
244
243
 
@@ -284,9 +283,8 @@
284
283
  }
285
284
 
286
285
  .#{$prefix}-select-group {
287
-
288
286
  &__title {
289
- font-size: $font-size-sm;
287
+ font-size: var(--ty-font-size-sm);
290
288
  cursor: default;
291
289
  color: $gray-600;
292
290
  padding: 7px 12px;
@@ -307,6 +305,7 @@
307
305
  from {
308
306
  transform: rotate(0deg);
309
307
  }
308
+
310
309
  to {
311
310
  transform: rotate(360deg);
312
311
  }
@@ -2,7 +2,7 @@
2
2
  position: relative;
3
3
  display: inline-block;
4
4
  width: 100%;
5
- font-size: 1rem;
5
+ font-size: var(--ty-font-size-base);
6
6
  cursor: pointer;
7
7
  outline: none;
8
8
  }
@@ -15,18 +15,18 @@
15
15
  cursor: not-allowed;
16
16
  }
17
17
  .ty-select_sm .ty-select__selector {
18
- min-height: 24px;
19
- font-size: 0.875rem;
18
+ min-height: var(--ty-height-sm);
19
+ font-size: var(--ty-font-size-sm);
20
20
  padding: 0 24px 0 8px;
21
21
  }
22
22
  .ty-select_md .ty-select__selector {
23
- min-height: 32px;
24
- font-size: 1rem;
23
+ min-height: var(--ty-height-md);
24
+ font-size: var(--ty-font-size-base);
25
25
  padding: 0 28px 0 10px;
26
26
  }
27
27
  .ty-select_lg .ty-select__selector {
28
- min-height: 42px;
29
- font-size: 1.25rem;
28
+ min-height: var(--ty-height-lg);
29
+ font-size: var(--ty-font-size-lg);
30
30
  padding: 0 32px 0 12px;
31
31
  }
32
32
  .ty-select_multiple .ty-select__selector {
@@ -46,7 +46,7 @@
46
46
  align-items: center;
47
47
  width: 100%;
48
48
  border: 1px solid var(--ty-input-border);
49
- border-radius: 2px;
49
+ border-radius: var(--ty-border-radius);
50
50
  background-color: var(--ty-input-bg);
51
51
  box-sizing: border-box;
52
52
  transition: all 0.3s;
@@ -143,9 +143,9 @@
143
143
  max-width: 100%;
144
144
  height: 22px;
145
145
  padding: 0 4px 0 8px;
146
- border-radius: 2px;
146
+ border-radius: var(--ty-border-radius);
147
147
  background-color: var(--ty-color-fill-secondary);
148
- font-size: 0.875rem;
148
+ font-size: var(--ty-font-size-sm);
149
149
  line-height: 20px;
150
150
  color: var(--ty-color-text);
151
151
  box-sizing: border-box;
@@ -176,12 +176,11 @@
176
176
  list-style-type: none;
177
177
  background-color: var(--ty-select-dropdown-bg);
178
178
  box-sizing: border-box;
179
- overflow-x: hidden;
180
- overflow-y: auto;
179
+ overflow: hidden auto;
181
180
  z-index: 10;
182
181
  box-shadow: var(--ty-shadow-popup);
183
- border-radius: 2px;
184
- font-size: 1rem;
182
+ border-radius: var(--ty-border-radius);
183
+ font-size: var(--ty-font-size-base);
185
184
  max-height: 300px;
186
185
  }
187
186
  .ty-select__loading {
@@ -197,7 +196,7 @@
197
196
  padding: 16px;
198
197
  text-align: center;
199
198
  color: var(--ty-color-text-quaternary);
200
- font-size: 0.875rem;
199
+ font-size: var(--ty-font-size-sm);
201
200
  }
202
201
 
203
202
  .ty-select-option {
@@ -236,7 +235,7 @@
236
235
  }
237
236
 
238
237
  .ty-select-group__title {
239
- font-size: 0.875rem;
238
+ font-size: var(--ty-font-size-sm);
240
239
  cursor: default;
241
240
  color: #8898aa;
242
241
  padding: 7px 12px;
@@ -197,9 +197,9 @@ $speed-dial-actions-gap: 16px;
197
197
  white-space: nowrap;
198
198
  background-color: var(--ty-speed-dial-tooltip-bg, #{$gray-800});
199
199
  color: var(--ty-speed-dial-tooltip-color, #{$white-color});
200
- font-size: $font-size-sm;
200
+ font-size: var(--ty-font-size-sm);
201
201
  padding: 4px 8px;
202
- border-radius: $border-radius;
202
+ border-radius: var(--ty-border-radius);
203
203
  pointer-events: none;
204
204
 
205
205
  &_left {
@@ -156,9 +156,9 @@
156
156
  white-space: nowrap;
157
157
  background-color: var(--ty-speed-dial-tooltip-bg, #32325d);
158
158
  color: var(--ty-speed-dial-tooltip-color, #fff);
159
- font-size: 0.875rem;
159
+ font-size: var(--ty-font-size-sm);
160
160
  padding: 4px 8px;
161
- border-radius: 2px;
161
+ border-radius: var(--ty-border-radius);
162
162
  pointer-events: none;
163
163
  }
164
164
  .ty-speed-dial__action-tooltip_left {
@@ -4,7 +4,7 @@
4
4
  &__title {
5
5
  margin-bottom: 4px;
6
6
  color: var(--ty-color-text-secondary, #{$gray-600});
7
- font-size: $font-size-sm;
7
+ font-size: var(--ty-font-size-sm);
8
8
  }
9
9
 
10
10
  &__content {
@@ -24,7 +24,7 @@
24
24
 
25
25
  &__suffix {
26
26
  margin-left: 4px;
27
- font-size: $font-size-base;
27
+ font-size: var(--ty-font-size-base);
28
28
  display: inline-flex;
29
29
  align-items: center;
30
30
  }
@@ -1,7 +1,7 @@
1
1
  .ty-statistic__title {
2
2
  margin-bottom: 4px;
3
3
  color: var(--ty-color-text-secondary, #8898aa);
4
- font-size: 0.875rem;
4
+ font-size: var(--ty-font-size-sm);
5
5
  }
6
6
  .ty-statistic__content {
7
7
  display: flex;
@@ -18,7 +18,7 @@
18
18
  }
19
19
  .ty-statistic__suffix {
20
20
  margin-left: 4px;
21
- font-size: 1rem;
21
+ font-size: var(--ty-font-size-base);
22
22
  display: inline-flex;
23
23
  align-items: center;
24
24
  }
@@ -12,10 +12,11 @@ const StrengthIndicator = react.default.forwardRef((props, ref) => {
12
12
  "#f44336",
13
13
  "#ff9800",
14
14
  "#52c41a"
15
- ], className, prefixCls: customisedCls, ...otherProps } = props;
15
+ ], labels, className, prefixCls: customisedCls, ...otherProps } = props;
16
16
  const prefixCls = require_general.getPrefixCls("strength-indicator", (0, react.useContext)(require_config_context.ConfigContext).prefixCls, customisedCls);
17
17
  const cls = (0, classnames.default)(prefixCls, className);
18
- const displayLabels = Array.isArray(props.labels) ? props.labels : [
18
+ const showLabels = labels !== void 0;
19
+ const displayLabels = Array.isArray(labels) ? labels : [
19
20
  "Weak",
20
21
  "Medium",
21
22
  "Strong"
@@ -36,7 +37,7 @@ const StrengthIndicator = react.default.forwardRef((props, ref) => {
36
37
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
37
38
  className: `${prefixCls}__inner`,
38
39
  style: { backgroundColor: bgColor }
39
- }), "labels" in props && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
40
+ }), showLabels && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
40
41
  className: `${prefixCls}__label`,
41
42
  children: displayLabels[idx]
42
43
  })]
@@ -1 +1 @@
1
- {"version":3,"file":"strength-indicator.js","names":["React","getPrefixCls","ConfigContext"],"sources":["../../src/strength-indicator/strength-indicator.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport classNames from 'classnames';\nimport { ConfigContext } from '../config-provider/config-context';\nimport { getPrefixCls } from '../_utils/general';\nimport { StrengthIndicatorProps } from './types';\n\nconst StrengthIndicator = React.forwardRef<HTMLDivElement, StrengthIndicatorProps>(\n (props: StrengthIndicatorProps, ref): React.ReactElement => {\n const {\n current = 0,\n blocks = 3,\n colors = ['#f44336', '#ff9800', '#52c41a'],\n className,\n prefixCls: customisedCls,\n ...otherProps\n } = props;\n const configContext = useContext(ConfigContext);\n const prefixCls = getPrefixCls('strength-indicator', configContext.prefixCls, customisedCls);\n const cls = classNames(prefixCls, className);\n const displayLabels: React.ReactNode[] = Array.isArray(props.labels)\n ? props.labels\n : ['Weak', 'Medium', 'Strong'];\n\n return (\n <div {...otherProps} className={cls} ref={ref} role=\"progressbar\" aria-valuenow={current} aria-valuemin={0} aria-valuemax={blocks}>\n {Array.from(new Array(blocks)).map((item, idx) => {\n const itemCls = classNames(`${prefixCls}__item`, {\n [`${prefixCls}__item_active`]: idx < current,\n });\n const bgColor = idx < current ? colors[current - 1] : undefined;\n return (\n <div key={idx} className={itemCls}>\n <div className={`${prefixCls}__inner`} style={{ backgroundColor: bgColor }} />\n {'labels' in props && (\n <div className={`${prefixCls}__label`}>{displayLabels[idx]}</div>\n )}\n </div>\n );\n })}\n </div>\n );\n }\n);\n\nStrengthIndicator.displayName = 'StrengthIndicator';\n\nexport default StrengthIndicator;\n"],"mappings":";;;;;;;;;AAMA,MAAM,oBAAoBA,MAAAA,QAAM,YAC7B,OAA+B,QAA4B;CAC1D,MAAM,EACJ,UAAU,GACV,SAAS,GACT,SAAS;EAAC;EAAW;EAAW;EAAU,EAC1C,WACA,WAAW,eACX,GAAG,eACD;CAEJ,MAAM,YAAYC,gBAAAA,aAAa,uBAAA,GAAA,MAAA,YADEC,uBAAAA,cAAc,CACoB,WAAW,cAAc;CAC5F,MAAM,OAAA,GAAA,WAAA,SAAiB,WAAW,UAAU;CAC5C,MAAM,gBAAmC,MAAM,QAAQ,MAAM,OAAO,GAChE,MAAM,SACN;EAAC;EAAQ;EAAU;EAAS;AAEhC,QACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EAAK,GAAI;EAAY,WAAW;EAAU;EAAK,MAAK;EAAc,iBAAe;EAAS,iBAAe;EAAG,iBAAe;YACxH,MAAM,KAAK,IAAI,MAAM,OAAO,CAAC,CAAC,KAAK,MAAM,QAAQ;GAChD,MAAM,WAAA,GAAA,WAAA,SAAqB,GAAG,UAAU,SAAS,GAC9C,GAAG,UAAU,iBAAiB,MAAM,SACtC,CAAC;GACF,MAAM,UAAU,MAAM,UAAU,OAAO,UAAU,KAAK,KAAA;AACtD,UACE,iBAAA,GAAA,kBAAA,MAAC,OAAD;IAAe,WAAW;cAA1B,CACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;KAAK,WAAW,GAAG,UAAU;KAAU,OAAO,EAAE,iBAAiB,SAAS;KAAI,CAAA,EAC7E,YAAY,SACX,iBAAA,GAAA,kBAAA,KAAC,OAAD;KAAK,WAAW,GAAG,UAAU;eAAW,cAAc;KAAW,CAAA,CAE/D;MALI,IAKJ;IAER;EACE,CAAA;EAGX;AAED,kBAAkB,cAAc"}
1
+ {"version":3,"file":"strength-indicator.js","names":["React","getPrefixCls","ConfigContext"],"sources":["../../src/strength-indicator/strength-indicator.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport classNames from 'classnames';\nimport { ConfigContext } from '../config-provider/config-context';\nimport { getPrefixCls } from '../_utils/general';\nimport { StrengthIndicatorProps } from './types';\n\nconst StrengthIndicator = React.forwardRef<HTMLDivElement, StrengthIndicatorProps>(\n (props: StrengthIndicatorProps, ref): React.ReactElement => {\n const {\n current = 0,\n blocks = 3,\n colors = ['#f44336', '#ff9800', '#52c41a'],\n labels,\n className,\n prefixCls: customisedCls,\n ...otherProps\n } = props;\n const configContext = useContext(ConfigContext);\n const prefixCls = getPrefixCls('strength-indicator', configContext.prefixCls, customisedCls);\n const cls = classNames(prefixCls, className);\n const showLabels = labels !== undefined;\n const displayLabels: React.ReactNode[] = Array.isArray(labels)\n ? labels\n : ['Weak', 'Medium', 'Strong'];\n\n return (\n <div {...otherProps} className={cls} ref={ref} role=\"progressbar\" aria-valuenow={current} aria-valuemin={0} aria-valuemax={blocks}>\n {Array.from(new Array(blocks)).map((item, idx) => {\n const itemCls = classNames(`${prefixCls}__item`, {\n [`${prefixCls}__item_active`]: idx < current,\n });\n const bgColor = idx < current ? colors[current - 1] : undefined;\n return (\n <div key={idx} className={itemCls}>\n <div className={`${prefixCls}__inner`} style={{ backgroundColor: bgColor }} />\n {showLabels && (\n <div className={`${prefixCls}__label`}>{displayLabels[idx]}</div>\n )}\n </div>\n );\n })}\n </div>\n );\n }\n);\n\nStrengthIndicator.displayName = 'StrengthIndicator';\n\nexport default StrengthIndicator;\n"],"mappings":";;;;;;;;;AAMA,MAAM,oBAAoBA,MAAAA,QAAM,YAC7B,OAA+B,QAA4B;CAC1D,MAAM,EACJ,UAAU,GACV,SAAS,GACT,SAAS;EAAC;EAAW;EAAW;EAAU,EAC1C,QACA,WACA,WAAW,eACX,GAAG,eACD;CAEJ,MAAM,YAAYC,gBAAAA,aAAa,uBAAA,GAAA,MAAA,YADEC,uBAAAA,cAAc,CACoB,WAAW,cAAc;CAC5F,MAAM,OAAA,GAAA,WAAA,SAAiB,WAAW,UAAU;CAC5C,MAAM,aAAa,WAAW,KAAA;CAC9B,MAAM,gBAAmC,MAAM,QAAQ,OAAO,GAC1D,SACA;EAAC;EAAQ;EAAU;EAAS;AAEhC,QACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EAAK,GAAI;EAAY,WAAW;EAAU;EAAK,MAAK;EAAc,iBAAe;EAAS,iBAAe;EAAG,iBAAe;YACxH,MAAM,KAAK,IAAI,MAAM,OAAO,CAAC,CAAC,KAAK,MAAM,QAAQ;GAChD,MAAM,WAAA,GAAA,WAAA,SAAqB,GAAG,UAAU,SAAS,GAC9C,GAAG,UAAU,iBAAiB,MAAM,SACtC,CAAC;GACF,MAAM,UAAU,MAAM,UAAU,OAAO,UAAU,KAAK,KAAA;AACtD,UACE,iBAAA,GAAA,kBAAA,MAAC,OAAD;IAAe,WAAW;cAA1B,CACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;KAAK,WAAW,GAAG,UAAU;KAAU,OAAO,EAAE,iBAAiB,SAAS;KAAI,CAAA,EAC7E,cACC,iBAAA,GAAA,kBAAA,KAAC,OAAD;KAAK,WAAW,GAAG,UAAU;eAAW,cAAc;KAAW,CAAA,CAE/D;MALI,IAKJ;IAER;EACE,CAAA;EAGX;AAED,kBAAkB,cAAc"}
@@ -36,6 +36,7 @@
36
36
  @use "../loader/style/index" as *;
37
37
  @use "../loading-bar/style/index" as *;
38
38
  @use "../keyboard/style/index" as *;
39
+ @use "../marquee/style/index" as *;
39
40
  @use "../menu/style/index" as *;
40
41
  @use "../message/style/index" as *;
41
42
  @use "../modal/style/index" as *;
@@ -270,6 +270,25 @@
270
270
  --ty-calendar-bg: #fff;
271
271
  --ty-calendar-border: #e9ecef;
272
272
  --ty-calendar-hover: #f6f9fc;
273
+ --ty-font-family: -apple-system, blinkmacsystemfont, Segoe UI, roboto, Helvetica Neue, arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;
274
+ --ty-font-family-monospace: lucida console, consolas, monaco, andale mono, ubuntu mono, monospace;
275
+ --ty-font-size-base: 1rem;
276
+ --ty-font-size-sm: 0.875rem;
277
+ --ty-font-size-lg: 1.25rem;
278
+ --ty-font-weight: 400;
279
+ --ty-line-height-base: 1.5;
280
+ --ty-headings-font-weight: 500;
281
+ --ty-h1-font-size: 2.5rem;
282
+ --ty-h2-font-size: 2rem;
283
+ --ty-h3-font-size: 1.75rem;
284
+ --ty-h4-font-size: 1.5rem;
285
+ --ty-h5-font-size: 1.25rem;
286
+ --ty-h6-font-size: 1rem;
287
+ --ty-border-radius: 2px;
288
+ --ty-height-sm: 24px;
289
+ --ty-height-md: 32px;
290
+ --ty-height-lg: 42px;
291
+ --ty-spacer: 1rem;
273
292
  }
274
293
 
275
294
  html[data-tiny-theme=dark] {
@@ -544,6 +563,25 @@ html[data-tiny-theme=dark] {
544
563
  --ty-calendar-bg: #1f1f1f;
545
564
  --ty-calendar-border: #363636;
546
565
  --ty-calendar-hover: #2a2a2a;
566
+ --ty-font-family: -apple-system, blinkmacsystemfont, Segoe UI, roboto, Helvetica Neue, arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;
567
+ --ty-font-family-monospace: lucida console, consolas, monaco, andale mono, ubuntu mono, monospace;
568
+ --ty-font-size-base: 1rem;
569
+ --ty-font-size-sm: 0.875rem;
570
+ --ty-font-size-lg: 1.25rem;
571
+ --ty-font-weight: 400;
572
+ --ty-line-height-base: 1.5;
573
+ --ty-headings-font-weight: 500;
574
+ --ty-h1-font-size: 2.5rem;
575
+ --ty-h2-font-size: 2rem;
576
+ --ty-h3-font-size: 1.75rem;
577
+ --ty-h4-font-size: 1.5rem;
578
+ --ty-h5-font-size: 1.25rem;
579
+ --ty-h6-font-size: 1rem;
580
+ --ty-border-radius: 2px;
581
+ --ty-height-sm: 24px;
582
+ --ty-height-md: 32px;
583
+ --ty-height-lg: 42px;
584
+ --ty-spacer: 1rem;
547
585
  }
548
586
 
549
587
  @media (prefers-color-scheme: dark) {
@@ -819,6 +857,25 @@ html[data-tiny-theme=dark] {
819
857
  --ty-calendar-bg: #1f1f1f;
820
858
  --ty-calendar-border: #363636;
821
859
  --ty-calendar-hover: #2a2a2a;
860
+ --ty-font-family: -apple-system, blinkmacsystemfont, Segoe UI, roboto, Helvetica Neue, arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;
861
+ --ty-font-family-monospace: lucida console, consolas, monaco, andale mono, ubuntu mono, monospace;
862
+ --ty-font-size-base: 1rem;
863
+ --ty-font-size-sm: 0.875rem;
864
+ --ty-font-size-lg: 1.25rem;
865
+ --ty-font-weight: 400;
866
+ --ty-line-height-base: 1.5;
867
+ --ty-headings-font-weight: 500;
868
+ --ty-h1-font-size: 2.5rem;
869
+ --ty-h2-font-size: 2rem;
870
+ --ty-h3-font-size: 1.75rem;
871
+ --ty-h4-font-size: 1.5rem;
872
+ --ty-h5-font-size: 1.25rem;
873
+ --ty-h6-font-size: 1rem;
874
+ --ty-border-radius: 2px;
875
+ --ty-height-sm: 24px;
876
+ --ty-height-md: 32px;
877
+ --ty-height-lg: 42px;
878
+ --ty-spacer: 1rem;
822
879
  }
823
880
  }
824
881
  /* stylelint-disable scss/comment-no-empty */
@@ -2,7 +2,7 @@
2
2
 
3
3
  .#{$prefix}-table {
4
4
  color: var(--ty-color-text, #{$gray-800});
5
- font-size: $font-size-base;
5
+ font-size: var(--ty-font-size-base);
6
6
 
7
7
  &__wrapper {
8
8
  overflow-x: auto;
@@ -24,8 +24,8 @@
24
24
 
25
25
  // Sizes
26
26
  &_sm &__cell {
27
- padding: 8px 8px;
28
- font-size: $font-size-sm;
27
+ padding: 8px;
28
+ font-size: var(--ty-font-size-sm);
29
29
  }
30
30
 
31
31
  &_md &__cell {
@@ -33,8 +33,8 @@
33
33
  }
34
34
 
35
35
  &_lg &__cell {
36
- padding: 16px 16px;
37
- font-size: $font-size-lg;
36
+ padding: 16px;
37
+ font-size: var(--ty-font-size-lg);
38
38
  }
39
39
 
40
40
  // Sticky header for virtual scroll
@@ -99,7 +99,7 @@
99
99
  }
100
100
 
101
101
  &_selected {
102
- background: var(--ty-table-selected-bg, rgba(110, 65, 191, 0.06));
102
+ background: var(--ty-table-selected-bg, rgb(110 65 191 / 6%));
103
103
  }
104
104
  }
105
105
 
@@ -1,6 +1,6 @@
1
1
  .ty-table {
2
2
  color: var(--ty-color-text, #32325d);
3
- font-size: 1rem;
3
+ font-size: var(--ty-font-size-base);
4
4
  }
5
5
  .ty-table__wrapper {
6
6
  overflow-x: auto;
@@ -17,15 +17,15 @@
17
17
  border: 1px solid var(--ty-table-border, #dee2e6);
18
18
  }
19
19
  .ty-table_sm .ty-table__cell {
20
- padding: 8px 8px;
21
- font-size: 0.875rem;
20
+ padding: 8px;
21
+ font-size: var(--ty-font-size-sm);
22
22
  }
23
23
  .ty-table_md .ty-table__cell {
24
24
  padding: 12px 16px;
25
25
  }
26
26
  .ty-table_lg .ty-table__cell {
27
- padding: 16px 16px;
28
- font-size: 1.25rem;
27
+ padding: 16px;
28
+ font-size: var(--ty-font-size-lg);
29
29
  }
30
30
  .ty-table__thead_sticky {
31
31
  position: sticky;
@@ -7,7 +7,7 @@
7
7
  padding: 3px 7px;
8
8
  font-size: 12px;
9
9
  border: 1px solid var(--ty-tag-border);
10
- border-radius: 2px;
10
+ border-radius: var(--ty-border-radius);
11
11
  color: var(--ty-color-text);
12
12
  background: var(--ty-tag-bg);
13
13
  }
package/lib/tag/tag.js CHANGED
@@ -9,8 +9,8 @@ classnames = require_runtime.__toESM(classnames);
9
9
  let react_jsx_runtime = require("react/jsx-runtime");
10
10
  //#region src/tag/tag.tsx
11
11
  const Tag = react.default.memo((0, react.forwardRef)((props, ref) => {
12
- const { closable = false, defaultVisible = true, prefixCls: customisedCls, color, onClose, onClick, className, style, children, ...otherProps } = props;
13
- const [visible, setVisible] = (0, react.useState)("visible" in props ? props.visible : defaultVisible);
12
+ const { closable = false, visible: visibleProp, defaultVisible = true, prefixCls: customisedCls, color, onClose, onClick, className, style, children, ...otherProps } = props;
13
+ const [visible, setVisible] = (0, react.useState)(visibleProp !== void 0 ? visibleProp : defaultVisible);
14
14
  const prefixCls = require_general.getPrefixCls("tag", (0, react.useContext)(require_config_context.ConfigContext).prefixCls, customisedCls);
15
15
  const cls = (0, classnames.default)(prefixCls, className, {
16
16
  [`${prefixCls}_${color}`]: color && require_types.PresetColors.includes(color),
@@ -24,7 +24,7 @@ const Tag = react.default.memo((0, react.forwardRef)((props, ref) => {
24
24
  const closeBtnOnClick = (e) => {
25
25
  onClose && onClose(e);
26
26
  if (e.defaultPrevented) return;
27
- !("visible" in props) && setVisible(false);
27
+ visibleProp === void 0 && setVisible(false);
28
28
  };
29
29
  const tagStyle = {
30
30
  backgroundColor: color ? require_types.PresetColors.includes(color) ? void 0 : color : void 0,
@@ -33,8 +33,8 @@ const Tag = react.default.memo((0, react.forwardRef)((props, ref) => {
33
33
  ...style
34
34
  };
35
35
  (0, react.useEffect)(() => {
36
- "visible" in props && setVisible(props.visible);
37
- }, [props]);
36
+ if (visibleProp !== void 0) setVisible(visibleProp);
37
+ }, [visibleProp]);
38
38
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
39
39
  ...otherProps,
40
40
  ref,
@@ -1 +1 @@
1
- {"version":3,"file":"tag.js","names":["React","getPrefixCls","ConfigContext","PresetColors"],"sources":["../../src/tag/tag.tsx"],"sourcesContent":["import React, { useState, useEffect, MouseEvent, useContext, forwardRef } from 'react';\nimport classNames from 'classnames';\nimport { ConfigContext } from '../config-provider/config-context';\nimport { getPrefixCls } from '../_utils/general';\nimport { PresetColors, TagProps } from './types';\n\nconst Tag = React.memo(forwardRef<HTMLDivElement, TagProps>((props, ref) => {\n const {\n closable = false,\n defaultVisible = true,\n prefixCls: customisedCls,\n color,\n onClose,\n onClick,\n className,\n style,\n children,\n ...otherProps\n } = props;\n const [visible, setVisible] = useState<boolean>(\n 'visible' in props ? (props.visible as boolean) : defaultVisible\n );\n const configContext = useContext(ConfigContext);\n const prefixCls = getPrefixCls('tag', configContext.prefixCls, customisedCls);\n const cls = classNames(prefixCls, className, {\n [`${prefixCls}_${color}`]: color && PresetColors.includes(color),\n [`${prefixCls}_visible`]: visible,\n [`${prefixCls}_closeable`]: closable,\n });\n\n /**\n * Callback when the close button is clicked.\n * @param e\n */\n const closeBtnOnClick = (e: MouseEvent<HTMLSpanElement>): void => {\n onClose && onClose(e);\n if (e.defaultPrevented) {\n return;\n }\n !('visible' in props) && setVisible(false);\n };\n\n const tagStyle: React.CSSProperties = {\n backgroundColor: color ? (PresetColors.includes(color) ? undefined : color) : undefined,\n borderColor: color ? (PresetColors.includes(color) ? undefined : color) : undefined,\n color: color ? (PresetColors.includes(color) ? undefined : '#fff') : undefined,\n ...style,\n };\n\n useEffect(() => {\n 'visible' in props && setVisible(props.visible as boolean);\n }, [props]);\n\n return (\n <div {...otherProps} ref={ref} className={cls} style={tagStyle} onClick={onClick}>\n {children}\n {closable && (\n <button type=\"button\" className={`${prefixCls}__close-btn`} onClick={closeBtnOnClick} aria-label=\"Remove\">\n ✕\n </button>\n )}\n </div>\n );\n}));\n\nTag.displayName = 'Tag';\n\nexport default Tag;\n"],"mappings":";;;;;;;;;;AAMA,MAAM,MAAMA,MAAAA,QAAM,MAAA,GAAA,MAAA,aAA2C,OAAO,QAAQ;CAC1E,MAAM,EACJ,WAAW,OACX,iBAAiB,MACjB,WAAW,eACX,OACA,SACA,SACA,WACA,OACA,UACA,GAAG,eACD;CACJ,MAAM,CAAC,SAAS,eAAA,GAAA,MAAA,UACd,aAAa,QAAS,MAAM,UAAsB,eACnD;CAED,MAAM,YAAYC,gBAAAA,aAAa,QAAA,GAAA,MAAA,YADEC,uBAAAA,cAAc,CACK,WAAW,cAAc;CAC7E,MAAM,OAAA,GAAA,WAAA,SAAiB,WAAW,WAAW;GAC1C,GAAG,UAAU,GAAG,UAAU,SAASC,cAAAA,aAAa,SAAS,MAAM;GAC/D,GAAG,UAAU,YAAY;GACzB,GAAG,UAAU,cAAc;EAC7B,CAAC;;;;;CAMF,MAAM,mBAAmB,MAAyC;AAChE,aAAW,QAAQ,EAAE;AACrB,MAAI,EAAE,iBACJ;AAEF,IAAE,aAAa,UAAU,WAAW,MAAM;;CAG5C,MAAM,WAAgC;EACpC,iBAAiB,QAASA,cAAAA,aAAa,SAAS,MAAM,GAAG,KAAA,IAAY,QAAS,KAAA;EAC9E,aAAa,QAASA,cAAAA,aAAa,SAAS,MAAM,GAAG,KAAA,IAAY,QAAS,KAAA;EAC1E,OAAO,QAASA,cAAAA,aAAa,SAAS,MAAM,GAAG,KAAA,IAAY,SAAU,KAAA;EACrE,GAAG;EACJ;AAED,EAAA,GAAA,MAAA,iBAAgB;AACd,eAAa,SAAS,WAAW,MAAM,QAAmB;IACzD,CAAC,MAAM,CAAC;AAEX,QACE,iBAAA,GAAA,kBAAA,MAAC,OAAD;EAAK,GAAI;EAAiB;EAAK,WAAW;EAAK,OAAO;EAAmB;YAAzE,CACG,UACA,YACC,iBAAA,GAAA,kBAAA,KAAC,UAAD;GAAQ,MAAK;GAAS,WAAW,GAAG,UAAU;GAAc,SAAS;GAAiB,cAAW;aAAS;GAEjG,CAAA,CAEP;;EAER,CAAC;AAEH,IAAI,cAAc"}
1
+ {"version":3,"file":"tag.js","names":["React","getPrefixCls","ConfigContext","PresetColors"],"sources":["../../src/tag/tag.tsx"],"sourcesContent":["import React, { useState, useEffect, MouseEvent, useContext, forwardRef } from 'react';\nimport classNames from 'classnames';\nimport { ConfigContext } from '../config-provider/config-context';\nimport { getPrefixCls } from '../_utils/general';\nimport { PresetColors, TagProps } from './types';\n\nconst Tag = React.memo(forwardRef<HTMLDivElement, TagProps>((props, ref) => {\n const {\n closable = false,\n visible: visibleProp,\n defaultVisible = true,\n prefixCls: customisedCls,\n color,\n onClose,\n onClick,\n className,\n style,\n children,\n ...otherProps\n } = props;\n const [visible, setVisible] = useState<boolean>(\n visibleProp !== undefined ? visibleProp : defaultVisible\n );\n const configContext = useContext(ConfigContext);\n const prefixCls = getPrefixCls('tag', configContext.prefixCls, customisedCls);\n const cls = classNames(prefixCls, className, {\n [`${prefixCls}_${color}`]: color && PresetColors.includes(color),\n [`${prefixCls}_visible`]: visible,\n [`${prefixCls}_closeable`]: closable,\n });\n\n /**\n * Callback when the close button is clicked.\n * @param e\n */\n const closeBtnOnClick = (e: MouseEvent<HTMLSpanElement>): void => {\n onClose && onClose(e);\n if (e.defaultPrevented) {\n return;\n }\n visibleProp === undefined && setVisible(false);\n };\n\n const tagStyle: React.CSSProperties = {\n backgroundColor: color ? (PresetColors.includes(color) ? undefined : color) : undefined,\n borderColor: color ? (PresetColors.includes(color) ? undefined : color) : undefined,\n color: color ? (PresetColors.includes(color) ? undefined : '#fff') : undefined,\n ...style,\n };\n\n useEffect(() => {\n if (visibleProp !== undefined) setVisible(visibleProp);\n }, [visibleProp]);\n\n return (\n <div {...otherProps} ref={ref} className={cls} style={tagStyle} onClick={onClick}>\n {children}\n {closable && (\n <button type=\"button\" className={`${prefixCls}__close-btn`} onClick={closeBtnOnClick} aria-label=\"Remove\">\n ✕\n </button>\n )}\n </div>\n );\n}));\n\nTag.displayName = 'Tag';\n\nexport default Tag;\n"],"mappings":";;;;;;;;;;AAMA,MAAM,MAAMA,MAAAA,QAAM,MAAA,GAAA,MAAA,aAA2C,OAAO,QAAQ;CAC1E,MAAM,EACJ,WAAW,OACX,SAAS,aACT,iBAAiB,MACjB,WAAW,eACX,OACA,SACA,SACA,WACA,OACA,UACA,GAAG,eACD;CACJ,MAAM,CAAC,SAAS,eAAA,GAAA,MAAA,UACd,gBAAgB,KAAA,IAAY,cAAc,eAC3C;CAED,MAAM,YAAYC,gBAAAA,aAAa,QAAA,GAAA,MAAA,YADEC,uBAAAA,cAAc,CACK,WAAW,cAAc;CAC7E,MAAM,OAAA,GAAA,WAAA,SAAiB,WAAW,WAAW;GAC1C,GAAG,UAAU,GAAG,UAAU,SAASC,cAAAA,aAAa,SAAS,MAAM;GAC/D,GAAG,UAAU,YAAY;GACzB,GAAG,UAAU,cAAc;EAC7B,CAAC;;;;;CAMF,MAAM,mBAAmB,MAAyC;AAChE,aAAW,QAAQ,EAAE;AACrB,MAAI,EAAE,iBACJ;AAEF,kBAAgB,KAAA,KAAa,WAAW,MAAM;;CAGhD,MAAM,WAAgC;EACpC,iBAAiB,QAASA,cAAAA,aAAa,SAAS,MAAM,GAAG,KAAA,IAAY,QAAS,KAAA;EAC9E,aAAa,QAASA,cAAAA,aAAa,SAAS,MAAM,GAAG,KAAA,IAAY,QAAS,KAAA;EAC1E,OAAO,QAASA,cAAAA,aAAa,SAAS,MAAM,GAAG,KAAA,IAAY,SAAU,KAAA;EACrE,GAAG;EACJ;AAED,EAAA,GAAA,MAAA,iBAAgB;AACd,MAAI,gBAAgB,KAAA,EAAW,YAAW,YAAY;IACrD,CAAC,YAAY,CAAC;AAEjB,QACE,iBAAA,GAAA,kBAAA,MAAC,OAAD;EAAK,GAAI;EAAiB;EAAK,WAAW;EAAK,OAAO;EAAmB;YAAzE,CACG,UACA,YACC,iBAAA,GAAA,kBAAA,KAAC,UAAD;GAAQ,MAAK;GAAS,WAAW,GAAG,UAAU;GAAc,SAAS;GAAiB,cAAW;aAAS;GAEjG,CAAA,CAEP;;EAER,CAAC;AAEH,IAAI,cAAc"}
@@ -6,8 +6,8 @@
6
6
  border: 1px solid var(--ty-input-border);
7
7
  transition: all 0.3s;
8
8
  outline: 0;
9
- border-radius: 2px;
10
- font-size: 1rem;
9
+ border-radius: var(--ty-border-radius);
10
+ font-size: var(--ty-font-size-base);
11
11
  background-color: var(--ty-input-bg);
12
12
  }
13
13
  .ty-textarea:hover {
@@ -5,7 +5,7 @@ $tp: #{$prefix}-time-picker;
5
5
  .#{$tp} {
6
6
  display: inline-flex;
7
7
  position: relative;
8
- font-size: $font-size-base;
8
+ font-size: var(--ty-font-size-base);
9
9
 
10
10
  // ---- Input ----
11
11
  &__input {
@@ -1,7 +1,7 @@
1
1
  .ty-time-picker {
2
2
  display: inline-flex;
3
3
  position: relative;
4
- font-size: 1rem;
4
+ font-size: var(--ty-font-size-base);
5
5
  }
6
6
  .ty-time-picker__input {
7
7
  display: inline-flex;