@hanzogui/tabs 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 +21 -21
- package/src/Tabs.tsx +1 -1
- package/src/createTabs.tsx +11 -6
- package/types/StyledContext.d.ts +1 -1
- package/types/Tabs.d.ts +11 -11
- package/types/createTabs.d.ts +136 -136
- package/types/index.d.ts +167 -167
- package/dist/cjs/StyledContext.cjs +0 -31
- package/dist/cjs/StyledContext.native.js +0 -34
- package/dist/cjs/StyledContext.native.js.map +0 -1
- package/dist/cjs/Tabs.cjs +0 -81
- package/dist/cjs/Tabs.native.js +0 -84
- package/dist/cjs/Tabs.native.js.map +0 -1
- package/dist/cjs/createTabs.cjs +0 -262
- package/dist/cjs/createTabs.native.js +0 -280
- package/dist/cjs/createTabs.native.js.map +0 -1
- package/dist/cjs/index.cjs +0 -35
- package/dist/cjs/index.native.js +0 -38
- package/dist/cjs/index.native.js.map +0 -1
- package/dist/esm/StyledContext.mjs +0 -7
- package/dist/esm/StyledContext.mjs.map +0 -1
- package/dist/esm/StyledContext.native.js +0 -7
- package/dist/esm/StyledContext.native.js.map +0 -1
- package/dist/esm/Tabs.mjs +0 -56
- package/dist/esm/Tabs.mjs.map +0 -1
- package/dist/esm/Tabs.native.js +0 -56
- package/dist/esm/Tabs.native.js.map +0 -1
- package/dist/esm/createTabs.mjs +0 -228
- package/dist/esm/createTabs.mjs.map +0 -1
- package/dist/esm/createTabs.native.js +0 -243
- package/dist/esm/createTabs.native.js.map +0 -1
- package/dist/esm/index.js +0 -11
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/index.mjs +0 -11
- package/dist/esm/index.mjs.map +0 -1
- package/dist/esm/index.native.js +0 -11
- package/dist/esm/index.native.js.map +0 -1
- package/dist/jsx/StyledContext.mjs +0 -7
- package/dist/jsx/StyledContext.mjs.map +0 -1
- package/dist/jsx/StyledContext.native.js +0 -34
- package/dist/jsx/StyledContext.native.js.map +0 -1
- package/dist/jsx/Tabs.mjs +0 -56
- package/dist/jsx/Tabs.mjs.map +0 -1
- package/dist/jsx/Tabs.native.js +0 -84
- package/dist/jsx/Tabs.native.js.map +0 -1
- package/dist/jsx/createTabs.mjs +0 -228
- package/dist/jsx/createTabs.mjs.map +0 -1
- package/dist/jsx/createTabs.native.js +0 -280
- package/dist/jsx/createTabs.native.js.map +0 -1
- package/dist/jsx/index.js +0 -11
- package/dist/jsx/index.js.map +0 -1
- package/dist/jsx/index.mjs +0 -11
- package/dist/jsx/index.mjs.map +0 -1
- package/dist/jsx/index.native.js +0 -38
- 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
|
+
"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": "
|
|
35
|
-
"watch": "
|
|
36
|
-
"clean": "
|
|
37
|
-
"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": "
|
|
41
|
-
"@hanzogui/constants": "
|
|
42
|
-
"@hanzogui/core": "
|
|
43
|
-
"@hanzogui/create-context": "
|
|
44
|
-
"@hanzogui/element": "
|
|
45
|
-
"@hanzogui/get-button-sized": "
|
|
46
|
-
"@hanzogui/group": "
|
|
47
|
-
"@hanzogui/helpers": "
|
|
48
|
-
"@hanzogui/roving-focus": "
|
|
49
|
-
"@hanzogui/sizable-context": "
|
|
50
|
-
"@hanzogui/stacks": "
|
|
51
|
-
"@hanzogui/use-controllable-state": "
|
|
52
|
-
"@hanzogui/use-direction": "
|
|
53
|
-
"@hanzogui/web": "
|
|
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": "
|
|
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
package/src/createTabs.tsx
CHANGED
|
@@ -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,
|
|
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<
|
|
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<
|
|
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.
|
|
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<
|
|
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
|
|
423
|
+
* controlling animation with Hanzogui animations.
|
|
419
424
|
*/
|
|
420
425
|
forceMount?: boolean
|
|
421
426
|
}
|
package/types/StyledContext.d.ts
CHANGED
package/types/Tabs.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
export declare const DefaultTabsFrame: import("@
|
|
2
|
-
size?: import("@
|
|
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("@
|
|
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("@
|
|
12
|
-
export declare const DefaultTabsTabFrame: import("@
|
|
13
|
-
readonly activeStyle?: Partial<import("@
|
|
14
|
-
__tama: [import("@
|
|
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("@
|
|
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("@
|
|
30
|
-
elevation?: number | import("@
|
|
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("@
|
|
37
|
+
}, import("@hanzogui/core").StaticConfigPublic>;
|
|
38
38
|
//# sourceMappingURL=Tabs.d.ts.map
|