@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 +1 -0
- package/dist/form.js +1 -0
- package/dist/index.cjs +11 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +11 -5
- package/dist/index.js.map +1 -1
- package/dist/internal/analytics/index.d.cts +11 -1
- package/dist/internal/analytics/index.d.ts +11 -1
- package/dist/internal/react-analytics/index.d.cts +4 -1
- package/dist/internal/react-analytics/index.d.ts +4 -1
- package/dist/theme.cjs +1 -0
- package/dist/theme.js +1 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
'use client';
|
|
1
2
|
import { cn, devWarn, cva, createKeyboardHandler, Keys, createMachine, generateId } from './chunk-VZLV27H2.js';
|
|
2
3
|
export { createFaroSink } from './chunk-XWP763SH.js';
|
|
3
4
|
import * as React11 from 'react';
|
|
@@ -15476,6 +15477,10 @@ async function startSessionReplay(options) {
|
|
|
15476
15477
|
|
|
15477
15478
|
// ../react-analytics/dist/index.js
|
|
15478
15479
|
var AnalyticsContext = React11.createContext(null);
|
|
15480
|
+
var noopAnalytics = null;
|
|
15481
|
+
function getNoopAnalytics() {
|
|
15482
|
+
return noopAnalytics ??= createNoopAnalytics();
|
|
15483
|
+
}
|
|
15479
15484
|
function AnalyticsProvider({ children, value }) {
|
|
15480
15485
|
const analyticsRef = React11.useRef(null);
|
|
15481
15486
|
if (!analyticsRef.current) {
|
|
@@ -15489,17 +15494,18 @@ function AnalyticsProvider({ children, value }) {
|
|
|
15489
15494
|
}
|
|
15490
15495
|
function useAnalytics(options) {
|
|
15491
15496
|
const ctx = React11.useContext(AnalyticsContext);
|
|
15492
|
-
|
|
15497
|
+
let base = ctx;
|
|
15498
|
+
if (!base) {
|
|
15493
15499
|
devWarn(
|
|
15494
15500
|
"react-analytics/use-analytics-outside-provider",
|
|
15495
|
-
"useAnalytics() was called outside an <AnalyticsProvider>.
|
|
15501
|
+
"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."
|
|
15496
15502
|
);
|
|
15497
|
-
|
|
15503
|
+
base = getNoopAnalytics();
|
|
15498
15504
|
}
|
|
15499
15505
|
const scope = options?.scope;
|
|
15500
15506
|
return React11.useMemo(
|
|
15501
|
-
() => scope ?
|
|
15502
|
-
[
|
|
15507
|
+
() => scope ? base.with(scope) : base,
|
|
15508
|
+
[base, scope]
|
|
15503
15509
|
);
|
|
15504
15510
|
}
|
|
15505
15511
|
function useTrackEvent(options) {
|