@bfrs/agentic-components 0.8.7 → 0.8.8

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.
Files changed (27) hide show
  1. package/dist/components/data-display/DataTable/TableSaveView.d.ts +14 -1
  2. package/dist/components/data-display/DataTable/TableSaveView.js +164 -144
  3. package/dist/components/data-display/DataTable/TableSaveView.js.map +1 -1
  4. package/dist/components/data-display/DataTable/TableViewSelector.d.ts +15 -1
  5. package/dist/components/data-display/DataTable/TableViewSelector.js +304 -296
  6. package/dist/components/data-display/DataTable/TableViewSelector.js.map +1 -1
  7. package/dist/components/data-display/DataTable/index.d.ts +1 -0
  8. package/dist/components/data-display/DataTable/savedViewAnalytics.d.ts +109 -0
  9. package/dist/components/data-display/DataTable/savedViewAnalytics.js +140 -0
  10. package/dist/components/data-display/DataTable/savedViewAnalytics.js.map +1 -0
  11. package/dist/components/ui/index.d.ts +2 -0
  12. package/dist/components/ui/providers/BfrsAnalyticsProvider/BfrsAnalyticsProvider.d.ts +18 -0
  13. package/dist/components/ui/providers/BfrsAnalyticsProvider/BfrsAnalyticsProvider.js +12 -0
  14. package/dist/components/ui/providers/BfrsAnalyticsProvider/BfrsAnalyticsProvider.js.map +1 -0
  15. package/dist/components/ui/providers/BfrsAnalyticsProvider/analyticsContext.d.ts +78 -0
  16. package/dist/components/ui/providers/BfrsAnalyticsProvider/analyticsContext.js +41 -0
  17. package/dist/components/ui/providers/BfrsAnalyticsProvider/analyticsContext.js.map +1 -0
  18. package/dist/components/ui/providers/BfrsAnalyticsProvider/index.d.ts +4 -0
  19. package/dist/components/ui/providers/BfrsProvider/BfrsProvider.d.ts +25 -0
  20. package/dist/components/ui/providers/BfrsProvider/BfrsProvider.js +42 -41
  21. package/dist/components/ui/providers/BfrsProvider/BfrsProvider.js.map +1 -1
  22. package/dist/custom-elements.js +9120 -8932
  23. package/dist/custom-elements.js.map +1 -1
  24. package/dist/index.js +224 -213
  25. package/dist/index.js.map +1 -1
  26. package/package.json +1 -1
  27. package/scripts/lint/cli.cjs +6 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"savedViewAnalytics.js","sources":["../../../../src/components/data-display/DataTable/savedViewAnalytics.ts"],"sourcesContent":["import { useMemo } from \"react\";\nimport {\n emitBfrsAnalytics,\n useBfrsAnalyticsSink,\n type BfrsAnalyticsSink\n} from \"@/components/ui/providers/BfrsAnalyticsProvider/analyticsContext\";\nimport { ViewApiError } from \"./saveViewApi\";\n\n/**\n * The saved-view cluster's instrumentation.\n *\n * One place decides which moment is which event, so the four apps that render\n * these components report the same shape instead of four hand-wired\n * approximations of it. The apps supply the registered ids; see\n * `BfrsAnalyticsProvider` for why the moments live here and the names do not.\n *\n * Deliberately NOT emitted:\n * - the selector popover opening and closing. It is a dropdown trigger, not a\n * surface with content worth a reach metric, and it would be the highest\n * volume event in the cluster for no answerable question.\n * - the primary view the selector restores on mount. It is not an action the\n * seller took, and it arrives through the same callback as a real pick —\n * which is exactly why consumers could not tell them apart.\n * - a submission blocked by an empty or reserved name. Both dialogs DISABLE\n * their submit button in those states, and a disabled default button also\n * takes implicit submission (Enter) out of play, so the submit handler's\n * guard is unreachable from the UI. `form_validation_failed` would be an\n * event no seller could fire. The reserved-name warning the dialog shows is\n * field-level feedback, which that event's own definition excludes.\n */\n\n/** Per-moment id overrides. Each defaults to a suffix on the base `id`. */\nexport type SavedViewAnalyticsIds = {\n /** The selector control. Default: `id`. */\n view?: string;\n /** The save dialog and its form. Default: `${id}_save`. */\n save?: string;\n /** The rename dialog and its form. Default: `${id}_rename`. */\n rename?: string;\n /** The delete confirmation. Default: `${id}_delete`. */\n remove?: string;\n /** \"Reset saved filters\". Default: `${id}_reset`. */\n reset?: string;\n /** \"Set as primary\". Default: `${id}_set_primary`. */\n setPrimary?: string;\n /** \"Unset primary\". Default: `${id}_unset_primary`. */\n unsetPrimary?: string;\n};\n\n/**\n * What a component accepts for `analytics`.\n *\n * The string form is the one to reach for: `analytics=\"finance_saved_view\"` is\n * the registered id, and every other id derives from it. The object form exists\n * for the cases that genuinely differ — an app keeping ids it already ships, a\n * funnel name that is not the control's id, or a per-instance sink.\n */\nexport type SavedViewAnalyticsInput = string | SavedViewAnalyticsConfig;\n\nexport type SavedViewAnalyticsConfig = {\n /**\n * Stable registered id for this saved-view control, e.g. `finance_saved_view`.\n * A code from the app's analytics vocabulary — never a label or a screen title.\n */\n id: string;\n /**\n * Registered funnel id for saving a view. Defaults to `id`, so the outcome\n * events work out of the box; pass `null` to turn them off when the app has\n * no funnel registered under that name.\n */\n flow?: string | null;\n /** Containing surface, sent as `parent_element`. */\n parentElement?: string;\n /** Where this instance sits, sent as `entry_point`. */\n entryPoint?: string;\n /** Id overrides for individual moments. */\n ids?: SavedViewAnalyticsIds;\n /** Sink override. Defaults to the nearest `BfrsProvider`/`BfrsAnalyticsProvider`. */\n emit?: BfrsAnalyticsSink;\n};\n\n/** How an overlay in this cluster was dismissed. */\nexport type SavedViewCloseMethod = \"close_icon\" | \"cancel\" | \"outside\" | \"esc\" | \"completed\";\n\nexport type SavedViewAnalytics = {\n /** A seller picked a saved view. Never the mount-time restore. */\n viewSelected: () => void;\n /** A seller picked the built-in, unsaved default view. */\n defaultViewSelected: () => void;\n setPrimary: () => void;\n unsetPrimary: () => void;\n renameOpened: () => void;\n renameDismissed: (closeMethod: SavedViewCloseMethod) => void;\n renameSubmitted: () => void;\n deleteOpened: () => void;\n deleteDismissed: (closeMethod: SavedViewCloseMethod) => void;\n deleteConfirmed: () => void;\n resetFilters: () => void;\n saveOpened: () => void;\n saveDismissed: (closeMethod: SavedViewCloseMethod) => void;\n /** The save request was dispatched. Intent — it asserts nothing about the result. */\n saveSubmitted: () => void;\n saveCompleted: () => void;\n /** The backend answered with an existing view instead of creating one. */\n saveRejectedAsDuplicate: () => void;\n saveFailed: (error: unknown) => void;\n};\n\n/**\n * Observed outcome of a failed save.\n *\n * Mirrors the platform's own classification: an answered refusal is `rejected`,\n * an answer we cannot read as a verdict (408 or 5xx) is `unknown` because the\n * view may well have been created server-side, and no readable response at all\n * is `network_error`. The distinction matters here specifically — a 504 that\n * created the view must not be counted as a confirmed failure.\n */\nfunction resultStateForError(error: unknown): \"rejected\" | \"unknown\" | \"network_error\" {\n const status = error instanceof ViewApiError ? error.status : undefined;\n\n if (status === undefined) return \"network_error\";\n if (status === 408 || status >= 500) return \"unknown\";\n if (status >= 400) return \"rejected\";\n return \"unknown\";\n}\n\nconst noop = () => {};\n\n/** An emitter that does nothing, for a component with no analytics config. */\nconst SILENT: SavedViewAnalytics = {\n viewSelected: noop,\n defaultViewSelected: noop,\n setPrimary: noop,\n unsetPrimary: noop,\n renameOpened: noop,\n renameDismissed: noop,\n renameSubmitted: noop,\n deleteOpened: noop,\n deleteDismissed: noop,\n deleteConfirmed: noop,\n resetFilters: noop,\n saveOpened: noop,\n saveDismissed: noop,\n saveSubmitted: noop,\n saveCompleted: noop,\n saveRejectedAsDuplicate: noop,\n saveFailed: noop\n};\n\n/** A code these components can use as an id: lower_snake_case, bounded. */\nconst DERIVABLE_SCREEN_NAME = /^[a-z0-9]+(?:[._-][a-z0-9]+)*$/;\n\n/**\n * The id to report under when the app passed nothing.\n *\n * Adoption should be an `npm upgrade` and nothing else, so an app that passes\n * no `analytics` at all still reports — under an id derived from the\n * `screenName` these components already require for their store. `.` and `-`\n * become `_`, because a GA4 parameter value is a lower_snake_case code.\n *\n * screenName \"finance_invoices\" → finance_invoices_saved_view\n * screenName \"ndr_unsuccessful\" → ndr_unsuccessful_saved_view\n *\n * Two consequences worth knowing, both fixed by passing `analytics` explicitly:\n * - the id follows the screen, so a per-tab `screenName` produces a per-tab id.\n * An app that wants ONE id across its tabs passes one (`analytics=\"ndr_saved_view\"`).\n * - the derived id is not something anyone registered in the app's analytics\n * vocabulary. It reports from the moment of the upgrade; registering it (or\n * replacing it with a registered one) is the follow-up, not a blocker.\n */\nfunction deriveIdFromScreenName(screenName: string | undefined): string | undefined {\n if (!screenName) return undefined;\n const code = screenName.trim().toLowerCase();\n if (!DERIVABLE_SCREEN_NAME.test(code)) return undefined;\n const normalized = code.replace(/[.-]/g, \"_\");\n return `${normalized}_saved_view`.length <= 60 ? `${normalized}_saved_view` : undefined;\n}\n\n/**\n * `\"finance_saved_view\"` → `{ id: \"finance_saved_view\" }`, and nothing at all →\n * an id derived from `screenName` so an upgrade is the whole integration.\n */\nexport function toSavedViewAnalyticsConfig(\n input: SavedViewAnalyticsInput | undefined,\n screenName?: string\n): SavedViewAnalyticsConfig | undefined {\n if (typeof input === \"string\") return { id: input };\n if (input) return input.id ? input : { ...input, id: deriveIdFromScreenName(screenName) ?? \"\" };\n\n const derived = deriveIdFromScreenName(screenName);\n return derived ? { id: derived } : undefined;\n}\n\nexport function createSavedViewAnalytics(\n input: SavedViewAnalyticsInput | undefined,\n contextSink: BfrsAnalyticsSink | null,\n screenName?: string\n): SavedViewAnalytics {\n const config = toSavedViewAnalyticsConfig(input, screenName);\n const sink = config?.emit ?? contextSink;\n if (!config || !config.id || !sink) return SILENT;\n\n const { id, parentElement, entryPoint, ids } = config;\n // The funnel defaults to the control's own id, so the outcome events are not\n // something a caller has to remember to switch on. `flow: null` opts out.\n const flow = config.flow === null ? undefined : (config.flow ?? id);\n const viewId = ids?.view ?? id;\n const saveId = ids?.save ?? `${id}_save`;\n const renameId = ids?.rename ?? `${id}_rename`;\n const removeId = ids?.remove ?? `${id}_delete`;\n const resetId = ids?.reset ?? `${id}_reset`;\n const setPrimaryId = ids?.setPrimary ?? `${id}_set_primary`;\n const unsetPrimaryId = ids?.unsetPrimary ?? `${id}_unset_primary`;\n\n const cta = (elementName: string, ctaAction?: string) =>\n emitBfrsAnalytics(sink, \"cta_clicked\", {\n element_name: elementName,\n element_type: \"cta\",\n cta_action: ctaAction,\n parent_element: parentElement ?? viewId,\n entry_point: entryPoint\n });\n\n const overlayShown = (elementName: string) =>\n emitBfrsAnalytics(sink, \"modal_displayed\", {\n element_name: elementName,\n element_type: \"modal\",\n parent_element: parentElement ?? viewId,\n entry_point: entryPoint\n });\n\n const overlayDismissed = (elementName: string, closeMethod: SavedViewCloseMethod) =>\n emitBfrsAnalytics(sink, \"modal_dismissed\", {\n element_name: elementName,\n element_type: \"modal\",\n close_method: closeMethod\n });\n\n const formSubmitted = (elementName: string) =>\n emitBfrsAnalytics(sink, \"form_submitted\", {\n element_name: elementName,\n element_type: \"form\",\n parent_element: parentElement ?? viewId\n });\n\n const picked = (selectedOption: string) =>\n emitBfrsAnalytics(sink, \"dropdown_option_selected\", {\n element_name: viewId,\n element_type: \"dropdown\",\n selected_option: selectedOption,\n parent_element: parentElement,\n entry_point: entryPoint\n });\n\n return {\n // `selected_option` is which KIND of view was applied, never its name: a\n // saved view's name is the seller's own words.\n viewSelected: () => picked(\"saved_view\"),\n defaultViewSelected: () => picked(\"default_view\"),\n setPrimary: () => cta(setPrimaryId, \"set_primary\"),\n unsetPrimary: () => cta(unsetPrimaryId, \"unset_primary\"),\n renameOpened: () => overlayShown(renameId),\n renameDismissed: (closeMethod) => overlayDismissed(renameId, closeMethod),\n renameSubmitted: () => formSubmitted(renameId),\n deleteOpened: () => overlayShown(removeId),\n deleteDismissed: (closeMethod) => overlayDismissed(removeId, closeMethod),\n deleteConfirmed: () => cta(removeId, \"delete\"),\n resetFilters: () => cta(resetId, \"reset\"),\n saveOpened: () => overlayShown(saveId),\n saveDismissed: (closeMethod) => overlayDismissed(saveId, closeMethod),\n saveSubmitted: () => formSubmitted(saveId),\n saveCompleted: () => {\n if (!flow) return;\n emitBfrsAnalytics(sink, \"workflow_completed\", { flow_name: flow, result_state: \"success\" });\n },\n // A backend \"soft duplicate\" echoes back a pre-existing view instead of\n // creating one. It is an answered refusal, not a save — counting it as a\n // success would overstate the funnel it completes.\n saveRejectedAsDuplicate: () => {\n if (!flow) return;\n emitBfrsAnalytics(sink, \"workflow_failed\", {\n flow_name: flow,\n result_state: \"rejected\",\n error_code: \"duplicate_name\"\n });\n },\n saveFailed: (error) => {\n if (!flow) return;\n emitBfrsAnalytics(sink, \"workflow_failed\", {\n flow_name: flow,\n result_state: resultStateForError(error)\n });\n }\n };\n}\n\n/**\n * The saved-view emitter for one component instance.\n *\n * `screenName` is the component's own prop. Passing it here is what makes the\n * zero-config case work: with no `analytics` prop and a host bridge installed,\n * the id is derived from it.\n */\nexport function useSavedViewAnalytics(\n input: SavedViewAnalyticsInput | undefined,\n screenName?: string\n): SavedViewAnalytics {\n const contextSink = useBfrsAnalyticsSink();\n const config = toSavedViewAnalyticsConfig(input, screenName);\n\n return useMemo(\n () => createSavedViewAnalytics(config, contextSink),\n // The config is an inline object at every call site, so depend on its\n // fields rather than its identity: a new object each render would otherwise\n // rebuild the emitter on every keystroke in the name field.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [\n contextSink,\n screenName,\n config?.emit,\n config?.id,\n config?.flow,\n config?.parentElement,\n config?.entryPoint,\n config?.ids?.view,\n config?.ids?.save,\n config?.ids?.rename,\n config?.ids?.remove,\n config?.ids?.reset,\n config?.ids?.setPrimary,\n config?.ids?.unsetPrimary\n ]\n );\n}\n"],"names":["resultStateForError","error","status","ViewApiError","noop","SILENT","DERIVABLE_SCREEN_NAME","deriveIdFromScreenName","screenName","code","normalized","toSavedViewAnalyticsConfig","input","derived","createSavedViewAnalytics","contextSink","config","sink","id","parentElement","entryPoint","ids","flow","viewId","saveId","renameId","removeId","resetId","setPrimaryId","unsetPrimaryId","cta","elementName","ctaAction","emitBfrsAnalytics","overlayShown","overlayDismissed","closeMethod","formSubmitted","picked","selectedOption","useSavedViewAnalytics","useBfrsAnalyticsSink","useMemo","_a","_b","_c","_d","_e","_f","_g"],"mappings":";;;AAqHA,SAASA,EAAoBC,GAA0D;AACrF,QAAMC,IAASD,aAAiBE,IAAeF,EAAM,SAAS;AAE9D,SAAIC,MAAW,SAAkB,kBAC7BA,MAAW,OAAOA,KAAU,MAAY,YACxCA,KAAU,MAAY,aACnB;AACT;AAEA,MAAME,IAAO,MAAM;AAAC,GAGdC,IAA6B;AAAA,EACjC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AAA,MACRA,KAAA,gBAAAA,EAAQ;AAAA,MACRA,KAAA,gBAAAA,EAAQ;AAAA,MACRA,KAAA,gBAAAA,EAAQ;AAAA,MACRA,KAAA,gBAAAA,EAAQ;AAAA,OACR2B,IAAA3B,KAAA,gBAAAA,EAAQ,QAAR,gBAAA2B,EAAa;AAAA,OACbC,IAAA5B,KAAA,gBAAAA,EAAQ,QAAR,gBAAA4B,EAAa;AAAA,OACbC,IAAA7B,KAAA,gBAAAA,EAAQ,QAAR,gBAAA6B,EAAa;AAAA,OACbC,IAAA9B,KAAA,gBAAAA,EAAQ,QAAR,gBAAA8B,EAAa;AAAA,OACbC,IAAA/B,KAAA,gBAAAA,EAAQ,QAAR,gBAAA+B,EAAa;AAAA,OACbC,IAAAhC,KAAA,gBAAAA,EAAQ,QAAR,gBAAAgC,EAAa;AAAA,OACbC,IAAAjC,KAAA,gBAAAA,EAAQ,QAAR,gBAAAiC,EAAa;AAAA,IAAA;AAAA,EACf;AAEJ;"}
@@ -1,5 +1,7 @@
1
1
  export { BfrsProvider } from './providers/BfrsProvider';
2
2
  export type { BfrsColorScheme, BfrsProviderProps } from './providers/BfrsProvider';
3
+ export { BfrsAnalyticsProvider, emitBfrsAnalytics, getBfrsAnalyticsSink, setBfrsAnalyticsSink, useBfrsAnalyticsSink } from './providers/BfrsAnalyticsProvider';
4
+ export type { BfrsAnalyticsEvent, BfrsAnalyticsEventName, BfrsAnalyticsProperties, BfrsAnalyticsProviderProps, BfrsAnalyticsSink } from './providers/BfrsAnalyticsProvider';
3
5
  export * from './primitives/Box';
4
6
  export * from './primitives/Container';
5
7
  export * from './primitives/Paper';
@@ -0,0 +1,18 @@
1
+ import { ReactNode } from 'react';
2
+ import { BfrsAnalyticsSink } from './analyticsContext';
3
+ export type BfrsAnalyticsProviderProps = {
4
+ /** Where to send library events. Omitted or null inherits the nearest provider. */
5
+ emit?: BfrsAnalyticsSink | null;
6
+ children: ReactNode;
7
+ };
8
+ /**
9
+ * Makes a sink available to every library component below it.
10
+ *
11
+ * `BfrsProvider` renders this for its `analytics` prop, so an app that already
12
+ * has a provider wires reporting in one place. See `analyticsContext.ts` for
13
+ * why library components emit at all.
14
+ */
15
+ export declare function BfrsAnalyticsProvider({ emit, children }: BfrsAnalyticsProviderProps): import("react/jsx-runtime").JSX.Element;
16
+ export declare namespace BfrsAnalyticsProvider {
17
+ var displayName: string;
18
+ }
@@ -0,0 +1,12 @@
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import { useContext as n, useMemo as f } from "react";
3
+ import { BfrsAnalyticsContext as t } from "./analyticsContext.js";
4
+ function m({ emit: r, children: e }) {
5
+ const o = n(t), i = f(() => r ?? o, [r, o]);
6
+ return /* @__PURE__ */ s(t.Provider, { value: i, children: e });
7
+ }
8
+ m.displayName = "BfrsAnalyticsProvider";
9
+ export {
10
+ m as BfrsAnalyticsProvider
11
+ };
12
+ //# sourceMappingURL=BfrsAnalyticsProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BfrsAnalyticsProvider.js","sources":["../../../../../src/components/ui/providers/BfrsAnalyticsProvider/BfrsAnalyticsProvider.tsx"],"sourcesContent":["import { useContext, useMemo, type ReactNode } from \"react\";\nimport { BfrsAnalyticsContext, type BfrsAnalyticsSink } from \"./analyticsContext\";\n\nexport type BfrsAnalyticsProviderProps = {\n /** Where to send library events. Omitted or null inherits the nearest provider. */\n emit?: BfrsAnalyticsSink | null;\n children: ReactNode;\n};\n\n/**\n * Makes a sink available to every library component below it.\n *\n * `BfrsProvider` renders this for its `analytics` prop, so an app that already\n * has a provider wires reporting in one place. See `analyticsContext.ts` for\n * why library components emit at all.\n */\nexport function BfrsAnalyticsProvider({ emit, children }: BfrsAnalyticsProviderProps) {\n const inherited = useContext(BfrsAnalyticsContext);\n // An omitted `emit` inherits rather than blanking the sink, so nesting a\n // provider for theming cannot silently switch reporting off.\n const value = useMemo(() => emit ?? inherited, [emit, inherited]);\n\n return <BfrsAnalyticsContext.Provider value={value}>{children}</BfrsAnalyticsContext.Provider>;\n}\n\nBfrsAnalyticsProvider.displayName = \"BfrsAnalyticsProvider\";\n"],"names":["BfrsAnalyticsProvider","emit","children","inherited","useContext","BfrsAnalyticsContext","value","useMemo","jsx"],"mappings":";;;AAgBO,SAASA,EAAsB,EAAE,MAAAC,GAAM,UAAAC,KAAwC;AACpF,QAAMC,IAAYC,EAAWC,CAAoB,GAG3CC,IAAQC,EAAQ,MAAMN,KAAQE,GAAW,CAACF,GAAME,CAAS,CAAC;AAEhE,SAAO,gBAAAK,EAACH,EAAqB,UAArB,EAA8B,OAAAC,GAAe,UAAAJ,EAAA,CAAS;AAChE;AAEAF,EAAsB,cAAc;"}
@@ -0,0 +1,78 @@
1
+ /**
2
+ * Analytics for library-owned interactions.
3
+ *
4
+ * ## Why the library emits at all
5
+ *
6
+ * The usage guide's rule — "the library should not know analytics events" —
7
+ * holds for anything the consumer can observe for itself. Saved views are the
8
+ * case where it cannot:
9
+ *
10
+ * - `TableSaveView` dispatches the request through its own store when
11
+ * `screenName` is supplied, so `onSave` never fires and the consumer cannot
12
+ * see the submit at all. Reporting a submission from `onSaved` would be a
13
+ * different fact (an outcome) wearing the submit's name.
14
+ * - A submission blocked by the component's own validation (empty or reserved
15
+ * name) produces no callback at all, so nobody could count it.
16
+ * - `TableViewSelector` calls `onValueChange` for BOTH a seller's pick and its
17
+ * own mount-time restore of the primary view, in an identical shape. Every
18
+ * consumer had to guess with a heuristic; the component knows for certain.
19
+ *
20
+ * So the component owns the MOMENTS, which only it can observe correctly, and
21
+ * the consumer owns the VOCABULARY: it passes the registered element ids and a
22
+ * sink, and nothing here ever touches `gtag`, `dataLayer` or a provider SDK.
23
+ * There is exactly one GA4 tag in the platform and it belongs to the host; this
24
+ * module hands the host an event and is finished.
25
+ */
26
+ /**
27
+ * The canonical event names the library may emit — a closed set, matching the
28
+ * platform registry. The host validates every name and property it receives, so
29
+ * an unknown name here would be dropped there with a diagnostic rather than
30
+ * silently reported.
31
+ *
32
+ * `form_validation_failed` is deliberately absent: the only validation these
33
+ * components apply disables the submit control, so no blocked attempt can
34
+ * occur. Add it when a component can actually observe one.
35
+ */
36
+ export type BfrsAnalyticsEventName = "cta_clicked" | "element_clicked" | "modal_displayed" | "modal_dismissed" | "dropdown_option_selected" | "form_submitted" | "workflow_completed" | "workflow_failed";
37
+ /**
38
+ * Event properties. Values are codes, counts and booleans only.
39
+ *
40
+ * Nothing in this file may pass a view NAME, a seller's typed text, a label, a
41
+ * URL or an identifier from an unbounded list: the ids are registered codes the
42
+ * consumer supplies, and a saved view's name is the seller's own words.
43
+ */
44
+ export type BfrsAnalyticsProperties = Record<string, string | number | boolean | undefined>;
45
+ export type BfrsAnalyticsEvent = {
46
+ name: BfrsAnalyticsEventName;
47
+ properties: BfrsAnalyticsProperties;
48
+ };
49
+ /**
50
+ * Where library events go. A consumer wires this once:
51
+ *
52
+ * ```tsx
53
+ * <BfrsProvider analytics={(event) => analytics.track(event.name, event.properties)}>
54
+ * ```
55
+ */
56
+ export type BfrsAnalyticsSink = (event: BfrsAnalyticsEvent) => void;
57
+ export declare const BfrsAnalyticsContext: import('react').Context<BfrsAnalyticsSink | null>;
58
+ export declare function setBfrsAnalyticsSink(sink: BfrsAnalyticsSink | null): void;
59
+ export declare function getBfrsAnalyticsSink(): BfrsAnalyticsSink | null;
60
+ /**
61
+ * The sink to use, most specific first:
62
+ *
63
+ * 1. the nearest `BfrsProvider`/`BfrsAnalyticsProvider`
64
+ * 2. `setBfrsAnalyticsSink`, if an app chose to set one
65
+ * 3. the host bridge, discovered — which is why a platform app needs neither
66
+ * of the above
67
+ *
68
+ * Null when none of them is present, and then nothing is emitted.
69
+ */
70
+ export declare function useBfrsAnalyticsSink(): BfrsAnalyticsSink | null;
71
+ /**
72
+ * Send one event, swallowing anything the sink throws.
73
+ *
74
+ * Reporting is never allowed to break the interaction it is reporting: a sink
75
+ * that throws (a mis-wired host, a consent gate, a provider SDK that is not
76
+ * loaded yet) must not take the save dialog down with it.
77
+ */
78
+ export declare function emitBfrsAnalytics(sink: BfrsAnalyticsSink | null | undefined, name: BfrsAnalyticsEventName, properties: BfrsAnalyticsProperties): void;
@@ -0,0 +1,41 @@
1
+ import { useContext as s, createContext as f } from "react";
2
+ const l = f(null), u = ["__shiprocketAnalyticsBridge", "__bfrsAnalytics"];
3
+ function a() {
4
+ if (typeof globalThis > "u") return null;
5
+ for (const t of u) {
6
+ const n = globalThis[t], e = n == null ? void 0 : n.trackLibraryEvent;
7
+ if (typeof e == "function")
8
+ return (r) => {
9
+ e.call(n, r.name, r.properties);
10
+ };
11
+ }
12
+ return null;
13
+ }
14
+ let o = null;
15
+ function p(t) {
16
+ o = t;
17
+ }
18
+ function k() {
19
+ return o;
20
+ }
21
+ function A() {
22
+ return s(l) ?? o ?? a();
23
+ }
24
+ function B(t, n, e) {
25
+ if (!t) return;
26
+ const r = {};
27
+ for (const [c, i] of Object.entries(e))
28
+ i !== void 0 && (r[c] = i);
29
+ try {
30
+ t({ name: n, properties: r });
31
+ } catch {
32
+ }
33
+ }
34
+ export {
35
+ l as BfrsAnalyticsContext,
36
+ B as emitBfrsAnalytics,
37
+ k as getBfrsAnalyticsSink,
38
+ p as setBfrsAnalyticsSink,
39
+ A as useBfrsAnalyticsSink
40
+ };
41
+ //# sourceMappingURL=analyticsContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analyticsContext.js","sources":["../../../../../src/components/ui/providers/BfrsAnalyticsProvider/analyticsContext.ts"],"sourcesContent":["import { createContext, useContext } from \"react\";\n\n/**\n * Analytics for library-owned interactions.\n *\n * ## Why the library emits at all\n *\n * The usage guide's rule — \"the library should not know analytics events\" —\n * holds for anything the consumer can observe for itself. Saved views are the\n * case where it cannot:\n *\n * - `TableSaveView` dispatches the request through its own store when\n * `screenName` is supplied, so `onSave` never fires and the consumer cannot\n * see the submit at all. Reporting a submission from `onSaved` would be a\n * different fact (an outcome) wearing the submit's name.\n * - A submission blocked by the component's own validation (empty or reserved\n * name) produces no callback at all, so nobody could count it.\n * - `TableViewSelector` calls `onValueChange` for BOTH a seller's pick and its\n * own mount-time restore of the primary view, in an identical shape. Every\n * consumer had to guess with a heuristic; the component knows for certain.\n *\n * So the component owns the MOMENTS, which only it can observe correctly, and\n * the consumer owns the VOCABULARY: it passes the registered element ids and a\n * sink, and nothing here ever touches `gtag`, `dataLayer` or a provider SDK.\n * There is exactly one GA4 tag in the platform and it belongs to the host; this\n * module hands the host an event and is finished.\n */\n\n/**\n * The canonical event names the library may emit — a closed set, matching the\n * platform registry. The host validates every name and property it receives, so\n * an unknown name here would be dropped there with a diagnostic rather than\n * silently reported.\n *\n * `form_validation_failed` is deliberately absent: the only validation these\n * components apply disables the submit control, so no blocked attempt can\n * occur. Add it when a component can actually observe one.\n */\nexport type BfrsAnalyticsEventName =\n | \"cta_clicked\"\n | \"element_clicked\"\n | \"modal_displayed\"\n | \"modal_dismissed\"\n | \"dropdown_option_selected\"\n | \"form_submitted\"\n | \"workflow_completed\"\n | \"workflow_failed\";\n\n/**\n * Event properties. Values are codes, counts and booleans only.\n *\n * Nothing in this file may pass a view NAME, a seller's typed text, a label, a\n * URL or an identifier from an unbounded list: the ids are registered codes the\n * consumer supplies, and a saved view's name is the seller's own words.\n */\nexport type BfrsAnalyticsProperties = Record<string, string | number | boolean | undefined>;\n\nexport type BfrsAnalyticsEvent = {\n name: BfrsAnalyticsEventName;\n properties: BfrsAnalyticsProperties;\n};\n\n/**\n * Where library events go. A consumer wires this once:\n *\n * ```tsx\n * <BfrsProvider analytics={(event) => analytics.track(event.name, event.properties)}>\n * ```\n */\nexport type BfrsAnalyticsSink = (event: BfrsAnalyticsEvent) => void;\n\nexport const BfrsAnalyticsContext = createContext<BfrsAnalyticsSink | null>(null);\n\n/**\n * The host bridge a platform app installs at bootstrap, as far as this library\n * needs to know it.\n *\n * `trackLibraryEvent` takes no origin: the host derives `module` and\n * `screen_name` from the live route, because a component library is rendered on\n * every module's screens from one build and cannot state an origin of its own.\n */\ntype HostAnalyticsBridgeLike = {\n trackLibraryEvent?: (event: string, properties?: Record<string, unknown>) => void;\n};\n\nconst HOST_BRIDGE_KEYS = [\"__shiprocketAnalyticsBridge\", \"__bfrsAnalytics\"] as const;\n\n/**\n * Find the host's own analytics entry point, so an app wires NOTHING.\n *\n * This is the last resort in the precedence list below, and it is deliberately\n * narrow: it looks only for a named method on a known host bridge, calls it\n * with an event the components already validate against the canonical names,\n * and does nothing at all when no bridge is there (a standalone Storybook, a\n * consumer that is not a platform app, a unit test).\n *\n * The honest tradeoff: a library reading a global is less explicit than a prop.\n * It is justified here because the alternative is every app repeating one line\n * that can only have one answer, and because the thing it reaches for is a\n * documented host contract rather than `gtag` or `dataLayer` — the library\n * still never touches a tag.\n */\nfunction discoverHostSink(): BfrsAnalyticsSink | null {\n if (typeof globalThis === \"undefined\") return null;\n\n for (const key of HOST_BRIDGE_KEYS) {\n const bridge = (globalThis as unknown as Record<string, HostAnalyticsBridgeLike | undefined>)[key];\n const track = bridge?.trackLibraryEvent;\n if (typeof track !== \"function\") continue;\n return (event) => {\n track.call(bridge, event.name, event.properties);\n };\n }\n\n return null;\n}\n\n/**\n * The app-wide sink, set once by the host instead of threaded through props.\n *\n * Why a global and not just the provider prop: an app mounts these components\n * in several trees (a filter row, a table toolbar, a portaled drawer), and some\n * of those are portaled outside the provider. Making every one of them carry an\n * `analytics` prop — or wrapping each in a provider — is friction that buys\n * nothing, because there is exactly one answer per app anyway.\n *\n * The host sets it once at bootstrap:\n *\n * ```ts\n * setBfrsAnalyticsSink((event) => analytics.track(event.name, event.properties));\n * ```\n *\n * Precedence, most specific first: a component's own `analytics.emit` → the\n * nearest `BfrsProvider`/`BfrsAnalyticsProvider` → this. Pass `null` to clear\n * it (tests, teardown). It is module state, not `window`, so two bundles on one\n * page keep their own and nothing leaks between them.\n */\nlet appSink: BfrsAnalyticsSink | null = null;\n\nexport function setBfrsAnalyticsSink(sink: BfrsAnalyticsSink | null): void {\n appSink = sink;\n}\n\nexport function getBfrsAnalyticsSink(): BfrsAnalyticsSink | null {\n return appSink;\n}\n\n/**\n * The sink to use, most specific first:\n *\n * 1. the nearest `BfrsProvider`/`BfrsAnalyticsProvider`\n * 2. `setBfrsAnalyticsSink`, if an app chose to set one\n * 3. the host bridge, discovered — which is why a platform app needs neither\n * of the above\n *\n * Null when none of them is present, and then nothing is emitted.\n */\nexport function useBfrsAnalyticsSink(): BfrsAnalyticsSink | null {\n return useContext(BfrsAnalyticsContext) ?? appSink ?? discoverHostSink();\n}\n\n/**\n * Send one event, swallowing anything the sink throws.\n *\n * Reporting is never allowed to break the interaction it is reporting: a sink\n * that throws (a mis-wired host, a consent gate, a provider SDK that is not\n * loaded yet) must not take the save dialog down with it.\n */\nexport function emitBfrsAnalytics(\n sink: BfrsAnalyticsSink | null | undefined,\n name: BfrsAnalyticsEventName,\n properties: BfrsAnalyticsProperties\n): void {\n if (!sink) return;\n\n const payload: BfrsAnalyticsProperties = {};\n for (const [key, value] of Object.entries(properties)) {\n if (value !== undefined) payload[key] = value;\n }\n\n try {\n sink({ name, properties: payload });\n } catch {\n /* reporting must never throw into a product interaction */\n }\n}\n"],"names":["BfrsAnalyticsContext","createContext","HOST_BRIDGE_KEYS","discoverHostSink","key","bridge","track","event","appSink","setBfrsAnalyticsSink","sink","getBfrsAnalyticsSink","useBfrsAnalyticsSink","useContext","emitBfrsAnalytics","name","properties","payload","value"],"mappings":";AAuEO,MAAMA,IAAuBC,EAAwC,IAAI,GAc1EC,IAAmB,CAAC,+BAA+B,iBAAiB;AAiB1E,SAASC,IAA6C;AACpD,MAAI,OAAO,aAAe,IAAa,QAAO;AAE9C,aAAWC,KAAOF,GAAkB;AAClC,UAAMG,IAAU,WAA8ED,CAAG,GAC3FE,IAAQD,KAAA,gBAAAA,EAAQ;AACtB,QAAI,OAAOC,KAAU;AACrB,aAAO,CAACC,MAAU;AAChB,QAAAD,EAAM,KAAKD,GAAQE,EAAM,MAAMA,EAAM,UAAU;AAAA,MACjD;AAAA,EACF;AAEA,SAAO;AACT;AAsBA,IAAIC,IAAoC;AAEjC,SAASC,EAAqBC,GAAsC;AACzE,EAAAF,IAAUE;AACZ;AAEO,SAASC,IAAiD;AAC/D,SAAOH;AACT;AAYO,SAASI,IAAiD;AAC/D,SAAOC,EAAWb,CAAoB,KAAKQ,KAAWL,EAAA;AACxD;AASO,SAASW,EACdJ,GACAK,GACAC,GACM;AACN,MAAI,CAACN,EAAM;AAEX,QAAMO,IAAmC,CAAA;AACzC,aAAW,CAACb,GAAKc,CAAK,KAAK,OAAO,QAAQF,CAAU;AAClD,IAAIE,MAAU,WAAWD,EAAQb,CAAG,IAAIc;AAG1C,MAAI;AACF,IAAAR,EAAK,EAAE,MAAAK,GAAM,YAAYE,EAAA,CAAS;AAAA,EACpC,QAAQ;AAAA,EAER;AACF;"}
@@ -0,0 +1,4 @@
1
+ export { BfrsAnalyticsProvider } from './BfrsAnalyticsProvider';
2
+ export type { BfrsAnalyticsProviderProps } from './BfrsAnalyticsProvider';
3
+ export { emitBfrsAnalytics, getBfrsAnalyticsSink, setBfrsAnalyticsSink, useBfrsAnalyticsSink } from './analyticsContext';
4
+ export type { BfrsAnalyticsEvent, BfrsAnalyticsEventName, BfrsAnalyticsProperties, BfrsAnalyticsSink } from './analyticsContext';
@@ -1,13 +1,38 @@
1
1
  import { HTMLAttributes, ReactNode } from 'react';
2
2
  import { AgenticThemeOverrides } from '../../../../theme';
3
+ import { BfrsAnalyticsSink } from '../BfrsAnalyticsProvider/analyticsContext';
3
4
  export type BfrsColorScheme = "light" | "dark";
4
5
  export type BfrsProviderProps = HTMLAttributes<HTMLDivElement> & {
5
6
  theme?: AgenticThemeOverrides;
6
7
  colorScheme?: BfrsColorScheme;
8
+ /**
9
+ * Where library-owned interactions are reported, wired once per app:
10
+ *
11
+ * ```tsx
12
+ * <BfrsProvider analytics={(event) => analytics.track(event.name, event.properties)}>
13
+ * ```
14
+ *
15
+ * Nothing in the library touches `gtag`, `dataLayer` or a provider SDK — it
16
+ * hands the event here and the app decides what happens to it. Omitted, the
17
+ * library reports nothing.
18
+ */
19
+ analytics?: BfrsAnalyticsSink;
7
20
  };
8
21
  export declare const BfrsProvider: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
9
22
  theme?: AgenticThemeOverrides;
10
23
  colorScheme?: BfrsColorScheme;
24
+ /**
25
+ * Where library-owned interactions are reported, wired once per app:
26
+ *
27
+ * ```tsx
28
+ * <BfrsProvider analytics={(event) => analytics.track(event.name, event.properties)}>
29
+ * ```
30
+ *
31
+ * Nothing in the library touches `gtag`, `dataLayer` or a provider SDK — it
32
+ * hands the event here and the app decides what happens to it. Omitted, the
33
+ * library reports nothing.
34
+ */
35
+ analytics?: BfrsAnalyticsSink;
11
36
  } & import('react').RefAttributes<HTMLDivElement>>;
12
37
  export declare function BfrsStyleScope({ children, root, colorScheme }: {
13
38
  children: ReactNode;
@@ -1,73 +1,74 @@
1
- import { jsx as i } from "react/jsx-runtime";
2
- import { forwardRef as v, useState as m, useMemo as l, useCallback as S, useContext as g, useEffect as x, createContext as P } from "react";
3
- import { cn as B } from "../../../../lib/cn.js";
4
- import { ensureDocumentStyles as C } from "../../../../lib/documentStyles.js";
5
- import { createAgenticThemeVariables as R } from "../../../../theme/overrides.js";
6
- const d = P({
1
+ import { jsx as l } from "react/jsx-runtime";
2
+ import { forwardRef as S, useState as d, useMemo as i, useCallback as g, useContext as P, useEffect as x, createContext as B } from "react";
3
+ import { cn as C } from "../../../../lib/cn.js";
4
+ import { ensureDocumentStyles as R } from "../../../../lib/documentStyles.js";
5
+ import { createAgenticThemeVariables as M } from "../../../../theme/overrides.js";
6
+ import { BfrsAnalyticsProvider as N } from "../BfrsAnalyticsProvider/BfrsAnalyticsProvider.js";
7
+ const y = B({
7
8
  root: null
8
9
  });
9
- function M(e, t) {
10
- if (e) {
11
- if (typeof e == "function") {
12
- e(t);
10
+ function T(t, e) {
11
+ if (t) {
12
+ if (typeof t == "function") {
13
+ t(e);
13
14
  return;
14
15
  }
15
- e.current = t;
16
+ t.current = e;
16
17
  }
17
18
  }
18
- const N = (e) => e, a = (e, t) => {
19
+ const V = (t) => t, a = (t, e) => {
19
20
  const r = {
20
21
  display: "contents"
21
22
  };
22
- if (t && (r.colorScheme = t), !e)
23
+ if (e && (r.colorScheme = e), !t)
23
24
  return r;
24
- for (let o = 0; o < e.style.length; o += 1) {
25
- const s = e.style.item(o);
26
- s.startsWith("--bfrs-") && (r[s] = e.style.getPropertyValue(s));
25
+ for (let s = 0; s < t.style.length; s += 1) {
26
+ const o = t.style.item(s);
27
+ o.startsWith("--bfrs-") && (r[o] = t.style.getPropertyValue(o));
27
28
  }
28
29
  return r;
29
- }, T = v(({ className: e, colorScheme: t = "light", theme: r, style: o, ...s }, n) => {
30
- const [c, y] = m(null), f = l(() => N(R(r ?? {})), [r]), b = l(() => ({ ...f, ...o }), [o, f]), p = S(
31
- (u) => {
32
- y(u), M(n, u);
30
+ }, w = S(({ analytics: t, className: e, colorScheme: r = "light", theme: s, style: o, ...n }, c) => {
31
+ const [f, b] = d(null), u = i(() => V(M(s ?? {})), [s]), p = i(() => ({ ...u, ...o }), [o, u]), h = g(
32
+ (m) => {
33
+ b(m), T(c, m);
33
34
  },
34
- [n]
35
- ), h = l(
35
+ [c]
36
+ ), v = i(
36
37
  () => ({
37
- root: c,
38
- colorScheme: t
38
+ root: f,
39
+ colorScheme: r
39
40
  }),
40
- [t, c]
41
+ [r, f]
41
42
  );
42
- return /* @__PURE__ */ i(d.Provider, { value: h, children: /* @__PURE__ */ i(
43
+ return /* @__PURE__ */ l(N, { emit: t, children: /* @__PURE__ */ l(y.Provider, { value: v, children: /* @__PURE__ */ l(
43
44
  "div",
44
45
  {
45
- ref: p,
46
+ ref: h,
46
47
  "data-bfrs-root": "",
47
- "data-bfrs-color-scheme": t,
48
- className: B("bfrs", e),
49
- style: b,
50
- ...s
48
+ "data-bfrs-color-scheme": r,
49
+ className: C("bfrs", e),
50
+ style: p,
51
+ ...n
51
52
  }
52
- ) });
53
+ ) }) });
53
54
  });
54
- T.displayName = "BfrsProvider";
55
- function A({ children: e }) {
56
- const { root: t, colorScheme: r } = g(d), [o, s] = m(() => a(t, r));
55
+ w.displayName = "BfrsProvider";
56
+ function F({ children: t }) {
57
+ const { root: e, colorScheme: r } = P(y), [s, o] = d(() => a(e, r));
57
58
  return x(() => {
58
- if (C(), s(a(t, r)), !t || typeof globalThis.MutationObserver > "u")
59
+ if (R(), o(a(e, r)), !e || typeof globalThis.MutationObserver > "u")
59
60
  return;
60
61
  const n = new globalThis.MutationObserver(() => {
61
- s(a(t, r));
62
+ o(a(e, r));
62
63
  });
63
- return n.observe(t, {
64
+ return n.observe(e, {
64
65
  attributes: !0,
65
66
  attributeFilter: ["style", "data-bfrs-color-scheme"]
66
67
  }), () => n.disconnect();
67
- }, [r, t]), /* @__PURE__ */ i("div", { className: "bfrs", "data-bfrs-portal": "", "data-bfrs-color-scheme": r, style: o, children: e });
68
+ }, [r, e]), /* @__PURE__ */ l("div", { className: "bfrs", "data-bfrs-portal": "", "data-bfrs-color-scheme": r, style: s, children: t });
68
69
  }
69
70
  export {
70
- A as BfrsPortalScope,
71
- T as BfrsProvider
71
+ F as BfrsPortalScope,
72
+ w as BfrsProvider
72
73
  };
73
74
  //# sourceMappingURL=BfrsProvider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BfrsProvider.js","sources":["../../../../../src/components/ui/providers/BfrsProvider/BfrsProvider.tsx"],"sourcesContent":["import {\n createContext,\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useState,\n type CSSProperties,\n type HTMLAttributes,\n type MutableRefObject,\n type ReactNode,\n type Ref\n} from \"react\";\nimport { cn } from \"@/lib/cn\";\nimport { ensureDocumentStyles } from \"@/lib/documentStyles\";\nimport { createAgenticThemeVariables, type AgenticThemeOverrides } from \"@/theme\";\n\nexport type BfrsColorScheme = \"light\" | \"dark\";\n\nexport type BfrsProviderProps = HTMLAttributes<HTMLDivElement> & {\n theme?: AgenticThemeOverrides;\n colorScheme?: BfrsColorScheme;\n};\n\ntype BfrsStyleScopeContextValue = {\n root: HTMLElement | null;\n colorScheme?: BfrsColorScheme;\n};\n\nconst BfrsStyleScopeContext = createContext<BfrsStyleScopeContextValue>({\n root: null\n});\n\nfunction assignRef<T>(ref: Ref<T> | undefined, value: T | null) {\n if (!ref) {\n return;\n }\n\n if (typeof ref === \"function\") {\n ref(value);\n return;\n }\n\n (ref as MutableRefObject<T | null>).current = value;\n}\n\nconst toStyleProperties = (variables: Record<string, string | undefined>) => variables as CSSProperties;\n\nconst collectBfrsInlineStyle = (root: HTMLElement | null, colorScheme?: BfrsColorScheme): CSSProperties => {\n const style: Record<string, string> = {\n display: \"contents\"\n };\n\n if (colorScheme) {\n style.colorScheme = colorScheme;\n }\n\n if (!root) {\n return style as CSSProperties;\n }\n\n for (let index = 0; index < root.style.length; index += 1) {\n const name = root.style.item(index);\n\n if (name.startsWith(\"--bfrs-\")) {\n style[name] = root.style.getPropertyValue(name);\n }\n }\n\n return style as CSSProperties;\n};\n\nexport const BfrsProvider = forwardRef<HTMLDivElement, BfrsProviderProps>(({ className, colorScheme = \"light\", theme, style, ...props }, ref) => {\n const [root, setRoot] = useState<HTMLDivElement | null>(null);\n const themeStyle = useMemo(() => toStyleProperties(createAgenticThemeVariables(theme ?? {})), [theme]);\n const mergedStyle = useMemo(() => ({ ...themeStyle, ...style }), [style, themeStyle]);\n\n const handleRef = useCallback(\n (node: HTMLDivElement | null) => {\n setRoot(node);\n assignRef(ref, node);\n },\n [ref]\n );\n\n const contextValue = useMemo(\n () => ({\n root,\n colorScheme\n }),\n [colorScheme, root]\n );\n\n return (\n <BfrsStyleScopeContext.Provider value={contextValue}>\n <div\n ref={handleRef}\n data-bfrs-root=\"\"\n data-bfrs-color-scheme={colorScheme}\n className={cn(\"bfrs\", className)}\n style={mergedStyle}\n {...props}\n />\n </BfrsStyleScopeContext.Provider>\n );\n});\n\nBfrsProvider.displayName = \"BfrsProvider\";\n\nexport function BfrsStyleScope({ children, root, colorScheme = \"light\" }: { children: ReactNode; root: HTMLElement | null; colorScheme?: BfrsColorScheme }) {\n const contextValue = useMemo(\n () => ({\n root,\n colorScheme\n }),\n [colorScheme, root]\n );\n\n return <BfrsStyleScopeContext.Provider value={contextValue}>{children}</BfrsStyleScopeContext.Provider>;\n}\n\nexport function BfrsPortalScope({ children }: { children: ReactNode }) {\n const { root, colorScheme } = useContext(BfrsStyleScopeContext);\n const [portalStyle, setPortalStyle] = useState<CSSProperties>(() => collectBfrsInlineStyle(root, colorScheme));\n\n useEffect(() => {\n // Overlays portal to <body>; make sure the document carries the library\n // stylesheet so portaled content stays styled.\n ensureDocumentStyles();\n setPortalStyle(collectBfrsInlineStyle(root, colorScheme));\n\n if (!root || typeof globalThis.MutationObserver === \"undefined\") {\n return undefined;\n }\n\n const observer = new globalThis.MutationObserver(() => {\n setPortalStyle(collectBfrsInlineStyle(root, colorScheme));\n });\n\n observer.observe(root, {\n attributes: true,\n attributeFilter: [\"style\", \"data-bfrs-color-scheme\"]\n });\n\n return () => observer.disconnect();\n }, [colorScheme, root]);\n\n return (\n <div className=\"bfrs\" data-bfrs-portal=\"\" data-bfrs-color-scheme={colorScheme} style={portalStyle}>\n {children}\n </div>\n );\n}\n"],"names":["BfrsStyleScopeContext","createContext","assignRef","ref","value","toStyleProperties","variables","collectBfrsInlineStyle","root","colorScheme","style","index","name","BfrsProvider","forwardRef","className","theme","props","setRoot","useState","themeStyle","useMemo","createAgenticThemeVariables","mergedStyle","handleRef","useCallback","node","contextValue","jsx","cn","BfrsPortalScope","children","useContext","portalStyle","setPortalStyle","useEffect","ensureDocumentStyles","observer"],"mappings":";;;;;AA8BA,MAAMA,IAAwBC,EAA0C;AAAA,EACtE,MAAM;AACR,CAAC;AAED,SAASC,EAAaC,GAAyBC,GAAiB;AAC9D,MAAKD,GAIL;AAAA,QAAI,OAAOA,KAAQ,YAAY;AAC7B,MAAAA,EAAIC,CAAK;AACT;AAAA,IACF;AAEC,IAAAD,EA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B,WAAWoB,EAAG,QAAQd,CAAS;AAAA,MAC/B,OAAOQ;AAAA,MACN,GAAGN;AAAA,IAAA;AAAA,EAAA,GAER;AAEJ,CAAC;AAEDJ,EAAa,cAAc;AAcpB,SAASiB,EAAgB,EAAE,UAAAC,KAAqC;AACrE,QAAM,EAAE,MAAAvB,GAAM,aAAAC,MAAgBuB,EAAWhC,CAAqB,GACxD,CAACiC,GAAaC,CAAc,IAAIf,EAAwB,MAAMZ,EAAuBC,GAAMC,CAAW,CAAC;AAE7G,SAAA0B,EAAU,MAAM;AAMd,QAHAC,EAAA,GACAF,EAAe3B,EAAuBC,GAAMC,CAAW,CAAC,GAEpD,CAACD,KAAQ,OAAO,WAAW,mBAAqB;AAClD;AAGF,UAAM6B,IAAW,IAAI,WAAW,iBAAiB,MAAM;AACrD,MAAAH,EAAe3B,EAAuBC,GAAMC,CAAW,CAAC;AAAA,IAC1D,CAAC;AAED,WAAA4B,EAAS,QAAQ7B,GAAM;AAAA,MACrB,YAAY;AAAA,MACZ,iBAAiB,CAAC,SAAS,wBAAwB;AAAA,IAAA,CACpD,GAEM,MAAM6B,EAAS,WAAA;AAAA,EACxB,GAAG,CAAC5B,GAAaD,CAAI,CAAC,GAGpB,gBAAAoB,EAAC,OAAA,EAAI,WAAU,QAAO,oBAAiB,IAAG,0BAAwBnB,GAAa,OAAOwB,GACnF,UAAAF,EAAA,CACH;AAEJ;"}
1
+ {"version":3,"file":"BfrsProvider.js","sources":["../../../../../src/components/ui/providers/BfrsProvider/BfrsProvider.tsx"],"sourcesContent":["import {\n createContext,\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useState,\n type CSSProperties,\n type HTMLAttributes,\n type MutableRefObject,\n type ReactNode,\n type Ref\n} from \"react\";\nimport { cn } from \"@/lib/cn\";\nimport { ensureDocumentStyles } from \"@/lib/documentStyles\";\nimport { createAgenticThemeVariables, type AgenticThemeOverrides } from \"@/theme\";\nimport { BfrsAnalyticsProvider } from \"../BfrsAnalyticsProvider/BfrsAnalyticsProvider\";\nimport type { BfrsAnalyticsSink } from \"../BfrsAnalyticsProvider/analyticsContext\";\n\nexport type BfrsColorScheme = \"light\" | \"dark\";\n\nexport type BfrsProviderProps = HTMLAttributes<HTMLDivElement> & {\n theme?: AgenticThemeOverrides;\n colorScheme?: BfrsColorScheme;\n /**\n * Where library-owned interactions are reported, wired once per app:\n *\n * ```tsx\n * <BfrsProvider analytics={(event) => analytics.track(event.name, event.properties)}>\n * ```\n *\n * Nothing in the library touches `gtag`, `dataLayer` or a provider SDK — it\n * hands the event here and the app decides what happens to it. Omitted, the\n * library reports nothing.\n */\n analytics?: BfrsAnalyticsSink;\n};\n\ntype BfrsStyleScopeContextValue = {\n root: HTMLElement | null;\n colorScheme?: BfrsColorScheme;\n};\n\nconst BfrsStyleScopeContext = createContext<BfrsStyleScopeContextValue>({\n root: null\n});\n\nfunction assignRef<T>(ref: Ref<T> | undefined, value: T | null) {\n if (!ref) {\n return;\n }\n\n if (typeof ref === \"function\") {\n ref(value);\n return;\n }\n\n (ref as MutableRefObject<T | null>).current = value;\n}\n\nconst toStyleProperties = (variables: Record<string, string | undefined>) => variables as CSSProperties;\n\nconst collectBfrsInlineStyle = (root: HTMLElement | null, colorScheme?: BfrsColorScheme): CSSProperties => {\n const style: Record<string, string> = {\n display: \"contents\"\n };\n\n if (colorScheme) {\n style.colorScheme = colorScheme;\n }\n\n if (!root) {\n return style as CSSProperties;\n }\n\n for (let index = 0; index < root.style.length; index += 1) {\n const name = root.style.item(index);\n\n if (name.startsWith(\"--bfrs-\")) {\n style[name] = root.style.getPropertyValue(name);\n }\n }\n\n return style as CSSProperties;\n};\n\nexport const BfrsProvider = forwardRef<HTMLDivElement, BfrsProviderProps>(({ analytics, className, colorScheme = \"light\", theme, style, ...props }, ref) => {\n const [root, setRoot] = useState<HTMLDivElement | null>(null);\n const themeStyle = useMemo(() => toStyleProperties(createAgenticThemeVariables(theme ?? {})), [theme]);\n const mergedStyle = useMemo(() => ({ ...themeStyle, ...style }), [style, themeStyle]);\n\n const handleRef = useCallback(\n (node: HTMLDivElement | null) => {\n setRoot(node);\n assignRef(ref, node);\n },\n [ref]\n );\n\n const contextValue = useMemo(\n () => ({\n root,\n colorScheme\n }),\n [colorScheme, root]\n );\n\n return (\n <BfrsAnalyticsProvider emit={analytics}>\n <BfrsStyleScopeContext.Provider value={contextValue}>\n <div\n ref={handleRef}\n data-bfrs-root=\"\"\n data-bfrs-color-scheme={colorScheme}\n className={cn(\"bfrs\", className)}\n style={mergedStyle}\n {...props}\n />\n </BfrsStyleScopeContext.Provider>\n </BfrsAnalyticsProvider>\n );\n});\n\nBfrsProvider.displayName = \"BfrsProvider\";\n\nexport function BfrsStyleScope({ children, root, colorScheme = \"light\" }: { children: ReactNode; root: HTMLElement | null; colorScheme?: BfrsColorScheme }) {\n const contextValue = useMemo(\n () => ({\n root,\n colorScheme\n }),\n [colorScheme, root]\n );\n\n return <BfrsStyleScopeContext.Provider value={contextValue}>{children}</BfrsStyleScopeContext.Provider>;\n}\n\nexport function BfrsPortalScope({ children }: { children: ReactNode }) {\n const { root, colorScheme } = useContext(BfrsStyleScopeContext);\n const [portalStyle, setPortalStyle] = useState<CSSProperties>(() => collectBfrsInlineStyle(root, colorScheme));\n\n useEffect(() => {\n // Overlays portal to <body>; make sure the document carries the library\n // stylesheet so portaled content stays styled.\n ensureDocumentStyles();\n setPortalStyle(collectBfrsInlineStyle(root, colorScheme));\n\n if (!root || typeof globalThis.MutationObserver === \"undefined\") {\n return undefined;\n }\n\n const observer = new globalThis.MutationObserver(() => {\n setPortalStyle(collectBfrsInlineStyle(root, colorScheme));\n });\n\n observer.observe(root, {\n attributes: true,\n attributeFilter: [\"style\", \"data-bfrs-color-scheme\"]\n });\n\n return () => observer.disconnect();\n }, [colorScheme, root]);\n\n return (\n <div className=\"bfrs\" data-bfrs-portal=\"\" data-bfrs-color-scheme={colorScheme} style={portalStyle}>\n {children}\n </div>\n );\n}\n"],"names":["BfrsStyleScopeContext","createContext","assignRef","ref","value","toStyleProperties","variables","collectBfrsInlineStyle","root","colorScheme","style","index","name","BfrsProvider","forwardRef","analytics","className","theme","props","setRoot","useState","themeStyle","useMemo","createAgenticThemeVariables","mergedStyle","handleRef","useCallback","node","contextValue","jsx","BfrsAnalyticsProvider","cn","BfrsPortalScope","children","useContext","portalStyle","setPortalStyle","useEffect","ensureDocumentStyles","observer"],"mappings":";;;;;;AA4CA,MAAMA,IAAwBC,EAA0C;AAAA,EACtE,MAAM;AACR,CAAC;AAED,SAASC,EAAaC,GAAyBC,GAAiB;AAC9D,MAAKD,GAIL;AAAA,QAAI,OAAOA,KAAQ,YAAY;AAC7B,MAAAA,EAAIC,CAAK;AACT;AAAA,IACF;AAEC,IAAAD,EAAmC,UAAUC;AAAA;AAChD;AAEA,MAAMC,IAAoB,CAACC,MAAkDA,GAEvEC,IAAyB,CAACC,GAA0BC,MAAiD;AACzG,QAAMC,IAAgC;AAAA,IACpC,SAAS;AAAA,EAAA;AAOX,MAJID,MACFC,EAAM,cAAcD,IAGlB,CAACD;AACH,WAAOE;AAGT,WAASC,IAAQ,GAAGA,IAAQH,EAAK,MAAM,QAAQG,KAAS,GAAG;AACzD,UAAMC,IAAOJ,EAAK,MAAM,KAAKG,CAAK;AAElC,IAAIC,EAAK,WAAW,SAAS,MAC3BF,EAAME,CAAI,IAAIJ,EAAK,MAAM,iBAAiBI,CAAI;AAAA,EAElD;AAEA,SAAOF;AACT,GAEaG,IAAeC,EAA8C,CAAC,EAAE,WAAAC,GAAW,WAAAC,GAAW,aAAAP,IAAc,SAAS,OAAAQ,GAAO,OAAAP,GAAO,GAAGQ,EAAA,GAASf,MAAQ;AAC1J,QAAM,CAACK,GAAMW,CAAO,IAAIC,EAAgC,IAAI,GACtDC,IAAaC,EAAQ,MAAMjB,EAAkBkB,EAA4BN,KAAS,EAAE,CAAC,GAAG,CAACA,CAAK,CAAC,GAC/FO,IAAcF,EAAQ,OAAO,EAAE,GAAGD,GAAY,GAAGX,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