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