@okam/stack-ui 1.44.0 → 1.44.3
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/CHANGELOG.md +82 -4
- package/components/Popover/interface.d.ts +3 -3
- package/components/TagGroup/interface.d.ts +2 -2
- package/index.d.ts +2 -0
- package/index149.js +1 -1
- package/index149.mjs +4 -4
- package/index155.js +1 -1
- package/index155.mjs +4 -4
- package/index157.js +1 -1
- package/index157.mjs +4 -4
- package/index158.js +1 -1
- package/index158.mjs +2 -2
- package/index159.js +1 -1
- package/index159.mjs +1 -1
- package/index160.js +1 -1
- package/index160.mjs +1 -1
- package/index161.js +1 -2
- package/index161.mjs +39 -12
- package/index162.js +1 -1
- package/index162.mjs +12 -38
- package/index163.js +2 -1
- package/index163.mjs +26 -11
- package/index164.js +2 -1
- package/index164.mjs +38 -13
- package/index165.js +1 -1
- package/index165.mjs +21 -38
- package/index166.js +1 -2
- package/index166.mjs +44 -24
- package/index167.js +1 -1
- package/index167.mjs +25 -22
- package/index168.js +1 -1
- package/index168.mjs +40 -45
- package/index169.js +2 -1
- package/index169.mjs +57 -25
- package/index170.js +1 -1
- package/index170.mjs +39 -41
- package/index171.js +1 -2
- package/index171.mjs +30 -57
- package/index172.js +2 -1
- package/index172.mjs +8 -38
- package/index173.js +2 -1
- package/index173.mjs +9 -30
- package/index174.js +1 -2
- package/index174.mjs +32 -9
- package/index175.js +1 -2
- package/index175.mjs +14 -9
- package/index176.js +1 -1
- package/index176.mjs +16 -31
- package/index177.js +1 -1
- package/index177.mjs +11 -15
- package/index178.js +2 -1
- package/index178.mjs +47 -16
- package/index179.js +1 -2
- package/index179.mjs +36 -46
- package/index180.js +1 -1
- package/index180.mjs +31 -36
- package/index181.js +1 -1
- package/index181.mjs +20 -31
- package/index182.js +1 -1
- package/index182.mjs +32 -18
- package/index183.js +1 -1
- package/index183.mjs +14 -36
- package/index185.js +1 -1
- package/index185.mjs +3 -3
- package/index186.js +1 -1
- package/index186.mjs +23 -23
- package/index188.js +1 -1
- package/index188.mjs +5 -2025
- package/index189.js +2 -1
- package/index189.mjs +48 -58
- package/index190.js +1 -1
- package/index190.mjs +2010 -174
- package/index191.js +1 -1
- package/index191.mjs +59 -5
- package/index192.js +1 -2
- package/index192.mjs +186 -47
- package/index193.js +1 -1
- package/index193.mjs +203 -11
- package/index194.js +1 -1
- package/index194.mjs +51 -190
- package/index195.js +1 -1
- package/index195.mjs +130 -51
- package/index196.js +1 -1
- package/index196.mjs +111 -130
- package/index197.js +1 -1
- package/index197.mjs +205 -105
- package/index198.js +1 -1
- package/index198.mjs +169 -203
- package/index199.js +1 -1
- package/index199.mjs +61 -182
- package/index2.mjs +35 -35
- package/index200.js +1 -1
- package/index200.mjs +270 -60
- package/index201.js +1 -1
- package/index201.mjs +89 -270
- package/index202.js +1 -1
- package/index202.mjs +182 -92
- package/index203.js +1 -1
- package/index203.mjs +78 -182
- package/index204.js +1 -1
- package/index204.mjs +49 -75
- package/index205.js +1 -1
- package/index205.mjs +117 -49
- package/index206.js +1 -1
- package/index206.mjs +108 -118
- package/index207.js +1 -1
- package/index207.mjs +112 -106
- package/index208.js +1 -1
- package/index208.mjs +63 -113
- package/index209.js +1 -1
- package/index209.mjs +108 -70
- package/index210.js +1 -1
- package/index210.mjs +50 -108
- package/index211.js +1 -1
- package/index211.mjs +75 -34
- package/index212.js +1 -1
- package/index212.mjs +48 -71
- package/index213.js +1 -1
- package/index213.mjs +43 -57
- package/index214.js +1 -1
- package/index214.mjs +86 -43
- package/index215.js +5 -1
- package/index215.mjs +62 -81
- package/index216.js +1 -5
- package/index216.mjs +11 -80
- package/index217.js +1 -1
- package/index217.mjs +119 -125
- package/index218.js +1 -1
- package/index218.mjs +129 -185
- package/index219.js +1 -1
- package/index219.mjs +72 -121
- package/index220.js +1 -1
- package/index220.mjs +12 -132
- package/index221.js +1 -1
- package/index221.mjs +89 -69
- package/index222.js +1 -1
- package/index222.mjs +104 -12
- package/index223.js +1 -1
- package/index223.mjs +4 -95
- package/index224.js +1 -1
- package/index224.mjs +3 -106
- package/index225.js +1 -1
- package/index225.mjs +125 -4
- package/index226.js +1 -1
- package/index226.mjs +29 -3
- package/index227.js +1 -1
- package/index227.mjs +39 -113
- package/index228.js +1 -1
- package/index228.mjs +34 -19
- package/index229.js +1 -1
- package/index229.mjs +26 -40
- package/index230.js +1 -1
- package/index230.mjs +98 -29
- package/index231.js +1 -1
- package/index231.mjs +68 -28
- package/index232.js +1 -1
- package/index232.mjs +78 -90
- package/index233.js +1 -1
- package/index233.mjs +98 -78
- package/index234.js +1 -1
- package/index234.mjs +125 -96
- package/index235.js +1 -1
- package/index235.mjs +191 -98
- package/index236.js +1 -1
- package/index236.mjs +4 -126
- package/index237.js +1 -1
- package/index237.mjs +20 -67
- package/index238.js +1 -7
- package/index238.mjs +39 -431
- package/index239.js +1 -1
- package/index239.mjs +4 -57
- package/index240.js +1 -1
- package/index240.mjs +24 -3
- package/index241.js +1 -1
- package/index241.mjs +12 -25
- package/index242.js +1 -1
- package/index242.mjs +4 -47
- package/index243.js +1 -1
- package/index243.mjs +14 -5
- package/index244.js +1 -1
- package/index244.mjs +40 -22
- package/index245.js +1 -1
- package/index245.mjs +57 -11
- package/index246.js +1 -1
- package/index246.mjs +43 -4
- package/index247.js +1 -1
- package/index247.mjs +31 -13
- package/index248.js +1 -1
- package/index248.mjs +31 -42
- package/index249.js +1 -1
- package/index249.mjs +13 -57
- package/index250.js +1 -1
- package/index250.mjs +10 -43
- package/index251.js +1 -1
- package/index251.mjs +28 -31
- package/index252.js +1 -1
- package/index252.mjs +14 -30
- package/index253.js +1 -1
- package/index253.mjs +9 -14
- package/index254.js +1 -1
- package/index254.mjs +6 -10
- package/index255.js +1 -1
- package/index255.mjs +5 -29
- package/index256.js +1 -1
- package/index256.mjs +7 -15
- package/index257.js +1 -1
- package/index257.mjs +29 -9
- package/index258.js +1 -1
- package/index258.mjs +17 -6
- package/index259.js +1 -1
- package/index259.mjs +44 -5
- package/index260.js +1 -1
- package/index260.mjs +8 -7
- package/index261.js +1 -1
- package/index261.mjs +13 -26
- package/index262.js +1 -1
- package/index262.mjs +3 -18
- package/index263.js +1 -1
- package/index263.mjs +18 -43
- package/index264.js +1 -1
- package/index264.mjs +33 -7
- package/index265.js +1 -1
- package/index265.mjs +22 -16
- package/index266.js +1 -1
- package/index266.mjs +10 -3
- package/index267.js +1 -1
- package/index267.mjs +2 -18
- package/index268.js +1 -1
- package/index268.mjs +36 -34
- package/index269.js +1 -1
- package/index269.mjs +5 -22
- package/index270.js +1 -1
- package/index270.mjs +28 -53
- package/index271.js +1 -1
- package/index271.mjs +6 -27
- package/index272.js +1 -1
- package/index272.mjs +9 -144
- package/index273.js +1 -1
- package/index273.mjs +127 -207
- package/index274.js +1 -1
- package/index274.mjs +43 -22
- package/index275.js +1 -1
- package/index275.mjs +226 -44
- package/index276.js +1 -1
- package/index276.mjs +121 -42
- package/index277.js +1 -6
- package/index277.mjs +64 -105
- package/index278.js +7 -1
- package/index278.mjs +440 -72
- package/index279.js +1 -1
- package/index279.mjs +56 -72
- package/index28.js +1 -1
- package/index28.mjs +38 -94
- package/index280.js +1 -1
- package/index280.mjs +54 -7
- package/index281.js +1 -1
- package/index281.mjs +27 -11
- package/index282.js +1 -1
- package/index282.mjs +31 -9
- package/index283.js +1 -1
- package/index283.mjs +136 -125
- package/index284.js +1 -1
- package/index284.mjs +209 -39
- package/index285.js +1 -1
- package/index285.mjs +19 -228
- package/index286.js +1 -1
- package/index286.mjs +46 -28
- package/index287.js +1 -1
- package/index287.mjs +45 -8
- package/index288.js +6 -1
- package/index288.mjs +113 -3
- package/index289.js +1 -1
- package/index289.mjs +72 -37
- package/index29.js +1 -1
- package/index29.mjs +2 -2
- package/index290.js +1 -1
- package/index290.mjs +74 -5
- package/index291.js +1 -1
- package/index291.mjs +7 -29
- package/index292.js +1 -1
- package/index292.mjs +11 -6
- package/index30.js +1 -1
- package/index30.mjs +1 -1
- package/index329.js +1 -1
- package/index329.mjs +17 -59
- package/index33.js +1 -1
- package/index33.mjs +2 -2
- package/index330.js +1 -1
- package/index330.mjs +30 -7
- package/index331.js +1 -1
- package/index331.mjs +63 -27
- package/index332.js +1 -1
- package/index332.mjs +15 -87
- package/index333.js +1 -1
- package/index333.mjs +48 -7
- package/index334.js +1 -1
- package/index334.mjs +7 -26
- package/index335.js +1 -1
- package/index335.mjs +26 -32
- package/index336.js +1 -1
- package/index336.mjs +87 -6
- package/index337.js +1 -1
- package/index337.mjs +9 -6
- package/index338.js +1 -1
- package/index338.mjs +23 -48
- package/index339.js +1 -1
- package/index339.mjs +32 -28
- package/index34.js +1 -1
- package/index34.mjs +3 -3
- package/index340.js +1 -1
- package/index340.mjs +6 -15
- package/index341.js +1 -1
- package/index341.mjs +6 -21
- package/index342.js +1 -1
- package/index342.mjs +28 -28
- package/index345.js +1 -1
- package/index345.mjs +1 -1
- package/index35.js +1 -1
- package/index35.mjs +1 -1
- package/index36.js +1 -1
- package/index36.mjs +2 -2
- package/index38.js +1 -1
- package/index38.mjs +3 -3
- package/index39.js +1 -1
- package/index39.mjs +3 -3
- package/index40.js +1 -1
- package/index40.mjs +3 -3
- package/index42.js +1 -1
- package/index42.mjs +1 -1
- package/index44.js +1 -1
- package/index44.mjs +2 -2
- package/index45.js +1 -1
- package/index45.mjs +1 -1
- package/index48.js +1 -1
- package/index48.mjs +2 -2
- package/index52.js +1 -1
- package/index52.mjs +1 -1
- package/index54.js +1 -1
- package/index54.mjs +3 -3
- package/index56.js +1 -1
- package/index56.mjs +2 -2
- package/index57.js +1 -1
- package/index57.mjs +1 -1
- package/index59.js +1 -1
- package/index59.mjs +2 -2
- package/logger.d.ts +2 -2
- package/package.json +2 -2
package/index28.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";const e=require("react/jsx-runtime")
|
|
2
|
+
"use strict";const e=require("react/jsx-runtime"),x=require("react"),f=require("react-aria"),R=require("react-stately"),v=require("./index89.js"),w=require("./index95.js"),c=require("./index37.js"),F=require("./index6.js"),B=require("./index69.js"),I=require("./index153.js"),M=require("./index3.js"),T=({value:a})=>a===""?e.jsx(I,{width:"16",height:"16"}):e.jsx(B,{width:"16",height:"16"}),Q=a=>{const{setUserSearchQuery:u}=w.useUserQueryValHook(),{label:h,themeName:s="search",tokens:g,customTheme:j,disabled:q,errorMessage:i,placeholder:k,icon:o,isDisabled:$}=a,r=$||q,d={...a,isDisabled:r},l=R.useSearchFieldState(d),m=x.useRef(null),{labelProps:S,inputProps:n,errorMessageProps:p,clearButtonProps:N}=f.useSearchField(d,l,m),C=x.useCallback(P=>{var b;u(l.value),(b=n.onChange)==null||b.call(n,P)},[u,l.value,n]),D=i!=null,t={...g,isError:D,isDisabled:r??!1},y=v(`${s}.input`,t,j);return e.jsxs(c.default,{themeName:`${s}.wrapper`,tokens:t,"aria-disabled":r??!1,children:[h&&e.jsx(c.default,{...S,as:"label",themeName:`${s}.label`,tokens:t,children:h}),e.jsxs(c.default,{themeName:`${s}.container`,tokens:t,children:[e.jsx("input",{ref:m,...n,onChange:C,placeholder:k,className:y,disabled:r}),e.jsx(f.FocusRing,{focusRingClass:"has-focus-ring",children:e.jsxs(F.default,{isDisabled:r,handlePress:N.onPress,tokens:{isIconOnly:!0,buttonStyle:"hollow",isDisabled:r??!1},themeName:`${s}.icon`,"aria-label":"clear",children:[o==null&&e.jsx(T,{value:l.value}),o!=null&&o]})})]}),i&&e.jsx(M.default,{themeName:`${s}.errorMessage`,tokens:t,...p,children:i})]})};module.exports=Q;
|
package/index28.mjs
CHANGED
|
@@ -1,122 +1,66 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import "
|
|
4
|
-
import
|
|
5
|
-
import "
|
|
6
|
-
import v, { useCallback as w } from "react";
|
|
7
|
-
import "./index94.mjs";
|
|
8
|
-
import l from "./index37.mjs";
|
|
9
|
-
import { useSearchField as F, FocusRing as R } from "react-aria";
|
|
10
|
-
import "react-use";
|
|
11
|
-
import "@react-spring/web";
|
|
2
|
+
import { jsxs as c, jsx as e } from "react/jsx-runtime";
|
|
3
|
+
import T, { useCallback as v } from "react";
|
|
4
|
+
import { useSearchField as w, FocusRing as F } from "react-aria";
|
|
5
|
+
import { useSearchFieldState as R } from "react-stately";
|
|
12
6
|
import I from "./index89.mjs";
|
|
13
|
-
import M from "./
|
|
14
|
-
import "./
|
|
15
|
-
import
|
|
16
|
-
import "./
|
|
17
|
-
import "./
|
|
18
|
-
import "
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
import "radashi";
|
|
24
|
-
import "./index149.mjs";
|
|
25
|
-
import "sanitize-html";
|
|
26
|
-
import "@react-aria/i18n";
|
|
27
|
-
import "react-hook-form";
|
|
28
|
-
import "./index97.mjs";
|
|
29
|
-
import { useUserQueryValHook as Q } from "./index95.mjs";
|
|
30
|
-
import U from "./index69.mjs";
|
|
31
|
-
import _ from "./index153.mjs";
|
|
32
|
-
import "./index161.mjs";
|
|
33
|
-
import "./index162.mjs";
|
|
34
|
-
import "./index93.mjs";
|
|
35
|
-
import "./index92.mjs";
|
|
36
|
-
import "./index163.mjs";
|
|
37
|
-
import "./index53.mjs";
|
|
38
|
-
import "./index55.mjs";
|
|
39
|
-
import "./index58.mjs";
|
|
40
|
-
import "./index63.mjs";
|
|
41
|
-
import "./index164.mjs";
|
|
42
|
-
import "./index62.mjs";
|
|
43
|
-
import "./index64.mjs";
|
|
44
|
-
import "./index65.mjs";
|
|
45
|
-
import "./index66.mjs";
|
|
46
|
-
import "./index67.mjs";
|
|
47
|
-
import "./index68.mjs";
|
|
48
|
-
import "./index70.mjs";
|
|
49
|
-
import "./index71.mjs";
|
|
50
|
-
import "./index72.mjs";
|
|
51
|
-
import "./index73.mjs";
|
|
52
|
-
import "./index74.mjs";
|
|
53
|
-
import "./index75.mjs";
|
|
54
|
-
import "./index76.mjs";
|
|
55
|
-
import "./index77.mjs";
|
|
56
|
-
import "./index78.mjs";
|
|
57
|
-
import "./index79.mjs";
|
|
58
|
-
import "./index80.mjs";
|
|
59
|
-
import "./index81.mjs";
|
|
60
|
-
import "./index82.mjs";
|
|
61
|
-
import "./index83.mjs";
|
|
62
|
-
import "./index84.mjs";
|
|
63
|
-
import "./index85.mjs";
|
|
64
|
-
import "./index86.mjs";
|
|
65
|
-
import "./index87.mjs";
|
|
66
|
-
import "./index88.mjs";
|
|
67
|
-
import "./index90.mjs";
|
|
68
|
-
import "./index117.mjs";
|
|
69
|
-
const E = ({ value: m }) => m === "" ? /* @__PURE__ */ r(_, { width: "16", height: "16" }) : /* @__PURE__ */ r(U, { width: "16", height: "16" }), Zr = (m) => {
|
|
70
|
-
const { setUserSearchQuery: c } = Q(), {
|
|
71
|
-
label: h,
|
|
72
|
-
themeName: o = "search",
|
|
7
|
+
import { useUserQueryValHook as M } from "./index95.mjs";
|
|
8
|
+
import m from "./index37.mjs";
|
|
9
|
+
import j from "./index6.mjs";
|
|
10
|
+
import Q from "./index69.mjs";
|
|
11
|
+
import U from "./index153.mjs";
|
|
12
|
+
import _ from "./index3.mjs";
|
|
13
|
+
const E = ({ value: a }) => a === "" ? /* @__PURE__ */ e(U, { width: "16", height: "16" }) : /* @__PURE__ */ e(Q, { width: "16", height: "16" }), X = (a) => {
|
|
14
|
+
const { setUserSearchQuery: h } = M(), {
|
|
15
|
+
label: u,
|
|
16
|
+
themeName: s = "search",
|
|
73
17
|
tokens: b,
|
|
74
18
|
customTheme: g,
|
|
75
19
|
disabled: k,
|
|
76
|
-
errorMessage:
|
|
20
|
+
errorMessage: l,
|
|
77
21
|
placeholder: C,
|
|
78
|
-
icon:
|
|
22
|
+
icon: i,
|
|
79
23
|
isDisabled: N
|
|
80
|
-
} =
|
|
24
|
+
} = a, r = N || k, d = { ...a, isDisabled: r }, n = R(d), f = T.useRef(null), { labelProps: S, inputProps: o, errorMessageProps: y, clearButtonProps: D } = w(d, n, f), $ = v(
|
|
81
25
|
(P) => {
|
|
82
|
-
var
|
|
83
|
-
|
|
26
|
+
var p;
|
|
27
|
+
h(n.value), (p = o.onChange) == null || p.call(o, P);
|
|
84
28
|
},
|
|
85
|
-
[
|
|
86
|
-
), x =
|
|
87
|
-
return /* @__PURE__ */
|
|
88
|
-
|
|
89
|
-
/* @__PURE__ */
|
|
90
|
-
/* @__PURE__ */
|
|
91
|
-
/* @__PURE__ */
|
|
29
|
+
[h, n.value, o]
|
|
30
|
+
), x = l != null, t = { ...b, isError: x, isDisabled: r ?? !1 }, B = I(`${s}.input`, t, g);
|
|
31
|
+
return /* @__PURE__ */ c(m, { themeName: `${s}.wrapper`, tokens: t, "aria-disabled": r ?? !1, children: [
|
|
32
|
+
u && // eslint-disable-next-line jsx-a11y/label-has-associated-control
|
|
33
|
+
/* @__PURE__ */ e(m, { ...S, as: "label", themeName: `${s}.label`, tokens: t, children: u }),
|
|
34
|
+
/* @__PURE__ */ c(m, { themeName: `${s}.container`, tokens: t, children: [
|
|
35
|
+
/* @__PURE__ */ e(
|
|
92
36
|
"input",
|
|
93
37
|
{
|
|
94
|
-
ref:
|
|
95
|
-
...
|
|
38
|
+
ref: f,
|
|
39
|
+
...o,
|
|
96
40
|
onChange: $,
|
|
97
41
|
placeholder: C,
|
|
98
42
|
className: B,
|
|
99
|
-
disabled:
|
|
43
|
+
disabled: r
|
|
100
44
|
}
|
|
101
45
|
),
|
|
102
|
-
/* @__PURE__ */
|
|
103
|
-
|
|
46
|
+
/* @__PURE__ */ e(F, { focusRingClass: "has-focus-ring", children: /* @__PURE__ */ c(
|
|
47
|
+
j,
|
|
104
48
|
{
|
|
105
|
-
isDisabled:
|
|
49
|
+
isDisabled: r,
|
|
106
50
|
handlePress: D.onPress,
|
|
107
|
-
tokens: { isIconOnly: !0, buttonStyle: "hollow", isDisabled:
|
|
108
|
-
themeName: `${
|
|
51
|
+
tokens: { isIconOnly: !0, buttonStyle: "hollow", isDisabled: r ?? !1 },
|
|
52
|
+
themeName: `${s}.icon`,
|
|
109
53
|
"aria-label": "clear",
|
|
110
54
|
children: [
|
|
111
|
-
|
|
112
|
-
|
|
55
|
+
i == null && /* @__PURE__ */ e(E, { value: n.value }),
|
|
56
|
+
i != null && i
|
|
113
57
|
]
|
|
114
58
|
}
|
|
115
59
|
) })
|
|
116
60
|
] }),
|
|
117
|
-
|
|
61
|
+
l && /* @__PURE__ */ e(_, { themeName: `${s}.errorMessage`, tokens: t, ...y, children: l })
|
|
118
62
|
] });
|
|
119
63
|
};
|
|
120
64
|
export {
|
|
121
|
-
|
|
65
|
+
X as default
|
|
122
66
|
};
|
package/index280.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index336.js"),c=require("react"),l=require("./index240.js"),m=require("./index241.js"),p=require("./index248.js");function B(b){let{isDisabled:v,onBlurWithin:i,onFocusWithin:s,onFocusWithinChange:t}=b,n=c.useRef({isFocusWithin:!1}),{addGlobalListener:a,removeAllGlobalListeners:f}=p.useGlobalListeners(),r=c.useCallback(e=>{e.currentTarget.contains(e.target)&&n.current.isFocusWithin&&!e.currentTarget.contains(e.relatedTarget)&&(n.current.isFocusWithin=!1,f(),i&&i(e),t&&t(!1))},[i,t,n,f]),g=o.useSyntheticBlurEvent(r),W=c.useCallback(e=>{if(!e.currentTarget.contains(e.target))return;const u=m.getOwnerDocument(e.target),T=l.getActiveElement(u);if(!n.current.isFocusWithin&&T===l.getEventTarget(e.nativeEvent)){s&&s(e),t&&t(!0),n.current.isFocusWithin=!0,g(e);let h=e.currentTarget;a(u,"focus",d=>{if(n.current.isFocusWithin&&!l.nodeContains(h,d.target)){let F=new u.defaultView.FocusEvent("blur",{relatedTarget:d.target});o.setEventTarget(F,h);let E=o.createSyntheticEvent(F);r(E)}},{capture:!0})}},[s,t,g,a,r]);return v?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:W,onBlur:r}}}exports.useFocusWithin=B;
|
package/index280.mjs
CHANGED
|
@@ -1,10 +1,57 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { useSyntheticBlurEvent as F, setEventTarget as W, createSyntheticEvent as v } from "./index336.mjs";
|
|
2
|
+
import { useRef as x, useCallback as $ } from "react";
|
|
3
|
+
import { getActiveElement as E, getEventTarget as T, nodeContains as B } from "./index240.mjs";
|
|
4
|
+
import { getOwnerDocument as G } from "./index241.mjs";
|
|
5
|
+
import { useGlobalListeners as L } from "./index248.mjs";
|
|
6
|
+
function S(b) {
|
|
7
|
+
let { isDisabled: h, onBlurWithin: i, onFocusWithin: o, onFocusWithinChange: t } = b, r = x({
|
|
8
|
+
isFocusWithin: !1
|
|
9
|
+
}), { addGlobalListener: c, removeAllGlobalListeners: s } = L(), n = $((e) => {
|
|
10
|
+
e.currentTarget.contains(e.target) && r.current.isFocusWithin && !e.currentTarget.contains(e.relatedTarget) && (r.current.isFocusWithin = !1, s(), i && i(e), t && t(!1));
|
|
11
|
+
}, [
|
|
12
|
+
i,
|
|
13
|
+
t,
|
|
14
|
+
r,
|
|
15
|
+
s
|
|
16
|
+
]), u = F(n), g = $((e) => {
|
|
17
|
+
if (!e.currentTarget.contains(e.target)) return;
|
|
18
|
+
const a = G(e.target), p = E(a);
|
|
19
|
+
if (!r.current.isFocusWithin && p === T(e.nativeEvent)) {
|
|
20
|
+
o && o(e), t && t(!0), r.current.isFocusWithin = !0, u(e);
|
|
21
|
+
let f = e.currentTarget;
|
|
22
|
+
c(a, "focus", (l) => {
|
|
23
|
+
if (r.current.isFocusWithin && !B(f, l.target)) {
|
|
24
|
+
let d = new a.defaultView.FocusEvent("blur", {
|
|
25
|
+
relatedTarget: l.target
|
|
26
|
+
});
|
|
27
|
+
W(d, f);
|
|
28
|
+
let m = v(d);
|
|
29
|
+
n(m);
|
|
30
|
+
}
|
|
31
|
+
}, {
|
|
32
|
+
capture: !0
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}, [
|
|
36
|
+
o,
|
|
37
|
+
t,
|
|
38
|
+
u,
|
|
39
|
+
c,
|
|
40
|
+
n
|
|
41
|
+
]);
|
|
42
|
+
return h ? {
|
|
43
|
+
focusWithinProps: {
|
|
44
|
+
// These cannot be null, that would conflict in mergeProps
|
|
45
|
+
onFocus: void 0,
|
|
46
|
+
onBlur: void 0
|
|
47
|
+
}
|
|
48
|
+
} : {
|
|
49
|
+
focusWithinProps: {
|
|
50
|
+
onFocus: g,
|
|
51
|
+
onBlur: n
|
|
52
|
+
}
|
|
53
|
+
};
|
|
6
54
|
}
|
|
7
55
|
export {
|
|
8
|
-
|
|
9
|
-
a as useUNSAFE_PortalContext
|
|
56
|
+
S as useFocusWithin
|
|
10
57
|
};
|
package/index281.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react");var u;const E=typeof document<"u"?(u=e.useInsertionEffect)!==null&&u!==void 0?u:e.useLayoutEffect:()=>{};function R(c,d,n){let[f,i]=e.useState(c||d),o=e.useRef(f),s=e.useRef(c!==void 0),r=c!==void 0;e.useEffect(()=>{let t=s.current;t!==r&&process.env.NODE_ENV!=="production"&&console.warn(`WARN: A component changed from ${t?"controlled":"uncontrolled"} to ${r?"controlled":"uncontrolled"}.`),s.current=r},[r]);let a=r?c:f;E(()=>{o.current=a});let[,$]=e.useReducer(()=>({}),{}),b=e.useCallback((t,...p)=>{let l=typeof t=="function"?t(o.current):t;Object.is(o.current,l)||(o.current=l,i(l),$(),n==null||n(l,...p))},[n]);return[a,b]}exports.useControlledState=R;
|
package/index281.mjs
CHANGED
|
@@ -1,14 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
},
|
|
1
|
+
import s, { useState as R, useRef as d, useEffect as V, useReducer as m, useCallback as _ } from "react";
|
|
2
|
+
var l;
|
|
3
|
+
const y = typeof document < "u" ? (l = s.useInsertionEffect) !== null && l !== void 0 ? l : s.useLayoutEffect : () => {
|
|
4
|
+
};
|
|
5
|
+
function w(r, i, o) {
|
|
6
|
+
let [u, $] = R(r || i), c = d(u), f = d(r !== void 0), t = r !== void 0;
|
|
7
|
+
V(() => {
|
|
8
|
+
let e = f.current;
|
|
9
|
+
e !== t && process.env.NODE_ENV !== "production" && console.warn(`WARN: A component changed from ${e ? "controlled" : "uncontrolled"} to ${t ? "controlled" : "uncontrolled"}.`), f.current = t;
|
|
10
|
+
}, [
|
|
11
|
+
t
|
|
12
|
+
]);
|
|
13
|
+
let a = t ? r : u;
|
|
14
|
+
y(() => {
|
|
15
|
+
c.current = a;
|
|
16
|
+
});
|
|
17
|
+
let [, p] = m(() => ({}), {}), E = _((e, ...b) => {
|
|
18
|
+
let n = typeof e == "function" ? e(c.current) : e;
|
|
19
|
+
Object.is(c.current, n) || (c.current = n, $(n), p(), o == null || o(n, ...b));
|
|
20
|
+
}, [
|
|
21
|
+
o
|
|
22
|
+
]);
|
|
23
|
+
return [
|
|
24
|
+
a,
|
|
25
|
+
E
|
|
26
|
+
];
|
|
11
27
|
}
|
|
12
28
|
export {
|
|
13
|
-
|
|
29
|
+
w as useControlledState
|
|
14
30
|
};
|
package/index282.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("./index343.js"),y=require("./index281.js"),g=require("react");function K(t){var l;let[e,s]=y.useControlledState(t.selectedKey,(l=t.defaultSelectedKey)!==null&&l!==void 0?l:null,t.onSelectionChange),i=g.useMemo(()=>e!=null?[e]:[],[e]),{collection:a,disabledKeys:u,selectionManager:d}=S.useListState({...t,selectionMode:"single",disallowEmptySelection:!0,allowDuplicateSelectionEvents:!0,selectedKeys:i,onSelectionChange:o=>{if(o==="all")return;var n;let c=(n=o.values().next().value)!==null&&n!==void 0?n:null;c===e&&t.onSelectionChange&&t.onSelectionChange(c),s(c)}}),r=e!=null?a.getItem(e):null;return{collection:a,disabledKeys:u,selectionManager:d,selectedKey:e,setSelectedKey:s,selectedItem:r}}exports.useSingleSelectListState=K;
|
package/index282.mjs
CHANGED
|
@@ -1,12 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
let t =
|
|
7
|
-
|
|
1
|
+
import { useListState as f } from "./index343.mjs";
|
|
2
|
+
import { useControlledState as S } from "./index281.mjs";
|
|
3
|
+
import { useMemo as y } from "react";
|
|
4
|
+
function g(l) {
|
|
5
|
+
var t;
|
|
6
|
+
let [e, c] = S(l.selectedKey, (t = l.defaultSelectedKey) !== null && t !== void 0 ? t : null, l.onSelectionChange), i = y(() => e != null ? [
|
|
7
|
+
e
|
|
8
|
+
] : [], [
|
|
9
|
+
e
|
|
10
|
+
]), { collection: o, disabledKeys: d, selectionManager: u } = f({
|
|
11
|
+
...l,
|
|
12
|
+
selectionMode: "single",
|
|
13
|
+
disallowEmptySelection: !0,
|
|
14
|
+
allowDuplicateSelectionEvents: !0,
|
|
15
|
+
selectedKeys: i,
|
|
16
|
+
onSelectionChange: (s) => {
|
|
17
|
+
if (s === "all") return;
|
|
18
|
+
var n;
|
|
19
|
+
let a = (n = s.values().next().value) !== null && n !== void 0 ? n : null;
|
|
20
|
+
a === e && l.onSelectionChange && l.onSelectionChange(a), c(a);
|
|
21
|
+
}
|
|
22
|
+
}), r = e != null ? o.getItem(e) : null;
|
|
23
|
+
return {
|
|
24
|
+
collection: o,
|
|
25
|
+
disabledKeys: d,
|
|
26
|
+
selectionManager: u,
|
|
27
|
+
selectedKey: e,
|
|
28
|
+
setSelectedKey: c,
|
|
29
|
+
selectedItem: r
|
|
30
|
+
};
|
|
8
31
|
}
|
|
9
32
|
export {
|
|
10
|
-
|
|
11
|
-
o as tabsIds
|
|
33
|
+
g as useSingleSelectListState
|
|
12
34
|
};
|
package/index283.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("./index284.js"),G=require("./index285.js"),v=require("react"),C=require("./index236.js"),U=require("./index251.js"),J=require("@react-aria/i18n");let t=typeof document<"u"?window.visualViewport:null;function K(l){let{direction:R}=J.useLocale(),{arrowSize:O,targetRef:p,overlayRef:i,arrowRef:s,scrollRef:u=i,placement:H="bottom",containerPadding:S=12,shouldFlip:B=!0,boundaryElement:b=typeof document<"u"?document.body:null,offset:q=0,crossOffset:T=0,shouldUpdatePosition:A=!0,isOpen:g=!0,onClose:m,maxHeight:x,arrowBoundaryOffset:F=0}=l,[e,I]=v.useState(null),N=[A,H,i.current,p.current,s==null?void 0:s.current,u.current,S,B,b,q,T,g,R,x,F,O],j=v.useRef(t==null?void 0:t.scale);v.useEffect(()=>{g&&(j.current=t==null?void 0:t.scale)},[g]);let d=v.useCallback(()=>{if(A===!1||!g||!i.current||!p.current||!b||(t==null?void 0:t.scale)!==j.current)return;let o=null;if(u.current&&u.current.contains(document.activeElement)){var a;let r=(a=document.activeElement)===null||a===void 0?void 0:a.getBoundingClientRect(),h=u.current.getBoundingClientRect();var c;if(o={type:"top",offset:((c=r==null?void 0:r.top)!==null&&c!==void 0?c:0)-h.top},o.offset>h.height/2){o.type="bottom";var z;o.offset=((z=r==null?void 0:r.bottom)!==null&&z!==void 0?z:0)-h.bottom}}let n=i.current;if(!x&&i.current){var L;n.style.top="0px",n.style.bottom="";var $;n.style.maxHeight=(($=(L=window.visualViewport)===null||L===void 0?void 0:L.height)!==null&&$!==void 0?$:window.innerHeight)+"px"}let f=k.calculatePosition({placement:W(H,R),overlayNode:i.current,targetNode:p.current,scrollNode:u.current||i.current,padding:S,shouldFlip:B,boundaryElement:b,offset:q,crossOffset:T,maxHeight:x,arrowSize:O??(s!=null&&s.current?k.getRect(s.current,!0).width:0),arrowBoundaryOffset:F});if(f.position){if(n.style.top="",n.style.bottom="",n.style.left="",n.style.right="",Object.keys(f.position).forEach(r=>n.style[r]=f.position[r]+"px"),n.style.maxHeight=f.maxHeight!=null?f.maxHeight+"px":"",o&&document.activeElement&&u.current){let r=document.activeElement.getBoundingClientRect(),h=u.current.getBoundingClientRect(),D=r[o.type]-h[o.type];u.current.scrollTop+=D-o.offset}I(f)}},N);C.useLayoutEffect(d,N),Q(d),U.useResizeObserver({ref:i,onResize:d}),U.useResizeObserver({ref:p,onResize:d});let y=v.useRef(!1);C.useLayoutEffect(()=>{let o,a=()=>{y.current=!0,clearTimeout(o),o=setTimeout(()=>{y.current=!1},500),d()},c=()=>{y.current&&a()};return t==null||t.addEventListener("resize",a),t==null||t.addEventListener("scroll",c),()=>{t==null||t.removeEventListener("resize",a),t==null||t.removeEventListener("scroll",c)}},[d]);let M=v.useCallback(()=>{y.current||m==null||m()},[m,y]);G.useCloseOnScroll({triggerRef:p,isOpen:g,onClose:m&&M});var E,P,w;return{overlayProps:{style:{position:e?"absolute":"fixed",top:e?void 0:0,left:e?void 0:0,zIndex:1e5,...e==null?void 0:e.position,maxHeight:(E=e==null?void 0:e.maxHeight)!==null&&E!==void 0?E:"100vh"}},placement:(P=e==null?void 0:e.placement)!==null&&P!==void 0?P:null,triggerAnchorPoint:(w=e==null?void 0:e.triggerAnchorPoint)!==null&&w!==void 0?w:null,arrowProps:{"aria-hidden":"true",role:"presentation",style:{left:e==null?void 0:e.arrowOffsetLeft,top:e==null?void 0:e.arrowOffsetTop}},updatePosition:d}}function Q(l){C.useLayoutEffect(()=>(window.addEventListener("resize",l,!1),()=>{window.removeEventListener("resize",l,!1)}),[l])}function W(l,R){return R==="rtl"?l.replace("start","right").replace("end","left"):l.replace("start","left").replace("end","right")}exports.useOverlayPosition=K;
|