@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/index169.mjs
CHANGED
|
@@ -1,14 +1,78 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { tv as e } from "tailwind-variants";
|
|
2
|
+
import r from "./index170.mjs";
|
|
3
|
+
const t = e({
|
|
4
|
+
base: `
|
|
5
|
+
relative
|
|
6
|
+
group
|
|
7
|
+
flex
|
|
8
|
+
items-center
|
|
9
|
+
gap-4
|
|
10
|
+
rounded-md
|
|
11
|
+
px-4
|
|
12
|
+
py-1
|
|
13
|
+
mb-3
|
|
14
|
+
m-0.5
|
|
15
|
+
border-2
|
|
16
|
+
aria-disabled:pointer-events-none
|
|
17
|
+
aria-disabled:opacity-30
|
|
18
|
+
focus-ring-black
|
|
19
|
+
`,
|
|
20
|
+
variants: {
|
|
21
|
+
isError: {
|
|
22
|
+
true: "border-error"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}), a = e({
|
|
26
|
+
base: "flex flex-col order-2"
|
|
27
|
+
}), n = e({
|
|
28
|
+
base: "flex items-center gap-2"
|
|
29
|
+
}), o = e({
|
|
30
|
+
base: `
|
|
31
|
+
group-has-[:required]:after:content-["_*"]
|
|
32
|
+
group-has-[:required]:after:text-red-500
|
|
33
|
+
text-xs
|
|
34
|
+
`
|
|
35
|
+
}), s = e({
|
|
36
|
+
base: ""
|
|
37
|
+
}), i = e({
|
|
38
|
+
extend: r,
|
|
39
|
+
base: "ml-0",
|
|
40
|
+
variants: {
|
|
41
|
+
isError: {
|
|
42
|
+
false: "hidden"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
defaultVariants: {
|
|
46
|
+
isError: !1,
|
|
47
|
+
size: "footnotes"
|
|
48
|
+
}
|
|
49
|
+
}), p = e({
|
|
50
|
+
base: [r(), "order-1"],
|
|
51
|
+
variants: {
|
|
52
|
+
isDisabled: {
|
|
53
|
+
true: "text-gray-300"
|
|
54
|
+
},
|
|
55
|
+
isError: {
|
|
56
|
+
true: "hidden"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}), u = e({
|
|
60
|
+
base: [r({ isError: !0 }), "order-3"],
|
|
61
|
+
variants: {
|
|
62
|
+
isError: {
|
|
63
|
+
false: "hidden"
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}), x = {
|
|
67
|
+
wrapper: t,
|
|
68
|
+
container: n,
|
|
69
|
+
inputWrapper: a,
|
|
70
|
+
label: o,
|
|
71
|
+
input: s,
|
|
72
|
+
errorMessage: i,
|
|
73
|
+
icon: p,
|
|
74
|
+
errorIcon: u
|
|
75
|
+
};
|
|
12
76
|
export {
|
|
13
|
-
|
|
77
|
+
x as default
|
|
14
78
|
};
|
package/index170.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";const t=require("tailwind-variants"),e=t.tv({variants:{size:{h1:"text-5xl",h2:"text-4xl",h3:"text-3xl",h4:"text-2xl",h5:"text-xl",h6:"text-lg",leading:"text-md font-bold leading-normal",paragraph:"text-md inline",footnotes:"text-sm",xs:"text-xs"},font:{body:"font-body"},weight:{normal:"font-normal",light:"font-light",bold:"font-bold"},color:{gray:"text-gray-500",white:"text-white"},isError:{true:"text-sm text-error"},align:{center:"text-center",left:"text-left",right:"text-right"}},defaultVariants:{size:"paragraph",font:"body"}});module.exports=e;
|
package/index170.mjs
CHANGED
|
@@ -1,13 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { tv as t } from "tailwind-variants";
|
|
2
|
+
const o = t({
|
|
3
|
+
variants: {
|
|
4
|
+
size: {
|
|
5
|
+
h1: "text-5xl",
|
|
6
|
+
h2: "text-4xl",
|
|
7
|
+
h3: "text-3xl",
|
|
8
|
+
h4: "text-2xl",
|
|
9
|
+
h5: "text-xl",
|
|
10
|
+
h6: "text-lg",
|
|
11
|
+
leading: "text-md font-bold leading-normal",
|
|
12
|
+
paragraph: "text-md inline",
|
|
13
|
+
footnotes: "text-sm",
|
|
14
|
+
xs: "text-xs"
|
|
15
|
+
},
|
|
16
|
+
font: {
|
|
17
|
+
body: "font-body"
|
|
18
|
+
},
|
|
19
|
+
weight: {
|
|
20
|
+
normal: "font-normal",
|
|
21
|
+
light: "font-light",
|
|
22
|
+
bold: "font-bold"
|
|
23
|
+
},
|
|
24
|
+
color: {
|
|
25
|
+
gray: "text-gray-500",
|
|
26
|
+
white: "text-white"
|
|
27
|
+
},
|
|
28
|
+
isError: {
|
|
29
|
+
true: "text-sm text-error"
|
|
30
|
+
},
|
|
31
|
+
align: {
|
|
32
|
+
center: "text-center",
|
|
33
|
+
left: "text-left",
|
|
34
|
+
right: "text-right"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
defaultVariants: {
|
|
38
|
+
size: "paragraph",
|
|
39
|
+
font: "body"
|
|
8
40
|
}
|
|
9
|
-
|
|
10
|
-
}
|
|
41
|
+
});
|
|
11
42
|
export {
|
|
12
|
-
|
|
43
|
+
o as default
|
|
13
44
|
};
|
package/index171.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";const u=require("react/jsx-runtime"),e=require("@react-spring/web"),T=require("./index88.js");function g(t){const{isVisible:o,children:i,themeName:n,tokens:r,customTheme:s,...a}=t,d=e.useTransition(o,{from:{gridTemplateRows:"0fr",paddingTop:"0",paddingBottom:"0"},enter:{gridTemplateRows:"1fr",paddingTop:"1rem",paddingBottom:"1rem"},leave:{gridTemplateRows:"0fr",paddingTop:"0",paddingBottom:"0"}}),m=T(n,r,s);return d((c,p)=>p&&u.jsx(e.animated.div,{...a,style:c,className:m,children:i}))}module.exports=g;
|
package/index171.mjs
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { jsx as T } from "react/jsx-runtime";
|
|
2
|
+
import { useTransition as c, animated as f } from "@react-spring/web";
|
|
3
|
+
import g from "./index88.mjs";
|
|
4
|
+
function w(e) {
|
|
5
|
+
const { isVisible: t, children: o, themeName: i, tokens: r, customTheme: n, ...m } = e, s = c(t, {
|
|
6
|
+
from: { gridTemplateRows: "0fr", paddingTop: "0", paddingBottom: "0" },
|
|
7
|
+
enter: { gridTemplateRows: "1fr", paddingTop: "1rem", paddingBottom: "1rem" },
|
|
8
|
+
leave: { gridTemplateRows: "0fr", paddingTop: "0", paddingBottom: "0" }
|
|
9
|
+
}), a = g(i, r, n);
|
|
10
|
+
return s((d, p) => p && /* @__PURE__ */ T(f.div, { ...m, style: d, className: a, children: o }));
|
|
6
11
|
}
|
|
7
12
|
export {
|
|
8
|
-
|
|
13
|
+
w as default
|
|
9
14
|
};
|
package/index172.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
"use
|
|
2
|
-
"use strict";const o=require("react/jsx-runtime"),i=require("@internationalized/date"),B=require("react"),n=require("react-aria"),c=require("./index7.js");function F(r){const{themeName:a="calendar",tokens:R,state:d,date:e}=r,u=B.useRef(null),{isUnavailable:k,cellProps:y,buttonProps:b,isSelected:t,isOutsideVisibleRange:h,isDisabled:C,formattedDate:S,isInvalid:q}=n.useCalendarCell(r,d,u),s=d?.highlightedRange,m=s?.start,f=s?.end,g=s!=null&&m!=null?i.isSameDay(e,m):t,x=s!=null&&f!=null?i.isSameDay(e,f):t,{locale:j}=n.useLocale(),D=i.getDayOfWeek(e,j),N=t&&(g||D===0||e.day===1),P=t&&(x||D===6||e.day===e.calendar.getDaysInMonth(e)),{focusProps:$,isFocusVisible:p}=n.useFocusRing(),l={isInvalid:q,isDisabled:C,isUnavailable:k,isSelected:t,isFocusVisible:p,isOutsideVisibleRange:h,...R};return o.jsx(c.Box,{as:"td",...y,"aria-disabled":!1,themeName:`${a}.cellContainer`,tokens:l,children:o.jsx(c.BoxWithForwardRef,{...n.mergeProps(b,$),ref:u,"aria-hidden":h,themeName:`${a}.cell`,tokens:{...l,isRoundedLeft:N,isRoundedRight:P},children:o.jsx(c.Box,{themeName:`${a}.cellDate`,tokens:{...l,isSelectionStart:g,isSelectionEnd:x},children:S})})})}module.exports=F;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function l(e,u){if(e==null)return!1;const{minValue:t,maxValue:n}=u;return t!=null&&e.compare(t)<0||n!=null&&e.compare(n)>0}exports.getIsDateOutsideRange=l;
|
package/index172.mjs
CHANGED
|
@@ -1,50 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { Box as p, BoxWithForwardRef as V } from "./index7.mjs";
|
|
7
|
-
function U(l) {
|
|
8
|
-
const { themeName: s = "calendar", tokens: D, state: i, date: e } = l, r = $(null), {
|
|
9
|
-
isUnavailable: R,
|
|
10
|
-
cellProps: k,
|
|
11
|
-
buttonProps: b,
|
|
12
|
-
isSelected: t,
|
|
13
|
-
isOutsideVisibleRange: c,
|
|
14
|
-
isDisabled: y,
|
|
15
|
-
formattedDate: C,
|
|
16
|
-
isInvalid: S
|
|
17
|
-
} = v(l, i, r), n = i?.highlightedRange, d = n?.start, m = n?.end, u = n != null && d != null ? g(e, d) : t, f = n != null && m != null ? g(e, m) : t, { locale: x } = B(), h = W(e, x), N = t && (u || h === 0 || e.day === 1), P = t && (f || h === 6 || e.day === e.calendar.getDaysInMonth(e)), { focusProps: F, isFocusVisible: O } = I(), a = {
|
|
18
|
-
isInvalid: S,
|
|
19
|
-
isDisabled: y,
|
|
20
|
-
isUnavailable: R,
|
|
21
|
-
isSelected: t,
|
|
22
|
-
isFocusVisible: O,
|
|
23
|
-
isOutsideVisibleRange: c,
|
|
24
|
-
...D
|
|
25
|
-
};
|
|
26
|
-
return /* @__PURE__ */ o(
|
|
27
|
-
p,
|
|
28
|
-
{
|
|
29
|
-
as: "td",
|
|
30
|
-
...k,
|
|
31
|
-
"aria-disabled": !1,
|
|
32
|
-
themeName: `${s}.cellContainer`,
|
|
33
|
-
tokens: a,
|
|
34
|
-
children: /* @__PURE__ */ o(
|
|
35
|
-
V,
|
|
36
|
-
{
|
|
37
|
-
...L(b, F),
|
|
38
|
-
ref: r,
|
|
39
|
-
"aria-hidden": c,
|
|
40
|
-
themeName: `${s}.cell`,
|
|
41
|
-
tokens: { ...a, isRoundedLeft: N, isRoundedRight: P },
|
|
42
|
-
children: /* @__PURE__ */ o(p, { themeName: `${s}.cellDate`, tokens: { ...a, isSelectionStart: u, isSelectionEnd: f }, children: C })
|
|
43
|
-
}
|
|
44
|
-
)
|
|
45
|
-
}
|
|
46
|
-
);
|
|
1
|
+
function r(e, u) {
|
|
2
|
+
if (e == null)
|
|
3
|
+
return !1;
|
|
4
|
+
const { minValue: n, maxValue: l } = u;
|
|
5
|
+
return n != null && e.compare(n) < 0 || l != null && e.compare(l) > 0;
|
|
47
6
|
}
|
|
48
7
|
export {
|
|
49
|
-
|
|
8
|
+
r as getIsDateOutsideRange
|
|
50
9
|
};
|
package/index173.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";const o=require("react/jsx-runtime"),i=require("@internationalized/date"),B=require("react"),n=require("react-aria"),c=require("./index7.js");function F(r){const{themeName:a="calendar",tokens:R,state:d,date:e}=r,u=B.useRef(null),{isUnavailable:k,cellProps:y,buttonProps:b,isSelected:t,isOutsideVisibleRange:h,isDisabled:C,formattedDate:S,isInvalid:q}=n.useCalendarCell(r,d,u),s=d?.highlightedRange,m=s?.start,f=s?.end,g=s!=null&&m!=null?i.isSameDay(e,m):t,x=s!=null&&f!=null?i.isSameDay(e,f):t,{locale:j}=n.useLocale(),D=i.getDayOfWeek(e,j),N=t&&(g||D===0||e.day===1),P=t&&(x||D===6||e.day===e.calendar.getDaysInMonth(e)),{focusProps:$,isFocusVisible:p}=n.useFocusRing(),l={isInvalid:q,isDisabled:C,isUnavailable:k,isSelected:t,isFocusVisible:p,isOutsideVisibleRange:h,...R};return o.jsx(c.Box,{as:"td",...y,"aria-disabled":!1,themeName:`${a}.cellContainer`,tokens:l,children:o.jsx(c.BoxWithForwardRef,{...n.mergeProps(b,$),ref:u,"aria-hidden":h,themeName:`${a}.cell`,tokens:{...l,isRoundedLeft:N,isRoundedRight:P},children:o.jsx(c.Box,{themeName:`${a}.cellDate`,tokens:{...l,isSelectionStart:g,isSelectionEnd:x},children:S})})})}module.exports=F;
|
package/index173.mjs
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
3
|
+
import { isSameDay as g, getDayOfWeek as W } from "@internationalized/date";
|
|
4
|
+
import { useRef as $ } from "react";
|
|
5
|
+
import { useCalendarCell as v, useLocale as B, useFocusRing as I, mergeProps as L } from "react-aria";
|
|
6
|
+
import { Box as p, BoxWithForwardRef as V } from "./index7.mjs";
|
|
7
|
+
function U(l) {
|
|
8
|
+
const { themeName: s = "calendar", tokens: D, state: i, date: e } = l, r = $(null), {
|
|
9
|
+
isUnavailable: R,
|
|
10
|
+
cellProps: k,
|
|
11
|
+
buttonProps: b,
|
|
12
|
+
isSelected: t,
|
|
13
|
+
isOutsideVisibleRange: c,
|
|
14
|
+
isDisabled: y,
|
|
15
|
+
formattedDate: C,
|
|
16
|
+
isInvalid: S
|
|
17
|
+
} = v(l, i, r), n = i?.highlightedRange, d = n?.start, m = n?.end, u = n != null && d != null ? g(e, d) : t, f = n != null && m != null ? g(e, m) : t, { locale: x } = B(), h = W(e, x), N = t && (u || h === 0 || e.day === 1), P = t && (f || h === 6 || e.day === e.calendar.getDaysInMonth(e)), { focusProps: F, isFocusVisible: O } = I(), a = {
|
|
18
|
+
isInvalid: S,
|
|
19
|
+
isDisabled: y,
|
|
20
|
+
isUnavailable: R,
|
|
21
|
+
isSelected: t,
|
|
22
|
+
isFocusVisible: O,
|
|
23
|
+
isOutsideVisibleRange: c,
|
|
24
|
+
...D
|
|
25
|
+
};
|
|
26
|
+
return /* @__PURE__ */ o(
|
|
27
|
+
p,
|
|
28
|
+
{
|
|
29
|
+
as: "td",
|
|
30
|
+
...k,
|
|
31
|
+
"aria-disabled": !1,
|
|
32
|
+
themeName: `${s}.cellContainer`,
|
|
33
|
+
tokens: a,
|
|
34
|
+
children: /* @__PURE__ */ o(
|
|
35
|
+
V,
|
|
36
|
+
{
|
|
37
|
+
...L(b, F),
|
|
38
|
+
ref: r,
|
|
39
|
+
"aria-hidden": c,
|
|
40
|
+
themeName: `${s}.cell`,
|
|
41
|
+
tokens: { ...a, isRoundedLeft: N, isRoundedRight: P },
|
|
42
|
+
children: /* @__PURE__ */ o(p, { themeName: `${s}.cellDate`, tokens: { ...a, isSelectionStart: u, isSelectionEnd: f }, children: C })
|
|
43
|
+
}
|
|
44
|
+
)
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
export {
|
|
49
|
+
U as default
|
|
50
|
+
};
|
package/index174.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function c(o,r){const i=[];let e=null;const s=[];for(const t of r){const u=t.key==="header"||t.key?.toString().includes("header-"),n=o.find(l=>typeof l.rendered!="string"?!1:l.rendered===t.value);u?(e!=null&&i.push(e),e={header:{key:t.key,rendered:t.value},items:[]}):e!=null?n!=null&&e.items.push(n):n!=null&&s.push(n)}return e!=null&&i.push(e),[...s.length>0?[{items:s}]:[],...i]}exports.getListboxSections=c;
|
package/index174.mjs
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
function d(r, o) {
|
|
2
|
+
const l = [];
|
|
3
|
+
let e = null;
|
|
4
|
+
const s = [];
|
|
5
|
+
for (const n of o) {
|
|
6
|
+
const u = n.key === "header" || n.key?.toString().includes("header-"), t = r.find((i) => typeof i.rendered != "string" ? !1 : i.rendered === n.value);
|
|
7
|
+
u ? (e != null && l.push(e), e = { header: { key: n.key, rendered: n.value }, items: [] }) : e != null ? t != null && e.items.push(t) : t != null && s.push(t);
|
|
8
|
+
}
|
|
9
|
+
return e != null && l.push(e), [...s.length > 0 ? [{ items: s }] : [], ...l];
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
d as getListboxSections
|
|
13
|
+
};
|
package/index2.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";const o=require("react/jsx-runtime"),x=require("@react-aria/selection"),m=require("react"),
|
|
2
|
+
"use strict";const o=require("react/jsx-runtime"),x=require("@react-aria/selection"),m=require("react"),A=require("./index81.js"),f=require("./index7.js"),h=require("./index119.js"),q=require("./index4.js");function b(r){const{id:s,themeName:t="accordion",tokens:n,customTheme:a,TransitionAnimation:d}=r,c=m.useRef(null),e=q(r),{listProps:l}=x.useSelectableList({collection:e.collection,disabledKeys:e.disabledKeys,selectionManager:e.selectionManager,allowsTabNavigation:!0,disallowTypeAhead:!0,ref:c}),u={...l,tabIndex:void 0};return o.jsx(A.AccordionContextProvider,{state:e,TransitionAnimation:d,children:o.jsx(f.BoxWithForwardRef,{themeName:`${t}.wrapper`,tokens:n,customTheme:a,ref:c,id:s,...u,children:Array.from(e.collection,i=>o.jsx(h,{item:i,themeName:t,tokens:n},i.key))})})}module.exports=b;
|
package/index2.mjs
CHANGED
|
@@ -3,8 +3,8 @@ import { jsx as e } from "react/jsx-runtime";
|
|
|
3
3
|
import { useSelectableList as f } from "@react-aria/selection";
|
|
4
4
|
import { useRef as p } from "react";
|
|
5
5
|
import { AccordionContextProvider as u } from "./index81.mjs";
|
|
6
|
-
import { BoxWithForwardRef as
|
|
7
|
-
import
|
|
6
|
+
import { BoxWithForwardRef as A } from "./index7.mjs";
|
|
7
|
+
import h from "./index119.mjs";
|
|
8
8
|
import b from "./index4.mjs";
|
|
9
9
|
function P(r) {
|
|
10
10
|
const { id: a, themeName: t = "accordion", tokens: i, customTheme: s, TransitionAnimation: l } = r, n = p(null), o = b(r), { listProps: m } = f({
|
|
@@ -16,7 +16,7 @@ function P(r) {
|
|
|
16
16
|
ref: n
|
|
17
17
|
}), d = { ...m, tabIndex: void 0 };
|
|
18
18
|
return /* @__PURE__ */ e(u, { state: o, TransitionAnimation: l, children: /* @__PURE__ */ e(
|
|
19
|
-
|
|
19
|
+
A,
|
|
20
20
|
{
|
|
21
21
|
themeName: `${t}.wrapper`,
|
|
22
22
|
tokens: i,
|
|
@@ -24,7 +24,7 @@ function P(r) {
|
|
|
24
24
|
ref: n,
|
|
25
25
|
id: a,
|
|
26
26
|
...d,
|
|
27
|
-
children:
|
|
27
|
+
children: Array.from(o.collection, (c) => /* @__PURE__ */ e(h, { item: c, themeName: t, tokens: i }, c.key))
|
|
28
28
|
}
|
|
29
29
|
) });
|
|
30
30
|
}
|
package/index38.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"),O=require("radashi"),E=require("react"),M=require("react-aria"),v=require("react-hook-form"),H=require("react-stately"),
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),O=require("radashi"),E=require("react"),M=require("react-aria"),v=require("react-hook-form"),H=require("react-stately"),A=require("./index89.js"),N=require("./index7.js"),I=require("./index8.js"),S=require("./index74.js"),K=require("./index40.js"),V=require("./index39.js"),W={item:K,section:V};function k({ref:e,...o}){const{state:r,themeName:c="listBox",tokens:m,customTheme:b,label:d,escapeKeyBehavior:h="clearSelection",linkElementType:R=I.Anchor,isDisabled:n=!1,isRequired:C=!1,isInvalid:L=!1,isError:x=!1,errorMessage:f,disabledKeys:y,fieldRef:q,...B}=o,g=r.collection.getKeys(),a=t=>{if(t!=null){if(q?.(t),e==null)return;typeof e=="function"?e(t):typeof e=="object"&&(e.current=t)}},{listBoxProps:j,labelProps:i}=M.useListBox({...B,escapeKeyBehavior:h,label:d,disabledKeys:n?g:y},r,a),l={...m,isDisabled:n,isRequired:C,isInvalid:L};return s.jsxs(N.Box,{themeName:`${c}.wrapper`,tokens:l,customTheme:b,children:[d!=null&&s.jsx(S.Typography,{...i,themeName:`${c}.label`,tokens:l,children:d}),s.jsx(N.BoxWithForwardRef,{ref:e,as:"ul",...j,themeName:`${c}.list`,tokens:l,children:Array.from(r.collection,t=>{const{key:F}=t,u=t.type??"item",p=W[u]??K;return s.jsx(p,{[u]:t,state:r,tokens:{...m,type:u},themeName:`${c}.${u}`,linkElementType:R},F)})}),x&&f!=null&&s.jsx(S.Typography,{themeName:`${c}.errorMessage`,tokens:{...l,isError:x},children:f})]})}k.displayName="ControlledListBox";function Q(e){const o=H.useListState(e),r=E.useRef(null);return s.jsx(k,{...e,state:o,ref:r})}function $({ref:e,...o}){const{name:r,rules:c,isRequired:m,isDisabled:b,tokens:d,selectionMode:h="single",errorMessage:R,...n}=o,{control:C,setValue:L,watch:x,getValues:f}=v.useFormContext(),{selectedKeys:y=x(r),defaultSelectedKeys:q=f(r)}=n,{t:B}=A.useTranslation(),g=E.useRef(null),a={required:m?B("FORM.ERROR.REQUIRED")??"required":!1,disabled:b,...c},j=H.useListState({...n,selectionMode:h,selectedKeys:y,children:o.children,onSelectionChange:i=>{n.onSelectionChange?.(i),L(r,i,{shouldDirty:!0,shouldTouch:!0}),g.current?.(i)}});return s.jsx(v.Controller,{...n,defaultValue:q,name:r,control:C,rules:a,disabled:a?.disabled,render:({field:i,fieldState:l})=>{const{ref:t,onChange:F,...u}=i;g.current=F;const p=!O.isEmpty(l.error),T={isDisabled:i.disabled??!1,isRequired:a?.required===!0||a?.required==="required",isInvalid:l.invalid,isError:p},{isError:_,...D}=T,P={...d,...D};return s.jsx(k,{...M.mergeProps(n,u,T),state:j,tokens:P,isError:p,selectionMode:h,selectedKeys:y,defaultSelectedKeys:q,errorMessage:R??l.error?.message,ref:e})}})}$.displayName="ControlledReactHookFormListBox";function U(e){const o=E.useRef(null);return s.jsx($,{...e,ref:o})}exports.ControlledListBox=k;exports.ControlledReactHookFormListBox=$;exports.ListBox=Q;exports.ReactHookFormListBox=U;
|
package/index38.mjs
CHANGED
|
@@ -5,8 +5,8 @@ import { useRef as F } from "react";
|
|
|
5
5
|
import { useListBox as j, mergeProps as H } from "react-aria";
|
|
6
6
|
import { useFormContext as I, Controller as V } from "react-hook-form";
|
|
7
7
|
import { useListState as K } from "react-stately";
|
|
8
|
-
import { useTranslation as
|
|
9
|
-
import { Box as
|
|
8
|
+
import { useTranslation as A } from "./index89.mjs";
|
|
9
|
+
import { Box as W, BoxWithForwardRef as Q } from "./index7.mjs";
|
|
10
10
|
import { Anchor as U } from "./index8.mjs";
|
|
11
11
|
import { Typography as T } from "./index74.mjs";
|
|
12
12
|
import M from "./index40.mjs";
|
|
@@ -17,7 +17,7 @@ const w = {
|
|
|
17
17
|
};
|
|
18
18
|
function N({ ref: e, ...t }) {
|
|
19
19
|
const {
|
|
20
|
-
state:
|
|
20
|
+
state: r,
|
|
21
21
|
themeName: a = "listBox",
|
|
22
22
|
tokens: u,
|
|
23
23
|
customTheme: x,
|
|
@@ -32,11 +32,11 @@ function N({ ref: e, ...t }) {
|
|
|
32
32
|
disabledKeys: y,
|
|
33
33
|
fieldRef: g,
|
|
34
34
|
...B
|
|
35
|
-
} = t, k =
|
|
36
|
-
if (
|
|
37
|
-
if (g?.(
|
|
35
|
+
} = t, k = r.collection.getKeys(), c = (o) => {
|
|
36
|
+
if (o != null) {
|
|
37
|
+
if (g?.(o), e == null)
|
|
38
38
|
return;
|
|
39
|
-
typeof e == "function" ? e(
|
|
39
|
+
typeof e == "function" ? e(o) : typeof e == "object" && (e.current = o);
|
|
40
40
|
}
|
|
41
41
|
}, { listBoxProps: L, labelProps: n } = j(
|
|
42
42
|
{
|
|
@@ -45,7 +45,7 @@ function N({ ref: e, ...t }) {
|
|
|
45
45
|
label: d,
|
|
46
46
|
disabledKeys: s ? k : y
|
|
47
47
|
},
|
|
48
|
-
|
|
48
|
+
r,
|
|
49
49
|
c
|
|
50
50
|
), i = {
|
|
51
51
|
...u,
|
|
@@ -53,7 +53,7 @@ function N({ ref: e, ...t }) {
|
|
|
53
53
|
isRequired: E,
|
|
54
54
|
isInvalid: R
|
|
55
55
|
};
|
|
56
|
-
return /* @__PURE__ */ P(
|
|
56
|
+
return /* @__PURE__ */ P(W, { themeName: `${a}.wrapper`, tokens: i, customTheme: x, children: [
|
|
57
57
|
d != null && /* @__PURE__ */ l(T, { ...n, themeName: `${a}.label`, tokens: i, children: d }),
|
|
58
58
|
/* @__PURE__ */ l(
|
|
59
59
|
Q,
|
|
@@ -63,13 +63,13 @@ function N({ ref: e, ...t }) {
|
|
|
63
63
|
...L,
|
|
64
64
|
themeName: `${a}.list`,
|
|
65
65
|
tokens: i,
|
|
66
|
-
children:
|
|
67
|
-
const { key: q } =
|
|
66
|
+
children: Array.from(r.collection, (o) => {
|
|
67
|
+
const { key: q } = o, m = o.type ?? "item", b = w[m] ?? M;
|
|
68
68
|
return /* @__PURE__ */ l(
|
|
69
69
|
b,
|
|
70
70
|
{
|
|
71
|
-
[m]:
|
|
72
|
-
state:
|
|
71
|
+
[m]: o,
|
|
72
|
+
state: r,
|
|
73
73
|
tokens: { ...u, type: m },
|
|
74
74
|
themeName: `${a}.${m}`,
|
|
75
75
|
linkElementType: C
|
|
@@ -84,11 +84,11 @@ function N({ ref: e, ...t }) {
|
|
|
84
84
|
}
|
|
85
85
|
N.displayName = "ControlledListBox";
|
|
86
86
|
function le(e) {
|
|
87
|
-
const t = K(e),
|
|
88
|
-
return /* @__PURE__ */ l(N, { ...e, state: t, ref:
|
|
87
|
+
const t = K(e), r = F(null);
|
|
88
|
+
return /* @__PURE__ */ l(N, { ...e, state: t, ref: r });
|
|
89
89
|
}
|
|
90
90
|
function $({ ref: e, ...t }) {
|
|
91
|
-
const { name:
|
|
91
|
+
const { name: r, rules: a, isRequired: u, isDisabled: x, tokens: d, selectionMode: f = "single", errorMessage: C, ...s } = t, { control: E, setValue: R, watch: p, getValues: h } = I(), { selectedKeys: y = p(r), defaultSelectedKeys: g = h(r) } = s, { t: B } = A(), k = F(null), c = {
|
|
92
92
|
required: u ? B("FORM.ERROR.REQUIRED") ?? "required" : !1,
|
|
93
93
|
disabled: x,
|
|
94
94
|
...a
|
|
@@ -98,7 +98,7 @@ function $({ ref: e, ...t }) {
|
|
|
98
98
|
selectedKeys: y,
|
|
99
99
|
children: t.children,
|
|
100
100
|
onSelectionChange: (n) => {
|
|
101
|
-
s.onSelectionChange?.(n), R(
|
|
101
|
+
s.onSelectionChange?.(n), R(r, n, { shouldDirty: !0, shouldTouch: !0 }), k.current?.(n);
|
|
102
102
|
}
|
|
103
103
|
});
|
|
104
104
|
return /* @__PURE__ */ l(
|
|
@@ -106,12 +106,12 @@ function $({ ref: e, ...t }) {
|
|
|
106
106
|
{
|
|
107
107
|
...s,
|
|
108
108
|
defaultValue: g,
|
|
109
|
-
name:
|
|
109
|
+
name: r,
|
|
110
110
|
control: E,
|
|
111
111
|
rules: c,
|
|
112
112
|
disabled: c?.disabled,
|
|
113
113
|
render: ({ field: n, fieldState: i }) => {
|
|
114
|
-
const { ref:
|
|
114
|
+
const { ref: o, onChange: q, ...m } = n;
|
|
115
115
|
k.current = q;
|
|
116
116
|
const b = !S(i.error), v = {
|
|
117
117
|
isDisabled: n.disabled ?? !1,
|
package/index39.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";const o=require("react/jsx-runtime")
|
|
2
|
+
"use strict";const o=require("react/jsx-runtime"),$=require("@react-aria/utils"),m=require("react-aria"),f=require("./index77.js"),u=require("./index7.js"),j=require("./index74.js"),B=require("./index40.js");function C({section:l,state:t,...s}){const{key:p,rendered:n,props:a,level:h,hasChildNodes:x,type:d}=l,{themeName:e="listBox.section",tokens:r,as:g="li",customTheme:P,...q}=f.mergeDefaultComponentProps(s,a),i={...r,type:d,level:h.toString(),hasChildNodes:x},{itemProps:k,headingProps:y,groupProps:N}=m.useListBoxSection(s);return o.jsxs(u.Box,{as:g,themeName:`${e}.wrapper`,tokens:i,...m.mergeProps($.filterDOMProps(q),k),customTheme:P,children:[!!n&&o.jsx(j.Typography,{themeName:`${e}.heading`,tokens:r,...y,children:n}),o.jsx(u.Box,{as:"ul",themeName:`${e}.group`,tokens:i,...N,children:Array.from(t.collection.getChildren?.(p)??[],c=>o.jsx(B,{item:c,state:t,tokens:r,themeName:`${e}.item`},c.key))})]})}module.exports=C;
|
package/index39.mjs
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
2
|
+
import { jsxs as N, jsx as r } from "react/jsx-runtime";
|
|
3
3
|
import { filterDOMProps as B } from "@react-aria/utils";
|
|
4
4
|
import { useListBoxSection as $, mergeProps as C } from "react-aria";
|
|
5
5
|
import { mergeDefaultComponentProps as S } from "./index77.mjs";
|
|
6
6
|
import { Box as p } from "./index7.mjs";
|
|
7
7
|
import { Typography as T } from "./index74.mjs";
|
|
8
8
|
import j from "./index40.mjs";
|
|
9
|
-
function
|
|
9
|
+
function b({
|
|
10
10
|
section: l,
|
|
11
|
-
state:
|
|
11
|
+
state: t,
|
|
12
12
|
...m
|
|
13
13
|
}) {
|
|
14
|
-
const { key: c, rendered: s, props: a, level: h, hasChildNodes:
|
|
14
|
+
const { key: c, rendered: s, props: a, level: h, hasChildNodes: f, type: d } = l, {
|
|
15
15
|
themeName: e = "listBox.section",
|
|
16
16
|
tokens: o,
|
|
17
17
|
as: g = "li",
|
|
@@ -19,11 +19,11 @@ function q({
|
|
|
19
19
|
...x
|
|
20
20
|
} = S(m, a), i = {
|
|
21
21
|
...o,
|
|
22
|
-
type:
|
|
22
|
+
type: d,
|
|
23
23
|
level: h.toString(),
|
|
24
|
-
hasChildNodes:
|
|
25
|
-
}, { itemProps: P, headingProps: k, groupProps:
|
|
26
|
-
return /* @__PURE__ */
|
|
24
|
+
hasChildNodes: f
|
|
25
|
+
}, { itemProps: P, headingProps: k, groupProps: y } = $(m);
|
|
26
|
+
return /* @__PURE__ */ N(
|
|
27
27
|
p,
|
|
28
28
|
{
|
|
29
29
|
as: g,
|
|
@@ -32,12 +32,12 @@ function q({
|
|
|
32
32
|
...C(B(x), P),
|
|
33
33
|
customTheme: u,
|
|
34
34
|
children: [
|
|
35
|
-
!!s && /* @__PURE__ */
|
|
36
|
-
/* @__PURE__ */
|
|
35
|
+
!!s && /* @__PURE__ */ r(T, { themeName: `${e}.heading`, tokens: o, ...k, children: s }),
|
|
36
|
+
/* @__PURE__ */ r(p, { as: "ul", themeName: `${e}.group`, tokens: i, ...y, children: Array.from(t.collection.getChildren?.(c) ?? [], (n) => /* @__PURE__ */ r(j, { item: n, state: t, tokens: o, themeName: `${e}.item` }, n.key)) })
|
|
37
37
|
]
|
|
38
38
|
}
|
|
39
39
|
);
|
|
40
40
|
}
|
|
41
41
|
export {
|
|
42
|
-
|
|
42
|
+
b as default
|
|
43
43
|
};
|
package/index43.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";const e=require("react/jsx-runtime"),m=require("react"),
|
|
2
|
+
"use strict";const e=require("react/jsx-runtime"),m=require("react"),C=require("react-aria"),v=require("react-stately"),w=require("./index88.js"),A=require("./index90.js"),c=require("./index7.js"),T=require("./index8.js"),F=require("./index99.js"),M=require("./index130.js"),I=require("./index74.js");function Q({value:a,clearButtonProps:r,isDisabled:o,tokens:s,themeName:i}){return a===""?e.jsx(c.Box,{as:"span",themeName:`${i}.icon`,tokens:s,"aria-hidden":"true",children:e.jsx(M,{width:"16",height:"16"})}):e.jsx(T.Button,{...r,isDisabled:o,handlePress:r.onPress,tokens:{...s,isIconOnly:!0,buttonStyle:"hollow"},themeName:`${i}.button`,children:e.jsx(F,{width:"16",height:"16"})})}function R(a){const{setUserSearchQuery:r}=A.useUserQueryValHook(),{label:o,themeName:s="search",tokens:i,customTheme:b,disabled:p,errorMessage:u,placeholder:j,renderAction:q,isDisabled:k}=a,t=k||p,d={...a,isDisabled:t},l=v.useSearchFieldState(d),x=m.useRef(null),{labelProps:$,inputProps:h,errorMessageProps:f,clearButtonProps:g}=C.useSearchField(d,l,x),N=m.useCallback(D=>{r(l.value),h.onChange?.(D)},[r,l.value,h]),S=u!=null,n={...i,isError:S,isDisabled:t??!1},y=w(`${s}.input`,n,b),P=q??Q,B={value:l.value,clearButtonProps:g,isDisabled:t??!1,tokens:n,themeName:s??"search"};return e.jsxs(c.Box,{themeName:`${s}.wrapper`,tokens:n,"aria-disabled":t??!1,children:[o!=null&&e.jsx(c.Box,{...$,as:"label",themeName:`${s}.label`,tokens:n,children:o}),e.jsxs(c.Box,{themeName:`${s}.container`,tokens:n,children:[e.jsx("input",{ref:x,...h,onChange:N,placeholder:j,className:y,disabled:t}),e.jsx(P,{...B})]}),u!=null&&e.jsx(I.Typography,{themeName:`${s}.errorMessage`,tokens:n,...f,children:u})]})}module.exports=R;
|