@bitrise/bitkit 9.17.0-alpha-badge.2 → 9.17.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 +2 -2
- package/src/Components/ColorButton/ColorButton.theme.ts +47 -8
- package/src/Components/Tabs/Tab.tsx +67 -0
- package/src/Components/Tabs/TabList.tsx +10 -0
- package/src/Components/Tabs/TabPanel.tsx +10 -0
- package/src/Components/Tabs/TabPanels.tsx +10 -0
- package/src/Components/Tabs/Tabs.stories.tsx +65 -0
- package/src/Components/Tabs/Tabs.theme.ts +52 -0
- package/src/Components/Tabs/Tabs.tsx +57 -0
- package/src/Old/AddonBeam/AddonBeam.tsx +9 -0
- package/src/Old/Badge/Badge.css +6 -0
- package/src/Old/Badge/Badge.tsx +18 -0
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useHistory.ts +67 -0
- package/src/index.ts +15 -2
- package/src/old.ts +3 -6
- package/src/theme.ts +2 -2
- package/src/tsconfig.tsbuildinfo +1 -1
- package/src/Components/Badge/Badge.stories.tsx +0 -13
- package/src/Components/Badge/Badge.theme.ts +0 -15
- package/src/Components/Badge/Badge.tsx +0 -18
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bitrise/bitkit",
|
|
3
3
|
"description": "Bitrise React component library",
|
|
4
|
-
"version": "9.17.0
|
|
4
|
+
"version": "9.17.0",
|
|
5
5
|
"repository": "git@github.com:bitrise-io/bitkit.git",
|
|
6
6
|
"main": "src/index.ts",
|
|
7
7
|
"license": "UNLICENSED",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"@babel/core": "^7.18.2",
|
|
56
56
|
"@bitrise/eslint-plugin": "^2.1.0",
|
|
57
57
|
"@chakra-ui/cli": "^1.9.0",
|
|
58
|
-
"@chakra-ui/storybook-addon": "^
|
|
58
|
+
"@chakra-ui/storybook-addon": "^1.0.3",
|
|
59
59
|
"@commitlint/cli": "^16.3.0",
|
|
60
60
|
"@commitlint/config-conventional": "^16.2.4",
|
|
61
61
|
"@google-cloud/storage": "^5.19.4",
|
|
@@ -1,10 +1,49 @@
|
|
|
1
1
|
const schemeColors = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
blue: {
|
|
3
|
+
color: 'blue.40',
|
|
4
|
+
_active: {
|
|
5
|
+
backgroundColor: 'blue.90',
|
|
6
|
+
},
|
|
7
|
+
_hover: {
|
|
8
|
+
backgroundColor: 'blue.93',
|
|
9
|
+
},
|
|
10
|
+
},
|
|
11
|
+
red: {
|
|
12
|
+
color: 'red.40',
|
|
13
|
+
_active: {
|
|
14
|
+
backgroundColor: 'red.90',
|
|
15
|
+
},
|
|
16
|
+
_hover: {
|
|
17
|
+
backgroundColor: 'red.93',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
green: {
|
|
21
|
+
color: 'green.50',
|
|
22
|
+
_active: {
|
|
23
|
+
backgroundColor: 'green.90',
|
|
24
|
+
},
|
|
25
|
+
_hover: {
|
|
26
|
+
backgroundColor: 'green.93',
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
yellow: {
|
|
30
|
+
color: 'yellow.40',
|
|
31
|
+
_active: {
|
|
32
|
+
backgroundColor: 'yellow.90',
|
|
33
|
+
},
|
|
34
|
+
_hover: {
|
|
35
|
+
backgroundColor: 'yellow.93',
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
purple: {
|
|
39
|
+
color: 'purple.40',
|
|
40
|
+
_active: {
|
|
41
|
+
backgroundColor: 'purple.90',
|
|
42
|
+
},
|
|
43
|
+
_hover: {
|
|
44
|
+
backgroundColor: 'purple.93',
|
|
45
|
+
},
|
|
46
|
+
},
|
|
8
47
|
};
|
|
9
48
|
|
|
10
49
|
const ColorButtonTheme = {
|
|
@@ -13,8 +52,8 @@ const ColorButtonTheme = {
|
|
|
13
52
|
display: 'inline-flex',
|
|
14
53
|
alignItems: 'center',
|
|
15
54
|
justifyContent: 'center',
|
|
16
|
-
|
|
17
|
-
|
|
55
|
+
backgroundColor: 'transparent',
|
|
56
|
+
...schemeColors[c || 'blue'],
|
|
18
57
|
};
|
|
19
58
|
},
|
|
20
59
|
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Badge as ChakraBadge,
|
|
4
|
+
BadgeProps as ChakraBadgeProps,
|
|
5
|
+
Button,
|
|
6
|
+
Tab as ChakraTab,
|
|
7
|
+
TabProps as ChakraTabProps,
|
|
8
|
+
forwardRef,
|
|
9
|
+
useMultiStyleConfig,
|
|
10
|
+
useTab,
|
|
11
|
+
} from '@chakra-ui/react';
|
|
12
|
+
import Icon from '../../Old/Icon/Icon';
|
|
13
|
+
import { TypeIconName } from '../../Old/Icon/tsx';
|
|
14
|
+
|
|
15
|
+
// TODO: separated component
|
|
16
|
+
interface BadgeProps extends ChakraBadgeProps {
|
|
17
|
+
backgroundColor?: ChakraBadgeProps['backgroundColor'];
|
|
18
|
+
children?: number | string;
|
|
19
|
+
color?: ChakraBadgeProps['color'];
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const Badge = (props: BadgeProps) => {
|
|
23
|
+
const properties: ChakraBadgeProps = {
|
|
24
|
+
...props,
|
|
25
|
+
borderRadius: '4',
|
|
26
|
+
fontSize: '1',
|
|
27
|
+
lineHeight: '1',
|
|
28
|
+
paddingY: '3px',
|
|
29
|
+
paddingX: '8',
|
|
30
|
+
textTransform: 'uppercase',
|
|
31
|
+
};
|
|
32
|
+
return <ChakraBadge {...properties} />;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export interface TabProps extends ChakraTabProps {
|
|
36
|
+
badge?: BadgeProps;
|
|
37
|
+
id: string;
|
|
38
|
+
leftIconName?: TypeIconName;
|
|
39
|
+
isDisabled?: boolean;
|
|
40
|
+
rightIconName?: TypeIconName;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const CustomTab = forwardRef((props, ref) => {
|
|
44
|
+
const { badge, leftIconName, rightIconName, ...rest } = props;
|
|
45
|
+
const tabProps = useTab({ ...rest, ref });
|
|
46
|
+
const styles = useMultiStyleConfig('Tabs', tabProps);
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<Button __css={styles.tab} {...tabProps}>
|
|
50
|
+
{leftIconName && <Icon name={leftIconName} />}
|
|
51
|
+
<span>{tabProps.children}</span>
|
|
52
|
+
{badge?.children && <Badge {...badge} />}
|
|
53
|
+
{rightIconName && <Icon name={rightIconName} />}
|
|
54
|
+
</Button>
|
|
55
|
+
);
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
const Tab = forwardRef<TabProps, 'div'>((props, ref) => {
|
|
59
|
+
const { badge, leftIconName, rightIconName, ...rest } = props;
|
|
60
|
+
const properties = rest;
|
|
61
|
+
if (badge?.children || leftIconName || rightIconName) {
|
|
62
|
+
return <CustomTab {...props} />;
|
|
63
|
+
}
|
|
64
|
+
return <ChakraTab {...properties} ref={ref} />;
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
export default Tab;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TabList as ChakraTabList, TabListProps, forwardRef } from '@chakra-ui/react';
|
|
3
|
+
|
|
4
|
+
const TabList = forwardRef<TabListProps, 'div'>((props, ref) => {
|
|
5
|
+
return <ChakraTabList {...props} ref={ref} />;
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
export type { TabListProps };
|
|
9
|
+
|
|
10
|
+
export default TabList;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TabPanel as ChakraTabPanel, TabPanelProps, forwardRef } from '@chakra-ui/react';
|
|
3
|
+
|
|
4
|
+
const TabPanel = forwardRef<TabPanelProps, 'div'>((props, ref) => {
|
|
5
|
+
return <ChakraTabPanel {...props} ref={ref} />;
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
export type { TabPanelProps };
|
|
9
|
+
|
|
10
|
+
export default TabPanel;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TabPanels as ChakraTabPanels, TabPanelsProps, forwardRef } from '@chakra-ui/react';
|
|
3
|
+
|
|
4
|
+
const TabPanels = forwardRef<TabPanelsProps, 'div'>((props, ref) => {
|
|
5
|
+
return <ChakraTabPanels {...props} ref={ref} />;
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
export type { TabPanelsProps };
|
|
9
|
+
|
|
10
|
+
export default TabPanels;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
2
|
+
import Tabs from './Tabs';
|
|
3
|
+
import TabList from './TabList';
|
|
4
|
+
import Tab from './Tab';
|
|
5
|
+
import TabPanels from './TabPanels';
|
|
6
|
+
import TabPanel from './TabPanel';
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
title: 'Components/Tabs',
|
|
10
|
+
component: Tabs,
|
|
11
|
+
subcomponents: { Tab },
|
|
12
|
+
argTypes: {
|
|
13
|
+
onChange: {
|
|
14
|
+
action: 'onChange event',
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
} as ComponentMeta<typeof Tabs>;
|
|
18
|
+
|
|
19
|
+
const badge = {
|
|
20
|
+
backgroundColor: 'yellow.80',
|
|
21
|
+
children: 'new',
|
|
22
|
+
color: 'neutral.10',
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const WithDefaults: ComponentStory<typeof Tabs> = (props) => {
|
|
26
|
+
return (
|
|
27
|
+
<Tabs defaultTab="selected-as-default" {...props}>
|
|
28
|
+
<TabList>
|
|
29
|
+
<Tab id="basic">Basic</Tab>
|
|
30
|
+
<Tab id="selected-as-default">Selected as default</Tab>
|
|
31
|
+
<Tab id="with-left-icon" leftIconName="Bell">
|
|
32
|
+
With left icon
|
|
33
|
+
</Tab>
|
|
34
|
+
<Tab id="with-badge" badge={badge}>
|
|
35
|
+
With badge
|
|
36
|
+
</Tab>
|
|
37
|
+
<Tab id="disabled" isDisabled>
|
|
38
|
+
Disabled
|
|
39
|
+
</Tab>
|
|
40
|
+
<Tab id="with-right-icon" rightIconName="ArrowForward">
|
|
41
|
+
With right icon
|
|
42
|
+
</Tab>
|
|
43
|
+
</TabList>
|
|
44
|
+
|
|
45
|
+
<TabPanels>
|
|
46
|
+
<TabPanel paddingTop="16">
|
|
47
|
+
<p>
|
|
48
|
+
You can add any style prop to <code>TabPanel</code>, like padding.
|
|
49
|
+
<br />
|
|
50
|
+
But doesn't have any default style.
|
|
51
|
+
</p>
|
|
52
|
+
</TabPanel>
|
|
53
|
+
<TabPanel paddingTop="16">You can use defaultIndex for this</TabPanel>
|
|
54
|
+
<TabPanel paddingTop="16">You can add icon to tab</TabPanel>
|
|
55
|
+
<TabPanel paddingTop="16">Or Badge</TabPanel>
|
|
56
|
+
<TabPanel paddingTop="16">This panel is disabled</TabPanel>
|
|
57
|
+
<TabPanel paddingTop="16">You can add icon to tab</TabPanel>
|
|
58
|
+
</TabPanels>
|
|
59
|
+
</Tabs>
|
|
60
|
+
);
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
WithDefaults.args = {
|
|
64
|
+
withHistory: true,
|
|
65
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
const TextTheme = {
|
|
2
|
+
baseStyle: {
|
|
3
|
+
tab: {
|
|
4
|
+
display: 'flex',
|
|
5
|
+
alignItems: 'center',
|
|
6
|
+
justifyContent: 'flex-start',
|
|
7
|
+
fontSize: '3',
|
|
8
|
+
gap: '8',
|
|
9
|
+
lineHeight: '3',
|
|
10
|
+
paddingX: '16',
|
|
11
|
+
paddingTop: '12',
|
|
12
|
+
paddingBottom: '10px',
|
|
13
|
+
borderBottom: '2px solid',
|
|
14
|
+
borderBottomColor: 'transparent',
|
|
15
|
+
color: 'neutral.50',
|
|
16
|
+
fontWeight: 'bold',
|
|
17
|
+
_selected: {
|
|
18
|
+
borderBottomColor: 'purple.50',
|
|
19
|
+
color: 'purple.50',
|
|
20
|
+
},
|
|
21
|
+
_focusVisible: {
|
|
22
|
+
backgroundColor: 'purple.95',
|
|
23
|
+
boxShadow: 'none',
|
|
24
|
+
color: 'purple.50',
|
|
25
|
+
},
|
|
26
|
+
_hover: {
|
|
27
|
+
backgroundColor: 'neutral.95',
|
|
28
|
+
},
|
|
29
|
+
_active: {
|
|
30
|
+
backgroundColor: 'neutral.93',
|
|
31
|
+
},
|
|
32
|
+
_disabled: {
|
|
33
|
+
color: 'neutral.70',
|
|
34
|
+
cursor: 'not-allowed',
|
|
35
|
+
_hover: {
|
|
36
|
+
background: 'transparent',
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
tablist: {
|
|
41
|
+
borderBottom: '1px solid',
|
|
42
|
+
borderBottomColor: 'separator.primary',
|
|
43
|
+
},
|
|
44
|
+
tabpanel: {
|
|
45
|
+
_focusVisible: {
|
|
46
|
+
boxShadow: 'none',
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export default TextTheme;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import { Tabs as ChakraTabs, TabsProps as ChakraTabsProps, forwardRef } from '@chakra-ui/react';
|
|
3
|
+
import { useHistory } from '../../hooks';
|
|
4
|
+
|
|
5
|
+
export interface TabsProps extends ChakraTabsProps {
|
|
6
|
+
defaultTab?: string;
|
|
7
|
+
onChange?: (index: number, tabId?: string) => void;
|
|
8
|
+
withHistory?: boolean;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const getTabIds = (props: TabsProps) => {
|
|
12
|
+
const ids: string[] = [];
|
|
13
|
+
const tabs = React.Children.toArray(props.children)[0] as any;
|
|
14
|
+
React.Children.forEach(tabs.props.children, (c, index) => {
|
|
15
|
+
ids[index] = c?.props?.id;
|
|
16
|
+
});
|
|
17
|
+
return ids;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* An accessible tabs component that provides keyboard interactions and ARIA attributes described in the WAI-ARIA Tabs Design Pattern.
|
|
22
|
+
*/
|
|
23
|
+
const Tabs = forwardRef<TabsProps, 'div'>((props, ref) => {
|
|
24
|
+
const { defaultTab = '', onChange, withHistory, ...rest } = props;
|
|
25
|
+
const tabIds = getTabIds(props);
|
|
26
|
+
const defaultIndex = tabIds.indexOf(defaultTab) > -1 ? tabIds.indexOf(defaultTab) : 0;
|
|
27
|
+
|
|
28
|
+
const { searchParams, replace } = useHistory();
|
|
29
|
+
const [actualIndex, setActualIndex] = useState(defaultIndex);
|
|
30
|
+
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
if (withHistory && searchParams.get('tab')) {
|
|
33
|
+
const tabName = searchParams.get('tab') || '';
|
|
34
|
+
const index = tabIds.indexOf(tabName) > -1 ? tabIds.indexOf(tabName) : defaultIndex;
|
|
35
|
+
setActualIndex(index);
|
|
36
|
+
}
|
|
37
|
+
}, []);
|
|
38
|
+
|
|
39
|
+
const onTabChange = (index: number) => {
|
|
40
|
+
const tabId = tabIds[index];
|
|
41
|
+
setActualIndex(index);
|
|
42
|
+
if (withHistory) {
|
|
43
|
+
if (tabId) {
|
|
44
|
+
searchParams.set('tab', tabId);
|
|
45
|
+
} else {
|
|
46
|
+
searchParams.delete('tab');
|
|
47
|
+
}
|
|
48
|
+
replace(`?${searchParams.toString()}`);
|
|
49
|
+
}
|
|
50
|
+
if (onChange) {
|
|
51
|
+
onChange(index, tabId);
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
return <ChakraTabs {...rest} ref={ref} onChange={onTabChange} index={actualIndex} />;
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
export default Tabs;
|
|
@@ -2,6 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { TypeIconName } from '../Icon/tsx';
|
|
3
3
|
import Flex, { Props as FlexProps } from '../Flex/Flex';
|
|
4
4
|
import Hamburger from '../Hamburger/Hamburger';
|
|
5
|
+
import Badge from '../Badge/Badge';
|
|
5
6
|
import Icon from '../Icon/Icon';
|
|
6
7
|
import Link from '../Link/Link';
|
|
7
8
|
import Image from '../Image/Image';
|
|
@@ -82,6 +83,14 @@ const AddonBeam: React.FunctionComponent<Props> = (props: Props) => {
|
|
|
82
83
|
by Bitrise
|
|
83
84
|
</Text>
|
|
84
85
|
</Flex>
|
|
86
|
+
|
|
87
|
+
{isBeta && (
|
|
88
|
+
<Flex>
|
|
89
|
+
<Badge backgroundColor="yellow.80" textColor="purple.10">
|
|
90
|
+
BETA
|
|
91
|
+
</Badge>
|
|
92
|
+
</Flex>
|
|
93
|
+
)}
|
|
85
94
|
</Flex>
|
|
86
95
|
|
|
87
96
|
{!isInResponsiveView && appName && (
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import classnames from 'classnames';
|
|
3
|
+
import Text, { Props as TextProps } from '../Text/Text';
|
|
4
|
+
import './Badge.css';
|
|
5
|
+
|
|
6
|
+
export interface Props extends TextProps {
|
|
7
|
+
uppercase?: boolean;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* A badge component, useful to provide context and highlight something
|
|
12
|
+
* important to a user.
|
|
13
|
+
*/
|
|
14
|
+
const Badge: React.FunctionComponent<Props> = ({ uppercase = true, className, ...rest }: Props) => {
|
|
15
|
+
return <Text {...rest} className={classnames('Badge', className)} size="1" uppercase={uppercase} />;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default Badge;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as useHistory } from './useHistory';
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
|
|
3
|
+
type UseLocation = {
|
|
4
|
+
pathname: string;
|
|
5
|
+
push: (url: string) => void;
|
|
6
|
+
replace: (url: string) => void;
|
|
7
|
+
search: string;
|
|
8
|
+
searchParams: URLSearchParams;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const getCurrentLocation = () => ({
|
|
12
|
+
pathname: window.location.pathname,
|
|
13
|
+
search: window.location.search,
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
const listeners: Array<() => void> = [];
|
|
17
|
+
|
|
18
|
+
const notify = () => {
|
|
19
|
+
listeners.forEach((listener) => listener());
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const getSearchParams = (search: string): URLSearchParams => {
|
|
23
|
+
const searchParams = new URLSearchParams(search);
|
|
24
|
+
return searchParams;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const useLocation = (): UseLocation => {
|
|
28
|
+
const [{ pathname, search }, setLocation] = useState(getCurrentLocation());
|
|
29
|
+
|
|
30
|
+
const handleChange = () => {
|
|
31
|
+
setLocation(getCurrentLocation());
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const push = (url: string) => {
|
|
35
|
+
window.history.pushState(null, '', url);
|
|
36
|
+
notify();
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const replace = (url: string) => {
|
|
40
|
+
window.history.replaceState(null, '', url);
|
|
41
|
+
notify();
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
useEffect(() => {
|
|
45
|
+
window.addEventListener('popstate', handleChange);
|
|
46
|
+
return () => {
|
|
47
|
+
window.removeEventListener('popstate', handleChange);
|
|
48
|
+
};
|
|
49
|
+
}, []);
|
|
50
|
+
|
|
51
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
52
|
+
// @ts-ignore
|
|
53
|
+
useEffect(() => {
|
|
54
|
+
listeners.push(handleChange);
|
|
55
|
+
return () => listeners.splice(listeners.indexOf(handleChange), 1);
|
|
56
|
+
}, []);
|
|
57
|
+
|
|
58
|
+
return {
|
|
59
|
+
pathname,
|
|
60
|
+
push,
|
|
61
|
+
replace,
|
|
62
|
+
search,
|
|
63
|
+
searchParams: getSearchParams(search),
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export default useLocation;
|
package/src/index.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './old';
|
|
2
2
|
export * from './types/chakra';
|
|
3
3
|
export * from './utils/chakra';
|
|
4
|
+
export * from './hooks';
|
|
4
5
|
|
|
5
6
|
export type { LinkProps } from './Components/Link/Link';
|
|
6
7
|
export { default as Link } from './Components/Link/Link';
|
|
@@ -38,5 +39,17 @@ export { default as Box } from './Components/Box/Box';
|
|
|
38
39
|
export type { ColorButtonProps } from './Components/ColorButton/ColorButton';
|
|
39
40
|
export { default as ColorButton } from './Components/ColorButton/ColorButton';
|
|
40
41
|
|
|
41
|
-
export type {
|
|
42
|
-
export { default as
|
|
42
|
+
export type { TabsProps } from './Components/Tabs/Tabs';
|
|
43
|
+
export { default as Tabs } from './Components/Tabs/Tabs';
|
|
44
|
+
|
|
45
|
+
export type { TabListProps } from './Components/Tabs/TabList';
|
|
46
|
+
export { default as TabList } from './Components/Tabs/TabList';
|
|
47
|
+
|
|
48
|
+
export type { TabProps } from './Components/Tabs/Tab';
|
|
49
|
+
export { default as Tab } from './Components/Tabs/Tab';
|
|
50
|
+
|
|
51
|
+
export type { TabPanelsProps } from './Components/Tabs/TabPanels';
|
|
52
|
+
export { default as TabPanels } from './Components/Tabs/TabPanels';
|
|
53
|
+
|
|
54
|
+
export type { TabPanelProps } from './Components/Tabs/TabPanel';
|
|
55
|
+
export { default as TabPanel } from './Components/Tabs/TabPanel';
|
package/src/old.ts
CHANGED
|
@@ -37,6 +37,9 @@ export { default as AppLayoutSidebar } from './Old/AppLayout/AppLayoutSidebar';
|
|
|
37
37
|
export type { Props as AvatarProps } from './Old/Avatar/Avatar';
|
|
38
38
|
export { default as Avatar } from './Old/Avatar/Avatar';
|
|
39
39
|
|
|
40
|
+
export type { Props as BadgeProps } from './Old/Badge/Badge';
|
|
41
|
+
export { default as Badge } from './Old/Badge/Badge';
|
|
42
|
+
|
|
40
43
|
export type { Props as BaseProps } from './Old/Base/Base';
|
|
41
44
|
export type { TypeBorderRadius } from './Old/Base/Base';
|
|
42
45
|
export type { TypeColors } from './Old/Base/Base';
|
|
@@ -223,12 +226,6 @@ export { default as TableHeaderRow } from './Old/Table/TableHeaderRow';
|
|
|
223
226
|
export type { Props as TableRowProps } from './Old/Table/TableRow';
|
|
224
227
|
export { default as TableRow } from './Old/Table/TableRow';
|
|
225
228
|
|
|
226
|
-
export type { Props as TabProps } from './Old/Tabs/Tab';
|
|
227
|
-
export { default as Tab } from './Old/Tabs/Tab';
|
|
228
|
-
|
|
229
|
-
export type { Props as TabsProps } from './Old/Tabs/Tabs';
|
|
230
|
-
export { default as Tabs } from './Old/Tabs/Tabs';
|
|
231
|
-
|
|
232
229
|
export type { Props as TextareaProps } from './Old/Textarea/Textarea';
|
|
233
230
|
export { default as Textarea } from './Old/Textarea/Textarea';
|
|
234
231
|
|
package/src/theme.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import Badge from './Components/Badge/Badge.theme';
|
|
2
1
|
import Button from './Components/Button/Button.theme';
|
|
3
2
|
import Card from './Components/Card/Card.theme';
|
|
4
3
|
import ColorButton from './Components/ColorButton/ColorButton.theme';
|
|
5
4
|
import Divider from './Components/Divider/Divider.theme';
|
|
6
5
|
import Link from './Components/Link/Link.theme';
|
|
7
6
|
import Menu from './Components/Menu/Menu.theme';
|
|
7
|
+
import Tabs from './Components/Tabs/Tabs.theme';
|
|
8
8
|
import Text from './Components/Text/Text.theme';
|
|
9
9
|
|
|
10
10
|
import colors from './Foundations/Colors/Colors';
|
|
@@ -47,13 +47,13 @@ const theme = {
|
|
|
47
47
|
},
|
|
48
48
|
},
|
|
49
49
|
components: {
|
|
50
|
-
Badge,
|
|
51
50
|
Button,
|
|
52
51
|
Card,
|
|
53
52
|
ColorButton,
|
|
54
53
|
Divider,
|
|
55
54
|
Link,
|
|
56
55
|
Menu,
|
|
56
|
+
Tabs,
|
|
57
57
|
Text,
|
|
58
58
|
},
|
|
59
59
|
};
|