@ziyarago/ui 0.14.0 → 0.15.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +5 -5
  3. package/dist/llms-full.txt +8 -4
  4. package/dist/llms.txt +2 -2
  5. package/dist/manifest.json +343 -4
  6. package/dist/style.css +13 -13
  7. package/docs/INTEGRATION.md +12 -0
  8. package/package.json +12 -25
  9. package/src/core/components.js +11 -15
  10. package/src/core/components2.js +2 -72
  11. package/src/core/components3.js +2 -44
  12. package/src/core/components4.js +0 -38
  13. package/src/core/components6.js +0 -50
  14. package/src/core/components7.js +0 -34
  15. package/src/core/index.js +2 -2
  16. package/src/core/pages.js +2 -36
  17. package/src/i18n/components/index.js +0 -72
  18. package/src/icons/builtin.js +99 -0
  19. package/src/internal.js +10 -0
  20. package/src/meta/forms.js +5 -1
  21. package/src/meta/index.js +2 -0
  22. package/src/meta/pages.js +1 -1
  23. package/src/react/index.js +1 -107
  24. package/src/styles/components.css +8 -8
  25. package/src/styles/components2.css +2 -2
  26. package/src/styles/components7.css +1 -1
  27. package/src/styles/components8.css +1 -1
  28. package/src/styles/extras.css +1 -1
  29. package/src/vue/index.js +2 -2
  30. package/types/core.d.ts +1 -1
  31. package/types/internal.d.ts +30 -0
  32. package/types/meta.d.ts +5 -0
  33. package/types/react.d.ts +154 -4141
  34. package/types/shared.d.ts +2 -0
  35. package/types/vue-global.d.ts +0 -106
  36. package/types/vue.d.ts +168 -3601
  37. package/docs/MIGRATION.md +0 -455
  38. package/src/compat/index.js +0 -469
  39. package/src/compat/map.js +0 -282
  40. package/src/compat/resolver.js +0 -22
  41. package/src/compat/vite.js +0 -29
  42. package/src/i18n/components/ActionCard.js +0 -5
  43. package/src/i18n/components/Actionsheet.js +0 -5
  44. package/src/i18n/components/CallCard.js +0 -5
  45. package/src/i18n/components/CallRow.js +0 -5
  46. package/src/i18n/components/Carousel.js +0 -5
  47. package/src/i18n/components/ChartCard.js +0 -5
  48. package/src/i18n/components/ChatAi.js +0 -5
  49. package/src/i18n/components/ChipInput.js +0 -5
  50. package/src/i18n/components/ContactPanel.js +0 -5
  51. package/src/i18n/components/DataGroup.js +0 -5
  52. package/src/i18n/components/DealCard.js +0 -5
  53. package/src/i18n/components/FullscreenDialog.js +0 -5
  54. package/src/i18n/components/Gallery.js +0 -5
  55. package/src/i18n/components/GuestCard.js +0 -5
  56. package/src/i18n/components/ImageUpload.js +0 -5
  57. package/src/i18n/components/ImageViewer.js +0 -5
  58. package/src/i18n/components/IncomingCall.js +0 -5
  59. package/src/i18n/components/InlineEdit.js +0 -5
  60. package/src/i18n/components/IntegrationCard.js +0 -5
  61. package/src/i18n/components/Map.js +0 -5
  62. package/src/i18n/components/NotificationBell.js +0 -5
  63. package/src/i18n/components/PricingCard.js +0 -5
  64. package/src/i18n/components/QiblaCompass.js +0 -5
  65. package/src/i18n/components/RamadanTracker.js +0 -5
  66. package/src/i18n/components/RangeCalendar.js +0 -5
  67. package/src/i18n/components/RangeSlider.js +0 -5
  68. package/src/i18n/components/RichEditor.js +0 -5
  69. package/src/i18n/components/Screensaver.js +0 -5
  70. package/src/i18n/components/Sortable.js +0 -5
  71. package/src/i18n/components/StepDialog.js +0 -5
  72. package/src/i18n/components/StepForm.js +0 -5
  73. package/src/i18n/components/TabTiles.js +0 -5
  74. package/src/i18n/components/Tour.js +0 -5
  75. package/src/i18n/components/TourCard.js +0 -5
  76. package/src/i18n/components/TourPopover.js +0 -5
  77. package/src/i18n/components/TreeSelect.js +0 -5
  78. package/types/compat-resolver.d.ts +0 -12
  79. package/types/compat-vite.d.ts +0 -11
  80. package/types/compat.d.ts +0 -176
package/src/compat/map.js DELETED
@@ -1,282 +0,0 @@
1
- // @ziyarago/ui/compat · declarative old-API to new-API translation tables. Pure data and small pure functions (no Vue, no DOM), so it is unit-testable in Node.
2
- // Old API = glass-ui-kit (@ziyarago/glass-ui-kit, Vue 3 + Tailwind, Ui* components). New API = @ziyarago/ui.
3
- // A spec describes ONE old component:
4
- // to new component name (string) or (src) => name
5
- // defaults old-API defaults applied before translation (old prop values, not new ones)
6
- // size size profile ('control' | 'shift' | 'same'); maps the old size onto the xs..xl scale, see SIZES
7
- // props per old prop: undefined = pass through unchanged, string = rename, null = unsupported (dropped, dev warning), false = consumed elsewhere (dropped silently),
8
- // { to, map } = rename and map values, (value, src, cfg) => object = set any new props
9
- // events new event -> list of [oldEvent, fixedValue?] to emit; without fixedValue the original arguments are forwarded, NONE emits without arguments
10
- // eventsWhen new event -> (src) => boolean, the handler is attached only when true (the new kit shows UI such as a close button only when a handler exists)
11
- // slots old slot -> { into: 'default', at: 'start' | 'end', unless?: oldProp } (merge into the default slot) or a new slot name (rename)
12
- // after (newProps, src, cfg) => void, last-chance adjustments
13
- import { BOOL_PROPS } from '../core/bools.js';
14
-
15
- export const config = { sizes: 'height', warn: true, t: null, legacyIcons: true, primary: 'primary' };
16
-
17
- /** Global compat options. sizes: 'height' (default) keeps old pixel heights, 'name' maps sm/md/lg/xl to the same names. t: (key, fallback) => string, i18n bridge. warn: false silences dev warnings. legacyIcons: false disables the lucide rename table (use it after setIconBase to a lucide-static >= 1 build). primary: 'inverse' renders the old primary button (black pill in qrbon) with the new inverse variant instead of the brand-colored primary. */
18
- export function configureCompat(o = {}) { return Object.assign(config, o); }
19
-
20
- const camel = k => /^(aria|data)-/.test(k) || !k.includes('-') ? k : k.replace(/-([a-z])/g, (_, c) => c.toUpperCase());
21
- export const camelizeKeys = o => { const r = {}; for (const k of Object.keys(o)) if (o[k] !== undefined) r[camel(k)] = o[k]; return r; };
22
-
23
- // Old kit control heights: sm 36, md 48, lg 56, xl 64 px. New: xs 28, sm 32, md 40, lg 48, xl 56 px.
24
- export const SIZES = {
25
- control: { height: { sm: 'md', md: 'lg', lg: 'xl', xl: 'xl' }, name: { sm: 'sm', md: 'md', lg: 'lg', xl: 'xl' } },
26
- shift: { height: { sm: 'md', md: 'lg', lg: 'xl' }, name: { sm: 'sm', md: 'md', lg: 'lg' } },
27
- same: { height: {}, name: {} },
28
- };
29
- export const mapSize = (profile, v, cfg = config) => (SIZES[profile] && SIZES[profile][cfg.sizes === 'name' ? 'name' : 'height'][v]) || v;
30
-
31
- // lucide-vue-next 1.x renamed a few icons that lucide-static@0.460 (the kit's default icon CDN version) still knows under the old name.
32
- export const ICON_RENAMES = { 'circle-question-mark': 'circle-help', 'text-align-start': 'align-left', 'text-align-center': 'align-center', 'text-align-end': 'align-right', 'text-align-justify': 'align-justify', 'file-code-corner': 'file-code-2', 'file-check-corner': 'file-check-2', funnel: 'filter', 'message-circle-question-mark': 'message-circle-question' };
33
- const old = n => (config.legacyIcons === false ? n : ICON_RENAMES[n] || n);
34
-
35
- /** Lucide component (lucide-vue-next) or string -> kebab-case icon name used by the new kit. Unknown shapes give undefined. */
36
- export function iconName(c) {
37
- if (!c) return undefined;
38
- if (typeof c === 'string') return c;
39
- try {
40
- if (typeof c === 'function') { const v = c({}, { slots: {}, attrs: {} }); if (v && v.props && typeof v.props.name === 'string') return old(v.props.name); }
41
- const n = c.name || c.displayName || c.__name;
42
- if (n) return old(String(n).replace(/^Lucide/, '').replace(/([a-z])([A-Z0-9])/g, '$1-$2').replace(/([0-9])([A-Z])/g, '$1-$2').toLowerCase());
43
- } catch { /* not an icon component */ }
44
- return undefined;
45
- }
46
-
47
- /** Marker for events entries: emit the old event without arguments (the new kit passes a DOM event the old one never had). */
48
- export const NONE = Symbol('none');
49
- const err = v => (v === true ? { error: ' ' } : v ? { error: v } : {});
50
- const BADGE_TONE = { sunshine: 'brand', cobalt: 'brand', petrol: 'info', ink: 'inverse', glass: undefined, neutral: undefined };
51
- const ALERT_TONE = { success: 'success', warning: 'warning', danger: 'danger', info: 'info', glass: 'info', neutral: 'info' };
52
- const CARD_TONE = { cobalt: 'brand', sunshine: 'warning', petrol: 'sky', ink: 'neutral' };
53
- const AVATAR_TONE = { cobalt: 'brand', sunshine: 'warning', petrol: 'sky', pink: 'danger', ink: 'neutral' };
54
- const PROGRESS_TONE = { success: 'success', warning: 'warning', danger: 'danger', sunshine: 'warning' };
55
- const MODAL_SIZE = { sm: { size: 'sm' }, md: { size: 'md' }, lg: { size: 'lg' }, xl: { size: 'xl' }, '2xl': { size: 'xl' }, '3xl': { size: 'xl', width: '768px' }, '4xl': { size: 'xl', width: '896px' }, '5xl': { size: 'xl', width: '1024px' } };
56
- const CARD_PADDING = { height: { none: 'md', sm: 'md', md: 'lg', lg: 'lg', xl: 'xl' }, name: { none: 'md', sm: 'sm', md: 'md', lg: 'lg', xl: 'xl' } };
57
- const num = v => (Number.isFinite(+v) ? +v : 0);
58
-
59
- export const SPECS = {
60
- Button: {
61
- to: 'Button', size: 'control', defaults: { variant: 'primary', size: 'lg' },
62
- props: { variant: (v, s, cfg) => ({ glass: { variant: 'secondary' }, gradient: { variant: 'tonal', tone: 'brand' }, ink: { variant: 'inverse' } }[v] || { variant: v === 'primary' && cfg.primary === 'inverse' ? 'inverse' : v }) },
63
- slots: { 'icon-left': { into: 'default', at: 'start', unless: 'loading' }, 'icon-right': { into: 'default', at: 'end', unless: 'loading' } },
64
- },
65
- Input: {
66
- to: 'TextField', size: 'control', defaults: { size: 'lg' },
67
- props: { error: err, help: 'hint', clearable: null },
68
- },
69
- Textarea: {
70
- to: 'Textarea', defaults: { size: 'lg', resize: false },
71
- props: { error: err },
72
- },
73
- Select: {
74
- to: 'Select', size: 'control', defaults: { size: 'lg' },
75
- props: { error: err },
76
- t: { placeholder: ['common.select', 'Select an option'] },
77
- },
78
- Combobox: {
79
- to: 'Combobox', size: 'control', defaults: { size: 'lg' },
80
- props: { error: err },
81
- t: { emptyText: ['common.noMatches', 'No matches'] },
82
- },
83
- Checkbox: { to: 'Checkbox', props: { error: err } },
84
- Switch: { to: 'Switch', props: { error: err } },
85
- Badge: {
86
- to: 'Badge', size: 'shift', defaults: { tone: 'sunshine', size: 'md' },
87
- props: { tone: v => (v in BADGE_TONE ? (BADGE_TONE[v] ? { tone: BADGE_TONE[v] } : {}) : { tone: v }) },
88
- slots: { 'icon-left': { into: 'default', at: 'start' }, 'icon-right': { into: 'default', at: 'end' } },
89
- },
90
- Alert: {
91
- to: 'Alert', defaults: { tone: 'info' },
92
- props: { tone: v => ({ tone: ALERT_TONE[v] || 'info' }), closable: false, dismissible: false },
93
- events: { close: [['close', NONE]] }, eventsWhen: { close: s => !!s.closable },
94
- },
95
- Skeleton: {
96
- to: 'Skeleton',
97
- props: { variant: v => (v === 'line' ? { variant: 'rect', height: '1px' } : { variant: v }), lastLineWidth: null },
98
- },
99
- Modal: {
100
- to: 'Modal', defaults: { size: 'md' },
101
- props: { size: v => MODAL_SIZE[v] || { size: v } },
102
- events: { close: [['update:open', false], ['close', NONE]] },
103
- },
104
- ConfirmModal: {
105
- to: 'ConfirmDialog', defaults: { confirmVariant: 'danger', size: 'sm' },
106
- props: { message: 'description', confirmVariant: v => ({ tone: v === 'danger' ? 'danger' : 'default' }) },
107
- t: { title: ['common.areYouSure', 'Are you sure?'], description: ['common.irreversible', 'This action cannot be undone.'], confirmLabel: ['common.delete', 'Delete'], cancelLabel: ['common.cancel', 'Cancel'] },
108
- },
109
- Card: {
110
- to: 'Card', defaults: { padding: 'lg', variant: 'glass' },
111
- props: {
112
- variant: (v, s) => ({ gradient: { variant: 'gradient' }, outline: { variant: 'outline' }, block: { variant: 'gradient', intensity: 'vivid', tone: CARD_TONE[s.tone] || 'brand' } }[v] || {}),
113
- tone: false, as: null,
114
- padding: (v, s, cfg) => ({ size: CARD_PADDING[cfg.sizes === 'name' ? 'name' : 'height'][v] || 'lg', ...(v === 'none' ? { padding: 'none' } : {}) }),
115
- },
116
- },
117
- Progress: {
118
- to: 'Progress', defaults: { tone: 'ink' },
119
- props: {
120
- value: (v, s) => (v === undefined ? {} : { value: Math.max(0, Math.min(100, (num(v) / (num(s.max) || 100)) * 100)) }),
121
- max: false,
122
- showValue: (v, s) => (v && s.value !== undefined ? { meta: Math.round(Math.max(0, Math.min(100, (num(s.value) / (num(s.max) || 100)) * 100))) + '%' } : {}),
123
- tone: v => (PROGRESS_TONE[v] ? { tone: PROGRESS_TONE[v] } : {}),
124
- },
125
- },
126
- Breadcrumbs: { to: 'Breadcrumbs' },
127
- Pagination: {
128
- to: 'Pagination', props: { current: 'page', total: 'pages' },
129
- events: { change: [['update:current']] },
130
- after: (p, s, cfg) => { if (cfg.t) p.labels = { prev: cfg.t('common.prevPage', 'Previous page'), next: cfg.t('common.nextPage', 'Next page') }; },
131
- },
132
- StatsCard: {
133
- to: s => (s.variant === 'block' ? 'KpiTile' : 'StatsCard'),
134
- props: {
135
- icon: v => ({ icon: iconName(v) }),
136
- variant: (v, s) => (v === 'block' ? { variant: s.tone === 'ink' ? 'inverse' : 'brand' } : {}),
137
- tone: false,
138
- delta: (v, s) => {
139
- if (v == null) return {};
140
- const d = typeof v === 'object' ? v : { value: v };
141
- const down = d.trend === 'down', text = String(d.value);
142
- return { delta: s.variant === 'block' && down && !text.startsWith('-') ? '-' + text : text, trend: down ? 'down' : 'up', ...(d.sublabel ? { sub: d.sublabel } : {}) };
143
- },
144
- },
145
- },
146
- SegmentedControl: {
147
- to: 'SegmentedControl', size: 'shift',
148
- props: { options: v => ({ items: (v || []).map(o => (o.icon ? { ...o, icon: iconName(o.icon) } : o)) }) },
149
- },
150
- Avatar: {
151
- to: 'Avatar', defaults: { size: 'md' },
152
- props: { alt: 'name', tone: v => ({ tone: AVATAR_TONE[v] || 'brand' }), shape: v => (v === 'squircle' ? { shape: 'rounded' } : {}) },
153
- },
154
- Calendar: { to: 'Calendar', props: { range: null, initialMonth: null } },
155
- DatePicker: {
156
- to: 'DatePicker', size: 'control', defaults: { size: 'lg', clearable: true },
157
- props: { error: err, range: false },
158
- },
159
- Spinner: { to: 'Spinner', props: { tone: null } },
160
- Divider: { to: 'Divider', props: { align: null, orientation: null, tone: null } },
161
- Banner: {
162
- to: 'Banner', props: { tone: v => ({ tone: ALERT_TONE[v] || 'info' }), closable: false, sticky: null },
163
- events: { close: [['close', NONE]] }, eventsWhen: { close: s => !!s.closable },
164
- },
165
- EmptyState: { to: 'EmptyState', props: { icon: v => ({ icon: iconName(v) }), tone: null, size: null }, slots: { actions: { into: 'default', at: 'end' } } },
166
- Drawer: {
167
- to: 'Drawer', defaults: { placement: 'right' },
168
- props: { placement: v => ({ side: v === 'left' ? 'start' : 'end' }), size: null, closable: null, closeOnBackdrop: null, closeOnEsc: null },
169
- events: { close: [['update:open', false], ['close', NONE]] },
170
- },
171
- Tag: {
172
- to: 'Tag', props: { tone: null, size: null, removable: false, disabled: null },
173
- slots: { 'icon-left': { into: 'default', at: 'start' } },
174
- events: { remove: [['remove', NONE]] }, eventsWhen: { remove: s => !!s.removable },
175
- },
176
- OtpInput: { to: 'CodeInput', props: { masked: null, disabled: null, error: null, hint: null } },
177
- KpiCard: {
178
- to: 'KpiTile',
179
- props: {
180
- secondary: 'sub', icon: null, tone: null, loading: null,
181
- delta: v => (v == null ? {} : { delta: String(typeof v === 'object' ? v.value : v) }),
182
- },
183
- },
184
- FormField: { to: 'FormField' },
185
- };
186
-
187
- /** Old components (and old-kit names) that exist only as hand-written compat components in index.js. */
188
- export const CUSTOM = [
189
- 'Tabs', 'TabsList', 'Tab', 'TabPanel', 'Radio', 'RadioGroup', 'Dropdown', 'Menu', 'MenuItem', 'MenuSeparator', 'Table', 'Sidebar', 'SidebarSection', 'SidebarItem',
190
- 'Navbar', 'SubNav', 'ToastContainer', 'CommandPalette', 'FileUpload', 'DateTimePicker', 'AvatarGroup', 'MultilangInput', 'Form', 'Tooltip',
191
- ];
192
-
193
- /** Every compat export name without the Ui prefix (components only; composables are listed in COMPAT_EXPORTS). */
194
- export const COMPAT_NAMES = [...new Set([...Object.keys(SPECS), ...CUSTOM])].sort();
195
- export const COMPAT_COMPONENTS = COMPAT_NAMES.map(n => 'Ui' + n);
196
-
197
- // Names of dev-time notes for props the new kit cannot honour. Used for warnings and documented in docs/MIGRATION.md.
198
- const warned = new Set();
199
- export function warnOnce(name, props) {
200
- if (!config.warn || !props.length || (typeof process !== 'undefined' && process.env && process.env.NODE_ENV === 'production')) return;
201
- for (const p of props) { const key = name + '.' + p; if (!warned.has(key)) { warned.add(key); console.warn(`[@ziyarago/ui/compat] <Ui${name}> prop "${p}" is not supported by the new kit and is ignored.`); } }
202
- }
203
-
204
- /** Translate old attrs for the old component `name`. Returns { component, props, dropped, src } or null for unknown names. */
205
- export function translate(name, attrs = {}, cfg = config) {
206
- const spec = SPECS[name];
207
- if (!spec) return null;
208
- const src = { ...(spec.defaults || {}), ...camelizeKeys(attrs) };
209
- for (const k of Object.keys(src)) if (src[k] === '' && BOOL_PROPS.has(k)) src[k] = true;
210
- const props = {}, dropped = [];
211
- for (const k of Object.keys(src)) {
212
- const v = src[k], rule = spec.props && Object.prototype.hasOwnProperty.call(spec.props, k) ? spec.props[k] : undefined;
213
- if (rule === undefined) {
214
- if (k === 'size' && spec.size) props.size = mapSize(spec.size, v, cfg);
215
- else props[k] = v;
216
- } else if (rule === false) continue;
217
- else if (rule === null) dropped.push(k);
218
- else if (typeof rule === 'string') props[rule] = v;
219
- else if (typeof rule === 'function') Object.assign(props, rule(v, src, cfg) || {});
220
- else { const nv = rule.map && v in rule.map ? rule.map[v] : v; if (nv !== undefined) props[rule.to || k] = nv; }
221
- }
222
- if (spec.t) for (const k of Object.keys(spec.t)) if (props[k] === undefined) props[k] = cfg.t ? cfg.t(spec.t[k][0], spec.t[k][1]) : spec.t[k][1];
223
- if (spec.after) spec.after(props, src, cfg);
224
- return { component: typeof spec.to === 'function' ? spec.to(src) : spec.to, props, dropped, src };
225
- }
226
-
227
- /** Old event names a compat component must declare in `emits` so Vue does not forward them as listeners. */
228
- export function emitsOf(name) {
229
- const spec = SPECS[name];
230
- return spec && spec.events ? [...new Set(Object.values(spec.events).flatMap(t => t.map(e => e[0])))] : [];
231
- }
232
-
233
- /** Listener props for the new component: { onClose: fn } that re-emit old events. `emit` is the Vue emit function (or any (name, ...args) => void). */
234
- export function buildHandlers(name, src, emit) {
235
- const spec = SPECS[name], out = {};
236
- if (!spec || !spec.events) return out;
237
- for (const ev of Object.keys(spec.events)) {
238
- if (spec.eventsWhen && spec.eventsWhen[ev] && !spec.eventsWhen[ev](src)) continue;
239
- out['on' + ev[0].toUpperCase() + ev.slice(1)] = (...a) => { for (const [n, ...fixed] of spec.events[ev]) { if (fixed[0] === NONE) emit(n); else emit(n, ...(fixed.length ? fixed : a)); } };
240
- }
241
- return out;
242
- }
243
-
244
- /** Old slot functions -> new slot functions. `slots` is { name: fn }, `src` the translated old props (for `unless`). Slot functions may receive args. */
245
- export function translateSlots(name, slots, src = {}) {
246
- const spec = SPECS[name], rules = (spec && spec.slots) || {}, out = {}, pre = [], post = [];
247
- for (const k of Object.keys(slots)) {
248
- const r = rules[k];
249
- if (r === undefined) out[k] = slots[k];
250
- else if (typeof r === 'string') out[r] = slots[k];
251
- else if (!(r.unless && src[r.unless])) (r.at === 'start' ? pre : post).push(slots[k]);
252
- }
253
- if (pre.length || post.length) {
254
- const base = out.default;
255
- out.default = (...a) => [...pre.map(f => f()), ...(base ? [].concat(base(...a)) : []), ...post.map(f => f())];
256
- }
257
- return out;
258
- }
259
-
260
- /** Tailwind width utility (w-32, w-[120px], w-1/2, w-full) -> CSS width. Anything else gives undefined. */
261
- export function twWidth(c) {
262
- if (!c || typeof c !== 'string') return undefined;
263
- const m = /(?:^|\s)w-(?:\[([^\]]+)\]|(\d+(?:\.\d+)?)|(full)|(\d+)\/(\d+))(?=\s|$)/.exec(c);
264
- if (!m) return undefined;
265
- if (m[1]) return m[1];
266
- if (m[2]) return +m[2] * 0.25 + 'rem';
267
- if (m[3]) return '100%';
268
- return +(100 * m[4] / m[5]).toFixed(4) + '%';
269
- }
270
-
271
- /** Client-side sort used by the compat UiTable (the new DataTable is controlled and never sorts). */
272
- export function sortRows(rows, col, dir, getValue) {
273
- const d = dir === 'desc' ? -1 : 1;
274
- return [...rows].sort((a, b) => {
275
- const av = getValue(a, col), bv = getValue(b, col);
276
- if (av == null && bv == null) return 0;
277
- if (av == null) return -1 * d;
278
- if (bv == null) return 1 * d;
279
- if (typeof av === 'number' && typeof bv === 'number') return (av - bv) * d;
280
- return String(av).localeCompare(String(bv)) * d;
281
- });
282
- }
@@ -1,22 +0,0 @@
1
- // unplugin-vue-components resolver for the compat layer: <UiInput>, <UiTable>, <UiSidebar> ... -> import from '@ziyarago/ui/compat'.
2
- // Components({ dirs: [], resolvers: [ZiyaragoCompatResolver(), ZiyaragoUiResolver({ exclude: [...] })] })
3
- // Put it BEFORE ZiyaragoUiResolver: names that exist in both kits (UiButton, UiCard, ...) then resolve to the compat wrapper.
4
- import { COMPAT_COMPONENTS } from './map.js';
5
-
6
- const NAMES = new Set(COMPAT_COMPONENTS);
7
-
8
- /** @param {{ from?: string, exclude?: string[], css?: boolean | string }} [options] exclude: full component names to leave alone, e.g. ['UiTable']. */
9
- export function ZiyaragoCompatResolver(options = {}) {
10
- const { from = '@ziyarago/ui/compat', exclude = [], css = false } = options;
11
- const skip = new Set(exclude);
12
- const sideEffects = css ? (css === true ? '@ziyarago/ui/style.css' : css) : undefined;
13
- return {
14
- type: 'component',
15
- resolve(name) {
16
- if (!NAMES.has(name) || skip.has(name)) return;
17
- return { name, from, ...(sideEffects ? { sideEffects } : {}) };
18
- },
19
- };
20
- }
21
-
22
- export default ZiyaragoCompatResolver;
@@ -1,29 +0,0 @@
1
- // Vite plugin: redirects imports of the project's local old-kit files (".../components/ui/Toast", ".../components/ui/Select/UiSelect.vue", "@/components/ui/Table", ...)
2
- // to '@ziyarago/ui/compat', so useToast, TableColumn, SelectOption, UiInput ... keep working without editing hundreds of import lines.
3
- // import { ziyaragoCompat } from '@ziyarago/ui/compat/vite' plugins: [ziyaragoCompat(), vue(), ...]
4
- const PREFIX = '\0ziyarago-compat:';
5
-
6
- /** @param {{ from?: string, ui?: RegExp, exclude?: RegExp[] }} [options] ui: matches the local ui directory in an import path. exclude: import paths to keep local (default: MultilangInput). */
7
- export function ziyaragoCompat(options = {}) {
8
- const { from = '@ziyarago/ui/compat', ui = /(?:^|\/)components\/ui\/([A-Za-z]+)(?:\/([A-Za-z]+)(\.vue|\.ts)?)?$/, exclude = [/MultilangInput/] } = options;
9
- return {
10
- name: 'ziyarago-ui-compat',
11
- enforce: 'pre',
12
- resolveId(source, importer) {
13
- const norm = source.replace(/\\/g, '/');
14
- if (!importer || importer.includes('node_modules') || norm.startsWith('\0') || norm.startsWith(from) || !norm.includes('components/ui')) return null;
15
- if (importer.replace(/\\/g, '/').includes('/components/ui/')) return null;
16
- if (exclude.some(r => r.test(norm))) return null;
17
- const m = ui.exec(norm);
18
- if (!m) return null;
19
- return PREFIX + (m[2] && m[3] === '.vue' ? m[2] : m[1]);
20
- },
21
- load(id) {
22
- if (!id.startsWith(PREFIX)) return null;
23
- const name = id.slice(PREFIX.length), comp = name.startsWith('Ui') ? name : name === 'Toast' ? 'UiToastContainer' : 'Ui' + name;
24
- return `export * from '${from}';\nimport * as C from '${from}';\nexport default C['${comp}'];\n`;
25
- },
26
- };
27
- }
28
-
29
- export default ziyaragoCompat;
@@ -1,5 +0,0 @@
1
- export default {
2
- en: { expand: 'Expand', collapse: 'Collapse', refresh: 'Refresh', remove: 'Remove' },
3
- ar: { expand: 'توسيع', collapse: 'طي', refresh: 'تحديث', remove: 'إزالة' },
4
- ru: { expand: 'Развернуть', collapse: 'Свернуть', refresh: 'Обновить', remove: 'Удалить' },
5
- };
@@ -1,5 +0,0 @@
1
- export default {
2
- en: { cancel: 'Cancel' },
3
- ar: { cancel: 'إلغاء' },
4
- ru: { cancel: 'Отмена' },
5
- };
@@ -1,5 +0,0 @@
1
- export default {
2
- en: { play: 'Play' },
3
- ar: { play: 'تشغيل' },
4
- ru: { play: 'Воспроизвести' },
5
- };
@@ -1,5 +0,0 @@
1
- export default {
2
- en: { play: 'Play' },
3
- ar: { play: 'تشغيل' },
4
- ru: { play: 'Воспроизвести' },
5
- };
@@ -1,5 +0,0 @@
1
- export default {
2
- en: { prev: 'Previous', next: 'Next', slide: 'Slide' },
3
- ar: { prev: 'السابق', next: 'التالي', slide: 'شريحة' },
4
- ru: { prev: 'Предыдущий', next: 'Следующий', slide: 'Слайд' },
5
- };
@@ -1,5 +0,0 @@
1
- export default {
2
- en: { more: 'More' },
3
- ar: { more: 'المزيد' },
4
- ru: { more: 'Ещё' },
5
- };
@@ -1,5 +0,0 @@
1
- export default {
2
- en: { assistant: 'Assistant', placeholder: 'Ask anything…', typing: 'Typing', message: 'Message', send: 'Send' },
3
- ar: { assistant: 'المساعد', placeholder: 'اسأل أي شيء…', typing: 'يكتب', message: 'رسالة', send: 'إرسال' },
4
- ru: { assistant: 'Ассистент', placeholder: 'Спросите что угодно…', typing: 'Печатает', message: 'Сообщение', send: 'Отправить' },
5
- };
@@ -1,5 +0,0 @@
1
- export default {
2
- en: { remove: 'Remove {name}' },
3
- ar: { remove: 'إزالة {name}' },
4
- ru: { remove: 'Удалить {name}' },
5
- };
@@ -1,5 +0,0 @@
1
- export default {
2
- en: { phone: 'Phone', telegram: 'Telegram', email: 'Email', city: 'City', call: 'Call', message: 'Message' },
3
- ar: { phone: 'الهاتف', telegram: 'Telegram', email: 'البريد الإلكتروني', city: 'المدينة', call: 'اتصال', message: 'رسالة' },
4
- ru: { phone: 'Телефон', telegram: 'Telegram', email: 'Email', city: 'Город', call: 'Позвонить', message: 'Написать' },
5
- };
@@ -1,5 +0,0 @@
1
- export default {
2
- en: { expand: 'Expand' },
3
- ar: { expand: 'توسيع' },
4
- ru: { expand: 'Развернуть' },
5
- };
@@ -1,5 +0,0 @@
1
- export default {
2
- en: { probability: 'Probability' },
3
- ar: { probability: 'الاحتمال' },
4
- ru: { probability: 'Вероятность' },
5
- };
@@ -1,5 +0,0 @@
1
- export default {
2
- en: { close: 'Close', save: 'Save' },
3
- ar: { close: 'إغلاق', save: 'حفظ' },
4
- ru: { close: 'Закрыть', save: 'Сохранить' },
5
- };
@@ -1,5 +0,0 @@
1
- export default {
2
- en: { photo: 'Photo' },
3
- ar: { photo: 'صورة' },
4
- ru: { photo: 'Фото' },
5
- };
@@ -1,5 +0,0 @@
1
- export default {
2
- en: { nights: '{n} nights' },
3
- ar: { nights: '{n} ليالٍ' },
4
- ru: { nights: '{n} ноч.' },
5
- };
@@ -1,5 +0,0 @@
1
- export default {
2
- en: { upload: 'Upload' },
3
- ar: { upload: 'رفع' },
4
- ru: { upload: 'Загрузить' },
5
- };
@@ -1,5 +0,0 @@
1
- export default {
2
- en: { label: 'Image viewer', close: 'Close', previous: 'Previous', next: 'Next' },
3
- ar: { label: 'عارض الصور', close: 'إغلاق', previous: 'السابق', next: 'التالي' },
4
- ru: { label: 'Просмотр изображений', close: 'Закрыть', previous: 'Назад', next: 'Далее' },
5
- };
@@ -1,5 +0,0 @@
1
- export default {
2
- en: { incoming: 'Incoming call', decline: 'Decline', answer: 'Answer' },
3
- ar: { incoming: 'مكالمة واردة', decline: 'رفض', answer: 'رد' },
4
- ru: { incoming: 'Входящий звонок', decline: 'Отклонить', answer: 'Ответить' },
5
- };
@@ -1,5 +0,0 @@
1
- export default {
2
- en: { save: 'Save', edit: 'Click to edit' },
3
- ar: { save: 'حفظ', edit: 'انقر للتعديل' },
4
- ru: { save: 'Сохранить', edit: 'Нажмите, чтобы изменить' },
5
- };
@@ -1,5 +0,0 @@
1
- export default {
2
- en: { connected: 'Connected', error: 'Error', off: 'Not linked', manage: 'Manage', reconnect: 'Reconnect', link: 'Link' },
3
- ar: { connected: 'متصل', error: 'خطأ', off: 'غير مرتبط', manage: 'إدارة', reconnect: 'إعادة الاتصال', link: 'ربط' },
4
- ru: { connected: 'Подключено', error: 'Ошибка', off: 'Не подключено', manage: 'Управлять', reconnect: 'Подключить снова', link: 'Подключить' },
5
- };
@@ -1,5 +0,0 @@
1
- export default {
2
- en: { label: 'Map', zoomIn: 'Zoom in', zoomOut: 'Zoom out' },
3
- ar: { label: 'خريطة', zoomIn: 'تكبير', zoomOut: 'تصغير' },
4
- ru: { label: 'Карта', zoomIn: 'Увеличить', zoomOut: 'Уменьшить' },
5
- };
@@ -1,5 +0,0 @@
1
- export default {
2
- en: { label: 'Notifications', markAllRead: 'Mark all read' },
3
- ar: { label: 'الإشعارات', markAllRead: 'تحديد الكل كمقروء' },
4
- ru: { label: 'Уведомления', markAllRead: 'Отметить все как прочитанные' },
5
- };
@@ -1,5 +0,0 @@
1
- export default {
2
- en: { choose: 'Choose' },
3
- ar: { choose: 'اختيار' },
4
- ru: { choose: 'Выбрать' },
5
- };
@@ -1,5 +0,0 @@
1
- export default {
2
- en: { label: 'Qibla direction, {deg} degrees from north', qibla: 'Qibla' },
3
- ar: { label: 'اتجاه القبلة، {deg} درجة من الشمال', qibla: 'القبلة' },
4
- ru: { label: 'Направление киблы, {deg} градусов от севера', qibla: 'Кибла' },
5
- };
@@ -1,5 +0,0 @@
1
- export default {
2
- en: { day: 'Day {day} of 30', label: 'Ramadan tracker' },
3
- ar: { day: 'اليوم {day} من 30', label: 'متتبع رمضان' },
4
- ru: { day: 'День {day} из 30', label: 'Трекер Рамадана' },
5
- };
@@ -1,5 +0,0 @@
1
- export default {
2
- en: { prev: 'Previous', next: 'Next' },
3
- ar: { prev: 'السابق', next: 'التالي' },
4
- ru: { prev: 'Назад', next: 'Далее' },
5
- };
@@ -1,5 +0,0 @@
1
- export default {
2
- en: { min: 'Min', max: 'Max' },
3
- ar: { min: 'الحد الأدنى', max: 'الحد الأقصى' },
4
- ru: { min: 'Мин.', max: 'Макс.' },
5
- };
@@ -1,5 +0,0 @@
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
- };
@@ -1,5 +0,0 @@
1
- export default {
2
- en: { label: 'Screensaver' },
3
- ar: { label: 'شاشة التوقف' },
4
- ru: { label: 'Заставка' },
5
- };
@@ -1,5 +0,0 @@
1
- export default {
2
- en: { moveUp: 'Move up', moveDown: 'Move down' },
3
- ar: { moveUp: 'نقل لأعلى', moveDown: 'نقل لأسفل' },
4
- ru: { moveUp: 'Переместить вверх', moveDown: 'Переместить вниз' },
5
- };
@@ -1,5 +0,0 @@
1
- export default {
2
- en: { close: 'Close', previous: 'Previous', next: 'Next', submit: 'Submit' },
3
- ar: { close: 'إغلاق', previous: 'السابق', next: 'التالي', submit: 'إرسال' },
4
- ru: { close: 'Закрыть', previous: 'Назад', next: 'Далее', submit: 'Отправить' },
5
- };
@@ -1,5 +0,0 @@
1
- export default {
2
- en: { back: 'Back', next: 'Next', finish: 'Finish' },
3
- ar: { back: 'رجوع', next: 'التالي', finish: 'إنهاء' },
4
- ru: { back: 'Назад', next: 'Следующий', finish: 'Готово' },
5
- };
@@ -1,5 +0,0 @@
1
- export default {
2
- en: { add: 'Add' },
3
- ar: { add: 'إضافة' },
4
- ru: { add: 'Добавить' },
5
- };
@@ -1,5 +0,0 @@
1
- export default {
2
- en: { label: 'Tour' },
3
- ar: { label: 'جولة تعريفية' },
4
- ru: { label: 'Тур' },
5
- };
@@ -1,5 +0,0 @@
1
- export default {
2
- en: { seats: 'Seats' },
3
- ar: { seats: 'المقاعد' },
4
- ru: { seats: 'Места' },
5
- };
@@ -1,5 +0,0 @@
1
- export default {
2
- en: { close: 'Close', back: 'Back', next: 'Next', finish: 'Finish' },
3
- ar: { close: 'إغلاق', back: 'رجوع', next: 'التالي', finish: 'إنهاء' },
4
- ru: { close: 'Закрыть', back: 'Назад', next: 'Следующий', finish: 'Готово' },
5
- };
@@ -1,5 +0,0 @@
1
- export default {
2
- en: { search: 'Search' },
3
- ar: { search: 'بحث' },
4
- ru: { search: 'Поиск' },
5
- };
@@ -1,12 +0,0 @@
1
- export interface ZiyaragoCompatResolverOptions {
2
- /** Module the compat components come from. Default '@ziyarago/ui/compat'. */
3
- from?: string;
4
- /** Full component names (with the Ui prefix) to leave to other resolvers or local files, for example ['UiTable']. */
5
- exclude?: string[];
6
- /** true: also import '@ziyarago/ui/style.css'; a string: import that module instead. Default false. */
7
- css?: boolean | string;
8
- }
9
- export interface ZiyaragoCompatResolverResult { name: string; from: string; sideEffects?: string }
10
- export interface ZiyaragoCompatResolver { type: 'component'; resolve(name: string): ZiyaragoCompatResolverResult | undefined }
11
- export function ZiyaragoCompatResolver(options?: ZiyaragoCompatResolverOptions): ZiyaragoCompatResolver;
12
- export default ZiyaragoCompatResolver;
@@ -1,11 +0,0 @@
1
- import type { Plugin } from 'vite';
2
- export interface ZiyaragoCompatViteOptions {
3
- /** Module the redirected imports resolve to. Default '@ziyarago/ui/compat'. */
4
- from?: string;
5
- /** Matches the local ui directory in an import path; group 1 is the folder, group 2 the optional file. */
6
- ui?: RegExp;
7
- /** Import paths that stay local. Default [/MultilangInput/]. */
8
- exclude?: RegExp[];
9
- }
10
- export function ziyaragoCompat(options?: ZiyaragoCompatViteOptions): Plugin;
11
- export default ziyaragoCompat;