@ziyarago/ui 0.1.1 → 0.3.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 (53) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +1 -0
  3. package/dist/llms-full.txt +100 -8
  4. package/dist/llms.txt +1 -1
  5. package/dist/manifest.json +412 -20
  6. package/dist/style.css +73 -4
  7. package/docs/INTEGRATION.md +153 -0
  8. package/docs/MIGRATION.md +453 -0
  9. package/package.json +87 -7
  10. package/src/compat/index.js +468 -0
  11. package/src/compat/map.js +282 -0
  12. package/src/compat/resolver.js +22 -0
  13. package/src/compat/vite.js +29 -0
  14. package/src/core/bools.js +4 -0
  15. package/src/core/components.js +31 -23
  16. package/src/core/components2.js +20 -16
  17. package/src/core/components4.js +3 -3
  18. package/src/core/components6.js +25 -16
  19. package/src/core/index.js +2 -0
  20. package/src/i18n/components/CopyButton.js +3 -0
  21. package/src/i18n/components/index.js +5 -0
  22. package/src/i18n/index.js +48 -0
  23. package/src/meta/actions.js +10 -3
  24. package/src/meta/data.js +8 -3
  25. package/src/meta/feedback.js +2 -1
  26. package/src/meta/forms.js +44 -4
  27. package/src/meta/media.js +7 -2
  28. package/src/meta/navigation.js +3 -0
  29. package/src/meta/overlay.js +8 -2
  30. package/src/nuxt/module.mjs +2 -2
  31. package/src/nuxt/plugin.mjs +6 -5
  32. package/src/react/index.js +202 -8
  33. package/src/resolver.js +33 -0
  34. package/src/styles/components.css +7 -0
  35. package/src/styles/components6.css +2 -0
  36. package/src/styles/effects.css +6 -4
  37. package/src/styles/extras.css +55 -0
  38. package/src/styles/index.css +1 -0
  39. package/src/theme.js +16 -4
  40. package/src/vue/global.js +2 -0
  41. package/src/vue/index.js +13 -5
  42. package/types/compat-resolver.d.ts +12 -0
  43. package/types/compat-vite.d.ts +11 -0
  44. package/types/compat.d.ts +176 -0
  45. package/types/i18n.d.ts +12 -0
  46. package/types/meta.d.ts +4 -0
  47. package/types/nuxt.d.ts +1 -1
  48. package/types/react.d.ts +6282 -186
  49. package/types/resolver.d.ts +14 -0
  50. package/types/shared.d.ts +7 -7
  51. package/types/theme.d.ts +20 -1
  52. package/types/vue-global.d.ts +193 -0
  53. package/types/vue.d.ts +6178 -186
@@ -0,0 +1,11 @@
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;
@@ -0,0 +1,176 @@
1
+ // Types for @ziyarago/ui/compat (hand-written; scripts/types.mjs only generates the vue and react entries).
2
+ // Prop interfaces use the OLD glass-ui-kit names so existing templates keep type-checking.
3
+ import type { Component, DefineComponent, Ref, ComputedRef, App } from 'vue';
4
+
5
+ type Any = Record<string, any>;
6
+ type OldSize3 = 'md' | 'lg' | 'xl';
7
+ type OldTone = 'success' | 'warning' | 'danger' | 'info' | 'neutral';
8
+
9
+ export interface SelectOption { label: string; value: string | number | null; disabled?: boolean }
10
+ export interface TableColumn<TRow = Record<string, unknown>> {
11
+ key: string;
12
+ label: string;
13
+ accessor?: (row: TRow) => unknown;
14
+ sortable?: boolean;
15
+ align?: 'left' | 'center' | 'right';
16
+ /** Tailwind width class such as "w-32" or "w-[120px]"; converted to a CSS width. */
17
+ width?: string;
18
+ }
19
+ export type TableVariant = 'default' | 'striped' | 'bordered';
20
+ export type TableDensity = 'comfortable' | 'compact';
21
+ export interface SubNavItem { path: string; label: string; icon?: Component; badge?: number | string }
22
+ export interface SegmentedOption<V extends string | number = string | number> { label: string; value: V; icon?: Component; disabled?: boolean }
23
+ export interface BreadcrumbItem { label: string; href?: string }
24
+ export interface DateRange { start: Date | null; end: Date | null }
25
+ export type MultilangLang = 'ru' | 'uz' | 'en';
26
+ export interface MultilangValue { ru?: string; uz?: string; en?: string }
27
+
28
+ export type ToastTone = 'success' | 'info' | 'warning' | 'danger' | 'default';
29
+ export interface ToastInput { tone?: ToastTone; title?: string; message: string; duration?: number; action?: { label: string; onClick: () => void } }
30
+ export interface Toast { id: string; tone: ToastTone; title?: string; message: string; duration: number; action?: { label: string; onClick: () => void } }
31
+ export function useToast(): {
32
+ toasts: Ref<Toast[]>;
33
+ push(input: ToastInput): string;
34
+ dismiss(id: string): void;
35
+ clear(): void;
36
+ success(message: string, options?: Partial<Omit<ToastInput, 'message' | 'tone'>>): string;
37
+ info(message: string, options?: Partial<Omit<ToastInput, 'message' | 'tone'>>): string;
38
+ warning(message: string, options?: Partial<Omit<ToastInput, 'message' | 'tone'>>): string;
39
+ danger(message: string, options?: Partial<Omit<ToastInput, 'message' | 'tone'>>): string;
40
+ };
41
+
42
+ export interface Command {
43
+ id: string;
44
+ label: string;
45
+ description?: string;
46
+ icon?: Component | string;
47
+ shortcut?: string;
48
+ group?: string;
49
+ keywords?: string[];
50
+ action: () => void | Promise<void>;
51
+ }
52
+ export function useCommandPalette(): {
53
+ commands: Ref<Command[]>;
54
+ isOpen: Ref<boolean>;
55
+ register(command: Command): void;
56
+ unregister(id: string): void;
57
+ clear(): void;
58
+ open(): void;
59
+ close(): void;
60
+ toggle(): void;
61
+ };
62
+
63
+ export type Theme = 'light' | 'dark';
64
+ /** Old useTheme(): also toggles the .dark class next to the new data-theme attribute. */
65
+ export function useTheme(): { theme: Readonly<Ref<Theme>>; setTheme(value: Theme): void; toggleTheme(): void };
66
+
67
+ export interface CompatConfig {
68
+ /** 'height' (default) keeps old pixel heights (old md 48px -> new lg); 'name' maps sm/md/lg/xl to the same names. */
69
+ sizes: 'height' | 'name';
70
+ /** Dev warnings for props the new kit cannot honour. */
71
+ warn: boolean;
72
+ /** i18n bridge: (key, fallback) => string. Default: the host vue-i18n ($t) when the key exists, else the fallback. */
73
+ t: ((key: string, fallback: string) => string) | null;
74
+ /** Rename the 9 lucide icons that lucide-static@0.460 knows under an older name. Set false after setIconBase to a newer lucide-static. */
75
+ legacyIcons: boolean;
76
+ /** 'inverse' renders the old primary button (the black pill in qrbon) with the new inverse variant instead of the brand-colored primary. */
77
+ primary: 'primary' | 'inverse';
78
+ }
79
+ export function configureCompat(options: Partial<CompatConfig>): CompatConfig;
80
+ /** Lucide component (lucide-vue-next) or string -> kebab-case icon name of the new kit. */
81
+ export function iconName(icon: unknown): string | undefined;
82
+ export function translate(name: string, attrs?: Any, cfg?: CompatConfig): { component: string; props: Any; dropped: string[]; src: Any } | null;
83
+ export const SPECS: Record<string, Any>;
84
+ export const COMPAT_NAMES: string[];
85
+ export const COMPAT_COMPONENTS: string[];
86
+ export function mapSize(profile: 'control' | 'shift' | 'same', size: string | undefined, cfg?: CompatConfig): string | undefined;
87
+ export const compatComponents: Record<string, Component>;
88
+
89
+ export interface UiButtonProps { variant?: 'primary' | 'glass' | 'ghost' | 'danger' | 'gradient' | 'ink'; size?: OldSize3; iconOnly?: boolean; block?: boolean; loading?: boolean; disabled?: boolean; type?: 'button' | 'submit' | 'reset'; title?: string; onClick?: (e: MouseEvent) => void }
90
+ export interface UiInputProps { modelValue?: string | number | null; label?: string; hint?: string; help?: string; error?: string | boolean; size?: 'sm' | OldSize3; type?: string; placeholder?: string; disabled?: boolean; required?: boolean; readonly?: boolean; autocomplete?: string; name?: string; id?: string; min?: number | string; max?: number | string; step?: number | string; maxlength?: number | string; minlength?: number | string; inputmode?: string; pattern?: string; spellcheck?: boolean; autofocus?: boolean }
91
+ export interface UiTextareaProps { modelValue?: string | null; label?: string; hint?: string; error?: string | boolean; size?: OldSize3; rows?: number; placeholder?: string; disabled?: boolean; required?: boolean; readonly?: boolean; autoResize?: boolean; resize?: boolean; maxlength?: number; showCount?: boolean; name?: string; id?: string }
92
+ export interface UiSelectProps { modelValue?: string | number | null; options: SelectOption[]; label?: string; hint?: string; error?: string | boolean; placeholder?: string; size?: OldSize3; disabled?: boolean; required?: boolean; name?: string; id?: string }
93
+ export interface UiComboboxProps { modelValue?: string | number | null; options: SelectOption[]; label?: string; placeholder?: string; hint?: string; error?: string; disabled?: boolean; required?: boolean; size?: OldSize3; clearable?: boolean; filter?: (option: SelectOption, query: string) => boolean; emptyText?: string }
94
+ export interface UiCheckboxProps { modelValue?: boolean; indeterminate?: boolean; label?: string; hint?: string; error?: string | boolean; disabled?: boolean; size?: 'sm' | 'md' | 'lg'; name?: string; value?: string | number; id?: string }
95
+ export interface UiSwitchProps { modelValue?: boolean; label?: string; hint?: string; error?: string | boolean; disabled?: boolean; size?: 'sm' | 'md' | 'lg'; labelLeft?: boolean; name?: string; id?: string }
96
+ export interface UiBadgeProps { tone?: 'sunshine' | 'cobalt' | 'petrol' | 'ink' | 'glass' | OldTone; size?: 'sm' | 'md' | 'lg'; shape?: 'pill' | 'square'; dot?: boolean }
97
+ export interface UiAlertProps { tone?: OldTone | 'glass'; title?: string; closable?: boolean; hideIcon?: boolean }
98
+ export interface UiCardProps { variant?: 'glass' | 'gradient' | 'solid' | 'outline' | 'block'; tone?: 'cobalt' | 'sunshine' | 'petrol' | 'ink' | 'none'; padding?: 'none' | 'sm' | 'md' | 'lg' | 'xl'; interactive?: boolean; as?: string; onClick?: (e: MouseEvent) => void }
99
+ export interface UiModalProps { open: boolean; size?: 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl'; title?: string; closable?: boolean; closeOnBackdrop?: boolean; closeOnEsc?: boolean }
100
+ export interface UiConfirmModalProps { open: boolean; title?: string; message?: string; confirmLabel?: string; confirmVariant?: 'danger' | 'primary' | 'glass'; loading?: boolean }
101
+ export interface UiTableProps<T = any> { rows: T[]; columns: TableColumn<T>[]; rowKey?: (row: T, index: number) => string | number; density?: TableDensity; variant?: TableVariant; loading?: boolean; skeletonRows?: number; hoverable?: boolean }
102
+ export interface UiPaginationProps { current: number; total: number; siblings?: number; hideArrows?: boolean }
103
+ export interface UiProgressProps { value?: number; max?: number; size?: 'sm' | 'md' | 'lg'; tone?: 'ink' | 'cobalt' | 'sunshine' | 'petrol' | OldTone; showValue?: boolean; label?: string }
104
+ export interface UiAvatarProps { src?: string; alt?: string; initials?: string; size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'; shape?: 'circle' | 'squircle'; tone?: 'cobalt' | 'sunshine' | 'petrol' | 'pink' | 'ink'; ring?: boolean; status?: 'online' | 'offline' | 'away' | 'busy' }
105
+ export interface UiTooltipProps { text?: string; placement?: 'top' | 'bottom' | 'left' | 'right'; tone?: 'ink' | 'glass'; delay?: number; disabled?: boolean }
106
+ export interface UiBreadcrumbsProps { items: BreadcrumbItem[]; separator?: 'chevron' | 'slash' | 'dot' }
107
+ export interface UiStatsCardProps { label: string; value: string | number; delta?: { value: string | number; trend?: 'up' | 'down' | 'flat'; sublabel?: string }; icon?: Component; variant?: 'glass' | 'block'; tone?: 'cobalt' | 'sunshine' | 'petrol' | 'ink' }
108
+ export interface UiSegmentedControlProps<V extends string | number = string | number> { modelValue: V; options: SegmentedOption<V>[]; size?: 'sm' | 'md' | 'lg'; block?: boolean; iconOnly?: boolean; ariaLabel?: string }
109
+ export interface UiDatePickerProps { modelValue?: Date | DateRange | null; range?: boolean; label?: string; placeholder?: string; hint?: string; error?: string; disabled?: boolean; required?: boolean; size?: OldSize3; clearable?: boolean; locale?: string; weekStartsOn?: 0 | 1 }
110
+ export interface UiDateTimePickerProps { modelValue?: string | null; label?: string; hint?: string; error?: string; disabled?: boolean; defaultTime?: string }
111
+ export interface UiDropdownProps { open?: boolean; placement?: string; offset?: number; closeOnOutsideClick?: boolean; closeOnEsc?: boolean }
112
+ export interface UiSidebarProps { collapsed?: boolean; defaultCollapsed?: boolean; open?: boolean; storageKey?: string }
113
+ export interface UiSubNavProps { items: SubNavItem[]; title?: string; titleIcon?: Component; matchExact?: boolean }
114
+ export interface UiFileUploadProps { modelValue?: File[] | null; label?: string; hint?: string; error?: string | boolean; multiple?: boolean; accept?: string; maxSize?: number; disabled?: boolean }
115
+ export interface UiMultilangInputProps { modelValue: MultilangValue; label?: string; placeholder?: string; required?: boolean; error?: string | boolean; disabled?: boolean }
116
+
117
+ export const UiButton: DefineComponent<UiButtonProps>;
118
+ export const UiInput: DefineComponent<UiInputProps>;
119
+ export const UiTextarea: DefineComponent<UiTextareaProps>;
120
+ export const UiSelect: DefineComponent<UiSelectProps>;
121
+ export const UiCombobox: DefineComponent<UiComboboxProps>;
122
+ export const UiCheckbox: DefineComponent<UiCheckboxProps>;
123
+ export const UiSwitch: DefineComponent<UiSwitchProps>;
124
+ export const UiBadge: DefineComponent<UiBadgeProps>;
125
+ export const UiAlert: DefineComponent<UiAlertProps>;
126
+ export const UiCard: DefineComponent<UiCardProps>;
127
+ export const UiModal: DefineComponent<UiModalProps>;
128
+ export const UiConfirmModal: DefineComponent<UiConfirmModalProps>;
129
+ export const UiTable: DefineComponent<UiTableProps>;
130
+ export const UiPagination: DefineComponent<UiPaginationProps>;
131
+ export const UiProgress: DefineComponent<UiProgressProps>;
132
+ export const UiAvatar: DefineComponent<UiAvatarProps>;
133
+ export const UiTooltip: DefineComponent<UiTooltipProps>;
134
+ export const UiBreadcrumbs: DefineComponent<UiBreadcrumbsProps>;
135
+ export const UiStatsCard: DefineComponent<UiStatsCardProps>;
136
+ export const UiSegmentedControl: DefineComponent<UiSegmentedControlProps>;
137
+ export const UiDatePicker: DefineComponent<UiDatePickerProps>;
138
+ export const UiDateTimePicker: DefineComponent<UiDateTimePickerProps>;
139
+ export const UiDropdown: DefineComponent<UiDropdownProps>;
140
+ export const UiSidebar: DefineComponent<UiSidebarProps>;
141
+ export const UiSubNav: DefineComponent<UiSubNavProps>;
142
+ export const UiFileUpload: DefineComponent<UiFileUploadProps>;
143
+ export const UiMultilangInput: DefineComponent<UiMultilangInputProps>;
144
+ export const MultilangInput: DefineComponent<UiMultilangInputProps>;
145
+ export const UiSkeleton: DefineComponent<{ variant?: 'text' | 'rect' | 'circle' | 'line'; size?: 'sm' | 'md' | 'lg'; lines?: number; lastLineWidth?: string }>;
146
+ export const UiAvatarGroup: DefineComponent<{ spacing?: 'tight' | 'normal' | 'loose'; reverse?: boolean }>;
147
+ export const UiTabs: DefineComponent<{ modelValue?: string | number | null; variant?: 'pill' | 'underline' }>;
148
+ export const UiTabsList: DefineComponent<Any>;
149
+ export const UiTab: DefineComponent<{ value: string | number; disabled?: boolean }>;
150
+ export const UiTabPanel: DefineComponent<{ value: string | number }>;
151
+ export const UiRadioGroup: DefineComponent<{ modelValue?: string | number | boolean | null; label?: string; hint?: string; error?: string | boolean; name?: string; size?: 'sm' | 'md' | 'lg'; disabled?: boolean; orientation?: 'vertical' | 'horizontal' }>;
152
+ export const UiRadio: DefineComponent<{ modelValue?: string | number | boolean | null; value: string | number | boolean; label?: string; hint?: string; disabled?: boolean; size?: 'sm' | 'md' | 'lg' }>;
153
+ export const UiMenu: DefineComponent<{ minWidth?: string; autofocus?: boolean }>;
154
+ export const UiMenuItem: DefineComponent<{ disabled?: boolean; tone?: 'default' | 'danger'; closeOnClick?: boolean }>;
155
+ export const UiMenuSeparator: DefineComponent<{ label?: string }>;
156
+ export const UiSidebarSection: DefineComponent<{ label?: string }>;
157
+ export const UiSidebarItem: DefineComponent<{ label: string; icon?: Component; active?: boolean; badge?: number | string; href?: string; disabled?: boolean }>;
158
+ export const UiNavbar: DefineComponent<{ variant?: 'glass' | 'solid' | 'minimal'; size?: 'md' | 'lg'; sticky?: boolean }>;
159
+ export const UiToastContainer: DefineComponent<{ position?: 'top-right' | 'top-center' | 'top-left' | 'bottom-right' | 'bottom-center' | 'bottom-left' }>;
160
+ export const UiCommandPalette: DefineComponent<{ shortcutKey?: string; disableShortcut?: boolean; emptyText?: string; placeholder?: string }>;
161
+ export const UiCalendar: DefineComponent<{ modelValue?: Date | null; locale?: string; weekStartsOn?: 0 | 1 }>;
162
+ export const UiForm: DefineComponent<{ novalidate?: boolean }>;
163
+ // Names from the published glass-ui-kit that are not part of the local component copies.
164
+ export const UiSpinner: DefineComponent<Any>;
165
+ export const UiDivider: DefineComponent<Any>;
166
+ export const UiBanner: DefineComponent<Any>;
167
+ export const UiEmptyState: DefineComponent<Any>;
168
+ export const UiDrawer: DefineComponent<Any>;
169
+ export const UiTag: DefineComponent<Any>;
170
+ export const UiOtpInput: DefineComponent<Any>;
171
+ export const UiKpiCard: DefineComponent<Any>;
172
+ export const UiFormField: DefineComponent<Any>;
173
+
174
+ export function install(app: App): void;
175
+ declare const _default: { install: typeof install };
176
+ export default _default;
@@ -0,0 +1,12 @@
1
+ export type UiLocale = 'en' | 'uz' | 'ru' | 'tr' | 'zh' | 'ar';
2
+ export const LOCALES: readonly UiLocale[];
3
+ export const RTL_LOCALES: readonly UiLocale[];
4
+ /** Switch the language of the built-in component strings. Components re-render by themselves. */
5
+ export function setUiLocale(locale: UiLocale | string): void;
6
+ export function getUiLocale(): UiLocale;
7
+ export function isRtlLocale(locale?: string): boolean;
8
+ /** Override single strings from the app: setUiMessages('ru', { Pagination: { prev: 'Назад' } }). Pass null to clear a locale. */
9
+ export function setUiMessages(locale: UiLocale | string, messages: Record<string, Record<string, string>> | null): void;
10
+ 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>>): void;
12
+ export function subscribeUiLocale(fn: (locale: UiLocale) => void): () => void;
@@ -0,0 +1,4 @@
1
+ export interface MetaProp { type: string; values?: string[]; default?: unknown; description?: string; required?: boolean; model?: boolean; forwarded?: boolean }
2
+ export interface ComponentMeta { description: string; props?: Record<string, MetaProp>; slots?: Record<string, string>; events?: Record<string, string>; notes?: string[] }
3
+ export const meta: Record<string, ComponentMeta>;
4
+ export default meta;
package/types/nuxt.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export interface ModuleOptions {
2
2
  css?: boolean;
3
3
  prefix?: string;
4
- theme?: false | { theme?: 'dark' | 'light'; palette?: 'gold' | 'tamam'; dir?: 'ltr' | 'rtl' };
4
+ theme?: false | { theme?: 'dark' | 'light'; palette?: 'gold' | 'tamam'; dir?: 'ltr' | 'rtl'; bg?: 'none' | 'aurora' | 'sunset' | 'ocean' | 'emerald' | 'rose' | 'mesh' };
5
5
  }
6
6
  declare const _default: import('@nuxt/schema').NuxtModule<ModuleOptions>;
7
7
  export default _default;