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