@burdenoff/microfe-calendar 2026.510.109
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/README.md +88 -0
- package/dist/CalendarRoot.d.ts +33 -0
- package/dist/CalendarRoot.d.ts.map +1 -0
- package/dist/CalendarRoot.js +81 -0
- package/dist/CalendarRoot.js.map +1 -0
- package/dist/CalendarRoutes.d.ts +21 -0
- package/dist/CalendarRoutes.d.ts.map +1 -0
- package/dist/CalendarRoutes.js +69 -0
- package/dist/CalendarRoutes.js.map +1 -0
- package/dist/components/AgendaView.d.ts +6 -0
- package/dist/components/AgendaView.d.ts.map +1 -0
- package/dist/components/AgendaView.js +102 -0
- package/dist/components/AgendaView.js.map +1 -0
- package/dist/components/ConfirmDialog.d.ts +16 -0
- package/dist/components/ConfirmDialog.d.ts.map +1 -0
- package/dist/components/ConfirmDialog.js +79 -0
- package/dist/components/ConfirmDialog.js.map +1 -0
- package/dist/components/DayView.d.ts +6 -0
- package/dist/components/DayView.d.ts.map +1 -0
- package/dist/components/DayView.js +73 -0
- package/dist/components/DayView.js.map +1 -0
- package/dist/components/EventBlock.d.ts +8 -0
- package/dist/components/EventBlock.d.ts.map +1 -0
- package/dist/components/EventBlock.js +38 -0
- package/dist/components/EventBlock.js.map +1 -0
- package/dist/components/EventFormModal.d.ts +14 -0
- package/dist/components/EventFormModal.d.ts.map +1 -0
- package/dist/components/EventFormModal.js +545 -0
- package/dist/components/EventFormModal.js.map +1 -0
- package/dist/components/MiniCalendar.d.ts +6 -0
- package/dist/components/MiniCalendar.d.ts.map +1 -0
- package/dist/components/MiniCalendar.js +73 -0
- package/dist/components/MiniCalendar.js.map +1 -0
- package/dist/components/MonthView.d.ts +6 -0
- package/dist/components/MonthView.d.ts.map +1 -0
- package/dist/components/MonthView.js +70 -0
- package/dist/components/MonthView.js.map +1 -0
- package/dist/components/TimelineView.d.ts +6 -0
- package/dist/components/TimelineView.d.ts.map +1 -0
- package/dist/components/TimelineView.js +99 -0
- package/dist/components/TimelineView.js.map +1 -0
- package/dist/components/ViewSwitcher.d.ts +6 -0
- package/dist/components/ViewSwitcher.d.ts.map +1 -0
- package/dist/components/ViewSwitcher.js +51 -0
- package/dist/components/ViewSwitcher.js.map +1 -0
- package/dist/components/WeekView.d.ts +6 -0
- package/dist/components/WeekView.d.ts.map +1 -0
- package/dist/components/WeekView.js +77 -0
- package/dist/components/WeekView.js.map +1 -0
- package/dist/components/YearView.d.ts +6 -0
- package/dist/components/YearView.d.ts.map +1 -0
- package/dist/components/YearView.js +69 -0
- package/dist/components/YearView.js.map +1 -0
- package/dist/constants/permissions.d.ts +90 -0
- package/dist/constants/permissions.d.ts.map +1 -0
- package/dist/constants/permissions.js +70 -0
- package/dist/constants/permissions.js.map +1 -0
- package/dist/dev/main.d.ts +2 -0
- package/dist/dev/main.d.ts.map +1 -0
- package/dist/generated/global-operations.d.ts +2 -0
- package/dist/generated/global-operations.d.ts.map +1 -0
- package/dist/generated/global-types.d.ts +20716 -0
- package/dist/generated/global-types.d.ts.map +1 -0
- package/dist/generated/wspace-operations.d.ts +906 -0
- package/dist/generated/wspace-operations.d.ts.map +1 -0
- package/dist/generated/wspace-operations.js +456 -0
- package/dist/generated/wspace-operations.js.map +1 -0
- package/dist/generated/wspace-types.d.ts +53363 -0
- package/dist/generated/wspace-types.d.ts.map +1 -0
- package/dist/graphql/calendarDocuments.d.ts +25 -0
- package/dist/graphql/calendarDocuments.d.ts.map +1 -0
- package/dist/graphql/calendarDocuments.js +360 -0
- package/dist/graphql/calendarDocuments.js.map +1 -0
- package/dist/hooks/index.d.ts +11 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/useCalendarPermissions.d.ts +14 -0
- package/dist/hooks/useCalendarPermissions.d.ts.map +1 -0
- package/dist/hooks/useCalendarPermissions.js +48 -0
- package/dist/hooks/useCalendarPermissions.js.map +1 -0
- package/dist/hooks/useEventPermissions.d.ts +15 -0
- package/dist/hooks/useEventPermissions.d.ts.map +1 -0
- package/dist/hooks/useEventPermissions.js +34 -0
- package/dist/hooks/useEventPermissions.js.map +1 -0
- package/dist/hooks/useEvents.d.ts +15 -0
- package/dist/hooks/useEvents.d.ts.map +1 -0
- package/dist/hooks/useEvents.js +199 -0
- package/dist/hooks/useEvents.js.map +1 -0
- package/dist/hooks/useSafePermissions.d.ts +6 -0
- package/dist/hooks/useSafePermissions.d.ts.map +1 -0
- package/dist/hooks/useSafePermissions.js +17 -0
- package/dist/hooks/useSafePermissions.js.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/pages/CalendarPage.d.ts +5 -0
- package/dist/pages/CalendarPage.d.ts.map +1 -0
- package/dist/pages/CalendarPage.js +239 -0
- package/dist/pages/CalendarPage.js.map +1 -0
- package/dist/pages/EventDetailsPage.d.ts +6 -0
- package/dist/pages/EventDetailsPage.d.ts.map +1 -0
- package/dist/pages/EventDetailsPage.js +625 -0
- package/dist/pages/EventDetailsPage.js.map +1 -0
- package/dist/pages/ResourcesPage.d.ts +6 -0
- package/dist/pages/ResourcesPage.d.ts.map +1 -0
- package/dist/pages/ResourcesPage.js +391 -0
- package/dist/pages/ResourcesPage.js.map +1 -0
- package/dist/pages/SettingsPage.d.ts +2 -0
- package/dist/pages/SettingsPage.d.ts.map +1 -0
- package/dist/pages/SettingsPage.js +798 -0
- package/dist/pages/SettingsPage.js.map +1 -0
- package/dist/pages/SubscriptionsPage.d.ts +6 -0
- package/dist/pages/SubscriptionsPage.d.ts.map +1 -0
- package/dist/pages/SubscriptionsPage.js +170 -0
- package/dist/pages/SubscriptionsPage.js.map +1 -0
- package/dist/providers/CalendarProvider.d.ts +31 -0
- package/dist/providers/CalendarProvider.d.ts.map +1 -0
- package/dist/providers/CalendarProvider.js +53 -0
- package/dist/providers/CalendarProvider.js.map +1 -0
- package/dist/store/calendarStore.d.ts +69 -0
- package/dist/store/calendarStore.d.ts.map +1 -0
- package/dist/store/calendarStore.js +82 -0
- package/dist/store/calendarStore.js.map +1 -0
- package/dist/types/index.d.ts +341 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/utils/dateHelpers.d.ts +115 -0
- package/dist/utils/dateHelpers.d.ts.map +1 -0
- package/dist/utils/dateHelpers.js +86 -0
- package/dist/utils/dateHelpers.js.map +1 -0
- package/dist/utils/icalHelpers.d.ts +19 -0
- package/dist/utils/icalHelpers.d.ts.map +1 -0
- package/dist/utils/icalHelpers.js +57 -0
- package/dist/utils/icalHelpers.js.map +1 -0
- package/dist/utils/nativeBridge.d.ts +3 -0
- package/dist/utils/nativeBridge.d.ts.map +1 -0
- package/dist/utils/nativeBridge.js +2 -0
- package/dist/utils/recurrenceHelpers.d.ts +15 -0
- package/dist/utils/recurrenceHelpers.d.ts.map +1 -0
- package/dist/utils/timezoneHelpers.d.ts +39 -0
- package/dist/utils/timezoneHelpers.d.ts.map +1 -0
- package/package.json +109 -0
package/README.md
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# @burdenoff/micro-fe
|
|
2
|
+
|
|
3
|
+
Microfrontend packages for Burdenoff products.
|
|
4
|
+
|
|
5
|
+
## Architecture
|
|
6
|
+
|
|
7
|
+
This is a **Layer 2 package** - a monolithic package with subpath exports for all microfrontends.
|
|
8
|
+
|
|
9
|
+
## Package Structure
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
@burdenoff/micro-fe/
|
|
13
|
+
├── /workflows - Complete workflow builder and management microfrontend
|
|
14
|
+
├── /tags - Tag management system (to be implemented)
|
|
15
|
+
└── /auth - Authentication flows (to be implemented)
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Usage
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
import { WorkflowsRoot } from '@burdenoff/micro-fe/workflows';
|
|
22
|
+
|
|
23
|
+
// In your host shell
|
|
24
|
+
<WorkflowsRoot
|
|
25
|
+
basePath="/workflows"
|
|
26
|
+
navigate={(path) => navigate(path)}
|
|
27
|
+
currentUser={user}
|
|
28
|
+
workspaceId={workspaceId}
|
|
29
|
+
apiGatewayUrl={apiGatewayUrl}
|
|
30
|
+
authToken={authToken}
|
|
31
|
+
/>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Development
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
# Install dependencies
|
|
38
|
+
bun install
|
|
39
|
+
|
|
40
|
+
# Generate GraphQL types
|
|
41
|
+
bun run codegen
|
|
42
|
+
|
|
43
|
+
# Build library
|
|
44
|
+
bun run build
|
|
45
|
+
|
|
46
|
+
# Type check
|
|
47
|
+
bun run type:check
|
|
48
|
+
|
|
49
|
+
# Run all checks
|
|
50
|
+
bun run sanity
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Workflows Microfrontend
|
|
54
|
+
|
|
55
|
+
Complete workflow automation microfrontend with:
|
|
56
|
+
|
|
57
|
+
- **WorkflowsList** - List all workflows
|
|
58
|
+
- **WorkflowBuilder** - Visual workflow builder with node palette
|
|
59
|
+
- **WorkflowRuns** - Execution history
|
|
60
|
+
- **WorkflowRunDetails** - Detailed run monitoring
|
|
61
|
+
|
|
62
|
+
### Routes
|
|
63
|
+
|
|
64
|
+
- `/` - Workflows list
|
|
65
|
+
- `/builder/:workflowKey?` - Workflow builder (create/edit)
|
|
66
|
+
- `/runs` - Workflow runs history
|
|
67
|
+
- `/runs/:runId` - Run details
|
|
68
|
+
|
|
69
|
+
## GraphQL Integration
|
|
70
|
+
|
|
71
|
+
Uses GraphQL Codegen to generate typed hooks from operations:
|
|
72
|
+
|
|
73
|
+
```typescript
|
|
74
|
+
import { useGetWorkflowDefinitionsQuery } from './graphql/generated/operations';
|
|
75
|
+
|
|
76
|
+
const { data, loading } = useGetWorkflowDefinitionsQuery({
|
|
77
|
+
variables: { input: { limit: 10 } }
|
|
78
|
+
});
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Tech Stack
|
|
82
|
+
|
|
83
|
+
- React 19 with TypeScript
|
|
84
|
+
- React Router v7
|
|
85
|
+
- Apollo Client for GraphQL
|
|
86
|
+
- Zustand for state management
|
|
87
|
+
- @burdenoff/fe-libs for UI primitives
|
|
88
|
+
- TailwindCSS v4 for styling
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { CalendarRootProps } from './types';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Root component for the Calendar microfrontend.
|
|
6
|
+
*
|
|
7
|
+
* This is the main entry point that host applications import and render.
|
|
8
|
+
* It sets up the necessary providers and renders the internal routing.
|
|
9
|
+
* Automatically registers navigation items with the shell if registration functions are provided.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* import { CalendarRoot, type CalendarRootProps } from '@burdenoff/micro-fe/calendar';
|
|
14
|
+
*
|
|
15
|
+
* function App() {
|
|
16
|
+
* const props: CalendarRootProps = {
|
|
17
|
+
* basePath: '/calendar',
|
|
18
|
+
* navigate: (path) => router.push(path),
|
|
19
|
+
* currentUser: { id: '1', email: 'user@example.com' },
|
|
20
|
+
* workspaceId: 'ws-123',
|
|
21
|
+
* apiGatewayUrl: 'https://api.example.com',
|
|
22
|
+
* authToken: 'token',
|
|
23
|
+
* defaultView: 'week',
|
|
24
|
+
* onEventSelect: (event) => console.log('Event selected:', event),
|
|
25
|
+
* registerNavItems: (items) => { return () => {}; },
|
|
26
|
+
* };
|
|
27
|
+
*
|
|
28
|
+
* return <CalendarRoot {...props} />;
|
|
29
|
+
* }
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export declare const CalendarRoot: FC<CalendarRootProps>;
|
|
33
|
+
//# sourceMappingURL=CalendarRoot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CalendarRoot.d.ts","sourceRoot":"","sources":["../src/CalendarRoot.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,EAA0B,MAAM,OAAO,CAAC;AAMxD,OAAO,KAAK,EAAE,iBAAiB,EAAuB,MAAM,SAAS,CAAC;AAGtE;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CAiG9C,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { CalendarProvider as e } from "./providers/CalendarProvider.js";
|
|
2
|
+
import { CalendarRoutes as t } from "./CalendarRoutes.js";
|
|
3
|
+
import { useCallback as n, useEffect as r } from "react";
|
|
4
|
+
import { ErrorBoundary as i } from "@burdenoff/fe-libs/shared/components";
|
|
5
|
+
import { useI18n as a } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
6
|
+
import { CalendarDays as o, DoorOpen as s, Rss as c, Settings as l } from "lucide-react";
|
|
7
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
8
|
+
import { FeatureFlagProvider as d } from "@burdenoff/fe-libs/shared/feature-flags";
|
|
9
|
+
//#region src/CalendarRoot.tsx
|
|
10
|
+
var f = (f) => {
|
|
11
|
+
let { registerNavItems: p, registerFooterItems: m, basePath: h = "/" } = f, { t: g } = a(), _ = n((e, t) => {
|
|
12
|
+
let n = g(e);
|
|
13
|
+
return n === e ? t : n;
|
|
14
|
+
}, [g]), v = (e, t) => (e.endsWith("/") ? e.slice(0, -1) : e) + (t.startsWith("/") ? t : `/${t}`);
|
|
15
|
+
return r(() => {
|
|
16
|
+
if (p) return p([
|
|
17
|
+
{
|
|
18
|
+
id: "calendar-main",
|
|
19
|
+
label: _("calendar.myCalendar", "My Calendar"),
|
|
20
|
+
path: h === "/" ? "/" : h,
|
|
21
|
+
icon: /* @__PURE__ */ u(o, { size: 20 }),
|
|
22
|
+
order: 10,
|
|
23
|
+
group: "calendar"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
id: "calendar-resources",
|
|
27
|
+
label: _("calendar.resources", "Resources"),
|
|
28
|
+
path: v(h, "resources"),
|
|
29
|
+
icon: /* @__PURE__ */ u(s, { size: 20 }),
|
|
30
|
+
order: 20,
|
|
31
|
+
group: "calendar"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
id: "calendar-subscriptions",
|
|
35
|
+
label: _("calendar.subscriptions", "Subscriptions"),
|
|
36
|
+
path: v(h, "subscriptions"),
|
|
37
|
+
icon: /* @__PURE__ */ u(c, { size: 20 }),
|
|
38
|
+
order: 30,
|
|
39
|
+
group: "calendar"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
id: "calendar-settings",
|
|
43
|
+
label: _("calendar.settings", "Settings"),
|
|
44
|
+
path: v(h, "settings"),
|
|
45
|
+
icon: /* @__PURE__ */ u(l, { size: 20 }),
|
|
46
|
+
order: 40,
|
|
47
|
+
group: "calendar"
|
|
48
|
+
}
|
|
49
|
+
]);
|
|
50
|
+
}, [
|
|
51
|
+
p,
|
|
52
|
+
h,
|
|
53
|
+
_
|
|
54
|
+
]), r(() => {
|
|
55
|
+
if (m) return m([{
|
|
56
|
+
id: "calendar-status",
|
|
57
|
+
label: _("calendar.calendarReady", "Calendar Ready"),
|
|
58
|
+
type: "status",
|
|
59
|
+
order: 10,
|
|
60
|
+
section: "left"
|
|
61
|
+
}]);
|
|
62
|
+
}, [m, _]), /* @__PURE__ */ u(i, {
|
|
63
|
+
fallback: /* @__PURE__ */ u("div", {
|
|
64
|
+
className: "p-6 text-center text-text-secondary",
|
|
65
|
+
children: "Something went wrong loading this module. Please refresh the page."
|
|
66
|
+
}),
|
|
67
|
+
children: /* @__PURE__ */ u(d, {
|
|
68
|
+
workspaceId: null,
|
|
69
|
+
gateway: "global",
|
|
70
|
+
defaultEnabled: !0,
|
|
71
|
+
children: /* @__PURE__ */ u(e, {
|
|
72
|
+
...f,
|
|
73
|
+
children: /* @__PURE__ */ u(t, {})
|
|
74
|
+
})
|
|
75
|
+
})
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
//#endregion
|
|
79
|
+
export { f as CalendarRoot };
|
|
80
|
+
|
|
81
|
+
//# sourceMappingURL=CalendarRoot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CalendarRoot.js","names":[],"sources":["../src/CalendarRoot.tsx"],"sourcesContent":["import { type FC, useCallback, useEffect } from 'react';\nimport { ErrorBoundary } from '@burdenoff/fe-libs/shared/components';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { CalendarDays, DoorOpen, Rss, Settings } from 'lucide-react';\nimport { CalendarProvider } from './providers/CalendarProvider';\nimport { FeatureFlagProvider } from '@burdenoff/fe-libs/shared/feature-flags';\nimport type { CalendarRootProps, NavItem, FooterItem } from './types';\nimport { CalendarRoutes } from './CalendarRoutes';\n\n/**\n * Root component for the Calendar microfrontend.\n *\n * This is the main entry point that host applications import and render.\n * It sets up the necessary providers and renders the internal routing.\n * Automatically registers navigation items with the shell if registration functions are provided.\n *\n * @example\n * ```tsx\n * import { CalendarRoot, type CalendarRootProps } from '@burdenoff/micro-fe/calendar';\n *\n * function App() {\n * const props: CalendarRootProps = {\n * basePath: '/calendar',\n * navigate: (path) => router.push(path),\n * currentUser: { id: '1', email: 'user@example.com' },\n * workspaceId: 'ws-123',\n * apiGatewayUrl: 'https://api.example.com',\n * authToken: 'token',\n * defaultView: 'week',\n * onEventSelect: (event) => console.log('Event selected:', event),\n * registerNavItems: (items) => { return () => {}; },\n * };\n *\n * return <CalendarRoot {...props} />;\n * }\n * ```\n */\nexport const CalendarRoot: FC<CalendarRootProps> = (props) => {\n const { registerNavItems, registerFooterItems, basePath = '/' } = props;\n const { t } = useI18n();\n const tr = useCallback(\n (key: string, fallback: string): string => {\n const value = t(key);\n return value === key ? fallback : value;\n },\n [t]\n );\n\n // Helper to join paths correctly, avoiding double slashes\n const joinPath = (base: string, path: string): string => {\n const cleanBase = base.endsWith('/') ? base.slice(0, -1) : base;\n const cleanPath = path.startsWith('/') ? path : `/${path}`;\n return cleanBase + cleanPath;\n };\n\n // Register navigation items with the shell\n useEffect(() => {\n if (!registerNavItems) return;\n\n const navItems: NavItem[] = [\n {\n id: 'calendar-main',\n label: tr('calendar.myCalendar', 'My Calendar'),\n path: basePath === '/' ? '/' : basePath,\n icon: <CalendarDays size={20} />,\n order: 10,\n group: 'calendar',\n },\n {\n id: 'calendar-resources',\n label: tr('calendar.resources', 'Resources'),\n path: joinPath(basePath, 'resources'),\n icon: <DoorOpen size={20} />,\n order: 20,\n group: 'calendar',\n },\n {\n id: 'calendar-subscriptions',\n label: tr('calendar.subscriptions', 'Subscriptions'),\n path: joinPath(basePath, 'subscriptions'),\n icon: <Rss size={20} />,\n order: 30,\n group: 'calendar',\n },\n {\n id: 'calendar-settings',\n label: tr('calendar.settings', 'Settings'),\n path: joinPath(basePath, 'settings'),\n icon: <Settings size={20} />,\n order: 40,\n group: 'calendar',\n },\n ];\n\n // Register and get cleanup function\n const cleanup = registerNavItems(navItems);\n\n // Return cleanup function to unregister on unmount\n return cleanup;\n }, [registerNavItems, basePath, tr]);\n\n // Register footer items\n useEffect(() => {\n if (!registerFooterItems) return;\n\n const footerItems: FooterItem[] = [\n {\n id: 'calendar-status',\n label: tr('calendar.calendarReady', 'Calendar Ready'),\n type: 'status',\n order: 10,\n section: 'left',\n },\n ];\n\n const cleanup = registerFooterItems(footerItems);\n return cleanup;\n }, [registerFooterItems, tr]);\n\n return (\n <ErrorBoundary\n fallback={\n <div className=\"p-6 text-center text-text-secondary\">\n Something went wrong loading this module. Please refresh the page.\n </div>\n }\n >\n <FeatureFlagProvider workspaceId={null} gateway=\"global\" defaultEnabled={true}>\n <CalendarProvider {...props}>\n <CalendarRoutes />\n </CalendarProvider>\n </FeatureFlagProvider>\n </ErrorBoundary>\n );\n};\n"],"mappings":";;;;;;;;;AAqCA,IAAa,KAAuC,MAAU;CAC5D,IAAM,EAAE,qBAAkB,wBAAqB,cAAW,QAAQ,GAC5D,EAAE,SAAM,GAAS,EACjB,IAAK,GACR,GAAa,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AM,SAAQ;GAAS,gBAAgB;aACvE,kBAAC,GAAD;IAAkB,GAAI;cACpB,kBAAC,GAAD,EAAkB,CAAA;IACD,CAAA;GACC,CAAA;EACR,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal routing for the Calendar microfrontend.
|
|
3
|
+
*
|
|
4
|
+
* All routes are relative to the basePath provided by the host.
|
|
5
|
+
* Example: If basePath="/calendar", then:
|
|
6
|
+
* - /calendar → redirects to /calendar/view/week
|
|
7
|
+
* - /calendar/view/week → CalendarPage (week view)
|
|
8
|
+
* - /calendar/event/:eventId → EventDetailsPage
|
|
9
|
+
* - /calendar/resources → ResourcesPage
|
|
10
|
+
* - /calendar/settings → SettingsPage
|
|
11
|
+
* - /calendar/subscriptions → SubscriptionsPage
|
|
12
|
+
*
|
|
13
|
+
* Lazy Loading Strategy:
|
|
14
|
+
* - CalendarPage: Eager (main entry point, most frequently accessed)
|
|
15
|
+
* - EventDetailsPage: Lazy (accessed on-demand)
|
|
16
|
+
* - ResourcesPage: Lazy (secondary feature)
|
|
17
|
+
* - SettingsPage: Lazy (infrequently accessed)
|
|
18
|
+
* - SubscriptionsPage: Lazy (infrequently accessed)
|
|
19
|
+
*/
|
|
20
|
+
export declare function CalendarRoutes(): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
//# sourceMappingURL=CalendarRoutes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CalendarRoutes.d.ts","sourceRoot":"","sources":["../src/CalendarRoutes.tsx"],"names":[],"mappings":"AA6BA;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,cAAc,4CAsD7B"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { CalendarPage as e } from "./pages/CalendarPage.js";
|
|
2
|
+
import { Suspense as t, lazy as n } from "react";
|
|
3
|
+
import { Navigate as r, Route as i, Routes as a } from "react-router-dom";
|
|
4
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
5
|
+
//#region src/CalendarRoutes.tsx
|
|
6
|
+
var c = n(() => import("./pages/EventDetailsPage.js").then((e) => ({ default: e.EventDetailsPage }))), l = n(() => import("./pages/ResourcesPage.js").then((e) => ({ default: e.ResourcesPage }))), u = n(() => import("./pages/SettingsPage.js").then((e) => ({ default: e.SettingsPage }))), d = n(() => import("./pages/SubscriptionsPage.js").then((e) => ({ default: e.SubscriptionsPage })));
|
|
7
|
+
function f() {
|
|
8
|
+
return /* @__PURE__ */ o("div", {
|
|
9
|
+
className: "min-h-screen bg-bg-canvas flex items-center justify-center",
|
|
10
|
+
children: /* @__PURE__ */ o("div", {
|
|
11
|
+
className: "text-text-secondary font-text-md",
|
|
12
|
+
children: "Loading..."
|
|
13
|
+
})
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
function p() {
|
|
17
|
+
return /* @__PURE__ */ s(a, { children: [
|
|
18
|
+
/* @__PURE__ */ o(i, {
|
|
19
|
+
index: !0,
|
|
20
|
+
element: /* @__PURE__ */ o(r, {
|
|
21
|
+
to: "view/week",
|
|
22
|
+
replace: !0
|
|
23
|
+
})
|
|
24
|
+
}),
|
|
25
|
+
/* @__PURE__ */ o(i, {
|
|
26
|
+
path: "view/:viewType",
|
|
27
|
+
element: /* @__PURE__ */ o(e, {})
|
|
28
|
+
}),
|
|
29
|
+
/* @__PURE__ */ o(i, {
|
|
30
|
+
path: "event/:eventId",
|
|
31
|
+
element: /* @__PURE__ */ o(t, {
|
|
32
|
+
fallback: /* @__PURE__ */ o(f, {}),
|
|
33
|
+
children: /* @__PURE__ */ o(c, {})
|
|
34
|
+
})
|
|
35
|
+
}),
|
|
36
|
+
/* @__PURE__ */ o(i, {
|
|
37
|
+
path: "resources",
|
|
38
|
+
element: /* @__PURE__ */ o(t, {
|
|
39
|
+
fallback: /* @__PURE__ */ o(f, {}),
|
|
40
|
+
children: /* @__PURE__ */ o(l, {})
|
|
41
|
+
})
|
|
42
|
+
}),
|
|
43
|
+
/* @__PURE__ */ o(i, {
|
|
44
|
+
path: "settings",
|
|
45
|
+
element: /* @__PURE__ */ o(t, {
|
|
46
|
+
fallback: /* @__PURE__ */ o(f, {}),
|
|
47
|
+
children: /* @__PURE__ */ o(u, {})
|
|
48
|
+
})
|
|
49
|
+
}),
|
|
50
|
+
/* @__PURE__ */ o(i, {
|
|
51
|
+
path: "subscriptions",
|
|
52
|
+
element: /* @__PURE__ */ o(t, {
|
|
53
|
+
fallback: /* @__PURE__ */ o(f, {}),
|
|
54
|
+
children: /* @__PURE__ */ o(d, {})
|
|
55
|
+
})
|
|
56
|
+
}),
|
|
57
|
+
/* @__PURE__ */ o(i, {
|
|
58
|
+
path: "*",
|
|
59
|
+
element: /* @__PURE__ */ o(r, {
|
|
60
|
+
to: "view/week",
|
|
61
|
+
replace: !0
|
|
62
|
+
})
|
|
63
|
+
})
|
|
64
|
+
] });
|
|
65
|
+
}
|
|
66
|
+
//#endregion
|
|
67
|
+
export { p as CalendarRoutes };
|
|
68
|
+
|
|
69
|
+
//# sourceMappingURL=CalendarRoutes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CalendarRoutes.js","names":[],"sources":["../src/CalendarRoutes.tsx"],"sourcesContent":["import { lazy, Suspense } from 'react';\nimport { Navigate, Route, Routes } from 'react-router-dom';\nimport { CalendarPage } from './pages/CalendarPage';\n\n// Lazy-loaded pages for code splitting\nconst EventDetailsPage = lazy(() =>\n import('./pages/EventDetailsPage').then((m) => ({ default: m.EventDetailsPage }))\n);\nconst ResourcesPage = lazy(() =>\n import('./pages/ResourcesPage').then((m) => ({ default: m.ResourcesPage }))\n);\nconst SettingsPage = lazy(() =>\n import('./pages/SettingsPage').then((m) => ({ default: m.SettingsPage }))\n);\nconst SubscriptionsPage = lazy(() =>\n import('./pages/SubscriptionsPage').then((m) => ({ default: m.SubscriptionsPage }))\n);\n\n/**\n * Fallback component for lazy-loaded pages\n */\nfunction PageLoadingFallback() {\n return (\n <div className=\"min-h-screen bg-bg-canvas flex items-center justify-center\">\n <div className=\"text-text-secondary font-text-md\">Loading...</div>\n </div>\n );\n}\n\n/**\n * Internal routing for the Calendar microfrontend.\n *\n * All routes are relative to the basePath provided by the host.\n * Example: If basePath=\"/calendar\", then:\n * - /calendar → redirects to /calendar/view/week\n * - /calendar/view/week → CalendarPage (week view)\n * - /calendar/event/:eventId → EventDetailsPage\n * - /calendar/resources → ResourcesPage\n * - /calendar/settings → SettingsPage\n * - /calendar/subscriptions → SubscriptionsPage\n *\n * Lazy Loading Strategy:\n * - CalendarPage: Eager (main entry point, most frequently accessed)\n * - EventDetailsPage: Lazy (accessed on-demand)\n * - ResourcesPage: Lazy (secondary feature)\n * - SettingsPage: Lazy (infrequently accessed)\n * - SubscriptionsPage: Lazy (infrequently accessed)\n */\nexport function CalendarRoutes() {\n return (\n <Routes>\n {/* Default redirect to week view */}\n <Route index element={<Navigate to=\"view/week\" replace />} />\n\n {/* Calendar views - Eager loaded (primary entry point) */}\n <Route path=\"view/:viewType\" element={<CalendarPage />} />\n {/* viewType: day | week | month | year | agenda | timeline */}\n\n {/* Event details - Lazy loaded */}\n <Route\n path=\"event/:eventId\"\n element={\n <Suspense fallback={<PageLoadingFallback />}>\n <EventDetailsPage />\n </Suspense>\n }\n />\n\n {/* Resources - Lazy loaded */}\n <Route\n path=\"resources\"\n element={\n <Suspense fallback={<PageLoadingFallback />}>\n <ResourcesPage />\n </Suspense>\n }\n />\n\n {/* Settings - Lazy loaded */}\n <Route\n path=\"settings\"\n element={\n <Suspense fallback={<PageLoadingFallback />}>\n <SettingsPage />\n </Suspense>\n }\n />\n\n {/* Subscriptions - Lazy loaded */}\n <Route\n path=\"subscriptions\"\n element={\n <Suspense fallback={<PageLoadingFallback />}>\n <SubscriptionsPage />\n </Suspense>\n }\n />\n\n {/* Catch-all: redirect to default view */}\n <Route path=\"*\" element={<Navigate to=\"view/week\" replace />} />\n </Routes>\n );\n}\n"],"mappings":";;;;;AAKA,IA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zC,kBAAC,GAAD,EAAqB,CAAA;IACZ,CAAA;GAEb,CAAA;EAGF,kBAAC,GAAD;GAAO,MAAK;GAAI,SAAS,kBAAC,GAAD;IAAU,IAAG;IAAY,SAAA;IAAU,CAAA;GAAI,CAAA;EACzD,EAAA,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgendaView.d.ts","sourceRoot":"","sources":["../../src/components/AgendaView.tsx"],"names":[],"mappings":"AAOA;;;GAGG;AACH,wBAAgB,UAAU,4CA0HzB"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { useCalendarStore as e } from "../store/calendarStore.js";
|
|
2
|
+
import { addDays as t, formatTime as n, isSameDay as r, startOfDay as i } from "../utils/dateHelpers.js";
|
|
3
|
+
import { useEvents as a } from "../hooks/useEvents.js";
|
|
4
|
+
import { EventBlock as o } from "./EventBlock.js";
|
|
5
|
+
import { useI18n as s } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
6
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
7
|
+
//#region src/components/AgendaView.tsx
|
|
8
|
+
function u() {
|
|
9
|
+
let u = e((e) => e.currentDate), { t: d } = s(), f = (e, t) => {
|
|
10
|
+
let n = d(e);
|
|
11
|
+
return n === e ? t : n;
|
|
12
|
+
}, p = i(u), { events: m, isLoading: h } = a({
|
|
13
|
+
startDate: p,
|
|
14
|
+
endDate: t(p, 30)
|
|
15
|
+
}), g = /* @__PURE__ */ new Map();
|
|
16
|
+
m.sort((e, t) => e.startTime.getTime() - t.startTime.getTime()).forEach((e) => {
|
|
17
|
+
let t = e.startTime.toISOString().split("T")[0], n = g.get(t) ?? [];
|
|
18
|
+
n.push(e), g.set(t, n);
|
|
19
|
+
});
|
|
20
|
+
let _ = Array.from(g.entries());
|
|
21
|
+
return /* @__PURE__ */ c("div", {
|
|
22
|
+
className: "@container",
|
|
23
|
+
children: /* @__PURE__ */ l("div", {
|
|
24
|
+
className: "max-w-3xl mx-auto",
|
|
25
|
+
children: [
|
|
26
|
+
h && /* @__PURE__ */ c("div", {
|
|
27
|
+
className: "text-center py-2 text-text-tertiary font-text-xs mb-2",
|
|
28
|
+
children: f("calendar.loadingEvents", "Loading events...")
|
|
29
|
+
}),
|
|
30
|
+
_.length === 0 && !h && /* @__PURE__ */ c("div", {
|
|
31
|
+
className: "bg-bg-surface border border-border-default rounded-radius-lg p-card-padding",
|
|
32
|
+
children: /* @__PURE__ */ c("p", {
|
|
33
|
+
className: "font-text-md text-text-secondary text-center py-12",
|
|
34
|
+
children: f("calendar.noUpcomingEvents", "No upcoming events in the next 30 days")
|
|
35
|
+
})
|
|
36
|
+
}),
|
|
37
|
+
/* @__PURE__ */ c("div", {
|
|
38
|
+
className: "space-y-4",
|
|
39
|
+
children: _.map(([e, t]) => {
|
|
40
|
+
let i = /* @__PURE__ */ new Date(e + "T00:00:00"), a = r(i, /* @__PURE__ */ new Date());
|
|
41
|
+
return /* @__PURE__ */ l("div", {
|
|
42
|
+
className: "bg-bg-surface border border-border-default rounded-radius-lg overflow-hidden",
|
|
43
|
+
children: [/* @__PURE__ */ c("div", {
|
|
44
|
+
className: `px-4 py-2 border-b border-border-default ${a ? "bg-blue-50 dark:bg-blue-950/20" : "bg-bg-elevated"}`,
|
|
45
|
+
children: /* @__PURE__ */ l("h3", {
|
|
46
|
+
className: `font-text-sm font-weight-semibold ${a ? "text-blue-600 dark:text-blue-400" : "text-text-primary"}`,
|
|
47
|
+
children: [a ? `${f("calendar.today", "Today")} - ` : "", i.toLocaleDateString("en-US", {
|
|
48
|
+
weekday: "long",
|
|
49
|
+
month: "long",
|
|
50
|
+
day: "numeric"
|
|
51
|
+
})]
|
|
52
|
+
})
|
|
53
|
+
}), /* @__PURE__ */ c("div", {
|
|
54
|
+
className: "divide-y divide-border-subtle",
|
|
55
|
+
children: t.map((e) => /* @__PURE__ */ c("div", {
|
|
56
|
+
className: "px-4 py-3 hover:bg-bg-elevated transition-colors",
|
|
57
|
+
children: /* @__PURE__ */ l("div", {
|
|
58
|
+
className: "flex items-start gap-3",
|
|
59
|
+
children: [/* @__PURE__ */ c("div", {
|
|
60
|
+
className: "w-20 shrink-0",
|
|
61
|
+
children: e.isAllDay ? /* @__PURE__ */ c("span", {
|
|
62
|
+
className: "font-text-xs text-text-tertiary",
|
|
63
|
+
children: f("calendar.allDay", "All day")
|
|
64
|
+
}) : /* @__PURE__ */ l("div", { children: [
|
|
65
|
+
/* @__PURE__ */ c("span", {
|
|
66
|
+
className: "font-text-sm font-weight-medium text-text-primary",
|
|
67
|
+
children: n(e.startTime)
|
|
68
|
+
}),
|
|
69
|
+
/* @__PURE__ */ c("br", {}),
|
|
70
|
+
/* @__PURE__ */ c("span", {
|
|
71
|
+
className: "font-text-xs text-text-tertiary",
|
|
72
|
+
children: n(e.endTime)
|
|
73
|
+
})
|
|
74
|
+
] })
|
|
75
|
+
}), /* @__PURE__ */ l("div", {
|
|
76
|
+
className: "flex-1 min-w-0",
|
|
77
|
+
children: [
|
|
78
|
+
/* @__PURE__ */ c(o, { event: e }),
|
|
79
|
+
e.location && /* @__PURE__ */ c("p", {
|
|
80
|
+
className: "mt-1 font-text-xs text-text-tertiary truncate",
|
|
81
|
+
children: e.location
|
|
82
|
+
}),
|
|
83
|
+
e.description && /* @__PURE__ */ c("p", {
|
|
84
|
+
className: "mt-1 font-text-xs text-text-tertiary line-clamp-2",
|
|
85
|
+
children: e.description
|
|
86
|
+
})
|
|
87
|
+
]
|
|
88
|
+
})]
|
|
89
|
+
})
|
|
90
|
+
}, e.id))
|
|
91
|
+
})]
|
|
92
|
+
}, e);
|
|
93
|
+
})
|
|
94
|
+
})
|
|
95
|
+
]
|
|
96
|
+
})
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
//#endregion
|
|
100
|
+
export { u as AgendaView };
|
|
101
|
+
|
|
102
|
+
//# sourceMappingURL=AgendaView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgendaView.js","names":[],"sources":["../../src/components/AgendaView.tsx"],"sourcesContent":["import { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { useCalendarStore } from '../store/calendarStore';\nimport { addDays, formatTime, isSameDay, startOfDay } from '../utils/dateHelpers';\nimport { useEvents } from '../hooks/useEvents';\nimport { EventBlock } from './EventBlock';\nimport type { CalendarEvent } from '../types';\n\n/**\n * Agenda view component\n * Shows upcoming events in a chronological list format grouped by date\n */\nexport function AgendaView() {\n const currentDate = useCalendarStore((state) => state.currentDate);\n const { t } = useI18n();\n const tr = (key: string, fallback: string): string => {\n const value = t(key);\n return value === key ? fallback : value;\n };\n\n // Show 30 days of upcoming events\n const rangeStart = startOfDay(currentDate);\n const rangeEnd = addDays(rangeStart, 30);\n const { events, isLoading } = useEvents({ startDate: rangeStart, endDate: rangeEnd });\n\n // Group events by date\n const groupedEvents: Map<string, CalendarEvent[]> = new Map();\n events\n .sort((a, b) => a.startTime.getTime() - b.startTime.getTime())\n .forEach((event) => {\n const dateKey = event.startTime.toISOString().split('T')[0];\n const existing = groupedEvents.get(dateKey) ?? [];\n existing.push(event);\n groupedEvents.set(dateKey, existing);\n });\n\n const dateGroups = Array.from(groupedEvents.entries());\n\n return (\n <div className=\"@container\">\n <div className=\"max-w-3xl mx-auto\">\n {/* Loading indicator */}\n {isLoading && (\n <div className=\"text-center py-2 text-text-tertiary font-text-xs mb-2\">\n {tr('calendar.loadingEvents', 'Loading events...')}\n </div>\n )}\n\n {dateGroups.length === 0 && !isLoading && (\n <div className=\"bg-bg-surface border border-border-default rounded-radius-lg p-card-padding\">\n <p className=\"font-text-md text-text-secondary text-center py-12\">\n {tr('calendar.noUpcomingEvents', 'No upcoming events in the next 30 days')}\n </p>\n </div>\n )}\n\n <div className=\"space-y-4\">\n {dateGroups.map(([dateKey, dayEvents]) => {\n const date = new Date(dateKey + 'T00:00:00');\n const today = isSameDay(date, new Date());\n\n return (\n <div\n key={dateKey}\n className=\"bg-bg-surface border border-border-default rounded-radius-lg overflow-hidden\"\n >\n {/* Date header */}\n <div\n className={`px-4 py-2 border-b border-border-default ${today ? 'bg-blue-50 dark:bg-blue-950/20' : 'bg-bg-elevated'}`}\n >\n <h3\n className={`font-text-sm font-weight-semibold ${today ? 'text-blue-600 dark:text-blue-400' : 'text-text-primary'}`}\n >\n {today ? `${tr('calendar.today', 'Today')} - ` : ''}\n {date.toLocaleDateString('en-US', {\n weekday: 'long',\n month: 'long',\n day: 'numeric',\n })}\n </h3>\n </div>\n\n {/* Events list */}\n <div className=\"divide-y divide-border-subtle\">\n {dayEvents.map((event) => (\n <div\n key={event.id}\n className=\"px-4 py-3 hover:bg-bg-elevated transition-colors\"\n >\n <div className=\"flex items-start gap-3\">\n {/* Time */}\n <div className=\"w-20 shrink-0\">\n {event.isAllDay ? (\n <span className=\"font-text-xs text-text-tertiary\">\n {tr('calendar.allDay', 'All day')}\n </span>\n ) : (\n <div>\n <span className=\"font-text-sm font-weight-medium text-text-primary\">\n {formatTime(event.startTime)}\n </span>\n <br />\n <span className=\"font-text-xs text-text-tertiary\">\n {formatTime(event.endTime)}\n </span>\n </div>\n )}\n </div>\n\n {/* Event details */}\n <div className=\"flex-1 min-w-0\">\n <EventBlock event={event} />\n {event.location && (\n <p className=\"mt-1 font-text-xs text-text-tertiary truncate\">\n {event.location}\n </p>\n )}\n {event.description && (\n <p className=\"mt-1 font-text-xs text-text-tertiary line-clamp-2\">\n {event.description}\n </p>\n )}\n </div>\n </div>\n </div>\n ))}\n </div>\n </div>\n );\n })}\n </div>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;AAWA,SAAgB,IAAa;CAC3B,IAAM,IAAc,GAAkB,MAAU,EAAM,YAAY,EAC5D,EAAE,SAAM,GAAS,EACjB,KAAM,GAAa,MAA6B;EACpD,IAAM,IAAQ,EAAE,EAAI;AACpB,SAAO,MAAU,IAAM,IAAW;IAI9B,IAAa,EAAW,EAAY,EAEpC,EAAE,WAAQ,iBAAc,EAAU;E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AU;mBAEV,kBAAC,OAAD;UAAK,WAAU;oBAAf,CAEE,kBAAC,OAAD;WAAK,WAAU;qBACZ,EAAM,WACL,kBAAC,QAAD;YAAM,WAAU;sBACb,EAAG,mBAAmB,UAAU;YAC5B,CAAA,GAEP,kBAAC,OAAD,EAAA,UAAA;YACE,kBAAC,QAAD;aAAM,WAAU;uBACb,EAAW,EAAM,UAAU;aACvB,CAAA;YACP,kBAAC,MAAD,EAAM,CAAA;YACN,kBAAC,QAAD;aAAM,WAAU;uBACb,EAAW,EAAM,QAAQ;aACrB,CAAA;YACH,EAAA,CAAA;WAEJ,CAAA,EAGN,kBAAC,OAAD;WAAK,WAAU;qBAAf;YACE,kBAAC,GAAD,EAAmB,UAAS,CAAA;YAC3B,EAAM,YACL,kBAAC,KAAD;aAAG,WAAU;uBACV,EAAM;aACL,CAAA;YAEL,EAAM,eACL,kBAAC,KAAD;aAAG,WAAU;uBACV,EAAM;aACL,CAAA;YAEF;aACF;;SACF,EAtCC,EAAM,GAsCP,CACN;QACE,CAAA,CACF;SAhEC,EAgED;OAER;KACE,CAAA;IACF;;EACF,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
|
|
3
|
+
interface ConfirmDialogProps {
|
|
4
|
+
open: boolean;
|
|
5
|
+
title: string;
|
|
6
|
+
message: string;
|
|
7
|
+
confirmLabel?: string;
|
|
8
|
+
cancelLabel?: string;
|
|
9
|
+
variant?: 'danger' | 'warning' | 'info';
|
|
10
|
+
loading?: boolean;
|
|
11
|
+
onConfirm: () => void;
|
|
12
|
+
onCancel: () => void;
|
|
13
|
+
}
|
|
14
|
+
export declare const ConfirmDialog: FC<ConfirmDialogProps>;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=ConfirmDialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfirmDialog.d.ts","sourceRoot":"","sources":["../../src/components/ConfirmDialog.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAqB,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAInD,UAAU,kBAAkB;IAC1B,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAC;IACxC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,CA+FhD,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { useEffect as e, useRef as t } from "react";
|
|
2
|
+
import { useI18n as n } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
3
|
+
import { AlertTriangle as r, X as i } from "lucide-react";
|
|
4
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/ConfirmDialog.tsx
|
|
6
|
+
var s = ({ open: s, title: c, message: l, confirmLabel: u = "Confirm", cancelLabel: d = "Cancel", variant: f = "danger", loading: p = !1, onConfirm: m, onCancel: h }) => {
|
|
7
|
+
let g = t(null), { t: _ } = n(), v = (e, t) => {
|
|
8
|
+
let n = _(e);
|
|
9
|
+
return n === e ? t : n;
|
|
10
|
+
};
|
|
11
|
+
if (e(() => {
|
|
12
|
+
let e = g.current;
|
|
13
|
+
e && (s && !e.open ? e.showModal() : !s && e.open && e.close());
|
|
14
|
+
}, [s]), !s) return null;
|
|
15
|
+
let y = {
|
|
16
|
+
danger: {
|
|
17
|
+
icon: "text-red-500",
|
|
18
|
+
button: "bg-red-600 hover:bg-red-700 text-white"
|
|
19
|
+
},
|
|
20
|
+
warning: {
|
|
21
|
+
icon: "text-amber-500",
|
|
22
|
+
button: "bg-amber-600 hover:bg-amber-700 text-white"
|
|
23
|
+
},
|
|
24
|
+
info: {
|
|
25
|
+
icon: "text-blue-500",
|
|
26
|
+
button: "bg-blue-600 hover:bg-blue-700 text-white"
|
|
27
|
+
}
|
|
28
|
+
}[f];
|
|
29
|
+
return /* @__PURE__ */ a("dialog", {
|
|
30
|
+
ref: g,
|
|
31
|
+
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-md w-full p-0",
|
|
32
|
+
onClose: h,
|
|
33
|
+
children: /* @__PURE__ */ o("div", {
|
|
34
|
+
className: "p-6",
|
|
35
|
+
children: [/* @__PURE__ */ o("div", {
|
|
36
|
+
className: "flex items-start gap-4",
|
|
37
|
+
children: [
|
|
38
|
+
/* @__PURE__ */ a("div", {
|
|
39
|
+
className: `size-10 rounded-full bg-bg-neutral flex items-center justify-center shrink-0 ${y.icon}`,
|
|
40
|
+
children: /* @__PURE__ */ a(r, { className: "size-5" })
|
|
41
|
+
}),
|
|
42
|
+
/* @__PURE__ */ o("div", {
|
|
43
|
+
className: "flex-1 min-w-0",
|
|
44
|
+
children: [/* @__PURE__ */ a("h3", {
|
|
45
|
+
className: "font-heading-sm text-text-primary",
|
|
46
|
+
children: c
|
|
47
|
+
}), /* @__PURE__ */ a("p", {
|
|
48
|
+
className: "mt-2 font-text-sm text-text-secondary",
|
|
49
|
+
children: l
|
|
50
|
+
})]
|
|
51
|
+
}),
|
|
52
|
+
/* @__PURE__ */ a("button", {
|
|
53
|
+
onClick: h,
|
|
54
|
+
className: "size-8 inline-flex items-center justify-center rounded-radius-sm hover:bg-bg-elevated text-text-tertiary transition-colors shrink-0",
|
|
55
|
+
"aria-label": v("calendar.close", "Close"),
|
|
56
|
+
children: /* @__PURE__ */ a(i, { className: "size-4" })
|
|
57
|
+
})
|
|
58
|
+
]
|
|
59
|
+
}), /* @__PURE__ */ o("div", {
|
|
60
|
+
className: "mt-6 flex justify-end gap-3",
|
|
61
|
+
children: [/* @__PURE__ */ a("button", {
|
|
62
|
+
onClick: h,
|
|
63
|
+
disabled: p,
|
|
64
|
+
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",
|
|
65
|
+
children: d
|
|
66
|
+
}), /* @__PURE__ */ a("button", {
|
|
67
|
+
onClick: m,
|
|
68
|
+
disabled: p,
|
|
69
|
+
className: `px-4 py-2 rounded-radius-md font-text-sm font-weight-medium transition-colors disabled:opacity-50 ${y.button}`,
|
|
70
|
+
children: p ? v("calendar.processing", "Processing...") : u
|
|
71
|
+
})]
|
|
72
|
+
})]
|
|
73
|
+
})
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
//#endregion
|
|
77
|
+
export { s as ConfirmDialog };
|
|
78
|
+
|
|
79
|
+
//# sourceMappingURL=ConfirmDialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfirmDialog.js","names":[],"sources":["../../src/components/ConfirmDialog.tsx"],"sourcesContent":["/**\n * ConfirmDialog - Reusable confirmation dialog for destructive actions\n */\n\nimport { useEffect, useRef, type FC } from 'react';\nimport { AlertTriangle, X } from 'lucide-react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\n\ninterface ConfirmDialogProps {\n open: boolean;\n title: string;\n message: string;\n confirmLabel?: string;\n cancelLabel?: string;\n variant?: 'danger' | 'warning' | 'info';\n loading?: boolean;\n onConfirm: () => void;\n onCancel: () => void;\n}\n\nexport const ConfirmDialog: FC<ConfirmDialogProps> = ({\n open,\n title,\n message,\n confirmLabel = 'Confirm',\n cancelLabel = 'Cancel',\n variant = 'danger',\n loading = false,\n onConfirm,\n onCancel,\n}) => {\n const dialogRef = useRef<HTMLDialogElement>(null);\n const { t } = useI18n();\n const tr = (key: string, fallback: string): string => {\n const value = t(key);\n return value === key ? fallback : value;\n };\n\n useEffect(() => {\n const dialog = dialogRef.current;\n if (!dialog) return;\n\n if (open && !dialog.open) {\n dialog.showModal();\n } else if (!open && dialog.open) {\n dialog.close();\n }\n }, [open]);\n\n if (!open) return null;\n\n const variantStyles = {\n danger: {\n icon: 'text-red-500',\n button: 'bg-red-600 hover:bg-red-700 text-white',\n },\n warning: {\n icon: 'text-amber-500',\n button: 'bg-amber-600 hover:bg-amber-700 text-white',\n },\n info: {\n icon: 'text-blue-500',\n button: 'bg-blue-600 hover:bg-blue-700 text-white',\n },\n };\n\n const styles = variantStyles[variant];\n\n return (\n <dialog\n ref={dialogRef}\n 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-md w-full p-0\"\n onClose={onCancel}\n >\n <div className=\"p-6\">\n {/* Header */}\n <div className=\"flex items-start gap-4\">\n <div\n className={`size-10 rounded-full bg-bg-neutral flex items-center justify-center shrink-0 ${styles.icon}`}\n >\n <AlertTriangle className=\"size-5\" />\n </div>\n <div className=\"flex-1 min-w-0\">\n <h3 className=\"font-heading-sm text-text-primary\">{title}</h3>\n <p className=\"mt-2 font-text-sm text-text-secondary\">{message}</p>\n </div>\n <button\n onClick={onCancel}\n className=\"size-8 inline-flex items-center justify-center rounded-radius-sm hover:bg-bg-elevated text-text-tertiary transition-colors shrink-0\"\n aria-label={tr('calendar.close', 'Close')}\n >\n <X className=\"size-4\" />\n </button>\n </div>\n\n {/* Actions */}\n <div className=\"mt-6 flex justify-end gap-3\">\n <button\n onClick={onCancel}\n disabled={loading}\n 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\"\n >\n {cancelLabel}\n </button>\n <button\n onClick={onConfirm}\n disabled={loading}\n className={`px-4 py-2 rounded-radius-md font-text-sm font-weight-medium transition-colors disabled:opacity-50 ${styles.button}`}\n >\n {loading ? tr('calendar.processing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UAAU;KACV,WAAU;eAET;KACM,CAAA,EACT,kBAAC,UAAD;KACE,SAAS;KACT,UAAU;KACV,WAAW,qGAAqG,EAAO;eAEtH,IAAU,EAAG,uBAAuB,gBAAgB,GAAG;KACjD,CAAA,CACL;MACF;;EACC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DayView.d.ts","sourceRoot":"","sources":["../../src/components/DayView.tsx"],"names":[],"mappings":"AAOA;;;GAGG;AACH,wBAAgB,OAAO,4CA+FtB"}
|