@exponential_app/eui-react 0.0.0-stage → 0.2.1

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 (102) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +54 -0
  3. package/README.md +360 -2
  4. package/dist/chunks/index-5yzzfez5.js +126 -0
  5. package/dist/chunks/index-5yzzfez5.js.map +11 -0
  6. package/dist/exponential-ui-react.css +2 -0
  7. package/dist/index.js +7700 -0
  8. package/dist/index.js.map +46 -0
  9. package/dist/primitives/index.js +3154 -0
  10. package/dist/primitives/index.js.map +59 -0
  11. package/dist/types/context.d.ts +96 -0
  12. package/dist/types/extensions.d.ts +25 -0
  13. package/dist/types/form.d.ts +65 -0
  14. package/dist/types/host-surface.d.ts +32 -0
  15. package/dist/types/host.d.ts +37 -0
  16. package/dist/types/icons.d.ts +31 -0
  17. package/dist/types/index.d.ts +37 -0
  18. package/dist/types/inputs.d.ts +25 -0
  19. package/dist/types/list.d.ts +31 -0
  20. package/dist/types/live.d.ts +18 -0
  21. package/dist/types/markdown.d.ts +9 -0
  22. package/dist/types/media.d.ts +15 -0
  23. package/dist/types/natives/actions.d.ts +10 -0
  24. package/dist/types/natives/bound.d.ts +2 -0
  25. package/dist/types/natives/chart.d.ts +2 -0
  26. package/dist/types/natives/chips.d.ts +5 -0
  27. package/dist/types/natives/choice-tiles.d.ts +2 -0
  28. package/dist/types/natives/code.d.ts +2 -0
  29. package/dist/types/natives/dates.d.ts +29 -0
  30. package/dist/types/natives/feedback.d.ts +29 -0
  31. package/dist/types/natives/index.d.ts +4 -0
  32. package/dist/types/natives/inputs.d.ts +19 -0
  33. package/dist/types/natives/layout.d.ts +15 -0
  34. package/dist/types/natives/listbox.d.ts +15 -0
  35. package/dist/types/natives/media.d.ts +13 -0
  36. package/dist/types/natives/nav.d.ts +17 -0
  37. package/dist/types/natives/overlays.d.ts +17 -0
  38. package/dist/types/natives/qr.d.ts +3 -0
  39. package/dist/types/natives/resizable.d.ts +2 -0
  40. package/dist/types/natives/search.d.ts +46 -0
  41. package/dist/types/natives/select.d.ts +8 -0
  42. package/dist/types/natives/shared.d.ts +35 -0
  43. package/dist/types/natives/table.d.ts +5 -0
  44. package/dist/types/natives/text.d.ts +4 -0
  45. package/dist/types/node-view.d.ts +73 -0
  46. package/dist/types/platform.d.ts +12 -0
  47. package/dist/types/primitives/alert-dialog.d.ts +14 -0
  48. package/dist/types/primitives/alert.d.ts +7 -0
  49. package/dist/types/primitives/avatar-color.d.ts +1 -0
  50. package/dist/types/primitives/avatar.d.ts +8 -0
  51. package/dist/types/primitives/badge.d.ts +8 -0
  52. package/dist/types/primitives/breadcrumb.d.ts +11 -0
  53. package/dist/types/primitives/button.d.ts +7 -0
  54. package/dist/types/primitives/calendar.d.ts +8 -0
  55. package/dist/types/primitives/card.d.ts +9 -0
  56. package/dist/types/primitives/checkbox.d.ts +4 -0
  57. package/dist/types/primitives/choice-tiles.d.ts +60 -0
  58. package/dist/types/primitives/cn.d.ts +1 -0
  59. package/dist/types/primitives/code-block.d.ts +32 -0
  60. package/dist/types/primitives/collapsible.d.ts +6 -0
  61. package/dist/types/primitives/command.d.ts +49 -0
  62. package/dist/types/primitives/context-ring.d.ts +15 -0
  63. package/dist/types/primitives/dialog-arms.d.ts +2 -0
  64. package/dist/types/primitives/dialog.d.ts +32 -0
  65. package/dist/types/primitives/disclosure-header.d.ts +7 -0
  66. package/dist/types/primitives/dock-card.d.ts +43 -0
  67. package/dist/types/primitives/dropdown-menu.d.ts +26 -0
  68. package/dist/types/primitives/empty-state.d.ts +19 -0
  69. package/dist/types/primitives/glass-card.d.ts +3 -0
  70. package/dist/types/primitives/hover-card.d.ts +6 -0
  71. package/dist/types/primitives/icon-disc.d.ts +10 -0
  72. package/dist/types/primitives/index.d.ts +52 -0
  73. package/dist/types/primitives/input.d.ts +4 -0
  74. package/dist/types/primitives/kbd.d.ts +4 -0
  75. package/dist/types/primitives/label.d.ts +4 -0
  76. package/dist/types/primitives/menu-surface.d.ts +1 -0
  77. package/dist/types/primitives/meter.d.ts +10 -0
  78. package/dist/types/primitives/popover.d.ts +7 -0
  79. package/dist/types/primitives/progress-ring.d.ts +12 -0
  80. package/dist/types/primitives/progress.d.ts +4 -0
  81. package/dist/types/primitives/scroll-area.d.ts +5 -0
  82. package/dist/types/primitives/segmented-control.d.ts +25 -0
  83. package/dist/types/primitives/select.d.ts +15 -0
  84. package/dist/types/primitives/separator.d.ts +4 -0
  85. package/dist/types/primitives/sheet-chrome.d.ts +13 -0
  86. package/dist/types/primitives/sheet.d.ts +18 -0
  87. package/dist/types/primitives/skeleton.d.ts +3 -0
  88. package/dist/types/primitives/spinner.d.ts +8 -0
  89. package/dist/types/primitives/switch.d.ts +6 -0
  90. package/dist/types/primitives/table.d.ts +11 -0
  91. package/dist/types/primitives/tabs.d.ts +8 -0
  92. package/dist/types/primitives/textarea.d.ts +3 -0
  93. package/dist/types/primitives/toast.d.ts +16 -0
  94. package/dist/types/primitives/tooltip.d.ts +7 -0
  95. package/dist/types/primitives/truncate.d.ts +1 -0
  96. package/dist/types/primitives/use-media-query.d.ts +3 -0
  97. package/dist/types/primitives/use-mobile.d.ts +1 -0
  98. package/dist/types/primitives/use-sheet-drag.d.ts +20 -0
  99. package/dist/types/primitives/voice-wave.d.ts +22 -0
  100. package/dist/types/surface.d.ts +117 -0
  101. package/dist/types/use-surface.d.ts +57 -0
  102. package/package.json +60 -4
@@ -0,0 +1,52 @@
1
+ export * from "./alert.js";
2
+ export * from "./alert-dialog.js";
3
+ export * from "./avatar.js";
4
+ export * from "./avatar-color.js";
5
+ export * from "./badge.js";
6
+ export * from "./breadcrumb.js";
7
+ export * from "./button.js";
8
+ export * from "./calendar.js";
9
+ export * from "./card.js";
10
+ export * from "./checkbox.js";
11
+ export * from "./choice-tiles.js";
12
+ export * from "./cn.js";
13
+ export * from "./code-block.js";
14
+ export * from "./collapsible.js";
15
+ export * from "./command.js";
16
+ export * from "./context-ring.js";
17
+ export * from "./dialog.js";
18
+ export * from "./dialog-arms.js";
19
+ export * from "./disclosure-header.js";
20
+ export * from "./dock-card.js";
21
+ export * from "./dropdown-menu.js";
22
+ export * from "./empty-state.js";
23
+ export * from "./glass-card.js";
24
+ export * from "./hover-card.js";
25
+ export * from "./icon-disc.js";
26
+ export * from "./input.js";
27
+ export * from "./kbd.js";
28
+ export * from "./label.js";
29
+ export * from "./menu-surface.js";
30
+ export * from "./meter.js";
31
+ export * from "./popover.js";
32
+ export * from "./progress.js";
33
+ export * from "./progress-ring.js";
34
+ export * from "./scroll-area.js";
35
+ export * from "./segmented-control.js";
36
+ export * from "./select.js";
37
+ export * from "./separator.js";
38
+ export * from "./sheet.js";
39
+ export * from "./sheet-chrome.js";
40
+ export * from "./skeleton.js";
41
+ export * from "./spinner.js";
42
+ export * from "./switch.js";
43
+ export * from "./table.js";
44
+ export * from "./tabs.js";
45
+ export * from "./textarea.js";
46
+ export * from "./toast.js";
47
+ export * from "./tooltip.js";
48
+ export * from "./truncate.js";
49
+ export * from "./use-media-query.js";
50
+ export * from "./use-mobile.js";
51
+ export * from "./use-sheet-drag.js";
52
+ export * from "./voice-wave.js";
@@ -0,0 +1,4 @@
1
+ import * as React from "react";
2
+ export { BARE_FIELD_CLASS, FIELD_CHROME_CLASS } from "@exponential_app/eui/web/primitives";
3
+ declare const Input: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
4
+ export { Input };
@@ -0,0 +1,4 @@
1
+ import * as React from "react";
2
+ declare function Kbd({ className, ...props }: React.ComponentProps<`kbd`>): import("react/jsx-runtime").JSX.Element;
3
+ declare function KbdGroup({ className, ...props }: React.ComponentProps<`span`>): import("react/jsx-runtime").JSX.Element;
4
+ export { Kbd, KbdGroup };
@@ -0,0 +1,4 @@
1
+ import * as React from "react";
2
+ import { Label as LabelPrimitive } from "radix-ui";
3
+ declare function Label({ className, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
4
+ export { Label };
@@ -0,0 +1 @@
1
+ export { MENU_CHECK_ITEM_CLASS, MENU_CHEVRON_CLASS, MENU_CONTENT_CLASS, MENU_ITEM_CLASS, MENU_LABEL_CLASS, MENU_SEPARATOR_CLASS, MENU_SHORTCUT_CLASS, MENU_SUB_TRIGGER_CLASS, MENU_SURFACE_CLASS, MENU_VALUE_CLASS } from "@exponential_app/eui/web/primitives";
@@ -0,0 +1,10 @@
1
+ import * as React from "react";
2
+ import { type MeterTone } from "@exponential_app/eui/web/primitives";
3
+ import { Progress } from "./progress.js";
4
+ export type { MeterTone } from "@exponential_app/eui/web/primitives";
5
+ export declare function Meter({ value, tone, className, ...props }: Omit<React.ComponentProps<typeof Progress>, `value`> & {
6
+ /** 0-100, the caller clamps (`parseWindow` already does). `null` =
7
+ * indeterminate: work with a duration but no measurable progress. */
8
+ value: number | null;
9
+ tone?: MeterTone;
10
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import * as React from "react";
2
+ import { Popover as PopoverPrimitive } from "radix-ui";
3
+ declare function Popover({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
4
+ declare function PopoverTrigger({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
5
+ declare function PopoverContent({ className, align, sideOffset, ...props }: React.ComponentProps<typeof PopoverPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
6
+ declare function PopoverAnchor({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Anchor>): import("react/jsx-runtime").JSX.Element;
7
+ export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor };
@@ -0,0 +1,12 @@
1
+ export { progressRingPercent } from "@exponential_app/eui/web/primitives";
2
+ export declare function ProgressRing({ done, total, size, colorClass, colorHex, className, }: {
3
+ done: number;
4
+ total: number;
5
+ /** Rendered box in px. */
6
+ size?: number;
7
+ /** A `text-*` token class — the builtin completed status. */
8
+ colorClass?: string;
9
+ /** A synced hex — a custom completed row. Wins over `colorClass`. */
10
+ colorHex?: string;
11
+ className?: string;
12
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ import * as React from "react";
2
+ import { Progress as ProgressPrimitive } from "radix-ui";
3
+ declare function Progress({ className, value, ...props }: React.ComponentProps<typeof ProgressPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
4
+ export { Progress };
@@ -0,0 +1,5 @@
1
+ import * as React from "react";
2
+ import { ScrollArea as ScrollAreaPrimitive } from "radix-ui";
3
+ declare function ScrollArea({ className, children, ...props }: React.ComponentProps<typeof ScrollAreaPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
4
+ declare function ScrollBar({ className, orientation, ...props }: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>): import("react/jsx-runtime").JSX.Element;
5
+ export { ScrollArea, ScrollBar };
@@ -0,0 +1,25 @@
1
+ import * as React from "react";
2
+ import type { LucideIcon } from "lucide-react";
3
+ interface SegmentedOption<TValue extends string> {
4
+ value: TValue;
5
+ label: React.ReactNode;
6
+ /** A leading glyph. A concept icon, never a raw lucide import. */
7
+ icon?: LucideIcon;
8
+ disabled?: boolean;
9
+ }
10
+ interface SegmentedControlProps<TValue extends string> {
11
+ value: TValue;
12
+ onValueChange: (value: TValue) => void;
13
+ options: readonly SegmentedOption<TValue>[];
14
+ /** Span the container instead of the capsule's natural `w-fit`, so the
15
+ * segments (already `flex-1`) share it equally. For narrow slots — a side
16
+ * panel — where the natural width overflows and clips the last label. */
17
+ fill?: boolean;
18
+ /** Disables every segment. */
19
+ disabled?: boolean;
20
+ /** Extra classes on the strip (the `TabsList`). */
21
+ className?: string;
22
+ }
23
+ declare function SegmentedControl<TValue extends string>({ value, onValueChange, options, fill, disabled, className, }: SegmentedControlProps<TValue>): import("react/jsx-runtime").JSX.Element;
24
+ export { SegmentedControl };
25
+ export type { SegmentedControlProps, SegmentedOption };
@@ -0,0 +1,15 @@
1
+ import * as React from "react";
2
+ import { Select as SelectPrimitive } from "radix-ui";
3
+ declare function Select({ ...props }: React.ComponentProps<typeof SelectPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
4
+ declare function SelectGroup({ ...props }: React.ComponentProps<typeof SelectPrimitive.Group>): import("react/jsx-runtime").JSX.Element;
5
+ declare function SelectValue({ ...props }: React.ComponentProps<typeof SelectPrimitive.Value>): import("react/jsx-runtime").JSX.Element;
6
+ declare function SelectTrigger({ className, size, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
7
+ size?: `sm` | `default`;
8
+ }): import("react/jsx-runtime").JSX.Element;
9
+ declare function SelectContent({ className, children, position, align, ...props }: React.ComponentProps<typeof SelectPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
10
+ declare function SelectLabel({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Label>): import("react/jsx-runtime").JSX.Element;
11
+ declare function SelectItem({ className, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Item>): import("react/jsx-runtime").JSX.Element;
12
+ declare function SelectSeparator({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Separator>): import("react/jsx-runtime").JSX.Element;
13
+ declare function SelectScrollUpButton({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>): import("react/jsx-runtime").JSX.Element;
14
+ declare function SelectScrollDownButton({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>): import("react/jsx-runtime").JSX.Element;
15
+ export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, };
@@ -0,0 +1,4 @@
1
+ import * as React from "react";
2
+ import { Separator as SeparatorPrimitive } from "radix-ui";
3
+ declare function Separator({ className, orientation, decorative, ...props }: React.ComponentProps<typeof SeparatorPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
4
+ export { Separator };
@@ -0,0 +1,13 @@
1
+ import * as React from "react";
2
+ import type { SheetDragHandleProps } from "./use-sheet-drag.js";
3
+ export declare function SheetDragProvider({ value, children, }: {
4
+ value: SheetDragHandleProps | null;
5
+ children: React.ReactNode;
6
+ }): import("react/jsx-runtime").JSX.Element;
7
+ /**
8
+ * The drag props of the enclosing sheet, or `null` outside one (a desktop
9
+ * panel, a side drawer). Header components spread these so the whole title
10
+ * area is draggable, not just the 4px bar.
11
+ */
12
+ export declare function useSheetDragHandleProps(): SheetDragHandleProps | null;
13
+ export declare function SheetGrabber({ className, ...props }: React.ComponentProps<`div`>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,18 @@
1
+ import * as React from "react";
2
+ import { Dialog as SheetPrimitive } from "radix-ui";
3
+ import { type SheetSide } from "@exponential_app/eui/web/primitives";
4
+ declare function Sheet({ ...props }: React.ComponentProps<typeof SheetPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
5
+ declare function SheetTrigger({ ...props }: React.ComponentProps<typeof SheetPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
6
+ declare function SheetClose({ ...props }: React.ComponentProps<typeof SheetPrimitive.Close>): import("react/jsx-runtime").JSX.Element;
7
+ declare function SheetContent({ className, children, side, showCloseButton, showGrabber, ref, onInteractOutside, ...props }: React.ComponentProps<typeof SheetPrimitive.Content> & {
8
+ side?: SheetSide;
9
+ showCloseButton?: boolean;
10
+ /** The drag pill at the top edge. On by default for `bottom`; the two
11
+ * page-like bottom sheets (New issue, search) turn it off. */
12
+ showGrabber?: boolean;
13
+ }): import("react/jsx-runtime").JSX.Element;
14
+ declare function SheetHeader({ className, ...props }: React.ComponentProps<`div`>): import("react/jsx-runtime").JSX.Element;
15
+ declare function SheetFooter({ className, ...props }: React.ComponentProps<`div`>): import("react/jsx-runtime").JSX.Element;
16
+ declare function SheetTitle({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Title>): import("react/jsx-runtime").JSX.Element;
17
+ declare function SheetDescription({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Description>): import("react/jsx-runtime").JSX.Element;
18
+ export { Sheet, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription, };
@@ -0,0 +1,3 @@
1
+ import * as React from "react";
2
+ declare function Skeleton({ className, ...props }: React.ComponentProps<`div`>): import("react/jsx-runtime").JSX.Element;
3
+ export { Skeleton };
@@ -0,0 +1,8 @@
1
+ import type * as React from "react";
2
+ declare function Spinner({ size, label, className, ...props }: Omit<React.ComponentProps<`svg`>, `children`> & {
3
+ size?: number;
4
+ /** The accessible name; the glyph itself never carries words. */
5
+ label?: string;
6
+ className?: string;
7
+ }): import("react/jsx-runtime").JSX.Element;
8
+ export { Spinner };
@@ -0,0 +1,6 @@
1
+ import * as React from "react";
2
+ import { Switch as SwitchPrimitive } from "radix-ui";
3
+ declare function Switch({ className, size, ...props }: React.ComponentProps<typeof SwitchPrimitive.Root> & {
4
+ size?: `sm` | `default`;
5
+ }): import("react/jsx-runtime").JSX.Element;
6
+ export { Switch };
@@ -0,0 +1,11 @@
1
+ import * as React from "react";
2
+ declare function Table({ className, ...props }: React.ComponentProps<`table`>): import("react/jsx-runtime").JSX.Element;
3
+ declare function TableHeader({ className, ...props }: React.ComponentProps<`thead`>): import("react/jsx-runtime").JSX.Element;
4
+ declare function TableBody({ className, ...props }: React.ComponentProps<`tbody`>): import("react/jsx-runtime").JSX.Element;
5
+ declare function TableFooter({ className, ...props }: React.ComponentProps<`tfoot`>): import("react/jsx-runtime").JSX.Element;
6
+ /** A selected row says so with `data-state="selected"` (shadcn's convention). */
7
+ declare function TableRow({ className, ...props }: React.ComponentProps<`tr`>): import("react/jsx-runtime").JSX.Element;
8
+ declare function TableHead({ className, ...props }: React.ComponentProps<`th`>): import("react/jsx-runtime").JSX.Element;
9
+ declare function TableCell({ className, ...props }: React.ComponentProps<`td`>): import("react/jsx-runtime").JSX.Element;
10
+ declare function TableCaption({ className, ...props }: React.ComponentProps<`caption`>): import("react/jsx-runtime").JSX.Element;
11
+ export { Table, TableHeader, TableBody, TableFooter, TableRow, TableHead, TableCell, TableCaption };
@@ -0,0 +1,8 @@
1
+ import * as React from "react";
2
+ import { Tabs as TabsPrimitive } from "radix-ui";
3
+ export { SEGMENTED_ITEM, SEGMENTED_LIST, SEGMENTED_ROW, SEGMENTED_ROW_COMPACT, SEGMENTED_TAB } from "@exponential_app/eui/web/primitives";
4
+ declare function Tabs({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
5
+ declare function TabsList({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.List>): import("react/jsx-runtime").JSX.Element;
6
+ declare function TabsTrigger({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
7
+ declare function TabsContent({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
8
+ export { Tabs, TabsList, TabsTrigger, TabsContent };
@@ -0,0 +1,3 @@
1
+ import * as React from "react";
2
+ declare function Textarea({ className, ...props }: React.ComponentProps<`textarea`>): import("react/jsx-runtime").JSX.Element;
3
+ export { Textarea };
@@ -0,0 +1,16 @@
1
+ import * as React from "react";
2
+ import { type ToastStore } from "@exponential_app/eui/web/primitives";
3
+ /** The default store `toast` writes to and `<Toaster />` reads. */
4
+ export declare const toastStore: ToastStore;
5
+ /** `toast("…")`, `toast.success("…", { description, action })`, … on the default store. */
6
+ export declare const toast: import("@exponential_app/eui/web/primitives").ToastFn;
7
+ export type ToasterProps = Omit<React.ComponentProps<`section`>, `children`> & {
8
+ store?: ToastStore;
9
+ /** The placement input (default: the `touchMaxWidth` media query). */
10
+ touch?: boolean;
11
+ /** The close glyph's label. */
12
+ closeLabel?: string;
13
+ };
14
+ export declare function Toaster({ store, touch, closeLabel, className, ...props }: ToasterProps): import("react/jsx-runtime").JSX.Element;
15
+ export { createToastStore, toastStackGeometry, toastPlacement, TOAST_CONSTANTS, TOAST_KINDS, TOAST_TOUCH_QUERY } from "@exponential_app/eui/web/primitives";
16
+ export type { ToastKind, ToastOptions, ToastRecord, ToastStore, ToastAction, ToastPlacement } from "@exponential_app/eui/web/primitives";
@@ -0,0 +1,7 @@
1
+ import * as React from "react";
2
+ import { Tooltip as TooltipPrimitive } from "radix-ui";
3
+ declare function TooltipProvider({ delayDuration, ...props }: React.ComponentProps<typeof TooltipPrimitive.Provider>): import("react/jsx-runtime").JSX.Element;
4
+ declare function Tooltip({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
5
+ declare function TooltipTrigger({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
6
+ declare function TooltipContent({ className, sideOffset, children, ...props }: React.ComponentProps<typeof TooltipPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
7
+ export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };
@@ -0,0 +1 @@
1
+ export { middleTruncate } from "@exponential_app/eui/web/primitives";
@@ -0,0 +1,3 @@
1
+ /** Whether `query` matches right now, following changes. Without a
2
+ * `window` (SSR, static markup) or `matchMedia` it answers `false`. */
3
+ export declare function useMediaQuery(query: string): boolean;
@@ -0,0 +1 @@
1
+ export declare function useIsMobile(): boolean;
@@ -0,0 +1,20 @@
1
+ import * as React from "react";
2
+ /**
3
+ * Pure decision half of the gesture: did a downward drag of `dy` px over
4
+ * `dtMs` ms earn a dismissal? Upward drags never do (the panel rubber-bands
5
+ * back instead).
6
+ */
7
+ export declare function shouldDismissSheet(dy: number, dtMs: number): boolean;
8
+ export interface SheetDragHandleProps {
9
+ onPointerDown: (event: React.PointerEvent<HTMLElement>) => void;
10
+ onPointerMove: (event: React.PointerEvent<HTMLElement>) => void;
11
+ onPointerUp: (event: React.PointerEvent<HTMLElement>) => void;
12
+ onPointerCancel: (event: React.PointerEvent<HTMLElement>) => void;
13
+ style: React.CSSProperties;
14
+ }
15
+ export declare function useSheetDrag({ panelRef, onDismiss, }: {
16
+ panelRef: React.RefObject<HTMLElement | null>;
17
+ onDismiss: () => void;
18
+ }): {
19
+ handleProps: SheetDragHandleProps;
20
+ };
@@ -0,0 +1,22 @@
1
+ import { type ReactNode } from "react";
2
+ import { type VoiceWaveActivity, type VoiceWaveSize } from "@exponential_app/eui/web/primitives";
3
+ export type { VoiceWaveActivity, VoiceWaveSize } from "@exponential_app/eui/web/primitives";
4
+ export interface VoiceWaveProps {
5
+ activity?: VoiceWaveActivity;
6
+ /** Loudness 0..1. */
7
+ level?: number;
8
+ /** Up to 8 band levels 0..1. */
9
+ bands?: readonly number[];
10
+ size?: VoiceWaveSize;
11
+ /** The accessible name (the activity is appended); none = decorative. */
12
+ label?: string;
13
+ className?: string;
14
+ /** The centre, at its own size, drawn scaled down to the wave's child
15
+ * box (never up; kept but not painted at `sm`). */
16
+ children?: ReactNode;
17
+ }
18
+ /** NEW-77: the Exponential UI `VoiceWave` native as a primitive: three
19
+ * closed waves (the core's `voiceWave`) around an optional centre child,
20
+ * moving while listening, thinking or speaking (not under reduced motion).
21
+ * The frames write the paths' `d` directly, never a re-render. */
22
+ export declare function VoiceWave({ activity, level, bands, size, label, className, children }: VoiceWaveProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,117 @@
1
+ import { type CSSProperties, type ReactNode, type Ref } from "react";
2
+ import type { ModeName, ResolvedTheme, ScrollAlign, ThemeIssue, ThemeSource, UiNode, SurfaceCommand } from "@exponential_app/eui";
3
+ import { type DataModel } from "@exponential_app/eui/web";
4
+ import { type ReactExtension } from "./extensions.js";
5
+ import type { HostPlugin } from "./host.js";
6
+ import type { SurfaceState } from "./use-surface.js";
7
+ export type ThemeInput = ResolvedTheme | ThemeSource | string;
8
+ /** What a host can ask of a live surface (`SurfaceCommand`, a11y.json). */
9
+ export interface SurfaceHandle {
10
+ run: (command: SurfaceCommand) => void;
11
+ /** Focus the node (or its first focusable descendant); false if absent. */
12
+ focus: (id: string) => boolean;
13
+ announce: (text: string, live?: `polite` | `assertive`) => void;
14
+ scrollIntoView: (id: string) => boolean;
15
+ /** Round 2: item `index` (data order) of the List/Table `id` into view;
16
+ * false when no such list is painted. */
17
+ scrollToIndex: (id: string, index: number, align?: ScrollAlign) => boolean;
18
+ }
19
+ export interface ExponentialSurfaceProps {
20
+ /** The state from `useSurface` (tree + data + templates)… */
21
+ surface?: SurfaceState;
22
+ /** …or a normalized tree (a fixture) with an optional data model… */
23
+ root?: UiNode | null;
24
+ /** …and its LIFTED templates (`ReduceResult.templates`, round 2 §4): a
25
+ * data template's component lives here, never in the tree. */
26
+ templates?: Readonly<Record<string, UiNode>>;
27
+ data?: DataModel;
28
+ /** A built-in id (`exponential` | `neutral` | `playful` | `orange`), a theme file
29
+ * (resolved against the built-ins) or a resolved theme. */
30
+ theme?: ThemeInput;
31
+ /** `light | dark | system` (default `system`: the platform's preference,
32
+ * followed live). */
33
+ mode?: ModeName | `system`;
34
+ /** Scales `$control.*` and `$spacing.*` by the theme's `$density.*`. */
35
+ density?: `compact` | `default` | `comfortable`;
36
+ /** `system` (default) follows `prefers-contrast: more`; `high` forces the
37
+ * theme's high-contrast overlays. */
38
+ contrast?: `normal` | `high` | `system`;
39
+ /** BCP 47 (default `en-US`): formatting, calendar names, week start, the
40
+ * default text direction. */
41
+ locale?: string;
42
+ /** IANA time zone dates and relative times format in (default the
43
+ * platform's). */
44
+ timeZone?: string;
45
+ /** Built-in string overrides by id (`catalog/strings.json`). */
46
+ strings?: Record<string, string>;
47
+ host?: HostPlugin;
48
+ extensions?: readonly ReactExtension[];
49
+ /** Forced interaction states on every node (the builder's recipe sheet). */
50
+ states?: readonly string[];
51
+ /** Geometry mode: leaves become fixed boxes of the returned size. */
52
+ measure?: (node: UiNode) => {
53
+ w: number;
54
+ h: number;
55
+ } | null;
56
+ /** Default: the locale's direction (`textDirection`). */
57
+ direction?: `ltr` | `rtl`;
58
+ /** The surface width; default = the host's box. */
59
+ width?: number | string;
60
+ /** The height of the VIEWPORT the surface is shown in: what the height and
61
+ * orientation style conditions test (the Rust core's `set_viewport`
62
+ * height). Default: an explicit inline `style.height` on the surface,
63
+ * else UNKNOWN (orientation = landscape, no min/max-height matches;
64
+ * contract §2) — never the surface's CONTENT height (a height rule must
65
+ * not feed back into its own measurement). The gpui host passes 0 (=
66
+ * unknown) today, so the default keeps web and desktop identical. */
67
+ viewportHeight?: number;
68
+ /** An explicit id (defaults to React's `useId`); must be unique per page. */
69
+ id?: string;
70
+ /** Host → surface commands (focus, announce, scrollIntoView). */
71
+ handleRef?: Ref<SurfaceHandle>;
72
+ className?: string;
73
+ style?: CSSProperties;
74
+ children?: ReactNode;
75
+ }
76
+ /** A theme prop, resolved: the theme to paint with and why the asked one
77
+ * was refused (empty when it loaded). */
78
+ export interface ThemeResolution {
79
+ theme: ResolvedTheme;
80
+ issues: ThemeIssue[];
81
+ }
82
+ /** A theme prop → the resolved theme (built-ins cached by id, theme files
83
+ * resolved against the built-ins and cached by content). NEVER throws
84
+ * (round 4, VAPP-103): an unknown built-in id or an invalid theme file
85
+ * paints with the default theme and carries its issues, which the surface
86
+ * reports through `HostPlugin.onThemeIssues`. */
87
+ export declare function resolveThemeInput(input: ThemeInput | undefined): ThemeResolution;
88
+ /** The theme a surface runs with: density applied, then the contrast
89
+ * overlays when asked (memoized per theme, so the compiled sheet is too). */
90
+ export declare function surfaceTheme(theme: ResolvedTheme, density: `compact` | `default` | `comfortable`, highContrast: boolean): ResolvedTheme;
91
+ /** What the surface knows of its box: the measured WIDTH and the condition
92
+ * height (an explicit inline height; see `viewportHeight`). */
93
+ export interface SurfaceBox {
94
+ width: number;
95
+ /** Undefined = unknown. */
96
+ height: number | undefined;
97
+ measured: boolean;
98
+ }
99
+ export interface LayoutInputs {
100
+ breakpoints: Record<string, number>;
101
+ queries: readonly string[];
102
+ viewportHeight: number | undefined;
103
+ hover: boolean;
104
+ reducedMotion: boolean;
105
+ }
106
+ /** The only layout facts that reach React: the active breakpoint and the
107
+ * matching JS-evaluated conditions (`data-xq`). A resize that changes
108
+ * neither re-renders nothing. */
109
+ export declare function surfaceLayout(box: SurfaceBox, inputs: LayoutInputs): {
110
+ breakpoint: string | null;
111
+ xq: string;
112
+ };
113
+ /** Structural equality, short-circuiting on identity at every level (an
114
+ * inline `data={{ items, filter }}` with stable values costs one pass over
115
+ * its top-level keys). */
116
+ export declare function sameData(a: unknown, b: unknown): boolean;
117
+ export declare function ExponentialSurface({ surface, root: rootProp, templates: templatesProp, data: dataProp, theme: themeProp, mode: modeSetting, density, contrast, locale, timeZone, strings: stringOverrides, host, extensions: extensionsProp, states, measure, direction: directionProp, width, viewportHeight, id: idProp, handleRef, className, style, children, }: ExponentialSurfaceProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,57 @@
1
+ import type { ExtensionDef, FlatComponent, NestedNode, ReduceIssue, ResolvedTheme, UiNode } from "@exponential_app/eui";
2
+ import type { DataModel } from "@exponential_app/eui/web";
3
+ export interface A2uiMessage {
4
+ version?: string;
5
+ createSurface?: {
6
+ surfaceId: string;
7
+ catalogId: string;
8
+ theme?: unknown;
9
+ sendDataModel?: boolean;
10
+ };
11
+ updateComponents?: {
12
+ surfaceId: string;
13
+ components: FlatComponent[];
14
+ };
15
+ updateDataModel?: {
16
+ surfaceId: string;
17
+ path?: string;
18
+ value?: unknown;
19
+ };
20
+ deleteSurface?: {
21
+ surfaceId: string;
22
+ };
23
+ }
24
+ export interface UseSurfaceOptions {
25
+ /** The surface id messages must carry; default `main`. */
26
+ surfaceId?: string;
27
+ catalogId?: string;
28
+ extensions?: readonly ExtensionDef[];
29
+ /** A nested tree to start from (fixtures, static screens). */
30
+ initial?: NestedNode;
31
+ /** The initial data model. */
32
+ data?: DataModel;
33
+ }
34
+ export interface SurfaceState {
35
+ surfaceId: string;
36
+ catalogId: string;
37
+ root: UiNode | null;
38
+ issues: ReduceIssue[];
39
+ /** Round 2: the nodes a data `template` renders per item, by component id
40
+ * (`ReduceResult.templates`: lifted out of the tree, never painted in
41
+ * place). */
42
+ templates?: Readonly<Record<string, UiNode>>;
43
+ /** The server's `createSurface.theme`, resolved (a host surface). */
44
+ theme?: ResolvedTheme;
45
+ data: DataModel;
46
+ /** True after `deleteSurface`. */
47
+ deleted: boolean;
48
+ /** The flat components (for template children). */
49
+ components: readonly FlatComponent[];
50
+ extensions: readonly ExtensionDef[];
51
+ apply: (message: A2uiMessage) => void;
52
+ setData: (pointer: string, value: unknown) => void;
53
+ /** Replace the tree with a nested authoring tree. */
54
+ setNested: (tree: NestedNode) => void;
55
+ reset: () => void;
56
+ }
57
+ export declare function useSurface(options?: UseSurfaceOptions): SurfaceState;
package/package.json CHANGED
@@ -1,6 +1,62 @@
1
1
  {
2
2
  "name": "@exponential_app/eui-react",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.2.1",
4
+ "description": "Exponential UI for React: the reference renderer of the core A2UI catalog on Radix with real CSS, runtime themes, extensions, and the shadcn primitive set the Exponential app shares.",
5
+ "license": "Apache-2.0",
6
+ "homepage": "https://exponential.at/ui/",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/Niach/exponential.git",
10
+ "directory": "packages/exponential-ui-react"
11
+ },
12
+ "keywords": [
13
+ "a2ui",
14
+ "generative-ui",
15
+ "exponential-ui"
16
+ ],
17
+ "type": "module",
18
+ "main": "./dist/index.js",
19
+ "module": "./dist/index.js",
20
+ "types": "./dist/types/index.d.ts",
21
+ "exports": {
22
+ ".": {
23
+ "types": "./dist/types/index.d.ts",
24
+ "import": "./dist/index.js",
25
+ "default": "./dist/index.js"
26
+ },
27
+ "./primitives": {
28
+ "types": "./dist/types/primitives/index.d.ts",
29
+ "import": "./dist/primitives/index.js",
30
+ "default": "./dist/primitives/index.js"
31
+ },
32
+ "./styles.css": "./dist/exponential-ui-react.css",
33
+ "./package.json": "./package.json"
34
+ },
35
+ "files": [
36
+ "dist",
37
+ "README.md",
38
+ "LICENSE",
39
+ "NOTICE"
40
+ ],
41
+ "sideEffects": [
42
+ "*.css"
43
+ ],
44
+ "dependencies": {
45
+ "@exponential_app/eui": "^0.2.1",
46
+ "class-variance-authority": "^0.7.1",
47
+ "clsx": "^2.1.1",
48
+ "lucide-react": "^0.544.0",
49
+ "radix-ui": "^1.4.3",
50
+ "react-day-picker": "^9.14.0",
51
+ "tailwind-merge": "^3.5.0",
52
+ "tw-animate-css": "^1.4.0"
53
+ },
54
+ "peerDependencies": {
55
+ "react": "^19.0.0",
56
+ "react-dom": "^19.0.0"
57
+ },
58
+ "publishConfig": {
59
+ "access": "public",
60
+ "provenance": true
61
+ }
62
+ }