@ziyarago/ui 0.3.0 → 0.4.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.
- package/CHANGELOG.md +6 -0
- package/README.md +23 -2
- package/dist/llms-full.txt +2 -2
- package/dist/llms.txt +2 -2
- package/dist/manifest.json +1 -1
- package/package.json +2 -2
- package/src/core/components.js +15 -14
- package/src/core/components2.js +37 -36
- package/src/core/components3.js +8 -7
- package/src/core/components4.js +23 -22
- package/src/core/components6.js +8 -7
- package/src/core/components7.js +10 -9
- package/src/core/index.js +1 -1
- package/src/i18n/components/ActionCard.js +5 -0
- package/src/i18n/components/Actionsheet.js +5 -0
- package/src/i18n/components/Alert.js +5 -0
- package/src/i18n/components/Breadcrumbs.js +5 -0
- package/src/i18n/components/Calendar.js +5 -0
- package/src/i18n/components/CallCard.js +5 -0
- package/src/i18n/components/CallRow.js +5 -0
- package/src/i18n/components/Carousel.js +5 -0
- package/src/i18n/components/ChartCard.js +5 -0
- package/src/i18n/components/ChatAi.js +5 -0
- package/src/i18n/components/Chip.js +5 -0
- package/src/i18n/components/ChipInput.js +5 -0
- package/src/i18n/components/CodeInput.js +5 -0
- package/src/i18n/components/Combobox.js +5 -0
- package/src/i18n/components/CommandPalette.js +5 -0
- package/src/i18n/components/ConfirmDialog.js +5 -0
- package/src/i18n/components/ContactPanel.js +5 -0
- package/src/i18n/components/CopyButton.js +2 -0
- package/src/i18n/components/DataGroup.js +5 -0
- package/src/i18n/components/DataState.js +5 -0
- package/src/i18n/components/DataTable.js +5 -0
- package/src/i18n/components/DatePicker.js +5 -0
- package/src/i18n/components/DealCard.js +5 -0
- package/src/i18n/components/Drawer.js +5 -0
- package/src/i18n/components/ErrorPage.js +5 -0
- package/src/i18n/components/FileUpload.js +5 -0
- package/src/i18n/components/FullscreenDialog.js +5 -0
- package/src/i18n/components/Gallery.js +5 -0
- package/src/i18n/components/GuestCard.js +5 -0
- package/src/i18n/components/ImageUpload.js +5 -0
- package/src/i18n/components/ImageViewer.js +5 -0
- package/src/i18n/components/IncomingCall.js +5 -0
- package/src/i18n/components/InlineEdit.js +5 -0
- package/src/i18n/components/IntegrationCard.js +5 -0
- package/src/i18n/components/LoginForm.js +5 -0
- package/src/i18n/components/Map.js +5 -0
- package/src/i18n/components/Modal.js +5 -0
- package/src/i18n/components/MultiSelect.js +5 -0
- package/src/i18n/components/NotificationBell.js +5 -0
- package/src/i18n/components/NumberInput.js +5 -0
- package/src/i18n/components/Pagination.js +5 -0
- package/src/i18n/components/PasswordInput.js +5 -0
- package/src/i18n/components/Popconfirm.js +5 -0
- package/src/i18n/components/PricingCard.js +5 -0
- package/src/i18n/components/RamadanTracker.js +5 -0
- package/src/i18n/components/RangeCalendar.js +5 -0
- package/src/i18n/components/RangeSlider.js +5 -0
- package/src/i18n/components/Rating.js +5 -0
- package/src/i18n/components/RichEditor.js +5 -0
- package/src/i18n/components/Screensaver.js +5 -0
- package/src/i18n/components/SearchInput.js +5 -0
- package/src/i18n/components/SideNav.js +5 -0
- package/src/i18n/components/Snackbar.js +5 -0
- package/src/i18n/components/Sortable.js +5 -0
- package/src/i18n/components/Spinner.js +5 -0
- package/src/i18n/components/StatusPage.js +5 -0
- package/src/i18n/components/StepDialog.js +5 -0
- package/src/i18n/components/StepForm.js +5 -0
- package/src/i18n/components/TabTiles.js +5 -0
- package/src/i18n/components/Tag.js +5 -0
- package/src/i18n/components/TopNav.js +5 -0
- package/src/i18n/components/Tour.js +5 -0
- package/src/i18n/components/TourCard.js +5 -0
- package/src/i18n/components/TourPopover.js +5 -0
- package/src/i18n/components/TreeSelect.js +5 -0
- package/src/i18n/components/Validation.js +5 -0
- package/src/i18n/components/index.js +130 -0
- package/src/i18n/index.js +8 -6
- package/types/i18n.d.ts +4 -2
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
en: { label: 'Pagination', prev: 'Previous page', next: 'Next page', page: 'Page' },
|
|
3
|
+
ar: { label: 'ترقيم الصفحات', prev: 'الصفحة السابقة', next: 'الصفحة التالية', page: 'صفحة' },
|
|
4
|
+
ru: { label: 'Постраничная навигация', prev: 'Предыдущая страница', next: 'Следующая страница', page: 'Страница' },
|
|
5
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
en: { editor: 'Editor', placeholder: 'Write something…', bold: 'Bold', italic: 'Italic', underline: 'Underline', strike: 'Strike', left: 'Left', center: 'Center', right: 'Right', bullets: 'Bullets', numbers: 'Numbers', quote: 'Quote', codeBlock: 'Code block' },
|
|
3
|
+
ar: { editor: 'المحرر', placeholder: 'اكتب شيئًا…', bold: 'غامق', italic: 'مائل', underline: 'تسطير', strike: 'يتوسطه خط', left: 'يسار', center: 'وسط', right: 'يمين', bullets: 'نقاط', numbers: 'أرقام', quote: 'اقتباس', codeBlock: 'كتلة برمجية' },
|
|
4
|
+
ru: { editor: 'Редактор', placeholder: 'Напишите что-нибудь…', bold: 'Жирный', italic: 'Курсив', underline: 'Подчёркнутый', strike: 'Зачёркнутый', left: 'По левому краю', center: 'По центру', right: 'По правому краю', bullets: 'Маркированный список', numbers: 'Нумерованный список', quote: 'Цитата', codeBlock: 'Блок кода' },
|
|
5
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
en: { nfTitle: 'Page not found', nfDesc: 'The page may have moved. Check the address or go back.', home: 'Back to home', authTitle: 'Not authorized', authDesc: 'You need permission to open this page.', mtTitle: 'Under maintenance', mtDesc: 'We are updating the service. It will be back shortly.', soonTitle: 'Coming soon', soonDesc: 'We are working on it. Leave your email and we will tell you first.', notify: 'Notify me' },
|
|
3
|
+
ar: { nfTitle: 'الصفحة غير موجودة', nfDesc: 'ربما تم نقل الصفحة. تحقق من العنوان أو ارجع.', home: 'العودة إلى الرئيسية', authTitle: 'غير مصرح', authDesc: 'تحتاج إلى إذن لفتح هذه الصفحة.', mtTitle: 'قيد الصيانة', mtDesc: 'نقوم بتحديث الخدمة. ستعود قريبًا.', soonTitle: 'قريبًا', soonDesc: 'نعمل على ذلك. اترك بريدك الإلكتروني وسنخبرك أولًا.', notify: 'أبلغني' },
|
|
4
|
+
ru: { nfTitle: 'Страница не найдена', nfDesc: 'Возможно, страница была перемещена. Проверьте адрес или вернитесь назад.', home: 'На главную', authTitle: 'Нет доступа', authDesc: 'Для открытия этой страницы нужно разрешение.', mtTitle: 'Технические работы', mtDesc: 'Мы обновляем сервис. Скоро он снова заработает.', soonTitle: 'Скоро', soonDesc: 'Мы работаем над этим. Оставьте email, и мы сообщим вам первыми.', notify: 'Уведомить меня' },
|
|
5
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
en: { required: 'This field is required', email: 'Enter a valid email', url: 'Enter a valid URL', digits: 'Exactly {n} digits', alpha: 'Letters only', alphaDash: 'Letters, digits, dash and underscore', minLength: 'At least {n} characters', maxLength: 'At most {n} characters', range: 'Between {a} and {b}', invalid: 'Invalid format', confirmed: 'Values do not match', password: '8+ characters, a digit and a capital letter' },
|
|
3
|
+
ar: { required: 'هذا الحقل مطلوب', email: 'أدخل بريدًا إلكترونيًا صالحًا', url: 'أدخل رابطًا صالحًا', digits: '{n} أرقام بالضبط', alpha: 'أحرف فقط', alphaDash: 'أحرف وأرقام وشرطة وشرطة سفلية', minLength: '{n} أحرف على الأقل', maxLength: '{n} أحرف كحد أقصى', range: 'بين {a} و {b}', invalid: 'تنسيق غير صالح', confirmed: 'القيمتان غير متطابقتين', password: '8 أحرف أو أكثر ورقم وحرف كبير' },
|
|
4
|
+
ru: { required: 'Обязательное поле', email: 'Введите корректный email', url: 'Введите корректный URL', digits: 'Ровно {n} цифр', alpha: 'Только буквы', alphaDash: 'Буквы, цифры, дефис и подчёркивание', minLength: 'Не менее {n} символов', maxLength: 'Не более {n} символов', range: 'От {a} до {b}', invalid: 'Неверный формат', confirmed: 'Значения не совпадают', password: '8+ символов, цифра и заглавная буква' },
|
|
5
|
+
};
|
|
@@ -1,5 +1,135 @@
|
|
|
1
1
|
// generated by scripts/i18n-index.mjs: do not edit
|
|
2
2
|
import { defineMessages } from '../index.js';
|
|
3
|
+
import ActionCard from './ActionCard.js';
|
|
4
|
+
import Actionsheet from './Actionsheet.js';
|
|
5
|
+
import Alert from './Alert.js';
|
|
6
|
+
import Breadcrumbs from './Breadcrumbs.js';
|
|
7
|
+
import Calendar from './Calendar.js';
|
|
8
|
+
import CallCard from './CallCard.js';
|
|
9
|
+
import CallRow from './CallRow.js';
|
|
10
|
+
import Carousel from './Carousel.js';
|
|
11
|
+
import ChartCard from './ChartCard.js';
|
|
12
|
+
import ChatAi from './ChatAi.js';
|
|
13
|
+
import Chip from './Chip.js';
|
|
14
|
+
import ChipInput from './ChipInput.js';
|
|
15
|
+
import CodeInput from './CodeInput.js';
|
|
16
|
+
import Combobox from './Combobox.js';
|
|
17
|
+
import CommandPalette from './CommandPalette.js';
|
|
18
|
+
import ConfirmDialog from './ConfirmDialog.js';
|
|
19
|
+
import ContactPanel from './ContactPanel.js';
|
|
3
20
|
import CopyButton from './CopyButton.js';
|
|
21
|
+
import DataGroup from './DataGroup.js';
|
|
22
|
+
import DataState from './DataState.js';
|
|
23
|
+
import DataTable from './DataTable.js';
|
|
24
|
+
import DatePicker from './DatePicker.js';
|
|
25
|
+
import DealCard from './DealCard.js';
|
|
26
|
+
import Drawer from './Drawer.js';
|
|
27
|
+
import ErrorPage from './ErrorPage.js';
|
|
28
|
+
import FileUpload from './FileUpload.js';
|
|
29
|
+
import FullscreenDialog from './FullscreenDialog.js';
|
|
30
|
+
import Gallery from './Gallery.js';
|
|
31
|
+
import GuestCard from './GuestCard.js';
|
|
32
|
+
import ImageUpload from './ImageUpload.js';
|
|
33
|
+
import ImageViewer from './ImageViewer.js';
|
|
34
|
+
import IncomingCall from './IncomingCall.js';
|
|
35
|
+
import InlineEdit from './InlineEdit.js';
|
|
36
|
+
import IntegrationCard from './IntegrationCard.js';
|
|
37
|
+
import LoginForm from './LoginForm.js';
|
|
38
|
+
import Map from './Map.js';
|
|
39
|
+
import Modal from './Modal.js';
|
|
40
|
+
import MultiSelect from './MultiSelect.js';
|
|
41
|
+
import NotificationBell from './NotificationBell.js';
|
|
42
|
+
import NumberInput from './NumberInput.js';
|
|
43
|
+
import Pagination from './Pagination.js';
|
|
44
|
+
import PasswordInput from './PasswordInput.js';
|
|
45
|
+
import Popconfirm from './Popconfirm.js';
|
|
46
|
+
import PricingCard from './PricingCard.js';
|
|
47
|
+
import RamadanTracker from './RamadanTracker.js';
|
|
48
|
+
import RangeCalendar from './RangeCalendar.js';
|
|
49
|
+
import RangeSlider from './RangeSlider.js';
|
|
50
|
+
import Rating from './Rating.js';
|
|
51
|
+
import RichEditor from './RichEditor.js';
|
|
52
|
+
import Screensaver from './Screensaver.js';
|
|
53
|
+
import SearchInput from './SearchInput.js';
|
|
54
|
+
import SideNav from './SideNav.js';
|
|
55
|
+
import Snackbar from './Snackbar.js';
|
|
56
|
+
import Sortable from './Sortable.js';
|
|
57
|
+
import Spinner from './Spinner.js';
|
|
58
|
+
import StatusPage from './StatusPage.js';
|
|
59
|
+
import StepDialog from './StepDialog.js';
|
|
60
|
+
import StepForm from './StepForm.js';
|
|
61
|
+
import TabTiles from './TabTiles.js';
|
|
62
|
+
import Tag from './Tag.js';
|
|
63
|
+
import TopNav from './TopNav.js';
|
|
64
|
+
import Tour from './Tour.js';
|
|
65
|
+
import TourCard from './TourCard.js';
|
|
66
|
+
import TourPopover from './TourPopover.js';
|
|
67
|
+
import TreeSelect from './TreeSelect.js';
|
|
68
|
+
import Validation from './Validation.js';
|
|
4
69
|
|
|
70
|
+
defineMessages('ActionCard', ActionCard);
|
|
71
|
+
defineMessages('Actionsheet', Actionsheet);
|
|
72
|
+
defineMessages('Alert', Alert);
|
|
73
|
+
defineMessages('Breadcrumbs', Breadcrumbs);
|
|
74
|
+
defineMessages('Calendar', Calendar);
|
|
75
|
+
defineMessages('CallCard', CallCard);
|
|
76
|
+
defineMessages('CallRow', CallRow);
|
|
77
|
+
defineMessages('Carousel', Carousel);
|
|
78
|
+
defineMessages('ChartCard', ChartCard);
|
|
79
|
+
defineMessages('ChatAi', ChatAi);
|
|
80
|
+
defineMessages('Chip', Chip);
|
|
81
|
+
defineMessages('ChipInput', ChipInput);
|
|
82
|
+
defineMessages('CodeInput', CodeInput);
|
|
83
|
+
defineMessages('Combobox', Combobox);
|
|
84
|
+
defineMessages('CommandPalette', CommandPalette);
|
|
85
|
+
defineMessages('ConfirmDialog', ConfirmDialog);
|
|
86
|
+
defineMessages('ContactPanel', ContactPanel);
|
|
5
87
|
defineMessages('CopyButton', CopyButton);
|
|
88
|
+
defineMessages('DataGroup', DataGroup);
|
|
89
|
+
defineMessages('DataState', DataState);
|
|
90
|
+
defineMessages('DataTable', DataTable);
|
|
91
|
+
defineMessages('DatePicker', DatePicker);
|
|
92
|
+
defineMessages('DealCard', DealCard);
|
|
93
|
+
defineMessages('Drawer', Drawer);
|
|
94
|
+
defineMessages('ErrorPage', ErrorPage);
|
|
95
|
+
defineMessages('FileUpload', FileUpload);
|
|
96
|
+
defineMessages('FullscreenDialog', FullscreenDialog);
|
|
97
|
+
defineMessages('Gallery', Gallery);
|
|
98
|
+
defineMessages('GuestCard', GuestCard);
|
|
99
|
+
defineMessages('ImageUpload', ImageUpload);
|
|
100
|
+
defineMessages('ImageViewer', ImageViewer);
|
|
101
|
+
defineMessages('IncomingCall', IncomingCall);
|
|
102
|
+
defineMessages('InlineEdit', InlineEdit);
|
|
103
|
+
defineMessages('IntegrationCard', IntegrationCard);
|
|
104
|
+
defineMessages('LoginForm', LoginForm);
|
|
105
|
+
defineMessages('Map', Map);
|
|
106
|
+
defineMessages('Modal', Modal);
|
|
107
|
+
defineMessages('MultiSelect', MultiSelect);
|
|
108
|
+
defineMessages('NotificationBell', NotificationBell);
|
|
109
|
+
defineMessages('NumberInput', NumberInput);
|
|
110
|
+
defineMessages('Pagination', Pagination);
|
|
111
|
+
defineMessages('PasswordInput', PasswordInput);
|
|
112
|
+
defineMessages('Popconfirm', Popconfirm);
|
|
113
|
+
defineMessages('PricingCard', PricingCard);
|
|
114
|
+
defineMessages('RamadanTracker', RamadanTracker);
|
|
115
|
+
defineMessages('RangeCalendar', RangeCalendar);
|
|
116
|
+
defineMessages('RangeSlider', RangeSlider);
|
|
117
|
+
defineMessages('Rating', Rating);
|
|
118
|
+
defineMessages('RichEditor', RichEditor);
|
|
119
|
+
defineMessages('Screensaver', Screensaver);
|
|
120
|
+
defineMessages('SearchInput', SearchInput);
|
|
121
|
+
defineMessages('SideNav', SideNav);
|
|
122
|
+
defineMessages('Snackbar', Snackbar);
|
|
123
|
+
defineMessages('Sortable', Sortable);
|
|
124
|
+
defineMessages('Spinner', Spinner);
|
|
125
|
+
defineMessages('StatusPage', StatusPage);
|
|
126
|
+
defineMessages('StepDialog', StepDialog);
|
|
127
|
+
defineMessages('StepForm', StepForm);
|
|
128
|
+
defineMessages('TabTiles', TabTiles);
|
|
129
|
+
defineMessages('Tag', Tag);
|
|
130
|
+
defineMessages('TopNav', TopNav);
|
|
131
|
+
defineMessages('Tour', Tour);
|
|
132
|
+
defineMessages('TourCard', TourCard);
|
|
133
|
+
defineMessages('TourPopover', TourPopover);
|
|
134
|
+
defineMessages('TreeSelect', TreeSelect);
|
|
135
|
+
defineMessages('Validation', Validation);
|
package/src/i18n/index.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
// Built-in component strings. One file per component in ./components/<Name>.js with all locales:
|
|
2
|
-
// export default { en: { copy: 'Copy' } } (the open source package ships
|
|
3
|
-
// that calls defineMessages(component, {
|
|
2
|
+
// export default { en: { copy: 'Copy' } } (the open source package ships en, ar, ru; the other 13 languages come from the Pro language pack
|
|
3
|
+
// that calls defineMessages(component, { uz: {...} }) or from the app via setUiMessages). A locale without strings falls back to English.
|
|
4
4
|
// The kit has its own translator: it never depends on the host app's i18n library. Sync it with yours:
|
|
5
5
|
// watch(() => i18n.locale.value, l => setUiLocale(l)) // vue-i18n
|
|
6
6
|
// setUiMessages('ru', { CopyButton: { copy: 'Скопировать' } }) // override single strings from the app
|
|
7
|
-
export const LOCALES = ['en', '
|
|
8
|
-
|
|
7
|
+
export const LOCALES = ['en', 'ar', 'ru', 'uz', 'tg', 'tr', 'fr', 'fa', 'hi', 'ur', 'bn', 'id', 'kk', 'ky', 'ms', 'ha'];
|
|
8
|
+
/** Languages whose strings ship in the free package. The rest come from the Pro language pack. */
|
|
9
|
+
export const FREE_LOCALES = ['en', 'ar', 'ru'];
|
|
10
|
+
export const RTL_LOCALES = ['ar', 'fa', 'ur'];
|
|
9
11
|
|
|
10
12
|
const registry = {};
|
|
11
13
|
const overrides = {};
|
|
@@ -16,7 +18,7 @@ let version = 0;
|
|
|
16
18
|
const norm = l => { const k = String(l || 'en').toLowerCase().split(/[-_]/)[0]; return LOCALES.includes(k) ? k : 'en'; };
|
|
17
19
|
const bump = () => { version++; subs.forEach(f => f(locale)); };
|
|
18
20
|
|
|
19
|
-
/** Register strings of a component. Calling it again for the same component MERGES locales:
|
|
21
|
+
/** Register strings of a component. Calling it again for the same component MERGES locales: a language pack can add locales on top of the built-in ones. */
|
|
20
22
|
export function defineMessages(component, messages) {
|
|
21
23
|
const cur = registry[component] || (registry[component] = {});
|
|
22
24
|
for (const [l, msgs] of Object.entries(messages)) cur[l] = { ...(cur[l] || {}), ...msgs };
|
|
@@ -45,4 +47,4 @@ export function t(component, key, params) {
|
|
|
45
47
|
}
|
|
46
48
|
|
|
47
49
|
/** Locale-aware helper for numbers and dates in components (uses the browser/Node Intl). */
|
|
48
|
-
export const intlLocale = () => ({ en: 'en-US', uz: 'uz-UZ',
|
|
50
|
+
export const intlLocale = () => ({ en: 'en-US', ar: 'ar', ru: 'ru-RU', uz: 'uz-UZ', tg: 'tg-TJ', tr: 'tr-TR', fr: 'fr-FR', fa: 'fa-IR', hi: 'hi-IN', ur: 'ur-PK', bn: 'bn-BD', id: 'id-ID', kk: 'kk-KZ', ky: 'ky-KG', ms: 'ms-MY', ha: 'ha-NG' })[locale];
|
package/types/i18n.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
export type UiLocale = 'en' | '
|
|
1
|
+
export type UiLocale = 'en' | 'ar' | 'ru' | 'uz' | 'tg' | 'tr' | 'fr' | 'fa' | 'hi' | 'ur' | 'bn' | 'id' | 'kk' | 'ky' | 'ms' | 'ha';
|
|
2
2
|
export const LOCALES: readonly UiLocale[];
|
|
3
|
+
/** en, ar, ru: included in the free package. */
|
|
4
|
+
export const FREE_LOCALES: readonly UiLocale[];
|
|
3
5
|
export const RTL_LOCALES: readonly UiLocale[];
|
|
4
6
|
/** Switch the language of the built-in component strings. Components re-render by themselves. */
|
|
5
7
|
export function setUiLocale(locale: UiLocale | string): void;
|
|
@@ -8,5 +10,5 @@ export function isRtlLocale(locale?: string): boolean;
|
|
|
8
10
|
/** Override single strings from the app: setUiMessages('ru', { Pagination: { prev: 'Назад' } }). Pass null to clear a locale. */
|
|
9
11
|
export function setUiMessages(locale: UiLocale | string, messages: Record<string, Record<string, string>> | null): void;
|
|
10
12
|
export function t(component: string, key: string, params?: Record<string, string | number>): string;
|
|
11
|
-
export function defineMessages(component: string, messages: Record<UiLocale, Record<string, string
|
|
13
|
+
export function defineMessages(component: string, messages: Partial<Record<UiLocale, Record<string, string>>>): void;
|
|
12
14
|
export function subscribeUiLocale(fn: (locale: UiLocale) => void): () => void;
|