@dimasbaguspm/versaur 0.0.19 → 0.0.21
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/README.md +22 -6
- package/dist/js/bottom-sheet-Eqduh3eY.js +495 -0
- package/dist/js/{selectable-multiple-input-CJXfqy1Z.js → bottom-sheet-input-DFGibm1I.js} +591 -476
- package/dist/js/forms/index.js +20 -17
- package/dist/js/{image-rectangle-CLU-GVtw.js → image-rectangle-C6cgL8R9.js} +354 -404
- package/dist/js/index.js +61 -53
- package/dist/js/layouts/index.js +5 -4
- package/dist/js/overlays/index.js +6 -4
- package/dist/js/primitive/index.js +15 -13
- package/dist/js/side-bar-BUACYQUo.js +397 -0
- package/dist/js/text-CRsIInRA.js +127 -0
- package/dist/js/tooltip-CDdl1U3A.js +148 -0
- package/dist/types/forms/bottom-sheet-input/bottom-sheet-input.d.ts +7 -0
- package/dist/types/forms/bottom-sheet-input/index.d.ts +2 -0
- package/dist/types/forms/bottom-sheet-input/types.d.ts +17 -0
- package/dist/types/forms/drawer-input/drawer-input.d.ts +6 -0
- package/dist/types/forms/drawer-input/index.d.ts +2 -0
- package/dist/types/forms/drawer-input/types.d.ts +18 -0
- package/dist/types/forms/index.d.ts +3 -0
- package/dist/types/forms/modal-input/index.d.ts +2 -0
- package/dist/types/forms/modal-input/modal-input.d.ts +6 -0
- package/dist/types/forms/modal-input/types.d.ts +18 -0
- package/dist/types/layouts/index.d.ts +1 -0
- package/dist/types/layouts/side-bar/index.d.ts +2 -0
- package/dist/types/layouts/side-bar/side-bar.atoms.d.ts +3 -0
- package/dist/types/layouts/side-bar/side-bar.d.ts +5 -0
- package/dist/types/layouts/side-bar/types.d.ts +42 -0
- package/dist/types/overlays/bottom-sheet/types.d.ts +2 -1
- package/dist/types/overlays/drawer/types.d.ts +2 -1
- package/dist/types/overlays/index.d.ts +1 -0
- package/dist/types/overlays/menu/menu.atoms.d.ts +5 -10
- package/dist/types/overlays/menu/menu.d.ts +2 -6
- package/dist/types/overlays/menu/types.d.ts +9 -14
- package/dist/types/overlays/menu/use-menu.d.ts +0 -1
- package/dist/types/overlays/modal/modal.d.ts +14 -5
- package/dist/types/overlays/modal/types.d.ts +7 -20
- package/dist/types/overlays/tooltip/index.d.ts +2 -0
- package/dist/types/overlays/tooltip/tooltip.d.ts +5 -0
- package/dist/types/overlays/tooltip/types.d.ts +33 -0
- package/dist/types/overlays/tooltip/use-tooltip-position.d.ts +8 -0
- package/dist/types/primitive/icon/types.d.ts +1 -1
- package/dist/types/primitive/index.d.ts +1 -0
- package/dist/types/primitive/no-results/index.d.ts +2 -0
- package/dist/types/primitive/no-results/no-results.d.ts +15 -0
- package/dist/types/primitive/no-results/types.d.ts +30 -0
- package/dist/types/primitive/table/table.atoms.d.ts +4 -6
- package/dist/types/primitive/table/table.d.ts +2 -1
- package/dist/types/primitive/table/types.d.ts +7 -4
- package/dist/utils/enforce-subpath-import.js +6 -0
- package/package.json +1 -1
- package/dist/js/bottom-sheet-BRv-oJL-.js +0 -646
- package/dist/js/form-layout-4ASWdXn8.js +0 -302
- package/dist/types/overlays/modal/use-escape-close.d.ts +0 -6
- package/dist/types/overlays/modal/use-focus-trap.d.ts +0 -6
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { c as u, j as b, a as y } from "./index-DOdDlCoL.js";
|
|
2
|
+
import { forwardRef as w } from "react";
|
|
3
|
+
const j = u("", {
|
|
4
|
+
variants: {
|
|
5
|
+
color: {
|
|
6
|
+
primary: "text-primary",
|
|
7
|
+
secondary: "text-secondary",
|
|
8
|
+
tertiary: "text-tertiary",
|
|
9
|
+
ghost: "text-ghost",
|
|
10
|
+
neutral: "text-ghost",
|
|
11
|
+
success: "text-success",
|
|
12
|
+
info: "text-info",
|
|
13
|
+
warning: "text-warning",
|
|
14
|
+
danger: "text-danger",
|
|
15
|
+
inherit: "",
|
|
16
|
+
gray: "text-gray-500",
|
|
17
|
+
black: "text-black",
|
|
18
|
+
white: "text-white"
|
|
19
|
+
},
|
|
20
|
+
hasUnderline: {
|
|
21
|
+
true: "underline",
|
|
22
|
+
false: ""
|
|
23
|
+
},
|
|
24
|
+
isCapitalize: {
|
|
25
|
+
true: "capitalize",
|
|
26
|
+
false: ""
|
|
27
|
+
},
|
|
28
|
+
align: {
|
|
29
|
+
left: "text-left",
|
|
30
|
+
center: "text-center",
|
|
31
|
+
right: "text-right",
|
|
32
|
+
justify: "text-justify"
|
|
33
|
+
},
|
|
34
|
+
italic: {
|
|
35
|
+
true: "italic",
|
|
36
|
+
false: ""
|
|
37
|
+
},
|
|
38
|
+
clamp: {
|
|
39
|
+
1: "line-clamp-1",
|
|
40
|
+
2: "line-clamp-2",
|
|
41
|
+
3: "line-clamp-3",
|
|
42
|
+
4: "line-clamp-4",
|
|
43
|
+
5: "line-clamp-5",
|
|
44
|
+
none: ""
|
|
45
|
+
},
|
|
46
|
+
ellipsis: {
|
|
47
|
+
true: "truncate",
|
|
48
|
+
false: ""
|
|
49
|
+
},
|
|
50
|
+
as: {
|
|
51
|
+
h1: "font-bold text-4xl leading-loose",
|
|
52
|
+
h2: "font-semibold text-3xl leading-relaxed",
|
|
53
|
+
h3: "font-medium text-2xl leading-relaxed",
|
|
54
|
+
h4: "font-bold text-xl leading-normal",
|
|
55
|
+
h5: "font-semibold text-lg leading-normal",
|
|
56
|
+
h6: "font-medium text-base leading-normal",
|
|
57
|
+
p: "font-normal text-base leading-normal",
|
|
58
|
+
span: "font-normal text-base leading-normal",
|
|
59
|
+
label: "font-normal text-xs leading-normal"
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
defaultVariants: {
|
|
63
|
+
color: "neutral",
|
|
64
|
+
hasUnderline: !1,
|
|
65
|
+
isCapitalize: !1,
|
|
66
|
+
align: "left",
|
|
67
|
+
italic: !1,
|
|
68
|
+
clamp: "none",
|
|
69
|
+
ellipsis: !1,
|
|
70
|
+
as: "span"
|
|
71
|
+
}
|
|
72
|
+
}), v = w(
|
|
73
|
+
({
|
|
74
|
+
as: e = "span",
|
|
75
|
+
color: l = "ghost",
|
|
76
|
+
hasUnderline: n = !1,
|
|
77
|
+
isCapitalize: s = !1,
|
|
78
|
+
align: i = "left",
|
|
79
|
+
italic: r = !1,
|
|
80
|
+
clamp: o = "none",
|
|
81
|
+
ellipsis: x = !1,
|
|
82
|
+
fontSize: t,
|
|
83
|
+
fontWeight: a,
|
|
84
|
+
className: c,
|
|
85
|
+
children: f,
|
|
86
|
+
...d
|
|
87
|
+
}, m) => {
|
|
88
|
+
const g = [
|
|
89
|
+
"h1",
|
|
90
|
+
"h2",
|
|
91
|
+
"h3",
|
|
92
|
+
"h4",
|
|
93
|
+
"h5",
|
|
94
|
+
"h6",
|
|
95
|
+
"p",
|
|
96
|
+
"span",
|
|
97
|
+
"label"
|
|
98
|
+
].includes(e) ? e : "span", h = t ? `text-${t}` : "", p = a ? `font-${a}` : "";
|
|
99
|
+
return /* @__PURE__ */ b.jsx(
|
|
100
|
+
e,
|
|
101
|
+
{
|
|
102
|
+
ref: m,
|
|
103
|
+
className: y(
|
|
104
|
+
j({
|
|
105
|
+
color: l,
|
|
106
|
+
hasUnderline: n,
|
|
107
|
+
isCapitalize: s,
|
|
108
|
+
align: i,
|
|
109
|
+
italic: r,
|
|
110
|
+
clamp: o,
|
|
111
|
+
ellipsis: x,
|
|
112
|
+
// @ts-expect-error - `as` is not a valid variant
|
|
113
|
+
as: g
|
|
114
|
+
}),
|
|
115
|
+
h,
|
|
116
|
+
p,
|
|
117
|
+
c
|
|
118
|
+
),
|
|
119
|
+
...d,
|
|
120
|
+
children: f
|
|
121
|
+
}
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
);
|
|
125
|
+
export {
|
|
126
|
+
v as T
|
|
127
|
+
};
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { c as h, j as u, a as b } from "./index-DOdDlCoL.js";
|
|
2
|
+
import { useEffect as m, useRef as c, useId as v, cloneElement as x, useState as g } from "react";
|
|
3
|
+
import { T as j } from "./text-CRsIInRA.js";
|
|
4
|
+
const I = h(
|
|
5
|
+
"absolute z-30 min-w-40 bg-background rounded-lg border border-border transition-all duration-200 ease-out will-change-transform",
|
|
6
|
+
{
|
|
7
|
+
variants: {
|
|
8
|
+
size: {
|
|
9
|
+
sm: "py-1.5 px-1",
|
|
10
|
+
md: "py-2 px-1"
|
|
11
|
+
},
|
|
12
|
+
open: {
|
|
13
|
+
true: "opacity-100 translate-y-1",
|
|
14
|
+
false: "opacity-0 pointer-events-none translate-y-3"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
defaultVariants: {
|
|
18
|
+
size: "md",
|
|
19
|
+
open: !1
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
function E(t, e, r, o) {
|
|
24
|
+
m(() => {
|
|
25
|
+
if (!t) return;
|
|
26
|
+
function n(s) {
|
|
27
|
+
!e.current?.contains(s.target) && !r.current?.contains(s.target) && o();
|
|
28
|
+
}
|
|
29
|
+
return document.addEventListener("mousedown", n), () => document.removeEventListener("mousedown", n);
|
|
30
|
+
}, [t, o, e, r]);
|
|
31
|
+
}
|
|
32
|
+
function M(t, e) {
|
|
33
|
+
m(() => {
|
|
34
|
+
if (t && e.current) {
|
|
35
|
+
const r = e.current.querySelectorAll('[role="menuitem"]');
|
|
36
|
+
r.length && r[0].focus();
|
|
37
|
+
}
|
|
38
|
+
}, [t, e]);
|
|
39
|
+
}
|
|
40
|
+
const F = ({
|
|
41
|
+
isOpen: t,
|
|
42
|
+
onOutsideClick: e,
|
|
43
|
+
size: r = "md",
|
|
44
|
+
content: o,
|
|
45
|
+
children: n
|
|
46
|
+
}) => {
|
|
47
|
+
const s = c(null), a = c(null), i = v();
|
|
48
|
+
return E(t, a, s, e), M(t, a), /* @__PURE__ */ u.jsxs("div", { className: "relative w-fit", children: [
|
|
49
|
+
x(n, {
|
|
50
|
+
// @ts-expect-error: ref is valid for button or forwardRef components
|
|
51
|
+
ref: s,
|
|
52
|
+
"aria-haspopup": "menu",
|
|
53
|
+
"aria-expanded": t,
|
|
54
|
+
"aria-controls": i,
|
|
55
|
+
tabIndex: 0
|
|
56
|
+
}),
|
|
57
|
+
/* @__PURE__ */ u.jsx(
|
|
58
|
+
"div",
|
|
59
|
+
{
|
|
60
|
+
id: i,
|
|
61
|
+
ref: a,
|
|
62
|
+
className: b(I({ size: r, open: t })),
|
|
63
|
+
role: "menu",
|
|
64
|
+
"aria-hidden": !t,
|
|
65
|
+
children: o
|
|
66
|
+
}
|
|
67
|
+
)
|
|
68
|
+
] });
|
|
69
|
+
};
|
|
70
|
+
function z(t = "auto") {
|
|
71
|
+
const e = c(null), [r, o] = g("bottom");
|
|
72
|
+
return m(() => {
|
|
73
|
+
if (!open || t !== "auto" || !e.current) {
|
|
74
|
+
o(t === "auto" ? "bottom" : t);
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
const n = e.current.getBoundingClientRect(), s = window.innerWidth, a = window.innerHeight, i = {
|
|
78
|
+
top: n.top,
|
|
79
|
+
bottom: a - n.bottom,
|
|
80
|
+
left: n.left,
|
|
81
|
+
right: s - n.right
|
|
82
|
+
};
|
|
83
|
+
i.bottom > 64 ? o("bottom") : i.top > 64 ? o("top") : i.right > 128 ? o("right") : o("left");
|
|
84
|
+
}, [t, e]), { position: r, ref: e };
|
|
85
|
+
}
|
|
86
|
+
const P = h(
|
|
87
|
+
"absolute z-50 px-2 py-1 rounded bg-neutral pointer-events-auto transition-opacity duration-150 min-w-[max-content] max-w-sm whitespace-pre-line",
|
|
88
|
+
{
|
|
89
|
+
variants: {
|
|
90
|
+
position: {
|
|
91
|
+
top: "bottom-full left-1/2 -translate-x-1/2 mb-2",
|
|
92
|
+
bottom: "top-full left-1/2 -translate-x-1/2 mt-2",
|
|
93
|
+
left: "right-full top-1/2 -translate-y-1/2 mr-2",
|
|
94
|
+
right: "left-full top-1/2 -translate-y-1/2 ml-2",
|
|
95
|
+
auto: "top-full left-1/2 -translate-x-1/2 mt-2"
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
defaultVariants: {
|
|
99
|
+
position: "auto"
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
), L = ({
|
|
103
|
+
children: t,
|
|
104
|
+
content: e,
|
|
105
|
+
position: r = "auto",
|
|
106
|
+
popoverClassName: o,
|
|
107
|
+
delay: n,
|
|
108
|
+
...s
|
|
109
|
+
}) => {
|
|
110
|
+
const a = v(), [i, d] = g(!1), l = c(null), p = () => {
|
|
111
|
+
n ? l.current = setTimeout(() => d(!0), n) : d(!0);
|
|
112
|
+
}, f = () => {
|
|
113
|
+
l.current && clearTimeout(l.current), d(!1);
|
|
114
|
+
};
|
|
115
|
+
m(() => () => {
|
|
116
|
+
l.current && clearTimeout(l.current);
|
|
117
|
+
}, []);
|
|
118
|
+
const w = {
|
|
119
|
+
tabIndex: 0,
|
|
120
|
+
"aria-describedby": a,
|
|
121
|
+
onMouseEnter: p,
|
|
122
|
+
onFocus: p,
|
|
123
|
+
onMouseLeave: f,
|
|
124
|
+
onBlur: f,
|
|
125
|
+
...s
|
|
126
|
+
}, { ref: y, position: T } = z(r);
|
|
127
|
+
return /* @__PURE__ */ u.jsxs("div", { className: "relative w-fit", ref: y, children: [
|
|
128
|
+
x(t, w),
|
|
129
|
+
/* @__PURE__ */ u.jsx(
|
|
130
|
+
"div",
|
|
131
|
+
{
|
|
132
|
+
id: a,
|
|
133
|
+
className: b(
|
|
134
|
+
P({ position: T }),
|
|
135
|
+
o,
|
|
136
|
+
!i && "opacity-0 pointer-events-none"
|
|
137
|
+
),
|
|
138
|
+
role: "tooltip",
|
|
139
|
+
"aria-hidden": !i,
|
|
140
|
+
children: /* @__PURE__ */ u.jsx(j, { as: "p", fontSize: "xs", fontWeight: "normal", color: "black", children: e })
|
|
141
|
+
}
|
|
142
|
+
)
|
|
143
|
+
] });
|
|
144
|
+
};
|
|
145
|
+
export {
|
|
146
|
+
F as M,
|
|
147
|
+
L as T
|
|
148
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BottomSheetInputProps } from './types';
|
|
2
|
+
export declare const BottomSheetInput: import('react').ForwardRefExoticComponent<BottomSheetInputProps & import('react').RefAttributes<HTMLInputElement>> & {
|
|
3
|
+
Header: import('react').ForwardRefExoticComponent<import('../..').BottomSheetHeaderProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
4
|
+
Body: import('react').ForwardRefExoticComponent<import('../..').BottomSheetBodyProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
5
|
+
Footer: import('react').ForwardRefExoticComponent<import('../..').BottomSheetFooterProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
6
|
+
Title: import('react').ForwardRefExoticComponent<import('../..').BottomSheetTitleProps & import('react').RefAttributes<HTMLHeadingElement>>;
|
|
7
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { TextInputProps } from '../text-input/types';
|
|
2
|
+
import { ChangeEventHandler, InputHTMLAttributes, ReactNode } from 'react';
|
|
3
|
+
export interface BottomSheetInputContextValue {
|
|
4
|
+
isOpen: boolean;
|
|
5
|
+
setIsOpen: (open: boolean) => void;
|
|
6
|
+
onChange?: ChangeEventHandler<HTMLInputElement>;
|
|
7
|
+
value: InputHTMLAttributes<HTMLInputElement>['value'];
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* BottomSheetInputProps extends TextInputProps, but input is always readOnly
|
|
11
|
+
* @property {boolean} open - BottomSheet open state (controlled)
|
|
12
|
+
* @property {(open: boolean) => void} onOpenChange - Callback for sheet open state change
|
|
13
|
+
* @property {React.ReactNode} children - BottomSheet content
|
|
14
|
+
*/
|
|
15
|
+
export interface BottomSheetInputProps extends Omit<TextInputProps, 'readOnly' | 'children'> {
|
|
16
|
+
children: (ctx: BottomSheetInputContextValue) => ReactNode;
|
|
17
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DrawerInputProps } from './types';
|
|
2
|
+
export declare const DrawerInput: import('react').ForwardRefExoticComponent<DrawerInputProps & import('react').RefAttributes<HTMLInputElement>> & {
|
|
3
|
+
Header: import('react').ForwardRefExoticComponent<import('../..').DrawerHeaderProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
4
|
+
Body: import('react').ForwardRefExoticComponent<import('../..').DrawerBodyProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
5
|
+
Footer: import('react').ForwardRefExoticComponent<import('../..').DrawerFooterProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
6
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { DrawerProps } from '../../overlays/drawer/types';
|
|
2
|
+
import { TextInputProps } from '../text-input/types';
|
|
3
|
+
import { ChangeEventHandler, InputHTMLAttributes, ReactNode } from 'react';
|
|
4
|
+
export interface DrawerInputContextValue {
|
|
5
|
+
isOpen: boolean;
|
|
6
|
+
setIsOpen: (open: boolean) => void;
|
|
7
|
+
onChange?: ChangeEventHandler<HTMLInputElement>;
|
|
8
|
+
value: InputHTMLAttributes<HTMLInputElement>['value'];
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* DrawerInputProps extends TextInputProps, but input is always readOnly
|
|
12
|
+
* @property {boolean} open - Drawer open state (controlled)
|
|
13
|
+
* @property {(open: boolean) => void} onOpenChange - Callback for drawer open state change
|
|
14
|
+
* @property {React.ReactNode} children - Drawer content
|
|
15
|
+
*/
|
|
16
|
+
export interface DrawerInputProps extends Omit<TextInputProps, 'readOnly' | 'children'>, Pick<DrawerProps, 'size' | 'position'> {
|
|
17
|
+
children: (ctx: DrawerInputContextValue) => ReactNode;
|
|
18
|
+
}
|
|
@@ -15,3 +15,6 @@ export * from './price-input';
|
|
|
15
15
|
export * from './email-input';
|
|
16
16
|
export * from './selectable-single-input';
|
|
17
17
|
export * from './selectable-multiple-input';
|
|
18
|
+
export * from './modal-input';
|
|
19
|
+
export * from './drawer-input';
|
|
20
|
+
export * from './bottom-sheet-input';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ModalInputProps } from './types';
|
|
2
|
+
export declare const ModalInput: import('react').ForwardRefExoticComponent<ModalInputProps & import('react').RefAttributes<HTMLInputElement>> & {
|
|
3
|
+
Header: import('react').ForwardRefExoticComponent<import('../..').ModalHeaderProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
4
|
+
Body: import('react').ForwardRefExoticComponent<import('../..').ModalBodyProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
5
|
+
Footer: import('react').ForwardRefExoticComponent<import('../..').ModalFooterProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
6
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ModalRootProps } from '../../overlays';
|
|
2
|
+
import { TextInputProps } from '../text-input/types';
|
|
3
|
+
import { ChangeEventHandler, InputHTMLAttributes, ReactNode } from 'react';
|
|
4
|
+
export interface ModalInputContextValue {
|
|
5
|
+
isOpen: boolean;
|
|
6
|
+
setIsOpen: (open: boolean) => void;
|
|
7
|
+
onChange?: ChangeEventHandler<HTMLInputElement>;
|
|
8
|
+
value: InputHTMLAttributes<HTMLInputElement>['value'];
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* ModalInputProps extends TextInputProps, but input is always readOnly
|
|
12
|
+
* @property {boolean} open - Modal open state (controlled)
|
|
13
|
+
* @property {(open: boolean) => void} onOpenChange - Callback for modal open state change
|
|
14
|
+
* @property {React.ReactNode} children - Modal content
|
|
15
|
+
*/
|
|
16
|
+
export interface ModalInputProps extends Omit<TextInputProps, 'readOnly' | 'children'>, Pick<ModalRootProps, 'size' | 'placement'> {
|
|
17
|
+
children: (ctx: ModalInputContextValue) => ReactNode;
|
|
18
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { SideBarItemProps, SideBarGroupProps } from './types';
|
|
2
|
+
export declare const SideBarItem: import('react').ForwardRefExoticComponent<SideBarItemProps & import('react').RefAttributes<HTMLElement>>;
|
|
3
|
+
export declare const SideBarGroup: import('react').ForwardRefExoticComponent<SideBarGroupProps & import('react').RefAttributes<HTMLLIElement>>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { SideBarProps } from './types';
|
|
2
|
+
export declare const SideBar: import('react').ForwardRefExoticComponent<SideBarProps & import('react').RefAttributes<HTMLElement>> & {
|
|
3
|
+
Item: import('react').ForwardRefExoticComponent<import('./types').SideBarItemProps & import('react').RefAttributes<HTMLElement>>;
|
|
4
|
+
Group: import('react').ForwardRefExoticComponent<import('./types').SideBarGroupProps & import('react').RefAttributes<HTMLLIElement>>;
|
|
5
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { HTMLAttributes, AnchorHTMLAttributes, ReactNode, ButtonHTMLAttributes } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Props for the SideBar root component
|
|
4
|
+
*/
|
|
5
|
+
export interface SideBarProps extends HTMLAttributes<HTMLElement> {
|
|
6
|
+
/**
|
|
7
|
+
* Children nodes (MenuList, etc)
|
|
8
|
+
*/
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
interface SideBarItemBaseAsAnchor extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
12
|
+
active?: boolean;
|
|
13
|
+
icon: ReactNode;
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
onClick?: never;
|
|
16
|
+
href: AnchorHTMLAttributes<HTMLAnchorElement>['href'];
|
|
17
|
+
}
|
|
18
|
+
interface SideBarItemBaseAsButton extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
19
|
+
active?: boolean;
|
|
20
|
+
icon?: ReactNode;
|
|
21
|
+
children: ReactNode;
|
|
22
|
+
onClick?: ButtonHTMLAttributes<HTMLButtonElement>['onClick'];
|
|
23
|
+
href?: never;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Props for the SideBar.Item component (polymorphic: anchor or button)
|
|
27
|
+
*/
|
|
28
|
+
export type SideBarItemProps = SideBarItemBaseAsAnchor | SideBarItemBaseAsButton;
|
|
29
|
+
/**
|
|
30
|
+
* Props for the SideBar.Group component
|
|
31
|
+
*/
|
|
32
|
+
export interface SideBarGroupProps extends HTMLAttributes<HTMLLIElement> {
|
|
33
|
+
/**
|
|
34
|
+
* Label for the group
|
|
35
|
+
*/
|
|
36
|
+
label: ReactNode;
|
|
37
|
+
/**
|
|
38
|
+
* Children (SideBar.Item)
|
|
39
|
+
*/
|
|
40
|
+
children: ReactNode;
|
|
41
|
+
}
|
|
42
|
+
export {};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { OverlayPortalProps } from '../../utils/overlay-portal';
|
|
1
2
|
import { HTMLAttributes } from 'react';
|
|
2
3
|
/**
|
|
3
4
|
* Props for BottomSheetRoot (main component)
|
|
4
5
|
*/
|
|
5
|
-
export interface BottomSheetProps extends HTMLAttributes<HTMLDivElement
|
|
6
|
+
export interface BottomSheetProps extends HTMLAttributes<HTMLDivElement>, OverlayPortalProps {
|
|
6
7
|
/**
|
|
7
8
|
* Controls open state (controlled only)
|
|
8
9
|
*/
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ComponentPropsWithoutRef, HTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
import { VariantProps } from '../../utils/variants';
|
|
3
3
|
import { drawerVariants } from './helpers';
|
|
4
|
+
import { OverlayPortalProps } from '../../utils/overlay-portal';
|
|
4
5
|
/**
|
|
5
6
|
* Drawer transition type options
|
|
6
7
|
*/
|
|
@@ -41,7 +42,7 @@ export interface DrawerContextValue {
|
|
|
41
42
|
/**
|
|
42
43
|
* Props for the Drawer component (controlled component)
|
|
43
44
|
*/
|
|
44
|
-
export interface DrawerProps extends ComponentPropsWithoutRef<'div'
|
|
45
|
+
export interface DrawerProps extends ComponentPropsWithoutRef<'div'>, OverlayPortalProps {
|
|
45
46
|
/** Whether the drawer is open (required - controlled component) */
|
|
46
47
|
isOpen: boolean;
|
|
47
48
|
/** Callback when the drawer should close */
|
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { MenuTriggerProps, MenuContentProps, MenuItemProps } from './types';
|
|
1
|
+
import { MenuContentProps, MenuItemProps } from './types';
|
|
3
2
|
/**
|
|
4
|
-
*
|
|
3
|
+
* MenuContent: Wraps menu items
|
|
5
4
|
*/
|
|
6
|
-
export declare const
|
|
5
|
+
export declare const MenuContent: import('react').ForwardRefExoticComponent<MenuContentProps & import('react').RefAttributes<HTMLUListElement>>;
|
|
7
6
|
/**
|
|
8
|
-
*
|
|
7
|
+
* MenuItem: Single menu item
|
|
9
8
|
*/
|
|
10
|
-
export declare const
|
|
11
|
-
/**
|
|
12
|
-
* MenuItem: Single menu option
|
|
13
|
-
*/
|
|
14
|
-
export declare const MenuItem: React.ForwardRefExoticComponent<MenuItemProps & React.RefAttributes<HTMLButtonElement>>;
|
|
9
|
+
export declare const MenuItem: import('react').ForwardRefExoticComponent<MenuItemProps & import('react').RefAttributes<HTMLLIElement>>;
|
|
@@ -1,7 +1,3 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
export declare const Menu: React.FC<
|
|
4
|
-
Trigger: React.ForwardRefExoticComponent<import('./types').MenuTriggerProps & React.RefAttributes<HTMLSpanElement>>;
|
|
5
|
-
Content: React.ForwardRefExoticComponent<import('./types').MenuContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
-
Item: React.ForwardRefExoticComponent<import('./types').MenuItemProps & React.RefAttributes<HTMLButtonElement>>;
|
|
7
|
-
};
|
|
2
|
+
import { MenuProps } from './types';
|
|
3
|
+
export declare const Menu: React.FC<MenuProps>;
|
|
@@ -1,29 +1,24 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ButtonHTMLAttributes, HTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
export type MenuSize = 'sm' | 'md';
|
|
3
3
|
/**
|
|
4
|
-
* Props for
|
|
4
|
+
* Props for Menu
|
|
5
5
|
*/
|
|
6
|
-
export interface
|
|
7
|
-
/**
|
|
8
|
-
children: ReactNode;
|
|
9
|
-
/** open state */
|
|
6
|
+
export interface MenuProps {
|
|
7
|
+
/** Whether the menu is open (controlled externally) */
|
|
10
8
|
isOpen: boolean;
|
|
11
|
-
/** Callback when
|
|
9
|
+
/** Callback when clicking outside menu */
|
|
12
10
|
onOutsideClick: () => void;
|
|
13
11
|
/** Menu size variant */
|
|
14
12
|
size?: MenuSize;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
*/
|
|
19
|
-
export interface MenuTriggerProps extends HTMLAttributes<HTMLSpanElement> {
|
|
20
|
-
/** Trigger content */
|
|
13
|
+
/** Menu content (MenuContent/MenuItem) */
|
|
14
|
+
content: ReactNode;
|
|
15
|
+
/** Trigger element */
|
|
21
16
|
children: ReactNode;
|
|
22
17
|
}
|
|
23
18
|
/**
|
|
24
19
|
* Props for MenuContent
|
|
25
20
|
*/
|
|
26
|
-
export interface MenuContentProps extends HTMLAttributes<
|
|
21
|
+
export interface MenuContentProps extends HTMLAttributes<HTMLUListElement> {
|
|
27
22
|
/** Menu items */
|
|
28
23
|
children: ReactNode;
|
|
29
24
|
}
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
export declare function useMenuOutsideClick(isOpen: boolean, contentRef: React.RefObject<HTMLDivElement | null>, triggerRef: React.RefObject<HTMLButtonElement | null>, onOutsideClick: () => void): void;
|
|
2
2
|
export declare function useMenuFocusFirstItem(isOpen: boolean, contentRef: React.RefObject<HTMLDivElement | null>): void;
|
|
3
|
-
export declare function useMenuKeyboardNavigation(isOpen: boolean, contentRef: React.RefObject<HTMLDivElement | null>, triggerRef: React.RefObject<HTMLButtonElement | null>, onOutsideClick: () => void): void;
|
|
@@ -1,7 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { default as React } from 'react';
|
|
2
2
|
import { ModalRootProps } from './types';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
/**
|
|
4
|
+
* ModalRoot - A controlled modal overlay component
|
|
5
|
+
* Provides shared state and context for modal compound parts
|
|
6
|
+
*/
|
|
7
|
+
export declare const ModalRoot: React.FC<ModalRootProps>;
|
|
8
|
+
/**
|
|
9
|
+
* Modal - Compound component with sub-components attached
|
|
10
|
+
* Provides a convenient API for using the modal with all its parts
|
|
11
|
+
*/
|
|
12
|
+
export declare const Modal: React.FC<ModalRootProps> & {
|
|
13
|
+
Header: React.ForwardRefExoticComponent<import('./types').ModalHeaderProps & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
+
Body: React.ForwardRefExoticComponent<import('./types').ModalBodyProps & React.RefAttributes<HTMLDivElement>>;
|
|
15
|
+
Footer: React.ForwardRefExoticComponent<import('./types').ModalFooterProps & React.RefAttributes<HTMLDivElement>>;
|
|
7
16
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OverlayPortalProps } from '../../utils/overlay-portal';
|
|
2
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
3
|
/**
|
|
3
4
|
* Modal component prop types
|
|
4
5
|
*/
|
|
@@ -7,27 +8,17 @@ export type ModalPlacement = 'top' | 'center';
|
|
|
7
8
|
/**
|
|
8
9
|
* Modal compound root
|
|
9
10
|
*/
|
|
10
|
-
export interface ModalRootProps {
|
|
11
|
+
export interface ModalRootProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'>, OverlayPortalProps {
|
|
11
12
|
/** Controls whether the modal is open */
|
|
12
13
|
isOpen: boolean;
|
|
13
|
-
/**
|
|
14
|
-
|
|
14
|
+
/** Function to close the modal */
|
|
15
|
+
onClose: () => void;
|
|
15
16
|
/** Modal size variant */
|
|
16
17
|
size?: ModalSize;
|
|
17
18
|
/** Modal placement variant */
|
|
18
19
|
placement?: ModalPlacement;
|
|
19
20
|
/** Children (Modal compound parts) */
|
|
20
|
-
children:
|
|
21
|
-
/** Optional: disables closing on overlay click */
|
|
22
|
-
disableOverlayClose?: boolean;
|
|
23
|
-
/** Optional: disables closing on ESC key */
|
|
24
|
-
disableEscClose?: boolean;
|
|
25
|
-
/** Optional: ARIA label for dialog */
|
|
26
|
-
'aria-label'?: string;
|
|
27
|
-
/** Optional: ARIA labelledby for dialog */
|
|
28
|
-
'aria-labelledby'?: string;
|
|
29
|
-
/** Optional: ARIA describedby for dialog */
|
|
30
|
-
'aria-describedby'?: string;
|
|
21
|
+
children: ReactNode;
|
|
31
22
|
}
|
|
32
23
|
/**
|
|
33
24
|
* Props for Modal.Header, Modal.Footer
|
|
@@ -41,8 +32,4 @@ export interface ModalFooterProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
41
32
|
export interface ModalBodyProps extends HTMLAttributes<HTMLDivElement> {
|
|
42
33
|
children: React.ReactNode;
|
|
43
34
|
}
|
|
44
|
-
export
|
|
45
|
-
children: React.ReactNode;
|
|
46
|
-
placement?: string;
|
|
47
|
-
onOverlayClick?: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
48
|
-
}
|
|
35
|
+
export type ModalOverlayProps = Omit<HTMLAttributes<HTMLDivElement>, 'children'>;
|