@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
package/lib/index.js CHANGED
@@ -47,43 +47,44 @@ const require_index$41 = require("./pagination/index.js");
47
47
  const require_index$42 = require("./list/index.js");
48
48
  const require_index$43 = require("./loader/index.js");
49
49
  const require_index$44 = require("./loading-bar/index.js");
50
- const require_index$45 = require("./menu/index.js");
51
- const require_index$46 = require("./message/index.js");
52
- const require_index$47 = require("./native-select/index.js");
53
- const require_index$48 = require("./row/index.js");
54
- const require_index$49 = require("./modal/index.js");
55
- const require_index$50 = require("./notification/index.js");
56
- const require_index$51 = require("./popover/index.js");
57
- const require_index$52 = require("./pop-confirm/index.js");
58
- const require_index$53 = require("./progress/index.js");
59
- const require_index$54 = require("./radio/index.js");
60
- const require_index$55 = require("./rate/index.js");
61
- const require_index$56 = require("./result/index.js");
62
- const require_index$57 = require("./scroll-indicator/index.js");
63
- const require_index$58 = require("./segmented/index.js");
64
- const require_index$59 = require("./select/index.js");
65
- const require_index$60 = require("./skeleton/index.js");
66
- const require_index$61 = require("./tooltip/index.js");
67
- const require_index$62 = require("./slider/index.js");
68
- const require_index$63 = require("./split/index.js");
69
- const require_index$64 = require("./split-button/index.js");
70
- const require_index$65 = require("./space/index.js");
71
- const require_index$66 = require("./speed-dial/index.js");
72
- const require_index$67 = require("./steps/index.js");
73
- const require_index$68 = require("./statistic/index.js");
74
- const require_index$69 = require("./strength-indicator/index.js");
75
- const require_index$70 = require("./switch/index.js");
76
- const require_index$71 = require("./table/index.js");
77
- const require_index$72 = require("./tabs/index.js");
78
- const require_index$73 = require("./tag/index.js");
79
- const require_index$74 = require("./textarea/index.js");
80
- const require_index$75 = require("./timeline/index.js");
81
- const require_index$76 = require("./time-picker/index.js");
82
- const require_index$77 = require("./transfer/index.js");
83
- const require_index$78 = require("./tree/index.js");
84
- const require_index$79 = require("./typography/index.js");
85
- const require_index$80 = require("./upload/index.js");
86
- const require_index$81 = require("./waterfall/index.js");
50
+ const require_index$45 = require("./marquee/index.js");
51
+ const require_index$46 = require("./menu/index.js");
52
+ const require_index$47 = require("./message/index.js");
53
+ const require_index$48 = require("./native-select/index.js");
54
+ const require_index$49 = require("./row/index.js");
55
+ const require_index$50 = require("./modal/index.js");
56
+ const require_index$51 = require("./notification/index.js");
57
+ const require_index$52 = require("./popover/index.js");
58
+ const require_index$53 = require("./pop-confirm/index.js");
59
+ const require_index$54 = require("./progress/index.js");
60
+ const require_index$55 = require("./radio/index.js");
61
+ const require_index$56 = require("./rate/index.js");
62
+ const require_index$57 = require("./result/index.js");
63
+ const require_index$58 = require("./scroll-indicator/index.js");
64
+ const require_index$59 = require("./segmented/index.js");
65
+ const require_index$60 = require("./select/index.js");
66
+ const require_index$61 = require("./skeleton/index.js");
67
+ const require_index$62 = require("./tooltip/index.js");
68
+ const require_index$63 = require("./slider/index.js");
69
+ const require_index$64 = require("./split/index.js");
70
+ const require_index$65 = require("./split-button/index.js");
71
+ const require_index$66 = require("./space/index.js");
72
+ const require_index$67 = require("./speed-dial/index.js");
73
+ const require_index$68 = require("./steps/index.js");
74
+ const require_index$69 = require("./statistic/index.js");
75
+ const require_index$70 = require("./strength-indicator/index.js");
76
+ const require_index$71 = require("./switch/index.js");
77
+ const require_index$72 = require("./table/index.js");
78
+ const require_index$73 = require("./tabs/index.js");
79
+ const require_index$74 = require("./tag/index.js");
80
+ const require_index$75 = require("./textarea/index.js");
81
+ const require_index$76 = require("./timeline/index.js");
82
+ const require_index$77 = require("./time-picker/index.js");
83
+ const require_index$78 = require("./transfer/index.js");
84
+ const require_index$79 = require("./tree/index.js");
85
+ const require_index$80 = require("./typography/index.js");
86
+ const require_index$81 = require("./upload/index.js");
87
+ const require_index$82 = require("./waterfall/index.js");
87
88
  const require_with_locale = require("./intl-provider/with-locale.js");
88
89
  const require_with_spin = require("./with-spin/with-spin.js");
89
90
  const require_zh_CN = require("./locale/zh_CN.js");
@@ -129,47 +130,48 @@ exports.Link = require_index$40;
129
130
  exports.List = require_index$42;
130
131
  exports.Loader = require_index$43;
131
132
  exports.LoadingBar = require_index$44;
132
- exports.Menu = require_index$45;
133
- exports.Message = require_index$46;
134
- exports.Modal = require_index$49;
135
- exports.NativeSelect = require_index$47;
136
- exports.Notification = require_index$50;
133
+ exports.Marquee = require_index$45;
134
+ exports.Menu = require_index$46;
135
+ exports.Message = require_index$47;
136
+ exports.Modal = require_index$50;
137
+ exports.NativeSelect = require_index$48;
138
+ exports.Notification = require_index$51;
137
139
  exports.Overlay = require_index$27;
138
140
  exports.Pagination = require_index$41;
139
- exports.PopConfirm = require_index$52;
140
- exports.Popover = require_index$51;
141
- exports.Progress = require_index$53;
142
- exports.Radio = require_index$54;
143
- exports.Rate = require_index$55;
144
- exports.Result = require_index$56;
145
- exports.Row = require_index$48;
146
- exports.ScrollIndicator = require_index$57;
147
- exports.Segmented = require_index$58;
148
- exports.Select = require_index$59;
149
- exports.Skeleton = require_index$60;
150
- exports.Slider = require_index$62;
151
- exports.Space = require_index$65;
152
- exports.SpeedDial = require_index$66;
153
- exports.Split = require_index$63;
154
- exports.SplitButton = require_index$64;
155
- exports.Statistic = require_index$68;
156
- exports.Steps = require_index$67;
141
+ exports.PopConfirm = require_index$53;
142
+ exports.Popover = require_index$52;
143
+ exports.Progress = require_index$54;
144
+ exports.Radio = require_index$55;
145
+ exports.Rate = require_index$56;
146
+ exports.Result = require_index$57;
147
+ exports.Row = require_index$49;
148
+ exports.ScrollIndicator = require_index$58;
149
+ exports.Segmented = require_index$59;
150
+ exports.Select = require_index$60;
151
+ exports.Skeleton = require_index$61;
152
+ exports.Slider = require_index$63;
153
+ exports.Space = require_index$66;
154
+ exports.SpeedDial = require_index$67;
155
+ exports.Split = require_index$64;
156
+ exports.SplitButton = require_index$65;
157
+ exports.Statistic = require_index$69;
158
+ exports.Steps = require_index$68;
157
159
  exports.Sticky = require_index$2;
158
- exports.StrengthIndicator = require_index$69;
159
- exports.Switch = require_index$70;
160
- exports.Table = require_index$71;
161
- exports.Tabs = require_index$72;
162
- exports.Tag = require_index$73;
163
- exports.Textarea = require_index$74;
164
- exports.TimePicker = require_index$76;
165
- exports.Timeline = require_index$75;
166
- exports.Tooltip = require_index$61;
167
- exports.Transfer = require_index$77;
160
+ exports.StrengthIndicator = require_index$70;
161
+ exports.Switch = require_index$71;
162
+ exports.Table = require_index$72;
163
+ exports.Tabs = require_index$73;
164
+ exports.Tag = require_index$74;
165
+ exports.Textarea = require_index$75;
166
+ exports.TimePicker = require_index$77;
167
+ exports.Timeline = require_index$76;
168
+ exports.Tooltip = require_index$62;
169
+ exports.Transfer = require_index$78;
168
170
  exports.Transition = require_index;
169
- exports.Tree = require_index$78;
170
- exports.Typography = require_index$79;
171
- exports.Upload = require_index$80;
172
- exports.Waterfall = require_index$81;
171
+ exports.Tree = require_index$79;
172
+ exports.Typography = require_index$80;
173
+ exports.Upload = require_index$81;
174
+ exports.Waterfall = require_index$82;
173
175
  exports.en_US = require_en_US;
174
176
  exports.useLocale = require_use_locale.useLocale;
175
177
  exports.useTheme = require_use_theme.useTheme;
@@ -4,10 +4,11 @@
4
4
  .#{$prefix}-input {
5
5
  position: relative;
6
6
  box-sizing: border-box;
7
+ width: 100%;
7
8
  color: var(--ty-color-text);
8
9
 
9
10
  &__input {
10
- @include input-default();
11
+ @include input-default;
11
12
  }
12
13
 
13
14
  &__prefix,
@@ -77,7 +78,7 @@
77
78
 
78
79
  &_disabled {
79
80
  .#{$prefix}-input__input {
80
- @include input-default-disabled();
81
+ @include input-default-disabled;
81
82
  }
82
83
  }
83
84
  }
@@ -124,7 +125,7 @@
124
125
  }
125
126
  }
126
127
 
127
- &:not(:first-child):not(:last-child) {
128
+ &:not(:first-child, :last-child) {
128
129
  .#{$prefix}-input__input {
129
130
  border-radius: 0;
130
131
  }
@@ -166,7 +167,7 @@
166
167
  border-top-left-radius: 0;
167
168
  }
168
169
 
169
- &:not(:first-child):not(:last-child) {
170
+ &:not(:first-child, :last-child) {
170
171
  border-radius: 0;
171
172
  border-left: 0;
172
173
  border-right: 0;
@@ -10,7 +10,7 @@
10
10
  transition: all 0.3s;
11
11
  outline: 0;
12
12
  border-radius: $input-border-radius;
13
- font-size: $font-size-base;
13
+ font-size: var(--ty-font-size-base);
14
14
  background-color: var(--ty-input-bg);
15
15
 
16
16
  &:hover {
@@ -1,6 +1,7 @@
1
1
  .ty-input {
2
2
  position: relative;
3
3
  box-sizing: border-box;
4
+ width: 100%;
4
5
  color: var(--ty-color-text);
5
6
  }
6
7
  .ty-input__input {
@@ -11,8 +12,8 @@
11
12
  border: 1px solid var(--ty-input-border);
12
13
  transition: all 0.3s;
13
14
  outline: 0;
14
- border-radius: 2px;
15
- font-size: 1rem;
15
+ border-radius: var(--ty-border-radius);
16
+ font-size: var(--ty-font-size-base);
16
17
  background-color: var(--ty-input-bg);
17
18
  }
18
19
  .ty-input__input:hover {
@@ -51,25 +52,25 @@
51
52
  cursor: pointer;
52
53
  }
53
54
  .ty-input_sm .ty-input__input {
54
- font-size: 0.875rem;
55
- height: 24px;
56
- line-height: 24px;
55
+ font-size: var(--ty-font-size-sm);
56
+ height: var(--ty-height-sm);
57
+ line-height: var(--ty-height-sm);
57
58
  }
58
59
  .ty-input_sm .ty-input__clear-btn {
59
60
  transform: scale(0.7);
60
61
  }
61
62
  .ty-input_md .ty-input__input {
62
- font-size: 1rem;
63
- height: 32px;
64
- line-height: 32px;
63
+ font-size: var(--ty-font-size-base);
64
+ height: var(--ty-height-md);
65
+ line-height: var(--ty-height-md);
65
66
  }
66
67
  .ty-input_md .ty-input__clear-btn {
67
68
  transform: scale(0.8);
68
69
  }
69
70
  .ty-input_lg .ty-input__input {
70
- font-size: 1.25rem;
71
- height: 42px;
72
- line-height: 42px;
71
+ font-size: var(--ty-font-size-lg);
72
+ height: var(--ty-height-lg);
73
+ line-height: var(--ty-height-lg);
73
74
  }
74
75
  .ty-input_disabled .ty-input__input {
75
76
  cursor: not-allowed;
@@ -92,13 +93,13 @@
92
93
  justify-content: center;
93
94
  }
94
95
  .ty-input-group_sm {
95
- height: 24px;
96
+ height: var(--ty-height-sm);
96
97
  }
97
98
  .ty-input-group_md {
98
- height: 32px;
99
+ height: var(--ty-height-md);
99
100
  }
100
101
  .ty-input-group_lg {
101
- height: 42px;
102
+ height: var(--ty-height-lg);
102
103
  }
103
104
  .ty-input-group .ty-input {
104
105
  z-index: 1;
@@ -112,7 +113,7 @@
112
113
  border-top-left-radius: 0;
113
114
  border-bottom-left-radius: 0;
114
115
  }
115
- .ty-input-group .ty-input:not(:first-child):not(:last-child) .ty-input__input {
116
+ .ty-input-group .ty-input:not(:first-child, :last-child) .ty-input__input {
116
117
  border-radius: 0;
117
118
  }
118
119
 
@@ -122,18 +123,18 @@
122
123
  box-sizing: border-box;
123
124
  text-align: center;
124
125
  line-height: 1;
125
- border-radius: 2px;
126
+ border-radius: var(--ty-border-radius);
126
127
  color: var(--ty-color-text);
127
128
  padding: 0 7px;
128
129
  }
129
130
  .ty-input-group-addon_sm {
130
- font-size: 0.875rem;
131
+ font-size: var(--ty-font-size-sm);
131
132
  }
132
133
  .ty-input-group-addon_md {
133
- font-size: 1rem;
134
+ font-size: var(--ty-font-size-base);
134
135
  }
135
136
  .ty-input-group-addon_lg {
136
- font-size: 1.25rem;
137
+ font-size: var(--ty-font-size-lg);
137
138
  }
138
139
  .ty-input-group-addon:first-child {
139
140
  border-right: 0;
@@ -145,7 +146,7 @@
145
146
  border-bottom-left-radius: 0;
146
147
  border-top-left-radius: 0;
147
148
  }
148
- .ty-input-group-addon:not(:first-child):not(:last-child) {
149
+ .ty-input-group-addon:not(:first-child, :last-child) {
149
150
  border-radius: 0;
150
151
  border-left: 0;
151
152
  border-right: 0;
@@ -15,8 +15,12 @@ let react_jsx_runtime = require("react/jsx-runtime");
15
15
  const isValid = (val) => {
16
16
  return !isNaN(+val);
17
17
  };
18
+ const getDecimalPrecision = (num) => {
19
+ const str = String(num);
20
+ const dotIndex = str.indexOf(".");
21
+ return dotIndex === -1 ? 0 : str.length - dotIndex - 1;
22
+ };
18
23
  const toPrecision = (val, precision) => {
19
- if (precision === void 0) return val;
20
24
  return parseFloat(val.toFixed(precision));
21
25
  };
22
26
  const InputNumber = react.default.forwardRef((props, ref) => {
@@ -27,16 +31,18 @@ const InputNumber = react.default.forwardRef((props, ref) => {
27
31
  [`${prefixCls}_disabled`]: disabled,
28
32
  [`${prefixCls}_always-controls`]: controls
29
33
  });
34
+ const resolvedPrecision = precision ?? Math.max(getDecimalPrecision(step), getDecimalPrecision(defaultValue));
30
35
  const [value, setValue] = (0, react.useState)("value" in props ? props.value : defaultValue);
31
36
  const inputOnChange = (e) => {
32
- const val = toPrecision(Number(e.target.value.trim()), precision);
37
+ const raw = Number(e.target.value.trim());
38
+ const val = resolvedPrecision > 0 ? toPrecision(raw, resolvedPrecision) : raw;
33
39
  !("value" in props) && setValue(val);
34
40
  onChange && isValid(val) && onChange(val, e);
35
41
  };
36
42
  const plusOnClick = (e) => {
37
43
  e.stopPropagation();
38
44
  if (!disabled && isValid(step)) {
39
- const val = toPrecision(+value + +step, precision);
45
+ const val = toPrecision(+value + +step, resolvedPrecision);
40
46
  if (val <= max) {
41
47
  !("value" in props) && setValue(val);
42
48
  onChange && onChange(val, e);
@@ -46,7 +52,7 @@ const InputNumber = react.default.forwardRef((props, ref) => {
46
52
  const minusOnClick = (e) => {
47
53
  e.stopPropagation();
48
54
  if (!disabled && isValid(step)) {
49
- const val = toPrecision(+value - +step, precision);
55
+ const val = toPrecision(+value - +step, resolvedPrecision);
50
56
  if (val >= min) {
51
57
  !("value" in props) && setValue(val);
52
58
  onChange && onChange(val, e);
@@ -63,7 +69,7 @@ const InputNumber = react.default.forwardRef((props, ref) => {
63
69
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
64
70
  autoComplete: "off",
65
71
  disabled,
66
- value: precision !== void 0 ? value.toFixed(precision) : value,
72
+ value: resolvedPrecision > 0 ? value.toFixed(resolvedPrecision) : value,
67
73
  type: "number",
68
74
  className: `${prefixCls}__input`,
69
75
  max,
@@ -1 +1 @@
1
- {"version":3,"file":"input-number.js","names":["React","ConfigContext","getPrefixCls","ArrowDown"],"sources":["../../src/input-number/input-number.tsx"],"sourcesContent":["import React, { useEffect, useState, MouseEvent, useContext } from 'react';\nimport classNames from 'classnames';\nimport { ConfigContext } from '../config-provider/config-context';\nimport { getPrefixCls } from '../_utils/general';\nimport { InputNumberProps } from './types';\nimport { ArrowDown } from '../_utils/components';\n\n/**\n * Valid the string is a number\n * @param val\n */\nconst isValid = (val: string | number): boolean => {\n return !isNaN(+val);\n};\n\nconst toPrecision = (val: number, precision?: number): number => {\n if (precision === undefined) return val;\n return parseFloat(val.toFixed(precision));\n};\n\nconst InputNumber = React.forwardRef<HTMLDivElement, InputNumberProps>((props, ref) => {\n const {\n size = 'md',\n disabled = false,\n defaultValue = 0,\n step = 1,\n precision,\n controls = false,\n min = Number.NEGATIVE_INFINITY,\n max = Number.POSITIVE_INFINITY,\n onChange,\n className,\n prefixCls: customisedCls,\n style,\n } = props;\n const configContext = useContext(ConfigContext);\n const prefixCls = getPrefixCls('input-number', configContext.prefixCls, customisedCls);\n const inputSize = props.size || configContext.componentSize || size;\n const cls = classNames(prefixCls, className, `${prefixCls}_${inputSize}`, {\n [`${prefixCls}_disabled`]: disabled,\n [`${prefixCls}_always-controls`]: controls,\n });\n const [value, setValue] = useState<number>(\n 'value' in props ? (props.value as number) : defaultValue\n );\n\n const inputOnChange = (e: React.ChangeEvent<HTMLInputElement>): void => {\n const raw = Number(e.target.value.trim());\n const val = toPrecision(raw, precision);\n !('value' in props) && setValue(val);\n onChange && isValid(val) && onChange(val, e);\n };\n\n const plusOnClick = (e: MouseEvent<HTMLSpanElement>): void => {\n e.stopPropagation();\n if (!disabled && isValid(step)) {\n const val = toPrecision(+value + +step, precision);\n if (val <= max) {\n !('value' in props) && setValue(val);\n onChange && onChange(val, e);\n }\n }\n };\n\n const minusOnClick = (e: MouseEvent<HTMLSpanElement>): void => {\n e.stopPropagation();\n if (!disabled && isValid(step)) {\n const val = toPrecision(+value - +step, precision);\n if (val >= min) {\n !('value' in props) && setValue(val);\n onChange && onChange(val, e);\n }\n }\n };\n\n useEffect(() => {\n 'value' in props && setValue(props.value as number);\n }, [props]);\n\n return (\n <div ref={ref} className={cls} style={style}>\n <input\n autoComplete=\"off\"\n disabled={disabled}\n value={precision !== undefined ? value.toFixed(precision) : value}\n type=\"number\"\n className={`${prefixCls}__input`}\n max={max}\n min={min}\n step={step}\n onChange={inputOnChange}\n aria-valuenow={value}\n aria-valuemax={max}\n aria-valuemin={min}\n aria-disabled={disabled}\n />\n <div className={`${prefixCls}__controls`}>\n <span className={`${prefixCls}__up`} onClick={plusOnClick}>\n <ArrowDown size={8} className={`${prefixCls}__icon ${prefixCls}__icon_reverse`} />\n </span>\n <span className={`${prefixCls}__down`} onClick={minusOnClick}>\n <ArrowDown size={8} className={`${prefixCls}__icon`} />\n </span>\n </div>\n </div>\n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AKlC,MAAM,gBAAgB,MAAyC;AAC7D,IAAE,iBAAiB;AACnB,MAAI,CAAC,YAAY,QAAQ,KAAK,EAAE;GAC9B,MAAM,MAAM,YAAY,CAAC,QAAQ,CAAC,MAAM,UAAU;AAClD,OAAI,OAAO,KAAK;AACd,MAAE,WAAW,UAAU,SAAS,IAAI;AACpC,gBAAY,SAAS,KAAK,EAAE;;;;AAKlC,EAAA,GAAA,MAAA,iBAAgB;AACd,aAAW,SAAS,SAAS,MAAM,MAAgB;IAClD,CAAC,MAAM,CAAC;AAEX,QACE,iBAAA,GAAA,kBAAA,MAAC,OAAD;EAAU;EAAK,WAAW;EAAY;YAAtC,CACE,iBAAA,GAAA,kBAAA,KAAC,SAAD;GACE,cAAa;GACH;GACV,OAAO,cAAc,KAAA,IAAY,MAAM,QAAQ,UAAU,GAAG;GAC5D,MAAK;GACL,WAAW,GAAG,UAAU;GACnB;GACA;GACC;GACN,UAAU;GACV,iBAAe;GACf,iBAAe;GACf,iBAAe;GACf,iBAAe;GACf,CAAA,EACF,iBAAA,GAAA,kBAAA,MAAC,OAAD;GAAK,WAAW,GAAG,UAAU;aAA7B,CACE,iBAAA,GAAA,kBAAA,KAAC,QAAD;IAAM,WAAW,GAAG,UAAU;IAAO,SAAS;cAC5C,iBAAA,GAAA,kBAAA,KAACC,mBAAAA,WAAD;KAAW,MAAM;KAAG,WAAW,GAAG,UAAU,SAAS,UAAU;KAAmB,CAAA;IAC7E,CAAA,EACP,iBAAA,GAAA,kBAAA,KAAC,QAAD;IAAM,WAAW,GAAG,UAAU;IAAS,SAAS;cAC9C,iBAAA,GAAA,kBAAA,KAACA,mBAAAA,WAAD;KAAW,MAAM;KAAG,WAAW,GAAG,UAAU;KAAW,CAAA;IAClD,CAAA,CACH;KACF;;EAER;AAEF,YAAY,cAAc"}
1
+ {"version":3,"file":"input-number.js","names":["React","ConfigContext","getPrefixCls","ArrowDown"],"sources":["../../src/input-number/input-number.tsx"],"sourcesContent":["import React, { useEffect, useState, MouseEvent, useContext } from 'react';\nimport classNames from 'classnames';\nimport { ConfigContext } from '../config-provider/config-context';\nimport { getPrefixCls } from '../_utils/general';\nimport { InputNumberProps } from './types';\nimport { ArrowDown } from '../_utils/components';\n\n/**\n * Valid the string is a number\n * @param val\n */\nconst isValid = (val: string | number): boolean => {\n return !isNaN(+val);\n};\n\nconst getDecimalPrecision = (num: number): number => {\n const str = String(num);\n const dotIndex = str.indexOf('.');\n return dotIndex === -1 ? 0 : str.length - dotIndex - 1;\n};\n\nconst toPrecision = (val: number, precision: number): number => {\n return parseFloat(val.toFixed(precision));\n};\n\nconst InputNumber = React.forwardRef<HTMLDivElement, InputNumberProps>((props, ref) => {\n const {\n size = 'md',\n disabled = false,\n defaultValue = 0,\n step = 1,\n precision,\n controls = false,\n min = Number.NEGATIVE_INFINITY,\n max = Number.POSITIVE_INFINITY,\n onChange,\n className,\n prefixCls: customisedCls,\n style,\n } = props;\n const configContext = useContext(ConfigContext);\n const prefixCls = getPrefixCls('input-number', configContext.prefixCls, customisedCls);\n const inputSize = props.size || configContext.componentSize || size;\n const cls = classNames(prefixCls, className, `${prefixCls}_${inputSize}`, {\n [`${prefixCls}_disabled`]: disabled,\n [`${prefixCls}_always-controls`]: controls,\n });\n const resolvedPrecision = precision ?? Math.max(getDecimalPrecision(step), getDecimalPrecision(defaultValue));\n const [value, setValue] = useState<number>(\n 'value' in props ? (props.value as number) : defaultValue\n );\n\n const inputOnChange = (e: React.ChangeEvent<HTMLInputElement>): void => {\n const raw = Number(e.target.value.trim());\n const val = resolvedPrecision > 0 ? toPrecision(raw, resolvedPrecision) : raw;\n !('value' in props) && setValue(val);\n onChange && isValid(val) && onChange(val, e);\n };\n\n const plusOnClick = (e: MouseEvent<HTMLSpanElement>): void => {\n e.stopPropagation();\n if (!disabled && isValid(step)) {\n const val = toPrecision(+value + +step, resolvedPrecision);\n if (val <= max) {\n !('value' in props) && setValue(val);\n onChange && onChange(val, e);\n }\n }\n };\n\n const minusOnClick = (e: MouseEvent<HTMLSpanElement>): void => {\n e.stopPropagation();\n if (!disabled && isValid(step)) {\n const val = toPrecision(+value - +step, resolvedPrecision);\n if (val >= min) {\n !('value' in props) && setValue(val);\n onChange && onChange(val, e);\n }\n }\n };\n\n useEffect(() => {\n 'value' in props && setValue(props.value as number);\n }, [props]);\n\n return (\n <div ref={ref} className={cls} style={style}>\n <input\n autoComplete=\"off\"\n disabled={disabled}\n value={resolvedPrecision > 0 ? value.toFixed(resolvedPrecision) : value}\n type=\"number\"\n className={`${prefixCls}__input`}\n max={max}\n min={min}\n step={step}\n onChange={inputOnChange}\n aria-valuenow={value}\n aria-valuemax={max}\n aria-valuemin={min}\n aria-disabled={disabled}\n />\n <div className={`${prefixCls}__controls`}>\n <span className={`${prefixCls}__up`} onClick={plusOnClick}>\n <ArrowDown size={8} className={`${prefixCls}__icon ${prefixCls}__icon_reverse`} />\n </span>\n <span className={`${prefixCls}__down`} onClick={minusOnClick}>\n <ArrowDown size={8} className={`${prefixCls}__icon`} />\n </span>\n </div>\n </div>\n );\n});\n\nInputNumber.displayName = 'InputNumber';\n\nexport default InputNumber;\n"],"mappings":";;;;;;;;;;;;;;AAWA,MAAM,WAAW,QAAkC;AACjD,QAAO,CAAC,MAAM,CAAC,IAAI;;AAGrB,MAAM,uBAAuB,QAAwB;CACnD,MAAM,MAAM,OAAO,IAAI;CACvB,MAAM,WAAW,IAAI,QAAQ,IAAI;AACjC,QAAO,aAAa,KAAK,IAAI,IAAI,SAAS,WAAW;;AAGvD,MAAM,eAAe,KAAa,cAA8B;AAC9D,QAAO,WAAW,IAAI,QAAQ,UAAU,CAAC;;AAG3C,MAAM,cAAcA,MAAAA,QAAM,YAA8C,OAAO,QAAQ;CACrF,MAAM,EACJ,OAAO,MACP,WAAW,OACX,eAAe,GACf,OAAO,GACP,WACA,WAAW,OACX,MAAM,OAAO,mBACb,MAAM,OAAO,mBACb,UACA,WACA,WAAW,eACX,UACE;CACJ,MAAM,iBAAA,GAAA,MAAA,YAA2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AAA,GAAA,kBAAA,MAAC,OAAD;EAAU;EAAK,WAAW;EAAY;YAAtC,CACE,iBAAA,GAAA,kBAAA,KAAC,SAAD;GACE,cAAa;GACH;GACV,OAAO,oBAAoB,IAAI,MAAM,QAAQ,kBAAkB,GAAG;GAClE,MAAK;GACL,WAAW,GAAG,UAAU;GACnB;GACA;GACC;GACN,UAAU;GACV,iBAAe;GACf,iBAAe;GACf,iBAAe;GACf,iBAAe;GACf,CAAA,EACF,iBAAA,GAAA,kBAAA,MAAC,OAAD;GAAK,WAAW,GAAG,UAAU;aAA7B,CACE,iBAAA,GAAA,kBAAA,KAAC,QAAD;IAAM,WAAW,GAAG,UAAU;IAAO,SAAS;cAC5C,iBAAA,GAAA,kBAAA,KAACC,mBAAAA,WAAD;KAAW,MAAM;KAAG,WAAW,GAAG,UAAU,SAAS,UAAU;KAAmB,CAAA;IAC7E,CAAA,EACP,iBAAA,GAAA,kBAAA,KAAC,QAAD;IAAM,WAAW,GAAG,UAAU;IAAS,SAAS;cAC9C,iBAAA,GAAA,kBAAA,KAACA,mBAAAA,WAAD;KAAW,MAAM;KAAG,WAAW,GAAG,UAAU;KAAW,CAAA;IAClD,CAAA,CACH;KACF;;EAER;AAEF,YAAY,cAAc"}
@@ -4,6 +4,7 @@
4
4
  .#{$prefix}-input-number {
5
5
  position: relative;
6
6
  box-sizing: border-box;
7
+ width: 100%;
7
8
 
8
9
  &:hover {
9
10
  .#{$prefix}-input-number__controls {
@@ -12,13 +13,14 @@
12
13
  }
13
14
 
14
15
  &__input {
15
- @include input-default();
16
+ @include input-default;
17
+
16
18
  padding-left: 7px;
17
19
  padding-right: 25px;
18
20
 
19
21
  &::-webkit-inner-spin-button,
20
22
  &::-webkit-outer-spin-button {
21
- -webkit-appearance: none;
23
+ appearance: none;
22
24
  }
23
25
  }
24
26
 
@@ -112,7 +114,7 @@
112
114
  &_disabled {
113
115
  .#{$prefix}-input-number {
114
116
  &__input {
115
- @include input-default-disabled();
117
+ @include input-default-disabled;
116
118
  }
117
119
 
118
120
  &__up,
@@ -1,6 +1,7 @@
1
1
  .ty-input-number {
2
2
  position: relative;
3
3
  box-sizing: border-box;
4
+ width: 100%;
4
5
  }
5
6
  .ty-input-number:hover .ty-input-number__controls {
6
7
  opacity: 1;
@@ -13,8 +14,8 @@
13
14
  border: 1px solid var(--ty-input-border);
14
15
  transition: all 0.3s;
15
16
  outline: 0;
16
- border-radius: 2px;
17
- font-size: 1rem;
17
+ border-radius: var(--ty-border-radius);
18
+ font-size: var(--ty-font-size-base);
18
19
  background-color: var(--ty-input-bg);
19
20
  }
20
21
  .ty-input-number__input:hover {
@@ -36,6 +37,7 @@
36
37
  }
37
38
  .ty-input-number__input::-webkit-inner-spin-button, .ty-input-number__input::-webkit-outer-spin-button {
38
39
  -webkit-appearance: none;
40
+ appearance: none;
39
41
  }
40
42
  .ty-input-number__controls {
41
43
  box-sizing: border-box;
@@ -84,19 +86,19 @@
84
86
  transform: rotate(180deg);
85
87
  }
86
88
  .ty-input-number_sm .ty-input-number__input {
87
- font-size: 0.875rem;
88
- height: 24px;
89
- line-height: 24px;
89
+ font-size: var(--ty-font-size-sm);
90
+ height: var(--ty-height-sm);
91
+ line-height: var(--ty-height-sm);
90
92
  }
91
93
  .ty-input-number_md .ty-input-number__input {
92
- font-size: 1rem;
93
- height: 32px;
94
- line-height: 32px;
94
+ font-size: var(--ty-font-size-base);
95
+ height: var(--ty-height-md);
96
+ line-height: var(--ty-height-md);
95
97
  }
96
98
  .ty-input-number_lg .ty-input-number__input {
97
- font-size: 1.25rem;
98
- height: 42px;
99
- line-height: 42px;
99
+ font-size: var(--ty-font-size-lg);
100
+ height: var(--ty-height-lg);
101
+ line-height: var(--ty-height-lg);
100
102
  }
101
103
  .ty-input-number_disabled .ty-input-number__input {
102
104
  cursor: not-allowed;
@@ -41,13 +41,11 @@ const InputOTP = react.default.forwardRef((props, ref) => {
41
41
  nativeElement: containerRef.current
42
42
  }));
43
43
  const triggerValueCellsChange = (0, react.useCallback)((nextValueCells) => {
44
- setValueCells((prev) => {
45
- const prevValue = prev.join("");
46
- const nextValue = nextValueCells.join("");
47
- if (onChange && prevValue !== nextValue) onChange(nextValue);
48
- return nextValueCells;
49
- });
50
- }, [onChange]);
44
+ const prevValue = valueCells.join("");
45
+ const nextValue = nextValueCells.join("");
46
+ setValueCells(nextValueCells);
47
+ if (onChange && prevValue !== nextValue) onChange(nextValue);
48
+ }, [onChange, valueCells]);
51
49
  const patchValue = (0, react.useCallback)((index, txt) => {
52
50
  let nextCells = [...valueCells];
53
51
  for (let i = 0; i < index; i += 1) if (!nextCells[i]) nextCells[i] = "";
@@ -1 +1 @@
1
- {"version":3,"file":"input-otp.js","names":["React","ConfigContext","getPrefixCls","OTPInput"],"sources":["../../src/input-otp/input-otp.tsx"],"sourcesContent":["import React, { useRef, useState, useEffect, useContext, useCallback, useMemo } from 'react';\nimport classNames from 'classnames';\nimport { ConfigContext } from '../config-provider/config-context';\nimport { getPrefixCls } from '../_utils/general';\nimport { InputOTPProps } from './types';\nimport OTPInput from './otp-input';\n\nfunction strToArr(str: string): string[] {\n return (str || '').split('');\n}\n\nexport interface InputOTPRef {\n focus: () => void;\n blur: () => void;\n nativeElement: HTMLDivElement | null;\n}\n\nconst InputOTP = React.forwardRef<InputOTPRef, InputOTPProps>(\n (props, ref) => {\n const {\n length = 6,\n size = 'md',\n defaultValue,\n value,\n onChange,\n formatter,\n separator,\n disabled = false,\n mask,\n autoFocus,\n autoComplete,\n className,\n style,\n prefixCls: customisedCls,\n onFocus,\n ...otherProps\n } = props;\n\n const configContext = useContext(ConfigContext);\n const prefixCls = getPrefixCls('input-otp', configContext.prefixCls, customisedCls);\n const inputSize = size || configContext.componentSize || 'md';\n\n const containerRef = useRef<HTMLDivElement>(null);\n const inputsRef = useRef<Record<number, HTMLInputElement | null>>({});\n\n // Formatter helper\n const internalFormatter = useCallback(\n (txt: string) => (formatter ? formatter(txt) : txt),\n [formatter]\n );\n\n // Value state\n const [valueCells, setValueCells] = useState<string[]>(() =>\n strToArr(internalFormatter(defaultValue || ''))\n );\n\n useEffect(() => {\n if (value !== undefined) {\n setValueCells(strToArr(value));\n }\n }, [value]);\n\n // Imperative handle\n React.useImperativeHandle(ref, () => ({\n focus: () => {\n // Focus first empty cell (or last cell if all filled)\n let nextIndex = 0;\n for (let i = 0; i < length; i += 1) {\n if (!inputsRef.current[i]?.value) {\n nextIndex = i;\n break;\n }\n nextIndex = i;\n }\n inputsRef.current[nextIndex]?.focus();\n },\n blur: () => {\n for (let i = 0; i < length; i += 1) {\n inputsRef.current[i]?.blur();\n }\n },\n nativeElement: containerRef.current,\n }));\n\n // Trigger onChange when value cells change\n const triggerValueCellsChange = useCallback(\n (nextValueCells: string[]) => {\n setValueCells((prev) => {\n const prevValue = prev.join('');\n const nextValue = nextValueCells.join('');\n if (onChange && prevValue !== nextValue) {\n onChange(nextValue);\n }\n return nextValueCells;\n });\n },\n [onChange]\n );\n\n // Patch value at given index\n const patchValue = useCallback(\n (index: number, txt: string) => {\n let nextCells = [...valueCells];\n\n // Fill cells till index\n for (let i = 0; i < index; i += 1) {\n if (!nextCells[i]) {\n nextCells[i] = '';\n }\n }\n\n if (txt.length <= 1) {\n nextCells[index] = txt;\n } else {\n nextCells = nextCells.slice(0, index).concat(strToArr(txt));\n }\n nextCells = nextCells.slice(0, length);\n\n // Clean trailing empty cells\n for (let i = nextCells.length - 1; i >= 0; i -= 1) {\n if (nextCells[i]) {\n break;\n }\n nextCells.pop();\n }\n\n // Format if needed\n const formattedValue = internalFormatter(\n nextCells.map((c) => c || ' ').join('')\n );\n nextCells = strToArr(formattedValue).map((c, i) => {\n if (c === ' ' && !nextCells[i]) {\n return nextCells[i];\n }\n return c;\n });\n\n return nextCells;\n },\n [valueCells, length, internalFormatter]\n );\n\n // Handle input change\n const onInputChange = useCallback(\n (index: number, txt: string) => {\n const nextCells = patchValue(index, txt);\n const nextIndex = Math.min(index + txt.length, length - 1);\n if (nextIndex !== index && nextCells[index] !== undefined) {\n inputsRef.current[nextIndex]?.focus();\n }\n triggerValueCellsChange(nextCells);\n },\n [patchValue, length, triggerValueCellsChange]\n );\n\n // Handle active change (arrow keys, backspace)\n const onInputActiveChange = useCallback(\n (nextIndex: number) => {\n const clampedIndex = Math.max(0, Math.min(nextIndex, length - 1));\n inputsRef.current[clampedIndex]?.focus();\n },\n [length]\n );\n\n // Handle focus — keep focus on the interacted cell\n const onInputFocus = useCallback(\n (event: React.FocusEvent<HTMLInputElement>, index: number) => {\n if (onFocus) {\n (onFocus as React.FocusEventHandler<HTMLDivElement>)(event as unknown as React.FocusEvent<HTMLDivElement>);\n }\n },\n [onFocus]\n );\n\n // Render separator\n const renderSeparator = useMemo(() => {\n if (!separator) return null;\n return (index: number) => {\n const separatorNode =\n typeof separator === 'function' ? separator(index) : separator;\n if (!separatorNode) return null;\n return (\n <span className={`${prefixCls}__separator`}>\n {separatorNode}\n </span>\n );\n };\n }, [separator, prefixCls]);\n\n const cls = classNames(prefixCls, className, `${prefixCls}_${inputSize}`, {\n [`${prefixCls}_disabled`]: disabled,\n });\n\n return (\n <div\n {...otherProps}\n ref={containerRef}\n className={cls}\n style={style}\n role=\"group\"\n >\n {Array.from({ length }).map((_, index) => {\n const singleValue = valueCells[index] || '';\n return (\n <React.Fragment key={`otp-${index}`}>\n <OTPInput\n ref={(el) => {\n inputsRef.current[index] = el;\n }}\n index={index}\n size={inputSize}\n prefixCls={prefixCls}\n value={singleValue}\n disabled={disabled}\n mask={mask}\n autoFocus={index === 0 && autoFocus}\n autoComplete={autoComplete}\n onChange={onInputChange}\n onActiveChange={onInputActiveChange}\n onFocus={(e) => onInputFocus(e, index)}\n />\n {index < length - 1 && renderSeparator?.(index)}\n </React.Fragment>\n );\n })}\n </div>\n );\n }\n);\n\nInputOTP.displayName = 'InputOTP';\n\nexport default InputOTP;\n"],"mappings":";;;;;;;;;;AAOA,SAAS,SAAS,KAAuB;AACvC,SAAQ,OAAO,IAAI,MAAM,GAAG;;AAS9B,MAAM,WA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5D,MAAI,QACD,SAAoD,MAAqD;IAG9G,CAAC,QAAQ,CACV;CAGD,MAAM,mBAAA,GAAA,MAAA,eAAgC;AACpC,MAAI,CAAC,UAAW,QAAO;AACvB,UAAQ,UAAkB;GACxB,MAAM,gBACJ,OAAO,cAAc,aAAa,UAAU,MAAM,GAAG;AACvD,OAAI,CAAC,cAAe,QAAO;AAC3B,UACE,iBAAA,GAAA,kBAAA,KAAC,QAAD;IAAM,WAAW,GAAG,UAAU;cAC3B;IACI,CAAA;;IAGV,CAAC,WAAW,UAAU,CAAC;CAE1B,MAAM,OAAA,GAAA,WAAA,SAAiB,WAAW,WAAW,GAAG,UAAU,GAAG,aAAa,GACvE,GAAG,UAAU,aAAa,UAC5B,CAAC;AAEF,QACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EACE,GAAI;EACJ,KAAK;EACL,WAAW;EACJ;EACP,MAAK;YAEJ,MAAM,KAAK,EAAE,QAAQ,CAAC,CAAC,KAAK,GAAG,UAAU;GACxC,MAAM,cAAc,WAAW,UAAU;AACzC,UACE,iBAAA,GAAA,kBAAA,MAACF,MAAAA,QAAM,UAAP,EAAA,UAAA,CACE,iBAAA,GAAA,kBAAA,KAACG,kBAAAA,SAAD;IACE,MAAM,OAAO;AACX,eAAU,QAAQ,SAAS;;IAEtB;IACP,MAAM;IACK;IACX,OAAO;IACG;IACJ;IACN,WAAW,UAAU,KAAK;IACZ;IACd,UAAU;IACV,gBAAgB;IAChB,UAAU,MAAM,aAAa,GAAG,MAAM;IACtC,CAAA,EACD,QAAQ,SAAS,KAAK,kBAAkB,MAAM,CAChC,EAAA,EAlBI,OAAO,QAkBX;IAEnB;EACE,CAAA;EAGX;AAED,SAAS,cAAc"}
1
+ {"version":3,"file":"input-otp.js","names":["React","ConfigContext","getPrefixCls","OTPInput"],"sources":["../../src/input-otp/input-otp.tsx"],"sourcesContent":["import React, { useRef, useState, useEffect, useContext, useCallback, useMemo } from 'react';\nimport classNames from 'classnames';\nimport { ConfigContext } from '../config-provider/config-context';\nimport { getPrefixCls } from '../_utils/general';\nimport { InputOTPProps } from './types';\nimport OTPInput from './otp-input';\n\nfunction strToArr(str: string): string[] {\n return (str || '').split('');\n}\n\nexport interface InputOTPRef {\n focus: () => void;\n blur: () => void;\n nativeElement: HTMLDivElement | null;\n}\n\nconst InputOTP = React.forwardRef<InputOTPRef, InputOTPProps>(\n (props, ref) => {\n const {\n length = 6,\n size = 'md',\n defaultValue,\n value,\n onChange,\n formatter,\n separator,\n disabled = false,\n mask,\n autoFocus,\n autoComplete,\n className,\n style,\n prefixCls: customisedCls,\n onFocus,\n ...otherProps\n } = props;\n\n const configContext = useContext(ConfigContext);\n const prefixCls = getPrefixCls('input-otp', configContext.prefixCls, customisedCls);\n const inputSize = size || configContext.componentSize || 'md';\n\n const containerRef = useRef<HTMLDivElement>(null);\n const inputsRef = useRef<Record<number, HTMLInputElement | null>>({});\n\n // Formatter helper\n const internalFormatter = useCallback(\n (txt: string) => (formatter ? formatter(txt) : txt),\n [formatter]\n );\n\n // Value state\n const [valueCells, setValueCells] = useState<string[]>(() =>\n strToArr(internalFormatter(defaultValue || ''))\n );\n\n useEffect(() => {\n if (value !== undefined) {\n setValueCells(strToArr(value));\n }\n }, [value]);\n\n // Imperative handle\n React.useImperativeHandle(ref, () => ({\n focus: () => {\n // Focus first empty cell (or last cell if all filled)\n let nextIndex = 0;\n for (let i = 0; i < length; i += 1) {\n if (!inputsRef.current[i]?.value) {\n nextIndex = i;\n break;\n }\n nextIndex = i;\n }\n inputsRef.current[nextIndex]?.focus();\n },\n blur: () => {\n for (let i = 0; i < length; i += 1) {\n inputsRef.current[i]?.blur();\n }\n },\n nativeElement: containerRef.current,\n }));\n\n // Trigger onChange when value cells change\n const triggerValueCellsChange = useCallback(\n (nextValueCells: string[]) => {\n const prevValue = valueCells.join('');\n const nextValue = nextValueCells.join('');\n setValueCells(nextValueCells);\n if (onChange && prevValue !== nextValue) {\n onChange(nextValue);\n }\n },\n [onChange, valueCells]\n );\n\n // Patch value at given index\n const patchValue = useCallback(\n (index: number, txt: string) => {\n let nextCells = [...valueCells];\n\n // Fill cells till index\n for (let i = 0; i < index; i += 1) {\n if (!nextCells[i]) {\n nextCells[i] = '';\n }\n }\n\n if (txt.length <= 1) {\n nextCells[index] = txt;\n } else {\n nextCells = nextCells.slice(0, index).concat(strToArr(txt));\n }\n nextCells = nextCells.slice(0, length);\n\n // Clean trailing empty cells\n for (let i = nextCells.length - 1; i >= 0; i -= 1) {\n if (nextCells[i]) {\n break;\n }\n nextCells.pop();\n }\n\n // Format if needed\n const formattedValue = internalFormatter(\n nextCells.map((c) => c || ' ').join('')\n );\n nextCells = strToArr(formattedValue).map((c, i) => {\n if (c === ' ' && !nextCells[i]) {\n return nextCells[i];\n }\n return c;\n });\n\n return nextCells;\n },\n [valueCells, length, internalFormatter]\n );\n\n // Handle input change\n const onInputChange = useCallback(\n (index: number, txt: string) => {\n const nextCells = patchValue(index, txt);\n const nextIndex = Math.min(index + txt.length, length - 1);\n if (nextIndex !== index && nextCells[index] !== undefined) {\n inputsRef.current[nextIndex]?.focus();\n }\n triggerValueCellsChange(nextCells);\n },\n [patchValue, length, triggerValueCellsChange]\n );\n\n // Handle active change (arrow keys, backspace)\n const onInputActiveChange = useCallback(\n (nextIndex: number) => {\n const clampedIndex = Math.max(0, Math.min(nextIndex, length - 1));\n inputsRef.current[clampedIndex]?.focus();\n },\n [length]\n );\n\n // Handle focus — keep focus on the interacted cell\n const onInputFocus = useCallback(\n (event: React.FocusEvent<HTMLInputElement>, index: number) => {\n if (onFocus) {\n (onFocus as React.FocusEventHandler<HTMLDivElement>)(event as unknown as React.FocusEvent<HTMLDivElement>);\n }\n },\n [onFocus]\n );\n\n // Render separator\n const renderSeparator = useMemo(() => {\n if (!separator) return null;\n return (index: number) => {\n const separatorNode =\n typeof separator === 'function' ? separator(index) : separator;\n if (!separatorNode) return null;\n return (\n <span className={`${prefixCls}__separator`}>\n {separatorNode}\n </span>\n );\n };\n }, [separator, prefixCls]);\n\n const cls = classNames(prefixCls, className, `${prefixCls}_${inputSize}`, {\n [`${prefixCls}_disabled`]: disabled,\n });\n\n return (\n <div\n {...otherProps}\n ref={containerRef}\n className={cls}\n style={style}\n role=\"group\"\n >\n {Array.from({ length }).map((_, index) => {\n const singleValue = valueCells[index] || '';\n return (\n <React.Fragment key={`otp-${index}`}>\n <OTPInput\n ref={(el) => {\n inputsRef.current[index] = el;\n }}\n index={index}\n size={inputSize}\n prefixCls={prefixCls}\n value={singleValue}\n disabled={disabled}\n mask={mask}\n autoFocus={index === 0 && autoFocus}\n autoComplete={autoComplete}\n onChange={onInputChange}\n onActiveChange={onInputActiveChange}\n onFocus={(e) => onInputFocus(e, index)}\n />\n {index < length - 1 && renderSeparator?.(index)}\n </React.Fragment>\n );\n })}\n </div>\n );\n }\n);\n\nInputOTP.displayName = 'InputOTP';\n\nexport default InputOTP;\n"],"mappings":";;;;;;;;;;AAOA,SAAS,SAAS,KAAuB;AACvC,SAAQ,OAAO,IAAI,MAAM,GAAG;;AAS9B,MAAM,WAAWA,MAAAA,QAAM,YACpB,OAAO,QAAQ;CACd,MAAM,EACJ,SAAS,GACT,OAAO,MACP,cACA,OACA,UACA,WACA,WACA,WAAW,OACX,MACA,WACA,cACA,WACA,OACA,WAAW,eACX,SACA,GAAG,eACD;CAEJ,MAAM,iBAAA,GAAA,MAAA,YAA2BC,uBAAAA,cAAc;CAC/C,MAAM,YAAYC,gBAAAA,aAAa,aAAa,cAAc,WAAW,cAAc;CACnF,MAAM,YAAY,QAAQ,cAAc,iBAAiB;CAEzD,MAAM,gBAAA,GAAA,MAAA,QAAsC,KAAK;CACjD,MAAM,aAAA,GAAA,MAAA,QAA4D,EAAE,CAAC;CAGrE,MAAM,qBAAA,GAAA,MAAA,cACH,QAAiB,YAAY,UAAU,IAAI,GAAG,KAC/C,CAAC,UAAU,CACZ;CAGD,MAAM,CAAC,YAAY,kBAAA,GAAA,MAAA,gBACjB,SAAS,kBAAkB,gBAAgB,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AC,CAAC,KAAK,GAAG,UAAU;GACxC,MAAM,cAAc,WAAW,UAAU;AACzC,UACE,iBAAA,GAAA,kBAAA,MAACF,MAAAA,QAAM,UAAP,EAAA,UAAA,CACE,iBAAA,GAAA,kBAAA,KAACG,kBAAAA,SAAD;IACE,MAAM,OAAO;AACX,eAAU,QAAQ,SAAS;;IAEtB;IACP,MAAM;IACK;IACX,OAAO;IACG;IACJ;IACN,WAAW,UAAU,KAAK;IACZ;IACd,UAAU;IACV,gBAAgB;IAChB,UAAU,MAAM,aAAa,GAAG,MAAM;IACtC,CAAA,EACD,QAAQ,SAAS,KAAK,kBAAkB,MAAM,CAChC,EAAA,EAlBI,OAAO,QAkBX;IAEnB;EACE,CAAA;EAGX;AAED,SAAS,cAAc"}
@@ -44,7 +44,7 @@
44
44
  display: inline-flex;
45
45
  align-items: center;
46
46
  color: var(--ty-color-text-secondary);
47
- font-size: $font-size-base;
47
+ font-size: var(--ty-font-size-base);
48
48
  }
49
49
 
50
50
  &_disabled {
@@ -11,8 +11,8 @@
11
11
  border: 1px solid var(--ty-input-border);
12
12
  transition: all 0.3s;
13
13
  outline: 0;
14
- border-radius: 2px;
15
- font-size: 1rem;
14
+ border-radius: var(--ty-border-radius);
15
+ font-size: var(--ty-font-size-base);
16
16
  background-color: var(--ty-input-bg);
17
17
  }
18
18
  .ty-input-otp__cell:hover {
@@ -33,24 +33,24 @@
33
33
  height: 36px;
34
34
  text-align: center;
35
35
  padding: 0;
36
- font-size: 1rem;
37
- border-radius: 2px;
36
+ font-size: var(--ty-font-size-base);
37
+ border-radius: var(--ty-border-radius);
38
38
  caret-color: currentcolor;
39
39
  }
40
40
  .ty-input-otp__cell_sm {
41
41
  width: 28px;
42
42
  height: 28px;
43
- font-size: 0.875rem;
43
+ font-size: var(--ty-font-size-sm);
44
44
  }
45
45
  .ty-input-otp__cell_md {
46
46
  width: 36px;
47
47
  height: 36px;
48
- font-size: 1rem;
48
+ font-size: var(--ty-font-size-base);
49
49
  }
50
50
  .ty-input-otp__cell_lg {
51
51
  width: 44px;
52
52
  height: 44px;
53
- font-size: 1.25rem;
53
+ font-size: var(--ty-font-size-lg);
54
54
  }
55
55
  .ty-input-otp__cell_disabled {
56
56
  cursor: not-allowed;
@@ -64,7 +64,7 @@
64
64
  display: inline-flex;
65
65
  align-items: center;
66
66
  color: var(--ty-color-text-secondary);
67
- font-size: 1rem;
67
+ font-size: var(--ty-font-size-base);
68
68
  }
69
69
  .ty-input-otp_disabled {
70
70
  cursor: not-allowed;