tekivex-ui 2.0.1 → 2.1.0

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 (79) hide show
  1. package/README.md +1 -1
  2. package/dist/index.cjs +12 -12
  3. package/dist/index.d.ts +5 -0
  4. package/dist/index.d.ts.map +1 -1
  5. package/dist/index.js +2207 -2018
  6. package/dist/src/components/TkxAppBar.d.ts +12 -0
  7. package/dist/src/components/TkxAppBar.d.ts.map +1 -0
  8. package/dist/src/components/TkxAutocomplete.d.ts +25 -0
  9. package/dist/src/components/TkxAutocomplete.d.ts.map +1 -0
  10. package/dist/src/components/TkxBottomNav.d.ts +15 -0
  11. package/dist/src/components/TkxBottomNav.d.ts.map +1 -0
  12. package/dist/src/components/TkxBreadcrumb.d.ts +17 -0
  13. package/dist/src/components/TkxBreadcrumb.d.ts.map +1 -0
  14. package/dist/src/components/TkxCard.d.ts.map +1 -1
  15. package/dist/src/components/TkxDataGrid.d.ts +33 -0
  16. package/dist/src/components/TkxDataGrid.d.ts.map +1 -0
  17. package/dist/src/components/TkxMasonry.d.ts +12 -0
  18. package/dist/src/components/TkxMasonry.d.ts.map +1 -0
  19. package/dist/src/components/TkxModal.d.ts.map +1 -1
  20. package/dist/src/components/TkxPopover.d.ts +15 -0
  21. package/dist/src/components/TkxPopover.d.ts.map +1 -0
  22. package/dist/src/components/TkxRichTextDisplay.d.ts +19 -0
  23. package/dist/src/components/TkxRichTextDisplay.d.ts.map +1 -0
  24. package/dist/src/components/TkxSelect.d.ts.map +1 -1
  25. package/dist/src/components/TkxSlider.d.ts.map +1 -1
  26. package/dist/src/components/TkxSnackbar.d.ts +16 -0
  27. package/dist/src/components/TkxSnackbar.d.ts.map +1 -0
  28. package/dist/src/components/TkxSpeedDial.d.ts +18 -0
  29. package/dist/src/components/TkxSpeedDial.d.ts.map +1 -0
  30. package/dist/src/components/TkxToolbar.d.ts +22 -0
  31. package/dist/src/components/TkxToolbar.d.ts.map +1 -0
  32. package/dist/src/components/TkxTooltip.d.ts.map +1 -1
  33. package/dist/src/components/TkxTransferList.d.ts +20 -0
  34. package/dist/src/components/TkxTransferList.d.ts.map +1 -0
  35. package/dist/src/components/TkxTreeView.d.ts +23 -0
  36. package/dist/src/components/TkxTreeView.d.ts.map +1 -0
  37. package/dist/src/components/index.d.ts +13 -0
  38. package/dist/src/components/index.d.ts.map +1 -1
  39. package/dist/src/i18n/I18nProvider.d.ts +10 -0
  40. package/dist/src/i18n/I18nProvider.d.ts.map +1 -0
  41. package/dist/src/i18n/index.d.ts +50 -0
  42. package/dist/src/i18n/index.d.ts.map +1 -0
  43. package/package.json +2 -2
  44. package/src/components/TkxAppBar.tsx +260 -0
  45. package/src/components/TkxAutocomplete.tsx +453 -0
  46. package/src/components/TkxBottomNav.tsx +239 -0
  47. package/src/components/TkxBreadcrumb.tsx +322 -0
  48. package/src/components/TkxCard.tsx +3 -1
  49. package/src/components/TkxDataGrid.tsx +540 -0
  50. package/src/components/TkxMasonry.tsx +176 -0
  51. package/src/components/TkxModal.tsx +4 -3
  52. package/src/components/TkxPopover.tsx +295 -0
  53. package/src/components/TkxRichTextDisplay.tsx +394 -0
  54. package/src/components/TkxSelect.tsx +2 -0
  55. package/src/components/TkxSlider.tsx +1 -0
  56. package/src/components/TkxSnackbar.tsx +314 -0
  57. package/src/components/TkxSpeedDial.tsx +395 -0
  58. package/src/components/TkxToolbar.tsx +260 -0
  59. package/src/components/TkxTooltip.tsx +3 -2
  60. package/src/components/TkxTransferList.tsx +487 -0
  61. package/src/components/TkxTreeView.tsx +421 -0
  62. package/src/components/index.ts +13 -0
  63. package/src/hooks/index.ts +1 -1
  64. package/src/i18n/I18nProvider.tsx +36 -0
  65. package/src/i18n/index.ts +237 -0
  66. package/dist/tests/TkxButton.test.d.ts +0 -2
  67. package/dist/tests/TkxButton.test.d.ts.map +0 -1
  68. package/dist/tests/a11y/components.test.d.ts +0 -2
  69. package/dist/tests/a11y/components.test.d.ts.map +0 -1
  70. package/dist/tests/quantum.test.d.ts +0 -2
  71. package/dist/tests/quantum.test.d.ts.map +0 -1
  72. package/dist/tests/security.test.d.ts +0 -2
  73. package/dist/tests/security.test.d.ts.map +0 -1
  74. package/dist/tests/setup.d.ts +0 -2
  75. package/dist/tests/setup.d.ts.map +0 -1
  76. package/dist/tests/tkx.test.d.ts +0 -2
  77. package/dist/tests/tkx.test.d.ts.map +0 -1
  78. package/dist/tests/wcag.test.d.ts +0 -2
  79. package/dist/tests/wcag.test.d.ts.map +0 -1
@@ -0,0 +1,237 @@
1
+ import { createContext, useContext } from 'react';
2
+
3
+ // ── Direction ───────────────────────────────────────────────────────────────
4
+
5
+ export type Direction = 'ltr' | 'rtl';
6
+
7
+ // ── Locale strings ──────────────────────────────────────────────────────────
8
+
9
+ export interface LocaleStrings {
10
+ // Common
11
+ close: string;
12
+ cancel: string;
13
+ confirm: string;
14
+ save: string;
15
+ delete: string;
16
+ search: string;
17
+ loading: string;
18
+ noResults: string;
19
+ required: string;
20
+
21
+ // Pagination
22
+ previous: string;
23
+ next: string;
24
+ pageOf: (page: number, total: number) => string;
25
+
26
+ // Select
27
+ selectPlaceholder: string;
28
+ clearSelection: string;
29
+
30
+ // DatePicker
31
+ selectDate: string;
32
+ today: string;
33
+
34
+ // FileUpload
35
+ dropFiles: string;
36
+ browse: string;
37
+
38
+ // Table
39
+ noData: string;
40
+ sortAscending: string;
41
+ sortDescending: string;
42
+ }
43
+
44
+ // ── Default English locale ──────────────────────────────────────────────────
45
+
46
+ export const enUS: LocaleStrings = {
47
+ close: 'Close',
48
+ cancel: 'Cancel',
49
+ confirm: 'Confirm',
50
+ save: 'Save',
51
+ delete: 'Delete',
52
+ search: 'Search',
53
+ loading: 'Loading...',
54
+ noResults: 'No results found',
55
+ required: 'Required',
56
+ previous: 'Previous',
57
+ next: 'Next',
58
+ pageOf: (page, total) => `Page ${page} of ${total}`,
59
+ selectPlaceholder: 'Select...',
60
+ clearSelection: 'Clear selection',
61
+ selectDate: 'Select a date',
62
+ today: 'Today',
63
+ dropFiles: 'Drop files here or',
64
+ browse: 'Browse',
65
+ noData: 'No data available',
66
+ sortAscending: 'Sort ascending',
67
+ sortDescending: 'Sort descending',
68
+ };
69
+
70
+ // ── Additional locales ──────────────────────────────────────────────────────
71
+
72
+ export const esES: LocaleStrings = {
73
+ close: 'Cerrar',
74
+ cancel: 'Cancelar',
75
+ confirm: 'Confirmar',
76
+ save: 'Guardar',
77
+ delete: 'Eliminar',
78
+ search: 'Buscar',
79
+ loading: 'Cargando...',
80
+ noResults: 'No se encontraron resultados',
81
+ required: 'Requerido',
82
+ previous: 'Anterior',
83
+ next: 'Siguiente',
84
+ pageOf: (page, total) => `Página ${page} de ${total}`,
85
+ selectPlaceholder: 'Seleccionar...',
86
+ clearSelection: 'Limpiar selección',
87
+ selectDate: 'Seleccionar fecha',
88
+ today: 'Hoy',
89
+ dropFiles: 'Suelte archivos aquí o',
90
+ browse: 'Explorar',
91
+ noData: 'No hay datos disponibles',
92
+ sortAscending: 'Orden ascendente',
93
+ sortDescending: 'Orden descendente',
94
+ };
95
+
96
+ export const arSA: LocaleStrings = {
97
+ close: 'إغلاق',
98
+ cancel: 'إلغاء',
99
+ confirm: 'تأكيد',
100
+ save: 'حفظ',
101
+ delete: 'حذف',
102
+ search: 'بحث',
103
+ loading: '...جارٍ التحميل',
104
+ noResults: 'لم يتم العثور على نتائج',
105
+ required: 'مطلوب',
106
+ previous: 'السابق',
107
+ next: 'التالي',
108
+ pageOf: (page, total) => `صفحة ${page} من ${total}`,
109
+ selectPlaceholder: '...اختر',
110
+ clearSelection: 'مسح الاختيار',
111
+ selectDate: 'اختر تاريخ',
112
+ today: 'اليوم',
113
+ dropFiles: 'أفلت الملفات هنا أو',
114
+ browse: 'تصفح',
115
+ noData: 'لا توجد بيانات',
116
+ sortAscending: 'ترتيب تصاعدي',
117
+ sortDescending: 'ترتيب تنازلي',
118
+ };
119
+
120
+ export const frFR: LocaleStrings = {
121
+ close: 'Fermer',
122
+ cancel: 'Annuler',
123
+ confirm: 'Confirmer',
124
+ save: 'Enregistrer',
125
+ delete: 'Supprimer',
126
+ search: 'Rechercher',
127
+ loading: 'Chargement...',
128
+ noResults: 'Aucun résultat trouvé',
129
+ required: 'Obligatoire',
130
+ previous: 'Précédent',
131
+ next: 'Suivant',
132
+ pageOf: (page, total) => `Page ${page} sur ${total}`,
133
+ selectPlaceholder: 'Sélectionner...',
134
+ clearSelection: 'Effacer la sélection',
135
+ selectDate: 'Sélectionner une date',
136
+ today: "Aujourd'hui",
137
+ dropFiles: 'Déposez les fichiers ici ou',
138
+ browse: 'Parcourir',
139
+ noData: 'Aucune donnée disponible',
140
+ sortAscending: 'Tri croissant',
141
+ sortDescending: 'Tri décroissant',
142
+ };
143
+
144
+ export const deDE: LocaleStrings = {
145
+ close: 'Schließen',
146
+ cancel: 'Abbrechen',
147
+ confirm: 'Bestätigen',
148
+ save: 'Speichern',
149
+ delete: 'Löschen',
150
+ search: 'Suchen',
151
+ loading: 'Wird geladen...',
152
+ noResults: 'Keine Ergebnisse gefunden',
153
+ required: 'Erforderlich',
154
+ previous: 'Zurück',
155
+ next: 'Weiter',
156
+ pageOf: (page, total) => `Seite ${page} von ${total}`,
157
+ selectPlaceholder: 'Auswählen...',
158
+ clearSelection: 'Auswahl löschen',
159
+ selectDate: 'Datum auswählen',
160
+ today: 'Heute',
161
+ dropFiles: 'Dateien hier ablegen oder',
162
+ browse: 'Durchsuchen',
163
+ noData: 'Keine Daten verfügbar',
164
+ sortAscending: 'Aufsteigend sortieren',
165
+ sortDescending: 'Absteigend sortieren',
166
+ };
167
+
168
+ export const jaJP: LocaleStrings = {
169
+ close: '閉じる',
170
+ cancel: 'キャンセル',
171
+ confirm: '確認',
172
+ save: '保存',
173
+ delete: '削除',
174
+ search: '検索',
175
+ loading: '読み込み中...',
176
+ noResults: '結果が見つかりません',
177
+ required: '必須',
178
+ previous: '前へ',
179
+ next: '次へ',
180
+ pageOf: (page, total) => `${total}ページ中${page}ページ`,
181
+ selectPlaceholder: '選択...',
182
+ clearSelection: '選択解除',
183
+ selectDate: '日付を選択',
184
+ today: '今日',
185
+ dropFiles: 'ファイルをドロップまたは',
186
+ browse: '参照',
187
+ noData: 'データなし',
188
+ sortAscending: '昇順',
189
+ sortDescending: '降順',
190
+ };
191
+
192
+ // ── Locale map ──────────────────────────────────────────────────────────────
193
+
194
+ export const LOCALES = {
195
+ 'en-US': enUS,
196
+ 'es-ES': esES,
197
+ 'ar-SA': arSA,
198
+ 'fr-FR': frFR,
199
+ 'de-DE': deDE,
200
+ 'ja-JP': jaJP,
201
+ } as const;
202
+
203
+ export type LocaleCode = keyof typeof LOCALES;
204
+
205
+ // ── RTL languages ───────────────────────────────────────────────────────────
206
+
207
+ const RTL_LOCALES = new Set<string>(['ar-SA', 'he-IL', 'fa-IR', 'ur-PK']);
208
+
209
+ export function isRTL(locale: string): boolean {
210
+ return RTL_LOCALES.has(locale);
211
+ }
212
+
213
+ // ── Context ─────────────────────────────────────────────────────────────────
214
+
215
+ export interface I18nContextValue {
216
+ locale: LocaleCode;
217
+ direction: Direction;
218
+ strings: LocaleStrings;
219
+ }
220
+
221
+ export const I18nContext = createContext<I18nContextValue>({
222
+ locale: 'en-US',
223
+ direction: 'ltr',
224
+ strings: enUS,
225
+ });
226
+
227
+ export function useI18n(): I18nContextValue {
228
+ return useContext(I18nContext);
229
+ }
230
+
231
+ export function useLocale(): LocaleStrings {
232
+ return useContext(I18nContext).strings;
233
+ }
234
+
235
+ export function useDirection(): Direction {
236
+ return useContext(I18nContext).direction;
237
+ }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=TkxButton.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TkxButton.test.d.ts","sourceRoot":"","sources":["../../tests/TkxButton.test.tsx"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=components.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"components.test.d.ts","sourceRoot":"","sources":["../../../tests/a11y/components.test.tsx"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=quantum.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"quantum.test.d.ts","sourceRoot":"","sources":["../../tests/quantum.test.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=security.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"security.test.d.ts","sourceRoot":"","sources":["../../tests/security.test.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- import '@testing-library/jest-dom';
2
- //# sourceMappingURL=setup.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../tests/setup.ts"],"names":[],"mappings":"AAAA,OAAO,2BAA2B,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=tkx.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tkx.test.d.ts","sourceRoot":"","sources":["../../tests/tkx.test.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=wcag.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"wcag.test.d.ts","sourceRoot":"","sources":["../../tests/wcag.test.ts"],"names":[],"mappings":""}