@lynx-example/lynx-ui-scroll-view 0.0.14 → 0.0.16

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 CHANGED
@@ -1,58 +1,13 @@
1
1
  @import "@lynx-js/luna-styles/index.css";
2
2
 
3
+ @import "../shared/base.css";
4
+
3
5
  .demo-container {
4
- background-color: var(--canvas);
5
- width: 100%;
6
- height: 100%;
7
6
  padding-top: 48px;
8
7
  padding-bottom: 24px;
9
- display: flex;
10
- align-items: center;
11
- justify-content: center;
12
- }
13
-
14
- .card {
15
- width: 288px;
16
- height: 100%;
17
- display: flex;
18
- align-items: center;
19
- justify-content: center;
20
- }
21
-
22
- .circle {
23
- width: 216px;
24
- height: 216px;
25
- border-radius: 9999px;
26
- background-color: var(--canvas);
27
- padding-bottom: 45px;
28
- display: flex;
29
- flex-direction: column;
30
- align-items: center;
31
- justify-content: end;
32
- }
33
-
34
- .letter {
35
- font-size: 96px;
36
- font-weight: 600;
37
- line-height: 96px;
38
- color: var(--primary);
39
- }
40
-
41
- .title {
42
- font-size: 16px;
43
- font-weight: 600;
44
- color: var(--content);
45
- margin-top: 4px;
46
- }
47
-
48
- .subtitle {
49
- font-size: 10px;
50
- color: var(--content-subtle);
51
- margin-top: 1px;
52
8
  }
53
9
 
54
10
  .scroll-view {
55
- width: 100%;
56
11
  height: 472px;
57
12
  }
58
13
 
package/Basic/index.tsx CHANGED
@@ -6,7 +6,7 @@ import { root } from '@lynx-js/react'
6
6
 
7
7
  import { ScrollView } from '@lynx-js/lynx-ui'
8
8
 
9
- import { CircleLetterCard } from './CircleLetterCard'
9
+ import { CircleCard } from '../shared/CircleCard'
10
10
  import './index.css'
11
11
 
12
12
  const LETTERS = ['L', 'Y', 'N', 'X', 'U', 'I', 'L', 'Y', 'N', 'X', 'J', 'S']
@@ -17,7 +17,12 @@ function App() {
17
17
  <ScrollView scrollOrientation='horizontal' className='scroll-view'>
18
18
  <view className='scroll-view-content'>
19
19
  {LETTERS.map((letter, i) => (
20
- <CircleLetterCard letter={letter} key={`circle-${i}`} />
20
+ <CircleCard
21
+ letter={letter}
22
+ title='ScrollView'
23
+ subtitle='@lynx-js/lynx-ui'
24
+ key={`circle-${i}`}
25
+ />
21
26
  ))}
22
27
  </view>
23
28
  </ScrollView>
@@ -0,0 +1,36 @@
1
+ @import "@lynx-js/luna-styles/index.css";
2
+
3
+ @import "../shared/base.css";
4
+
5
+ .demo-container {
6
+ padding-top: 48px;
7
+ padding-bottom: 24px;
8
+ }
9
+
10
+ .demo-scroll-region {
11
+ width: 100%;
12
+ height: 472px;
13
+ display: flex;
14
+ align-items: center;
15
+ background-color: var(--canvas-ambient);
16
+ }
17
+
18
+ .scroll-view {
19
+ height: 100%;
20
+ }
21
+
22
+ .scroll-view-content {
23
+ width: max-content;
24
+ height: 100%;
25
+ display: flex;
26
+ flex-direction: row;
27
+ padding-left: 40px;
28
+ padding-right: 40px;
29
+ background: linear-gradient(
30
+ 90deg,
31
+ var(--gradient-a),
32
+ var(--gradient-b),
33
+ var(--gradient-c),
34
+ var(--gradient-d)
35
+ );
36
+ }
@@ -0,0 +1,61 @@
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 { BounceTag } from '../shared/BounceTag'
10
+ import { CircleCard } from '../shared/CircleCard'
11
+ import './index.css'
12
+
13
+ const LETTERS = [
14
+ 'L',
15
+ 'Y',
16
+ 'N',
17
+ 'X',
18
+ 'L',
19
+ 'T',
20
+ 'R',
21
+ 'B',
22
+ 'O',
23
+ 'U',
24
+ 'N',
25
+ 'C',
26
+ 'E',
27
+ ]
28
+
29
+ function App() {
30
+ return (
31
+ <view className='demo-container lunaris-dark'>
32
+ <view className='demo-scroll-region'>
33
+ <ScrollView
34
+ scrollOrientation='horizontal'
35
+ className='scroll-view'
36
+ bounceableOptions={{
37
+ enableBounces: true,
38
+ alwaysBouncing: true,
39
+ upperBounceItem: <BounceTag label='Start Bounce' variant='upper' />,
40
+ lowerBounceItem: <BounceTag label='End Bounce' variant='lower' />,
41
+ }}
42
+ >
43
+ <view className='scroll-view-content'>
44
+ {LETTERS.map((letter, index) => (
45
+ <CircleCard
46
+ letter={letter}
47
+ title='ScrollView Bounces'
48
+ subtitle='@lynx-js/lynx-ui'
49
+ key={`${letter}-${index}`}
50
+ />
51
+ ))}
52
+ </view>
53
+ </ScrollView>
54
+ </view>
55
+ </view>
56
+ )
57
+ }
58
+
59
+ root.render(<App />)
60
+
61
+ export default App
@@ -0,0 +1,41 @@
1
+ @import "@lynx-js/luna-styles/index.css";
2
+
3
+ @import "../shared/base.css";
4
+
5
+ .demo-container {
6
+ padding-top: 48px;
7
+ padding-bottom: 24px;
8
+ }
9
+
10
+ .demo-scroll-region {
11
+ width: 100%;
12
+ height: 472px;
13
+ display: flex;
14
+ align-items: center;
15
+ background-color: var(--canvas-ambient);
16
+ }
17
+
18
+ .rtl-scope {
19
+ direction: rtl;
20
+ }
21
+
22
+ .scroll-view {
23
+ height: 100%;
24
+ }
25
+
26
+ .scroll-view-content {
27
+ width: max-content;
28
+ height: 100%;
29
+ display: flex;
30
+ flex-direction: row;
31
+ padding-left: 40px;
32
+ padding-right: 40px;
33
+ direction: inherit;
34
+ background: linear-gradient(
35
+ 270deg,
36
+ var(--gradient-a),
37
+ var(--gradient-b),
38
+ var(--gradient-c),
39
+ var(--gradient-d)
40
+ );
41
+ }
@@ -0,0 +1,63 @@
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 { BounceTag } from '../shared/BounceTag'
10
+ import { CircleCard } from '../shared/CircleCard'
11
+ import './index.css'
12
+
13
+ const LETTERS = [
14
+ 'L',
15
+ 'Y',
16
+ 'N',
17
+ 'X',
18
+ 'R',
19
+ 'T',
20
+ 'L',
21
+ 'B',
22
+ 'O',
23
+ 'U',
24
+ 'N',
25
+ 'C',
26
+ 'E',
27
+ ]
28
+
29
+ function App() {
30
+ return (
31
+ <view className='demo-container lunaris-dark rtl-scope'>
32
+ <view className='demo-scroll-region'>
33
+ <ScrollView
34
+ scrollOrientation='horizontal'
35
+ enableRTL={true}
36
+ className='scroll-view'
37
+ bounceableOptions={{
38
+ enableBounces: true,
39
+ alwaysBouncing: true,
40
+ upperBounceItem: <BounceTag label='Start Bounce' variant='upper' />,
41
+ lowerBounceItem: <BounceTag label='End Bounce' variant='lower' />,
42
+ }}
43
+ >
44
+ <view className='scroll-view-content'>
45
+ {LETTERS.map((letter, index) => (
46
+ <CircleCard
47
+ letter={letter}
48
+ title='Bounces RTL'
49
+ subtitle='@lynx-js/lynx-ui'
50
+ subtitleDirection='ltr'
51
+ key={`${letter}-${index}`}
52
+ />
53
+ ))}
54
+ </view>
55
+ </ScrollView>
56
+ </view>
57
+ </view>
58
+ )
59
+ }
60
+
61
+ root.render(<App />)
62
+
63
+ export default App
package/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # @lynx-example/lynx-ui-scroll-view
2
2
 
3
+ ## 0.0.16
4
+
5
+ ### Patch Changes
6
+
7
+ - Rename the horizontal bounce demos to Bounces and BouncesRTL, and ([#266](https://github.com/lynx-family/lynx-ui/pull/266))
8
+ refine ScrollView example layout, gradients, shared primitives, and
9
+ surface layering to improve bounce demos, button styling, and RTL text
10
+ behavior.
11
+ - Updated dependencies [[`4214d92`](https://github.com/lynx-family/lynx-ui/commit/4214d923421d0a61ecd0b7cbf9a7a44acaff8d2a)]:
12
+ - @lynx-js/lynx-ui@3.136.0
13
+ - @lynx-js/luna-styles@0.2.2
14
+
15
+ ## 0.0.15
16
+
17
+ ### Patch Changes
18
+
19
+ - Rebuild the examples with the upgraded Lynx, Rspeedy, and Rsbuild toolchain. ([#233](https://github.com/lynx-family/lynx-ui/pull/233))
20
+
21
+ - Updated dependencies [[`f80b5cc`](https://github.com/lynx-family/lynx-ui/commit/f80b5ccecd8444ac06428f30475eb14d764ce8d7), [`753556b`](https://github.com/lynx-family/lynx-ui/commit/753556bc1acb77e05567aba3b8b5ab057b9f670b)]:
22
+ - @lynx-js/luna-styles@0.2.1
23
+ - @lynx-js/lynx-ui@3.135.4
24
+
3
25
  ## 0.0.14
4
26
 
5
27
  ### Patch Changes
@@ -3,7 +3,7 @@
3
3
  .demo-container {
4
4
  width: 100%;
5
5
  height: 100%;
6
- padding: 32px 20px;
6
+ padding: 64px 20px 32px;
7
7
  background-color: var(--canvas);
8
8
  }
9
9
 
@@ -17,26 +17,34 @@
17
17
 
18
18
  .button {
19
19
  flex: 1;
20
- height: 48px;
21
- border-radius: 12px;
20
+ height: 44px;
21
+ border-radius: 999px;
22
22
  display: flex;
23
23
  align-items: center;
24
24
  justify-content: center;
25
- background-color: var(--canvas-ambient);
25
+ background-color: var(--neutral);
26
+ }
27
+
28
+ .button.ui-active {
29
+ background-color: var(--neutral-2);
26
30
  }
27
31
 
28
32
  .button--primary {
29
- background-color: var(--primary);
33
+ background-color: var(--gradient-a);
34
+ }
35
+
36
+ .button--primary.ui-active {
37
+ background-color: var(--gradient-b);
30
38
  }
31
39
 
32
40
  .button-text {
33
- color: var(--content);
34
- font-size: 15px;
35
- font-weight: 600;
41
+ color: var(--neutral-content);
42
+ font-size: 14px;
43
+ font-weight: 700;
36
44
  }
37
45
 
38
46
  .button--primary .button-text {
39
- color: var(--canvas);
47
+ color: var(--gradient-content);
40
48
  }
41
49
 
42
50
  .scroll-view {
@@ -66,13 +74,13 @@
66
74
  }
67
75
 
68
76
  .card-title {
69
- color: var(--content);
77
+ color: var(--gradient-content);
70
78
  font-size: 20px;
71
79
  font-weight: 700;
72
80
  }
73
81
 
74
82
  .card-subtitle {
75
83
  margin-top: 6px;
76
- color: var(--content-subtle);
84
+ color: var(--gradient-content-faded);
77
85
  font-size: 13px;
78
86
  }
@@ -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
- <view
24
+ <Button
23
25
  className='button'
24
- main-thread:bindtap={() => {
25
- 'main thread'
26
- scrollByOffset(-160)
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
- </view>
31
- <view
34
+ </Button>
35
+ <Button
32
36
  className='button button--primary'
33
- main-thread:bindtap={() => {
34
- 'main thread'
35
- scrollByOffset(160)
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
- </view>
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-top: 48px;
7
- padding-bottom: 24px;
8
- background-color: var(--canvas-ambient);
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: 520px;
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: 16px;
20
- padding-right: 16px;
21
- padding-bottom: 32px;
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(--primary);
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, index) => (
18
+ {CARDS.map((card) => (
24
19
  <view
25
- className={`layer-card ${
26
- index === 1 ? 'layer-card--raised' : ''
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={`layer-card__badge ${
32
- index === 1 ? 'layer-card__badge--raised' : ''
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
- Scroll the list and check the overlapping badge.
37
+ {card.subtitle}
40
38
  </text>
41
39
  </view>
42
40
  ))}
Binary file
Binary file
Binary file
package/lynx.config.mjs CHANGED
@@ -6,8 +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
+ ScrollViewBounces: './Bounces/index.tsx',
10
+ ScrollViewBouncesRTL: './BouncesRTL/index.tsx',
11
11
  ScrollViewInnerFlex: './InnerFlex/index.tsx',
12
12
  ScrollViewScrollBy: './ScrollBy/index.tsx',
13
13
  ScrollViewZIndex: './ZIndex/index.tsx',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lynx-example/lynx-ui-scroll-view",
3
- "version": "0.0.14",
3
+ "version": "0.0.16",
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,15 +23,16 @@
23
23
  "lynx.config.mjs"
24
24
  ],
25
25
  "dependencies": {
26
- "@lynx-js/react": "0.114.0",
27
- "@lynx-js/lynx-ui": "3.135.3",
28
- "@lynx-js/luna-styles": "0.2.0"
26
+ "@lynx-js/react": "0.123.1",
27
+ "clsx": "^2.1.1",
28
+ "@lynx-js/luna-styles": "0.2.2",
29
+ "@lynx-js/lynx-ui": "3.136.0"
29
30
  },
30
31
  "devDependencies": {
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
- "@lynx-js/types": "3.6.0",
32
+ "@lynx-js/qrcode-rsbuild-plugin": "0.6.0",
33
+ "@lynx-js/react-rsbuild-plugin": "0.18.1",
34
+ "@lynx-js/rspeedy": "0.16.1",
35
+ "@lynx-js/types": "4.1.0",
35
36
  "@types/react": "^18.3.8"
36
37
  },
37
38
  "publishConfig": {
@@ -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,7 @@
1
+ @import "@lynx-js/luna-styles/index.css";
2
+
3
+ @import "../base.css";
4
+
5
+ .subtitle--ltr {
6
+ direction: ltr;
7
+ }
@@ -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
- background-color: var(--canvas);
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
- }
@@ -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
- }
@@ -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
@@ -1,76 +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
- '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