@rockshin/tao-ui 0.0.45 → 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 (114) hide show
  1. package/README.md +3 -1
  2. package/component-manifest.json +32 -3
  3. package/dist/components/alert/alert.js +20 -17
  4. package/dist/components/avatar/avatar.js +2 -1
  5. package/dist/components/breadcrumb/breadcrumb.js +81 -77
  6. package/dist/components/calendar/calendar.d.ts +0 -1
  7. package/dist/components/calendar/calendar.js +41 -30
  8. package/dist/components/color-picker/color-picker.js +273 -269
  9. package/dist/components/date-picker/calendar/calendar-grid.js +10 -4
  10. package/dist/components/date-picker/calendar/use-calendar.d.ts +2 -2
  11. package/dist/components/date-picker/calendar/use-calendar.js +2 -3
  12. package/dist/components/date-picker/date-localization.d.ts +3 -0
  13. package/dist/components/date-picker/date-localization.js +76 -0
  14. package/dist/components/date-picker/date-picker.js +35 -27
  15. package/dist/components/date-picker/range-picker.js +28 -20
  16. package/dist/components/dropdown/dropdown.js +21 -20
  17. package/dist/components/float-button/float-button.js +3 -2
  18. package/dist/components/form/form.js +88 -103
  19. package/dist/components/image/image.js +202 -137
  20. package/dist/components/list/list-pagination.js +148 -147
  21. package/dist/components/modal/confirm-dialog.js +4 -2
  22. package/dist/components/modal/modal.js +385 -383
  23. package/dist/components/pagination/pagination.js +115 -110
  24. package/dist/components/popconfirm/popconfirm.js +109 -107
  25. package/dist/components/qr-code/qr-code.js +22 -21
  26. package/dist/components/scroll-area/scroll-area.js +41 -38
  27. package/dist/components/select/mobile-select.d.ts +1 -1
  28. package/dist/components/select/mobile-select.js +2 -1
  29. package/dist/components/sonner/sonner.js +10 -10
  30. package/dist/components/spinner/spinner.js +1 -1
  31. package/dist/components/splitter/splitter.js +24 -21
  32. package/dist/components/statistic/statistic.d.ts +2 -0
  33. package/dist/components/statistic/statistic.js +203 -187
  34. package/dist/components/table/table-filter.js +61 -52
  35. package/dist/components/table/table-icons.js +3 -1
  36. package/dist/components/table/table.d.ts +1 -1
  37. package/dist/components/table/table.js +5 -4
  38. package/dist/components/tag/tag.js +22 -19
  39. package/dist/components/time-picker/time-picker.d.ts +0 -1
  40. package/dist/components/time-picker/time-picker.js +139 -96
  41. package/dist/components/transfer/transfer-list.js +224 -488
  42. package/dist/components/transfer/transfer-parts.js +2 -2
  43. package/dist/components/transfer/transfer-types.d.ts +1 -0
  44. package/dist/components/transfer/transfer.js +13 -16
  45. package/dist/components/upload/upload.js +30 -26
  46. package/dist/docs/component-docs.d.ts +13 -2
  47. package/dist/docs/components/headless-input-number.doc.d.ts +5 -0
  48. package/dist/docs/components/headless-input-number.doc.js +7 -0
  49. package/dist/docs/components/input-number.doc.d.ts +5 -0
  50. package/dist/docs/components/input-number.doc.js +7 -0
  51. package/dist/docs/components/statistic.doc.d.ts +5 -0
  52. package/dist/docs/components/statistic.doc.js +7 -0
  53. package/dist/docs/components/tao-provider.doc.d.ts +8 -2
  54. package/dist/docs/components/tao-provider.doc.js +10 -2
  55. package/dist/docs/components/tooltip.doc.d.ts +2 -2
  56. package/dist/entries/provider.d.ts +1 -0
  57. package/dist/entries/provider.js +1 -0
  58. package/dist/index.d.ts +1 -0
  59. package/dist/index.js +1 -0
  60. package/dist/locales/ar-EG.d.ts +3 -0
  61. package/dist/locales/ar-EG.js +199 -0
  62. package/dist/locales/create-locale.d.ts +41 -0
  63. package/dist/locales/create-locale.js +88 -0
  64. package/dist/locales/de-DE.d.ts +3 -0
  65. package/dist/locales/de-DE.js +195 -0
  66. package/dist/locales/en-US.d.ts +2 -0
  67. package/dist/locales/en-US.js +194 -0
  68. package/dist/locales/es-ES.d.ts +3 -0
  69. package/dist/locales/es-ES.js +195 -0
  70. package/dist/locales/fr-FR.d.ts +3 -0
  71. package/dist/locales/fr-FR.js +195 -0
  72. package/dist/locales/hi-IN.d.ts +3 -0
  73. package/dist/locales/hi-IN.js +194 -0
  74. package/dist/locales/id-ID.d.ts +3 -0
  75. package/dist/locales/id-ID.js +194 -0
  76. package/dist/locales/index.d.ts +18 -0
  77. package/dist/locales/index.js +17 -0
  78. package/dist/locales/it-IT.d.ts +3 -0
  79. package/dist/locales/it-IT.js +195 -0
  80. package/dist/locales/ja-JP.d.ts +3 -0
  81. package/dist/locales/ja-JP.js +194 -0
  82. package/dist/locales/ko-KR.d.ts +3 -0
  83. package/dist/locales/ko-KR.js +194 -0
  84. package/dist/locales/pt-BR.d.ts +3 -0
  85. package/dist/locales/pt-BR.js +195 -0
  86. package/dist/locales/ru-RU.d.ts +3 -0
  87. package/dist/locales/ru-RU.js +197 -0
  88. package/dist/locales/th-TH.d.ts +3 -0
  89. package/dist/locales/th-TH.js +194 -0
  90. package/dist/locales/tr-TR.d.ts +3 -0
  91. package/dist/locales/tr-TR.js +194 -0
  92. package/dist/locales/types.d.ts +176 -0
  93. package/dist/locales/types.js +0 -0
  94. package/dist/locales/vi-VN.d.ts +3 -0
  95. package/dist/locales/vi-VN.js +194 -0
  96. package/dist/locales/zh-CN.d.ts +3 -0
  97. package/dist/locales/zh-CN.js +194 -0
  98. package/dist/locales/zh-TW.d.ts +3 -0
  99. package/dist/locales/zh-TW.js +194 -0
  100. package/dist/number-input/format.d.ts +4 -3
  101. package/dist/number-input/format.js +9 -7
  102. package/dist/number-input/locale.d.ts +19 -0
  103. package/dist/number-input/locale.js +44 -0
  104. package/dist/number-input/number-input.js +1 -0
  105. package/dist/number-input/use-number-input.d.ts +2 -0
  106. package/dist/number-input/use-number-input.js +180 -176
  107. package/dist/provider/locale.d.ts +3 -65
  108. package/dist/provider/locale.js +2 -146
  109. package/dist/provider/merge-locale.d.ts +8 -0
  110. package/dist/provider/merge-locale.js +53 -0
  111. package/dist/provider/tao-provider.d.ts +6 -2
  112. package/dist/provider/tao-provider.js +2 -4
  113. package/llms.txt +1 -1
  114. package/package.json +5 -1
@@ -38,7 +38,7 @@ function TransferSearch(t0) {
38
38
  "data-tao-transfer-clear": "",
39
39
  type: "button",
40
40
  disabled: disabled,
41
- "aria-label": locale.locale?.startsWith("zh") ? "\u6E05\u7A7A\u641C\u7D22" : "Clear search",
41
+ "aria-label": locale.messages.clearSearch,
42
42
  onClick: handleClear,
43
43
  children: "\xd7"
44
44
  }) : void 0;
@@ -94,7 +94,7 @@ function TransferOperation(t0) {
94
94
  }
95
95
  });
96
96
  }
97
- const label = locale.locale?.startsWith("zh") ? right ? "\u79FB\u81F3\u76EE\u6807" : "\u79FB\u81F3\u6E90\u5217\u8868" : right ? "Move to target" : "Move to source";
97
+ const label = right ? locale.messages.moveToTarget : locale.messages.moveToSource;
98
98
  return /*#__PURE__*/ jsx(Button, {
99
99
  size: "small",
100
100
  disabled: inactive,
@@ -42,6 +42,7 @@ export interface TransferLocale {
42
42
  searchPlaceholder: string;
43
43
  itemUnit: string;
44
44
  itemsUnit: string;
45
+ itemCount?: (count: number) => string;
45
46
  remove?: string;
46
47
  selectAll?: string;
47
48
  deselectAll?: string;
@@ -10,25 +10,22 @@ function TransferRoot(props, ref) {
10
10
  const { prefixCls = 'tao-transfer', rootClassName, className, classNames, style, styles, listStyle, operationStyle, disabled, dataSource = [], targetKeys = [], selectedKeys, render, onChange, onSelectChange, titles, operations, actions, showSearch, filterOption, locale, footer, rowKey, onSearch, onScroll, children, showSelectAll = true, selectAllLabels = [], oneWay, pagination, status, selectionsIcon, ...rest } = props;
11
11
  const config = useTaoConfig();
12
12
  const resolvedDisabled = disabled ?? config.disabled;
13
- const chinese = config.locale.locale?.startsWith('zh');
14
13
  const text = {
15
- titles: chinese ? [
16
- '源列表',
17
- '目标列表'
18
- ] : [
19
- 'Source',
20
- 'Target'
14
+ titles: [
15
+ config.locale.messages.source,
16
+ config.locale.messages.target
21
17
  ],
22
18
  searchPlaceholder: config.locale.searchPlaceholder,
23
- itemUnit: chinese ? '项' : 'item',
24
- itemsUnit: chinese ? '项' : 'items',
25
- remove: chinese ? '移除' : 'Remove',
26
- selectAll: chinese ? '全选' : 'Select all',
27
- deselectAll: chinese ? '取消全选' : 'Deselect all',
28
- selectCurrent: chinese ? '选择当前页' : 'Select current page',
29
- selectInvert: chinese ? '反选当前页' : 'Invert current selection',
30
- removeAll: chinese ? '移除全部' : 'Remove all',
31
- removeCurrent: chinese ? '移除当前页' : 'Remove current page',
19
+ itemUnit: config.locale.messages.itemUnit,
20
+ itemsUnit: config.locale.messages.itemsUnit,
21
+ itemCount: locale?.itemUnit !== void 0 || locale?.itemsUnit !== void 0 ? void 0 : config.locale.messages.itemCount,
22
+ remove: config.locale.remove('').trim(),
23
+ selectAll: config.locale.messages.selectAll,
24
+ deselectAll: config.locale.messages.deselectAll,
25
+ selectCurrent: config.locale.messages.selectCurrent,
26
+ selectInvert: config.locale.messages.invertCurrent,
27
+ removeAll: config.locale.messages.removeAll,
28
+ removeCurrent: config.locale.messages.removeCurrent,
32
29
  ...locale
33
30
  };
34
31
  const mergedProps = {
@@ -23,29 +23,30 @@ function toFile(file) {
23
23
  percent: 0
24
24
  };
25
25
  }
26
- function readPreview(file) {
26
+ function readPreview(file, failureMessage) {
27
27
  return new Promise((resolve, reject)=>{
28
28
  const reader = new FileReader();
29
29
  reader.onload = ()=>resolve(String(reader.result));
30
- reader.onerror = ()=>reject(reader.error ?? new Error('Unable to read file preview'));
30
+ reader.onerror = ()=>reject(reader.error ?? new Error(failureMessage));
31
31
  reader.readAsDataURL(file);
32
32
  });
33
33
  }
34
34
  function FilePreview(t0) {
35
- const $ = c(11);
35
+ const $ = c(13);
36
36
  const { file, previewFile } = t0;
37
+ const { locale } = useTaoConfig();
37
38
  const [preview, setPreview] = useState();
38
39
  const [error, setError] = useState();
39
40
  let t1;
40
41
  let t2;
41
- if ($[0] !== file.originFileObj || $[1] !== file.thumbUrl || $[2] !== file.url || $[3] !== previewFile) {
42
+ if ($[0] !== file.originFileObj || $[1] !== file.thumbUrl || $[2] !== file.url || $[3] !== locale.messages.previewUnavailable || $[4] !== locale.messages.readFileError || $[5] !== previewFile) {
42
43
  t1 = ()=>{
43
44
  if (file.thumbUrl || file.url || !file.originFileObj) return;
44
45
  let active = true;
45
- Promise.resolve((previewFile ?? readPreview)(file.originFileObj)).then((value)=>{
46
+ Promise.resolve(previewFile ? previewFile(file.originFileObj) : readPreview(file.originFileObj, locale.messages.readFileError)).then((value)=>{
46
47
  if (active) setPreview(value);
47
48
  }, (reason)=>{
48
- if (active) setError(reason instanceof Error ? reason.message : "Preview unavailable");
49
+ if (active) setError(reason instanceof Error ? reason.message : locale.messages.previewUnavailable);
49
50
  });
50
51
  return ()=>{
51
52
  active = false;
@@ -55,22 +56,26 @@ function FilePreview(t0) {
55
56
  file.originFileObj,
56
57
  file.thumbUrl,
57
58
  file.url,
58
- previewFile
59
+ previewFile,
60
+ locale.messages.readFileError,
61
+ locale.messages.previewUnavailable
59
62
  ];
60
63
  $[0] = file.originFileObj;
61
64
  $[1] = file.thumbUrl;
62
65
  $[2] = file.url;
63
- $[3] = previewFile;
64
- $[4] = t1;
65
- $[5] = t2;
66
+ $[3] = locale.messages.previewUnavailable;
67
+ $[4] = locale.messages.readFileError;
68
+ $[5] = previewFile;
69
+ $[6] = t1;
70
+ $[7] = t2;
66
71
  } else {
67
- t1 = $[4];
68
- t2 = $[5];
72
+ t1 = $[6];
73
+ t2 = $[7];
69
74
  }
70
75
  useEffect(t1, t2);
71
76
  const src = file.thumbUrl ?? file.url ?? preview;
72
77
  let t3;
73
- if ($[6] !== error || $[7] !== file.crossOrigin || $[8] !== file.name || $[9] !== src) {
78
+ if ($[8] !== error || $[9] !== file.crossOrigin || $[10] !== file.name || $[11] !== src) {
74
79
  t3 = error ? /*#__PURE__*/ jsx("span", {
75
80
  role: "status",
76
81
  children: error
@@ -82,12 +87,12 @@ function FilePreview(t0) {
82
87
  "aria-hidden": "true",
83
88
  children: "▧"
84
89
  });
85
- $[6] = error;
86
- $[7] = file.crossOrigin;
87
- $[8] = file.name;
88
- $[9] = src;
89
- $[10] = t3;
90
- } else t3 = $[10];
90
+ $[8] = error;
91
+ $[9] = file.crossOrigin;
92
+ $[10] = file.name;
93
+ $[11] = src;
94
+ $[12] = t3;
95
+ } else t3 = $[12];
91
96
  return t3;
92
97
  }
93
98
  function FileIcon(t0) {
@@ -144,12 +149,11 @@ const UploadRoot = /*#__PURE__*/ forwardRef((props, ref)=>{
144
149
  disabled
145
150
  }
146
151
  }) : props.styles;
147
- const chinese = 'zh_CN' === config.locale.locale;
148
152
  const locale = {
149
- removeFile: chinese ? '删除文件' : 'Remove file',
150
- previewFile: chinese ? '预览文件' : 'Preview file',
151
- downloadFile: chinese ? '下载文件' : 'Download file',
152
- uploadError: chinese ? '上传失败' : 'Upload failed',
153
+ removeFile: config.locale.messages.removeFile,
154
+ previewFile: config.locale.messages.previewFile,
155
+ downloadFile: config.locale.messages.downloadFile,
156
+ uploadError: config.locale.messages.uploadError,
153
157
  ...props.locale
154
158
  };
155
159
  const current = ()=>propsRef.current.fileList ?? filesRef.current;
@@ -232,7 +236,7 @@ const UploadRoot = /*#__PURE__*/ forwardRef((props, ref)=>{
232
236
  }, items_0.filter((item_5)=>item_5.uid !== file_6.uid));
233
237
  setRemoveError(void 0);
234
238
  } catch (error_0) {
235
- setRemoveError(error_0 instanceof Error ? error_0.message : 'Unable to remove file');
239
+ setRemoveError(error_0 instanceof Error ? error_0.message : config.locale.messages.removeFileError);
236
240
  }
237
241
  };
238
242
  const download = (file_7)=>{
@@ -303,7 +307,7 @@ const UploadRoot = /*#__PURE__*/ forwardRef((props, ref)=>{
303
307
  setDragging(false);
304
308
  props.onDrop?.(event_3);
305
309
  },
306
- children: props.children ?? ('drag' === type ? chinese ? '点击或拖动文件到此区域上传' : 'Click or drop files here to upload' : chinese ? '上传文件' : 'Upload files')
310
+ children: props.children ?? ('drag' === type ? config.locale.messages.uploadDrop : config.locale.messages.uploadFile)
307
311
  })
308
312
  }),
309
313
  false !== props.showUploadList && /*#__PURE__*/ jsx("span", {
@@ -98,6 +98,11 @@ export declare const componentDocs: ({
98
98
  tests: string[];
99
99
  keywords: string[];
100
100
  related: string[];
101
+ props: {
102
+ name: string;
103
+ type: string;
104
+ description: string;
105
+ }[];
101
106
  usage: {
102
107
  description: string;
103
108
  bestPractices: string[];
@@ -131,11 +136,17 @@ export declare const componentDocs: ({
131
136
  bestPractices: string[];
132
137
  avoid: string[];
133
138
  };
134
- props: {
139
+ props: ({
135
140
  name: string;
136
141
  type: string;
142
+ defaultValue: string;
137
143
  description: string;
138
- }[];
144
+ } | {
145
+ defaultValue?: undefined;
146
+ name: string;
147
+ type: string;
148
+ description: string;
149
+ })[];
139
150
  } | {
140
151
  name: string;
141
152
  displayName: string;
@@ -9,6 +9,11 @@ export declare const headlessInputNumberDoc: {
9
9
  tests: string[];
10
10
  keywords: string[];
11
11
  related: string[];
12
+ props: {
13
+ name: string;
14
+ type: string;
15
+ description: string;
16
+ }[];
12
17
  usage: {
13
18
  description: string;
14
19
  bestPractices: string[];
@@ -25,6 +25,13 @@ const headlessInputNumberDoc = {
25
25
  related: [
26
26
  'InputNumber'
27
27
  ],
28
+ props: [
29
+ {
30
+ name: 'locale',
31
+ type: 'string',
32
+ description: 'BCP 47 numeric locale, also accepted by useNumberInput. Inherits TaoProvider numberLocale; explicit separators win. Canonical values and callbacks remain exact ASCII strings.'
33
+ }
34
+ ],
28
35
  usage: {
29
36
  description: 'Use the headless API when tao-ui styling is not appropriate but number formatting behavior should stay consistent.',
30
37
  bestPractices: [
@@ -10,6 +10,11 @@ export declare const inputNumberDoc: {
10
10
  semanticParts: string[];
11
11
  keywords: string[];
12
12
  related: string[];
13
+ props: {
14
+ name: string;
15
+ type: string;
16
+ description: string;
17
+ }[];
13
18
  usage: {
14
19
  description: string;
15
20
  bestPractices: string[];
@@ -26,6 +26,13 @@ const inputNumberDoc = {
26
26
  'HeadlessInputNumber',
27
27
  'Input'
28
28
  ],
29
+ props: [
30
+ {
31
+ name: 'locale',
32
+ type: 'string',
33
+ description: 'BCP 47 numeric locale. Inherits TaoProvider numberLocale; explicit decimalSeparator/thousandsSeparator override regional symbols. Callbacks keep exact canonical ASCII strings.'
34
+ }
35
+ ],
29
36
  usage: {
30
37
  description: 'Use InputNumber for numeric values that need min, max, step, precision, or formatted display.',
31
38
  bestPractices: [
@@ -7,6 +7,11 @@ export declare const statisticDoc: {
7
7
  source: string;
8
8
  story: string;
9
9
  tests: string[];
10
+ props: {
11
+ name: string;
12
+ type: string;
13
+ description: string;
14
+ }[];
10
15
  semanticParts: string[];
11
16
  usage: {
12
17
  description: string;
@@ -11,6 +11,13 @@ const statisticDoc = {
11
11
  tests: [
12
12
  'tests/statistic/statistic.test.tsx'
13
13
  ],
14
+ props: [
15
+ {
16
+ name: 'locale',
17
+ type: 'string',
18
+ description: 'BCP 47 numeric locale. Inherits TaoProvider numberLocale. Explicit separators and formatter take precedence; string precision and truncation semantics are preserved.'
19
+ }
20
+ ],
14
21
  semanticParts: [
15
22
  'root',
16
23
  'header',
@@ -14,9 +14,15 @@ export declare const taoProviderDoc: {
14
14
  bestPractices: string[];
15
15
  avoid: string[];
16
16
  };
17
- props: {
17
+ props: ({
18
18
  name: string;
19
19
  type: string;
20
+ defaultValue: string;
20
21
  description: string;
21
- }[];
22
+ } | {
23
+ defaultValue?: undefined;
24
+ name: string;
25
+ type: string;
26
+ description: string;
27
+ })[];
22
28
  };
@@ -2,7 +2,7 @@ const taoProviderDoc = {
2
2
  name: 'tao-provider',
3
3
  displayName: 'TaoProvider',
4
4
  category: 'Config',
5
- description: 'Provides global component defaults, portal scoping, and theme seed token overrides.',
5
+ description: 'Provides global component defaults, 17 locales with date and number regional settings, portal scoping, and theme seed token overrides.',
6
6
  exports: [
7
7
  'TaoProvider'
8
8
  ],
@@ -16,7 +16,9 @@ const taoProviderDoc = {
16
16
  'theme',
17
17
  'tokens',
18
18
  'size',
19
- 'disabled'
19
+ 'disabled',
20
+ 'locale',
21
+ 'internationalization'
20
22
  ],
21
23
  related: [
22
24
  'Button',
@@ -34,6 +36,12 @@ const taoProviderDoc = {
34
36
  ]
35
37
  },
36
38
  props: [
39
+ {
40
+ name: 'locale',
41
+ type: 'Partial<TaoLocale>',
42
+ defaultValue: 'enUS',
43
+ description: 'Component text, accessible names, form validation and regional date/number settings. Missing keys inherit from the parent; explicit component overrides win. Direction is independent.'
44
+ },
37
45
  {
38
46
  name: 'direction',
39
47
  type: "'ltr' | 'rtl'",
@@ -16,11 +16,11 @@ export declare const tooltipDoc: {
16
16
  avoid: string[];
17
17
  };
18
18
  props: ({
19
+ defaultValue?: undefined;
19
20
  name: string;
20
21
  type: string;
21
22
  description: string;
22
23
  required: true;
23
- defaultValue?: undefined;
24
24
  } | {
25
25
  required?: undefined;
26
26
  name: string;
@@ -28,8 +28,8 @@ export declare const tooltipDoc: {
28
28
  description: string;
29
29
  defaultValue: string;
30
30
  } | {
31
- required?: undefined;
32
31
  defaultValue?: undefined;
32
+ required?: undefined;
33
33
  name: string;
34
34
  type: string;
35
35
  description: string;
@@ -1,3 +1,4 @@
1
1
  import '../theme/theme.css';
2
2
  import '../theme/control.css';
3
3
  export { type ButtonComponentToken, enUS, type FormFieldComponentToken, type InputComponentToken, type TaoComponentTokenMap, type TaoConfig, type TaoDirection, type TaoLocale, TaoProvider, type TaoProviderProps, type TaoSeedToken, type TaoSize, type TaoStatus, type TaoThemeConfig, type TaoThemeMode, type TaoVariant, useTaoConfig, useTaoToken, zhCN, } from '../provider/tao-provider.js';
4
+ export { arEG, deDE, esES, frFR, hiIN, idID, itIT, jaJP, koKR, ptBR, ruRU, thTH, trTR, viVN, zhTW, type BuiltinTaoLocale, type TaoMessages, } from '../locales/index.js';
@@ -2,3 +2,4 @@
2
2
  import "../theme/theme.css";
3
3
  import "../theme/control.css";
4
4
  export { TaoProvider, enUS, useTaoConfig, useTaoToken, zhCN } from "../provider/tao-provider.js";
5
+ export { arEG, deDE, esES, frFR, hiIN, idID, itIT, jaJP, koKR, ptBR, ruRU, thTH, trTR, viVN, zhTW } from "../locales/index.js";
package/dist/index.d.ts CHANGED
@@ -81,6 +81,7 @@ export { FormLayout, type FormLayoutProps, type FormLayoutSemanticPart, } from '
81
81
  export { Stack, type StackProps, type StackSemanticPart, } from './layouts/stack/stack.js';
82
82
  export { type FormatOptions, HeadlessInputNumber, type HeadlessInputNumberProps, NumberInput, type NumberInputProps, type PadDecimalsOnBlur, type UseNumberInputOptions, type UseNumberInputReturn, useNumberInput, } from './number-input/index.js';
83
83
  export { type ButtonComponentToken, enUS, type FormFieldComponentToken, type InputComponentToken, type TaoComponentTokenMap, type TaoConfig, type TaoDirection, type TaoLocale, TaoProvider, type TaoProviderProps, type TaoSeedToken, type TaoSize, type TaoStatus, type TaoThemeConfig, type TaoThemeMode, type TaoVariant, useTaoConfig, useTaoToken, zhCN, } from './provider/tao-provider.js';
84
+ export { arEG, deDE, esES, frFR, hiIN, idID, itIT, jaJP, koKR, ptBR, ruRU, thTH, trTR, viVN, zhTW, type BuiltinTaoLocale, type TaoMessages, } from './locales/index.js';
84
85
  export { type TaoTokenName, taoTokenNames, tokenVar } from './theme/tokens.js';
85
86
  export { resolveResponsiveValue, type TaoBreakpoint, type TaoBreakpointMap, type TaoResponsiveValue, useBreakpoint, useIsMobile, } from './utils/breakpoint.js';
86
87
  export { cx, type SemanticClassNames, type SemanticStyles, } from './utils/semantic.js';
package/dist/index.js CHANGED
@@ -73,6 +73,7 @@ export { FormLayout } from "./layouts/form-layout/form-layout.js";
73
73
  export { Stack } from "./layouts/stack/stack.js";
74
74
  export { HeadlessInputNumber, NumberInput, useNumberInput } from "./number-input/index.js";
75
75
  export { TaoProvider, enUS, useTaoConfig, useTaoToken, zhCN } from "./provider/tao-provider.js";
76
+ export { arEG, deDE, esES, frFR, hiIN, idID, itIT, jaJP, koKR, ptBR, ruRU, thTH, trTR, viVN, zhTW } from "./locales/index.js";
76
77
  export { taoTokenNames, tokenVar } from "./theme/tokens.js";
77
78
  export { resolveResponsiveValue, useBreakpoint, useIsMobile } from "./utils/breakpoint.js";
78
79
  export { cx } from "./utils/semantic.js";
@@ -0,0 +1,3 @@
1
+ import 'dayjs/locale/ar';
2
+ export declare const arEG: import("./types.js").BuiltinTaoLocale;
3
+ export default arEG;
@@ -0,0 +1,199 @@
1
+ import ar_EG from "@rc-component/picker/locale/ar_EG";
2
+ import "dayjs/locale/ar";
3
+ import { createFormMessages, createItemCount, createLocale } from "./create-locale.js";
4
+ const arEG = createLocale({
5
+ locale: 'ar_EG',
6
+ numberLocale: 'ar-EG',
7
+ dayjsLocale: 'ar',
8
+ weekStartsOn: 6,
9
+ pickerLocale: ar_EG,
10
+ select: 'اختيار',
11
+ searchPlaceholder: 'بحث…',
12
+ search: 'بحث',
13
+ showPassword: 'إظهار كلمة المرور',
14
+ hidePassword: 'إخفاء كلمة المرور',
15
+ otpLabel: (index, length)=>`الحرف ${index} من ${length}`,
16
+ searchOptions: 'البحث في الخيارات',
17
+ noResults: 'لا توجد نتائج',
18
+ emptyDescription: 'لا توجد بيانات',
19
+ done: 'تم',
20
+ clear: 'مسح',
21
+ close: 'إغلاق',
22
+ remove: (label)=>`إزالة ${label}`,
23
+ dateTime: 'التاريخ والوقت',
24
+ selectDate: 'اختيار التاريخ',
25
+ selectTime: 'اختيار الوقت',
26
+ startTime: 'وقت البدء',
27
+ endTime: 'وقت الانتهاء',
28
+ dateRange: 'اختيار نطاق التاريخ',
29
+ startDate: 'تاريخ البدء',
30
+ endDate: 'تاريخ الانتهاء',
31
+ now: 'الآن',
32
+ ok: 'موافق',
33
+ cancel: 'إلغاء',
34
+ previous: 'السابق',
35
+ next: 'التالي',
36
+ previousMonth: 'الشهر السابق',
37
+ nextMonth: 'الشهر التالي',
38
+ previousYear: 'السنة السابقة',
39
+ nextYear: 'السنة التالية',
40
+ hour: 'ساعة',
41
+ minute: 'دقيقة',
42
+ second: 'ثانية',
43
+ qrCode: {
44
+ expired: 'انتهت صلاحية رمز QR',
45
+ refresh: 'تحديث',
46
+ scanned: 'تم المسح'
47
+ },
48
+ messages: {
49
+ tableEmpty: 'لا توجد بيانات',
50
+ loading: 'جارٍ التحميل',
51
+ pagination: 'التنقل بين الصفحات',
52
+ previousPage: 'الصفحة السابقة',
53
+ nextPage: 'الصفحة التالية',
54
+ itemsPerPage: '/ صفحة',
55
+ pageSize: 'عدد العناصر في الصفحة',
56
+ jumpTo: 'انتقال إلى',
57
+ jumpToConfirm: 'انتقال',
58
+ previousPages: 'الصفحات السابقة',
59
+ nextPages: 'الصفحات التالية',
60
+ selectAllRows: 'تحديد جميع الصفوف',
61
+ expandRow: 'توسيع الصف',
62
+ collapseRow: 'طي الصف',
63
+ uploadFile: 'رفع ملفات',
64
+ uploadDrop: 'انقر أو اسحب الملفات إلى هنا لرفعها',
65
+ removeFile: 'إزالة الملف',
66
+ previewFile: 'معاينة الملف',
67
+ downloadFile: 'تنزيل الملف',
68
+ uploadError: 'فشل الرفع',
69
+ previewUnavailable: 'المعاينة غير متاحة',
70
+ source: 'المصدر',
71
+ target: 'الوجهة',
72
+ itemUnit: 'عنصر',
73
+ itemsUnit: 'عناصر',
74
+ selectAll: 'تحديد الكل',
75
+ deselectAll: 'إلغاء تحديد الكل',
76
+ selectCurrent: 'تحديد الصفحة الحالية',
77
+ invertCurrent: 'عكس التحديد الحالي',
78
+ removeAll: 'إزالة الكل',
79
+ removeCurrent: 'إزالة الصفحة الحالية',
80
+ moveToTarget: 'نقل إلى الوجهة',
81
+ moveToSource: 'نقل إلى المصدر',
82
+ clearSearch: 'مسح البحث',
83
+ calendarYear: 'السنة',
84
+ calendarMonth: 'الشهر',
85
+ calendarView: 'عرض التقويم',
86
+ zoomIn: 'تكبير',
87
+ zoomOut: 'تصغير',
88
+ rotateLeft: 'تدوير لليسار',
89
+ rotateRight: 'تدوير لليمين',
90
+ flipX: 'قلب أفقي',
91
+ flipY: 'قلب عمودي',
92
+ colorMode: 'وضع اللون',
93
+ colorSingle: 'لون موحد',
94
+ colorGradient: 'تدرج',
95
+ colorStop: 'نقطة لون',
96
+ addColorStop: 'إضافة نقطة لون',
97
+ removeColorStop: 'إزالة نقطة اللون',
98
+ colorPosition: 'الموضع',
99
+ colorStopPosition: 'موضع النقطة',
100
+ colorFormat: 'تنسيق اللون',
101
+ colorHex: 'لون بالنظام الست عشري',
102
+ colorRed: 'أحمر',
103
+ colorGreen: 'أخضر',
104
+ colorBlue: 'أزرق',
105
+ colorHue: 'درجة اللون',
106
+ colorSaturation: 'التشبع',
107
+ colorBrightness: 'السطوع',
108
+ colorAlpha: 'العتامة',
109
+ clearColor: 'مسح اللون',
110
+ colorPreset: 'إعداد مسبق',
111
+ colorTransparent: 'شفاف',
112
+ chooseColor: 'اختيار لون',
113
+ colorPicker: 'منتقي الألوان',
114
+ loadingQrCode: 'جارٍ تحميل رمز QR',
115
+ loadingNotification: 'جارٍ تحميل الإشعار',
116
+ closeNotification: 'إغلاق الإشعار',
117
+ floatingActions: 'إجراءات عائمة',
118
+ breadcrumb: 'مسار التنقل',
119
+ showMore: 'عرض المزيد',
120
+ collapsePanel: 'طي اللوحة',
121
+ selectionActions: 'إجراءات التحديد',
122
+ more: 'المزيد',
123
+ scrollVertically: 'تمرير عمودي',
124
+ scrollHorizontally: 'تمرير أفقي',
125
+ filter: 'تصفية',
126
+ filterReset: 'إعادة ضبط عوامل التصفية',
127
+ page: (page)=>`الصفحة ${page}`,
128
+ selectRow: (label)=>`تحديد الصف ${label}`,
129
+ moreUsers: (count)=>`مستخدمون إضافيون: ${count}`,
130
+ resizePanels: (first, second)=>`تغيير حجم اللوحتين ${first} و${second}`,
131
+ backToTop: 'العودة إلى الأعلى',
132
+ successNotification: 'إشعار نجاح',
133
+ errorNotification: 'إشعار خطأ',
134
+ warningNotification: 'إشعار تحذير',
135
+ infoNotification: 'إشعار معلومات',
136
+ notification: 'إشعار',
137
+ removeFileError: 'تعذرت إزالة الملف',
138
+ readFileError: 'تعذرت قراءة الملف',
139
+ millisecond: 'مللي ثانية',
140
+ meridiem: 'صباحًا/مساءً',
141
+ pageUnit: 'صفحة',
142
+ itemCount: createItemCount('ar-EG', {
143
+ zero: 'لا عناصر',
144
+ one: 'عنصر واحد',
145
+ two: 'عنصران',
146
+ few: '# عناصر',
147
+ many: '# عنصرًا',
148
+ other: '# عنصر'
149
+ })
150
+ },
151
+ form: createFormMessages({
152
+ default: "خطأ في التحقق من الحقل «${name}»",
153
+ required: "الحقل «${name}» مطلوب",
154
+ enum: "يجب أن تكون قيمة «${name}» واحدة من [${enum}]",
155
+ whitespace: "لا يمكن أن يكون «${name}» فارغًا",
156
+ invalid: "يجب أن تكون قيمة «${name}» من النوع ${type}",
157
+ dateFormat: "تنسيق التاريخ في «${name}» غير صالح",
158
+ dateParse: "تعذر تفسير «${name}» كتاريخ",
159
+ dateInvalid: "«${name}» ليس تاريخًا صالحًا",
160
+ string: {
161
+ len: "يجب أن يتكون «${name}» من ${len} حرفًا بالضبط",
162
+ min: "يجب ألا يقل طول «${name}» عن ${min} حرفًا",
163
+ max: "يجب ألا يتجاوز طول «${name}» ${max} حرفًا",
164
+ range: "يجب أن يكون طول «${name}» بين ${min} و${max} حرفًا"
165
+ },
166
+ number: {
167
+ len: "يجب أن تساوي قيمة «${name}» ${len}",
168
+ min: "يجب ألا تقل قيمة «${name}» عن ${min}",
169
+ max: "يجب ألا تزيد قيمة «${name}» عن ${max}",
170
+ range: "يجب أن تكون قيمة «${name}» بين ${min} و${max}"
171
+ },
172
+ array: {
173
+ len: "يجب أن يحتوي «${name}» على ${len} عنصرًا بالضبط",
174
+ min: "يجب ألا يقل عدد عناصر «${name}» عن ${min}",
175
+ max: "يجب ألا يزيد عدد عناصر «${name}» عن ${max}",
176
+ range: "يجب أن يكون عدد عناصر «${name}» بين ${min} و${max}"
177
+ },
178
+ pattern: "لا تتطابق قيمة «${name}» مع النمط ${pattern}",
179
+ typeNames: {
180
+ string: 'نص',
181
+ method: 'دالة',
182
+ array: 'مصفوفة',
183
+ object: 'كائن',
184
+ number: 'عدد',
185
+ date: 'تاريخ',
186
+ boolean: 'قيمة منطقية',
187
+ integer: 'عدد صحيح',
188
+ float: 'عدد عشري',
189
+ regexp: 'تعبير نمطي',
190
+ email: 'عنوان بريد إلكتروني',
191
+ tel: 'رقم هاتف',
192
+ url: 'عنوان ويب',
193
+ hex: 'قيمة ست عشرية'
194
+ }
195
+ })
196
+ });
197
+ const locales_ar_EG = arEG;
198
+ export default locales_ar_EG;
199
+ export { arEG };
@@ -0,0 +1,41 @@
1
+ import type { ValidateMessages } from '@rc-component/form/es/interface';
2
+ import type { BuiltinTaoLocale } from './types.js';
3
+ export declare function createItemCount(locale: string, forms: Partial<Record<Intl.LDMLPluralRule, string>> & {
4
+ other: string;
5
+ }): (count: number) => string;
6
+ type LocaleDefinition = Omit<BuiltinTaoLocale, 'weekdays' | 'months' | 'monthTitle' | 'calendarTitle'>;
7
+ /** Each language module registers only its own Day.js resource before calling this. */
8
+ export declare function createLocale(definition: LocaleDefinition): BuiltinTaoLocale;
9
+ interface FormMessages {
10
+ default: string;
11
+ required: string;
12
+ enum: string;
13
+ whitespace: string;
14
+ invalid: string;
15
+ dateFormat: string;
16
+ dateParse: string;
17
+ dateInvalid: string;
18
+ string: {
19
+ len: string;
20
+ min: string;
21
+ max: string;
22
+ range: string;
23
+ };
24
+ number: {
25
+ len: string;
26
+ min: string;
27
+ max: string;
28
+ range: string;
29
+ };
30
+ array: {
31
+ len: string;
32
+ min: string;
33
+ max: string;
34
+ range: string;
35
+ };
36
+ pattern: string;
37
+ typeNames: Record<keyof NonNullable<ValidateMessages['types']>, string>;
38
+ }
39
+ /** Expand translated type names once; rc-form substitutes field values at validation time. */
40
+ export declare function createFormMessages(text: FormMessages): ValidateMessages;
41
+ export {};