@chayns-components/swipeable-wrapper 5.0.32 → 5.0.34
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/AI_USAGE.md +154 -0
- package/package.json +5 -4
package/AI_USAGE.md
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
# @chayns-components/swipeable-wrapper
|
|
2
|
+
|
|
3
|
+
React component package providing `SwipeableWrapper` for chayns applications.
|
|
4
|
+
|
|
5
|
+
Documented components: `SwipeableWrapper`.
|
|
6
|
+
|
|
7
|
+
## Import
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { SwipeableWrapper } from '@chayns-components/swipeable-wrapper';
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Typical Usage
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
<SwipeableWrapper
|
|
17
|
+
leftActions={[
|
|
18
|
+
{
|
|
19
|
+
action: () => console.log('Comment'),
|
|
20
|
+
backgroundColor: 'blue',
|
|
21
|
+
color: 'white',
|
|
22
|
+
icon: <Icon color="white" icons={['fa fa-comment']} />,
|
|
23
|
+
key: 'comment',
|
|
24
|
+
text: 'Comment',
|
|
25
|
+
},
|
|
26
|
+
]}
|
|
27
|
+
rightActions={[
|
|
28
|
+
{
|
|
29
|
+
action: () => console.log('Star'),
|
|
30
|
+
backgroundColor: 'darkkhaki',
|
|
31
|
+
color: 'black',
|
|
32
|
+
icon: <Icon color="black" icons={['fa fa-star']} />,
|
|
33
|
+
key: 'star',
|
|
34
|
+
text: 'Star',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
action: () => console.log('Fire'),
|
|
38
|
+
backgroundColor: 'red',
|
|
39
|
+
color: 'white',
|
|
40
|
+
icon: <Icon color="white" icons={['fa fa-fire']} />,
|
|
41
|
+
key: 'fire',
|
|
42
|
+
text: 'Fire',
|
|
43
|
+
},
|
|
44
|
+
]}
|
|
45
|
+
>
|
|
46
|
+
{<ListItem title="Swipe me" />}
|
|
47
|
+
</SwipeableWrapper>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## SwipeableWrapper
|
|
51
|
+
|
|
52
|
+
`SwipeableWrapper` is exported by `@chayns-components/swipeable-wrapper` and should be imported from the public package entry point.
|
|
53
|
+
|
|
54
|
+
### Import
|
|
55
|
+
|
|
56
|
+
```ts
|
|
57
|
+
import { Icon, ListItem, SwipeableWrapper } from '@chayns-components/swipeable-wrapper';
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Examples
|
|
61
|
+
|
|
62
|
+
#### General
|
|
63
|
+
|
|
64
|
+
```tsx
|
|
65
|
+
<SwipeableWrapper
|
|
66
|
+
leftActions={[
|
|
67
|
+
{
|
|
68
|
+
action: () => console.log('Comment'),
|
|
69
|
+
backgroundColor: 'blue',
|
|
70
|
+
color: 'white',
|
|
71
|
+
icon: <Icon color="white" icons={['fa fa-comment']} />,
|
|
72
|
+
key: 'comment',
|
|
73
|
+
text: 'Comment',
|
|
74
|
+
},
|
|
75
|
+
]}
|
|
76
|
+
rightActions={[
|
|
77
|
+
{
|
|
78
|
+
action: () => console.log('Star'),
|
|
79
|
+
backgroundColor: 'darkkhaki',
|
|
80
|
+
color: 'black',
|
|
81
|
+
icon: <Icon color="black" icons={['fa fa-star']} />,
|
|
82
|
+
key: 'star',
|
|
83
|
+
text: 'Star',
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
action: () => console.log('Fire'),
|
|
87
|
+
backgroundColor: 'red',
|
|
88
|
+
color: 'white',
|
|
89
|
+
icon: <Icon color="white" icons={['fa fa-fire']} />,
|
|
90
|
+
key: 'fire',
|
|
91
|
+
text: 'Fire',
|
|
92
|
+
},
|
|
93
|
+
]}
|
|
94
|
+
>
|
|
95
|
+
{<ListItem title="Swipe me" />}
|
|
96
|
+
</SwipeableWrapper>
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
#### Left Action Without Background
|
|
100
|
+
|
|
101
|
+
```tsx
|
|
102
|
+
<SwipeableWrapper
|
|
103
|
+
leftActions={[
|
|
104
|
+
{
|
|
105
|
+
action: () => console.log('Reply'),
|
|
106
|
+
backgroundColor: undefined,
|
|
107
|
+
color: 'var(--chayns-color--headline)',
|
|
108
|
+
icon: <Icon color="var(--chayns-color--headline)" icons={['fa fa-reply']} />,
|
|
109
|
+
key: 'reply',
|
|
110
|
+
text: 'Reply',
|
|
111
|
+
},
|
|
112
|
+
]}
|
|
113
|
+
rightActions={undefined}
|
|
114
|
+
>
|
|
115
|
+
{<ListItem title="Swipe me" />}
|
|
116
|
+
</SwipeableWrapper>
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
#### Single Right Action
|
|
120
|
+
|
|
121
|
+
```tsx
|
|
122
|
+
<SwipeableWrapper
|
|
123
|
+
leftActions={undefined}
|
|
124
|
+
rightActions={[
|
|
125
|
+
{
|
|
126
|
+
action: () => console.log('Delete'),
|
|
127
|
+
backgroundColor: 'red',
|
|
128
|
+
color: 'white',
|
|
129
|
+
icon: <Icon color="white" icons={['fa fa-trash']} />,
|
|
130
|
+
key: 'trash',
|
|
131
|
+
text: 'Delete',
|
|
132
|
+
},
|
|
133
|
+
]}
|
|
134
|
+
>
|
|
135
|
+
{<ListItem title="Swipe me" />}
|
|
136
|
+
</SwipeableWrapper>
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### Props
|
|
140
|
+
|
|
141
|
+
No prop documentation available.
|
|
142
|
+
|
|
143
|
+
### Types
|
|
144
|
+
|
|
145
|
+
No additional exported types documented.
|
|
146
|
+
|
|
147
|
+
### Usage Notes
|
|
148
|
+
|
|
149
|
+
- Import `SwipeableWrapper` directly from `@chayns-components/swipeable-wrapper` instead of internal source paths.
|
|
150
|
+
- Start with one of the documented Storybook examples and adapt the props incrementally for your use case.
|
|
151
|
+
|
|
152
|
+
### Anti Patterns
|
|
153
|
+
|
|
154
|
+
- Avoid imports from internal paths such as `@chayns-components/swipeable-wrapper/src/...`; always use the public package export.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chayns-components/swipeable-wrapper",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.34",
|
|
4
4
|
"description": "A set of beautiful React components for developing your own applications with chayns.",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"browserslist": [
|
|
@@ -33,7 +33,8 @@
|
|
|
33
33
|
"test": "__tests__"
|
|
34
34
|
},
|
|
35
35
|
"files": [
|
|
36
|
-
"lib"
|
|
36
|
+
"lib",
|
|
37
|
+
"AI_USAGE.md"
|
|
37
38
|
],
|
|
38
39
|
"repository": {
|
|
39
40
|
"type": "git",
|
|
@@ -71,7 +72,7 @@
|
|
|
71
72
|
"typescript": "^5.9.3"
|
|
72
73
|
},
|
|
73
74
|
"dependencies": {
|
|
74
|
-
"@chayns-components/core": "^5.0.
|
|
75
|
+
"@chayns-components/core": "^5.0.34"
|
|
75
76
|
},
|
|
76
77
|
"peerDependencies": {
|
|
77
78
|
"chayns-api": ">=2.2.0",
|
|
@@ -83,5 +84,5 @@
|
|
|
83
84
|
"publishConfig": {
|
|
84
85
|
"access": "public"
|
|
85
86
|
},
|
|
86
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "7c7c2d7dacbc7c8031f3bcef885e4f63b8f49b1a"
|
|
87
88
|
}
|