@hanzogui/tabs 3.0.1 → 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.
Files changed (55) hide show
  1. package/package.json +21 -21
  2. package/src/Tabs.tsx +1 -1
  3. package/src/createTabs.tsx +11 -6
  4. package/types/StyledContext.d.ts +1 -1
  5. package/types/Tabs.d.ts +11 -11
  6. package/types/createTabs.d.ts +136 -136
  7. package/types/index.d.ts +167 -167
  8. package/dist/cjs/StyledContext.cjs +0 -31
  9. package/dist/cjs/StyledContext.native.js +0 -34
  10. package/dist/cjs/StyledContext.native.js.map +0 -1
  11. package/dist/cjs/Tabs.cjs +0 -81
  12. package/dist/cjs/Tabs.native.js +0 -84
  13. package/dist/cjs/Tabs.native.js.map +0 -1
  14. package/dist/cjs/createTabs.cjs +0 -262
  15. package/dist/cjs/createTabs.native.js +0 -280
  16. package/dist/cjs/createTabs.native.js.map +0 -1
  17. package/dist/cjs/index.cjs +0 -35
  18. package/dist/cjs/index.native.js +0 -38
  19. package/dist/cjs/index.native.js.map +0 -1
  20. package/dist/esm/StyledContext.mjs +0 -7
  21. package/dist/esm/StyledContext.mjs.map +0 -1
  22. package/dist/esm/StyledContext.native.js +0 -7
  23. package/dist/esm/StyledContext.native.js.map +0 -1
  24. package/dist/esm/Tabs.mjs +0 -56
  25. package/dist/esm/Tabs.mjs.map +0 -1
  26. package/dist/esm/Tabs.native.js +0 -56
  27. package/dist/esm/Tabs.native.js.map +0 -1
  28. package/dist/esm/createTabs.mjs +0 -228
  29. package/dist/esm/createTabs.mjs.map +0 -1
  30. package/dist/esm/createTabs.native.js +0 -243
  31. package/dist/esm/createTabs.native.js.map +0 -1
  32. package/dist/esm/index.js +0 -11
  33. package/dist/esm/index.js.map +0 -1
  34. package/dist/esm/index.mjs +0 -11
  35. package/dist/esm/index.mjs.map +0 -1
  36. package/dist/esm/index.native.js +0 -11
  37. package/dist/esm/index.native.js.map +0 -1
  38. package/dist/jsx/StyledContext.mjs +0 -7
  39. package/dist/jsx/StyledContext.mjs.map +0 -1
  40. package/dist/jsx/StyledContext.native.js +0 -34
  41. package/dist/jsx/StyledContext.native.js.map +0 -1
  42. package/dist/jsx/Tabs.mjs +0 -56
  43. package/dist/jsx/Tabs.mjs.map +0 -1
  44. package/dist/jsx/Tabs.native.js +0 -84
  45. package/dist/jsx/Tabs.native.js.map +0 -1
  46. package/dist/jsx/createTabs.mjs +0 -228
  47. package/dist/jsx/createTabs.mjs.map +0 -1
  48. package/dist/jsx/createTabs.native.js +0 -280
  49. package/dist/jsx/createTabs.native.js.map +0 -1
  50. package/dist/jsx/index.js +0 -11
  51. package/dist/jsx/index.js.map +0 -1
  52. package/dist/jsx/index.mjs +0 -11
  53. package/dist/jsx/index.mjs.map +0 -1
  54. package/dist/jsx/index.native.js +0 -38
  55. package/dist/jsx/index.native.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hanzogui/tabs",
3
- "version": "3.0.1",
3
+ "version": "7.0.0",
4
4
  "gitHead": "a49cc7ea6b93ba384e77a4880ae48ac4a5635c14",
5
5
  "source": "src/index.ts",
6
6
  "files": [
@@ -31,29 +31,29 @@
31
31
  "access": "public"
32
32
  },
33
33
  "scripts": {
34
- "build": "hanzo-gui-build",
35
- "watch": "hanzo-gui-build --watch",
36
- "clean": "hanzo-gui-build clean",
37
- "clean:build": "hanzo-gui-build clean:build"
34
+ "build": "hanzogui-build",
35
+ "watch": "hanzogui-build --watch",
36
+ "clean": "hanzogui-build clean",
37
+ "clean:build": "hanzogui-build clean:build"
38
38
  },
39
39
  "dependencies": {
40
- "@hanzogui/compose-refs": "3.0.0",
41
- "@hanzogui/constants": "3.0.0",
42
- "@hanzogui/core": "3.0.0",
43
- "@hanzogui/create-context": "3.0.0",
44
- "@hanzogui/element": "3.0.0",
45
- "@hanzogui/get-button-sized": "3.0.0",
46
- "@hanzogui/group": "3.0.0",
47
- "@hanzogui/helpers": "3.0.0",
48
- "@hanzogui/roving-focus": "3.0.0",
49
- "@hanzogui/sizable-context": "3.0.0",
50
- "@hanzogui/stacks": "3.0.0",
51
- "@hanzogui/use-controllable-state": "3.0.0",
52
- "@hanzogui/use-direction": "3.0.0",
53
- "@hanzogui/web": "3.0.0"
40
+ "@hanzogui/compose-refs": "^7.0.0",
41
+ "@hanzogui/constants": "^7.0.0",
42
+ "@hanzogui/core": "^7.0.0",
43
+ "@hanzogui/create-context": "^7.0.0",
44
+ "@hanzogui/element": "^7.0.0",
45
+ "@hanzogui/get-button-sized": "^7.0.0",
46
+ "@hanzogui/group": "^7.0.0",
47
+ "@hanzogui/helpers": "^7.0.0",
48
+ "@hanzogui/roving-focus": "^7.0.0",
49
+ "@hanzogui/sizable-context": "^7.0.0",
50
+ "@hanzogui/stacks": "^7.0.0",
51
+ "@hanzogui/use-controllable-state": "^7.0.0",
52
+ "@hanzogui/use-direction": "^7.0.0",
53
+ "@hanzogui/web": "^7.0.0"
54
54
  },
55
55
  "devDependencies": {
56
- "@hanzogui/build": "3.0.0",
56
+ "@hanzogui/build": "^7.0.0",
57
57
  "react": ">=19",
58
58
  "react-native": "0.83.2"
59
59
  },
@@ -62,4 +62,4 @@
62
62
  "react-native": "*"
63
63
  },
64
64
  "module:jsx": "dist/jsx"
65
- }
65
+ }
package/src/Tabs.tsx CHANGED
@@ -52,7 +52,7 @@ export const DefaultTabsTabFrame = styled(
52
52
  } as const,
53
53
 
54
54
  defaultVariants: {
55
- unstyled: process.env.HANZO_GUI_HEADLESS === '1',
55
+ unstyled: process.env.HANZOGUI_HEADLESS === '1',
56
56
  },
57
57
  },
58
58
  {
@@ -7,7 +7,7 @@ import { RovingFocusGroup, type RovingFocusGroupProps } from '@hanzogui/roving-f
7
7
  import { SizableContext } from '@hanzogui/sizable-context'
8
8
  import { useControllableState } from '@hanzogui/use-controllable-state'
9
9
  import { useDirection } from '@hanzogui/use-direction'
10
- import type { GetProps, GuiElement, ViewProps } from '@hanzogui/web'
10
+ import type { GetProps, HanzoguiElement, ViewProps } from '@hanzogui/web'
11
11
  import { useEvent } from '@hanzogui/web'
12
12
  import * as React from 'react'
13
13
  import type { LayoutRectangle } from 'react-native'
@@ -37,7 +37,7 @@ export function createTabs<
37
37
 
38
38
  const TAB_LIST_NAME = 'TabsList'
39
39
 
40
- const TabsList = React.forwardRef<GuiElement, TabsListProps>(
40
+ const TabsList = React.forwardRef<HanzoguiElement, TabsListProps>(
41
41
  (props: ScopedProps<TabsListProps>, forwardedRef) => {
42
42
  const { __scopeTabs, loop = true, children, ...listProps } = props
43
43
  const context = useTabsContext(__scopeTabs)
@@ -94,7 +94,7 @@ export function createTabs<
94
94
  const contentId = makeContentId(context.baseId, value)
95
95
  const isSelected = value === context.value
96
96
  const [layout, setLayout] = React.useState<TabLayout | null>(null)
97
- const triggerRef = React.useRef<GuiElement>(null)
97
+ const triggerRef = React.useRef<HanzoguiElement>(null)
98
98
  const groupItemProps = useGroupItem({ disabled: !!disabled })
99
99
 
100
100
  React.useEffect(() => {
@@ -122,7 +122,7 @@ export function createTabs<
122
122
  observer.observe(el)
123
123
 
124
124
  return () => {
125
- observer.unobserve(el)
125
+ observer.disconnect()
126
126
  }
127
127
  }, [context.triggersCount])
128
128
 
@@ -140,6 +140,11 @@ export function createTabs<
140
140
  active={isSelected}
141
141
  >
142
142
  <TabFrame
143
+ {...(!isWeb && {
144
+ onLayout: (event) => {
145
+ setLayout(event.nativeEvent.layout)
146
+ },
147
+ })}
143
148
  onMouseEnter={composeEventHandlers(props.onMouseEnter, () => {
144
149
  if (layout) {
145
150
  onInteraction?.('hover', layout)
@@ -318,7 +323,7 @@ export function createTabs<
318
323
  // this broke things outside our repo, but not sure why, all non style props were missing
319
324
  // like onPress etc
320
325
  // as <Tab = string>(
321
- // props: TabsProps<Tab> & { ref?: React.Ref<GuiElement> }
326
+ // props: TabsProps<Tab> & { ref?: React.Ref<HanzoguiElement> }
322
327
  // ) => React.JSX.Element
323
328
 
324
329
  return withStaticProperties(TabsComponent, {
@@ -415,7 +420,7 @@ type TabsContentExtraProps = {
415
420
 
416
421
  /**
417
422
  * Used to force mounting when more control is needed. Useful when
418
- * controlling animation with Gui animations.
423
+ * controlling animation with Hanzogui animations.
419
424
  */
420
425
  forceMount?: boolean
421
426
  }
@@ -1,4 +1,4 @@
1
- import type { SizeTokens } from '@gui/core';
1
+ import type { SizeTokens } from '@hanzogui/core';
2
2
  import type { TabsProps } from './createTabs';
3
3
  export type TabsContextValue = {
4
4
  baseId: string;
package/types/Tabs.d.ts CHANGED
@@ -1,17 +1,17 @@
1
- export declare const DefaultTabsFrame: import("@gui/core").GuiComponent<import("@gui/core").TamaDefer, import("@gui/core").GuiElement, import("@gui/core").RNGuiViewNonStyleProps, import("@gui/core").StackStyleBase, {
2
- size?: import("@gui/core").SizeTokens | undefined;
1
+ export declare const DefaultTabsFrame: import("@hanzogui/core").HanzoguiComponent<import("@hanzogui/core").TamaDefer, import("@hanzogui/core").HanzoguiElement, import("@hanzogui/core").RNHanzoguiViewNonStyleProps, import("@hanzogui/core").StackStyleBase, {
2
+ size?: import("@hanzogui/core").SizeTokens | undefined;
3
3
  unstyled?: boolean | undefined;
4
- elevation?: number | import("@gui/core").SizeTokens | undefined;
4
+ elevation?: number | import("@hanzogui/core").SizeTokens | undefined;
5
5
  transparent?: boolean | undefined;
6
6
  fullscreen?: boolean | undefined;
7
7
  circular?: boolean | undefined;
8
8
  elevate?: boolean | undefined;
9
9
  bordered?: boolean | undefined;
10
10
  chromeless?: boolean | "all" | undefined;
11
- }, import("@gui/core").StaticConfigPublic>;
12
- export declare const DefaultTabsTabFrame: import("@gui/core").GuiComponent<import("@gui/core").TamaDefer, import("@gui/core").GuiElement, import("@gui/core").RNGuiViewNonStyleProps, import("@gui/core").StackStyleBase & {
13
- readonly activeStyle?: Partial<import("@gui/core").InferStyleProps<import("react").ForwardRefExoticComponent<Omit<import("@gui/core").RNGuiViewNonStyleProps, keyof import("@gui/core").StackStyleBase> & import("@gui/core").WithThemeValues<import("@gui/core").StackStyleBase> & import("@gui/core").WithShorthands<import("@gui/core").WithThemeValues<import("@gui/core").StackStyleBase>> & import("@gui/core").WithPseudoProps<import("@gui/core").WithThemeValues<import("@gui/core").StackStyleBase> & import("@gui/core").WithShorthands<import("@gui/core").WithThemeValues<import("@gui/core").StackStyleBase>>> & import("@gui/core").WithMediaProps<import("@gui/core").WithThemeShorthandsAndPseudos<import("@gui/core").StackStyleBase, {}>> & import("react").RefAttributes<import("@gui/core").GuiElement>> & import("@gui/core").StaticComponentObject<import("@gui/core").TamaDefer, import("@gui/core").GuiElement, import("@gui/core").RNGuiViewNonStyleProps, import("@gui/core").StackStyleBase, {}, {}> & Omit<{}, "staticConfig" | "styleable"> & {
14
- __tama: [import("@gui/core").TamaDefer, import("@gui/core").GuiElement, import("@gui/core").RNGuiViewNonStyleProps, import("@gui/core").StackStyleBase, {}, {}];
11
+ }, import("@hanzogui/core").StaticConfigPublic>;
12
+ export declare const DefaultTabsTabFrame: import("@hanzogui/core").HanzoguiComponent<import("@hanzogui/core").TamaDefer, import("@hanzogui/core").HanzoguiElement, import("@hanzogui/core").RNHanzoguiViewNonStyleProps, import("@hanzogui/core").StackStyleBase & {
13
+ readonly activeStyle?: Partial<import("@hanzogui/core").InferStyleProps<import("react").ForwardRefExoticComponent<Omit<import("@hanzogui/core").RNHanzoguiViewNonStyleProps, keyof import("@hanzogui/core").StackStyleBase> & import("@hanzogui/core").WithThemeValues<import("@hanzogui/core").StackStyleBase> & import("@hanzogui/core").WithShorthands<import("@hanzogui/core").WithThemeValues<import("@hanzogui/core").StackStyleBase>> & import("@hanzogui/core").WithPseudoProps<import("@hanzogui/core").WithThemeValues<import("@hanzogui/core").StackStyleBase> & import("@hanzogui/core").WithShorthands<import("@hanzogui/core").WithThemeValues<import("@hanzogui/core").StackStyleBase>>> & import("@hanzogui/core").WithMediaProps<import("@hanzogui/core").WithThemeShorthandsAndPseudos<import("@hanzogui/core").StackStyleBase, {}>> & import("react").RefAttributes<import("@hanzogui/core").HanzoguiElement>> & import("@hanzogui/core").StaticComponentObject<import("@hanzogui/core").TamaDefer, import("@hanzogui/core").HanzoguiElement, import("@hanzogui/core").RNHanzoguiViewNonStyleProps, import("@hanzogui/core").StackStyleBase, {}, {}> & Omit<{}, "staticConfig" | "styleable"> & {
14
+ __tama: [import("@hanzogui/core").TamaDefer, import("@hanzogui/core").HanzoguiElement, import("@hanzogui/core").RNHanzoguiViewNonStyleProps, import("@hanzogui/core").StackStyleBase, {}, {}];
15
15
  }, {
16
16
  accept: {
17
17
  readonly activeStyle: "style";
@@ -20,19 +20,19 @@ export declare const DefaultTabsTabFrame: import("@gui/core").GuiComponent<impor
20
20
  }, {
21
21
  disabled?: boolean | undefined;
22
22
  unstyled?: boolean | undefined;
23
- size?: import("@gui/core").SizeTokens | undefined;
23
+ size?: import("@hanzogui/core").SizeTokens | undefined;
24
24
  }, {
25
25
  accept: {
26
26
  readonly activeStyle: "style";
27
27
  };
28
28
  }>;
29
- export declare const DefaultTabsContentFrame: import("@gui/core").GuiComponent<import("@gui/core").TamaDefer, import("@gui/core").GuiElement, import("@gui/core").RNGuiViewNonStyleProps, import("@gui/core").StackStyleBase, {
30
- elevation?: number | import("@gui/core").SizeTokens | undefined;
29
+ export declare const DefaultTabsContentFrame: import("@hanzogui/core").HanzoguiComponent<import("@hanzogui/core").TamaDefer, import("@hanzogui/core").HanzoguiElement, import("@hanzogui/core").RNHanzoguiViewNonStyleProps, import("@hanzogui/core").StackStyleBase, {
30
+ elevation?: number | import("@hanzogui/core").SizeTokens | undefined;
31
31
  transparent?: boolean | undefined;
32
32
  fullscreen?: boolean | undefined;
33
33
  circular?: boolean | undefined;
34
34
  elevate?: boolean | undefined;
35
35
  bordered?: boolean | undefined;
36
36
  chromeless?: boolean | "all" | undefined;
37
- }, import("@gui/core").StaticConfigPublic>;
37
+ }, import("@hanzogui/core").StaticConfigPublic>;
38
38
  //# sourceMappingURL=Tabs.d.ts.map