@dismissible/react-client 0.3.2 → 1.0.0-canary.4.a9fb4a5

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.
@@ -4,23 +4,22 @@ import { default as React } from 'react';
4
4
  */
5
5
  export interface DismissibleProps {
6
6
  /** Unique identifier for the dismissible item */
7
- id: string;
7
+ itemId: string;
8
8
  /** Content to render when the item is not dismissed */
9
9
  children: React.ReactNode;
10
10
  /** Optional callback when item is dismissed */
11
11
  onDismiss?: () => void;
12
12
  /** Optional custom loading component */
13
13
  LoadingComponent?: React.ComponentType<{
14
- id: string;
14
+ itemId: string;
15
15
  }> | null;
16
16
  /** Optional custom error component */
17
17
  ErrorComponent?: React.ComponentType<{
18
- id: string;
18
+ itemId: string;
19
19
  error: Error;
20
20
  }> | null;
21
21
  /** Optional custom dismiss button component */
22
22
  DismissButtonComponent?: React.ComponentType<{
23
- id: string;
24
23
  onDismiss: () => Promise<void>;
25
24
  ariaLabel: string;
26
25
  }> | null;
@@ -1,21 +1,7 @@
1
- /**
2
- * API configuration settings
3
- */
4
- /**
5
- * Configuration interface for API settings
6
- */
7
1
  export interface ApiConfig {
8
2
  /** Base URL for API requests */
9
3
  baseUrl: string;
10
4
  }
11
- /**
12
- * Returns the API configuration based on the current environment
13
- * @returns The API configuration object
14
- */
15
5
  export declare const getConfig: () => ApiConfig;
16
- /**
17
- * Gets the API base URL
18
- * @returns The base URL for API requests
19
- */
20
6
  export declare const getBaseUrl: () => string;
21
7
  export default getConfig;
@@ -5,6 +5,7 @@ import { DismissibleContextValue } from '../types/dismissible.types';
5
5
  export declare const DismissibleContext: import('react').Context<DismissibleContextValue | null>;
6
6
  /**
7
7
  * Hook to consume the DismissibleContext
8
- * @returns The context value or null if not within a provider
8
+ * @throws Error if used outside of a DismissibleProvider
9
+ * @returns The context value
9
10
  */
10
- export declare const useDismissibleContext: () => DismissibleContextValue | null;
11
+ export declare const useDismissibleContext: () => DismissibleContextValue;
@@ -6,12 +6,13 @@ import { DismissibleProviderProps } from '../types/dismissible.types';
6
6
  * @example
7
7
  * ```tsx
8
8
  * // With static JWT
9
- * <DismissibleProvider jwt="eyJhbGciOiJ..." baseUrl="https://api.dismissible.io">
9
+ * <DismissibleProvider userId="user-123" jwt="eyJhbGciOiJ..." baseUrl="https://api.dismissible.io">
10
10
  * <App />
11
11
  * </DismissibleProvider>
12
12
  *
13
13
  * // With synchronous JWT function
14
14
  * <DismissibleProvider
15
+ * userId="user-123"
15
16
  * jwt={() => getAccessToken()}
16
17
  * baseUrl="https://api.dismissible.io"
17
18
  * >
@@ -20,6 +21,7 @@ import { DismissibleProviderProps } from '../types/dismissible.types';
20
21
  *
21
22
  * // With asynchronous JWT function
22
23
  * <DismissibleProvider
24
+ * userId="user-123"
23
25
  * jwt={async () => await fetchAccessToken()}
24
26
  * baseUrl="https://api.dismissible.io"
25
27
  * >