@lynx-example/lynx-ui-scroll-view 0.0.4 → 0.0.6
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/CHANGELOG.md +14 -0
- package/Horizontal/index.css +110 -0
- package/Horizontal/index.tsx +75 -0
- package/HorizontalRTL/index.css +111 -0
- package/HorizontalRTL/index.tsx +76 -0
- package/dist/ScrollViewBasic.lynx.bundle +0 -0
- package/dist/ScrollViewHorizontal.lynx.bundle +0 -0
- package/dist/ScrollViewHorizontalRTL.lynx.bundle +0 -0
- package/dist/ScrollViewInnerFlex.lynx.bundle +0 -0
- package/lynx.config.mjs +2 -0
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @lynx-example/lynx-ui-scroll-view
|
|
2
2
|
|
|
3
|
+
## 0.0.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies []:
|
|
8
|
+
- @lynx-js/lynx-ui@3.132.0
|
|
9
|
+
|
|
10
|
+
## 0.0.5
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies []:
|
|
15
|
+
- @lynx-js/lynx-ui@3.131.1
|
|
16
|
+
|
|
3
17
|
## 0.0.4
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
@import "@lynx-js/luna-styles/index.css";
|
|
2
|
+
|
|
3
|
+
.demo-container {
|
|
4
|
+
width: 100%;
|
|
5
|
+
height: 100%;
|
|
6
|
+
display: flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
background-color: var(--canvas);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.scroll-view {
|
|
13
|
+
width: 100%;
|
|
14
|
+
height: 472px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.scroll-view-content {
|
|
18
|
+
width: max-content;
|
|
19
|
+
height: 100%;
|
|
20
|
+
display: flex;
|
|
21
|
+
flex-direction: row;
|
|
22
|
+
align-items: center;
|
|
23
|
+
padding-left: 24px;
|
|
24
|
+
padding-right: 24px;
|
|
25
|
+
gap: 20px;
|
|
26
|
+
background: linear-gradient(
|
|
27
|
+
90deg,
|
|
28
|
+
var(--gradient-a),
|
|
29
|
+
var(--gradient-b),
|
|
30
|
+
var(--gradient-c),
|
|
31
|
+
var(--gradient-d)
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.card {
|
|
36
|
+
width: 288px;
|
|
37
|
+
height: 100%;
|
|
38
|
+
display: flex;
|
|
39
|
+
align-items: center;
|
|
40
|
+
justify-content: center;
|
|
41
|
+
flex-shrink: 0;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.circle {
|
|
45
|
+
width: 216px;
|
|
46
|
+
height: 216px;
|
|
47
|
+
border-radius: 9999px;
|
|
48
|
+
background-color: var(--canvas);
|
|
49
|
+
padding-bottom: 45px;
|
|
50
|
+
display: flex;
|
|
51
|
+
flex-direction: column;
|
|
52
|
+
align-items: center;
|
|
53
|
+
justify-content: end;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.letter {
|
|
57
|
+
font-size: 96px;
|
|
58
|
+
font-weight: 600;
|
|
59
|
+
line-height: 96px;
|
|
60
|
+
color: var(--primary);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.title {
|
|
64
|
+
font-size: 16px;
|
|
65
|
+
font-weight: 600;
|
|
66
|
+
color: var(--content);
|
|
67
|
+
margin-top: 4px;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.subtitle {
|
|
71
|
+
font-size: 10px;
|
|
72
|
+
color: var(--content-subtle);
|
|
73
|
+
margin-top: 1px;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.bounce-slot {
|
|
77
|
+
width: 96px;
|
|
78
|
+
height: 100%;
|
|
79
|
+
display: flex;
|
|
80
|
+
align-items: center;
|
|
81
|
+
justify-content: center;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.bounce-slot__text {
|
|
85
|
+
min-width: 56px;
|
|
86
|
+
padding: 16px 12px;
|
|
87
|
+
border-radius: 20px;
|
|
88
|
+
display: flex;
|
|
89
|
+
flex-direction: column;
|
|
90
|
+
align-items: center;
|
|
91
|
+
justify-content: center;
|
|
92
|
+
gap: 4px;
|
|
93
|
+
background-color: var(--primary);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.bounce-slot__text--upper {
|
|
97
|
+
background-color: var(--primary);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.bounce-slot__text--lower {
|
|
101
|
+
background-color: var(--primary-2);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.bounce-slot__line {
|
|
105
|
+
font-size: 13px;
|
|
106
|
+
font-weight: 600;
|
|
107
|
+
line-height: 16px;
|
|
108
|
+
text-align: center;
|
|
109
|
+
color: var(--gradient-content);
|
|
110
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
// Copyright 2026 The Lynx Authors. All rights reserved.
|
|
2
|
+
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
3
|
+
// LICENSE file in the root directory of this source tree.
|
|
4
|
+
|
|
5
|
+
import { root } from '@lynx-js/react'
|
|
6
|
+
|
|
7
|
+
import { ScrollView } from '@lynx-js/lynx-ui'
|
|
8
|
+
|
|
9
|
+
import './index.css'
|
|
10
|
+
|
|
11
|
+
const LETTERS = [
|
|
12
|
+
'L',
|
|
13
|
+
'Y',
|
|
14
|
+
'N',
|
|
15
|
+
'X',
|
|
16
|
+
'L',
|
|
17
|
+
'T',
|
|
18
|
+
'R',
|
|
19
|
+
'B',
|
|
20
|
+
'O',
|
|
21
|
+
'U',
|
|
22
|
+
'N',
|
|
23
|
+
'C',
|
|
24
|
+
'E',
|
|
25
|
+
]
|
|
26
|
+
|
|
27
|
+
function BounceTag(props: { label: string, variant: 'upper' | 'lower' }) {
|
|
28
|
+
const { label, variant } = props
|
|
29
|
+
const lines = label.split(' ')
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<view className='bounce-slot'>
|
|
33
|
+
<view className={`bounce-slot__text bounce-slot__text--${variant}`}>
|
|
34
|
+
{lines.map((line, index) => (
|
|
35
|
+
<text className='bounce-slot__line' key={`${line}-${index}`}>
|
|
36
|
+
{line}
|
|
37
|
+
</text>
|
|
38
|
+
))}
|
|
39
|
+
</view>
|
|
40
|
+
</view>
|
|
41
|
+
)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function App() {
|
|
45
|
+
return (
|
|
46
|
+
<view className='demo-container lunaris-dark'>
|
|
47
|
+
<ScrollView
|
|
48
|
+
scrollOrientation='horizontal'
|
|
49
|
+
className='scroll-view'
|
|
50
|
+
bounceableOptions={{
|
|
51
|
+
enableBounces: true,
|
|
52
|
+
alwaysBouncing: true,
|
|
53
|
+
upperBounceItem: <BounceTag label='Start Bounce' variant='upper' />,
|
|
54
|
+
lowerBounceItem: <BounceTag label='End Bounce' variant='lower' />,
|
|
55
|
+
}}
|
|
56
|
+
>
|
|
57
|
+
<view className='scroll-view-content'>
|
|
58
|
+
{LETTERS.map((letter, index) => (
|
|
59
|
+
<view className='card' key={`${letter}-${index}`}>
|
|
60
|
+
<view className='circle'>
|
|
61
|
+
<text className='letter'>{letter}</text>
|
|
62
|
+
<text className='title'>ScrollView Horizontal</text>
|
|
63
|
+
<text className='subtitle'>direction: ltr + useBounce</text>
|
|
64
|
+
</view>
|
|
65
|
+
</view>
|
|
66
|
+
))}
|
|
67
|
+
</view>
|
|
68
|
+
</ScrollView>
|
|
69
|
+
</view>
|
|
70
|
+
)
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
root.render(<App />)
|
|
74
|
+
|
|
75
|
+
export default App
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
@import "@lynx-js/luna-styles/index.css";
|
|
2
|
+
|
|
3
|
+
.demo-container {
|
|
4
|
+
width: 100%;
|
|
5
|
+
height: 100%;
|
|
6
|
+
display: flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
background-color: var(--canvas);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.rtl-scope {
|
|
13
|
+
direction: rtl;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.scroll-view {
|
|
17
|
+
width: 100%;
|
|
18
|
+
height: 472px;
|
|
19
|
+
direction: inherit;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.scroll-view-content {
|
|
23
|
+
width: max-content;
|
|
24
|
+
height: 100%;
|
|
25
|
+
display: flex;
|
|
26
|
+
flex-direction: row;
|
|
27
|
+
align-items: center;
|
|
28
|
+
padding-left: 24px;
|
|
29
|
+
padding-right: 24px;
|
|
30
|
+
gap: 20px;
|
|
31
|
+
direction: inherit;
|
|
32
|
+
background: linear-gradient(
|
|
33
|
+
90deg,
|
|
34
|
+
var(--gradient-a),
|
|
35
|
+
var(--gradient-b),
|
|
36
|
+
var(--gradient-c),
|
|
37
|
+
var(--gradient-d)
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.card {
|
|
42
|
+
width: 288px;
|
|
43
|
+
height: 100%;
|
|
44
|
+
display: flex;
|
|
45
|
+
align-items: center;
|
|
46
|
+
justify-content: center;
|
|
47
|
+
flex-shrink: 0;
|
|
48
|
+
direction: inherit;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.circle {
|
|
52
|
+
width: 216px;
|
|
53
|
+
height: 216px;
|
|
54
|
+
border-radius: 9999px;
|
|
55
|
+
background-color: var(--canvas);
|
|
56
|
+
padding-bottom: 45px;
|
|
57
|
+
display: flex;
|
|
58
|
+
flex-direction: column;
|
|
59
|
+
align-items: center;
|
|
60
|
+
justify-content: end;
|
|
61
|
+
direction: inherit;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.letter {
|
|
65
|
+
font-size: 96px;
|
|
66
|
+
font-weight: 600;
|
|
67
|
+
line-height: 96px;
|
|
68
|
+
color: var(--primary);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.title {
|
|
72
|
+
font-size: 16px;
|
|
73
|
+
font-weight: 600;
|
|
74
|
+
color: var(--content);
|
|
75
|
+
margin-top: 4px;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.subtitle {
|
|
79
|
+
font-size: 10px;
|
|
80
|
+
color: var(--content-subtle);
|
|
81
|
+
margin-top: 1px;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.bounce-slot {
|
|
85
|
+
width: 96px;
|
|
86
|
+
height: 100%;
|
|
87
|
+
display: flex;
|
|
88
|
+
align-items: center;
|
|
89
|
+
justify-content: center;
|
|
90
|
+
direction: inherit;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.bounce-slot__text {
|
|
94
|
+
min-width: 56px;
|
|
95
|
+
padding: 16px 12px;
|
|
96
|
+
border-radius: 20px;
|
|
97
|
+
display: flex;
|
|
98
|
+
flex-direction: column;
|
|
99
|
+
align-items: center;
|
|
100
|
+
justify-content: center;
|
|
101
|
+
gap: 4px;
|
|
102
|
+
background-color: var(--primary);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.bounce-slot__line {
|
|
106
|
+
font-size: 13px;
|
|
107
|
+
font-weight: 600;
|
|
108
|
+
line-height: 16px;
|
|
109
|
+
text-align: center;
|
|
110
|
+
color: var(--gradient-content);
|
|
111
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
// Copyright 2026 The Lynx Authors. All rights reserved.
|
|
2
|
+
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
3
|
+
// LICENSE file in the root directory of this source tree.
|
|
4
|
+
|
|
5
|
+
import { root } from '@lynx-js/react'
|
|
6
|
+
|
|
7
|
+
import { ScrollView } from '@lynx-js/lynx-ui'
|
|
8
|
+
|
|
9
|
+
import './index.css'
|
|
10
|
+
|
|
11
|
+
const LETTERS = [
|
|
12
|
+
'L',
|
|
13
|
+
'Y',
|
|
14
|
+
'N',
|
|
15
|
+
'X',
|
|
16
|
+
'R',
|
|
17
|
+
'T',
|
|
18
|
+
'L',
|
|
19
|
+
'B',
|
|
20
|
+
'O',
|
|
21
|
+
'U',
|
|
22
|
+
'N',
|
|
23
|
+
'C',
|
|
24
|
+
'E',
|
|
25
|
+
]
|
|
26
|
+
|
|
27
|
+
function BounceTag(props: { label: string }) {
|
|
28
|
+
const { label } = props
|
|
29
|
+
const lines = label.split(' ')
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<view className='bounce-slot'>
|
|
33
|
+
<view className='bounce-slot__text'>
|
|
34
|
+
{lines.map((line, index) => (
|
|
35
|
+
<text className='bounce-slot__line' key={`${line}-${index}`}>
|
|
36
|
+
{line}
|
|
37
|
+
</text>
|
|
38
|
+
))}
|
|
39
|
+
</view>
|
|
40
|
+
</view>
|
|
41
|
+
)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function App() {
|
|
45
|
+
return (
|
|
46
|
+
<view className='demo-container lunaris-dark rtl-scope'>
|
|
47
|
+
<ScrollView
|
|
48
|
+
scrollOrientation='horizontal'
|
|
49
|
+
enableRTL={true}
|
|
50
|
+
className='scroll-view'
|
|
51
|
+
bounceableOptions={{
|
|
52
|
+
enableBounces: true,
|
|
53
|
+
alwaysBouncing: true,
|
|
54
|
+
upperBounceItem: <BounceTag label='Start Bounce' />,
|
|
55
|
+
lowerBounceItem: <BounceTag label='End Bounce' />,
|
|
56
|
+
}}
|
|
57
|
+
>
|
|
58
|
+
<view className='scroll-view-content'>
|
|
59
|
+
{LETTERS.map((letter, index) => (
|
|
60
|
+
<view className='card' key={`${letter}-${index}`}>
|
|
61
|
+
<view className='circle'>
|
|
62
|
+
<text className='letter'>{letter}</text>
|
|
63
|
+
<text className='title'>ScrollView RTL</text>
|
|
64
|
+
<text className='subtitle'>direction: rtl + useBounce</text>
|
|
65
|
+
</view>
|
|
66
|
+
</view>
|
|
67
|
+
))}
|
|
68
|
+
</view>
|
|
69
|
+
</ScrollView>
|
|
70
|
+
</view>
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
root.render(<App />)
|
|
75
|
+
|
|
76
|
+
export default App
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/lynx.config.mjs
CHANGED
|
@@ -6,6 +6,8 @@ import { exampleConfig } from '../../../tools/configs/exampleConfig.mjs'
|
|
|
6
6
|
|
|
7
7
|
const defaultConfig = exampleConfig({
|
|
8
8
|
ScrollViewBasic: './Basic/index.tsx',
|
|
9
|
+
ScrollViewHorizontal: './Horizontal/index.tsx',
|
|
10
|
+
ScrollViewHorizontalRTL: './HorizontalRTL/index.tsx',
|
|
9
11
|
ScrollViewInnerFlex: './InnerFlex/index.tsx',
|
|
10
12
|
}, { needWeb: false })
|
|
11
13
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lynx-example/lynx-ui-scroll-view",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"description": "Example app demonstrating ScrollView usage in lynx-ui",
|
|
5
5
|
"homepage": "https://github.com/lynx-family/lynx-ui/tree/main/apps/examples/ScrollView#readme",
|
|
6
6
|
"repository": {
|
|
@@ -23,14 +23,14 @@
|
|
|
23
23
|
"lynx.config.mjs"
|
|
24
24
|
],
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@lynx-js/react": "0.
|
|
27
|
-
"@lynx-js/
|
|
28
|
-
"@lynx-js/
|
|
26
|
+
"@lynx-js/react": "0.114.0",
|
|
27
|
+
"@lynx-js/lynx-ui": "3.132.0",
|
|
28
|
+
"@lynx-js/luna-styles": "0.1.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@lynx-js/qrcode-rsbuild-plugin": "0.
|
|
32
|
-
"@lynx-js/react-rsbuild-plugin": "0.
|
|
33
|
-
"@lynx-js/rspeedy": "0.
|
|
31
|
+
"@lynx-js/qrcode-rsbuild-plugin": "0.4.6",
|
|
32
|
+
"@lynx-js/react-rsbuild-plugin": "0.12.4",
|
|
33
|
+
"@lynx-js/rspeedy": "0.12.2",
|
|
34
34
|
"@lynx-js/types": "3.6.0",
|
|
35
35
|
"@types/react": "^18.3.8"
|
|
36
36
|
},
|