se-design 1.0.83-dev.4 → 1.0.83-r-dev.1

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 (269) hide show
  1. package/dist/assets/icons/tag.svg +2 -2
  2. package/dist/assets/style.css +1 -1
  3. package/dist/components/AccessibleDiv/index.d.ts +1 -23
  4. package/dist/components/Dropdown/index.d.ts +0 -2
  5. package/dist/components/DropdownWithInputTags/index.d.ts +0 -3
  6. package/dist/components/Link/index.d.ts +2 -6
  7. package/dist/components/NLSearch/ClearAiFiltersBar.d.ts +21 -0
  8. package/dist/components/NLSearch/NLDynamicChip.d.ts +26 -0
  9. package/dist/components/NLSearch/NLSearchInput.d.ts +46 -0
  10. package/dist/components/NLSearch/index.d.ts +6 -0
  11. package/dist/components/index.d.ts +2 -0
  12. package/dist/index.js +139 -140
  13. package/dist/index.js.map +1 -1
  14. package/dist/index100.js.map +1 -1
  15. package/dist/index101.js.map +1 -1
  16. package/dist/index102.js.map +1 -1
  17. package/dist/index103.js.map +1 -1
  18. package/dist/index104.js.map +1 -1
  19. package/dist/index105.js.map +1 -1
  20. package/dist/index106.js.map +1 -1
  21. package/dist/index107.js.map +1 -1
  22. package/dist/index108.js.map +1 -1
  23. package/dist/index109.js.map +1 -1
  24. package/dist/index11.js +1 -1
  25. package/dist/index110.js.map +1 -1
  26. package/dist/index111.js.map +1 -1
  27. package/dist/index112.js.map +1 -1
  28. package/dist/index113.js.map +1 -1
  29. package/dist/index114.js.map +1 -1
  30. package/dist/index115.js.map +1 -1
  31. package/dist/index116.js.map +1 -1
  32. package/dist/index117.js.map +1 -1
  33. package/dist/index118.js.map +1 -1
  34. package/dist/index119.js.map +1 -1
  35. package/dist/index12.js +1 -1
  36. package/dist/index120.js.map +1 -1
  37. package/dist/index121.js.map +1 -1
  38. package/dist/index122.js.map +1 -1
  39. package/dist/index123.js.map +1 -1
  40. package/dist/index124.js.map +1 -1
  41. package/dist/index125.js.map +1 -1
  42. package/dist/index126.js.map +1 -1
  43. package/dist/index127.js.map +1 -1
  44. package/dist/index128.js.map +1 -1
  45. package/dist/index129.js.map +1 -1
  46. package/dist/index13.js +1 -1
  47. package/dist/index130.js.map +1 -1
  48. package/dist/index131.js.map +1 -1
  49. package/dist/index132.js.map +1 -1
  50. package/dist/index133.js.map +1 -1
  51. package/dist/index134.js.map +1 -1
  52. package/dist/index135.js.map +1 -1
  53. package/dist/index136.js.map +1 -1
  54. package/dist/index137.js.map +1 -1
  55. package/dist/index138.js.map +1 -1
  56. package/dist/index139.js.map +1 -1
  57. package/dist/index140.js.map +1 -1
  58. package/dist/index141.js.map +1 -1
  59. package/dist/index142.js.map +1 -1
  60. package/dist/index143.js.map +1 -1
  61. package/dist/index144.js.map +1 -1
  62. package/dist/index145.js.map +1 -1
  63. package/dist/index146.js.map +1 -1
  64. package/dist/index147.js.map +1 -1
  65. package/dist/index148.js.map +1 -1
  66. package/dist/index149.js.map +1 -1
  67. package/dist/index150.js.map +1 -1
  68. package/dist/index151.js.map +1 -1
  69. package/dist/index152.js.map +1 -1
  70. package/dist/index153.js.map +1 -1
  71. package/dist/index154.js.map +1 -1
  72. package/dist/index155.js.map +1 -1
  73. package/dist/index156.js.map +1 -1
  74. package/dist/index157.js.map +1 -1
  75. package/dist/index158.js.map +1 -1
  76. package/dist/index159.js.map +1 -1
  77. package/dist/index16.js +23 -25
  78. package/dist/index16.js.map +1 -1
  79. package/dist/index160.js.map +1 -1
  80. package/dist/index161.js.map +1 -1
  81. package/dist/index162.js.map +1 -1
  82. package/dist/index163.js.map +1 -1
  83. package/dist/index164.js.map +1 -1
  84. package/dist/index165.js.map +1 -1
  85. package/dist/index166.js.map +1 -1
  86. package/dist/index167.js.map +1 -1
  87. package/dist/index168.js.map +1 -1
  88. package/dist/index169.js.map +1 -1
  89. package/dist/index17.js +29 -29
  90. package/dist/index17.js.map +1 -1
  91. package/dist/index170.js.map +1 -1
  92. package/dist/index171.js.map +1 -1
  93. package/dist/index172.js.map +1 -1
  94. package/dist/index173.js.map +1 -1
  95. package/dist/index174.js.map +1 -1
  96. package/dist/index175.js.map +1 -1
  97. package/dist/index176.js.map +1 -1
  98. package/dist/index177.js.map +1 -1
  99. package/dist/index178.js.map +1 -1
  100. package/dist/index179.js.map +1 -1
  101. package/dist/index18.js +63 -85
  102. package/dist/index18.js.map +1 -1
  103. package/dist/index180.js.map +1 -1
  104. package/dist/index181.js.map +1 -1
  105. package/dist/index182.js.map +1 -1
  106. package/dist/index183.js.map +1 -1
  107. package/dist/index184.js.map +1 -1
  108. package/dist/index185.js.map +1 -1
  109. package/dist/index186.js.map +1 -1
  110. package/dist/index187.js.map +1 -1
  111. package/dist/index188.js.map +1 -1
  112. package/dist/index189.js.map +1 -1
  113. package/dist/index19.js +167 -182
  114. package/dist/index19.js.map +1 -1
  115. package/dist/index190.js.map +1 -1
  116. package/dist/index191.js.map +1 -1
  117. package/dist/index192.js.map +1 -1
  118. package/dist/index193.js +1 -1
  119. package/dist/index193.js.map +1 -1
  120. package/dist/index194.js.map +1 -1
  121. package/dist/index195.js.map +1 -1
  122. package/dist/index196.js.map +1 -1
  123. package/dist/index197.js.map +1 -1
  124. package/dist/index198.js.map +1 -1
  125. package/dist/index199.js.map +1 -1
  126. package/dist/index200.js.map +1 -1
  127. package/dist/index201.js.map +1 -1
  128. package/dist/index202.js.map +1 -1
  129. package/dist/index203.js.map +1 -1
  130. package/dist/index207.js +2 -2
  131. package/dist/index208.js +3 -3
  132. package/dist/index208.js.map +1 -1
  133. package/dist/index216.js +9 -13
  134. package/dist/index216.js.map +1 -1
  135. package/dist/index23.js +2 -2
  136. package/dist/index244.js +1 -1
  137. package/dist/index25.js +160 -174
  138. package/dist/index25.js.map +1 -1
  139. package/dist/index27.js +1 -1
  140. package/dist/index28.js +4 -4
  141. package/dist/index28.js.map +1 -1
  142. package/dist/index29.js +30 -34
  143. package/dist/index29.js.map +1 -1
  144. package/dist/index3.js +50 -60
  145. package/dist/index3.js.map +1 -1
  146. package/dist/index30.js +3 -3
  147. package/dist/index32.js +10 -11
  148. package/dist/index35.js +3 -3
  149. package/dist/index36.js +4 -4
  150. package/dist/index38.js +195 -210
  151. package/dist/index38.js.map +1 -1
  152. package/dist/index39.js +2 -2
  153. package/dist/index4.js +3 -3
  154. package/dist/index42.js +7 -8
  155. package/dist/index43.js +13 -14
  156. package/dist/index43.js.map +1 -1
  157. package/dist/index45.js +60 -61
  158. package/dist/index45.js.map +1 -1
  159. package/dist/index46.js +198 -194
  160. package/dist/index46.js.map +1 -1
  161. package/dist/index47.js +40 -38
  162. package/dist/index47.js.map +1 -1
  163. package/dist/index48.js +36 -33
  164. package/dist/index48.js.map +1 -1
  165. package/dist/index50.js +189 -78
  166. package/dist/index50.js.map +1 -1
  167. package/dist/index51.js +36 -459
  168. package/dist/index51.js.map +1 -1
  169. package/dist/index52.js +33 -98
  170. package/dist/index52.js.map +1 -1
  171. package/dist/index53.js +151 -36
  172. package/dist/index53.js.map +1 -1
  173. package/dist/index54.js +84 -36
  174. package/dist/index54.js.map +1 -1
  175. package/dist/index55.js +456 -88
  176. package/dist/index55.js.map +1 -1
  177. package/dist/index56.js +96 -161
  178. package/dist/index56.js.map +1 -1
  179. package/dist/index57.js +35 -146
  180. package/dist/index57.js.map +1 -1
  181. package/dist/index58.js +38 -33
  182. package/dist/index58.js.map +1 -1
  183. package/dist/index59.js +89 -83
  184. package/dist/index59.js.map +1 -1
  185. package/dist/index6.js +237 -239
  186. package/dist/index6.js.map +1 -1
  187. package/dist/index60.js +157 -113
  188. package/dist/index60.js.map +1 -1
  189. package/dist/index61.js +143 -62
  190. package/dist/index61.js.map +1 -1
  191. package/dist/index62.js +33 -152
  192. package/dist/index62.js.map +1 -1
  193. package/dist/index63.js +80 -312
  194. package/dist/index63.js.map +1 -1
  195. package/dist/index64.js +118 -46
  196. package/dist/index64.js.map +1 -1
  197. package/dist/index65.js +62 -140
  198. package/dist/index65.js.map +1 -1
  199. package/dist/index66.js +152 -12
  200. package/dist/index66.js.map +1 -1
  201. package/dist/index67.js +316 -44
  202. package/dist/index67.js.map +1 -1
  203. package/dist/index68.js +44 -104
  204. package/dist/index68.js.map +1 -1
  205. package/dist/index69.js +143 -18
  206. package/dist/index69.js.map +1 -1
  207. package/dist/index7.js +8 -9
  208. package/dist/index70.js +9 -63
  209. package/dist/index70.js.map +1 -1
  210. package/dist/index71.js +45 -26
  211. package/dist/index71.js.map +1 -1
  212. package/dist/index72.js +78 -102
  213. package/dist/index72.js.map +1 -1
  214. package/dist/index73.js +18 -61
  215. package/dist/index73.js.map +1 -1
  216. package/dist/index74.js +63 -18
  217. package/dist/index74.js.map +1 -1
  218. package/dist/index75.js +24 -105
  219. package/dist/index75.js.map +1 -1
  220. package/dist/index76.js +108 -18
  221. package/dist/index76.js.map +1 -1
  222. package/dist/index77.js +61 -10
  223. package/dist/index77.js.map +1 -1
  224. package/dist/index78.js +21 -5
  225. package/dist/index78.js.map +1 -1
  226. package/dist/index79.js +5 -56
  227. package/dist/index79.js.map +1 -1
  228. package/dist/index80.js +50 -23
  229. package/dist/index80.js.map +1 -1
  230. package/dist/index81.js +22 -7
  231. package/dist/index81.js.map +1 -1
  232. package/dist/index82.js +12 -0
  233. package/dist/index82.js.map +1 -0
  234. package/dist/index84.js +2 -2
  235. package/dist/index84.js.map +1 -1
  236. package/dist/index85.js +2 -2
  237. package/dist/index85.js.map +1 -1
  238. package/dist/index86.js +2 -2
  239. package/dist/index86.js.map +1 -1
  240. package/dist/index87.js +2 -2
  241. package/dist/index87.js.map +1 -1
  242. package/dist/index88.js +1 -1
  243. package/dist/index88.js.map +1 -1
  244. package/dist/index89.js +1 -1
  245. package/dist/index89.js.map +1 -1
  246. package/dist/index9.js +3 -3
  247. package/dist/index90.js +1 -1
  248. package/dist/index90.js.map +1 -1
  249. package/dist/index91.js +1 -1
  250. package/dist/index91.js.map +1 -1
  251. package/dist/index92.js +1 -1
  252. package/dist/index92.js.map +1 -1
  253. package/dist/index93.js +1 -1
  254. package/dist/index93.js.map +1 -1
  255. package/dist/index94.js +1 -1
  256. package/dist/index94.js.map +1 -1
  257. package/dist/index95.js +1 -1
  258. package/dist/index95.js.map +1 -1
  259. package/dist/index96.js +1 -1
  260. package/dist/index96.js.map +1 -1
  261. package/dist/index97.js.map +1 -1
  262. package/dist/index98.js.map +1 -1
  263. package/dist/index99.js.map +1 -1
  264. package/package.json +1 -1
  265. package/dist/assets/icons/chat.svg +0 -4
  266. package/dist/index49.js +0 -152
  267. package/dist/index49.js.map +0 -1
  268. package/dist/index83.js +0 -5
  269. package/dist/index83.js.map +0 -1
package/dist/index55.js CHANGED
@@ -1,96 +1,464 @@
1
- import t from "react";
1
+ import r, { useState as S } from "react";
2
+ import { Button as z } from "./index4.js";
3
+ import { Icon as _ } from "./index6.js";
4
+ import { Dropdown as te } from "./index25.js";
5
+ import { useDatePickerA11y as Fe, formatDateId as Pe, getCellAriaLabel as Ce } from "./index244.js";
2
6
  /* empty css */
3
- const n = ({
4
- element: e,
5
- animationDuration: d,
6
- baseColor: s,
7
- highlightColor: m
7
+ function T() {
8
+ return T = Object.assign ? Object.assign.bind() : function(p) {
9
+ for (var m = 1; m < arguments.length; m++) {
10
+ var v = arguments[m];
11
+ for (var w in v) ({}).hasOwnProperty.call(v, w) && (p[w] = v[w]);
12
+ }
13
+ return p;
14
+ }, T.apply(null, arguments);
15
+ }
16
+ const Oe = ["S", "M", "T", "W", "T", "F", "S"], Se = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], Te = ["Today", "Yesterday", "This Week", "Last Week", "This Month", "Last Month"], q = [{
17
+ value: "january",
18
+ label: "January"
19
+ }, {
20
+ value: "february",
21
+ label: "February"
22
+ }, {
23
+ value: "march",
24
+ label: "March"
25
+ }, {
26
+ value: "april",
27
+ label: "April"
28
+ }, {
29
+ value: "may",
30
+ label: "May"
31
+ }, {
32
+ value: "june",
33
+ label: "June"
34
+ }, {
35
+ value: "july",
36
+ label: "July"
37
+ }, {
38
+ value: "august",
39
+ label: "August"
40
+ }, {
41
+ value: "september",
42
+ label: "September"
43
+ }, {
44
+ value: "october",
45
+ label: "October"
46
+ }, {
47
+ value: "november",
48
+ label: "November"
49
+ }, {
50
+ value: "december",
51
+ label: "December"
52
+ }], Re = (p, m) => new Date(p, m + 1, 0).getDate(), je = (p, m) => new Date(p, m, 1).getDay(), ze = ({
53
+ title: p = "Select modified date",
54
+ // isOpen = true,
55
+ showHeader: m = !0,
56
+ initialStartDate: v,
57
+ initialEndDate: w,
58
+ onApply: R = () => {
59
+ },
60
+ onClose: j,
61
+ shouldAllowFutureDateSelection: F = !1,
62
+ maxDays: g,
63
+ disablePastDates: A = !1,
64
+ singleDateSelection: P = !1,
65
+ minYearOption: ae,
66
+ showQuickActions: ne = !1,
67
+ showSingleMonth: h = !1,
68
+ className: re = "",
69
+ automationId: y = "datepicker",
70
+ labels: J = {
71
+ clear: "Clear",
72
+ apply: "Apply"
73
+ }
8
74
  }) => {
9
- const i = {
10
- width: typeof e.width == "number" ? `${e.width}px` : e.width,
11
- height: typeof e.height == "number" ? `${e.height}px` : e.height,
12
- borderRadius: e.borderRadius ? typeof e.borderRadius == "number" ? `${e.borderRadius}px` : e.borderRadius : void 0,
13
- margin: e.margin,
14
- "--shimmer-duration": `${d}s`,
15
- "--shimmer-base-color": s,
16
- "--shimmer-highlight-color": m
17
- }, r = `se-design-shimmer-element se-design-shimmer-${e.type}`;
18
- return /* @__PURE__ */ t.createElement("div", {
19
- className: r,
20
- style: i
21
- }, e.children && e.children.map((a, p) => /* @__PURE__ */ t.createElement(n, {
22
- key: p,
23
- element: a,
24
- animationDuration: d,
25
- baseColor: s,
26
- highlightColor: m
27
- })));
28
- }, y = ({
29
- container: e,
30
- animationDuration: d,
31
- baseColor: s,
32
- highlightColor: m
33
- }) => {
34
- const i = {
35
- display: "flex",
36
- flexDirection: e.direction || "column",
37
- gap: typeof e.gap == "number" ? `${e.gap}px` : e.gap,
38
- padding: e.padding,
39
- margin: e.margin,
40
- alignItems: e.alignItems,
41
- flex: e.flex
42
- };
43
- return /* @__PURE__ */ t.createElement("div", {
44
- className: `se-design-shimmer-container ${e.className || ""}`,
45
- style: i
46
- }, e.children.map((r, a) => r.type === "container" ? /* @__PURE__ */ t.createElement(y, {
47
- key: a,
48
- container: r,
49
- animationDuration: d,
50
- baseColor: s,
51
- highlightColor: m
52
- }) : /* @__PURE__ */ t.createElement(n, {
53
- key: a,
54
- element: r,
55
- animationDuration: d,
56
- baseColor: s,
57
- highlightColor: m
58
- })));
59
- }, l = ({
60
- structure: e,
61
- className: d = "",
62
- animationDuration: s = 3,
63
- baseColor: m = "var(--color-gray-700)",
64
- highlightColor: i = "var(--color-gray-600)",
65
- width: r,
66
- height: a
67
- }) => {
68
- const p = {
69
- width: r ? typeof r == "number" ? `${r}px` : r : "100%",
70
- height: a ? typeof a == "number" ? `${a}px` : a : "auto",
71
- "--shimmer-duration": `${s}s`,
72
- "--shimmer-base-color": m,
73
- "--shimmer-highlight-color": i
75
+ const oe = () => {
76
+ if (v && w)
77
+ return {
78
+ startDate: v,
79
+ endDate: w
80
+ };
81
+ const t = /* @__PURE__ */ new Date();
82
+ t.setHours(23, 59, 59, 999);
83
+ const e = /* @__PURE__ */ new Date();
84
+ return e.setHours(0, 0, 0, 0), {
85
+ startDate: e,
86
+ endDate: t
87
+ };
88
+ }, se = () => {
89
+ const t = /* @__PURE__ */ new Date(), e = /* @__PURE__ */ new Date();
90
+ return t.setDate(1), e.setDate(1), h || e.setMonth(e.getMonth() - 1), t.setHours(0, 0, 0, 0), e.setHours(0, 0, 0, 0), [e, t];
91
+ }, [l, M] = S(oe), [Q] = S(se), [x, W] = S(() => Q[0]), [C, G] = S(() => Q[1]), V = (t, e) => t.getTime() > e.getTime() ? [e, t] : [t, e], N = (t, e) => {
92
+ if (h) {
93
+ W(t);
94
+ return;
95
+ }
96
+ if (e) {
97
+ const [a, n] = V(t, C);
98
+ W(a), n !== C && G(n);
99
+ } else {
100
+ const [a, n] = V(x, t);
101
+ a !== x && W(a), G(n);
102
+ }
103
+ }, {
104
+ getGridCellProps: le,
105
+ getLeftContainerProps: ce,
106
+ getRightContainerProps: ie
107
+ } = Fe({
108
+ leftMonth: x,
109
+ rightMonth: C,
110
+ showSingleMonth: h,
111
+ selectedRange: l,
112
+ onMonthChange: N
113
+ }), ue = (t, e) => {
114
+ const a = Re(t, e), n = je(t, e), d = [];
115
+ for (let c = 0; c < n; c++)
116
+ d.push(null);
117
+ for (let c = 1; c <= a; c++) {
118
+ const u = new Date(t, e, c);
119
+ u.setHours(0, 0, 0, 0), d.push(u);
120
+ }
121
+ return d;
122
+ }, O = (t, e) => t.getDate() === e.getDate() && t.getMonth() === e.getMonth() && t.getFullYear() === e.getFullYear(), de = (t) => {
123
+ if (!l.startDate || !l.endDate) return !1;
124
+ const e = new Date(t);
125
+ e.setHours(12, 0, 0, 0);
126
+ const a = new Date(l.startDate);
127
+ a.setHours(0, 0, 0, 0);
128
+ const n = new Date(l.endDate);
129
+ return n.setHours(23, 59, 59, 999), e >= a && e <= n;
130
+ }, ge = (t) => {
131
+ const e = /* @__PURE__ */ new Date();
132
+ return t.getDate() === e.getDate() && t.getMonth() === e.getMonth() && t.getFullYear() === e.getFullYear();
133
+ }, I = (t) => {
134
+ if (!t) return !0;
135
+ const e = /* @__PURE__ */ new Date();
136
+ e.setHours(0, 0, 0, 0);
137
+ const a = new Date(t);
138
+ if (a.setHours(0, 0, 0, 0), A && a < e)
139
+ return !0;
140
+ if (g != null) {
141
+ const n = new Date(e);
142
+ return n.setDate(n.getDate() + g), n.setHours(0, 0, 0, 0), a > n;
143
+ }
144
+ return F ? !1 : a > e;
145
+ }, De = (t) => {
146
+ if (I(t)) return;
147
+ const e = new Date(t);
148
+ if (e.setHours(12, 0, 0, 0), P) {
149
+ M({
150
+ startDate: e,
151
+ endDate: e
152
+ }), R({
153
+ startDate: e,
154
+ endDate: e
155
+ }), j?.();
156
+ return;
157
+ }
158
+ if (!l.startDate || l.endDate)
159
+ M({
160
+ startDate: e,
161
+ endDate: null
162
+ });
163
+ else {
164
+ const a = new Date(l.startDate);
165
+ a.setHours(12, 0, 0, 0);
166
+ const n = e > a ? e : a, d = e > a ? a : e;
167
+ M({
168
+ startDate: d,
169
+ endDate: n
170
+ });
171
+ }
172
+ }, K = (t, e) => {
173
+ const a = new Date(t);
174
+ return a.setMonth(a.getMonth() + (e ? 1 : -1)), a;
175
+ }, me = (t) => l?.startDate ? O(t, l.startDate) : !1, fe = (t) => l?.endDate ? O(t, l?.endDate) : !1, pe = (t) => !l.startDate || !l.endDate ? !1 : O(l.startDate, l.endDate) && O(t, l.startDate), he = (t, e) => {
176
+ const a = ae || t - 10;
177
+ let n = F ? t + 10 : t;
178
+ if (g) {
179
+ const c = /* @__PURE__ */ new Date(), u = new Date(c);
180
+ u.setDate(u.getDate() + g);
181
+ const b = u.getFullYear();
182
+ n = Math.min(n, b);
183
+ }
184
+ n = Math.max(n, e);
185
+ const d = n - a + 1;
186
+ return Array.from({
187
+ length: d
188
+ }, (c, u) => ({
189
+ value: a + u,
190
+ label: (a + u).toString()
191
+ })).filter((c) => {
192
+ if (c.value === e)
193
+ return !0;
194
+ if (!F && c.value > t)
195
+ return !1;
196
+ if (g) {
197
+ const u = /* @__PURE__ */ new Date(), b = new Date(u);
198
+ return b.setDate(b.getDate() + g), c.value <= b.getFullYear();
199
+ }
200
+ return !0;
201
+ });
202
+ }, be = () => {
203
+ const t = /* @__PURE__ */ new Date(), e = /* @__PURE__ */ new Date();
204
+ e.setHours(0, 0, 0, 0), t.setHours(23, 59, 59, 999), M({
205
+ startDate: e,
206
+ endDate: t
207
+ });
208
+ }, k = (t) => {
209
+ const e = new Date(t);
210
+ return e.setHours(0, 0, 0, 0), e;
211
+ }, E = (t) => {
212
+ const e = new Date(t);
213
+ return e.setHours(23, 59, 59, 999), e;
214
+ }, ve = (t) => {
215
+ const e = /* @__PURE__ */ new Date();
216
+ let a = /* @__PURE__ */ new Date(), n = /* @__PURE__ */ new Date();
217
+ switch (t) {
218
+ case "Today":
219
+ a = k(e), n = E(e);
220
+ break;
221
+ case "Yesterday":
222
+ a = k(new Date(e.setDate(e.getDate() - 1))), n = E(new Date(e));
223
+ break;
224
+ case "This Week":
225
+ const d = new Date(e.setDate(e.getDate() - e.getDay()));
226
+ a = k(d), n = E(/* @__PURE__ */ new Date());
227
+ break;
228
+ case "Last Week":
229
+ const c = new Date(e.setDate(e.getDate() - e.getDay() - 7)), u = new Date(e.setDate(c.getDate() + 6));
230
+ a = k(c), n = E(u);
231
+ break;
232
+ case "This Month":
233
+ a = k(new Date(e.getFullYear(), e.getMonth(), 1)), n = E(/* @__PURE__ */ new Date());
234
+ break;
235
+ case "Last Month":
236
+ a = k(new Date(e.getFullYear(), e.getMonth() - 1, 1)), n = E(new Date(e.getFullYear(), e.getMonth(), 0));
237
+ break;
238
+ }
239
+ M({
240
+ startDate: a,
241
+ endDate: n
242
+ });
243
+ }, we = () => /* @__PURE__ */ r.createElement("div", {
244
+ className: "w-[147px] p-4 border-r border-[var(--color-gray-200)]"
245
+ }, /* @__PURE__ */ r.createElement("div", {
246
+ role: "group",
247
+ "aria-label": "Quick date selections",
248
+ className: "flex flex-col gap-3"
249
+ }, Te.map((t) => /* @__PURE__ */ r.createElement(z, {
250
+ key: t,
251
+ label: t,
252
+ type: "link",
253
+ onClick: () => ve(t)
254
+ })))), ye = () => {
255
+ const {
256
+ startDate: t = null,
257
+ endDate: e = null
258
+ } = l;
259
+ if (t && e) {
260
+ R({
261
+ startDate: t,
262
+ endDate: e
263
+ });
264
+ return;
265
+ }
266
+ if (t || e) {
267
+ const a = t || e;
268
+ R({
269
+ startDate: a,
270
+ endDate: a
271
+ });
272
+ }
273
+ }, U = (t, e) => {
274
+ const a = t.getFullYear(), n = t.getMonth(), d = ue(a, n), c = (/* @__PURE__ */ new Date()).getFullYear(), u = he(c, a), b = new Date(a, n, 1).toLocaleString("en-US", {
275
+ month: "long",
276
+ year: "numeric"
277
+ }), ke = e ? ce : ie, X = `calendar-instructions-${e ? "left" : "right"}`, Ee = P ? "Press Enter or Space to select a date. Use arrow keys to navigate days, Page Up and Page Down to change months." : "Press Enter or Space to select a start date, then again to select an end date. Use arrow keys to navigate days, Page Up and Page Down to change months.", Me = le({
278
+ isLeftCalendar: e,
279
+ isDateDisabled: I,
280
+ handleDateClick: De
281
+ }), Z = [];
282
+ for (let o = 0; o < d.length; o += 7) {
283
+ const s = d.slice(o, o + 7);
284
+ for (; s.length < 7; ) s.push(null);
285
+ Z.push(s);
286
+ }
287
+ const $ = /* @__PURE__ */ new Date(), xe = A && t.getMonth() === $.getMonth() && t.getFullYear() === $.getFullYear(), Ne = !F && n === $.getMonth() && a === $.getFullYear() || g !== void 0 && (() => {
288
+ const o = new Date($);
289
+ return o.setDate(o.getDate() + g), t.getMonth() === o.getMonth() && t.getFullYear() === o.getFullYear();
290
+ })();
291
+ return /* @__PURE__ */ r.createElement("div", {
292
+ className: "se-design-calendar-container w-fit p-4"
293
+ }, /* @__PURE__ */ r.createElement("div", {
294
+ className: "flex justify-between items-center"
295
+ }, /* @__PURE__ */ r.createElement(_, {
296
+ name: "chevron",
297
+ rotation: "90",
298
+ size: 16,
299
+ disabled: xe,
300
+ onClick: () => {
301
+ const o = K(t, !1);
302
+ if (A) {
303
+ const s = /* @__PURE__ */ new Date();
304
+ if (s.setHours(0, 0, 0, 0), o < s && o.getMonth() !== s.getMonth())
305
+ return;
306
+ }
307
+ N(o, e);
308
+ },
309
+ automationId: `${y}-previous-month`,
310
+ ariaLabel: h ? "Previous month" : e ? "Previous month of starting date" : "Previous month of end date"
311
+ }), /* @__PURE__ */ r.createElement("div", {
312
+ className: "flex gap-2",
313
+ onClick: (o) => o.stopPropagation()
314
+ }, /* @__PURE__ */ r.createElement(te, {
315
+ type: "select",
316
+ dropDownOptions: q,
317
+ defaultSelectedValue: q[n],
318
+ selectBy: "label",
319
+ optionsUniqueBy: "value",
320
+ displaySelected: !0,
321
+ label: h ? "Month" : e ? "Start month" : "End month",
322
+ firstOptionAsHeading: !0,
323
+ onOptionClick: (o) => {
324
+ const s = new Date(t);
325
+ s.setMonth(q.findIndex((i) => i.value === o.value)), N(s, e);
326
+ },
327
+ className: "w-[124px] dropdown-option-container"
328
+ }), /* @__PURE__ */ r.createElement(te, {
329
+ type: "select",
330
+ dropDownOptions: u,
331
+ defaultSelectedValue: u.find((o) => o.value === a),
332
+ selectBy: "label",
333
+ optionsUniqueBy: "value",
334
+ displaySelected: !0,
335
+ label: h ? "Year" : e ? "Start year" : "End year",
336
+ firstOptionAsHeading: !0,
337
+ onOptionClick: (o) => {
338
+ const s = new Date(t);
339
+ s.setFullYear(o.value), N(s, e);
340
+ },
341
+ className: "w-[104px] dropdown-option-container"
342
+ })), /* @__PURE__ */ r.createElement(_, {
343
+ name: "chevron",
344
+ rotation: "270",
345
+ size: 16,
346
+ disabled: Ne,
347
+ onClick: () => {
348
+ const o = K(t, !0);
349
+ if (g !== void 0) {
350
+ const s = /* @__PURE__ */ new Date(), i = new Date(s);
351
+ if (i.setDate(i.getDate() + g), o > i)
352
+ return;
353
+ }
354
+ N(o, e);
355
+ },
356
+ automationId: `${y}-next-month`,
357
+ ariaLabel: h ? "Next month" : e ? "Next month of starting date" : "Next month of end date"
358
+ })), /* @__PURE__ */ r.createElement("span", {
359
+ id: X,
360
+ className: "sr-only"
361
+ }, Ee), /* @__PURE__ */ r.createElement("div", T({}, ke({
362
+ ariaLabel: b,
363
+ ariaDescribedBy: X
364
+ }), {
365
+ className: "mt-3"
366
+ }), /* @__PURE__ */ r.createElement("div", {
367
+ role: "row",
368
+ className: "grid grid-cols-7 gap-2"
369
+ }, Oe.map((o, s) => /* @__PURE__ */ r.createElement("abbr", {
370
+ key: `${o}-${s}`,
371
+ role: "columnheader",
372
+ title: Se[s],
373
+ className: "datepicker-weekdays"
374
+ }, o))), Z.map((o, s) => /* @__PURE__ */ r.createElement("div", {
375
+ key: s,
376
+ role: "row",
377
+ className: "grid grid-cols-7 gap-2"
378
+ }, o.map((i, $e) => {
379
+ if (!i)
380
+ return /* @__PURE__ */ r.createElement("div", {
381
+ key: `empty-${s}-${$e}`,
382
+ role: "gridcell",
383
+ "aria-hidden": "true",
384
+ className: "h-10 w-10"
385
+ });
386
+ const ee = Pe(i), D = me(i), f = fe(i), H = pe(i), B = !D && !f && de(i), L = ge(i), Y = I(i), {
387
+ ref: He,
388
+ ...Ye
389
+ } = Me({
390
+ cellId: ee,
391
+ cellDate: i,
392
+ disabled: Y,
393
+ ariaLabel: Ce(i, D, f, H, P, B),
394
+ ariaCurrent: L ? "date" : void 0,
395
+ ariaDisabled: Y || void 0
396
+ });
397
+ return /* @__PURE__ */ r.createElement("div", {
398
+ key: ee,
399
+ role: "gridcell",
400
+ "aria-selected": D || f || void 0,
401
+ className: "relative h-10 w-10"
402
+ }, /* @__PURE__ */ r.createElement("button", T({
403
+ type: "button"
404
+ }, Ye, {
405
+ ref: He,
406
+ className: `
407
+ datepicker-cell-button
408
+ h-full w-full flex items-center justify-center
409
+ rounded-md focus-outline transition-colors
410
+ ${Y ? "cursor-not-allowed text-[var(--color-gray-600)] hover:bg-transparent" : "cursor-pointer"}
411
+ ${H ? "bg-[var(--color-blue-500)] text-[var(--color-white)] hover:bg-[var(--color-blue-600)]" : ""}
412
+ ${!H && D ? "bg-[var(--color-blue-500)] text-[var(--color-white)] hover:bg-[var(--color-blue-600)]" : ""}
413
+ ${!H && f ? "bg-[var(--color-blue-500)] text-[var(--color-white)] hover:bg-[var(--color-blue-600)]" : ""}
414
+ ${!D && !f && B ? "bg-[var(--color-blue-100)] text-[var(--color-blue-600)] outline outline-1 outline-[var(--color-blue-500)]" : ""}
415
+ ${!D && !f && !B && !Y ? "hover:bg-[var(--color-blue-100)] hover:outline hover:outline-1 hover:outline-[var(--color-blue-500)]" : ""}
416
+ ${L && !D && !f ? "text-[var(--color-blue-500)] bg-[var(--color-blue-100)] outline outline-1 outline-[var(--color-blue-500)]" : ""}
417
+ ${!Y && !D && !f && !L ? "text-[var(--color-blue-500)]" : ""}
418
+ `,
419
+ "data-automation-id": `${y}-date-${i.getDate()}`
420
+ }), i.getDate()), !H && (D || f) && /* @__PURE__ */ r.createElement("div", {
421
+ "aria-hidden": "true",
422
+ className: `absolute top-0 bottom-0 ${D ? "right-[-8px]" : "left-[-8px]"} w-[8px]
423
+ bg-[var(--color-blue-100)] -z-10`
424
+ }));
425
+ })))));
74
426
  };
75
- return /* @__PURE__ */ t.createElement("div", {
76
- className: `se-design-shimmer-loader ${d}`,
77
- style: p
78
- }, e.map((c, o) => c.type === "container" ? /* @__PURE__ */ t.createElement(y, {
79
- key: o,
80
- container: c,
81
- animationDuration: s,
82
- baseColor: m,
83
- highlightColor: i
84
- }) : /* @__PURE__ */ t.createElement(n, {
85
- key: o,
86
- element: c,
87
- animationDuration: s,
88
- baseColor: m,
89
- highlightColor: i
427
+ return /* @__PURE__ */ r.createElement("div", {
428
+ className: `se-design-datepicker-container flex flex-col bg-[var(--color-white)] rounded-md shadow-md w-max max-w-full ${re}`
429
+ }, m && /* @__PURE__ */ r.createElement("div", {
430
+ className: "se-design-datepicker-header flex justify-between items-center border-b border-[var(--color-gray-200)] p-4"
431
+ }, /* @__PURE__ */ r.createElement("h2", {
432
+ className: "datepicker-title"
433
+ }, p), j && /* @__PURE__ */ r.createElement(_, {
434
+ name: "close",
435
+ size: 16,
436
+ onClick: j,
437
+ className: "cursor-pointer",
438
+ automationId: `${y}-close`,
439
+ ariaLabel: "Close date picker"
440
+ })), /* @__PURE__ */ r.createElement("div", {
441
+ className: "se-design-datepicker-content flex"
442
+ }, ne && we(), /* @__PURE__ */ r.createElement("div", {
443
+ className: "flex"
444
+ }, h ? U(x, !0) : /* @__PURE__ */ r.createElement(r.Fragment, null, U(x, !0), /* @__PURE__ */ r.createElement("div", {
445
+ className: "h-full w-[1px] border-r border-[var(--color-gray-200)]",
446
+ "aria-hidden": "true"
447
+ }), U(C, !1)))), !P && /* @__PURE__ */ r.createElement("div", {
448
+ className: "se-design-datepicker-footer flex justify-end items-center gap-5 p-4 border-t border-[var(--color-gray-200)]"
449
+ }, /* @__PURE__ */ r.createElement(z, {
450
+ label: J?.clear || "Clear",
451
+ type: "ghost",
452
+ onClick: be,
453
+ "data-automation-id": `${y}-clear-button`
454
+ }), /* @__PURE__ */ r.createElement(z, {
455
+ label: J?.apply || "Apply",
456
+ type: "primary",
457
+ onClick: ye,
458
+ "data-automation-id": `${y}-apply-button`
90
459
  })));
91
460
  };
92
461
  export {
93
- l as ShimmerLoader,
94
- l as default
462
+ ze as DatePicker
95
463
  };
96
464
  //# sourceMappingURL=index55.js.map