@fountain-ui/core 3.0.0-alpha.15 → 3.0.0-alpha.16
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/build/commonjs/Tab/Tab.js +2 -1
- package/build/commonjs/Tab/Tab.js.map +1 -1
- package/build/commonjs/Tab/TabProps.js +3 -1
- package/build/commonjs/Tab/TabProps.js.map +1 -1
- package/build/commonjs/Tab/index.js +14 -0
- package/build/commonjs/Tab/index.js.map +1 -1
- package/build/commonjs/Tab/useVariantStyleMap.js +18 -12
- package/build/commonjs/Tab/useVariantStyleMap.js.map +1 -1
- package/build/commonjs/Tabs/Tabs.js +4 -5
- package/build/commonjs/Tabs/Tabs.js.map +1 -1
- package/build/commonjs/Tabs/TabsProps.js.map +1 -1
- package/build/commonjs/Tabs/useTabsStyle.js +15 -6
- package/build/commonjs/Tabs/useTabsStyle.js.map +1 -1
- package/build/module/Tab/Tab.js +2 -1
- package/build/module/Tab/Tab.js.map +1 -1
- package/build/module/Tab/TabProps.js +1 -0
- package/build/module/Tab/TabProps.js.map +1 -1
- package/build/module/Tab/index.js +1 -0
- package/build/module/Tab/index.js.map +1 -1
- package/build/module/Tab/useVariantStyleMap.js +18 -12
- package/build/module/Tab/useVariantStyleMap.js.map +1 -1
- package/build/module/Tabs/Tabs.js +4 -5
- package/build/module/Tabs/Tabs.js.map +1 -1
- package/build/module/Tabs/TabsProps.js.map +1 -1
- package/build/module/Tabs/useTabsStyle.js +15 -6
- package/build/module/Tabs/useTabsStyle.js.map +1 -1
- package/build/typescript/Tab/TabProps.d.ts +7 -0
- package/build/typescript/Tab/index.d.ts +2 -1
- package/build/typescript/Tab/useVariantStyleMap.d.ts +2 -2
- package/build/typescript/Tabs/Tabs.d.ts +1 -1
- package/build/typescript/Tabs/TabsProps.d.ts +6 -1
- package/build/typescript/Tabs/useTabsStyle.d.ts +2 -2
- package/package.json +2 -2
- package/src/Tab/Tab.tsx +3 -2
- package/src/Tab/TabProps.ts +9 -0
- package/src/Tab/index.ts +2 -1
- package/src/Tab/useVariantStyleMap.ts +18 -12
- package/src/Tabs/Tabs.tsx +4 -7
- package/src/Tabs/TabsProps.ts +7 -1
- package/src/Tabs/useTabsStyle.ts +14 -6
package/src/Tabs/useTabsStyle.ts
CHANGED
|
@@ -2,16 +2,16 @@ import { useMemo } from 'react';
|
|
|
2
2
|
import type { FountainUiStyle } from '@fountain-ui/styles';
|
|
3
3
|
import { useBreakpointUp } from '../hooks';
|
|
4
4
|
import { useTheme } from '../styles';
|
|
5
|
-
import type { TabVariant } from '../Tab';
|
|
5
|
+
import type { TabSize, TabVariant } from '../Tab';
|
|
6
6
|
|
|
7
7
|
interface TabsStyle {
|
|
8
8
|
container: FountainUiStyle;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
export default function useTabsStyle(variant: TabVariant) {
|
|
11
|
+
export default function useTabsStyle(variant: TabVariant, size: TabSize) {
|
|
12
12
|
const theme = useTheme();
|
|
13
13
|
|
|
14
|
-
const
|
|
14
|
+
const isTablet = useBreakpointUp('md', true, false);
|
|
15
15
|
|
|
16
16
|
return useMemo<TabsStyle>(() => {
|
|
17
17
|
switch (variant) {
|
|
@@ -19,7 +19,14 @@ export default function useTabsStyle(variant: TabVariant) {
|
|
|
19
19
|
return {
|
|
20
20
|
container: {
|
|
21
21
|
paddingBottom: 8,
|
|
22
|
-
paddingHorizontal:
|
|
22
|
+
paddingHorizontal: isTablet ? 20 : (size === 'small' ? 8 : 12),
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
case 'circular-home':
|
|
26
|
+
return {
|
|
27
|
+
container: {
|
|
28
|
+
paddingBottom: 8,
|
|
29
|
+
paddingHorizontal: isTablet ? 20 : 8,
|
|
23
30
|
},
|
|
24
31
|
};
|
|
25
32
|
case 'bottom-navigation':
|
|
@@ -27,15 +34,16 @@ export default function useTabsStyle(variant: TabVariant) {
|
|
|
27
34
|
container: {
|
|
28
35
|
borderTopColor: theme.palette.border.base,
|
|
29
36
|
borderTopWidth: 0.5,
|
|
37
|
+
paddingHorizontal: 20,
|
|
30
38
|
},
|
|
31
39
|
};
|
|
32
40
|
case 'default':
|
|
33
41
|
default:
|
|
34
42
|
return {
|
|
35
43
|
container: {
|
|
36
|
-
paddingHorizontal:
|
|
44
|
+
paddingHorizontal: isTablet ? 14 : 6,
|
|
37
45
|
},
|
|
38
46
|
};
|
|
39
47
|
}
|
|
40
|
-
}, [theme, variant,
|
|
48
|
+
}, [theme, variant, isTablet, size]);
|
|
41
49
|
}
|