@okam/stack-ui 2.0.3 → 2.1.0
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/components/fields/SearchField/interface.d.ts +9 -2
- package/components/fields/TextArea/attributes.d.ts +1 -0
- package/components/fields/TextInputField/attributes.d.ts +1 -0
- package/index.d.ts +1 -0
- package/index119.js +1 -1
- package/index119.mjs +1 -1
- package/index122.js +1 -1
- package/index122.mjs +22 -22
- package/index131.js +1 -1
- package/index131.mjs +1 -1
- package/index133.js +1 -1
- package/index133.mjs +11 -14
- package/index134.js +1 -1
- package/index134.mjs +12 -7
- package/index135.js +1 -1
- package/index135.mjs +14 -7
- package/index136.js +1 -1
- package/index136.mjs +6 -15
- package/index137.js +1 -1
- package/index137.mjs +7 -31
- package/index138.js +1 -2
- package/index138.mjs +15 -8
- package/index139.js +1 -2
- package/index139.mjs +30 -9
- package/index140.js +2 -1
- package/index140.mjs +8 -23
- package/index141.js +1 -1
- package/index141.mjs +8 -45
- package/index142.js +1 -1
- package/index142.mjs +24 -52
- package/index143.js +2 -6
- package/index143.mjs +45 -92
- package/index144.js +1 -1
- package/index144.mjs +52 -70
- package/index145.js +6 -1
- package/index145.mjs +82 -29
- package/index146.js +1 -51
- package/index146.mjs +65 -86
- package/index147.js +1 -64
- package/index147.mjs +33 -220
- package/index148.js +51 -10
- package/index148.mjs +85 -65
- package/index149.js +64 -1
- package/index149.mjs +214 -31
- package/index150.js +10 -1
- package/index150.mjs +68 -10
- package/index151.js +1 -7
- package/index151.mjs +42 -47
- package/index152.js +1 -5
- package/index152.mjs +10 -85
- package/index153.js +7 -1
- package/index153.mjs +50 -6
- package/index154.js +4 -11
- package/index154.mjs +78 -30
- package/index155.js +1 -1
- package/index155.mjs +6 -96
- package/index156.js +12 -1
- package/index156.mjs +39 -12
- package/index157.js +1 -1
- package/index157.mjs +96 -8
- package/index158.js +1 -1
- package/index158.mjs +13 -29
- package/index159.js +1 -1
- package/index159.mjs +7 -12
- package/index160.js +1 -7
- package/index160.mjs +23 -13
- package/index161.js +1 -15
- package/index161.mjs +9 -67
- package/index162.js +7 -1
- package/index162.mjs +22 -6
- package/index163.js +15 -9
- package/index163.mjs +68 -12
- package/index164.js +1 -41
- package/index164.mjs +7 -106
- package/index165.js +9 -47
- package/index165.mjs +13 -100
- package/index166.js +40 -15
- package/index166.mjs +100 -19
- package/index167.js +45 -18
- package/index167.mjs +85 -59
- package/index168.js +16 -1
- package/index168.mjs +20 -37
- package/index169.js +20 -1
- package/index169.mjs +76 -12
- package/index170.js +1 -1
- package/index170.mjs +41 -10
- package/index171.js +1 -1
- package/index171.mjs +11 -6
- package/index172.js +1 -2
- package/index172.mjs +6 -47
- package/index173.js +2 -0
- package/index173.mjs +50 -0
- package/index174.js +1 -0
- package/index174.mjs +13 -0
- package/index2.js +1 -1
- package/index2.mjs +4 -4
- package/index38.js +1 -1
- package/index38.mjs +19 -19
- package/index39.js +1 -1
- package/index39.mjs +11 -11
- package/index43.js +1 -1
- package/index43.mjs +55 -52
- package/index46.js +1 -1
- package/index46.mjs +86 -87
- package/index47.js +1 -1
- package/index47.mjs +110 -111
- package/index48.js +1 -1
- package/index48.mjs +3 -3
- package/index52.js +1 -1
- package/index52.mjs +1 -1
- package/index53.js +1 -1
- package/index53.mjs +1 -1
- package/index54.js +1 -1
- package/index54.mjs +3 -3
- package/index66.js +1 -1
- package/index66.mjs +1 -1
- package/index68.js +1 -1
- package/index68.mjs +11 -11
- package/index72.js +1 -1
- package/index72.mjs +13 -13
- package/index76.js +1 -1
- package/index76.mjs +1 -1
- package/index8.js +1 -1
- package/index8.mjs +30 -30
- package/index91.js +1 -1
- package/index91.mjs +50 -49
- package/package.json +1 -1
- package/theme/Search/index.d.ts +2 -1
package/index43.mjs
CHANGED
|
@@ -1,67 +1,70 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { useRef as
|
|
4
|
-
import { useSearchField as
|
|
2
|
+
import { jsxs as p, jsx as t } from "react/jsx-runtime";
|
|
3
|
+
import { useRef as w, useCallback as B } from "react";
|
|
4
|
+
import { useSearchField as A } from "react-aria";
|
|
5
5
|
import { useSearchFieldState as F } from "react-stately";
|
|
6
|
-
import
|
|
7
|
-
import { useUserQueryValHook as
|
|
6
|
+
import M from "./index88.mjs";
|
|
7
|
+
import { useUserQueryValHook as j } from "./index90.mjs";
|
|
8
8
|
import { Box as m } from "./index7.mjs";
|
|
9
|
-
import { Button as
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import { Typography as
|
|
13
|
-
function
|
|
14
|
-
return
|
|
9
|
+
import { Button as I } from "./index8.mjs";
|
|
10
|
+
import Q from "./index99.mjs";
|
|
11
|
+
import U from "./index130.mjs";
|
|
12
|
+
import { Typography as E } from "./index74.mjs";
|
|
13
|
+
function H({ value: n, clearButtonProps: r, isDisabled: a, tokens: e, themeName: l }) {
|
|
14
|
+
return n === "" ? /* @__PURE__ */ t(m, { as: "span", themeName: `${l}.icon`, tokens: e, "aria-hidden": "true", children: /* @__PURE__ */ t(U, { width: "16", height: "16" }) }) : /* @__PURE__ */ t(
|
|
15
|
+
I,
|
|
16
|
+
{
|
|
17
|
+
...r,
|
|
18
|
+
isDisabled: a,
|
|
19
|
+
handlePress: r.onPress,
|
|
20
|
+
tokens: { ...e, isIconOnly: !0, buttonStyle: "hollow" },
|
|
21
|
+
themeName: `${l}.button`,
|
|
22
|
+
children: /* @__PURE__ */ t(Q, { width: "16", height: "16" })
|
|
23
|
+
}
|
|
24
|
+
);
|
|
15
25
|
}
|
|
16
|
-
function
|
|
17
|
-
const { setUserSearchQuery:
|
|
18
|
-
label:
|
|
19
|
-
themeName:
|
|
20
|
-
tokens:
|
|
21
|
-
customTheme:
|
|
22
|
-
disabled:
|
|
23
|
-
errorMessage:
|
|
24
|
-
placeholder:
|
|
25
|
-
|
|
26
|
-
isDisabled:
|
|
27
|
-
} =
|
|
28
|
-
(
|
|
29
|
-
|
|
26
|
+
function Y(n) {
|
|
27
|
+
const { setUserSearchQuery: r } = j(), {
|
|
28
|
+
label: a,
|
|
29
|
+
themeName: e = "search",
|
|
30
|
+
tokens: l,
|
|
31
|
+
customTheme: f,
|
|
32
|
+
disabled: b,
|
|
33
|
+
errorMessage: c,
|
|
34
|
+
placeholder: g,
|
|
35
|
+
renderAction: k,
|
|
36
|
+
isDisabled: N
|
|
37
|
+
} = n, s = N || b, u = { ...n, isDisabled: s }, i = F(u), d = w(null), { labelProps: C, inputProps: h, errorMessageProps: P, clearButtonProps: S } = A(u, i, d), $ = B(
|
|
38
|
+
(v) => {
|
|
39
|
+
r(i.value), h.onChange?.(v);
|
|
30
40
|
},
|
|
31
|
-
[
|
|
32
|
-
),
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
41
|
+
[r, i.value, h]
|
|
42
|
+
), y = c != null, o = { ...l, isError: y, isDisabled: s ?? !1 }, D = M(`${e}.input`, o, f), x = k ?? H, T = {
|
|
43
|
+
value: i.value,
|
|
44
|
+
clearButtonProps: S,
|
|
45
|
+
isDisabled: s ?? !1,
|
|
46
|
+
tokens: o,
|
|
47
|
+
themeName: e ?? "search"
|
|
48
|
+
};
|
|
49
|
+
return /* @__PURE__ */ p(m, { themeName: `${e}.wrapper`, tokens: o, "aria-disabled": s ?? !1, children: [
|
|
50
|
+
a != null && /* @__PURE__ */ t(m, { ...C, as: "label", themeName: `${e}.label`, tokens: o, children: a }),
|
|
51
|
+
/* @__PURE__ */ p(m, { themeName: `${e}.container`, tokens: o, children: [
|
|
52
|
+
/* @__PURE__ */ t(
|
|
37
53
|
"input",
|
|
38
54
|
{
|
|
39
|
-
ref:
|
|
40
|
-
...
|
|
41
|
-
onChange:
|
|
42
|
-
placeholder:
|
|
55
|
+
ref: d,
|
|
56
|
+
...h,
|
|
57
|
+
onChange: $,
|
|
58
|
+
placeholder: g,
|
|
43
59
|
className: D,
|
|
44
|
-
disabled:
|
|
60
|
+
disabled: s
|
|
45
61
|
}
|
|
46
62
|
),
|
|
47
|
-
/* @__PURE__ */
|
|
48
|
-
R,
|
|
49
|
-
{
|
|
50
|
-
isDisabled: o,
|
|
51
|
-
handlePress: S.onPress,
|
|
52
|
-
tokens: { isIconOnly: !0, buttonStyle: "hollow", isDisabled: o ?? !1 },
|
|
53
|
-
themeName: `${s}.icon`,
|
|
54
|
-
"aria-label": "clear",
|
|
55
|
-
children: [
|
|
56
|
-
l == null && /* @__PURE__ */ e(E, { value: n.value }),
|
|
57
|
-
l != null && l
|
|
58
|
-
]
|
|
59
|
-
}
|
|
60
|
-
) })
|
|
63
|
+
/* @__PURE__ */ t(x, { ...T })
|
|
61
64
|
] }),
|
|
62
|
-
|
|
65
|
+
c != null && /* @__PURE__ */ t(E, { themeName: `${e}.errorMessage`, tokens: o, ...P, children: c })
|
|
63
66
|
] });
|
|
64
67
|
}
|
|
65
68
|
export {
|
|
66
|
-
|
|
69
|
+
Y as default
|
|
67
70
|
};
|
package/index46.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),P=require("@react-aria/utils"),$=require("radashi"),D=require("react"),O=require("react-aria"),y=require("react-hook-form"),h=require("./index88.js"),H=require("./index89.js"),I=require("./index74.js"),w=require("./index133.js");function C(t){const{id:b,label:r,name:p,placeholder:g,required:f,disabled:o=!1,errorMessage:l,ariaLabel:T,value:u,onBlur:c,onChange:v,fieldRef:M,themeName:a="textarea",tokens:j,customTheme:i,children:k}=t,R=D.useRef(null),{errorMessageProps:d,inputProps:E,labelProps:n}=O.useTextField(t,R),e={...j,isDisabled:o,isError:l!=null},F=h(`${a}.wrapper`,e,i),N=h(`${a}.input`,e,i),A=h(`${a}.label`,e,i),q=h(`${a}.container`,e,i);return s.jsxs("div",{children:[s.jsxs("div",{className:F,"aria-disabled":o?"true":"false",children:[r!=null&&s.jsx("label",{className:A,...n,children:r}),s.jsx(O.FocusRing,{focusRingClass:"has-focus-ring",children:s.jsxs("div",{className:q,children:[k,s.jsx("textarea",{...E,ref:x=>{M?.(x),R.current=x},className:N,placeholder:g,disabled:o,required:f,id:b,name:p,"aria-label":T,"aria-labelledby":b,value:u,onBlur:c,onChange:v})]})})]}),l!=null&&s.jsx(I.Typography,{themeName:`${a}.errorMessage`,tokens:e,...d,children:l})]})}function B({name:t,label:b,rules:r,tokens:p,ariaLabel:g,defaultValue:f="",placeholder:o="",themeName:l="textarea",isReadOnly:T=!1,minLength:u,maxLength:c,required:v,isRequired:M,onChange:a,onBlur:j,children:i=null,...k}){const{control:R}=y.useFormContext(),{t:d}=H.useTranslation(),E={required:v??M?d("FORM.ERROR.REQUIRED")??"required":!1,...u!=null&&{minLength:{value:u,message:d("FORM.ERROR.MIN_LENGTH",{length:u})}},...c!=null&&{maxLength:{value:c,message:d("FORM.ERROR.MAX_LENGTH",{length:c})}},...r};return s.jsx(y.Controller,{name:t,control:R,rules:E,disabled:r?.disabled,defaultValue:f,render:({field:n,fieldState:e})=>{const{ref:F,...N}=n,A=!$.isEmpty(e.error),q={isDisabled:n.disabled??!1,isRequired:r?.required===!0||r?.required==="required",isInvalid:e.invalid,isError:A,isReadOnly:T},x={...p,...q};return s.jsx(C,{...N,...q,...P.filterDOMProps(k,{events:!0,labelable:!0,isLink:!1,global:!0,propNames:new Set([...w.textAreaAttributes])}),fieldRef:F,name:t,placeholder:o,themeName:l,label:b,tokens:x,ariaLabel:g,isDisabled:n.disabled,isRequired:r?.required===!0||r?.required==="required",isInvalid:e.invalid,errorMessage:e.error?.message,onChange:m=>{n.onChange(m),a?.(m)},onBlur:m=>{n.onBlur(),j?.(m)},children:i})}})}exports.ReactHookFormTextArea=B;exports.TextArea=C;
|
package/index46.mjs
CHANGED
|
@@ -1,142 +1,141 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
2
|
+
import { jsx as i, jsxs as y } from "react/jsx-runtime";
|
|
3
|
+
import { filterDOMProps as A } from "@react-aria/utils";
|
|
4
|
+
import { isEmpty as D } from "radashi";
|
|
5
|
+
import { useRef as P } from "react";
|
|
6
|
+
import { useTextField as $, FocusRing as I } from "react-aria";
|
|
7
|
+
import { useFormContext as w, Controller as B } from "react-hook-form";
|
|
7
8
|
import h from "./index88.mjs";
|
|
8
9
|
import { useTranslation as H } from "./index89.mjs";
|
|
9
|
-
import { Typography as
|
|
10
|
-
|
|
10
|
+
import { Typography as j } from "./index74.mjs";
|
|
11
|
+
import { textAreaAttributes as G } from "./index133.mjs";
|
|
12
|
+
function L(l) {
|
|
11
13
|
const {
|
|
12
|
-
id:
|
|
14
|
+
id: m,
|
|
13
15
|
label: r,
|
|
14
16
|
name: g,
|
|
15
17
|
placeholder: v,
|
|
16
18
|
required: T,
|
|
17
|
-
disabled:
|
|
19
|
+
disabled: n = !1,
|
|
18
20
|
errorMessage: t,
|
|
19
21
|
ariaLabel: q,
|
|
20
|
-
value:
|
|
21
|
-
onBlur:
|
|
22
|
-
onChange:
|
|
23
|
-
fieldRef:
|
|
24
|
-
themeName:
|
|
25
|
-
tokens:
|
|
26
|
-
customTheme:
|
|
27
|
-
children:
|
|
28
|
-
} =
|
|
22
|
+
value: u,
|
|
23
|
+
onBlur: d,
|
|
24
|
+
onChange: x,
|
|
25
|
+
fieldRef: M,
|
|
26
|
+
themeName: s = "textarea",
|
|
27
|
+
tokens: E,
|
|
28
|
+
customTheme: a,
|
|
29
|
+
children: N
|
|
30
|
+
} = l, p = P(null), { errorMessageProps: c, inputProps: F, labelProps: o } = $(l, p), e = { ...E, isDisabled: n, isError: t != null }, k = h(`${s}.wrapper`, e, a), C = h(`${s}.input`, e, a), O = h(`${s}.label`, e, a), f = h(`${s}.container`, e, a);
|
|
29
31
|
return /* @__PURE__ */ y("div", { children: [
|
|
30
|
-
/* @__PURE__ */ y("div", { className:
|
|
31
|
-
r != null && /* @__PURE__ */
|
|
32
|
-
/* @__PURE__ */
|
|
33
|
-
|
|
34
|
-
/* @__PURE__ */
|
|
32
|
+
/* @__PURE__ */ y("div", { className: k, "aria-disabled": n ? "true" : "false", children: [
|
|
33
|
+
r != null && /* @__PURE__ */ i("label", { className: O, ...o, children: r }),
|
|
34
|
+
/* @__PURE__ */ i(I, { focusRingClass: "has-focus-ring", children: /* @__PURE__ */ y("div", { className: f, children: [
|
|
35
|
+
N,
|
|
36
|
+
/* @__PURE__ */ i(
|
|
35
37
|
"textarea",
|
|
36
38
|
{
|
|
37
|
-
...
|
|
38
|
-
ref: (
|
|
39
|
-
|
|
39
|
+
...F,
|
|
40
|
+
ref: (b) => {
|
|
41
|
+
M?.(b), p.current = b;
|
|
40
42
|
},
|
|
41
|
-
className:
|
|
43
|
+
className: C,
|
|
42
44
|
placeholder: v,
|
|
43
|
-
disabled:
|
|
45
|
+
disabled: n,
|
|
44
46
|
required: T,
|
|
45
|
-
id:
|
|
47
|
+
id: m,
|
|
46
48
|
name: g,
|
|
47
49
|
"aria-label": q,
|
|
48
|
-
"aria-labelledby":
|
|
49
|
-
value:
|
|
50
|
-
onBlur:
|
|
51
|
-
onChange:
|
|
50
|
+
"aria-labelledby": m,
|
|
51
|
+
value: u,
|
|
52
|
+
onBlur: d,
|
|
53
|
+
onChange: x
|
|
52
54
|
}
|
|
53
55
|
)
|
|
54
56
|
] }) })
|
|
55
57
|
] }),
|
|
56
|
-
t != null && /* @__PURE__ */
|
|
58
|
+
t != null && /* @__PURE__ */ i(j, { themeName: `${s}.errorMessage`, tokens: e, ...c, children: t })
|
|
57
59
|
] });
|
|
58
60
|
}
|
|
59
|
-
function
|
|
60
|
-
name:
|
|
61
|
-
label:
|
|
61
|
+
function Z({
|
|
62
|
+
name: l,
|
|
63
|
+
label: m,
|
|
62
64
|
rules: r,
|
|
63
65
|
tokens: g,
|
|
64
66
|
ariaLabel: v,
|
|
65
67
|
defaultValue: T = "",
|
|
66
|
-
placeholder:
|
|
68
|
+
placeholder: n = "",
|
|
67
69
|
themeName: t = "textarea",
|
|
68
70
|
isReadOnly: q = !1,
|
|
69
|
-
minLength:
|
|
70
|
-
maxLength:
|
|
71
|
-
required:
|
|
72
|
-
isRequired:
|
|
73
|
-
onChange:
|
|
74
|
-
onBlur:
|
|
75
|
-
children:
|
|
76
|
-
...
|
|
71
|
+
minLength: u,
|
|
72
|
+
maxLength: d,
|
|
73
|
+
required: x,
|
|
74
|
+
isRequired: M,
|
|
75
|
+
onChange: s,
|
|
76
|
+
onBlur: E,
|
|
77
|
+
children: a = null,
|
|
78
|
+
...N
|
|
77
79
|
}) {
|
|
78
|
-
const { control:
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}, O = {
|
|
82
|
-
required: E ?? x ? c("FORM.ERROR.REQUIRED") ?? "required" : !1,
|
|
83
|
-
...d != null && {
|
|
80
|
+
const { control: p } = w(), { t: c } = H(), F = {
|
|
81
|
+
required: x ?? M ? c("FORM.ERROR.REQUIRED") ?? "required" : !1,
|
|
82
|
+
...u != null && {
|
|
84
83
|
minLength: {
|
|
85
|
-
value:
|
|
86
|
-
message: c("FORM.ERROR.MIN_LENGTH", { length:
|
|
84
|
+
value: u,
|
|
85
|
+
message: c("FORM.ERROR.MIN_LENGTH", { length: u })
|
|
87
86
|
}
|
|
88
87
|
},
|
|
89
|
-
...
|
|
88
|
+
...d != null && {
|
|
90
89
|
maxLength: {
|
|
91
|
-
value:
|
|
92
|
-
message: c("FORM.ERROR.MAX_LENGTH", { length:
|
|
90
|
+
value: d,
|
|
91
|
+
message: c("FORM.ERROR.MAX_LENGTH", { length: d })
|
|
93
92
|
}
|
|
94
93
|
},
|
|
95
94
|
...r
|
|
96
95
|
};
|
|
97
|
-
return /* @__PURE__ */
|
|
96
|
+
return /* @__PURE__ */ i(
|
|
98
97
|
B,
|
|
99
98
|
{
|
|
100
|
-
name:
|
|
101
|
-
control:
|
|
102
|
-
rules:
|
|
99
|
+
name: l,
|
|
100
|
+
control: p,
|
|
101
|
+
rules: F,
|
|
103
102
|
disabled: r?.disabled,
|
|
104
103
|
defaultValue: T,
|
|
105
|
-
render: ({ field:
|
|
106
|
-
const { ref:
|
|
107
|
-
isDisabled:
|
|
104
|
+
render: ({ field: o, fieldState: e }) => {
|
|
105
|
+
const { ref: k, ...C } = o, O = !D(e.error), f = {
|
|
106
|
+
isDisabled: o.disabled ?? !1,
|
|
108
107
|
isRequired: r?.required === !0 || r?.required === "required",
|
|
109
|
-
isInvalid:
|
|
110
|
-
isError:
|
|
108
|
+
isInvalid: e.invalid,
|
|
109
|
+
isError: O,
|
|
111
110
|
isReadOnly: q
|
|
112
|
-
},
|
|
111
|
+
}, b = {
|
|
113
112
|
...g,
|
|
114
|
-
...
|
|
113
|
+
...f
|
|
115
114
|
};
|
|
116
|
-
return /* @__PURE__ */
|
|
117
|
-
|
|
115
|
+
return /* @__PURE__ */ i(
|
|
116
|
+
L,
|
|
118
117
|
{
|
|
119
118
|
...C,
|
|
120
|
-
...
|
|
121
|
-
...N(),
|
|
122
|
-
fieldRef:
|
|
123
|
-
name:
|
|
124
|
-
placeholder:
|
|
119
|
+
...f,
|
|
120
|
+
...A(N, { events: !0, labelable: !0, isLink: !1, global: !0, propNames: /* @__PURE__ */ new Set([...G]) }),
|
|
121
|
+
fieldRef: k,
|
|
122
|
+
name: l,
|
|
123
|
+
placeholder: n,
|
|
125
124
|
themeName: t,
|
|
126
|
-
label:
|
|
127
|
-
tokens:
|
|
125
|
+
label: m,
|
|
126
|
+
tokens: b,
|
|
128
127
|
ariaLabel: v,
|
|
129
|
-
isDisabled:
|
|
128
|
+
isDisabled: o.disabled,
|
|
130
129
|
isRequired: r?.required === !0 || r?.required === "required",
|
|
131
|
-
isInvalid:
|
|
132
|
-
errorMessage:
|
|
133
|
-
onChange: (
|
|
134
|
-
|
|
130
|
+
isInvalid: e.invalid,
|
|
131
|
+
errorMessage: e.error?.message,
|
|
132
|
+
onChange: (R) => {
|
|
133
|
+
o.onChange(R), s?.(R);
|
|
135
134
|
},
|
|
136
|
-
onBlur: (
|
|
137
|
-
|
|
135
|
+
onBlur: (R) => {
|
|
136
|
+
o.onBlur(), E?.(R);
|
|
138
137
|
},
|
|
139
|
-
children:
|
|
138
|
+
children: a
|
|
140
139
|
}
|
|
141
140
|
);
|
|
142
141
|
}
|
|
@@ -144,6 +143,6 @@ function K({
|
|
|
144
143
|
);
|
|
145
144
|
}
|
|
146
145
|
export {
|
|
147
|
-
|
|
148
|
-
|
|
146
|
+
Z as ReactHookFormTextArea,
|
|
147
|
+
L as TextArea
|
|
149
148
|
};
|
package/index47.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),C=require("@react-aria/utils"),H=require("radashi"),w=require("react"),O=require("react-aria"),D=require("react-hook-form"),A=require("./index88.js"),G=require("./index89.js"),g=require("./index7.js"),B=require("./index48.js"),L=require("./index74.js"),_=require("./index134.js");function P(R){const{icon:p,errorIcon:r,label:a,isRequired:m=!1,isDisabled:q=!1,isInvalid:f=!1,required:k,disabled:I,errorMessage:s,fieldRef:u,children:j,themeName:n="textInput",tokens:F,customTheme:t,ariaLabel:M,placeholder:N,isReadOnly:T=!1,...v}=R,x=w.useRef(null),d=k??m,E=I??q,{labelProps:o,inputProps:l,errorMessageProps:$}=O.useTextField({label:a,errorMessage:s,isRequired:d,isDisabled:E,isInvalid:f,isReadOnly:T,...v},x),y=c=>{c!=null&&(u?.(c),x.current=c)},i={...F,isDisabled:q,isRequired:m,isError:s!=null},b=A(`${n}.input`,i);return e.jsxs(g.Box,{children:[e.jsx(O.FocusRing,{focusRingClass:"has-focus-ring",within:!0,children:e.jsxs(g.Box,{"aria-disabled":l.disabled,themeName:`${n}.wrapper`,tokens:i,customTheme:t,children:[a!=null&&e.jsx(g.Box,{as:"label",tokens:i,themeName:`${n}.label`,customTheme:t,...o,children:a}),e.jsxs(g.Box,{themeName:`${n}.container`,tokens:i,customTheme:t,children:[j,e.jsx("input",{"aria-label":M,...l,placeholder:N,ref:y,className:b})]}),p!=null&&e.jsx(B,{themeName:`${n}.icon`,tokens:i,customTheme:t,icon:p,"aria-hidden":!0}),s!=null&&r!=null&&e.jsx(B,{themeName:`${n}.errorIcon`,tokens:i,customTheme:t,icon:r,"aria-hidden":!0})]})}),s!=null&&e.jsx(L.Typography,{themeName:`${n}.errorMessage`,tokens:i,customTheme:t,...$,children:s})]})}function Q({name:R,label:p,rules:r,tokens:a,ariaLabel:m,defaultValue:q="",placeholder:f="",themeName:k="textInput",isReadOnly:I=!1,minLength:s,maxLength:u,required:j,isRequired:n,onChange:F,onBlur:t,children:M=null,errorIcon:N,icon:T,...v}){const{control:x}=D.useFormContext(),{t:d}=G.useTranslation(),E={required:j??n?d("FORM.ERROR.REQUIRED")??"required":!1,...s!=null&&{minLength:{value:s,message:d("FORM.ERROR.MIN_LENGTH",{length:s})}},...u!=null&&{maxLength:{value:u,message:d("FORM.ERROR.MAX_LENGTH",{length:u})}},...r};return e.jsx(D.Controller,{name:R,control:x,rules:E,disabled:r?.disabled,defaultValue:q,render:({field:o,fieldState:l})=>{const{ref:$,...y}=o,i=!H.isEmpty(l.error),b={isDisabled:o.disabled??!1,isRequired:r?.required===!0||r?.required==="required",isInvalid:l.invalid,isError:i,isReadOnly:I},c={...a,...b};return e.jsx(P,{...y,...b,...C.filterDOMProps(v,{events:!0,labelable:!0,isLink:!1,global:!0,propNames:new Set([..._.textInputAttributes])}),fieldRef:$,name:R,placeholder:f,themeName:k,label:p,tokens:c,ariaLabel:m,isDisabled:o.disabled,isRequired:r?.required===!0||r?.required==="required",isInvalid:l.invalid,errorMessage:l.error?.message,onChange:h=>{o.onChange(h),F?.(h)},onBlur:h=>{o.onBlur(),t?.(h)},icon:T,errorIcon:N,children:M})}})}exports.ReactHookFormInput=Q;exports.TextInputField=P;
|