@ghia/react 0.0.0-stage → 0.11.0

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 (151) hide show
  1. package/LICENSE +201 -0
  2. package/dist/automation/client.d.ts +2 -0
  3. package/dist/automation/client.d.ts.map +1 -0
  4. package/dist/automation/client.js +2 -0
  5. package/dist/automation/client.js.map +1 -0
  6. package/dist/automation/index.d.ts +2 -0
  7. package/dist/automation/index.d.ts.map +1 -0
  8. package/dist/automation/index.js +2 -0
  9. package/dist/automation/index.js.map +1 -0
  10. package/dist/automation/protocol.d.ts +2 -0
  11. package/dist/automation/protocol.d.ts.map +1 -0
  12. package/dist/automation/protocol.js +2 -0
  13. package/dist/automation/protocol.js.map +1 -0
  14. package/dist/components/animate-presence.d.ts +35 -0
  15. package/dist/components/animate-presence.d.ts.map +1 -0
  16. package/dist/components/animate-presence.js +184 -0
  17. package/dist/components/animate-presence.js.map +1 -0
  18. package/dist/components/button.d.ts +32 -0
  19. package/dist/components/button.d.ts.map +1 -0
  20. package/dist/components/button.js +62 -0
  21. package/dist/components/button.js.map +1 -0
  22. package/dist/components/combobox.d.ts +63 -0
  23. package/dist/components/combobox.d.ts.map +1 -0
  24. package/dist/components/combobox.js +279 -0
  25. package/dist/components/combobox.js.map +1 -0
  26. package/dist/components/dialog.d.ts +49 -0
  27. package/dist/components/dialog.d.ts.map +1 -0
  28. package/dist/components/dialog.js +157 -0
  29. package/dist/components/dialog.js.map +1 -0
  30. package/dist/components/floating.d.ts +54 -0
  31. package/dist/components/floating.d.ts.map +1 -0
  32. package/dist/components/floating.js +199 -0
  33. package/dist/components/floating.js.map +1 -0
  34. package/dist/components/index.d.ts +135 -0
  35. package/dist/components/index.d.ts.map +1 -0
  36. package/dist/components/index.js +190 -0
  37. package/dist/components/index.js.map +1 -0
  38. package/dist/components/layout-group.d.ts +10 -0
  39. package/dist/components/layout-group.d.ts.map +1 -0
  40. package/dist/components/layout-group.js +10 -0
  41. package/dist/components/layout-group.js.map +1 -0
  42. package/dist/components/motion-config.d.ts +24 -0
  43. package/dist/components/motion-config.d.ts.map +1 -0
  44. package/dist/components/motion-config.js +31 -0
  45. package/dist/components/motion-config.js.map +1 -0
  46. package/dist/components/reorder.d.ts +44 -0
  47. package/dist/components/reorder.d.ts.map +1 -0
  48. package/dist/components/reorder.js +123 -0
  49. package/dist/components/reorder.js.map +1 -0
  50. package/dist/components/select.d.ts +61 -0
  51. package/dist/components/select.d.ts.map +1 -0
  52. package/dist/components/select.js +267 -0
  53. package/dist/components/select.js.map +1 -0
  54. package/dist/components/tooltip.d.ts +30 -0
  55. package/dist/components/tooltip.d.ts.map +1 -0
  56. package/dist/components/tooltip.js +138 -0
  57. package/dist/components/tooltip.js.map +1 -0
  58. package/dist/components/universal-style.d.ts +12 -0
  59. package/dist/components/universal-style.d.ts.map +1 -0
  60. package/dist/components/universal-style.js +45 -0
  61. package/dist/components/universal-style.js.map +1 -0
  62. package/dist/components/variant-context.d.ts +4 -0
  63. package/dist/components/variant-context.d.ts.map +1 -0
  64. package/dist/components/variant-context.js +4 -0
  65. package/dist/components/variant-context.js.map +1 -0
  66. package/dist/cpu-throttle.d.ts +3 -0
  67. package/dist/cpu-throttle.d.ts.map +1 -0
  68. package/dist/cpu-throttle.js +2 -0
  69. package/dist/cpu-throttle.js.map +1 -0
  70. package/dist/floating.d.ts +4 -0
  71. package/dist/floating.d.ts.map +1 -0
  72. package/dist/floating.js +3 -0
  73. package/dist/floating.js.map +1 -0
  74. package/dist/hooks/index.d.ts +6 -0
  75. package/dist/hooks/index.d.ts.map +1 -0
  76. package/dist/hooks/index.js +6 -0
  77. package/dist/hooks/index.js.map +1 -0
  78. package/dist/hooks/use-gpuix.d.ts +17 -0
  79. package/dist/hooks/use-gpuix.d.ts.map +1 -0
  80. package/dist/hooks/use-gpuix.js +22 -0
  81. package/dist/hooks/use-gpuix.js.map +1 -0
  82. package/dist/hooks/use-media-query.d.ts +15 -0
  83. package/dist/hooks/use-media-query.d.ts.map +1 -0
  84. package/dist/hooks/use-media-query.js +30 -0
  85. package/dist/hooks/use-media-query.js.map +1 -0
  86. package/dist/hooks/use-motion-value.d.ts +31 -0
  87. package/dist/hooks/use-motion-value.d.ts.map +1 -0
  88. package/dist/hooks/use-motion-value.js +105 -0
  89. package/dist/hooks/use-motion-value.js.map +1 -0
  90. package/dist/hooks/use-text-search.d.ts +16 -0
  91. package/dist/hooks/use-text-search.d.ts.map +1 -0
  92. package/dist/hooks/use-text-search.js +17 -0
  93. package/dist/hooks/use-text-search.js.map +1 -0
  94. package/dist/hooks/use-window-size.d.ts +11 -0
  95. package/dist/hooks/use-window-size.d.ts.map +1 -0
  96. package/dist/hooks/use-window-size.js +20 -0
  97. package/dist/hooks/use-window-size.js.map +1 -0
  98. package/dist/idle-gc.d.ts +3 -0
  99. package/dist/idle-gc.d.ts.map +1 -0
  100. package/dist/idle-gc.js +2 -0
  101. package/dist/idle-gc.js.map +1 -0
  102. package/dist/index.d.ts +47 -0
  103. package/dist/index.d.ts.map +1 -0
  104. package/dist/index.js +28 -0
  105. package/dist/index.js.map +1 -0
  106. package/dist/reconciler/event-registry.d.ts +10 -0
  107. package/dist/reconciler/event-registry.d.ts.map +1 -0
  108. package/dist/reconciler/event-registry.js +32 -0
  109. package/dist/reconciler/event-registry.js.map +1 -0
  110. package/dist/reconciler/host-config.d.ts +68 -0
  111. package/dist/reconciler/host-config.d.ts.map +1 -0
  112. package/dist/reconciler/host-config.js +539 -0
  113. package/dist/reconciler/host-config.js.map +1 -0
  114. package/dist/reconciler/index.d.ts +3 -0
  115. package/dist/reconciler/index.d.ts.map +1 -0
  116. package/dist/reconciler/index.js +3 -0
  117. package/dist/reconciler/index.js.map +1 -0
  118. package/dist/reconciler/motion-bindings.d.ts +5 -0
  119. package/dist/reconciler/motion-bindings.d.ts.map +1 -0
  120. package/dist/reconciler/motion-bindings.js +10 -0
  121. package/dist/reconciler/motion-bindings.js.map +1 -0
  122. package/dist/reconciler/portal.d.ts +24 -0
  123. package/dist/reconciler/portal.d.ts.map +1 -0
  124. package/dist/reconciler/portal.js +32 -0
  125. package/dist/reconciler/portal.js.map +1 -0
  126. package/dist/reconciler/reconciler.d.ts +14 -0
  127. package/dist/reconciler/reconciler.d.ts.map +1 -0
  128. package/dist/reconciler/reconciler.js +126 -0
  129. package/dist/reconciler/reconciler.js.map +1 -0
  130. package/dist/reconciler/renderer.d.ts +42 -0
  131. package/dist/reconciler/renderer.d.ts.map +1 -0
  132. package/dist/reconciler/renderer.js +320 -0
  133. package/dist/reconciler/renderer.js.map +1 -0
  134. package/dist/testing.d.ts +14 -0
  135. package/dist/testing.d.ts.map +1 -0
  136. package/dist/testing.js +43 -0
  137. package/dist/testing.js.map +1 -0
  138. package/dist/types/host.d.ts +215 -0
  139. package/dist/types/host.d.ts.map +1 -0
  140. package/dist/types/host.js +3 -0
  141. package/dist/types/host.js.map +1 -0
  142. package/dist/types/index.d.ts +2 -0
  143. package/dist/types/index.d.ts.map +1 -0
  144. package/dist/types/index.js +2 -0
  145. package/dist/types/index.js.map +1 -0
  146. package/jsx-dev-runtime.d.ts +143 -0
  147. package/jsx-dev-runtime.js +3 -0
  148. package/jsx-runtime.d.ts +145 -0
  149. package/jsx-runtime.js +1 -0
  150. package/package.json +102 -3
  151. package/README.md +0 -3
@@ -0,0 +1,54 @@
1
+ /** Shared state, slot, and positioning helpers for headless floating controls. */
2
+ import React from "react";
3
+ import type { ReactElement, ReactNode, Ref } from "react";
4
+ import type { KeyEvent, Props, PublicInstance, MotionValueStyle, StyleDesc } from "../types/host.js";
5
+ export type FloatingSide = "top" | "right" | "bottom" | "left";
6
+ export type FloatingAlign = "start" | "center" | "end";
7
+ export type StateStyle<State> = StyleDesc | ((state: State) => StyleDesc);
8
+ export interface FloatingContentProps extends Omit<Props, "children"> {
9
+ children?: ReactNode;
10
+ side?: FloatingSide;
11
+ sideOffset?: number;
12
+ align?: FloatingAlign;
13
+ alignOffset?: number;
14
+ collisionPadding?: number;
15
+ }
16
+ export declare function resolveStyle<State>(style: StateStyle<State> | undefined, state: State): StyleDesc | undefined;
17
+ export declare function mergeStyles(base: MotionValueStyle | undefined, override: MotionValueStyle | undefined): MotionValueStyle | undefined;
18
+ export declare function floatingRootStyle(style?: MotionValueStyle): MotionValueStyle;
19
+ export declare function useControllableState<Value>({ value, defaultValue, onChange, }: {
20
+ value: Value | undefined;
21
+ defaultValue: Value;
22
+ onChange?: (value: Value) => void;
23
+ }): [Value, (value: Value) => void];
24
+ export interface DismissableLayerProps {
25
+ children?: ReactNode;
26
+ /** Escape reached the window, this layer is on top, and nothing prevented it. */
27
+ onEscapeKeyDown: (event: KeyEvent) => void;
28
+ /** Element to focus when the layer opens on top. Null leaves focus. */
29
+ initialFocus?: () => number | null;
30
+ /** Element to focus on close. `previous` is the focus from before it opened. */
31
+ finalFocus?: (previous: number | null) => number | null;
32
+ }
33
+ /**
34
+ * Put an open overlay on the window's layer stack while mounted. Escape closes
35
+ * only the top layer. Layers inside this one, such as a Select in a Dialog,
36
+ * are always above it. The stack also moves focus in and out, in stack order.
37
+ */
38
+ export declare function DismissableLayer({ children, ...handlers }: DismissableLayerProps): ReactElement;
39
+ export declare function setRefs<T>(value: T, ...refs: Array<Ref<T> | undefined>): void;
40
+ /**
41
+ * Render `props` on a `div`, or merge them into the single `asChild` element.
42
+ *
43
+ * `defaultTabIndex` makes the part a tab stop, like the `<button>` Base UI
44
+ * renders. An explicit `tabIndex` on the part, then on the child, wins.
45
+ */
46
+ export declare function renderSlot({ asChild, children, props, ref, defaultTabIndex, }: {
47
+ asChild?: boolean;
48
+ children: ReactNode;
49
+ props: Props;
50
+ ref?: Ref<PublicInstance>;
51
+ defaultTabIndex?: number;
52
+ }): ReactElement;
53
+ export declare const FloatingLayer: React.ForwardRefExoticComponent<Omit<FloatingContentProps, "ref"> & React.RefAttributes<PublicInstance>>;
54
+ //# sourceMappingURL=floating.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"floating.d.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1
+ import { jsx as _jsx } from "@ghia/react/jsx-runtime";
2
+ /** Shared state, slot, and positioning helpers for headless floating controls. */
3
+ import React, { cloneElement, createContext, forwardRef, isValidElement, useCallback, useContext, useLayoutEffect, useMemo, useRef, useState, } from "react";
4
+ import { EVENT_PROP_NAMES, pushDismissLayer } from "@ghia/native/host";
5
+ import { useGpuix } from "../hooks/use-gpuix.js";
6
+ export function resolveStyle(style, state) {
7
+ return typeof style === "function" ? style(state) : style;
8
+ }
9
+ export function mergeStyles(base, override) {
10
+ if (!base)
11
+ return override;
12
+ if (!override)
13
+ return base;
14
+ return { ...base, ...override };
15
+ }
16
+ export function floatingRootStyle(style) {
17
+ return {
18
+ display: "flex",
19
+ position: "relative",
20
+ alignItems: "start",
21
+ ...style,
22
+ };
23
+ }
24
+ function floatingSurfaceStateStyle(style) {
25
+ if (!style)
26
+ return undefined;
27
+ const surface = {};
28
+ if (style.visibility !== undefined)
29
+ surface.visibility = style.visibility;
30
+ if (style.opacity !== undefined)
31
+ surface.opacity = style.opacity;
32
+ if (style.borderRadius !== undefined)
33
+ surface.borderRadius = style.borderRadius;
34
+ if (style.borderTopLeftRadius !== undefined) {
35
+ surface.borderTopLeftRadius = style.borderTopLeftRadius;
36
+ }
37
+ if (style.borderTopRightRadius !== undefined) {
38
+ surface.borderTopRightRadius = style.borderTopRightRadius;
39
+ }
40
+ if (style.borderBottomRightRadius !== undefined) {
41
+ surface.borderBottomRightRadius = style.borderBottomRightRadius;
42
+ }
43
+ if (style.borderBottomLeftRadius !== undefined) {
44
+ surface.borderBottomLeftRadius = style.borderBottomLeftRadius;
45
+ }
46
+ return Object.keys(surface).length > 0 ? surface : undefined;
47
+ }
48
+ function floatingSurfaceStyle(style) {
49
+ const surface = floatingSurfaceStateStyle(style) ?? {};
50
+ // The anchored surface is hit where it paints, so a layer that must not take
51
+ // the pointer (a tooltip) has to say so on the surface itself.
52
+ if (style?.pointerEvents !== undefined)
53
+ surface.pointerEvents = style.pointerEvents;
54
+ const hover = floatingSurfaceStateStyle(style?.hover);
55
+ const active = floatingSurfaceStateStyle(style?.active);
56
+ if (hover)
57
+ surface.hover = hover;
58
+ if (active)
59
+ surface.active = active;
60
+ return surface;
61
+ }
62
+ function withoutOpacity(style) {
63
+ if (!style)
64
+ return undefined;
65
+ const { opacity: _opacity, ...rest } = style;
66
+ return rest;
67
+ }
68
+ function floatingContentStyle(style) {
69
+ if (!style)
70
+ return undefined;
71
+ const { opacity: _opacity, hover, active, ...rest } = style;
72
+ return {
73
+ ...rest,
74
+ hover: withoutOpacity(hover),
75
+ active: withoutOpacity(active),
76
+ };
77
+ }
78
+ export function useControllableState({ value, defaultValue, onChange, }) {
79
+ const [internalValue, setInternalValue] = useState(defaultValue);
80
+ const controlled = value !== undefined;
81
+ const currentValue = controlled ? value : internalValue;
82
+ const setValue = useCallback((nextValue) => {
83
+ if (!controlled)
84
+ setInternalValue(nextValue);
85
+ if (!Object.is(currentValue, nextValue))
86
+ onChange?.(nextValue);
87
+ }, [controlled, currentValue, onChange]);
88
+ return [currentValue, setValue];
89
+ }
90
+ const DismissLayerContext = createContext(undefined);
91
+ /**
92
+ * Put an open overlay on the window's layer stack while mounted. Escape closes
93
+ * only the top layer. Layers inside this one, such as a Select in a Dialog,
94
+ * are always above it. The stack also moves focus in and out, in stack order.
95
+ */
96
+ export function DismissableLayer({ children, ...handlers }) {
97
+ const { renderer } = useGpuix();
98
+ const parent = useContext(DismissLayerContext);
99
+ // Read during render, before this layer's elements are committed. After the
100
+ // commit an autoFocus inside the layer may already hold focus.
101
+ const [previousFocus] = useState(() => renderer?.getFocusedElementId?.() ?? null);
102
+ const latest = useRef(handlers);
103
+ latest.current = handlers;
104
+ const layer = useMemo(() => ({
105
+ parent,
106
+ onEscapeKeyDown: (event) => latest.current.onEscapeKeyDown(event),
107
+ initialFocus: () => latest.current.initialFocus?.() ?? null,
108
+ finalFocus: (previous) => latest.current.finalFocus?.(previous) ?? null,
109
+ }), [parent]);
110
+ useLayoutEffect(() => {
111
+ if (!renderer)
112
+ return;
113
+ return pushDismissLayer(renderer, layer, { previousFocus });
114
+ }, [renderer, layer, previousFocus]);
115
+ return _jsx(DismissLayerContext.Provider, { value: layer, children: children });
116
+ }
117
+ export function setRefs(value, ...refs) {
118
+ for (const ref of refs) {
119
+ if (typeof ref === "function") {
120
+ ref(value);
121
+ }
122
+ else if (ref) {
123
+ ref.current = value;
124
+ }
125
+ }
126
+ }
127
+ function mergeRefs(...refs) {
128
+ return (value) => {
129
+ for (const ref of refs) {
130
+ if (typeof ref === "function") {
131
+ ref(value);
132
+ }
133
+ else if (ref) {
134
+ ref.current = value;
135
+ }
136
+ }
137
+ };
138
+ }
139
+ function getElementRef(element) {
140
+ if (element.props.ref)
141
+ return element.props.ref;
142
+ const descriptor = Object.getOwnPropertyDescriptor(element, "ref");
143
+ return descriptor?.value;
144
+ }
145
+ function composeHandlers(first, second) {
146
+ if (!first)
147
+ return second;
148
+ if (!second)
149
+ return first;
150
+ return (event) => {
151
+ first(event);
152
+ second(event);
153
+ };
154
+ }
155
+ /** Every handler prop, capture variants included, runs the child's handler and then the part's. */
156
+ function composeEventHandlers(merged, childProps, props) {
157
+ const target = merged;
158
+ const own = childProps;
159
+ const part = props;
160
+ for (const propName of EVENT_PROP_NAMES) {
161
+ const composed = composeHandlers(own[propName], part[propName]);
162
+ if (composed)
163
+ target[propName] = composed;
164
+ }
165
+ }
166
+ /**
167
+ * Render `props` on a `div`, or merge them into the single `asChild` element.
168
+ *
169
+ * `defaultTabIndex` makes the part a tab stop, like the `<button>` Base UI
170
+ * renders. An explicit `tabIndex` on the part, then on the child, wins.
171
+ */
172
+ export function renderSlot({ asChild, children, props, ref, defaultTabIndex, }) {
173
+ if (!asChild) {
174
+ return (_jsx("div", { ...props, tabIndex: props.tabIndex ?? defaultTabIndex, ref: ref, children: children }));
175
+ }
176
+ if (!isValidElement(children)) {
177
+ throw new Error("asChild requires exactly one React element");
178
+ }
179
+ const child = children;
180
+ const childProps = child.props;
181
+ const merged = {
182
+ ...childProps,
183
+ ...props,
184
+ style: mergeStyles(childProps.style, props.style),
185
+ };
186
+ composeEventHandlers(merged, childProps, props);
187
+ merged.tabIndex = props.tabIndex ?? childProps.tabIndex ?? defaultTabIndex;
188
+ const childRef = getElementRef(child);
189
+ if (childRef || ref)
190
+ merged.ref = mergeRefs(childRef, ref);
191
+ return cloneElement(child, merged);
192
+ }
193
+ export const FloatingLayer = forwardRef(function FloatingLayer({ side = "bottom", sideOffset = 0, align = "start", alignOffset = 0, collisionPadding = 8, children, ...props }, ref) {
194
+ const offset = side === "top" || side === "bottom"
195
+ ? { x: alignOffset, y: 0 }
196
+ : { x: 0, y: alignOffset };
197
+ return (_jsx("anchored", { style: floatingSurfaceStyle(props.style), side: side, align: align, gap: sideOffset, offset: offset, snapMargin: collisionPadding, deferred: true, priority: 1, children: _jsx("div", { ...props, ref: ref, style: mergeStyles({ backgroundColor: "#1A1A1A" }, floatingContentStyle(props.style)), children: children }) }));
198
+ });
199
+ //# sourceMappingURL=floating.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"floating.js","sourceRoot":"","sources":["../../src/components/floating.tsx"],"names":[],"mappings":";AAAA,kFAAkF;AAElF,OAAO,KAAK,EAAE,EACZ,YAAY,EACZ,aAAa,EACb,UAAU,EACV,cAAc,EACd,WAAW,EACX,UAAU,EACV,eAAe,EACf,OAAO,EACP,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAA;AAGd,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAStE,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAehD,MAAM,UAAU,YAAY,CAC1B,KAAoC,EACpC,KAAY;IAEZ,OAAO,OAAO,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAA;AAC3D,CAAC;AAED,MAAM,UAAU,WAAW,CACzB,IAAkC,EAClC,QA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C,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,WAAW,EAAE,CAAA;IAE9B,OAAO,CACL,mBACE,KAAK,EAAE,oBAAoB,CAAC,KAAK,CAAC,KAAK,CAAC,EACxC,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,GAAG,EAAE,UAAU,EACf,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,gBAAgB,EAC5B,QAAQ,QACR,QAAQ,EAAE,CAAC,YAEX,iBACM,KAAK,EACT,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,WAAW,CAChB,EAAE,eAAe,EAAE,SAAS,EAAE,EAC9B,oBAAoB,CAAC,KAAK,CAAC,KAAK,CAAC,CAClC,YAEA,QAAQ,GACL,GACG,CACZ,CAAA;AACH,CAAC,CACF,CAAA"}
@@ -0,0 +1,135 @@
1
+ import type { ReactNode } from "react";
2
+ import type { LayoutDrag, MotionAnimation, MotionGestureCallbacks, MotionLayoutProps, MotionSpanAnimation, MotionSpanIgnoredProps, MotionStyle, MotionTransition, MotionValueStyle, Props, PublicInstance, SvgCircleProps, SvgEllipseProps, SvgGroupProps, SvgLineProps, SvgMotionStyle, SvgMotionTransition, SvgPathProps, SvgPolyProps, SvgRectProps, SvgFeDropShadowProps, SvgFeFloodProps, SvgFeGaussianBlurProps, SvgFeOffsetProps, SvgImageProps, SvgTextProps, SvgTspanProps } from "../types/host.js";
3
+ export { AnimatePresence, PresenceContext, useIsPresent, usePresence, } from "./animate-presence.js";
4
+ export type { AnimatePresenceProps } from "./animate-presence.js";
5
+ export { LayoutGroup } from "./layout-group.js";
6
+ export type { LayoutGroupProps } from "./layout-group.js";
7
+ export { MotionConfig, useReducedMotionConfig } from "./motion-config.js";
8
+ export type { MotionConfigProps } from "./motion-config.js";
9
+ export { UniversalStyle } from "./universal-style.js";
10
+ export type { UniversalStyleProps } from "./universal-style.js";
11
+ export declare const gpuixComponents: {
12
+ readonly div: "div";
13
+ readonly text: "text";
14
+ readonly span: "span";
15
+ readonly img: "img";
16
+ readonly svg: "svg";
17
+ readonly canvas: "canvas";
18
+ readonly input: "input";
19
+ readonly textarea: "textarea";
20
+ readonly label: "label";
21
+ readonly form: "form";
22
+ readonly anchored: "anchored";
23
+ readonly webview: "webview";
24
+ readonly nativeview: "nativeview";
25
+ readonly "virtual-list": "virtual-list";
26
+ };
27
+ export type GpuixComponentType = keyof typeof gpuixComponents;
28
+ export interface MotionDivProps extends MotionAnimation<MotionStyle>, MotionGestureCallbacks, MotionLayoutProps {
29
+ children?: ReactNode;
30
+ style?: MotionValueStyle;
31
+ onClick?: Props["onClick"];
32
+ onMouseDown?: Props["onMouseDown"];
33
+ onMouseUp?: Props["onMouseUp"];
34
+ onMouseEnter?: Props["onMouseEnter"];
35
+ onMouseLeave?: Props["onMouseLeave"];
36
+ onMouseMove?: Props["onMouseMove"];
37
+ onPointerDown?: Props["onPointerDown"];
38
+ onPointerMove?: Props["onPointerMove"];
39
+ onPointerUp?: Props["onPointerUp"];
40
+ onPointerCancel?: Props["onPointerCancel"];
41
+ onLostPointerCapture?: Props["onLostPointerCapture"];
42
+ onMouseDownOutside?: Props["onMouseDownOutside"];
43
+ onKeyDown?: Props["onKeyDown"];
44
+ onKeyUp?: Props["onKeyUp"];
45
+ onFocus?: Props["onFocus"];
46
+ onBlur?: Props["onBlur"];
47
+ onWheel?: Props["onWheel"];
48
+ onScroll?: Props["onScroll"];
49
+ onDrop?: Props["onDrop"];
50
+ onMotionComplete?: Props["onMotionComplete"];
51
+ onLayoutAnimationStart?: Props["onLayoutAnimationStart"];
52
+ onLayoutAnimationComplete?: Props["onLayoutAnimationComplete"];
53
+ autoFocus?: boolean;
54
+ }
55
+ /**
56
+ * Props of a `motion.span`: an inline span animates what an inline box shows (`animate`, `initial`,
57
+ * `exit`, `whileHover`, `whileTap`, `whileFocus`, `whileInView`, or the `variants` they name) and takes
58
+ * the props of a `<span>`. A non-atomic inline box takes no transform, so `layout`, `layoutId`, `drag*`
59
+ * and the transform keys are accepted and have no effect, as in a browser.
60
+ */
61
+ export interface MotionSpanProps extends Omit<Props, "style" | keyof MotionSpanAnimation | keyof MotionGestureCallbacks | keyof MotionSpanIgnoredProps>, MotionSpanAnimation, MotionGestureCallbacks, MotionSpanIgnoredProps {
62
+ style?: MotionValueStyle;
63
+ }
64
+ /** What every `motion.*` component takes, whatever it animates. */
65
+ interface MotionSource<Style, Transition> extends MotionAnimation<Style, Transition>, MotionGestureCallbacks {
66
+ layout?: MotionLayoutProps["layout"];
67
+ layoutId?: string;
68
+ /** The drag values of a `Reorder.Item`; not part of the API. */
69
+ layoutDrag?: LayoutDrag;
70
+ onMotionComplete?: Props["onMotionComplete"];
71
+ }
72
+ export declare function createMotionComponent<Source extends MotionSource<object, MotionTransition | SvgMotionTransition>>(tag: string): import("react").ForwardRefExoticComponent<import("react").PropsWithoutRef<Source> & import("react").RefAttributes<PublicInstance>>;
73
+ /** `motion.div` plus the drag values `Reorder.Item` hands it, for the element type it is `as`. */
74
+ export type MotionDragProps = MotionDivProps & {
75
+ layoutDrag?: LayoutDrag;
76
+ };
77
+ /** Props of a `motion.path`, `motion.circle`, ...: the shape's own plus Framer's animation props. */
78
+ export type MotionShapeProps<Shape> = Omit<Shape, "motion" | "ref" | "key"> & MotionAnimation<SvgMotionStyle, SvgMotionTransition> & Pick<MotionGestureCallbacks, "onViewportEnter" | "onViewportLeave"> & {
79
+ onMotionComplete?: Props["onMotionComplete"];
80
+ };
81
+ /**
82
+ * Native animations with a Motion-like declarative React API. `motion.path`,
83
+ * `motion.circle` and the other SVG shapes animate attributes (`pathLength`,
84
+ * `d`, `stroke`, ...) instead of style, and are valid only inside `<svg>`.
85
+ */
86
+ export declare const motion: {
87
+ readonly div: import("react").ForwardRefExoticComponent<MotionDivProps & import("react").RefAttributes<PublicInstance>>;
88
+ readonly span: import("react").ForwardRefExoticComponent<Omit<MotionSpanProps, "ref"> & import("react").RefAttributes<PublicInstance>>;
89
+ readonly g: import("react").ForwardRefExoticComponent<Omit<SvgGroupProps, "motion" | "key" | "ref"> & MotionAnimation<SvgMotionStyle, SvgMotionTransition> & Pick<MotionGestureCallbacks, "onViewportEnter" | "onViewportLeave"> & {
90
+ onMotionComplete?: Props["onMotionComplete"];
91
+ } & import("react").RefAttributes<PublicInstance>>;
92
+ readonly path: import("react").ForwardRefExoticComponent<Omit<SvgPathProps, "motion" | "key" | "ref"> & MotionAnimation<SvgMotionStyle, SvgMotionTransition> & Pick<MotionGestureCallbacks, "onViewportEnter" | "onViewportLeave"> & {
93
+ onMotionComplete?: Props["onMotionComplete"];
94
+ } & import("react").RefAttributes<PublicInstance>>;
95
+ readonly circle: import("react").ForwardRefExoticComponent<Omit<SvgCircleProps, "motion" | "key" | "ref"> & MotionAnimation<SvgMotionStyle, SvgMotionTransition> & Pick<MotionGestureCallbacks, "onViewportEnter" | "onViewportLeave"> & {
96
+ onMotionComplete?: Props["onMotionComplete"];
97
+ } & import("react").RefAttributes<PublicInstance>>;
98
+ readonly ellipse: import("react").ForwardRefExoticComponent<Omit<SvgEllipseProps, "motion" | "key" | "ref"> & MotionAnimation<SvgMotionStyle, SvgMotionTransition> & Pick<MotionGestureCallbacks, "onViewportEnter" | "onViewportLeave"> & {
99
+ onMotionComplete?: Props["onMotionComplete"];
100
+ } & import("react").RefAttributes<PublicInstance>>;
101
+ readonly rect: import("react").ForwardRefExoticComponent<Omit<SvgRectProps, "motion" | "key" | "ref"> & MotionAnimation<SvgMotionStyle, SvgMotionTransition> & Pick<MotionGestureCallbacks, "onViewportEnter" | "onViewportLeave"> & {
102
+ onMotionComplete?: Props["onMotionComplete"];
103
+ } & import("react").RefAttributes<PublicInstance>>;
104
+ readonly line: import("react").ForwardRefExoticComponent<Omit<SvgLineProps, "motion" | "key" | "ref"> & MotionAnimation<SvgMotionStyle, SvgMotionTransition> & Pick<MotionGestureCallbacks, "onViewportEnter" | "onViewportLeave"> & {
105
+ onMotionComplete?: Props["onMotionComplete"];
106
+ } & import("react").RefAttributes<PublicInstance>>;
107
+ readonly polyline: import("react").ForwardRefExoticComponent<Omit<SvgPolyProps, "motion" | "key" | "ref"> & MotionAnimation<SvgMotionStyle, SvgMotionTransition> & Pick<MotionGestureCallbacks, "onViewportEnter" | "onViewportLeave"> & {
108
+ onMotionComplete?: Props["onMotionComplete"];
109
+ } & import("react").RefAttributes<PublicInstance>>;
110
+ readonly polygon: import("react").ForwardRefExoticComponent<Omit<SvgPolyProps, "motion" | "key" | "ref"> & MotionAnimation<SvgMotionStyle, SvgMotionTransition> & Pick<MotionGestureCallbacks, "onViewportEnter" | "onViewportLeave"> & {
111
+ onMotionComplete?: Props["onMotionComplete"];
112
+ } & import("react").RefAttributes<PublicInstance>>;
113
+ readonly text: import("react").ForwardRefExoticComponent<Omit<SvgTextProps, "motion" | "key" | "ref"> & MotionAnimation<SvgMotionStyle, SvgMotionTransition> & Pick<MotionGestureCallbacks, "onViewportEnter" | "onViewportLeave"> & {
114
+ onMotionComplete?: Props["onMotionComplete"];
115
+ } & import("react").RefAttributes<PublicInstance>>;
116
+ readonly tspan: import("react").ForwardRefExoticComponent<Omit<SvgTspanProps, "motion" | "key" | "ref"> & MotionAnimation<SvgMotionStyle, SvgMotionTransition> & Pick<MotionGestureCallbacks, "onViewportEnter" | "onViewportLeave"> & {
117
+ onMotionComplete?: Props["onMotionComplete"];
118
+ } & import("react").RefAttributes<PublicInstance>>;
119
+ readonly image: import("react").ForwardRefExoticComponent<Omit<SvgImageProps, "motion" | "key" | "ref"> & MotionAnimation<SvgMotionStyle, SvgMotionTransition> & Pick<MotionGestureCallbacks, "onViewportEnter" | "onViewportLeave"> & {
120
+ onMotionComplete?: Props["onMotionComplete"];
121
+ } & import("react").RefAttributes<PublicInstance>>;
122
+ readonly feGaussianBlur: import("react").ForwardRefExoticComponent<Omit<SvgFeGaussianBlurProps, "motion" | "key" | "ref"> & MotionAnimation<SvgMotionStyle, SvgMotionTransition> & Pick<MotionGestureCallbacks, "onViewportEnter" | "onViewportLeave"> & {
123
+ onMotionComplete?: Props["onMotionComplete"];
124
+ } & import("react").RefAttributes<PublicInstance>>;
125
+ readonly feOffset: import("react").ForwardRefExoticComponent<Omit<SvgFeOffsetProps, "motion" | "key" | "ref"> & MotionAnimation<SvgMotionStyle, SvgMotionTransition> & Pick<MotionGestureCallbacks, "onViewportEnter" | "onViewportLeave"> & {
126
+ onMotionComplete?: Props["onMotionComplete"];
127
+ } & import("react").RefAttributes<PublicInstance>>;
128
+ readonly feFlood: import("react").ForwardRefExoticComponent<Omit<SvgFeFloodProps, "motion" | "key" | "ref"> & MotionAnimation<SvgMotionStyle, SvgMotionTransition> & Pick<MotionGestureCallbacks, "onViewportEnter" | "onViewportLeave"> & {
129
+ onMotionComplete?: Props["onMotionComplete"];
130
+ } & import("react").RefAttributes<PublicInstance>>;
131
+ readonly feDropShadow: import("react").ForwardRefExoticComponent<Omit<SvgFeDropShadowProps, "motion" | "key" | "ref"> & MotionAnimation<SvgMotionStyle, SvgMotionTransition> & Pick<MotionGestureCallbacks, "onViewportEnter" | "onViewportLeave"> & {
132
+ onMotionComplete?: Props["onMotionComplete"];
133
+ } & import("react").RefAttributes<PublicInstance>>;
134
+ };
135
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAgB,SAAS,EAAE,MAAM,OAAO,CAAA;AAmBpD,OAAO,KAAK,EAEV,UAAU,EACV,eAAe,EACf,sBAAsB,EAGtB,iBAAiB,EACjB,mBAAmB,EACnB,sBAAsB,EACtB,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAEhB,KAAK,EACL,cAAc,EACd,cAAc,EACd,eAAe,EACf,aAAa,EACb,YAAY,EACZ,cAAc,EACd,mBAAmB,EACnB,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,oBAAoB,EACpB,eAAe,EACf,sBAAsB,EACtB,gBAAgB,EAChB,aAAa,EACb,YAAY,EAC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AkB,CAAC;;;2BAAzB,KAAK,CAAC,kBAAkB,CAAC;;CA8BtC,CAAA"}
@@ -0,0 +1,190 @@
1
+ // GPUIX component definitions and native motion wrappers.
2
+ import { createElement, forwardRef, useCallback, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
3
+ import { elementScope, gestureDescription, gestureHandlers, layoutDescription, motionComponentStyle, observeViewport, reduceMotionValues, resolveExit, resolveMotion, scopeLayoutId, SPAN_SCOPE, withoutIgnoredSpanProps, withoutIgnoredSpanStyle, withoutLayoutTransition, wireMotionTransition, } from "@ghia/native/host";
4
+ import { flushSync } from "../reconciler/reconciler.js";
5
+ import { PresenceContext, usePresence } from "./animate-presence.js";
6
+ import { LayoutGroupContext } from "./layout-group.js";
7
+ import { MotionConfigContext } from "./motion-config.js";
8
+ import { VariantContext } from "./variant-context.js";
9
+ let nextMotionGeneration = 0;
10
+ export { AnimatePresence, PresenceContext, useIsPresent, usePresence, } from "./animate-presence.js";
11
+ export { LayoutGroup } from "./layout-group.js";
12
+ export { MotionConfig, useReducedMotionConfig } from "./motion-config.js";
13
+ export { UniversalStyle } from "./universal-style.js";
14
+ export const gpuixComponents = {
15
+ div: "div",
16
+ text: "text",
17
+ span: "span",
18
+ img: "img",
19
+ svg: "svg",
20
+ canvas: "canvas",
21
+ input: "input",
22
+ textarea: "textarea",
23
+ label: "label",
24
+ form: "form",
25
+ anchored: "anchored",
26
+ webview: "webview",
27
+ nativeview: "nativeview",
28
+ "virtual-list": "virtual-list",
29
+ };
30
+ export function createMotionComponent(tag) {
31
+ const inline = tag === "span";
32
+ const scope = inline ? SPAN_SCOPE : elementScope(`motion.${tag}`);
33
+ return forwardRef(function Motion({ initial, animate, exit: exitTarget, custom, transition, layout, layoutId, layoutDrag, variants, inherit, whileHover, whileTap, whileFocus, whileInView, viewport, onHoverStart, onHoverEnd, onTapStart, onTap, onTapCancel, onViewportEnter, onViewportLeave, onMotionComplete, ...rest }, ref) {
34
+ // A span takes no transform: what Framer would move with one is accepted and left where it is.
35
+ const props = inline
36
+ ? withoutIgnoredSpanProps({ ...rest, style: withoutIgnoredSpanStyle(Reflect.get(rest, "style")) })
37
+ : { ...rest, style: motionComponentStyle(Reflect.get(rest, "style")) };
38
+ const [inView, setInView] = useState(false);
39
+ const observed = useRef(null);
40
+ const setRef = useCallback((instance) => {
41
+ observed.current = instance;
42
+ if (typeof ref === "function")
43
+ ref(instance);
44
+ else if (ref)
45
+ ref.current = instance;
46
+ }, [ref]);
47
+ const callbacks = useRef({});
48
+ callbacks.current = { onHoverStart, onHoverEnd, onTapStart, onTap, onTapCancel, onViewportEnter, onViewportLeave };
49
+ const presence = useContext(PresenceContext);
50
+ const config = useContext(MotionConfigContext);
51
+ const layoutGroupId = useContext(LayoutGroupContext);
52
+ const parentVariants = useContext(VariantContext);
53
+ const inheritedVariants = inherit === false ? undefined : parentVariants;
54
+ const reduced = config !== undefined && config.reduced;
55
+ const [isPresent, safeToRemove] = usePresence();
56
+ // An `exit` function has nothing to leave from outside an `AnimatePresence`.
57
+ const exitResolved = typeof exitTarget === "function" && presence === null
58
+ ? undefined
59
+ : resolveExit(exitTarget, presence?.custom ?? custom);
60
+ const resolved = resolveMotion(scope, {
61
+ initial: presence?.initial === false ? false : initial,
62
+ animate: animate,
63
+ exit: exitResolved,
64
+ variants: variants,
65
+ custom: presence?.custom ?? custom,
66
+ gestures: { whileHover, whileTap, whileFocus, whileInView },
67
+ parent: inheritedVariants,
68
+ inView,
69
+ });
70
+ const exit = resolved.exit;
71
+ const resolvedInitial = resolved.initial;
72
+ const resolvedAnimate = !isPresent && exit ? exit : resolved.animate;
73
+ const variantTransition = !isPresent && exit ? resolved.exitTransition : resolved.animateTransition;
74
+ const componentTransition = wireMotionTransition(transition ?? config?.transition);
75
+ const motionTransition = withoutLayoutTransition(variantTransition === undefined ? componentTransition : wireMotionTransition(variantTransition));
76
+ useEffect(() => {
77
+ if (!isPresent && !exit)
78
+ safeToRemove?.();
79
+ }, [exit, isPresent, safeToRemove]);
80
+ // Gestures are over once the element is on its way out.
81
+ const gestures = isPresent
82
+ ? gestureDescription(resolved, (own) => wireMotionTransition(own), resolved.inherited.includes("whileInView") ? inheritedVariants.inView : inView)
83
+ : undefined;
84
+ const watchesView = isPresent && (whileInView !== undefined || onViewportEnter !== undefined || onViewportLeave !== undefined);
85
+ useEffect(() => {
86
+ const target = observed.current;
87
+ if (!watchesView || !target)
88
+ return;
89
+ // Native delivers it from a frame, not from an event React is handling.
90
+ return observeViewport(target, viewport, (visible, entry) => {
91
+ flushSync(() => setInView(visible));
92
+ if (visible)
93
+ callbacks.current.onViewportEnter?.(entry);
94
+ else
95
+ callbacks.current.onViewportLeave?.(entry);
96
+ });
97
+ }, [watchesView, viewport?.root, viewport?.margin, viewport?.amount, viewport?.once]);
98
+ const motionKey = JSON.stringify([
99
+ isPresent,
100
+ resolvedInitial,
101
+ resolvedAnimate,
102
+ motionTransition,
103
+ reduced,
104
+ gestures,
105
+ ]);
106
+ const generation = useMemo(() => ++nextMotionGeneration, [motionKey]);
107
+ const style = Reflect.get(props, "style");
108
+ useLayoutEffect(() => (reduced ? reduceMotionValues(style) : undefined), [reduced, style]);
109
+ const hostProps = {
110
+ ...props,
111
+ ...gestureHandlers(() => callbacks.current, props),
112
+ ref: watchesView ? setRef : ref,
113
+ };
114
+ if (resolvedAnimate !== undefined || gestures !== undefined) {
115
+ hostProps.motion = {
116
+ generation,
117
+ isExit: !isPresent && exit !== undefined,
118
+ initial: resolvedInitial,
119
+ animate: resolvedAnimate ?? {},
120
+ transition: motionTransition,
121
+ ...(reduced ? { reducedMotion: true } : {}),
122
+ ...gestures,
123
+ };
124
+ }
125
+ // A layout animation moves a box with a transform, which a span has none of.
126
+ const layoutProp = inline
127
+ ? undefined
128
+ : layoutDescription({
129
+ layout,
130
+ layoutId: scopeLayoutId(layoutGroupId, layoutId),
131
+ transition: componentTransition,
132
+ reduced,
133
+ drag: layoutDrag,
134
+ });
135
+ if (layoutProp !== undefined)
136
+ hostProps.layout = layoutProp;
137
+ if (!isPresent || onMotionComplete) {
138
+ hostProps.onMotionComplete = (event) => {
139
+ if (event.motionGeneration !== generation)
140
+ return;
141
+ onMotionComplete?.(event);
142
+ if (!isPresent)
143
+ safeToRemove?.();
144
+ };
145
+ }
146
+ // Always a provider, so that a component that starts or stops controlling variants keeps its element.
147
+ const handedDown = useStableVariants(resolved.controls ?? inheritedVariants);
148
+ return createElement(VariantContext.Provider, { value: handedDown }, createElement(tag, hostProps));
149
+ });
150
+ }
151
+ /** The same object for the same names, so that a render of the controller does not render what is under it. */
152
+ function useStableVariants(value) {
153
+ const key = JSON.stringify(value);
154
+ return useMemo(() => value, [key]);
155
+ }
156
+ const MotionDiv = createMotionComponent("div");
157
+ const MotionSpan = createMotionComponent("span");
158
+ function motionShape(tag) {
159
+ return createMotionComponent(tag);
160
+ }
161
+ /**
162
+ * Native animations with a Motion-like declarative React API. `motion.path`,
163
+ * `motion.circle` and the other SVG shapes animate attributes (`pathLength`,
164
+ * `d`, `stroke`, ...) instead of style, and are valid only inside `<svg>`.
165
+ */
166
+ export const motion = {
167
+ div: MotionDiv,
168
+ span: MotionSpan,
169
+ g: motionShape("g"),
170
+ path: motionShape("path"),
171
+ circle: motionShape("circle"),
172
+ ellipse: motionShape("ellipse"),
173
+ rect: motionShape("rect"),
174
+ line: motionShape("line"),
175
+ polyline: motionShape("polyline"),
176
+ polygon: motionShape("polygon"),
177
+ text: motionShape("text"),
178
+ tspan: motionShape("tspan"),
179
+ image: motionShape("image"),
180
+ feGaussianBlur: motionShape("feGaussianBlur"),
181
+ feOffset: motionShape("feOffset"),
182
+ feFlood: motionShape("feFlood"),
183
+ feDropShadow: motionShape("feDropShadow"),
184
+ };
185
+ // There is no `VirtualList` React wrapper. Windowing on the React side is the
186
+ // app's job: pass `itemCount`, `estimatedItemHeight` and `windowStart` to the
187
+ // host `<virtual-list>` and render only that slice. A generic wrapper cannot
188
+ // know when to widen its own window, so it silently dropped rows whenever
189
+ // `itemCount` grew without a scroll.
190
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAE1D,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEjI,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,oBAAoB,EACpB,eAAe,EACf,kBAAkB,EAClB,WAAW,EACX,aAAa,EACb,aAAa,EACb,UAAU,EACV,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,mBAAmB,CAAA;AAmC1B,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAA;AACvD,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAErD,IAAI,oBAAoB,GAAG,CAAC,CAAA;AAE5B,OAAO,EACL,eAAe,EACf,eAAe,EACf,YAAY,EACZ,WAAW,GACZ,MAAM,uBAAuB,CAAA;AAE9B,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAE/C,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAA;AAEzE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAGrD,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,GAAG,EAAE,KAAK;IACV,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,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W,CAAe,UAAU,CAAC;IAC/C,OAAO,EAAE,WAAW,CAAe,SAAS,CAAC;IAC7C,IAAI,EAAE,WAAW,CAAe,MAAM,CAAC;IACvC,KAAK,EAAE,WAAW,CAAgB,OAAO,CAAC;IAC1C,KAAK,EAAE,WAAW,CAAgB,OAAO,CAAC;IAC1C,cAAc,EAAE,WAAW,CAAyB,gBAAgB,CAAC;IACrE,QAAQ,EAAE,WAAW,CAAmB,UAAU,CAAC;IACnD,OAAO,EAAE,WAAW,CAAkB,SAAS,CAAC;IAChD,YAAY,EAAE,WAAW,CAAuB,cAAc,CAAC;CACvD,CAAA;AAEV,8EAA8E;AAC9E,8EAA8E;AAC9E,6EAA6E;AAC7E,0EAA0E;AAC1E,qCAAqC"}
@@ -0,0 +1,10 @@
1
+ import type { ReactElement, ReactNode } from "react";
2
+ /** The id prefix `motion.*` components below apply to their `layoutId`. */
3
+ export declare const LayoutGroupContext: import("react").Context<string | undefined>;
4
+ export type LayoutGroupProps = {
5
+ /** Prefixes the `layoutId` of every `motion.*` below as `${id}-${layoutId}`, so two groups can reuse an id without sharing a glide. A nested group continues its parent's prefix. */
6
+ id?: string;
7
+ children?: ReactNode;
8
+ };
9
+ export declare function LayoutGroup(props: LayoutGroupProps): ReactElement;
10
+ //# sourceMappingURL=layout-group.d.ts.map