@xsolla/xui-navigation 0.96.0 → 0.97.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/README.md +45 -0
- package/package.json +8 -8
package/README.md
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# @xsolla/xui-navigation
|
|
2
|
+
|
|
3
|
+
Convenience re-export of all navigation components: Breadcrumbs, Link, NavBar, Pagination, Segmented, TabBar, and Tabs.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
yarn add @xsolla/xui-navigation
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
import { Tabs, TabPanel, NavBar, Breadcrumbs, Pagination } from '@xsolla/xui-navigation';
|
|
15
|
+
|
|
16
|
+
function App() {
|
|
17
|
+
const [page, setPage] = React.useState(1);
|
|
18
|
+
const [activeTab, setActiveTab] = React.useState('home');
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<>
|
|
22
|
+
<NavBar bordered>
|
|
23
|
+
<NavBar.StartSlot><BackButton /></NavBar.StartSlot>
|
|
24
|
+
<NavBar.Center><Text>My App</Text></NavBar.Center>
|
|
25
|
+
</NavBar>
|
|
26
|
+
<Breadcrumbs items={[{ label: 'Home', href: '/' }, { label: 'Shop' }]} />
|
|
27
|
+
<Tabs
|
|
28
|
+
id="main"
|
|
29
|
+
tabs={[{ id: 'home', label: 'Home' }, { id: 'shop', label: 'Shop' }]}
|
|
30
|
+
activeTabId={activeTab}
|
|
31
|
+
onChange={setActiveTab}
|
|
32
|
+
/>
|
|
33
|
+
<Pagination totalPages={20} currentPage={page} onPageChange={setPage} />
|
|
34
|
+
</>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Components
|
|
40
|
+
|
|
41
|
+
- **Breadcrumbs** — Accessible breadcrumb trail
|
|
42
|
+
- **NavBar** — Top navigation bar with start/centre/end slots
|
|
43
|
+
- **Pagination** — Page navigation control
|
|
44
|
+
- **Tabs** / **TabPanel** — Tabbed interface with content panels
|
|
45
|
+
- **TabBar** — React Navigation-compatible bottom tab bar
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xsolla/xui-navigation",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.97.0",
|
|
4
4
|
"main": "./web/index.js",
|
|
5
5
|
"types": "./web/index.d.ts",
|
|
6
6
|
"scripts": {
|
|
@@ -12,13 +12,13 @@
|
|
|
12
12
|
"styled-components": ">=4"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@xsolla/xui-breadcrumbs": "0.
|
|
16
|
-
"@xsolla/xui-link": "0.
|
|
17
|
-
"@xsolla/xui-nav-bar": "0.
|
|
18
|
-
"@xsolla/xui-pagination": "0.
|
|
19
|
-
"@xsolla/xui-segmented": "0.
|
|
20
|
-
"@xsolla/xui-tab-bar": "0.
|
|
21
|
-
"@xsolla/xui-tabs": "0.
|
|
15
|
+
"@xsolla/xui-breadcrumbs": "0.97.0",
|
|
16
|
+
"@xsolla/xui-link": "0.97.0",
|
|
17
|
+
"@xsolla/xui-nav-bar": "0.97.0",
|
|
18
|
+
"@xsolla/xui-pagination": "0.97.0",
|
|
19
|
+
"@xsolla/xui-segmented": "0.97.0",
|
|
20
|
+
"@xsolla/xui-tab-bar": "0.97.0",
|
|
21
|
+
"@xsolla/xui-tabs": "0.97.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@vitest/coverage-v8": "^4.0.18",
|