@ecohouse/ui 0.1.57 → 0.1.58
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/dist/index.cjs +396 -30
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +39 -2
- package/dist/index.d.ts +39 -2
- package/dist/index.js +386 -32
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/NotificationStatus/NotificationStatus.stories.tsx +86 -0
- package/src/components/NotificationStatus/NotificationStatus.tsx +255 -0
- package/src/components/NotificationStatus/index.ts +9 -0
- package/src/components/index.ts +10 -0
- package/src/icons/DoubleCheck/DoubleCheckIcon.tsx +25 -0
- package/src/icons/DoubleCheck/DoubleCheckIcon.web.tsx +31 -0
- package/src/icons/DoubleCheck/doubleCheckPath.ts +3 -0
- package/src/icons/DoubleCheck/index.ts +1 -0
- package/src/icons/NotificationCancelled/NotificationCancelledIcon.tsx +22 -0
- package/src/icons/NotificationCancelled/NotificationCancelledIcon.web.tsx +21 -0
- package/src/icons/NotificationCancelled/index.ts +1 -0
- package/src/icons/NotificationCheckout/NotificationCheckoutIcon.tsx +22 -0
- package/src/icons/NotificationCheckout/NotificationCheckoutIcon.web.tsx +21 -0
- package/src/icons/NotificationCheckout/index.ts +1 -0
- package/src/icons/NotificationIcons.stories.tsx +99 -0
- package/src/icons/NotificationQrCode/NotificationQrCodeIcon.tsx +25 -0
- package/src/icons/NotificationQrCode/NotificationQrCodeIcon.web.tsx +24 -0
- package/src/icons/NotificationQrCode/index.ts +1 -0
- package/src/icons/NotificationSuccess/NotificationSuccessIcon.tsx +26 -0
- package/src/icons/NotificationSuccess/NotificationSuccessIcon.web.tsx +25 -0
- package/src/icons/NotificationSuccess/index.ts +1 -0
- package/src/icons/NotificationWarning/NotificationWarningIcon.tsx +22 -0
- package/src/icons/NotificationWarning/NotificationWarningIcon.web.tsx +21 -0
- package/src/icons/NotificationWarning/index.ts +1 -0
- package/src/icons/index.ts +6 -0
- package/src/icons/registry.ts +20 -0
- package/src/index.ts +13 -0
package/package.json
CHANGED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import { StyleSheet, View } from "react-native";
|
|
3
|
+
import { colors } from "../../theme";
|
|
4
|
+
import {
|
|
5
|
+
BookingWarningNotification,
|
|
6
|
+
CancelledBookingNotification,
|
|
7
|
+
GuestCheckInNotification,
|
|
8
|
+
NewBookingNotification,
|
|
9
|
+
NotificationStatusSkeleton,
|
|
10
|
+
QrKeyNotification,
|
|
11
|
+
} from "./NotificationStatus";
|
|
12
|
+
|
|
13
|
+
const meta = {
|
|
14
|
+
title: "Components/Notification Statuses",
|
|
15
|
+
component: NewBookingNotification,
|
|
16
|
+
args: {
|
|
17
|
+
title: "Նոր ամրագրում",
|
|
18
|
+
description: "Արմեն Գրիգորյանը ամրագրեց «Լեռնային Ռեզիդենցիա» (Օգս 28 - Օգս 30):",
|
|
19
|
+
timestamp: "2 ժ առաջ",
|
|
20
|
+
unread: true,
|
|
21
|
+
onPress: () => undefined,
|
|
22
|
+
},
|
|
23
|
+
decorators: [
|
|
24
|
+
(Story) => (
|
|
25
|
+
<View style={styles.frame}>
|
|
26
|
+
<Story />
|
|
27
|
+
</View>
|
|
28
|
+
),
|
|
29
|
+
],
|
|
30
|
+
parameters: {
|
|
31
|
+
backgrounds: { default: "dark" },
|
|
32
|
+
},
|
|
33
|
+
} satisfies Meta<typeof NewBookingNotification>;
|
|
34
|
+
|
|
35
|
+
export default meta;
|
|
36
|
+
type Story = StoryObj<typeof meta>;
|
|
37
|
+
|
|
38
|
+
export const NewBooking: Story = {};
|
|
39
|
+
|
|
40
|
+
export const CancelledBooking: Story = {
|
|
41
|
+
render: (args) => <CancelledBookingNotification {...args} title="Ամրագրումը չեղարկվել է" />,
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export const GuestCheckIn: Story = {
|
|
45
|
+
render: (args) => <GuestCheckInNotification {...args} title="Հյուրը մուտք գործեց" />,
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export const QrKey: Story = {
|
|
49
|
+
name: "QR Key",
|
|
50
|
+
render: (args) => <QrKeyNotification {...args} title="QR բանալին ակտիվացված է" />,
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export const BookingWarning: Story = {
|
|
54
|
+
render: (args) => (
|
|
55
|
+
<BookingWarningNotification {...args} title="Քոթեջն ուշադրություն է պահանջում" />
|
|
56
|
+
),
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export const Loading: Story = {
|
|
60
|
+
render: () => <NotificationStatusSkeleton />,
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export const AllStatuses: Story = {
|
|
64
|
+
render: (args) => (
|
|
65
|
+
<View>
|
|
66
|
+
<NewBookingNotification {...args} />
|
|
67
|
+
<CancelledBookingNotification {...args} title="Ամրագրումը չեղարկվել է" />
|
|
68
|
+
<GuestCheckInNotification {...args} title="Հյուրը մուտք գործեց" />
|
|
69
|
+
<QrKeyNotification {...args} title="QR բանալին ակտիվացված է" unread={false} />
|
|
70
|
+
<BookingWarningNotification
|
|
71
|
+
{...args}
|
|
72
|
+
title="Քոթեջն ուշադրություն է պահանջում"
|
|
73
|
+
unread={false}
|
|
74
|
+
/>
|
|
75
|
+
</View>
|
|
76
|
+
),
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
const styles = StyleSheet.create({
|
|
80
|
+
frame: {
|
|
81
|
+
width: 460,
|
|
82
|
+
overflow: "hidden",
|
|
83
|
+
borderRadius: 16,
|
|
84
|
+
backgroundColor: colors.grey750,
|
|
85
|
+
},
|
|
86
|
+
});
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
import { useState, type ReactNode } from "react";
|
|
2
|
+
import {
|
|
3
|
+
Pressable,
|
|
4
|
+
StyleSheet,
|
|
5
|
+
Text,
|
|
6
|
+
View,
|
|
7
|
+
type PressableProps,
|
|
8
|
+
type StyleProp,
|
|
9
|
+
type ViewStyle,
|
|
10
|
+
} from "react-native";
|
|
11
|
+
import {
|
|
12
|
+
ChevronRightIcon,
|
|
13
|
+
NotificationCancelledIcon,
|
|
14
|
+
NotificationCheckoutIcon,
|
|
15
|
+
NotificationQrCodeIcon,
|
|
16
|
+
NotificationSuccessIcon,
|
|
17
|
+
NotificationWarningIcon,
|
|
18
|
+
} from "../../icons";
|
|
19
|
+
import { colors, fonts } from "../../theme";
|
|
20
|
+
|
|
21
|
+
export interface NotificationStatusProps extends Omit<
|
|
22
|
+
PressableProps,
|
|
23
|
+
"children" | "disabled" | "onPress" | "style"
|
|
24
|
+
> {
|
|
25
|
+
title: string;
|
|
26
|
+
description: string;
|
|
27
|
+
timestamp: string;
|
|
28
|
+
unread?: boolean;
|
|
29
|
+
disabled?: boolean;
|
|
30
|
+
showChevron?: boolean;
|
|
31
|
+
onPress?: PressableProps["onPress"];
|
|
32
|
+
style?: StyleProp<ViewStyle>;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function NewBookingNotification(props: NotificationStatusProps) {
|
|
36
|
+
return <NotificationStatus icon={<NotificationSuccessIcon />} {...props} />;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function CancelledBookingNotification(props: NotificationStatusProps) {
|
|
40
|
+
return <NotificationStatus icon={<NotificationCancelledIcon />} {...props} />;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function GuestCheckInNotification(props: NotificationStatusProps) {
|
|
44
|
+
return <NotificationStatus icon={<NotificationCheckoutIcon />} {...props} />;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function QrKeyNotification(props: NotificationStatusProps) {
|
|
48
|
+
return <NotificationStatus icon={<NotificationQrCodeIcon />} {...props} />;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function BookingWarningNotification(props: NotificationStatusProps) {
|
|
52
|
+
return <NotificationStatus icon={<NotificationWarningIcon />} {...props} />;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function NotificationStatusSkeleton() {
|
|
56
|
+
return (
|
|
57
|
+
<View
|
|
58
|
+
accessibilityElementsHidden
|
|
59
|
+
importantForAccessibility="no-hide-descendants"
|
|
60
|
+
style={styles.root}
|
|
61
|
+
>
|
|
62
|
+
<View style={[styles.icon, styles.skeletonIcon]} />
|
|
63
|
+
<View style={[styles.content, styles.skeletonContent]}>
|
|
64
|
+
<View style={[styles.skeletonLine, styles.skeletonTitle]} />
|
|
65
|
+
<View style={styles.skeletonDescription}>
|
|
66
|
+
<View style={[styles.skeletonLine, styles.skeletonDescriptionFirst]} />
|
|
67
|
+
<View style={[styles.skeletonLine, styles.skeletonDescriptionSecond]} />
|
|
68
|
+
</View>
|
|
69
|
+
<View style={[styles.skeletonLine, styles.skeletonTimestamp]} />
|
|
70
|
+
</View>
|
|
71
|
+
<View style={[styles.chevron, styles.skeletonChevron]} />
|
|
72
|
+
</View>
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function NotificationStatus({
|
|
77
|
+
icon,
|
|
78
|
+
title,
|
|
79
|
+
description,
|
|
80
|
+
timestamp,
|
|
81
|
+
unread = false,
|
|
82
|
+
disabled = false,
|
|
83
|
+
showChevron,
|
|
84
|
+
onPress,
|
|
85
|
+
style,
|
|
86
|
+
accessibilityLabel,
|
|
87
|
+
onHoverIn,
|
|
88
|
+
onHoverOut,
|
|
89
|
+
onPressIn,
|
|
90
|
+
onPressOut,
|
|
91
|
+
...rest
|
|
92
|
+
}: NotificationStatusProps & { icon: ReactNode }) {
|
|
93
|
+
const [active, setActive] = useState(false);
|
|
94
|
+
const interactive = onPress !== undefined;
|
|
95
|
+
|
|
96
|
+
return (
|
|
97
|
+
<Pressable
|
|
98
|
+
{...rest}
|
|
99
|
+
accessibilityLabel={accessibilityLabel ?? `${title}. ${description}. ${timestamp}`}
|
|
100
|
+
accessibilityRole={interactive ? "button" : undefined}
|
|
101
|
+
accessibilityState={{ disabled }}
|
|
102
|
+
disabled={disabled}
|
|
103
|
+
onPress={onPress}
|
|
104
|
+
onHoverIn={(event) => {
|
|
105
|
+
setActive(true);
|
|
106
|
+
onHoverIn?.(event);
|
|
107
|
+
}}
|
|
108
|
+
onHoverOut={(event) => {
|
|
109
|
+
setActive(false);
|
|
110
|
+
onHoverOut?.(event);
|
|
111
|
+
}}
|
|
112
|
+
onPressIn={(event) => {
|
|
113
|
+
setActive(true);
|
|
114
|
+
onPressIn?.(event);
|
|
115
|
+
}}
|
|
116
|
+
onPressOut={(event) => {
|
|
117
|
+
setActive(false);
|
|
118
|
+
onPressOut?.(event);
|
|
119
|
+
}}
|
|
120
|
+
style={[styles.root, active && styles.rootActive, disabled && styles.disabled, style]}
|
|
121
|
+
>
|
|
122
|
+
<View style={styles.icon}>{icon}</View>
|
|
123
|
+
<View style={styles.content}>
|
|
124
|
+
<View style={styles.titleRow}>
|
|
125
|
+
{unread ? <View style={styles.unreadIndicator} /> : null}
|
|
126
|
+
<Text numberOfLines={1} style={styles.title}>
|
|
127
|
+
{title}
|
|
128
|
+
</Text>
|
|
129
|
+
</View>
|
|
130
|
+
<Text style={styles.description}>{description}</Text>
|
|
131
|
+
<Text numberOfLines={1} style={styles.timestamp}>
|
|
132
|
+
{timestamp}
|
|
133
|
+
</Text>
|
|
134
|
+
</View>
|
|
135
|
+
{(showChevron ?? interactive) ? (
|
|
136
|
+
<View
|
|
137
|
+
accessibilityElementsHidden
|
|
138
|
+
importantForAccessibility="no-hide-descendants"
|
|
139
|
+
style={styles.chevron}
|
|
140
|
+
>
|
|
141
|
+
<ChevronRightIcon color={colors.grey300} size={16} strokeWidth={1.5} />
|
|
142
|
+
</View>
|
|
143
|
+
) : null}
|
|
144
|
+
</Pressable>
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
const styles = StyleSheet.create({
|
|
149
|
+
root: {
|
|
150
|
+
width: "100%",
|
|
151
|
+
minHeight: 111,
|
|
152
|
+
flexDirection: "row",
|
|
153
|
+
alignItems: "flex-start",
|
|
154
|
+
gap: 16,
|
|
155
|
+
padding: 16,
|
|
156
|
+
backgroundColor: "transparent",
|
|
157
|
+
},
|
|
158
|
+
rootActive: {
|
|
159
|
+
backgroundColor: colors.whiteAlpha1,
|
|
160
|
+
},
|
|
161
|
+
disabled: {
|
|
162
|
+
opacity: 0.4,
|
|
163
|
+
},
|
|
164
|
+
icon: {
|
|
165
|
+
width: 44,
|
|
166
|
+
height: 44,
|
|
167
|
+
flexShrink: 0,
|
|
168
|
+
},
|
|
169
|
+
content: {
|
|
170
|
+
minWidth: 0,
|
|
171
|
+
flex: 1,
|
|
172
|
+
alignSelf: "stretch",
|
|
173
|
+
justifyContent: "space-between",
|
|
174
|
+
},
|
|
175
|
+
titleRow: {
|
|
176
|
+
minWidth: 0,
|
|
177
|
+
flexDirection: "row",
|
|
178
|
+
alignItems: "center",
|
|
179
|
+
gap: 10,
|
|
180
|
+
},
|
|
181
|
+
unreadIndicator: {
|
|
182
|
+
width: 8,
|
|
183
|
+
height: 8,
|
|
184
|
+
flexShrink: 0,
|
|
185
|
+
borderRadius: 4,
|
|
186
|
+
backgroundColor: colors.primaryLight,
|
|
187
|
+
},
|
|
188
|
+
title: {
|
|
189
|
+
minWidth: 0,
|
|
190
|
+
flex: 1,
|
|
191
|
+
color: colors.white,
|
|
192
|
+
fontFamily: fonts.sans,
|
|
193
|
+
fontSize: 14,
|
|
194
|
+
fontWeight: "600",
|
|
195
|
+
lineHeight: 14,
|
|
196
|
+
letterSpacing: 0,
|
|
197
|
+
},
|
|
198
|
+
description: {
|
|
199
|
+
color: colors.lightGrey,
|
|
200
|
+
fontFamily: fonts.sans,
|
|
201
|
+
fontSize: 12,
|
|
202
|
+
fontWeight: "400",
|
|
203
|
+
lineHeight: 16,
|
|
204
|
+
letterSpacing: 0,
|
|
205
|
+
},
|
|
206
|
+
timestamp: {
|
|
207
|
+
color: colors.grey50,
|
|
208
|
+
fontFamily: fonts.sans,
|
|
209
|
+
fontSize: 12,
|
|
210
|
+
fontWeight: "400",
|
|
211
|
+
lineHeight: 16,
|
|
212
|
+
letterSpacing: 0,
|
|
213
|
+
},
|
|
214
|
+
chevron: {
|
|
215
|
+
alignSelf: "center",
|
|
216
|
+
flexShrink: 0,
|
|
217
|
+
},
|
|
218
|
+
skeletonIcon: {
|
|
219
|
+
borderRadius: 22,
|
|
220
|
+
backgroundColor: colors.grey600,
|
|
221
|
+
},
|
|
222
|
+
skeletonContent: {
|
|
223
|
+
paddingTop: 1,
|
|
224
|
+
paddingBottom: 2,
|
|
225
|
+
},
|
|
226
|
+
skeletonLine: {
|
|
227
|
+
borderRadius: 999,
|
|
228
|
+
backgroundColor: colors.grey500,
|
|
229
|
+
},
|
|
230
|
+
skeletonTitle: {
|
|
231
|
+
width: "42%",
|
|
232
|
+
height: 12,
|
|
233
|
+
},
|
|
234
|
+
skeletonDescription: {
|
|
235
|
+
gap: 5,
|
|
236
|
+
},
|
|
237
|
+
skeletonDescriptionFirst: {
|
|
238
|
+
width: "92%",
|
|
239
|
+
height: 10,
|
|
240
|
+
},
|
|
241
|
+
skeletonDescriptionSecond: {
|
|
242
|
+
width: "68%",
|
|
243
|
+
height: 10,
|
|
244
|
+
},
|
|
245
|
+
skeletonTimestamp: {
|
|
246
|
+
width: 58,
|
|
247
|
+
height: 10,
|
|
248
|
+
},
|
|
249
|
+
skeletonChevron: {
|
|
250
|
+
width: 7,
|
|
251
|
+
height: 12,
|
|
252
|
+
borderRadius: 4,
|
|
253
|
+
backgroundColor: colors.grey500,
|
|
254
|
+
},
|
|
255
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export {
|
|
2
|
+
BookingWarningNotification,
|
|
3
|
+
CancelledBookingNotification,
|
|
4
|
+
GuestCheckInNotification,
|
|
5
|
+
NewBookingNotification,
|
|
6
|
+
NotificationStatusSkeleton,
|
|
7
|
+
QrKeyNotification,
|
|
8
|
+
} from "./NotificationStatus";
|
|
9
|
+
export type { NotificationStatusProps } from "./NotificationStatus";
|
package/src/components/index.ts
CHANGED
|
@@ -119,6 +119,16 @@ export type { RatingInputProps } from "./RatingInput";
|
|
|
119
119
|
export { CommentCard } from "./CommentCard";
|
|
120
120
|
export type { CommentCardProps } from "./CommentCard";
|
|
121
121
|
|
|
122
|
+
export {
|
|
123
|
+
BookingWarningNotification,
|
|
124
|
+
CancelledBookingNotification,
|
|
125
|
+
GuestCheckInNotification,
|
|
126
|
+
NewBookingNotification,
|
|
127
|
+
NotificationStatusSkeleton,
|
|
128
|
+
QrKeyNotification,
|
|
129
|
+
} from "./NotificationStatus";
|
|
130
|
+
export type { NotificationStatusProps } from "./NotificationStatus";
|
|
131
|
+
|
|
122
132
|
export { Range } from "./Range";
|
|
123
133
|
export type { RangeProps, RangeValue } from "./Range";
|
|
124
134
|
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import Svg, { Path } from "react-native-svg";
|
|
2
|
+
import { colors } from "../../theme";
|
|
3
|
+
import type { IconProps } from "../types";
|
|
4
|
+
import { DOUBLE_CHECK_PATH } from "./doubleCheckPath";
|
|
5
|
+
|
|
6
|
+
export { DOUBLE_CHECK_PATH } from "./doubleCheckPath";
|
|
7
|
+
|
|
8
|
+
/** Native — react-native-svg (peer dependency). */
|
|
9
|
+
export function DoubleCheckIcon({
|
|
10
|
+
size = 16,
|
|
11
|
+
color = colors.primary,
|
|
12
|
+
strokeWidth = 1.5,
|
|
13
|
+
}: IconProps) {
|
|
14
|
+
return (
|
|
15
|
+
<Svg width={size} height={size} viewBox="0 0 16 16" fill="none">
|
|
16
|
+
<Path
|
|
17
|
+
d={DOUBLE_CHECK_PATH}
|
|
18
|
+
stroke={color}
|
|
19
|
+
strokeWidth={strokeWidth}
|
|
20
|
+
strokeLinecap="round"
|
|
21
|
+
strokeLinejoin="round"
|
|
22
|
+
/>
|
|
23
|
+
</Svg>
|
|
24
|
+
);
|
|
25
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { colors } from "../../theme";
|
|
2
|
+
import type { IconProps } from "../types";
|
|
3
|
+
import { DOUBLE_CHECK_PATH } from "./doubleCheckPath";
|
|
4
|
+
|
|
5
|
+
/** Web / Storybook — plain SVG (no react-native-svg). */
|
|
6
|
+
export function DoubleCheckIcon({
|
|
7
|
+
size = 16,
|
|
8
|
+
color = colors.primary,
|
|
9
|
+
strokeWidth = 1.5,
|
|
10
|
+
}: IconProps) {
|
|
11
|
+
return (
|
|
12
|
+
<svg
|
|
13
|
+
width={size}
|
|
14
|
+
height={size}
|
|
15
|
+
viewBox="0 0 16 16"
|
|
16
|
+
fill="none"
|
|
17
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
18
|
+
aria-hidden
|
|
19
|
+
>
|
|
20
|
+
<path
|
|
21
|
+
d={DOUBLE_CHECK_PATH}
|
|
22
|
+
stroke={color}
|
|
23
|
+
strokeWidth={strokeWidth}
|
|
24
|
+
strokeLinecap="round"
|
|
25
|
+
strokeLinejoin="round"
|
|
26
|
+
/>
|
|
27
|
+
</svg>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export { DOUBLE_CHECK_PATH } from "./doubleCheckPath";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DoubleCheckIcon, DOUBLE_CHECK_PATH } from "./DoubleCheckIcon";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import Svg, { Path, Rect } from "react-native-svg";
|
|
2
|
+
import type { IconProps } from "../types";
|
|
3
|
+
|
|
4
|
+
export function NotificationCancelledIcon({
|
|
5
|
+
size = 44,
|
|
6
|
+
color = "#A63E3E",
|
|
7
|
+
strokeWidth = 2,
|
|
8
|
+
fillOpacity = 0.08,
|
|
9
|
+
}: IconProps) {
|
|
10
|
+
return (
|
|
11
|
+
<Svg width={size} height={size} viewBox="0 0 44 44" fill="none">
|
|
12
|
+
<Rect width="44" height="44" rx="22" fill={color} fillOpacity={fillOpacity} />
|
|
13
|
+
<Path
|
|
14
|
+
d="M27 17L17 27M17 17L27 27"
|
|
15
|
+
stroke={color}
|
|
16
|
+
strokeWidth={strokeWidth}
|
|
17
|
+
strokeLinecap="round"
|
|
18
|
+
strokeLinejoin="round"
|
|
19
|
+
/>
|
|
20
|
+
</Svg>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { IconProps } from "../types";
|
|
2
|
+
|
|
3
|
+
export function NotificationCancelledIcon({
|
|
4
|
+
size = 44,
|
|
5
|
+
color = "#A63E3E",
|
|
6
|
+
strokeWidth = 2,
|
|
7
|
+
fillOpacity = 0.08,
|
|
8
|
+
}: IconProps) {
|
|
9
|
+
return (
|
|
10
|
+
<svg width={size} height={size} viewBox="0 0 44 44" fill="none" aria-hidden="true">
|
|
11
|
+
<rect width="44" height="44" rx="22" fill={color} fillOpacity={fillOpacity} />
|
|
12
|
+
<path
|
|
13
|
+
d="M27 17L17 27M17 17L27 27"
|
|
14
|
+
stroke={color}
|
|
15
|
+
strokeWidth={strokeWidth}
|
|
16
|
+
strokeLinecap="round"
|
|
17
|
+
strokeLinejoin="round"
|
|
18
|
+
/>
|
|
19
|
+
</svg>
|
|
20
|
+
);
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { NotificationCancelledIcon } from "./NotificationCancelledIcon";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import Svg, { Path, Rect } from "react-native-svg";
|
|
2
|
+
import type { IconProps } from "../types";
|
|
3
|
+
|
|
4
|
+
export function NotificationCheckoutIcon({
|
|
5
|
+
size = 44,
|
|
6
|
+
color = "#B46436",
|
|
7
|
+
strokeWidth = 2,
|
|
8
|
+
fillOpacity = 0.06,
|
|
9
|
+
}: IconProps) {
|
|
10
|
+
return (
|
|
11
|
+
<Svg width={size} height={size} viewBox="0 0 44 44" fill="none">
|
|
12
|
+
<Rect width="44" height="44" rx="22" fill={color} fillOpacity={fillOpacity} />
|
|
13
|
+
<Path
|
|
14
|
+
d="M17 17L27 27M20.3333 27H27V20.3333"
|
|
15
|
+
stroke={color}
|
|
16
|
+
strokeWidth={strokeWidth}
|
|
17
|
+
strokeLinecap="round"
|
|
18
|
+
strokeLinejoin="round"
|
|
19
|
+
/>
|
|
20
|
+
</Svg>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { IconProps } from "../types";
|
|
2
|
+
|
|
3
|
+
export function NotificationCheckoutIcon({
|
|
4
|
+
size = 44,
|
|
5
|
+
color = "#B46436",
|
|
6
|
+
strokeWidth = 2,
|
|
7
|
+
fillOpacity = 0.06,
|
|
8
|
+
}: IconProps) {
|
|
9
|
+
return (
|
|
10
|
+
<svg width={size} height={size} viewBox="0 0 44 44" fill="none" aria-hidden="true">
|
|
11
|
+
<rect width="44" height="44" rx="22" fill={color} fillOpacity={fillOpacity} />
|
|
12
|
+
<path
|
|
13
|
+
d="M17 17L27 27M20.3333 27H27V20.3333"
|
|
14
|
+
stroke={color}
|
|
15
|
+
strokeWidth={strokeWidth}
|
|
16
|
+
strokeLinecap="round"
|
|
17
|
+
strokeLinejoin="round"
|
|
18
|
+
/>
|
|
19
|
+
</svg>
|
|
20
|
+
);
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { NotificationCheckoutIcon } from "./NotificationCheckoutIcon";
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
3
|
+
import { StyleSheet, Text, View } from "react-native";
|
|
4
|
+
import { colors } from "../theme";
|
|
5
|
+
import { NotificationCancelledIcon } from "./NotificationCancelled";
|
|
6
|
+
import { NotificationCheckoutIcon } from "./NotificationCheckout";
|
|
7
|
+
import { NotificationQrCodeIcon } from "./NotificationQrCode";
|
|
8
|
+
import { NotificationSuccessIcon } from "./NotificationSuccess";
|
|
9
|
+
import { NotificationWarningIcon } from "./NotificationWarning";
|
|
10
|
+
|
|
11
|
+
const meta = {
|
|
12
|
+
title: "Icons/Notifications",
|
|
13
|
+
component: NotificationSuccessIcon,
|
|
14
|
+
args: {
|
|
15
|
+
size: 44,
|
|
16
|
+
strokeWidth: 2,
|
|
17
|
+
},
|
|
18
|
+
argTypes: {
|
|
19
|
+
size: { control: { type: "number", min: 24, max: 88, step: 2 } },
|
|
20
|
+
color: { control: "color" },
|
|
21
|
+
strokeWidth: { control: { type: "number", min: 1, max: 4, step: 0.5 } },
|
|
22
|
+
fillOpacity: { control: { type: "number", min: 0, max: 1, step: 0.01 } },
|
|
23
|
+
},
|
|
24
|
+
parameters: {
|
|
25
|
+
backgrounds: { default: "dark" },
|
|
26
|
+
},
|
|
27
|
+
} satisfies Meta<typeof NotificationSuccessIcon>;
|
|
28
|
+
|
|
29
|
+
export default meta;
|
|
30
|
+
type Story = StoryObj<typeof meta>;
|
|
31
|
+
|
|
32
|
+
export const Gallery: Story = {
|
|
33
|
+
render: () => (
|
|
34
|
+
<View style={styles.gallery}>
|
|
35
|
+
<IconPreview label="Success">
|
|
36
|
+
<NotificationSuccessIcon />
|
|
37
|
+
</IconPreview>
|
|
38
|
+
<IconPreview label="Cancelled">
|
|
39
|
+
<NotificationCancelledIcon />
|
|
40
|
+
</IconPreview>
|
|
41
|
+
<IconPreview label="Checkout">
|
|
42
|
+
<NotificationCheckoutIcon />
|
|
43
|
+
</IconPreview>
|
|
44
|
+
<IconPreview label="QR code">
|
|
45
|
+
<NotificationQrCodeIcon />
|
|
46
|
+
</IconPreview>
|
|
47
|
+
<IconPreview label="Warning">
|
|
48
|
+
<NotificationWarningIcon />
|
|
49
|
+
</IconPreview>
|
|
50
|
+
</View>
|
|
51
|
+
),
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export const Success: Story = {};
|
|
55
|
+
|
|
56
|
+
export const Cancelled: Story = {
|
|
57
|
+
render: (args) => <NotificationCancelledIcon {...args} />,
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export const Checkout: Story = {
|
|
61
|
+
render: (args) => <NotificationCheckoutIcon {...args} />,
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export const QrCode: Story = {
|
|
65
|
+
name: "QR Code",
|
|
66
|
+
render: (args) => <NotificationQrCodeIcon {...args} />,
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export const Warning: Story = {
|
|
70
|
+
render: (args) => <NotificationWarningIcon {...args} />,
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
function IconPreview({ label, children }: { label: string; children: ReactNode }) {
|
|
74
|
+
return (
|
|
75
|
+
<View style={styles.preview}>
|
|
76
|
+
{children}
|
|
77
|
+
<Text style={styles.label}>{label}</Text>
|
|
78
|
+
</View>
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const styles = StyleSheet.create({
|
|
83
|
+
gallery: {
|
|
84
|
+
flexDirection: "row",
|
|
85
|
+
flexWrap: "wrap",
|
|
86
|
+
gap: 24,
|
|
87
|
+
padding: 16,
|
|
88
|
+
},
|
|
89
|
+
preview: {
|
|
90
|
+
width: 88,
|
|
91
|
+
alignItems: "center",
|
|
92
|
+
gap: 8,
|
|
93
|
+
},
|
|
94
|
+
label: {
|
|
95
|
+
color: colors.white,
|
|
96
|
+
fontFamily: "Noto Sans Armenian",
|
|
97
|
+
fontSize: 12,
|
|
98
|
+
},
|
|
99
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import Svg, { Path, Rect } from "react-native-svg";
|
|
2
|
+
import type { IconProps } from "../types";
|
|
3
|
+
|
|
4
|
+
const QR_PATH =
|
|
5
|
+
"M17.4167 17.4167H17.425M26.5833 17.4167H26.5917M17.4167 26.5833H17.425M22.8333 22.8333H22.8417M26.5833 26.5833H26.5917M26.1667 29.5H29.5V26.1667M23.6667 25.75V29.5M29.5 23.6667H25.75M25 20.3333H28.1667C28.6334 20.3333 28.8667 20.3333 29.045 20.2425C29.2018 20.1626 29.3293 20.0351 29.4092 19.8783C29.5 19.7001 29.5 19.4667 29.5 19V15.8333C29.5 15.3666 29.5 15.1333 29.4092 14.955C29.3293 14.7982 29.2018 14.6707 29.045 14.5908C28.8667 14.5 28.6334 14.5 28.1667 14.5H25C24.5333 14.5 24.2999 14.5 24.1217 14.5908C23.9649 14.6707 23.8374 14.7982 23.7575 14.955C23.6667 15.1333 23.6667 15.3666 23.6667 15.8333V19C23.6667 19.4667 23.6667 19.7001 23.7575 19.8783C23.8374 20.0351 23.9649 20.1626 24.1217 20.2425C24.2999 20.3333 24.5333 20.3333 25 20.3333ZM15.8333 20.3333H19C19.4667 20.3333 19.7001 20.3333 19.8783 20.2425C20.0351 20.1626 20.1626 20.0351 20.2425 19.8783C20.3333 19.7001 20.3333 19.4667 20.3333 19V15.8333C20.3333 15.3666 20.3333 15.1333 20.2425 14.955C20.1626 14.7982 20.0351 14.6707 19.8783 14.5908C19.7001 14.5 19.4667 14.5 19 14.5H15.8333C15.3666 14.5 15.1333 14.5 14.955 14.5908C14.7982 14.6707 14.6707 14.7982 14.5908 14.955C14.5 15.1333 14.5 15.3666 14.5 15.8333V19C14.5 19.4667 14.5 19.7001 14.5908 19.8783C14.6707 20.0351 14.7982 20.1626 14.955 20.2425C15.1333 20.3333 15.3666 20.3333 15.8333 20.3333ZM15.8333 29.5H19C19.4667 29.5 19.7001 29.5 19.8783 29.4092C20.0351 29.3293 20.1626 29.2018 20.2425 29.045C20.3333 28.8667 20.3333 28.6334 20.3333 28.1667V25C20.3333 24.5333 20.3333 24.2999 20.2425 24.1217C20.1626 23.9649 20.0351 23.8374 19.8783 23.7575C19.7001 23.6667 19.4667 23.6667 19 23.6667H15.8333C15.3666 23.6667 15.1333 23.6667 14.955 23.7575C14.7982 23.8374 14.6707 23.9649 14.5908 24.1217C14.5 24.2999 14.5 24.5333 14.5 25V28.1667C14.5 28.6334 14.5 28.8667 14.5908 29.045C14.6707 29.2018 14.7982 29.3293 14.955 29.4092C15.1333 29.5 15.3666 29.5 15.8333 29.5Z";
|
|
6
|
+
|
|
7
|
+
export function NotificationQrCodeIcon({
|
|
8
|
+
size = 44,
|
|
9
|
+
color = "#B46436",
|
|
10
|
+
strokeWidth = 2,
|
|
11
|
+
fillOpacity = 0.06,
|
|
12
|
+
}: IconProps) {
|
|
13
|
+
return (
|
|
14
|
+
<Svg width={size} height={size} viewBox="0 0 44 44" fill="none">
|
|
15
|
+
<Rect width="44" height="44" rx="22" fill={color} fillOpacity={fillOpacity} />
|
|
16
|
+
<Path
|
|
17
|
+
d={QR_PATH}
|
|
18
|
+
stroke={color}
|
|
19
|
+
strokeWidth={strokeWidth}
|
|
20
|
+
strokeLinecap="round"
|
|
21
|
+
strokeLinejoin="round"
|
|
22
|
+
/>
|
|
23
|
+
</Svg>
|
|
24
|
+
);
|
|
25
|
+
}
|