@refraction-ui/react 0.9.1 → 0.9.2

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.
@@ -259,6 +259,16 @@ interface Analytics {
259
259
  */
260
260
  declare function createAnalytics(config: AnalyticsConfig): Analytics;
261
261
 
262
+ /**
263
+ * The noop collector returned when `enabled: false`.
264
+ *
265
+ * Every method is an empty function so calls are free and the surrounding
266
+ * vendor/sink code can be tree-shaken out of a production bundle when
267
+ * analytics is compiled off. Kept in its own module so bundlers can drop the
268
+ * live collector entirely on the `enabled:false` path.
269
+ */
270
+ declare function createNoopAnalytics(): Analytics;
271
+
262
272
  /** Create the built-in Segment-spec HTTP sink. */
263
273
  declare function createHttpSink(options: HttpSinkOptions): AnalyticsSink;
264
274
 
@@ -445,4 +455,4 @@ declare const UUID_V4_RE: RegExp;
445
455
  /** True when `value` is a well-formed v4 UUID. */
446
456
  declare function isUuidV4(value: unknown): value is string;
447
457
 
448
- export { type Analytics, type AnalyticsConfig, type AnalyticsContext, type AnalyticsEvent, type AnalyticsEventType, type AnalyticsProperties, type AnalyticsSink, type AnalyticsStorage, type CallOptions, type ConsentAPI, type ConsentConfig, type ConsoleSinkOptions, type CreateMockSinkOptions, DEFAULT_SESSION_TIMEOUT_MS, type HttpSinkOptions, type IdentityConfig, type MockSink, PII_DENY_LIST, PII_EXACT_KEYS, REDACTED, type Redactor, SCHEMA_VERSION, type SessionAPI, type SessionConfig, type SinkDeliverContext, type SinkInitContext, UUID_V4_RE, campaignFingerprint, createAnalytics, createConsent, createConsoleSink, createCookieAdapter, createHttpSink, createIdentity, createLocalStorageAdapter, createMemoryStorage, createMockSink, createRedactor, createSession, isUuidV4, resolveStorage, uuidv4 };
458
+ export { type Analytics, type AnalyticsConfig, type AnalyticsContext, type AnalyticsEvent, type AnalyticsEventType, type AnalyticsProperties, type AnalyticsSink, type AnalyticsStorage, type CallOptions, type ConsentAPI, type ConsentConfig, type ConsoleSinkOptions, type CreateMockSinkOptions, DEFAULT_SESSION_TIMEOUT_MS, type HttpSinkOptions, type IdentityConfig, type MockSink, PII_DENY_LIST, PII_EXACT_KEYS, REDACTED, type Redactor, SCHEMA_VERSION, type SessionAPI, type SessionConfig, type SinkDeliverContext, type SinkInitContext, UUID_V4_RE, campaignFingerprint, createAnalytics, createConsent, createConsoleSink, createCookieAdapter, createHttpSink, createIdentity, createLocalStorageAdapter, createMemoryStorage, createMockSink, createNoopAnalytics, createRedactor, createSession, isUuidV4, resolveStorage, uuidv4 };
@@ -259,6 +259,16 @@ interface Analytics {
259
259
  */
260
260
  declare function createAnalytics(config: AnalyticsConfig): Analytics;
261
261
 
262
+ /**
263
+ * The noop collector returned when `enabled: false`.
264
+ *
265
+ * Every method is an empty function so calls are free and the surrounding
266
+ * vendor/sink code can be tree-shaken out of a production bundle when
267
+ * analytics is compiled off. Kept in its own module so bundlers can drop the
268
+ * live collector entirely on the `enabled:false` path.
269
+ */
270
+ declare function createNoopAnalytics(): Analytics;
271
+
262
272
  /** Create the built-in Segment-spec HTTP sink. */
263
273
  declare function createHttpSink(options: HttpSinkOptions): AnalyticsSink;
264
274
 
@@ -445,4 +455,4 @@ declare const UUID_V4_RE: RegExp;
445
455
  /** True when `value` is a well-formed v4 UUID. */
446
456
  declare function isUuidV4(value: unknown): value is string;
447
457
 
448
- export { type Analytics, type AnalyticsConfig, type AnalyticsContext, type AnalyticsEvent, type AnalyticsEventType, type AnalyticsProperties, type AnalyticsSink, type AnalyticsStorage, type CallOptions, type ConsentAPI, type ConsentConfig, type ConsoleSinkOptions, type CreateMockSinkOptions, DEFAULT_SESSION_TIMEOUT_MS, type HttpSinkOptions, type IdentityConfig, type MockSink, PII_DENY_LIST, PII_EXACT_KEYS, REDACTED, type Redactor, SCHEMA_VERSION, type SessionAPI, type SessionConfig, type SinkDeliverContext, type SinkInitContext, UUID_V4_RE, campaignFingerprint, createAnalytics, createConsent, createConsoleSink, createCookieAdapter, createHttpSink, createIdentity, createLocalStorageAdapter, createMemoryStorage, createMockSink, createRedactor, createSession, isUuidV4, resolveStorage, uuidv4 };
458
+ export { type Analytics, type AnalyticsConfig, type AnalyticsContext, type AnalyticsEvent, type AnalyticsEventType, type AnalyticsProperties, type AnalyticsSink, type AnalyticsStorage, type CallOptions, type ConsentAPI, type ConsentConfig, type ConsoleSinkOptions, type CreateMockSinkOptions, DEFAULT_SESSION_TIMEOUT_MS, type HttpSinkOptions, type IdentityConfig, type MockSink, PII_DENY_LIST, PII_EXACT_KEYS, REDACTED, type Redactor, SCHEMA_VERSION, type SessionAPI, type SessionConfig, type SinkDeliverContext, type SinkInitContext, UUID_V4_RE, campaignFingerprint, createAnalytics, createConsent, createConsoleSink, createCookieAdapter, createHttpSink, createIdentity, createLocalStorageAdapter, createMemoryStorage, createMockSink, createNoopAnalytics, createRedactor, createSession, isUuidV4, resolveStorage, uuidv4 };
@@ -32,7 +32,10 @@ interface UseAnalyticsOptions {
32
32
  * useAnalytics — access the `Analytics` instance from context.
33
33
  *
34
34
  * Pass `{ scope }` to receive a `with(...)` child whose context is merged
35
- * into every event. Must be used within an `<AnalyticsProvider>`.
35
+ * into every event. If called outside an `<AnalyticsProvider>` it does NOT
36
+ * throw: it returns a shared no-op `Analytics` (a dev-only warn-once hint is
37
+ * emitted). Instrumenting a component with analytics must never crash the
38
+ * host (incl. in tests).
36
39
  */
37
40
  declare function useAnalytics(options?: UseAnalyticsOptions): Analytics;
38
41
  /**
@@ -32,7 +32,10 @@ interface UseAnalyticsOptions {
32
32
  * useAnalytics — access the `Analytics` instance from context.
33
33
  *
34
34
  * Pass `{ scope }` to receive a `with(...)` child whose context is merged
35
- * into every event. Must be used within an `<AnalyticsProvider>`.
35
+ * into every event. If called outside an `<AnalyticsProvider>` it does NOT
36
+ * throw: it returns a shared no-op `Analytics` (a dev-only warn-once hint is
37
+ * emitted). Instrumenting a component with analytics must never crash the
38
+ * host (incl. in tests).
36
39
  */
37
40
  declare function useAnalytics(options?: UseAnalyticsOptions): Analytics;
38
41
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@refraction-ui/react",
3
- "version": "0.9.1",
3
+ "version": "0.9.2",
4
4
  "description": "All Refraction UI React components in one package — headless, accessible, zero-dependency",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",