@avament-pub/support-navbar-create 0.0.0-stage → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,3 +1,21 @@
1
- # Temporary Holding Version
1
+ # `@avament-pub/support-navbar-create`
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Full **Support** `CreateTicketDialog` (same UI as `support-frontend`) for module navbars.
4
+
5
+ ## Usage
6
+
7
+ Host must provide `QueryClientProvider` and `react-i18next` (with `ticket.create_dialog.*` keys).
8
+
9
+ ```tsx
10
+ import { useSupportNavbarCreateTicket } from "@avament-pub/support-navbar-create";
11
+
12
+ const { onSupportClick, dialog } = useSupportNavbarCreateTicket({
13
+ apiBaseUrl: process.env.NEXT_PUBLIC_API_URL!,
14
+ getAccessToken: () => storageService.getString(STORAGE_KEYS.ACCESS_TOKEN),
15
+ });
16
+
17
+ <Navbar onSupportClick={onSupportClick} />
18
+ {dialog}
19
+ ```
20
+
21
+ Calls `/api/support/tickets` with the same role-based field visibility as Support.
@@ -0,0 +1,34 @@
1
+ import * as React from 'react';
2
+
3
+ type CreateTicketDialogProps = {
4
+ open: boolean;
5
+ onOpenChange: (open: boolean) => void;
6
+ /** When set, dialog opens in edit mode for this ticket. */
7
+ ticketId?: string | null;
8
+ allowKeepAdding?: boolean;
9
+ onSaved?: () => void;
10
+ };
11
+
12
+ declare function CreateTicketDialog({ open, onOpenChange, ticketId, allowKeepAdding, onSaved, }: CreateTicketDialogProps): React.JSX.Element;
13
+
14
+ type SupportApiRuntime = {
15
+ apiBaseUrl: string;
16
+ getAccessToken: () => string | null;
17
+ };
18
+
19
+ declare function SupportApiRuntimeProvider({ apiBaseUrl, getAccessToken, children, }: SupportApiRuntime & {
20
+ children: React.ReactNode;
21
+ }): React.JSX.Element;
22
+
23
+ type UseSupportNavbarCreateTicketOptions = {
24
+ apiBaseUrl: string;
25
+ getAccessToken: () => string | null;
26
+ };
27
+ declare function useSupportNavbarCreateTicket({ apiBaseUrl, getAccessToken, }: UseSupportNavbarCreateTicketOptions): {
28
+ onSupportClick: () => void;
29
+ dialog: React.JSX.Element | null;
30
+ open: boolean;
31
+ setOpen: React.Dispatch<React.SetStateAction<boolean>>;
32
+ };
33
+
34
+ export { CreateTicketDialog, type CreateTicketDialogProps, SupportApiRuntimeProvider, type UseSupportNavbarCreateTicketOptions, useSupportNavbarCreateTicket };