@refraction-ui/react 0.9.1 → 0.9.3

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/form.cjs CHANGED
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  'use strict';
2
3
 
3
4
  var React2 = require('react');
package/dist/form.js CHANGED
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { cva, cn, devWarn } from './chunk-VZLV27H2.js';
2
3
  import * as React2 from 'react';
3
4
  import { useFormContext, useFormState, FormProvider, Controller } from 'react-hook-form';
package/dist/index.cjs CHANGED
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  'use strict';
2
3
 
3
4
  var React11 = require('react');
@@ -45403,6 +45404,10 @@ async function startSessionReplay(options) {
45403
45404
 
45404
45405
  // ../react-analytics/dist/index.js
45405
45406
  var AnalyticsContext = React11__namespace.createContext(null);
45407
+ var noopAnalytics = null;
45408
+ function getNoopAnalytics() {
45409
+ return noopAnalytics ??= createNoopAnalytics();
45410
+ }
45406
45411
  function AnalyticsProvider({ children, value }) {
45407
45412
  const analyticsRef = React11__namespace.useRef(null);
45408
45413
  if (!analyticsRef.current) {
@@ -45416,17 +45421,18 @@ function AnalyticsProvider({ children, value }) {
45416
45421
  }
45417
45422
  function useAnalytics(options) {
45418
45423
  const ctx = React11__namespace.useContext(AnalyticsContext);
45419
- if (!ctx) {
45424
+ let base = ctx;
45425
+ if (!base) {
45420
45426
  devWarn(
45421
45427
  "react-analytics/use-analytics-outside-provider",
45422
- "useAnalytics() was called outside an <AnalyticsProvider>. Wrap your app (or the consuming subtree) in <AnalyticsProvider> so the analytics context is available."
45428
+ "useAnalytics() (or useTrackEvent()) was called outside an <AnalyticsProvider>. Analytics is a no-op here; wrap your app (or the consuming subtree) in <AnalyticsProvider> to enable it."
45423
45429
  );
45424
- throw new Error("useAnalytics must be used within an <AnalyticsProvider>");
45430
+ base = getNoopAnalytics();
45425
45431
  }
45426
45432
  const scope = options?.scope;
45427
45433
  return React11__namespace.useMemo(
45428
- () => scope ? ctx.with(scope) : ctx,
45429
- [ctx, scope]
45434
+ () => scope ? base.with(scope) : base,
45435
+ [base, scope]
45430
45436
  );
45431
45437
  }
45432
45438
  function useTrackEvent(options) {