@adgytec/adgytec-web-ui-components 0.0.6 → 0.0.7
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/{FieldError-CZn24fiL.js → FieldError-a_f080R9.js} +3 -3
- package/dist/Form-BrgsgT93.js +53 -0
- package/dist/Input-CcFMJrOW.js +33 -0
- package/dist/Select-uiw8JPDT.js +85 -0
- package/dist/{TextArea-DBZO5z2H.js → TextArea-sEBd2qe1.js} +9 -9
- package/dist/assets/FieldError.css +1 -1
- package/dist/assets/Form.css +1 -0
- package/dist/assets/Input.css +1 -1
- package/dist/assets/Select.css +1 -1
- package/dist/assets/TextArea.css +1 -1
- package/dist/components/Form/Form/Form.d.ts +3 -0
- package/dist/components/Form/Form/index.d.ts +2 -0
- package/dist/components/Form/Form/index.js +4 -0
- package/dist/components/Form/Form/types.d.ts +8 -0
- package/dist/components/Form/Input/index.js +1 -1
- package/dist/components/Form/TextArea/index.js +1 -1
- package/dist/components/Select/index.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +44 -42
- package/dist/styles/main.css +193 -0
- package/dist/utils/form.d.ts +13 -0
- package/package.json +5 -3
- package/dist/Input-KLfZufI4.js +0 -33
- package/dist/Select-pbrPLreh.js +0 -85
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { Label as l, FieldError as s } from "react-aria-components";
|
|
3
|
-
import './assets/FieldError.css';const a = "
|
|
3
|
+
import './assets/FieldError.css';const a = "_label_1qx1g_1", o = {
|
|
4
4
|
label: a
|
|
5
|
-
},
|
|
5
|
+
}, m = (r) => /* @__PURE__ */ e(l, { ...r, className: r.className ?? o.label, children: r.children }), t = "_error_srqbn_1", c = {
|
|
6
6
|
error: t
|
|
7
7
|
}, i = (r) => /* @__PURE__ */ e(
|
|
8
8
|
s,
|
|
@@ -13,5 +13,5 @@ import './assets/FieldError.css';const a = "_label_1ladm_1", o = {
|
|
|
13
13
|
);
|
|
14
14
|
export {
|
|
15
15
|
i as F,
|
|
16
|
-
|
|
16
|
+
m as L
|
|
17
17
|
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
2
|
+
import { Form as i } from "react-aria-components";
|
|
3
|
+
import { useState as l } from "react";
|
|
4
|
+
import './assets/Form.css';function d(o, e = (r) => r.message) {
|
|
5
|
+
const r = {}, s = [];
|
|
6
|
+
for (const t of o.issues)
|
|
7
|
+
t.path.length > 0 ? (r[t.path[0]] = r[t.path[0]] || [], r[t.path[0]].push(e(t))) : s.push(e(t));
|
|
8
|
+
return { formErrors: s, fieldErrors: r };
|
|
9
|
+
}
|
|
10
|
+
const h = "_form_1k1fe_1", E = {
|
|
11
|
+
form: h
|
|
12
|
+
}, F = (o, e) => {
|
|
13
|
+
const r = Object.fromEntries(new FormData(o)), s = e.safeParse(r);
|
|
14
|
+
return s.success ? {
|
|
15
|
+
success: !0,
|
|
16
|
+
data: s.data
|
|
17
|
+
} : {
|
|
18
|
+
success: !1,
|
|
19
|
+
errors: d(s.error).fieldErrors
|
|
20
|
+
};
|
|
21
|
+
}, g = ({
|
|
22
|
+
schema: o,
|
|
23
|
+
onSubmit: e,
|
|
24
|
+
children: r,
|
|
25
|
+
...s
|
|
26
|
+
}) => {
|
|
27
|
+
const [t, a] = l({});
|
|
28
|
+
return /* @__PURE__ */ f(
|
|
29
|
+
i,
|
|
30
|
+
{
|
|
31
|
+
...s,
|
|
32
|
+
validationErrors: t,
|
|
33
|
+
onSubmit: async (c) => {
|
|
34
|
+
c.preventDefault(), a({});
|
|
35
|
+
const m = c.currentTarget, n = F(m, o);
|
|
36
|
+
if (!n.success) {
|
|
37
|
+
a(n.errors);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
const u = await e(n.data, () => m.reset());
|
|
41
|
+
if (u) {
|
|
42
|
+
a(u);
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
className: s.className ?? E.form,
|
|
47
|
+
children: r
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
};
|
|
51
|
+
export {
|
|
52
|
+
g as F
|
|
53
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsxs as a, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { TextField as m, Input as c } from "react-aria-components";
|
|
3
|
+
import { L as p, F as d } from "./FieldError-a_f080R9.js";
|
|
4
|
+
import './assets/Input.css';const l = "_input_xzjym_1", u = "_editor_xzjym_11", o = {
|
|
5
|
+
input: l,
|
|
6
|
+
editor: u
|
|
7
|
+
}, I = ({
|
|
8
|
+
label: t,
|
|
9
|
+
textFieldProps: r,
|
|
10
|
+
inputProps: e,
|
|
11
|
+
labelProps: i,
|
|
12
|
+
fieldErrorProps: n
|
|
13
|
+
}) => /* @__PURE__ */ a(
|
|
14
|
+
m,
|
|
15
|
+
{
|
|
16
|
+
...r,
|
|
17
|
+
className: r?.className ?? o.input,
|
|
18
|
+
children: [
|
|
19
|
+
t && /* @__PURE__ */ s(p, { ...i, children: t }),
|
|
20
|
+
/* @__PURE__ */ s(
|
|
21
|
+
c,
|
|
22
|
+
{
|
|
23
|
+
...e,
|
|
24
|
+
className: e?.className ?? o.editor
|
|
25
|
+
}
|
|
26
|
+
),
|
|
27
|
+
/* @__PURE__ */ s(d, { ...n })
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
export {
|
|
32
|
+
I
|
|
33
|
+
};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { jsxs as i, jsx as e, Fragment as n } from "react/jsx-runtime";
|
|
2
|
+
import { O as S, F as T } from "./OutlinedButton-DaLKO8zx.js";
|
|
3
|
+
import { B as o } from "./useSplash-7h6ni4l2.js";
|
|
4
|
+
import { Select as b, SelectValue as m, ListBox as k, Text as d, ListBoxItem as V } from "react-aria-components";
|
|
5
|
+
import { P as y } from "./Popover-D3iGWJwQ.js";
|
|
6
|
+
import { ChevronsUpDown as C, Check as F } from "lucide-react";
|
|
7
|
+
import { T as $ } from "./TextButton-BJRez1un.js";
|
|
8
|
+
import { C as p } from "./types-C1YOMbh5.js";
|
|
9
|
+
import { T as L } from "./Tooltip-DAYtebkl.js";
|
|
10
|
+
import { L as D, F as j } from "./FieldError-a_f080R9.js";
|
|
11
|
+
import './assets/Select.css';const w = "_select_17r3s_1", I = "_trigger_17r3s_37", t = {
|
|
12
|
+
select: w,
|
|
13
|
+
"selected-value": "_selected-value_17r3s_11",
|
|
14
|
+
"option-description": "_option-description_17r3s_19",
|
|
15
|
+
trigger: I,
|
|
16
|
+
"options-list": "_options-list_17r3s_51",
|
|
17
|
+
"options-item-group": "_options-item-group_17r3s_63",
|
|
18
|
+
"options-item": "_options-item_17r3s_63"
|
|
19
|
+
}, K = ({
|
|
20
|
+
options: u,
|
|
21
|
+
label: a,
|
|
22
|
+
name: _,
|
|
23
|
+
disabled: h,
|
|
24
|
+
isRequired: f,
|
|
25
|
+
triggerVariant: g = o.filled,
|
|
26
|
+
description: x,
|
|
27
|
+
placeholder: c,
|
|
28
|
+
selectedKey: v,
|
|
29
|
+
onSelectionChange: B
|
|
30
|
+
}) => {
|
|
31
|
+
let r;
|
|
32
|
+
switch (g) {
|
|
33
|
+
case o.filled:
|
|
34
|
+
r = T;
|
|
35
|
+
break;
|
|
36
|
+
case o.outlined:
|
|
37
|
+
r = S;
|
|
38
|
+
break;
|
|
39
|
+
case o.text:
|
|
40
|
+
r = $;
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
return /* @__PURE__ */ i(
|
|
44
|
+
b,
|
|
45
|
+
{
|
|
46
|
+
className: t.select,
|
|
47
|
+
isDisabled: h,
|
|
48
|
+
isRequired: f,
|
|
49
|
+
name: _,
|
|
50
|
+
selectedKey: v,
|
|
51
|
+
onSelectionChange: B,
|
|
52
|
+
children: [
|
|
53
|
+
a && /* @__PURE__ */ e(D, { children: a }),
|
|
54
|
+
/* @__PURE__ */ e(L, { description: x, theme: p.inverseSurface, children: /* @__PURE__ */ e(r, { theme: p.inverseSurface, children: /* @__PURE__ */ i("span", { className: t.trigger, children: [
|
|
55
|
+
c ? /* @__PURE__ */ e(m, { className: `${t["selected-value"]}`, children: ({ defaultChildren: s, isPlaceholder: l }) => l ? c : s }) : /* @__PURE__ */ e(m, {}),
|
|
56
|
+
/* @__PURE__ */ e(C, {})
|
|
57
|
+
] }) }) }),
|
|
58
|
+
/* @__PURE__ */ e(j, {}),
|
|
59
|
+
/* @__PURE__ */ e(y, { children: /* @__PURE__ */ e(k, { className: `${t["options-list"]}`, items: u, children: (s) => {
|
|
60
|
+
const l = /* @__PURE__ */ i(n, { children: [
|
|
61
|
+
/* @__PURE__ */ e(d, { children: s.displayValue }),
|
|
62
|
+
s.description && /* @__PURE__ */ e(d, { className: t["option-description"], children: s.description })
|
|
63
|
+
] });
|
|
64
|
+
return /* @__PURE__ */ e(
|
|
65
|
+
V,
|
|
66
|
+
{
|
|
67
|
+
className: `${t["options-item-group"]}`,
|
|
68
|
+
id: s.key,
|
|
69
|
+
textValue: s.displayValue,
|
|
70
|
+
isDisabled: s.disabled,
|
|
71
|
+
children: ({ isSelected: N }) => /* @__PURE__ */ i(n, { children: [
|
|
72
|
+
/* @__PURE__ */ e("div", { className: `${t["options-item"]}`, children: l }),
|
|
73
|
+
N && /* @__PURE__ */ e(F, {})
|
|
74
|
+
] })
|
|
75
|
+
},
|
|
76
|
+
s.key
|
|
77
|
+
);
|
|
78
|
+
} }) })
|
|
79
|
+
]
|
|
80
|
+
}
|
|
81
|
+
);
|
|
82
|
+
};
|
|
83
|
+
export {
|
|
84
|
+
K as S
|
|
85
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { TextField as
|
|
3
|
-
import { L as d, F as l } from "./FieldError-
|
|
4
|
-
import './assets/TextArea.css';const n = "
|
|
1
|
+
import { jsxs as i, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { TextField as m, TextArea as x } from "react-aria-components";
|
|
3
|
+
import { L as d, F as l } from "./FieldError-a_f080R9.js";
|
|
4
|
+
import './assets/TextArea.css';const n = "_textarea_1o47z_1", _ = "_editor_1o47z_11", s = {
|
|
5
5
|
textarea: n,
|
|
6
6
|
editor: _
|
|
7
7
|
}, h = ({
|
|
@@ -9,22 +9,22 @@ import './assets/TextArea.css';const n = "_textarea_1fx5i_1", _ = "_editor_1fx5i
|
|
|
9
9
|
textFieldProps: r,
|
|
10
10
|
textAreaProps: t,
|
|
11
11
|
labelProps: o,
|
|
12
|
-
fieldErrorProps:
|
|
13
|
-
}) => /* @__PURE__ */
|
|
14
|
-
|
|
12
|
+
fieldErrorProps: c
|
|
13
|
+
}) => /* @__PURE__ */ i(
|
|
14
|
+
m,
|
|
15
15
|
{
|
|
16
16
|
...r,
|
|
17
17
|
className: r?.className ?? s.textarea,
|
|
18
18
|
children: [
|
|
19
19
|
a && /* @__PURE__ */ e(d, { ...o, children: a }),
|
|
20
20
|
/* @__PURE__ */ e(
|
|
21
|
-
|
|
21
|
+
x,
|
|
22
22
|
{
|
|
23
23
|
...t,
|
|
24
24
|
className: t?.className ?? s.editor
|
|
25
25
|
}
|
|
26
26
|
),
|
|
27
|
-
/* @__PURE__ */ e(l, { ...
|
|
27
|
+
/* @__PURE__ */ e(l, { ...c })
|
|
28
28
|
]
|
|
29
29
|
}
|
|
30
30
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._label_1qx1g_1{font-weight:500;font-size:var(--form-label-text)}._error_srqbn_1{font-size:.875rem;color:var(--color-error)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._form_1k1fe_1{display:grid;gap:var(--form-gap)}
|
package/dist/assets/Input.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._input_xzjym_1{display:grid;gap:var(--form-input-gap, .25rem)}._editor_xzjym_11{font-weight:500;border-radius:var(--radius);padding-inline:.625em;padding-block:.625em;max-inline-size:100%;border-style:solid;background-color:var(--color-surface-container-highest);color:var(--color-on-surface);font-size:var(--form-input-text)}._editor_xzjym_11[data-invalid]{border-color:var(--color-error)}
|
package/dist/assets/Select.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._select_17r3s_1{display:grid;gap:var(--form-input-gap)}._selected-value_17r3s_11{font-size:var(--form-input-text);font-weight:600}._selected-value_17r3s_11 ._option-description_17r3s_19{display:none}._selected-value_17r3s_11[data-placeholder]{font-style:italic}._trigger_17r3s_37{display:flex;align-items:center;gap:.75rem;justify-content:space-between}._options-list_17r3s_51{display:grid;gap:var(--form-gap);border-radius:inherit}._options-item-group_17r3s_63{display:flex;gap:.5rem;align-items:center;justify-content:space-between;cursor:pointer;border-radius:inherit;padding-inline:.75rem;padding-block:.5rem;color:var(--_item-text);background-color:var(--_item-color);transition:background-color .25s,color .25s}._options-item-group_17r3s_63[data-hovered],._options-item-group_17r3s_63[data-focused]{--_item-color: hsl(from var(--_popover-bg) h s calc(l + 10) );--_item-text: hsl(from var(--_popover-text) h s calc(l + 10) )}._options-item-group_17r3s_63[data-selected]{--_item-color: hsl(from var(--_popover-bg) h s calc(l - 10) );--_item-text: hsl(from var(--_popover-text) h s calc(l - 10) )}._options-item_17r3s_63{font-size:var(--form-input-text);display:grid;gap:.25rem}._options-item_17r3s_63 ._option-description_17r3s_19{font-size:.875em;font-style:italic}
|
package/dist/assets/TextArea.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._textarea_1o47z_1{display:grid;gap:var(--form-input-gap, .25rem)}._editor_1o47z_11{font-weight:500;border-radius:var(--radius);padding-inline:.625em;padding-block:.625em;max-inline-size:100%;border-style:solid;background-color:var(--color-surface-container-highest);color:var(--color-on-surface);resize:vertical;max-height:15rem;font-size:var(--form-input-text)}._editor_1o47z_11[data-invalid]{border-color:var(--color-error)}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FormProps as AriaFormProps } from 'react-aria-components';
|
|
2
|
+
import * as z from "zod";
|
|
3
|
+
export type FormReset = () => void;
|
|
4
|
+
export type submitHandler<T> = (values: T, reset: FormReset) => void | Promise<void> | Promise<Partial<Record<keyof T, string | string[]>>>;
|
|
5
|
+
export interface FormProps<T extends z.ZodObject<any>> extends Omit<AriaFormProps, "onSubmit" | "validationErrors"> {
|
|
6
|
+
schema: T;
|
|
7
|
+
onSubmit: submitHandler<z.infer<T>>;
|
|
8
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export * from './components/Button';
|
|
|
4
4
|
export * from './components/Disclosure/Disclosure';
|
|
5
5
|
export * from './components/Disclosure/DisclousureGroup';
|
|
6
6
|
export * from './components/Error';
|
|
7
|
+
export * from './components/Form/Form';
|
|
7
8
|
export * from './components/Form/Input';
|
|
8
9
|
export * from './components/Form/TextArea';
|
|
9
10
|
export * from './components/Link';
|
package/dist/index.js
CHANGED
|
@@ -1,61 +1,63 @@
|
|
|
1
1
|
import { C as a } from "./types-C1YOMbh5.js";
|
|
2
2
|
import { A as t, a as s, b as p } from "./Avatar-vPRORJSz.js";
|
|
3
|
-
import { a as
|
|
3
|
+
import { a as x, B as i } from "./useSplash-7h6ni4l2.js";
|
|
4
4
|
import { F as f, O as u } from "./OutlinedButton-DaLKO8zx.js";
|
|
5
5
|
import { T as d } from "./TextButton-BJRez1un.js";
|
|
6
6
|
import { D as B } from "./Disclosure-VEgfonAa.js";
|
|
7
7
|
import { D as T } from "./DisclousreGroup-DEhMBMtj.js";
|
|
8
8
|
import { E as c } from "./Error-y2dIWjyb.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { M as z } from "./
|
|
15
|
-
import { M as G
|
|
16
|
-
import { M as V } from "./
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import { N as X } from "./
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import { S as ro } from "./
|
|
24
|
-
import {
|
|
25
|
-
import { T as so } from "./
|
|
9
|
+
import { F as A } from "./Form-BrgsgT93.js";
|
|
10
|
+
import { I as N } from "./Input-CcFMJrOW.js";
|
|
11
|
+
import { T as L } from "./TextArea-sEBd2qe1.js";
|
|
12
|
+
import { F as O, O as P } from "./OutlinedButtonLink-BvCiAZyQ.js";
|
|
13
|
+
import { L as C } from "./Link-CbLEp2fF.js";
|
|
14
|
+
import { M as z } from "./MenuButton-CAzQcvOm.js";
|
|
15
|
+
import { M as G } from "./MenuLabel-B7jC7YwF.js";
|
|
16
|
+
import { M as y, a as R, b as V } from "./ModalAction-DjHBeAOr.js";
|
|
17
|
+
import { M as q } from "./ModalBase-DLaR_yid.js";
|
|
18
|
+
import { N as H } from "./NavigationResponsive-D6d2f-k_.js";
|
|
19
|
+
import { S as K, a as Q, b as U } from "./Sidebar-LlVvowsG.js";
|
|
20
|
+
import { N as X } from "./NavigationSidebar-CZEPGghA.js";
|
|
21
|
+
import { N as Z } from "./NavigationMenu-DNsB0lr1.js";
|
|
22
|
+
import { P as $ } from "./Popover-D3iGWJwQ.js";
|
|
23
|
+
import { S as ro } from "./Select-uiw8JPDT.js";
|
|
24
|
+
import { S as eo } from "./Success-Bh3pb5T7.js";
|
|
25
|
+
import { T as so } from "./ToggleButtonGroup-Hw3WdsOM.js";
|
|
26
|
+
import { T as mo } from "./Tree-DwJPCnFr.js";
|
|
26
27
|
export {
|
|
27
28
|
t as Avatar,
|
|
28
29
|
s as AvatarSize,
|
|
29
30
|
p as AvatarType,
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
x as ButtonShape,
|
|
32
|
+
i as ButtonVariant,
|
|
32
33
|
a as ColorTheme,
|
|
33
34
|
B as Disclosure,
|
|
34
35
|
T as DisclosureGroup,
|
|
35
36
|
c as Error,
|
|
36
37
|
f as FilledButton,
|
|
37
|
-
|
|
38
|
-
A as
|
|
39
|
-
|
|
40
|
-
C as
|
|
41
|
-
z as
|
|
42
|
-
G as
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
38
|
+
O as FilledButtonLink,
|
|
39
|
+
A as Form,
|
|
40
|
+
N as Input,
|
|
41
|
+
C as Link,
|
|
42
|
+
z as MenuButton,
|
|
43
|
+
G as MenuLabel,
|
|
44
|
+
y as ModalAction,
|
|
45
|
+
R as ModalActionPlacement,
|
|
46
|
+
q as ModalBase,
|
|
47
|
+
V as ModalCloseText,
|
|
48
|
+
Z as NavigationMenu,
|
|
49
|
+
H as NavigationResponsive,
|
|
50
|
+
X as NavigationSidebar,
|
|
49
51
|
u as OutlinedButton,
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
52
|
+
P as OutlinedButtonLink,
|
|
53
|
+
$ as Popover,
|
|
54
|
+
ro as Select,
|
|
55
|
+
K as Sidebar,
|
|
56
|
+
Q as SidebarPosition,
|
|
57
|
+
U as SidebarSize,
|
|
58
|
+
eo as Success,
|
|
59
|
+
L as TextArea,
|
|
58
60
|
d as TextButton,
|
|
59
|
-
|
|
60
|
-
|
|
61
|
+
so as ToggleButtonGroup,
|
|
62
|
+
mo as Tree
|
|
61
63
|
};
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
@import url("https://fonts.googleapis.com/css2?family=Lexend:wght@100..900&display=swap");
|
|
2
|
+
@import "reset.css";
|
|
3
|
+
|
|
4
|
+
[data-shape="sharp"] {
|
|
5
|
+
--radius: 0;
|
|
6
|
+
--radius-sidebar: 0;
|
|
7
|
+
--radius-button: var(--radius);
|
|
8
|
+
--radius-circular: 0;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
[data-shape="round"] {
|
|
12
|
+
--radius: 0.5rem;
|
|
13
|
+
--radius-sidebar: 2.5rem;
|
|
14
|
+
--radius-button: var(--radius);
|
|
15
|
+
--radius-circular: 50%;
|
|
16
|
+
|
|
17
|
+
&[data-button-shape="pill"] {
|
|
18
|
+
--radius-button: 100vi;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
[data-theme="dark"] {
|
|
23
|
+
--color-primary: rgb(134 209 233);
|
|
24
|
+
--color-surface-tint: rgb(134 209 233);
|
|
25
|
+
--color-on-primary: rgb(0 54 66);
|
|
26
|
+
--color-primary-container: rgb(0 78 94);
|
|
27
|
+
--color-on-primary-container: rgb(178 235 255);
|
|
28
|
+
--color-secondary: rgb(178 202 211);
|
|
29
|
+
--color-on-secondary: rgb(29 52 59);
|
|
30
|
+
--color-secondary-container: rgb(52 74 82);
|
|
31
|
+
--color-on-secondary-container: rgb(206 231 240);
|
|
32
|
+
--color-tertiary: rgb(193 196 235);
|
|
33
|
+
--color-on-tertiary: rgb(42 46 77);
|
|
34
|
+
--color-tertiary-container: rgb(65 68 101);
|
|
35
|
+
--color-on-tertiary-container: rgb(223 224 255);
|
|
36
|
+
--color-error: rgb(255 180 171);
|
|
37
|
+
--color-on-error: rgb(105 0 5);
|
|
38
|
+
--color-error-container: rgb(147 0 10);
|
|
39
|
+
--color-on-error-container: rgb(255 218 214);
|
|
40
|
+
--color-success: rgb(160 212 155);
|
|
41
|
+
--color-on-success: rgb(7 57 16);
|
|
42
|
+
--color-success-container: rgb(34 80 37);
|
|
43
|
+
--color-on-success-container: rgb(187 240 181);
|
|
44
|
+
--color-background: rgb(15 20 22);
|
|
45
|
+
--color-on-background: rgb(222 227 230);
|
|
46
|
+
--color-surface: rgb(15 20 22);
|
|
47
|
+
--color-on-surface: rgb(222 227 230);
|
|
48
|
+
--color-surface-variant: rgb(64 72 75);
|
|
49
|
+
--color-on-surface-variant: rgb(191 200 204);
|
|
50
|
+
--color-outline: rgb(137 146 150);
|
|
51
|
+
--color-outline-variant: rgb(64 72 75);
|
|
52
|
+
--color-shadow: rgb(0 0 0);
|
|
53
|
+
--color-scrim: rgb(0 0 0);
|
|
54
|
+
--color-inverse-surface: rgb(222 227 230);
|
|
55
|
+
--color-inverse-on-surface: rgb(44 49 51);
|
|
56
|
+
--color-inverse-primary: rgb(0 103 125);
|
|
57
|
+
--color-primary-fixed: rgb(178 235 255);
|
|
58
|
+
--color-on-primary-fixed: rgb(0 31 39);
|
|
59
|
+
--color-primary-fixed-dim: rgb(134 209 233);
|
|
60
|
+
--color-on-primary-fixed-variant: rgb(0 78 94);
|
|
61
|
+
--color-secondary-fixed: rgb(206 231 240);
|
|
62
|
+
--color-on-secondary-fixed: rgb(6 30 37);
|
|
63
|
+
--color-secondary-fixed-dim: rgb(178 202 211);
|
|
64
|
+
--color-on-secondary-fixed-variant: rgb(52 74 82);
|
|
65
|
+
--color-tertiary-fixed: rgb(223 224 255);
|
|
66
|
+
--color-on-tertiary-fixed: rgb(21 25 55);
|
|
67
|
+
--color-tertiary-fixed-dim: rgb(193 196 235);
|
|
68
|
+
--color-on-tertiary-fixed-variant: rgb(65 68 101);
|
|
69
|
+
--color-surface-dim: rgb(15 20 22);
|
|
70
|
+
--color-surface-bright: rgb(52 58 60);
|
|
71
|
+
--color-surface-container-lowest: rgb(9 15 17);
|
|
72
|
+
--color-surface-container-low: rgb(23 28 30);
|
|
73
|
+
--color-surface-container: rgb(27 32 34);
|
|
74
|
+
--color-surface-container-high: rgb(37 43 45);
|
|
75
|
+
--color-surface-container-highest: rgb(48 54 56);
|
|
76
|
+
--color-primary-variant: rgb(220 198 110);
|
|
77
|
+
--color-on-primary-variant: rgb(58 48 0);
|
|
78
|
+
--color-primary-variant-container: rgb(84 70 0);
|
|
79
|
+
--color-on-primary-variant-container: rgb(249 226 135);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
[data-theme="light"] {
|
|
83
|
+
--color-primary: rgb(0 103 125);
|
|
84
|
+
--color-surface-tint: rgb(0 103 125);
|
|
85
|
+
--color-on-primary: rgb(255 255 255);
|
|
86
|
+
--color-primary-container: rgb(178 235 255);
|
|
87
|
+
--color-on-primary-container: rgb(0 78 94);
|
|
88
|
+
--color-secondary: rgb(75 98 106);
|
|
89
|
+
--color-on-secondary: rgb(255 255 255);
|
|
90
|
+
--color-secondary-container: rgb(206 231 240);
|
|
91
|
+
--color-on-secondary-container: rgb(52 74 82);
|
|
92
|
+
--color-tertiary: rgb(88 92 126);
|
|
93
|
+
--color-on-tertiary: rgb(255 255 255);
|
|
94
|
+
--color-tertiary-container: rgb(223 224 255);
|
|
95
|
+
--color-on-tertiary-container: rgb(65 68 101);
|
|
96
|
+
--color-error: rgb(186 26 26);
|
|
97
|
+
--color-on-error: rgb(255 255 255);
|
|
98
|
+
--color-error-container: rgb(255 218 214);
|
|
99
|
+
--color-on-error-container: rgb(147 0 10);
|
|
100
|
+
--color-success: rgb(58 105 58);
|
|
101
|
+
--color-on-success: rgb(255 255 255);
|
|
102
|
+
--color-success-container: rgb(187 240 181);
|
|
103
|
+
--color-on-success-container: rgb(34 80 37);
|
|
104
|
+
--color-background: rgb(245 250 253);
|
|
105
|
+
--color-on-background: rgb(23 28 30);
|
|
106
|
+
--color-surface: rgb(245 250 253);
|
|
107
|
+
--color-on-surface: rgb(23 28 30);
|
|
108
|
+
--color-surface-variant: rgb(219 228 232);
|
|
109
|
+
--color-on-surface-variant: rgb(64 72 75);
|
|
110
|
+
--color-outline: rgb(112 120 124);
|
|
111
|
+
--color-outline-variant: rgb(191 200 204);
|
|
112
|
+
--color-shadow: rgb(0 0 0);
|
|
113
|
+
--color-scrim: rgb(0 0 0);
|
|
114
|
+
--color-inverse-surface: rgb(44 49 51);
|
|
115
|
+
--color-inverse-on-surface: rgb(236 241 244);
|
|
116
|
+
--color-inverse-primary: rgb(134 209 233);
|
|
117
|
+
--color-primary-fixed: rgb(178 235 255);
|
|
118
|
+
--color-on-primary-fixed: rgb(0 31 39);
|
|
119
|
+
--color-primary-fixed-dim: rgb(134 209 233);
|
|
120
|
+
--color-on-primary-fixed-variant: rgb(0 78 94);
|
|
121
|
+
--color-secondary-fixed: rgb(206 231 240);
|
|
122
|
+
--color-on-secondary-fixed: rgb(6 30 37);
|
|
123
|
+
--color-secondary-fixed-dim: rgb(178 202 211);
|
|
124
|
+
--color-on-secondary-fixed-variant: rgb(52 74 82);
|
|
125
|
+
--color-tertiary-fixed: rgb(223 224 255);
|
|
126
|
+
--color-on-tertiary-fixed: rgb(21 25 55);
|
|
127
|
+
--color-tertiary-fixed-dim: rgb(193 196 235);
|
|
128
|
+
--color-on-tertiary-fixed-variant: rgb(65 68 101);
|
|
129
|
+
--color-surface-dim: rgb(214 219 221);
|
|
130
|
+
--color-surface-bright: rgb(245 250 253);
|
|
131
|
+
--color-surface-container-lowest: rgb(255 255 255);
|
|
132
|
+
--color-surface-container-low: rgb(239 244 247);
|
|
133
|
+
--color-surface-container: rgb(234 239 241);
|
|
134
|
+
--color-surface-container-high: rgb(228 233 235);
|
|
135
|
+
--color-surface-container-highest: rgb(222 227 230);
|
|
136
|
+
--color-primary-variant: rgb(110 93 14);
|
|
137
|
+
--color-on-primary-variant: rgb(255 255 255);
|
|
138
|
+
--color-primary-variant-container: rgb(249 226 135);
|
|
139
|
+
--color-on-primary-variant-container: rgb(84 70 0);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
:root {
|
|
143
|
+
--font-normal: "Lexend", sans-serif;
|
|
144
|
+
--font-heading: "Lexend", sans-serif;
|
|
145
|
+
|
|
146
|
+
--elevation-1: 0px 2px 6px 1.5px hsl(from var(--color-shadow) h s l / 0.375);
|
|
147
|
+
--elevation-2: 0px 4px 12px 1.5px hsl(from var(--color-shadow) h s l / 0.375);
|
|
148
|
+
|
|
149
|
+
--disabled-opacity: 0.625;
|
|
150
|
+
--button-border-width: 0.125rem;
|
|
151
|
+
--tree-font-size: 1rem;
|
|
152
|
+
|
|
153
|
+
--form-label-text: 1rem;
|
|
154
|
+
--form-input-text: 1rem;
|
|
155
|
+
--form-input-gap: 0.5rem;
|
|
156
|
+
--form-gap: 1rem;
|
|
157
|
+
|
|
158
|
+
caret-color: var(--color-primary);
|
|
159
|
+
accent-color: var(--color-primary);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/* lucide icon global config */
|
|
163
|
+
.lucide {
|
|
164
|
+
width: 1rem;
|
|
165
|
+
aspect-ratio: 1/1;
|
|
166
|
+
stroke-width: 0.1875rem;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
[data-disabled] {
|
|
170
|
+
cursor: not-allowed;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
[data-disabled]:not([data-disabled] [data-disabled]) {
|
|
174
|
+
opacity: var(--disabled-opacity);
|
|
175
|
+
filter: grayscale(75%);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
body {
|
|
179
|
+
background-color: var(--color-surface);
|
|
180
|
+
color: var(--color-on-surface);
|
|
181
|
+
font-family: var(--font-normal);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
[data-heading] {
|
|
185
|
+
font-family: var(--font-heading);
|
|
186
|
+
font-weight: 700;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
em,
|
|
190
|
+
i {
|
|
191
|
+
font-family: var(--font-normal);
|
|
192
|
+
font-style: italic;
|
|
193
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
interface FormValidateSuccessResult<T> {
|
|
3
|
+
success: true;
|
|
4
|
+
data: T;
|
|
5
|
+
}
|
|
6
|
+
interface FormValidateFailureResult<T> {
|
|
7
|
+
success: false;
|
|
8
|
+
errors: Partial<Record<keyof T, string | string[]>>;
|
|
9
|
+
}
|
|
10
|
+
type FormValidateResult<T> = FormValidateSuccessResult<T> | FormValidateFailureResult<T>;
|
|
11
|
+
export type ValidateAndGetFormValues = <T extends z.ZodObject<any>>(formElement: HTMLFormElement, schema: T) => FormValidateResult<z.infer<T>>;
|
|
12
|
+
export declare const validateAndGetFormValues: ValidateAndGetFormValues;
|
|
13
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adgytec/adgytec-web-ui-components",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.7",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist"
|
|
@@ -25,7 +25,8 @@
|
|
|
25
25
|
"react": "^19.1.0",
|
|
26
26
|
"react-aria-components": "^1.10.1",
|
|
27
27
|
"react-dom": "^19.1.0",
|
|
28
|
-
"usehooks-ts": "^3.1.1"
|
|
28
|
+
"usehooks-ts": "^3.1.1",
|
|
29
|
+
"zod": "^4.0.5"
|
|
29
30
|
},
|
|
30
31
|
"devDependencies": {
|
|
31
32
|
"@eslint/js": "^9.29.0",
|
|
@@ -44,7 +45,8 @@
|
|
|
44
45
|
"typescript-eslint": "^8.34.1",
|
|
45
46
|
"vite": "^7.0.0",
|
|
46
47
|
"vite-plugin-dts": "^4.5.4",
|
|
47
|
-
"vite-plugin-lib-inject-css": "^2.2.2"
|
|
48
|
+
"vite-plugin-lib-inject-css": "^2.2.2",
|
|
49
|
+
"vite-plugin-static-copy": "^3.1.1"
|
|
48
50
|
},
|
|
49
51
|
"author": {
|
|
50
52
|
"name": "Adgytec",
|
package/dist/Input-KLfZufI4.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { jsxs as a, jsx as s } from "react/jsx-runtime";
|
|
2
|
-
import { TextField as c, Input as m } from "react-aria-components";
|
|
3
|
-
import { L as p, F as d } from "./FieldError-CZn24fiL.js";
|
|
4
|
-
import './assets/Input.css';const l = "_input_sezs4_1", u = "_editor_sezs4_11", o = {
|
|
5
|
-
input: l,
|
|
6
|
-
editor: u
|
|
7
|
-
}, f = ({
|
|
8
|
-
label: t,
|
|
9
|
-
textFieldProps: e,
|
|
10
|
-
inputProps: r,
|
|
11
|
-
labelProps: i,
|
|
12
|
-
fieldErrorProps: n
|
|
13
|
-
}) => /* @__PURE__ */ a(
|
|
14
|
-
c,
|
|
15
|
-
{
|
|
16
|
-
...e,
|
|
17
|
-
className: e?.className ?? o.input,
|
|
18
|
-
children: [
|
|
19
|
-
t && /* @__PURE__ */ s(p, { ...i, children: t }),
|
|
20
|
-
/* @__PURE__ */ s(
|
|
21
|
-
m,
|
|
22
|
-
{
|
|
23
|
-
...r,
|
|
24
|
-
className: r?.className ?? o.editor
|
|
25
|
-
}
|
|
26
|
-
),
|
|
27
|
-
/* @__PURE__ */ s(d, { ...n })
|
|
28
|
-
]
|
|
29
|
-
}
|
|
30
|
-
);
|
|
31
|
-
export {
|
|
32
|
-
f as I
|
|
33
|
-
};
|
package/dist/Select-pbrPLreh.js
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { jsxs as r, jsx as e, Fragment as n } from "react/jsx-runtime";
|
|
2
|
-
import { O as B, F as N } from "./OutlinedButton-DaLKO8zx.js";
|
|
3
|
-
import { B as l } from "./useSplash-7h6ni4l2.js";
|
|
4
|
-
import { Select as S, SelectValue as m, ListBox as T, Text as d, ListBoxItem as b } from "react-aria-components";
|
|
5
|
-
import { P as k } from "./Popover-D3iGWJwQ.js";
|
|
6
|
-
import { ChevronsUpDown as V, Check as y } from "lucide-react";
|
|
7
|
-
import { T as C } from "./TextButton-BJRez1un.js";
|
|
8
|
-
import { C as p } from "./types-C1YOMbh5.js";
|
|
9
|
-
import { T as F } from "./Tooltip-DAYtebkl.js";
|
|
10
|
-
import { L as $, F as L } from "./FieldError-CZn24fiL.js";
|
|
11
|
-
import './assets/Select.css';const D = "_select_3q7jl_1", w = "_trigger_3q7jl_31", i = {
|
|
12
|
-
select: D,
|
|
13
|
-
"selected-value": "_selected-value_3q7jl_11",
|
|
14
|
-
"option-description": "_option-description_3q7jl_13",
|
|
15
|
-
trigger: w,
|
|
16
|
-
"options-list": "_options-list_3q7jl_45",
|
|
17
|
-
"options-item-group": "_options-item-group_3q7jl_57",
|
|
18
|
-
"options-item": "_options-item_3q7jl_57"
|
|
19
|
-
}, K = ({
|
|
20
|
-
options: u,
|
|
21
|
-
label: a,
|
|
22
|
-
name: _,
|
|
23
|
-
disabled: h,
|
|
24
|
-
isRequired: f,
|
|
25
|
-
triggerVariant: g = l.filled,
|
|
26
|
-
description: j,
|
|
27
|
-
placeholder: c,
|
|
28
|
-
selectedKey: x,
|
|
29
|
-
onSelectionChange: v
|
|
30
|
-
}) => {
|
|
31
|
-
let s;
|
|
32
|
-
switch (g) {
|
|
33
|
-
case l.filled:
|
|
34
|
-
s = N;
|
|
35
|
-
break;
|
|
36
|
-
case l.outlined:
|
|
37
|
-
s = B;
|
|
38
|
-
break;
|
|
39
|
-
case l.text:
|
|
40
|
-
s = C;
|
|
41
|
-
break;
|
|
42
|
-
}
|
|
43
|
-
return /* @__PURE__ */ r(
|
|
44
|
-
S,
|
|
45
|
-
{
|
|
46
|
-
className: i.select,
|
|
47
|
-
isDisabled: h,
|
|
48
|
-
isRequired: f,
|
|
49
|
-
name: _,
|
|
50
|
-
selectedKey: x,
|
|
51
|
-
onSelectionChange: v,
|
|
52
|
-
children: [
|
|
53
|
-
a && /* @__PURE__ */ e($, { children: a }),
|
|
54
|
-
/* @__PURE__ */ e(F, { description: j, theme: p.inverseSurface, children: /* @__PURE__ */ e(s, { theme: p.inverseSurface, children: /* @__PURE__ */ r("span", { className: i.trigger, children: [
|
|
55
|
-
c ? /* @__PURE__ */ e(m, { className: `${i["selected-value"]}`, children: ({ defaultChildren: t, isPlaceholder: o }) => o ? c : t }) : /* @__PURE__ */ e(m, {}),
|
|
56
|
-
/* @__PURE__ */ e(V, {})
|
|
57
|
-
] }) }) }),
|
|
58
|
-
/* @__PURE__ */ e(L, {}),
|
|
59
|
-
/* @__PURE__ */ e(k, { children: /* @__PURE__ */ e(T, { className: `${i["options-list"]}`, items: u, children: (t) => {
|
|
60
|
-
const o = /* @__PURE__ */ r(n, { children: [
|
|
61
|
-
/* @__PURE__ */ e(d, { children: t.displayValue }),
|
|
62
|
-
t.description && /* @__PURE__ */ e(d, { className: i["option-description"], children: t.description })
|
|
63
|
-
] });
|
|
64
|
-
return /* @__PURE__ */ e(
|
|
65
|
-
b,
|
|
66
|
-
{
|
|
67
|
-
className: `${i["options-item-group"]}`,
|
|
68
|
-
id: t.key,
|
|
69
|
-
textValue: t.displayValue,
|
|
70
|
-
isDisabled: t.disabled,
|
|
71
|
-
children: ({ isSelected: q }) => /* @__PURE__ */ r(n, { children: [
|
|
72
|
-
/* @__PURE__ */ e("div", { className: `${i["options-item"]}`, children: o }),
|
|
73
|
-
q && /* @__PURE__ */ e(y, {})
|
|
74
|
-
] })
|
|
75
|
-
},
|
|
76
|
-
t.key
|
|
77
|
-
);
|
|
78
|
-
} }) })
|
|
79
|
-
]
|
|
80
|
-
}
|
|
81
|
-
);
|
|
82
|
-
};
|
|
83
|
-
export {
|
|
84
|
-
K as S
|
|
85
|
-
};
|