@okam/stack-ui 1.29.1 → 1.30.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/Accordion/components/AccordionItem.d.ts +1 -0
- package/components/Accordion/index.d.ts +2 -1
- package/components/Accordion/interface.d.ts +3 -2
- package/components/Alerts/components/AlertsCloseButton.d.ts +1 -1
- package/components/Alerts/index.d.ts +2 -1
- package/components/Alerts/interface.d.ts +4 -3
- package/components/Box/index.d.ts +3 -2
- package/components/Button/index.d.ts +8 -4
- package/components/Button/interface.d.ts +3 -2
- package/components/Calendar/index.d.ts +5 -1
- package/components/Calendar/interface.d.ts +2 -1
- package/components/Carousel/components/CarouselNavigationButton.d.ts +3 -3
- package/components/Date/index.d.ts +2 -1
- package/components/Date/interface.d.ts +2 -1
- package/components/Icon/index.d.ts +2 -1
- package/components/Icon/interface.d.ts +2 -1
- package/components/Lightbox/hooks/overlay/index.d.ts +75 -0
- package/components/Lightbox/index.d.ts +2 -1
- package/components/Lightbox/interface.d.ts +3 -2
- package/components/Menu/Menu.d.ts +2 -1
- package/components/Menu/interface.d.ts +5 -4
- package/components/Modal/index.d.ts +2 -1
- package/components/Modal/interface.d.ts +2 -1
- package/components/Popover/index.d.ts +2 -1
- package/components/Popover/interface.d.ts +3 -2
- package/components/ShareButton/index.d.ts +2 -1
- package/components/ShareButton/interface.d.ts +2 -2
- package/components/SidePanel/index.d.ts +3 -3
- package/components/SidePanel/interface.d.ts +5 -4
- package/components/Typography/index.d.ts +3 -2
- package/components/Video/index.d.ts +2 -1
- package/components/Video/interface.d.ts +2 -1
- package/components/WysiwygBlock/index.d.ts +2 -1
- package/components/WysiwygBlock/interface.d.ts +2 -1
- package/components/fields/Checkbox/Checkbox.interface.d.ts +2 -1
- package/components/fields/Checkbox/index.d.ts +2 -1
- package/components/fields/CheckboxGroup/index.d.ts +2 -1
- package/components/fields/CheckboxGroup/interface.d.ts +2 -1
- package/components/fields/DatePicker/index.d.ts +2 -1
- package/components/fields/DatePicker/interface.d.ts +2 -1
- package/components/fields/Radio/Radio.interface.d.ts +3 -2
- package/components/fields/Radio/index.d.ts +3 -2
- package/components/fields/RadioGroup/index.d.ts +2 -1
- package/components/fields/RadioGroup/interface.d.ts +2 -1
- package/components/fields/SearchField/index.d.ts +2 -1
- package/components/fields/SearchField/interface.d.ts +2 -1
- package/components/fields/Select/Select.d.ts +2 -1
- package/components/fields/Select/Select.interface.d.ts +3 -2
- package/components/fields/TextArea/index.d.ts +2 -1
- package/components/fields/TextInputField/interface.d.ts +3 -2
- package/index.d.ts +1 -0
- package/index.js +1 -1
- package/index.mjs +41 -38
- package/index100.js +1 -2
- package/index100.mjs +22 -21
- package/index101.js +2 -1
- package/index101.mjs +22 -63
- package/index102.js +1 -1
- package/index102.mjs +58 -24
- package/index103.js +1 -1
- package/index103.mjs +29 -52
- package/index104.js +1 -1
- package/index104.mjs +52 -4
- package/index105.js +1 -1
- package/index105.mjs +4 -11
- package/index106.js +1 -1
- package/index106.mjs +11 -14
- package/index107.js +1 -1
- package/index107.mjs +13 -22
- package/index108.js +1 -1
- package/index108.mjs +19 -19
- package/index109.js +1 -1
- package/index109.mjs +22 -38
- package/index11.js +1 -1
- package/index11.mjs +2 -2
- package/index110.js +1 -2
- package/index110.mjs +38 -12
- package/index111.js +2 -1
- package/index111.mjs +12 -7
- package/index112.js +1 -1
- package/index112.mjs +7 -21
- package/index113.js +1 -1
- package/index113.mjs +21 -38
- package/index114.js +1 -1
- package/index114.mjs +38 -49
- package/index115.js +1 -1
- package/index115.mjs +49 -40
- package/index116.js +1 -1
- package/index116.mjs +40 -13
- package/index117.js +1 -1
- package/index117.mjs +14 -26
- package/index118.js +1 -1
- package/index118.mjs +29 -18
- package/index119.js +1 -1
- package/index119.mjs +19 -8
- package/index120.js +1 -1
- package/index120.mjs +9 -30
- package/index121.js +1 -1
- package/index121.mjs +30 -15
- package/index122.js +1 -1
- package/index122.mjs +13 -15
- package/index123.js +1 -1
- package/index123.mjs +17 -21
- package/index124.js +1 -1
- package/index124.mjs +21 -11
- package/index125.js +1 -2
- package/index125.mjs +11 -22
- package/index126.js +2 -1
- package/index126.mjs +22 -12
- package/index127.js +1 -1
- package/index127.mjs +12 -46
- package/index128.js +1 -1
- package/index128.mjs +46 -241
- package/index129.js +1 -2
- package/index129.mjs +241 -13
- package/index13.js +1 -1
- package/index13.mjs +1 -1
- package/index130.js +2 -1
- package/index130.mjs +12 -29
- package/index131.js +1 -1
- package/index131.mjs +30 -51
- package/index132.js +1 -1
- package/index132.mjs +49 -25
- package/index133.js +1 -1
- package/index133.mjs +25 -19
- package/index134.js +1 -1
- package/index134.mjs +17 -58
- package/index135.js +1 -1
- package/index135.mjs +57 -90
- package/index136.js +1 -1
- package/index136.mjs +91 -28
- package/index137.js +1 -1
- package/index137.mjs +31 -119
- package/index138.js +1 -1
- package/index138.mjs +119 -25
- package/index139.js +1 -1
- package/index139.mjs +25 -122
- package/index14.js +1 -1
- package/index14.mjs +3 -3
- package/index140.js +1 -1
- package/index140.mjs +122 -132
- package/index141.js +1 -1
- package/index141.mjs +132 -12
- package/index142.js +1 -1
- package/index142.mjs +12 -93
- package/index143.js +1 -1
- package/index143.mjs +87 -98
- package/index144.js +1 -1
- package/index144.mjs +106 -5
- package/index145.js +1 -1
- package/index145.mjs +5 -3
- package/index146.js +1 -1
- package/index146.mjs +3 -125
- package/index147.js +1 -1
- package/index147.mjs +117 -21
- package/index148.js +1 -1
- package/index148.mjs +15 -37
- package/index149.js +1 -1
- package/index149.mjs +41 -34
- package/index150.js +1 -1
- package/index150.mjs +32 -25
- package/index151.js +1 -1
- package/index151.mjs +22 -98
- package/index152.js +1 -1
- package/index152.mjs +99 -63
- package/index153.js +1 -1
- package/index153.mjs +55 -79
- package/index154.js +1 -1
- package/index154.mjs +102 -98
- package/index155.js +1 -1
- package/index155.mjs +98 -200
- package/index156.js +1 -1
- package/index156.mjs +186 -51
- package/index157.js +1 -1
- package/index157.mjs +51 -128
- package/index158.js +1 -1
- package/index158.mjs +129 -107
- package/index159.js +1 -1
- package/index159.mjs +101 -199
- package/index16.js +1 -1
- package/index16.mjs +2 -2
- package/index160.js +1 -1
- package/index160.mjs +198 -171
- package/index161.js +1 -1
- package/index161.mjs +182 -61
- package/index162.js +1 -1
- package/index162.mjs +60 -249
- package/index163.js +1 -1
- package/index163.mjs +249 -88
- package/index164.js +1 -1
- package/index164.mjs +93 -170
- package/index165.js +1 -1
- package/index165.mjs +170 -80
- package/index166.js +1 -1
- package/index166.mjs +75 -49
- package/index167.js +1 -1
- package/index167.mjs +49 -117
- package/index168.js +1 -1
- package/index168.mjs +118 -108
- package/index169.js +1 -1
- package/index169.mjs +106 -112
- package/index170.js +1 -1
- package/index170.mjs +113 -63
- package/index171.js +1 -1
- package/index171.mjs +70 -108
- package/index172.js +1 -1
- package/index172.mjs +108 -50
- package/index173.js +1 -1
- package/index173.mjs +34 -75
- package/index174.js +1 -1
- package/index174.mjs +71 -48
- package/index175.js +1 -1
- package/index175.mjs +57 -43
- package/index176.js +1 -1
- package/index176.mjs +43 -86
- package/index177.js +1 -5
- package/index177.mjs +81 -62
- package/index178.js +5 -1
- package/index178.mjs +72 -2003
- package/index179.js +1 -1
- package/index179.mjs +2006 -54
- package/index18.js +1 -1
- package/index18.mjs +7 -7
- package/index180.js +1 -1
- package/index180.mjs +56 -185
- package/index181.js +1 -1
- package/index181.mjs +188 -5
- package/index182.js +1 -1
- package/index182.mjs +5 -130
- package/index183.js +1 -1
- package/index183.mjs +123 -172
- package/index184.js +1 -1
- package/index184.mjs +178 -8
- package/index185.js +1 -1
- package/index185.mjs +9 -3
- package/index186.js +1 -1
- package/index186.mjs +3 -36
- package/index187.js +1 -1
- package/index187.mjs +36 -5
- package/index188.js +1 -1
- package/index188.mjs +5 -29
- package/index189.js +1 -1
- package/index189.mjs +29 -6
- package/index19.js +1 -1
- package/index19.mjs +2 -2
- package/index190.js +1 -1
- package/index190.mjs +6 -313
- package/index191.js +1 -1
- package/index191.mjs +327 -179
- package/index192.js +1 -1
- package/index192.mjs +183 -8
- package/index193.js +1 -1
- package/index193.mjs +7 -25
- package/index194.js +1 -1
- package/index194.mjs +26 -55
- package/index195.js +1 -1
- package/index195.mjs +55 -46
- package/index196.js +1 -1
- package/index196.mjs +45 -123
- package/index197.js +1 -1
- package/index197.mjs +110 -5
- package/index198.js +1 -1
- package/index198.mjs +31 -27
- package/index199.js +1 -1
- package/index199.mjs +6 -7
- package/index2.js +1 -1
- package/index2.mjs +19 -19
- package/index20.js +1 -1
- package/index20.mjs +1 -1
- package/index200.js +1 -1
- package/index200.mjs +28 -7
- package/index201.js +1 -1
- package/index201.mjs +7 -8
- package/index202.js +1 -1
- package/index202.mjs +6 -3
- package/index203.js +1 -1
- package/index203.mjs +7 -5
- package/index204.js +1 -1
- package/index204.mjs +4 -9
- package/index205.js +1 -0
- package/index205.mjs +8 -0
- package/index206.js +1 -0
- package/index206.mjs +12 -0
- package/index21.js +1 -1
- package/index21.mjs +8 -8
- package/index22.js +1 -1
- package/index22.mjs +2 -2
- package/index23.js +1 -1
- package/index23.mjs +3 -3
- package/index24.js +1 -1
- package/index24.mjs +14 -14
- package/index26.js +1 -1
- package/index26.mjs +28 -21
- package/index27.js +1 -1
- package/index27.mjs +12 -12
- package/index28.js +1 -1
- package/index28.mjs +6 -6
- package/index29.js +1 -1
- package/index29.mjs +1 -1
- package/index30.js +1 -1
- package/index30.mjs +14 -8
- package/index31.js +1 -1
- package/index31.mjs +18 -18
- package/index32.js +1 -1
- package/index32.mjs +1 -1
- package/index33.mjs +43 -43
- package/index34.js +1 -1
- package/index34.mjs +1 -1
- package/index35.js +1 -1
- package/index35.mjs +3 -3
- package/index36.mjs +10 -10
- package/index4.js +1 -1
- package/index4.mjs +3 -3
- package/index6.js +1 -1
- package/index6.mjs +34 -33
- package/index65.js +1 -1
- package/index65.mjs +1 -1
- package/index66.js +1 -1
- package/index66.mjs +2 -2
- package/index67.js +1 -1
- package/index67.mjs +1 -1
- package/index69.js +1 -1
- package/index69.mjs +1 -1
- package/index7.mjs +4 -4
- package/index70.js +1 -1
- package/index70.mjs +1 -1
- package/index71.js +1 -1
- package/index71.mjs +1 -1
- package/index72.js +2 -1
- package/index72.mjs +27 -2
- package/index73.js +1 -2
- package/index73.mjs +2 -9
- package/index74.js +1 -1
- package/index74.mjs +7 -6
- package/index75.js +1 -1
- package/index75.mjs +6 -6
- package/index76.js +1 -1
- package/index76.mjs +6 -6
- package/index77.js +2 -1
- package/index77.mjs +8 -25
- package/index78.js +1 -1
- package/index78.mjs +25 -2
- package/index79.js +1 -6
- package/index79.mjs +2 -94
- package/index8.js +1 -1
- package/index8.mjs +42 -23
- package/index80.js +6 -1
- package/index80.mjs +79 -54
- package/index81.js +1 -1
- package/index81.mjs +61 -33
- package/index82.js +1 -42
- package/index82.mjs +34 -67
- package/index83.js +42 -1
- package/index83.mjs +69 -154
- package/index84.js +1 -9
- package/index84.mjs +149 -47
- package/index85.js +9 -1
- package/index85.mjs +48 -36
- package/index86.js +1 -1
- package/index86.mjs +40 -8
- package/index87.js +1 -1
- package/index87.mjs +9 -31
- package/index88.js +1 -1
- package/index88.mjs +35 -6
- package/index89.js +1 -12
- package/index89.mjs +6 -40
- package/index9.js +1 -1
- package/index9.mjs +7 -7
- package/index90.js +12 -1
- package/index90.mjs +36 -25
- package/index91.js +1 -1
- package/index91.mjs +24 -8
- package/index92.js +1 -7
- package/index92.mjs +7 -13
- package/index93.js +6 -14
- package/index93.mjs +13 -65
- package/index94.js +15 -1
- package/index94.mjs +71 -7
- package/index95.js +1 -16
- package/index95.mjs +7 -25
- package/index96.js +16 -1
- package/index96.mjs +20 -37
- package/index97.js +1 -1
- package/index97.mjs +40 -43
- package/index98.js +1 -1
- package/index98.mjs +44 -47
- package/index99.js +1 -1
- package/index99.mjs +48 -17
- package/package.json +1 -1
- package/providers/Translation/index.d.ts +4 -0
- package/providers/Translation/interface.d.ts +16 -0
- package/theme/Accordion/index.d.ts +12 -12
- package/theme/Alerts/index.d.ts +22 -22
- package/theme/Box/index.d.ts +8 -8
- package/theme/Button/index.d.ts +2 -2
- package/theme/Calendar/index.d.ts +12 -12
- package/theme/Carousel/index.d.ts +11 -11
- package/theme/Checkbox/index.d.ts +8 -8
- package/theme/CheckboxGroup/index.d.ts +3 -3
- package/theme/DatePicker/index.d.ts +9 -9
- package/theme/Image/index.d.ts +1 -1
- package/theme/LightBox/index.d.ts +9 -9
- package/theme/Radio/index.d.ts +6 -6
- package/theme/RadioGroup/index.d.ts +3 -3
- package/theme/Search/index.d.ts +3 -3
- package/theme/ShareButton/index.d.ts +10 -10
- package/theme/SidePanel/index.d.ts +3 -3
- package/theme/TextArea/index.d.ts +2 -2
- package/theme/Typography/index.d.ts +2 -2
- package/transitions/ModalTransition.d.ts +3 -6
- package/transitions/RenderWithSlide.d.ts +3 -6
- package/transitions/SidePanelTransition.d.ts +3 -6
package/index138.mjs
CHANGED
|
@@ -1,30 +1,124 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { createContext as O, useMemo as I, useContext as U, useState as f, useRef as T, useEffect as R } from "react";
|
|
2
|
+
const D = {
|
|
3
|
+
badInput: !1,
|
|
4
|
+
customError: !1,
|
|
5
|
+
patternMismatch: !1,
|
|
6
|
+
rangeOverflow: !1,
|
|
7
|
+
rangeUnderflow: !1,
|
|
8
|
+
stepMismatch: !1,
|
|
9
|
+
tooLong: !1,
|
|
10
|
+
tooShort: !1,
|
|
11
|
+
typeMismatch: !1,
|
|
12
|
+
valueMissing: !1,
|
|
13
|
+
valid: !0
|
|
14
|
+
}, L = {
|
|
15
|
+
...D,
|
|
16
|
+
customError: !0,
|
|
17
|
+
valid: !1
|
|
18
|
+
}, c = {
|
|
19
|
+
isInvalid: !1,
|
|
20
|
+
validationDetails: D,
|
|
21
|
+
validationErrors: []
|
|
22
|
+
}, B = O({}), h = "__formValidationState" + Date.now();
|
|
23
|
+
function P(a) {
|
|
24
|
+
if (a[h]) {
|
|
25
|
+
let { realtimeValidation: e, displayValidation: t, updateValidation: i, resetValidation: o, commitValidation: l } = a[h];
|
|
26
|
+
return {
|
|
27
|
+
realtimeValidation: e,
|
|
28
|
+
displayValidation: t,
|
|
29
|
+
updateValidation: i,
|
|
30
|
+
resetValidation: o,
|
|
31
|
+
commitValidation: l
|
|
13
32
|
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
33
|
+
}
|
|
34
|
+
return Q(a);
|
|
35
|
+
}
|
|
36
|
+
function Q(a) {
|
|
37
|
+
let { isInvalid: e, validationState: t, name: i, value: o, builtinValidation: l, validate: d, validationBehavior: n = "aria" } = a;
|
|
38
|
+
t && (e || (e = t === "invalid"));
|
|
39
|
+
let v = e !== void 0 ? {
|
|
40
|
+
isInvalid: e,
|
|
41
|
+
validationErrors: [],
|
|
42
|
+
validationDetails: L
|
|
43
|
+
} : null, V = I(() => C(Y(d, o)), [
|
|
44
|
+
d,
|
|
45
|
+
o
|
|
22
46
|
]);
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
47
|
+
l != null && l.validationDetails.valid && (l = null);
|
|
48
|
+
let s = U(B), A = I(() => i ? Array.isArray(i) ? i.flatMap((r) => S(s[r])) : S(s[i]) : [], [
|
|
49
|
+
s,
|
|
50
|
+
i
|
|
51
|
+
]), [M, _] = f(s), [x, m] = f(!1);
|
|
52
|
+
s !== M && (_(s), m(!1));
|
|
53
|
+
let $ = I(() => C(x ? [] : A), [
|
|
54
|
+
x,
|
|
55
|
+
A
|
|
56
|
+
]), g = T(c), [b, E] = f(c), u = T(c), w = () => {
|
|
57
|
+
if (!F) return;
|
|
58
|
+
p(!1);
|
|
59
|
+
let r = V || l || g.current;
|
|
60
|
+
y(r, u.current) || (u.current = r, E(r));
|
|
61
|
+
}, [F, p] = f(!1);
|
|
62
|
+
return R(w), {
|
|
63
|
+
realtimeValidation: v || $ || V || l || c,
|
|
64
|
+
displayValidation: n === "native" ? v || $ || b : v || $ || V || l || b,
|
|
65
|
+
updateValidation(r) {
|
|
66
|
+
n === "aria" && !y(b, r) ? E(r) : g.current = r;
|
|
67
|
+
},
|
|
68
|
+
resetValidation() {
|
|
69
|
+
let r = c;
|
|
70
|
+
y(r, u.current) || (u.current = r, E(r)), n === "native" && p(!1), m(!0);
|
|
71
|
+
},
|
|
72
|
+
commitValidation() {
|
|
73
|
+
n === "native" && p(!0), m(!0);
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
function S(a) {
|
|
78
|
+
return a ? Array.isArray(a) ? a : [
|
|
79
|
+
a
|
|
80
|
+
] : [];
|
|
81
|
+
}
|
|
82
|
+
function Y(a, e) {
|
|
83
|
+
if (typeof a == "function") {
|
|
84
|
+
let t = a(e);
|
|
85
|
+
if (t && typeof t != "boolean") return S(t);
|
|
86
|
+
}
|
|
87
|
+
return [];
|
|
88
|
+
}
|
|
89
|
+
function C(a) {
|
|
90
|
+
return a.length ? {
|
|
91
|
+
isInvalid: !0,
|
|
92
|
+
validationErrors: a,
|
|
93
|
+
validationDetails: L
|
|
94
|
+
} : null;
|
|
95
|
+
}
|
|
96
|
+
function y(a, e) {
|
|
97
|
+
return a === e ? !0 : a && e && a.isInvalid === e.isInvalid && a.validationErrors.length === e.validationErrors.length && a.validationErrors.every((t, i) => t === e.validationErrors[i]) && Object.entries(a.validationDetails).every(([t, i]) => e.validationDetails[t] === i);
|
|
98
|
+
}
|
|
99
|
+
function k(...a) {
|
|
100
|
+
let e = /* @__PURE__ */ new Set(), t = !1, i = {
|
|
101
|
+
...D
|
|
102
|
+
};
|
|
103
|
+
for (let d of a) {
|
|
104
|
+
var o, l;
|
|
105
|
+
for (let n of d.validationErrors) e.add(n);
|
|
106
|
+
t || (t = d.isInvalid);
|
|
107
|
+
for (let n in i) (o = i)[l = n] || (o[l] = d.validationDetails[n]);
|
|
108
|
+
}
|
|
109
|
+
return i.valid = !t, {
|
|
110
|
+
isInvalid: t,
|
|
111
|
+
validationErrors: [
|
|
112
|
+
...e
|
|
113
|
+
],
|
|
114
|
+
validationDetails: i
|
|
115
|
+
};
|
|
27
116
|
}
|
|
28
117
|
export {
|
|
29
|
-
|
|
118
|
+
c as DEFAULT_VALIDATION_RESULT,
|
|
119
|
+
B as FormValidationContext,
|
|
120
|
+
D as VALID_VALIDITY_STATE,
|
|
121
|
+
k as mergeValidation,
|
|
122
|
+
h as privateValidationStateProp,
|
|
123
|
+
P as useFormValidationState
|
|
30
124
|
};
|
package/index139.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 l=require("react");function C(o,b,u){let[p,s]=l.useState(o||b),i=l.useRef(o!==void 0),e=o!==void 0;l.useEffect(()=>{let t=i.current;t!==e&&console.warn(`WARN: A component changed from ${t?"controlled":"uncontrolled"} to ${e?"controlled":"uncontrolled"}.`),i.current=e},[e]);let n=e?o:p,S=l.useCallback((t,...f)=>{let a=(r,...c)=>{u&&(Object.is(n,r)||u(r,...c)),e||(n=r)};typeof t=="function"?(console.warn("We can not support a function callback. See Github Issues for details https://github.com/adobe/react-spectrum/issues/2320"),s((c,...m)=>{let d=t(e?n:c,...m);return a(d,...f),e?c:d})):(e||s(t),a(t,...f))},[e,n,u]);return[n,S]}exports.useControlledState=C;
|
package/index139.mjs
CHANGED
|
@@ -1,127 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
let
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import { useState as C, useRef as $, useEffect as S, useCallback as V } from "react";
|
|
2
|
+
function w(o, d, c) {
|
|
3
|
+
let [p, s] = C(o || d), u = $(o !== void 0), e = o !== void 0;
|
|
4
|
+
S(() => {
|
|
5
|
+
let t = u.current;
|
|
6
|
+
t !== e && console.warn(`WARN: A component changed from ${t ? "controlled" : "uncontrolled"} to ${e ? "controlled" : "uncontrolled"}.`), u.current = e;
|
|
7
|
+
}, [
|
|
8
|
+
e
|
|
9
|
+
]);
|
|
10
|
+
let n = e ? o : p, b = V((t, ...i) => {
|
|
11
|
+
let f = (r, ...l) => {
|
|
12
|
+
c && (Object.is(n, r) || c(r, ...l)), e || (n = r);
|
|
13
|
+
};
|
|
14
|
+
typeof t == "function" ? (console.warn("We can not support a function callback. See Github Issues for details https://github.com/adobe/react-spectrum/issues/2320"), s((l, ...m) => {
|
|
15
|
+
let a = t(e ? n : l, ...m);
|
|
16
|
+
return f(a, ...i), e ? l : a;
|
|
17
|
+
})) : (e || s(t), f(t, ...i));
|
|
18
|
+
}, [
|
|
17
19
|
e,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
n,
|
|
21
|
+
c
|
|
22
|
+
]);
|
|
23
|
+
return [
|
|
24
|
+
n,
|
|
25
|
+
b
|
|
21
26
|
];
|
|
22
27
|
}
|
|
23
|
-
var S = /* @__PURE__ */ new WeakMap();
|
|
24
|
-
class d {
|
|
25
|
-
/** Returns a copy of this date. */
|
|
26
|
-
copy() {
|
|
27
|
-
return this.era ? new d(this.calendar, this.era, this.year, this.month, this.day) : new d(this.calendar, this.year, this.month, this.day);
|
|
28
|
-
}
|
|
29
|
-
/** Returns a new `CalendarDate` with the given duration added to it. */
|
|
30
|
-
add(t) {
|
|
31
|
-
return n(this, t);
|
|
32
|
-
}
|
|
33
|
-
/** Returns a new `CalendarDate` with the given duration subtracted from it. */
|
|
34
|
-
subtract(t) {
|
|
35
|
-
return o(this, t);
|
|
36
|
-
}
|
|
37
|
-
/** Returns a new `CalendarDate` with the given fields set to the provided values. Other fields will be constrained accordingly. */
|
|
38
|
-
set(t) {
|
|
39
|
-
return $(this, t);
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Returns a new `CalendarDate` with the given field adjusted by a specified amount.
|
|
43
|
-
* When the resulting value reaches the limits of the field, it wraps around.
|
|
44
|
-
*/
|
|
45
|
-
cycle(t, e, a) {
|
|
46
|
-
return f(this, t, e, a);
|
|
47
|
-
}
|
|
48
|
-
/** Converts the date to a native JavaScript Date object, with the time set to midnight in the given time zone. */
|
|
49
|
-
toDate(t) {
|
|
50
|
-
return u(this, t);
|
|
51
|
-
}
|
|
52
|
-
/** Converts the date to an ISO 8601 formatted string. */
|
|
53
|
-
toString() {
|
|
54
|
-
return w(this);
|
|
55
|
-
}
|
|
56
|
-
/** Compares this date with another. A negative result indicates that this date is before the given one, and a positive date indicates that it is after. */
|
|
57
|
-
compare(t) {
|
|
58
|
-
return m(this, t);
|
|
59
|
-
}
|
|
60
|
-
constructor(...t) {
|
|
61
|
-
p(this, S, {
|
|
62
|
-
writable: !0,
|
|
63
|
-
value: void 0
|
|
64
|
-
});
|
|
65
|
-
let [e, a, i, h, s] = y(t);
|
|
66
|
-
this.calendar = e, this.era = a, this.year = i, this.month = h, this.day = s, l(this);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
var k = /* @__PURE__ */ new WeakMap();
|
|
70
|
-
class c {
|
|
71
|
-
/** Returns a copy of this date. */
|
|
72
|
-
copy() {
|
|
73
|
-
return this.era ? new c(this.calendar, this.era, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond) : new c(this.calendar, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond);
|
|
74
|
-
}
|
|
75
|
-
/** Returns a new `CalendarDateTime` with the given duration added to it. */
|
|
76
|
-
add(t) {
|
|
77
|
-
return n(this, t);
|
|
78
|
-
}
|
|
79
|
-
/** Returns a new `CalendarDateTime` with the given duration subtracted from it. */
|
|
80
|
-
subtract(t) {
|
|
81
|
-
return o(this, t);
|
|
82
|
-
}
|
|
83
|
-
/** Returns a new `CalendarDateTime` with the given fields set to the provided values. Other fields will be constrained accordingly. */
|
|
84
|
-
set(t) {
|
|
85
|
-
return $(b(this, t), t);
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* Returns a new `CalendarDateTime` with the given field adjusted by a specified amount.
|
|
89
|
-
* When the resulting value reaches the limits of the field, it wraps around.
|
|
90
|
-
*/
|
|
91
|
-
cycle(t, e, a) {
|
|
92
|
-
switch (t) {
|
|
93
|
-
case "era":
|
|
94
|
-
case "year":
|
|
95
|
-
case "month":
|
|
96
|
-
case "day":
|
|
97
|
-
return f(this, t, e, a);
|
|
98
|
-
default:
|
|
99
|
-
return x(this, t, e, a);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
/** Converts the date to a native JavaScript Date object in the given time zone. */
|
|
103
|
-
toDate(t, e) {
|
|
104
|
-
return u(this, t, e);
|
|
105
|
-
}
|
|
106
|
-
/** Converts the date to an ISO 8601 formatted string. */
|
|
107
|
-
toString() {
|
|
108
|
-
return D(this);
|
|
109
|
-
}
|
|
110
|
-
/** Compares this date with another. A negative result indicates that this date is before the given one, and a positive date indicates that it is after. */
|
|
111
|
-
compare(t) {
|
|
112
|
-
let e = m(this, t);
|
|
113
|
-
return e === 0 ? v(this, C(t)) : e;
|
|
114
|
-
}
|
|
115
|
-
constructor(...t) {
|
|
116
|
-
p(this, k, {
|
|
117
|
-
writable: !0,
|
|
118
|
-
value: void 0
|
|
119
|
-
});
|
|
120
|
-
let [e, a, i, h, s] = y(t);
|
|
121
|
-
this.calendar = e, this.era = a, this.year = i, this.month = h, this.day = s, this.hour = t.shift() || 0, this.minute = t.shift() || 0, this.second = t.shift() || 0, this.millisecond = t.shift() || 0, l(this);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
28
|
export {
|
|
125
|
-
|
|
126
|
-
c as CalendarDateTime
|
|
29
|
+
w as useControlledState
|
|
127
30
|
};
|
package/index14.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";const a=require("./
|
|
2
|
+
"use strict";const a=require("./index107.js"),o=require("react/jsx-runtime"),t=require("react"),v=require("./index64.js"),x=require("./index105.js"),e=r=>Object.freeze(Object.defineProperty({__proto__:null,default:r},Symbol.toStringTag,{value:"Module"})),q=r=>{const{icon:s,...i}=r,n=t.useMemo(()=>t.lazy(()=>a(Object.assign({"../icons/ArrowDown.tsx":()=>Promise.resolve().then(()=>e(require("./index39.js"))),"../icons/ArrowLeft.tsx":()=>Promise.resolve().then(()=>e(require("./index40.js"))),"../icons/ArrowRight.tsx":()=>Promise.resolve().then(()=>e(require("./index41.js"))),"../icons/Check.tsx":()=>Promise.resolve().then(()=>e(require("./index42.js"))),"../icons/ChevronLeft.tsx":()=>Promise.resolve().then(()=>e(require("./index43.js"))),"../icons/ChevronRight.tsx":()=>Promise.resolve().then(()=>e(require("./index44.js"))),"../icons/CloseBtn.tsx":()=>Promise.resolve().then(()=>e(require("./index45.js"))),"../icons/Facebook.tsx":()=>Promise.resolve().then(()=>e(require("./index46.js"))),"../icons/FacebookColored.tsx":()=>Promise.resolve().then(()=>e(require("./index47.js"))),"../icons/FacebookRounded.tsx":()=>Promise.resolve().then(()=>e(require("./index48.js"))),"../icons/Globe.tsx":()=>Promise.resolve().then(()=>e(require("./index49.js"))),"../icons/IconFallback.tsx":()=>Promise.resolve().then(()=>e(require("./index105.js"))),"../icons/Instagram.tsx":()=>Promise.resolve().then(()=>e(require("./index50.js"))),"../icons/InstagramColored.tsx":()=>Promise.resolve().then(()=>e(require("./index51.js"))),"../icons/Link.tsx":()=>Promise.resolve().then(()=>e(require("./index52.js"))),"../icons/LinkedIn.tsx":()=>Promise.resolve().then(()=>e(require("./index53.js"))),"../icons/Mail.tsx":()=>Promise.resolve().then(()=>e(require("./index54.js"))),"../icons/Plus.tsx":()=>Promise.resolve().then(()=>e(require("./index55.js"))),"../icons/Search.tsx":()=>Promise.resolve().then(()=>e(require("./index106.js"))),"../icons/Share.tsx":()=>Promise.resolve().then(()=>e(require("./index56.js"))),"../icons/Twitter.tsx":()=>Promise.resolve().then(()=>e(require("./index57.js"))),"../icons/TwitterColored.tsx":()=>Promise.resolve().then(()=>e(require("./index58.js"))),"../icons/Upload.tsx":()=>Promise.resolve().then(()=>e(require("./index59.js"))),"../icons/X.tsx":()=>Promise.resolve().then(()=>e(require("./index60.js"))),"../icons/YouTube.tsx":()=>Promise.resolve().then(()=>e(require("./index61.js"))),"../icons/YouTubeColored.tsx":()=>Promise.resolve().then(()=>e(require("./index62.js")))}),`../icons/${s||"ArrowRight"}.tsx`,3)),[s]);return o.jsx(t.Suspense,{fallback:o.jsx(x,{className:"overflow-visible pointer-events-none"}),children:o.jsx(n,{...i,className:"overflow-visible pointer-events-none",...r})})},P=r=>{const{icon:s,as:i="span",tokens:n,customTheme:m,themeName:h="icon",children:c,...l}=r,u=v(h,n,m);return typeof s!="string"?o.jsxs(i,{...l,className:u,children:[c,s]}):o.jsxs(i,{className:u,children:[c,o.jsx(q,{icon:s,...l})]})};module.exports=P;
|
package/index14.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import l from "./
|
|
2
|
+
import l from "./index107.mjs";
|
|
3
3
|
import { jsxs as m, jsx as i } from "react/jsx-runtime";
|
|
4
4
|
import { useMemo as x, lazy as h, Suspense as u } from "react";
|
|
5
5
|
import d from "./index64.mjs";
|
|
6
|
-
import b from "./
|
|
6
|
+
import b from "./index105.mjs";
|
|
7
7
|
const f = (t) => {
|
|
8
|
-
const { icon: o, ...s } = t, r = x(() => h(() => l(/* @__PURE__ */ Object.assign({ "../icons/ArrowDown.tsx": () => import("./index39.mjs"), "../icons/ArrowLeft.tsx": () => import("./index40.mjs"), "../icons/ArrowRight.tsx": () => import("./index41.mjs"), "../icons/Check.tsx": () => import("./index42.mjs"), "../icons/ChevronLeft.tsx": () => import("./index43.mjs"), "../icons/ChevronRight.tsx": () => import("./index44.mjs"), "../icons/CloseBtn.tsx": () => import("./index45.mjs"), "../icons/Facebook.tsx": () => import("./index46.mjs"), "../icons/FacebookColored.tsx": () => import("./index47.mjs"), "../icons/FacebookRounded.tsx": () => import("./index48.mjs"), "../icons/Globe.tsx": () => import("./index49.mjs"), "../icons/IconFallback.tsx": () => import("./
|
|
8
|
+
const { icon: o, ...s } = t, r = x(() => h(() => l(/* @__PURE__ */ Object.assign({ "../icons/ArrowDown.tsx": () => import("./index39.mjs"), "../icons/ArrowLeft.tsx": () => import("./index40.mjs"), "../icons/ArrowRight.tsx": () => import("./index41.mjs"), "../icons/Check.tsx": () => import("./index42.mjs"), "../icons/ChevronLeft.tsx": () => import("./index43.mjs"), "../icons/ChevronRight.tsx": () => import("./index44.mjs"), "../icons/CloseBtn.tsx": () => import("./index45.mjs"), "../icons/Facebook.tsx": () => import("./index46.mjs"), "../icons/FacebookColored.tsx": () => import("./index47.mjs"), "../icons/FacebookRounded.tsx": () => import("./index48.mjs"), "../icons/Globe.tsx": () => import("./index49.mjs"), "../icons/IconFallback.tsx": () => import("./index105.mjs"), "../icons/Instagram.tsx": () => import("./index50.mjs"), "../icons/InstagramColored.tsx": () => import("./index51.mjs"), "../icons/Link.tsx": () => import("./index52.mjs"), "../icons/LinkedIn.tsx": () => import("./index53.mjs"), "../icons/Mail.tsx": () => import("./index54.mjs"), "../icons/Plus.tsx": () => import("./index55.mjs"), "../icons/Search.tsx": () => import("./index106.mjs"), "../icons/Share.tsx": () => import("./index56.mjs"), "../icons/Twitter.tsx": () => import("./index57.mjs"), "../icons/TwitterColored.tsx": () => import("./index58.mjs"), "../icons/Upload.tsx": () => import("./index59.mjs"), "../icons/X.tsx": () => import("./index60.mjs"), "../icons/YouTube.tsx": () => import("./index61.mjs"), "../icons/YouTubeColored.tsx": () => import("./index62.mjs") }), `../icons/${o || "ArrowRight"}.tsx`, 3)), [o]);
|
|
9
9
|
return /* @__PURE__ */ i(u, { fallback: /* @__PURE__ */ i(b, { className: "overflow-visible pointer-events-none" }), children: /* @__PURE__ */ i(r, { ...s, className: "overflow-visible pointer-events-none", ...t }) });
|
|
10
10
|
}, g = (t) => {
|
|
11
11
|
const { icon: o, as: s = "span", tokens: r, customTheme: p, themeName: a = "icon", children: n, ...e } = t, c = d(a, r, p);
|
package/index140.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index141.js"),l=require("./index132.js"),d=require("./index142.js"),f=require("./index143.js"),u=require("./index144.js"),y=require("./index145.js");function m(s){let t=typeof s[0]=="object"?s.shift():new f.GregorianCalendar,e;if(typeof s[0]=="string")e=s.shift();else{let a=t.getEras();e=a[a.length-1]}let r=s.shift(),n=s.shift(),h=s.shift();return[t,e,r,n,h]}var p=new WeakMap;class c{copy(){return this.era?new c(this.calendar,this.era,this.year,this.month,this.day):new c(this.calendar,this.year,this.month,this.day)}add(t){return i.add(this,t)}subtract(t){return i.subtract(this,t)}set(t){return i.set(this,t)}cycle(t,e,r){return i.cycleDate(this,t,e,r)}toDate(t){return u.toDate(this,t)}toString(){return d.dateToString(this)}compare(t){return l.compareDate(this,t)}constructor(...t){y._class_private_field_init(this,p,{writable:!0,value:void 0});let[e,r,n,h,a]=m(t);this.calendar=e,this.era=r,this.year=n,this.month=h,this.day=a,i.constrain(this)}}var v=new WeakMap;class o{copy(){return this.era?new o(this.calendar,this.era,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond):new o(this.calendar,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond)}add(t){return i.add(this,t)}subtract(t){return i.subtract(this,t)}set(t){return i.set(i.setTime(this,t),t)}cycle(t,e,r){switch(t){case"era":case"year":case"month":case"day":return i.cycleDate(this,t,e,r);default:return i.cycleTime(this,t,e,r)}}toDate(t,e){return u.toDate(this,t,e)}toString(){return d.dateTimeToString(this)}compare(t){let e=l.compareDate(this,t);return e===0?l.compareTime(this,u.toCalendarDateTime(t)):e}constructor(...t){y._class_private_field_init(this,v,{writable:!0,value:void 0});let[e,r,n,h,a]=m(t);this.calendar=e,this.era=r,this.year=n,this.month=h,this.day=a,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,i.constrain(this)}}exports.CalendarDate=c;exports.CalendarDateTime=o;
|