@storybook/react-native-ui 8.0.0-alpha.3
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/LICENSE +21 -0
- package/dist/index.d.ts +492 -0
- package/dist/index.js +2860 -0
- package/package.json +85 -0
- package/src/Button.stories.tsx +134 -0
- package/src/Button.tsx +243 -0
- package/src/Explorer.stories.tsx +46 -0
- package/src/Explorer.tsx +54 -0
- package/src/IconButton.tsx +11 -0
- package/src/Layout.stories.tsx +38 -0
- package/src/Layout.tsx +103 -0
- package/src/LayoutProvider.tsx +90 -0
- package/src/MobileAddonsPanel.tsx +166 -0
- package/src/MobileMenuDrawer.tsx +75 -0
- package/src/Refs.tsx +142 -0
- package/src/Search.tsx +336 -0
- package/src/SearchResults.tsx +315 -0
- package/src/Sidebar.stories.tsx +262 -0
- package/src/Sidebar.tsx +200 -0
- package/src/Tree.stories.tsx +139 -0
- package/src/Tree.tsx +441 -0
- package/src/TreeNode.stories.tsx +122 -0
- package/src/TreeNode.tsx +146 -0
- package/src/constants.ts +4 -0
- package/src/icon/BottomBarToggleIcon.tsx +23 -0
- package/src/icon/CloseIcon.tsx +22 -0
- package/src/icon/CollapseAllIcon.tsx +17 -0
- package/src/icon/CollapseIcon.tsx +39 -0
- package/src/icon/ComponentIcon.tsx +14 -0
- package/src/icon/ExpandAllIcon.tsx +17 -0
- package/src/icon/FaceHappyIcon.tsx +18 -0
- package/src/icon/GroupIcon.tsx +14 -0
- package/src/icon/MenuIcon.tsx +18 -0
- package/src/icon/SearchIcon.tsx +17 -0
- package/src/icon/StoryIcon.tsx +14 -0
- package/src/index.tsx +9 -0
- package/src/mockdata.large.ts +25217 -0
- package/src/mockdata.ts +287 -0
- package/src/types.ts +78 -0
- package/src/useExpanded.ts +130 -0
- package/src/useLastViewed.ts +48 -0
- package/src/util/status.tsx +70 -0
- package/src/util/tree.ts +91 -0
package/src/constants.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Path, Svg, SvgProps } from 'react-native-svg';
|
|
2
|
+
|
|
3
|
+
export const BottomBarToggleIcon = ({
|
|
4
|
+
color = 'currentColor',
|
|
5
|
+
width = 14,
|
|
6
|
+
height = 14,
|
|
7
|
+
...props
|
|
8
|
+
}: SvgProps) => {
|
|
9
|
+
return (
|
|
10
|
+
<Svg width={width} height={height} viewBox="0 0 14 14" fill="none" {...props}>
|
|
11
|
+
<Path
|
|
12
|
+
d="M3.5 10.004a.5.5 0 000 1h1a.5.5 0 000-1h-1zM6 10.504a.5.5 0 01.5-.5h1a.5.5 0 010 1h-1a.5.5 0 01-.5-.5zM9.5 10.004a.5.5 0 000 1h1a.5.5 0 000-1h-1z"
|
|
13
|
+
fill={color}
|
|
14
|
+
/>
|
|
15
|
+
<Path
|
|
16
|
+
fillRule="evenodd"
|
|
17
|
+
clipRule="evenodd"
|
|
18
|
+
d="M1 12.504v-11a.5.5 0 01.5-.5h11a.5.5 0 01.5.5v11a.5.5 0 01-.5.5h-11a.5.5 0 01-.5-.5zm1-.5v-3h10v3H2zm4.5-4H2v-6h10v6H7.5V5.21l.646.646a.5.5 0 10.708-.707l-1.5-1.5a.5.5 0 00-.708 0l-1.5 1.5a.5.5 0 10.708.707l.646-.646v2.793z"
|
|
19
|
+
fill={color}
|
|
20
|
+
/>
|
|
21
|
+
</Svg>
|
|
22
|
+
);
|
|
23
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
import { Path, Svg, SvgProps } from 'react-native-svg';
|
|
4
|
+
|
|
5
|
+
export const CloseIcon =
|
|
6
|
+
/* @__PURE__ */
|
|
7
|
+
({ color = 'currentColor', width = 14, height = 14, ...props }: SvgProps) => {
|
|
8
|
+
return (
|
|
9
|
+
<Svg width={width} height={height} viewBox="0 0 14 14" fill="none" {...props}>
|
|
10
|
+
<Path
|
|
11
|
+
d="M9.854 4.146a.5.5 0 010 .708L7.707 7l2.147 2.146a.5.5 0 01-.708.708L7 7.707 4.854 9.854a.5.5 0 01-.708-.708L6.293 7 4.146 4.854a.5.5 0 11.708-.708L7 6.293l2.146-2.147a.5.5 0 01.708 0z"
|
|
12
|
+
fill={color}
|
|
13
|
+
/>
|
|
14
|
+
<Path
|
|
15
|
+
fillRule="evenodd"
|
|
16
|
+
clipRule="evenodd"
|
|
17
|
+
d="M7 14A7 7 0 107 0a7 7 0 000 14zm0-1A6 6 0 107 1a6 6 0 000 12z"
|
|
18
|
+
fill={color}
|
|
19
|
+
/>
|
|
20
|
+
</Svg>
|
|
21
|
+
);
|
|
22
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Path, Svg, SvgProps } from 'react-native-svg';
|
|
2
|
+
|
|
3
|
+
export const CollapseAllIcon = ({
|
|
4
|
+
color = '#2E3438',
|
|
5
|
+
width = 14,
|
|
6
|
+
height = 14,
|
|
7
|
+
...props
|
|
8
|
+
}: SvgProps) => {
|
|
9
|
+
return (
|
|
10
|
+
<Svg width={width} height={height} viewBox="0 0 14 14" fill="none" {...props}>
|
|
11
|
+
<Path
|
|
12
|
+
d="M3.354.146a.5.5 0 10-.708.708l4 4a.5.5 0 00.708 0l4-4a.5.5 0 00-.708-.708L7 3.793 3.354.146zM6.646 9.146a.5.5 0 01.708 0l4 4a.5.5 0 01-.708.708L7 10.207l-3.646 3.647a.5.5 0 01-.708-.708l4-4z"
|
|
13
|
+
fill={color}
|
|
14
|
+
/>
|
|
15
|
+
</Svg>
|
|
16
|
+
);
|
|
17
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { styled } from '@storybook/react-native-theming';
|
|
2
|
+
import type { FC } from 'react';
|
|
3
|
+
import { transparentize } from 'polished';
|
|
4
|
+
import Svg, { Path, SvgProps } from 'react-native-svg';
|
|
5
|
+
|
|
6
|
+
interface CollapseIconProps {
|
|
7
|
+
isExpanded: boolean;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const CollapseIconWrapper = styled.View<{ isExpanded: boolean }>(
|
|
11
|
+
({ theme, isExpanded }) => ({
|
|
12
|
+
width: 8,
|
|
13
|
+
height: 8,
|
|
14
|
+
display: 'flex',
|
|
15
|
+
justifyContent: 'center',
|
|
16
|
+
alignItems: 'center',
|
|
17
|
+
color: transparentize(0.4, theme.textMutedColor),
|
|
18
|
+
transform: isExpanded ? 'rotateZ(90deg)' : 'none',
|
|
19
|
+
transition: 'transform .1s ease-out',
|
|
20
|
+
})
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
export const CollapseIcon: FC<CollapseIconProps> = ({ isExpanded }) => (
|
|
24
|
+
<CollapseIconWrapper isExpanded={isExpanded}>
|
|
25
|
+
{/* <Icon icon="arrowRight" width={8} height={8} /> */}
|
|
26
|
+
<CollapseSVG />
|
|
27
|
+
</CollapseIconWrapper>
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
export function CollapseSVG(props: SvgProps) {
|
|
31
|
+
return (
|
|
32
|
+
<Svg width={8} height={8} fill="none" {...props}>
|
|
33
|
+
<Path
|
|
34
|
+
fill="#73828C"
|
|
35
|
+
d="M1.896 7.146a.5.5 0 10.708.708l3.5-3.5a.5.5 0 000-.708l-3.5-3.5a.5.5 0 10-.708.708L5.043 4 1.896 7.146z"
|
|
36
|
+
/>
|
|
37
|
+
</Svg>
|
|
38
|
+
);
|
|
39
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import Svg, { Path, SvgProps } from 'react-native-svg';
|
|
2
|
+
|
|
3
|
+
export function ComponentIcon({ color = '#029CFD', ...props }: SvgProps) {
|
|
4
|
+
return (
|
|
5
|
+
<Svg width={12} height={12} viewBox="0 0 12 12" fill="none" {...props}>
|
|
6
|
+
<Path
|
|
7
|
+
fillRule="evenodd"
|
|
8
|
+
clipRule="evenodd"
|
|
9
|
+
d="M2.5.004a2.5 2.5 0 00-2.5 2.5v7a2.5 2.5 0 002.5 2.5h7a2.5 2.5 0 002.5-2.5v-7a2.5 2.5 0 00-2.5-2.5h-7zm8.5 5.5H6.5v-4.5h3a1.5 1.5 0 011.5 1.5v3zm0 1v3a1.5 1.5 0 01-1.5 1.5h-3v-4.5H11zm-5.5 4.5v-4.5H1v3a1.5 1.5 0 001.5 1.5h3zM1 5.504h4.5v-4.5h-3a1.5 1.5 0 00-1.5 1.5v3z"
|
|
10
|
+
fill={color}
|
|
11
|
+
/>
|
|
12
|
+
</Svg>
|
|
13
|
+
);
|
|
14
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Path, Svg, SvgProps } from 'react-native-svg';
|
|
2
|
+
|
|
3
|
+
export const ExpandAllIcon = ({
|
|
4
|
+
color = '#2E3438',
|
|
5
|
+
width = 14,
|
|
6
|
+
height = 14,
|
|
7
|
+
...props
|
|
8
|
+
}: SvgProps) => {
|
|
9
|
+
return (
|
|
10
|
+
<Svg width={width} height={height} viewBox="0 0 14 14" fill="none" {...props}>
|
|
11
|
+
<Path
|
|
12
|
+
d="M7.354.146l4 4a.5.5 0 01-.708.708L7 1.207 3.354 4.854a.5.5 0 11-.708-.708l4-4a.5.5 0 01.708 0zM11.354 9.146a.5.5 0 010 .708l-4 4a.5.5 0 01-.708 0l-4-4a.5.5 0 11.708-.708L7 12.793l3.646-3.647a.5.5 0 01.708 0z"
|
|
13
|
+
fill={color}
|
|
14
|
+
/>
|
|
15
|
+
</Svg>
|
|
16
|
+
);
|
|
17
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Path, Svg, SvgProps } from 'react-native-svg';
|
|
2
|
+
|
|
3
|
+
export const FaceHappyIcon = ({ color, width = 14, height = 14, ...props }: SvgProps) => {
|
|
4
|
+
return (
|
|
5
|
+
<Svg width={width} height={height} viewBox="0 0 14 14" fill="none" {...props}>
|
|
6
|
+
<Path
|
|
7
|
+
d="M3.968 8.75a.5.5 0 00-.866.5A4.498 4.498 0 007 11.5c1.666 0 3.12-.906 3.898-2.25a.5.5 0 10-.866-.5A3.498 3.498 0 017 10.5a3.498 3.498 0 01-3.032-1.75zM5.5 5a1 1 0 11-2 0 1 1 0 012 0zM9.5 6a1 1 0 100-2 1 1 0 000 2z"
|
|
8
|
+
fill={color}
|
|
9
|
+
/>
|
|
10
|
+
<Path
|
|
11
|
+
fillRule="evenodd"
|
|
12
|
+
clipRule="evenodd"
|
|
13
|
+
d="M14 7A7 7 0 110 7a7 7 0 0114 0zm-1 0A6 6 0 111 7a6 6 0 0112 0z"
|
|
14
|
+
fill={color}
|
|
15
|
+
/>
|
|
16
|
+
</Svg>
|
|
17
|
+
);
|
|
18
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import Svg, { Path, SvgProps } from 'react-native-svg';
|
|
2
|
+
|
|
3
|
+
export function GroupIcon({ color = '#6F2CAC', ...props }: SvgProps) {
|
|
4
|
+
return (
|
|
5
|
+
<Svg width={15} height={15} viewBox="0 0 15 15" fill="none" {...props}>
|
|
6
|
+
<Path
|
|
7
|
+
fillRule="evenodd"
|
|
8
|
+
clipRule="evenodd"
|
|
9
|
+
d="M6.962 3.704L5.376 2.118H1.057v9.514h12.685V3.704h-6.78zM7.4 2.647L6.124 1.37a1.057 1.057 0 00-.748-.31H.53A.529.529 0 000 1.59v10.57c0 .292.237.529.529.529H14.27a.529.529 0 00.528-.529V3.175a.529.529 0 00-.528-.528H7.4z"
|
|
10
|
+
fill={color}
|
|
11
|
+
/>
|
|
12
|
+
</Svg>
|
|
13
|
+
);
|
|
14
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Path, Svg, SvgProps } from 'react-native-svg';
|
|
3
|
+
|
|
4
|
+
export const MenuIcon = ({
|
|
5
|
+
color = 'currentColor',
|
|
6
|
+
width = 14,
|
|
7
|
+
height = 14,
|
|
8
|
+
...props
|
|
9
|
+
}: SvgProps) => {
|
|
10
|
+
return (
|
|
11
|
+
<Svg width={width} height={height} viewBox="0 0 14 14" fill="none" {...props}>
|
|
12
|
+
<Path
|
|
13
|
+
d="M13 3.5a.5.5 0 010 1H1a.5.5 0 010-1h12zM13.5 10a.5.5 0 00-.5-.5H1a.5.5 0 000 1h12a.5.5 0 00.5-.5zM13 6.5a.5.5 0 010 1H1a.5.5 0 010-1h12z"
|
|
14
|
+
fill={color}
|
|
15
|
+
/>
|
|
16
|
+
</Svg>
|
|
17
|
+
);
|
|
18
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Path, Svg, SvgProps } from 'react-native-svg';
|
|
3
|
+
|
|
4
|
+
export const SearchIcon =
|
|
5
|
+
/* @__PURE__ */
|
|
6
|
+
({ color = 'currentColor', width = 14, height = 14, ...props }: SvgProps) => {
|
|
7
|
+
return (
|
|
8
|
+
<Svg width={width} height={height} viewBox="0 0 14 14" fill="none" {...props}>
|
|
9
|
+
<Path
|
|
10
|
+
fillRule="evenodd"
|
|
11
|
+
clipRule="evenodd"
|
|
12
|
+
d="M9.544 10.206a5.5 5.5 0 11.662-.662.5.5 0 01.148.102l3 3a.5.5 0 01-.708.708l-3-3a.5.5 0 01-.102-.148zM10.5 6a4.5 4.5 0 11-9 0 4.5 4.5 0 019 0z"
|
|
13
|
+
fill={color}
|
|
14
|
+
/>
|
|
15
|
+
</Svg>
|
|
16
|
+
);
|
|
17
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import Svg, { Path, SvgProps } from 'react-native-svg';
|
|
2
|
+
|
|
3
|
+
export function StoryIcon({ color = '#37D5D3', ...props }: SvgProps) {
|
|
4
|
+
return (
|
|
5
|
+
<Svg width={12} height={12} viewBox="0 0 12 12" fill="none" {...props}>
|
|
6
|
+
<Path
|
|
7
|
+
fillRule="evenodd"
|
|
8
|
+
clipRule="evenodd"
|
|
9
|
+
d="M3 0h6c.237 0 .428.192.428.429V11.57c0 .224-.17.407-.389.427a.396.396 0 01-.318-.101L6 9.565l-2.721 2.332a.395.395 0 01-.325.1.429.429 0 01-.383-.426V.43C2.571.192 2.763 0 3 0zm.428 10.64l2.284-1.958.034-.028a.39.39 0 01.289-.081c.087.007.172.04.244.102L8.57 10.64V.857H3.428v9.783z"
|
|
10
|
+
fill={color}
|
|
11
|
+
/>
|
|
12
|
+
</Svg>
|
|
13
|
+
);
|
|
14
|
+
}
|
package/src/index.tsx
ADDED