@razorpay/blade 8.0.0 → 8.2.2

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