@devalok/shilp-sutra-karm 0.1.0 → 0.1.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 (64) hide show
  1. package/dist/admin/break/break-admin.d.ts.map +1 -1
  2. package/dist/admin/break/break-admin.js +205 -179
  3. package/dist/admin/break/delete-break.d.ts +2 -4
  4. package/dist/admin/break/delete-break.d.ts.map +1 -1
  5. package/dist/admin/break/delete-break.js +20 -19
  6. package/dist/admin/break/edit-break-balance.d.ts +2 -4
  7. package/dist/admin/break/edit-break-balance.d.ts.map +1 -1
  8. package/dist/admin/break/edit-break-balance.js +20 -19
  9. package/dist/admin/break/edit-break.d.ts +2 -4
  10. package/dist/admin/break/edit-break.d.ts.map +1 -1
  11. package/dist/admin/break/edit-break.js +114 -147
  12. package/dist/admin/break/header.d.ts.map +1 -1
  13. package/dist/admin/break/header.js +52 -50
  14. package/dist/admin/break/leave-request.d.ts +4 -6
  15. package/dist/admin/break/leave-request.d.ts.map +1 -1
  16. package/dist/admin/break/leave-request.js +57 -58
  17. package/dist/admin/dashboard/admin-dashboard.js +2 -2
  18. package/dist/admin/dashboard/associate-detail.d.ts.map +1 -1
  19. package/dist/admin/dashboard/associate-detail.js +46 -57
  20. package/dist/admin/dashboard/attendance-overview.d.ts.map +1 -1
  21. package/dist/admin/dashboard/attendance-overview.js +2 -4
  22. package/dist/admin/dashboard/break-request.d.ts.map +1 -1
  23. package/dist/admin/dashboard/break-request.js +31 -30
  24. package/dist/admin/dashboard/calendar.js +1 -1
  25. package/dist/admin/dashboard/correction-list.d.ts.map +1 -1
  26. package/dist/admin/dashboard/correction-list.js +49 -47
  27. package/dist/admin/dashboard/dashboard-header.d.ts.map +1 -1
  28. package/dist/admin/dashboard/dashboard-header.js +7 -6
  29. package/dist/admin/dashboard/dashboard-skeleton.d.ts.map +1 -1
  30. package/dist/admin/dashboard/dashboard-skeleton.js +11 -13
  31. package/dist/admin/dashboard/leave-requests.d.ts.map +1 -1
  32. package/dist/admin/dashboard/leave-requests.js +78 -75
  33. package/dist/admin/index.d.ts +1 -1
  34. package/dist/admin/index.d.ts.map +1 -1
  35. package/dist/admin/index.js +8 -8
  36. package/dist/admin/utils/render-adjustment-type.d.ts +1 -1
  37. package/dist/admin/utils/render-adjustment-type.d.ts.map +1 -1
  38. package/dist/admin/utils/render-adjustment-type.js +1 -1
  39. package/dist/board/task-card.js +1 -1
  40. package/dist/chat/markdown-components.d.ts +30 -0
  41. package/dist/chat/markdown-components.d.ts.map +1 -0
  42. package/dist/chat/markdown-components.js +16 -0
  43. package/dist/chat/message-list.d.ts.map +1 -1
  44. package/dist/chat/message-list.js +37 -47
  45. package/dist/chat/streaming-text.d.ts.map +1 -1
  46. package/dist/chat/streaming-text.js +10 -23
  47. package/dist/client/client-portal-header.js +5 -5
  48. package/dist/client/project-card.d.ts.map +1 -1
  49. package/dist/dashboard/attendance-cta.d.ts +1 -1
  50. package/dist/dashboard/attendance-cta.d.ts.map +1 -1
  51. package/dist/dashboard/attendance-cta.js +25 -38
  52. package/dist/dashboard/daily-brief.d.ts +1 -1
  53. package/dist/dashboard/daily-brief.d.ts.map +1 -1
  54. package/dist/dashboard/daily-brief.js +2 -1
  55. package/dist/dashboard/index.d.ts +2 -2
  56. package/dist/dashboard/index.d.ts.map +1 -1
  57. package/dist/dashboard/index.js +4 -4
  58. package/dist/index.js +11 -11
  59. package/dist/page-skeletons.d.ts.map +1 -1
  60. package/dist/tasks/review-tab.js +3 -3
  61. package/dist/tasks/task-detail-panel.d.ts +1 -4
  62. package/dist/tasks/task-detail-panel.d.ts.map +1 -1
  63. package/dist/tasks/task-detail-panel.js +96 -96
  64. package/package.json +3 -2
@@ -1 +1 @@
1
- {"version":3,"file":"break-admin.d.ts","sourceRoot":"","sources":["../../../src/admin/break/break-admin.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAc9B,OAAO,EAAoB,KAAK,iBAAiB,EAAE,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AE,MAAM,KAAK,OAAO,CAAC,YAAY,EAAE,CAAC,CAAA;IAK7E,iBAAiB,CAAC,EAAE,iBAAiB,CAAA;IAErC,0FAA0F;IAC1F,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B;AAggBD,eAAO,MAAM,UAAU;;;;;;;CAOrB,CAAA"}
@@ -1,54 +1,54 @@
1
- import { jsxs as c, Fragment as T, jsx as e } from "react/jsx-runtime";
1
+ import { jsxs as d, Fragment as q, jsx as e } from "react/jsx-runtime";
2
2
  import * as B from "react";
3
- import { useState as C, useMemo as se, useCallback as q, createContext as ie, useContext as le } from "react";
4
- import { cn as u } from "@devalok/shilp-sutra/ui";
5
- import { useToast as ce } from "@devalok/shilp-sutra/ui";
3
+ import { useState as N, useMemo as re, useCallback as F, createContext as ie, useContext as ce } from "react";
4
+ import { cn as p } from "@devalok/shilp-sutra/ui";
5
+ import { useToast as le } from "@devalok/shilp-sutra/ui";
6
6
  import { BreakBalance as de } from "./break-balance.js";
7
7
  import { LeaveRequest as me } from "./leave-request.js";
8
8
  import { Breaks as ue } from "./breaks.js";
9
9
  import { BreakAdminHeader as fe } from "./header.js";
10
10
  import { BreakAdminSkeleton as pe } from "./break-admin-skeleton.js";
11
- const I = ie(null);
12
- function A() {
13
- const d = le(I);
14
- if (!d)
11
+ const te = ie(null);
12
+ function w() {
13
+ const m = ce(te);
14
+ if (!m)
15
15
  throw new Error(
16
16
  "BreakAdmin compound components must be used within <BreakAdmin>"
17
17
  );
18
- return d;
18
+ return m;
19
19
  }
20
- const S = B.forwardRef(
20
+ const L = B.forwardRef(
21
21
  function({
22
- currentUser: o,
23
- breaks: s,
22
+ currentUser: s,
23
+ breaks: i,
24
24
  pendingRequests: t,
25
- cashoutRequests: a = [],
25
+ cashoutRequests: o = [],
26
26
  breakBalanceData: n,
27
- breakBalance: i,
27
+ breakBalance: c,
28
28
  userImages: l,
29
- users: f,
30
- isLoading: h = !1,
31
- isLoadingBreaks: k = !1,
32
- isLoadingRequests: v = !1,
33
- isLoadingBalance: _ = !1,
34
- existingBreaks: R,
35
- filters: m,
36
- onFilterChange: N,
29
+ users: u,
30
+ isLoading: k = !1,
31
+ isLoadingBreaks: g = !1,
32
+ isLoadingRequests: y = !1,
33
+ isLoadingBalance: O = !1,
34
+ existingBreaks: v,
35
+ filters: f,
36
+ onFilterChange: R,
37
37
  onApproveRequest: P,
38
38
  onRejectRequest: j,
39
39
  onApproveCashout: xe,
40
40
  onRejectCashout: be,
41
- onRefresh: U,
42
- onSaveBreak: Y,
43
- onDeleteBreak: $,
44
- onSaveBalance: z,
41
+ onRefresh: Y,
42
+ onSaveBreak: $,
43
+ onDeleteBreak: z,
44
+ onSaveBalance: I,
45
45
  onFetchMonthBreaks: Q,
46
- realtimeCallbacks: Be,
47
- children: V
48
- }, G) {
49
- const [J, W] = C("breaks"), [y, w] = C(!1), [X, H] = C(
46
+ realtimeCallbacks: he,
47
+ children: ae
48
+ }, oe) {
49
+ const [U, V] = N("breaks"), [b, C] = N(!1), [G, E] = N(
50
50
  null
51
- ), [Z, O] = C(null), { toast: b } = ce(), ee = se(
51
+ ), [J, T] = N(null), { toast: h } = le(), ne = re(
52
52
  () => ({
53
53
  selectedAssociate: null,
54
54
  dateFilterStart: null,
@@ -58,124 +58,150 @@ const S = B.forwardRef(
58
58
  isOpen: !1
59
59
  }),
60
60
  []
61
- ), re = m || ee, te = q(
62
- (p) => {
63
- N && N(p);
61
+ ), W = f || ne, X = F(
62
+ (a) => {
63
+ R && R(a);
64
64
  },
65
- [N]
66
- ), ae = q(
67
- async (p, x, g) => {
68
- if (!y) {
69
- if (!g && (p.metaKey || p.ctrlKey)) {
70
- H(x);
65
+ [R]
66
+ ), Z = F(
67
+ async (a, x, A) => {
68
+ if (!b) {
69
+ if (!A && ((a == null ? void 0 : a.metaKey) || (a == null ? void 0 : a.ctrlKey))) {
70
+ E(x);
71
71
  return;
72
72
  }
73
73
  try {
74
- w(!0);
75
- const r = t.find((E) => E.id === x);
74
+ C(!0);
75
+ const r = t.find((K) => K.id === x);
76
76
  if (!r)
77
77
  throw new Error("Request not found");
78
- P && P(x, g, r.correction, r), b({
79
- description: /* @__PURE__ */ c(T, { children: [
80
- /* @__PURE__ */ c("span", { children: [
78
+ P && P(x, A, r.correction, r), h({
79
+ description: /* @__PURE__ */ d(q, { children: [
80
+ /* @__PURE__ */ d("span", { children: [
81
81
  r.correction ? "Attendance correction" : "Break request",
82
82
  " "
83
83
  ] }),
84
- /* @__PURE__ */ e("span", { style: { color: "var(--color-success-text)" }, children: "approved successfully" })
84
+ /* @__PURE__ */ e("span", { className: "text-success-text", children: "approved successfully" })
85
85
  ] }),
86
86
  variant: "default",
87
- style: { marginBottom: "16px", border: "None" }
87
+ style: { marginBottom: "var(--spacing-04)", border: "none" }
88
88
  });
89
89
  } catch (r) {
90
- console.error("Error approving request:", r), b({
90
+ console.error("Error approving request:", r), h({
91
91
  title: "Error",
92
92
  description: r instanceof Error ? r.message : "Failed to approve request",
93
93
  variant: "error"
94
94
  });
95
95
  } finally {
96
- w(!1);
96
+ C(!1);
97
97
  }
98
98
  }
99
99
  },
100
- [y, t, P, b]
101
- ), ne = q(
102
- async (p, x, g) => {
103
- if (!y) {
104
- if (!g && (p.metaKey || p.ctrlKey)) {
105
- O(x);
100
+ [b, t, P, h]
101
+ ), ee = F(
102
+ async (a, x, A) => {
103
+ if (!b) {
104
+ if (!A && ((a == null ? void 0 : a.metaKey) || (a == null ? void 0 : a.ctrlKey))) {
105
+ T(x);
106
106
  return;
107
107
  }
108
108
  try {
109
- w(!0);
110
- const r = t.find((E) => E.id === x);
109
+ C(!0);
110
+ const r = t.find((K) => K.id === x);
111
111
  if (!r)
112
112
  throw new Error("Request not found");
113
- j && j(x, g, r.correction, r), b({
114
- description: /* @__PURE__ */ c(T, { children: [
115
- /* @__PURE__ */ c("span", { children: [
113
+ j && j(x, A, r.correction, r), h({
114
+ description: /* @__PURE__ */ d(q, { children: [
115
+ /* @__PURE__ */ d("span", { children: [
116
116
  r.correction ? "Attendance correction" : "Break request",
117
117
  " "
118
118
  ] }),
119
- /* @__PURE__ */ e("span", { style: { color: "var(--color-error-text)" }, children: "rejected" })
119
+ /* @__PURE__ */ e("span", { className: "text-error-text", children: "rejected" })
120
120
  ] }),
121
121
  variant: "default",
122
- style: { marginBottom: "16px", border: "None" }
122
+ style: { marginBottom: "var(--spacing-04)", border: "none" }
123
123
  });
124
124
  } catch (r) {
125
- console.error("Error rejecting request:", r), b({
125
+ console.error("Error rejecting request:", r), h({
126
126
  title: "Error",
127
127
  description: r instanceof Error ? r.message : "Failed to reject request",
128
128
  variant: "error"
129
129
  });
130
130
  } finally {
131
- w(!1);
131
+ C(!1);
132
132
  }
133
133
  }
134
134
  },
135
- [y, t, j, b]
135
+ [b, t, j, h]
136
+ ), se = re(
137
+ () => ({
138
+ currentUser: s,
139
+ activeTab: U,
140
+ setActiveTab: V,
141
+ isProcessing: b,
142
+ breaks: i,
143
+ pendingRequests: t,
144
+ cashoutRequests: o,
145
+ breakBalanceData: n,
146
+ breakBalance: c,
147
+ userImages: l,
148
+ users: u,
149
+ existingBreaks: v,
150
+ filters: W,
151
+ handleFilterChange: X,
152
+ handleApproveRequest: Z,
153
+ handleRejectRequest: ee,
154
+ acceptedCommentBox: G,
155
+ rejectedCommentBox: J,
156
+ setAcceptedCommentBox: E,
157
+ setRejectedCommentBox: T,
158
+ onRefresh: Y,
159
+ onSaveBreak: $,
160
+ onDeleteBreak: z,
161
+ onSaveBalance: I,
162
+ onFetchMonthBreaks: Q
163
+ }),
164
+ [
165
+ s,
166
+ U,
167
+ V,
168
+ b,
169
+ i,
170
+ t,
171
+ o,
172
+ n,
173
+ c,
174
+ l,
175
+ u,
176
+ v,
177
+ W,
178
+ X,
179
+ Z,
180
+ ee,
181
+ G,
182
+ J,
183
+ E,
184
+ T,
185
+ Y,
186
+ $,
187
+ z,
188
+ I,
189
+ Q
190
+ ]
136
191
  );
137
- if (h)
138
- return /* @__PURE__ */ e(pe, {});
139
- const oe = {
140
- currentUser: o,
141
- activeTab: J,
142
- setActiveTab: W,
143
- isProcessing: y,
144
- breaks: s,
145
- pendingRequests: t,
146
- cashoutRequests: a,
147
- breakBalanceData: n,
148
- breakBalance: i,
149
- userImages: l,
150
- users: f,
151
- existingBreaks: R,
152
- filters: re,
153
- handleFilterChange: te,
154
- handleApproveRequest: ae,
155
- handleRejectRequest: ne,
156
- acceptedCommentBox: X,
157
- rejectedCommentBox: Z,
158
- setAcceptedCommentBox: H,
159
- setRejectedCommentBox: O,
160
- onRefresh: U,
161
- onSaveBreak: Y,
162
- onDeleteBreak: $,
163
- onSaveBalance: z,
164
- onFetchMonthBreaks: Q
165
- };
166
- return /* @__PURE__ */ e(I.Provider, { value: oe, children: /* @__PURE__ */ e(
192
+ return k ? /* @__PURE__ */ e(pe, {}) : /* @__PURE__ */ e(te.Provider, { value: se, children: /* @__PURE__ */ e(
167
193
  "div",
168
194
  {
169
- ref: G,
195
+ ref: oe,
170
196
  className: "z-base flex w-full max-w-layout flex-col items-center justify-center md:pt-0",
171
- children: /* @__PURE__ */ e("div", { className: "no-scrollbar w-full overflow-auto border border-border-subtle sm:rounded-ds-lg max-md:rounded-ds-none max-md:border-0", children: V ?? /* @__PURE__ */ c(T, { children: [
172
- /* @__PURE__ */ e(F, {}),
173
- /* @__PURE__ */ c("div", { className: "no-scrollbar flex h-fit min-w-[800px] flex-col border-t-[1px] border-border-subtle bg-layer-02 shadow-transparent max-lg:min-w-[100%] max-lg:overflow-x-auto", children: [
174
- /* @__PURE__ */ e(K, {}),
175
- /* @__PURE__ */ c("div", { className: "w-full border-0 max-lg:min-w-[800px]", children: [
176
- /* @__PURE__ */ e(L, {}),
177
- /* @__PURE__ */ e(M, {}),
178
- /* @__PURE__ */ e(D, {})
197
+ children: /* @__PURE__ */ e("div", { className: "no-scrollbar w-full overflow-auto border border-border-subtle sm:rounded-ds-lg max-md:rounded-ds-none max-md:border-0", children: ae ?? /* @__PURE__ */ d(q, { children: [
198
+ /* @__PURE__ */ e(S, {}),
199
+ /* @__PURE__ */ d("div", { className: "no-scrollbar flex h-fit min-w-[800px] flex-col border-t-[1px] border-border-subtle bg-layer-02 shadow-transparent max-lg:min-w-[100%] max-lg:overflow-x-auto", children: [
200
+ /* @__PURE__ */ e(M, {}),
201
+ /* @__PURE__ */ d("div", { className: "w-full border-0 max-lg:min-w-[800px]", children: [
202
+ /* @__PURE__ */ e(_, {}),
203
+ /* @__PURE__ */ e(D, {}),
204
+ /* @__PURE__ */ e(H, {})
179
205
  ] })
180
206
  ] })
181
207
  ] }) })
@@ -183,63 +209,63 @@ const S = B.forwardRef(
183
209
  ) });
184
210
  }
185
211
  );
186
- S.displayName = "BreakAdmin";
187
- const F = B.forwardRef(function({ className: o, ...s }, t) {
212
+ L.displayName = "BreakAdmin";
213
+ const S = B.forwardRef(function({ className: s, ...i }, t) {
188
214
  const {
189
- filters: a,
215
+ filters: o,
190
216
  handleFilterChange: n,
191
- breakBalance: i,
217
+ breakBalance: c,
192
218
  userImages: l,
193
- users: f
194
- } = A();
195
- return /* @__PURE__ */ e("div", { ref: t, className: u(o), ...s, children: /* @__PURE__ */ e(
219
+ users: u
220
+ } = w();
221
+ return /* @__PURE__ */ e("div", { ref: t, className: p(s), ...i, children: /* @__PURE__ */ e(
196
222
  fe,
197
223
  {
198
- filters: a,
224
+ filters: o,
199
225
  onFilterChange: n,
200
- breakBalance: i,
226
+ breakBalance: c,
201
227
  userImages: l,
202
- users: f
228
+ users: u
203
229
  }
204
230
  ) });
205
231
  });
206
- F.displayName = "BreakAdmin.Header";
207
- const K = B.forwardRef(function({ className: o, ...s }, t) {
208
- const { activeTab: a, setActiveTab: n, pendingRequests: i, breakBalanceData: l } = A();
209
- return /* @__PURE__ */ c(
232
+ S.displayName = "BreakAdmin.Header";
233
+ const M = B.forwardRef(function({ className: s, ...i }, t) {
234
+ const { activeTab: o, setActiveTab: n, pendingRequests: c, breakBalanceData: l } = w();
235
+ return /* @__PURE__ */ d(
210
236
  "div",
211
237
  {
212
238
  ref: t,
213
- className: u(
239
+ className: p(
214
240
  "flex w-full gap-ds-03 border-b-[1px] border-border px-ds-06 pt-ds-03 max-lg:min-w-[800px]",
215
- o
241
+ s
216
242
  ),
217
- ...s,
243
+ ...i,
218
244
  children: [
219
245
  /* @__PURE__ */ e(
220
246
  "button",
221
247
  {
222
- className: u("text-ds-sm font-semibold uppercase tracking-wider mb-[-1px] px-ds-03 py-ds-04", a === "breaks" ? "text-text-primary border-b-[1px] border-interactive-hover" : "text-text-tertiary"),
248
+ className: p("text-ds-sm font-semibold uppercase tracking-wider mb-[-1px] px-ds-03 py-ds-04", o === "breaks" ? "text-text-primary border-b-[1px] border-interactive-hover" : "text-text-tertiary"),
223
249
  onClick: () => n("breaks"),
224
250
  children: "BREAKS"
225
251
  }
226
252
  ),
227
- /* @__PURE__ */ c(
253
+ /* @__PURE__ */ d(
228
254
  "button",
229
255
  {
230
- className: u("text-ds-sm font-semibold uppercase tracking-wider mb-[-1px] flex items-center gap-ds-02 px-ds-03 py-ds-04", a === "requests" ? "border-b-[1px] border-interactive-hover text-text-primary" : "text-text-tertiary"),
256
+ className: p("text-ds-sm font-semibold uppercase tracking-wider mb-[-1px] flex items-center gap-ds-02 px-ds-03 py-ds-04", o === "requests" ? "border-b-[1px] border-interactive-hover text-text-primary" : "text-text-tertiary"),
231
257
  onClick: () => n("requests"),
232
258
  children: [
233
259
  "REQUESTS",
234
260
  " ",
235
- /* @__PURE__ */ e("span", { className: "text-interactive-hover", children: `(${i.length})` })
261
+ /* @__PURE__ */ e("span", { className: "text-interactive-hover", children: `(${c.length})` })
236
262
  ]
237
263
  }
238
264
  ),
239
- /* @__PURE__ */ c(
265
+ /* @__PURE__ */ d(
240
266
  "button",
241
267
  {
242
- className: u("text-ds-sm font-semibold uppercase tracking-wider mb-[-1px] flex items-center gap-ds-02 px-ds-03 py-ds-04", a === "balance" ? "border-b-[1px] border-interactive-hover text-text-primary" : "text-text-tertiary"),
268
+ className: p("text-ds-sm font-semibold uppercase tracking-wider mb-[-1px] flex items-center gap-ds-02 px-ds-03 py-ds-04", o === "balance" ? "border-b-[1px] border-interactive-hover text-text-primary" : "text-text-tertiary"),
243
269
  onClick: () => n("balance"),
244
270
  children: [
245
271
  "BALANCE",
@@ -252,95 +278,95 @@ const K = B.forwardRef(function({ className: o, ...s }, t) {
252
278
  }
253
279
  );
254
280
  });
255
- K.displayName = "BreakAdmin.TabBar";
256
- const L = B.forwardRef(function({ className: o, ...s }, t) {
281
+ M.displayName = "BreakAdmin.TabBar";
282
+ const _ = B.forwardRef(function({ className: s, ...i }, t) {
257
283
  const {
258
- activeTab: a,
284
+ activeTab: o,
259
285
  breaks: n,
260
- userImages: i,
286
+ userImages: c,
261
287
  existingBreaks: l,
262
- onFetchMonthBreaks: f,
263
- onSaveBreak: h,
264
- onDeleteBreak: k,
265
- onRefresh: v
266
- } = A();
267
- return a !== "breaks" ? null : /* @__PURE__ */ e("div", { ref: t, className: u(o), ...s, children: /* @__PURE__ */ e(
288
+ onFetchMonthBreaks: u,
289
+ onSaveBreak: k,
290
+ onDeleteBreak: g,
291
+ onRefresh: y
292
+ } = w();
293
+ return o !== "breaks" ? null : /* @__PURE__ */ e("div", { ref: t, className: p(s), ...i, children: /* @__PURE__ */ e(
268
294
  ue,
269
295
  {
270
296
  breaks: n,
271
- userImages: i,
297
+ userImages: c,
272
298
  existingBreaks: l,
273
- onFetchMonthBreaks: f,
274
- onSave: h,
275
- onDelete: k,
276
- onRefresh: v
299
+ onFetchMonthBreaks: u,
300
+ onSave: k,
301
+ onDelete: g,
302
+ onRefresh: y
277
303
  }
278
304
  ) });
279
305
  });
280
- L.displayName = "BreakAdmin.BreaksPanel";
281
- const M = B.forwardRef(function({ className: o, ...s }, t) {
306
+ _.displayName = "BreakAdmin.BreaksPanel";
307
+ const D = B.forwardRef(function({ className: s, ...i }, t) {
282
308
  const {
283
- activeTab: a,
309
+ activeTab: o,
284
310
  currentUser: n,
285
- pendingRequests: i,
311
+ pendingRequests: c,
286
312
  userImages: l,
287
- handleApproveRequest: f,
288
- handleRejectRequest: h,
289
- acceptedCommentBox: k,
290
- rejectedCommentBox: v,
291
- setAcceptedCommentBox: _,
292
- setRejectedCommentBox: R
293
- } = A();
294
- return a !== "requests" ? null : /* @__PURE__ */ e(
313
+ handleApproveRequest: u,
314
+ handleRejectRequest: k,
315
+ acceptedCommentBox: g,
316
+ rejectedCommentBox: y,
317
+ setAcceptedCommentBox: O,
318
+ setRejectedCommentBox: v
319
+ } = w();
320
+ return o !== "requests" ? null : /* @__PURE__ */ e(
295
321
  "div",
296
322
  {
297
323
  ref: t,
298
- className: u(
324
+ className: p(
299
325
  /* intentional: h-[400px] is the fixed panel height for break tab content areas; mobile uses dvh for browser chrome */
300
326
  "no-scrollbar flex h-[400px] flex-col gap-ds-02 overflow-y-auto border-t border-t-border px-ds-06 pb-ds-02 pt-ds-02 max-md:h-[calc(100dvh-317px)] max-md:border-0",
301
- o
327
+ s
302
328
  ),
303
- ...s,
304
- children: i.map((m) => /* @__PURE__ */ e(
329
+ ...i,
330
+ children: c.map((f) => /* @__PURE__ */ e(
305
331
  me,
306
332
  {
307
- request: m,
333
+ request: f,
308
334
  userImages: l,
309
- handleRejectRequest: h,
310
- handleApproveRequest: f,
311
- commentBoxOpen: k === m.id || v === m.id,
335
+ handleRejectRequest: k,
336
+ handleApproveRequest: u,
337
+ commentBoxOpen: g === f.id || y === f.id,
312
338
  onCommentBoxClose: () => {
313
- _(null), R(null);
339
+ O(null), v(null);
314
340
  },
315
- clickedAction: k === m.id ? "approve" : v === m.id ? "reject" : null,
341
+ clickedAction: g === f.id ? "approve" : y === f.id ? "reject" : null,
316
342
  userId: n.id
317
343
  },
318
- m.id
344
+ f.id
319
345
  ))
320
346
  }
321
347
  );
322
348
  });
323
- M.displayName = "BreakAdmin.RequestsPanel";
324
- const D = B.forwardRef(function({ className: o, ...s }, t) {
325
- const { activeTab: a, breakBalanceData: n, userImages: i, onSaveBalance: l } = A();
326
- return a !== "balance" ? null : /* @__PURE__ */ e("div", { ref: t, className: u(o), ...s, children: /* @__PURE__ */ e(
349
+ D.displayName = "BreakAdmin.RequestsPanel";
350
+ const H = B.forwardRef(function({ className: s, ...i }, t) {
351
+ const { activeTab: o, breakBalanceData: n, userImages: c, onSaveBalance: l } = w();
352
+ return o !== "balance" ? null : /* @__PURE__ */ e("div", { ref: t, className: p(s), ...i, children: /* @__PURE__ */ e(
327
353
  de,
328
354
  {
329
355
  breakBalanceData: n,
330
- userImages: i,
356
+ userImages: c,
331
357
  onSaveBalance: l
332
358
  }
333
359
  ) });
334
360
  });
335
- D.displayName = "BreakAdmin.BalancePanel";
336
- const Ne = Object.assign(S, {
337
- Root: S,
338
- Header: F,
339
- TabBar: K,
340
- BreaksPanel: L,
341
- RequestsPanel: M,
342
- BalancePanel: D
361
+ H.displayName = "BreakAdmin.BalancePanel";
362
+ const Re = Object.assign(L, {
363
+ Root: L,
364
+ Header: S,
365
+ TabBar: M,
366
+ BreaksPanel: _,
367
+ RequestsPanel: D,
368
+ BalancePanel: H
343
369
  });
344
370
  export {
345
- Ne as BreakAdmin
371
+ Re as BreakAdmin
346
372
  };
@@ -1,10 +1,8 @@
1
+ import * as React from 'react';
1
2
  export interface DeleteBreakProps {
2
3
  id: string;
3
4
  userId: string;
4
5
  onDelete?: () => void;
5
6
  }
6
- export declare function DeleteBreak({ id: _id, userId: _userId, onDelete }: DeleteBreakProps): import("react/jsx-runtime").JSX.Element;
7
- export declare namespace DeleteBreak {
8
- var displayName: string;
9
- }
7
+ export declare const DeleteBreak: React.ForwardRefExoticComponent<DeleteBreakProps & React.RefAttributes<HTMLDivElement>>;
10
8
  //# sourceMappingURL=delete-break.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"delete-break.d.ts","sourceRoot":"","sources":["../../../src/admin/break/delete-break.tsx"],"names":[],"mappings":"AAaA,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;CACtB;AAED,wBAAgB,WAAW,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,gBAAgB,2CA4DnF;yBA5De,WAAW"}
1
+ {"version":3,"file":"delete-break.d.ts","sourceRoot":"","sources":["../../../src/admin/break/delete-break.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAY9B,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;CACtB;AAED,eAAO,MAAM,WAAW,yFA4DtB,CAAA"}
@@ -1,27 +1,28 @@
1
1
  import { jsxs as r, jsx as t } from "react/jsx-runtime";
2
- import { useState as d, useRef as u } from "react";
3
- import { useToast as p } from "@devalok/shilp-sutra/ui";
4
- import { Dialog as x, DialogTrigger as h, DialogContent as g } from "@devalok/shilp-sutra/ui";
5
- import { Button as b } from "@devalok/shilp-sutra/ui";
6
- import { IconButton as D } from "@devalok/shilp-sutra/ui";
2
+ import * as u from "react";
3
+ import { useState as d, useRef as p } from "react";
4
+ import { useToast as x } from "@devalok/shilp-sutra/ui";
5
+ import { Dialog as h, DialogTrigger as g, DialogContent as b } from "@devalok/shilp-sutra/ui";
6
+ import { Button as D } from "@devalok/shilp-sutra/ui";
7
+ import { IconButton as k } from "@devalok/shilp-sutra/ui";
7
8
  import { IconTrash as y } from "@tabler/icons-react";
8
- function k({ id: v, userId: w, onDelete: a }) {
9
- const [c, l] = d(!1), { toast: s } = p(), [m, i] = d(!1), n = u(null);
10
- return /* @__PURE__ */ r(x, { open: m, onOpenChange: i, children: [
11
- /* @__PURE__ */ t(h, { asChild: !0, children: /* @__PURE__ */ t(D, { icon: /* @__PURE__ */ t(y, {}), size: "md", "aria-label": "Delete break" }) }),
12
- /* @__PURE__ */ r(g, { className: "flex w-[335px] flex-col items-center gap-ds-06 p-ds-06 max-md:w-[90%] max-md:rounded-ds-lg", children: [
9
+ const w = u.forwardRef(function({ id: N, userId: B, onDelete: a }, I) {
10
+ const [c, l] = d(!1), { toast: s } = x(), [m, o] = d(!1), i = p(null);
11
+ return /* @__PURE__ */ r(h, { open: m, onOpenChange: o, children: [
12
+ /* @__PURE__ */ t(g, { asChild: !0, children: /* @__PURE__ */ t(k, { icon: /* @__PURE__ */ t(y, {}), size: "md", "aria-label": "Delete break" }) }),
13
+ /* @__PURE__ */ r(b, { className: "flex w-[335px] flex-col items-center gap-ds-06 p-ds-06 max-md:w-[90%] max-md:rounded-ds-lg", children: [
13
14
  /* @__PURE__ */ r("div", { className: "flex w-full max-w-[240px] flex-col items-center gap-ds-04 text-center", children: [
14
15
  /* @__PURE__ */ t("p", { className: "text-ds-lg font-semibold text-center text-text-primary", children: "Delete this break?" }),
15
16
  /* @__PURE__ */ t("p", { className: "text-ds-base text-text-tertiary", children: "This will be permanently deleted and can not undo" })
16
17
  ] }),
17
- /* @__PURE__ */ t("form", { ref: n, onSubmit: async (e) => {
18
- var o;
19
- e.preventDefault(), (o = e.stopPropagation) == null || o.call(e), l(!0);
18
+ /* @__PURE__ */ t("form", { ref: i, onSubmit: async (e) => {
19
+ var n;
20
+ e.preventDefault(), (n = e.stopPropagation) == null || n.call(e), l(!0);
20
21
  try {
21
22
  a && a(), s({
22
23
  description: "Break request deleted successfully",
23
24
  variant: "default"
24
- }), i(!1);
25
+ }), o(!1);
25
26
  } catch (f) {
26
27
  console.error("Error deleting break request:", f), s({
27
28
  title: "Error",
@@ -32,13 +33,13 @@ function k({ id: v, userId: w, onDelete: a }) {
32
33
  l(!1);
33
34
  }
34
35
  }, className: "w-full", children: /* @__PURE__ */ t(
35
- b,
36
+ D,
36
37
  {
37
38
  className: "w-full",
38
39
  variant: "primary",
39
40
  onClick: () => {
40
41
  var e;
41
- return (e = n.current) == null ? void 0 : e.requestSubmit();
42
+ return (e = i.current) == null ? void 0 : e.requestSubmit();
42
43
  },
43
44
  disabled: c,
44
45
  children: "Yes, Delete"
@@ -46,8 +47,8 @@ function k({ id: v, userId: w, onDelete: a }) {
46
47
  ) })
47
48
  ] })
48
49
  ] });
49
- }
50
- k.displayName = "DeleteBreak";
50
+ });
51
+ w.displayName = "DeleteBreak";
51
52
  export {
52
- k as DeleteBreak
53
+ w as DeleteBreak
53
54
  };