@shopify/shop-minis-cli 0.0.35

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.
Files changed (152) hide show
  1. package/README.md +8 -0
  2. package/build/commands/create-mini/index.d.ts +2 -0
  3. package/build/commands/create-mini/index.js +116 -0
  4. package/build/commands/create-mini/index.js.map +1 -0
  5. package/build/commands/create-mini/utils/template-app.d.ts +1 -0
  6. package/build/commands/create-mini/utils/template-app.js +44 -0
  7. package/build/commands/create-mini/utils/template-app.js.map +1 -0
  8. package/build/commands/dev/index.d.ts +6 -0
  9. package/build/commands/dev/index.js +31 -0
  10. package/build/commands/dev/index.js.map +1 -0
  11. package/build/commands/dev/utils/android.d.ts +16 -0
  12. package/build/commands/dev/utils/android.js +165 -0
  13. package/build/commands/dev/utils/android.js.map +1 -0
  14. package/build/commands/dev/utils/binaries.d.ts +83 -0
  15. package/build/commands/dev/utils/binaries.js +173 -0
  16. package/build/commands/dev/utils/binaries.js.map +1 -0
  17. package/build/commands/dev/utils/binaries.test.d.ts +1 -0
  18. package/build/commands/dev/utils/binaries.test.js +275 -0
  19. package/build/commands/dev/utils/binaries.test.js.map +1 -0
  20. package/build/commands/dev/utils/deeplink.d.ts +3 -0
  21. package/build/commands/dev/utils/deeplink.js +30 -0
  22. package/build/commands/dev/utils/deeplink.js.map +1 -0
  23. package/build/commands/dev/utils/interactive-terminal.d.ts +23 -0
  24. package/build/commands/dev/utils/interactive-terminal.js +252 -0
  25. package/build/commands/dev/utils/interactive-terminal.js.map +1 -0
  26. package/build/commands/dev/utils/metro/metro-config.d.ts +2 -0
  27. package/build/commands/dev/utils/metro/metro-config.js +31 -0
  28. package/build/commands/dev/utils/metro/metro-config.js.map +1 -0
  29. package/build/commands/dev/utils/metro/metro-reporter.d.ts +14 -0
  30. package/build/commands/dev/utils/metro/metro-reporter.js +34 -0
  31. package/build/commands/dev/utils/metro/metro-reporter.js.map +1 -0
  32. package/build/commands/dev/utils/metro/metro-server-middleware.d.ts +6 -0
  33. package/build/commands/dev/utils/metro/metro-server-middleware.js +45 -0
  34. package/build/commands/dev/utils/metro/metro-server-middleware.js.map +1 -0
  35. package/build/commands/dev/utils/metro/metro-server.d.ts +2 -0
  36. package/build/commands/dev/utils/metro/metro-server.js +24 -0
  37. package/build/commands/dev/utils/metro/metro-server.js.map +1 -0
  38. package/build/commands/dev/utils/minis-manifest.d.ts +1 -0
  39. package/build/commands/dev/utils/minis-manifest.js +24 -0
  40. package/build/commands/dev/utils/minis-manifest.js.map +1 -0
  41. package/build/commands/dev/utils/qr-code.d.ts +1 -0
  42. package/build/commands/dev/utils/qr-code.js +12 -0
  43. package/build/commands/dev/utils/qr-code.js.map +1 -0
  44. package/build/commands/dev/utils/simulator.d.ts +19 -0
  45. package/build/commands/dev/utils/simulator.js +89 -0
  46. package/build/commands/dev/utils/simulator.js.map +1 -0
  47. package/build/commands/dev/utils/with-retries.d.ts +4 -0
  48. package/build/commands/dev/utils/with-retries.js +28 -0
  49. package/build/commands/dev/utils/with-retries.js.map +1 -0
  50. package/build/commands/generate-graphql-types/index.d.ts +5 -0
  51. package/build/commands/generate-graphql-types/index.js +90 -0
  52. package/build/commands/generate-graphql-types/index.js.map +1 -0
  53. package/build/commands/utils/exec-async-child-process.d.ts +18 -0
  54. package/build/commands/utils/exec-async-child-process.js +48 -0
  55. package/build/commands/utils/exec-async-child-process.js.map +1 -0
  56. package/build/commands/utils/wrap-with-loading-indicator.d.ts +9 -0
  57. package/build/commands/utils/wrap-with-loading-indicator.js +23 -0
  58. package/build/commands/utils/wrap-with-loading-indicator.js.map +1 -0
  59. package/build/dev-panel/images/bottomsheet.png +0 -0
  60. package/build/dev-panel/images/checkmark.svg +3 -0
  61. package/build/dev-panel/images/chevron.svg +3 -0
  62. package/build/dev-panel/images/copy.svg +4 -0
  63. package/build/dev-panel/images/get-started.svg +3 -0
  64. package/build/dev-panel/images/how-to.svg +3 -0
  65. package/build/dev-panel/images/navigation.png +0 -0
  66. package/build/dev-panel/images/references.svg +3 -0
  67. package/build/dev-panel/images/shop-minis-logo-inverse.svg +5 -0
  68. package/build/dev-panel/images/shop-minis-logo.svg +5 -0
  69. package/build/dev-panel/images/stories.png +0 -0
  70. package/build/dev-panel/images/topics.svg +3 -0
  71. package/build/dev-panel/index.html +302 -0
  72. package/build/dev-panel/middleware.d.ts +4 -0
  73. package/build/dev-panel/middleware.js +11 -0
  74. package/build/dev-panel/middleware.js.map +1 -0
  75. package/build/dev-panel/middleware.ts +6 -0
  76. package/build/dev-panel/styles.css +507 -0
  77. package/build/index.d.ts +2 -0
  78. package/build/index.js +26 -0
  79. package/build/index.js.map +1 -0
  80. package/package.json +83 -0
  81. package/templates/__template_blank/src/custom.d.ts +4 -0
  82. package/templates/__template_blank/src/index.tsx +9 -0
  83. package/templates/__template_blank/src/screens/HomeScreen.tsx +12 -0
  84. package/templates/__template_blank/src/types.ts +5 -0
  85. package/templates/__template_common/.eslintignore +1 -0
  86. package/templates/__template_common/.eslintrc.json +132 -0
  87. package/templates/__template_common/.prettierrc.json +8 -0
  88. package/templates/__template_common/babel.config.js +19 -0
  89. package/templates/__template_common/gitignore +3 -0
  90. package/templates/__template_common/index.tsx +43 -0
  91. package/templates/__template_common/metro.config.js +31 -0
  92. package/templates/__template_common/package.json +68 -0
  93. package/templates/__template_common/patches/react-native+0.68.5.patch +173 -0
  94. package/templates/__template_common/src/manifest.json +29 -0
  95. package/templates/__template_common/tsconfig.json +36 -0
  96. package/templates/__template_hello_world/src/assets/Modal-component-thumbnail.png +0 -0
  97. package/templates/__template_hello_world/src/assets/ProductCard-component-thumbnail.png +0 -0
  98. package/templates/__template_hello_world/src/assets/ProductLink-component-thumbnail.png +0 -0
  99. package/templates/__template_hello_world/src/assets/assets.d.ts +4 -0
  100. package/templates/__template_hello_world/src/assets/figma-logo.svg +14 -0
  101. package/templates/__template_hello_world/src/assets/shop-minis-logo.svg +7 -0
  102. package/templates/__template_hello_world/src/components/ButtonCTA.tsx +31 -0
  103. package/templates/__template_hello_world/src/components/ComponentLink.ts +70 -0
  104. package/templates/__template_hello_world/src/components/ComponentListItem.tsx +38 -0
  105. package/templates/__template_hello_world/src/components/FeaturedComponents.tsx +108 -0
  106. package/templates/__template_hello_world/src/components/Header.tsx +40 -0
  107. package/templates/__template_hello_world/src/data/Test.graphql +33 -0
  108. package/templates/__template_hello_world/src/data/Test.graphql.d.ts +114 -0
  109. package/templates/__template_hello_world/src/data/TestProducts.graphql +34 -0
  110. package/templates/__template_hello_world/src/data/TestProducts.graphql.d.ts +119 -0
  111. package/templates/__template_hello_world/src/index.tsx +9 -0
  112. package/templates/__template_hello_world/src/routes.tsx +107 -0
  113. package/templates/__template_hello_world/src/screens/AvatarScreen.tsx +95 -0
  114. package/templates/__template_hello_world/src/screens/BottomSheetScreen.tsx +711 -0
  115. package/templates/__template_hello_world/src/screens/ButtonsScreen.tsx +90 -0
  116. package/templates/__template_hello_world/src/screens/GridScreen.tsx +74 -0
  117. package/templates/__template_hello_world/src/screens/HomeScreen.tsx +70 -0
  118. package/templates/__template_hello_world/src/screens/IconsScreen.tsx +181 -0
  119. package/templates/__template_hello_world/src/screens/MediaScreen.tsx +130 -0
  120. package/templates/__template_hello_world/src/screens/ModalScreen.tsx +379 -0
  121. package/templates/__template_hello_world/src/screens/ProductCardGridScreen.tsx +68 -0
  122. package/templates/__template_hello_world/src/screens/ProductCardScreen.tsx +62 -0
  123. package/templates/__template_hello_world/src/screens/ProductLinkScreen.tsx +215 -0
  124. package/templates/__template_hello_world/src/screens/ProgressIndicatorScreen.tsx +77 -0
  125. package/templates/__template_hello_world/src/screens/QuantityPickerScreen.tsx +76 -0
  126. package/templates/__template_hello_world/src/screens/SpinnerScreen.tsx +63 -0
  127. package/templates/__template_hello_world/src/screens/TypographyScreen.tsx +274 -0
  128. package/templates/__template_hello_world/src/screens/WebViewScreen.tsx +42 -0
  129. package/templates/__template_hello_world/src/types.ts +25 -0
  130. package/templates/__template_snowboardz/src/assets/assets.d.ts +4 -0
  131. package/templates/__template_snowboardz/src/assets/circle-blue.svg +9 -0
  132. package/templates/__template_snowboardz/src/assets/circle-green.svg +9 -0
  133. package/templates/__template_snowboardz/src/assets/circle-purple.svg +9 -0
  134. package/templates/__template_snowboardz/src/assets/circle-rainbow.svg +34 -0
  135. package/templates/__template_snowboardz/src/assets/circle-red.svg +9 -0
  136. package/templates/__template_snowboardz/src/assets/circle-yellow.svg +9 -0
  137. package/templates/__template_snowboardz/src/assets/skill-level-icon-advanced.svg +3 -0
  138. package/templates/__template_snowboardz/src/assets/skill-level-icon-beginner.svg +3 -0
  139. package/templates/__template_snowboardz/src/assets/skill-level-icon-intermediate.svg +3 -0
  140. package/templates/__template_snowboardz/src/components/ColorButton.tsx +79 -0
  141. package/templates/__template_snowboardz/src/components/ColorPicker.tsx +40 -0
  142. package/templates/__template_snowboardz/src/components/EmptyResult.tsx +52 -0
  143. package/templates/__template_snowboardz/src/components/SkillLevelIcon.tsx +44 -0
  144. package/templates/__template_snowboardz/src/components/SkillLevelPicker.tsx +86 -0
  145. package/templates/__template_snowboardz/src/data/TestProducts.graphql +34 -0
  146. package/templates/__template_snowboardz/src/data/TestProducts.graphql.d.ts +108 -0
  147. package/templates/__template_snowboardz/src/hooks/useSnowboardData.tsx +37 -0
  148. package/templates/__template_snowboardz/src/index.tsx +9 -0
  149. package/templates/__template_snowboardz/src/routes.tsx +17 -0
  150. package/templates/__template_snowboardz/src/screens/HomeScreen.tsx +126 -0
  151. package/templates/__template_snowboardz/src/types.ts +12 -0
  152. package/templates/__template_snowboardz/src/utils.ts +17 -0
@@ -0,0 +1,274 @@
1
+ import {ComponentProps, useState} from 'react'
2
+ import {SafeAreaView, ScrollView} from 'react-native'
3
+ import {
4
+ Box,
5
+ Text,
6
+ IconButton,
7
+ ScrollViewBottomSheet,
8
+ useTheme,
9
+ } from '@shopify/shop-minis-platform-sdk'
10
+
11
+ import {Header} from '../components/Header'
12
+
13
+ interface SectionHeaderProps {
14
+ first?: boolean
15
+ title: string
16
+ }
17
+
18
+ interface DetailsBottomSheetProps {
19
+ fontFamily: string
20
+ fontSize: string
21
+ lineHeight: string
22
+ letterSpacing: string
23
+ onDismiss: ComponentProps<typeof ScrollViewBottomSheet>['onDismiss']
24
+ }
25
+
26
+ const DetailsBottomSheet = ({
27
+ fontFamily,
28
+ fontSize,
29
+ lineHeight,
30
+ letterSpacing,
31
+ onDismiss,
32
+ }: DetailsBottomSheetProps) => {
33
+ return (
34
+ <ScrollViewBottomSheet
35
+ onDismiss={onDismiss}
36
+ variant="header"
37
+ headerText="Details"
38
+ >
39
+ <Box padding="m">
40
+ {fontFamily ? <Text>fontFamily: {fontFamily} </Text> : null}
41
+ {fontSize ? <Text>fontSize: {fontSize}</Text> : null}
42
+ {lineHeight ? <Text>lineHeight: {lineHeight} </Text> : null}
43
+ {letterSpacing ? <Text>letterSpacing: {letterSpacing} </Text> : null}
44
+ </Box>
45
+ </ScrollViewBottomSheet>
46
+ )
47
+ }
48
+
49
+ const SectionHeader = ({title, first}: SectionHeaderProps) => (
50
+ <Box paddingTop="m" paddingBottom="xs">
51
+ {first ? null : (
52
+ <Box
53
+ height={1}
54
+ width="100%"
55
+ backgroundColor="borders-regular"
56
+ marginBottom="s"
57
+ />
58
+ )}
59
+ <Text variant="label">{title}</Text>
60
+ </Box>
61
+ )
62
+
63
+ const TextBox = ({children}: {children: React.ReactNode}) => (
64
+ <Box paddingBottom="xxxs" flexDirection="row" alignItems="center">
65
+ {children}
66
+ </Box>
67
+ )
68
+
69
+ export const TypographyScreen = () => {
70
+ const [sheetVisible, setSheetVisible] = useState(false)
71
+ const [fontFamily, setFontFamily] = useState('')
72
+ const [fontSize, setFontSize] = useState('')
73
+ const [letterSpacing, setLetterSpacing] = useState('')
74
+ const [lineHeight, setLineHeight] = useState('')
75
+
76
+ const theme = useTheme()
77
+
78
+ return (
79
+ <>
80
+ <SafeAreaView
81
+ style={{flex: 1, backgroundColor: theme.colors['backgrounds-regular']}}
82
+ >
83
+ <ScrollView style={{flex: 1}}>
84
+ <Header />
85
+ <Box px="gutter">
86
+ <Text variant="headerBold" mb="xs">
87
+ Typography
88
+ </Text>
89
+
90
+ <SectionHeader title="hero" first />
91
+ <TextBox key={1}>
92
+ <Text variant="heroBold">heroBold</Text>
93
+ <IconButton
94
+ variant="plain"
95
+ name="information"
96
+ onPress={() => {
97
+ setSheetVisible(true)
98
+ setFontFamily('fonts.display.bold')
99
+ setFontSize('36 (32 on smaller devices)')
100
+ setLineHeight('42 (38 on smaller devices)')
101
+ setLetterSpacing('-0.5')
102
+ }}
103
+ accessibilityLabel="heroBold"
104
+ />
105
+ </TextBox>
106
+ <TextBox key={2}>
107
+ <Text variant="heroNormal">heroNormal</Text>
108
+ <IconButton
109
+ variant="plain"
110
+ name="information"
111
+ onPress={() => {
112
+ setSheetVisible(true)
113
+ setFontFamily('fonts.display.medium')
114
+ setFontSize('36 (32 on smaller devices)')
115
+ setLineHeight('42 (38 on smaller devices)')
116
+ setLetterSpacing('-0.5')
117
+ }}
118
+ accessibilityLabel="heroNormal"
119
+ />
120
+ </TextBox>
121
+ <SectionHeader title="Body" />
122
+ <TextBox key={3}>
123
+ <Text variant="bodyTitleLarge">bodyTitleLarge</Text>
124
+ <IconButton
125
+ variant="plain"
126
+ name="information"
127
+ onPress={() => {
128
+ setSheetVisible(true)
129
+ setFontFamily('fonts.medium')
130
+ setFontSize('16 (14 on smaller devices)')
131
+ setLineHeight('22 (20 on smaller devices)')
132
+ }}
133
+ accessibilityLabel="bodyTitleLarge"
134
+ />
135
+ </TextBox>
136
+ <TextBox key={4}>
137
+ <Text variant="bodyTitleSmall">bodyTitleSmall</Text>
138
+ <IconButton
139
+ variant="plain"
140
+ name="information"
141
+ onPress={() => {
142
+ setSheetVisible(true)
143
+ setFontFamily('fonts.medium')
144
+ setFontSize('13 (12 on smaller devices)')
145
+ setLineHeight('18 (17 on smaller devices)')
146
+ }}
147
+ accessibilityLabel="bodyTitleLarge"
148
+ />
149
+ </TextBox>
150
+ <TextBox key={5}>
151
+ <Text variant="bodyLargeBold">bodyLargeBold</Text>
152
+ <IconButton
153
+ variant="plain"
154
+ name="information"
155
+ onPress={() => {
156
+ setSheetVisible(true)
157
+ setFontFamily('fonts.bold')
158
+ setFontSize('16 (14 on smaller devices)')
159
+ setLineHeight('22 (20 on smaller devices)')
160
+ }}
161
+ accessibilityLabel="bodyLargeBold"
162
+ />
163
+ </TextBox>
164
+ <TextBox key={6}>
165
+ <Text variant="bodyLarge" color="foregrounds-regular">
166
+ bodyLarge (default variant)
167
+ </Text>
168
+ <IconButton
169
+ variant="plain"
170
+ name="information"
171
+ onPress={() => {
172
+ setSheetVisible(true)
173
+ setFontFamily('fonts.regular')
174
+ setFontSize('16 (14 on smaller devices)')
175
+ setLineHeight('22 (20 on smaller devices)')
176
+ }}
177
+ accessibilityLabel="bodyLarge"
178
+ />
179
+ </TextBox>
180
+ <TextBox key={7}>
181
+ <Text style={{color: '#336699'}}>
182
+ bodyLarge with custom color
183
+ </Text>
184
+ <IconButton
185
+ variant="plain"
186
+ name="information"
187
+ onPress={() => {
188
+ setSheetVisible(true)
189
+ setFontFamily('fonts.regular')
190
+ setFontSize('16 (14 on smaller devices)')
191
+ setLineHeight('22 (20 on smaller devices)')
192
+ }}
193
+ accessibilityLabel="bodyLargeBold"
194
+ />
195
+ </TextBox>
196
+ <TextBox key={8}>
197
+ <Text variant="bodySmallBold">bodySmallBold</Text>
198
+ <IconButton
199
+ variant="plain"
200
+ name="information"
201
+ onPress={() => {
202
+ setSheetVisible(true)
203
+ setFontFamily('fonts.bold')
204
+ setFontSize('13 (12 on smaller devices)')
205
+ setLineHeight('18 (17 on smaller devices)')
206
+ }}
207
+ accessibilityLabel="bodySmallBold"
208
+ />
209
+ </TextBox>
210
+ <TextBox key={9}>
211
+ <Text variant="bodySmall">bodySmall</Text>
212
+ <IconButton
213
+ variant="plain"
214
+ name="information"
215
+ onPress={() => {
216
+ setSheetVisible(true)
217
+ setFontFamily('fonts.regular')
218
+ setFontSize('13 (12 on smaller devices)')
219
+ setLineHeight('18 (17 on smaller devices)')
220
+ }}
221
+ accessibilityLabel="bodySmall"
222
+ />
223
+ </TextBox>
224
+ <SectionHeader title="Caption" />
225
+ <TextBox key={10}>
226
+ <Text variant="captionBold">captionBold</Text>
227
+ <IconButton
228
+ variant="plain"
229
+ name="information"
230
+ onPress={() => {
231
+ setSheetVisible(true)
232
+ setFontFamily('fonts.bold')
233
+ setFontSize('12 (11 on smaller devices)')
234
+ setLineHeight('16 (15 on smaller devices)')
235
+ }}
236
+ accessibilityLabel="captionBold"
237
+ />
238
+ </TextBox>
239
+ <TextBox key={11}>
240
+ <Text variant="caption">caption</Text>
241
+ <IconButton
242
+ variant="plain"
243
+ name="information"
244
+ onPress={() => {
245
+ setSheetVisible(true)
246
+ setFontFamily('fonts.regular')
247
+ setFontSize('12 (11 on smaller devices)')
248
+ setLineHeight('16 (15 on smaller devices)')
249
+ }}
250
+ accessibilityLabel="caption"
251
+ />
252
+ </TextBox>
253
+ </Box>
254
+ </ScrollView>
255
+ </SafeAreaView>
256
+ {sheetVisible ? (
257
+ <DetailsBottomSheet
258
+ key="bottomsheet"
259
+ lineHeight={lineHeight}
260
+ fontFamily={fontFamily}
261
+ fontSize={fontSize}
262
+ letterSpacing={letterSpacing}
263
+ onDismiss={() => {
264
+ setSheetVisible(false)
265
+ setFontFamily('')
266
+ setFontSize('')
267
+ setLineHeight('')
268
+ setLetterSpacing('')
269
+ }}
270
+ />
271
+ ) : null}
272
+ </>
273
+ )
274
+ }
@@ -0,0 +1,42 @@
1
+ import {useRef} from 'react'
2
+ import {SafeAreaView} from 'react-native'
3
+ import {
4
+ Box,
5
+ Button,
6
+ WebView,
7
+ WebViewRef,
8
+ useTheme,
9
+ } from '@shopify/shop-minis-platform-sdk'
10
+
11
+ import {Header} from '../components/Header'
12
+
13
+ export const WebViewScreen = () => {
14
+ const ref = useRef<WebViewRef>(null)
15
+ const theme = useTheme()
16
+
17
+ return (
18
+ <SafeAreaView
19
+ style={{flex: 1, backgroundColor: theme.colors['backgrounds-regular']}}
20
+ >
21
+ <Header />
22
+ <WebView
23
+ ref={ref}
24
+ originAllowlist={['https://shop.app*']}
25
+ source={{uri: 'https://shop.app'}}
26
+ style={{
27
+ width: '100%',
28
+ height: '100%',
29
+ }}
30
+ />
31
+
32
+ <Box
33
+ position="absolute"
34
+ bottom={32}
35
+ width="100%"
36
+ paddingHorizontal="gutter"
37
+ >
38
+ <Button onPress={() => ref.current?.reload()} text="Reload WebView" />
39
+ </Box>
40
+ </SafeAreaView>
41
+ )
42
+ }
@@ -0,0 +1,25 @@
1
+ // @react-navigation/native-stack requires a `type` instead of an `interface`
2
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions
3
+ export type StackParamList = {
4
+ '__MINI_APP_HANDLE_PASCAL_CASE__.Home': undefined
5
+ '__MINI_APP_HANDLE_PASCAL_CASE__.Modal': undefined
6
+ '__MINI_APP_HANDLE_PASCAL_CASE__.ProductCard': undefined
7
+ '__MINI_APP_HANDLE_PASCAL_CASE__.ProductCardGrid': undefined
8
+ '__MINI_APP_HANDLE_PASCAL_CASE__.ProductLink': undefined
9
+ '__MINI_APP_HANDLE_PASCAL_CASE__.Typography': undefined
10
+ '__MINI_APP_HANDLE_PASCAL_CASE__.BottomSheet': undefined
11
+ '__MINI_APP_HANDLE_PASCAL_CASE__.Buttons': undefined
12
+ '__MINI_APP_HANDLE_PASCAL_CASE__.Icons': undefined
13
+ '__MINI_APP_HANDLE_PASCAL_CASE__.Media': undefined
14
+ '__MINI_APP_HANDLE_PASCAL_CASE__.QuantityPicker': undefined
15
+ '__MINI_APP_HANDLE_PASCAL_CASE__.WebView': undefined
16
+ '__MINI_APP_HANDLE_PASCAL_CASE__.Query': undefined
17
+ '__MINI_APP_HANDLE_PASCAL_CASE__.ShopActions': undefined
18
+ '__MINI_APP_HANDLE_PASCAL_CASE__.Html': undefined
19
+ '__MINI_APP_HANDLE_PASCAL_CASE__.Params': undefined
20
+ '__MINI_APP_HANDLE_PASCAL_CASE__.ProgressIndicator': undefined
21
+ '__MINI_APP_HANDLE_PASCAL_CASE__.Spinner': undefined
22
+ '__MINI_APP_HANDLE_PASCAL_CASE__.Grid': undefined
23
+ '__MINI_APP_HANDLE_PASCAL_CASE__.Avatar': undefined
24
+ '__MINI_APP_HANDLE_PASCAL_CASE__.KeyboardAvoidingView': undefined
25
+ }
@@ -0,0 +1,4 @@
1
+ declare module '*.svg' {
2
+ const content: any
3
+ export default content
4
+ }
@@ -0,0 +1,9 @@
1
+ <svg width="41" height="40" viewBox="0 0 41 40" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <rect x="0.199997" width="40" height="40" rx="20" fill="url(#paint0_linear_277_3614)"/>
3
+ <defs>
4
+ <linearGradient id="paint0_linear_277_3614" x1="20.2" y1="0" x2="20.2" y2="40" gradientUnits="userSpaceOnUse">
5
+ <stop stop-color="#8ACDFD"/>
6
+ <stop offset="1" stop-color="#3D5EEA"/>
7
+ </linearGradient>
8
+ </defs>
9
+ </svg>
@@ -0,0 +1,9 @@
1
+ <svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <rect width="40" height="40" rx="20" fill="url(#paint0_linear_277_3611)"/>
3
+ <defs>
4
+ <linearGradient id="paint0_linear_277_3611" x1="20" y1="0" x2="20" y2="40" gradientUnits="userSpaceOnUse">
5
+ <stop stop-color="#2CCB29"/>
6
+ <stop offset="1" stop-color="#23B7AE"/>
7
+ </linearGradient>
8
+ </defs>
9
+ </svg>
@@ -0,0 +1,9 @@
1
+ <svg width="41" height="40" viewBox="0 0 41 40" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <rect x="0.399994" width="40" height="40" rx="20" fill="url(#paint0_linear_277_3612)"/>
3
+ <defs>
4
+ <linearGradient id="paint0_linear_277_3612" x1="20.4" y1="0" x2="20.4" y2="40" gradientUnits="userSpaceOnUse">
5
+ <stop stop-color="#CE9CE4"/>
6
+ <stop offset="1" stop-color="#6D41CB"/>
7
+ </linearGradient>
8
+ </defs>
9
+ </svg>
@@ -0,0 +1,34 @@
1
+ <svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g clip-path="url(#clip0_277_3873)">
3
+ <circle cx="20" cy="20" r="20" transform="rotate(-180 20 20)" fill="#FFB7D8"/>
4
+ <circle cx="20" cy="20" r="17" transform="rotate(-180 20 20)" fill="#750CD6"/>
5
+ <circle cx="20" cy="20" r="14" transform="rotate(-180 20 20)" fill="#0098DB"/>
6
+ <circle cx="20" cy="20" r="11" transform="rotate(-180 20 20)" fill="#78C301"/>
7
+ <circle cx="20" cy="20" r="8" transform="rotate(-180 20 20)" fill="#F5CF3E"/>
8
+ <circle cx="20" cy="20" r="5" transform="rotate(-180 20 20)" fill="#FE6C37"/>
9
+ <circle cx="20" cy="20" r="2" transform="rotate(-180 20 20)" fill="#DE2826"/>
10
+ <rect x="40" y="20" width="3" height="21" transform="rotate(-180 40 20)" fill="#FFB7D8"/>
11
+ <rect x="3" y="20" width="3" height="21" transform="rotate(-180 3 20)" fill="#FFB7D8"/>
12
+ <rect x="37" y="20" width="3" height="21" transform="rotate(-180 37 20)" fill="#750CD6"/>
13
+ <rect x="6" y="20" width="3" height="21" transform="rotate(-180 6 20)" fill="#750CD6"/>
14
+ <rect x="34" y="20" width="3" height="21" transform="rotate(-180 34 20)" fill="#0098DB"/>
15
+ <rect x="9" y="20" width="3" height="21" transform="rotate(-180 9 20)" fill="#0098DB"/>
16
+ <rect x="31" y="20" width="3" height="21" transform="rotate(-180 31 20)" fill="#78C301"/>
17
+ <rect x="12" y="20" width="3" height="21" transform="rotate(-180 12 20)" fill="#78C301"/>
18
+ <rect x="28" y="20" width="3" height="21" transform="rotate(-180 28 20)" fill="#F5CF3E"/>
19
+ <rect x="15" y="20" width="3" height="21" transform="rotate(-180 15 20)" fill="#F5CF3E"/>
20
+ <rect x="25" y="20" width="3" height="21" transform="rotate(-180 25 20)" fill="#FE6C37"/>
21
+ <rect x="18" y="20" width="3" height="21" transform="rotate(-180 18 20)" fill="#FE6C37"/>
22
+ <rect x="22" y="20" width="4" height="21" transform="rotate(-180 22 20)" fill="#DE2826"/>
23
+ <rect width="40" height="40" fill="url(#paint0_linear_277_3873)"/>
24
+ </g>
25
+ <defs>
26
+ <linearGradient id="paint0_linear_277_3873" x1="20" y1="0" x2="20" y2="40" gradientUnits="userSpaceOnUse">
27
+ <stop stop-opacity="0"/>
28
+ <stop offset="1" stop-opacity="0.2"/>
29
+ </linearGradient>
30
+ <clipPath id="clip0_277_3873">
31
+ <rect x="40" y="40" width="40" height="40" rx="20" transform="rotate(-180 40 40)" fill="white"/>
32
+ </clipPath>
33
+ </defs>
34
+ </svg>
@@ -0,0 +1,9 @@
1
+ <svg width="41" height="40" viewBox="0 0 41 40" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <rect x="0.599991" width="40" height="40" rx="20" fill="url(#paint0_linear_277_3615)"/>
3
+ <defs>
4
+ <linearGradient id="paint0_linear_277_3615" x1="20.6" y1="0" x2="20.6" y2="40" gradientUnits="userSpaceOnUse">
5
+ <stop stop-color="#EF6767"/>
6
+ <stop offset="1" stop-color="#731D4B"/>
7
+ </linearGradient>
8
+ </defs>
9
+ </svg>
@@ -0,0 +1,9 @@
1
+ <svg width="41" height="40" viewBox="0 0 41 40" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <rect x="0.800003" width="40" height="40" rx="20" fill="url(#paint0_linear_277_3613)"/>
3
+ <defs>
4
+ <linearGradient id="paint0_linear_277_3613" x1="20.8" y1="0" x2="20.8" y2="40" gradientUnits="userSpaceOnUse">
5
+ <stop stop-color="#E8D846"/>
6
+ <stop offset="1" stop-color="#968C34"/>
7
+ </linearGradient>
8
+ </defs>
9
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <rect y="8" width="11" height="11" transform="rotate(-45 0 8)" fill="black"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <circle cx="8" cy="8" r="8" fill="#008552"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <rect width="14" height="14" fill="#33A9EB"/>
3
+ </svg>
@@ -0,0 +1,79 @@
1
+ import {Box, Text} from '@shopify/shop-minis-platform-sdk'
2
+ import {StyleSheet, TouchableOpacity} from 'react-native'
3
+
4
+ import CircleGreen from '../assets/circle-green.svg'
5
+ import CirclePurple from '../assets/circle-purple.svg'
6
+ import CircleYellow from '../assets/circle-yellow.svg'
7
+ import CircleBlue from '../assets/circle-blue.svg'
8
+ import CircleRed from '../assets/circle-red.svg'
9
+ import CircleRainbow from '../assets/circle-rainbow.svg'
10
+
11
+ const colorMap = {
12
+ green: CircleGreen,
13
+ purple: CirclePurple,
14
+ yellow: CircleYellow,
15
+ blue: CircleBlue,
16
+ red: CircleRed,
17
+ }
18
+
19
+ interface Props {
20
+ onPress: () => void
21
+ color: string
22
+ selected?: boolean
23
+ isResetButton?: boolean
24
+ }
25
+ export const ColorButton = ({
26
+ onPress,
27
+ color,
28
+ selected,
29
+ isResetButton,
30
+ }: Props) => {
31
+ const ColoredCircle = colorMap[color as keyof typeof colorMap]
32
+
33
+ if (isResetButton) {
34
+ return (
35
+ <TouchableOpacity onPress={onPress}>
36
+ <Box style={[styles.circleContainer]}>
37
+ {selected ? null : (
38
+ <Text
39
+ variant="bodySmall"
40
+ color="foregrounds-primary"
41
+ style={styles.resetText}
42
+ >
43
+ Reset
44
+ </Text>
45
+ )}
46
+ <CircleRainbow />
47
+ </Box>
48
+ </TouchableOpacity>
49
+ )
50
+ }
51
+
52
+ if (!ColoredCircle) return null
53
+
54
+ return (
55
+ <>
56
+ <TouchableOpacity onPress={onPress}>
57
+ <Box style={[styles.circleContainer, selected && styles.selected]}>
58
+ <ColoredCircle />
59
+ </Box>
60
+ </TouchableOpacity>
61
+ </>
62
+ )
63
+ }
64
+
65
+ const styles = StyleSheet.create({
66
+ circleContainer: {
67
+ padding: 2,
68
+ borderWidth: 2,
69
+ borderRadius: 100,
70
+ borderColor: 'transparent',
71
+ },
72
+ selected: {
73
+ borderColor: 'black',
74
+ },
75
+ resetText: {
76
+ position: 'absolute',
77
+ top: -24,
78
+ },
79
+ })
@@ -0,0 +1,40 @@
1
+ import {Box, Text} from '@shopify/shop-minis-platform-sdk'
2
+
3
+ import {ColorButton} from './ColorButton'
4
+
5
+ interface ColorPickerProps {
6
+ handleSelectedColor: (handleSelectedColor: string | null) => void
7
+ selectedColor: string | null
8
+ snowboardColors: string[]
9
+ }
10
+ export const ColorPicker = ({
11
+ handleSelectedColor,
12
+ selectedColor,
13
+ snowboardColors,
14
+ }: ColorPickerProps) => {
15
+ if (!snowboardColors || snowboardColors.length < 1) {
16
+ return null
17
+ }
18
+
19
+ return (
20
+ <>
21
+ <Text marginBottom="xs">Select color</Text>
22
+ <Box justifyContent="space-between" flexDirection="row">
23
+ {snowboardColors.map(color => (
24
+ <ColorButton
25
+ selected={selectedColor === color}
26
+ key={color}
27
+ color={color}
28
+ onPress={() => handleSelectedColor(color)}
29
+ />
30
+ ))}
31
+ <ColorButton
32
+ selected={!selectedColor}
33
+ color="Reset"
34
+ isResetButton
35
+ onPress={() => handleSelectedColor(null)}
36
+ />
37
+ </Box>
38
+ </>
39
+ )
40
+ }
@@ -0,0 +1,52 @@
1
+ import {Box, Button, Text, theme} from '@shopify/shop-minis-platform-sdk'
2
+ import {useMemo} from 'react'
3
+
4
+ import {SkillLevel} from '../types'
5
+
6
+ interface Props {
7
+ selectedColor: string | null
8
+ selectedSkillLevel: SkillLevel | null
9
+ handleFilterReset: () => void
10
+ }
11
+
12
+ export const EmptyResult = ({
13
+ selectedColor,
14
+ selectedSkillLevel,
15
+ handleFilterReset,
16
+ }: Props) => {
17
+ const feedback = useMemo(() => {
18
+ if (selectedColor && selectedSkillLevel) {
19
+ return `No ${selectedColor} boards for ${selectedSkillLevel.toLowerCase()} riders`
20
+ }
21
+ if (!selectedColor && selectedSkillLevel) {
22
+ return `No boards for ${selectedSkillLevel.toLowerCase()} riders`
23
+ }
24
+ if (selectedColor && !selectedSkillLevel) {
25
+ return `No ${selectedColor} boards`
26
+ }
27
+ if (!selectedColor && !selectedSkillLevel) {
28
+ return 'No boards'
29
+ }
30
+ }, [selectedColor, selectedSkillLevel])
31
+
32
+ const showResetButton = useMemo(() => {
33
+ return selectedColor || selectedSkillLevel
34
+ }, [selectedColor, selectedSkillLevel])
35
+
36
+ return (
37
+ <Box paddingVertical="l" justifyContent="center" alignContent="center">
38
+ <Text variant="heroNormal" textAlign="center" marginBottom="m">
39
+ {feedback} :&apos;-(
40
+ </Text>
41
+ {showResetButton ? (
42
+ <Button
43
+ style={{
44
+ marginHorizontal: theme.spacing.gutter,
45
+ }}
46
+ text="Reset Filters"
47
+ onPress={handleFilterReset}
48
+ />
49
+ ) : null}
50
+ </Box>
51
+ )
52
+ }
@@ -0,0 +1,44 @@
1
+ import {StyleSheet} from 'react-native'
2
+ import {Box} from '@shopify/shop-minis-platform-sdk'
3
+
4
+ import AdvancedIcon from '../assets/skill-level-icon-advanced.svg'
5
+ import BeginnerIcon from '../assets/skill-level-icon-beginner.svg'
6
+ import IntermediateIcon from '../assets/skill-level-icon-intermediate.svg'
7
+ import {SkillLevel} from '../types'
8
+
9
+ interface LevelIconProps {
10
+ level: SkillLevel
11
+ }
12
+ export const SkillLevelIcon = ({level}: LevelIconProps) => {
13
+ let Icon
14
+
15
+ switch (level) {
16
+ case 'Beginner':
17
+ Icon = BeginnerIcon
18
+ break
19
+ case 'Intermediate':
20
+ Icon = IntermediateIcon
21
+ break
22
+ case 'Advanced':
23
+ Icon = AdvancedIcon
24
+ break
25
+ default:
26
+ Icon = null
27
+ break
28
+ }
29
+
30
+ return (
31
+ <Box style={styles.iconWrapper}>
32
+ <Icon />
33
+ </Box>
34
+ )
35
+ }
36
+
37
+ const styles = StyleSheet.create({
38
+ iconWrapper: {
39
+ position: 'absolute',
40
+ left: 14,
41
+ width: 16,
42
+ height: 16,
43
+ },
44
+ })