@coinlist-co/react 0.5.0 → 0.6.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.
@@ -1,7 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as react from 'react';
3
3
  import { ReactNode } from 'react';
4
- import { A as AuthorizationCode, C as CodeVerifier, a as Config, O as OAuthAccessToken, b as Offer, P as PaginationParams, c as PaginatedResponse, d as OfferId, e as OfferDetail, f as Participation, g as ParticipationsPaginationParams, h as ParticipationId, i as CreateParticipationParams, j as OfferOptionId, R as Requirement, k as RequirementStatusInfo, l as RequirementType, m as RequirementStatusValue } from '../requirement-BEO42QOr.cjs';
4
+ import { A as AuthorizationCode, C as CodeVerifier, a as Config, O as OAuthAccessToken, b as Offer, P as PaginationParams, c as PaginatedResponse, d as OfferId, e as OfferDetail, f as Participation, g as ParticipationsPaginationParams, h as ParticipationId, i as CreateParticipationParams, j as OfferOptionId, R as Requirement, k as RequirementStatusInfo, l as RequirementType, m as RequirementStatusValue } from '../requirement-Dk6nYN1c.cjs';
5
5
 
6
6
  type AuthState = 'unknown' | 'logged-in' | 'logged-out';
7
7
  /** Discriminated error reasons from {@link CoinListClient.completeOAuth}. */
@@ -170,10 +170,40 @@ type CoinListProviderProps = {
170
170
  children: ReactNode;
171
171
  };
172
172
  /**
173
- * Provide CoinList (api + config) to the tree. Initialize once at app root with your config.
173
+ * Provide CoinList (api + config) to the tree WITHOUT any styling. Renders only the
174
+ * React context: no DOM, no <style>, no .clco-sdk-root. Safe to mount app-wide:
175
+ * it has zero visual impact on the host's own pages.
176
+ *
177
+ * Use this when you need useCoinList() available app-wide. Wrap SDK visual components
178
+ * in {@link CoinListStyleScope} separately. For dropping in a single widget, use the
179
+ * all-in-one {@link CoinListProvider}.
180
+ */
181
+ declare function CoinListContextProvider({ config, children, }: CoinListProviderProps): react_jsx_runtime.JSX.Element;
182
+ /**
183
+ * All-in-one provider: the React context plus the SDK styling wrapper. Convenience for
184
+ * dropping in a single widget. Composes {@link CoinListContextProvider} and
185
+ * {@link CoinListStyleScope}.
186
+ *
187
+ * Caution: this applies SDK styling (.clco-sdk-root) to everything below it. If you need
188
+ * context app-wide without styling the host's pages, mount {@link CoinListContextProvider}
189
+ * at the root and wrap only SDK visual components in {@link CoinListStyleScope}.
174
190
  */
175
191
  declare function CoinListProvider({ config, children }: CoinListProviderProps): react_jsx_runtime.JSX.Element;
176
192
 
193
+ type CoinListStyleScopeProps = {
194
+ children: ReactNode;
195
+ };
196
+ /**
197
+ * Render the SDK styling wrapper: the Inter font links and the .clco-sdk-root div
198
+ * with the self-contained, scoped <style> injection. Mount this around SDK visual
199
+ * components only. Keep it off the host's own pages to avoid styling them.
200
+ *
201
+ * This component self-injects all SDK styles via an inline <style> tag so consumers
202
+ * do not need to import any CSS files or configure their bundler. Styles are fully
203
+ * scoped to .clco-sdk-root and do not leak to the host page.
204
+ */
205
+ declare function CoinListStyleScope({ children }: CoinListStyleScopeProps): react_jsx_runtime.JSX.Element;
206
+
177
207
  interface CoinListSignInCardProps {
178
208
  state?: 'idle' | 'error';
179
209
  /**
@@ -535,4 +565,4 @@ interface UseParticipationsResult {
535
565
  */
536
566
  declare function useParticipations(offerId?: OfferId, options?: UseParticipationsOptions): UseParticipationsResult;
537
567
 
538
- export { type AuthState, ChecklistStatus, type ClientConfig, type CoinListClient, CoinListClientInitializationError, CoinListContext, type CoinListContextValue, CoinListProvider, type CoinListProviderProps, CoinListSignInCard, type CoinListSignInCardProps, type CompleteOAuthFailureReason, type LoadOfferDetailsReason, type LoadOfferDetailsState, type LoadOffersReason, type LoadOffersState, type LoadParticipationsReason, type LoadParticipationsState, type LoadRequirementsReason, type LoadRequirementsState, OAUTH_CODE_VERIFIER_KEY, OAUTH_STATE_KEY, type OauthClientErrorReason, type OauthClientResult, OfferCard, type Props as OfferCardProps, OfferCardUi, OffersGrid, type OffersGridProps, RequirementItem, type RequirementItemProps, RequirementItemUi, RequirementStatus, RequirementVariant, RequirementsChecklist, type RequirementsChecklistProps, type RequirementsData, type UseCoinListResult, type UseCompleteOAuthOptions, type UseOfferDetailsOptions, type UseOfferDetailsResult, type UseOffersOptions, type UseOffersResult, type UseParticipationsOptions, type UseParticipationsResult, type UseRequirementsOptions, type UseRequirementsResult, createCoinListClient, useCoinList, useCompleteOAuth, useOfferDetails, useOffers, useParticipations, useRequirements };
568
+ export { type AuthState, ChecklistStatus, type ClientConfig, type CoinListClient, CoinListClientInitializationError, CoinListContext, CoinListContextProvider, type CoinListContextValue, CoinListProvider, type CoinListProviderProps, CoinListSignInCard, type CoinListSignInCardProps, CoinListStyleScope, type CoinListStyleScopeProps, type CompleteOAuthFailureReason, type LoadOfferDetailsReason, type LoadOfferDetailsState, type LoadOffersReason, type LoadOffersState, type LoadParticipationsReason, type LoadParticipationsState, type LoadRequirementsReason, type LoadRequirementsState, OAUTH_CODE_VERIFIER_KEY, OAUTH_STATE_KEY, type OauthClientErrorReason, type OauthClientResult, OfferCard, type Props as OfferCardProps, OfferCardUi, OffersGrid, type OffersGridProps, RequirementItem, type RequirementItemProps, RequirementItemUi, RequirementStatus, RequirementVariant, RequirementsChecklist, type RequirementsChecklistProps, type RequirementsData, type UseCoinListResult, type UseCompleteOAuthOptions, type UseOfferDetailsOptions, type UseOfferDetailsResult, type UseOffersOptions, type UseOffersResult, type UseParticipationsOptions, type UseParticipationsResult, type UseRequirementsOptions, type UseRequirementsResult, createCoinListClient, useCoinList, useCompleteOAuth, useOfferDetails, useOffers, useParticipations, useRequirements };
@@ -1,7 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as react from 'react';
3
3
  import { ReactNode } from 'react';
4
- import { A as AuthorizationCode, C as CodeVerifier, a as Config, O as OAuthAccessToken, b as Offer, P as PaginationParams, c as PaginatedResponse, d as OfferId, e as OfferDetail, f as Participation, g as ParticipationsPaginationParams, h as ParticipationId, i as CreateParticipationParams, j as OfferOptionId, R as Requirement, k as RequirementStatusInfo, l as RequirementType, m as RequirementStatusValue } from '../requirement-BEO42QOr.js';
4
+ import { A as AuthorizationCode, C as CodeVerifier, a as Config, O as OAuthAccessToken, b as Offer, P as PaginationParams, c as PaginatedResponse, d as OfferId, e as OfferDetail, f as Participation, g as ParticipationsPaginationParams, h as ParticipationId, i as CreateParticipationParams, j as OfferOptionId, R as Requirement, k as RequirementStatusInfo, l as RequirementType, m as RequirementStatusValue } from '../requirement-Dk6nYN1c.js';
5
5
 
6
6
  type AuthState = 'unknown' | 'logged-in' | 'logged-out';
7
7
  /** Discriminated error reasons from {@link CoinListClient.completeOAuth}. */
@@ -170,10 +170,40 @@ type CoinListProviderProps = {
170
170
  children: ReactNode;
171
171
  };
172
172
  /**
173
- * Provide CoinList (api + config) to the tree. Initialize once at app root with your config.
173
+ * Provide CoinList (api + config) to the tree WITHOUT any styling. Renders only the
174
+ * React context: no DOM, no <style>, no .clco-sdk-root. Safe to mount app-wide:
175
+ * it has zero visual impact on the host's own pages.
176
+ *
177
+ * Use this when you need useCoinList() available app-wide. Wrap SDK visual components
178
+ * in {@link CoinListStyleScope} separately. For dropping in a single widget, use the
179
+ * all-in-one {@link CoinListProvider}.
180
+ */
181
+ declare function CoinListContextProvider({ config, children, }: CoinListProviderProps): react_jsx_runtime.JSX.Element;
182
+ /**
183
+ * All-in-one provider: the React context plus the SDK styling wrapper. Convenience for
184
+ * dropping in a single widget. Composes {@link CoinListContextProvider} and
185
+ * {@link CoinListStyleScope}.
186
+ *
187
+ * Caution: this applies SDK styling (.clco-sdk-root) to everything below it. If you need
188
+ * context app-wide without styling the host's pages, mount {@link CoinListContextProvider}
189
+ * at the root and wrap only SDK visual components in {@link CoinListStyleScope}.
174
190
  */
175
191
  declare function CoinListProvider({ config, children }: CoinListProviderProps): react_jsx_runtime.JSX.Element;
176
192
 
193
+ type CoinListStyleScopeProps = {
194
+ children: ReactNode;
195
+ };
196
+ /**
197
+ * Render the SDK styling wrapper: the Inter font links and the .clco-sdk-root div
198
+ * with the self-contained, scoped <style> injection. Mount this around SDK visual
199
+ * components only. Keep it off the host's own pages to avoid styling them.
200
+ *
201
+ * This component self-injects all SDK styles via an inline <style> tag so consumers
202
+ * do not need to import any CSS files or configure their bundler. Styles are fully
203
+ * scoped to .clco-sdk-root and do not leak to the host page.
204
+ */
205
+ declare function CoinListStyleScope({ children }: CoinListStyleScopeProps): react_jsx_runtime.JSX.Element;
206
+
177
207
  interface CoinListSignInCardProps {
178
208
  state?: 'idle' | 'error';
179
209
  /**
@@ -535,4 +565,4 @@ interface UseParticipationsResult {
535
565
  */
536
566
  declare function useParticipations(offerId?: OfferId, options?: UseParticipationsOptions): UseParticipationsResult;
537
567
 
538
- export { type AuthState, ChecklistStatus, type ClientConfig, type CoinListClient, CoinListClientInitializationError, CoinListContext, type CoinListContextValue, CoinListProvider, type CoinListProviderProps, CoinListSignInCard, type CoinListSignInCardProps, type CompleteOAuthFailureReason, type LoadOfferDetailsReason, type LoadOfferDetailsState, type LoadOffersReason, type LoadOffersState, type LoadParticipationsReason, type LoadParticipationsState, type LoadRequirementsReason, type LoadRequirementsState, OAUTH_CODE_VERIFIER_KEY, OAUTH_STATE_KEY, type OauthClientErrorReason, type OauthClientResult, OfferCard, type Props as OfferCardProps, OfferCardUi, OffersGrid, type OffersGridProps, RequirementItem, type RequirementItemProps, RequirementItemUi, RequirementStatus, RequirementVariant, RequirementsChecklist, type RequirementsChecklistProps, type RequirementsData, type UseCoinListResult, type UseCompleteOAuthOptions, type UseOfferDetailsOptions, type UseOfferDetailsResult, type UseOffersOptions, type UseOffersResult, type UseParticipationsOptions, type UseParticipationsResult, type UseRequirementsOptions, type UseRequirementsResult, createCoinListClient, useCoinList, useCompleteOAuth, useOfferDetails, useOffers, useParticipations, useRequirements };
568
+ export { type AuthState, ChecklistStatus, type ClientConfig, type CoinListClient, CoinListClientInitializationError, CoinListContext, CoinListContextProvider, type CoinListContextValue, CoinListProvider, type CoinListProviderProps, CoinListSignInCard, type CoinListSignInCardProps, CoinListStyleScope, type CoinListStyleScopeProps, type CompleteOAuthFailureReason, type LoadOfferDetailsReason, type LoadOfferDetailsState, type LoadOffersReason, type LoadOffersState, type LoadParticipationsReason, type LoadParticipationsState, type LoadRequirementsReason, type LoadRequirementsState, OAUTH_CODE_VERIFIER_KEY, OAUTH_STATE_KEY, type OauthClientErrorReason, type OauthClientResult, OfferCard, type Props as OfferCardProps, OfferCardUi, OffersGrid, type OffersGridProps, RequirementItem, type RequirementItemProps, RequirementItemUi, RequirementStatus, RequirementVariant, RequirementsChecklist, type RequirementsChecklistProps, type RequirementsData, type UseCoinListResult, type UseCompleteOAuthOptions, type UseOfferDetailsOptions, type UseOfferDetailsResult, type UseOffersOptions, type UseOffersResult, type UseParticipationsOptions, type UseParticipationsResult, type UseRequirementsOptions, type UseRequirementsResult, createCoinListClient, useCoinList, useCompleteOAuth, useOfferDetails, useOffers, useParticipations, useRequirements };