@rockshin/tao-ui 0.0.44 → 0.0.46

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 (152) hide show
  1. package/README.md +9 -1
  2. package/component-manifest.json +38 -4
  3. package/dist/components/alert/alert.js +20 -17
  4. package/dist/components/auto-complete/auto-complete.js +12 -3
  5. package/dist/components/avatar/avatar.js +2 -1
  6. package/dist/components/breadcrumb/breadcrumb.css +4 -0
  7. package/dist/components/breadcrumb/breadcrumb.js +82 -77
  8. package/dist/components/calendar/calendar.d.ts +1 -1
  9. package/dist/components/calendar/calendar.js +51 -33
  10. package/dist/components/card/card-tabs.js +204 -182
  11. package/dist/components/card/card.js +1 -1
  12. package/dist/components/carousel/carousel.js +11 -5
  13. package/dist/components/cascader/cascader.js +16 -4
  14. package/dist/components/collapse/collapse.css +8 -0
  15. package/dist/components/color-picker/color-picker.js +273 -269
  16. package/dist/components/context-menu/context-menu.d.ts +2 -1
  17. package/dist/components/context-menu/context-menu.js +57 -44
  18. package/dist/components/date-picker/calendar/calendar-grid.js +13 -6
  19. package/dist/components/date-picker/calendar/use-calendar.d.ts +2 -2
  20. package/dist/components/date-picker/calendar/use-calendar.js +2 -3
  21. package/dist/components/date-picker/date-localization.d.ts +3 -0
  22. package/dist/components/date-picker/date-localization.js +76 -0
  23. package/dist/components/date-picker/date-picker.css +4 -0
  24. package/dist/components/date-picker/date-picker.d.ts +1 -0
  25. package/dist/components/date-picker/date-picker.js +48 -30
  26. package/dist/components/date-picker/range-picker.d.ts +1 -0
  27. package/dist/components/date-picker/range-picker.js +41 -23
  28. package/dist/components/drawer/drawer.d.ts +2 -1
  29. package/dist/components/drawer/drawer.js +32 -20
  30. package/dist/components/dropdown/dropdown.d.ts +1 -0
  31. package/dist/components/dropdown/dropdown.js +160 -143
  32. package/dist/components/float-button/float-button.js +3 -2
  33. package/dist/components/form/form.js +88 -103
  34. package/dist/components/image/image.js +202 -137
  35. package/dist/components/list/list-pagination.js +148 -147
  36. package/dist/components/mentions/mentions.js +6 -2
  37. package/dist/components/modal/confirm-dialog.js +4 -2
  38. package/dist/components/modal/modal.d.ts +2 -1
  39. package/dist/components/modal/modal.js +387 -375
  40. package/dist/components/pagination/pagination.css +4 -0
  41. package/dist/components/pagination/pagination.js +115 -110
  42. package/dist/components/popconfirm/popconfirm.js +109 -107
  43. package/dist/components/popover/popover.d.ts +2 -1
  44. package/dist/components/popover/popover.js +185 -176
  45. package/dist/components/qr-code/qr-code.js +22 -21
  46. package/dist/components/rate/rate.js +114 -88
  47. package/dist/components/scroll-area/scroll-area.js +132 -120
  48. package/dist/components/segmented/segmented.js +52 -29
  49. package/dist/components/select/mobile-select.d.ts +3 -2
  50. package/dist/components/select/mobile-select.js +54 -48
  51. package/dist/components/select/select-types.d.ts +1 -0
  52. package/dist/components/select/select.js +19 -6
  53. package/dist/components/slider/slider.js +136 -133
  54. package/dist/components/sonner/sonner.js +10 -10
  55. package/dist/components/spinner/spinner.js +1 -1
  56. package/dist/components/splitter/splitter.css +4 -0
  57. package/dist/components/splitter/splitter.js +29 -24
  58. package/dist/components/statistic/statistic.d.ts +2 -0
  59. package/dist/components/statistic/statistic.js +203 -187
  60. package/dist/components/table/table-filter.js +61 -52
  61. package/dist/components/table/table-icons.js +3 -1
  62. package/dist/components/table/table.css +29 -11
  63. package/dist/components/table/table.d.ts +1 -1
  64. package/dist/components/table/table.js +384 -547
  65. package/dist/components/tabs/tabs.js +3 -2
  66. package/dist/components/tag/tag.js +22 -19
  67. package/dist/components/time-picker/time-picker.d.ts +0 -1
  68. package/dist/components/time-picker/time-picker.js +160 -103
  69. package/dist/components/tooltip/tooltip.d.ts +2 -1
  70. package/dist/components/tooltip/tooltip.js +82 -71
  71. package/dist/components/transfer/transfer-list.js +224 -488
  72. package/dist/components/transfer/transfer-parts.js +14 -4
  73. package/dist/components/transfer/transfer-types.d.ts +1 -0
  74. package/dist/components/transfer/transfer.js +23 -20
  75. package/dist/components/tree/tree-keyboard.d.ts +6 -0
  76. package/dist/components/tree/tree-keyboard.js +27 -0
  77. package/dist/components/tree/tree.js +14 -3
  78. package/dist/components/tree-select/select-engine.d.ts +2 -1
  79. package/dist/components/tree-select/select-engine.js +23 -15
  80. package/dist/components/tree-select/tree-select.js +20 -10
  81. package/dist/components/upload/upload.js +30 -26
  82. package/dist/docs/component-docs.d.ts +13 -2
  83. package/dist/docs/components/headless-input-number.doc.d.ts +5 -0
  84. package/dist/docs/components/headless-input-number.doc.js +7 -0
  85. package/dist/docs/components/input-number.doc.d.ts +5 -0
  86. package/dist/docs/components/input-number.doc.js +7 -0
  87. package/dist/docs/components/statistic.doc.d.ts +5 -0
  88. package/dist/docs/components/statistic.doc.js +7 -0
  89. package/dist/docs/components/tao-provider.doc.d.ts +8 -2
  90. package/dist/docs/components/tao-provider.doc.js +16 -3
  91. package/dist/docs/components/tooltip.doc.d.ts +2 -2
  92. package/dist/entries/provider.d.ts +2 -1
  93. package/dist/entries/provider.js +1 -0
  94. package/dist/index.d.ts +2 -1
  95. package/dist/index.js +1 -0
  96. package/dist/locales/ar-EG.d.ts +3 -0
  97. package/dist/locales/ar-EG.js +199 -0
  98. package/dist/locales/create-locale.d.ts +41 -0
  99. package/dist/locales/create-locale.js +88 -0
  100. package/dist/locales/de-DE.d.ts +3 -0
  101. package/dist/locales/de-DE.js +195 -0
  102. package/dist/locales/en-US.d.ts +2 -0
  103. package/dist/locales/en-US.js +194 -0
  104. package/dist/locales/es-ES.d.ts +3 -0
  105. package/dist/locales/es-ES.js +195 -0
  106. package/dist/locales/fr-FR.d.ts +3 -0
  107. package/dist/locales/fr-FR.js +195 -0
  108. package/dist/locales/hi-IN.d.ts +3 -0
  109. package/dist/locales/hi-IN.js +194 -0
  110. package/dist/locales/id-ID.d.ts +3 -0
  111. package/dist/locales/id-ID.js +194 -0
  112. package/dist/locales/index.d.ts +18 -0
  113. package/dist/locales/index.js +17 -0
  114. package/dist/locales/it-IT.d.ts +3 -0
  115. package/dist/locales/it-IT.js +195 -0
  116. package/dist/locales/ja-JP.d.ts +3 -0
  117. package/dist/locales/ja-JP.js +194 -0
  118. package/dist/locales/ko-KR.d.ts +3 -0
  119. package/dist/locales/ko-KR.js +194 -0
  120. package/dist/locales/pt-BR.d.ts +3 -0
  121. package/dist/locales/pt-BR.js +195 -0
  122. package/dist/locales/ru-RU.d.ts +3 -0
  123. package/dist/locales/ru-RU.js +197 -0
  124. package/dist/locales/th-TH.d.ts +3 -0
  125. package/dist/locales/th-TH.js +194 -0
  126. package/dist/locales/tr-TR.d.ts +3 -0
  127. package/dist/locales/tr-TR.js +194 -0
  128. package/dist/locales/types.d.ts +176 -0
  129. package/dist/locales/types.js +0 -0
  130. package/dist/locales/vi-VN.d.ts +3 -0
  131. package/dist/locales/vi-VN.js +194 -0
  132. package/dist/locales/zh-CN.d.ts +3 -0
  133. package/dist/locales/zh-CN.js +194 -0
  134. package/dist/locales/zh-TW.d.ts +3 -0
  135. package/dist/locales/zh-TW.js +194 -0
  136. package/dist/number-input/format.d.ts +4 -3
  137. package/dist/number-input/format.js +9 -7
  138. package/dist/number-input/locale.d.ts +19 -0
  139. package/dist/number-input/locale.js +44 -0
  140. package/dist/number-input/number-input.js +1 -0
  141. package/dist/number-input/use-number-input.d.ts +2 -0
  142. package/dist/number-input/use-number-input.js +180 -176
  143. package/dist/provider/locale.d.ts +3 -65
  144. package/dist/provider/locale.js +2 -146
  145. package/dist/provider/merge-locale.d.ts +8 -0
  146. package/dist/provider/merge-locale.js +53 -0
  147. package/dist/provider/tao-provider.d.ts +16 -5
  148. package/dist/provider/tao-provider.js +200 -92
  149. package/dist/utils/scroll-left.d.ts +3 -0
  150. package/dist/utils/scroll-left.js +7 -0
  151. package/llms.txt +3 -3
  152. package/package.json +5 -1
@@ -26,46 +26,48 @@ function colorKeys() {
26
26
  };
27
27
  }
28
28
  function PickerPanel() {
29
- const $ = c(28);
29
+ const $ = c(29);
30
30
  const fieldId = useId();
31
+ const { locale: t0 } = useTaoConfig();
32
+ const { messages } = t0;
31
33
  const keyForColor = colorKeys();
32
34
  const panel = useContext(PanelContext);
33
- const { value, active, props, mode, modes, setMode, format, setFormat, chinese } = panel;
35
+ const { value, active, props, mode, modes, setMode, format, setFormat } = panel;
34
36
  const stops = value.getColors();
35
37
  const activeIndex = Math.min(active, stops.length - 1);
36
38
  const selected = "gradient" === mode ? stops[activeIndex].color : value;
37
39
  const hex = selected.toHexString();
38
40
  const [draft, setDraft] = useState(hex);
39
- let t0;
41
+ let t1;
40
42
  if ($[0] !== hex) {
41
- t0 = [
43
+ t1 = [
42
44
  hex
43
45
  ];
44
46
  $[0] = hex;
45
- $[1] = t0;
46
- } else t0 = $[1];
47
- useEffect(()=>setDraft(hex), t0);
47
+ $[1] = t1;
48
+ } else t1 = $[1];
49
+ useEffect(()=>setDraft(hex), t1);
48
50
  const replace = (next)=>"gradient" === mode ? new external_color_js_Color(stops.map((stop, index)=>({
49
51
  ...stop,
50
52
  color: index === activeIndex ? next : stop.color
51
53
  }))) : next;
52
- const changeSelected = (next_0, t1)=>{
53
- const complete = void 0 === t1 ? true : t1;
54
+ const changeSelected = (next_0, t2)=>{
55
+ const complete = void 0 === t2 ? true : t2;
54
56
  return panel.change(replace(next_0), complete);
55
57
  };
56
- let t2;
58
+ let t3;
57
59
  if ($[2] !== fieldId) {
58
- t2 = (label, number, max, change, t3)=>{
59
- const step = void 0 === t3 ? 1 : t3;
60
+ t3 = (channel, label, number, max, change, t4)=>{
61
+ const step = void 0 === t4 ? 1 : t4;
60
62
  return /*#__PURE__*/ jsxs("label", {
61
63
  "data-tao-color-field": "",
62
- htmlFor: `${fieldId}-${label}`,
64
+ htmlFor: `${fieldId}-${channel}`,
63
65
  children: [
64
66
  /*#__PURE__*/ jsx("span", {
65
67
  children: label
66
68
  }),
67
69
  /*#__PURE__*/ jsx(BaseInput, {
68
- id: `${fieldId}-${label}`,
70
+ id: `${fieldId}-${channel}`,
69
71
  size: "small",
70
72
  disabled: false,
71
73
  type: "number",
@@ -82,16 +84,16 @@ function PickerPanel() {
82
84
  });
83
85
  };
84
86
  $[2] = fieldId;
85
- $[3] = t2;
86
- } else t2 = $[3];
87
- const numberInput = t2;
87
+ $[3] = t3;
88
+ } else t3 = $[3];
89
+ const numberInput = t3;
88
90
  const rgb = selected.toRgb();
89
91
  const hsb = selected.toHsb();
90
92
  const prefix = props.prefixCls ?? "tao-color-engine";
91
- let t3;
92
- if ($[4] !== chinese || $[5] !== mode || $[6] !== modes.length || $[7] !== setMode) {
93
- t3 = modes.length > 1 && /*#__PURE__*/ jsx(Segmented, {
94
- "aria-label": chinese ? "\u989C\u8272\u6A21\u5F0F" : "Color mode",
93
+ let t4;
94
+ if ($[4] !== messages.colorGradient || $[5] !== messages.colorMode || $[6] !== messages.colorSingle || $[7] !== mode || $[8] !== modes.length || $[9] !== setMode) {
95
+ t4 = modes.length > 1 && /*#__PURE__*/ jsx(Segmented, {
96
+ "aria-label": messages.colorMode,
95
97
  size: "small",
96
98
  disabled: false,
97
99
  value: mode,
@@ -99,81 +101,82 @@ function PickerPanel() {
99
101
  options: [
100
102
  {
101
103
  value: "single",
102
- label: chinese ? "\u5355\u8272" : "Single"
104
+ label: messages.colorSingle
103
105
  },
104
106
  {
105
107
  value: "gradient",
106
- label: chinese ? "\u6E10\u53D8" : "Gradient"
108
+ label: messages.colorGradient
107
109
  }
108
110
  ]
109
111
  });
110
- $[4] = chinese;
111
- $[5] = mode;
112
- $[6] = modes.length;
113
- $[7] = setMode;
114
- $[8] = t3;
115
- } else t3 = $[8];
116
- const t4 = "";
117
- const t5 = chinese ? "\u989C\u8272\u683C\u5F0F" : "Color format";
118
- const t6 = chinese ? "\u989C\u8272\u683C\u5F0F" : "Color format";
119
- let t7;
112
+ $[4] = messages.colorGradient;
113
+ $[5] = messages.colorMode;
114
+ $[6] = messages.colorSingle;
115
+ $[7] = mode;
116
+ $[8] = modes.length;
117
+ $[9] = setMode;
118
+ $[10] = t4;
119
+ } else t4 = $[10];
120
+ const t5 = "";
121
+ const t6 = messages.colorFormat;
122
+ const t7 = messages.colorFormat;
120
123
  let t8;
121
- if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
122
- t7 = {
124
+ let t9;
125
+ if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
126
+ t8 = {
123
127
  width: "5.5em",
124
128
  flexShrink: 0
125
129
  };
126
- t8 = {
130
+ t9 = {
127
131
  popup: {
128
132
  zIndex: "calc(var(--tao-z-index-popup-base) + 60)"
129
133
  }
130
134
  };
131
- $[9] = t7;
132
- $[10] = t8;
135
+ $[11] = t8;
136
+ $[12] = t9;
133
137
  } else {
134
- t7 = $[9];
135
- t8 = $[10];
138
+ t8 = $[11];
139
+ t9 = $[12];
136
140
  }
137
- const t9 = props.disabledFormat ?? false;
138
- let t10;
139
- if ($[11] !== setFormat) {
140
- t10 = (next_5)=>setFormat(next_5);
141
- $[11] = setFormat;
142
- $[12] = t10;
143
- } else t10 = $[12];
141
+ const t10 = props.disabledFormat ?? false;
144
142
  let t11;
145
- if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
146
- t11 = [
143
+ if ($[13] !== setFormat) {
144
+ t11 = (next_5)=>setFormat(next_5);
145
+ $[13] = setFormat;
146
+ $[14] = t11;
147
+ } else t11 = $[14];
148
+ let t12;
149
+ if ($[15] === Symbol.for("react.memo_cache_sentinel")) {
150
+ t12 = [
147
151
  "hex",
148
152
  "rgb",
149
153
  "hsb"
150
154
  ].map(_temp3);
151
- $[13] = t11;
152
- } else t11 = $[13];
153
- let t12;
154
- if ($[14] !== format || $[15] !== t10 || $[16] !== t5 || $[17] !== t6 || $[18] !== t9) {
155
- t12 = /*#__PURE__*/ jsx(Select, {
156
- "aria-label": t5,
157
- mobileTitle: t6,
155
+ $[15] = t12;
156
+ } else t12 = $[15];
157
+ let t13;
158
+ if ($[16] !== format || $[17] !== messages.colorFormat || $[18] !== t10 || $[19] !== t11) {
159
+ t13 = /*#__PURE__*/ jsx(Select, {
160
+ "aria-label": t6,
161
+ mobileTitle: t7,
158
162
  size: "small",
159
- style: t7,
160
- styles: t8,
163
+ style: t8,
164
+ styles: t9,
161
165
  value: format,
162
- disabled: t9,
163
- onChange: t10,
164
- options: t11
166
+ disabled: t10,
167
+ onChange: t11,
168
+ options: t12
165
169
  });
166
- $[14] = format;
167
- $[15] = t10;
168
- $[16] = t5;
169
- $[17] = t6;
170
- $[18] = t9;
171
- $[19] = t12;
172
- } else t12 = $[19];
173
- const t13 = "hex" === format ? /*#__PURE__*/ jsx(BaseInput, {
170
+ $[16] = format;
171
+ $[17] = messages.colorFormat;
172
+ $[18] = t10;
173
+ $[19] = t11;
174
+ $[20] = t13;
175
+ } else t13 = $[20];
176
+ const t14 = "hex" === format ? /*#__PURE__*/ jsx(BaseInput, {
174
177
  size: "small",
175
178
  disabled: false,
176
- "aria-label": chinese ? "\u5341\u516D\u8FDB\u5236\u989C\u8272" : "Hex color",
179
+ "aria-label": messages.colorHex,
177
180
  value: draft,
178
181
  "aria-invalid": !/^#?(?:[\da-f]{3}|[\da-f]{4}|[\da-f]{6}|[\da-f]{8})$/i.test(draft),
179
182
  onChange: (event_0)=>{
@@ -182,73 +185,73 @@ function PickerPanel() {
182
185
  }
183
186
  }) : "rgb" === format ? /*#__PURE__*/ jsxs(Fragment, {
184
187
  children: [
185
- numberInput("Red", rgb.r, 255, (r)=>changeSelected(new external_color_js_Color({
188
+ numberInput("red", messages.colorRed, rgb.r, 255, (r)=>changeSelected(new external_color_js_Color({
186
189
  ...rgb,
187
190
  r
188
191
  }))),
189
- numberInput("Green", rgb.g, 255, (g)=>changeSelected(new external_color_js_Color({
192
+ numberInput("green", messages.colorGreen, rgb.g, 255, (g)=>changeSelected(new external_color_js_Color({
190
193
  ...rgb,
191
194
  g
192
195
  }))),
193
- numberInput("Blue", rgb.b, 255, (b_1)=>changeSelected(new external_color_js_Color({
196
+ numberInput("blue", messages.colorBlue, rgb.b, 255, (b_1)=>changeSelected(new external_color_js_Color({
194
197
  ...rgb,
195
198
  b: b_1
196
199
  })))
197
200
  ]
198
201
  }) : /*#__PURE__*/ jsxs(Fragment, {
199
202
  children: [
200
- numberInput("Hue", Math.round(hsb.h), 360, (h)=>changeSelected(new external_color_js_Color({
203
+ numberInput("hue", messages.colorHue, Math.round(hsb.h), 360, (h)=>changeSelected(new external_color_js_Color({
201
204
  ...hsb,
202
205
  h
203
206
  }))),
204
- numberInput("Saturation", Math.round(100 * hsb.s), 100, (s)=>changeSelected(new external_color_js_Color({
207
+ numberInput("saturation", messages.colorSaturation, Math.round(100 * hsb.s), 100, (s)=>changeSelected(new external_color_js_Color({
205
208
  ...hsb,
206
209
  s: s / 100
207
210
  }))),
208
- numberInput("Brightness", Math.round(100 * hsb.b), 100, (b_2)=>changeSelected(new external_color_js_Color({
211
+ numberInput("brightness", messages.colorBrightness, Math.round(100 * hsb.b), 100, (b_2)=>changeSelected(new external_color_js_Color({
209
212
  ...hsb,
210
213
  b: b_2 / 100
211
214
  })))
212
215
  ]
213
216
  });
214
- const t14 = !props.disabledAlpha && numberInput("Alpha", Math.round(100 * rgb.a), 100, (alpha)=>changeSelected(new external_color_js_Color({
217
+ const t15 = !props.disabledAlpha && numberInput("alpha", messages.colorAlpha, Math.round(100 * rgb.a), 100, (alpha)=>changeSelected(new external_color_js_Color({
215
218
  ...rgb,
216
219
  a: alpha / 100
217
220
  })));
218
- let t15;
219
- if ($[20] !== t12 || $[21] !== t13 || $[22] !== t14) {
220
- t15 = /*#__PURE__*/ jsxs("div", {
221
- "data-tao-color-inputs": t4,
221
+ let t16;
222
+ if ($[21] !== t13 || $[22] !== t14 || $[23] !== t15) {
223
+ t16 = /*#__PURE__*/ jsxs("div", {
224
+ "data-tao-color-inputs": t5,
222
225
  children: [
223
- t12,
224
226
  t13,
225
- t14
227
+ t14,
228
+ t15
226
229
  ]
227
230
  });
228
- $[20] = t12;
229
231
  $[21] = t13;
230
232
  $[22] = t14;
231
233
  $[23] = t15;
232
- } else t15 = $[23];
233
- let t16;
234
- if ($[24] !== chinese || $[25] !== panel.clear || $[26] !== props.allowClear) {
235
- t16 = props.allowClear && /*#__PURE__*/ jsx(Button, {
234
+ $[24] = t16;
235
+ } else t16 = $[24];
236
+ let t17;
237
+ if ($[25] !== messages.clearColor || $[26] !== panel.clear || $[27] !== props.allowClear) {
238
+ t17 = props.allowClear && /*#__PURE__*/ jsx(Button, {
236
239
  variant: "ghost",
237
240
  size: "small",
238
241
  disabled: false,
239
242
  "data-tao-color-clear": "",
240
243
  onClick: panel.clear,
241
- children: chinese ? "\u6E05\u9664\u989C\u8272" : "Clear color"
244
+ children: messages.clearColor
242
245
  });
243
- $[24] = chinese;
244
- $[25] = panel.clear;
245
- $[26] = props.allowClear;
246
- $[27] = t16;
247
- } else t16 = $[27];
246
+ $[25] = messages.clearColor;
247
+ $[26] = panel.clear;
248
+ $[27] = props.allowClear;
249
+ $[28] = t17;
250
+ } else t17 = $[28];
248
251
  return /*#__PURE__*/ jsxs("div", {
249
252
  "data-tao-color-picker-controls": "",
250
253
  children: [
251
- t3,
254
+ t4,
252
255
  "gradient" === mode && /*#__PURE__*/ jsxs("div", {
253
256
  "data-tao-color-stops": "",
254
257
  children: [
@@ -263,7 +266,7 @@ function PickerPanel() {
263
266
  children: [
264
267
  stops.map((stop_0, index_0)=>/*#__PURE__*/ jsx("button", {
265
268
  type: "button",
266
- "aria-label": `${chinese ? "\u8272\u6807" : "Color stop"} ${index_0 + 1}`,
269
+ "aria-label": `${messages.colorStop} ${index_0 + 1}`,
267
270
  "aria-pressed": index_0 === activeIndex,
268
271
  onClick: ()=>panel.setActive(index_0),
269
272
  style: {
@@ -274,7 +277,7 @@ function PickerPanel() {
274
277
  variant: "bare",
275
278
  disabled: false,
276
279
  type: "button",
277
- "aria-label": chinese ? "\u6DFB\u52A0\u8272\u6807" : "Add color stop",
280
+ "aria-label": messages.addColorStop,
278
281
  onClick: ()=>{
279
282
  const added = {
280
283
  color: selected,
@@ -293,7 +296,7 @@ function PickerPanel() {
293
296
  variant: "bare",
294
297
  disabled: false,
295
298
  type: "button",
296
- "aria-label": chinese ? "\u5220\u9664\u8272\u6807" : "Remove color stop",
299
+ "aria-label": messages.removeColorStop,
297
300
  onClick: ()=>{
298
301
  panel.setActive(Math.max(0, activeIndex - 1));
299
302
  panel.change(new external_color_js_Color(stops.filter((_, index_1)=>index_1 !== activeIndex)));
@@ -306,10 +309,10 @@ function PickerPanel() {
306
309
  "data-tao-color-stop-position": "",
307
310
  children: [
308
311
  /*#__PURE__*/ jsx("span", {
309
- children: chinese ? "\u4F4D\u7F6E" : "Position"
312
+ children: messages.colorPosition
310
313
  }),
311
314
  /*#__PURE__*/ jsx(Slider, {
312
- ariaLabelForHandle: chinese ? "\u8272\u6807\u4F4D\u7F6E" : "Stop position",
315
+ ariaLabelForHandle: messages.colorStopPosition,
313
316
  disabled: false,
314
317
  min: 0,
315
318
  max: 100,
@@ -345,8 +348,8 @@ function PickerPanel() {
345
348
  onChange: (next_3)=>changeSelected(new external_color_js_Color(next_3.toRgb()), false),
346
349
  onChangeComplete: (next_4)=>panel.complete(replace(new external_color_js_Color(next_4.toRgb())))
347
350
  }),
348
- t15,
349
- t16
351
+ t16,
352
+ t17
350
353
  ]
351
354
  });
352
355
  }
@@ -365,20 +368,22 @@ function _temp(a, b) {
365
368
  function PresetsPanel() {
366
369
  const $ = c(6);
367
370
  const keyForColor = colorKeys();
368
- const { props, change, chinese } = useContext(PanelContext);
371
+ const { props, change } = useContext(PanelContext);
372
+ const { locale: t0 } = useTaoConfig();
373
+ const { messages } = t0;
369
374
  if (!props.presets?.length) return null;
370
- const t0 = "";
375
+ const t1 = "";
371
376
  const T0 = Collapse;
372
- const t1 = true;
373
- const t2 = false;
374
- const t3 = "small";
375
- let t4;
377
+ const t2 = true;
378
+ const t3 = false;
379
+ const t4 = "small";
380
+ let t5;
376
381
  if ($[0] !== props.presets) {
377
- t4 = props.presets.flatMap(_temp4);
382
+ t5 = props.presets.flatMap(_temp4);
378
383
  $[0] = props.presets;
379
- $[1] = t4;
380
- } else t4 = $[1];
381
- const t5 = props.presets.map((preset_0, index_0)=>({
384
+ $[1] = t5;
385
+ } else t5 = $[1];
386
+ const t6 = props.presets.map((preset_0, index_0)=>({
382
387
  key: String(preset_0.key ?? index_0),
383
388
  label: preset_0.label,
384
389
  children: /*#__PURE__*/ jsx("div", {
@@ -387,7 +392,7 @@ function PresetsPanel() {
387
392
  const color = new external_color_js_Color(value);
388
393
  return /*#__PURE__*/ jsx("button", {
389
394
  type: "button",
390
- "aria-label": `${chinese ? "\u9884\u8BBE" : "Preset"} ${color.isGradient() ? color.toCssString() : color.toHexString()}`,
395
+ "aria-label": `${messages.colorPreset} ${color.isGradient() ? color.toCssString() : color.toHexString()}`,
391
396
  style: {
392
397
  background: color.toCssString()
393
398
  },
@@ -396,24 +401,24 @@ function PresetsPanel() {
396
401
  })
397
402
  })
398
403
  }));
399
- let t6;
400
- if ($[2] !== T0 || $[3] !== t4 || $[4] !== t5) {
401
- t6 = /*#__PURE__*/ jsx("div", {
402
- "data-tao-color-presets": t0,
404
+ let t7;
405
+ if ($[2] !== T0 || $[3] !== t5 || $[4] !== t6) {
406
+ t7 = /*#__PURE__*/ jsx("div", {
407
+ "data-tao-color-presets": t1,
403
408
  children: /*#__PURE__*/ jsx(T0, {
404
- ghost: t1,
405
- disabled: t2,
406
- size: t3,
407
- defaultActiveKey: t4,
408
- items: t5
409
+ ghost: t2,
410
+ disabled: t3,
411
+ size: t4,
412
+ defaultActiveKey: t5,
413
+ items: t6
409
414
  })
410
415
  });
411
416
  $[2] = T0;
412
- $[3] = t4;
413
- $[4] = t5;
414
- $[5] = t6;
415
- } else t6 = $[5];
416
- return t6;
417
+ $[3] = t5;
418
+ $[4] = t6;
419
+ $[5] = t7;
420
+ } else t7 = $[5];
421
+ return t7;
417
422
  }
418
423
  function _temp4(preset, index) {
419
424
  return preset.defaultOpen ?? true ? [
@@ -552,7 +557,7 @@ function ColorPicker(props) {
552
557
  $[21] = t9;
553
558
  } else t9 = $[21];
554
559
  const styles = t9;
555
- const chinese = "zh_CN" === config.locale.locale;
560
+ const { messages } = config.locale;
556
561
  let t10;
557
562
  if ($[22] !== props.disabledAlpha) {
558
563
  t10 = (next)=>props.disabledAlpha && !next.cleared ? opaque(next) : next;
@@ -660,7 +665,7 @@ function ColorPicker(props) {
660
665
  $[48] = t18;
661
666
  } else t18 = $[48];
662
667
  let t19;
663
- if ($[49] !== active || $[50] !== change || $[51] !== chinese || $[52] !== complete || $[53] !== format || $[54] !== mode || $[55] !== modes || $[56] !== panelValue || $[57] !== props || $[58] !== t16 || $[59] !== t17 || $[60] !== t18) {
668
+ if ($[49] !== active || $[50] !== change || $[51] !== complete || $[52] !== format || $[53] !== mode || $[54] !== modes || $[55] !== panelValue || $[56] !== props || $[57] !== t16 || $[58] !== t17 || $[59] !== t18) {
664
669
  t19 = {
665
670
  props,
666
671
  value: panelValue,
@@ -673,43 +678,42 @@ function ColorPicker(props) {
673
678
  setMode: t17,
674
679
  change,
675
680
  complete,
676
- clear: t18,
677
- chinese
681
+ clear: t18
678
682
  };
679
683
  $[49] = active;
680
684
  $[50] = change;
681
- $[51] = chinese;
682
- $[52] = complete;
683
- $[53] = format;
684
- $[54] = mode;
685
- $[55] = modes;
686
- $[56] = panelValue;
687
- $[57] = props;
688
- $[58] = t16;
689
- $[59] = t17;
690
- $[60] = t18;
691
- $[61] = t19;
692
- } else t19 = $[61];
685
+ $[51] = complete;
686
+ $[52] = format;
687
+ $[53] = mode;
688
+ $[54] = modes;
689
+ $[55] = panelValue;
690
+ $[56] = props;
691
+ $[57] = t16;
692
+ $[58] = t17;
693
+ $[59] = t18;
694
+ $[60] = t19;
695
+ } else t19 = $[60];
693
696
  const panelState = t19;
694
697
  let t20;
695
- if ($[62] === Symbol.for("react.memo_cache_sentinel")) {
698
+ if ($[61] === Symbol.for("react.memo_cache_sentinel")) {
696
699
  t20 = /*#__PURE__*/ jsxs(Fragment, {
697
700
  children: [
698
701
  /*#__PURE__*/ jsx(PickerPanel, {}),
699
702
  /*#__PURE__*/ jsx(PresetsPanel, {})
700
703
  ]
701
704
  });
702
- $[62] = t20;
703
- } else t20 = $[62];
705
+ $[61] = t20;
706
+ } else t20 = $[61];
704
707
  const basicPanel = t20;
705
708
  const placement = props.placement ?? "bottomLeft";
706
709
  const side = placement.startsWith("top") ? "top" : placement.startsWith("left") ? "left" : placement.startsWith("right") ? "right" : "bottom";
707
710
  const align = "object" == typeof props.arrow && props.arrow.pointAtCenter ? "center" : /Left|Top/.test(placement) ? "start" : /Right|Bottom/.test(placement) ? "end" : "center";
708
711
  let t21;
709
- if ($[63] !== chinese || $[64] !== format || $[65] !== props.showText || $[66] !== value) {
710
- t21 = "function" == typeof props.showText ? props.showText(value) : value.cleared ? chinese ? "\u900F\u660E" : "Transparent" : value.isGradient() ? chinese ? "\u6E10\u53D8" : "Gradient" : "rgb" === format ? value.toRgbString() : "hsb" === format ? value.toHsbString() : value.toHexString();
711
- $[63] = chinese;
712
- $[64] = format;
712
+ if ($[62] !== format || $[63] !== messages.colorGradient || $[64] !== messages.colorTransparent || $[65] !== props.showText || $[66] !== value) {
713
+ t21 = "function" == typeof props.showText ? props.showText(value) : value.cleared ? messages.colorTransparent : value.isGradient() ? messages.colorGradient : "rgb" === format ? value.toRgbString() : "hsb" === format ? value.toHsbString() : value.toHexString();
714
+ $[62] = format;
715
+ $[63] = messages.colorGradient;
716
+ $[64] = messages.colorTransparent;
713
717
  $[65] = props.showText;
714
718
  $[66] = value;
715
719
  $[67] = t21;
@@ -722,60 +726,61 @@ function ColorPicker(props) {
722
726
  $[69] = t22;
723
727
  } else t22 = $[69];
724
728
  const dataProps = t22;
725
- let t23;
729
+ const t23 = messages.chooseColor;
730
+ let t24;
726
731
  if ($[70] !== value) {
727
- t23 = value.toHexString();
732
+ t24 = value.toHexString();
728
733
  $[70] = value;
729
- $[71] = t23;
730
- } else t23 = $[71];
731
- const t24 = `${chinese ? "\u9009\u62E9\u989C\u8272" : "Choose color"} ${t23}`;
732
- const t25 = names?.body;
733
- const t26 = styles?.body;
734
- const t27 = names?.content;
735
- let t28;
734
+ $[71] = t24;
735
+ } else t24 = $[71];
736
+ const t25 = `${t23} ${t24}`;
737
+ const t26 = names?.body;
738
+ const t27 = styles?.body;
739
+ const t28 = names?.content;
740
+ let t29;
736
741
  if ($[72] !== value) {
737
- t28 = value.toCssString();
742
+ t29 = value.toCssString();
738
743
  $[72] = value;
739
- $[73] = t28;
740
- } else t28 = $[73];
741
- const t29 = styles?.content;
742
- let t30;
743
- if ($[74] !== t28 || $[75] !== t29) {
744
- t30 = {
745
- background: t28,
746
- ...t29
747
- };
748
- $[74] = t28;
749
- $[75] = t29;
750
- $[76] = t30;
751
- } else t30 = $[76];
744
+ $[73] = t29;
745
+ } else t29 = $[73];
746
+ const t30 = styles?.content;
752
747
  let t31;
753
- if ($[77] !== t27 || $[78] !== t30) {
754
- t31 = /*#__PURE__*/ jsx("span", {
755
- "data-tao-color-content": "",
756
- className: t27,
757
- style: t30
758
- });
759
- $[77] = t27;
760
- $[78] = t30;
761
- $[79] = t31;
762
- } else t31 = $[79];
748
+ if ($[74] !== t29 || $[75] !== t30) {
749
+ t31 = {
750
+ background: t29,
751
+ ...t30
752
+ };
753
+ $[74] = t29;
754
+ $[75] = t30;
755
+ $[76] = t31;
756
+ } else t31 = $[76];
763
757
  let t32;
764
- if ($[80] !== t25 || $[81] !== t26 || $[82] !== t31) {
758
+ if ($[77] !== t28 || $[78] !== t31) {
765
759
  t32 = /*#__PURE__*/ jsx("span", {
766
- "data-tao-color-body": "",
767
- className: t25,
768
- style: t26,
769
- children: t31
760
+ "data-tao-color-content": "",
761
+ className: t28,
762
+ style: t31
770
763
  });
771
- $[80] = t25;
772
- $[81] = t26;
773
- $[82] = t31;
774
- $[83] = t32;
775
- } else t32 = $[83];
764
+ $[77] = t28;
765
+ $[78] = t31;
766
+ $[79] = t32;
767
+ } else t32 = $[79];
776
768
  let t33;
769
+ if ($[80] !== t26 || $[81] !== t27 || $[82] !== t32) {
770
+ t33 = /*#__PURE__*/ jsx("span", {
771
+ "data-tao-color-body": "",
772
+ className: t26,
773
+ style: t27,
774
+ children: t32
775
+ });
776
+ $[80] = t26;
777
+ $[81] = t27;
778
+ $[82] = t32;
779
+ $[83] = t33;
780
+ } else t33 = $[83];
781
+ let t34;
777
782
  if ($[84] !== names?.description || $[85] !== props.showText || $[86] !== styles?.description || $[87] !== text) {
778
- t33 = props.showText && /*#__PURE__*/ jsx("span", {
783
+ t34 = props.showText && /*#__PURE__*/ jsx("span", {
779
784
  "data-tao-color-description": "",
780
785
  className: names?.description,
781
786
  style: styles?.description,
@@ -785,60 +790,60 @@ function ColorPicker(props) {
785
790
  $[85] = props.showText;
786
791
  $[86] = styles?.description;
787
792
  $[87] = text;
788
- $[88] = t33;
789
- } else t33 = $[88];
790
- let t34;
791
- if ($[89] !== disabled || $[90] !== t24 || $[91] !== t32 || $[92] !== t33) {
792
- t34 = /*#__PURE__*/ jsxs("button", {
793
+ $[88] = t34;
794
+ } else t34 = $[88];
795
+ let t35;
796
+ if ($[89] !== disabled || $[90] !== t25 || $[91] !== t33 || $[92] !== t34) {
797
+ t35 = /*#__PURE__*/ jsxs("button", {
793
798
  type: "button",
794
799
  disabled: disabled,
795
- "aria-label": t24,
800
+ "aria-label": t25,
796
801
  children: [
797
- t32,
798
- t33
802
+ t33,
803
+ t34
799
804
  ]
800
805
  });
801
806
  $[89] = disabled;
802
- $[90] = t24;
803
- $[91] = t32;
804
- $[92] = t33;
805
- $[93] = t34;
806
- } else t34 = $[93];
807
- const defaultTrigger = t34;
808
- const t35 = "middle" === props.size ? "medium" : props.size ?? config.size;
809
- const t36 = disabled || void 0;
810
- const t37 = names?.root;
811
- let t38;
812
- if ($[94] !== props.className || $[95] !== props.rootClassName || $[96] !== t37) {
813
- t38 = cx(t37, props.className, props.rootClassName);
807
+ $[90] = t25;
808
+ $[91] = t33;
809
+ $[92] = t34;
810
+ $[93] = t35;
811
+ } else t35 = $[93];
812
+ const defaultTrigger = t35;
813
+ const t36 = "middle" === props.size ? "medium" : props.size ?? config.size;
814
+ const t37 = disabled || void 0;
815
+ const t38 = names?.root;
816
+ let t39;
817
+ if ($[94] !== props.className || $[95] !== props.rootClassName || $[96] !== t38) {
818
+ t39 = cx(t38, props.className, props.rootClassName);
814
819
  $[94] = props.className;
815
820
  $[95] = props.rootClassName;
816
- $[96] = t37;
817
- $[97] = t38;
818
- } else t38 = $[97];
819
- const t39 = styles?.root;
820
- let t40;
821
- if ($[98] !== props.style || $[99] !== t39) {
822
- t40 = {
823
- ...t39,
821
+ $[96] = t38;
822
+ $[97] = t39;
823
+ } else t39 = $[97];
824
+ const t40 = styles?.root;
825
+ let t41;
826
+ if ($[98] !== props.style || $[99] !== t40) {
827
+ t41 = {
828
+ ...t40,
824
829
  ...props.style
825
830
  };
826
831
  $[98] = props.style;
827
- $[99] = t39;
828
- $[100] = t40;
829
- } else t40 = $[100];
830
- let t41;
832
+ $[99] = t40;
833
+ $[100] = t41;
834
+ } else t41 = $[100];
835
+ let t42;
831
836
  if ($[101] !== disabled || $[102] !== props.trigger) {
832
- t41 = (event)=>{
837
+ t42 = (event)=>{
833
838
  if ("hover" === props.trigger || disabled) event.preventDefault();
834
839
  };
835
840
  $[101] = disabled;
836
841
  $[102] = props.trigger;
837
- $[103] = t41;
838
- } else t41 = $[103];
839
- let t42;
842
+ $[103] = t42;
843
+ } else t42 = $[103];
844
+ let t43;
840
845
  if ($[104] !== defaultTrigger || $[105] !== disabled || $[106] !== props.children) {
841
- t42 = /*#__PURE__*/ isValidElement(props.children) ? props.children : props.children ? /*#__PURE__*/ jsx("button", {
846
+ t43 = /*#__PURE__*/ isValidElement(props.children) ? props.children : props.children ? /*#__PURE__*/ jsx("button", {
842
847
  type: "button",
843
848
  disabled: disabled,
844
849
  children: props.children
@@ -846,32 +851,31 @@ function ColorPicker(props) {
846
851
  $[104] = defaultTrigger;
847
852
  $[105] = disabled;
848
853
  $[106] = props.children;
849
- $[107] = t42;
850
- } else t42 = $[107];
851
- let t43;
852
- if ($[108] !== enter || $[109] !== leave || $[110] !== t41 || $[111] !== t42) {
853
- t43 = /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_popover_c8444160.Trigger, {
854
+ $[107] = t43;
855
+ } else t43 = $[107];
856
+ let t44;
857
+ if ($[108] !== enter || $[109] !== leave || $[110] !== t42 || $[111] !== t43) {
858
+ t44 = /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_popover_c8444160.Trigger, {
854
859
  asChild: true,
855
860
  onPointerEnter: enter,
856
861
  onPointerLeave: leave,
857
- onClick: t41,
858
- children: t42
862
+ onClick: t42,
863
+ children: t43
859
864
  });
860
865
  $[108] = enter;
861
866
  $[109] = leave;
862
- $[110] = t41;
863
- $[111] = t42;
864
- $[112] = t43;
865
- } else t43 = $[112];
866
- let t44;
867
+ $[110] = t42;
868
+ $[111] = t43;
869
+ $[112] = t44;
870
+ } else t44 = $[112];
871
+ let t45;
867
872
  if ($[113] !== props.getPopupContainer || $[114] !== triggerElement) {
868
- t44 = triggerElement ? props.getPopupContainer?.(triggerElement) : void 0;
873
+ t45 = triggerElement ? props.getPopupContainer?.(triggerElement) : void 0;
869
874
  $[113] = props.getPopupContainer;
870
875
  $[114] = triggerElement;
871
- $[115] = t44;
872
- } else t44 = $[115];
873
- const t45 = props.destroyOnHidden || props.destroyTooltipOnHide ? void 0 : true;
874
- const t46 = chinese ? "\u989C\u8272\u9009\u62E9\u5668" : "Color picker";
876
+ $[115] = t45;
877
+ } else t45 = $[115];
878
+ const t46 = props.destroyOnHidden || props.destroyTooltipOnHide ? void 0 : true;
875
879
  const t47 = props.autoAdjustOverflow ?? true;
876
880
  const t48 = names?.popup?.root;
877
881
  const t49 = styles?.popup?.root;
@@ -957,12 +961,12 @@ function ColorPicker(props) {
957
961
  $[136] = t60;
958
962
  } else t60 = $[136];
959
963
  let t61;
960
- if ($[137] !== align || $[138] !== enter || $[139] !== leave || $[140] !== side || $[141] !== t46 || $[142] !== t47 || $[143] !== t48 || $[144] !== t51 || $[145] !== t52 || $[146] !== t59 || $[147] !== t60) {
964
+ if ($[137] !== align || $[138] !== enter || $[139] !== leave || $[140] !== messages.colorPicker || $[141] !== side || $[142] !== t47 || $[143] !== t48 || $[144] !== t51 || $[145] !== t52 || $[146] !== t59 || $[147] !== t60) {
961
965
  t61 = /*#__PURE__*/ jsx(TaoPortalScope, {
962
966
  asChild: true,
963
967
  children: /*#__PURE__*/ jsxs(__rspack_external__radix_ui_react_popover_c8444160.Content, {
964
968
  "data-tao-color-popup": "",
965
- "aria-label": t46,
969
+ "aria-label": messages.colorPicker,
966
970
  side: side,
967
971
  align: align,
968
972
  sideOffset: 6,
@@ -982,8 +986,8 @@ function ColorPicker(props) {
982
986
  $[137] = align;
983
987
  $[138] = enter;
984
988
  $[139] = leave;
985
- $[140] = side;
986
- $[141] = t46;
989
+ $[140] = messages.colorPicker;
990
+ $[141] = side;
987
991
  $[142] = t47;
988
992
  $[143] = t48;
989
993
  $[144] = t51;
@@ -993,50 +997,50 @@ function ColorPicker(props) {
993
997
  $[148] = t61;
994
998
  } else t61 = $[148];
995
999
  let t62;
996
- if ($[149] !== t44 || $[150] !== t45 || $[151] !== t61) {
1000
+ if ($[149] !== t45 || $[150] !== t46 || $[151] !== t61) {
997
1001
  t62 = /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_popover_c8444160.Portal, {
998
- container: t44,
999
- forceMount: t45,
1002
+ container: t45,
1003
+ forceMount: t46,
1000
1004
  children: t61
1001
1005
  });
1002
- $[149] = t44;
1003
- $[150] = t45;
1006
+ $[149] = t45;
1007
+ $[150] = t46;
1004
1008
  $[151] = t61;
1005
1009
  $[152] = t62;
1006
1010
  } else t62 = $[152];
1007
1011
  let t63;
1008
- if ($[153] !== open || $[154] !== openChange || $[155] !== t43 || $[156] !== t62) {
1012
+ if ($[153] !== open || $[154] !== openChange || $[155] !== t44 || $[156] !== t62) {
1009
1013
  t63 = /*#__PURE__*/ jsxs(__rspack_external__radix_ui_react_popover_c8444160.Root, {
1010
1014
  open: open,
1011
1015
  onOpenChange: openChange,
1012
1016
  children: [
1013
- t43,
1017
+ t44,
1014
1018
  t62
1015
1019
  ]
1016
1020
  });
1017
1021
  $[153] = open;
1018
1022
  $[154] = openChange;
1019
- $[155] = t43;
1023
+ $[155] = t44;
1020
1024
  $[156] = t62;
1021
1025
  $[157] = t63;
1022
1026
  } else t63 = $[157];
1023
1027
  let t64;
1024
- if ($[158] !== dataProps || $[159] !== t35 || $[160] !== t36 || $[161] !== t38 || $[162] !== t40 || $[163] !== t63) {
1028
+ if ($[158] !== dataProps || $[159] !== t36 || $[160] !== t37 || $[161] !== t39 || $[162] !== t41 || $[163] !== t63) {
1025
1029
  t64 = /*#__PURE__*/ jsx("span", {
1026
1030
  ref: setTriggerElement,
1027
1031
  "data-tao-color-picker": "",
1028
- "data-tao-size": t35,
1029
- "data-disabled": t36,
1030
- className: t38,
1031
- style: t40,
1032
+ "data-tao-size": t36,
1033
+ "data-disabled": t37,
1034
+ className: t39,
1035
+ style: t41,
1032
1036
  ...dataProps,
1033
1037
  children: t63
1034
1038
  });
1035
1039
  $[158] = dataProps;
1036
- $[159] = t35;
1037
- $[160] = t36;
1038
- $[161] = t38;
1039
- $[162] = t40;
1040
+ $[159] = t36;
1041
+ $[160] = t37;
1042
+ $[161] = t39;
1043
+ $[162] = t41;
1040
1044
  $[163] = t63;
1041
1045
  $[164] = t64;
1042
1046
  } else t64 = $[164];