@razorpay/blade 8.2.2 → 8.3.0

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.
@@ -0,0 +1,1210 @@
1
+ declare type BorderRadius$1 = Readonly<{
2
+ /** none: 0(px/rem/pt) */
3
+ none: 0;
4
+ /** small: 2(px/rem/pt) */
5
+ small: 2;
6
+ /** medium: 4(px/rem/pt) */
7
+ medium: 4;
8
+ /** large: 8(px/rem/pt) */
9
+ large: 8;
10
+ /** max: 9999(px/rem/pt). This will round the left and right side of the box element */
11
+ max: 9999;
12
+ /** round: 50%(pt). This will turn the box element into a circle */
13
+ round: '50%';
14
+ }>;
15
+ declare type BorderWidth$1 = Readonly<{
16
+ /** none: 0(px/rem/pt) */
17
+ none: 0;
18
+ /** thin: 1(px/rem/pt) */
19
+ thin: 1;
20
+ /** thick: 1.5(px/rem/pt) */
21
+ thick: 1.5;
22
+ }>;
23
+ declare type Border$1 = Readonly<{
24
+ radius: BorderRadius$1;
25
+ width: BorderWidth$1;
26
+ }>;
27
+ declare const border: Border$1;
28
+
29
+ declare type Breakpoints$1 = Readonly<{
30
+ /**
31
+ * `base` is used for responsive styling following a **mobile first** approach. It starts from 0px till the next existing token
32
+ *
33
+ * Think of this as styles without any media query.
34
+ *
35
+ * ### Example
36
+ *
37
+ * This code will set margin as `spacing.2` on "m" size screens and above. And as `spacing.1` on less than "m" size screens
38
+ * ```jsx
39
+ * <Box margin={{ base: 'spacing.1', m: 'spacing.2' }} />
40
+ * ```
41
+ *
42
+ * This roughly translates into -
43
+ *
44
+ * ```
45
+ * .Box {
46
+ * margin: 'spacing.1';
47
+ * }
48
+ *
49
+ * @media screen and (min-width: 768px) {
50
+ * .Box {
51
+ * margin: 'spacing.2';
52
+ * }
53
+ * }
54
+ * ```
55
+ */
56
+ base: number;
57
+ /**
58
+ * `@media screen and (min-width: 320px)`
59
+ *
60
+ * Small Mobiles
61
+ */
62
+ xs: number;
63
+ /**
64
+ * `@media screen and (min-width: 480px)`
65
+ *
66
+ * Mobiles and Small Tablets
67
+ */
68
+ s: number;
69
+ /**
70
+ * `@media screen and (min-width: 768px)`
71
+ *
72
+ * Medium and Large Tablets.
73
+ *
74
+ * Dimensions with `m` and above can be treated as desktop in mobile-first approach (with min-width).
75
+ * Hence this breakpoint can be used for desktop styling.
76
+ *
77
+ * E.g. next example will keep flexDirection `row` on mobiles and `column` on large tablets, desktop, and larger screens
78
+ *
79
+ * ```jsx
80
+ * <Box display="flex" flexDirection={{ base: 'row', m: 'column' }} />
81
+ * ```
82
+ *
83
+ */
84
+ m: number;
85
+ /**
86
+ * `@media screen and (min-width: 1024px)`
87
+ *
88
+ * Desktop
89
+ */
90
+ l: number;
91
+ /**
92
+ * `@media screen and (min-width: 1200px)`
93
+ *
94
+ * HD Desktop
95
+ */
96
+ xl: number;
97
+ }>;
98
+ declare const breakpoints: Breakpoints$1;
99
+
100
+ declare type ColorChromaticScale = Readonly<{
101
+ 50: string;
102
+ 100: string;
103
+ 200: string;
104
+ 300: string;
105
+ 400: string;
106
+ 500: string;
107
+ 600: string;
108
+ 700: string;
109
+ 800: string;
110
+ 900: string;
111
+ 950: string;
112
+ a00: string;
113
+ a50: string;
114
+ a100: string;
115
+ a200: string;
116
+ }>;
117
+ declare type ColorNeutralScale = Readonly<{
118
+ 0: string;
119
+ 50: string;
120
+ 100: string;
121
+ 200: string;
122
+ 300: string;
123
+ 400: string;
124
+ 500: string;
125
+ 600: string;
126
+ 700: string;
127
+ 800: string;
128
+ 900: string;
129
+ 1000: string;
130
+ 1100: string;
131
+ 1200: string;
132
+ 1300: string;
133
+ a00: string;
134
+ a50: string;
135
+ a100: string;
136
+ a200: string;
137
+ a300: string;
138
+ a400: string;
139
+ a500: string;
140
+ }>;
141
+ declare type Color = Readonly<{
142
+ chromatic: {
143
+ azure: ColorChromaticScale;
144
+ emerald: ColorChromaticScale;
145
+ crimson: ColorChromaticScale;
146
+ cider: ColorChromaticScale;
147
+ orchid: ColorChromaticScale;
148
+ magenta: ColorChromaticScale;
149
+ sapphire: ColorChromaticScale;
150
+ };
151
+ neutral: {
152
+ blueGrayLight: ColorNeutralScale;
153
+ blueGrayDark: ColorNeutralScale;
154
+ navyGrayLight: ColorNeutralScale;
155
+ navyGrayDark: ColorNeutralScale;
156
+ ashGrayLight: ColorNeutralScale;
157
+ ashGrayDark: ColorNeutralScale;
158
+ };
159
+ }>;
160
+ declare const colors: Color;
161
+
162
+ declare type Opacity = Readonly<{
163
+ /**0: 0 */
164
+ 0: number;
165
+ /**1: 0.09 */
166
+ 1: number;
167
+ /**2: 0.18 */
168
+ 2: number;
169
+ /**3: 0.32 */
170
+ 3: number;
171
+ /**4: 1.0 */
172
+ 4: number;
173
+ /**5: 1.0 */
174
+ 5: number;
175
+ /**6: 1.0 */
176
+ 6: number;
177
+ /**7: 1.0 */
178
+ 7: number;
179
+ /**8: 1.0 */
180
+ 8: number;
181
+ /**9: 1.0 */
182
+ 9: number;
183
+ }>;
184
+ declare const opacity: Opacity;
185
+
186
+ declare type FontFamily$1 = {
187
+ /** Used for all type of textual content except code snippets */
188
+ text: string;
189
+ /** Used for code snippets */
190
+ code: string;
191
+ };
192
+
193
+ declare type FontWeight$1 = {
194
+ regular: 400;
195
+ bold: 700;
196
+ };
197
+ /**
198
+ * For font size and line-heights we can’t say from xl to 2xl the value will necessary increase.
199
+ * it might decrease or remain same because these are alias tokens and we need aliases for cross platform.
200
+ * so for example xl on mobile can be 32px and on desktop xl can be 34px,
201
+ * similarly 2xl on mobile can be 34px but on desktop doesn’t necessarily mean 2xl will be more than xl(34px) it can be 32 as well since visually they make better hierarchy.
202
+ */
203
+ declare type FontSize$1 = {
204
+ /** desktop: 9(px/rem/pt)
205
+ *
206
+ * mobile: 9(px/rem/pt)
207
+ */
208
+ 10: number;
209
+ /** desktop: 10(px/rem/pt)
210
+ *
211
+ * mobile: 10(px/rem/pt)
212
+ */
213
+ 25: number;
214
+ /** desktop: 11(px/rem/pt)
215
+ *
216
+ * mobile: 11(px/rem/pt)
217
+ */
218
+ 50: number;
219
+ /** desktop: 12(px/rem/pt)
220
+ *
221
+ * mobile: 12(px/rem/pt)
222
+ */
223
+ 75: number;
224
+ /** desktop: 14(px/rem/pt)
225
+ *
226
+ * mobile: 14(px/rem/pt)
227
+ */
228
+ 100: number;
229
+ /** desktop: 16(px/rem/pt)
230
+ *
231
+ * mobile: 16(px/rem/pt)
232
+ */
233
+ 200: number;
234
+ /** desktop: 18(px/rem/pt)
235
+ *
236
+ * mobile: 16(px/rem/pt)
237
+ */
238
+ 300: number;
239
+ /** desktop: 20(px/rem/pt)
240
+ *
241
+ * mobile: 18(px/rem/pt)
242
+ */
243
+ 400: number;
244
+ /** desktop: 22(px/rem/pt)
245
+ *
246
+ * mobile: 20(px/rem/pt)
247
+ */
248
+ 500: number;
249
+ /** desktop: 24(px/rem/pt)
250
+ *
251
+ * mobile: 20(px/rem/pt)
252
+ */
253
+ 600: number;
254
+ /** desktop: 28(px/rem/pt)
255
+ *
256
+ * mobile: 24(px/rem/pt)
257
+ */
258
+ 700: number;
259
+ /** desktop: 32(px/rem/pt)
260
+ *
261
+ * mobile: 28(px/rem/pt)
262
+ */
263
+ 800: number;
264
+ /** desktop: 36(px/rem/pt)
265
+ *
266
+ * mobile: 32(px/rem/pt)
267
+ */
268
+ 900: number;
269
+ /** desktop: 40(px/rem/pt)
270
+ *
271
+ * mobile: 32(px/rem/pt)
272
+ */
273
+ 1000: number;
274
+ };
275
+ declare type Typography$1 = {
276
+ fonts: {
277
+ family: FontFamily$1;
278
+ size: FontSize$1;
279
+ weight: FontWeight$1;
280
+ };
281
+ lineHeights: {
282
+ /** desktop: 0(px/rem/pt)
283
+ *
284
+ * mobile: 0(px/rem/pt)
285
+ */
286
+ 0: number;
287
+ /** desktop: 14(px/rem/pt)
288
+ *
289
+ * mobile: 14(px/rem/pt)
290
+ */
291
+ 25: number;
292
+ /** desktop: 16(px/rem/pt)
293
+ *
294
+ * mobile: 16(px/rem/pt)
295
+ */
296
+ 50: number;
297
+ /** desktop: 18(px/rem/pt)
298
+ *
299
+ * mobile: 18(px/rem/pt)
300
+ */
301
+ 75: number;
302
+ /** desktop: 20(px/rem/pt)
303
+ *
304
+ * mobile: 20(px/rem/pt)
305
+ */
306
+ 100: number;
307
+ /** desktop: 24(px/rem/pt)
308
+ *
309
+ * mobile: 20(px/rem/pt)
310
+ */
311
+ 200: number;
312
+ /** desktop: 24(px/rem/pt)
313
+ *
314
+ * mobile: 24(px/rem/pt)
315
+ */
316
+ 300: number;
317
+ /** desktop: 28(px/rem/pt)
318
+ *
319
+ * mobile: 24(px/rem/pt)
320
+ */
321
+ 400: number;
322
+ /** desktop: 32(px/rem/pt)
323
+ *
324
+ * mobile: 28(px/rem/pt)
325
+ */
326
+ 500: number;
327
+ /** desktop: 40(px/rem/pt)
328
+ *
329
+ * mobile: 32(px/rem/pt)
330
+ */
331
+ 600: number;
332
+ /** desktop: 40(px/rem/pt)
333
+ *
334
+ * mobile: 40(px/rem/pt)
335
+ */
336
+ 700: number;
337
+ /** desktop: 48(px/rem/pt)
338
+ *
339
+ * mobile: 40(px/rem/pt)
340
+ */
341
+ 800: number;
342
+ };
343
+ };
344
+ declare type TypographyPlatforms$1 = 'onDesktop' | 'onMobile';
345
+ declare type TypographyWithPlatforms$1 = Record<TypographyPlatforms$1, Typography$1>;
346
+ declare const typography: TypographyWithPlatforms$1;
347
+
348
+ /**
349
+ * When any of the values are changed here, do change the jsdoc comments in BaseBox/types/spacingTypes.ts as well
350
+ *
351
+ * {@link ../../components/Box/BaseBox/types/spacingTypes.ts}
352
+ */
353
+ declare type Spacing$1 = Readonly<{
354
+ /** 0: 0(px/rem/pt) */
355
+ 0: 0;
356
+ /** 1: 2(px/rem/pt) */
357
+ 1: 2;
358
+ /** 2: 4(px/rem/pt) */
359
+ 2: 4;
360
+ /** 3: 8(px/rem/pt) */
361
+ 3: 8;
362
+ /** 4: 12(px/rem/pt) */
363
+ 4: 12;
364
+ /** 5: 16(px/rem/pt) */
365
+ 5: 16;
366
+ /** 6: 20(px/rem/pt) */
367
+ 6: 20;
368
+ /** 7: 24(px/rem/pt) */
369
+ 7: 24;
370
+ /** 8: 32(px/rem/pt) */
371
+ 8: 32;
372
+ /** 9: 40(px/rem/pt) */
373
+ 9: 40;
374
+ /** 10: 48(px/rem/pt) */
375
+ 10: 48;
376
+ /** 11: 56(px/rem/pt) */
377
+ 11: 56;
378
+ }>;
379
+ declare const spacing: Spacing$1;
380
+
381
+ type BorderRadius = Readonly<{
382
+ /** none: 0(px/rem/pt) */
383
+ none: 0;
384
+ /** small: 2(px/rem/pt) */
385
+ small: 2;
386
+ /** medium: 4(px/rem/pt) */
387
+ medium: 4;
388
+ /** large: 8(px/rem/pt) */
389
+ large: 8;
390
+ /** max: 9999(px/rem/pt). This will round the left and right side of the box element */
391
+ max: 9999;
392
+ /** round: 50%(pt). This will turn the box element into a circle */
393
+ round: '50%';
394
+ }>;
395
+
396
+ type BorderWidth = Readonly<{
397
+ /** none: 0(px/rem/pt) */
398
+ none: 0;
399
+ /** thin: 1(px/rem/pt) */
400
+ thin: 1;
401
+ /** thick: 1.5(px/rem/pt) */
402
+ thick: 1.5;
403
+ }>;
404
+
405
+ type Border = Readonly<{
406
+ radius: BorderRadius;
407
+ width: BorderWidth;
408
+ }>;
409
+
410
+ type Breakpoints = Readonly<{
411
+ /**
412
+ * `base` is used for responsive styling following a **mobile first** approach. It starts from 0px till the next existing token
413
+ *
414
+ * Think of this as styles without any media query.
415
+ *
416
+ * ### Example
417
+ *
418
+ * This code will set margin as `spacing.2` on "m" size screens and above. And as `spacing.1` on less than "m" size screens
419
+ * ```jsx
420
+ * <Box margin={{ base: 'spacing.1', m: 'spacing.2' }} />
421
+ * ```
422
+ *
423
+ * This roughly translates into -
424
+ *
425
+ * ```
426
+ * .Box {
427
+ * margin: 'spacing.1';
428
+ * }
429
+ *
430
+ * @media screen and (min-width: 768px) {
431
+ * .Box {
432
+ * margin: 'spacing.2';
433
+ * }
434
+ * }
435
+ * ```
436
+ */
437
+ base: number;
438
+ /**
439
+ * `@media screen and (min-width: 320px)`
440
+ *
441
+ * Small Mobiles
442
+ */
443
+ xs: number;
444
+ /**
445
+ * `@media screen and (min-width: 480px)`
446
+ *
447
+ * Mobiles and Small Tablets
448
+ */
449
+ s: number;
450
+ /**
451
+ * `@media screen and (min-width: 768px)`
452
+ *
453
+ * Medium and Large Tablets.
454
+ *
455
+ * Dimensions with `m` and above can be treated as desktop in mobile-first approach (with min-width).
456
+ * Hence this breakpoint can be used for desktop styling.
457
+ *
458
+ * E.g. next example will keep flexDirection `row` on mobiles and `column` on large tablets, desktop, and larger screens
459
+ *
460
+ * ```jsx
461
+ * <Box display="flex" flexDirection={{ base: 'row', m: 'column' }} />
462
+ * ```
463
+ *
464
+ */
465
+ m: number;
466
+ /**
467
+ * `@media screen and (min-width: 1024px)`
468
+ *
469
+ * Desktop
470
+ */
471
+ l: number;
472
+ /**
473
+ * `@media screen and (min-width: 1200px)`
474
+ *
475
+ * HD Desktop
476
+ */
477
+ xl: number;
478
+ }>;
479
+
480
+ type FontFamily = {
481
+ /** Used for all type of textual content except code snippets */
482
+ text: string;
483
+ /** Used for code snippets */
484
+ code: string;
485
+ };
486
+
487
+ type FontWeight = {
488
+ regular: 400;
489
+ bold: 700;
490
+ };
491
+
492
+ /**
493
+ * For font size and line-heights we can’t say from xl to 2xl the value will necessary increase.
494
+ * it might decrease or remain same because these are alias tokens and we need aliases for cross platform.
495
+ * so for example xl on mobile can be 32px and on desktop xl can be 34px,
496
+ * similarly 2xl on mobile can be 34px but on desktop doesn’t necessarily mean 2xl will be more than xl(34px) it can be 32 as well since visually they make better hierarchy.
497
+ */
498
+
499
+ type FontSize = {
500
+ /** desktop: 9(px/rem/pt)
501
+ *
502
+ * mobile: 9(px/rem/pt)
503
+ */
504
+ 10: number;
505
+ /** desktop: 10(px/rem/pt)
506
+ *
507
+ * mobile: 10(px/rem/pt)
508
+ */
509
+ 25: number;
510
+ /** desktop: 11(px/rem/pt)
511
+ *
512
+ * mobile: 11(px/rem/pt)
513
+ */
514
+ 50: number;
515
+ /** desktop: 12(px/rem/pt)
516
+ *
517
+ * mobile: 12(px/rem/pt)
518
+ */
519
+ 75: number;
520
+ /** desktop: 14(px/rem/pt)
521
+ *
522
+ * mobile: 14(px/rem/pt)
523
+ */
524
+ 100: number;
525
+ /** desktop: 16(px/rem/pt)
526
+ *
527
+ * mobile: 16(px/rem/pt)
528
+ */
529
+ 200: number;
530
+ /** desktop: 18(px/rem/pt)
531
+ *
532
+ * mobile: 16(px/rem/pt)
533
+ */
534
+ 300: number;
535
+ /** desktop: 20(px/rem/pt)
536
+ *
537
+ * mobile: 18(px/rem/pt)
538
+ */
539
+ 400: number;
540
+ /** desktop: 22(px/rem/pt)
541
+ *
542
+ * mobile: 20(px/rem/pt)
543
+ */
544
+ 500: number;
545
+ /** desktop: 24(px/rem/pt)
546
+ *
547
+ * mobile: 20(px/rem/pt)
548
+ */
549
+ 600: number;
550
+ /** desktop: 28(px/rem/pt)
551
+ *
552
+ * mobile: 24(px/rem/pt)
553
+ */
554
+ 700: number;
555
+ /** desktop: 32(px/rem/pt)
556
+ *
557
+ * mobile: 28(px/rem/pt)
558
+ */
559
+ 800: number;
560
+ /** desktop: 36(px/rem/pt)
561
+ *
562
+ * mobile: 32(px/rem/pt)
563
+ */
564
+ 900: number;
565
+ /** desktop: 40(px/rem/pt)
566
+ *
567
+ * mobile: 32(px/rem/pt)
568
+ */
569
+ 1000: number;
570
+ };
571
+
572
+ type Typography = {
573
+ fonts: {
574
+ family: FontFamily;
575
+ size: FontSize;
576
+ weight: FontWeight;
577
+ };
578
+ lineHeights: {
579
+ /** desktop: 0(px/rem/pt)
580
+ *
581
+ * mobile: 0(px/rem/pt)
582
+ */
583
+ 0: number;
584
+ /** desktop: 14(px/rem/pt)
585
+ *
586
+ * mobile: 14(px/rem/pt)
587
+ */
588
+ 25: number;
589
+ /** desktop: 16(px/rem/pt)
590
+ *
591
+ * mobile: 16(px/rem/pt)
592
+ */
593
+ 50: number;
594
+ /** desktop: 18(px/rem/pt)
595
+ *
596
+ * mobile: 18(px/rem/pt)
597
+ */
598
+ 75: number;
599
+ /** desktop: 20(px/rem/pt)
600
+ *
601
+ * mobile: 20(px/rem/pt)
602
+ */
603
+ 100: number;
604
+ /** desktop: 24(px/rem/pt)
605
+ *
606
+ * mobile: 20(px/rem/pt)
607
+ */
608
+ 200: number;
609
+ /** desktop: 24(px/rem/pt)
610
+ *
611
+ * mobile: 24(px/rem/pt)
612
+ */
613
+ 300: number;
614
+ /** desktop: 28(px/rem/pt)
615
+ *
616
+ * mobile: 24(px/rem/pt)
617
+ */
618
+ 400: number;
619
+ /** desktop: 32(px/rem/pt)
620
+ *
621
+ * mobile: 28(px/rem/pt)
622
+ */
623
+ 500: number;
624
+ /** desktop: 40(px/rem/pt)
625
+ *
626
+ * mobile: 32(px/rem/pt)
627
+ */
628
+ 600: number;
629
+ /** desktop: 40(px/rem/pt)
630
+ *
631
+ * mobile: 40(px/rem/pt)
632
+ */
633
+ 700: number;
634
+ /** desktop: 48(px/rem/pt)
635
+ *
636
+ * mobile: 40(px/rem/pt)
637
+ */
638
+ 800: number;
639
+ };
640
+ // letterSpacings: {};
641
+ };
642
+
643
+ type TypographyPlatforms = 'onDesktop' | 'onMobile';
644
+
645
+ type TypographyWithPlatforms = Record<TypographyPlatforms, Typography>;
646
+
647
+ /**
648
+ * When any of the values are changed here, do change the jsdoc comments in BaseBox/types/spacingTypes.ts as well
649
+ *
650
+ * {@link ../../components/Box/BaseBox/types/spacingTypes.ts}
651
+ */
652
+
653
+ type Spacing = Readonly<{
654
+ /** 0: 0(px/rem/pt) */
655
+ 0: 0;
656
+ /** 1: 2(px/rem/pt) */
657
+ 1: 2;
658
+ /** 2: 4(px/rem/pt) */
659
+ 2: 4;
660
+ /** 3: 8(px/rem/pt) */
661
+ 3: 8;
662
+ /** 4: 12(px/rem/pt) */
663
+ 4: 12;
664
+ /** 5: 16(px/rem/pt) */
665
+ 5: 16;
666
+ /** 6: 20(px/rem/pt) */
667
+ 6: 20;
668
+ /** 7: 24(px/rem/pt) */
669
+ 7: 24;
670
+ /** 8: 32(px/rem/pt) */
671
+ 8: 32;
672
+ /** 9: 40(px/rem/pt) */
673
+ 9: 40;
674
+ /** 10: 48(px/rem/pt) */
675
+ 10: 48;
676
+ /** 11: 56(px/rem/pt) */
677
+ 11: 56;
678
+ }>;
679
+
680
+ type ColorSchemeModes$1 = 'onDark' | 'onLight';
681
+
682
+ /* eslint-disable no-console */
683
+
684
+
685
+ type DeepPartial<T> = {
686
+ [P in keyof T]?: T[P] extends Record<number | string, unknown> ? DeepPartial<T[P]> : T[P];
687
+ };
688
+
689
+ /* eslint-disable @typescript-eslint/no-explicit-any */
690
+
691
+ /**
692
+ * Brands a type making them act as nominal
693
+ * @see https://medium.com/@KevinBGreene/surviving-the-typescript-ecosystem-branding-and-type-tagging-6cf6e516523d
694
+ */
695
+ type Brand<Type, Name extends string> = Type & { __brand__?: Name };
696
+
697
+ type NativeOrWebBrand = Brand<any, 'native' | 'web'>;
698
+
699
+ /* eslint-disable @typescript-eslint/no-namespace */
700
+
701
+
702
+ declare namespace Platform {
703
+ export type Name = 'native';
704
+ /**
705
+ * Right now, the module resolution is set to resolve `.native` files,
706
+ *
707
+ * Thus Platform.Select<> type will return the `native` type
708
+ */
709
+ export type Select<Options extends { web: unknown; native: unknown }> = Brand<
710
+ Options[Name],
711
+ 'platform-native'
712
+ >;
713
+
714
+ export type CastNative<T extends NativeOrWebBrand | undefined> = Extract<
715
+ T,
716
+ { __brand__?: 'platform-native' | 'platform-all' }
717
+ >;
718
+
719
+ export type CastWeb<T extends NativeOrWebBrand | undefined> = Extract<
720
+ T,
721
+ { __brand__?: 'platform-web' | 'platform-all' }
722
+ >;
723
+ }
724
+
725
+ type Duration$1 = {
726
+ /** `70` milliseconds */
727
+ '2xquick': 70;
728
+ /** `150` milliseconds */
729
+ xquick: 150;
730
+ /** `200` milliseconds */
731
+ quick: 200;
732
+ /** `250` milliseconds */
733
+ moderate: 250;
734
+ /** `300` milliseconds */
735
+ xmoderate: 300;
736
+ /** `400` milliseconds */
737
+ gentle: 400;
738
+ /** `600` milliseconds */
739
+ xgentle: 600;
740
+ /** `900` milliseconds */
741
+ '2xgentle': 900;
742
+ };
743
+
744
+ type Delay$1 = {
745
+ /** `70` milliseconds */
746
+ '2xshort': 70;
747
+ /** `120` milliseconds */
748
+ xshort: 120;
749
+ /** `180` milliseconds */
750
+ short: 180;
751
+ /** `3000` milliseconds */
752
+ long: 3000;
753
+ /** `5000` milliseconds */
754
+ xlong: 5000;
755
+ };
756
+
757
+ type EasingFunctionFactory$1 = { factory: () => (value: number) => number }; // similar to EasingFunctionFactory of `react-native-reanimated`
758
+ type EasingType$1<Value extends string> = Platform.Select<{
759
+ web: Value;
760
+ native: EasingFunctionFactory$1;
761
+ }>;
762
+
763
+ type Easing$1 = {
764
+ /** Easings for all standard animations*/
765
+ standard: {
766
+ /** `cubic-bezier(0.5, 0, 0.3, 1.5)`
767
+ *
768
+ * Returns a `string` of `"cubic-bezier(...)"` for web & react-native-reanimated's Easing Function of type `EasingFunctionFactory` for native */
769
+ attentive: EasingType$1<'cubic-bezier(0.5, 0, 0.3, 1.5)'>;
770
+ /** `cubic-bezier(0.3, 0, 0.2, 1)`
771
+ *
772
+ * Returns a `string` of `"cubic-bezier(...)"` for web & react-native-reanimated's Easing Function of type `EasingFunctionFactory` for native */
773
+ effective: EasingType$1<'cubic-bezier(0.3, 0, 0.2, 1)'>;
774
+ /** `cubic-bezier(0.5, 0, 0, 1)`
775
+ *
776
+ * Returns a `string` of `"cubic-bezier(...)"` for web & react-native-reanimated's Easing Function of type `EasingFunctionFactory` for native */
777
+ revealing: EasingType$1<'cubic-bezier(0.5, 0, 0, 1)'>;
778
+ /** `cubic-bezier(1, 0.5, 0, 0.5)`
779
+ *
780
+ * Returns a `string` of `"cubic-bezier(...)"` for web & react-native-reanimated's Easing Function of type `EasingFunctionFactory` for native */
781
+ wary: EasingType$1<'cubic-bezier(1, 0.5, 0, 0.5)'>;
782
+ };
783
+ /** Easings for all entrance animations*/
784
+ entrance: {
785
+ /** `cubic-bezier(0.5, 0, 0.3, 1.5)`
786
+ *
787
+ * Returns a `string` of `"cubic-bezier(...)"` for web & react-native-reanimated's Easing Function of type `EasingFunctionFactory` for native */
788
+ attentive: EasingType$1<'cubic-bezier(0.5, 0, 0.3, 1.5)'>;
789
+ /** `cubic-bezier(0, 0, 0.2, 1)`
790
+ *
791
+ * Returns a `string` of `"cubic-bezier(...)"` for web & react-native-reanimated's Easing Function of type `EasingFunctionFactory` for native */
792
+ effective: EasingType$1<'cubic-bezier(0, 0, 0.2, 1)'>;
793
+ /** `cubic-bezier(0, 0, 0, 1)`
794
+ *
795
+ * Returns a `string` of `"cubic-bezier(...)"` for web & react-native-reanimated's Easing Function of type `EasingFunctionFactory` for native */
796
+ revealing: EasingType$1<'cubic-bezier(0, 0, 0, 1)'>;
797
+ };
798
+ /** Easings for all exit animations*/
799
+ exit: {
800
+ /** `cubic-bezier(0.7, 0, 0.5, 1)`
801
+ *
802
+ * Returns a `string` of `"cubic-bezier(...)"` for web & react-native-reanimated's Easing Function of type `EasingFunctionFactory` for native */
803
+ attentive: EasingType$1<'cubic-bezier(0.7, 0, 0.5, 1)'>;
804
+ /** `cubic-bezier(0.17, 0, 1, 1)`
805
+ *
806
+ * Returns a `string` of `"cubic-bezier(...)"` for web & react-native-reanimated's Easing Function of type `EasingFunctionFactory` for native */
807
+ effective: EasingType$1<'cubic-bezier(0.17, 0, 1, 1)'>;
808
+ /** `cubic-bezier(0.5, 0, 1, 1)`
809
+ *
810
+ * Returns a `string` of `"cubic-bezier(...)"` for web & react-native-reanimated's Easing Function of type `EasingFunctionFactory` for native */
811
+ revealing: EasingType$1<'cubic-bezier(0.5, 0, 1, 1)'>;
812
+ };
813
+ };
814
+
815
+ type Motion$1 = Readonly<{
816
+ delay: Delay$1;
817
+ duration: Duration$1;
818
+ easing: Easing$1;
819
+ }>;
820
+
821
+ type ElevationLevels$1 = 'none' | 'lowRaised' | 'midRaised' | 'highRaised';
822
+
823
+ type ElevationStyles$1 = Readonly<{
824
+ elevation: number;
825
+ shadowColor: string;
826
+ shadowOpacity: number;
827
+ shadowRadius: number;
828
+ shadowOffset: {
829
+ /**
830
+ * x-axis
831
+ */
832
+ width: number;
833
+ /**
834
+ * y-axis
835
+ */
836
+ height: number;
837
+ };
838
+ }>;
839
+
840
+ type Elevation$1 = Record<
841
+ ElevationLevels$1,
842
+ Platform.Select<{
843
+ web: string;
844
+ native: ElevationStyles$1;
845
+ }>
846
+ >;
847
+
848
+ type ElevationWithColorModes$1 = Record<ColorSchemeModes$1, Elevation$1>;
849
+
850
+ type DotNotationMotionStringToken<TokenType> = {
851
+ [K in keyof TokenType]: `${Extract<K, string>}.${TokenType[K] extends Record<
852
+ string,
853
+ string | EasingFunctionFactory$1
854
+ >
855
+ ? Extract<keyof TokenType[K], string | EasingFunctionFactory$1>
856
+ : DotNotationMotionStringToken<TokenType[K]>}`;
857
+ }[keyof TokenType];
858
+
859
+ /**
860
+ *
861
+ * When combined with union, this type utility will give you autocomplete of union while still supporting any string value as input
862
+ *
863
+ * ### Usage
864
+ *
865
+ * ```ts
866
+ * type ThemeName = 'paymentTheme' | 'bankingTheme' | StringWithAutocomplete;
867
+ * ```
868
+ *
869
+ * This will show paymentTheme and bankingTheme in autocomplete but also allow any other string as value.
870
+ *
871
+ * More details - https://github.com/razorpay/blade/pull/1031/commits/86b6ee0facf45e7556739efcbfa5396b11b1b3c9#r1121298293
872
+ * Related TS Issue - https://github.com/microsoft/TypeScript/issues/29729
873
+ *
874
+ */
875
+ type StringWithAutocomplete = string & Record<never, never>;
876
+
877
+ declare type Duration = {
878
+ /** `70` milliseconds */
879
+ '2xquick': 70;
880
+ /** `150` milliseconds */
881
+ xquick: 150;
882
+ /** `200` milliseconds */
883
+ quick: 200;
884
+ /** `250` milliseconds */
885
+ moderate: 250;
886
+ /** `300` milliseconds */
887
+ xmoderate: 300;
888
+ /** `400` milliseconds */
889
+ gentle: 400;
890
+ /** `600` milliseconds */
891
+ xgentle: 600;
892
+ /** `900` milliseconds */
893
+ '2xgentle': 900;
894
+ };
895
+ declare type Delay = {
896
+ /** `70` milliseconds */
897
+ '2xshort': 70;
898
+ /** `120` milliseconds */
899
+ xshort: 120;
900
+ /** `180` milliseconds */
901
+ short: 180;
902
+ /** `3000` milliseconds */
903
+ long: 3000;
904
+ /** `5000` milliseconds */
905
+ xlong: 5000;
906
+ };
907
+ declare type EasingFunctionFactory = {
908
+ factory: () => (value: number) => number;
909
+ };
910
+ declare type EasingType<Value extends string> = Platform.Select<{
911
+ web: Value;
912
+ native: EasingFunctionFactory;
913
+ }>;
914
+ declare type Easing = {
915
+ /** Easings for all standard animations*/
916
+ standard: {
917
+ /** `cubic-bezier(0.5, 0, 0.3, 1.5)`
918
+ *
919
+ * Returns a `string` of `"cubic-bezier(...)"` for web & react-native-reanimated's Easing Function of type `EasingFunctionFactory` for native */
920
+ attentive: EasingType<'cubic-bezier(0.5, 0, 0.3, 1.5)'>;
921
+ /** `cubic-bezier(0.3, 0, 0.2, 1)`
922
+ *
923
+ * Returns a `string` of `"cubic-bezier(...)"` for web & react-native-reanimated's Easing Function of type `EasingFunctionFactory` for native */
924
+ effective: EasingType<'cubic-bezier(0.3, 0, 0.2, 1)'>;
925
+ /** `cubic-bezier(0.5, 0, 0, 1)`
926
+ *
927
+ * Returns a `string` of `"cubic-bezier(...)"` for web & react-native-reanimated's Easing Function of type `EasingFunctionFactory` for native */
928
+ revealing: EasingType<'cubic-bezier(0.5, 0, 0, 1)'>;
929
+ /** `cubic-bezier(1, 0.5, 0, 0.5)`
930
+ *
931
+ * Returns a `string` of `"cubic-bezier(...)"` for web & react-native-reanimated's Easing Function of type `EasingFunctionFactory` for native */
932
+ wary: EasingType<'cubic-bezier(1, 0.5, 0, 0.5)'>;
933
+ };
934
+ /** Easings for all entrance animations*/
935
+ entrance: {
936
+ /** `cubic-bezier(0.5, 0, 0.3, 1.5)`
937
+ *
938
+ * Returns a `string` of `"cubic-bezier(...)"` for web & react-native-reanimated's Easing Function of type `EasingFunctionFactory` for native */
939
+ attentive: EasingType<'cubic-bezier(0.5, 0, 0.3, 1.5)'>;
940
+ /** `cubic-bezier(0, 0, 0.2, 1)`
941
+ *
942
+ * Returns a `string` of `"cubic-bezier(...)"` for web & react-native-reanimated's Easing Function of type `EasingFunctionFactory` for native */
943
+ effective: EasingType<'cubic-bezier(0, 0, 0.2, 1)'>;
944
+ /** `cubic-bezier(0, 0, 0, 1)`
945
+ *
946
+ * Returns a `string` of `"cubic-bezier(...)"` for web & react-native-reanimated's Easing Function of type `EasingFunctionFactory` for native */
947
+ revealing: EasingType<'cubic-bezier(0, 0, 0, 1)'>;
948
+ };
949
+ /** Easings for all exit animations*/
950
+ exit: {
951
+ /** `cubic-bezier(0.7, 0, 0.5, 1)`
952
+ *
953
+ * Returns a `string` of `"cubic-bezier(...)"` for web & react-native-reanimated's Easing Function of type `EasingFunctionFactory` for native */
954
+ attentive: EasingType<'cubic-bezier(0.7, 0, 0.5, 1)'>;
955
+ /** `cubic-bezier(0.17, 0, 1, 1)`
956
+ *
957
+ * Returns a `string` of `"cubic-bezier(...)"` for web & react-native-reanimated's Easing Function of type `EasingFunctionFactory` for native */
958
+ effective: EasingType<'cubic-bezier(0.17, 0, 1, 1)'>;
959
+ /** `cubic-bezier(0.5, 0, 1, 1)`
960
+ *
961
+ * Returns a `string` of `"cubic-bezier(...)"` for web & react-native-reanimated's Easing Function of type `EasingFunctionFactory` for native */
962
+ revealing: EasingType<'cubic-bezier(0.5, 0, 1, 1)'>;
963
+ };
964
+ };
965
+ declare type Motion = Readonly<{
966
+ delay: Delay;
967
+ duration: Duration;
968
+ easing: Easing;
969
+ }>;
970
+ declare type EasingString = `easing.${DotNotationMotionStringToken<Easing>}`;
971
+ declare type DurationString = `duration.${keyof Duration}`;
972
+ declare type DelayString = `delay.${keyof Delay}`;
973
+ declare const motion: Motion;
974
+
975
+ /**
976
+ * Size tokens are currently not exposed for users (therefore not available in theme)
977
+ */
978
+ declare const size: {
979
+ /** 0 px */
980
+ readonly 0: 0;
981
+ /** 1 px */
982
+ readonly 1: 1;
983
+ /** 2 px */
984
+ readonly 2: 2;
985
+ /** 3 px */
986
+ readonly 3: 3;
987
+ /** 4 px */
988
+ readonly 4: 4;
989
+ /** 5 px */
990
+ readonly 5: 5;
991
+ /** 6 px */
992
+ readonly 6: 6;
993
+ /** 8 px */
994
+ readonly 8: 8;
995
+ /** 10 px */
996
+ readonly 10: 10;
997
+ /** 12 px */
998
+ readonly 12: 12;
999
+ /** 16 px */
1000
+ readonly 16: 16;
1001
+ /** 18 px */
1002
+ readonly 18: 18;
1003
+ /** 20 px */
1004
+ readonly 20: 20;
1005
+ /** 24 px */
1006
+ readonly 24: 24;
1007
+ /** 28 px */
1008
+ readonly 28: 28;
1009
+ /** 32 px */
1010
+ readonly 32: 32;
1011
+ /** 36 px */
1012
+ readonly 36: 36;
1013
+ /** 40 px */
1014
+ readonly 40: 40;
1015
+ /** 48 px */
1016
+ readonly 48: 48;
1017
+ /** 60 px */
1018
+ readonly 56: 56;
1019
+ /** 100 px */
1020
+ readonly 100: 100;
1021
+ /** 120 px */
1022
+ readonly 120: 120;
1023
+ /** 300 px */
1024
+ readonly 300: 300;
1025
+ /** 584 px */
1026
+ readonly 584: 584;
1027
+ };
1028
+ declare type Size = typeof size;
1029
+
1030
+ declare type ColorSchemeNames = 'dark' | 'light';
1031
+ declare type ColorSchemeNamesInput = ColorSchemeNames | 'system';
1032
+ declare type ColorSchemeModes = 'onDark' | 'onLight';
1033
+ declare type TextTypes = 'muted' | 'normal' | 'placeholder' | 'subdued' | 'subtle';
1034
+ declare type ColorContrastTypes = 'low' | 'high';
1035
+ declare type Feedback = 'information' | 'negative' | 'neutral' | 'notice' | 'positive';
1036
+ declare type ColorContrast = {
1037
+ [K in ColorContrastTypes as `${Extract<K, string>}Contrast`]: string;
1038
+ };
1039
+ declare type ActionStates = {
1040
+ default: string;
1041
+ hover: string;
1042
+ focus: string;
1043
+ active: string;
1044
+ disabled: string;
1045
+ };
1046
+ declare type LinkActionStates = ActionStates & {
1047
+ visited: string;
1048
+ };
1049
+ declare type ActionStatesWithContrast = {
1050
+ default: ColorContrast;
1051
+ hover: ColorContrast;
1052
+ focus: ColorContrast;
1053
+ active: ColorContrast;
1054
+ disabled: ColorContrast;
1055
+ };
1056
+ declare type ActionVariants = {
1057
+ primary: ActionStates;
1058
+ secondary: ActionStates;
1059
+ tertiary: ActionStates;
1060
+ link: LinkActionStates;
1061
+ };
1062
+ declare type ActionVariantsWithContrast = {
1063
+ primary: ActionStatesWithContrast;
1064
+ secondary: ActionStatesWithContrast;
1065
+ tertiary: ActionStatesWithContrast;
1066
+ link: ActionStatesWithContrast;
1067
+ };
1068
+ declare type FeedbackActions = {
1069
+ background: Pick<ActionVariantsWithContrast, 'primary'>;
1070
+ border: Pick<ActionVariantsWithContrast, 'primary'>;
1071
+ text: Pick<ActionVariantsWithContrast, 'link' | 'primary'>;
1072
+ icon: Pick<ActionVariantsWithContrast, 'link' | 'primary'>;
1073
+ };
1074
+ declare type Colors = {
1075
+ brand: {
1076
+ primary: Record<300 | 400 | 500 | 600 | 700 | 800, string>;
1077
+ secondary: Record<500, string>;
1078
+ gray: Record<200 | 300 | 400 | 500 | 600 | 700 | 'a50' | 'a100', ColorContrast>;
1079
+ };
1080
+ feedback: {
1081
+ background: Record<Feedback, ColorContrast>;
1082
+ border: Record<Feedback, ColorContrast>;
1083
+ text: Record<Feedback, ColorContrast>;
1084
+ icon: Record<Feedback, ColorContrast>;
1085
+ positive: {
1086
+ action: FeedbackActions;
1087
+ };
1088
+ negative: {
1089
+ action: FeedbackActions;
1090
+ };
1091
+ information: {
1092
+ action: FeedbackActions;
1093
+ };
1094
+ notice: {
1095
+ action: FeedbackActions;
1096
+ };
1097
+ neutral: {
1098
+ action: FeedbackActions;
1099
+ };
1100
+ };
1101
+ surface: {
1102
+ background: Record<'level1' | 'level2' | 'level3', ColorContrast>;
1103
+ border: Record<'normal' | 'subtle', ColorContrast>;
1104
+ text: Record<TextTypes, ColorContrast>;
1105
+ action: {
1106
+ icon: ActionStatesWithContrast;
1107
+ };
1108
+ };
1109
+ overlay: Record<'background', string>;
1110
+ action: {
1111
+ background: Omit<ActionVariants, 'link'>;
1112
+ border: Omit<ActionVariants, 'link'>;
1113
+ text: ActionVariants;
1114
+ icon: ActionVariants;
1115
+ };
1116
+ badge: {
1117
+ background: {
1118
+ blue: ColorContrast;
1119
+ };
1120
+ border: {
1121
+ blue: ColorContrast;
1122
+ };
1123
+ text: {
1124
+ blue: ColorContrast;
1125
+ };
1126
+ icon: {
1127
+ blue: ColorContrast;
1128
+ };
1129
+ };
1130
+ };
1131
+ declare type ColorsWithModes = Record<ColorSchemeModes, Colors>;
1132
+ declare type ThemeTokens = {
1133
+ name: 'paymentTheme' | 'bankingTheme' | StringWithAutocomplete;
1134
+ border: Border;
1135
+ breakpoints: Breakpoints;
1136
+ colors: ColorsWithModes;
1137
+ motion: Motion$1;
1138
+ elevation: ElevationWithColorModes$1;
1139
+ spacing: Spacing;
1140
+ typography: TypographyWithPlatforms;
1141
+ };
1142
+
1143
+ declare type ElevationLevels = 'none' | 'lowRaised' | 'midRaised' | 'highRaised';
1144
+ declare type ElevationStyles = Readonly<{
1145
+ elevation: number;
1146
+ shadowColor: string;
1147
+ shadowOpacity: number;
1148
+ shadowRadius: number;
1149
+ shadowOffset: {
1150
+ /**
1151
+ * x-axis
1152
+ */
1153
+ width: number;
1154
+ /**
1155
+ * y-axis
1156
+ */
1157
+ height: number;
1158
+ };
1159
+ }>;
1160
+ declare type Elevation = Record<ElevationLevels, Platform.Select<{
1161
+ web: string;
1162
+ native: ElevationStyles;
1163
+ }>>;
1164
+ declare type ElevationWithColorModes = Record<ColorSchemeModes, Elevation>;
1165
+
1166
+ declare const elevation: ElevationWithColorModes;
1167
+
1168
+ declare const paymentTheme: ThemeTokens;
1169
+
1170
+ declare const bankingTheme: ThemeTokens;
1171
+
1172
+ declare type OverrideTheme = {
1173
+ /**
1174
+ * base tokens
1175
+ */
1176
+ baseThemeTokens: ThemeTokens;
1177
+ /**
1178
+ * partial theme tokens
1179
+ */
1180
+ overrides: DeepPartial<ThemeTokens>;
1181
+ };
1182
+ /**
1183
+ * @description
1184
+ *
1185
+ * `overrideTheme` merges the `baseThemeTokens` and `overrides` and returns a new ThemeTokens object,
1186
+ * which you can pass into BladeProvider.
1187
+ *
1188
+ * @example
1189
+ * ```tsx
1190
+ * const customTheme = overrideTheme({
1191
+ * baseThemeTokens: paymentTheme, // theme to override
1192
+ * overrides: {
1193
+ * colors: {
1194
+ * onLight: {
1195
+ * brand: {
1196
+ * primary: {
1197
+ * '500': 'hsla(222, 100%, 96%, 1)',
1198
+ * },
1199
+ * },
1200
+ * },
1201
+ * },
1202
+ * },
1203
+ * });
1204
+ *
1205
+ * <BladeProvider themeTokens={customTheme} />
1206
+ * ```
1207
+ */
1208
+ declare const overrideTheme: ({ baseThemeTokens, overrides }: OverrideTheme) => ThemeTokens;
1209
+
1210
+ export { Border$1 as Border, Breakpoints$1 as Breakpoints, Color, ColorSchemeNames, ColorSchemeNamesInput, ColorsWithModes, DelayString, DurationString, EasingFunctionFactory, EasingString, Elevation, ElevationWithColorModes, FontFamily$1 as FontFamily, FontSize$1 as FontSize, Motion, Opacity, Size, Spacing$1 as Spacing, ThemeTokens, Typography$1 as Typography, TypographyPlatforms$1 as TypographyPlatforms, TypographyWithPlatforms$1 as TypographyWithPlatforms, bankingTheme, border, breakpoints, colors, elevation, motion, opacity, overrideTheme, paymentTheme, size, spacing, typography };