@vhyxui/core 0.1.0-alpha.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.
- package/dist/Slot-CLNJSabn.cjs +1 -0
- package/dist/Slot-PvMbF2q3.js +43 -0
- package/dist/contracts.cjs +1 -0
- package/dist/contracts.d.ts +251 -0
- package/dist/contracts.js +25 -0
- package/dist/errors.cjs +1 -0
- package/dist/errors.d.ts +44 -0
- package/dist/errors.js +10 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +367 -0
- package/dist/index.js +32 -0
- package/dist/pagination-BC8m1q01.js +312 -0
- package/dist/pagination-DMKZiFFW.cjs +1 -0
- package/dist/slot.cjs +1 -0
- package/dist/slot.d.ts +52 -0
- package/dist/slot.js +6 -0
- package/dist/types.cjs +1 -0
- package/dist/types.d.ts +16 -0
- package/dist/types.js +1 -0
- package/package.json +60 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const r=require("react");function a(n){return/^on[A-Z]/.test(n)}function i(n,l){const e={...n};for(const t of Object.keys(l)){const s=n[t],o=l[t];if(a(t))typeof s=="function"&&typeof o=="function"?e[t]=(...f)=>{s(...f),o(...f)}:e[t]=o??s;else if(t==="className"){const f=typeof s=="string"?s:void 0,y=typeof o=="string"?o:void 0;e[t]=[f,y].filter(Boolean).join(" ")||void 0}else t==="style"?e[t]=s!==null&&typeof s=="object"&&o!==null&&typeof o=="object"?{...s,...o}:o??s:e[t]=o}return e}function c(...n){return l=>{for(const e of n)e!=null&&(typeof e=="function"?e(l):e.current=l)}}const u=r.forwardRef(({children:n,...l},e)=>{if(!r.isValidElement(n))return null;const t=n;return r.cloneElement(t,{...i(l,t.props),ref:e!=null?c(e,t.ref):t.ref})});u.displayName="VhyxSlot";exports.Slot=u;exports.mergeProps=i;exports.mergeRefs=c;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import i from "react";
|
|
2
|
+
function c(n) {
|
|
3
|
+
return /^on[A-Z]/.test(n);
|
|
4
|
+
}
|
|
5
|
+
function u(n, l) {
|
|
6
|
+
const e = { ...n };
|
|
7
|
+
for (const t of Object.keys(l)) {
|
|
8
|
+
const f = n[t], o = l[t];
|
|
9
|
+
if (c(t))
|
|
10
|
+
typeof f == "function" && typeof o == "function" ? e[t] = (...s) => {
|
|
11
|
+
f(...s), o(...s);
|
|
12
|
+
} : e[t] = o ?? f;
|
|
13
|
+
else if (t === "className") {
|
|
14
|
+
const s = typeof f == "string" ? f : void 0, r = typeof o == "string" ? o : void 0;
|
|
15
|
+
e[t] = [s, r].filter(Boolean).join(" ") || void 0;
|
|
16
|
+
} else t === "style" ? e[t] = f !== null && typeof f == "object" && o !== null && typeof o == "object" ? { ...f, ...o } : o ?? f : e[t] = o;
|
|
17
|
+
}
|
|
18
|
+
return e;
|
|
19
|
+
}
|
|
20
|
+
function a(...n) {
|
|
21
|
+
return (l) => {
|
|
22
|
+
for (const e of n)
|
|
23
|
+
e != null && (typeof e == "function" ? e(l) : e.current = l);
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
const y = i.forwardRef(
|
|
27
|
+
({ children: n, ...l }, e) => {
|
|
28
|
+
if (!i.isValidElement(n))
|
|
29
|
+
return null;
|
|
30
|
+
const t = n;
|
|
31
|
+
return i.cloneElement(t, {
|
|
32
|
+
...u(l, t.props),
|
|
33
|
+
// Merge the Slot's forwarded ref with the child's own ref so both are satisfied.
|
|
34
|
+
ref: e != null ? a(e, t.ref) : t.ref
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
y.displayName = "VhyxSlot";
|
|
39
|
+
export {
|
|
40
|
+
y as S,
|
|
41
|
+
a,
|
|
42
|
+
u as m
|
|
43
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./pagination-DMKZiFFW.cjs");exports.alertContract=t.alertContract;exports.badgeContract=t.badgeContract;exports.breadcrumbContract=t.breadcrumbContract;exports.buttonContract=t.buttonContract;exports.cardContract=t.cardContract;exports.checkboxContract=t.checkboxContract;exports.dialogContract=t.dialogContract;exports.drawerContract=t.drawerContract;exports.formContract=t.formContract;exports.inputContract=t.inputContract;exports.paginationContract=t.paginationContract;exports.popoverContract=t.popoverContract;exports.progressContract=t.progressContract;exports.radioContract=t.radioContract;exports.selectContract=t.selectContract;exports.separatorContract=t.separatorContract;exports.spinnerContract=t.spinnerContract;exports.switchContract=t.switchContract;exports.tabsContract=t.tabsContract;exports.textareaContract=t.textareaContract;exports.toastContract=t.toastContract;exports.tooltipContract=t.tooltipContract;
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
import { ComponentContract } from '@vhyxseal/core';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Default VhyxSeal contract template for the Alert component.
|
|
5
|
+
*
|
|
6
|
+
* Expresses that an Alert is a persistent in-page notification — display only.
|
|
7
|
+
* Unlike Toast, Alert persists until explicitly dismissed by the user or application.
|
|
8
|
+
* Instance id is injected at render time: { ...alertContract, id: instanceId }
|
|
9
|
+
*/
|
|
10
|
+
export declare const alertContract: Readonly<Omit<ComponentContract, "id"> & {
|
|
11
|
+
readonly fingerprint: string;
|
|
12
|
+
}>;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Default VhyxSeal contract template for the Badge component.
|
|
16
|
+
*
|
|
17
|
+
* Expresses that a Badge is a small status indicator — display only.
|
|
18
|
+
* Agents read badge content to understand counts, states, or labels.
|
|
19
|
+
* Instance id is injected at render time: { ...badgeContract, id: instanceId }
|
|
20
|
+
*/
|
|
21
|
+
export declare const badgeContract: Readonly<Omit<ComponentContract, "id"> & {
|
|
22
|
+
readonly fingerprint: string;
|
|
23
|
+
}>;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Default VhyxSeal contract template for the Breadcrumb component.
|
|
27
|
+
*
|
|
28
|
+
* Expresses that a Breadcrumb shows the current page location within a hierarchy
|
|
29
|
+
* and provides navigation links to ancestor pages.
|
|
30
|
+
* Instance id is injected at render time: { ...breadcrumbContract, id: instanceId }
|
|
31
|
+
*/
|
|
32
|
+
export declare const breadcrumbContract: Readonly<Omit<ComponentContract, "id"> & {
|
|
33
|
+
readonly fingerprint: string;
|
|
34
|
+
}>;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Default VhyxSeal contract template for the Button component.
|
|
38
|
+
*
|
|
39
|
+
* Expresses that a Button triggers a low-safety action. The destructive variant
|
|
40
|
+
* merges safetyLevel: 'high' and destructive: true at runtime in the React component
|
|
41
|
+
* (DECISION-014). This base contract covers all non-destructive variants.
|
|
42
|
+
* Instance id is injected at render time: { ...buttonContract, id: instanceId }
|
|
43
|
+
*/
|
|
44
|
+
export declare const buttonContract: Readonly<Omit<ComponentContract, "id"> & {
|
|
45
|
+
readonly fingerprint: string;
|
|
46
|
+
}>;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Default VhyxSeal contract template for the Card component.
|
|
50
|
+
*
|
|
51
|
+
* Expresses that a Card is a content container — display only by default.
|
|
52
|
+
* When interactive=true, the developer should override intent to 'trigger-action'
|
|
53
|
+
* or 'navigate' as appropriate for the card's clickable behaviour.
|
|
54
|
+
* Instance id is injected at render time: { ...cardContract, id: instanceId }
|
|
55
|
+
*/
|
|
56
|
+
export declare const cardContract: Readonly<Omit<ComponentContract, "id"> & {
|
|
57
|
+
readonly fingerprint: string;
|
|
58
|
+
}>;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Default VhyxSeal contract template for the Checkbox component.
|
|
62
|
+
*
|
|
63
|
+
* Expresses that a Checkbox toggles a boolean or indeterminate selection state.
|
|
64
|
+
* The toggle is reversible — the user can uncheck before form submission.
|
|
65
|
+
* Instance id is injected at render time: { ...checkboxContract, id: instanceId }
|
|
66
|
+
*/
|
|
67
|
+
export declare const checkboxContract: Readonly<Omit<ComponentContract, "id"> & {
|
|
68
|
+
readonly fingerprint: string;
|
|
69
|
+
}>;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Default VhyxSeal contract template for the Dialog component.
|
|
73
|
+
*
|
|
74
|
+
* Expresses that a Dialog opens a modal overlay requiring user interaction.
|
|
75
|
+
* type 'confirmation' signals to agents that the dialog interrupts flow and
|
|
76
|
+
* must be resolved (confirmed or dismissed) before proceeding.
|
|
77
|
+
* Safety of the dialog's contents is determined by its child contracts.
|
|
78
|
+
* Instance id is injected at render time: { ...dialogContract, id: instanceId }
|
|
79
|
+
*/
|
|
80
|
+
export declare const dialogContract: Readonly<Omit<ComponentContract, "id"> & {
|
|
81
|
+
readonly fingerprint: string;
|
|
82
|
+
}>;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Default VhyxSeal contract template for the Drawer component.
|
|
86
|
+
*
|
|
87
|
+
* Expresses that a Drawer slides in a panel from a screen edge. Navigation type
|
|
88
|
+
* because drawers typically expose navigation or contextual content, not confirmations.
|
|
89
|
+
* Instance id is injected at render time: { ...drawerContract, id: instanceId }
|
|
90
|
+
*/
|
|
91
|
+
export declare const drawerContract: Readonly<Omit<ComponentContract, "id"> & {
|
|
92
|
+
readonly fingerprint: string;
|
|
93
|
+
}>;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Default VhyxSeal contract template for the Form component.
|
|
97
|
+
*
|
|
98
|
+
* Expresses that a Form collects and submits user data. Submission is not
|
|
99
|
+
* reversible — the agent must be certain fields are correct before triggering.
|
|
100
|
+
* safetyLevel medium because form submission typically writes to external systems.
|
|
101
|
+
* Instance id is injected at render time: { ...formContract, id: instanceId }
|
|
102
|
+
*/
|
|
103
|
+
export declare const formContract: Readonly<Omit<ComponentContract, "id"> & {
|
|
104
|
+
readonly fingerprint: string;
|
|
105
|
+
}>;
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Default VhyxSeal contract template for the Input component.
|
|
109
|
+
*
|
|
110
|
+
* Expresses that an Input accepts user text. The field value is reversible —
|
|
111
|
+
* the user can clear or modify the input before the parent form is submitted.
|
|
112
|
+
* Instance id is injected at render time: { ...inputContract, id: instanceId }
|
|
113
|
+
*/
|
|
114
|
+
export declare const inputContract: Readonly<Omit<ComponentContract, "id"> & {
|
|
115
|
+
readonly fingerprint: string;
|
|
116
|
+
}>;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Default VhyxSeal contract template for the Pagination component.
|
|
120
|
+
*
|
|
121
|
+
* Expresses that Pagination navigates between pages of a data set.
|
|
122
|
+
* Page changes update the visible content slice — no data is mutated.
|
|
123
|
+
* Instance id is injected at render time: { ...paginationContract, id: instanceId }
|
|
124
|
+
*/
|
|
125
|
+
export declare const paginationContract: Readonly<Omit<ComponentContract, "id"> & {
|
|
126
|
+
readonly fingerprint: string;
|
|
127
|
+
}>;
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Default VhyxSeal contract template for the Popover component.
|
|
131
|
+
*
|
|
132
|
+
* Expresses that a Popover opens a non-modal floating panel anchored to a trigger.
|
|
133
|
+
* Unlike Dialog, a Popover does not block the rest of the page.
|
|
134
|
+
* Instance id is injected at render time: { ...popoverContract, id: instanceId }
|
|
135
|
+
*/
|
|
136
|
+
export declare const popoverContract: Readonly<Omit<ComponentContract, "id"> & {
|
|
137
|
+
readonly fingerprint: string;
|
|
138
|
+
}>;
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Default VhyxSeal contract template for the Progress component.
|
|
142
|
+
*
|
|
143
|
+
* Expresses that a Progress bar is a visual indicator of completion — display only.
|
|
144
|
+
* Agents read value and max to determine how far along an operation is.
|
|
145
|
+
* Instance id is injected at render time: { ...progressContract, id: instanceId }
|
|
146
|
+
*/
|
|
147
|
+
export declare const progressContract: Readonly<Omit<ComponentContract, "id"> & {
|
|
148
|
+
readonly fingerprint: string;
|
|
149
|
+
}>;
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Default VhyxSeal contract template for the RadioGroup component.
|
|
153
|
+
*
|
|
154
|
+
* Expresses that a RadioGroup captures a mutually exclusive selection.
|
|
155
|
+
* The selection is reversible — a different option can be chosen before form submission.
|
|
156
|
+
* Instance id is injected at render time: { ...radioContract, id: instanceId }
|
|
157
|
+
*/
|
|
158
|
+
export declare const radioContract: Readonly<Omit<ComponentContract, "id"> & {
|
|
159
|
+
readonly fingerprint: string;
|
|
160
|
+
}>;
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Default VhyxSeal contract template for the Select component.
|
|
164
|
+
*
|
|
165
|
+
* Expresses that a Select allows the user to choose one option from a list.
|
|
166
|
+
* The selection is reversible — another option can be chosen before form submission.
|
|
167
|
+
* Instance id is injected at render time: { ...selectContract, id: instanceId }
|
|
168
|
+
*/
|
|
169
|
+
export declare const selectContract: Readonly<Omit<ComponentContract, "id"> & {
|
|
170
|
+
readonly fingerprint: string;
|
|
171
|
+
}>;
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Default VhyxSeal contract template for the Separator component.
|
|
175
|
+
*
|
|
176
|
+
* Expresses that a Separator is a visual or semantic divider — display only.
|
|
177
|
+
* When decorative=true, it carries no semantic meaning. When decorative=false,
|
|
178
|
+
* agents can use it to understand structural grouping of adjacent content.
|
|
179
|
+
* Instance id is injected at render time: { ...separatorContract, id: instanceId }
|
|
180
|
+
*/
|
|
181
|
+
export declare const separatorContract: Readonly<Omit<ComponentContract, "id"> & {
|
|
182
|
+
readonly fingerprint: string;
|
|
183
|
+
}>;
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Default VhyxSeal contract template for the Spinner component.
|
|
187
|
+
*
|
|
188
|
+
* Expresses that a Spinner signals an in-progress loading state — display only.
|
|
189
|
+
* Agents check for a Spinner's presence to detect when the application is busy.
|
|
190
|
+
* Instance id is injected at render time: { ...spinnerContract, id: instanceId }
|
|
191
|
+
*/
|
|
192
|
+
export declare const spinnerContract: Readonly<Omit<ComponentContract, "id"> & {
|
|
193
|
+
readonly fingerprint: string;
|
|
194
|
+
}>;
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Default VhyxSeal contract template for the Switch component.
|
|
198
|
+
*
|
|
199
|
+
* Expresses that a Switch toggles a binary on/off state. The toggle is
|
|
200
|
+
* reversible — the user can switch back at any time.
|
|
201
|
+
* Instance id is injected at render time: { ...switchContract, id: instanceId }
|
|
202
|
+
*/
|
|
203
|
+
export declare const switchContract: Readonly<Omit<ComponentContract, "id"> & {
|
|
204
|
+
readonly fingerprint: string;
|
|
205
|
+
}>;
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Default VhyxSeal contract template for the Tabs component.
|
|
209
|
+
*
|
|
210
|
+
* Expresses that a Tabs component navigates between content panels.
|
|
211
|
+
* Activating a tab changes the visible panel — no data is submitted or deleted.
|
|
212
|
+
* Instance id is injected at render time: { ...tabsContract, id: instanceId }
|
|
213
|
+
*/
|
|
214
|
+
export declare const tabsContract: Readonly<Omit<ComponentContract, "id"> & {
|
|
215
|
+
readonly fingerprint: string;
|
|
216
|
+
}>;
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* Default VhyxSeal contract template for the Textarea component.
|
|
220
|
+
*
|
|
221
|
+
* Expresses that a Textarea accepts multi-line text input. Reversible because
|
|
222
|
+
* the user can edit or clear the content before form submission.
|
|
223
|
+
* Instance id is injected at render time: { ...textareaContract, id: instanceId }
|
|
224
|
+
*/
|
|
225
|
+
export declare const textareaContract: Readonly<Omit<ComponentContract, "id"> & {
|
|
226
|
+
readonly fingerprint: string;
|
|
227
|
+
}>;
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Default VhyxSeal contract template for the Toast component.
|
|
231
|
+
*
|
|
232
|
+
* Expresses that a Toast is a transient notification — display only,
|
|
233
|
+
* no data mutation. Agents read toast content to confirm prior actions succeeded.
|
|
234
|
+
* Instance id is injected at render time: { ...toastContract, id: instanceId }
|
|
235
|
+
*/
|
|
236
|
+
export declare const toastContract: Readonly<Omit<ComponentContract, "id"> & {
|
|
237
|
+
readonly fingerprint: string;
|
|
238
|
+
}>;
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Default VhyxSeal contract template for the Tooltip component.
|
|
242
|
+
*
|
|
243
|
+
* Expresses that a Tooltip displays supplementary information on hover or focus.
|
|
244
|
+
* Display only — no user action, no data mutation.
|
|
245
|
+
* Instance id is injected at render time: { ...tooltipContract, id: instanceId }
|
|
246
|
+
*/
|
|
247
|
+
export declare const tooltipContract: Readonly<Omit<ComponentContract, "id"> & {
|
|
248
|
+
readonly fingerprint: string;
|
|
249
|
+
}>;
|
|
250
|
+
|
|
251
|
+
export { }
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { a as r, b as o, c as s, d as c, e as n, f as C, g as e, h as p, i, j as b, p as d, k as g, l, r as m, s as u, m as f, n as h, o as x, t as k, q as v, u as w, v as j } from "./pagination-BC8m1q01.js";
|
|
2
|
+
export {
|
|
3
|
+
r as alertContract,
|
|
4
|
+
o as badgeContract,
|
|
5
|
+
s as breadcrumbContract,
|
|
6
|
+
c as buttonContract,
|
|
7
|
+
n as cardContract,
|
|
8
|
+
C as checkboxContract,
|
|
9
|
+
e as dialogContract,
|
|
10
|
+
p as drawerContract,
|
|
11
|
+
i as formContract,
|
|
12
|
+
b as inputContract,
|
|
13
|
+
d as paginationContract,
|
|
14
|
+
g as popoverContract,
|
|
15
|
+
l as progressContract,
|
|
16
|
+
m as radioContract,
|
|
17
|
+
u as selectContract,
|
|
18
|
+
f as separatorContract,
|
|
19
|
+
h as spinnerContract,
|
|
20
|
+
x as switchContract,
|
|
21
|
+
k as tabsContract,
|
|
22
|
+
v as textareaContract,
|
|
23
|
+
w as toastContract,
|
|
24
|
+
j as tooltipContract
|
|
25
|
+
};
|
package/dist/errors.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e=(I=>(I.VHYXUI_MISSING_CONTEXT="VHYXUI_MISSING_CONTEXT",I.VHYXUI_MISSING_TITLE="VHYXUI_MISSING_TITLE",I.VHYXUI_INVALID_PROP="VHYXUI_INVALID_PROP",I.VHYXUI_PROVIDER_MISSING="VHYXUI_PROVIDER_MISSING",I.VHYXUI_TOAST_LIMIT_EXCEEDED="VHYXUI_TOAST_LIMIT_EXCEEDED",I))(e||{});class t extends Error{constructor(_){super(_.message),this.name="VhyxUIError",this.code=_.code,this.suggestion=_.suggestion,this.context=_.context}}exports.VhyxUIError=t;exports.VhyxUIErrorCode=e;
|
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base error class for all errors thrown by VhyxUI.
|
|
3
|
+
*
|
|
4
|
+
* In development: thrown with a helpful message and suggestion.
|
|
5
|
+
* In production: caught by component boundaries, logged to console.error.
|
|
6
|
+
* The visual layer never breaks because of VhyxUI internal errors.
|
|
7
|
+
*/
|
|
8
|
+
export declare class VhyxUIError extends Error {
|
|
9
|
+
/** Machine readable error code — use this for programmatic error handling. */
|
|
10
|
+
readonly code: VhyxUIErrorCode;
|
|
11
|
+
/** Concrete action the developer should take to fix this error. */
|
|
12
|
+
readonly suggestion: string | undefined;
|
|
13
|
+
/** Structured context relevant to this specific error instance. */
|
|
14
|
+
readonly context: Record<string, unknown> | undefined;
|
|
15
|
+
constructor(options: VhyxUIErrorOptions);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* All error codes thrown by VhyxUI.
|
|
20
|
+
*
|
|
21
|
+
* SCREAMING_SNAKE_CASE. Every code prefixed with VHYXUI_.
|
|
22
|
+
* Never remove or rename codes — components and tooling may depend on them.
|
|
23
|
+
*/
|
|
24
|
+
export declare enum VhyxUIErrorCode {
|
|
25
|
+
VHYXUI_MISSING_CONTEXT = "VHYXUI_MISSING_CONTEXT",
|
|
26
|
+
VHYXUI_MISSING_TITLE = "VHYXUI_MISSING_TITLE",
|
|
27
|
+
VHYXUI_INVALID_PROP = "VHYXUI_INVALID_PROP",
|
|
28
|
+
VHYXUI_PROVIDER_MISSING = "VHYXUI_PROVIDER_MISSING",
|
|
29
|
+
VHYXUI_TOAST_LIMIT_EXCEEDED = "VHYXUI_TOAST_LIMIT_EXCEEDED"
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** Configuration object passed to the VhyxUIError constructor. */
|
|
33
|
+
export declare interface VhyxUIErrorOptions {
|
|
34
|
+
/** Machine readable error code from VhyxUIErrorCode. */
|
|
35
|
+
code: VhyxUIErrorCode;
|
|
36
|
+
/** Human readable description of what went wrong. */
|
|
37
|
+
message: string;
|
|
38
|
+
/** Concrete action the developer should take to fix this error. */
|
|
39
|
+
suggestion?: string;
|
|
40
|
+
/** Structured context relevant to this specific error instance. */
|
|
41
|
+
context?: Record<string, unknown>;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export { }
|
package/dist/errors.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
var S = /* @__PURE__ */ ((I) => (I.VHYXUI_MISSING_CONTEXT = "VHYXUI_MISSING_CONTEXT", I.VHYXUI_MISSING_TITLE = "VHYXUI_MISSING_TITLE", I.VHYXUI_INVALID_PROP = "VHYXUI_INVALID_PROP", I.VHYXUI_PROVIDER_MISSING = "VHYXUI_PROVIDER_MISSING", I.VHYXUI_TOAST_LIMIT_EXCEEDED = "VHYXUI_TOAST_LIMIT_EXCEEDED", I))(S || {});
|
|
2
|
+
class T extends Error {
|
|
3
|
+
constructor(_) {
|
|
4
|
+
super(_.message), this.name = "VhyxUIError", this.code = _.code, this.suggestion = _.suggestion, this.context = _.context;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
export {
|
|
8
|
+
T as VhyxUIError,
|
|
9
|
+
S as VhyxUIErrorCode
|
|
10
|
+
};
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./errors.cjs"),r=require("./Slot-CLNJSabn.cjs"),t=require("./pagination-DMKZiFFW.cjs");exports.VhyxUIError=o.VhyxUIError;exports.VhyxUIErrorCode=o.VhyxUIErrorCode;exports.Slot=r.Slot;exports.mergeProps=r.mergeProps;exports.mergeRefs=r.mergeRefs;exports.alertContract=t.alertContract;exports.badgeContract=t.badgeContract;exports.breadcrumbContract=t.breadcrumbContract;exports.buttonContract=t.buttonContract;exports.cardContract=t.cardContract;exports.checkboxContract=t.checkboxContract;exports.dialogContract=t.dialogContract;exports.drawerContract=t.drawerContract;exports.formContract=t.formContract;exports.inputContract=t.inputContract;exports.paginationContract=t.paginationContract;exports.popoverContract=t.popoverContract;exports.progressContract=t.progressContract;exports.radioContract=t.radioContract;exports.selectContract=t.selectContract;exports.separatorContract=t.separatorContract;exports.spinnerContract=t.spinnerContract;exports.switchContract=t.switchContract;exports.tabsContract=t.tabsContract;exports.textareaContract=t.textareaContract;exports.toastContract=t.toastContract;exports.tooltipContract=t.tooltipContract;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,367 @@
|
|
|
1
|
+
import { ComponentContract } from '@vhyxseal/core';
|
|
2
|
+
import { ComponentType as ContractComponentType } from '@vhyxseal/core';
|
|
3
|
+
import { default as default_2 } from 'react';
|
|
4
|
+
import { SafetyLevel } from '@vhyxseal/core';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Default VhyxSeal contract template for the Alert component.
|
|
8
|
+
*
|
|
9
|
+
* Expresses that an Alert is a persistent in-page notification — display only.
|
|
10
|
+
* Unlike Toast, Alert persists until explicitly dismissed by the user or application.
|
|
11
|
+
* Instance id is injected at render time: { ...alertContract, id: instanceId }
|
|
12
|
+
*/
|
|
13
|
+
export declare const alertContract: Readonly<Omit<ComponentContract, "id"> & {
|
|
14
|
+
readonly fingerprint: string;
|
|
15
|
+
}>;
|
|
16
|
+
|
|
17
|
+
/** Alignment along the cross-axis of a positioned element. */
|
|
18
|
+
export declare type Align = 'start' | 'center' | 'end';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Default VhyxSeal contract template for the Badge component.
|
|
22
|
+
*
|
|
23
|
+
* Expresses that a Badge is a small status indicator — display only.
|
|
24
|
+
* Agents read badge content to understand counts, states, or labels.
|
|
25
|
+
* Instance id is injected at render time: { ...badgeContract, id: instanceId }
|
|
26
|
+
*/
|
|
27
|
+
export declare const badgeContract: Readonly<Omit<ComponentContract, "id"> & {
|
|
28
|
+
readonly fingerprint: string;
|
|
29
|
+
}>;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Default VhyxSeal contract template for the Breadcrumb component.
|
|
33
|
+
*
|
|
34
|
+
* Expresses that a Breadcrumb shows the current page location within a hierarchy
|
|
35
|
+
* and provides navigation links to ancestor pages.
|
|
36
|
+
* Instance id is injected at render time: { ...breadcrumbContract, id: instanceId }
|
|
37
|
+
*/
|
|
38
|
+
export declare const breadcrumbContract: Readonly<Omit<ComponentContract, "id"> & {
|
|
39
|
+
readonly fingerprint: string;
|
|
40
|
+
}>;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Default VhyxSeal contract template for the Button component.
|
|
44
|
+
*
|
|
45
|
+
* Expresses that a Button triggers a low-safety action. The destructive variant
|
|
46
|
+
* merges safetyLevel: 'high' and destructive: true at runtime in the React component
|
|
47
|
+
* (DECISION-014). This base contract covers all non-destructive variants.
|
|
48
|
+
* Instance id is injected at render time: { ...buttonContract, id: instanceId }
|
|
49
|
+
*/
|
|
50
|
+
export declare const buttonContract: Readonly<Omit<ComponentContract, "id"> & {
|
|
51
|
+
readonly fingerprint: string;
|
|
52
|
+
}>;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Default VhyxSeal contract template for the Card component.
|
|
56
|
+
*
|
|
57
|
+
* Expresses that a Card is a content container — display only by default.
|
|
58
|
+
* When interactive=true, the developer should override intent to 'trigger-action'
|
|
59
|
+
* or 'navigate' as appropriate for the card's clickable behaviour.
|
|
60
|
+
* Instance id is injected at render time: { ...cardContract, id: instanceId }
|
|
61
|
+
*/
|
|
62
|
+
export declare const cardContract: Readonly<Omit<ComponentContract, "id"> & {
|
|
63
|
+
readonly fingerprint: string;
|
|
64
|
+
}>;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Default VhyxSeal contract template for the Checkbox component.
|
|
68
|
+
*
|
|
69
|
+
* Expresses that a Checkbox toggles a boolean or indeterminate selection state.
|
|
70
|
+
* The toggle is reversible — the user can uncheck before form submission.
|
|
71
|
+
* Instance id is injected at render time: { ...checkboxContract, id: instanceId }
|
|
72
|
+
*/
|
|
73
|
+
export declare const checkboxContract: Readonly<Omit<ComponentContract, "id"> & {
|
|
74
|
+
readonly fingerprint: string;
|
|
75
|
+
}>;
|
|
76
|
+
|
|
77
|
+
/** Semantic color variant — maps to the token color scale. */
|
|
78
|
+
export declare type ColorVariant = 'default' | 'success' | 'warning' | 'danger' | 'info';
|
|
79
|
+
|
|
80
|
+
export { ComponentContract }
|
|
81
|
+
|
|
82
|
+
export { ContractComponentType }
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Default VhyxSeal contract template for the Dialog component.
|
|
86
|
+
*
|
|
87
|
+
* Expresses that a Dialog opens a modal overlay requiring user interaction.
|
|
88
|
+
* type 'confirmation' signals to agents that the dialog interrupts flow and
|
|
89
|
+
* must be resolved (confirmed or dismissed) before proceeding.
|
|
90
|
+
* Safety of the dialog's contents is determined by its child contracts.
|
|
91
|
+
* Instance id is injected at render time: { ...dialogContract, id: instanceId }
|
|
92
|
+
*/
|
|
93
|
+
export declare const dialogContract: Readonly<Omit<ComponentContract, "id"> & {
|
|
94
|
+
readonly fingerprint: string;
|
|
95
|
+
}>;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Default VhyxSeal contract template for the Drawer component.
|
|
99
|
+
*
|
|
100
|
+
* Expresses that a Drawer slides in a panel from a screen edge. Navigation type
|
|
101
|
+
* because drawers typically expose navigation or contextual content, not confirmations.
|
|
102
|
+
* Instance id is injected at render time: { ...drawerContract, id: instanceId }
|
|
103
|
+
*/
|
|
104
|
+
export declare const drawerContract: Readonly<Omit<ComponentContract, "id"> & {
|
|
105
|
+
readonly fingerprint: string;
|
|
106
|
+
}>;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Default VhyxSeal contract template for the Form component.
|
|
110
|
+
*
|
|
111
|
+
* Expresses that a Form collects and submits user data. Submission is not
|
|
112
|
+
* reversible — the agent must be certain fields are correct before triggering.
|
|
113
|
+
* safetyLevel medium because form submission typically writes to external systems.
|
|
114
|
+
* Instance id is injected at render time: { ...formContract, id: instanceId }
|
|
115
|
+
*/
|
|
116
|
+
export declare const formContract: Readonly<Omit<ComponentContract, "id"> & {
|
|
117
|
+
readonly fingerprint: string;
|
|
118
|
+
}>;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Default VhyxSeal contract template for the Input component.
|
|
122
|
+
*
|
|
123
|
+
* Expresses that an Input accepts user text. The field value is reversible —
|
|
124
|
+
* the user can clear or modify the input before the parent form is submitted.
|
|
125
|
+
* Instance id is injected at render time: { ...inputContract, id: instanceId }
|
|
126
|
+
*/
|
|
127
|
+
export declare const inputContract: Readonly<Omit<ComponentContract, "id"> & {
|
|
128
|
+
readonly fingerprint: string;
|
|
129
|
+
}>;
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Merges slot props onto child props.
|
|
133
|
+
*
|
|
134
|
+
* Rules:
|
|
135
|
+
* - Event handlers: compose — both slot and child handlers are called (slot first).
|
|
136
|
+
* - className: concatenate with a space separator.
|
|
137
|
+
* - style: merge objects — child values override slot values.
|
|
138
|
+
* - All other props: child value overrides slot value.
|
|
139
|
+
*
|
|
140
|
+
* @param slotProps - Props from the Slot component (defaults / additions).
|
|
141
|
+
* @param childProps - Props from the child element being slotted into.
|
|
142
|
+
* @returns Merged props object ready to spread onto the cloned child element.
|
|
143
|
+
*/
|
|
144
|
+
export declare function mergeProps(slotProps: Record<string, unknown>, childProps: Record<string, unknown>): Record<string, unknown>;
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Merges multiple React refs into a single callback ref.
|
|
148
|
+
*
|
|
149
|
+
* Handles RefObject (created by createRef/useRef) and callback refs.
|
|
150
|
+
* Null and undefined entries are skipped safely.
|
|
151
|
+
*
|
|
152
|
+
* @param refs - Any number of React refs to merge. Null and undefined are accepted.
|
|
153
|
+
* @returns A single callback ref that sets all provided refs when called.
|
|
154
|
+
*/
|
|
155
|
+
export declare function mergeRefs<T>(...refs: ReadonlyArray<default_2.Ref<T> | null | undefined>): default_2.RefCallback<T>;
|
|
156
|
+
|
|
157
|
+
/** Layout or scroll orientation. */
|
|
158
|
+
export declare type Orientation = 'horizontal' | 'vertical';
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Default VhyxSeal contract template for the Pagination component.
|
|
162
|
+
*
|
|
163
|
+
* Expresses that Pagination navigates between pages of a data set.
|
|
164
|
+
* Page changes update the visible content slice — no data is mutated.
|
|
165
|
+
* Instance id is injected at render time: { ...paginationContract, id: instanceId }
|
|
166
|
+
*/
|
|
167
|
+
export declare const paginationContract: Readonly<Omit<ComponentContract, "id"> & {
|
|
168
|
+
readonly fingerprint: string;
|
|
169
|
+
}>;
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Default VhyxSeal contract template for the Popover component.
|
|
173
|
+
*
|
|
174
|
+
* Expresses that a Popover opens a non-modal floating panel anchored to a trigger.
|
|
175
|
+
* Unlike Dialog, a Popover does not block the rest of the page.
|
|
176
|
+
* Instance id is injected at render time: { ...popoverContract, id: instanceId }
|
|
177
|
+
*/
|
|
178
|
+
export declare const popoverContract: Readonly<Omit<ComponentContract, "id"> & {
|
|
179
|
+
readonly fingerprint: string;
|
|
180
|
+
}>;
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Default VhyxSeal contract template for the Progress component.
|
|
184
|
+
*
|
|
185
|
+
* Expresses that a Progress bar is a visual indicator of completion — display only.
|
|
186
|
+
* Agents read value and max to determine how far along an operation is.
|
|
187
|
+
* Instance id is injected at render time: { ...progressContract, id: instanceId }
|
|
188
|
+
*/
|
|
189
|
+
export declare const progressContract: Readonly<Omit<ComponentContract, "id"> & {
|
|
190
|
+
readonly fingerprint: string;
|
|
191
|
+
}>;
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Default VhyxSeal contract template for the RadioGroup component.
|
|
195
|
+
*
|
|
196
|
+
* Expresses that a RadioGroup captures a mutually exclusive selection.
|
|
197
|
+
* The selection is reversible — a different option can be chosen before form submission.
|
|
198
|
+
* Instance id is injected at render time: { ...radioContract, id: instanceId }
|
|
199
|
+
*/
|
|
200
|
+
export declare const radioContract: Readonly<Omit<ComponentContract, "id"> & {
|
|
201
|
+
readonly fingerprint: string;
|
|
202
|
+
}>;
|
|
203
|
+
|
|
204
|
+
export { SafetyLevel }
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Default VhyxSeal contract template for the Select component.
|
|
208
|
+
*
|
|
209
|
+
* Expresses that a Select allows the user to choose one option from a list.
|
|
210
|
+
* The selection is reversible — another option can be chosen before form submission.
|
|
211
|
+
* Instance id is injected at render time: { ...selectContract, id: instanceId }
|
|
212
|
+
*/
|
|
213
|
+
export declare const selectContract: Readonly<Omit<ComponentContract, "id"> & {
|
|
214
|
+
readonly fingerprint: string;
|
|
215
|
+
}>;
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Default VhyxSeal contract template for the Separator component.
|
|
219
|
+
*
|
|
220
|
+
* Expresses that a Separator is a visual or semantic divider — display only.
|
|
221
|
+
* When decorative=true, it carries no semantic meaning. When decorative=false,
|
|
222
|
+
* agents can use it to understand structural grouping of adjacent content.
|
|
223
|
+
* Instance id is injected at render time: { ...separatorContract, id: instanceId }
|
|
224
|
+
*/
|
|
225
|
+
export declare const separatorContract: Readonly<Omit<ComponentContract, "id"> & {
|
|
226
|
+
readonly fingerprint: string;
|
|
227
|
+
}>;
|
|
228
|
+
|
|
229
|
+
/** Positional side relative to a trigger or anchor element. */
|
|
230
|
+
export declare type Side = 'top' | 'right' | 'bottom' | 'left';
|
|
231
|
+
|
|
232
|
+
/** Component size — xs through xl. Used across all sized components. */
|
|
233
|
+
export declare type Size = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* Slot — the asChild pattern implementation.
|
|
237
|
+
*
|
|
238
|
+
* Merges its own props onto its immediate child element, allowing a parent
|
|
239
|
+
* component to pass behaviour (event handlers, className, style, ARIA attributes)
|
|
240
|
+
* through to a developer-supplied element without wrapping it in an extra DOM node.
|
|
241
|
+
*
|
|
242
|
+
* Merge rules (handled by mergeProps):
|
|
243
|
+
* - Event handlers: both slot and child handlers are called (slot fires first).
|
|
244
|
+
* - className: concatenated with a space.
|
|
245
|
+
* - style: merged as objects (child values override slot values).
|
|
246
|
+
* - All other props: child value overrides slot default.
|
|
247
|
+
*
|
|
248
|
+
* Zero Radix dependency — per DECISION-012.
|
|
249
|
+
*/
|
|
250
|
+
export declare const Slot: default_2.ForwardRefExoticComponent<SlotProps & default_2.RefAttributes<HTMLElement>>;
|
|
251
|
+
|
|
252
|
+
/** Props accepted by the Slot component. Extends all standard HTML element attributes. */
|
|
253
|
+
export declare interface SlotProps extends default_2.HTMLAttributes<HTMLElement> {
|
|
254
|
+
/** The single child element whose props will be merged with the Slot's own props. */
|
|
255
|
+
children?: default_2.ReactNode;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* Default VhyxSeal contract template for the Spinner component.
|
|
260
|
+
*
|
|
261
|
+
* Expresses that a Spinner signals an in-progress loading state — display only.
|
|
262
|
+
* Agents check for a Spinner's presence to detect when the application is busy.
|
|
263
|
+
* Instance id is injected at render time: { ...spinnerContract, id: instanceId }
|
|
264
|
+
*/
|
|
265
|
+
export declare const spinnerContract: Readonly<Omit<ComponentContract, "id"> & {
|
|
266
|
+
readonly fingerprint: string;
|
|
267
|
+
}>;
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* Default VhyxSeal contract template for the Switch component.
|
|
271
|
+
*
|
|
272
|
+
* Expresses that a Switch toggles a binary on/off state. The toggle is
|
|
273
|
+
* reversible — the user can switch back at any time.
|
|
274
|
+
* Instance id is injected at render time: { ...switchContract, id: instanceId }
|
|
275
|
+
*/
|
|
276
|
+
export declare const switchContract: Readonly<Omit<ComponentContract, "id"> & {
|
|
277
|
+
readonly fingerprint: string;
|
|
278
|
+
}>;
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* Default VhyxSeal contract template for the Tabs component.
|
|
282
|
+
*
|
|
283
|
+
* Expresses that a Tabs component navigates between content panels.
|
|
284
|
+
* Activating a tab changes the visible panel — no data is submitted or deleted.
|
|
285
|
+
* Instance id is injected at render time: { ...tabsContract, id: instanceId }
|
|
286
|
+
*/
|
|
287
|
+
export declare const tabsContract: Readonly<Omit<ComponentContract, "id"> & {
|
|
288
|
+
readonly fingerprint: string;
|
|
289
|
+
}>;
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* Default VhyxSeal contract template for the Textarea component.
|
|
293
|
+
*
|
|
294
|
+
* Expresses that a Textarea accepts multi-line text input. Reversible because
|
|
295
|
+
* the user can edit or clear the content before form submission.
|
|
296
|
+
* Instance id is injected at render time: { ...textareaContract, id: instanceId }
|
|
297
|
+
*/
|
|
298
|
+
export declare const textareaContract: Readonly<Omit<ComponentContract, "id"> & {
|
|
299
|
+
readonly fingerprint: string;
|
|
300
|
+
}>;
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* Default VhyxSeal contract template for the Toast component.
|
|
304
|
+
*
|
|
305
|
+
* Expresses that a Toast is a transient notification — display only,
|
|
306
|
+
* no data mutation. Agents read toast content to confirm prior actions succeeded.
|
|
307
|
+
* Instance id is injected at render time: { ...toastContract, id: instanceId }
|
|
308
|
+
*/
|
|
309
|
+
export declare const toastContract: Readonly<Omit<ComponentContract, "id"> & {
|
|
310
|
+
readonly fingerprint: string;
|
|
311
|
+
}>;
|
|
312
|
+
|
|
313
|
+
/**
|
|
314
|
+
* Default VhyxSeal contract template for the Tooltip component.
|
|
315
|
+
*
|
|
316
|
+
* Expresses that a Tooltip displays supplementary information on hover or focus.
|
|
317
|
+
* Display only — no user action, no data mutation.
|
|
318
|
+
* Instance id is injected at render time: { ...tooltipContract, id: instanceId }
|
|
319
|
+
*/
|
|
320
|
+
export declare const tooltipContract: Readonly<Omit<ComponentContract, "id"> & {
|
|
321
|
+
readonly fingerprint: string;
|
|
322
|
+
}>;
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* Base error class for all errors thrown by VhyxUI.
|
|
326
|
+
*
|
|
327
|
+
* In development: thrown with a helpful message and suggestion.
|
|
328
|
+
* In production: caught by component boundaries, logged to console.error.
|
|
329
|
+
* The visual layer never breaks because of VhyxUI internal errors.
|
|
330
|
+
*/
|
|
331
|
+
export declare class VhyxUIError extends Error {
|
|
332
|
+
/** Machine readable error code — use this for programmatic error handling. */
|
|
333
|
+
readonly code: VhyxUIErrorCode;
|
|
334
|
+
/** Concrete action the developer should take to fix this error. */
|
|
335
|
+
readonly suggestion: string | undefined;
|
|
336
|
+
/** Structured context relevant to this specific error instance. */
|
|
337
|
+
readonly context: Record<string, unknown> | undefined;
|
|
338
|
+
constructor(options: VhyxUIErrorOptions);
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* All error codes thrown by VhyxUI.
|
|
343
|
+
*
|
|
344
|
+
* SCREAMING_SNAKE_CASE. Every code prefixed with VHYXUI_.
|
|
345
|
+
* Never remove or rename codes — components and tooling may depend on them.
|
|
346
|
+
*/
|
|
347
|
+
export declare enum VhyxUIErrorCode {
|
|
348
|
+
VHYXUI_MISSING_CONTEXT = "VHYXUI_MISSING_CONTEXT",
|
|
349
|
+
VHYXUI_MISSING_TITLE = "VHYXUI_MISSING_TITLE",
|
|
350
|
+
VHYXUI_INVALID_PROP = "VHYXUI_INVALID_PROP",
|
|
351
|
+
VHYXUI_PROVIDER_MISSING = "VHYXUI_PROVIDER_MISSING",
|
|
352
|
+
VHYXUI_TOAST_LIMIT_EXCEEDED = "VHYXUI_TOAST_LIMIT_EXCEEDED"
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
/** Configuration object passed to the VhyxUIError constructor. */
|
|
356
|
+
export declare interface VhyxUIErrorOptions {
|
|
357
|
+
/** Machine readable error code from VhyxUIErrorCode. */
|
|
358
|
+
code: VhyxUIErrorCode;
|
|
359
|
+
/** Human readable description of what went wrong. */
|
|
360
|
+
message: string;
|
|
361
|
+
/** Concrete action the developer should take to fix this error. */
|
|
362
|
+
suggestion?: string;
|
|
363
|
+
/** Structured context relevant to this specific error instance. */
|
|
364
|
+
context?: Record<string, unknown>;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
export { }
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { VhyxUIError as r, VhyxUIErrorCode as o } from "./errors.js";
|
|
2
|
+
import { S as c, m as n, a as e } from "./Slot-PvMbF2q3.js";
|
|
3
|
+
import { a as p, b as i, c as m, d, e as b, f as g, g as x, h as f, i as l, j as h, p as u, k, l as v, r as w, s as y, m as E, n as I, o as S, t as U, q as V, u as j, v as q } from "./pagination-BC8m1q01.js";
|
|
4
|
+
export {
|
|
5
|
+
c as Slot,
|
|
6
|
+
r as VhyxUIError,
|
|
7
|
+
o as VhyxUIErrorCode,
|
|
8
|
+
p as alertContract,
|
|
9
|
+
i as badgeContract,
|
|
10
|
+
m as breadcrumbContract,
|
|
11
|
+
d as buttonContract,
|
|
12
|
+
b as cardContract,
|
|
13
|
+
g as checkboxContract,
|
|
14
|
+
x as dialogContract,
|
|
15
|
+
f as drawerContract,
|
|
16
|
+
l as formContract,
|
|
17
|
+
h as inputContract,
|
|
18
|
+
n as mergeProps,
|
|
19
|
+
e as mergeRefs,
|
|
20
|
+
u as paginationContract,
|
|
21
|
+
k as popoverContract,
|
|
22
|
+
v as progressContract,
|
|
23
|
+
w as radioContract,
|
|
24
|
+
y as selectContract,
|
|
25
|
+
E as separatorContract,
|
|
26
|
+
I as spinnerContract,
|
|
27
|
+
S as switchContract,
|
|
28
|
+
U as tabsContract,
|
|
29
|
+
V as textareaContract,
|
|
30
|
+
j as toastContract,
|
|
31
|
+
q as tooltipContract
|
|
32
|
+
};
|
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
import { defineContractTemplate as e } from "@vhyxseal/core";
|
|
2
|
+
const s = e({
|
|
3
|
+
type: "action",
|
|
4
|
+
intent: "trigger-action",
|
|
5
|
+
description: "Triggers an action or submits a form when activated by the user",
|
|
6
|
+
requires: [],
|
|
7
|
+
requiredPermissions: [],
|
|
8
|
+
consequence: "Triggers the associated action",
|
|
9
|
+
affects: [],
|
|
10
|
+
reversible: !1,
|
|
11
|
+
safetyLevel: "low",
|
|
12
|
+
requiresConfirmation: !1,
|
|
13
|
+
destructive: !1,
|
|
14
|
+
contractVersion: "0.0.1"
|
|
15
|
+
}), r = e({
|
|
16
|
+
type: "input",
|
|
17
|
+
intent: "enter-text",
|
|
18
|
+
description: "Accepts a text value entered by the user",
|
|
19
|
+
requires: [],
|
|
20
|
+
requiredPermissions: [],
|
|
21
|
+
consequence: "Updates the field value in the parent form context",
|
|
22
|
+
affects: ["form"],
|
|
23
|
+
reversible: !0,
|
|
24
|
+
safetyLevel: "low",
|
|
25
|
+
requiresConfirmation: !1,
|
|
26
|
+
destructive: !1,
|
|
27
|
+
contractVersion: "0.0.1"
|
|
28
|
+
}), i = e({
|
|
29
|
+
type: "input",
|
|
30
|
+
intent: "enter-text",
|
|
31
|
+
description: "Accepts multi-line text content entered by the user",
|
|
32
|
+
requires: [],
|
|
33
|
+
requiredPermissions: [],
|
|
34
|
+
consequence: "Updates the multi-line field value in the parent form context",
|
|
35
|
+
affects: ["form"],
|
|
36
|
+
reversible: !0,
|
|
37
|
+
safetyLevel: "low",
|
|
38
|
+
requiresConfirmation: !1,
|
|
39
|
+
destructive: !1,
|
|
40
|
+
contractVersion: "0.0.1"
|
|
41
|
+
}), n = e({
|
|
42
|
+
type: "input",
|
|
43
|
+
intent: "select-option",
|
|
44
|
+
description: "Allows the user to choose one option from a dropdown list",
|
|
45
|
+
requires: [],
|
|
46
|
+
requiredPermissions: [],
|
|
47
|
+
consequence: "Updates the selected option value in the parent form context",
|
|
48
|
+
affects: ["form"],
|
|
49
|
+
reversible: !0,
|
|
50
|
+
safetyLevel: "low",
|
|
51
|
+
requiresConfirmation: !1,
|
|
52
|
+
destructive: !1,
|
|
53
|
+
contractVersion: "0.0.1"
|
|
54
|
+
}), a = e({
|
|
55
|
+
type: "input",
|
|
56
|
+
intent: "toggle-selection",
|
|
57
|
+
description: "Toggles a boolean selection — checked, unchecked, or indeterminate",
|
|
58
|
+
requires: [],
|
|
59
|
+
requiredPermissions: [],
|
|
60
|
+
consequence: "Updates the checked state in the parent form context",
|
|
61
|
+
affects: ["form"],
|
|
62
|
+
reversible: !0,
|
|
63
|
+
safetyLevel: "low",
|
|
64
|
+
requiresConfirmation: !1,
|
|
65
|
+
destructive: !1,
|
|
66
|
+
contractVersion: "0.0.1"
|
|
67
|
+
}), o = e({
|
|
68
|
+
type: "input",
|
|
69
|
+
intent: "select-option",
|
|
70
|
+
description: "Captures a single mutually exclusive selection from a set of radio options",
|
|
71
|
+
requires: [],
|
|
72
|
+
requiredPermissions: [],
|
|
73
|
+
consequence: "Updates the selected radio value in the parent form context",
|
|
74
|
+
affects: ["form"],
|
|
75
|
+
reversible: !0,
|
|
76
|
+
safetyLevel: "low",
|
|
77
|
+
requiresConfirmation: !1,
|
|
78
|
+
destructive: !1,
|
|
79
|
+
contractVersion: "0.0.1"
|
|
80
|
+
}), c = e({
|
|
81
|
+
type: "input",
|
|
82
|
+
intent: "toggle-state",
|
|
83
|
+
description: "Toggles a binary on/off state immediately upon interaction",
|
|
84
|
+
requires: [],
|
|
85
|
+
requiredPermissions: [],
|
|
86
|
+
consequence: "Changes the boolean state of the controlled feature",
|
|
87
|
+
affects: [],
|
|
88
|
+
reversible: !0,
|
|
89
|
+
safetyLevel: "low",
|
|
90
|
+
requiresConfirmation: !1,
|
|
91
|
+
destructive: !1,
|
|
92
|
+
contractVersion: "0.0.1"
|
|
93
|
+
}), l = e({
|
|
94
|
+
type: "action",
|
|
95
|
+
intent: "submit-form",
|
|
96
|
+
description: "Collects field values and submits them to the server or handler",
|
|
97
|
+
requires: [],
|
|
98
|
+
requiredPermissions: [],
|
|
99
|
+
consequence: "Sends form data to the configured handler — may create or update records",
|
|
100
|
+
affects: ["form"],
|
|
101
|
+
reversible: !1,
|
|
102
|
+
safetyLevel: "medium",
|
|
103
|
+
requiresConfirmation: !1,
|
|
104
|
+
destructive: !1,
|
|
105
|
+
contractVersion: "0.0.1"
|
|
106
|
+
}), u = e({
|
|
107
|
+
type: "display",
|
|
108
|
+
intent: "notify",
|
|
109
|
+
description: "Displays a transient notification message to the user",
|
|
110
|
+
requires: [],
|
|
111
|
+
requiredPermissions: [],
|
|
112
|
+
consequence: "None — display only. Disappears after the configured duration.",
|
|
113
|
+
affects: [],
|
|
114
|
+
reversible: !1,
|
|
115
|
+
safetyLevel: "low",
|
|
116
|
+
requiresConfirmation: !1,
|
|
117
|
+
destructive: !1,
|
|
118
|
+
contractVersion: "0.0.1"
|
|
119
|
+
}), f = e({
|
|
120
|
+
type: "display",
|
|
121
|
+
intent: "display-alert",
|
|
122
|
+
description: "Displays a persistent contextual alert message to the user",
|
|
123
|
+
requires: [],
|
|
124
|
+
requiredPermissions: [],
|
|
125
|
+
consequence: "None — display only. Persists until dismissed.",
|
|
126
|
+
affects: [],
|
|
127
|
+
reversible: !1,
|
|
128
|
+
safetyLevel: "low",
|
|
129
|
+
requiresConfirmation: !1,
|
|
130
|
+
destructive: !1,
|
|
131
|
+
contractVersion: "0.0.1"
|
|
132
|
+
}), d = e({
|
|
133
|
+
type: "display",
|
|
134
|
+
intent: "display-status",
|
|
135
|
+
description: "Displays a small status label, count, or categorical indicator",
|
|
136
|
+
requires: [],
|
|
137
|
+
requiredPermissions: [],
|
|
138
|
+
consequence: "None — display only.",
|
|
139
|
+
affects: [],
|
|
140
|
+
reversible: !1,
|
|
141
|
+
safetyLevel: "low",
|
|
142
|
+
requiresConfirmation: !1,
|
|
143
|
+
destructive: !1,
|
|
144
|
+
contractVersion: "0.0.1"
|
|
145
|
+
}), p = e({
|
|
146
|
+
type: "display",
|
|
147
|
+
intent: "display-progress",
|
|
148
|
+
description: "Displays the completion percentage of an ongoing operation",
|
|
149
|
+
requires: [],
|
|
150
|
+
requiredPermissions: [],
|
|
151
|
+
consequence: "None — display only.",
|
|
152
|
+
affects: [],
|
|
153
|
+
reversible: !1,
|
|
154
|
+
safetyLevel: "low",
|
|
155
|
+
requiresConfirmation: !1,
|
|
156
|
+
destructive: !1,
|
|
157
|
+
contractVersion: "0.0.1"
|
|
158
|
+
}), v = e({
|
|
159
|
+
type: "display",
|
|
160
|
+
intent: "display-loading",
|
|
161
|
+
description: "Indicates that an asynchronous operation is in progress",
|
|
162
|
+
requires: [],
|
|
163
|
+
requiredPermissions: [],
|
|
164
|
+
consequence: "None — display only.",
|
|
165
|
+
affects: [],
|
|
166
|
+
reversible: !1,
|
|
167
|
+
safetyLevel: "low",
|
|
168
|
+
requiresConfirmation: !1,
|
|
169
|
+
destructive: !1,
|
|
170
|
+
contractVersion: "0.0.1"
|
|
171
|
+
}), y = e({
|
|
172
|
+
type: "confirmation",
|
|
173
|
+
intent: "open-dialog",
|
|
174
|
+
description: "Opens a modal dialog overlay that interrupts the current workflow",
|
|
175
|
+
requires: [],
|
|
176
|
+
requiredPermissions: [],
|
|
177
|
+
consequence: "Renders a blocking overlay — underlying page is inaccessible until dismissed",
|
|
178
|
+
affects: ["view"],
|
|
179
|
+
reversible: !0,
|
|
180
|
+
safetyLevel: "low",
|
|
181
|
+
requiresConfirmation: !1,
|
|
182
|
+
destructive: !1,
|
|
183
|
+
contractVersion: "0.0.1"
|
|
184
|
+
}), m = e({
|
|
185
|
+
type: "navigation",
|
|
186
|
+
intent: "open-drawer",
|
|
187
|
+
description: "Opens a slide-in panel from a screen edge for navigation or contextual content",
|
|
188
|
+
requires: [],
|
|
189
|
+
requiredPermissions: [],
|
|
190
|
+
consequence: "Renders a side panel overlay — underlying page remains accessible",
|
|
191
|
+
affects: ["view"],
|
|
192
|
+
reversible: !0,
|
|
193
|
+
safetyLevel: "low",
|
|
194
|
+
requiresConfirmation: !1,
|
|
195
|
+
destructive: !1,
|
|
196
|
+
contractVersion: "0.0.1"
|
|
197
|
+
}), q = e({
|
|
198
|
+
type: "display",
|
|
199
|
+
intent: "display-tooltip",
|
|
200
|
+
description: "Shows supplementary information about a trigger element on hover or focus",
|
|
201
|
+
requires: [],
|
|
202
|
+
requiredPermissions: [],
|
|
203
|
+
consequence: "None — display only. Hides on mouse leave, blur, or Escape.",
|
|
204
|
+
affects: [],
|
|
205
|
+
reversible: !1,
|
|
206
|
+
safetyLevel: "low",
|
|
207
|
+
requiresConfirmation: !1,
|
|
208
|
+
destructive: !1,
|
|
209
|
+
contractVersion: "0.0.1"
|
|
210
|
+
}), g = e({
|
|
211
|
+
type: "display",
|
|
212
|
+
intent: "open-popover",
|
|
213
|
+
description: "Opens a non-modal floating panel anchored to a trigger element",
|
|
214
|
+
requires: [],
|
|
215
|
+
requiredPermissions: [],
|
|
216
|
+
consequence: "Renders a floating panel — underlying page remains fully interactive",
|
|
217
|
+
affects: ["view"],
|
|
218
|
+
reversible: !0,
|
|
219
|
+
safetyLevel: "low",
|
|
220
|
+
requiresConfirmation: !1,
|
|
221
|
+
destructive: !1,
|
|
222
|
+
contractVersion: "0.0.1"
|
|
223
|
+
}), b = e({
|
|
224
|
+
type: "display",
|
|
225
|
+
intent: "display-content",
|
|
226
|
+
description: "Displays grouped content in a visually distinct container",
|
|
227
|
+
requires: [],
|
|
228
|
+
requiredPermissions: [],
|
|
229
|
+
consequence: "None — display only.",
|
|
230
|
+
affects: [],
|
|
231
|
+
reversible: !1,
|
|
232
|
+
safetyLevel: "low",
|
|
233
|
+
requiresConfirmation: !1,
|
|
234
|
+
destructive: !1,
|
|
235
|
+
contractVersion: "0.0.1"
|
|
236
|
+
}), h = e({
|
|
237
|
+
type: "display",
|
|
238
|
+
intent: "separate-content",
|
|
239
|
+
description: "Visually or semantically separates adjacent content sections",
|
|
240
|
+
requires: [],
|
|
241
|
+
requiredPermissions: [],
|
|
242
|
+
consequence: "None — display only.",
|
|
243
|
+
affects: [],
|
|
244
|
+
reversible: !1,
|
|
245
|
+
safetyLevel: "low",
|
|
246
|
+
requiresConfirmation: !1,
|
|
247
|
+
destructive: !1,
|
|
248
|
+
contractVersion: "0.0.1"
|
|
249
|
+
}), C = e({
|
|
250
|
+
type: "navigation",
|
|
251
|
+
intent: "navigate-tabs",
|
|
252
|
+
description: "Switches between content panels by activating a tab trigger",
|
|
253
|
+
requires: [],
|
|
254
|
+
requiredPermissions: [],
|
|
255
|
+
consequence: "Changes the active content panel — no data mutation",
|
|
256
|
+
affects: ["view"],
|
|
257
|
+
reversible: !0,
|
|
258
|
+
safetyLevel: "low",
|
|
259
|
+
requiresConfirmation: !1,
|
|
260
|
+
destructive: !1,
|
|
261
|
+
contractVersion: "0.0.1"
|
|
262
|
+
}), w = e({
|
|
263
|
+
type: "navigation",
|
|
264
|
+
intent: "navigate-breadcrumb",
|
|
265
|
+
description: "Displays the current page location in the site hierarchy with ancestor navigation links",
|
|
266
|
+
requires: [],
|
|
267
|
+
requiredPermissions: [],
|
|
268
|
+
consequence: "Navigates to an ancestor page when a breadcrumb link is activated",
|
|
269
|
+
affects: ["view"],
|
|
270
|
+
reversible: !0,
|
|
271
|
+
safetyLevel: "low",
|
|
272
|
+
requiresConfirmation: !1,
|
|
273
|
+
destructive: !1,
|
|
274
|
+
contractVersion: "0.0.1"
|
|
275
|
+
}), P = e({
|
|
276
|
+
type: "navigation",
|
|
277
|
+
intent: "navigate-page",
|
|
278
|
+
description: "Navigates between pages of a paginated data set",
|
|
279
|
+
requires: [],
|
|
280
|
+
requiredPermissions: [],
|
|
281
|
+
consequence: "Changes the visible page of the data set — no data mutation",
|
|
282
|
+
affects: ["view"],
|
|
283
|
+
reversible: !0,
|
|
284
|
+
safetyLevel: "low",
|
|
285
|
+
requiresConfirmation: !1,
|
|
286
|
+
destructive: !1,
|
|
287
|
+
contractVersion: "0.0.1"
|
|
288
|
+
});
|
|
289
|
+
export {
|
|
290
|
+
f as a,
|
|
291
|
+
d as b,
|
|
292
|
+
w as c,
|
|
293
|
+
s as d,
|
|
294
|
+
b as e,
|
|
295
|
+
a as f,
|
|
296
|
+
y as g,
|
|
297
|
+
m as h,
|
|
298
|
+
l as i,
|
|
299
|
+
r as j,
|
|
300
|
+
g as k,
|
|
301
|
+
p as l,
|
|
302
|
+
h as m,
|
|
303
|
+
v as n,
|
|
304
|
+
c as o,
|
|
305
|
+
P as p,
|
|
306
|
+
i as q,
|
|
307
|
+
o as r,
|
|
308
|
+
n as s,
|
|
309
|
+
C as t,
|
|
310
|
+
u,
|
|
311
|
+
q as v
|
|
312
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("@vhyxseal/core"),t=e.defineContractTemplate({type:"action",intent:"trigger-action",description:"Triggers an action or submits a form when activated by the user",requires:[],requiredPermissions:[],consequence:"Triggers the associated action",affects:[],reversible:!1,safetyLevel:"low",requiresConfirmation:!1,destructive:!1,contractVersion:"0.0.1"}),r=e.defineContractTemplate({type:"input",intent:"enter-text",description:"Accepts a text value entered by the user",requires:[],requiredPermissions:[],consequence:"Updates the field value in the parent form context",affects:["form"],reversible:!0,safetyLevel:"low",requiresConfirmation:!1,destructive:!1,contractVersion:"0.0.1"}),n=e.defineContractTemplate({type:"input",intent:"enter-text",description:"Accepts multi-line text content entered by the user",requires:[],requiredPermissions:[],consequence:"Updates the multi-line field value in the parent form context",affects:["form"],reversible:!0,safetyLevel:"low",requiresConfirmation:!1,destructive:!1,contractVersion:"0.0.1"}),s=e.defineContractTemplate({type:"input",intent:"select-option",description:"Allows the user to choose one option from a dropdown list",requires:[],requiredPermissions:[],consequence:"Updates the selected option value in the parent form context",affects:["form"],reversible:!0,safetyLevel:"low",requiresConfirmation:!1,destructive:!1,contractVersion:"0.0.1"}),i=e.defineContractTemplate({type:"input",intent:"toggle-selection",description:"Toggles a boolean selection — checked, unchecked, or indeterminate",requires:[],requiredPermissions:[],consequence:"Updates the checked state in the parent form context",affects:["form"],reversible:!0,safetyLevel:"low",requiresConfirmation:!1,destructive:!1,contractVersion:"0.0.1"}),a=e.defineContractTemplate({type:"input",intent:"select-option",description:"Captures a single mutually exclusive selection from a set of radio options",requires:[],requiredPermissions:[],consequence:"Updates the selected radio value in the parent form context",affects:["form"],reversible:!0,safetyLevel:"low",requiresConfirmation:!1,destructive:!1,contractVersion:"0.0.1"}),o=e.defineContractTemplate({type:"input",intent:"toggle-state",description:"Toggles a binary on/off state immediately upon interaction",requires:[],requiredPermissions:[],consequence:"Changes the boolean state of the controlled feature",affects:[],reversible:!0,safetyLevel:"low",requiresConfirmation:!1,destructive:!1,contractVersion:"0.0.1"}),c=e.defineContractTemplate({type:"action",intent:"submit-form",description:"Collects field values and submits them to the server or handler",requires:[],requiredPermissions:[],consequence:"Sends form data to the configured handler — may create or update records",affects:["form"],reversible:!1,safetyLevel:"medium",requiresConfirmation:!1,destructive:!1,contractVersion:"0.0.1"}),l=e.defineContractTemplate({type:"display",intent:"notify",description:"Displays a transient notification message to the user",requires:[],requiredPermissions:[],consequence:"None — display only. Disappears after the configured duration.",affects:[],reversible:!1,safetyLevel:"low",requiresConfirmation:!1,destructive:!1,contractVersion:"0.0.1"}),f=e.defineContractTemplate({type:"display",intent:"display-alert",description:"Displays a persistent contextual alert message to the user",requires:[],requiredPermissions:[],consequence:"None — display only. Persists until dismissed.",affects:[],reversible:!1,safetyLevel:"low",requiresConfirmation:!1,destructive:!1,contractVersion:"0.0.1"}),d=e.defineContractTemplate({type:"display",intent:"display-status",description:"Displays a small status label, count, or categorical indicator",requires:[],requiredPermissions:[],consequence:"None — display only.",affects:[],reversible:!1,safetyLevel:"low",requiresConfirmation:!1,destructive:!1,contractVersion:"0.0.1"}),u=e.defineContractTemplate({type:"display",intent:"display-progress",description:"Displays the completion percentage of an ongoing operation",requires:[],requiredPermissions:[],consequence:"None — display only.",affects:[],reversible:!1,safetyLevel:"low",requiresConfirmation:!1,destructive:!1,contractVersion:"0.0.1"}),p=e.defineContractTemplate({type:"display",intent:"display-loading",description:"Indicates that an asynchronous operation is in progress",requires:[],requiredPermissions:[],consequence:"None — display only.",affects:[],reversible:!1,safetyLevel:"low",requiresConfirmation:!1,destructive:!1,contractVersion:"0.0.1"}),m=e.defineContractTemplate({type:"confirmation",intent:"open-dialog",description:"Opens a modal dialog overlay that interrupts the current workflow",requires:[],requiredPermissions:[],consequence:"Renders a blocking overlay — underlying page is inaccessible until dismissed",affects:["view"],reversible:!0,safetyLevel:"low",requiresConfirmation:!1,destructive:!1,contractVersion:"0.0.1"}),v=e.defineContractTemplate({type:"navigation",intent:"open-drawer",description:"Opens a slide-in panel from a screen edge for navigation or contextual content",requires:[],requiredPermissions:[],consequence:"Renders a side panel overlay — underlying page remains accessible",affects:["view"],reversible:!0,safetyLevel:"low",requiresConfirmation:!1,destructive:!1,contractVersion:"0.0.1"}),y=e.defineContractTemplate({type:"display",intent:"display-tooltip",description:"Shows supplementary information about a trigger element on hover or focus",requires:[],requiredPermissions:[],consequence:"None — display only. Hides on mouse leave, blur, or Escape.",affects:[],reversible:!1,safetyLevel:"low",requiresConfirmation:!1,destructive:!1,contractVersion:"0.0.1"}),C=e.defineContractTemplate({type:"display",intent:"open-popover",description:"Opens a non-modal floating panel anchored to a trigger element",requires:[],requiredPermissions:[],consequence:"Renders a floating panel — underlying page remains fully interactive",affects:["view"],reversible:!0,safetyLevel:"low",requiresConfirmation:!1,destructive:!1,contractVersion:"0.0.1"}),q=e.defineContractTemplate({type:"display",intent:"display-content",description:"Displays grouped content in a visually distinct container",requires:[],requiredPermissions:[],consequence:"None — display only.",affects:[],reversible:!1,safetyLevel:"low",requiresConfirmation:!1,destructive:!1,contractVersion:"0.0.1"}),g=e.defineContractTemplate({type:"display",intent:"separate-content",description:"Visually or semantically separates adjacent content sections",requires:[],requiredPermissions:[],consequence:"None — display only.",affects:[],reversible:!1,safetyLevel:"low",requiresConfirmation:!1,destructive:!1,contractVersion:"0.0.1"}),b=e.defineContractTemplate({type:"navigation",intent:"navigate-tabs",description:"Switches between content panels by activating a tab trigger",requires:[],requiredPermissions:[],consequence:"Changes the active content panel — no data mutation",affects:["view"],reversible:!0,safetyLevel:"low",requiresConfirmation:!1,destructive:!1,contractVersion:"0.0.1"}),h=e.defineContractTemplate({type:"navigation",intent:"navigate-breadcrumb",description:"Displays the current page location in the site hierarchy with ancestor navigation links",requires:[],requiredPermissions:[],consequence:"Navigates to an ancestor page when a breadcrumb link is activated",affects:["view"],reversible:!0,safetyLevel:"low",requiresConfirmation:!1,destructive:!1,contractVersion:"0.0.1"}),w=e.defineContractTemplate({type:"navigation",intent:"navigate-page",description:"Navigates between pages of a paginated data set",requires:[],requiredPermissions:[],consequence:"Changes the visible page of the data set — no data mutation",affects:["view"],reversible:!0,safetyLevel:"low",requiresConfirmation:!1,destructive:!1,contractVersion:"0.0.1"});exports.alertContract=f;exports.badgeContract=d;exports.breadcrumbContract=h;exports.buttonContract=t;exports.cardContract=q;exports.checkboxContract=i;exports.dialogContract=m;exports.drawerContract=v;exports.formContract=c;exports.inputContract=r;exports.paginationContract=w;exports.popoverContract=C;exports.progressContract=u;exports.radioContract=a;exports.selectContract=s;exports.separatorContract=g;exports.spinnerContract=p;exports.switchContract=o;exports.tabsContract=b;exports.textareaContract=n;exports.toastContract=l;exports.tooltipContract=y;
|
package/dist/slot.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./Slot-CLNJSabn.cjs");exports.Slot=e.Slot;exports.mergeProps=e.mergeProps;exports.mergeRefs=e.mergeRefs;
|
package/dist/slot.d.ts
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { default as default_2 } from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Merges slot props onto child props.
|
|
5
|
+
*
|
|
6
|
+
* Rules:
|
|
7
|
+
* - Event handlers: compose — both slot and child handlers are called (slot first).
|
|
8
|
+
* - className: concatenate with a space separator.
|
|
9
|
+
* - style: merge objects — child values override slot values.
|
|
10
|
+
* - All other props: child value overrides slot value.
|
|
11
|
+
*
|
|
12
|
+
* @param slotProps - Props from the Slot component (defaults / additions).
|
|
13
|
+
* @param childProps - Props from the child element being slotted into.
|
|
14
|
+
* @returns Merged props object ready to spread onto the cloned child element.
|
|
15
|
+
*/
|
|
16
|
+
export declare function mergeProps(slotProps: Record<string, unknown>, childProps: Record<string, unknown>): Record<string, unknown>;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Merges multiple React refs into a single callback ref.
|
|
20
|
+
*
|
|
21
|
+
* Handles RefObject (created by createRef/useRef) and callback refs.
|
|
22
|
+
* Null and undefined entries are skipped safely.
|
|
23
|
+
*
|
|
24
|
+
* @param refs - Any number of React refs to merge. Null and undefined are accepted.
|
|
25
|
+
* @returns A single callback ref that sets all provided refs when called.
|
|
26
|
+
*/
|
|
27
|
+
export declare function mergeRefs<T>(...refs: ReadonlyArray<default_2.Ref<T> | null | undefined>): default_2.RefCallback<T>;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Slot — the asChild pattern implementation.
|
|
31
|
+
*
|
|
32
|
+
* Merges its own props onto its immediate child element, allowing a parent
|
|
33
|
+
* component to pass behaviour (event handlers, className, style, ARIA attributes)
|
|
34
|
+
* through to a developer-supplied element without wrapping it in an extra DOM node.
|
|
35
|
+
*
|
|
36
|
+
* Merge rules (handled by mergeProps):
|
|
37
|
+
* - Event handlers: both slot and child handlers are called (slot fires first).
|
|
38
|
+
* - className: concatenated with a space.
|
|
39
|
+
* - style: merged as objects (child values override slot values).
|
|
40
|
+
* - All other props: child value overrides slot default.
|
|
41
|
+
*
|
|
42
|
+
* Zero Radix dependency — per DECISION-012.
|
|
43
|
+
*/
|
|
44
|
+
export declare const Slot: default_2.ForwardRefExoticComponent<SlotProps & default_2.RefAttributes<HTMLElement>>;
|
|
45
|
+
|
|
46
|
+
/** Props accepted by the Slot component. Extends all standard HTML element attributes. */
|
|
47
|
+
export declare interface SlotProps extends default_2.HTMLAttributes<HTMLElement> {
|
|
48
|
+
/** The single child element whose props will be merged with the Slot's own props. */
|
|
49
|
+
children?: default_2.ReactNode;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export { }
|
package/dist/slot.js
ADDED
package/dist/types.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** Alignment along the cross-axis of a positioned element. */
|
|
2
|
+
export declare type Align = 'start' | 'center' | 'end';
|
|
3
|
+
|
|
4
|
+
/** Semantic color variant — maps to the token color scale. */
|
|
5
|
+
export declare type ColorVariant = 'default' | 'success' | 'warning' | 'danger' | 'info';
|
|
6
|
+
|
|
7
|
+
/** Layout or scroll orientation. */
|
|
8
|
+
export declare type Orientation = 'horizontal' | 'vertical';
|
|
9
|
+
|
|
10
|
+
/** Positional side relative to a trigger or anchor element. */
|
|
11
|
+
export declare type Side = 'top' | 'right' | 'bottom' | 'left';
|
|
12
|
+
|
|
13
|
+
/** Component size — xs through xl. Used across all sized components. */
|
|
14
|
+
export declare type Size = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
15
|
+
|
|
16
|
+
export { }
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/package.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@vhyxui/core",
|
|
3
|
+
"version": "0.1.0-alpha.1",
|
|
4
|
+
"description": "VhyxUI core — shared types, contracts, slot, and error infrastructure",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"private": false,
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "./dist/index.cjs",
|
|
9
|
+
"module": "./dist/index.js",
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"import": "./dist/index.js",
|
|
14
|
+
"require": "./dist/index.cjs",
|
|
15
|
+
"types": "./dist/index.d.ts"
|
|
16
|
+
},
|
|
17
|
+
"./contracts": {
|
|
18
|
+
"import": "./dist/contracts.js",
|
|
19
|
+
"require": "./dist/contracts.cjs",
|
|
20
|
+
"types": "./dist/contracts.d.ts"
|
|
21
|
+
},
|
|
22
|
+
"./slot": {
|
|
23
|
+
"import": "./dist/slot.js",
|
|
24
|
+
"require": "./dist/slot.cjs",
|
|
25
|
+
"types": "./dist/slot.d.ts"
|
|
26
|
+
},
|
|
27
|
+
"./errors": {
|
|
28
|
+
"import": "./dist/errors.js",
|
|
29
|
+
"require": "./dist/errors.cjs",
|
|
30
|
+
"types": "./dist/errors.d.ts"
|
|
31
|
+
},
|
|
32
|
+
"./types": {
|
|
33
|
+
"import": "./dist/types.js",
|
|
34
|
+
"require": "./dist/types.cjs",
|
|
35
|
+
"types": "./dist/types.d.ts"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"files": [
|
|
39
|
+
"dist"
|
|
40
|
+
],
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"@vhyxseal/core": "1.0.0-rc.2"
|
|
43
|
+
},
|
|
44
|
+
"peerDependencies": {
|
|
45
|
+
"react": ">=18",
|
|
46
|
+
"react-dom": ">=18"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@types/react": "^18.0.0",
|
|
50
|
+
"@types/react-dom": "^18.0.0"
|
|
51
|
+
},
|
|
52
|
+
"scripts": {
|
|
53
|
+
"build": "vite build",
|
|
54
|
+
"dev": "vite build --watch",
|
|
55
|
+
"test": "vitest run",
|
|
56
|
+
"test:watch": "vitest",
|
|
57
|
+
"typecheck": "tsc --project tsconfig.test.json --noEmit",
|
|
58
|
+
"lint": "eslint src"
|
|
59
|
+
}
|
|
60
|
+
}
|