@ziyarago/ui 0.13.0 → 0.14.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/dist/llms-full.txt +1 -1
- package/dist/llms.txt +1 -1
- package/dist/manifest.json +1 -1
- package/docs/INTEGRATION.md +11 -0
- package/package.json +1 -1
- package/src/core/index.js +6 -0
- package/src/meta/index.js +13 -0
- package/src/nuxt/module.mjs +9 -1
- package/src/react/index.js +8 -1
- package/src/resolver.js +17 -4
- package/src/vue/index.js +8 -1
- package/types/core.d.ts +3 -0
- package/types/meta.d.ts +3 -0
- package/types/nuxt.d.ts +2 -0
- package/types/react.d.ts +2 -0
- package/types/resolver.d.ts +2 -0
- package/types/vue.d.ts +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
## [0.14.0](https://github.com/ziyarago/ui/compare/v0.13.0...v0.14.0) (2026-10-21)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
* plugin API (registerComponents, defineUiComponents, registerMeta, resolver and Nuxt plugins option) ([ab8b844](https://github.com/ziyarago/ui/commit/ab8b8442a9968cfc0c978d9a5d4c3dc22b28b467))
|
|
6
|
+
|
|
1
7
|
## [0.13.0](https://github.com/ziyarago/ui/compare/v0.12.0...v0.13.0) (2026-10-21)
|
|
2
8
|
|
|
3
9
|
### Features
|
package/dist/llms-full.txt
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> ZiyaraGo UI — glass design system for Umrah and Hajj products. OKLCH tokens, two palettes, dark and light, RTL, Thmanyah. One framework-neutral core with Vue 3, Nuxt and React adapters, 208 components and 40 page templates.
|
|
4
4
|
|
|
5
|
-
Version 0.
|
|
5
|
+
Version 0.14.0. Docs: https://ziyara.vip . Manifest (machine readable): https://ziyara.vip/manifest.json
|
|
6
6
|
|
|
7
7
|
## Setup
|
|
8
8
|
- import { UiButton } from '@ziyarago/ui/vue'
|
package/dist/llms.txt
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> ZiyaraGo UI — glass design system for Umrah and Hajj products. OKLCH tokens, two palettes, dark and light, RTL, Thmanyah. One framework-neutral core with Vue 3, Nuxt and React adapters, 208 components and 40 page templates.
|
|
4
4
|
|
|
5
|
-
Version 0.
|
|
5
|
+
Version 0.14.0. Docs: https://ziyara.vip . Manifest (machine readable): https://ziyara.vip/manifest.json
|
|
6
6
|
|
|
7
7
|
## Setup
|
|
8
8
|
- import { UiButton } from '@ziyarago/ui/vue'
|
package/dist/manifest.json
CHANGED
package/docs/INTEGRATION.md
CHANGED
|
@@ -151,3 +151,14 @@ React types: `Ui<Name>Props` (props, callbacks, named slots as `ReactNode` props
|
|
|
151
151
|
## 7. Checking the types yourself
|
|
152
152
|
|
|
153
153
|
`npm run test:types` in this repository runs vue-tsc and tsc over `tests/types/*`: valid usage must compile, invalid enum / missing required prop / wrong event payload / wrong model type / unknown slot / wrong slot type must fail with the expected message.
|
|
154
|
+
|
|
155
|
+
## 8. Add-on packages (plugins)
|
|
156
|
+
|
|
157
|
+
An add-on package (for example `@ziyarago/ui-pro`) plugs components into the same registry through `registerComponents` / `defineUiComponents`, so its definitions can use `C.Button` and the core components can reference them. A plugin ships its own stylesheet: import it after the core one.
|
|
158
|
+
|
|
159
|
+
```ts
|
|
160
|
+
import '@ziyarago/ui/style.css'
|
|
161
|
+
import '@ziyarago/ui-pro/style.css' // plugin css, always after style.css
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
Plugin CSS must only use the public design tokens (`--zg-*`, see `@ziyarago/ui/tokens.css`) and its own prefixed classes. Auto-import: pass `plugins: ['@ziyarago/ui-pro']` to the Nuxt module options (`ziyarago: { plugins: [...] }`) or to `ZiyaragoUiResolver({ plugins: [...] })`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ziyarago/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"description": "ZiyaraGo UI — glass design system for Umrah and Hajj products. OKLCH tokens, two palettes, dark and light, RTL, Thmanyah. One framework-neutral core with Vue 3, Nuxt and React adapters, 208 components and 40 page templates.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ui",
|
package/src/core/index.js
CHANGED
|
@@ -7,5 +7,11 @@ import { more6 } from './components6.js';
|
|
|
7
7
|
import { more7 } from './components7.js';
|
|
8
8
|
export const components = { ...base, ...more, ...more3, ...more4, ...more6, ...more7, ...pages };
|
|
9
9
|
export { fmt, setIconBase, rules };
|
|
10
|
+
/** Extension API: adds definitions to the shared registry (used by add-on packages such as @ziyarago/ui-pro). Registering the very same definition twice is a no-op (Vue and React adapters can both load one plugin). */
|
|
11
|
+
export function registerComponents(defs, { override = false } = {}) {
|
|
12
|
+
for (const name of Object.keys(defs)) if (!override && name in components && components[name] !== defs[name]) throw new Error(`@ziyarago/ui: component "${name}" is already registered (pass { override: true } to replace it)`);
|
|
13
|
+
Object.assign(components, defs);
|
|
14
|
+
return components;
|
|
15
|
+
}
|
|
10
16
|
export { LOCALES, FREE_LOCALES, t, setUiLocale, getUiLocale, setUiMessages, isRtlLocale, subscribeUiLocale, getUiVersion, defineMessages } from '../i18n/index.js';
|
|
11
17
|
import '../i18n/components/index.js';
|
package/src/meta/index.js
CHANGED
|
@@ -11,4 +11,17 @@ import domain from './domain.js';
|
|
|
11
11
|
import pages from './pages.js';
|
|
12
12
|
|
|
13
13
|
export const meta = { ...typography, ...layout, ...actions, ...forms, ...data, ...feedback, ...overlay, ...navigation, ...media, ...domain, ...pages };
|
|
14
|
+
import { PRO_NAMES } from './tiers.js';
|
|
15
|
+
import { GROUPS } from './groups.js';
|
|
16
|
+
/** Extension API: adds API metadata for plugin components. `tiers` marks names as Pro, `groups` ({ id, title, blurb, names }) lists them in the manifest. */
|
|
17
|
+
export function registerMeta(extra, { tiers, groups } = {}) {
|
|
18
|
+
Object.assign(meta, extra);
|
|
19
|
+
for (const n of tiers || []) PRO_NAMES.add(n);
|
|
20
|
+
for (const g of groups || []) {
|
|
21
|
+
const ex = GROUPS.find(x => x.id === g.id);
|
|
22
|
+
if (ex) ex.names.push(...g.names.filter(n => !ex.names.includes(n)));
|
|
23
|
+
else GROUPS.push({ blurb: '', title: g.id, ...g, names: [...g.names] });
|
|
24
|
+
}
|
|
25
|
+
return meta;
|
|
26
|
+
}
|
|
14
27
|
export default meta;
|
package/src/nuxt/module.mjs
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
// Nuxt 3/4 module. nuxt.config: modules: ['@ziyarago/ui/nuxt'], ziyarago: { theme: true }
|
|
2
2
|
import { defineNuxtModule, addComponent, addImports, addPlugin, createResolver } from '@nuxt/kit';
|
|
3
|
+
import { createRequire } from 'node:module';
|
|
3
4
|
import { components } from '../core/index.js';
|
|
4
5
|
import { themeInitScript } from '../theme.js';
|
|
5
6
|
|
|
6
7
|
export default defineNuxtModule({
|
|
7
8
|
meta: { name: '@ziyarago/ui', configKey: 'ziyarago', compatibility: { nuxt: '>=3.0.0' } },
|
|
8
|
-
defaults: { css: true, prefix: 'Ui', theme: { theme: 'dark', palette: 'gold', dir: 'ltr', bg: 'none', locale: 'en' } },
|
|
9
|
+
defaults: { css: true, plugins: [], prefix: 'Ui', theme: { theme: 'dark', palette: 'gold', dir: 'ltr', bg: 'none', locale: 'en' } },
|
|
9
10
|
setup(opts, nuxt) {
|
|
10
11
|
const { resolve } = createResolver(import.meta.url);
|
|
11
12
|
if (opts.css) nuxt.options.css.push('@ziyarago/ui/style.css');
|
|
@@ -13,6 +14,13 @@ export default defineNuxtModule({
|
|
|
13
14
|
for (const name of Object.keys(components)) {
|
|
14
15
|
addComponent({ name: opts.prefix + name, export: opts.prefix + name, filePath: '@ziyarago/ui/vue' });
|
|
15
16
|
}
|
|
17
|
+
for (const pkg of opts.plugins) {
|
|
18
|
+
nuxt.options.build.transpile.push(pkg);
|
|
19
|
+
let names = [];
|
|
20
|
+
try { names = createRequire(import.meta.url)(pkg + '/names'); } catch { try { names = createRequire(nuxt.options.rootDir + '/')(pkg + '/names'); } catch { console.warn(`[@ziyarago/ui] plugin ${pkg}: cannot load ${pkg}/names`); } }
|
|
21
|
+
for (const name of names) addComponent({ name: opts.prefix + name, export: 'Ui' + name, filePath: pkg + '/vue' });
|
|
22
|
+
if (opts.css) nuxt.options.css.push(pkg + '/style.css');
|
|
23
|
+
}
|
|
16
24
|
addImports([
|
|
17
25
|
{ name: 'useUiTheme', from: '@ziyarago/ui/theme' },
|
|
18
26
|
{ name: 'fmt', from: '@ziyarago/ui/vue' },
|
package/src/react/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// React 18+ adapter. Usage: import { UiButton, UiAppShell } from '@ziyarago/ui/react'
|
|
3
3
|
import React, { useState, useRef, useEffect, useLayoutEffect, useSyncExternalStore, createElement, cloneElement, isValidElement } from 'react';
|
|
4
4
|
import { createPortal } from 'react-dom';
|
|
5
|
-
import { components, subscribeUiLocale, getUiVersion } from '../core/index.js';
|
|
5
|
+
import { components, registerComponents, subscribeUiLocale, getUiVersion } from '../core/index.js';
|
|
6
6
|
|
|
7
7
|
const C = {};
|
|
8
8
|
const useIsoLayoutEffect = typeof document === 'undefined' ? useEffect : useLayoutEffect;
|
|
@@ -37,6 +37,13 @@ const wrap = (name, def) => {
|
|
|
37
37
|
return Comp;
|
|
38
38
|
};
|
|
39
39
|
for (const [name, def] of Object.entries(components)) C[name] = wrap(name, def);
|
|
40
|
+
/** Wraps definitions like the built-in ones, registers them in C (cross references work both ways) and returns { UiName: Component }. */
|
|
41
|
+
export function defineUiComponents(defs, { override = false } = {}) {
|
|
42
|
+
registerComponents(defs, { override });
|
|
43
|
+
const out = {};
|
|
44
|
+
for (const [name, def] of Object.entries(defs)) out['Ui' + name] = C[name] = wrap(name, def);
|
|
45
|
+
return out;
|
|
46
|
+
}
|
|
40
47
|
|
|
41
48
|
// Explicit named exports (not destructuring): Next.js reads the export names of a 'use client' module statically.
|
|
42
49
|
export const UiButton = C.Button;
|
package/src/resolver.js
CHANGED
|
@@ -3,20 +3,31 @@
|
|
|
3
3
|
// import { ZiyaragoUiResolver } from '@ziyarago/ui/resolver'
|
|
4
4
|
// Components({ resolvers: [ZiyaragoUiResolver()] })
|
|
5
5
|
// Zero dependencies: it only maps <UiButton> to { name: 'UiButton', from: '@ziyarago/ui/vue' }.
|
|
6
|
+
import { createRequire } from 'node:module';
|
|
6
7
|
import { components } from './core/index.js';
|
|
7
8
|
|
|
8
9
|
const NAMES = new Set(Object.keys(components));
|
|
9
10
|
|
|
11
|
+
// Plugin packages (see docs-private/PRO-SPLIT.md, "Plugin contract") export ./names (JSON array of component names without the Ui prefix) and ./vue.
|
|
12
|
+
// A plugin may be a package name or { from, names } for tests and custom setups.
|
|
13
|
+
const loadPlugin = p => {
|
|
14
|
+
if (typeof p !== 'string') return { from: p.from, names: new Set(p.names) };
|
|
15
|
+
const req = createRequire(process.cwd() + '/');
|
|
16
|
+
return { from: p + '/vue', names: new Set(req(p + '/names')) };
|
|
17
|
+
};
|
|
18
|
+
|
|
10
19
|
/**
|
|
11
|
-
* @param {{ prefix?: string, css?: boolean | string, exclude?: string[], from?: string }} [options]
|
|
20
|
+
* @param {{ prefix?: string, css?: boolean | string, exclude?: string[], from?: string, plugins?: Array<string | { from: string, names: string[] }> }} [options]
|
|
12
21
|
* prefix component prefix, default 'Ui' (must match the registered names, which are always Ui*)
|
|
13
22
|
* css true: import '@ziyarago/ui/style.css' as a side effect together with the first resolved component (once per module that uses one);
|
|
14
23
|
* a string: import that path instead (for example your own entry that imports the css inside a Tailwind @layer). Default false.
|
|
15
24
|
* exclude component names (without prefix) that must not be auto-imported, e.g. ['Button'] if you keep your own UiButton.
|
|
16
25
|
* from module the components are imported from, default '@ziyarago/ui/vue'
|
|
26
|
+
* plugins add-on packages whose components auto-import too: ['@ziyarago/ui-pro'] (needs its ./names and ./vue exports) or [{ from, names }]
|
|
17
27
|
*/
|
|
18
28
|
export function ZiyaragoUiResolver(options = {}) {
|
|
19
|
-
const { prefix = 'Ui', css = false, exclude = [], from = '@ziyarago/ui/vue' } = options;
|
|
29
|
+
const { prefix = 'Ui', css = false, exclude = [], from = '@ziyarago/ui/vue', plugins = [] } = options;
|
|
30
|
+
const loaded = plugins.map(loadPlugin);
|
|
20
31
|
const skip = new Set(exclude.map(n => n.replace(/^Ui/, '')));
|
|
21
32
|
const sideEffects = css ? (css === true ? '@ziyarago/ui/style.css' : css) : undefined;
|
|
22
33
|
return {
|
|
@@ -24,8 +35,10 @@ export function ZiyaragoUiResolver(options = {}) {
|
|
|
24
35
|
resolve(name) {
|
|
25
36
|
if (!name.startsWith(prefix)) return;
|
|
26
37
|
const bare = name.slice(prefix.length);
|
|
27
|
-
if (
|
|
28
|
-
|
|
38
|
+
if (skip.has(bare)) return;
|
|
39
|
+
const pl = NAMES.has(bare) ? null : loaded.find(x => x.names.has(bare));
|
|
40
|
+
if (!pl && !NAMES.has(bare)) return;
|
|
41
|
+
return { name: 'Ui' + bare, from: pl ? pl.from : from, ...(sideEffects ? { sideEffects } : {}) };
|
|
29
42
|
},
|
|
30
43
|
};
|
|
31
44
|
}
|
package/src/vue/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Vue 3 adapter. Usage: import { UiButton, UiAppShell } from '@ziyarago/ui/vue'
|
|
2
2
|
import { h, ref, reactive, defineComponent, onMounted, onBeforeUnmount, Teleport, cloneVNode, isVNode } from 'vue';
|
|
3
|
-
import { components, subscribeUiLocale } from '../core/index.js';
|
|
3
|
+
import { components, registerComponents, subscribeUiLocale } from '../core/index.js';
|
|
4
4
|
import { BOOL_PROPS } from '../core/bools.js';
|
|
5
5
|
|
|
6
6
|
const C = {};
|
|
@@ -28,6 +28,13 @@ const wrap = (name, def) => defineComponent({
|
|
|
28
28
|
},
|
|
29
29
|
});
|
|
30
30
|
for (const [name, def] of Object.entries(components)) C[name] = wrap(name, def);
|
|
31
|
+
/** Wraps definitions like the built-in ones, registers them in C (cross references work both ways) and returns { UiName: Component }. */
|
|
32
|
+
export function defineUiComponents(defs, { override = false } = {}) {
|
|
33
|
+
registerComponents(defs, { override });
|
|
34
|
+
const out = {};
|
|
35
|
+
for (const [name, def] of Object.entries(defs)) out['Ui' + name] = C[name] = wrap(name, def);
|
|
36
|
+
return out;
|
|
37
|
+
}
|
|
31
38
|
|
|
32
39
|
export const { Button: UiButton, IconButton: UiIconButton, Badge: UiBadge, Avatar: UiAvatar, Switch: UiSwitch, Checkbox: UiCheckbox, SegmentedControl: UiSegmentedControl, Tabs: UiTabs, FilterChips: UiFilterChips, TextField: UiTextField, Select: UiSelect, CodeInput: UiCodeInput, Stepper: UiStepper, Card: UiCard, Modal: UiModal, Drawer: UiDrawer, Toast: UiToast, Breadcrumbs: UiBreadcrumbs, Pagination: UiPagination, Progress: UiProgress, Ring: UiRing, KpiTile: UiKpiTile, DataTable: UiDataTable, KanbanColumn: UiKanbanColumn, KanbanCard: UiKanbanCard, Timeline: UiTimeline, TopNav: UiTopNav, SideNav: UiSideNav, AppShell: UiAppShell, PageHeader: UiPageHeader, AuthLayout: UiAuthLayout, LeadCard: UiLeadCard, HotelCard: UiHotelCard, TourCard: UiTourCard, PrayerTimes: UiPrayerTimes, RamadanTracker: UiRamadanTracker, QiblaCompass: UiQiblaCompass, CallRow: UiCallRow, Alert: UiAlert, Banner: UiBanner, Accordion: UiAccordion, Skeleton: UiSkeleton, Spinner: UiSpinner, Divider: UiDivider, EmptyState: UiEmptyState, ErrorPage: UiErrorPage, DataState: UiDataState, LoadingOverlay: UiLoadingOverlay, ConfirmDialog: UiConfirmDialog, Popconfirm: UiPopconfirm, Carousel: UiCarousel, Gallery: UiGallery, Code: UiCode, PricingCard: UiPricingCard, IntegrationCard: UiIntegrationCard, IncomingCall: UiIncomingCall, CallCard: UiCallCard, Dropdown: UiDropdown, Menu: UiMenu, Tooltip: UiTooltip, HoverCard: UiHoverCard, Popover: UiPopover, CopyButton: UiCopyButton, CommandBar: UiCommandBar, CommandPalette: UiCommandPalette, NotificationBell: UiNotificationBell, ToggleGroup: UiToggleGroup, Fab: UiFab, Textarea: UiTextarea, NumberInput: UiNumberInput, PasswordInput: UiPasswordInput, SearchInput: UiSearchInput, RadioGroup: UiRadioGroup, Slider: UiSlider, Rating: UiRating, ChipInput: UiChipInput, InlineEdit: UiInlineEdit, ColorPicker: UiColorPicker, FileUpload: UiFileUpload, Combobox: UiCombobox, MultiSelect: UiMultiSelect, GroupedSelect: UiGroupedSelect, PhoneInput: UiPhoneInput, Calendar: UiCalendar, DatePicker: UiDatePicker, TimePicker: UiTimePicker, FormField: UiFormField, LoginForm: UiLoginForm, StepForm: UiStepForm, Tag: UiTag, Kbd: UiKbd, StatsCard: UiStatsCard, KpiInline: UiKpiInline, MiniChart: UiMiniChart, Descriptions: UiDescriptions, LazyImage: UiLazyImage, SystemStatus: UiSystemStatus, TreeView: UiTreeView, CalendarView: UiCalendarView, SubNav: UiSubNav, ActionRail: UiActionRail, SplitLayout: UiSplitLayout, SettingsSection: UiSettingsSection, ScrollArea: UiScrollArea, DealCard: UiDealCard, PipelineBoard: UiPipelineBoard, ContactPanel: UiContactPanel, SalesFunnel: UiSalesFunnel, BookingCard: UiBookingCard, GuestCard: UiGuestCard, RoomGrid: UiRoomGrid, RoomCalendar: UiRoomCalendar, OccupancyChart: UiOccupancyChart, Chip: UiChip, IconTile: UiIconTile, StatusIcon: UiStatusIcon, UserCell: UiUserCell, StatRow: UiStatRow, CountryRow: UiCountryRow, StatLine: UiStatLine, StatStrip: UiStatStrip, VersusBar: UiVersusBar, SegBar: UiSegBar, HeroBanner: UiHeroBanner, TabTiles: UiTabTiles, PillTabs: UiPillTabs, PillSelect: UiPillSelect, ChartCard: UiChartCard, ActionCard: UiActionCard, Snackbar: UiSnackbar, TourPopover: UiTourPopover, ProfileHeader: UiProfileHeader, AuthSplit: UiAuthSplit, AuthShowcase: UiAuthShowcase, SocialAuth: UiSocialAuth, StatusPage: UiStatusPage, ValidatedField: UiValidatedField, Footer: UiFooter, DataGroup: UiDataGroup, OptionCard: UiOptionCard, OptionCards: UiOptionCards, RichEditor: UiRichEditor, RangeSlider: UiRangeSlider, RangeCalendar: UiRangeCalendar, StepDialog: UiStepDialog, FullscreenDialog: UiFullscreenDialog, PageDashboard: UiPageDashboard, PagePatterns: UiPagePatterns, PageCrm: UiPageCrm, PageBookings: UiPageBookings, PageCatalog: UiPageCatalog, PageDetail: UiPageDetail, PageSettings: UiPageSettings, PageUserList: UiPageUserList, PageProfile: UiPageProfile, PageForm: UiPageForm, PageOrder: UiPageOrder, PageAccount: UiPageAccount, PagePricing: UiPagePricing, PageFaq: UiPageFaq, PageAnalytics: UiPageAnalytics, PageCalendar: UiPageCalendar, PageKanban: UiPageKanban, PageBilling: UiPageBilling, PageTeam: UiPageTeam, PageIntegrations: UiPageIntegrations, PageSearch: UiPageSearch, PageArticle: UiPageArticle, PageChangelog: UiPageChangelog, PageHelp: UiPageHelp, PageStates: UiPageStates, PageLegal: UiPageLegal, PageLocations: UiPageLocations, PageBookingFlow: UiPageBookingFlow, PageItinerary: UiPageItinerary, PagePrayer: UiPagePrayer, PageGroupManager: UiPageGroupManager, PageTourPublic: UiPageTourPublic, PageNotifications: UiPageNotifications, PageInbox: UiPageInbox, PageCheckout: UiPageCheckout, PageOnboarding: UiPageOnboarding, PageLanding: UiPageLanding, PageAuth: UiPageAuth, PageStatus: UiPageStatus, TreeSelect: UiTreeSelect, ContextMenu: UiContextMenu, Sortable: UiSortable, Map: UiMap, ImageUpload: UiImageUpload, Screensaver: UiScreensaver, Tour: UiTour, Heading: UiHeading, Text: UiText, Box: UiBox, Center: UiCenter, HStack: UiHStack, VStack: UiVStack, Grid: UiGrid, Link: UiLink, Pressable: UiPressable, Icon: UiIcon, Portal: UiPortal, LiquidGlass: UiLiquidGlass, BottomSheet: UiBottomSheet, Actionsheet: UiActionsheet, ImageViewer: UiImageViewer, ChatAi: UiChatAi } = C;
|
|
33
40
|
export const install = app => { for (const [n, c] of Object.entries(C)) app.component('Ui' + n, c); };
|
package/types/core.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
// Core (framework-neutral) entry. Most apps import from '@ziyarago/ui/vue' or '@ziyarago/ui/react' instead.
|
|
2
2
|
export { rules, setIconBase, fmt } from './shared';
|
|
3
3
|
export type * from './shared';
|
|
4
|
+
export interface ComponentDefinition { state?: Record<string, unknown>; slots?: string[]; render: (ctx: any) => unknown }
|
|
5
|
+
/** Extension API for add-on packages: adds definitions to the shared registry. Throws on a name clash with a different definition unless { override: true }. */
|
|
6
|
+
export function registerComponents(defs: Record<string, ComponentDefinition>, options?: { override?: boolean }): Record<string, ComponentDefinition>;
|
|
4
7
|
export const components: Record<string, { state?: Record<string, unknown>; slots?: string[]; render: (ctx: any) => unknown }>;
|
package/types/meta.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
export interface MetaProp { type: string; values?: string[]; default?: unknown; description?: string; required?: boolean; model?: boolean; forwarded?: boolean }
|
|
2
2
|
export interface ComponentMeta { description: string; props?: Record<string, MetaProp>; slots?: Record<string, string>; events?: Record<string, string>; notes?: string[] }
|
|
3
|
+
export interface MetaGroup { id: string; title?: string; blurb?: string; names: string[] }
|
|
4
|
+
/** Extension API: adds metadata for plugin components. `tiers` are marked as pro, `groups` list them in the manifest. */
|
|
5
|
+
export function registerMeta(extra: Record<string, ComponentMeta>, options?: { tiers?: string[]; groups?: MetaGroup[] }): Record<string, ComponentMeta>;
|
|
3
6
|
export const meta: Record<string, ComponentMeta>;
|
|
4
7
|
export default meta;
|
package/types/nuxt.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export interface ModuleOptions {
|
|
2
2
|
css?: boolean;
|
|
3
3
|
prefix?: string;
|
|
4
|
+
/** Add-on packages (for example '@ziyarago/ui-pro'): their components auto-import and their style.css is added after the core css. */
|
|
5
|
+
plugins?: string[];
|
|
4
6
|
theme?: false | { theme?: 'dark' | 'light'; palette?: 'gold' | 'tamam'; dir?: 'ltr' | 'rtl'; bg?: 'none' | 'aurora' | 'sunset' | 'ocean' | 'emerald' | 'rose' | 'mesh' };
|
|
5
7
|
}
|
|
6
8
|
declare const _default: import('@nuxt/schema').NuxtModule<ModuleOptions>;
|
package/types/react.d.ts
CHANGED
|
@@ -7739,3 +7739,5 @@ export const UiVersusBar: ComponentType<UiVersusBarProps>;
|
|
|
7739
7739
|
export const rules: typeof import('./shared').rules;
|
|
7740
7740
|
export { useUiTheme } from './theme';
|
|
7741
7741
|
export { fmt, setIconBase } from './shared';
|
|
7742
|
+
/** Extension API: wraps plugin component definitions like the built-in ones, registers them (C.Name cross references work) and returns { UiName: Component }. */
|
|
7743
|
+
export function defineUiComponents(defs: Record<string, import('./core').ComponentDefinition>, options?: { override?: boolean }): Record<string, ComponentType<any>>;
|
package/types/resolver.d.ts
CHANGED
|
@@ -7,6 +7,8 @@ export interface ZiyaragoUiResolverOptions {
|
|
|
7
7
|
exclude?: string[];
|
|
8
8
|
/** Module the components come from. Default '@ziyarago/ui/vue'. */
|
|
9
9
|
from?: string;
|
|
10
|
+
/** Add-on packages whose components auto-import too: a package name exporting ./names and ./vue, or an explicit { from, names }. */
|
|
11
|
+
plugins?: Array<string | { from: string; names: string[] }>;
|
|
10
12
|
}
|
|
11
13
|
export interface ZiyaragoUiResolverResult { name: string; from: string; sideEffects?: string }
|
|
12
14
|
export interface ZiyaragoUiResolver { type: 'component'; resolve(name: string): ZiyaragoUiResolverResult | undefined }
|
package/types/vue.d.ts
CHANGED
|
@@ -7217,6 +7217,8 @@ export const UiVersusBar: UiVueComponent<UiVersusBarProps, UiVersusBarSlots>;
|
|
|
7217
7217
|
|
|
7218
7218
|
export const rules: typeof import('./shared').rules;
|
|
7219
7219
|
export function install(app: import('vue').App): void;
|
|
7220
|
+
/** Extension API: wraps plugin component definitions like the built-in ones, registers them (C.Name cross references work) and returns { UiName: Component }. */
|
|
7221
|
+
export function defineUiComponents(defs: Record<string, import('./core').ComponentDefinition>, options?: { override?: boolean }): Record<string, import('vue').Component>;
|
|
7220
7222
|
declare const _default: { install: typeof install };
|
|
7221
7223
|
export default _default;
|
|
7222
7224
|
export { useUiTheme } from './theme';
|