@devalok/shilp-sutra 0.4.2 → 0.6.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/composed/command-palette.d.ts +1 -2
- package/dist/composed/command-palette.d.ts.map +1 -1
- package/dist/composed/command-palette.js +27 -33
- package/dist/composed/date-picker/calendar-grid.d.ts +7 -0
- package/dist/composed/date-picker/calendar-grid.d.ts.map +1 -1
- package/dist/composed/date-picker/calendar-grid.js +92 -72
- package/dist/composed/date-picker/index.d.ts +1 -1
- package/dist/composed/date-picker/index.d.ts.map +1 -1
- package/dist/composed/empty-state.d.ts +1 -2
- package/dist/composed/empty-state.d.ts.map +1 -1
- package/dist/composed/empty-state.js +67 -56
- package/dist/composed/index.d.ts +5 -1
- package/dist/composed/index.d.ts.map +1 -1
- package/dist/composed/index.js +42 -38
- package/dist/composed/page-header.d.ts +1 -1
- package/dist/composed/page-header.d.ts.map +1 -1
- package/dist/composed/page-header.js +63 -59
- package/dist/composed/schedule-view.d.ts +26 -0
- package/dist/composed/schedule-view.d.ts.map +1 -0
- package/dist/composed/schedule-view.js +183 -0
- package/dist/composed/simple-tooltip.d.ts +15 -0
- package/dist/composed/simple-tooltip.d.ts.map +1 -0
- package/dist/composed/simple-tooltip.js +17 -0
- package/dist/composed/status-badge.d.ts +2 -1
- package/dist/composed/status-badge.d.ts.map +1 -1
- package/dist/composed/status-badge.js +37 -22
- package/dist/shell/app-command-palette.js +87 -87
- package/dist/shell/bottom-navbar.d.ts +1 -3
- package/dist/shell/bottom-navbar.d.ts.map +1 -1
- package/dist/shell/bottom-navbar.js +37 -37
- package/dist/shell/notification-preferences.d.ts.map +1 -1
- package/dist/shell/notification-preferences.js +31 -31
- package/dist/shell/sidebar.d.ts +1 -3
- package/dist/shell/sidebar.d.ts.map +1 -1
- package/dist/shell/sidebar.js +6 -6
- package/dist/ui/alert.d.ts +3 -0
- package/dist/ui/alert.d.ts.map +1 -1
- package/dist/ui/alert.js +56 -31
- package/dist/ui/charts/index.js +21 -0
- package/dist/ui/index.d.ts +0 -3
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +253 -275
- package/package.json +210 -208
|
@@ -1,192 +1,192 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { useCallback as
|
|
4
|
-
import {
|
|
2
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
3
|
+
import { useCallback as u, useMemo as l } from "react";
|
|
4
|
+
import { IconFileText as g, IconLayoutDashboard as S, IconCalendarCheck as E, IconUmbrella as y, IconLayoutKanban as T, IconListCheck as A, IconBook as L, IconAdjustmentsHorizontal as M, IconUserCircle as P, IconShieldCheck as $, IconClipboardList as D, IconUserPlus as O, IconSettings as U, IconPackage as B, IconLink as K, IconVideo as N, IconMessage as w, IconUsers as G } from "@tabler/icons-react";
|
|
5
5
|
import { CommandPalette as V } from "../composed/command-palette.js";
|
|
6
6
|
const v = {
|
|
7
|
-
TASK:
|
|
8
|
-
PROJECT:
|
|
9
|
-
USER:
|
|
10
|
-
COMMENT:
|
|
11
|
-
MEETING:
|
|
12
|
-
LINK:
|
|
13
|
-
DELIVERABLE:
|
|
7
|
+
TASK: /* @__PURE__ */ e(A, {}),
|
|
8
|
+
PROJECT: /* @__PURE__ */ e(T, {}),
|
|
9
|
+
USER: /* @__PURE__ */ e(G, {}),
|
|
10
|
+
COMMENT: /* @__PURE__ */ e(w, {}),
|
|
11
|
+
MEETING: /* @__PURE__ */ e(N, {}),
|
|
12
|
+
LINK: /* @__PURE__ */ e(K, {}),
|
|
13
|
+
DELIVERABLE: /* @__PURE__ */ e(B, {})
|
|
14
14
|
};
|
|
15
|
-
function x(
|
|
15
|
+
function x(a) {
|
|
16
16
|
return [
|
|
17
17
|
{
|
|
18
18
|
id: "nav-dashboard",
|
|
19
19
|
label: "Dashboard",
|
|
20
|
-
icon:
|
|
21
|
-
onSelect: () =>
|
|
20
|
+
icon: /* @__PURE__ */ e(S, {}),
|
|
21
|
+
onSelect: () => a("/")
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
24
|
id: "nav-attendance",
|
|
25
25
|
label: "Attendance",
|
|
26
|
-
icon:
|
|
27
|
-
onSelect: () =>
|
|
26
|
+
icon: /* @__PURE__ */ e(E, {}),
|
|
27
|
+
onSelect: () => a("/attendance")
|
|
28
28
|
},
|
|
29
29
|
{
|
|
30
30
|
id: "nav-breaks",
|
|
31
31
|
label: "Breaks",
|
|
32
|
-
icon:
|
|
33
|
-
onSelect: () =>
|
|
32
|
+
icon: /* @__PURE__ */ e(y, {}),
|
|
33
|
+
onSelect: () => a("/breaks")
|
|
34
34
|
},
|
|
35
35
|
{
|
|
36
36
|
id: "nav-projects",
|
|
37
37
|
label: "Projects",
|
|
38
|
-
icon:
|
|
39
|
-
onSelect: () =>
|
|
38
|
+
icon: /* @__PURE__ */ e(T, {}),
|
|
39
|
+
onSelect: () => a("/projects")
|
|
40
40
|
},
|
|
41
41
|
{
|
|
42
42
|
id: "nav-my-tasks",
|
|
43
43
|
label: "My Tasks",
|
|
44
|
-
icon:
|
|
45
|
-
onSelect: () =>
|
|
44
|
+
icon: /* @__PURE__ */ e(A, {}),
|
|
45
|
+
onSelect: () => a("/my-tasks")
|
|
46
46
|
},
|
|
47
47
|
{
|
|
48
48
|
id: "nav-devsabha",
|
|
49
49
|
label: "Devsabha",
|
|
50
|
-
icon:
|
|
51
|
-
onSelect: () =>
|
|
50
|
+
icon: /* @__PURE__ */ e(L, {}),
|
|
51
|
+
onSelect: () => a("/devsabha")
|
|
52
52
|
},
|
|
53
53
|
{
|
|
54
54
|
id: "nav-adjustments",
|
|
55
55
|
label: "Adjustments",
|
|
56
|
-
icon:
|
|
57
|
-
onSelect: () =>
|
|
56
|
+
icon: /* @__PURE__ */ e(M, {}),
|
|
57
|
+
onSelect: () => a("/adjustments")
|
|
58
58
|
},
|
|
59
59
|
{
|
|
60
60
|
id: "nav-profile",
|
|
61
61
|
label: "Profile",
|
|
62
|
-
icon:
|
|
63
|
-
onSelect: () =>
|
|
62
|
+
icon: /* @__PURE__ */ e(P, {}),
|
|
63
|
+
onSelect: () => a("/profile")
|
|
64
64
|
}
|
|
65
65
|
];
|
|
66
66
|
}
|
|
67
|
-
function J(
|
|
67
|
+
function J(a) {
|
|
68
68
|
return [
|
|
69
69
|
{
|
|
70
70
|
id: "nav-admin-dashboard",
|
|
71
71
|
label: "Admin Dashboard",
|
|
72
|
-
icon:
|
|
73
|
-
onSelect: () =>
|
|
72
|
+
icon: /* @__PURE__ */ e($, {}),
|
|
73
|
+
onSelect: () => a("/admin")
|
|
74
74
|
},
|
|
75
75
|
{
|
|
76
76
|
id: "nav-admin-breaks",
|
|
77
77
|
label: "Manage Breaks",
|
|
78
|
-
icon:
|
|
79
|
-
onSelect: () =>
|
|
78
|
+
icon: /* @__PURE__ */ e(y, {}),
|
|
79
|
+
onSelect: () => a("/admin/breaks")
|
|
80
80
|
},
|
|
81
81
|
{
|
|
82
82
|
id: "nav-admin-attendance",
|
|
83
83
|
label: "Manage Attendance",
|
|
84
|
-
icon:
|
|
85
|
-
onSelect: () =>
|
|
84
|
+
icon: /* @__PURE__ */ e(E, {}),
|
|
85
|
+
onSelect: () => a("/admin/attendance")
|
|
86
86
|
},
|
|
87
87
|
{
|
|
88
88
|
id: "nav-admin-lokwasi",
|
|
89
89
|
label: "Lokwasi",
|
|
90
|
-
icon:
|
|
91
|
-
onSelect: () =>
|
|
90
|
+
icon: /* @__PURE__ */ e(D, {}),
|
|
91
|
+
onSelect: () => a("/admin/lokwasi")
|
|
92
92
|
},
|
|
93
93
|
{
|
|
94
94
|
id: "nav-admin-onboarding",
|
|
95
95
|
label: "Onboarding",
|
|
96
|
-
icon:
|
|
97
|
-
onSelect: () =>
|
|
96
|
+
icon: /* @__PURE__ */ e(O, {}),
|
|
97
|
+
onSelect: () => a("/admin/onboarding")
|
|
98
98
|
},
|
|
99
99
|
{
|
|
100
100
|
id: "nav-admin-config",
|
|
101
101
|
label: "System Config",
|
|
102
|
-
icon:
|
|
103
|
-
onSelect: () =>
|
|
102
|
+
icon: /* @__PURE__ */ e(U, {}),
|
|
103
|
+
onSelect: () => a("/admin/system-config")
|
|
104
104
|
}
|
|
105
105
|
];
|
|
106
106
|
}
|
|
107
107
|
function Y({
|
|
108
|
-
user:
|
|
109
|
-
extraGroups:
|
|
110
|
-
onNavigate:
|
|
111
|
-
onSearch:
|
|
112
|
-
searchResults:
|
|
113
|
-
isSearching:
|
|
114
|
-
onSearchResultSelect:
|
|
108
|
+
user: a,
|
|
109
|
+
extraGroups: b = [],
|
|
110
|
+
onNavigate: c,
|
|
111
|
+
onSearch: d,
|
|
112
|
+
searchResults: m = [],
|
|
113
|
+
isSearching: p = !1,
|
|
114
|
+
onSearchResultSelect: s
|
|
115
115
|
}) {
|
|
116
|
-
const
|
|
117
|
-
(
|
|
118
|
-
|
|
116
|
+
const I = (a == null ? void 0 : a.role) === "Admin" || (a == null ? void 0 : a.role) === "SuperAdmin", i = u(
|
|
117
|
+
(t) => {
|
|
118
|
+
c == null || c(t);
|
|
119
119
|
},
|
|
120
|
-
[
|
|
121
|
-
),
|
|
120
|
+
[c]
|
|
121
|
+
), k = l(
|
|
122
122
|
() => ({
|
|
123
123
|
label: "Pages",
|
|
124
|
-
items: x(
|
|
124
|
+
items: x(i)
|
|
125
125
|
}),
|
|
126
|
-
[
|
|
127
|
-
),
|
|
126
|
+
[i]
|
|
127
|
+
), j = l(
|
|
128
128
|
() => ({
|
|
129
129
|
label: "Admin",
|
|
130
|
-
items: J(
|
|
130
|
+
items: J(i)
|
|
131
131
|
}),
|
|
132
|
-
[
|
|
133
|
-
),
|
|
134
|
-
if (
|
|
135
|
-
const
|
|
136
|
-
var
|
|
137
|
-
let
|
|
138
|
-
switch (
|
|
132
|
+
[i]
|
|
133
|
+
), r = l(() => {
|
|
134
|
+
if (m.length === 0) return null;
|
|
135
|
+
const t = m.map((n) => {
|
|
136
|
+
var f;
|
|
137
|
+
let o = "/";
|
|
138
|
+
switch (n.entityType) {
|
|
139
139
|
case "TASK":
|
|
140
|
-
|
|
140
|
+
o = n.projectId ? `/projects/${n.projectId}?taskId=${n.id}` : "/";
|
|
141
141
|
break;
|
|
142
142
|
case "PROJECT":
|
|
143
|
-
|
|
143
|
+
o = `/projects/${n.id}`;
|
|
144
144
|
break;
|
|
145
145
|
case "USER":
|
|
146
|
-
|
|
146
|
+
o = "/teammates";
|
|
147
147
|
break;
|
|
148
148
|
case "COMMENT":
|
|
149
|
-
|
|
149
|
+
o = n.projectId && ((f = n.metadata) != null && f.taskId) ? `/projects/${n.projectId}?taskId=${n.metadata.taskId}` : "/";
|
|
150
150
|
break;
|
|
151
151
|
case "MEETING":
|
|
152
|
-
|
|
152
|
+
o = n.projectId ? `/projects/${n.projectId}?tab=meetings` : "/";
|
|
153
153
|
break;
|
|
154
154
|
case "LINK":
|
|
155
|
-
|
|
155
|
+
o = n.projectId ? `/projects/${n.projectId}?tab=karyakram` : "/";
|
|
156
156
|
break;
|
|
157
157
|
case "DELIVERABLE":
|
|
158
|
-
|
|
158
|
+
o = n.projectId ? `/projects/${n.projectId}?tab=deliverables` : "/";
|
|
159
159
|
break;
|
|
160
160
|
}
|
|
161
161
|
return {
|
|
162
|
-
id: `search-${
|
|
163
|
-
label:
|
|
164
|
-
description:
|
|
165
|
-
icon: v[
|
|
162
|
+
id: `search-${n.entityType}-${n.id}`,
|
|
163
|
+
label: n.title,
|
|
164
|
+
description: n.snippet,
|
|
165
|
+
icon: v[n.entityType] ?? /* @__PURE__ */ e(g, {}),
|
|
166
166
|
onSelect: () => {
|
|
167
|
-
|
|
167
|
+
s == null || s(n), i(o);
|
|
168
168
|
}
|
|
169
169
|
};
|
|
170
170
|
});
|
|
171
171
|
return {
|
|
172
|
-
label:
|
|
173
|
-
items:
|
|
172
|
+
label: p ? "Searching..." : "Search Results",
|
|
173
|
+
items: t
|
|
174
174
|
};
|
|
175
|
-
}, [
|
|
176
|
-
const
|
|
177
|
-
return
|
|
178
|
-
}, [
|
|
179
|
-
(
|
|
180
|
-
|
|
175
|
+
}, [m, p, i, s]), C = l(() => {
|
|
176
|
+
const t = [];
|
|
177
|
+
return r && t.push(r), t.push(k), I && t.push(j), t.push(...b), t;
|
|
178
|
+
}, [r, k, I, j, b]), h = u(
|
|
179
|
+
(t) => {
|
|
180
|
+
d == null || d(t);
|
|
181
181
|
},
|
|
182
|
-
[
|
|
182
|
+
[d]
|
|
183
183
|
);
|
|
184
|
-
return /* @__PURE__ */
|
|
184
|
+
return /* @__PURE__ */ e(
|
|
185
185
|
V,
|
|
186
186
|
{
|
|
187
|
-
groups:
|
|
187
|
+
groups: C,
|
|
188
188
|
placeholder: "Search or jump to...",
|
|
189
|
-
onSearch:
|
|
189
|
+
onSearch: h,
|
|
190
190
|
emptyMessage: "No results found. Try a different search term."
|
|
191
191
|
}
|
|
192
192
|
);
|
|
@@ -9,9 +9,7 @@ import * as React from 'react';
|
|
|
9
9
|
export interface BottomNavItem {
|
|
10
10
|
title: string;
|
|
11
11
|
href: string;
|
|
12
|
-
icon: React.
|
|
13
|
-
className?: string;
|
|
14
|
-
}>;
|
|
12
|
+
icon: React.ReactNode;
|
|
15
13
|
/** When true, the route matches only when the path is exactly equal */
|
|
16
14
|
exact?: boolean;
|
|
17
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bottom-navbar.d.ts","sourceRoot":"","sources":["../../src/shell/bottom-navbar.tsx"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAU9B,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"bottom-navbar.d.ts","sourceRoot":"","sources":["../../src/shell/bottom-navbar.tsx"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAU9B,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,KAAK,CAAC,SAAS,CAAA;IACrB,uEAAuE;IACvE,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,iBACf,SAAQ,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC;IACzC,gCAAgC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,kEAAkE;IAClE,IAAI,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAA;IAC9B,6EAA6E;IAC7E,YAAY,CAAC,EAAE,aAAa,EAAE,CAAA;IAC9B,yDAAyD;IACzD,SAAS,CAAC,EAAE,aAAa,EAAE,CAAA;IAC3B,+CAA+C;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAkDD,QAAA,MAAM,YAAY,uFA2IjB,CAAA;AAGD,OAAO,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -1,58 +1,58 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as a, Fragment as v, jsx as t } from "react/jsx-runtime";
|
|
3
|
-
import * as
|
|
4
|
-
import { useState as
|
|
5
|
-
import { useLink as
|
|
3
|
+
import * as g from "react";
|
|
4
|
+
import { useState as N } from "react";
|
|
5
|
+
import { useLink as p } from "./link-context.js";
|
|
6
6
|
import { IconX as y, IconDots as w } from "@tabler/icons-react";
|
|
7
|
-
import { cn as
|
|
7
|
+
import { cn as r } from "../ui/lib/utils.js";
|
|
8
8
|
function k({
|
|
9
|
-
item:
|
|
10
|
-
isActive:
|
|
9
|
+
item: s,
|
|
10
|
+
isActive: i,
|
|
11
11
|
onClick: d
|
|
12
12
|
}) {
|
|
13
|
-
const
|
|
13
|
+
const l = p();
|
|
14
14
|
return /* @__PURE__ */ t(
|
|
15
|
-
|
|
15
|
+
l,
|
|
16
16
|
{
|
|
17
|
-
href:
|
|
17
|
+
href: s.href,
|
|
18
18
|
onClick: d,
|
|
19
|
-
"aria-label":
|
|
20
|
-
"aria-current":
|
|
21
|
-
className:
|
|
19
|
+
"aria-label": s.title,
|
|
20
|
+
"aria-current": i ? "page" : void 0,
|
|
21
|
+
className: r(
|
|
22
22
|
"flex h-16 max-w-[70px] flex-1 cursor-pointer flex-col items-center gap-ds-02 p-ds-02 pt-0 text-ds-sm",
|
|
23
|
-
|
|
23
|
+
i ? "font-semibold text-interactive" : "text-text-helper"
|
|
24
24
|
),
|
|
25
25
|
children: /* @__PURE__ */ a("div", { className: "relative flex w-full flex-col items-center gap-ds-02", children: [
|
|
26
26
|
/* @__PURE__ */ t(
|
|
27
27
|
"div",
|
|
28
28
|
{
|
|
29
|
-
className:
|
|
29
|
+
className: r(
|
|
30
30
|
"absolute top-0 h-[3px] w-full rounded-b-ds-sm bg-interactive p-0 transition-opacity duration-slow-01",
|
|
31
|
-
|
|
31
|
+
i ? "opacity-100" : "opacity-0"
|
|
32
32
|
),
|
|
33
33
|
"aria-hidden": "true"
|
|
34
34
|
}
|
|
35
35
|
),
|
|
36
|
-
/* @__PURE__ */ t("div", { className: "p-ds-03", children: /* @__PURE__ */ t(
|
|
37
|
-
/* @__PURE__ */ t("span", { className: "text-center", children:
|
|
36
|
+
/* @__PURE__ */ t("div", { className: "p-ds-03", children: /* @__PURE__ */ t("span", { className: "[&>svg]:h-ico-md [&>svg]:w-ico-md", "aria-hidden": "true", children: s.icon }) }),
|
|
37
|
+
/* @__PURE__ */ t("span", { className: "text-center", children: s.title })
|
|
38
38
|
] })
|
|
39
39
|
}
|
|
40
40
|
);
|
|
41
41
|
}
|
|
42
|
-
const M =
|
|
42
|
+
const M = g.forwardRef(
|
|
43
43
|
({
|
|
44
|
-
currentPath:
|
|
45
|
-
user:
|
|
44
|
+
currentPath: s = "/",
|
|
45
|
+
user: i,
|
|
46
46
|
primaryItems: d = [],
|
|
47
|
-
moreItems:
|
|
48
|
-
className:
|
|
47
|
+
moreItems: l = [],
|
|
48
|
+
className: f,
|
|
49
49
|
...x
|
|
50
50
|
}, h) => {
|
|
51
|
-
const b =
|
|
51
|
+
const b = p(), [o, n] = N(!1), c = (e, u = !1) => u || e === "/" ? s === e : s.startsWith(e), m = l.some(
|
|
52
52
|
(e) => c(e.href, e.exact)
|
|
53
53
|
);
|
|
54
|
-
return
|
|
55
|
-
|
|
54
|
+
return i ? /* @__PURE__ */ a(v, { children: [
|
|
55
|
+
o && /* @__PURE__ */ a(
|
|
56
56
|
"div",
|
|
57
57
|
{
|
|
58
58
|
role: "button",
|
|
@@ -83,17 +83,17 @@ const M = N.forwardRef(
|
|
|
83
83
|
}
|
|
84
84
|
)
|
|
85
85
|
] }),
|
|
86
|
-
/* @__PURE__ */ t("div", { className: "grid grid-cols-4 gap-ds-03", children:
|
|
86
|
+
/* @__PURE__ */ t("div", { className: "grid grid-cols-4 gap-ds-03", children: l.map((e) => /* @__PURE__ */ a(
|
|
87
87
|
b,
|
|
88
88
|
{
|
|
89
89
|
href: e.href,
|
|
90
90
|
onClick: () => n(!1),
|
|
91
|
-
className:
|
|
91
|
+
className: r(
|
|
92
92
|
"flex flex-col items-center gap-ds-02b rounded-ds-xl p-ds-04 text-ds-sm transition-colors",
|
|
93
93
|
c(e.href, e.exact) ? "bg-layer-02 text-interactive" : "text-text-helper hover:bg-layer-02"
|
|
94
94
|
),
|
|
95
95
|
children: [
|
|
96
|
-
/* @__PURE__ */ t(
|
|
96
|
+
/* @__PURE__ */ t("span", { className: "[&>svg]:h-ico-md [&>svg]:w-ico-md", children: e.icon }),
|
|
97
97
|
/* @__PURE__ */ t("span", { className: "text-center", children: e.title })
|
|
98
98
|
]
|
|
99
99
|
},
|
|
@@ -111,9 +111,9 @@ const M = N.forwardRef(
|
|
|
111
111
|
...x,
|
|
112
112
|
ref: h,
|
|
113
113
|
"aria-label": "Mobile navigation",
|
|
114
|
-
className:
|
|
114
|
+
className: r(
|
|
115
115
|
"fixed bottom-0 left-0 right-0 z-sticky flex w-full flex-row items-start justify-between border-t border-border bg-layer-01 px-ds-05 pb-ds-05b pt-0 md:hidden",
|
|
116
|
-
|
|
116
|
+
f
|
|
117
117
|
),
|
|
118
118
|
children: [
|
|
119
119
|
d.map((e) => /* @__PURE__ */ t(
|
|
@@ -124,24 +124,24 @@ const M = N.forwardRef(
|
|
|
124
124
|
},
|
|
125
125
|
e.href
|
|
126
126
|
)),
|
|
127
|
-
|
|
127
|
+
l.length > 0 && /* @__PURE__ */ t(
|
|
128
128
|
"button",
|
|
129
129
|
{
|
|
130
130
|
type: "button",
|
|
131
|
-
onClick: () => n(!
|
|
131
|
+
onClick: () => n(!o),
|
|
132
132
|
"aria-label": "More navigation options",
|
|
133
|
-
"aria-expanded":
|
|
134
|
-
className:
|
|
133
|
+
"aria-expanded": o,
|
|
134
|
+
className: r(
|
|
135
135
|
"flex h-16 max-w-[70px] flex-1 cursor-pointer flex-col items-center gap-ds-02 p-ds-02 pt-0 text-ds-sm",
|
|
136
|
-
|
|
136
|
+
o || m ? "font-semibold text-interactive" : "text-text-helper"
|
|
137
137
|
),
|
|
138
138
|
children: /* @__PURE__ */ a("div", { className: "relative flex w-full flex-col items-center gap-ds-02", children: [
|
|
139
139
|
/* @__PURE__ */ t(
|
|
140
140
|
"div",
|
|
141
141
|
{
|
|
142
|
-
className:
|
|
142
|
+
className: r(
|
|
143
143
|
"absolute top-0 h-[3px] w-full rounded-b-ds-sm bg-interactive p-0 transition-opacity duration-slow-01",
|
|
144
|
-
|
|
144
|
+
o || m ? "opacity-100" : "opacity-0"
|
|
145
145
|
),
|
|
146
146
|
"aria-hidden": "true"
|
|
147
147
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification-preferences.d.ts","sourceRoot":"","sources":["../../src/shell/notification-preferences.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3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MAAM,CAAA;CACnB;AAqBD,wBAAgB,uBAAuB,CAAC,EACtC,WAAgB,EAChB,QAAa,EACb,SAAiB,EACjB,MAAM,EACN,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,SAAS,GACV,EAAE,4BAA4B,2CA2O9B;yBApPe,uBAAuB"}
|
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as t, Fragment as
|
|
2
|
+
import { jsxs as t, Fragment as V, jsx as e } from "react/jsx-runtime";
|
|
3
3
|
import { useState as i } from "react";
|
|
4
4
|
import { Button as b } from "../ui/button.js";
|
|
5
5
|
import { Select as d, SelectTrigger as o, SelectValue as m, SelectContent as h, SelectItem as c } from "../ui/select.js";
|
|
6
|
-
import { Dialog as
|
|
6
|
+
import { Dialog as B, DialogContent as D, DialogHeader as z, DialogTitle as q, DialogDescription as J } from "../ui/dialog.js";
|
|
7
7
|
import { Switch as k } from "../ui/switch.js";
|
|
8
|
-
import { Card as
|
|
9
|
-
import { IconPlus as Z, IconMessage as $, IconBell as U
|
|
10
|
-
import { cn as
|
|
8
|
+
import { Card as K, CardHeader as Q, CardTitle as W, CardContent as X } from "../ui/card.js";
|
|
9
|
+
import { IconPlus as Y, IconTrash as Z, IconMessage as $, IconBell as U } from "@tabler/icons-react";
|
|
10
|
+
import { cn as ee } from "../ui/lib/utils.js";
|
|
11
11
|
const _ = {
|
|
12
|
-
IN_APP: { label: "In-App", icon: U },
|
|
13
|
-
GOOGLE_CHAT: { label: "Google Chat", icon:
|
|
12
|
+
IN_APP: { label: "In-App", icon: /* @__PURE__ */ e(U, {}) },
|
|
13
|
+
GOOGLE_CHAT: { label: "Google Chat", icon: /* @__PURE__ */ e($, {}) }
|
|
14
14
|
}, G = {
|
|
15
15
|
INFO: "All (Info+)",
|
|
16
16
|
IMPORTANT: "Important+",
|
|
17
17
|
CRITICAL: "Critical only"
|
|
18
18
|
};
|
|
19
|
-
function
|
|
19
|
+
function le({
|
|
20
20
|
preferences: f = [],
|
|
21
21
|
projects: v = [],
|
|
22
22
|
isLoading: L = !1,
|
|
23
|
-
onSave:
|
|
23
|
+
onSave: g,
|
|
24
24
|
onToggleMute: u,
|
|
25
25
|
onUpdateTier: x,
|
|
26
26
|
onDelete: p,
|
|
27
27
|
className: T
|
|
28
28
|
}) {
|
|
29
|
-
const [E, s] = i(!1), [N,
|
|
30
|
-
if (
|
|
29
|
+
const [E, s] = i(!1), [N, C] = i("global"), [I, w] = i("IN_APP"), [y, A] = i("INFO"), [P, j] = i(!1), [S, O] = i(!1), R = async () => {
|
|
30
|
+
if (g) {
|
|
31
31
|
O(!0);
|
|
32
32
|
try {
|
|
33
|
-
await
|
|
33
|
+
await g({
|
|
34
34
|
projectId: N === "global" ? null : N,
|
|
35
35
|
channel: I,
|
|
36
36
|
minTier: y,
|
|
@@ -43,16 +43,16 @@ function te({
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
}, F = () => {
|
|
46
|
-
|
|
46
|
+
C("global"), w("IN_APP"), A("INFO"), j(!1);
|
|
47
47
|
}, H = (l) => {
|
|
48
48
|
if (!l) return "Global (all projects)";
|
|
49
49
|
const n = v.find((a) => a.id === l);
|
|
50
50
|
return (n == null ? void 0 : n.title) || "Unknown project";
|
|
51
51
|
};
|
|
52
|
-
return /* @__PURE__ */ t(
|
|
53
|
-
/* @__PURE__ */ t(
|
|
54
|
-
/* @__PURE__ */ t(
|
|
55
|
-
/* @__PURE__ */ e(
|
|
52
|
+
return /* @__PURE__ */ t(V, { children: [
|
|
53
|
+
/* @__PURE__ */ t(K, { className: T, children: [
|
|
54
|
+
/* @__PURE__ */ t(Q, { className: "flex flex-row items-center justify-between space-y-0 pb-ds-04", children: [
|
|
55
|
+
/* @__PURE__ */ e(W, { className: "text-ds-md font-semibold", children: "Notification Preferences" }),
|
|
56
56
|
/* @__PURE__ */ t(
|
|
57
57
|
b,
|
|
58
58
|
{
|
|
@@ -60,23 +60,23 @@ function te({
|
|
|
60
60
|
variant: "outline",
|
|
61
61
|
onClick: () => s(!0),
|
|
62
62
|
children: [
|
|
63
|
-
/* @__PURE__ */ e(
|
|
63
|
+
/* @__PURE__ */ e(Y, { className: "mr-ds-02b h-ico-sm w-ico-sm" }),
|
|
64
64
|
"Add Rule"
|
|
65
65
|
]
|
|
66
66
|
}
|
|
67
67
|
)
|
|
68
68
|
] }),
|
|
69
|
-
/* @__PURE__ */ e(
|
|
70
|
-
const a = _[l.channel] || _.IN_APP
|
|
69
|
+
/* @__PURE__ */ e(X, { children: L ? /* @__PURE__ */ e("div", { className: "flex items-center justify-center py-ds-07", children: /* @__PURE__ */ e("div", { className: "h-ico-md w-ico-md animate-spin rounded-ds-full border-2 border-border border-t-interactive" }) }) : f.length === 0 ? /* @__PURE__ */ e("div", { className: "py-ds-07 text-center", children: /* @__PURE__ */ e("p", { className: "text-ds-md text-text-placeholder", children: "No custom preferences set. All notifications are delivered by default." }) }) : /* @__PURE__ */ e("div", { className: "flex flex-col", children: f.map((l, n) => {
|
|
70
|
+
const a = _[l.channel] || _.IN_APP;
|
|
71
71
|
return /* @__PURE__ */ t(
|
|
72
72
|
"div",
|
|
73
73
|
{
|
|
74
|
-
className:
|
|
74
|
+
className: ee(
|
|
75
75
|
"flex items-center gap-ds-05 py-ds-04",
|
|
76
76
|
n < f.length - 1 && "border-b border-border"
|
|
77
77
|
),
|
|
78
78
|
children: [
|
|
79
|
-
/* @__PURE__ */ e("div", { className: "flex h-ds-sm w-ds-sm shrink-0 items-center justify-center rounded-ds-lg bg-layer-02", children: /* @__PURE__ */ e(
|
|
79
|
+
/* @__PURE__ */ e("div", { className: "flex h-ds-sm w-ds-sm shrink-0 items-center justify-center rounded-ds-lg bg-layer-02", children: /* @__PURE__ */ e("span", { className: "[&>svg]:h-ico-sm [&>svg]:w-ico-sm text-text-secondary", "aria-hidden": "true", children: a.icon }) }),
|
|
80
80
|
/* @__PURE__ */ t("div", { className: "min-w-0 flex-1", children: [
|
|
81
81
|
/* @__PURE__ */ e("p", { className: "text-ds-md font-medium text-text-primary", children: a.label }),
|
|
82
82
|
/* @__PURE__ */ e("p", { className: "text-ds-sm text-text-placeholder", children: H(l.projectId) })
|
|
@@ -88,7 +88,7 @@ function te({
|
|
|
88
88
|
onValueChange: (r) => x == null ? void 0 : x(l, r),
|
|
89
89
|
children: [
|
|
90
90
|
/* @__PURE__ */ e(o, { className: "h-ds-xs-plus w-[130px] text-ds-sm", children: /* @__PURE__ */ e(m, {}) }),
|
|
91
|
-
/* @__PURE__ */ e(h, { children: Object.entries(G).map(([r,
|
|
91
|
+
/* @__PURE__ */ e(h, { children: Object.entries(G).map(([r, M]) => /* @__PURE__ */ e(c, { value: r, children: M }, r)) })
|
|
92
92
|
]
|
|
93
93
|
}
|
|
94
94
|
),
|
|
@@ -108,7 +108,7 @@ function te({
|
|
|
108
108
|
type: "button",
|
|
109
109
|
onClick: () => p == null ? void 0 : p(l.id),
|
|
110
110
|
className: "shrink-0 rounded p-ds-02b text-text-placeholder transition-colors hover:bg-layer-02 hover:text-error",
|
|
111
|
-
children: /* @__PURE__ */ e(
|
|
111
|
+
children: /* @__PURE__ */ e(Z, { className: "h-ico-sm w-ico-sm" })
|
|
112
112
|
}
|
|
113
113
|
)
|
|
114
114
|
]
|
|
@@ -117,15 +117,15 @@ function te({
|
|
|
117
117
|
);
|
|
118
118
|
}) }) })
|
|
119
119
|
] }),
|
|
120
|
-
/* @__PURE__ */ e(
|
|
121
|
-
/* @__PURE__ */ t(
|
|
122
|
-
/* @__PURE__ */ e(
|
|
123
|
-
/* @__PURE__ */ e(
|
|
120
|
+
/* @__PURE__ */ e(B, { open: E, onOpenChange: s, children: /* @__PURE__ */ t(D, { className: "sm:max-w-md", children: [
|
|
121
|
+
/* @__PURE__ */ t(z, { children: [
|
|
122
|
+
/* @__PURE__ */ e(q, { children: "Add Notification Rule" }),
|
|
123
|
+
/* @__PURE__ */ e(J, { children: "Customize how you receive notifications for a specific channel and project." })
|
|
124
124
|
] }),
|
|
125
125
|
/* @__PURE__ */ t("div", { className: "flex flex-col gap-ds-05 pt-ds-03", children: [
|
|
126
126
|
/* @__PURE__ */ t("div", { className: "flex flex-col gap-ds-02b", children: [
|
|
127
127
|
/* @__PURE__ */ e("label", { htmlFor: "pref-scope", className: "text-ds-sm font-medium text-text-secondary", children: "Scope" }),
|
|
128
|
-
/* @__PURE__ */ t(d, { value: N, onValueChange:
|
|
128
|
+
/* @__PURE__ */ t(d, { value: N, onValueChange: C, children: [
|
|
129
129
|
/* @__PURE__ */ e(o, { id: "pref-scope", children: /* @__PURE__ */ e(m, { placeholder: "Select scope" }) }),
|
|
130
130
|
/* @__PURE__ */ t(h, { children: [
|
|
131
131
|
/* @__PURE__ */ e(c, { value: "global", children: "Global (all projects)" }),
|
|
@@ -178,7 +178,7 @@ function te({
|
|
|
178
178
|
] }) })
|
|
179
179
|
] });
|
|
180
180
|
}
|
|
181
|
-
|
|
181
|
+
le.displayName = "NotificationPreferences";
|
|
182
182
|
export {
|
|
183
|
-
|
|
183
|
+
le as NotificationPreferences
|
|
184
184
|
};
|
package/dist/shell/sidebar.d.ts
CHANGED
|
@@ -13,9 +13,7 @@ import * as React from 'react';
|
|
|
13
13
|
export interface NavItem {
|
|
14
14
|
title: string;
|
|
15
15
|
href: string;
|
|
16
|
-
icon: React.
|
|
17
|
-
className?: string;
|
|
18
|
-
}>;
|
|
16
|
+
icon: React.ReactNode;
|
|
19
17
|
/** When true, the route matches only when the path is exactly equal */
|
|
20
18
|
exact?: boolean;
|
|
21
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sidebar.d.ts","sourceRoot":"","sources":["../../src/shell/sidebar.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAsB9B,MAAM,WAAW,OAAO;IACtB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,KAAK,CAAC,
|
|
1
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