@devalok/shilp-sutra-karm 0.8.2 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/chat-panel.js +376 -0
- package/dist/_chunks/daily-brief.js +177 -0
- package/dist/_chunks/kanban-board.js +597 -0
- package/dist/_chunks/project-card.js +121 -0
- package/dist/_chunks/render-adjustment-type.js +3596 -0
- package/dist/{tasks → _chunks}/task-constants.js +3 -3
- package/dist/_chunks/task-detail-panel.js +1305 -0
- package/dist/_chunks/use-composed-ref.js +12 -0
- package/dist/_chunks/vendor.js +11491 -0
- package/dist/admin/index.js +37 -60
- package/dist/board/index.js +3 -5
- package/dist/chat/index.js +6 -10
- package/dist/client/index.js +4 -6
- package/dist/dashboard/index.js +3 -4
- package/dist/index.js +189 -103
- package/dist/tasks/index.js +8 -14
- package/package.json +78 -80
- package/dist/admin/adjustments/approved-adjustments.js +0 -43
- package/dist/admin/break/break-admin-skeleton.js +0 -59
- package/dist/admin/break/break-admin.js +0 -373
- package/dist/admin/break/break-balance.js +0 -42
- package/dist/admin/break/breaks.js +0 -91
- package/dist/admin/break/delete-break.js +0 -55
- package/dist/admin/break/edit-break-balance.js +0 -113
- package/dist/admin/break/edit-break.js +0 -453
- package/dist/admin/break/header.js +0 -231
- package/dist/admin/break/leave-request.js +0 -162
- package/dist/admin/break/use-break-date-picker.js +0 -43
- package/dist/admin/dashboard/admin-dashboard.js +0 -337
- package/dist/admin/dashboard/associate-detail.js +0 -259
- package/dist/admin/dashboard/attendance-overview.js +0 -136
- package/dist/admin/dashboard/break-request.js +0 -176
- package/dist/admin/dashboard/calendar.js +0 -141
- package/dist/admin/dashboard/correction-list.js +0 -102
- package/dist/admin/dashboard/dashboard-header.js +0 -155
- package/dist/admin/dashboard/dashboard-skeleton.js +0 -109
- package/dist/admin/dashboard/leave-requests.js +0 -201
- package/dist/admin/dashboard/render-date.js +0 -144
- package/dist/admin/dashboard/use-calendar-navigation.js +0 -169
- package/dist/admin/dashboard/use-leave-request-interaction.js +0 -34
- package/dist/admin/utils/date-range-utils.js +0 -37
- package/dist/admin/utils/date-utils.js +0 -119
- package/dist/admin/utils/emoji-utils.js +0 -17
- package/dist/admin/utils/render-adjustment-type.js +0 -20
- package/dist/admin/utils/render-status.js +0 -22
- package/dist/board/board-column.js +0 -236
- package/dist/board/kanban-board.js +0 -218
- package/dist/board/task-card.js +0 -168
- package/dist/chat/chat-input.js +0 -54
- package/dist/chat/chat-panel.js +0 -151
- package/dist/chat/conversation-list.js +0 -99
- package/dist/chat/markdown-components.js +0 -35
- package/dist/chat/message-list.js +0 -59
- package/dist/chat/streaming-text.js +0 -17
- package/dist/client/accent-provider.js +0 -22
- package/dist/client/client-portal-header.js +0 -48
- package/dist/client/project-card.js +0 -60
- package/dist/dashboard/attendance-cta.js +0 -115
- package/dist/dashboard/daily-brief.js +0 -68
- package/dist/page-skeletons.js +0 -130
- package/dist/tasks/activity-tab.js +0 -185
- package/dist/tasks/conversation-tab.js +0 -138
- package/dist/tasks/files-tab.js +0 -186
- package/dist/tasks/review-tab.js +0 -170
- package/dist/tasks/subtasks-tab.js +0 -154
- package/dist/tasks/task-detail-panel.js +0 -210
- package/dist/tasks/task-properties.js +0 -324
- package/dist/utils/use-composed-ref.js +0 -12
package/package.json
CHANGED
|
@@ -1,80 +1,78 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@devalok/shilp-sutra-karm",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Domain components for Karm — board, tasks, chat, dashboard, client, and admin",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"type": "module",
|
|
7
|
-
"main": "./dist/index.js",
|
|
8
|
-
"module": "./dist/index.js",
|
|
9
|
-
"types": "./dist/index.d.ts",
|
|
10
|
-
"sideEffects": [
|
|
11
|
-
"**/*.css"
|
|
12
|
-
],
|
|
13
|
-
"exports": {
|
|
14
|
-
".": {
|
|
15
|
-
"import": "./dist/index.js",
|
|
16
|
-
"default": "./dist/index.js",
|
|
17
|
-
"types": "./dist/index.d.ts"
|
|
18
|
-
},
|
|
19
|
-
"./board": {
|
|
20
|
-
"import": "./dist/board/index.js",
|
|
21
|
-
"default": "./dist/board/index.js",
|
|
22
|
-
"types": "./dist/board/index.d.ts"
|
|
23
|
-
},
|
|
24
|
-
"./tasks": {
|
|
25
|
-
"import": "./dist/tasks/index.js",
|
|
26
|
-
"default": "./dist/tasks/index.js",
|
|
27
|
-
"types": "./dist/tasks/index.d.ts"
|
|
28
|
-
},
|
|
29
|
-
"./chat": {
|
|
30
|
-
"import": "./dist/chat/index.js",
|
|
31
|
-
"default": "./dist/chat/index.js",
|
|
32
|
-
"types": "./dist/chat/index.d.ts"
|
|
33
|
-
},
|
|
34
|
-
"./dashboard": {
|
|
35
|
-
"import": "./dist/dashboard/index.js",
|
|
36
|
-
"default": "./dist/dashboard/index.js",
|
|
37
|
-
"types": "./dist/dashboard/index.d.ts"
|
|
38
|
-
},
|
|
39
|
-
"./client": {
|
|
40
|
-
"import": "./dist/client/index.js",
|
|
41
|
-
"default": "./dist/client/index.js",
|
|
42
|
-
"types": "./dist/client/index.d.ts"
|
|
43
|
-
},
|
|
44
|
-
"./admin": {
|
|
45
|
-
"import": "./dist/admin/index.js",
|
|
46
|
-
"default": "./dist/admin/index.js",
|
|
47
|
-
"types": "./dist/admin/index.d.ts"
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
"files": [
|
|
51
|
-
"dist",
|
|
52
|
-
"README.md",
|
|
53
|
-
"llms.txt"
|
|
54
|
-
],
|
|
55
|
-
"scripts": {
|
|
56
|
-
"build": "vite build && node scripts/inject-use-client.mjs",
|
|
57
|
-
"typecheck": "tsc --noEmit",
|
|
58
|
-
"lint": "eslint src/",
|
|
59
|
-
"prepublishOnly": "pnpm build"
|
|
60
|
-
},
|
|
61
|
-
"peerDependencies": {
|
|
62
|
-
"@devalok/shilp-sutra": ">=0.7.0",
|
|
63
|
-
"@tabler/icons-react": "^3.0.0",
|
|
64
|
-
"react": "^18 || ^19",
|
|
65
|
-
"react-dom": "^18 || ^19"
|
|
66
|
-
},
|
|
67
|
-
"devDependencies": {
|
|
68
|
-
"@devalok/shilp-sutra": "workspace:*"
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
"@dnd-kit/
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@devalok/shilp-sutra-karm",
|
|
3
|
+
"version": "0.9.0",
|
|
4
|
+
"description": "Domain components for Karm — board, tasks, chat, dashboard, client, and admin",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"module": "./dist/index.js",
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"sideEffects": [
|
|
11
|
+
"**/*.css"
|
|
12
|
+
],
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"import": "./dist/index.js",
|
|
16
|
+
"default": "./dist/index.js",
|
|
17
|
+
"types": "./dist/index.d.ts"
|
|
18
|
+
},
|
|
19
|
+
"./board": {
|
|
20
|
+
"import": "./dist/board/index.js",
|
|
21
|
+
"default": "./dist/board/index.js",
|
|
22
|
+
"types": "./dist/board/index.d.ts"
|
|
23
|
+
},
|
|
24
|
+
"./tasks": {
|
|
25
|
+
"import": "./dist/tasks/index.js",
|
|
26
|
+
"default": "./dist/tasks/index.js",
|
|
27
|
+
"types": "./dist/tasks/index.d.ts"
|
|
28
|
+
},
|
|
29
|
+
"./chat": {
|
|
30
|
+
"import": "./dist/chat/index.js",
|
|
31
|
+
"default": "./dist/chat/index.js",
|
|
32
|
+
"types": "./dist/chat/index.d.ts"
|
|
33
|
+
},
|
|
34
|
+
"./dashboard": {
|
|
35
|
+
"import": "./dist/dashboard/index.js",
|
|
36
|
+
"default": "./dist/dashboard/index.js",
|
|
37
|
+
"types": "./dist/dashboard/index.d.ts"
|
|
38
|
+
},
|
|
39
|
+
"./client": {
|
|
40
|
+
"import": "./dist/client/index.js",
|
|
41
|
+
"default": "./dist/client/index.js",
|
|
42
|
+
"types": "./dist/client/index.d.ts"
|
|
43
|
+
},
|
|
44
|
+
"./admin": {
|
|
45
|
+
"import": "./dist/admin/index.js",
|
|
46
|
+
"default": "./dist/admin/index.js",
|
|
47
|
+
"types": "./dist/admin/index.d.ts"
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"files": [
|
|
51
|
+
"dist",
|
|
52
|
+
"README.md",
|
|
53
|
+
"llms.txt"
|
|
54
|
+
],
|
|
55
|
+
"scripts": {
|
|
56
|
+
"build": "vite build && node scripts/inject-use-client.mjs",
|
|
57
|
+
"typecheck": "tsc --noEmit",
|
|
58
|
+
"lint": "eslint src/",
|
|
59
|
+
"prepublishOnly": "pnpm build"
|
|
60
|
+
},
|
|
61
|
+
"peerDependencies": {
|
|
62
|
+
"@devalok/shilp-sutra": ">=0.7.0",
|
|
63
|
+
"@tabler/icons-react": "^3.0.0",
|
|
64
|
+
"react": "^18 || ^19",
|
|
65
|
+
"react-dom": "^18 || ^19"
|
|
66
|
+
},
|
|
67
|
+
"devDependencies": {
|
|
68
|
+
"@devalok/shilp-sutra": "workspace:*",
|
|
69
|
+
"@dnd-kit/core": "^6.3.1",
|
|
70
|
+
"@dnd-kit/sortable": "^10.0.0",
|
|
71
|
+
"@dnd-kit/utilities": "^3.2.2",
|
|
72
|
+
"class-variance-authority": "^0.7.1",
|
|
73
|
+
"clsx": "^2.1.1",
|
|
74
|
+
"date-fns": "^4.1.0",
|
|
75
|
+
"react-markdown": "^10.1.0",
|
|
76
|
+
"tailwind-merge": "^3.0.1"
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as e, jsxs as s } from "react/jsx-runtime";
|
|
3
|
-
import * as p from "react";
|
|
4
|
-
import { formatDate as c } from "../utils/date-utils.js";
|
|
5
|
-
const i = p.forwardRef(
|
|
6
|
-
function({
|
|
7
|
-
adjustments: r,
|
|
8
|
-
adminId: o
|
|
9
|
-
}, t) {
|
|
10
|
-
return /* @__PURE__ */ e("div", { ref: t, 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: /* @__PURE__ */ e("div", { className: "bg-layer-02 pb-ds-06 pl-ds-05 pt-ds-03 md:p-ds-05", children: /* @__PURE__ */ e("div", { className: "no-scrollbar w-full overflow-x-auto overflow-y-auto", children: /* @__PURE__ */ s("div", { className: "min-w-[800px] max-md:w-[max-content]", children: [
|
|
11
|
-
/* @__PURE__ */ s("div", { className: "text-ds-sm font-semibold uppercase tracking-wider sticky top-0 grid grid-cols-[200px_160px_80px_1fr_1fr_1fr] gap-ds-05 py-ds-03 text-text-placeholder sm:px-ds-06", children: [
|
|
12
|
-
/* @__PURE__ */ e("div", { className: "p-ds-03 pl-ds-04", children: "User" }),
|
|
13
|
-
/* @__PURE__ */ e("div", { className: "p-ds-03 pl-ds-04", children: "Date" }),
|
|
14
|
-
/* @__PURE__ */ e("div", { className: "p-ds-03 text-center", children: "Days" }),
|
|
15
|
-
/* @__PURE__ */ e("div", { className: "p-ds-03 pl-ds-04", children: "Type" }),
|
|
16
|
-
/* @__PURE__ */ e("div", { className: "p-ds-03", children: "Reason" }),
|
|
17
|
-
/* @__PURE__ */ e("div", { className: "p-ds-03", children: "Approved By" })
|
|
18
|
-
] }),
|
|
19
|
-
/* @__PURE__ */ e("div", { className: "text-ds-md no-scrollbar overflow-y-auto md:max-h-[414px] max-md:h-[calc(100dvh-366px)] max-md:max-h-[calc(100dvh-366px)] max-md:overflow-visible max-md:overflow-y-auto max-md:overflow-x-visible", children: r.length === 0 ? /* @__PURE__ */ e("div", { className: "flex justify-center p-ds-05 text-text-tertiary", children: "No approved adjustments found" }) : r.map((d) => {
|
|
20
|
-
var a, l;
|
|
21
|
-
return /* @__PURE__ */ s(
|
|
22
|
-
"div",
|
|
23
|
-
{
|
|
24
|
-
className: "grid grid-cols-[200px_160px_80px_1fr_1fr_1fr] gap-ds-05 bg-layer-02 py-ds-03 sm:px-ds-06",
|
|
25
|
-
children: [
|
|
26
|
-
/* @__PURE__ */ e("div", { className: "p-ds-03 pl-ds-04 text-text-secondary", children: ((a = d.user) == null ? void 0 : a.name) || "Unknown User" }),
|
|
27
|
-
/* @__PURE__ */ e("div", { className: "w-[160px] p-ds-03 text-text-secondary", children: c(new Date(d.createdAt)) }),
|
|
28
|
-
/* @__PURE__ */ e("div", { className: "w-[80px] p-ds-03 text-center text-text-secondary", children: d.numberOfDays }),
|
|
29
|
-
/* @__PURE__ */ e("div", { className: "max-w-[350px] p-ds-03 pl-ds-04 text-text-tertiary", children: d.type }),
|
|
30
|
-
/* @__PURE__ */ e("div", { className: "max-w-[350px] p-ds-03 text-text-secondary", children: d.reason || "-" }),
|
|
31
|
-
/* @__PURE__ */ e("div", { className: "p-ds-03 text-text-secondary", children: ((l = d.approver) == null ? void 0 : l.name) || (d.approvedBy === o ? "You" : "Unknown") })
|
|
32
|
-
]
|
|
33
|
-
},
|
|
34
|
-
d.id
|
|
35
|
-
);
|
|
36
|
-
}) })
|
|
37
|
-
] }) }) }) });
|
|
38
|
-
}
|
|
39
|
-
);
|
|
40
|
-
i.displayName = "ApprovedAdjustments";
|
|
41
|
-
export {
|
|
42
|
-
i as ApprovedAdjustments
|
|
43
|
-
};
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsxs as d, jsx as e } from "react/jsx-runtime";
|
|
3
|
-
import * as r from "react";
|
|
4
|
-
import { Skeleton as s } from "@devalok/shilp-sutra/ui/skeleton";
|
|
5
|
-
const m = r.forwardRef(
|
|
6
|
-
function(c, l) {
|
|
7
|
-
return /* @__PURE__ */ d("div", { ref: l, className: "z-base h-fit w-full max-w-layout-body overflow-hidden border-[1px] border-border-subtle bg-field sm:rounded-ds-lg", children: [
|
|
8
|
-
/* @__PURE__ */ e("div", { className: "flex items-center justify-end bg-field px-ds-06 py-ds-05b", children: /* @__PURE__ */ e("header", { className: "flex items-center", children: /* @__PURE__ */ d("div", { className: "flex items-center gap-ds-04", children: [
|
|
9
|
-
/* @__PURE__ */ e(s, { className: "h-ds-sm-plus w-32 rounded-ds-md" }),
|
|
10
|
-
/* @__PURE__ */ e(s, { className: "h-ds-sm-plus w-32 rounded-ds-md" })
|
|
11
|
-
] }) }) }),
|
|
12
|
-
/* @__PURE__ */ d("div", { className: "flex h-fit flex-col border-t-[1px] border-border-subtle bg-layer-02 shadow-transparent", children: [
|
|
13
|
-
/* @__PURE__ */ d("div", { className: "flex w-full gap-ds-03 border-b-[1px] border-border px-ds-06 pt-ds-03", children: [
|
|
14
|
-
/* @__PURE__ */ e(s, { className: "h-ds-md w-20" }),
|
|
15
|
-
/* @__PURE__ */ e(s, { className: "h-ds-md w-24" }),
|
|
16
|
-
/* @__PURE__ */ e(s, { className: "h-ds-md w-24" })
|
|
17
|
-
] }),
|
|
18
|
-
/* @__PURE__ */ d("div", { className: "h-[400px] border-0 px-ds-06 py-ds-05", children: [
|
|
19
|
-
/* @__PURE__ */ d("div", { className: "mb-ds-05 ml-ds-06 grid grid-cols-6 items-center gap-ds-05 py-ds-03", children: [
|
|
20
|
-
/* @__PURE__ */ e(s, { className: "h-5 w-full bg-field" }),
|
|
21
|
-
/* @__PURE__ */ e(s, { className: "h-5 w-full bg-field" }),
|
|
22
|
-
/* @__PURE__ */ e(s, { className: "h-5 w-full bg-field" }),
|
|
23
|
-
/* @__PURE__ */ e(s, { className: "h-5 w-full bg-field" }),
|
|
24
|
-
/* @__PURE__ */ e(s, { className: "h-5 w-full bg-field" }),
|
|
25
|
-
/* @__PURE__ */ e(s, { className: "h-5 w-full bg-field" })
|
|
26
|
-
] }),
|
|
27
|
-
/* @__PURE__ */ e("div", { className: "flex flex-col gap-ds-05", children: Array.from({ length: 5 }).map((f, a) => /* @__PURE__ */ d(
|
|
28
|
-
"div",
|
|
29
|
-
{
|
|
30
|
-
className: "ml-ds-06 grid grid-cols-6 items-center gap-ds-05 rounded-ds-lg py-ds-03",
|
|
31
|
-
children: [
|
|
32
|
-
/* @__PURE__ */ d("div", { className: "flex items-center gap-ds-03", children: [
|
|
33
|
-
/* @__PURE__ */ e(s, { className: "h-ds-sm w-ds-sm rounded-ds-full bg-field" }),
|
|
34
|
-
/* @__PURE__ */ e(s, { className: "h-5 w-24 bg-field" })
|
|
35
|
-
] }),
|
|
36
|
-
/* @__PURE__ */ e(s, { className: "h-5 w-full bg-field" }),
|
|
37
|
-
/* @__PURE__ */ e(s, { className: "h-5 w-16 bg-field" }),
|
|
38
|
-
/* @__PURE__ */ e(s, { className: "h-5 w-full bg-field" }),
|
|
39
|
-
/* @__PURE__ */ d("div", { className: "flex items-center gap-ds-03", children: [
|
|
40
|
-
/* @__PURE__ */ e(s, { className: "h-ds-xs w-ds-xs rounded-ds-full bg-field" }),
|
|
41
|
-
/* @__PURE__ */ e(s, { className: "h-5 w-16 bg-field" })
|
|
42
|
-
] }),
|
|
43
|
-
/* @__PURE__ */ d("div", { className: "flex items-center justify-end gap-ds-03", children: [
|
|
44
|
-
/* @__PURE__ */ e(s, { className: "h-ds-sm w-ds-sm rounded-ds-full bg-field" }),
|
|
45
|
-
/* @__PURE__ */ e(s, { className: "h-ds-sm w-ds-sm rounded-ds-full bg-field" })
|
|
46
|
-
] })
|
|
47
|
-
]
|
|
48
|
-
},
|
|
49
|
-
a
|
|
50
|
-
)) })
|
|
51
|
-
] })
|
|
52
|
-
] })
|
|
53
|
-
] });
|
|
54
|
-
}
|
|
55
|
-
);
|
|
56
|
-
m.displayName = "BreakAdminSkeleton";
|
|
57
|
-
export {
|
|
58
|
-
m as BreakAdminSkeleton
|
|
59
|
-
};
|
|
@@ -1,373 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsxs as d, Fragment as q, jsx as e } from "react/jsx-runtime";
|
|
3
|
-
import * as B from "react";
|
|
4
|
-
import { useState as N, useMemo as re, useCallback as F, createContext as ie, useContext as ce } from "react";
|
|
5
|
-
import { cn as p } from "@devalok/shilp-sutra/ui/lib/utils";
|
|
6
|
-
import { useToast as le } from "@devalok/shilp-sutra/hooks/use-toast";
|
|
7
|
-
import { BreakBalance as de } from "./break-balance.js";
|
|
8
|
-
import { LeaveRequest as me } from "./leave-request.js";
|
|
9
|
-
import { Breaks as ue } from "./breaks.js";
|
|
10
|
-
import { BreakAdminHeader as fe } from "./header.js";
|
|
11
|
-
import { BreakAdminSkeleton as pe } from "./break-admin-skeleton.js";
|
|
12
|
-
const te = ie(null);
|
|
13
|
-
function w() {
|
|
14
|
-
const m = ce(te);
|
|
15
|
-
if (!m)
|
|
16
|
-
throw new Error(
|
|
17
|
-
"BreakAdmin compound components must be used within <BreakAdmin>"
|
|
18
|
-
);
|
|
19
|
-
return m;
|
|
20
|
-
}
|
|
21
|
-
const L = B.forwardRef(
|
|
22
|
-
function({
|
|
23
|
-
currentUser: n,
|
|
24
|
-
breaks: i,
|
|
25
|
-
pendingRequests: t,
|
|
26
|
-
cashoutRequests: o = [],
|
|
27
|
-
breakBalanceData: s,
|
|
28
|
-
breakBalance: c,
|
|
29
|
-
userImages: l,
|
|
30
|
-
users: u,
|
|
31
|
-
isLoading: k = !1,
|
|
32
|
-
isLoadingBreaks: g = !1,
|
|
33
|
-
isLoadingRequests: y = !1,
|
|
34
|
-
isLoadingBalance: O = !1,
|
|
35
|
-
existingBreaks: C,
|
|
36
|
-
filters: f,
|
|
37
|
-
onFilterChange: R,
|
|
38
|
-
onApproveRequest: P,
|
|
39
|
-
onRejectRequest: j,
|
|
40
|
-
onApproveCashout: xe,
|
|
41
|
-
onRejectCashout: be,
|
|
42
|
-
onRefresh: Y,
|
|
43
|
-
onSaveBreak: $,
|
|
44
|
-
onDeleteBreak: z,
|
|
45
|
-
onSaveBalance: I,
|
|
46
|
-
onFetchMonthBreaks: Q,
|
|
47
|
-
realtimeCallbacks: he,
|
|
48
|
-
children: ae
|
|
49
|
-
}, oe) {
|
|
50
|
-
const [U, V] = N("breaks"), [b, v] = N(!1), [G, E] = N(
|
|
51
|
-
null
|
|
52
|
-
), [J, T] = N(null), { toast: h } = le(), se = re(
|
|
53
|
-
() => ({
|
|
54
|
-
selectedAssociate: null,
|
|
55
|
-
dateFilterStart: null,
|
|
56
|
-
dateFilterEnd: null,
|
|
57
|
-
currMonth: (/* @__PURE__ */ new Date()).getMonth(),
|
|
58
|
-
currYear: (/* @__PURE__ */ new Date()).getFullYear(),
|
|
59
|
-
isOpen: !1
|
|
60
|
-
}),
|
|
61
|
-
[]
|
|
62
|
-
), W = f || se, X = F(
|
|
63
|
-
(a) => {
|
|
64
|
-
R && R(a);
|
|
65
|
-
},
|
|
66
|
-
[R]
|
|
67
|
-
), Z = F(
|
|
68
|
-
async (a, x, A) => {
|
|
69
|
-
if (!b) {
|
|
70
|
-
if (!A && ((a == null ? void 0 : a.metaKey) || (a == null ? void 0 : a.ctrlKey))) {
|
|
71
|
-
E(x);
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
try {
|
|
75
|
-
v(!0);
|
|
76
|
-
const r = t.find((K) => K.id === x);
|
|
77
|
-
if (!r)
|
|
78
|
-
throw new Error("Request not found");
|
|
79
|
-
P && P(x, A, r.correction, r), h({
|
|
80
|
-
description: /* @__PURE__ */ d(q, { children: [
|
|
81
|
-
/* @__PURE__ */ d("span", { children: [
|
|
82
|
-
r.correction ? "Attendance correction" : "Break request",
|
|
83
|
-
" "
|
|
84
|
-
] }),
|
|
85
|
-
/* @__PURE__ */ e("span", { className: "text-success-text", children: "approved successfully" })
|
|
86
|
-
] }),
|
|
87
|
-
color: "neutral",
|
|
88
|
-
style: { marginBottom: "var(--spacing-04)", border: "none" }
|
|
89
|
-
});
|
|
90
|
-
} catch (r) {
|
|
91
|
-
console.error("Error approving request:", r), h({
|
|
92
|
-
title: "Error",
|
|
93
|
-
description: r instanceof Error ? r.message : "Failed to approve request",
|
|
94
|
-
color: "error"
|
|
95
|
-
});
|
|
96
|
-
} finally {
|
|
97
|
-
v(!1);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
},
|
|
101
|
-
[b, t, P, h]
|
|
102
|
-
), ee = F(
|
|
103
|
-
async (a, x, A) => {
|
|
104
|
-
if (!b) {
|
|
105
|
-
if (!A && ((a == null ? void 0 : a.metaKey) || (a == null ? void 0 : a.ctrlKey))) {
|
|
106
|
-
T(x);
|
|
107
|
-
return;
|
|
108
|
-
}
|
|
109
|
-
try {
|
|
110
|
-
v(!0);
|
|
111
|
-
const r = t.find((K) => K.id === x);
|
|
112
|
-
if (!r)
|
|
113
|
-
throw new Error("Request not found");
|
|
114
|
-
j && j(x, A, r.correction, r), h({
|
|
115
|
-
description: /* @__PURE__ */ d(q, { children: [
|
|
116
|
-
/* @__PURE__ */ d("span", { children: [
|
|
117
|
-
r.correction ? "Attendance correction" : "Break request",
|
|
118
|
-
" "
|
|
119
|
-
] }),
|
|
120
|
-
/* @__PURE__ */ e("span", { className: "text-error-text", children: "rejected" })
|
|
121
|
-
] }),
|
|
122
|
-
color: "neutral",
|
|
123
|
-
style: { marginBottom: "var(--spacing-04)", border: "none" }
|
|
124
|
-
});
|
|
125
|
-
} catch (r) {
|
|
126
|
-
console.error("Error rejecting request:", r), h({
|
|
127
|
-
title: "Error",
|
|
128
|
-
description: r instanceof Error ? r.message : "Failed to reject request",
|
|
129
|
-
color: "error"
|
|
130
|
-
});
|
|
131
|
-
} finally {
|
|
132
|
-
v(!1);
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
},
|
|
136
|
-
[b, t, j, h]
|
|
137
|
-
), ne = re(
|
|
138
|
-
() => ({
|
|
139
|
-
currentUser: n,
|
|
140
|
-
activeTab: U,
|
|
141
|
-
setActiveTab: V,
|
|
142
|
-
isProcessing: b,
|
|
143
|
-
breaks: i,
|
|
144
|
-
pendingRequests: t,
|
|
145
|
-
cashoutRequests: o,
|
|
146
|
-
breakBalanceData: s,
|
|
147
|
-
breakBalance: c,
|
|
148
|
-
userImages: l,
|
|
149
|
-
users: u,
|
|
150
|
-
existingBreaks: C,
|
|
151
|
-
filters: W,
|
|
152
|
-
handleFilterChange: X,
|
|
153
|
-
handleApproveRequest: Z,
|
|
154
|
-
handleRejectRequest: ee,
|
|
155
|
-
acceptedCommentBox: G,
|
|
156
|
-
rejectedCommentBox: J,
|
|
157
|
-
setAcceptedCommentBox: E,
|
|
158
|
-
setRejectedCommentBox: T,
|
|
159
|
-
onRefresh: Y,
|
|
160
|
-
onSaveBreak: $,
|
|
161
|
-
onDeleteBreak: z,
|
|
162
|
-
onSaveBalance: I,
|
|
163
|
-
onFetchMonthBreaks: Q
|
|
164
|
-
}),
|
|
165
|
-
[
|
|
166
|
-
n,
|
|
167
|
-
U,
|
|
168
|
-
V,
|
|
169
|
-
b,
|
|
170
|
-
i,
|
|
171
|
-
t,
|
|
172
|
-
o,
|
|
173
|
-
s,
|
|
174
|
-
c,
|
|
175
|
-
l,
|
|
176
|
-
u,
|
|
177
|
-
C,
|
|
178
|
-
W,
|
|
179
|
-
X,
|
|
180
|
-
Z,
|
|
181
|
-
ee,
|
|
182
|
-
G,
|
|
183
|
-
J,
|
|
184
|
-
E,
|
|
185
|
-
T,
|
|
186
|
-
Y,
|
|
187
|
-
$,
|
|
188
|
-
z,
|
|
189
|
-
I,
|
|
190
|
-
Q
|
|
191
|
-
]
|
|
192
|
-
);
|
|
193
|
-
return k ? /* @__PURE__ */ e(pe, {}) : /* @__PURE__ */ e(te.Provider, { value: ne, children: /* @__PURE__ */ e(
|
|
194
|
-
"div",
|
|
195
|
-
{
|
|
196
|
-
ref: oe,
|
|
197
|
-
className: "z-base flex w-full max-w-layout flex-col items-center justify-center md:pt-0",
|
|
198
|
-
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: [
|
|
199
|
-
/* @__PURE__ */ e(S, {}),
|
|
200
|
-
/* @__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: [
|
|
201
|
-
/* @__PURE__ */ e(M, {}),
|
|
202
|
-
/* @__PURE__ */ d("div", { className: "w-full border-0 max-lg:min-w-[800px]", children: [
|
|
203
|
-
/* @__PURE__ */ e(_, {}),
|
|
204
|
-
/* @__PURE__ */ e(D, {}),
|
|
205
|
-
/* @__PURE__ */ e(H, {})
|
|
206
|
-
] })
|
|
207
|
-
] })
|
|
208
|
-
] }) })
|
|
209
|
-
}
|
|
210
|
-
) });
|
|
211
|
-
}
|
|
212
|
-
);
|
|
213
|
-
L.displayName = "BreakAdmin";
|
|
214
|
-
const S = B.forwardRef(function({ className: n, ...i }, t) {
|
|
215
|
-
const {
|
|
216
|
-
filters: o,
|
|
217
|
-
handleFilterChange: s,
|
|
218
|
-
breakBalance: c,
|
|
219
|
-
userImages: l,
|
|
220
|
-
users: u
|
|
221
|
-
} = w();
|
|
222
|
-
return /* @__PURE__ */ e("div", { ref: t, className: p(n), ...i, children: /* @__PURE__ */ e(
|
|
223
|
-
fe,
|
|
224
|
-
{
|
|
225
|
-
filters: o,
|
|
226
|
-
onFilterChange: s,
|
|
227
|
-
breakBalance: c,
|
|
228
|
-
userImages: l,
|
|
229
|
-
users: u
|
|
230
|
-
}
|
|
231
|
-
) });
|
|
232
|
-
});
|
|
233
|
-
S.displayName = "BreakAdmin.Header";
|
|
234
|
-
const M = B.forwardRef(function({ className: n, ...i }, t) {
|
|
235
|
-
const { activeTab: o, setActiveTab: s, pendingRequests: c, breakBalanceData: l } = w();
|
|
236
|
-
return /* @__PURE__ */ d(
|
|
237
|
-
"div",
|
|
238
|
-
{
|
|
239
|
-
ref: t,
|
|
240
|
-
className: p(
|
|
241
|
-
"flex w-full gap-ds-03 border-b-[1px] border-border px-ds-06 pt-ds-03 max-lg:min-w-[800px]",
|
|
242
|
-
n
|
|
243
|
-
),
|
|
244
|
-
...i,
|
|
245
|
-
children: [
|
|
246
|
-
/* @__PURE__ */ e(
|
|
247
|
-
"button",
|
|
248
|
-
{
|
|
249
|
-
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"),
|
|
250
|
-
onClick: () => s("breaks"),
|
|
251
|
-
children: "BREAKS"
|
|
252
|
-
}
|
|
253
|
-
),
|
|
254
|
-
/* @__PURE__ */ d(
|
|
255
|
-
"button",
|
|
256
|
-
{
|
|
257
|
-
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"),
|
|
258
|
-
onClick: () => s("requests"),
|
|
259
|
-
children: [
|
|
260
|
-
"REQUESTS",
|
|
261
|
-
" ",
|
|
262
|
-
/* @__PURE__ */ e("span", { className: "text-interactive-hover", children: `(${c.length})` })
|
|
263
|
-
]
|
|
264
|
-
}
|
|
265
|
-
),
|
|
266
|
-
/* @__PURE__ */ d(
|
|
267
|
-
"button",
|
|
268
|
-
{
|
|
269
|
-
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"),
|
|
270
|
-
onClick: () => s("balance"),
|
|
271
|
-
children: [
|
|
272
|
-
"BALANCE",
|
|
273
|
-
" ",
|
|
274
|
-
/* @__PURE__ */ e("span", { className: "text-interactive-hover", children: `(${l.length})` })
|
|
275
|
-
]
|
|
276
|
-
}
|
|
277
|
-
)
|
|
278
|
-
]
|
|
279
|
-
}
|
|
280
|
-
);
|
|
281
|
-
});
|
|
282
|
-
M.displayName = "BreakAdmin.TabBar";
|
|
283
|
-
const _ = B.forwardRef(function({ className: n, ...i }, t) {
|
|
284
|
-
const {
|
|
285
|
-
activeTab: o,
|
|
286
|
-
breaks: s,
|
|
287
|
-
userImages: c,
|
|
288
|
-
existingBreaks: l,
|
|
289
|
-
onFetchMonthBreaks: u,
|
|
290
|
-
onSaveBreak: k,
|
|
291
|
-
onDeleteBreak: g,
|
|
292
|
-
onRefresh: y
|
|
293
|
-
} = w();
|
|
294
|
-
return o !== "breaks" ? null : /* @__PURE__ */ e("div", { ref: t, className: p(n), ...i, children: /* @__PURE__ */ e(
|
|
295
|
-
ue,
|
|
296
|
-
{
|
|
297
|
-
breaks: s,
|
|
298
|
-
userImages: c,
|
|
299
|
-
existingBreaks: l,
|
|
300
|
-
onFetchMonthBreaks: u,
|
|
301
|
-
onSave: k,
|
|
302
|
-
onDelete: g,
|
|
303
|
-
onRefresh: y
|
|
304
|
-
}
|
|
305
|
-
) });
|
|
306
|
-
});
|
|
307
|
-
_.displayName = "BreakAdmin.BreaksPanel";
|
|
308
|
-
const D = B.forwardRef(function({ className: n, ...i }, t) {
|
|
309
|
-
const {
|
|
310
|
-
activeTab: o,
|
|
311
|
-
currentUser: s,
|
|
312
|
-
pendingRequests: c,
|
|
313
|
-
userImages: l,
|
|
314
|
-
handleApproveRequest: u,
|
|
315
|
-
handleRejectRequest: k,
|
|
316
|
-
acceptedCommentBox: g,
|
|
317
|
-
rejectedCommentBox: y,
|
|
318
|
-
setAcceptedCommentBox: O,
|
|
319
|
-
setRejectedCommentBox: C
|
|
320
|
-
} = w();
|
|
321
|
-
return o !== "requests" ? null : /* @__PURE__ */ e(
|
|
322
|
-
"div",
|
|
323
|
-
{
|
|
324
|
-
ref: t,
|
|
325
|
-
className: p(
|
|
326
|
-
/* intentional: h-[400px] is the fixed panel height for break tab content areas; mobile uses dvh for browser chrome */
|
|
327
|
-
"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",
|
|
328
|
-
n
|
|
329
|
-
),
|
|
330
|
-
...i,
|
|
331
|
-
children: c.map((f) => /* @__PURE__ */ e(
|
|
332
|
-
me,
|
|
333
|
-
{
|
|
334
|
-
request: f,
|
|
335
|
-
userImages: l,
|
|
336
|
-
handleRejectRequest: k,
|
|
337
|
-
handleApproveRequest: u,
|
|
338
|
-
commentBoxOpen: g === f.id || y === f.id,
|
|
339
|
-
onCommentBoxClose: () => {
|
|
340
|
-
O(null), C(null);
|
|
341
|
-
},
|
|
342
|
-
clickedAction: g === f.id ? "approve" : y === f.id ? "reject" : null,
|
|
343
|
-
userId: s.id
|
|
344
|
-
},
|
|
345
|
-
f.id
|
|
346
|
-
))
|
|
347
|
-
}
|
|
348
|
-
);
|
|
349
|
-
});
|
|
350
|
-
D.displayName = "BreakAdmin.RequestsPanel";
|
|
351
|
-
const H = B.forwardRef(function({ className: n, ...i }, t) {
|
|
352
|
-
const { activeTab: o, breakBalanceData: s, userImages: c, onSaveBalance: l } = w();
|
|
353
|
-
return o !== "balance" ? null : /* @__PURE__ */ e("div", { ref: t, className: p(n), ...i, children: /* @__PURE__ */ e(
|
|
354
|
-
de,
|
|
355
|
-
{
|
|
356
|
-
breakBalanceData: s,
|
|
357
|
-
userImages: c,
|
|
358
|
-
onSaveBalance: l
|
|
359
|
-
}
|
|
360
|
-
) });
|
|
361
|
-
});
|
|
362
|
-
H.displayName = "BreakAdmin.BalancePanel";
|
|
363
|
-
const Re = Object.assign(L, {
|
|
364
|
-
Root: L,
|
|
365
|
-
Header: S,
|
|
366
|
-
TabBar: M,
|
|
367
|
-
BreaksPanel: _,
|
|
368
|
-
RequestsPanel: D,
|
|
369
|
-
BalancePanel: H
|
|
370
|
-
});
|
|
371
|
-
export {
|
|
372
|
-
Re as BreakAdmin
|
|
373
|
-
};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsxs as s, jsx as e } from "react/jsx-runtime";
|
|
3
|
-
import * as p from "react";
|
|
4
|
-
import { Avatar as o, AvatarImage as f, AvatarFallback as u } from "@devalok/shilp-sutra/ui/avatar";
|
|
5
|
-
const h = p.forwardRef(
|
|
6
|
-
function({
|
|
7
|
-
breakBalanceData: m,
|
|
8
|
-
userImages: n,
|
|
9
|
-
onSaveBalance: w
|
|
10
|
-
}, x) {
|
|
11
|
-
return /* @__PURE__ */ s("div", { ref: x, className: "m-0 flex h-[400px] flex-col items-start justify-start p-0 max-md:h-auto", children: [
|
|
12
|
-
/* @__PURE__ */ s("div", { className: "m-0 mx-[4%] mb-ds-05 mt-ds-04 flex w-[92%] items-start justify-start gap-ds-03 p-0 text-text-placeholder", children: [
|
|
13
|
-
/* @__PURE__ */ e("div", { className: "text-ds-sm font-semibold uppercase tracking-wider w-[16.4%] min-w-[120px] px-ds-04 py-ds-03 text-text-tertiary", children: "NAME" }),
|
|
14
|
-
/* @__PURE__ */ e("div", { className: "text-ds-sm font-semibold uppercase tracking-wider w-[16.4%] px-ds-04 py-ds-03 text-text-tertiary", children: "Total Balance" })
|
|
15
|
-
] }),
|
|
16
|
-
/* @__PURE__ */ e("div", { className: "no-scrollbar mx-[4%] flex w-[92%] flex-col gap-ds-05 overflow-y-auto max-md:h-[calc(100dvh-373px)]", children: m.map((a) => {
|
|
17
|
-
var t, l, r, d, c, i;
|
|
18
|
-
return /* @__PURE__ */ s(
|
|
19
|
-
"div",
|
|
20
|
-
{
|
|
21
|
-
className: "flex w-full flex-row items-center justify-start gap-ds-03 !border-0 text-left hover:bg-field",
|
|
22
|
-
children: [
|
|
23
|
-
/* @__PURE__ */ s("div", { className: "flex w-1/6 min-w-[120px] items-center gap-ds-03 p-ds-04", children: [
|
|
24
|
-
/* @__PURE__ */ s(o, { className: "h-ds-xs-plus w-ds-xs-plus", children: [
|
|
25
|
-
/* @__PURE__ */ e(f, { src: n[a.userId], alt: ((t = a.user) == null ? void 0 : t.name) || "" }),
|
|
26
|
-
/* @__PURE__ */ e(u, { children: ((r = (l = a.user) == null ? void 0 : l.name) == null ? void 0 : r[0]) || "U" })
|
|
27
|
-
] }),
|
|
28
|
-
/* @__PURE__ */ e("div", { className: "w-[calc(100%-36px)]", children: /* @__PURE__ */ e("span", { className: "text-ds-md block w-full cursor-default truncate text-text-primary", children: ((d = a.user) == null ? void 0 : d.firstName) ?? ((i = (c = a.user) == null ? void 0 : c.name) == null ? void 0 : i.split(" ")[0]) }) })
|
|
29
|
-
] }),
|
|
30
|
-
/* @__PURE__ */ e("div", { className: "text-ds-md w-[16.4%] p-ds-04 px-ds-04 text-interactive", children: a.totalDays })
|
|
31
|
-
]
|
|
32
|
-
},
|
|
33
|
-
a.id
|
|
34
|
-
);
|
|
35
|
-
}) })
|
|
36
|
-
] });
|
|
37
|
-
}
|
|
38
|
-
);
|
|
39
|
-
h.displayName = "BreakBalance";
|
|
40
|
-
export {
|
|
41
|
-
h as BreakBalance
|
|
42
|
-
};
|