@dimasbaguspm/versaur 0.0.16 → 0.0.18
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/{js → assets}/styles.css +37 -0
- package/dist/js/bottom-sheet-BRv-oJL-.js +646 -0
- package/dist/js/description-list-DZQF212Z.js +1786 -0
- package/dist/js/email-input-BIbrfs5q.js +1731 -0
- package/dist/js/forms/index.js +16 -16
- package/dist/js/index.js +44 -41
- package/dist/js/overlays/index.js +3 -4
- package/dist/js/primitive/index.js +12 -11
- package/dist/js/providers/index.js +5 -0
- package/dist/js/snackbar-DH8jCh2V.js +50 -0
- package/dist/js/use-snackbars-oPoF7J5t.js +94 -0
- package/dist/types/feedbacks/loading-indicator/index.d.ts +2 -1
- package/dist/types/forms/chip-multiple-input/chip-multiple-input.atoms.d.ts +10 -0
- package/dist/types/forms/chip-multiple-input/chip-multiple-input.d.ts +5 -0
- package/dist/types/forms/chip-multiple-input/index.d.ts +2 -0
- package/dist/types/forms/{chip-input → chip-multiple-input}/types.d.ts +16 -4
- package/dist/types/forms/chip-single-input/chip-single-input.atoms.d.ts +10 -0
- package/dist/types/forms/chip-single-input/chip-single-input.d.ts +5 -0
- package/dist/types/forms/chip-single-input/index.d.ts +2 -0
- package/dist/types/forms/chip-single-input/types.d.ts +67 -0
- package/dist/types/forms/date-single-picker-input/date-single-picker-input.d.ts +1 -8
- package/dist/types/forms/date-single-picker-input/index.d.ts +1 -1
- package/dist/types/forms/date-single-picker-input/types.d.ts +12 -66
- package/dist/types/forms/email-input/email-input.d.ts +8 -0
- package/dist/types/forms/email-input/index.d.ts +2 -0
- package/dist/types/forms/email-input/types.d.ts +6 -0
- package/dist/types/forms/index.d.ts +5 -2
- package/dist/types/forms/price-input/index.d.ts +2 -0
- package/dist/types/forms/price-input/price-input.d.ts +6 -0
- package/dist/types/forms/price-input/types.d.ts +15 -0
- package/dist/types/forms/price-input/use-price-input.d.ts +6 -0
- package/dist/types/forms/search-input/index.d.ts +2 -0
- package/dist/types/forms/search-input/search-input.d.ts +8 -0
- package/dist/types/forms/search-input/types.d.ts +35 -0
- package/dist/types/forms/segment-multiple-input/types.d.ts +1 -5
- package/dist/types/forms/segment-single-input/types.d.ts +1 -5
- package/dist/types/forms/switch-input/index.d.ts +2 -3
- package/dist/types/forms/time-picker-input/time-picker-input.d.ts +4 -4
- package/dist/types/forms/time-picker-input/types.d.ts +2 -38
- package/dist/types/index.d.ts +1 -0
- package/dist/types/layouts/page-layout/index.d.ts +2 -1
- package/dist/types/overlays/menu/index.d.ts +2 -2
- package/dist/types/overlays/modal/types.d.ts +1 -1
- package/dist/types/primitive/anchor/types.d.ts +8 -2
- package/dist/types/primitive/description-list/description-list.atoms.d.ts +13 -0
- package/dist/types/primitive/description-list/description-list.d.ts +6 -0
- package/dist/types/primitive/description-list/index.d.ts +2 -0
- package/dist/types/primitive/description-list/types.d.ts +46 -0
- package/dist/types/primitive/index.d.ts +1 -0
- package/dist/types/providers/index.d.ts +1 -0
- package/dist/types/providers/snackbars-provider/index.d.ts +3 -0
- package/dist/types/providers/snackbars-provider/provider.d.ts +7 -0
- package/dist/types/providers/snackbars-provider/types.d.ts +28 -0
- package/dist/types/providers/snackbars-provider/use-snackbars-queue.d.ts +9 -0
- package/dist/types/providers/snackbars-provider/use-snackbars.d.ts +4 -0
- package/dist/{js → utils}/enforce-subpath-import.js +61 -51
- package/package.json +8 -4
- package/dist/js/bottom-sheet-Difan0U1.js +0 -340
- package/dist/js/calendar-CUjVZ7Ap.js +0 -811
- package/dist/js/menu-Bm-yPIMN.js +0 -310
- package/dist/js/switch-input-Bx6_2zG9.js +0 -2035
- package/dist/js/tile-BjhJ5Mvl.js +0 -939
- package/dist/types/forms/calculator-input/calculator-input.atoms.d.ts +0 -11
- package/dist/types/forms/calculator-input/calculator-input.d.ts +0 -8
- package/dist/types/forms/calculator-input/index.d.ts +0 -1
- package/dist/types/forms/calculator-input/types.d.ts +0 -51
- package/dist/types/forms/chip-input/chip-input.atoms.d.ts +0 -10
- package/dist/types/forms/chip-input/chip-input.d.ts +0 -5
- package/dist/types/forms/chip-input/index.d.ts +0 -2
- package/dist/types/forms/date-range-picker-input/date-range-picker-input.d.ts +0 -10
- package/dist/types/forms/date-range-picker-input/index.d.ts +0 -2
- package/dist/types/forms/date-range-picker-input/types.d.ts +0 -64
- package/dist/types/forms/date-range-picker-input/use-date-range-picker.d.ts +0 -13
- package/dist/types/forms/date-single-picker-input/date-single-picker-input.atoms.d.ts +0 -13
- package/dist/types/forms/date-single-picker-input/date-single-picker-input.docked.d.ts +0 -14
- package/dist/types/forms/date-single-picker-input/date-single-picker-input.modal.d.ts +0 -15
- package/dist/types/forms/date-single-picker-input/use-date-single-picker.d.ts +0 -10
- package/dist/types/forms/time-picker-input/time-picker-input.atoms.d.ts +0 -15
package/dist/js/forms/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { C as
|
|
1
|
+
import { C as a, b as n, a as p, D as u, E as s, P as I, R as i, d as l, c as S, S as c, e as r, h as g, f as h, T as m, g as o } from "../email-input-BIbrfs5q.js";
|
|
2
2
|
export {
|
|
3
|
-
|
|
4
|
-
n as
|
|
5
|
-
p as
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
S as
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
3
|
+
a as CheckboxInput,
|
|
4
|
+
n as ChipMultipleInput,
|
|
5
|
+
p as ChipSingleInput,
|
|
6
|
+
u as DateSinglePickerInput,
|
|
7
|
+
s as EmailInput,
|
|
8
|
+
I as PriceInput,
|
|
9
|
+
i as RadioInput,
|
|
10
|
+
l as SearchInput,
|
|
11
|
+
S as SegmentMultipleInput,
|
|
12
|
+
c as SegmentSingleInput,
|
|
13
|
+
r as SelectInput,
|
|
14
|
+
g as SwitchInput,
|
|
15
|
+
h as TextAreaInput,
|
|
16
|
+
m as TextInput,
|
|
17
|
+
o as TimePickerInput
|
|
18
18
|
};
|
package/dist/js/index.js
CHANGED
|
@@ -1,54 +1,57 @@
|
|
|
1
|
-
import { L as
|
|
2
|
-
import { A as n, B as p, F as u, P as
|
|
3
|
-
import { C as
|
|
4
|
-
import { B as L, D } from "./bottom-sheet-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { B as O, a as Q, C as U, b as V, I as W, T as X } from "./calendar-CUjVZ7Ap.js";
|
|
1
|
+
import { L as t, P as e, S as r } from "./skeleton-BNZyaRjo.js";
|
|
2
|
+
import { A as n, B as p, F as u, P as i, T as c } from "./form-layout-4ASWdXn8.js";
|
|
3
|
+
import { C as l, b as S, a as m, D as B, E as d, P as x, R as T, d as g, c as f, S as b, e as h, h as P, f as k, T as A, g as C } from "./email-input-BIbrfs5q.js";
|
|
4
|
+
import { B as L, D as M, M as F, a as v } from "./bottom-sheet-BRv-oJL-.js";
|
|
5
|
+
import { A as y, a as E, b as R, B as j, c as q, d as z, e as G, f as H, C as J, g as K, D as N, I as O, T as Q, h as U, i as V } from "./description-list-DZQF212Z.js";
|
|
6
|
+
import { S as X } from "./snackbar-DH8jCh2V.js";
|
|
8
7
|
import { B as Z, T as _ } from "./tabs-BbOkYchB.js";
|
|
8
|
+
import { S as aa, u as sa } from "./use-snackbars-oPoF7J5t.js";
|
|
9
9
|
export {
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
y as Alert,
|
|
11
|
+
E as Anchor,
|
|
12
12
|
n as AppBar,
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
R as Avatar,
|
|
14
|
+
j as Badge,
|
|
15
15
|
p as BottomBar,
|
|
16
16
|
L as BottomSheet,
|
|
17
|
-
|
|
17
|
+
q as Brand,
|
|
18
18
|
Z as Breadcrumbs,
|
|
19
|
-
|
|
19
|
+
z as Button,
|
|
20
20
|
G as ButtonFloat,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
21
|
+
H as ButtonIcon,
|
|
22
|
+
J as Calculator,
|
|
23
|
+
K as Calendar,
|
|
24
|
+
l as CheckboxInput,
|
|
25
|
+
S as ChipMultipleInput,
|
|
26
|
+
m as ChipSingleInput,
|
|
27
|
+
B as DateSinglePickerInput,
|
|
28
|
+
N as DescriptionList,
|
|
29
|
+
M as Drawer,
|
|
30
|
+
d as EmailInput,
|
|
29
31
|
u as FormLayout,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
+
O as Icon,
|
|
33
|
+
t as LoadingIndicator,
|
|
32
34
|
F as Menu,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
+
v as Modal,
|
|
36
|
+
i as PageLayout,
|
|
37
|
+
x as PriceInput,
|
|
35
38
|
e as ProgressIndicator,
|
|
36
39
|
T as RadioInput,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
b as
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
J as Table,
|
|
40
|
+
g as SearchInput,
|
|
41
|
+
f as SegmentMultipleInput,
|
|
42
|
+
b as SegmentSingleInput,
|
|
43
|
+
h as SelectInput,
|
|
44
|
+
r as Skeleton,
|
|
45
|
+
X as Snackbar,
|
|
46
|
+
aa as SnackbarsProvider,
|
|
47
|
+
P as SwitchInput,
|
|
48
|
+
Q as Table,
|
|
47
49
|
_ as Tabs,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
50
|
+
U as Text,
|
|
51
|
+
k as TextAreaInput,
|
|
52
|
+
A as TextInput,
|
|
53
|
+
V as Tile,
|
|
54
|
+
C as TimePickerInput,
|
|
55
|
+
c as TopBar,
|
|
56
|
+
sa as useSnackbars
|
|
54
57
|
};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { B as
|
|
2
|
-
import { M as s, a as m } from "../menu-Bm-yPIMN.js";
|
|
1
|
+
import { B as o, D as r, M as s, a as t } from "../bottom-sheet-BRv-oJL-.js";
|
|
3
2
|
export {
|
|
4
|
-
|
|
3
|
+
o as BottomSheet,
|
|
5
4
|
r as Drawer,
|
|
6
5
|
s as Menu,
|
|
7
|
-
|
|
6
|
+
t as Modal
|
|
8
7
|
};
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import { A as t, a as o, b as r, B as e, c as n, d as l,
|
|
2
|
-
import {
|
|
1
|
+
import { A as t, a as o, b as r, B as e, c as n, d as c, e as l, f as B, C as i, g as d, D as u, I as A, T, h as b, i as f } from "../description-list-DZQF212Z.js";
|
|
2
|
+
import { S as x } from "../snackbar-DH8jCh2V.js";
|
|
3
3
|
export {
|
|
4
4
|
t as Alert,
|
|
5
5
|
o as Anchor,
|
|
6
6
|
r as Avatar,
|
|
7
7
|
e as Badge,
|
|
8
8
|
n as Brand,
|
|
9
|
-
|
|
9
|
+
c as Button,
|
|
10
10
|
l as ButtonFloat,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
B as ButtonIcon,
|
|
12
|
+
i as Calculator,
|
|
13
|
+
d as Calendar,
|
|
14
|
+
u as DescriptionList,
|
|
15
|
+
A as Icon,
|
|
16
|
+
x as Snackbar,
|
|
17
|
+
T as Table,
|
|
18
|
+
b as Text,
|
|
19
|
+
f as Tile
|
|
19
20
|
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { c, j as r, a as d } from "./index-DOdDlCoL.js";
|
|
2
|
+
import { forwardRef as i } from "react";
|
|
3
|
+
const l = c(
|
|
4
|
+
"flex items-center gap-2 px-4 py-2 rounded-sm w-auto mx-4 sm:mx-0 sm:w-fit relative shadow-sm",
|
|
5
|
+
{
|
|
6
|
+
variants: {
|
|
7
|
+
color: {
|
|
8
|
+
success: "text-success-bold bg-success-soft border-l-4 border-success",
|
|
9
|
+
info: "text-info-bold bg-info-soft border-l-4 border-info",
|
|
10
|
+
warning: "text-warning-bold bg-warning-soft border-l-4 border-warning",
|
|
11
|
+
danger: "text-danger-bold bg-danger-soft border-l-4 border-danger"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
defaultVariants: {
|
|
15
|
+
color: "success"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
), b = ({
|
|
19
|
+
children: a,
|
|
20
|
+
...s
|
|
21
|
+
}) => /* @__PURE__ */ r.jsx(
|
|
22
|
+
"span",
|
|
23
|
+
{
|
|
24
|
+
className: "flex-1 truncate text-sm",
|
|
25
|
+
"data-testid": "snackbar-text",
|
|
26
|
+
...s,
|
|
27
|
+
children: a
|
|
28
|
+
}
|
|
29
|
+
), x = ({
|
|
30
|
+
children: a,
|
|
31
|
+
...s
|
|
32
|
+
}) => /* @__PURE__ */ r.jsx("span", { className: "ml-2", "data-testid": "snackbar-action", ...s, children: a }), g = i(
|
|
33
|
+
({ children: a, action: s, color: e, className: t, ...o }, n) => /* @__PURE__ */ r.jsxs(
|
|
34
|
+
"div",
|
|
35
|
+
{
|
|
36
|
+
ref: n,
|
|
37
|
+
role: "status",
|
|
38
|
+
"aria-live": "polite",
|
|
39
|
+
className: d(l({ color: e }), t),
|
|
40
|
+
...o,
|
|
41
|
+
children: [
|
|
42
|
+
/* @__PURE__ */ r.jsx(b, { children: a }),
|
|
43
|
+
s && /* @__PURE__ */ r.jsx(x, { children: s })
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
)
|
|
47
|
+
);
|
|
48
|
+
export {
|
|
49
|
+
g as S
|
|
50
|
+
};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { c as d, j as c } from "./index-DOdDlCoL.js";
|
|
2
|
+
import { createContext as x, useState as k, useRef as p, useCallback as m, useEffect as S, useMemo as v, useContext as h } from "react";
|
|
3
|
+
import { S as w } from "./snackbar-DH8jCh2V.js";
|
|
4
|
+
const f = x(
|
|
5
|
+
null
|
|
6
|
+
), j = d(
|
|
7
|
+
[
|
|
8
|
+
"fixed z-50 flex flex-col gap-2 px-0 pb-2",
|
|
9
|
+
"w-screen left-0 bottom-0",
|
|
10
|
+
// mobile: full width
|
|
11
|
+
"sm:w-auto sm:left-4 sm:bottom-4 sm:max-w-sm"
|
|
12
|
+
// desktop/tablet
|
|
13
|
+
].join(" ")
|
|
14
|
+
), T = d("", {
|
|
15
|
+
variants: {
|
|
16
|
+
placement: {
|
|
17
|
+
mobile: "snackbar-animate-fade-in-out",
|
|
18
|
+
desktop: "snackbar-animate-slide-in-left"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
defaultVariants: {
|
|
22
|
+
placement: "mobile"
|
|
23
|
+
}
|
|
24
|
+
}), C = 4e3;
|
|
25
|
+
function E() {
|
|
26
|
+
const [a, s] = k([]), t = p({}), n = m((e) => {
|
|
27
|
+
s((r) => r.filter((o) => o.id !== e)), t.current[e] && (clearTimeout(t.current[e]), delete t.current[e]);
|
|
28
|
+
}, []), i = m(
|
|
29
|
+
(e, r, o) => {
|
|
30
|
+
const u = `${Date.now()}-${Math.random()}`, l = o?.duration ?? C;
|
|
31
|
+
s((b) => [
|
|
32
|
+
...b,
|
|
33
|
+
{
|
|
34
|
+
id: u,
|
|
35
|
+
color: e,
|
|
36
|
+
message: r,
|
|
37
|
+
...o,
|
|
38
|
+
duration: l
|
|
39
|
+
}
|
|
40
|
+
]), t.current[u] = setTimeout(() => {
|
|
41
|
+
n(u);
|
|
42
|
+
}, l);
|
|
43
|
+
},
|
|
44
|
+
[n]
|
|
45
|
+
);
|
|
46
|
+
return S(() => () => {
|
|
47
|
+
Object.values(t.current).forEach(clearTimeout), t.current = {};
|
|
48
|
+
}, []), { queue: a, showSnack: i, removeSnack: n };
|
|
49
|
+
}
|
|
50
|
+
const V = ({ children: a }) => {
|
|
51
|
+
const { queue: s, showSnack: t, removeSnack: n } = E(), i = v(() => ({ showSnack: t }), [t]);
|
|
52
|
+
return /* @__PURE__ */ c.jsxs(f.Provider, { value: i, children: [
|
|
53
|
+
a,
|
|
54
|
+
/* @__PURE__ */ c.jsx(
|
|
55
|
+
"div",
|
|
56
|
+
{
|
|
57
|
+
className: j(),
|
|
58
|
+
"aria-live": "polite",
|
|
59
|
+
"aria-atomic": "true",
|
|
60
|
+
children: s.map((e, r) => /* @__PURE__ */ c.jsx(
|
|
61
|
+
"div",
|
|
62
|
+
{
|
|
63
|
+
className: T({
|
|
64
|
+
placement: window.innerWidth >= 640 ? "desktop" : "mobile"
|
|
65
|
+
}),
|
|
66
|
+
style: { transitionDelay: `${r * 60}ms` },
|
|
67
|
+
children: /* @__PURE__ */ c.jsx(
|
|
68
|
+
w,
|
|
69
|
+
{
|
|
70
|
+
color: e.color,
|
|
71
|
+
action: e.action,
|
|
72
|
+
onClose: () => {
|
|
73
|
+
n(e.id);
|
|
74
|
+
},
|
|
75
|
+
children: e.message
|
|
76
|
+
}
|
|
77
|
+
)
|
|
78
|
+
},
|
|
79
|
+
e.id
|
|
80
|
+
))
|
|
81
|
+
}
|
|
82
|
+
)
|
|
83
|
+
] });
|
|
84
|
+
};
|
|
85
|
+
function N() {
|
|
86
|
+
const a = h(f);
|
|
87
|
+
if (!a)
|
|
88
|
+
throw new Error("useSnackbars must be used within a SnackbarsProvider");
|
|
89
|
+
return a;
|
|
90
|
+
}
|
|
91
|
+
export {
|
|
92
|
+
V as S,
|
|
93
|
+
N as u
|
|
94
|
+
};
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { LoadingIndicator } from './loading-indicator';
|
|
2
|
+
export type * from './types';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ChipMultipleInputOptionProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* ChipMultipleInput.Option atom component
|
|
5
|
+
*
|
|
6
|
+
* Individual chip option for ChipMultipleInput
|
|
7
|
+
* Uses checkbox input pattern for multiple selection
|
|
8
|
+
* Supports leading icon and animated tick/check
|
|
9
|
+
*/
|
|
10
|
+
export declare const ChipMultipleOption: React.ForwardRefExoticComponent<ChipMultipleInputOptionProps & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ChipMultipleInputProps } from './types';
|
|
3
|
+
export declare const ChipMultipleInput: React.ForwardRefExoticComponent<ChipMultipleInputProps & React.RefAttributes<HTMLDivElement>> & {
|
|
4
|
+
Option: React.ForwardRefExoticComponent<import('./types').ChipMultipleInputOptionProps & React.RefAttributes<HTMLInputElement>>;
|
|
5
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { InputHTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
/**
|
|
3
|
-
* Props for the
|
|
3
|
+
* Props for the ChipMultipleInput component
|
|
4
4
|
*/
|
|
5
|
-
export interface
|
|
5
|
+
export interface ChipMultipleInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'size' | 'onChange' | 'value'> {
|
|
6
6
|
/**
|
|
7
7
|
* The shape of the chip: 'circle' (default) or 'rounded'
|
|
8
8
|
*/
|
|
@@ -45,9 +45,9 @@ export interface ChipInputProps extends Omit<InputHTMLAttributes<HTMLInputElemen
|
|
|
45
45
|
onChange?: (value: string[]) => void;
|
|
46
46
|
}
|
|
47
47
|
/**
|
|
48
|
-
* Props for the
|
|
48
|
+
* Props for the ChipMultipleInput.Option component
|
|
49
49
|
*/
|
|
50
|
-
export interface
|
|
50
|
+
export interface ChipMultipleInputOptionProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'name'> {
|
|
51
51
|
/**
|
|
52
52
|
* The option label content
|
|
53
53
|
*/
|
|
@@ -64,4 +64,16 @@ export interface ChipInputOptionProps extends Omit<InputHTMLAttributes<HTMLInput
|
|
|
64
64
|
* Show the default check icon if true (default: false). If both check and defaultCheck are provided, check takes precedence
|
|
65
65
|
*/
|
|
66
66
|
defaultCheck?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Disabled state for this option
|
|
69
|
+
*/
|
|
70
|
+
disabled?: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Optional id for the input
|
|
73
|
+
*/
|
|
74
|
+
id?: string;
|
|
75
|
+
/**
|
|
76
|
+
* Additional className for styling
|
|
77
|
+
*/
|
|
78
|
+
className?: string;
|
|
67
79
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ChipSingleInputOptionProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* ChipSingleInput.Option atom component
|
|
5
|
+
*
|
|
6
|
+
* Individual chip option for ChipSingleInput
|
|
7
|
+
* Uses radio input pattern for single selection
|
|
8
|
+
* Supports leading icon and animated tick/check
|
|
9
|
+
*/
|
|
10
|
+
export declare const ChipSingleInputOption: React.ForwardRefExoticComponent<ChipSingleInputOptionProps & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ChipSingleInputProps } from './types';
|
|
3
|
+
export declare const ChipSingleInput: React.ForwardRefExoticComponent<ChipSingleInputProps & React.RefAttributes<HTMLDivElement>> & {
|
|
4
|
+
Option: React.ForwardRefExoticComponent<import('./types').ChipSingleInputOptionProps & React.RefAttributes<HTMLInputElement>>;
|
|
5
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { InputHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Props for the ChipSingleInput component
|
|
4
|
+
*/
|
|
5
|
+
export interface ChipSingleInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'size' | 'onChange' | 'value'> {
|
|
6
|
+
/**
|
|
7
|
+
* The shape of the chip: 'circle' (default) or 'rounded'
|
|
8
|
+
*/
|
|
9
|
+
shape?: 'circle' | 'rounded';
|
|
10
|
+
/**
|
|
11
|
+
* The size of the chip: 'sm' (default), 'md', or 'lg'
|
|
12
|
+
*/
|
|
13
|
+
size?: 'sm' | 'md' | 'lg';
|
|
14
|
+
/**
|
|
15
|
+
* Visual style variant supporting Versaur color system
|
|
16
|
+
* Core variants: primary (coral), secondary (sage), tertiary (mist), ghost (slate), neutral (light gray)
|
|
17
|
+
* Semantic variants: success, info, warning, danger
|
|
18
|
+
* Each variant supports outline form for flexible design expression
|
|
19
|
+
*/
|
|
20
|
+
variant?: 'primary' | 'secondary' | 'tertiary' | 'ghost' | 'neutral' | 'success' | 'info' | 'warning' | 'danger';
|
|
21
|
+
/**
|
|
22
|
+
* Label text to display above the chip group
|
|
23
|
+
*/
|
|
24
|
+
label?: ReactNode;
|
|
25
|
+
/**
|
|
26
|
+
* Helper text to display below the chip group
|
|
27
|
+
*/
|
|
28
|
+
helperText?: ReactNode;
|
|
29
|
+
/**
|
|
30
|
+
* Error message for invalid state
|
|
31
|
+
*/
|
|
32
|
+
error?: ReactNode;
|
|
33
|
+
/**
|
|
34
|
+
* The name attribute for the radio group - required for radio functionality
|
|
35
|
+
*/
|
|
36
|
+
name: string;
|
|
37
|
+
/**
|
|
38
|
+
* Current selected value (controlled component)
|
|
39
|
+
* String representing selected option value
|
|
40
|
+
*/
|
|
41
|
+
value?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Callback when value changes
|
|
44
|
+
*/
|
|
45
|
+
onChange?: (value: string) => void;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Props for the ChipSingleInput.Option component
|
|
49
|
+
*/
|
|
50
|
+
export interface ChipSingleInputOptionProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'name'> {
|
|
51
|
+
/**
|
|
52
|
+
* The option label content
|
|
53
|
+
*/
|
|
54
|
+
children: ReactNode;
|
|
55
|
+
/**
|
|
56
|
+
* The value for this chip option
|
|
57
|
+
*/
|
|
58
|
+
value: string;
|
|
59
|
+
/**
|
|
60
|
+
* Custom check icon or element. If not provided, no check is rendered unless defaultCheck is true
|
|
61
|
+
*/
|
|
62
|
+
check?: React.ReactNode;
|
|
63
|
+
/**
|
|
64
|
+
* Show the default check icon if true (default: false). If both check and defaultCheck are provided, check takes precedence
|
|
65
|
+
*/
|
|
66
|
+
defaultCheck?: boolean;
|
|
67
|
+
}
|
|
@@ -1,10 +1,3 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { DateSinglePickerInputProps } from './types';
|
|
3
|
-
|
|
4
|
-
* DateSinglePickerInput component for Versaur UI
|
|
5
|
-
*
|
|
6
|
-
* Styled like TextInput, but acts as a button to pick a single date
|
|
7
|
-
* Clicking opens a docked Calendar below the input
|
|
8
|
-
* Strictly typed, accessible, and visually consistent with TextInput
|
|
9
|
-
*/
|
|
10
|
-
export declare const DateSinglePickerInput: React.ForwardRefExoticComponent<DateSinglePickerInputProps & React.RefAttributes<HTMLButtonElement>>;
|
|
3
|
+
export declare const DateSinglePickerInput: React.ForwardRefExoticComponent<DateSinglePickerInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { DateSinglePickerInput } from './date-single-picker-input';
|
|
2
|
-
export
|
|
2
|
+
export * from './types';
|
|
@@ -1,75 +1,21 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TextInputProps } from '../text-input/types';
|
|
2
2
|
/**
|
|
3
|
-
* Props for
|
|
3
|
+
* Props for DateSinglePickerInput
|
|
4
|
+
* Extends TextInputProps, but restricts type to 'date' and value to string
|
|
4
5
|
*/
|
|
5
|
-
|
|
6
|
-
* Props for the DateSinglePickerInput component
|
|
7
|
-
*/
|
|
8
|
-
export interface DateSinglePickerInputProps {
|
|
9
|
-
/**
|
|
10
|
-
* Picker display type: 'docked' (default) or 'modal'.
|
|
11
|
-
* 'docked' shows calendar below input, 'modal' opens a modal at top.
|
|
12
|
-
*/
|
|
13
|
-
type?: 'docked' | 'modal';
|
|
14
|
-
/**
|
|
15
|
-
* The selected date value
|
|
16
|
-
*/
|
|
17
|
-
value?: Date;
|
|
18
|
-
/**
|
|
19
|
-
* Callback when a date is selected
|
|
20
|
-
*/
|
|
21
|
-
onChange?: (date: Date) => void;
|
|
22
|
-
/**
|
|
23
|
-
* Label text to display above the input
|
|
24
|
-
*/
|
|
25
|
-
label?: ReactNode;
|
|
26
|
-
/**
|
|
27
|
-
* Optional content to display inside the input (left)
|
|
28
|
-
*/
|
|
29
|
-
leftContent?: ReactNode;
|
|
30
|
-
/**
|
|
31
|
-
* Optional content to display inside the input (right)
|
|
32
|
-
*/
|
|
33
|
-
rightContent?: ReactNode;
|
|
34
|
-
/**
|
|
35
|
-
* Helper text to display below the input
|
|
36
|
-
*/
|
|
37
|
-
helperText?: ReactNode;
|
|
38
|
-
/**
|
|
39
|
-
* Error message for invalid state
|
|
40
|
-
*/
|
|
41
|
-
error?: ReactNode;
|
|
42
|
-
/**
|
|
43
|
-
* Visual style variant supporting Versaur color system
|
|
44
|
-
*/
|
|
45
|
-
variant?: 'primary' | 'primary-outline' | 'secondary' | 'secondary-outline' | 'tertiary' | 'tertiary-outline' | 'ghost' | 'ghost-outline' | 'neutral' | 'neutral-outline' | 'success' | 'success-outline' | 'info' | 'info-outline' | 'warning' | 'warning-outline' | 'danger' | 'danger-outline';
|
|
6
|
+
export interface DateSinglePickerInputProps extends Omit<TextInputProps, 'type' | 'value' | 'onChange'> {
|
|
46
7
|
/**
|
|
47
|
-
*
|
|
8
|
+
* The value of the input (ISO date string: YYYY-MM-DD)
|
|
48
9
|
*/
|
|
49
|
-
|
|
10
|
+
value: string;
|
|
50
11
|
/**
|
|
51
|
-
*
|
|
12
|
+
* Called when the value changes
|
|
52
13
|
*/
|
|
53
|
-
|
|
14
|
+
onChange: (value: string) => void;
|
|
54
15
|
/**
|
|
55
|
-
* Optional
|
|
16
|
+
* Optional custom formatter for displaying the date value
|
|
17
|
+
* @param value ISO date string
|
|
18
|
+
* @returns formatted string for display
|
|
56
19
|
*/
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Optional custom date formatter. If not provided, uses default format.
|
|
60
|
-
* @param date Date to format
|
|
61
|
-
* @returns Formatted date string
|
|
62
|
-
*/
|
|
63
|
-
formatDate?: (date?: Date) => string;
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Atoms for DateSinglePickerInput modal type
|
|
67
|
-
*/
|
|
68
|
-
export interface DateSinglePickerModalContentProps {
|
|
69
|
-
children: ReactNode;
|
|
70
|
-
}
|
|
71
|
-
export interface DateSinglePickerModalFooterProps {
|
|
72
|
-
onCancel: () => void;
|
|
73
|
-
onConfirm: () => void;
|
|
74
|
-
confirmDisabled?: boolean;
|
|
20
|
+
formatter?: (value: string) => string;
|
|
75
21
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { EmailInputProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* EmailInput component for Versaur UI
|
|
4
|
+
*
|
|
5
|
+
* A wrapper around TextInput that enforces type="email" and follows HTML input standards
|
|
6
|
+
* Supports all TextInput props except type, which is always "email"
|
|
7
|
+
*/
|
|
8
|
+
export declare const EmailInput: import('react').ForwardRefExoticComponent<EmailInputProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
export * from './calculator-input';
|
|
2
1
|
export * from './checkbox-input';
|
|
3
|
-
export * from './chip-input';
|
|
2
|
+
export * from './chip-single-input';
|
|
3
|
+
export * from './chip-multiple-input';
|
|
4
4
|
export * from './date-single-picker-input';
|
|
5
5
|
export * from './radio-input';
|
|
6
6
|
export * from './segment-single-input';
|
|
7
7
|
export * from './segment-multiple-input';
|
|
8
|
+
export * from './search-input';
|
|
8
9
|
export * from './select-input';
|
|
9
10
|
export * from './text-input';
|
|
10
11
|
export * from './textarea-input';
|
|
11
12
|
export * from './time-picker-input';
|
|
12
13
|
export * from './switch-input';
|
|
14
|
+
export * from './price-input';
|
|
15
|
+
export * from './email-input';
|