@burdenoff/microfe-calendar 2026.625.1 → 2026.625.2
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/pages/CalendarPage.js +189 -146
- package/dist/pages/CalendarPage.js.map +1 -1
- package/dist/pages/EventDetailsPage.js +486 -445
- package/dist/pages/EventDetailsPage.js.map +1 -1
- package/dist/pages/ResourcesPage.js +194 -177
- package/dist/pages/ResourcesPage.js.map +1 -1
- package/dist/pages/SettingsPage.js +320 -263
- package/dist/pages/SettingsPage.js.map +1 -1
- package/dist/pages/SubscriptionsPage.js +39 -36
- package/dist/pages/SubscriptionsPage.js.map +1 -1
- package/package.json +2 -2
|
@@ -7,10 +7,10 @@ import { useCallback as c, useMemo as l, useState as u } from "react";
|
|
|
7
7
|
import { AccessDenied as d } from "@burdenoff/fe-libs/shared/components";
|
|
8
8
|
import { useI18n as f } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
9
9
|
import { Car as p, DoorOpen as m, MapPin as h, Monitor as g, Package as _, Plus as v, Users as y, X as b } from "lucide-react";
|
|
10
|
-
import {
|
|
11
|
-
import { GlassCard as
|
|
10
|
+
import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
|
|
11
|
+
import { EmphasisPanel as w, GlassCard as T, GradientText as E, IllustratedEmptyState as D, PagePurpose as O } from "@burdenoff/fe-libs/ui";
|
|
12
12
|
//#region src/pages/ResourcesPage.tsx
|
|
13
|
-
var
|
|
13
|
+
var k = {
|
|
14
14
|
ROOM: m,
|
|
15
15
|
EQUIPMENT: g,
|
|
16
16
|
VEHICLE: p,
|
|
@@ -18,14 +18,14 @@ var E = {
|
|
|
18
18
|
PARKING_SPOT: p,
|
|
19
19
|
OTHER: _
|
|
20
20
|
};
|
|
21
|
-
function
|
|
22
|
-
let { hasPermission: p, isLoading:
|
|
23
|
-
let n =
|
|
21
|
+
function A() {
|
|
22
|
+
let { hasPermission: p, isLoading: g } = r(), { t: A } = f(), j = c((e, t) => {
|
|
23
|
+
let n = A(e);
|
|
24
24
|
return n === e ? t : n;
|
|
25
|
-
}, [
|
|
25
|
+
}, [A]), [M, N] = u(!1), [P, F] = u(null), I = p(i.CALENDAR_RESOURCE_READ), { data: L, loading: R, error: z, refetch: B } = n({
|
|
26
26
|
fetchPolicy: "cache-and-network",
|
|
27
|
-
skip:
|
|
28
|
-
}),
|
|
27
|
+
skip: g || !I
|
|
28
|
+
}), V = L?.getCalendarResources ?? [], [H, { loading: U, error: W }] = e(), [G, { loading: K }] = t(), [q, J] = u({
|
|
29
29
|
name: "",
|
|
30
30
|
description: "",
|
|
31
31
|
resourceType: "ROOM",
|
|
@@ -35,168 +35,185 @@ function D() {
|
|
|
35
35
|
floor: "",
|
|
36
36
|
room: "",
|
|
37
37
|
requireApproval: !1
|
|
38
|
-
}),
|
|
39
|
-
ROOM:
|
|
40
|
-
EQUIPMENT:
|
|
41
|
-
VEHICLE:
|
|
42
|
-
DESK:
|
|
43
|
-
PARKING_SPOT:
|
|
44
|
-
OTHER:
|
|
45
|
-
}), [
|
|
46
|
-
|
|
38
|
+
}), Y = l(() => ({
|
|
39
|
+
ROOM: j("calendar.room", "Room"),
|
|
40
|
+
EQUIPMENT: j("calendar.equipment", "Equipment"),
|
|
41
|
+
VEHICLE: j("calendar.vehicle", "Vehicle"),
|
|
42
|
+
DESK: j("calendar.desk", "Desk"),
|
|
43
|
+
PARKING_SPOT: j("calendar.parkingSpot", "Parking Spot"),
|
|
44
|
+
OTHER: j("calendar.other", "Other")
|
|
45
|
+
}), [j]), X = (e, t) => {
|
|
46
|
+
J((n) => ({
|
|
47
47
|
...n,
|
|
48
48
|
[e]: t
|
|
49
49
|
}));
|
|
50
50
|
};
|
|
51
|
-
return
|
|
51
|
+
return g || R && !L ? /* @__PURE__ */ S("div", {
|
|
52
52
|
className: "@container min-h-screen bg-bg-canvas flex items-center justify-center",
|
|
53
|
-
children: /* @__PURE__ */
|
|
53
|
+
children: /* @__PURE__ */ S("p", {
|
|
54
54
|
className: "font-text-md text-text-secondary",
|
|
55
|
-
children:
|
|
55
|
+
children: j("calendar.loading", "Loading...")
|
|
56
56
|
})
|
|
57
|
-
}) :
|
|
57
|
+
}) : I ? /* @__PURE__ */ C("div", {
|
|
58
58
|
className: "@container min-h-screen bg-bg-canvas",
|
|
59
59
|
children: [
|
|
60
|
-
/* @__PURE__ */
|
|
60
|
+
/* @__PURE__ */ S("header", {
|
|
61
61
|
className: "border-b border-border-seam bg-bg-surface px-page-padding py-element-padding",
|
|
62
|
-
children: /* @__PURE__ */
|
|
62
|
+
children: /* @__PURE__ */ C("div", {
|
|
63
63
|
className: "flex flex-col @lg:flex-row @lg:items-center @lg:justify-between gap-stack-gap",
|
|
64
|
-
children: [/* @__PURE__ */
|
|
64
|
+
children: [/* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("h1", {
|
|
65
65
|
className: "font-heading-lg text-text-primary mb-stack-gap-sm",
|
|
66
|
-
children: /* @__PURE__ */
|
|
67
|
-
}), /* @__PURE__ */
|
|
68
|
-
className: "
|
|
69
|
-
children:
|
|
70
|
-
})] }), p(i.CALENDAR_RESOURCE_CREATE) ? /* @__PURE__ */
|
|
66
|
+
children: /* @__PURE__ */ S(E, { children: j("calendar.resources", "Resources") })
|
|
67
|
+
}), /* @__PURE__ */ S(O, {
|
|
68
|
+
className: "max-w-2xl",
|
|
69
|
+
children: j("calendar.resourcesPagePurpose", "A shared inventory of bookable rooms, equipment, vehicles, and desks. Add a resource here, then attach it to an event so it is reserved for that time — capacity, location, and approval rules keep double-bookings out.")
|
|
70
|
+
})] }), p(i.CALENDAR_RESOURCE_CREATE) ? /* @__PURE__ */ C("button", {
|
|
71
71
|
type: "button",
|
|
72
|
-
onClick: () =>
|
|
72
|
+
onClick: () => N(!0),
|
|
73
73
|
className: "inline-flex items-center gap-inline-gap-sm px-element-padding py-element-padding-sm rounded-radius-md bg-action-primary-bg text-action-primary-fg font-text-sm font-weight-medium hover:bg-action-primary-bg-hover transition-colors",
|
|
74
|
-
children: [/* @__PURE__ */
|
|
74
|
+
children: [/* @__PURE__ */ S(v, { className: "size-4" }), j("calendar.addResource", "Add Resource")]
|
|
75
75
|
}) : null]
|
|
76
76
|
})
|
|
77
77
|
}),
|
|
78
|
-
/* @__PURE__ */
|
|
78
|
+
/* @__PURE__ */ C("div", {
|
|
79
79
|
className: "p-page-padding",
|
|
80
80
|
children: [
|
|
81
|
-
|
|
81
|
+
R && V.length === 0 && /* @__PURE__ */ S("div", {
|
|
82
82
|
className: "text-center py-12",
|
|
83
|
-
children: /* @__PURE__ */
|
|
83
|
+
children: /* @__PURE__ */ S("p", {
|
|
84
84
|
className: "font-text-md text-text-secondary",
|
|
85
|
-
children:
|
|
85
|
+
children: j("calendar.loadingResources", "Loading resources...")
|
|
86
86
|
})
|
|
87
87
|
}),
|
|
88
|
-
|
|
88
|
+
z && /* @__PURE__ */ S("div", {
|
|
89
89
|
className: "text-center py-12",
|
|
90
|
-
children: /* @__PURE__ */
|
|
90
|
+
children: /* @__PURE__ */ C("p", {
|
|
91
91
|
className: "font-text-md text-red-600 dark:text-red-400",
|
|
92
92
|
children: [
|
|
93
|
-
|
|
93
|
+
j("calendar.failedToLoadResources", "Failed to load resources:"),
|
|
94
94
|
" ",
|
|
95
|
-
|
|
95
|
+
z.message
|
|
96
96
|
]
|
|
97
97
|
})
|
|
98
98
|
}),
|
|
99
|
-
!
|
|
99
|
+
!R && !z && V.length === 0 && /* @__PURE__ */ S(D, {
|
|
100
100
|
illustration: "empty-data",
|
|
101
|
-
title:
|
|
102
|
-
description:
|
|
103
|
-
action: p(i.CALENDAR_RESOURCE_CREATE) ? /* @__PURE__ */
|
|
101
|
+
title: j("calendar.noResourcesYet", "No resources yet"),
|
|
102
|
+
description: j("calendar.bookConferenceRooms", "Book conference rooms, equipment, and other workspace resources"),
|
|
103
|
+
action: p(i.CALENDAR_RESOURCE_CREATE) ? /* @__PURE__ */ C("button", {
|
|
104
104
|
type: "button",
|
|
105
|
-
onClick: () =>
|
|
105
|
+
onClick: () => N(!0),
|
|
106
106
|
className: "inline-flex min-h-11 items-center gap-inline-gap-sm px-element-padding py-element-padding-sm rounded-radius-md bg-action-primary-bg text-action-primary-fg font-text-sm font-weight-medium hover:bg-action-primary-bg-hover transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-action-primary-border",
|
|
107
|
-
children: [/* @__PURE__ */
|
|
107
|
+
children: [/* @__PURE__ */ S(v, { className: "size-4" }), j("calendar.addYourFirstResource", "Add your first resource")]
|
|
108
108
|
}) : void 0
|
|
109
109
|
}),
|
|
110
|
-
|
|
110
|
+
V.length > 0 && /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ C(w, {
|
|
111
|
+
className: "mb-section-gap flex flex-wrap items-center justify-between gap-stack-gap",
|
|
112
|
+
children: [/* @__PURE__ */ C("div", {
|
|
113
|
+
className: "flex items-start gap-3",
|
|
114
|
+
children: [/* @__PURE__ */ S(m, { className: "size-5 text-action-primary-bg shrink-0 mt-0.5" }), /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("p", {
|
|
115
|
+
className: "font-text-sm font-weight-semibold text-text-primary mb-0.5",
|
|
116
|
+
children: j("calendar.bookableResources", "Bookable resources")
|
|
117
|
+
}), /* @__PURE__ */ S("p", {
|
|
118
|
+
className: "font-text-sm text-text-secondary",
|
|
119
|
+
children: j("calendar.resourcesSummary", "{count} resources ready to attach to your events. Open an event and add a resource to reserve it.").replace("{count}", String(V.length))
|
|
120
|
+
})] })]
|
|
121
|
+
}), p(i.CALENDAR_RESOURCE_CREATE) ? /* @__PURE__ */ C("button", {
|
|
122
|
+
type: "button",
|
|
123
|
+
onClick: () => N(!0),
|
|
124
|
+
className: "inline-flex items-center gap-inline-gap-sm px-element-padding py-element-padding-sm rounded-radius-md bg-action-primary-bg text-action-primary-fg font-text-sm font-weight-medium hover:bg-action-primary-bg-hover transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-action-primary-border",
|
|
125
|
+
children: [/* @__PURE__ */ S(v, { className: "size-4" }), j("calendar.addResource", "Add Resource")]
|
|
126
|
+
}) : null]
|
|
127
|
+
}), /* @__PURE__ */ S("div", {
|
|
111
128
|
className: "grid gap-grid-gap",
|
|
112
129
|
style: { gridTemplateColumns: "repeat(auto-fit, minmax(18rem, 1fr))" },
|
|
113
|
-
children:
|
|
130
|
+
children: V.map((e) => /* @__PURE__ */ S(T, {
|
|
114
131
|
treatment: "metric",
|
|
115
132
|
className: "@container p-card-padding",
|
|
116
|
-
children: /* @__PURE__ */
|
|
133
|
+
children: /* @__PURE__ */ C("div", {
|
|
117
134
|
className: "flex items-start gap-inline-gap",
|
|
118
|
-
children: [/* @__PURE__ */
|
|
135
|
+
children: [/* @__PURE__ */ S("div", {
|
|
119
136
|
className: "size-10 inline-flex items-center justify-center rounded-radius-md bg-bg-neutral text-text-secondary shrink-0",
|
|
120
|
-
children: /* @__PURE__ */
|
|
121
|
-
}), /* @__PURE__ */
|
|
137
|
+
children: /* @__PURE__ */ S(k[e.resourceType] ?? _, { className: "size-5" })
|
|
138
|
+
}), /* @__PURE__ */ C("div", {
|
|
122
139
|
className: "min-w-0 flex-1",
|
|
123
140
|
children: [
|
|
124
|
-
/* @__PURE__ */
|
|
141
|
+
/* @__PURE__ */ C("div", {
|
|
125
142
|
className: "flex items-start justify-between",
|
|
126
|
-
children: [/* @__PURE__ */
|
|
143
|
+
children: [/* @__PURE__ */ S("h3", {
|
|
127
144
|
className: "font-heading-sm text-text-primary mb-1",
|
|
128
145
|
children: e.name
|
|
129
|
-
}), p(i.CALENDAR_RESOURCE_DELETE) && /* @__PURE__ */
|
|
146
|
+
}), p(i.CALENDAR_RESOURCE_DELETE) && /* @__PURE__ */ S("button", {
|
|
130
147
|
type: "button",
|
|
131
|
-
onClick: () =>
|
|
148
|
+
onClick: () => F({
|
|
132
149
|
id: e.id,
|
|
133
150
|
name: e.name
|
|
134
151
|
}),
|
|
135
152
|
className: "size-6 inline-flex items-center justify-center rounded-radius-sm hover:bg-red-50 dark:hover:bg-red-950/20 text-text-tertiary hover:text-red-600 transition-colors shrink-0",
|
|
136
|
-
"aria-label": `${
|
|
137
|
-
children: /* @__PURE__ */
|
|
153
|
+
"aria-label": `${j("calendar.deleteResource", "Delete Resource")} ${e.name}`,
|
|
154
|
+
children: /* @__PURE__ */ S(b, { className: "size-3.5" })
|
|
138
155
|
})]
|
|
139
156
|
}),
|
|
140
|
-
e.description && /* @__PURE__ */
|
|
157
|
+
e.description && /* @__PURE__ */ S("p", {
|
|
141
158
|
className: "font-text-sm text-text-secondary mb-2 line-clamp-2",
|
|
142
159
|
children: e.description
|
|
143
160
|
}),
|
|
144
|
-
/* @__PURE__ */
|
|
161
|
+
/* @__PURE__ */ C("div", {
|
|
145
162
|
className: "flex flex-wrap items-center gap-2",
|
|
146
163
|
children: [
|
|
147
|
-
/* @__PURE__ */
|
|
164
|
+
/* @__PURE__ */ S("span", {
|
|
148
165
|
className: "font-text-xs px-2 py-0.5 rounded-radius-sm bg-bg-neutral text-text-secondary",
|
|
149
|
-
children:
|
|
166
|
+
children: Y[e.resourceType] ?? e.resourceType
|
|
150
167
|
}),
|
|
151
|
-
e.capacity && /* @__PURE__ */
|
|
168
|
+
e.capacity && /* @__PURE__ */ C("span", {
|
|
152
169
|
className: "inline-flex items-center gap-1 font-text-xs text-text-tertiary",
|
|
153
|
-
children: [/* @__PURE__ */
|
|
170
|
+
children: [/* @__PURE__ */ S(y, { className: "size-3" }), e.capacity]
|
|
154
171
|
}),
|
|
155
|
-
e.location && /* @__PURE__ */
|
|
172
|
+
e.location && /* @__PURE__ */ C("span", {
|
|
156
173
|
className: "inline-flex items-center gap-1 font-text-xs text-text-tertiary",
|
|
157
|
-
children: [/* @__PURE__ */
|
|
174
|
+
children: [/* @__PURE__ */ S(h, { className: "size-3" }), e.location]
|
|
158
175
|
})
|
|
159
176
|
]
|
|
160
177
|
}),
|
|
161
|
-
/* @__PURE__ */
|
|
178
|
+
/* @__PURE__ */ C("div", {
|
|
162
179
|
className: "mt-2 flex items-center gap-2",
|
|
163
|
-
children: [/* @__PURE__ */
|
|
180
|
+
children: [/* @__PURE__ */ S("span", {
|
|
164
181
|
className: `font-text-xs px-2 py-0.5 rounded-radius-sm ${e.isActive ? "bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-300" : "bg-gray-100 dark:bg-gray-800 text-gray-600 dark:text-gray-400"}`,
|
|
165
|
-
children: e.isActive ?
|
|
166
|
-
}), e.requireApproval && /* @__PURE__ */
|
|
182
|
+
children: e.isActive ? j("calendar.active", "Active") : j("calendar.inactive", "Inactive")
|
|
183
|
+
}), e.requireApproval && /* @__PURE__ */ S("span", {
|
|
167
184
|
className: "font-text-xs px-2 py-0.5 rounded-radius-sm bg-amber-100 dark:bg-amber-900/30 text-amber-700 dark:text-amber-300",
|
|
168
|
-
children:
|
|
185
|
+
children: j("calendar.requiresApproval", "Requires Approval")
|
|
169
186
|
})]
|
|
170
187
|
})
|
|
171
188
|
]
|
|
172
189
|
})]
|
|
173
190
|
})
|
|
174
191
|
}, e.id))
|
|
175
|
-
})
|
|
192
|
+
})] })
|
|
176
193
|
]
|
|
177
194
|
}),
|
|
178
|
-
|
|
195
|
+
M && /* @__PURE__ */ C("dialog", {
|
|
179
196
|
open: !0,
|
|
180
197
|
className: "fixed inset-0 z-50 m-auto rounded-radius-lg border border-border-default bg-bg-surface shadow-lg backdrop:bg-black/50 max-w-lg w-full p-0",
|
|
181
198
|
style: { position: "fixed" },
|
|
182
|
-
children: [/* @__PURE__ */
|
|
199
|
+
children: [/* @__PURE__ */ S("button", {
|
|
183
200
|
type: "button",
|
|
184
|
-
"aria-label":
|
|
201
|
+
"aria-label": j("calendar.closeDialog", "Close dialog"),
|
|
185
202
|
className: "fixed inset-0 bg-black/50",
|
|
186
|
-
onClick: () =>
|
|
187
|
-
}), /* @__PURE__ */
|
|
203
|
+
onClick: () => N(!1)
|
|
204
|
+
}), /* @__PURE__ */ C("form", {
|
|
188
205
|
onSubmit: async (e) => {
|
|
189
|
-
e.preventDefault(),
|
|
190
|
-
name:
|
|
191
|
-
description:
|
|
192
|
-
resourceType:
|
|
193
|
-
capacity:
|
|
194
|
-
location:
|
|
195
|
-
building:
|
|
196
|
-
floor:
|
|
197
|
-
room:
|
|
198
|
-
requireApproval:
|
|
199
|
-
} } }),
|
|
206
|
+
e.preventDefault(), q.name.trim() && (await H({ variables: { input: {
|
|
207
|
+
name: q.name,
|
|
208
|
+
description: q.description || void 0,
|
|
209
|
+
resourceType: q.resourceType,
|
|
210
|
+
capacity: q.capacity ? parseInt(q.capacity, 10) : void 0,
|
|
211
|
+
location: q.location || void 0,
|
|
212
|
+
building: q.building || void 0,
|
|
213
|
+
floor: q.floor || void 0,
|
|
214
|
+
room: q.room || void 0,
|
|
215
|
+
requireApproval: q.requireApproval
|
|
216
|
+
} } }), J({
|
|
200
217
|
name: "",
|
|
201
218
|
description: "",
|
|
202
219
|
resourceType: "ROOM",
|
|
@@ -206,193 +223,193 @@ function D() {
|
|
|
206
223
|
floor: "",
|
|
207
224
|
room: "",
|
|
208
225
|
requireApproval: !1
|
|
209
|
-
}),
|
|
226
|
+
}), N(!1), B());
|
|
210
227
|
},
|
|
211
228
|
className: "relative z-10 bg-bg-surface rounded-radius-lg p-6 max-w-lg w-full mx-auto mt-20 border border-border-default shadow-lg",
|
|
212
229
|
children: [
|
|
213
|
-
/* @__PURE__ */
|
|
230
|
+
/* @__PURE__ */ C("div", {
|
|
214
231
|
className: "flex items-center justify-between mb-6",
|
|
215
|
-
children: [/* @__PURE__ */
|
|
232
|
+
children: [/* @__PURE__ */ S("h2", {
|
|
216
233
|
className: "font-heading-md text-text-primary",
|
|
217
|
-
children:
|
|
218
|
-
}), /* @__PURE__ */
|
|
234
|
+
children: j("calendar.addResource", "Add Resource")
|
|
235
|
+
}), /* @__PURE__ */ S("button", {
|
|
219
236
|
type: "button",
|
|
220
|
-
onClick: () =>
|
|
237
|
+
onClick: () => N(!1),
|
|
221
238
|
className: "size-8 inline-flex items-center justify-center rounded-radius-sm hover:bg-bg-elevated text-text-tertiary",
|
|
222
|
-
children: /* @__PURE__ */
|
|
239
|
+
children: /* @__PURE__ */ S(b, { className: "size-5" })
|
|
223
240
|
})]
|
|
224
241
|
}),
|
|
225
|
-
|
|
242
|
+
W && /* @__PURE__ */ S("div", {
|
|
226
243
|
className: "mb-4 p-3 rounded-radius-md bg-red-50 dark:bg-red-950/20 border border-red-200 dark:border-red-800",
|
|
227
|
-
children: /* @__PURE__ */
|
|
244
|
+
children: /* @__PURE__ */ S("p", {
|
|
228
245
|
className: "font-text-sm text-red-700 dark:text-red-300",
|
|
229
|
-
children:
|
|
246
|
+
children: W.message
|
|
230
247
|
})
|
|
231
248
|
}),
|
|
232
|
-
/* @__PURE__ */
|
|
249
|
+
/* @__PURE__ */ C("div", {
|
|
233
250
|
className: "space-y-4",
|
|
234
251
|
children: [
|
|
235
|
-
/* @__PURE__ */
|
|
252
|
+
/* @__PURE__ */ C("div", { children: [/* @__PURE__ */ C("label", {
|
|
236
253
|
htmlFor: "resource-name",
|
|
237
254
|
className: "block font-text-sm font-weight-medium text-text-primary mb-1",
|
|
238
255
|
children: [
|
|
239
|
-
|
|
256
|
+
j("calendar.name", "Name"),
|
|
240
257
|
" ",
|
|
241
|
-
/* @__PURE__ */
|
|
258
|
+
/* @__PURE__ */ S("span", {
|
|
242
259
|
className: "text-red-500",
|
|
243
260
|
children: "*"
|
|
244
261
|
})
|
|
245
262
|
]
|
|
246
|
-
}), /* @__PURE__ */
|
|
263
|
+
}), /* @__PURE__ */ S("input", {
|
|
247
264
|
id: "resource-name",
|
|
248
265
|
type: "text",
|
|
249
266
|
required: !0,
|
|
250
|
-
value:
|
|
251
|
-
onChange: (e) =>
|
|
252
|
-
placeholder:
|
|
267
|
+
value: q.name,
|
|
268
|
+
onChange: (e) => X("name", e.target.value),
|
|
269
|
+
placeholder: j("calendar.resourceNameExample", "e.g. Conference Room A"),
|
|
253
270
|
className: "w-full px-3 py-2 rounded-radius-md border border-border-default bg-bg-surface text-text-primary font-text-sm placeholder:text-text-tertiary focus:outline-none focus:ring-2 focus:ring-action-primary-border",
|
|
254
|
-
"aria-label":
|
|
271
|
+
"aria-label": j("calendar.name", "Name")
|
|
255
272
|
})] }),
|
|
256
|
-
/* @__PURE__ */
|
|
273
|
+
/* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
|
|
257
274
|
htmlFor: "resource-type",
|
|
258
275
|
className: "block font-text-sm font-weight-medium text-text-primary mb-1",
|
|
259
|
-
children:
|
|
260
|
-
}), /* @__PURE__ */
|
|
276
|
+
children: j("calendar.type", "Type")
|
|
277
|
+
}), /* @__PURE__ */ C("select", {
|
|
261
278
|
id: "resource-type",
|
|
262
|
-
value:
|
|
263
|
-
onChange: (e) =>
|
|
279
|
+
value: q.resourceType,
|
|
280
|
+
onChange: (e) => X("resourceType", e.target.value),
|
|
264
281
|
className: "w-full px-3 py-2 rounded-radius-md border border-border-default bg-bg-surface text-text-primary font-text-sm focus:outline-none focus:ring-2 focus:ring-action-primary-border",
|
|
265
282
|
children: [
|
|
266
|
-
/* @__PURE__ */
|
|
283
|
+
/* @__PURE__ */ S("option", {
|
|
267
284
|
value: "ROOM",
|
|
268
|
-
children:
|
|
285
|
+
children: j("calendar.room", "Room")
|
|
269
286
|
}),
|
|
270
|
-
/* @__PURE__ */
|
|
287
|
+
/* @__PURE__ */ S("option", {
|
|
271
288
|
value: "EQUIPMENT",
|
|
272
|
-
children:
|
|
289
|
+
children: j("calendar.equipment", "Equipment")
|
|
273
290
|
}),
|
|
274
|
-
/* @__PURE__ */
|
|
291
|
+
/* @__PURE__ */ S("option", {
|
|
275
292
|
value: "DESK",
|
|
276
|
-
children:
|
|
293
|
+
children: j("calendar.desk", "Desk")
|
|
277
294
|
}),
|
|
278
|
-
/* @__PURE__ */
|
|
295
|
+
/* @__PURE__ */ S("option", {
|
|
279
296
|
value: "VEHICLE",
|
|
280
|
-
children:
|
|
297
|
+
children: j("calendar.vehicle", "Vehicle")
|
|
281
298
|
}),
|
|
282
|
-
/* @__PURE__ */
|
|
299
|
+
/* @__PURE__ */ S("option", {
|
|
283
300
|
value: "PARKING_SPOT",
|
|
284
|
-
children:
|
|
301
|
+
children: j("calendar.parkingSpot", "Parking Spot")
|
|
285
302
|
}),
|
|
286
|
-
/* @__PURE__ */
|
|
303
|
+
/* @__PURE__ */ S("option", {
|
|
287
304
|
value: "OTHER",
|
|
288
|
-
children:
|
|
305
|
+
children: j("calendar.other", "Other")
|
|
289
306
|
})
|
|
290
307
|
]
|
|
291
308
|
})] }),
|
|
292
|
-
/* @__PURE__ */
|
|
309
|
+
/* @__PURE__ */ C("div", {
|
|
293
310
|
className: "grid grid-cols-2 gap-3",
|
|
294
|
-
children: [/* @__PURE__ */
|
|
311
|
+
children: [/* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
|
|
295
312
|
htmlFor: "resource-capacity",
|
|
296
313
|
className: "block font-text-sm font-weight-medium text-text-primary mb-1",
|
|
297
|
-
children:
|
|
298
|
-
}), /* @__PURE__ */
|
|
314
|
+
children: j("calendar.capacity", "Capacity")
|
|
315
|
+
}), /* @__PURE__ */ S("input", {
|
|
299
316
|
id: "resource-capacity",
|
|
300
317
|
type: "number",
|
|
301
318
|
min: "1",
|
|
302
|
-
value:
|
|
303
|
-
onChange: (e) =>
|
|
304
|
-
placeholder:
|
|
319
|
+
value: q.capacity,
|
|
320
|
+
onChange: (e) => X("capacity", e.target.value),
|
|
321
|
+
placeholder: j("calendar.resourceCapacityExample", "e.g. 12"),
|
|
305
322
|
className: "w-full px-3 py-2 rounded-radius-md border border-border-default bg-bg-surface text-text-primary font-text-sm placeholder:text-text-tertiary focus:outline-none focus:ring-2 focus:ring-action-primary-border",
|
|
306
|
-
"aria-label":
|
|
307
|
-
})] }), /* @__PURE__ */
|
|
323
|
+
"aria-label": j("calendar.capacity", "Capacity")
|
|
324
|
+
})] }), /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
|
|
308
325
|
htmlFor: "resource-location",
|
|
309
326
|
className: "block font-text-sm font-weight-medium text-text-primary mb-1",
|
|
310
|
-
children:
|
|
311
|
-
}), /* @__PURE__ */
|
|
327
|
+
children: j("calendar.location", "Location")
|
|
328
|
+
}), /* @__PURE__ */ S("input", {
|
|
312
329
|
id: "resource-location",
|
|
313
330
|
type: "text",
|
|
314
|
-
value:
|
|
315
|
-
onChange: (e) =>
|
|
316
|
-
placeholder:
|
|
317
|
-
"aria-label":
|
|
331
|
+
value: q.location,
|
|
332
|
+
onChange: (e) => X("location", e.target.value),
|
|
333
|
+
placeholder: j("calendar.resourceLocationExample", "e.g. Building A"),
|
|
334
|
+
"aria-label": j("calendar.location", "Location"),
|
|
318
335
|
className: "w-full px-3 py-2 rounded-radius-md border border-border-default bg-bg-surface text-text-primary font-text-sm placeholder:text-text-tertiary focus:outline-none focus:ring-2 focus:ring-action-primary-border"
|
|
319
336
|
})] })]
|
|
320
337
|
}),
|
|
321
|
-
/* @__PURE__ */
|
|
338
|
+
/* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
|
|
322
339
|
htmlFor: "resource-description",
|
|
323
340
|
className: "block font-text-sm font-weight-medium text-text-primary mb-1",
|
|
324
|
-
children:
|
|
325
|
-
}), /* @__PURE__ */
|
|
341
|
+
children: j("calendar.description", "Description")
|
|
342
|
+
}), /* @__PURE__ */ S("textarea", {
|
|
326
343
|
id: "resource-description",
|
|
327
|
-
value:
|
|
328
|
-
onChange: (e) =>
|
|
329
|
-
placeholder:
|
|
344
|
+
value: q.description,
|
|
345
|
+
onChange: (e) => X("description", e.target.value),
|
|
346
|
+
placeholder: j("calendar.addDescription", "Add a description"),
|
|
330
347
|
rows: 2,
|
|
331
|
-
"aria-label":
|
|
348
|
+
"aria-label": j("calendar.description", "Description"),
|
|
332
349
|
className: "w-full px-3 py-2 rounded-radius-md border border-border-default bg-bg-surface text-text-primary font-text-sm placeholder:text-text-tertiary focus:outline-none focus:ring-2 focus:ring-action-primary-border resize-none"
|
|
333
350
|
})] }),
|
|
334
|
-
/* @__PURE__ */
|
|
351
|
+
/* @__PURE__ */ C("div", {
|
|
335
352
|
className: "flex items-center gap-3",
|
|
336
|
-
children: [/* @__PURE__ */
|
|
353
|
+
children: [/* @__PURE__ */ S("input", {
|
|
337
354
|
id: "resource-approval",
|
|
338
355
|
type: "checkbox",
|
|
339
|
-
checked:
|
|
340
|
-
onChange: (e) =>
|
|
356
|
+
checked: q.requireApproval,
|
|
357
|
+
onChange: (e) => X("requireApproval", e.target.checked),
|
|
341
358
|
className: "size-4 rounded border-border-default",
|
|
342
|
-
"aria-label":
|
|
343
|
-
}), /* @__PURE__ */
|
|
359
|
+
"aria-label": j("calendar.requireApprovalForBookings", "Require approval for bookings")
|
|
360
|
+
}), /* @__PURE__ */ S("label", {
|
|
344
361
|
htmlFor: "resource-approval",
|
|
345
362
|
className: "font-text-sm text-text-primary",
|
|
346
|
-
children:
|
|
363
|
+
children: j("calendar.requireApprovalForBookings", "Require approval for bookings")
|
|
347
364
|
})]
|
|
348
365
|
})
|
|
349
366
|
]
|
|
350
367
|
}),
|
|
351
|
-
/* @__PURE__ */
|
|
368
|
+
/* @__PURE__ */ C("div", {
|
|
352
369
|
className: "mt-6 flex justify-end gap-3",
|
|
353
|
-
children: [/* @__PURE__ */
|
|
370
|
+
children: [/* @__PURE__ */ S("button", {
|
|
354
371
|
type: "button",
|
|
355
|
-
onClick: () =>
|
|
356
|
-
disabled:
|
|
372
|
+
onClick: () => N(!1),
|
|
373
|
+
disabled: U,
|
|
357
374
|
className: "px-4 py-2 rounded-radius-md border border-border-default bg-bg-surface hover:bg-bg-elevated font-text-sm font-weight-medium text-text-primary transition-colors disabled:opacity-50",
|
|
358
|
-
children:
|
|
359
|
-
}), /* @__PURE__ */
|
|
375
|
+
children: j("calendar.cancel", "Cancel")
|
|
376
|
+
}), /* @__PURE__ */ S("button", {
|
|
360
377
|
type: "submit",
|
|
361
|
-
disabled:
|
|
378
|
+
disabled: U || !q.name.trim(),
|
|
362
379
|
className: "px-4 py-2 rounded-radius-md bg-action-primary-bg text-action-primary-fg font-text-sm font-weight-medium hover:bg-action-primary-bg-hover transition-colors disabled:opacity-50",
|
|
363
|
-
children:
|
|
380
|
+
children: U ? j("calendar.creating", "Creating...") : j("calendar.createResource", "Create Resource")
|
|
364
381
|
})]
|
|
365
382
|
})
|
|
366
383
|
]
|
|
367
384
|
})]
|
|
368
385
|
}),
|
|
369
|
-
/* @__PURE__ */
|
|
370
|
-
open: !!
|
|
371
|
-
title:
|
|
372
|
-
message:
|
|
373
|
-
confirmLabel:
|
|
386
|
+
/* @__PURE__ */ S(a, {
|
|
387
|
+
open: !!P,
|
|
388
|
+
title: j("calendar.deleteResource", "Delete Resource"),
|
|
389
|
+
message: j("calendar.deleteResourceConfirmation", "Are you sure you want to delete \"{name}\"? This will also cancel all future bookings.").replace("{name}", P?.name ?? ""),
|
|
390
|
+
confirmLabel: j("calendar.delete", "Delete"),
|
|
374
391
|
variant: "danger",
|
|
375
|
-
loading:
|
|
392
|
+
loading: K,
|
|
376
393
|
onConfirm: async () => {
|
|
377
|
-
if (
|
|
378
|
-
title:
|
|
379
|
-
message:
|
|
380
|
-
okButtonTitle:
|
|
394
|
+
if (P && await o({
|
|
395
|
+
title: j("calendar.deleteResource", "Delete Resource"),
|
|
396
|
+
message: j("calendar.deleteResourceConfirmation", "Are you sure you want to delete \"{name}\"? This will also cancel all future bookings.").replace("{name}", P.name),
|
|
397
|
+
okButtonTitle: j("calendar.delete", "Delete")
|
|
381
398
|
}) !== !1) try {
|
|
382
|
-
await
|
|
399
|
+
await G({ variables: { id: P.id } }), s("success"), F(null), B();
|
|
383
400
|
} catch (e) {
|
|
384
401
|
throw s("error"), e;
|
|
385
402
|
}
|
|
386
403
|
},
|
|
387
|
-
onCancel: () =>
|
|
404
|
+
onCancel: () => F(null)
|
|
388
405
|
})
|
|
389
406
|
]
|
|
390
|
-
}) : /* @__PURE__ */
|
|
391
|
-
title:
|
|
392
|
-
description:
|
|
407
|
+
}) : /* @__PURE__ */ S(d, {
|
|
408
|
+
title: j("calendar.accessDenied", "Access Denied"),
|
|
409
|
+
description: j("calendar.noPermissionViewResources", "You don't have permission to view resources.")
|
|
393
410
|
});
|
|
394
411
|
}
|
|
395
412
|
//#endregion
|
|
396
|
-
export {
|
|
413
|
+
export { A as ResourcesPage };
|
|
397
414
|
|
|
398
415
|
//# sourceMappingURL=ResourcesPage.js.map
|