@vhyxui/react 0.3.0-alpha → 0.4.0-alpha
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/LICENSE +21 -0
- package/README.md +65 -0
- package/dist/Accordion-qtPur3CA.js +81 -0
- package/dist/Accordion-z3QDvyGf.cjs +1 -0
- package/dist/Alert-D4EFVKUy.js +99 -0
- package/dist/Alert-DWB9Gtpv.cjs +1 -0
- package/dist/Avatar-CDoAvY0m.js +51 -0
- package/dist/Avatar-afXJdutp.cjs +1 -0
- package/dist/Badge-DOhfKlXt.cjs +1 -0
- package/dist/Badge-Z6crWSLX.js +38 -0
- package/dist/Breadcrumb-CbPmH-b4.js +90 -0
- package/dist/Breadcrumb-DWRxQvbb.cjs +1 -0
- package/dist/Button-CnNtk6HV.cjs +1 -0
- package/dist/Button-DN5vy24q.js +60 -0
- package/dist/Card-CI7DyOJg.js +79 -0
- package/dist/Card-CZUQhd45.cjs +1 -0
- package/dist/Center-BmKeGEa1.cjs +1 -0
- package/dist/Center-DFq5m7mf.js +22 -0
- package/dist/Checkbox-D-5qaOEj.js +92 -0
- package/dist/Checkbox-DOd4SIx2.cjs +1 -0
- package/dist/Container-CcsVyA6r.cjs +1 -0
- package/dist/Container-DPKIgeDZ.js +21 -0
- package/dist/Dialog-B7Mhq9Qc.cjs +1 -0
- package/dist/Dialog-DhIanyWH.js +258 -0
- package/dist/Drawer-8maigAH9.cjs +1 -0
- package/dist/Drawer-BKizItfr.js +259 -0
- package/dist/Field-DJvjEmzE.cjs +1 -0
- package/dist/Field-Dx9gXxGL.js +120 -0
- package/dist/Grid-Bzzb0usH.cjs +1 -0
- package/dist/Grid-x_OHCzGV.js +25 -0
- package/dist/Heading-BPqfnM8i.js +14 -0
- package/dist/Heading-icKRWRno.cjs +1 -0
- package/dist/Input-B0dEXpG8.js +151 -0
- package/dist/Input-CdS0oZyf.cjs +1 -0
- package/dist/Kbd-C2vxklhy.cjs +1 -0
- package/dist/Kbd-DGURpjWN.js +22 -0
- package/dist/Pagination-CiE9Jzm0.cjs +1 -0
- package/dist/Pagination-UQ53MWnR.js +128 -0
- package/dist/{Popover-j9pNswBn.js → Popover-0QvSlzcQ.js} +53 -53
- package/dist/Popover-Chf2ikqa.cjs +1 -0
- package/dist/Progress-DdWZRQVS.js +75 -0
- package/dist/Progress-lItZES-D.cjs +1 -0
- package/dist/RadioItem-BbIH7LoA.js +141 -0
- package/dist/RadioItem-Cfxch4Gj.cjs +1 -0
- package/dist/Select-CgjfJSB8.js +350 -0
- package/dist/Select-D_oVKzzK.cjs +1 -0
- package/dist/SelectField-DBGtOECg.js +49 -0
- package/dist/SelectField-DdkU9fXq.cjs +1 -0
- package/dist/Separator-BwR51KpL.js +52 -0
- package/dist/Separator-CTncQd7E.cjs +1 -0
- package/dist/Skeleton-C1LTpmVC.js +20 -0
- package/dist/Skeleton-CpzYhkFp.cjs +1 -0
- package/dist/Spinner-BJnT9SOB.cjs +1 -0
- package/dist/{Spinner-BYi9eTfl.js → Spinner-Dz68qwGs.js} +25 -25
- package/dist/Stack--mNjuxZe.cjs +1 -0
- package/dist/Stack-CfwjUv0j.js +49 -0
- package/dist/Switch-I712svE0.cjs +1 -0
- package/dist/{Switch-DOAZfSV0.js → Switch-bIbcXIMH.js} +22 -22
- package/dist/Table-C2TUkSZv.cjs +1 -0
- package/dist/Table-C_jZjmPK.js +67 -0
- package/dist/Tabs-CbmdCTVE.js +220 -0
- package/dist/Tabs-Dfuu2ZVq.cjs +1 -0
- package/dist/Text-CgsfCbWf.cjs +1 -0
- package/dist/Text-Dl4z0gus.js +26 -0
- package/dist/Text.module-CEBydIO4.js +7 -0
- package/dist/Text.module-gGopk2Yk.cjs +1 -0
- package/dist/TextField-B492c5Ct.js +31 -0
- package/dist/TextField-Bp-b0-hG.cjs +1 -0
- package/dist/{Textarea-CLrctxHU.js → Textarea-cloHZ5Sz.js} +41 -41
- package/dist/Textarea-uXK6PrFb.cjs +1 -0
- package/dist/TextareaField-C5naVyA1.cjs +1 -0
- package/dist/TextareaField-CrRndsuY.js +31 -0
- package/dist/Toast-CESL8AKT.cjs +1 -0
- package/dist/Toast-DYqE0PjM.js +167 -0
- package/dist/Tooltip-B-PpSm6T.cjs +1 -0
- package/dist/{Tooltip-BAmErB_g.js → Tooltip-DCCaNX5W.js} +34 -34
- package/dist/VhyxUIProvider-3f3b9ukY.cjs +1 -0
- package/dist/VhyxUIProvider-B2UHeumk.js +58 -0
- package/dist/VisuallyHidden-BWdnOImJ.cjs +1 -0
- package/dist/VisuallyHidden-CPTxPvL_.js +18 -0
- package/dist/accordion.cjs +1 -0
- package/dist/accordion.d.ts +48 -0
- package/dist/accordion.js +5 -0
- package/dist/alert.cjs +1 -1
- package/dist/alert.js +3 -2
- package/dist/avatar.cjs +1 -0
- package/dist/avatar.d.ts +53 -0
- package/dist/avatar.js +7 -0
- package/dist/badge.cjs +1 -1
- package/dist/badge.js +2 -1
- package/dist/breadcrumb.cjs +1 -1
- package/dist/breadcrumb.js +3 -2
- package/dist/button.cjs +1 -1
- package/dist/button.js +3 -2
- package/dist/card.cjs +1 -1
- package/dist/card.js +3 -2
- package/dist/center.cjs +1 -0
- package/dist/center.d.ts +20 -0
- package/dist/center.js +5 -0
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.js +3 -2
- package/dist/container.cjs +1 -0
- package/dist/container.d.ts +23 -0
- package/dist/container.js +5 -0
- package/dist/cx-OWdTFKLx.js +15 -0
- package/dist/cx-dgWA95G6.cjs +1 -0
- package/dist/dialog.cjs +1 -1
- package/dist/dialog.d.ts +0 -1
- package/dist/dialog.js +3 -2
- package/dist/drawer.cjs +1 -1
- package/dist/drawer.d.ts +0 -1
- package/dist/drawer.js +3 -2
- package/dist/env-Cqd4Y-Z7.cjs +1 -0
- package/dist/env-lFT_FRkA.js +19 -0
- package/dist/form.cjs +1 -1
- package/dist/form.d.ts +6 -6
- package/dist/form.js +5 -4
- package/dist/grid.cjs +1 -0
- package/dist/grid.d.ts +35 -0
- package/dist/grid.js +5 -0
- package/dist/heading.cjs +1 -0
- package/dist/heading.d.ts +25 -0
- package/dist/heading.js +5 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +440 -20
- package/dist/index.js +96 -62
- package/dist/input.cjs +1 -1
- package/dist/input.js +3 -2
- package/dist/kbd.cjs +1 -0
- package/dist/kbd.d.ts +16 -0
- package/dist/kbd.js +5 -0
- package/dist/pagination.cjs +1 -1
- package/dist/pagination.js +2 -1
- package/dist/popover.cjs +1 -1
- package/dist/popover.js +3 -2
- package/dist/progress.cjs +1 -1
- package/dist/progress.js +2 -1
- package/dist/radio.cjs +1 -1
- package/dist/radio.js +4 -3
- package/dist/select.cjs +1 -1
- package/dist/select.d.ts +3 -3
- package/dist/select.js +3 -2
- package/dist/selectfield.cjs +1 -1
- package/dist/selectfield.d.ts +6 -6
- package/dist/selectfield.js +3 -2
- package/dist/separator.cjs +1 -1
- package/dist/separator.js +3 -2
- package/dist/skeleton.cjs +1 -0
- package/dist/skeleton.d.ts +22 -0
- package/dist/skeleton.js +5 -0
- package/dist/spinner.cjs +1 -1
- package/dist/spinner.js +3 -2
- package/dist/stack.cjs +1 -0
- package/dist/stack.d.ts +58 -0
- package/dist/stack.js +7 -0
- package/dist/style.css +2 -1
- package/dist/switch.cjs +1 -1
- package/dist/switch.js +3 -2
- package/dist/table.cjs +1 -0
- package/dist/table.d.ts +65 -0
- package/dist/table.js +5 -0
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.js +3 -2
- package/dist/test-utils.cjs +1 -1
- package/dist/test-utils.d.ts +14 -2
- package/dist/test-utils.js +5 -5
- package/dist/text.cjs +1 -0
- package/dist/text.d.ts +38 -0
- package/dist/text.js +5 -0
- package/dist/textarea.cjs +1 -1
- package/dist/textarea.js +2 -1
- package/dist/textareafield.cjs +1 -1
- package/dist/textareafield.d.ts +6 -6
- package/dist/textareafield.js +2 -1
- package/dist/textfield.cjs +1 -1
- package/dist/textfield.d.ts +6 -6
- package/dist/textfield.js +3 -2
- package/dist/toast.cjs +1 -1
- package/dist/toast.js +4 -3
- package/dist/tooltip.cjs +1 -1
- package/dist/tooltip.js +3 -2
- package/dist/utils.cjs +1 -0
- package/dist/utils.d.ts +28 -0
- package/dist/utils.js +8 -0
- package/dist/visually-hidden.cjs +1 -0
- package/dist/visually-hidden.d.ts +16 -0
- package/dist/visually-hidden.js +5 -0
- package/package.json +166 -72
- package/dist/Alert-BJ1O0bnK.cjs +0 -1
- package/dist/Alert-am3ANPTH.js +0 -99
- package/dist/Badge-Bbxb4wyt.js +0 -38
- package/dist/Badge-SBO9tGzn.cjs +0 -1
- package/dist/Breadcrumb-Db7ASomJ.js +0 -90
- package/dist/Breadcrumb-StitgXXx.cjs +0 -1
- package/dist/Button-DDMc7-3S.js +0 -58
- package/dist/Button-akOSYEu9.cjs +0 -1
- package/dist/Card-DSCA-Igh.cjs +0 -1
- package/dist/Card-Dh9Pcmfa.js +0 -79
- package/dist/Checkbox-DWl91ci_.js +0 -92
- package/dist/Checkbox-DvkT6QP9.cjs +0 -1
- package/dist/Dialog-CtYu14zl.js +0 -245
- package/dist/Dialog-gPT4noD8.cjs +0 -1
- package/dist/Drawer-BFJxsPG1.js +0 -246
- package/dist/Drawer-BygSIQQn.cjs +0 -1
- package/dist/Field-Bv07PL2M.js +0 -120
- package/dist/Field-D6FSsUGj.cjs +0 -1
- package/dist/Input-BS_t1bl-.js +0 -151
- package/dist/Input-UQ2fQwE7.cjs +0 -1
- package/dist/Pagination-C1h7OTgM.js +0 -128
- package/dist/Pagination-CmmcBPNz.cjs +0 -1
- package/dist/Popover-BlCmIF9J.cjs +0 -1
- package/dist/Progress-DWLr6Bq2.js +0 -75
- package/dist/Progress-FO-4WX0i.cjs +0 -1
- package/dist/RadioItem-BfkTHBxQ.cjs +0 -1
- package/dist/RadioItem-CzHSS_qK.js +0 -141
- package/dist/Select-BkJNe4Lc.cjs +0 -1
- package/dist/Select-DfV10hZt.js +0 -350
- package/dist/SelectField-B6N0uub8.js +0 -49
- package/dist/SelectField-Dxl2Mgbv.cjs +0 -1
- package/dist/Separator-C5lPGzes.cjs +0 -1
- package/dist/Separator-DQT58t90.js +0 -52
- package/dist/Spinner-CeIDpqkx.cjs +0 -1
- package/dist/Switch-BU_Tcttb.cjs +0 -1
- package/dist/Tabs-BTfm4LbV.js +0 -220
- package/dist/Tabs-DuU02-UD.cjs +0 -1
- package/dist/TextField-C3r-6jr6.cjs +0 -1
- package/dist/TextField-DtXQQJJk.js +0 -31
- package/dist/Textarea-H6evM8L4.cjs +0 -1
- package/dist/TextareaField-CpqPinvx.js +0 -31
- package/dist/TextareaField-D234Lyi_.cjs +0 -1
- package/dist/Toast-0acAjZTB.js +0 -167
- package/dist/Toast-ndaxbpcV.cjs +0 -1
- package/dist/Tooltip-CCd6VRvZ.cjs +0 -1
- package/dist/VhyxUIProvider-C7ie8u2L.cjs +0 -1
- package/dist/VhyxUIProvider-DVFSW4q-.js +0 -31
- package/dist/jsx-runtime-BRMkMA8J.cjs +0 -22
- package/dist/jsx-runtime-CL69jGNW.js +0 -279
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Vhyxara
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# @vhyxui/react
|
|
2
|
+
|
|
3
|
+
Accessible React components with motion tokens and built-in AI agent contracts.
|
|
4
|
+
Every interactive component describes what it does, so AI agents can use your UI
|
|
5
|
+
safely — powered by [VhyxSeal](https://www.npmjs.com/package/@vhyxseal/react).
|
|
6
|
+
|
|
7
|
+
> **Alpha** — APIs may change between minor versions.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install @vhyxui/react @vhyxui/tokens
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Requires React 18 or 19.
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
```css
|
|
20
|
+
/* app.css */
|
|
21
|
+
@import "@vhyxui/tokens/index.css";
|
|
22
|
+
@import "@vhyxui/react/style.css";
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
```tsx
|
|
26
|
+
import { VhyxUIProvider, Stack, Heading, Text, Button } from "@vhyxui/react";
|
|
27
|
+
|
|
28
|
+
export function App() {
|
|
29
|
+
return (
|
|
30
|
+
<VhyxUIProvider theme="system">
|
|
31
|
+
<Stack gap={4}>
|
|
32
|
+
<Heading>Welcome</Heading>
|
|
33
|
+
<Text tone="muted">Your workspace is ready.</Text>
|
|
34
|
+
<Button onClick={start}>Get started</Button>
|
|
35
|
+
</Stack>
|
|
36
|
+
</VhyxUIProvider>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Components are tree-shakeable, and each one has its own entry point
|
|
42
|
+
(`@vhyxui/react/button`, `@vhyxui/react/dialog` …). Styles live in
|
|
43
|
+
`@layer components`, so your own CSS and Tailwind utilities always win.
|
|
44
|
+
|
|
45
|
+
## What's included
|
|
46
|
+
|
|
47
|
+
- **Layout & type** — `Stack`, `HStack`, `VStack`, `Grid`, `Container`, `Center`, `Text`, `Heading`, `Kbd`, `VisuallyHidden`
|
|
48
|
+
- **Forms** — `Button`, `Input`, `Textarea`, `Select`, `Checkbox`, `RadioGroup`, `Switch`, `Form`, `Field`, `TextField`, `TextareaField`, `SelectField`
|
|
49
|
+
- **Overlays** — `Dialog`, `Drawer`, `Popover`, `Tooltip`, `toast`
|
|
50
|
+
- **Display** — `Card`, `Badge`, `Alert`, `Avatar`, `Table`, `Accordion`, `Tabs`, `Breadcrumb`, `Pagination`, `Progress`, `Spinner`, `Skeleton`, `Separator`
|
|
51
|
+
- **Utilities** — `cx`, `VhyxUIProvider` (theme, toasts, skip link, agent contracts)
|
|
52
|
+
|
|
53
|
+
Works with Next.js Server Components: components ship with `'use client'`.
|
|
54
|
+
|
|
55
|
+
## Related packages
|
|
56
|
+
|
|
57
|
+
- `@vhyxui/tokens` — design tokens (required)
|
|
58
|
+
- `@vhyxui/blocks` — ready-made blocks and page layouts
|
|
59
|
+
- `@vhyxui/tailwind` — Tailwind v3 preset and v4 theme
|
|
60
|
+
|
|
61
|
+
## Links
|
|
62
|
+
|
|
63
|
+
- Documentation — https://vhyxui.com
|
|
64
|
+
- Source — https://github.com/vhyxara/vhyxUI/tree/main/packages/react
|
|
65
|
+
- License — MIT
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { jsx as c, jsxs as y } from "react/jsx-runtime";
|
|
2
|
+
import N, { useState as R, useCallback as S, useMemo as L, useContext as M, createContext as B } from "react";
|
|
3
|
+
import { accordionContract as A } from "@vhyxui/core";
|
|
4
|
+
import { withAgentContract as D } from "@vhyxseal/react";
|
|
5
|
+
import { c as k } from "./cx-OWdTFKLx.js";
|
|
6
|
+
import { u as J } from "./useId-BGRmH6iF.js";
|
|
7
|
+
const P = "_accordion_1an9c_1", W = "_item_1an9c_16", q = "_trigger_1an9c_20", z = "_chevron_1an9c_51", E = "_content_1an9c_61", d = {
|
|
8
|
+
accordion: P,
|
|
9
|
+
item: W,
|
|
10
|
+
trigger: q,
|
|
11
|
+
chevron: z,
|
|
12
|
+
content: E
|
|
13
|
+
}, I = B(null), b = N.forwardRef(
|
|
14
|
+
({ type: t = "single", defaultValue: m = [], value: r, onValueChange: e, variant: v = "default", items: i, contract: l, className: f, children: n, ...p }, s) => {
|
|
15
|
+
const [j, w] = R(m), a = r ?? j, h = J("vhyx-accordion"), _ = S(
|
|
16
|
+
(o, g) => {
|
|
17
|
+
if (a.includes(o) === g) return;
|
|
18
|
+
const x = g ? t === "single" ? [o] : [...a, o] : a.filter((O) => O !== o);
|
|
19
|
+
r === void 0 && w(x), e == null || e(x);
|
|
20
|
+
},
|
|
21
|
+
[a, t, r, e]
|
|
22
|
+
), C = L(
|
|
23
|
+
() => ({ isOpen: (o) => a.includes(o), toggle: _, name: t === "single" ? h : void 0 }),
|
|
24
|
+
[a, _, t, h]
|
|
25
|
+
);
|
|
26
|
+
return /* @__PURE__ */ c(I.Provider, { value: C, children: /* @__PURE__ */ c(
|
|
27
|
+
"div",
|
|
28
|
+
{
|
|
29
|
+
ref: s,
|
|
30
|
+
className: k(d.accordion, f),
|
|
31
|
+
"data-variant": v,
|
|
32
|
+
"data-vhyx-contract": l ? JSON.stringify({ ...A, ...l }) : void 0,
|
|
33
|
+
...p,
|
|
34
|
+
children: i ? i.map((o) => /* @__PURE__ */ c(u, { value: o.value, title: o.title, disabled: o.disabled ?? !1, children: o.content }, o.value)) : n
|
|
35
|
+
}
|
|
36
|
+
) });
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
b.displayName = "VhyxAccordion";
|
|
40
|
+
const u = N.forwardRef(
|
|
41
|
+
({ value: t, title: m, disabled: r = !1, className: e, children: v, onToggle: i, ...l }, f) => {
|
|
42
|
+
const n = M(I), p = (n == null ? void 0 : n.isOpen(t)) ?? !1;
|
|
43
|
+
return /* @__PURE__ */ y(
|
|
44
|
+
"details",
|
|
45
|
+
{
|
|
46
|
+
ref: f,
|
|
47
|
+
className: k(d.item, e),
|
|
48
|
+
open: p,
|
|
49
|
+
name: n == null ? void 0 : n.name,
|
|
50
|
+
"data-disabled": r ? "true" : void 0,
|
|
51
|
+
onToggle: (s) => {
|
|
52
|
+
n == null || n.toggle(t, s.currentTarget.open), i == null || i(s);
|
|
53
|
+
},
|
|
54
|
+
...l,
|
|
55
|
+
children: [
|
|
56
|
+
/* @__PURE__ */ y(
|
|
57
|
+
"summary",
|
|
58
|
+
{
|
|
59
|
+
className: d.trigger,
|
|
60
|
+
"aria-disabled": r ? !0 : void 0,
|
|
61
|
+
tabIndex: r ? -1 : void 0,
|
|
62
|
+
onClick: r ? (s) => s.preventDefault() : void 0,
|
|
63
|
+
children: [
|
|
64
|
+
/* @__PURE__ */ c("span", { children: m }),
|
|
65
|
+
/* @__PURE__ */ c("svg", { className: d.chevron, viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ c("path", { d: "M4 6l4 4 4-4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) })
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
),
|
|
69
|
+
/* @__PURE__ */ c("div", { className: d.content, children: v })
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
);
|
|
75
|
+
u.displayName = "VhyxAccordionItem";
|
|
76
|
+
const F = { ...A, id: "vhyxui-accordion" }, Z = Object.assign(D(b, F), {
|
|
77
|
+
Item: u
|
|
78
|
+
});
|
|
79
|
+
export {
|
|
80
|
+
Z as A
|
|
81
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),t=require("react"),y=require("@vhyxui/core"),b=require("@vhyxseal/react"),N=require("./cx-dgWA95G6.cjs"),w=require("./useId-D2AEOm2G.cjs"),O="_accordion_1an9c_1",S="_item_1an9c_16",L="_trigger_1an9c_20",M="_chevron_1an9c_51",B="_content_1an9c_61",l={accordion:O,item:S,trigger:L,chevron:M,content:B},A=t.createContext(null),I=t.forwardRef(({type:r="single",defaultValue:v=[],value:o,onValueChange:s,variant:x="default",items:i,contract:u,className:h,children:c,...m},a)=>{const[k,q]=t.useState(v),d=o??k,f=w.useId("vhyx-accordion"),j=t.useCallback((n,g)=>{if(d.includes(n)===g)return;const p=g?r==="single"?[n]:[...d,n]:d.filter(R=>R!==n);o===void 0&&q(p),s==null||s(p)},[d,r,o,s]),C=t.useMemo(()=>({isOpen:n=>d.includes(n),toggle:j,name:r==="single"?f:void 0}),[d,j,r,f]);return e.jsx(A.Provider,{value:C,children:e.jsx("div",{ref:a,className:N.cx(l.accordion,h),"data-variant":x,"data-vhyx-contract":u?JSON.stringify({...y.accordionContract,...u}):void 0,...m,children:i?i.map(n=>e.jsx(_,{value:n.value,title:n.title,disabled:n.disabled??!1,children:n.content},n.value)):c})})});I.displayName="VhyxAccordion";const _=t.forwardRef(({value:r,title:v,disabled:o=!1,className:s,children:x,onToggle:i,...u},h)=>{const c=t.useContext(A),m=(c==null?void 0:c.isOpen(r))??!1;return e.jsxs("details",{ref:h,className:N.cx(l.item,s),open:m,name:c==null?void 0:c.name,"data-disabled":o?"true":void 0,onToggle:a=>{c==null||c.toggle(r,a.currentTarget.open),i==null||i(a)},...u,children:[e.jsxs("summary",{className:l.trigger,"aria-disabled":o?!0:void 0,tabIndex:o?-1:void 0,onClick:o?a=>a.preventDefault():void 0,children:[e.jsx("span",{children:v}),e.jsx("svg",{className:l.chevron,viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:e.jsx("path",{d:"M4 6l4 4 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]}),e.jsx("div",{className:l.content,children:x})]})});_.displayName="VhyxAccordionItem";const D={...y.accordionContract,id:"vhyxui-accordion"},J=Object.assign(b.withAgentContract(I,D),{Item:_});exports.Accordion=J;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { jsxs as l, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import b, { useState as A } from "react";
|
|
3
|
+
import { alertContract as o } from "@vhyxui/core";
|
|
4
|
+
import { withAgentContract as C } from "@vhyxseal/react";
|
|
5
|
+
import { u as w } from "./useId-BGRmH6iF.js";
|
|
6
|
+
const k = "_alert_tjvt2_1", a = {
|
|
7
|
+
alert: k,
|
|
8
|
+
"alert-icon": "_alert-icon_tjvt2_51",
|
|
9
|
+
"alert-body": "_alert-body_tjvt2_60",
|
|
10
|
+
"alert-title": "_alert-title_tjvt2_68",
|
|
11
|
+
"alert-message": "_alert-message_tjvt2_73",
|
|
12
|
+
"alert-dismiss": "_alert-dismiss_tjvt2_80"
|
|
13
|
+
}, d = b.forwardRef(
|
|
14
|
+
({
|
|
15
|
+
variant: e = "default",
|
|
16
|
+
title: i,
|
|
17
|
+
icon: c,
|
|
18
|
+
dismissible: u = !1,
|
|
19
|
+
onDismiss: s,
|
|
20
|
+
contract: r,
|
|
21
|
+
className: m,
|
|
22
|
+
children: n,
|
|
23
|
+
...f
|
|
24
|
+
}, _) => {
|
|
25
|
+
const y = w("vhyx-alert"), [h, v] = A(!1);
|
|
26
|
+
if (h) return null;
|
|
27
|
+
const p = {
|
|
28
|
+
...o,
|
|
29
|
+
...r,
|
|
30
|
+
id: (r == null ? void 0 : r.id) ?? y
|
|
31
|
+
}, x = e === "danger" ? "alert" : "status", g = e === "danger" ? "assertive" : "polite", j = c ?? S(e);
|
|
32
|
+
function N() {
|
|
33
|
+
v(!0), s == null || s();
|
|
34
|
+
}
|
|
35
|
+
return /* @__PURE__ */ l(
|
|
36
|
+
"div",
|
|
37
|
+
{
|
|
38
|
+
ref: _,
|
|
39
|
+
role: x,
|
|
40
|
+
"aria-live": g,
|
|
41
|
+
className: [a.alert, m].filter(Boolean).join(" "),
|
|
42
|
+
"data-variant": e,
|
|
43
|
+
"data-vhyx-contract": JSON.stringify(p),
|
|
44
|
+
...f,
|
|
45
|
+
children: [
|
|
46
|
+
/* @__PURE__ */ t("span", { className: a["alert-icon"], "aria-hidden": "true", children: j }),
|
|
47
|
+
/* @__PURE__ */ l("div", { className: a["alert-body"], children: [
|
|
48
|
+
i && /* @__PURE__ */ t("span", { className: a["alert-title"], children: i }),
|
|
49
|
+
n && /* @__PURE__ */ t("span", { className: a["alert-message"], children: n })
|
|
50
|
+
] }),
|
|
51
|
+
u && /* @__PURE__ */ t(
|
|
52
|
+
"button",
|
|
53
|
+
{
|
|
54
|
+
type: "button",
|
|
55
|
+
className: a["alert-dismiss"],
|
|
56
|
+
onClick: N,
|
|
57
|
+
"aria-label": "Dismiss",
|
|
58
|
+
children: /* @__PURE__ */ l(
|
|
59
|
+
"svg",
|
|
60
|
+
{
|
|
61
|
+
"aria-hidden": "true",
|
|
62
|
+
viewBox: "0 0 12 12",
|
|
63
|
+
fill: "none",
|
|
64
|
+
stroke: "currentColor",
|
|
65
|
+
strokeWidth: 1.5,
|
|
66
|
+
strokeLinecap: "round",
|
|
67
|
+
children: [
|
|
68
|
+
/* @__PURE__ */ t("line", { x1: "2", y1: "2", x2: "10", y2: "10" }),
|
|
69
|
+
/* @__PURE__ */ t("line", { x1: "10", y1: "2", x2: "2", y2: "10" })
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
)
|
|
73
|
+
}
|
|
74
|
+
)
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
);
|
|
80
|
+
d.displayName = "VhyxAlert";
|
|
81
|
+
const I = { ...o, id: "vhyxui-alert" }, B = C(d, I);
|
|
82
|
+
B.displayName = "VhyxAlert";
|
|
83
|
+
function S(e) {
|
|
84
|
+
switch (e) {
|
|
85
|
+
case "success":
|
|
86
|
+
return "✓";
|
|
87
|
+
case "danger":
|
|
88
|
+
return "✕";
|
|
89
|
+
case "warning":
|
|
90
|
+
return "⚠";
|
|
91
|
+
case "info":
|
|
92
|
+
return "ℹ";
|
|
93
|
+
default:
|
|
94
|
+
return "●";
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
export {
|
|
98
|
+
B as A
|
|
99
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),i=require("react"),c=require("@vhyxui/core"),b=require("@vhyxseal/react"),A=require("./useId-D2AEOm2G.cjs"),q="_alert_tjvt2_1",s={alert:q,"alert-icon":"_alert-icon_tjvt2_51","alert-body":"_alert-body_tjvt2_60","alert-title":"_alert-title_tjvt2_68","alert-message":"_alert-message_tjvt2_73","alert-dismiss":"_alert-dismiss_tjvt2_80"},o=i.forwardRef(({variant:t="default",title:l,icon:u,dismissible:x=!1,onDismiss:a,contract:r,className:_,children:n,...j},y)=>{const f=A.useId("vhyx-alert"),[h,v]=i.useState(!1);if(h)return null;const m={...c.alertContract,...r,id:(r==null?void 0:r.id)??f},g=t==="danger"?"alert":"status",N=t==="danger"?"assertive":"polite",p=u??I(t);function C(){v(!0),a==null||a()}return e.jsxs("div",{ref:y,role:g,"aria-live":N,className:[s.alert,_].filter(Boolean).join(" "),"data-variant":t,"data-vhyx-contract":JSON.stringify(m),...j,children:[e.jsx("span",{className:s["alert-icon"],"aria-hidden":"true",children:p}),e.jsxs("div",{className:s["alert-body"],children:[l&&e.jsx("span",{className:s["alert-title"],children:l}),n&&e.jsx("span",{className:s["alert-message"],children:n})]}),x&&e.jsx("button",{type:"button",className:s["alert-dismiss"],onClick:C,"aria-label":"Dismiss",children:e.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",children:[e.jsx("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),e.jsx("line",{x1:"10",y1:"2",x2:"2",y2:"10"})]})})]})});o.displayName="VhyxAlert";const w={...c.alertContract,id:"vhyxui-alert"},d=b.withAgentContract(o,w);d.displayName="VhyxAlert";function I(t){switch(t){case"success":return"✓";case"danger":return"✕";case"warning":return"⚠";case"info":return"ℹ";default:return"●"}}exports.Alert=d;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { jsxs as d, jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import m, { useState as v } from "react";
|
|
3
|
+
import { c as p } from "./cx-OWdTFKLx.js";
|
|
4
|
+
const _ = "_avatar_xltqw_1", f = "_image_xltqw_24", x = "_status_xltqw_30", w = "_group_xltqw_45", i = {
|
|
5
|
+
avatar: _,
|
|
6
|
+
image: f,
|
|
7
|
+
status: x,
|
|
8
|
+
group: w
|
|
9
|
+
};
|
|
10
|
+
function N(t) {
|
|
11
|
+
var e, r;
|
|
12
|
+
const a = t.trim().split(/\s+/).filter(Boolean), s = ((e = a[0]) == null ? void 0 : e[0]) ?? "", o = a.length > 1 ? ((r = a[a.length - 1]) == null ? void 0 : r[0]) ?? "" : "";
|
|
13
|
+
return (s + o).toUpperCase() || "?";
|
|
14
|
+
}
|
|
15
|
+
const A = m.forwardRef(
|
|
16
|
+
({ src: t, name: a, size: s = "md", shape: o = "circle", status: e, className: r, ...n }, l) => {
|
|
17
|
+
const [g, u] = v(null), h = !!t && g !== t;
|
|
18
|
+
return /* @__PURE__ */ d(
|
|
19
|
+
"span",
|
|
20
|
+
{
|
|
21
|
+
ref: l,
|
|
22
|
+
role: "img",
|
|
23
|
+
"aria-label": e ? `${a} (${e})` : a,
|
|
24
|
+
className: p(i.avatar, r),
|
|
25
|
+
"data-size": s,
|
|
26
|
+
"data-shape": o,
|
|
27
|
+
...n,
|
|
28
|
+
children: [
|
|
29
|
+
h ? /* @__PURE__ */ c("img", { className: i.image, src: t, alt: "", onError: () => u(t ?? null) }) : /* @__PURE__ */ c("span", { "aria-hidden": "true", children: N(a) }),
|
|
30
|
+
e && /* @__PURE__ */ c("span", { className: i.status, "data-status": e, "aria-hidden": "true" })
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
A.displayName = "VhyxAvatar";
|
|
37
|
+
function S({ max: t, size: a = "md", className: s, children: o, ...e }) {
|
|
38
|
+
const r = m.Children.toArray(o), n = t !== void 0 ? r.slice(0, t) : r, l = r.length - n.length;
|
|
39
|
+
return /* @__PURE__ */ d("div", { role: "group", className: p(i.group, s), ...e, children: [
|
|
40
|
+
l > 0 && /* @__PURE__ */ d("span", { className: i.avatar, "data-size": a, role: "img", "aria-label": `${l} more`, children: [
|
|
41
|
+
"+",
|
|
42
|
+
l
|
|
43
|
+
] }),
|
|
44
|
+
[...n].reverse()
|
|
45
|
+
] });
|
|
46
|
+
}
|
|
47
|
+
export {
|
|
48
|
+
A,
|
|
49
|
+
S as a,
|
|
50
|
+
N as g
|
|
51
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const r=require("react/jsx-runtime"),u=require("react"),d=require("./cx-dgWA95G6.cjs"),x="_avatar_xltqw_1",_="_image_xltqw_24",f="_status_xltqw_30",j="_group_xltqw_45",o={avatar:x,image:_,status:f,group:j};function g(t){var e,s;const a=t.trim().split(/\s+/).filter(Boolean),i=((e=a[0])==null?void 0:e[0])??"",n=a.length>1?((s=a[a.length-1])==null?void 0:s[0])??"":"";return(i+n).toUpperCase()||"?"}const m=u.forwardRef(({src:t,name:a,size:i="md",shape:n="circle",status:e,className:s,...c},l)=>{const[p,h]=u.useState(null),v=!!t&&p!==t;return r.jsxs("span",{ref:l,role:"img","aria-label":e?`${a} (${e})`:a,className:d.cx(o.avatar,s),"data-size":i,"data-shape":n,...c,children:[v?r.jsx("img",{className:o.image,src:t,alt:"",onError:()=>h(t??null)}):r.jsx("span",{"aria-hidden":"true",children:g(a)}),e&&r.jsx("span",{className:o.status,"data-status":e,"aria-hidden":"true"})]})});m.displayName="VhyxAvatar";function q({max:t,size:a="md",className:i,children:n,...e}){const s=u.Children.toArray(n),c=t!==void 0?s.slice(0,t):s,l=s.length-c.length;return r.jsxs("div",{role:"group",className:d.cx(o.group,i),...e,children:[l>0&&r.jsxs("span",{className:o.avatar,"data-size":a,role:"img","aria-label":`${l} more`,children:["+",l]}),[...c].reverse()]})}exports.Avatar=m;exports.AvatarGroup=q;exports.getInitials=g;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const b=require("react/jsx-runtime"),f=require("react"),B=require("@vhyxui/core"),y=require("@vhyxseal/react"),h="_badge_1s34s_1",m={badge:h},r=f.forwardRef(({variant:n="default",size:d="md",dot:a=!1,count:e,max:t=99,className:i,children:o,...c},g)=>{const l=[m.badge,i].filter(Boolean).join(" "),u=()=>a?null:e!==void 0?e>t?`${t}+`:String(e):o;return b.jsx("span",{ref:g,className:l,"data-variant":n,"data-size":d,"data-dot":a?!0:void 0,...c,children:u()})});r.displayName="VhyxBadge";const q={...B.badgeContract,id:"vhyxui-badge"},s=y.withAgentContract(r,q);s.displayName="VhyxBadge";exports.Badge=s;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import f from "react";
|
|
3
|
+
import { badgeContract as m } from "@vhyxui/core";
|
|
4
|
+
import { withAgentContract as b } from "@vhyxseal/react";
|
|
5
|
+
const p = "_badge_1s34s_1", B = {
|
|
6
|
+
badge: p
|
|
7
|
+
}, r = f.forwardRef(
|
|
8
|
+
({
|
|
9
|
+
variant: o = "default",
|
|
10
|
+
size: d = "md",
|
|
11
|
+
dot: t = !1,
|
|
12
|
+
count: a,
|
|
13
|
+
max: e = 99,
|
|
14
|
+
className: n,
|
|
15
|
+
children: s,
|
|
16
|
+
...i
|
|
17
|
+
}, g) => {
|
|
18
|
+
const c = [B.badge, n].filter(Boolean).join(" ");
|
|
19
|
+
return /* @__PURE__ */ l(
|
|
20
|
+
"span",
|
|
21
|
+
{
|
|
22
|
+
ref: g,
|
|
23
|
+
className: c,
|
|
24
|
+
"data-variant": o,
|
|
25
|
+
"data-size": d,
|
|
26
|
+
"data-dot": t ? !0 : void 0,
|
|
27
|
+
...i,
|
|
28
|
+
children: t ? null : a !== void 0 ? a > e ? `${e}+` : String(a) : s
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
r.displayName = "VhyxBadge";
|
|
34
|
+
const u = { ...m, id: "vhyxui-badge" }, y = b(r, u);
|
|
35
|
+
y.displayName = "VhyxBadge";
|
|
36
|
+
export {
|
|
37
|
+
y as B
|
|
38
|
+
};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { jsx as t, jsxs as N } from "react/jsx-runtime";
|
|
2
|
+
import g, { useMemo as c, createContext as C, useContext as I } from "react";
|
|
3
|
+
import { breadcrumbContract as l, Slot as v, VhyxUIError as V, VhyxUIErrorCode as j } from "@vhyxui/core";
|
|
4
|
+
import { withAgentContract as k } from "@vhyxseal/react";
|
|
5
|
+
import { u as w } from "./useId-BGRmH6iF.js";
|
|
6
|
+
const E = "_nav_u2x1y_1", S = "_list_u2x1y_6", P = "_item_u2x1y_16", L = "_separator_u2x1y_23", O = "_link_u2x1y_33", R = "_page_u2x1y_51", U = "_ellipsis_u2x1y_56", n = {
|
|
7
|
+
nav: E,
|
|
8
|
+
list: S,
|
|
9
|
+
item: P,
|
|
10
|
+
separator: L,
|
|
11
|
+
link: O,
|
|
12
|
+
page: R,
|
|
13
|
+
ellipsis: U
|
|
14
|
+
}, m = C(null);
|
|
15
|
+
function M(e) {
|
|
16
|
+
const a = I(m);
|
|
17
|
+
if (!a)
|
|
18
|
+
throw new V({
|
|
19
|
+
code: j.VHYXUI_MISSING_CONTEXT,
|
|
20
|
+
message: `${e} must be used within <Breadcrumb>`,
|
|
21
|
+
suggestion: "Wrap your component tree with <Breadcrumb>"
|
|
22
|
+
});
|
|
23
|
+
return a;
|
|
24
|
+
}
|
|
25
|
+
const u = g.forwardRef(
|
|
26
|
+
({
|
|
27
|
+
separator: e = "/",
|
|
28
|
+
maxItems: a,
|
|
29
|
+
contract: r,
|
|
30
|
+
className: s,
|
|
31
|
+
children: i,
|
|
32
|
+
...y
|
|
33
|
+
}, B) => {
|
|
34
|
+
const o = w("vhyx-breadcrumb"), _ = c(
|
|
35
|
+
() => ({ ...l, id: o, ...r }),
|
|
36
|
+
[o, r]
|
|
37
|
+
), f = c(
|
|
38
|
+
() => ({ separator: e }),
|
|
39
|
+
[e]
|
|
40
|
+
), h = [n.nav, s].filter(Boolean).join(" ");
|
|
41
|
+
return /* @__PURE__ */ t(m.Provider, { value: f, children: /* @__PURE__ */ t(
|
|
42
|
+
"nav",
|
|
43
|
+
{
|
|
44
|
+
ref: B,
|
|
45
|
+
"aria-label": "Breadcrumb",
|
|
46
|
+
className: h,
|
|
47
|
+
"data-vhyx-contract": JSON.stringify(_),
|
|
48
|
+
...y,
|
|
49
|
+
children: /* @__PURE__ */ t("ol", { className: n.list, children: i })
|
|
50
|
+
}
|
|
51
|
+
) });
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
u.displayName = "VhyxBreadcrumb";
|
|
55
|
+
function d({ children: e, className: a, ...r }) {
|
|
56
|
+
const s = M("Breadcrumb.Item"), i = [n.item, a].filter(Boolean).join(" ");
|
|
57
|
+
return /* @__PURE__ */ N("li", { className: i, ...r, children: [
|
|
58
|
+
e,
|
|
59
|
+
/* @__PURE__ */ t("span", { className: n.separator, "aria-hidden": "true", children: s.separator })
|
|
60
|
+
] });
|
|
61
|
+
}
|
|
62
|
+
d.displayName = "VhyxBreadcrumbItem";
|
|
63
|
+
function p({ children: e, className: a, asChild: r = !1, ...s }) {
|
|
64
|
+
const i = [n.link, a].filter(Boolean).join(" ");
|
|
65
|
+
return r ? /* @__PURE__ */ t(v, { className: i, ...s, children: e }) : /* @__PURE__ */ t("a", { className: i, ...s, children: e });
|
|
66
|
+
}
|
|
67
|
+
p.displayName = "VhyxBreadcrumbLink";
|
|
68
|
+
function b({ children: e, className: a, ...r }) {
|
|
69
|
+
const s = [n.page, a].filter(Boolean).join(" ");
|
|
70
|
+
return /* @__PURE__ */ t("span", { "aria-current": "page", className: s, ...r, children: e });
|
|
71
|
+
}
|
|
72
|
+
b.displayName = "VhyxBreadcrumbPage";
|
|
73
|
+
function x({ className: e, ...a }) {
|
|
74
|
+
const r = [n.ellipsis, e].filter(Boolean).join(" ");
|
|
75
|
+
return /* @__PURE__ */ t("span", { "aria-hidden": "true", className: r, ...a, children: "…" });
|
|
76
|
+
}
|
|
77
|
+
x.displayName = "VhyxBreadcrumbEllipsis";
|
|
78
|
+
const T = { ...l, id: "vhyxui-breadcrumb" }, X = Object.assign(
|
|
79
|
+
k(u, T),
|
|
80
|
+
{
|
|
81
|
+
Item: d,
|
|
82
|
+
Link: p,
|
|
83
|
+
Page: b,
|
|
84
|
+
Ellipsis: x
|
|
85
|
+
}
|
|
86
|
+
);
|
|
87
|
+
X.displayName = "VhyxBreadcrumb";
|
|
88
|
+
export {
|
|
89
|
+
X as B
|
|
90
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const s=require("react/jsx-runtime"),i=require("react"),o=require("@vhyxui/core"),j=require("@vhyxseal/react"),C=require("./useId-D2AEOm2G.cjs"),g="_nav_u2x1y_1",I="_list_u2x1y_6",v="_item_u2x1y_16",V="_separator_u2x1y_23",k="_link_u2x1y_33",w="_page_u2x1y_51",E="_ellipsis_u2x1y_56",n={nav:g,list:I,item:v,separator:V,link:k,page:w,ellipsis:E},u=i.createContext(null);function q(e){const r=i.useContext(u);if(!r)throw new o.VhyxUIError({code:o.VhyxUIErrorCode.VHYXUI_MISSING_CONTEXT,message:`${e} must be used within <Breadcrumb>`,suggestion:"Wrap your component tree with <Breadcrumb>"});return r}const m=i.forwardRef(({separator:e="/",maxItems:r,contract:a,className:t,children:c,...B},_)=>{const l=C.useId("vhyx-breadcrumb"),h=i.useMemo(()=>({...o.breadcrumbContract,id:l,...a}),[l,a]),f=i.useMemo(()=>({separator:e}),[e]),N=[n.nav,t].filter(Boolean).join(" ");return s.jsx(u.Provider,{value:f,children:s.jsx("nav",{ref:_,"aria-label":"Breadcrumb",className:N,"data-vhyx-contract":JSON.stringify(h),...B,children:s.jsx("ol",{className:n.list,children:c})})})});m.displayName="VhyxBreadcrumb";function d({children:e,className:r,...a}){const t=q("Breadcrumb.Item"),c=[n.item,r].filter(Boolean).join(" ");return s.jsxs("li",{className:c,...a,children:[e,s.jsx("span",{className:n.separator,"aria-hidden":"true",children:t.separator})]})}d.displayName="VhyxBreadcrumbItem";function x({children:e,className:r,asChild:a=!1,...t}){const c=[n.link,r].filter(Boolean).join(" ");return a?s.jsx(o.Slot,{className:c,...t,children:e}):s.jsx("a",{className:c,...t,children:e})}x.displayName="VhyxBreadcrumbLink";function b({children:e,className:r,...a}){const t=[n.page,r].filter(Boolean).join(" ");return s.jsx("span",{"aria-current":"page",className:t,...a,children:e})}b.displayName="VhyxBreadcrumbPage";function p({className:e,...r}){const a=[n.ellipsis,e].filter(Boolean).join(" ");return s.jsx("span",{"aria-hidden":"true",className:a,...r,children:"…"})}p.displayName="VhyxBreadcrumbEllipsis";const S={...o.breadcrumbContract,id:"vhyxui-breadcrumb"},y=Object.assign(j.withAgentContract(m,S),{Item:d,Link:x,Page:b,Ellipsis:p});y.displayName="VhyxBreadcrumb";exports.Breadcrumb=y;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("react/jsx-runtime"),p=require("react"),u=require("@vhyxui/core"),I=require("@vhyxseal/react"),g=require("./Spinner-BJnT9SOB.cjs"),R=require("./useId-D2AEOm2G.cjs"),V=require("./env-Cqd4Y-Z7.cjs"),z="_button_frr7n_1",D="_content_frr7n_58",U="_spinner_frr7n_197",A="_icon_frr7n_205",s={button:z,content:D,spinner:U,icon:A},v=p.forwardRef(({variant:a="primary",size:x="md",loading:r=!1,icon:e,iconPosition:c="left",iconOnly:n=!1,asChild:y=!1,contract:d,className:_,children:l,disabled:j,id:q,"aria-label":b,...B},f)=>{const N=R.useId("vhyx-button"),i=q??N;V.isDev()&&n&&!b&&console.warn("[VhyxUI] <Button iconOnly> requires an aria-label for accessibility. Screen reader users will not be able to identify this button.");const C=p.useMemo(()=>{const w=a==="destructive"?{safetyLevel:"high",destructive:!0,requiresConfirmation:!0}:{};return{...u.buttonContract,id:i,...w,...d}},[a,i,d]),o=!!j||r,S=[s.button,_].filter(Boolean).join(" "),h={id:i,className:S,"aria-busy":r?!0:void 0,"aria-label":b,"data-variant":a,"data-size":x,"data-loading":r?!0:void 0,"data-icon-only":n?!0:void 0,"data-disabled":o?!0:void 0,"data-vhyx-contract":JSON.stringify(C),...B};return y?t.jsx(u.Slot,{ref:f,"aria-disabled":o?!0:void 0,...h,children:l}):t.jsxs("button",{ref:f,disabled:o,...h,children:[r&&t.jsx(g.Spinner,{size:"sm",variant:"white","aria-hidden":"true",label:"",className:s.spinner}),e&&c==="left"&&!n&&t.jsx("span",{className:s.icon,"aria-hidden":"true",children:e}),n&&e?t.jsx("span",{className:s.icon,"aria-hidden":"true",children:e}):!n&&t.jsx("span",{className:s.content,children:l}),e&&c==="right"&&!n&&t.jsx("span",{className:s.icon,"aria-hidden":"true",children:e})]})});v.displayName="VhyxButton";const J={...u.buttonContract,id:"vhyxui-button"},m=I.withAgentContract(v,J);m.displayName="VhyxButton";exports.Button=m;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { jsx as r, jsxs as w } from "react/jsx-runtime";
|
|
2
|
+
import g, { useMemo as I } from "react";
|
|
3
|
+
import { buttonContract as b, Slot as j } from "@vhyxui/core";
|
|
4
|
+
import { withAgentContract as U } from "@vhyxseal/react";
|
|
5
|
+
import { S as V } from "./Spinner-Dz68qwGs.js";
|
|
6
|
+
import { u as q } from "./useId-BGRmH6iF.js";
|
|
7
|
+
import { i as z } from "./env-lFT_FRkA.js";
|
|
8
|
+
const D = "_button_frr7n_1", R = "_content_frr7n_58", A = "_spinner_frr7n_197", J = "_icon_frr7n_205", a = {
|
|
9
|
+
button: D,
|
|
10
|
+
content: R,
|
|
11
|
+
spinner: A,
|
|
12
|
+
icon: J
|
|
13
|
+
}, p = g.forwardRef(
|
|
14
|
+
({
|
|
15
|
+
variant: n = "primary",
|
|
16
|
+
size: h = "md",
|
|
17
|
+
loading: s = !1,
|
|
18
|
+
icon: t,
|
|
19
|
+
iconPosition: d = "left",
|
|
20
|
+
iconOnly: e = !1,
|
|
21
|
+
asChild: v = !1,
|
|
22
|
+
contract: u,
|
|
23
|
+
className: y,
|
|
24
|
+
children: c,
|
|
25
|
+
disabled: _,
|
|
26
|
+
id: x,
|
|
27
|
+
"aria-label": l,
|
|
28
|
+
...B
|
|
29
|
+
}, f) => {
|
|
30
|
+
const N = q("vhyx-button"), o = x ?? N;
|
|
31
|
+
z() && e && !l && console.warn(
|
|
32
|
+
"[VhyxUI] <Button iconOnly> requires an aria-label for accessibility. Screen reader users will not be able to identify this button."
|
|
33
|
+
);
|
|
34
|
+
const C = I(() => ({ ...b, id: o, ...n === "destructive" ? { safetyLevel: "high", destructive: !0, requiresConfirmation: !0 } : {}, ...u }), [n, o, u]), i = !!_ || s, S = [a.button, y].filter(Boolean).join(" "), m = {
|
|
35
|
+
id: o,
|
|
36
|
+
className: S,
|
|
37
|
+
"aria-busy": s ? !0 : void 0,
|
|
38
|
+
"aria-label": l,
|
|
39
|
+
"data-variant": n,
|
|
40
|
+
"data-size": h,
|
|
41
|
+
"data-loading": s ? !0 : void 0,
|
|
42
|
+
"data-icon-only": e ? !0 : void 0,
|
|
43
|
+
"data-disabled": i ? !0 : void 0,
|
|
44
|
+
"data-vhyx-contract": JSON.stringify(C),
|
|
45
|
+
...B
|
|
46
|
+
};
|
|
47
|
+
return v ? /* @__PURE__ */ r(j, { ref: f, "aria-disabled": i ? !0 : void 0, ...m, children: c }) : /* @__PURE__ */ w("button", { ref: f, disabled: i, ...m, children: [
|
|
48
|
+
s && /* @__PURE__ */ r(V, { size: "sm", variant: "white", "aria-hidden": "true", label: "", className: a.spinner }),
|
|
49
|
+
t && d === "left" && !e && /* @__PURE__ */ r("span", { className: a.icon, "aria-hidden": "true", children: t }),
|
|
50
|
+
e && t ? /* @__PURE__ */ r("span", { className: a.icon, "aria-hidden": "true", children: t }) : !e && /* @__PURE__ */ r("span", { className: a.content, children: c }),
|
|
51
|
+
t && d === "right" && !e && /* @__PURE__ */ r("span", { className: a.icon, "aria-hidden": "true", children: t })
|
|
52
|
+
] });
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
p.displayName = "VhyxButton";
|
|
56
|
+
const M = { ...b, id: "vhyxui-button" }, k = U(p, M);
|
|
57
|
+
k.displayName = "VhyxButton";
|
|
58
|
+
export {
|
|
59
|
+
k as B
|
|
60
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import i from "react";
|
|
3
|
+
import { cardContract as l } from "@vhyxui/core";
|
|
4
|
+
import { withAgentContract as N } from "@vhyxseal/react";
|
|
5
|
+
import { u as x } from "./useId-BGRmH6iF.js";
|
|
6
|
+
const b = "_card_wvqde_1", B = "_header_wvqde_35", j = "_body_wvqde_36", w = "_footer_wvqde_37", V = "_image_wvqde_102", d = {
|
|
7
|
+
card: b,
|
|
8
|
+
header: B,
|
|
9
|
+
body: j,
|
|
10
|
+
footer: w,
|
|
11
|
+
image: V
|
|
12
|
+
};
|
|
13
|
+
function q(a) {
|
|
14
|
+
return i.isValidElement(a) && (a.type === c || a.type === n || a.type === m || a.type === y);
|
|
15
|
+
}
|
|
16
|
+
const f = i.forwardRef(
|
|
17
|
+
({
|
|
18
|
+
variant: a = "default",
|
|
19
|
+
padding: e = "md",
|
|
20
|
+
interactive: o = !1,
|
|
21
|
+
contract: t,
|
|
22
|
+
className: C,
|
|
23
|
+
children: s,
|
|
24
|
+
...p
|
|
25
|
+
}, u) => {
|
|
26
|
+
const v = x("vhyx-card"), _ = {
|
|
27
|
+
...l,
|
|
28
|
+
id: v,
|
|
29
|
+
...t
|
|
30
|
+
}, h = [d.card, C].filter(Boolean).join(" "), g = i.Children.toArray(s).some(q) ? s : /* @__PURE__ */ r(n, { children: s });
|
|
31
|
+
return /* @__PURE__ */ r(
|
|
32
|
+
"div",
|
|
33
|
+
{
|
|
34
|
+
ref: u,
|
|
35
|
+
className: h,
|
|
36
|
+
"data-variant": a,
|
|
37
|
+
"data-padding": e,
|
|
38
|
+
"data-interactive": o ? !0 : void 0,
|
|
39
|
+
"data-vhyx-contract": JSON.stringify(_),
|
|
40
|
+
...p,
|
|
41
|
+
children: g
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
f.displayName = "VhyxCard";
|
|
47
|
+
function c({ children: a, className: e, ...o }) {
|
|
48
|
+
const t = [d.header, e].filter(Boolean).join(" ");
|
|
49
|
+
return /* @__PURE__ */ r("div", { className: t, ...o, children: a });
|
|
50
|
+
}
|
|
51
|
+
c.displayName = "VhyxCardHeader";
|
|
52
|
+
function n({ children: a, className: e, ...o }) {
|
|
53
|
+
const t = [d.body, e].filter(Boolean).join(" ");
|
|
54
|
+
return /* @__PURE__ */ r("div", { className: t, ...o, children: a });
|
|
55
|
+
}
|
|
56
|
+
n.displayName = "VhyxCardBody";
|
|
57
|
+
function m({ children: a, className: e, ...o }) {
|
|
58
|
+
const t = [d.footer, e].filter(Boolean).join(" ");
|
|
59
|
+
return /* @__PURE__ */ r("div", { className: t, ...o, children: a });
|
|
60
|
+
}
|
|
61
|
+
m.displayName = "VhyxCardFooter";
|
|
62
|
+
function y({ children: a, className: e, ...o }) {
|
|
63
|
+
const t = [d.image, e].filter(Boolean).join(" ");
|
|
64
|
+
return /* @__PURE__ */ r("div", { className: t, ...o, children: a });
|
|
65
|
+
}
|
|
66
|
+
y.displayName = "VhyxCardImage";
|
|
67
|
+
const I = { ...l, id: "vhyxui-card" }, S = Object.assign(
|
|
68
|
+
N(f, I),
|
|
69
|
+
{
|
|
70
|
+
Header: c,
|
|
71
|
+
Body: n,
|
|
72
|
+
Footer: m,
|
|
73
|
+
Image: y
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
S.displayName = "VhyxCard";
|
|
77
|
+
export {
|
|
78
|
+
S as C
|
|
79
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const r=require("react/jsx-runtime"),c=require("react"),C=require("@vhyxui/core"),g=require("@vhyxseal/react"),N=require("./useId-D2AEOm2G.cjs"),q="_card_wvqde_1",b="_header_wvqde_35",B="_body_wvqde_36",w="_footer_wvqde_37",V="_image_wvqde_102",s={card:q,header:b,body:B,footer:w,image:V};function I(e){return c.isValidElement(e)&&(e.type===i||e.type===n||e.type===y||e.type===l)}const m=c.forwardRef(({variant:e="default",padding:a="md",interactive:t=!1,contract:o,className:f,children:d,...v},x)=>{const _=N.useId("vhyx-card"),p={...C.cardContract,id:_,...o},h=[s.card,f].filter(Boolean).join(" "),j=c.Children.toArray(d).some(I)?d:r.jsx(n,{children:d});return r.jsx("div",{ref:x,className:h,"data-variant":e,"data-padding":a,"data-interactive":t?!0:void 0,"data-vhyx-contract":JSON.stringify(p),...v,children:j})});m.displayName="VhyxCard";function i({children:e,className:a,...t}){const o=[s.header,a].filter(Boolean).join(" ");return r.jsx("div",{className:o,...t,children:e})}i.displayName="VhyxCardHeader";function n({children:e,className:a,...t}){const o=[s.body,a].filter(Boolean).join(" ");return r.jsx("div",{className:o,...t,children:e})}n.displayName="VhyxCardBody";function y({children:e,className:a,...t}){const o=[s.footer,a].filter(Boolean).join(" ");return r.jsx("div",{className:o,...t,children:e})}y.displayName="VhyxCardFooter";function l({children:e,className:a,...t}){const o=[s.image,a].filter(Boolean).join(" ");return r.jsx("div",{className:o,...t,children:e})}l.displayName="VhyxCardImage";const S={...C.cardContract,id:"vhyxui-card"},u=Object.assign(g.withAgentContract(m,S),{Header:i,Body:n,Footer:y,Image:l});u.displayName="VhyxCard";exports.Card=u;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const l=require("react/jsx-runtime"),c=require("react"),e=c.forwardRef(({as:t="div",inline:n=!1,fullHeight:s=!1,style:i,...r},a)=>l.jsx(t,{ref:a,style:{display:n?"inline-flex":"flex",alignItems:"center",justifyContent:"center",...s?{minHeight:"100dvh"}:{},...i},...r}));e.displayName="VhyxCenter";exports.Center=e;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import f from "react";
|
|
3
|
+
const l = f.forwardRef(
|
|
4
|
+
({ as: e = "div", inline: t = !1, fullHeight: i = !1, style: n, ...r }, s) => /* @__PURE__ */ a(
|
|
5
|
+
e,
|
|
6
|
+
{
|
|
7
|
+
ref: s,
|
|
8
|
+
style: {
|
|
9
|
+
display: t ? "inline-flex" : "flex",
|
|
10
|
+
alignItems: "center",
|
|
11
|
+
justifyContent: "center",
|
|
12
|
+
...i ? { minHeight: "100dvh" } : {},
|
|
13
|
+
...n
|
|
14
|
+
},
|
|
15
|
+
...r
|
|
16
|
+
}
|
|
17
|
+
)
|
|
18
|
+
);
|
|
19
|
+
l.displayName = "VhyxCenter";
|
|
20
|
+
export {
|
|
21
|
+
l as C
|
|
22
|
+
};
|