glitchgrab 1.12.0 → 1.13.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/index.d.mts CHANGED
@@ -87,17 +87,15 @@ interface GlitchgrabProviderProps {
87
87
  maxBreadcrumbs?: number;
88
88
  children: ReactNode;
89
89
  fallback?: ReactNode;
90
+ /** Which report types to show in the dialog (default: all four) */
91
+ types?: ReportType[];
92
+ /** Show severity picker for BUG type (default: true) */
93
+ showSeverity?: boolean;
90
94
  }
91
95
  interface ReportButtonProps {
92
96
  position?: "bottom-right" | "bottom-left" | "top-right" | "top-left";
93
97
  label?: string;
94
98
  className?: string;
95
- /** Allow reporting feature requests, questions, not just bugs */
96
- types?: ReportType[];
97
- /** Dialog variant: "classic" (single screen) or "stepper" (3-step wizard). Default: "classic" */
98
- variant?: "classic" | "stepper";
99
- /** Show severity picker in stepper mode for BUG type. Default: true */
100
- showSeverity?: boolean;
101
99
  }
102
100
  interface UseGlitchgrabReturn {
103
101
  /** Report a bug programmatically */
@@ -137,8 +135,29 @@ interface UseGlitchgrabReturn {
137
135
  declare function useGlitchgrab(): UseGlitchgrabReturn;
138
136
  declare function GlitchgrabProvider(props: GlitchgrabProviderProps): react_jsx_runtime.JSX.Element;
139
137
 
140
- declare function ReportButton({ position, label, className, variant, showSeverity, types, children, }: ReportButtonProps & {
141
- /** Render prop — receives { onClick, capturing } so you can use your own trigger button */
138
+ /**
139
+ * Optional trigger button for opening the report dialog.
140
+ *
141
+ * The dialog itself lives inside `GlitchgrabProvider` — you don't need this component
142
+ * unless you want a visible trigger button. You can also open the dialog programmatically
143
+ * via `useGlitchgrab().openReportDialog()`.
144
+ *
145
+ * @example
146
+ * ```tsx
147
+ * // Use the default floating button
148
+ * <ReportButton />
149
+ *
150
+ * // Use your own trigger
151
+ * <ReportButton>
152
+ * {({ onClick }) => <button onClick={onClick}>Report</button>}
153
+ * </ReportButton>
154
+ *
155
+ * // Or skip ReportButton entirely and use the hook
156
+ * const { openReportDialog } = useGlitchgrab();
157
+ * <button onClick={() => openReportDialog()}>Report</button>
158
+ * ```
159
+ */
160
+ declare function ReportButton({ position, label, className, children, }: ReportButtonProps & {
142
161
  children?: (props: {
143
162
  onClick: () => void;
144
163
  capturing: boolean;
package/dist/index.d.ts CHANGED
@@ -87,17 +87,15 @@ interface GlitchgrabProviderProps {
87
87
  maxBreadcrumbs?: number;
88
88
  children: ReactNode;
89
89
  fallback?: ReactNode;
90
+ /** Which report types to show in the dialog (default: all four) */
91
+ types?: ReportType[];
92
+ /** Show severity picker for BUG type (default: true) */
93
+ showSeverity?: boolean;
90
94
  }
91
95
  interface ReportButtonProps {
92
96
  position?: "bottom-right" | "bottom-left" | "top-right" | "top-left";
93
97
  label?: string;
94
98
  className?: string;
95
- /** Allow reporting feature requests, questions, not just bugs */
96
- types?: ReportType[];
97
- /** Dialog variant: "classic" (single screen) or "stepper" (3-step wizard). Default: "classic" */
98
- variant?: "classic" | "stepper";
99
- /** Show severity picker in stepper mode for BUG type. Default: true */
100
- showSeverity?: boolean;
101
99
  }
102
100
  interface UseGlitchgrabReturn {
103
101
  /** Report a bug programmatically */
@@ -137,8 +135,29 @@ interface UseGlitchgrabReturn {
137
135
  declare function useGlitchgrab(): UseGlitchgrabReturn;
138
136
  declare function GlitchgrabProvider(props: GlitchgrabProviderProps): react_jsx_runtime.JSX.Element;
139
137
 
140
- declare function ReportButton({ position, label, className, variant, showSeverity, types, children, }: ReportButtonProps & {
141
- /** Render prop — receives { onClick, capturing } so you can use your own trigger button */
138
+ /**
139
+ * Optional trigger button for opening the report dialog.
140
+ *
141
+ * The dialog itself lives inside `GlitchgrabProvider` — you don't need this component
142
+ * unless you want a visible trigger button. You can also open the dialog programmatically
143
+ * via `useGlitchgrab().openReportDialog()`.
144
+ *
145
+ * @example
146
+ * ```tsx
147
+ * // Use the default floating button
148
+ * <ReportButton />
149
+ *
150
+ * // Use your own trigger
151
+ * <ReportButton>
152
+ * {({ onClick }) => <button onClick={onClick}>Report</button>}
153
+ * </ReportButton>
154
+ *
155
+ * // Or skip ReportButton entirely and use the hook
156
+ * const { openReportDialog } = useGlitchgrab();
157
+ * <button onClick={() => openReportDialog()}>Report</button>
158
+ * ```
159
+ */
160
+ declare function ReportButton({ position, label, className, children, }: ReportButtonProps & {
142
161
  children?: (props: {
143
162
  onClick: () => void;
144
163
  capturing: boolean;