@teja-app/ui 0.0.12 → 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 (54) 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/Accordion.d.ts +75 -0
  22. package/dist/theme/components/Accordion.d.ts.map +1 -0
  23. package/dist/theme/components/Badge.d.ts +21 -1
  24. package/dist/theme/components/Badge.d.ts.map +1 -1
  25. package/dist/theme/components/Button.d.ts +2 -0
  26. package/dist/theme/components/Button.d.ts.map +1 -1
  27. package/dist/theme/components/Card.d.ts +37 -2
  28. package/dist/theme/components/Card.d.ts.map +1 -1
  29. package/dist/theme/components/DarkScope.d.ts +54 -0
  30. package/dist/theme/components/DarkScope.d.ts.map +1 -0
  31. package/dist/theme/components/IconButton.d.ts +2 -0
  32. package/dist/theme/components/IconButton.d.ts.map +1 -1
  33. package/dist/theme/components/Menu.d.ts +84 -0
  34. package/dist/theme/components/Menu.d.ts.map +1 -0
  35. package/dist/theme/components/SegmentedControl.d.ts.map +1 -1
  36. package/dist/theme/components/SelectableCard.d.ts +34 -0
  37. package/dist/theme/components/SelectableCard.d.ts.map +1 -0
  38. package/dist/theme/components/Toast.d.ts +79 -0
  39. package/dist/theme/components/Toast.d.ts.map +1 -0
  40. package/dist/theme/components/ToggleChip.d.ts +38 -0
  41. package/dist/theme/components/ToggleChip.d.ts.map +1 -0
  42. package/dist/theme/components/Tooltip.d.ts +40 -0
  43. package/dist/theme/components/Tooltip.d.ts.map +1 -0
  44. package/dist/theme/components/index.d.ts +8 -1
  45. package/dist/theme/components/index.d.ts.map +1 -1
  46. package/dist/theme/index.cjs +992 -16
  47. package/dist/theme/index.cjs.map +1 -1
  48. package/dist/theme/index.js +993 -17
  49. package/dist/theme/index.js.map +1 -1
  50. package/dist/useInstrumentedClick-B7QAnoBt.js +68 -0
  51. package/dist/useInstrumentedClick-B7QAnoBt.js.map +1 -0
  52. package/dist/useInstrumentedClick-COxikkTF.cjs +67 -0
  53. package/dist/useInstrumentedClick-COxikkTF.cjs.map +1 -0
  54. 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"}
@@ -0,0 +1,75 @@
1
+ /**
2
+ * Accordion / AccordionItem
3
+ *
4
+ * Design source:
5
+ * - design/screens/app/documents/note-editor/intake.jsx:29-37
6
+ * (NEIntakeBlock collapsible header pattern: surface-1 bg, border-bottom,
7
+ * fontSize:13/fontWeight:600 title, Icon chevronDown size:11 ink-3)
8
+ * - design/screens/app/settings/audit-logs.jsx (chevronDown expander rows)
9
+ *
10
+ * Header: full-width button, ink-1 title (fontSize 13, weight 600),
11
+ * trailing chevronDown Icon (size 11, ink-3), rotate(180deg) when open,
12
+ * transition: transform .15s; hover background: surface-1;
13
+ * borderRadius: r-md.
14
+ * Panel: content region below header; mount/unmount; paddingTop: 8.
15
+ * a11y: header <button aria-expanded>; panel role="region" + aria-labelledby.
16
+ * testId: forwarded as {testId}-header and {testId}-panel.
17
+ */
18
+ import { type ButtonHTMLAttributes, type CSSProperties, type ReactNode } from 'react';
19
+ export interface AccordionProps {
20
+ /** Allow multiple panels to be open simultaneously. Default: false (single-open). */
21
+ multiple?: boolean;
22
+ /** Uncontrolled default open value(s). */
23
+ defaultValue?: string | string[];
24
+ /** Controlled open value(s). */
25
+ value?: string | string[];
26
+ /** Called with the new open value(s) whenever a panel is toggled. */
27
+ onChange?: (value: string | string[]) => void;
28
+ children?: ReactNode;
29
+ /** Extra inline styles on the container. */
30
+ style?: CSSProperties;
31
+ /** Forwarded as data-testid on the root element. */
32
+ testId?: string;
33
+ }
34
+ export interface AccordionItemProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'title'> {
35
+ /** Unique value used for controlled/uncontrolled open state. */
36
+ value: string;
37
+ /** Header content — string or ReactNode. */
38
+ title: ReactNode;
39
+ /** Panel content. */
40
+ children?: ReactNode;
41
+ /** Forwarded as {testId}-header + {testId}-panel. */
42
+ testId?: string;
43
+ /** Extra inline styles on the outer item wrapper. */
44
+ style?: CSSProperties;
45
+ }
46
+ /**
47
+ * Accordion — collapsible section container.
48
+ *
49
+ * ```tsx
50
+ * <Accordion defaultValue="section-1">
51
+ * <AccordionItem value="section-1" title="Presenting problem" testId="pp">
52
+ * Content here…
53
+ * </AccordionItem>
54
+ * <AccordionItem value="section-2" title="Clinical history">
55
+ * More content…
56
+ * </AccordionItem>
57
+ * </Accordion>
58
+ * ```
59
+ */
60
+ export declare function Accordion({ multiple, defaultValue, value: controlledValue, onChange, children, style, testId, }: AccordionProps): import("react/jsx-runtime").JSX.Element;
61
+ /**
62
+ * AccordionItem — a single collapsible panel within an Accordion.
63
+ *
64
+ * Visual harvest from NEIntakeBlock (intake.jsx:29-37):
65
+ * header row: display:flex, alignItems:center, justifyContent:space-between
66
+ * background:var(--surface-1), borderBottom:1px solid var(--border)
67
+ * title: fontSize:13, fontWeight:600 (ink-1 inherited)
68
+ * icon: chevronDown size:11, color:var(--ink-3), rotates 180° when open
69
+ * transition: transform .15s
70
+ * hover: background:var(--surface-1)
71
+ *
72
+ * a11y: button aria-expanded; panel role="region" aria-labelledby headerId.
73
+ */
74
+ export declare const AccordionItem: import("react").ForwardRefExoticComponent<AccordionItemProps & import("react").RefAttributes<HTMLButtonElement>>;
75
+ //# sourceMappingURL=Accordion.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Accordion.d.ts","sourceRoot":"","sources":["../../../src/theme/components/Accordion.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAQL,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAIf,MAAM,WAAW,cAAc;IAC7B,qFAAqF;IACrF,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,0CAA0C;IAC1C,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACjC,gCAAgC;IAChC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC1B,qEAAqE;IACrE,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,IAAI,CAAC;IAC9C,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,4CAA4C;IAC5C,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,oDAAoD;IACpD,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,kBACf,SAAQ,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC9D,gEAAgE;IAChE,KAAK,EAAE,MAAM,CAAC;IACd,4CAA4C;IAC5C,KAAK,EAAE,SAAS,CAAC;IACjB,qBAAqB;IACrB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,qDAAqD;IACrD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,qDAAqD;IACrD,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAqBD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,SAAS,CAAC,EACxB,QAAgB,EAChB,YAAY,EACZ,KAAK,EAAE,eAAe,EACtB,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,MAAM,GACP,EAAE,cAAc,2CA8DhB;AAID;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,aAAa,kHAmGzB,CAAC"}
@@ -1,16 +1,36 @@
1
1
  import type { HTMLAttributes, ReactNode } from 'react';
2
2
  export type BadgeTone = 'neutral' | 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'ai';
3
3
  export type BadgeSize = 'sm' | 'md';
4
+ /**
5
+ * Explicit color override for dynamically-computed badge tones.
6
+ * Callers should pass CSS-var strings (e.g. `var(--success-soft)`) but
7
+ * arbitrary CSS color strings are accepted.
8
+ */
9
+ export interface BadgeColors {
10
+ /** Background color. */
11
+ bg: string;
12
+ /** Foreground (text) color. */
13
+ fg: string;
14
+ /** Leading dot color. Falls back to `fg` when omitted. */
15
+ dot?: string;
16
+ }
4
17
  export interface BadgeProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'children'> {
5
18
  tone?: BadgeTone;
6
19
  size?: BadgeSize;
7
20
  /** Show a leading colored dot. */
8
21
  dot?: boolean;
22
+ /**
23
+ * Explicit color override for dynamically-computed tones.
24
+ * When provided, overrides the `tone` token lookup.
25
+ * Callers should pass CSS-var strings but arbitrary CSS color strings are accepted.
26
+ * Named `tone` prop is still used as a semantic hint for tooling; `colors` wins visually.
27
+ */
28
+ colors?: BadgeColors;
9
29
  children?: ReactNode;
10
30
  /** Forwarded as `data-testid` for e2e selectors. */
11
31
  'data-testid'?: string;
12
32
  /** Alias of `data-testid` to keep the API uniform across primitives. */
13
33
  testId?: string;
14
34
  }
15
- export declare function Badge({ tone, size, dot, children, style, testId, 'data-testid': dataTestId, ...rest }: BadgeProps): import("react/jsx-runtime").JSX.Element;
35
+ export declare function Badge({ tone, size, dot, colors, children, style, testId, 'data-testid': dataTestId, ...rest }: BadgeProps): import("react/jsx-runtime").JSX.Element;
16
36
  //# sourceMappingURL=Badge.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../../src/theme/components/Badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtE,MAAM,MAAM,SAAS,GACjB,SAAS,GACT,SAAS,GACT,SAAS,GACT,SAAS,GACT,QAAQ,GACR,MAAM,GACN,IAAI,CAAC;AACT,MAAM,MAAM,SAAS,GAAG,IAAI,GAAG,IAAI,CAAC;AA4BpC,MAAM,WAAW,UAAW,SAAQ,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC,EAAE,UAAU,CAAC;IACnF,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,kCAAkC;IAClC,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,oDAAoD;IACpD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,wEAAwE;IACxE,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,KAAK,CAAC,EACpB,IAAgB,EAChB,IAAW,EACX,GAAG,EACH,QAAQ,EACR,KAAK,EACL,MAAM,EACN,aAAa,EAAE,UAAU,EACzB,GAAG,IAAI,EACR,EAAE,UAAU,2CAsCZ"}
1
+ {"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../../src/theme/components/Badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtE,MAAM,MAAM,SAAS,GACjB,SAAS,GACT,SAAS,GACT,SAAS,GACT,SAAS,GACT,QAAQ,GACR,MAAM,GACN,IAAI,CAAC;AACT,MAAM,MAAM,SAAS,GAAG,IAAI,GAAG,IAAI,CAAC;AAEpC;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,wBAAwB;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,+BAA+B;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,0DAA0D;IAC1D,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AA4BD,MAAM,WAAW,UAAW,SAAQ,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC,EAAE,UAAU,CAAC;IACnF,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,kCAAkC;IAClC,GAAG,CAAC,EAAE,OAAO,CAAC;IACd;;;;;OAKG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,oDAAoD;IACpD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,wEAAwE;IACxE,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,KAAK,CAAC,EACpB,IAAgB,EAChB,IAAW,EACX,GAAG,EACH,MAAM,EACN,QAAQ,EACR,KAAK,EACL,MAAM,EACN,aAAa,EAAE,UAAU,EACzB,GAAG,IAAI,EACR,EAAE,UAAU,2CA0CZ"}
@@ -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"}
@@ -1,10 +1,45 @@
1
- import type { HTMLAttributes, ReactNode } from 'react';
1
+ import { type HTMLAttributes, type ReactNode } from 'react';
2
2
  export interface CardProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
3
3
  /** Inner padding in pixels. Defaults to 20. */
4
4
  padding?: number;
5
5
  children?: ReactNode;
6
6
  /** Forwarded as `data-testid` on the root div. */
7
7
  testId?: string;
8
+ /**
9
+ * Renders the card in a selected/active state:
10
+ * - border becomes 1px var(--primary) (border-width unchanged, only color changes)
11
+ * - outer ring: 0 0 0 3px var(--primary-ring)
12
+ * - background tint: var(--primary-soft)
13
+ *
14
+ * Harvested from design/screens/app/clients/modals/create-client.jsx:191-213
15
+ * (TypeCard: r-md, 1px border, shadow-xs unselected) and
16
+ * create-inquiry.jsx SourceCard (same pattern).
17
+ */
18
+ selected?: boolean;
19
+ /**
20
+ * Makes the card interactive (pointer cursor, hover surface lift, focus-visible
21
+ * primary ring). Automatically inferred when an `onClick` handler is provided.
22
+ * Renders as a `<button>` when interactive so keyboard activation works natively.
23
+ *
24
+ * Harvested from create-client.jsx TypeCard (cursor:pointer + button element)
25
+ * and create-inquiry.jsx SourceCard (same treatment).
26
+ */
27
+ interactive?: boolean;
8
28
  }
9
- export declare function Card({ padding, children, style, testId, ...rest }: CardProps): import("react/jsx-runtime").JSX.Element;
29
+ /**
30
+ * Card — base surface primitive.
31
+ *
32
+ * Default (no extra props): white surface, r-lg radius, 1px border — identical
33
+ * to the original Card and 100% backward-compatible.
34
+ *
35
+ * Interactive/selected variant: r-md radius to match TypeCard / SourceCard design
36
+ * sources (create-client.jsx:198, create-inquiry.jsx:292). Non-selected interactive
37
+ * cards carry shadow-xs; selected state swaps it for the primary-ring glow.
38
+ *
39
+ * Enhanced:
40
+ * selected — primary ring + tint background (design TypeCard / CoupleCard pattern)
41
+ * interactive — pointer cursor, keyboard activation via <button> root
42
+ * (automatically inferred when onClick is supplied)
43
+ */
44
+ export declare const Card: import("react").ForwardRefExoticComponent<CardProps & import("react").RefAttributes<HTMLElement>>;
10
45
  //# sourceMappingURL=Card.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../../src/theme/components/Card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtE,MAAM,WAAW,SAAU,SAAQ,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC;IACjF,+CAA+C;IAC/C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,kDAAkD;IAClD,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,IAAI,CAAC,EAAE,OAAY,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,EAAE,SAAS,2CAajF"}
1
+ {"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../../src/theme/components/Card.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,cAAc,EAKnB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,MAAM,WAAW,SAAU,SAAQ,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC;IACjF,+CAA+C;IAC/C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,kDAAkD;IAClD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;;;;;OASG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;;;OAOG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,IAAI,mGAqFf,CAAC"}
@@ -0,0 +1,54 @@
1
+ import { type HTMLAttributes, type ReactNode } from 'react';
2
+ /**
3
+ * DarkScope — scoped dark-room wrapper.
4
+ *
5
+ * Applies the existing `[data-theme="dark"]` token block (tokens.css:120+)
6
+ * to **a subtree** by setting `data-theme="dark"` on a container div plus
7
+ * `color-scheme: dark` via inline style. Every theme component inside renders
8
+ * dark automatically — no per-component `tone="dark"` prop needed.
9
+ *
10
+ * Primary use-case: Telehealth video room (`/telehealth/$roomId`) where the
11
+ * full viewport must be dark regardless of the user's global theme setting.
12
+ *
13
+ * Design source:
14
+ * - `design/screens/app/sessions/telehealth-room.jsx` — immersive dark video
15
+ * room layout; the root `background: '#0f1117'` is the design's intent; we
16
+ * use `var(--bg)` from the dark token block instead of the hardcoded hex so
17
+ * the full dark palette applies to all children.
18
+ * - `teja-ui/src/theme/tokens.css:120` — `[data-theme="dark"]` block with
19
+ * full dark surface/ink/border/shadow/semantic token overrides.
20
+ *
21
+ * Tokens consumed (all from the `[data-theme="dark"]` block in tokens.css):
22
+ * --bg, --surface-0..3, --sidebar, --border, --border-strong, --divider,
23
+ * --ink-1..5, --primary-soft, --success/warning/danger/info/ai (-soft),
24
+ * --shadow-xs/sm/md/lg/pop (resolved via color-scheme:dark cascade).
25
+ *
26
+ * Decision note: the token-scope approach (data-theme="dark" on a subtree)
27
+ * covers EVERY theme component for free — do NOT add per-component tone="dark"
28
+ * props. See GAP-PRIMITIVES-BUILD-SPEC.md §6.
29
+ */
30
+ export interface DarkScopeProps extends HTMLAttributes<HTMLDivElement> {
31
+ children?: ReactNode;
32
+ /**
33
+ * Forwarded as `data-testid` on the root div for e2e selectors.
34
+ * Also accepts the raw `data-testid` attribute for consistency with
35
+ * components that expose both forms (e.g. Badge).
36
+ */
37
+ testId?: string;
38
+ /** Raw `data-testid` — takes precedence over `testId`. */
39
+ 'data-testid'?: string;
40
+ }
41
+ /**
42
+ * Scoped dark wrapper. Renders a `div` with `data-theme="dark"` so all
43
+ * `@teja-app/ui/theme` components in the subtree pick up dark tokens.
44
+ *
45
+ * @example
46
+ * ```tsx
47
+ * <DarkScope style={{ position: 'fixed', inset: 0 }}>
48
+ * <Card>Dark-themed card</Card>
49
+ * <Button variant="primary">Join</Button>
50
+ * </DarkScope>
51
+ * ```
52
+ */
53
+ export declare const DarkScope: import("react").ForwardRefExoticComponent<DarkScopeProps & import("react").RefAttributes<HTMLDivElement>>;
54
+ //# sourceMappingURL=DarkScope.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DarkScope.d.ts","sourceRoot":"","sources":["../../../src/theme/components/DarkScope.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,cAAc,EACnB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,WAAW,cAAe,SAAQ,cAAc,CAAC,cAAc,CAAC;IACpE,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,0DAA0D;IAC1D,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,SAAS,2GAsBrB,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"}
@@ -0,0 +1,84 @@
1
+ /**
2
+ * Menu / MenuItem / MenuDivider
3
+ *
4
+ * Design source:
5
+ * - design/screens/app/appointments/modals/flyout.jsx:514 (FlyoutOverflowMenu)
6
+ * - design/components/shell.jsx:524 (NotificationBell dropdown pattern)
7
+ *
8
+ * Panel: position:absolute, top:100%, right:0, marginTop:4, zIndex high,
9
+ * minWidth:220, --surface-0 bg, 1px --border border, --r-md radius,
10
+ * shadow-pop, padding:4.
11
+ * Item: flex, gap:8, 100% width, padding 8px 10px, --r-sm radius,
12
+ * transparent bg, cursor:pointer, fontSize:12.5, --ink-1 / --danger
13
+ * color, hover --surface-1.
14
+ * Divider: hr, border:0, borderTop 1px --divider, margin 4px 2px.
15
+ * Backdrop: fixed inset:0 click-catcher (shell.jsx pattern).
16
+ */
17
+ import { type ButtonHTMLAttributes, type CSSProperties, type HTMLAttributes, type ReactNode } from 'react';
18
+ import { type IconName } from './Icon';
19
+ export type MenuPlacement = 'bottom-end' | 'bottom-start' | 'top-end' | 'top-start';
20
+ export interface MenuProps {
21
+ /** Controlled open state. */
22
+ open: boolean;
23
+ /** Called when the menu should close (outside click, Escape, item click). */
24
+ onClose: () => void;
25
+ /**
26
+ * Trigger element — rendered as the anchor. The menu positions itself
27
+ * relative to this via the parent `position:relative` wrapper.
28
+ */
29
+ trigger?: ReactNode;
30
+ children?: ReactNode;
31
+ /** Placement relative to the trigger. Default: bottom-end. */
32
+ placement?: MenuPlacement;
33
+ /** Minimum width of the panel. Default: 220. */
34
+ minWidth?: number;
35
+ /** z-index of the backdrop + panel. Default: 200. */
36
+ zIndex?: number;
37
+ /** Forwarded as `data-testid` on the panel element. */
38
+ testId?: string;
39
+ /** Extra inline styles for the panel. */
40
+ style?: CSSProperties;
41
+ }
42
+ export interface MenuItemProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'> {
43
+ /** Leading icon name from the Teja icon set. */
44
+ icon?: IconName;
45
+ /** Render in danger (red) color. */
46
+ danger?: boolean;
47
+ children?: ReactNode;
48
+ /** Forwarded as `data-testid`. */
49
+ testId?: string;
50
+ }
51
+ export type MenuDividerProps = Omit<HTMLAttributes<HTMLHRElement>, 'children'>;
52
+ /**
53
+ * Menu — floating action panel.
54
+ *
55
+ * ```tsx
56
+ * const [open, setOpen] = useState(false);
57
+ * <Menu open={open} onClose={() => setOpen(false)} trigger={<IconButton>…</IconButton>}>
58
+ * <MenuItem icon="edit" onClick={…}>Edit</MenuItem>
59
+ * <MenuDivider />
60
+ * <MenuItem icon="trash" danger onClick={…}>Delete</MenuItem>
61
+ * </Menu>
62
+ * ```
63
+ */
64
+ export declare function Menu({ open, onClose, trigger, children, placement, minWidth, zIndex, testId, style, }: MenuProps): import("react/jsx-runtime").JSX.Element;
65
+ /**
66
+ * MenuItem — action row inside a Menu.
67
+ *
68
+ * Harvested from FlyoutOverflowMenu button styling (flyout.jsx:527-539):
69
+ * display:flex, alignItems:center, gap:8, width:100%,
70
+ * padding:8px 10px, border:0, borderRadius:var(--r-sm),
71
+ * background:transparent, cursor:pointer, fontFamily:inherit,
72
+ * fontSize:12.5, color:--ink-1 / --danger, textAlign:left.
73
+ * Icon size:12, color:--ink-3 / --danger.
74
+ * hover: background:--surface-1 (added via data-hover state).
75
+ */
76
+ export declare const MenuItem: import("react").ForwardRefExoticComponent<MenuItemProps & import("react").RefAttributes<HTMLButtonElement>>;
77
+ /**
78
+ * MenuDivider — horizontal rule between item groups.
79
+ *
80
+ * Harvested from FlyoutOverflowMenu hr (flyout.jsx:525):
81
+ * border:0; borderTop:1px solid var(--divider); margin:4px 2px.
82
+ */
83
+ export declare function MenuDivider({ style, ...rest }: MenuDividerProps): import("react/jsx-runtime").JSX.Element;
84
+ //# sourceMappingURL=Menu.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../../../src/theme/components/Menu.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAML,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,EAAQ,KAAK,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAI7C,MAAM,MAAM,aAAa,GAAG,YAAY,GAAG,cAAc,GAAG,SAAS,GAAG,WAAW,CAAC;AAEpF,MAAM,WAAW,SAAS;IACxB,6BAA6B;IAC7B,IAAI,EAAE,OAAO,CAAC;IACd,6EAA6E;IAC7E,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,8DAA8D;IAC9D,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,gDAAgD;IAChD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,qDAAqD;IACrD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,uDAAuD;IACvD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,yCAAyC;IACzC,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAED,MAAM,WAAW,aACf,SAAQ,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,UAAU,CAAC;IACjE,gDAAgD;IAChD,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,oCAAoC;IACpC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,kCAAkC;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,EAAE,UAAU,CAAC,CAAC;AA4B/E;;;;;;;;;;;GAWG;AACH,wBAAgB,IAAI,CAAC,EACnB,IAAI,EACJ,OAAO,EACP,OAAO,EACP,QAAQ,EACR,SAAwB,EACxB,QAAc,EACd,MAAY,EACZ,MAAM,EACN,KAAK,GACN,EAAE,SAAS,2CAsEX;AAID;;;;;;;;;;GAUG;AACH,eAAO,MAAM,QAAQ,6GA2DnB,CAAC;AAIH;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,EAAE,gBAAgB,2CAa/D"}
@@ -1 +1 @@
1
- {"version":3,"file":"SegmentedControl.d.ts","sourceRoot":"","sources":["../../../src/theme/components/SegmentedControl.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtD,MAAM,WAAW,oBAAoB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IAC7D,KAAK,EAAE,CAAC,CAAC;IACT,KAAK,EAAE,SAAS,CAAC;CAClB;AAED,MAAM,WAAW,qBAAqB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IAC9D,KAAK,EAAE,aAAa,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9C,KAAK,EAAE,CAAC,CAAC;IACT,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;IAC9B,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,EAC1D,KAAK,EACL,KAAK,EACL,QAAQ,EACR,IAAW,EACX,KAAK,EACL,MAAM,GACP,EAAE,qBAAqB,CAAC,CAAC,CAAC,2CAiD1B"}
1
+ {"version":3,"file":"SegmentedControl.d.ts","sourceRoot":"","sources":["../../../src/theme/components/SegmentedControl.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtD,MAAM,WAAW,oBAAoB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IAC7D,KAAK,EAAE,CAAC,CAAC;IACT,KAAK,EAAE,SAAS,CAAC;CAClB;AAED,MAAM,WAAW,qBAAqB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IAC9D,KAAK,EAAE,aAAa,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9C,KAAK,EAAE,CAAC,CAAC;IACT,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;IAC9B,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,EAC1D,KAAK,EACL,KAAK,EACL,QAAQ,EACR,IAAW,EACX,KAAK,EACL,MAAM,GACP,EAAE,qBAAqB,CAAC,CAAC,CAAC,2CAkD1B"}
@@ -0,0 +1,34 @@
1
+ import { type ButtonHTMLAttributes, type ReactNode } from 'react';
2
+ /**
3
+ * SelectableCard — generic selectable card primitive.
4
+ *
5
+ * Generalises `RoleTile` to arbitrary children (no hard-coded icon + title +
6
+ * description layout). Accepts `selected` + `onSelect` and renders as a full-
7
+ * width `<button>` with the same primary-border / primary-soft-bg / shadow-xs
8
+ * treatment as RoleTile.
9
+ *
10
+ * Design source: teja-ui/src/theme/components/RoleTile.tsx — lines 31–111
11
+ * (button shell, border/bg/shadow token assignments, disabled dimming).
12
+ *
13
+ * Usage:
14
+ * <SelectableCard selected={picked === 'a'} onSelect={() => setPicked('a')}>
15
+ * <MyCardContent />
16
+ * </SelectableCard>
17
+ */
18
+ export type SelectableCardRole = 'radio' | 'checkbox';
19
+ export interface SelectableCardProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'role' | 'aria-checked'> {
20
+ /** Whether this card is currently selected. */
21
+ selected: boolean;
22
+ /** ARIA role. Defaults to "radio" for single-select groups; use "checkbox" for multi-select. */
23
+ role?: SelectableCardRole;
24
+ /** Called when the card is clicked (or activated via keyboard). */
25
+ onSelect?: () => void;
26
+ /** When true the card is visually dimmed and non-interactive. */
27
+ disabled?: boolean;
28
+ /** Forwarded to `data-testid`. */
29
+ testId?: string;
30
+ /** Card body — any React content. */
31
+ children?: ReactNode;
32
+ }
33
+ export declare const SelectableCard: import("react").ForwardRefExoticComponent<SelectableCardProps & import("react").RefAttributes<HTMLButtonElement>>;
34
+ //# sourceMappingURL=SelectableCard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SelectableCard.d.ts","sourceRoot":"","sources":["../../../src/theme/components/SelectableCard.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,oBAAoB,EAAsB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAElG;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,UAAU,CAAC;AAEtD,MAAM,WAAW,mBACf,SAAQ,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,MAAM,GAAG,cAAc,CAAC;IAC9E,+CAA+C;IAC/C,QAAQ,EAAE,OAAO,CAAC;IAClB,gGAAgG;IAChG,IAAI,CAAC,EAAE,kBAAkB,CAAC;IAC1B,mEAAmE;IACnE,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,iEAAiE;IACjE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,kCAAkC;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,qCAAqC;IACrC,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,eAAO,MAAM,cAAc,mHA+D1B,CAAC"}