@okam/stack-ui 1.32.3 → 1.32.5

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.
Files changed (331) hide show
  1. package/components/fields/Checkbox/index.d.ts +6 -0
  2. package/components/fields/CheckboxGroup/components/CheckboxGroupItem/index.d.ts +6 -0
  3. package/components/fields/Select/Select.d.ts +4 -1
  4. package/components/fields/Select/Select.interface.d.ts +1 -0
  5. package/components/fields/TextArea/index.d.ts +4 -1
  6. package/components/fields/TextInputField/index.d.ts +1 -1
  7. package/components/fields/TextInputField/interface.d.ts +1 -2
  8. package/index.d.ts +4 -2
  9. package/index.js +1 -1
  10. package/index.mjs +153 -151
  11. package/index124.js +1 -1
  12. package/index124.mjs +1 -1
  13. package/index125.js +1 -1
  14. package/index125.mjs +1 -1
  15. package/index139.js +1 -1
  16. package/index139.mjs +2 -2
  17. package/index140.js +1 -1
  18. package/index140.mjs +23 -23
  19. package/index141.js +1 -1
  20. package/index141.mjs +3 -3
  21. package/index146.js +1 -1
  22. package/index146.mjs +1 -1
  23. package/index150.js +1 -1
  24. package/index150.mjs +1 -1
  25. package/index151.js +1 -1
  26. package/index151.mjs +1 -1
  27. package/index153.js +1 -1
  28. package/index153.mjs +1 -1
  29. package/index154.js +1 -1
  30. package/index154.mjs +1 -1
  31. package/index155.js +1 -1
  32. package/index155.mjs +1 -1
  33. package/index156.js +1 -1
  34. package/index156.mjs +2 -2
  35. package/index158.js +1 -1
  36. package/index158.mjs +2 -2
  37. package/index159.js +1 -1
  38. package/index159.mjs +8 -8
  39. package/index16.js +1 -1
  40. package/index16.mjs +144 -67
  41. package/index17.js +1 -1
  42. package/index17.mjs +95 -26
  43. package/index173.js +1 -1
  44. package/index173.mjs +1 -1
  45. package/index175.js +1 -1
  46. package/index175.mjs +1 -1
  47. package/index176.js +1 -1
  48. package/index176.mjs +1 -1
  49. package/index177.js +1 -1
  50. package/index177.mjs +1 -1
  51. package/index178.js +1 -1
  52. package/index178.mjs +4 -4
  53. package/index179.js +1 -1
  54. package/index179.mjs +1 -1
  55. package/index198.js +1 -1
  56. package/index198.mjs +201 -70
  57. package/index199.js +1 -1
  58. package/index199.mjs +60 -91
  59. package/index20.js +1 -1
  60. package/index20.mjs +105 -31
  61. package/index200.js +1 -1
  62. package/index200.mjs +139 -151
  63. package/index201.js +1 -1
  64. package/index201.mjs +125 -72
  65. package/index202.js +1 -1
  66. package/index202.mjs +220 -38
  67. package/index203.js +1 -1
  68. package/index203.mjs +190 -5
  69. package/index204.js +1 -1
  70. package/index204.mjs +68 -60
  71. package/index205.js +1 -1
  72. package/index205.mjs +273 -53
  73. package/index206.js +1 -1
  74. package/index206.mjs +86 -191
  75. package/index207.js +1 -1
  76. package/index207.mjs +180 -56
  77. package/index208.js +1 -1
  78. package/index208.mjs +75 -134
  79. package/index209.js +1 -1
  80. package/index209.mjs +52 -118
  81. package/index21.js +1 -1
  82. package/index21.mjs +132 -59
  83. package/index210.js +1 -1
  84. package/index210.mjs +116 -214
  85. package/index211.js +1 -1
  86. package/index211.mjs +107 -181
  87. package/index212.js +1 -1
  88. package/index212.mjs +114 -61
  89. package/index213.js +1 -1
  90. package/index213.mjs +65 -272
  91. package/index214.js +1 -1
  92. package/index214.mjs +105 -93
  93. package/index215.js +1 -1
  94. package/index215.mjs +47 -183
  95. package/index216.js +1 -1
  96. package/index216.mjs +86 -77
  97. package/index217.js +1 -1
  98. package/index217.mjs +65 -53
  99. package/index218.js +1 -1
  100. package/index218.mjs +52 -122
  101. package/index219.js +1 -1
  102. package/index219.mjs +94 -111
  103. package/index22.js +1 -1
  104. package/index22.mjs +109 -102
  105. package/index220.js +5 -1
  106. package/index220.mjs +75 -117
  107. package/index221.js +1 -1
  108. package/index221.mjs +2016 -63
  109. package/index222.js +1 -1
  110. package/index222.mjs +54 -105
  111. package/index223.js +1 -1
  112. package/index223.mjs +186 -50
  113. package/index224.js +1 -1
  114. package/index224.mjs +68 -89
  115. package/index225.js +1 -1
  116. package/index225.mjs +93 -68
  117. package/index226.js +1 -1
  118. package/index226.mjs +151 -52
  119. package/index227.js +1 -1
  120. package/index227.mjs +72 -100
  121. package/index228.js +1 -5
  122. package/index228.mjs +40 -78
  123. package/index229.js +1 -1
  124. package/index229.mjs +5 -2025
  125. package/index230.js +1 -1
  126. package/index230.mjs +61 -59
  127. package/index231.js +1 -1
  128. package/index231.mjs +58 -187
  129. package/index266.js +1 -1
  130. package/index266.mjs +34 -34
  131. package/index270.js +1 -1
  132. package/index270.mjs +24 -48
  133. package/index271.js +1 -1
  134. package/index271.mjs +47 -9
  135. package/index272.js +1 -1
  136. package/index272.mjs +6 -16
  137. package/index273.js +1 -1
  138. package/index273.mjs +6 -16
  139. package/index274.js +1 -1
  140. package/index274.mjs +15 -16
  141. package/index275.js +1 -1
  142. package/index275.mjs +25 -16
  143. package/index276.js +1 -1
  144. package/index276.mjs +29 -16
  145. package/index277.js +1 -1
  146. package/index277.mjs +32 -16
  147. package/index278.js +1 -1
  148. package/index278.mjs +10 -16
  149. package/index279.js +1 -1
  150. package/index279.mjs +29 -16
  151. package/index280.js +1 -1
  152. package/index280.mjs +10 -16
  153. package/index281.js +1 -1
  154. package/index281.mjs +6 -16
  155. package/index282.js +1 -1
  156. package/index282.mjs +8 -16
  157. package/index283.js +1 -1
  158. package/index283.mjs +14 -16
  159. package/index284.js +1 -1
  160. package/index284.mjs +9 -16
  161. package/index285.js +1 -1
  162. package/index285.mjs +130 -15
  163. package/index286.js +1 -1
  164. package/index286.mjs +191 -16
  165. package/index287.js +1 -1
  166. package/index287.mjs +10 -16
  167. package/index288.js +1 -1
  168. package/index288.mjs +4 -16
  169. package/index289.js +1 -1
  170. package/index289.mjs +37 -16
  171. package/index290.js +1 -1
  172. package/index290.mjs +6 -16
  173. package/index291.js +1 -1
  174. package/index291.mjs +30 -16
  175. package/index292.js +1 -1
  176. package/index292.mjs +7 -16
  177. package/index293.js +1 -1
  178. package/index293.mjs +49 -16
  179. package/index294.js +1 -1
  180. package/index294.mjs +15 -15
  181. package/index295.js +1 -1
  182. package/index295.mjs +15 -15
  183. package/index296.js +1 -1
  184. package/index296.mjs +12 -12
  185. package/index297.js +1 -1
  186. package/index297.mjs +15 -15
  187. package/index298.js +1 -1
  188. package/index298.mjs +12 -12
  189. package/index299.js +1 -1
  190. package/index299.mjs +15 -15
  191. package/index300.js +1 -1
  192. package/index300.mjs +15 -15
  193. package/index301.js +1 -1
  194. package/index301.mjs +12 -12
  195. package/index302.js +1 -1
  196. package/index302.mjs +12 -12
  197. package/index303.js +1 -1
  198. package/index303.mjs +15 -15
  199. package/index304.js +1 -1
  200. package/index304.mjs +15 -15
  201. package/index305.js +1 -1
  202. package/index305.mjs +15 -15
  203. package/index306.js +1 -1
  204. package/index306.mjs +15 -130
  205. package/index307.js +1 -1
  206. package/index307.mjs +16 -191
  207. package/index308.js +1 -1
  208. package/index308.mjs +16 -10
  209. package/index309.js +1 -1
  210. package/index309.mjs +16 -4
  211. package/index310.js +1 -1
  212. package/index310.mjs +16 -37
  213. package/index311.js +1 -1
  214. package/index311.mjs +16 -6
  215. package/index312.js +1 -1
  216. package/index312.mjs +16 -30
  217. package/index313.js +1 -1
  218. package/index313.mjs +16 -7
  219. package/index314.js +1 -1
  220. package/index314.mjs +16 -25
  221. package/index315.js +1 -1
  222. package/index315.mjs +16 -48
  223. package/index316.js +1 -1
  224. package/index316.mjs +16 -6
  225. package/index317.js +1 -1
  226. package/index317.mjs +16 -6
  227. package/index318.js +1 -1
  228. package/index318.mjs +16 -15
  229. package/index319.js +1 -1
  230. package/index319.mjs +16 -25
  231. package/index320.js +1 -1
  232. package/index320.mjs +16 -29
  233. package/index321.js +1 -1
  234. package/index321.mjs +16 -32
  235. package/index322.js +1 -1
  236. package/index322.mjs +16 -29
  237. package/index323.js +1 -1
  238. package/index323.mjs +16 -10
  239. package/index324.js +1 -1
  240. package/index324.mjs +16 -6
  241. package/index325.js +1 -1
  242. package/index325.mjs +16 -8
  243. package/index326.js +1 -1
  244. package/index326.mjs +16 -14
  245. package/index327.js +1 -1
  246. package/index327.mjs +16 -9
  247. package/index328.js +1 -1
  248. package/index328.mjs +1 -1
  249. package/index332.js +1 -1
  250. package/index332.mjs +2 -2
  251. package/index333.js +1 -1
  252. package/index333.mjs +1 -1
  253. package/index339.js +1 -1
  254. package/index339.mjs +1 -1
  255. package/index340.js +1 -1
  256. package/index340.mjs +2 -2
  257. package/index345.js +1 -1
  258. package/index345.mjs +5 -117
  259. package/index346.js +1 -1
  260. package/index346.mjs +117 -71
  261. package/index347.js +1 -1
  262. package/index347.mjs +71 -7
  263. package/index348.js +1 -1
  264. package/index348.mjs +7 -7
  265. package/index349.js +1 -1
  266. package/index349.mjs +7 -7
  267. package/index350.js +1 -1
  268. package/index350.mjs +7 -7
  269. package/index351.js +1 -1
  270. package/index351.mjs +4 -4
  271. package/index352.js +1 -1
  272. package/index352.mjs +7 -7
  273. package/index353.js +1 -1
  274. package/index353.mjs +7 -7
  275. package/index354.js +1 -1
  276. package/index354.mjs +4 -4
  277. package/index355.js +1 -1
  278. package/index355.mjs +4 -4
  279. package/index356.js +1 -1
  280. package/index356.mjs +4 -4
  281. package/index357.js +1 -1
  282. package/index357.mjs +4 -4
  283. package/index358.js +1 -1
  284. package/index358.mjs +7 -7
  285. package/index359.js +1 -1
  286. package/index359.mjs +7 -7
  287. package/index360.js +1 -1
  288. package/index360.mjs +7 -7
  289. package/index361.js +1 -1
  290. package/index361.mjs +4 -4
  291. package/index362.js +1 -1
  292. package/index362.mjs +7 -7
  293. package/index363.js +1 -1
  294. package/index363.mjs +7 -7
  295. package/index364.js +1 -1
  296. package/index364.mjs +7 -7
  297. package/index365.js +1 -1
  298. package/index365.mjs +7 -7
  299. package/index366.js +1 -1
  300. package/index366.mjs +7 -7
  301. package/index367.js +1 -1
  302. package/index367.mjs +4 -4
  303. package/index368.js +1 -1
  304. package/index368.mjs +7 -7
  305. package/index369.js +1 -1
  306. package/index369.mjs +7 -7
  307. package/index370.js +1 -1
  308. package/index370.mjs +3 -3
  309. package/index371.js +1 -1
  310. package/index371.mjs +4 -4
  311. package/index372.js +1 -1
  312. package/index372.mjs +7 -7
  313. package/index373.js +1 -1
  314. package/index373.mjs +7 -7
  315. package/index374.js +1 -1
  316. package/index374.mjs +7 -7
  317. package/index375.js +1 -1
  318. package/index375.mjs +4 -4
  319. package/index376.js +1 -1
  320. package/index376.mjs +7 -7
  321. package/index377.js +1 -1
  322. package/index377.mjs +4 -4
  323. package/index378.js +1 -1
  324. package/index378.mjs +4 -4
  325. package/index379.js +1 -1
  326. package/index379.mjs +7 -7
  327. package/index380.js +1 -1
  328. package/index380.mjs +4 -4
  329. package/index381.js +1 -1
  330. package/index381.mjs +8 -6
  331. package/package.json +1 -1
package/index199.mjs CHANGED
@@ -1,98 +1,67 @@
1
- import s from "./index201.mjs";
2
- import { isSameDay as c, startOfMonth as x, endOfMonth as p } from "./index152.mjs";
3
- import { useLocalizedStringFormatter as h, useDateFormatter as m } from "@react-aria/i18n";
4
- import { useMemo as R } from "react";
5
- function b(e) {
6
- return e && e.__esModule ? e.default : e;
7
- }
8
- const k = /* @__PURE__ */ new WeakMap();
9
- function d(e) {
10
- return (e == null ? void 0 : e.calendar.identifier) === "gregory" && e.era === "BC" ? "short" : void 0;
11
- }
12
- function D(e) {
13
- let a = h(b(s), "@react-aria/calendar"), r, t;
14
- var i;
15
- "highlightedRange" in e ? { start: r, end: t } = e.highlightedRange || {} : r = t = (i = e.value) !== null && i !== void 0 ? i : void 0;
16
- let o = m({
17
- weekday: "long",
18
- month: "long",
19
- year: "numeric",
20
- day: "numeric",
21
- era: d(r) || d(t),
22
- timeZone: e.timeZone
23
- }), n = "anchorDate" in e ? e.anchorDate : null;
24
- return R(() => {
25
- if (!n && r && t)
26
- if (c(r, t)) {
27
- let f = o.format(r.toDate(e.timeZone));
28
- return a.format("selectedDateDescription", {
29
- date: f
30
- });
31
- } else {
32
- let f = g(o, a, r, t, e.timeZone);
33
- return a.format("selectedRangeDescription", {
34
- dateRange: f
35
- });
36
- }
37
- return "";
38
- }, [
39
- r,
40
- t,
41
- n,
42
- e.timeZone,
43
- a,
44
- o
45
- ]);
46
- }
47
- function _(e, a, r, t) {
48
- let i = h(b(s), "@react-aria/calendar"), o = d(e) || d(a), n = m({
49
- month: "long",
50
- year: "numeric",
51
- era: o,
52
- calendar: e.calendar.identifier,
53
- timeZone: r
54
- }), f = m({
55
- month: "long",
56
- year: "numeric",
57
- day: "numeric",
58
- era: o,
59
- calendar: e.calendar.identifier,
60
- timeZone: r
1
+ import { g as K, a as U } from "./index285.mjs";
2
+ import { a as C, b as W } from "./index286.mjs";
3
+ function I(H) {
4
+ let {
5
+ swiper: e,
6
+ extendParams: V,
7
+ on: b,
8
+ emit: x
9
+ } = H;
10
+ const o = K(), m = U();
11
+ e.keyboard = {
12
+ enabled: !1
13
+ }, V({
14
+ keyboard: {
15
+ enabled: !1,
16
+ onlyInViewport: !0,
17
+ pageUpDown: !0
18
+ }
61
19
  });
62
- return R(() => {
63
- if (c(e, x(e))) {
64
- if (c(a, p(e))) return n.format(e.toDate(r));
65
- if (c(a, p(a))) return t ? g(n, i, e, a, r) : n.formatRange(e.toDate(r), a.toDate(r));
20
+ function y(L) {
21
+ if (!e.enabled) return;
22
+ const {
23
+ rtlTranslate: s
24
+ } = e;
25
+ let t = L;
26
+ t.originalEvent && (t = t.originalEvent);
27
+ const i = t.keyCode || t.charCode, k = e.params.keyboard.pageUpDown, r = k && i === 33, a = k && i === 34, d = i === 37, f = i === 39, c = i === 38, u = i === 40;
28
+ if (!e.allowSlideNext && (e.isHorizontal() && f || e.isVertical() && u || a) || !e.allowSlidePrev && (e.isHorizontal() && d || e.isVertical() && c || r))
29
+ return !1;
30
+ if (!(t.shiftKey || t.altKey || t.ctrlKey || t.metaKey) && !(o.activeElement && o.activeElement.nodeName && (o.activeElement.nodeName.toLowerCase() === "input" || o.activeElement.nodeName.toLowerCase() === "textarea"))) {
31
+ if (e.params.keyboard.onlyInViewport && (r || a || d || f || c || u)) {
32
+ let h = !1;
33
+ if (C(e.el, `.${e.params.slideClass}, swiper-slide`).length > 0 && C(e.el, `.${e.params.slideActiveClass}`).length === 0)
34
+ return;
35
+ const p = e.el, D = p.clientWidth, E = p.clientHeight, N = m.innerWidth, A = m.innerHeight, n = W(p);
36
+ s && (n.left -= p.scrollLeft);
37
+ const P = [[n.left, n.top], [n.left + D, n.top], [n.left, n.top + E], [n.left + D, n.top + E]];
38
+ for (let w = 0; w < P.length; w += 1) {
39
+ const l = P[w];
40
+ if (l[0] >= 0 && l[0] <= N && l[1] >= 0 && l[1] <= A) {
41
+ if (l[0] === 0 && l[1] === 0) continue;
42
+ h = !0;
43
+ }
44
+ }
45
+ if (!h) return;
46
+ }
47
+ e.isHorizontal() ? ((r || a || d || f) && (t.preventDefault ? t.preventDefault() : t.returnValue = !1), ((a || f) && !s || (r || d) && s) && e.slideNext(), ((r || d) && !s || (a || f) && s) && e.slidePrev()) : ((r || a || c || u) && (t.preventDefault ? t.preventDefault() : t.returnValue = !1), (a || u) && e.slideNext(), (r || c) && e.slidePrev()), x("keyPress", i);
66
48
  }
67
- return t ? g(f, i, e, a, r) : f.formatRange(e.toDate(r), a.toDate(r));
68
- }, [
69
- e,
70
- a,
71
- n,
72
- f,
73
- i,
74
- r,
75
- t
76
- ]);
77
- }
78
- function g(e, a, r, t, i) {
79
- let o = e.formatRangeToParts(r.toDate(i), t.toDate(i)), n = -1;
80
- for (let l = 0; l < o.length; l++) {
81
- let u = o[l];
82
- if (u.source === "shared" && u.type === "literal") n = l;
83
- else if (u.source === "endRange") break;
84
49
  }
85
- let f = "", $ = "";
86
- for (let l = 0; l < o.length; l++)
87
- l < n ? f += o[l].value : l > n && ($ += o[l].value);
88
- return a.format("dateRange", {
89
- startDate: f,
90
- endDate: $
50
+ function g() {
51
+ e.keyboard.enabled || (o.addEventListener("keydown", y), e.keyboard.enabled = !0);
52
+ }
53
+ function v() {
54
+ e.keyboard.enabled && (o.removeEventListener("keydown", y), e.keyboard.enabled = !1);
55
+ }
56
+ b("init", () => {
57
+ e.params.keyboard.enabled && g();
58
+ }), b("destroy", () => {
59
+ e.keyboard.enabled && v();
60
+ }), Object.assign(e.keyboard, {
61
+ enable: g,
62
+ disable: v
91
63
  });
92
64
  }
93
65
  export {
94
- d as getEraFormat,
95
- k as hookData,
96
- D as useSelectedDateDescription,
97
- _ as useVisibleRangeDescription
66
+ I as default
98
67
  };
package/index20.js CHANGED
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- "use strict";const e=require("react/jsx-runtime"),N=require("react"),a=require("react-aria"),g=require("./index114.js"),n=require("./index64.js"),I=require("./index14.js"),b=require("./index3.js"),R=o=>{const{id:r,ariaLabel:j,icon:i,state:l,themeName:s="checkbox",customTheme:t,tokens:f,isDisabled:h=!1,isError:u=!1,value:x,errorMessage:d,label:C}=o,k=N.useRef(null),{inputProps:$}=a.useCheckboxGroupItem(o,l,k),{isSelected:m}=l,c={...f,selected:m(x),isDisabled:h,isError:u},q=n(`${s}.container`,c,t),T=n(`${s}.checkBox`,c,t),p=n(`${s}.checkMark`,c,t),M=n(`${s}.checkMarkIcon`,c,t);return e.jsxs("div",{children:[e.jsx(a.FocusRing,{focusRingClass:"has-focus-ring",within:!0,children:e.jsxs("label",{className:q,htmlFor:r,"aria-label":j,"aria-disabled":h,children:[e.jsx(a.VisuallyHidden,{children:e.jsx("input",{ref:k,...$})}),e.jsx("div",{className:T,"aria-checked":m(x),role:"checkbox","aria-labelledby":r,children:e.jsx("div",{className:p,children:i&&e.jsx(I,{icon:i,customTheme:M})})}),e.jsx(b.default,{themeName:`${s}.label`,tokens:c,children:C})]})}),u&&d&&e.jsx(b.default,{themeName:`${s}.errorMessage`,tokens:c,children:d})]})},v=o=>{const r=g.useCheckboxGroupCtx();return r&&e.jsx(R,{state:r,...o})};module.exports=v;
2
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("react/jsx-runtime"),O=require("radashi"),D=require("react"),F=require("react-aria"),I=require("react-hook-form"),G=require("./index114.js"),j=require("./index64.js"),H=require("./index72.js"),P=require("./index14.js"),$=require("./index3.js"),_=c=>{const{id:i,ariaLabel:e,icon:l,state:x,themeName:t="checkbox",customTheme:a,tokens:R,isDisabled:k=!1,isError:d=!1,value:h,errorMessage:u,label:f}=c,m=D.useRef(null),{inputProps:M}=F.useCheckboxGroupItem(c,x,m),{isSelected:b}=x,o={...R,selected:b(h),isDisabled:k,isError:d},v=j(`${t}.container`,o,a),s=j(`${t}.checkBox`,o,a),n=j(`${t}.checkMark`,o,a),C=j(`${t}.checkMarkIcon`,o,a);return r.jsxs("div",{children:[r.jsx(F.FocusRing,{focusRingClass:"has-focus-ring",within:!0,children:r.jsxs("label",{className:v,htmlFor:i,"aria-label":e,"aria-disabled":k,children:[r.jsx(F.VisuallyHidden,{children:r.jsx("input",{ref:m,...M})}),r.jsx("div",{className:s,"aria-checked":b(h),role:"checkbox","aria-labelledby":i,children:r.jsx("div",{className:n,children:l&&r.jsx(P,{icon:l,customTheme:C})})}),r.jsx($.default,{themeName:`${t}.label`,tokens:o,children:f})]})}),d&&u&&r.jsx($.default,{themeName:`${t}.errorMessage`,tokens:o,children:u})]})},p=c=>{const i=G.useCheckboxGroupCtx();return i&&r.jsx(_,{state:i,...c})},A=({name:c,label:i,rules:e,tokens:l,ariaLabel:x,defaultValue:t=!1,themeName:a="checkbox",isReadOnly:R=!1,isRequired:k,onChange:d,onBlur:h,value:u,icon:f,...m})=>{const{control:M}=I.useFormContext(),{t:b}=H.useTranslation(),o=()=>{const s=Object.entries(m).filter(([n,C])=>n.startsWith("aria-"));return Object.fromEntries(s)},v={required:k?b("FORM.ERROR.REQUIRED")??"required":!1,...e};return r.jsx(I.Controller,{name:c,control:M,rules:v,disabled:e==null?void 0:e.disabled,defaultValue:t,render:({field:s,fieldState:n})=>{var g;const{ref:C,...E}=s,N=!O.isEmpty(n.error),T={isDisabled:s.disabled??!1,isRequired:(e==null?void 0:e.required)===!0||(e==null?void 0:e.required)==="required",isInvalid:n.invalid,isError:N,isReadOnly:R},y={...l,...T};return r.jsx(p,{...E,...T,...o(),id:c,value:u,icon:f,themeName:a,label:i,tokens:y,ariaLabel:x,isDisabled:s.disabled,isRequired:(e==null?void 0:e.required)===!0||(e==null?void 0:e.required)==="required",errorMessage:(g=n.error)==null?void 0:g.message,onChange:q=>{s.onChange(q),d==null||d(q)},onBlur:q=>{s.onBlur(),h==null||h(q)}})}})};exports.ReactHookFormCheckboxItem=A;exports.default=p;
package/index20.mjs CHANGED
@@ -1,38 +1,112 @@
1
1
  "use client";
2
- import { jsx as e, jsxs as p } from "react/jsx-runtime";
3
- import { useRef as $ } from "react";
4
- import { useCheckboxGroupItem as v, FocusRing as y, VisuallyHidden as B } from "react-aria";
5
- import { useCheckboxGroupCtx as G } from "./index114.mjs";
6
- import a from "./index64.mjs";
7
- import R from "./index14.mjs";
8
- import x from "./index3.mjs";
9
- const j = (s) => {
2
+ import { jsx as o, jsxs as v } from "react/jsx-runtime";
3
+ import { isEmpty as $ } from "radashi";
4
+ import { useRef as D } from "react";
5
+ import { useCheckboxGroupItem as j, FocusRing as G, VisuallyHidden as O } from "react-aria";
6
+ import { useFormContext as B, Controller as H } from "react-hook-form";
7
+ import { useCheckboxGroupCtx as P } from "./index114.mjs";
8
+ import u from "./index64.mjs";
9
+ import { useTranslation as w } from "./index72.mjs";
10
+ import A from "./index14.mjs";
11
+ import F from "./index3.mjs";
12
+ const L = (i) => {
10
13
  const {
11
- id: r,
12
- ariaLabel: b,
13
- icon: n,
14
- state: i,
15
- themeName: o = "checkbox",
16
- customTheme: t,
17
- tokens: f,
18
- isDisabled: h = !1,
19
- isError: l = !1,
20
- value: m,
21
- errorMessage: k,
22
- label: C
23
- } = s, d = $(null), { inputProps: T } = v(s, i, d), { isSelected: u } = i, c = { ...f, selected: u(m), isDisabled: h, isError: l }, g = a(`${o}.container`, c, t), I = a(`${o}.checkBox`, c, t), M = a(`${o}.checkMark`, c, t), N = a(`${o}.checkMarkIcon`, c, t);
24
- return /* @__PURE__ */ p("div", { children: [
25
- /* @__PURE__ */ e(y, { focusRingClass: "has-focus-ring", within: !0, children: /* @__PURE__ */ p("label", { className: g, htmlFor: r, "aria-label": b, "aria-disabled": h, children: [
26
- /* @__PURE__ */ e(B, { children: /* @__PURE__ */ e("input", { ref: d, ...T }) }),
27
- /* @__PURE__ */ e("div", { className: I, "aria-checked": u(m), role: "checkbox", "aria-labelledby": r, children: /* @__PURE__ */ e("div", { className: M, children: n && /* @__PURE__ */ e(R, { icon: n, customTheme: N }) }) }),
28
- /* @__PURE__ */ e(x, { themeName: `${o}.label`, tokens: c, children: C })
14
+ id: s,
15
+ ariaLabel: e,
16
+ icon: h,
17
+ state: l,
18
+ themeName: t = "checkbox",
19
+ customTheme: n,
20
+ tokens: R,
21
+ isDisabled: k = !1,
22
+ isError: m = !1,
23
+ value: d,
24
+ errorMessage: b,
25
+ label: T
26
+ } = i, p = D(null), { inputProps: q } = j(i, l, p), { isSelected: x } = l, c = { ...R, selected: x(d), isDisabled: k, isError: m }, C = u(`${t}.container`, c, n), r = u(`${t}.checkBox`, c, n), a = u(`${t}.checkMark`, c, n), I = u(`${t}.checkMarkIcon`, c, n);
27
+ return /* @__PURE__ */ v("div", { children: [
28
+ /* @__PURE__ */ o(G, { focusRingClass: "has-focus-ring", within: !0, children: /* @__PURE__ */ v("label", { className: C, htmlFor: s, "aria-label": e, "aria-disabled": k, children: [
29
+ /* @__PURE__ */ o(O, { children: /* @__PURE__ */ o("input", { ref: p, ...q }) }),
30
+ /* @__PURE__ */ o("div", { className: r, "aria-checked": x(d), role: "checkbox", "aria-labelledby": s, children: /* @__PURE__ */ o("div", { className: a, children: h && /* @__PURE__ */ o(A, { icon: h, customTheme: I }) }) }),
31
+ /* @__PURE__ */ o(F, { themeName: `${t}.label`, tokens: c, children: T })
29
32
  ] }) }),
30
- l && k && /* @__PURE__ */ e(x, { themeName: `${o}.errorMessage`, tokens: c, children: k })
33
+ m && b && /* @__PURE__ */ o(F, { themeName: `${t}.errorMessage`, tokens: c, children: b })
31
34
  ] });
32
- }, S = (s) => {
33
- const r = G();
34
- return r && /* @__PURE__ */ e(j, { state: r, ...s });
35
+ }, Q = (i) => {
36
+ const s = P();
37
+ return s && /* @__PURE__ */ o(L, { state: s, ...i });
38
+ }, S = ({
39
+ name: i,
40
+ label: s,
41
+ rules: e,
42
+ tokens: h,
43
+ ariaLabel: l,
44
+ defaultValue: t = !1,
45
+ themeName: n = "checkbox",
46
+ isReadOnly: R = !1,
47
+ isRequired: k,
48
+ onChange: m,
49
+ onBlur: d,
50
+ value: b,
51
+ icon: T,
52
+ ...p
53
+ }) => {
54
+ const { control: q } = B(), { t: x } = w(), c = () => {
55
+ const r = Object.entries(p).filter(([a, I]) => a.startsWith("aria-"));
56
+ return Object.fromEntries(r);
57
+ }, C = {
58
+ required: k ? x("FORM.ERROR.REQUIRED") ?? "required" : !1,
59
+ ...e
60
+ };
61
+ return /* @__PURE__ */ o(
62
+ H,
63
+ {
64
+ name: i,
65
+ control: q,
66
+ rules: C,
67
+ disabled: e == null ? void 0 : e.disabled,
68
+ defaultValue: t,
69
+ render: ({ field: r, fieldState: a }) => {
70
+ var g;
71
+ const { ref: I, ...E } = r, y = !$(a.error), M = {
72
+ isDisabled: r.disabled ?? !1,
73
+ isRequired: (e == null ? void 0 : e.required) === !0 || (e == null ? void 0 : e.required) === "required",
74
+ isInvalid: a.invalid,
75
+ isError: y,
76
+ isReadOnly: R
77
+ }, N = {
78
+ ...h,
79
+ ...M
80
+ };
81
+ return /* @__PURE__ */ o(
82
+ Q,
83
+ {
84
+ ...E,
85
+ ...M,
86
+ ...c(),
87
+ id: i,
88
+ value: b,
89
+ icon: T,
90
+ themeName: n,
91
+ label: s,
92
+ tokens: N,
93
+ ariaLabel: l,
94
+ isDisabled: r.disabled,
95
+ isRequired: (e == null ? void 0 : e.required) === !0 || (e == null ? void 0 : e.required) === "required",
96
+ errorMessage: (g = a.error) == null ? void 0 : g.message,
97
+ onChange: (f) => {
98
+ r.onChange(f), m == null || m(f);
99
+ },
100
+ onBlur: (f) => {
101
+ r.onBlur(), d == null || d(f);
102
+ }
103
+ }
104
+ );
105
+ }
106
+ }
107
+ );
35
108
  };
36
109
  export {
37
- S as default
110
+ S as ReactHookFormCheckboxItem,
111
+ Q as default
38
112
  };
package/index200.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("./index199.js"),E=require("./index201.js"),n=require("./index152.js"),Z=require("./index156.js"),$=require("./index202.js"),w=require("./index173.js"),A=require("./index166.js"),U=require("./index176.js"),k=require("./index203.js"),B=require("./index204.js"),j=require("./index159.js"),P=require("@react-aria/i18n"),l=require("react");function W(t){return t&&t.__esModule?t.default:t}function _(t,e,u){let{date:i,isDisabled:s}=t,{errorMessageId:T,selectedDateDescription:b}=I.hookData.get(e),a=P.useLocalizedStringFormatter(W(E),"@react-aria/calendar"),R=P.useDateFormatter({weekday:"long",day:"numeric",month:"long",year:"numeric",era:I.getEraFormat(i),timeZone:e.timeZone}),d=e.isSelected(i),f=e.isCellFocused(i);s=s||e.isCellDisabled(i);let S=e.isCellUnavailable(i),g=!s&&!S,c=e.isValueInvalid&&!!("highlightedRange"in e?!e.anchorDate&&e.highlightedRange&&i.compare(e.highlightedRange.start)>=0&&i.compare(e.highlightedRange.end)<=0:e.value&&n.isSameDay(e.value,i));c&&(d=!0),i=k.useDeepMemo(i,n.isEqualDay);let m=l.useMemo(()=>i.toDate(e.timeZone),[i,e.timeZone]),v=n.isToday(i,e.timeZone),M=l.useMemo(()=>{let r="";return"highlightedRange"in e&&e.value&&!e.anchorDate&&(n.isSameDay(i,e.value.start)||n.isSameDay(i,e.value.end))&&(r=b+", "),r+=R.format(m),v?r=a.format(d?"todayDateSelected":"todayDate",{date:r}):d&&(r=a.format("dateSelected",{date:r})),e.minValue&&n.isSameDay(i,e.minValue)?r+=", "+a.format("minimumDate"):e.maxValue&&n.isSameDay(i,e.maxValue)&&(r+=", "+a.format("maximumDate")),r},[R,m,a,d,v,i,e,b]),p="";"anchorDate"in e&&f&&!e.isReadOnly&&g&&(e.anchorDate?p=a.format("finishRangeSelectionPrompt"):p=a.format("startRangeSelectionPrompt"));let x=A.useDescription(p),y=l.useRef(!1),h=l.useRef(!1),D=l.useRef(void 0),{pressProps:C,isPressed:O}=j.usePress({shouldCancelOnPointerExit:"anchorDate"in e&&!!e.anchorDate,preventFocusOnPress:!0,isDisabled:!g||e.isReadOnly,onPressStart(r){if(e.isReadOnly){e.setFocusedDate(i);return}if("highlightedRange"in e&&!e.anchorDate&&(r.pointerType==="mouse"||r.pointerType==="touch")){if(e.highlightedRange&&!c){if(n.isSameDay(i,e.highlightedRange.start)){e.setAnchorDate(e.highlightedRange.end),e.setFocusedDate(i),e.setDragging(!0),h.current=!0;return}else if(n.isSameDay(i,e.highlightedRange.end)){e.setAnchorDate(e.highlightedRange.start),e.setFocusedDate(i),e.setDragging(!0),h.current=!0;return}}let o=()=>{e.setDragging(!0),D.current=void 0,e.selectDate(i),e.setFocusedDate(i),y.current=!0};r.pointerType==="touch"?D.current=setTimeout(o,200):o()}},onPressEnd(){h.current=!1,y.current=!1,clearTimeout(D.current),D.current=void 0},onPress(){!("anchorDate"in e)&&!e.isReadOnly&&(e.selectDate(i),e.setFocusedDate(i))},onPressUp(r){if(!e.isReadOnly&&("anchorDate"in e&&D.current&&(e.selectDate(i),e.setFocusedDate(i)),"anchorDate"in e))if(h.current)e.setAnchorDate(i);else if(e.anchorDate&&!y.current)e.selectDate(i),e.setFocusedDate(i);else if(r.pointerType==="keyboard"&&!e.anchorDate){e.selectDate(i);let o=i.add({days:1});e.isInvalid(o)&&(o=i.subtract({days:1})),e.isInvalid(o)||e.setFocusedDate(o)}else r.pointerType==="virtual"&&(e.selectDate(i),e.setFocusedDate(i))}}),F;s||(F=n.isSameDay(i,e.focusedDate)?0:-1),l.useEffect(()=>{f&&u.current&&($.focusWithoutScrolling(u.current),B.getInteractionModality()!=="pointer"&&document.activeElement===u.current&&U.scrollIntoViewport(u.current,{containingElement:w.getScrollParent(u.current)}))},[f,u]);let q=P.useDateFormatter({day:"numeric",timeZone:e.timeZone,calendar:i.calendar.identifier}),V=l.useMemo(()=>q.formatToParts(m).find(r=>r.type==="day").value,[q,m]);return{cellProps:{role:"gridcell","aria-disabled":!g||void 0,"aria-selected":d||void 0,"aria-invalid":c||void 0},buttonProps:Z.mergeProps(C,{onFocus(){s||e.setFocusedDate(i)},tabIndex:F,role:"button","aria-disabled":!g||void 0,"aria-label":M,"aria-invalid":c||void 0,"aria-describedby":[c?T:void 0,x["aria-describedby"]].filter(Boolean).join(" ")||void 0,onPointerEnter(r){"highlightDate"in e&&(r.pointerType!=="touch"||e.isDragging)&&g&&e.highlightDate(i)},onPointerDown(r){"releasePointerCapture"in r.target&&r.target.releasePointerCapture(r.pointerId)},onContextMenu(r){r.preventDefault()}}),isPressed:O,isFocused:f,isSelected:d,isDisabled:s,isUnavailable:S,isOutsideVisibleRange:i.compare(e.visibleRange.start)<0||i.compare(e.visibleRange.end)>0,isInvalid:c,formattedDate:V}}exports.useCalendarCell=_;
1
+ "use strict";const B=require("./index285.js"),c=require("./index286.js");function N(P){let{swiper:e,extendParams:S,on:I,emit:T}=P;const Y=B.a();S({mousewheel:{enabled:!1,releaseOnEdges:!1,invert:!1,forceToAxis:!1,sensitivity:1,eventsTarget:"container",thresholdDelta:null,thresholdTime:null,noMousewheelClass:"swiper-no-mousewheel"}}),e.mousewheel={enabled:!1};let E,g=c.d(),u;const i=[];function L(t){let o=0,r=0,s=0,l=0;return"detail"in t&&(r=t.detail),"wheelDelta"in t&&(r=-t.wheelDelta/120),"wheelDeltaY"in t&&(r=-t.wheelDeltaY/120),"wheelDeltaX"in t&&(o=-t.wheelDeltaX/120),"axis"in t&&t.axis===t.HORIZONTAL_AXIS&&(o=r,r=0),s=o*10,l=r*10,"deltaY"in t&&(l=t.deltaY),"deltaX"in t&&(s=t.deltaX),t.shiftKey&&!s&&(s=l,l=0),(s||l)&&t.deltaMode&&(t.deltaMode===1?(s*=40,l*=40):(s*=800,l*=800)),s&&!o&&(o=s<1?-1:1),l&&!r&&(r=l<1?-1:1),{spinX:o,spinY:r,pixelX:s,pixelY:l}}function _(){e.enabled&&(e.mouseEntered=!0)}function G(){e.enabled&&(e.mouseEntered=!1)}function y(t){return e.params.mousewheel.thresholdDelta&&t.delta<e.params.mousewheel.thresholdDelta||e.params.mousewheel.thresholdTime&&c.d()-g<e.params.mousewheel.thresholdTime?!1:t.delta>=6&&c.d()-g<60?!0:(t.direction<0?(!e.isEnd||e.params.loop)&&!e.animating&&(e.slideNext(),T("scroll",t.raw)):(!e.isBeginning||e.params.loop)&&!e.animating&&(e.slidePrev(),T("scroll",t.raw)),g=new Y.Date().getTime(),!1)}function O(t){const a=e.params.mousewheel;if(t.direction<0){if(e.isEnd&&!e.params.loop&&a.releaseOnEdges)return!0}else if(e.isBeginning&&!e.params.loop&&a.releaseOnEdges)return!0;return!1}function w(t){let a=t,b=!0;if(!e.enabled||t.target.closest(`.${e.params.mousewheel.noMousewheelClass}`))return;const f=e.params.mousewheel;e.params.cssMode&&a.preventDefault();let o=e.el;e.params.mousewheel.eventsTarget!=="container"&&(o=document.querySelector(e.params.mousewheel.eventsTarget));const r=o&&o.contains(a.target);if(!e.mouseEntered&&!r&&!f.releaseOnEdges)return!0;a.originalEvent&&(a=a.originalEvent);let s=0;const l=e.rtlTranslate?-1:1,d=L(a);if(f.forceToAxis)if(e.isHorizontal())if(Math.abs(d.pixelX)>Math.abs(d.pixelY))s=-d.pixelX*l;else return!0;else if(Math.abs(d.pixelY)>Math.abs(d.pixelX))s=-d.pixelY;else return!0;else s=Math.abs(d.pixelX)>Math.abs(d.pixelY)?-d.pixelX*l:-d.pixelY;if(s===0)return!0;f.invert&&(s=-s);let h=e.getTranslate()+s*f.sensitivity;if(h>=e.minTranslate()&&(h=e.minTranslate()),h<=e.maxTranslate()&&(h=e.maxTranslate()),b=e.params.loop?!0:!(h===e.minTranslate()||h===e.maxTranslate()),b&&e.params.nested&&a.stopPropagation(),!e.params.freeMode||!e.params.freeMode.enabled){const n={time:c.d(),delta:Math.abs(s),direction:Math.sign(s),raw:t};i.length>=2&&i.shift();const m=i.length?i[i.length-1]:void 0;if(i.push(n),m?(n.direction!==m.direction||n.delta>m.delta||n.time>m.time+150)&&y(n):y(n),O(n))return!0}else{const n={time:c.d(),delta:Math.abs(s),direction:Math.sign(s)},m=u&&n.time<u.time+500&&n.delta<=u.delta&&n.direction===u.direction;if(!m){u=void 0;let p=e.getTranslate()+s*f.sensitivity;const A=e.isBeginning,C=e.isEnd;if(p>=e.minTranslate()&&(p=e.minTranslate()),p<=e.maxTranslate()&&(p=e.maxTranslate()),e.setTransition(0),e.setTranslate(p),e.updateProgress(),e.updateActiveIndex(),e.updateSlidesClasses(),(!A&&e.isBeginning||!C&&e.isEnd)&&e.updateSlidesClasses(),e.params.loop&&e.loopFix({direction:n.direction<0?"next":"prev",byMousewheel:!0}),e.params.freeMode.sticky){clearTimeout(E),E=void 0,i.length>=15&&i.shift();const M=i.length?i[i.length-1]:void 0,H=i[0];if(i.push(n),M&&(n.delta>M.delta||n.direction!==M.direction))i.splice(0);else if(i.length>=15&&n.time-H.time<500&&H.delta-n.delta>=1&&n.delta<=6){const X=s>0?.8:.2;u=n,i.splice(0),E=c.n(()=>{e.destroyed||!e.params||e.slideToClosest(e.params.speed,!0,void 0,X)},0)}E||(E=c.n(()=>{if(e.destroyed||!e.params)return;const X=.5;u=n,i.splice(0),e.slideToClosest(e.params.speed,!0,void 0,X)},500))}if(m||T("scroll",a),e.params.autoplay&&e.params.autoplayDisableOnInteraction&&e.autoplay.stop(),f.releaseOnEdges&&(p===e.minTranslate()||p===e.maxTranslate()))return!0}}return a.preventDefault?a.preventDefault():a.returnValue=!1,!1}function D(t){let a=e.el;e.params.mousewheel.eventsTarget!=="container"&&(a=document.querySelector(e.params.mousewheel.eventsTarget)),a[t]("mouseenter",_),a[t]("mouseleave",G),a[t]("wheel",w)}function v(){return e.params.cssMode?(e.wrapperEl.removeEventListener("wheel",w),!0):e.mousewheel.enabled?!1:(D("addEventListener"),e.mousewheel.enabled=!0,!0)}function x(){return e.params.cssMode?(e.wrapperEl.addEventListener(event,w),!0):e.mousewheel.enabled?(D("removeEventListener"),e.mousewheel.enabled=!1,!0):!1}I("init",()=>{!e.params.mousewheel.enabled&&e.params.cssMode&&x(),e.params.mousewheel.enabled&&v()}),I("destroy",()=>{e.params.cssMode&&v(),e.mousewheel.enabled&&x()}),Object.assign(e.mousewheel,{enable:v,disable:x})}module.exports=N;