@hanzogui/popper 3.0.2 → 7.0.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hanzogui/popper",
3
- "version": "3.0.2",
3
+ "version": "7.0.0",
4
4
  "source": "src/index.ts",
5
5
  "files": [
6
6
  "src",
@@ -30,23 +30,23 @@
30
30
  "access": "public"
31
31
  },
32
32
  "scripts": {
33
- "build": "hanzo-gui-build",
34
- "watch": "hanzo-gui-build --watch",
35
- "clean": "hanzo-gui-build clean",
36
- "clean:build": "hanzo-gui-build clean:build"
33
+ "build": "hanzogui-build",
34
+ "watch": "hanzogui-build --watch",
35
+ "clean": "hanzogui-build clean",
36
+ "clean:build": "hanzogui-build clean:build"
37
37
  },
38
38
  "dependencies": {
39
- "@hanzogui/compose-refs": "3.0.1",
40
- "@hanzogui/constants": "3.0.1",
41
- "@hanzogui/core": "3.0.1",
42
- "@hanzogui/floating": "3.0.1",
43
- "@hanzogui/get-token": "3.0.1",
44
- "@hanzogui/stacks": "3.0.1",
45
- "@hanzogui/start-transition": "3.0.1",
46
- "@hanzogui/use-controllable-state": "3.0.1"
39
+ "@hanzogui/compose-refs": "^7.0.0",
40
+ "@hanzogui/constants": "^7.0.0",
41
+ "@hanzogui/core": "^7.0.0",
42
+ "@hanzogui/floating": "^7.0.0",
43
+ "@hanzogui/get-token": "^7.0.0",
44
+ "@hanzogui/stacks": "^7.0.0",
45
+ "@hanzogui/start-transition": "^7.0.0",
46
+ "@hanzogui/use-controllable-state": "^7.0.0"
47
47
  },
48
48
  "devDependencies": {
49
- "@hanzogui/build": "3.0.1",
49
+ "@hanzogui/build": "^7.0.0",
50
50
  "react": ">=19",
51
51
  "react-native": "0.83.2"
52
52
  },
@@ -55,4 +55,4 @@
55
55
  "react-native": "*"
56
56
  },
57
57
  "module:jsx": "dist/jsx"
58
- }
58
+ }
package/src/Popper.tsx CHANGED
@@ -2,10 +2,10 @@
2
2
  import { flushSync } from 'react-dom'
3
3
  import { useComposedRefs } from '@hanzogui/compose-refs'
4
4
  import { isWeb, useIsomorphicLayoutEffect } from '@hanzogui/constants'
5
- import type { SizeTokens, GuiElement, ViewProps } from '@hanzogui/core'
5
+ import type { SizeTokens, HanzoguiElement, ViewProps } from '@hanzogui/core'
6
6
  import {
7
7
  LayoutMeasurementController,
8
- View as GuiView,
8
+ View as HanzoguiView,
9
9
  createStyledContext,
10
10
  getVariableValue,
11
11
  registerLayoutNode,
@@ -191,7 +191,7 @@ export type PopperProps = {
191
191
  }
192
192
 
193
193
  const checkFloating =
194
- process.env.HANZO_GUI_TARGET === 'native'
194
+ process.env.TAMAGUI_TARGET === 'native'
195
195
  ? {
196
196
  name: 'checkFloating',
197
197
  fn(data: any) {
@@ -262,10 +262,10 @@ const transformOriginMiddleware = (options: {
262
262
  },
263
263
  })
264
264
 
265
- // replaces floating-ui's autoUpdate with gui's batched IO measurement loop
265
+ // replaces floating-ui's autoUpdate with hanzogui's batched IO measurement loop
266
266
  // keeps scroll/resize listeners for immediate response, but replaces per-element
267
267
  // ResizeObserver + IntersectionObserver with the shared layoutOnAnimationFrame loop
268
- function guiAutoUpdate(
268
+ function hanzoguiAutoUpdate(
269
269
  reference: ReferenceType,
270
270
  floating: HTMLElement,
271
271
  update: () => void
@@ -286,7 +286,7 @@ function guiAutoUpdate(
286
286
  },
287
287
  ]
288
288
 
289
- // watch reference element via gui's IO measurement loop
289
+ // watch reference element via hanzogui's IO measurement loop
290
290
  // only watch reference, NOT floating — watching floating causes loops
291
291
  // (computePosition sets position → rect changes → update → repeat)
292
292
  if (reference instanceof HTMLElement) {
@@ -360,7 +360,7 @@ export function Popper(props: PopperProps) {
360
360
  : (null as any),
361
361
  arrowEl ? arrow({ element: arrowEl }) : (null as any),
362
362
  checkFloating,
363
- process.env.HANZO_GUI_TARGET !== 'native' && resize
363
+ process.env.TAMAGUI_TARGET !== 'native' && resize
364
364
  ? sizeMiddleware({
365
365
  padding: typeof stayInFrame === 'object' ? stayInFrame.padding : 10,
366
366
  apply({ availableHeight, availableWidth }) {
@@ -382,32 +382,32 @@ export function Popper(props: PopperProps) {
382
382
  })
383
383
  : (null as any),
384
384
  // Add size middleware for CSS custom properties (web only)
385
- process.env.HANZO_GUI_TARGET !== 'native'
385
+ process.env.TAMAGUI_TARGET !== 'native'
386
386
  ? sizeMiddleware({
387
387
  apply({ elements, rects, availableWidth, availableHeight }) {
388
388
  const { width: anchorWidth, height: anchorHeight } = rects.reference
389
389
  const contentStyle = elements.floating.style
390
390
  contentStyle.setProperty(
391
- '--gui-popper-available-width',
391
+ '--hanzogui-popper-available-width',
392
392
  `${availableWidth}px`
393
393
  )
394
394
  contentStyle.setProperty(
395
- '--gui-popper-available-height',
395
+ '--hanzogui-popper-available-height',
396
396
  `${availableHeight}px`
397
397
  )
398
398
  contentStyle.setProperty(
399
- '--gui-popper-anchor-width',
399
+ '--hanzogui-popper-anchor-width',
400
400
  `${anchorWidth}px`
401
401
  )
402
402
  contentStyle.setProperty(
403
- '--gui-popper-anchor-height',
403
+ '--hanzogui-popper-anchor-height',
404
404
  `${anchorHeight}px`
405
405
  )
406
406
  },
407
407
  })
408
408
  : (null as any),
409
409
  // Transform origin middleware (web only)
410
- process.env.HANZO_GUI_TARGET !== 'native'
410
+ process.env.TAMAGUI_TARGET !== 'native'
411
411
  ? transformOriginMiddleware({
412
412
  arrowHeight: arrowSize,
413
413
  arrowWidth: arrowSize,
@@ -421,7 +421,7 @@ export function Popper(props: PopperProps) {
421
421
  strategy,
422
422
  placement,
423
423
  sameScrollView: false, // this only takes effect on native
424
- whileElementsMounted: !isOpen ? undefined : guiAutoUpdate,
424
+ whileElementsMounted: !isOpen ? undefined : hanzoguiAutoUpdate,
425
425
  platform:
426
426
  (disableRTL ?? setupOptions.disableRTL)
427
427
  ? {
@@ -434,7 +434,7 @@ export function Popper(props: PopperProps) {
434
434
  middleware: middlewareRef.current,
435
435
  })
436
436
 
437
- if (process.env.HANZO_GUI_TARGET !== 'native') {
437
+ if (process.env.TAMAGUI_TARGET !== 'native') {
438
438
  // add our size middleware here
439
439
  floating = React.useMemo(() => {
440
440
  const og = floating.getFloatingProps
@@ -455,7 +455,7 @@ export function Popper(props: PopperProps) {
455
455
 
456
456
  const { middlewareData } = floating
457
457
 
458
- if (process.env.HANZO_GUI_TARGET === 'native') {
458
+ if (process.env.TAMAGUI_TARGET === 'native') {
459
459
  // On Native there's no autoupdate so we call update() when necessary
460
460
 
461
461
  // Subscribe to window dimensions (orientation, scale, etc...)
@@ -524,7 +524,7 @@ export function Popper(props: PopperProps) {
524
524
  * PopperAnchor
525
525
  * -----------------------------------------------------------------------------------------------*/
526
526
 
527
- type PopperAnchorRef = GuiElement
527
+ type PopperAnchorRef = HanzoguiElement
528
528
 
529
529
  export type PopperAnchorExtraProps = {
530
530
  virtualRef?: React.RefObject<any>
@@ -586,7 +586,7 @@ export const PopperAnchor = YStack.styleable<PopperAnchorExtraProps>(
586
586
  )
587
587
 
588
588
  return (
589
- <GuiView
589
+ <HanzoguiView
590
590
  {...rest}
591
591
  {...refProps}
592
592
  ref={composedRefs}
@@ -627,7 +627,7 @@ export const PopperAnchor = YStack.styleable<PopperAnchorExtraProps>(
627
627
  * PopperContent
628
628
  * -----------------------------------------------------------------------------------------------*/
629
629
 
630
- type PopperContentElement = GuiElement
630
+ type PopperContentElement = HanzoguiElement
631
631
 
632
632
  export type PopperContentProps = SizableStackProps & {
633
633
  scope?: string
@@ -824,7 +824,7 @@ export const PopperContent = React.forwardRef<PopperContentElement, PopperConten
824
824
 
825
825
  return (
826
826
  <LayoutMeasurementController disable={!context.open}>
827
- <GuiView
827
+ <HanzoguiView
828
828
  passThrough={passThrough}
829
829
  ref={contentRefs}
830
830
  direction={rest.direction}
@@ -849,7 +849,7 @@ export const PopperContent = React.forwardRef<PopperContentElement, PopperConten
849
849
  >
850
850
  {children}
851
851
  </PopperContentFrame>
852
- </GuiView>
852
+ </HanzoguiView>
853
853
  </LayoutMeasurementController>
854
854
  )
855
855
  }
@@ -885,7 +885,7 @@ export const PopperArrowFrame = styled(YStack, {
885
885
  } as const,
886
886
 
887
887
  defaultVariants: {
888
- unstyled: process.env.HANZO_GUI_HEADLESS === '1',
888
+ unstyled: process.env.HANZOGUI_HEADLESS === '1',
889
889
  },
890
890
  })
891
891
 
@@ -906,7 +906,7 @@ const PopperArrowOuterFrame = styled(YStack, {
906
906
  } as const,
907
907
 
908
908
  defaultVariants: {
909
- unstyled: process.env.HANZO_GUI_HEADLESS === '1',
909
+ unstyled: process.env.HANZOGUI_HEADLESS === '1',
910
910
  },
911
911
  })
912
912
 
@@ -919,7 +919,7 @@ const opposites = {
919
919
 
920
920
  type Sides = keyof typeof opposites
921
921
 
922
- export const PopperArrow = React.forwardRef<GuiElement, PopperArrowProps>(
922
+ export const PopperArrow = React.forwardRef<HanzoguiElement, PopperArrowProps>(
923
923
  function PopperArrow(propsIn, forwardedRef) {
924
924
  const { scope, animatePosition, transition, ...rest } = propsIn
925
925
  const { offset, size: sizeProp, borderWidth = 0, ...arrowProps } = rest
package/types/Popper.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import type { SizeTokens, GuiElement } from '@gui/core';
2
- import type { PopupTriggerMap } from '@gui/floating';
3
- import type { Coords, OffsetOptions, Placement, SizeOptions, Strategy, UseFloatingReturn } from '@gui/floating';
4
- import { flip, shift } from '@gui/floating';
5
- import type { SizableStackProps, YStackProps } from '@gui/stacks';
1
+ import type { SizeTokens, HanzoguiElement } from '@hanzogui/core';
2
+ import type { PopupTriggerMap } from '@hanzogui/floating';
3
+ import type { Coords, OffsetOptions, Placement, SizeOptions, Strategy, UseFloatingReturn } from '@hanzogui/floating';
4
+ import { flip, shift } from '@hanzogui/floating';
5
+ import type { SizableStackProps, YStackProps } from '@hanzogui/stacks';
6
6
  import * as React from 'react';
7
7
  type ShiftProps = typeof shift extends (options: infer Opts) => void ? Opts : never;
8
8
  type FlipProps = typeof flip extends (options: infer Opts) => void ? Opts : never;
@@ -22,8 +22,8 @@ export type PopperContextShared = {
22
22
  };
23
23
  };
24
24
  export type PopperContextValue = UseFloatingReturn & PopperContextShared;
25
- export declare const PopperContextFast: import("@gui/core").StyledContext<PopperContextValue>;
26
- export declare const PopperPositionContext: <VariantProps extends Record<string, any>>(defaultValues?: VariantProps, namespace?: string) => import("@gui/core").StyledContext<VariantProps>;
25
+ export declare const PopperContextFast: import("@hanzogui/core").StyledContext<PopperContextValue>;
26
+ export declare const PopperPositionContext: <VariantProps extends Record<string, any>>(defaultValues?: VariantProps, namespace?: string) => import("@hanzogui/core").StyledContext<VariantProps>;
27
27
  export declare const usePopperContext: (scope?: string) => PopperContextValue, PopperProviderFast: React.Provider<PopperContextValue> & React.ProviderExoticComponent<Partial<PopperContextValue> & {
28
28
  children?: React.ReactNode;
29
29
  scope?: string;
@@ -33,7 +33,7 @@ export type PopperContextSlowValue = Pick<UseFloatingReturn, 'getReferenceProps'
33
33
  onLeaveReference?: () => void;
34
34
  triggerElements?: PopupTriggerMap;
35
35
  };
36
- export declare const PopperContextSlow: import("@gui/core").StyledContext<PopperContextSlowValue>;
36
+ export declare const PopperContextSlow: import("@hanzogui/core").StyledContext<PopperContextSlowValue>;
37
37
  export declare const usePopperContextSlow: (scope?: string) => PopperContextSlowValue, PopperProviderSlow: React.Provider<PopperContextSlowValue> & React.ProviderExoticComponent<Partial<PopperContextSlowValue> & {
38
38
  children?: React.ReactNode;
39
39
  scope?: string;
@@ -97,13 +97,13 @@ export type PopperAnchorExtraProps = {
97
97
  scope?: string;
98
98
  };
99
99
  export type PopperAnchorProps = YStackProps;
100
- export declare const PopperAnchor: import("@gui/core").GuiComponent<Omit<import("@gui/core").GetFinalProps<import("@gui/core").RNGuiViewNonStyleProps, import("@gui/core").StackStyleBase, {
100
+ export declare const PopperAnchor: import("@hanzogui/core").HanzoguiComponent<Omit<import("@hanzogui/core").GetFinalProps<import("@hanzogui/core").RNHanzoguiViewNonStyleProps, import("@hanzogui/core").StackStyleBase, {
101
101
  elevation?: number | SizeTokens | undefined;
102
102
  fullscreen?: boolean | undefined;
103
- }>, keyof PopperAnchorExtraProps> & PopperAnchorExtraProps, GuiElement, import("@gui/core").RNGuiViewNonStyleProps & PopperAnchorExtraProps, import("@gui/core").StackStyleBase, {
103
+ }>, keyof PopperAnchorExtraProps> & PopperAnchorExtraProps, HanzoguiElement, import("@hanzogui/core").RNHanzoguiViewNonStyleProps & PopperAnchorExtraProps, import("@hanzogui/core").StackStyleBase, {
104
104
  elevation?: number | SizeTokens | undefined;
105
105
  fullscreen?: boolean | undefined;
106
- }, import("@gui/core").StaticConfigPublic>;
106
+ }, import("@hanzogui/core").StaticConfigPublic>;
107
107
  export type PopperContentProps = SizableStackProps & {
108
108
  scope?: string;
109
109
  /**
@@ -114,36 +114,36 @@ export type PopperContentProps = SizableStackProps & {
114
114
  enableAnimationForPositionChange?: boolean | 'even-when-repositioning';
115
115
  passThrough?: boolean;
116
116
  };
117
- export declare const PopperContentFrame: import("@gui/core").GuiComponent<import("@gui/core").TamaDefer, GuiElement, import("@gui/core").RNGuiViewNonStyleProps, import("@gui/core").StackStyleBase, {
117
+ export declare const PopperContentFrame: import("@hanzogui/core").HanzoguiComponent<import("@hanzogui/core").TamaDefer, HanzoguiElement, import("@hanzogui/core").RNHanzoguiViewNonStyleProps, import("@hanzogui/core").StackStyleBase, {
118
118
  size?: SizeTokens | undefined;
119
119
  unstyled?: boolean | undefined;
120
120
  elevation?: number | SizeTokens | undefined;
121
121
  fullscreen?: boolean | undefined;
122
- }, import("@gui/core").StaticConfigPublic>;
123
- export declare const PopperContent: React.ForwardRefExoticComponent<Omit<import("@gui/core").RNGuiViewNonStyleProps, "size" | "unstyled" | "elevation" | keyof import("@gui/core").StackStyleBase | "fullscreen" | "transparent" | "circular" | "elevate" | "bordered" | "chromeless"> & import("@gui/core").WithThemeValues<import("@gui/core").StackStyleBase> & {
124
- size?: import("@gui/core").SizeTokens | undefined;
122
+ }, import("@hanzogui/core").StaticConfigPublic>;
123
+ export declare const PopperContent: React.ForwardRefExoticComponent<Omit<import("@hanzogui/core").RNHanzoguiViewNonStyleProps, "size" | "unstyled" | "elevation" | keyof import("@hanzogui/core").StackStyleBase | "fullscreen" | "transparent" | "circular" | "elevate" | "bordered" | "chromeless"> & import("@hanzogui/core").WithThemeValues<import("@hanzogui/core").StackStyleBase> & {
124
+ size?: import("@hanzogui/core").SizeTokens | undefined;
125
125
  unstyled?: boolean | undefined;
126
- elevation?: number | import("@gui/core").SizeTokens | undefined;
126
+ elevation?: number | import("@hanzogui/core").SizeTokens | undefined;
127
127
  transparent?: boolean | undefined;
128
128
  fullscreen?: boolean | undefined;
129
129
  circular?: boolean | undefined;
130
130
  elevate?: boolean | undefined;
131
131
  bordered?: boolean | undefined;
132
132
  chromeless?: boolean | "all" | undefined;
133
- } & import("@gui/core").WithShorthands<import("@gui/core").WithThemeValues<import("@gui/core").StackStyleBase>> & import("@gui/core").WithPseudoProps<import("@gui/core").WithThemeValues<import("@gui/core").StackStyleBase> & {
134
- size?: import("@gui/core").SizeTokens | undefined;
133
+ } & import("@hanzogui/core").WithShorthands<import("@hanzogui/core").WithThemeValues<import("@hanzogui/core").StackStyleBase>> & import("@hanzogui/core").WithPseudoProps<import("@hanzogui/core").WithThemeValues<import("@hanzogui/core").StackStyleBase> & {
134
+ size?: import("@hanzogui/core").SizeTokens | undefined;
135
135
  unstyled?: boolean | undefined;
136
- elevation?: number | import("@gui/core").SizeTokens | undefined;
136
+ elevation?: number | import("@hanzogui/core").SizeTokens | undefined;
137
137
  transparent?: boolean | undefined;
138
138
  fullscreen?: boolean | undefined;
139
139
  circular?: boolean | undefined;
140
140
  elevate?: boolean | undefined;
141
141
  bordered?: boolean | undefined;
142
142
  chromeless?: boolean | "all" | undefined;
143
- } & import("@gui/core").WithShorthands<import("@gui/core").WithThemeValues<import("@gui/core").StackStyleBase>>> & import("@gui/core").WithMediaProps<import("@gui/core").WithThemeShorthandsAndPseudos<import("@gui/core").StackStyleBase, {
144
- size?: import("@gui/core").SizeTokens | undefined;
143
+ } & import("@hanzogui/core").WithShorthands<import("@hanzogui/core").WithThemeValues<import("@hanzogui/core").StackStyleBase>>> & import("@hanzogui/core").WithMediaProps<import("@hanzogui/core").WithThemeShorthandsAndPseudos<import("@hanzogui/core").StackStyleBase, {
144
+ size?: import("@hanzogui/core").SizeTokens | undefined;
145
145
  unstyled?: boolean | undefined;
146
- elevation?: number | import("@gui/core").SizeTokens | undefined;
146
+ elevation?: number | import("@hanzogui/core").SizeTokens | undefined;
147
147
  transparent?: boolean | undefined;
148
148
  fullscreen?: boolean | undefined;
149
149
  circular?: boolean | undefined;
@@ -159,7 +159,7 @@ export declare const PopperContent: React.ForwardRefExoticComponent<Omit<import(
159
159
  /** @deprecated Use `animatePosition` instead */
160
160
  enableAnimationForPositionChange?: boolean | "even-when-repositioning";
161
161
  passThrough?: boolean;
162
- } & React.RefAttributes<GuiElement>>;
162
+ } & React.RefAttributes<HanzoguiElement>>;
163
163
  export type PopperArrowExtraProps = {
164
164
  offset?: number;
165
165
  size?: SizeTokens;
@@ -170,14 +170,14 @@ export type PopperArrowExtraProps = {
170
170
  animatePosition?: boolean;
171
171
  };
172
172
  export type PopperArrowProps = YStackProps & PopperArrowExtraProps;
173
- export declare const PopperArrowFrame: import("@gui/core").GuiComponent<import("@gui/core").TamaDefer, GuiElement, import("@gui/core").RNGuiViewNonStyleProps, import("@gui/core").StackStyleBase, {
173
+ export declare const PopperArrowFrame: import("@hanzogui/core").HanzoguiComponent<import("@hanzogui/core").TamaDefer, HanzoguiElement, import("@hanzogui/core").RNHanzoguiViewNonStyleProps, import("@hanzogui/core").StackStyleBase, {
174
174
  unstyled?: boolean | undefined;
175
175
  elevation?: number | SizeTokens | undefined;
176
176
  fullscreen?: boolean | undefined;
177
- }, import("@gui/core").StaticConfigPublic>;
178
- export declare const PopperArrow: React.ForwardRefExoticComponent<Omit<import("@gui/core").GetFinalProps<import("@gui/core").RNGuiViewNonStyleProps, import("@gui/core").StackStyleBase, {
177
+ }, import("@hanzogui/core").StaticConfigPublic>;
178
+ export declare const PopperArrow: React.ForwardRefExoticComponent<Omit<import("@hanzogui/core").GetFinalProps<import("@hanzogui/core").RNHanzoguiViewNonStyleProps, import("@hanzogui/core").StackStyleBase, {
179
179
  elevation?: number | SizeTokens | undefined;
180
180
  fullscreen?: boolean | undefined;
181
- }>, keyof import("@gui/stacks").StackVariants> & import("@gui/stacks").StackVariants & PopperArrowExtraProps & React.RefAttributes<GuiElement>>;
181
+ }>, keyof import("@hanzogui/stacks").StackVariants> & import("@hanzogui/stacks").StackVariants & PopperArrowExtraProps & React.RefAttributes<HanzoguiElement>>;
182
182
  export {};
183
183
  //# sourceMappingURL=Popper.d.ts.map