@stackshift-ui/navigation 6.0.3 → 6.0.4
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/package.json +11 -10
- package/src/helper/blockStyle.tsx +37 -0
- package/src/helper/index.ts +14 -0
- package/src/index.ts +9 -0
- package/src/navigation.test.tsx +13 -0
- package/src/navigation.tsx +45 -0
- package/src/navigation_a.tsx +259 -0
- package/src/navigation_b.tsx +250 -0
- package/src/navigation_c.tsx +252 -0
- package/src/navigation_d.tsx +252 -0
- package/src/navigation_e.tsx +476 -0
- package/src/types.ts +418 -0
package/src/types.ts
ADDED
|
@@ -0,0 +1,418 @@
|
|
|
1
|
+
import { PortableTextComponents } from "@portabletext/react";
|
|
2
|
+
|
|
3
|
+
export type StyleVariants<T extends string> = Record<T, string>;
|
|
4
|
+
|
|
5
|
+
export type Socials = "facebook" | "instagram" | "youtube" | "linkedin" | "twitter";
|
|
6
|
+
export interface MainImage {
|
|
7
|
+
image: string;
|
|
8
|
+
alt?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface LabeledRoute extends ConditionalLink {
|
|
12
|
+
ariaLabel?: string;
|
|
13
|
+
label?: string;
|
|
14
|
+
linkTarget?: string;
|
|
15
|
+
linkType?: string;
|
|
16
|
+
_type?: string;
|
|
17
|
+
linkInternal?: any;
|
|
18
|
+
}
|
|
19
|
+
export interface ConditionalLink {
|
|
20
|
+
type?: string;
|
|
21
|
+
internalLink?: string | null;
|
|
22
|
+
externalLink?: string | null;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface StatItems {
|
|
26
|
+
label?: string;
|
|
27
|
+
mainImage?: MainImage;
|
|
28
|
+
value?: string;
|
|
29
|
+
_key?: string;
|
|
30
|
+
_type?: string;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface Logo extends ConditionalLink {
|
|
34
|
+
alt?: string;
|
|
35
|
+
linkTarget?: string;
|
|
36
|
+
image?: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface Images {
|
|
40
|
+
image?: string;
|
|
41
|
+
_key?: string;
|
|
42
|
+
_type?: string;
|
|
43
|
+
alt?: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface ContactDetails {
|
|
47
|
+
addressInfo?: string;
|
|
48
|
+
contactInfo?: string;
|
|
49
|
+
emailInfo?: string;
|
|
50
|
+
_key?: string;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface SocialLink {
|
|
54
|
+
socialMedia?: string | null;
|
|
55
|
+
socialMediaLink?: string | null;
|
|
56
|
+
_key?: string | null;
|
|
57
|
+
_type?: string | null;
|
|
58
|
+
socialMediaIcon?: {
|
|
59
|
+
alt?: string;
|
|
60
|
+
image?: string;
|
|
61
|
+
} | null;
|
|
62
|
+
socialMediaPlatform?: string | null;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface LabeledRouteWithKey extends LabeledRoute {
|
|
66
|
+
_key?: string;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export interface ArrayOfImageTitleAndText {
|
|
70
|
+
mainImage?: {
|
|
71
|
+
alt?: string;
|
|
72
|
+
image?: string;
|
|
73
|
+
};
|
|
74
|
+
plainText?: string;
|
|
75
|
+
title?: string;
|
|
76
|
+
_key?: string;
|
|
77
|
+
_type?: string;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export interface FeaturedItem {
|
|
81
|
+
description?: string;
|
|
82
|
+
mainImage?: MainImage;
|
|
83
|
+
title?: string;
|
|
84
|
+
subtitle?: string;
|
|
85
|
+
_key?: string;
|
|
86
|
+
_type?: string;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export interface ArrayOfTitleAndText {
|
|
90
|
+
_key?: string;
|
|
91
|
+
plainText?: string;
|
|
92
|
+
title?: string;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export interface BlogPost extends SanityBody {
|
|
96
|
+
authors?: Author[] | null;
|
|
97
|
+
body?: any;
|
|
98
|
+
categories?: Category[] | null;
|
|
99
|
+
excerpt?: string | null;
|
|
100
|
+
link?: string | null;
|
|
101
|
+
mainImage?: string | null;
|
|
102
|
+
publishedAt?: string;
|
|
103
|
+
seo?: Seo | null;
|
|
104
|
+
slug?: SanitySlug | null;
|
|
105
|
+
title?: string;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export interface Seo {
|
|
109
|
+
_type?: string;
|
|
110
|
+
seoTitle?: string;
|
|
111
|
+
seoDescription?: string;
|
|
112
|
+
seoImage?: string;
|
|
113
|
+
seoKeywords?: string;
|
|
114
|
+
seoSynonyms?: string;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export interface SanitySlug {
|
|
118
|
+
current?: string;
|
|
119
|
+
_type?: "slug";
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export interface SanityBody {
|
|
123
|
+
_createdAt?: string;
|
|
124
|
+
_id?: string;
|
|
125
|
+
_rev?: string;
|
|
126
|
+
_type?: string;
|
|
127
|
+
_updatedAt?: string;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export interface Author extends SanityBody {
|
|
131
|
+
link?: string | null;
|
|
132
|
+
bio?: string | null;
|
|
133
|
+
name?: string | null;
|
|
134
|
+
slug?: SanitySlug | null;
|
|
135
|
+
image?: string | null;
|
|
136
|
+
profile?: {
|
|
137
|
+
alt: string;
|
|
138
|
+
image: string;
|
|
139
|
+
} | null;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export interface Category extends SanityBody {
|
|
143
|
+
title?: string;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export interface Form {
|
|
147
|
+
id?: string | null;
|
|
148
|
+
buttonLabel?: string | null;
|
|
149
|
+
name?: string | null;
|
|
150
|
+
subtitle?: string | null;
|
|
151
|
+
fields?: FormFields[] | null;
|
|
152
|
+
thankYouPage?: ThankYouPage | null;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export interface FormFields {
|
|
156
|
+
name?: string;
|
|
157
|
+
placeholder?: string;
|
|
158
|
+
pricingType?: string;
|
|
159
|
+
type?: FormTypes;
|
|
160
|
+
_key?: string;
|
|
161
|
+
_type?: string;
|
|
162
|
+
isRequired?: boolean;
|
|
163
|
+
label?: string;
|
|
164
|
+
items?: string[];
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export type FormTypes =
|
|
168
|
+
| "inputText"
|
|
169
|
+
| "inputEmail"
|
|
170
|
+
| "inputPassword"
|
|
171
|
+
| "inputNumber"
|
|
172
|
+
| "textarea"
|
|
173
|
+
| "inputFile"
|
|
174
|
+
| "inputRadio"
|
|
175
|
+
| "inputCheckbox"
|
|
176
|
+
| "inputSelect";
|
|
177
|
+
|
|
178
|
+
export interface ThankYouPage {
|
|
179
|
+
externalLink?: string | null;
|
|
180
|
+
internalLink?: string | null;
|
|
181
|
+
linkInternal?: any;
|
|
182
|
+
linkTarget?: string;
|
|
183
|
+
linkType?: string;
|
|
184
|
+
type?: string;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
//Used on different sections
|
|
188
|
+
export interface SectionsProps {
|
|
189
|
+
template?: Template;
|
|
190
|
+
data?: Sections;
|
|
191
|
+
variant?: string | null | undefined;
|
|
192
|
+
schema?: Variants;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
export interface Sections extends SanityBody {
|
|
196
|
+
label?: string;
|
|
197
|
+
variant?: string;
|
|
198
|
+
variants?: Variants;
|
|
199
|
+
_key?: string;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
//*EDIT THIS SECTION WHEN CREATING/UPDATING SCHEMAS ON STUDIO */
|
|
203
|
+
export interface Variants {
|
|
204
|
+
template?: Template;
|
|
205
|
+
multipleMenus?: any;
|
|
206
|
+
arrayOfTitleAndText?: ArrayOfTitleAndText[] | null;
|
|
207
|
+
logo?: Logo | null;
|
|
208
|
+
primaryButton?: LabeledRoute | null;
|
|
209
|
+
secondaryButton?: LabeledRoute | null;
|
|
210
|
+
routes?: LabeledRouteWithKey[] | null;
|
|
211
|
+
menu?: LabeledRouteWithKey[] | null;
|
|
212
|
+
plans?: Plans[] | null;
|
|
213
|
+
formLinks?: LabeledRouteWithKey[] | null;
|
|
214
|
+
portfolios?: Portfolios[] | null;
|
|
215
|
+
portfoliosWithCategories?: PortfoliosWithCategories[] | null;
|
|
216
|
+
length?: number;
|
|
217
|
+
signInLink?: LabeledRoute | null;
|
|
218
|
+
signinLink?: LabeledRoute | null;
|
|
219
|
+
tags?: string[] | null;
|
|
220
|
+
posts?: BlogPost[] | null;
|
|
221
|
+
blogsPerPage?: number | null;
|
|
222
|
+
form?: Form | null;
|
|
223
|
+
collections?: Collection | null;
|
|
224
|
+
products?: CollectionProduct | null;
|
|
225
|
+
allProducts?: Collection[];
|
|
226
|
+
subtitle?: string | null;
|
|
227
|
+
caption?: string | null;
|
|
228
|
+
title?: string | null;
|
|
229
|
+
plainText?: string | null;
|
|
230
|
+
contactDescription?: string | null;
|
|
231
|
+
officeInformation?: string | null;
|
|
232
|
+
contactEmail?: string | null;
|
|
233
|
+
contactNumber?: string | null;
|
|
234
|
+
socialLinks?: SocialLink[] | null;
|
|
235
|
+
block?: any;
|
|
236
|
+
heading?: string | null;
|
|
237
|
+
acceptButtonLabel?: string | null;
|
|
238
|
+
declineButtonLabel?: string | null;
|
|
239
|
+
faqsWithCategories?: FaqsWithCategory[] | null;
|
|
240
|
+
faqs?: AskedQuestion[] | null;
|
|
241
|
+
arrayOfImageTitleAndText?: ArrayOfImageTitleAndText[] | null;
|
|
242
|
+
description?: string | null;
|
|
243
|
+
featuredItems?: FeaturedItem[] | null;
|
|
244
|
+
images?: Images[] | null;
|
|
245
|
+
contactDetails?: ContactDetails[] | null;
|
|
246
|
+
copyright?: string | null;
|
|
247
|
+
mainImage?: MainImage | null;
|
|
248
|
+
youtubeLink?: string | null;
|
|
249
|
+
banner?: any;
|
|
250
|
+
stats?: StatItems[] | null;
|
|
251
|
+
teams?: Team[] | null;
|
|
252
|
+
testimonials?: Testimonial[] | null;
|
|
253
|
+
selectStripeAccount?: string;
|
|
254
|
+
annualBilling?: string;
|
|
255
|
+
monthlyBilling?: string;
|
|
256
|
+
productDetails?: ProductDetail[];
|
|
257
|
+
btnLabel?: string;
|
|
258
|
+
selectAccount?: string;
|
|
259
|
+
hashtags?: string[];
|
|
260
|
+
numberOfPosts?: number;
|
|
261
|
+
text?: string;
|
|
262
|
+
button?: LabeledRoute;
|
|
263
|
+
features?: string[];
|
|
264
|
+
config?: {
|
|
265
|
+
enableAnalytics: boolean;
|
|
266
|
+
cookiePolicy?: {
|
|
267
|
+
siteName: string;
|
|
268
|
+
cookiePolicyPage: Reference;
|
|
269
|
+
};
|
|
270
|
+
consentModalPosition?: string;
|
|
271
|
+
};
|
|
272
|
+
contactLink?: LabeledRoute;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
export interface Template {
|
|
276
|
+
bg?: string;
|
|
277
|
+
color?: string;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
export type Plans = {
|
|
281
|
+
_key?: string | null;
|
|
282
|
+
_type?: "planItems" | null;
|
|
283
|
+
checkoutButtonName?: string | null;
|
|
284
|
+
description?: string | null;
|
|
285
|
+
monthlyPrice?: string | null;
|
|
286
|
+
planType?: string | null;
|
|
287
|
+
yearlyPrice?: string | null;
|
|
288
|
+
planIncludes?: string[] | null;
|
|
289
|
+
primaryButton?: LabeledRoute | null;
|
|
290
|
+
} & Record<string, string>;
|
|
291
|
+
|
|
292
|
+
export interface Portfolios {
|
|
293
|
+
dateAdded?: string | null;
|
|
294
|
+
mainImage?: {
|
|
295
|
+
image?: string | null;
|
|
296
|
+
alt?: string | null;
|
|
297
|
+
} | null;
|
|
298
|
+
primaryButton?: LabeledRoute | null;
|
|
299
|
+
title?: string | null;
|
|
300
|
+
_key?: string | null;
|
|
301
|
+
_type?: string | null;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
export interface PortfoliosWithCategories {
|
|
305
|
+
category?: string | null;
|
|
306
|
+
content?: Content[] | null;
|
|
307
|
+
primaryButton?: LabeledRoute | null;
|
|
308
|
+
_key?: string | null;
|
|
309
|
+
_type?: string | null;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
export interface Content extends Portfolios {
|
|
313
|
+
description?: string | null;
|
|
314
|
+
subtitle?: string | null;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
export interface Collection extends SanityBody {
|
|
318
|
+
collectionInfoVariant?: {
|
|
319
|
+
variant?: string;
|
|
320
|
+
} | null;
|
|
321
|
+
name?: string | null;
|
|
322
|
+
products?: CollectionProduct[] | null;
|
|
323
|
+
sections?: any; //todo
|
|
324
|
+
seo?: Seo | null;
|
|
325
|
+
slug?: SanitySlug | null;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
export interface CollectionProduct extends SanityBody {
|
|
329
|
+
compareToPrice?: number | null;
|
|
330
|
+
description?: string | null;
|
|
331
|
+
ecwidProductId?: number | null;
|
|
332
|
+
name?: string | null;
|
|
333
|
+
price?: number | null;
|
|
334
|
+
productInfo?: ProductInfo | null;
|
|
335
|
+
productInfoVariant?: {
|
|
336
|
+
variant?: string;
|
|
337
|
+
} | null;
|
|
338
|
+
sections?: any; //todo
|
|
339
|
+
seo?: Seo | null;
|
|
340
|
+
slug?: SanitySlug | null;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
//TODO, RECHECK PRODUCT INFO DATA FROM SANITY
|
|
344
|
+
interface ProductInfo {
|
|
345
|
+
btnLabel?: string | null;
|
|
346
|
+
images?: ProductInfoImage[] | null;
|
|
347
|
+
productDetails?: ProductDetail[] | null;
|
|
348
|
+
socialLinks?: SocialLink[] | null;
|
|
349
|
+
subtitle?: string | null;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
//TODO, RECHECK PRODUCT INFO DATA FROM SANITY
|
|
353
|
+
export interface ProductDetail {
|
|
354
|
+
blockContent?: any;
|
|
355
|
+
contentType?: string;
|
|
356
|
+
tabName?: string;
|
|
357
|
+
_key?: string;
|
|
358
|
+
[key: string]: any;
|
|
359
|
+
}
|
|
360
|
+
interface ProductInfoImage {
|
|
361
|
+
alt?: string | null;
|
|
362
|
+
_key: string;
|
|
363
|
+
_type: string;
|
|
364
|
+
image?: string | null;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
export interface FaqsWithCategory {
|
|
368
|
+
askedQuestions?: AskedQuestion[] | null;
|
|
369
|
+
category?: string | null;
|
|
370
|
+
_key?: string;
|
|
371
|
+
_type?: string;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
export interface AskedQuestion {
|
|
375
|
+
answer?: string | null;
|
|
376
|
+
question?: string | null;
|
|
377
|
+
hidden?: boolean;
|
|
378
|
+
_key?: string;
|
|
379
|
+
_type?: string;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
export interface Team {
|
|
383
|
+
jobTitle?: string;
|
|
384
|
+
mainImage?: MainImage;
|
|
385
|
+
name?: string;
|
|
386
|
+
plainText?: string;
|
|
387
|
+
_key?: string;
|
|
388
|
+
_type?: string;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
export interface Testimonial {
|
|
392
|
+
jobTitle?: string;
|
|
393
|
+
mainImage?: MainImage;
|
|
394
|
+
name?: string;
|
|
395
|
+
rating?: string;
|
|
396
|
+
testimony?: string;
|
|
397
|
+
_key?: string;
|
|
398
|
+
_type?: string;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
export declare interface Reference {
|
|
402
|
+
_type: string;
|
|
403
|
+
_ref: string;
|
|
404
|
+
_key?: string;
|
|
405
|
+
_weak?: boolean;
|
|
406
|
+
_strengthenOnPublish?: {
|
|
407
|
+
type: string;
|
|
408
|
+
weak?: boolean;
|
|
409
|
+
template?: {
|
|
410
|
+
id: string;
|
|
411
|
+
params: Record<string, string | number | boolean>;
|
|
412
|
+
};
|
|
413
|
+
};
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
export type MyPortableTextComponents = PortableTextComponents & {
|
|
417
|
+
code?: ({ value }: { value: { language?: string; code?: string } }) => JSX.Element;
|
|
418
|
+
};
|