@lynx-example/lynx-ui-scroll-view 0.0.15 → 0.0.17
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/Basic/index.css +2 -47
- package/Basic/index.tsx +7 -2
- package/Bounces/index.css +36 -0
- package/Bounces/index.tsx +61 -0
- package/BouncesRTL/index.css +41 -0
- package/BouncesRTL/index.tsx +63 -0
- package/CHANGELOG.md +19 -0
- package/NativeUseBounces/index.css +136 -0
- package/NativeUseBounces/index.tsx +155 -0
- package/ScrollBy/index.css +19 -11
- package/ScrollBy/index.tsx +16 -10
- package/ZIndex/data.ts +47 -0
- package/ZIndex/index.css +39 -9
- package/ZIndex/index.tsx +14 -16
- package/dist/ScrollViewBasic.lynx.bundle +0 -0
- package/dist/ScrollViewBounces.lynx.bundle +0 -0
- package/dist/ScrollViewBouncesRTL.lynx.bundle +0 -0
- package/dist/ScrollViewInnerFlex.lynx.bundle +0 -0
- package/dist/ScrollViewNativeUseBounces.lynx.bundle +0 -0
- package/dist/ScrollViewScrollBy.lynx.bundle +0 -0
- package/dist/ScrollViewZIndex.lynx.bundle +0 -0
- package/lynx.config.mjs +3 -2
- package/package.json +4 -3
- package/shared/BounceTag/index.css +37 -0
- package/shared/BounceTag/index.tsx +27 -0
- package/shared/CircleCard/index.css +7 -0
- package/shared/CircleCard/index.tsx +35 -0
- package/{HorizontalRTL/index.css → shared/base.css} +2 -54
- package/Basic/CircleLetterCard.tsx +0 -23
- package/Horizontal/index.css +0 -110
- package/Horizontal/index.tsx +0 -75
- package/HorizontalRTL/index.tsx +0 -76
- package/dist/ScrollViewHorizontal.lynx.bundle +0 -0
- package/dist/ScrollViewHorizontalRTL.lynx.bundle +0 -0
package/ScrollBy/index.tsx
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import { root } from '@lynx-js/react'
|
|
6
6
|
|
|
7
|
+
import { Button } from '@lynx-js/lynx-ui'
|
|
8
|
+
|
|
7
9
|
import './index.css'
|
|
8
10
|
|
|
9
11
|
const ITEMS = Array.from({ length: 24 }, (_, index) => index + 1)
|
|
@@ -19,24 +21,28 @@ function App() {
|
|
|
19
21
|
return (
|
|
20
22
|
<view className='demo-container lunaris-dark'>
|
|
21
23
|
<view className='toolbar'>
|
|
22
|
-
<
|
|
24
|
+
<Button
|
|
23
25
|
className='button'
|
|
24
|
-
|
|
25
|
-
'main
|
|
26
|
-
|
|
26
|
+
buttonProps={{
|
|
27
|
+
'main-thread:bindtap': () => {
|
|
28
|
+
'main thread'
|
|
29
|
+
scrollByOffset(-160)
|
|
30
|
+
},
|
|
27
31
|
}}
|
|
28
32
|
>
|
|
29
33
|
<text className='button-text'>Scroll Up</text>
|
|
30
|
-
</
|
|
31
|
-
<
|
|
34
|
+
</Button>
|
|
35
|
+
<Button
|
|
32
36
|
className='button button--primary'
|
|
33
|
-
|
|
34
|
-
'main
|
|
35
|
-
|
|
37
|
+
buttonProps={{
|
|
38
|
+
'main-thread:bindtap': () => {
|
|
39
|
+
'main thread'
|
|
40
|
+
scrollByOffset(160)
|
|
41
|
+
},
|
|
36
42
|
}}
|
|
37
43
|
>
|
|
38
44
|
<text className='button-text'>Scroll Down</text>
|
|
39
|
-
</
|
|
45
|
+
</Button>
|
|
40
46
|
</view>
|
|
41
47
|
|
|
42
48
|
<scroll-view
|
package/ZIndex/data.ts
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
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
|
+
export interface LayerCardData {
|
|
6
|
+
key: string
|
|
7
|
+
title: string
|
|
8
|
+
subtitle: string
|
|
9
|
+
badge: string
|
|
10
|
+
surfaceClassName:
|
|
11
|
+
| 'layer-card--canvas'
|
|
12
|
+
| 'layer-card--paper'
|
|
13
|
+
| 'layer-card--paper-clear'
|
|
14
|
+
raised?: boolean
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const CARDS: LayerCardData[] = [
|
|
18
|
+
{
|
|
19
|
+
key: 'card-1',
|
|
20
|
+
title: 'Canvas Surface',
|
|
21
|
+
subtitle: 'The first content layer above the canvas-ambient viewport.',
|
|
22
|
+
badge: 'canvas · z-index: 1',
|
|
23
|
+
surfaceClassName: 'layer-card--canvas',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
key: 'card-2',
|
|
27
|
+
title: 'Raised Paper Surface',
|
|
28
|
+
subtitle: 'The raised badge overlaps neighboring cards while scrolling.',
|
|
29
|
+
badge: 'paper · z-index: 3',
|
|
30
|
+
surfaceClassName: 'layer-card--paper',
|
|
31
|
+
raised: true,
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
key: 'card-3',
|
|
35
|
+
title: 'Paper Surface',
|
|
36
|
+
subtitle: 'Standard content card sitting under the raised layer.',
|
|
37
|
+
badge: 'paper · z-index: 1',
|
|
38
|
+
surfaceClassName: 'layer-card--paper',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
key: 'card-4',
|
|
42
|
+
title: 'Paper Clear Surface',
|
|
43
|
+
subtitle: 'A lighter surface variant to compare stacked elevation.',
|
|
44
|
+
badge: 'paper-clear · z-index: 1',
|
|
45
|
+
surfaceClassName: 'layer-card--paper-clear',
|
|
46
|
+
},
|
|
47
|
+
]
|
package/ZIndex/index.css
CHANGED
|
@@ -1,24 +1,38 @@
|
|
|
1
1
|
@import "@lynx-js/luna-styles/index.css";
|
|
2
2
|
|
|
3
3
|
.demo-container {
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
justify-content: center;
|
|
4
7
|
width: 100%;
|
|
5
8
|
height: 100%;
|
|
6
|
-
padding
|
|
7
|
-
|
|
8
|
-
|
|
9
|
+
padding: 48px 16px 24px;
|
|
10
|
+
box-sizing: border-box;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.luna-gradient-rose {
|
|
14
|
+
background: linear-gradient(
|
|
15
|
+
0deg,
|
|
16
|
+
var(--gradient-a),
|
|
17
|
+
var(--gradient-b)
|
|
18
|
+
);
|
|
9
19
|
}
|
|
10
20
|
|
|
11
21
|
.scroll-view {
|
|
12
22
|
width: 100%;
|
|
13
|
-
height:
|
|
23
|
+
height: 560px;
|
|
24
|
+
padding: 12px;
|
|
25
|
+
border-radius: 24px;
|
|
26
|
+
background-color: var(--canvas-ambient);
|
|
27
|
+
box-sizing: border-box;
|
|
14
28
|
}
|
|
15
29
|
|
|
16
30
|
.scroll-view-content {
|
|
17
31
|
width: 100%;
|
|
18
32
|
height: 920px;
|
|
19
|
-
padding-left:
|
|
20
|
-
padding-right:
|
|
21
|
-
padding-bottom:
|
|
33
|
+
padding-left: 4px;
|
|
34
|
+
padding-right: 4px;
|
|
35
|
+
padding-bottom: 20px;
|
|
22
36
|
box-sizing: border-box;
|
|
23
37
|
}
|
|
24
38
|
|
|
@@ -31,7 +45,6 @@
|
|
|
31
45
|
padding-left: 20px;
|
|
32
46
|
padding-right: 20px;
|
|
33
47
|
border-radius: 20px;
|
|
34
|
-
background-color: var(--canvas);
|
|
35
48
|
border-width: 1px;
|
|
36
49
|
border-color: var(--line);
|
|
37
50
|
}
|
|
@@ -44,6 +57,18 @@
|
|
|
44
57
|
z-index: 2;
|
|
45
58
|
}
|
|
46
59
|
|
|
60
|
+
.layer-card--canvas {
|
|
61
|
+
background-color: var(--canvas);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.layer-card--paper {
|
|
65
|
+
background-color: var(--paper);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.layer-card--paper-clear {
|
|
69
|
+
background-color: var(--paper-clear);
|
|
70
|
+
}
|
|
71
|
+
|
|
47
72
|
.layer-card__badge {
|
|
48
73
|
position: absolute;
|
|
49
74
|
top: -18px;
|
|
@@ -56,15 +81,20 @@
|
|
|
56
81
|
|
|
57
82
|
.layer-card__badge--raised {
|
|
58
83
|
z-index: 3;
|
|
59
|
-
background-color: var(--
|
|
84
|
+
background-color: var(--gradient-b);
|
|
60
85
|
}
|
|
61
86
|
|
|
62
87
|
.layer-card__badge-text {
|
|
63
88
|
font-size: 12px;
|
|
64
89
|
font-weight: 600;
|
|
90
|
+
line-height: 16px;
|
|
65
91
|
color: var(--neutral-content);
|
|
66
92
|
}
|
|
67
93
|
|
|
94
|
+
.layer-card__badge--raised .layer-card__badge-text {
|
|
95
|
+
color: var(--gradient-content);
|
|
96
|
+
}
|
|
97
|
+
|
|
68
98
|
.layer-card__title {
|
|
69
99
|
font-size: 22px;
|
|
70
100
|
font-weight: 600;
|
package/ZIndex/index.tsx
CHANGED
|
@@ -5,38 +5,36 @@
|
|
|
5
5
|
import { root } from '@lynx-js/react'
|
|
6
6
|
|
|
7
7
|
import { ScrollView } from '@lynx-js/lynx-ui'
|
|
8
|
+
import { clsx } from 'clsx'
|
|
8
9
|
|
|
10
|
+
import { CARDS } from './data'
|
|
9
11
|
import './index.css'
|
|
10
12
|
|
|
11
|
-
const CARDS = [
|
|
12
|
-
{ key: 'card-1', title: 'Base Layer', badge: 'z-index: 1' },
|
|
13
|
-
{ key: 'card-2', title: 'Raised Layer', badge: 'z-index: 3' },
|
|
14
|
-
{ key: 'card-3', title: 'Normal Layer', badge: 'z-index: 1' },
|
|
15
|
-
{ key: 'card-4', title: 'Content Layer', badge: 'z-index: 1' },
|
|
16
|
-
]
|
|
17
|
-
|
|
18
13
|
function App() {
|
|
19
14
|
return (
|
|
20
|
-
<view className='demo-container lunaris-dark'>
|
|
15
|
+
<view className='demo-container lunaris-dark luna-gradient-rose'>
|
|
21
16
|
<ScrollView className='scroll-view'>
|
|
22
17
|
<view className='scroll-view-content'>
|
|
23
|
-
{CARDS.map((card
|
|
18
|
+
{CARDS.map((card) => (
|
|
24
19
|
<view
|
|
25
|
-
className={
|
|
26
|
-
|
|
27
|
-
|
|
20
|
+
className={clsx(
|
|
21
|
+
'layer-card',
|
|
22
|
+
card.surfaceClassName,
|
|
23
|
+
card.raised && 'layer-card--raised',
|
|
24
|
+
)}
|
|
28
25
|
key={card.key}
|
|
29
26
|
>
|
|
30
27
|
<view
|
|
31
|
-
className={
|
|
32
|
-
|
|
33
|
-
|
|
28
|
+
className={clsx(
|
|
29
|
+
'layer-card__badge',
|
|
30
|
+
card.raised && 'layer-card__badge--raised',
|
|
31
|
+
)}
|
|
34
32
|
>
|
|
35
33
|
<text className='layer-card__badge-text'>{card.badge}</text>
|
|
36
34
|
</view>
|
|
37
35
|
<text className='layer-card__title'>{card.title}</text>
|
|
38
36
|
<text className='layer-card__subtitle'>
|
|
39
|
-
|
|
37
|
+
{card.subtitle}
|
|
40
38
|
</text>
|
|
41
39
|
</view>
|
|
42
40
|
))}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/lynx.config.mjs
CHANGED
|
@@ -6,9 +6,10 @@ import { exampleConfig } from '../../../tools/configs/exampleConfig.mjs'
|
|
|
6
6
|
|
|
7
7
|
const defaultConfig = exampleConfig({
|
|
8
8
|
ScrollViewBasic: './Basic/index.tsx',
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
ScrollViewBounces: './Bounces/index.tsx',
|
|
10
|
+
ScrollViewBouncesRTL: './BouncesRTL/index.tsx',
|
|
11
11
|
ScrollViewInnerFlex: './InnerFlex/index.tsx',
|
|
12
|
+
ScrollViewNativeUseBounces: './NativeUseBounces/index.tsx',
|
|
12
13
|
ScrollViewScrollBy: './ScrollBy/index.tsx',
|
|
13
14
|
ScrollViewZIndex: './ZIndex/index.tsx',
|
|
14
15
|
}, { needWeb: false })
|
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.17",
|
|
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": {
|
|
@@ -24,8 +24,9 @@
|
|
|
24
24
|
],
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@lynx-js/react": "0.123.1",
|
|
27
|
-
"
|
|
28
|
-
"@lynx-js/
|
|
27
|
+
"clsx": "^2.1.1",
|
|
28
|
+
"@lynx-js/luna-styles": "0.2.2",
|
|
29
|
+
"@lynx-js/lynx-ui": "3.137.0"
|
|
29
30
|
},
|
|
30
31
|
"devDependencies": {
|
|
31
32
|
"@lynx-js/qrcode-rsbuild-plugin": "0.6.0",
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
@import "@lynx-js/luna-styles/index.css";
|
|
2
|
+
|
|
3
|
+
.bounce-tag {
|
|
4
|
+
padding: 0px 32px;
|
|
5
|
+
height: 100%;
|
|
6
|
+
display: flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
direction: inherit;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.bounce-tag__surface {
|
|
13
|
+
min-width: 56px;
|
|
14
|
+
padding: 16px 16px;
|
|
15
|
+
border-radius: 20px;
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
align-items: center;
|
|
19
|
+
justify-content: center;
|
|
20
|
+
gap: 4px;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.bounce-tag__surface--upper {
|
|
24
|
+
background-color: var(--gradient-a);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.bounce-tag__surface--lower {
|
|
28
|
+
background-color: var(--gradient-d);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.bounce-tag__text-line {
|
|
32
|
+
font-size: 13px;
|
|
33
|
+
font-weight: 600;
|
|
34
|
+
line-height: 16px;
|
|
35
|
+
text-align: center;
|
|
36
|
+
color: var(--gradient-content);
|
|
37
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
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 './index.css'
|
|
6
|
+
|
|
7
|
+
interface BounceTagProps {
|
|
8
|
+
label: string
|
|
9
|
+
variant: 'upper' | 'lower'
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function BounceTag(props: BounceTagProps) {
|
|
13
|
+
const { label, variant } = props
|
|
14
|
+
const lines = label.split(' ')
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<view className='bounce-tag'>
|
|
18
|
+
<view className={`bounce-tag__surface bounce-tag__surface--${variant}`}>
|
|
19
|
+
{lines.map((line, index) => (
|
|
20
|
+
<text className='bounce-tag__text-line' key={`${line}-${index}`}>
|
|
21
|
+
{line}
|
|
22
|
+
</text>
|
|
23
|
+
))}
|
|
24
|
+
</view>
|
|
25
|
+
</view>
|
|
26
|
+
)
|
|
27
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
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 './index.css'
|
|
6
|
+
|
|
7
|
+
import { clsx } from 'clsx'
|
|
8
|
+
|
|
9
|
+
interface CircleCardProps {
|
|
10
|
+
letter: string
|
|
11
|
+
title: string
|
|
12
|
+
subtitle: string
|
|
13
|
+
subtitleDirection?: 'inherit' | 'ltr'
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function CircleCard(props: CircleCardProps) {
|
|
17
|
+
const { letter, title, subtitle, subtitleDirection = 'inherit' } = props
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<view className='card'>
|
|
21
|
+
<view className='circle'>
|
|
22
|
+
<text className='letter'>{letter}</text>
|
|
23
|
+
<text className='title'>{title}</text>
|
|
24
|
+
<text
|
|
25
|
+
className={clsx(
|
|
26
|
+
'subtitle',
|
|
27
|
+
subtitleDirection === 'ltr' && 'subtitle--ltr',
|
|
28
|
+
)}
|
|
29
|
+
>
|
|
30
|
+
{subtitle}
|
|
31
|
+
</text>
|
|
32
|
+
</view>
|
|
33
|
+
</view>
|
|
34
|
+
)
|
|
35
|
+
}
|
|
@@ -1,43 +1,20 @@
|
|
|
1
1
|
@import "@lynx-js/luna-styles/index.css";
|
|
2
2
|
|
|
3
3
|
.demo-container {
|
|
4
|
+
background-color: var(--canvas);
|
|
4
5
|
width: 100%;
|
|
5
6
|
height: 100%;
|
|
6
7
|
display: flex;
|
|
7
8
|
align-items: center;
|
|
8
9
|
justify-content: center;
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.rtl-scope {
|
|
13
|
-
direction: rtl;
|
|
10
|
+
box-sizing: border-box;
|
|
14
11
|
}
|
|
15
12
|
|
|
16
13
|
.scroll-view {
|
|
17
14
|
width: 100%;
|
|
18
|
-
height: 472px;
|
|
19
15
|
direction: inherit;
|
|
20
16
|
}
|
|
21
17
|
|
|
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
18
|
.card {
|
|
42
19
|
width: 288px;
|
|
43
20
|
height: 100%;
|
|
@@ -80,32 +57,3 @@
|
|
|
80
57
|
color: var(--content-subtle);
|
|
81
58
|
margin-top: 1px;
|
|
82
59
|
}
|
|
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
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
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 type { ReactNode } from '@lynx-js/react'
|
|
6
|
-
import './index.css'
|
|
7
|
-
|
|
8
|
-
interface CircleLetterCardProps {
|
|
9
|
-
letter: string
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export const CircleLetterCard = (props: CircleLetterCardProps): ReactNode => {
|
|
13
|
-
const { letter } = props
|
|
14
|
-
return (
|
|
15
|
-
<view className='card'>
|
|
16
|
-
<view className='circle'>
|
|
17
|
-
<text className='letter'>{letter}</text>
|
|
18
|
-
<text className='title'>ScrollView</text>
|
|
19
|
-
<text className='subtitle'>@lynx-js/lynx-ui</text>
|
|
20
|
-
</view>
|
|
21
|
-
</view>
|
|
22
|
-
)
|
|
23
|
-
}
|
package/Horizontal/index.css
DELETED
|
@@ -1,110 +0,0 @@
|
|
|
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
|
-
}
|
package/Horizontal/index.tsx
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
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
|