@teja-app/ui 0.0.13 → 0.0.14

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 (33) hide show
  1. package/dist/index.cjs +5 -0
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.ts +1 -0
  4. package/dist/index.d.ts.map +1 -1
  5. package/dist/index.js +6 -1
  6. package/dist/index.js.map +1 -1
  7. package/dist/instrumentation/context.d.ts +9 -0
  8. package/dist/instrumentation/context.d.ts.map +1 -0
  9. package/dist/instrumentation/index.cjs +8 -0
  10. package/dist/instrumentation/index.cjs.map +1 -0
  11. package/dist/instrumentation/index.d.ts +10 -0
  12. package/dist/instrumentation/index.d.ts.map +1 -0
  13. package/dist/instrumentation/index.js +8 -0
  14. package/dist/instrumentation/index.js.map +1 -0
  15. package/dist/instrumentation/tracker.d.ts +28 -0
  16. package/dist/instrumentation/tracker.d.ts.map +1 -0
  17. package/dist/instrumentation/useInstrumentedClick.d.ts +31 -0
  18. package/dist/instrumentation/useInstrumentedClick.d.ts.map +1 -0
  19. package/dist/theme/components/AIComposeButton.d.ts +2 -0
  20. package/dist/theme/components/AIComposeButton.d.ts.map +1 -1
  21. package/dist/theme/components/Button.d.ts +2 -0
  22. package/dist/theme/components/Button.d.ts.map +1 -1
  23. package/dist/theme/components/IconButton.d.ts +2 -0
  24. package/dist/theme/components/IconButton.d.ts.map +1 -1
  25. package/dist/theme/index.cjs +26 -2
  26. package/dist/theme/index.cjs.map +1 -1
  27. package/dist/theme/index.js +26 -2
  28. package/dist/theme/index.js.map +1 -1
  29. package/dist/useInstrumentedClick-B7QAnoBt.js +68 -0
  30. package/dist/useInstrumentedClick-B7QAnoBt.js.map +1 -0
  31. package/dist/useInstrumentedClick-COxikkTF.cjs +67 -0
  32. package/dist/useInstrumentedClick-COxikkTF.cjs.map +1 -0
  33. package/package.json +6 -1
package/dist/index.cjs CHANGED
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const useSidebar = require("./useSidebar-d1VZFhxd.cjs");
4
4
  const utils_index = require("./utils/index.cjs");
5
+ const useInstrumentedClick = require("./useInstrumentedClick-COxikkTF.cjs");
5
6
  exports.useDebounce = useSidebar.useDebounce;
6
7
  exports.useDebouncedCallback = useSidebar.useDebouncedCallback;
7
8
  exports.useDebouncedCallbackWithControl = useSidebar.useDebouncedCallbackWithControl;
@@ -9,4 +10,8 @@ exports.useSelection = useSidebar.useSelection;
9
10
  exports.useSidebar = useSidebar.useSidebar;
10
11
  exports.useTable = useSidebar.useTable;
11
12
  exports.cn = utils_index.cn;
13
+ exports.TrackerProvider = useInstrumentedClick.TrackerProvider;
14
+ exports.noopTracker = useInstrumentedClick.noopTracker;
15
+ exports.useInstrumentedClick = useInstrumentedClick.useInstrumentedClick;
16
+ exports.useTracker = useInstrumentedClick.useTracker;
12
17
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
1
+ {"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;"}
package/dist/index.d.ts CHANGED
@@ -14,4 +14,5 @@
14
14
  */
15
15
  export * from './hooks';
16
16
  export { cn } from './utils';
17
+ export * from './instrumentation';
17
18
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,cAAc,SAAS,CAAC;AAGxB,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,cAAc,SAAS,CAAC;AAGxB,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAM7B,cAAc,mBAAmB,CAAC"}
package/dist/index.js CHANGED
@@ -1,12 +1,17 @@
1
1
  import { u, a, b, c, d, e } from "./useSidebar-BWe09WbE.js";
2
2
  import { cn } from "./utils/index.js";
3
+ import { T, n, u as u2, a as a2 } from "./useInstrumentedClick-B7QAnoBt.js";
3
4
  export {
5
+ T as TrackerProvider,
4
6
  cn,
7
+ n as noopTracker,
5
8
  u as useDebounce,
6
9
  a as useDebouncedCallback,
7
10
  b as useDebouncedCallbackWithControl,
11
+ u2 as useInstrumentedClick,
8
12
  c as useSelection,
9
13
  d as useSidebar,
10
- e as useTable
14
+ e as useTable,
15
+ a2 as useTracker
11
16
  };
12
17
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
@@ -0,0 +1,9 @@
1
+ import { type ReactNode } from 'react';
2
+ import { type Tracker } from './tracker';
3
+ export interface TrackerProviderProps {
4
+ tracker: Tracker;
5
+ children: ReactNode;
6
+ }
7
+ export declare function TrackerProvider({ tracker, children }: TrackerProviderProps): import("react/jsx-runtime").JSX.Element;
8
+ export declare function useTracker(): Tracker;
9
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/instrumentation/context.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA6B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAElE,OAAO,EAAe,KAAK,OAAO,EAAE,MAAM,WAAW,CAAC;AAWtD,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,wBAAgB,eAAe,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,oBAAoB,2CAM1E;AAED,wBAAgB,UAAU,IAAI,OAAO,CAEpC"}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const useInstrumentedClick = require("../useInstrumentedClick-COxikkTF.cjs");
4
+ exports.TrackerProvider = useInstrumentedClick.TrackerProvider;
5
+ exports.noopTracker = useInstrumentedClick.noopTracker;
6
+ exports.useInstrumentedClick = useInstrumentedClick.useInstrumentedClick;
7
+ exports.useTracker = useInstrumentedClick.useTracker;
8
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * teja-ui instrumentation surface (W3 §7.5–7.6).
3
+ *
4
+ * FROZEN contract consumed by the app-side adapter. teja-ui carries no telemetry
5
+ * SDK; the host injects a `Tracker` via `<TrackerProvider>`.
6
+ */
7
+ export { noopTracker, type Tracker, type SpanHandle } from './tracker';
8
+ export { TrackerProvider, useTracker, type TrackerProviderProps } from './context';
9
+ export { useInstrumentedClick, type InstrumentedClickMeta, } from './useInstrumentedClick';
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/instrumentation/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,WAAW,EAAE,KAAK,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,WAAW,CAAC;AACvE,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,KAAK,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACnF,OAAO,EACL,oBAAoB,EACpB,KAAK,qBAAqB,GAC3B,MAAM,wBAAwB,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { T, n, u, a } from "../useInstrumentedClick-B7QAnoBt.js";
2
+ export {
3
+ T as TrackerProvider,
4
+ n as noopTracker,
5
+ u as useInstrumentedClick,
6
+ a as useTracker
7
+ };
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Tracker facade — the FROZEN telemetry contract teja-ui exposes (W3 §7.5).
3
+ *
4
+ * teja-ui carries NO OpenTelemetry / Sentry / PostHog dependency. Consuming
5
+ * apps inject a concrete `Tracker` via `<TrackerProvider>`; when no provider is
6
+ * mounted the components fall back to `noopTracker`, so an un-instrumented host
7
+ * sees ZERO behavior change. The app-side adapter (`frontend/src/lib/telemetry/
8
+ * uiTracker.ts`) is the only place that knows about the real sink.
9
+ */
10
+ /** A single in-flight UI span (e.g. one button click). */
11
+ export interface SpanHandle {
12
+ setAttribute(key: string, value: string | number | boolean): void;
13
+ /**
14
+ * End the span. `outcome` records how the handler settled; `error` is the
15
+ * thrown/rejected value when `outcome === "error"` (recorded as an exception
16
+ * by the adapter, never swallowed by the hook).
17
+ */
18
+ end(outcome: 'success' | 'error' | 'abandoned', error?: unknown): void;
19
+ }
20
+ export interface Tracker {
21
+ /** Start a span. Attributes are flat primitives so any sink can serialize them. */
22
+ startSpan(name: string, attrs: Record<string, string | number | boolean>): SpanHandle;
23
+ /** Fire-and-forget discrete event (no duration). */
24
+ track(event: string, attrs?: Record<string, string | number | boolean>): void;
25
+ }
26
+ /** No-op implementation: the default when no provider is mounted. */
27
+ export declare const noopTracker: Tracker;
28
+ //# sourceMappingURL=tracker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tracker.d.ts","sourceRoot":"","sources":["../../src/instrumentation/tracker.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,0DAA0D;AAC1D,MAAM,WAAW,UAAU;IACzB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;IAClE;;;;OAIG;IACH,GAAG,CAAC,OAAO,EAAE,SAAS,GAAG,OAAO,GAAG,WAAW,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CACxE;AAED,MAAM,WAAW,OAAO;IACtB,mFAAmF;IACnF,SAAS,CACP,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,GAC/C,UAAU,CAAC;IACd,oDAAoD;IACpD,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,GAAG,IAAI,CAAC;CAC/E;AAED,qEAAqE;AACrE,eAAO,MAAM,WAAW,EAAE,OAGzB,CAAC"}
@@ -0,0 +1,31 @@
1
+ import { type SyntheticEvent } from 'react';
2
+ /**
3
+ * useInstrumentedClick (W3 §7.6).
4
+ *
5
+ * Wraps a click handler in a `ui.button.click` span. The span's lifecycle
6
+ * follows the handler:
7
+ * - sync handler → span ends `success` immediately (`ui.handler.async=false`)
8
+ * - async handler → span ends when the returned promise settles
9
+ * (`success`/`error`), recording `ui.handler.duration_ms`.
10
+ *
11
+ * Error semantics — the hook observes, never alters control flow:
12
+ * - sync throw → span ends `error`, then the error is RE-THROWN so the
13
+ * caller's try/catch / React error boundary still sees it.
14
+ * - async reject → span ends `error`; the rejection is left ON the original
15
+ * promise so the caller's own `.catch`/awaiter still receives it. The hook
16
+ * attaches a passive observer (it does not consume the rejection).
17
+ *
18
+ * Tracker comes from `useTracker()`, so an unmounted provider = noop = zero
19
+ * behavior change.
20
+ */
21
+ export interface InstrumentedClickMeta {
22
+ /** Semantic id, e.g. "onboarding.step1.next". Highest-priority component.name. */
23
+ telemetryId?: string;
24
+ /** Fallback identity (the component's data-testid). */
25
+ testId?: string;
26
+ /** "Button" | "IconButton" | "AIComposeButton". */
27
+ kind: string;
28
+ variant?: string;
29
+ }
30
+ export declare function useInstrumentedClick<E extends SyntheticEvent>(onClick: ((e: E) => void | Promise<void>) | undefined, meta: InstrumentedClickMeta): ((e: E) => void) | undefined;
31
+ //# sourceMappingURL=useInstrumentedClick.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useInstrumentedClick.d.ts","sourceRoot":"","sources":["../../src/instrumentation/useInstrumentedClick.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAIzD;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,WAAW,qBAAqB;IACpC,kFAAkF;IAClF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uDAAuD;IACvD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mDAAmD;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAID,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,cAAc,EAC3D,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,SAAS,EACrD,IAAI,EAAE,qBAAqB,GAC1B,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI,CAAC,GAAG,SAAS,CAmE9B"}
@@ -9,6 +9,8 @@ export interface AIComposeButtonProps extends Omit<ButtonHTMLAttributes<HTMLButt
9
9
  size?: AIComposeButtonSize;
10
10
  children?: ReactNode;
11
11
  testId?: string;
12
+ /** Semantic telemetry id for the click span (`component.name`). */
13
+ telemetryId?: string;
12
14
  }
13
15
  export declare const AIComposeButton: import("react").ForwardRefExoticComponent<AIComposeButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
14
16
  //# sourceMappingURL=AIComposeButton.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AIComposeButton.d.ts","sourceRoot":"","sources":["../../../src/theme/components/AIComposeButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,oBAAoB,EAAsB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAIlG;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG,IAAI,GAAG,IAAI,CAAC;AAE9C,MAAM,WAAW,oBACf,SAAQ,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,UAAU,CAAC;IACjE,IAAI,CAAC,EAAE,mBAAmB,CAAC;IAC3B,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,eAAe,oHAqC3B,CAAC"}
1
+ {"version":3,"file":"AIComposeButton.d.ts","sourceRoot":"","sources":["../../../src/theme/components/AIComposeButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,oBAAoB,EAAsB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAMlG;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG,IAAI,GAAG,IAAI,CAAC;AAE9C,MAAM,WAAW,oBACf,SAAQ,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,UAAU,CAAC;IACjE,IAAI,CAAC,EAAE,mBAAmB,CAAC;IAC3B,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mEAAmE;IACnE,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,eAAe,oHA4C3B,CAAC"}
@@ -14,6 +14,8 @@ export interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement
14
14
  children?: ReactNode;
15
15
  /** Forwarded as `data-testid` on the `<button>` element. */
16
16
  testId?: string;
17
+ /** Semantic telemetry id for the click span (`component.name`). */
18
+ telemetryId?: string;
17
19
  }
18
20
  export declare const Button: import("react").ForwardRefExoticComponent<ButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
19
21
  //# sourceMappingURL=Button.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/theme/components/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,oBAAoB,EAEzB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,EAAQ,KAAK,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAE7C,MAAM,MAAM,aAAa,GACrB,SAAS,GACT,WAAW,GACX,OAAO,GACP,QAAQ,GACR,MAAM,CAAC;AACX,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAqC5C,MAAM,WAAW,WACf,SAAQ,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,UAAU,CAAC;IACjE,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,gDAAgD;IAChD,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,0BAA0B;IAC1B,SAAS,CAAC,EAAE,QAAQ,CAAC;IACrB,uCAAuC;IACvC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,4DAA4D;IAC5D,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,MAAM,2GAgDjB,CAAC"}
1
+ {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/theme/components/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,oBAAoB,EAEzB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAIf,OAAO,EAAQ,KAAK,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAE7C,MAAM,MAAM,aAAa,GACrB,SAAS,GACT,WAAW,GACX,OAAO,GACP,QAAQ,GACR,MAAM,CAAC;AACX,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAqC5C,MAAM,WAAW,WACf,SAAQ,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,UAAU,CAAC;IACjE,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,gDAAgD;IAChD,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,0BAA0B;IAC1B,SAAS,CAAC,EAAE,QAAQ,CAAC;IACrB,uCAAuC;IACvC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,4DAA4D;IAC5D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mEAAmE;IACnE,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,MAAM,2GAyDjB,CAAC"}
@@ -12,6 +12,8 @@ export interface IconButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonEle
12
12
  size?: IconButtonSize;
13
13
  tone?: IconButtonTone;
14
14
  testId?: string;
15
+ /** Semantic telemetry id for the click span (`component.name`). */
16
+ telemetryId?: string;
15
17
  }
16
18
  export declare const IconButton: import("react").ForwardRefExoticComponent<IconButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
17
19
  //# sourceMappingURL=IconButton.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../../src/theme/components/IconButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,oBAAoB,EAAsB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAElG;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAChD,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,SAAS,CAAC;AAEnD,MAAM,WAAW,eACf,SAAQ,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,UAAU,CAAC;IACjE,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAID,eAAO,MAAM,UAAU,+GAmCtB,CAAC"}
1
+ {"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../../src/theme/components/IconButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,oBAAoB,EAAsB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAIlG;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAChD,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,SAAS,CAAC;AAEnD,MAAM,WAAW,eACf,SAAQ,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,UAAU,CAAC;IACjE,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mEAAmE;IACnE,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAID,eAAO,MAAM,UAAU,+GA0CtB,CAAC"}
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
4
  const React = require("react");
5
+ const instrumentation = require("@teja-app/ui/instrumentation");
5
6
  const ReactDOM = require("react-dom");
6
7
  function _interopNamespaceDefault(e2) {
7
8
  const n2 = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
@@ -674,9 +675,17 @@ const Button$1 = React.forwardRef(function Button2({
674
675
  type = "button",
675
676
  disabled,
676
677
  testId,
678
+ telemetryId,
679
+ onClick,
677
680
  ...rest
678
681
  }, ref) {
679
682
  const dims = SIZE_DIMS$2[size2];
683
+ const instrumentedClick = instrumentation.useInstrumentedClick(onClick, {
684
+ telemetryId,
685
+ testId,
686
+ kind: "Button",
687
+ variant
688
+ });
680
689
  return /* @__PURE__ */ jsxRuntime.jsxs(
681
690
  "button",
682
691
  {
@@ -684,6 +693,7 @@ const Button$1 = React.forwardRef(function Button2({
684
693
  type,
685
694
  disabled,
686
695
  "data-testid": testId,
696
+ onClick: instrumentedClick,
687
697
  style: {
688
698
  height: dims.h,
689
699
  padding: dims.pad,
@@ -16523,8 +16533,14 @@ const Switch = React.forwardRef(function Switch2({ on = false, onChange, size: s
16523
16533
  });
16524
16534
  const SIZE_PX$1 = { sm: 22, md: 26, lg: 32 };
16525
16535
  const IconButton = React.forwardRef(
16526
- function IconButton2({ children, size: size2 = "md", tone = "default", style, testId, type = "button", ...rest }, ref) {
16536
+ function IconButton2({ children, size: size2 = "md", tone = "default", style, testId, telemetryId, onClick, type = "button", ...rest }, ref) {
16527
16537
  const dim = SIZE_PX$1[size2];
16538
+ const instrumentedClick = instrumentation.useInstrumentedClick(onClick, {
16539
+ telemetryId,
16540
+ testId,
16541
+ kind: "IconButton",
16542
+ variant: tone
16543
+ });
16528
16544
  const merged = {
16529
16545
  width: dim,
16530
16546
  height: dim,
@@ -16548,6 +16564,7 @@ const IconButton = React.forwardRef(
16548
16564
  type,
16549
16565
  "data-testid": testId,
16550
16566
  "data-tone": tone,
16567
+ onClick: instrumentedClick,
16551
16568
  style: merged,
16552
16569
  ...rest,
16553
16570
  children
@@ -17240,8 +17257,14 @@ function AIBadge({
17240
17257
  ] });
17241
17258
  }
17242
17259
  const AIComposeButton = React.forwardRef(
17243
- function AIComposeButton2({ size: size2 = "md", children = "Compose with AI", style, testId, type = "button", ...rest }, ref) {
17260
+ function AIComposeButton2({ size: size2 = "md", children = "Compose with AI", style, testId, telemetryId, onClick, type = "button", ...rest }, ref) {
17244
17261
  const h2 = size2 === "sm" ? 28 : 32;
17262
+ const instrumentedClick = instrumentation.useInstrumentedClick(onClick, {
17263
+ telemetryId,
17264
+ testId,
17265
+ kind: "AIComposeButton",
17266
+ variant: size2
17267
+ });
17245
17268
  const fz = size2 === "sm" ? 12 : 13;
17246
17269
  const merged = {
17247
17270
  height: h2,
@@ -17266,6 +17289,7 @@ const AIComposeButton = React.forwardRef(
17266
17289
  type,
17267
17290
  "data-testid": testId,
17268
17291
  "data-size": size2,
17292
+ onClick: instrumentedClick,
17269
17293
  style: merged,
17270
17294
  ...rest,
17271
17295
  children: [