@razorpay/blade 8.12.1 → 8.14.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.
- package/build/components/index.d.ts +867 -626
- package/build/components/index.native.d.ts +1514 -1342
- package/build/components/index.native.js +1121 -2403
- package/build/components/index.native.js.map +1 -1
- package/build/components/index.web.js +4714 -5948
- package/build/components/index.web.js.map +1 -1
- package/build/css/bankingThemeDarkDesktop.css +2 -1
- package/build/css/bankingThemeDarkMobile.css +2 -1
- package/build/css/bankingThemeLightDesktop.css +2 -1
- package/build/css/bankingThemeLightMobile.css +2 -1
- package/build/css/paymentThemeDarkDesktop.css +2 -1
- package/build/css/paymentThemeDarkMobile.css +2 -1
- package/build/css/paymentThemeLightDesktop.css +2 -1
- package/build/css/paymentThemeLightMobile.css +2 -1
- package/build/tokens/index.d.ts +7 -0
- package/build/tokens/index.native.d.ts +7 -0
- package/build/tokens/index.native.js +33 -170
- package/build/tokens/index.native.js.map +1 -1
- package/build/tokens/index.web.js +4372 -4567
- package/build/tokens/index.web.js.map +1 -1
- package/build/utils/index.d.ts +31 -397
- package/build/utils/index.native.d.ts +28 -395
- package/build/utils/index.native.js +10 -4531
- package/build/utils/index.native.js.map +1 -1
- package/build/utils/index.web.js +72 -4873
- package/build/utils/index.web.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,84 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export { default as isEmpty } from 'lodash/isEmpty';
|
|
4
|
-
export { default as isEqual } from 'lodash/isEqual';
|
|
5
|
-
import React, { MutableRefObject } from 'react';
|
|
6
|
-
import { AccessibilityRole, Platform as Platform$2 } from 'react-native';
|
|
7
|
-
import { EasingFunctionFactory } from 'react-native-reanimated';
|
|
8
|
-
export { default as merge } from 'lodash/merge';
|
|
9
|
-
|
|
10
|
-
declare const metaAttribute: ({ testID, name, }: {
|
|
11
|
-
name?: string | undefined;
|
|
12
|
-
testID?: string | undefined;
|
|
13
|
-
}) => Record<string, string>;
|
|
14
|
-
|
|
15
|
-
declare const MetaConstants: {
|
|
16
|
-
readonly Accordion: "accordion";
|
|
17
|
-
readonly AccordionButton: "accordion-button";
|
|
18
|
-
readonly AccordionItem: "accordion-item";
|
|
19
|
-
readonly ActionList: "action-list";
|
|
20
|
-
readonly ActionListFooter: "action-list-footer";
|
|
21
|
-
readonly ActionListHeader: "action-list-header";
|
|
22
|
-
readonly ActionListItem: "action-list-item";
|
|
23
|
-
readonly ActionListSection: "action-list-section";
|
|
24
|
-
readonly Alert: "alert";
|
|
25
|
-
readonly Amount: "amount";
|
|
26
|
-
readonly Badge: "badge";
|
|
27
|
-
readonly Box: "box";
|
|
28
|
-
readonly BaseBox: "base-box";
|
|
29
|
-
readonly BaseText: "base-text";
|
|
30
|
-
readonly Button: "button";
|
|
31
|
-
readonly Checkbox: "checkbox";
|
|
32
|
-
readonly CheckboxGroup: "checkbox-group";
|
|
33
|
-
readonly CheckboxLabel: "checkbox-label";
|
|
34
|
-
readonly Code: "code";
|
|
35
|
-
readonly Component: "blade-component";
|
|
36
|
-
readonly Counter: "counter";
|
|
37
|
-
readonly DropdownOverlay: "dropdown-overlay";
|
|
38
|
-
readonly Icon: "icon";
|
|
39
|
-
readonly IconButton: "icon-button";
|
|
40
|
-
readonly Indicator: "indicator";
|
|
41
|
-
readonly Link: "link";
|
|
42
|
-
readonly List: "list";
|
|
43
|
-
readonly ListItem: "list-item";
|
|
44
|
-
readonly OTPInput: "otp-input";
|
|
45
|
-
readonly PasswordInput: "password-input";
|
|
46
|
-
readonly TextArea: "textarea";
|
|
47
|
-
readonly TextInput: "textinput";
|
|
48
|
-
readonly ProgressBar: "progress-bar";
|
|
49
|
-
readonly Radio: "radio";
|
|
50
|
-
readonly RadioGroup: "radio-group";
|
|
51
|
-
readonly RadioLabel: "radio-label";
|
|
52
|
-
readonly SkipNav: "skipnav";
|
|
53
|
-
readonly Spinner: "spinner";
|
|
54
|
-
readonly SelectInput: "select-input";
|
|
55
|
-
readonly Tooltip: "tooltip";
|
|
56
|
-
readonly TooltipInteractiveWrapper: "tooltip-interactive-wrapper";
|
|
57
|
-
readonly BottomSheet: "bottom-sheet";
|
|
58
|
-
readonly BottomSheetBody: "bottom-sheet-body";
|
|
59
|
-
readonly BottomSheetHeader: "bottom-sheet-header";
|
|
60
|
-
readonly BottomSheetFooter: "bottom-sheet-footer";
|
|
61
|
-
readonly BottomSheetGrabHandle: "bottomsheet-grab-handle";
|
|
62
|
-
readonly Card: "card";
|
|
63
|
-
readonly CardBody: "card-body";
|
|
64
|
-
readonly CardHeader: "card-header";
|
|
65
|
-
readonly CardFooter: "card-footer";
|
|
66
|
-
readonly Collapsible: "collapsible";
|
|
67
|
-
readonly CollapsibleBody: "collapsible-body";
|
|
68
|
-
readonly CollapsibleButton: "collapsible-button";
|
|
69
|
-
readonly CollapsibleLink: "collapsible-link";
|
|
70
|
-
readonly Modal: "modal";
|
|
71
|
-
readonly ModalBody: "modal-body";
|
|
72
|
-
readonly ModalHeader: "modal-header";
|
|
73
|
-
readonly ModalFooter: "modal-footer";
|
|
74
|
-
readonly ModalBackdrop: "modal-backdrop";
|
|
75
|
-
readonly ModalScrollOverlay: "modal-scroll-overlay";
|
|
76
|
-
readonly VisuallyHidden: "visually-hidden";
|
|
77
|
-
readonly FormLabel: "form-label";
|
|
78
|
-
readonly Switch: "switch";
|
|
79
|
-
readonly SwitchLabel: "switch-label";
|
|
80
|
-
readonly StyledBaseInput: "styled-base-input";
|
|
81
|
-
};
|
|
1
|
+
import { Platform as Platform$2 } from 'react-native';
|
|
2
|
+
import { MutableRefObject } from 'react';
|
|
82
3
|
|
|
83
4
|
type Breakpoints = Readonly<{
|
|
84
5
|
/**
|
|
@@ -199,277 +120,6 @@ declare const getMediaQuery: ({ min, max }: {
|
|
|
199
120
|
declare type PlatformTypes = 'browser' | 'node' | 'react-native' | 'unknown';
|
|
200
121
|
declare const getPlatformType: () => PlatformTypes;
|
|
201
122
|
|
|
202
|
-
/**
|
|
203
|
-
* Gets the `componentId` prop of React component if it exists.
|
|
204
|
-
*/
|
|
205
|
-
declare const getComponentId: (component: React.ReactNode) => string | null;
|
|
206
|
-
/**
|
|
207
|
-
* Checks if the `component` matches the `componentId`
|
|
208
|
-
*/
|
|
209
|
-
declare const isValidAllowedChildren: (component: React.ReactNode, id: string) => boolean;
|
|
210
|
-
|
|
211
|
-
declare type DeepPartial<T> = {
|
|
212
|
-
[P in keyof T]?: T[P] extends Record<number | string, unknown> ? DeepPartial<T[P]> : T[P];
|
|
213
|
-
};
|
|
214
|
-
declare const isPartialMatchObjectKeys: <ActualObject>({ objectToMatch, objectToInspect, }: {
|
|
215
|
-
objectToMatch: DeepPartial<ActualObject>;
|
|
216
|
-
objectToInspect: ActualObject;
|
|
217
|
-
}) => boolean;
|
|
218
|
-
|
|
219
|
-
declare type AriaRoles = Exclude<AccessibilityRole, 'header' | 'adjustable' | 'image' | 'none' | 'summary'> | 'alert' | 'alertdialog' | 'application' | 'article' | 'banner' | 'button' | 'cell' | 'checkbox' | 'columnheader' | 'combobox' | 'complementary' | 'contentinfo' | 'definition' | 'dialog' | 'directory' | 'document' | 'feed' | 'figure' | 'form' | 'grid' | 'gridcell' | 'group' | 'heading' | 'img' | 'link' | 'list' | 'listbox' | 'listitem' | 'log' | 'main' | 'marquee' | 'math' | 'menu' | 'menubar' | 'menuitem' | 'menuitemcheckbox' | 'menuitemradio' | 'meter' | 'navigation' | 'none' | 'note' | 'option' | 'presentation' | 'progressbar' | 'radio' | 'radiogroup' | 'region' | 'row' | 'rowgroup' | 'rowheader' | 'scrollbar' | 'search' | 'searchbox' | 'separator' | 'slider' | 'spinbutton' | 'status' | 'switch' | 'tab' | 'table' | 'tablist' | 'tabpanel' | 'term' | 'textbox' | 'timer' | 'toolbar' | 'tooltip' | 'tree' | 'treegrid' | 'treeitem';
|
|
220
|
-
declare type AccessibilityKeys = keyof AriaAttributes;
|
|
221
|
-
declare type AccessibilityProps = AriaAttributes;
|
|
222
|
-
declare type AccessibilityMap = Record<AccessibilityKeys, string>;
|
|
223
|
-
declare type AriaAttributes = {
|
|
224
|
-
role: AriaRoles;
|
|
225
|
-
/**
|
|
226
|
-
* Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application.
|
|
227
|
-
*/
|
|
228
|
-
activeDescendant?: string;
|
|
229
|
-
/**
|
|
230
|
-
* Indicates whether assistive technologies will present all, or only parts of, the changed region based on the change notifications defined by the aria-relevant attribute.
|
|
231
|
-
*/
|
|
232
|
-
atomic?: boolean;
|
|
233
|
-
/**
|
|
234
|
-
* Indicates whether inputting text could trigger display of one or more predictions of the user's intended value for an input and specifies how predictions would be presented if they are made.
|
|
235
|
-
*/
|
|
236
|
-
autoComplete?: 'none' | 'inline' | 'list' | 'both';
|
|
237
|
-
/**
|
|
238
|
-
* Indicates an element is being modified and that assistive technologies MAY want to wait until the modifications are complete before exposing them to the user.
|
|
239
|
-
*/
|
|
240
|
-
busy?: boolean;
|
|
241
|
-
/**
|
|
242
|
-
* Indicates the current "checked" state of checkboxes, radio buttons, and other widgets.
|
|
243
|
-
* @see aria-pressed @see aria-selected.
|
|
244
|
-
*/
|
|
245
|
-
checked?: boolean | 'mixed';
|
|
246
|
-
/**
|
|
247
|
-
* Defines the total number of columns in a table, grid, or treegrid.
|
|
248
|
-
* @see aria-colindex.
|
|
249
|
-
*/
|
|
250
|
-
colCount?: number;
|
|
251
|
-
/**
|
|
252
|
-
* Defines an element's column index or position with respect to the total number of columns within a table, grid, or treegrid.
|
|
253
|
-
* @see aria-colcount @see aria-colspan.
|
|
254
|
-
*/
|
|
255
|
-
colIndex?: number;
|
|
256
|
-
/**
|
|
257
|
-
* Defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid.
|
|
258
|
-
* @see aria-colindex @see aria-rowspan.
|
|
259
|
-
*/
|
|
260
|
-
colSpan?: number;
|
|
261
|
-
/**
|
|
262
|
-
* Identifies the element (or elements) whose contents or presence are controlled by the current element.
|
|
263
|
-
* @see aria-owns.
|
|
264
|
-
*/
|
|
265
|
-
controls?: string;
|
|
266
|
-
/**
|
|
267
|
-
* Indicates the element that represents the current item within a container or set of related elements.
|
|
268
|
-
*/
|
|
269
|
-
current?: boolean | 'page' | 'step' | 'location' | 'date' | 'time';
|
|
270
|
-
/**
|
|
271
|
-
* Identifies the element (or elements) that describes the object.
|
|
272
|
-
* @see aria-labelledby
|
|
273
|
-
*/
|
|
274
|
-
describedBy?: string;
|
|
275
|
-
/**
|
|
276
|
-
* Identifies the element that provides a detailed, extended description for the object.
|
|
277
|
-
* @see aria-describedby.
|
|
278
|
-
*/
|
|
279
|
-
details?: string;
|
|
280
|
-
/**
|
|
281
|
-
* Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable.
|
|
282
|
-
* @see aria-hidden @see aria-readonly.
|
|
283
|
-
*/
|
|
284
|
-
disabled?: boolean;
|
|
285
|
-
/**
|
|
286
|
-
* Indicates what functions can be performed when a dragged object is released on the drop target.
|
|
287
|
-
* @deprecated in ARIA 1.1
|
|
288
|
-
*/
|
|
289
|
-
dropEffect?: 'none' | 'copy' | 'execute' | 'link' | 'move' | 'popup';
|
|
290
|
-
/**
|
|
291
|
-
* Identifies the element that provides an error message for the object.
|
|
292
|
-
* @see aria-invalid @see aria-describedby.
|
|
293
|
-
*/
|
|
294
|
-
errorMessage?: string;
|
|
295
|
-
/**
|
|
296
|
-
* Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed.
|
|
297
|
-
*/
|
|
298
|
-
expanded?: boolean;
|
|
299
|
-
/**
|
|
300
|
-
* Identifies the next element (or elements) in an alternate reading order of content which, at the user's discretion,
|
|
301
|
-
* allows assistive technology to override the general default of reading in document source order.
|
|
302
|
-
*/
|
|
303
|
-
flowTo?: string;
|
|
304
|
-
/**
|
|
305
|
-
* Indicates an element's "grabbed" state in a drag-and-drop operation.
|
|
306
|
-
* @deprecated in ARIA 1.1
|
|
307
|
-
*/
|
|
308
|
-
grabbed?: boolean;
|
|
309
|
-
/**
|
|
310
|
-
* Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element.
|
|
311
|
-
*/
|
|
312
|
-
hasPopup?: boolean | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog';
|
|
313
|
-
/**
|
|
314
|
-
* Indicates whether the element is exposed to an accessibility API.
|
|
315
|
-
* @see aria-disabled.
|
|
316
|
-
*/
|
|
317
|
-
hidden?: boolean;
|
|
318
|
-
/**
|
|
319
|
-
* Indicates the entered value does not conform to the format expected by the application.
|
|
320
|
-
* @see aria-errormessage.
|
|
321
|
-
*/
|
|
322
|
-
invalid?: boolean | 'grammar' | 'spelling';
|
|
323
|
-
/**
|
|
324
|
-
* Indicates keyboard shortcuts that an author has implemented to activate or give focus to an element.
|
|
325
|
-
*/
|
|
326
|
-
keyShortcuts?: string;
|
|
327
|
-
/**
|
|
328
|
-
* Defines a string value that labels the current element.
|
|
329
|
-
* @see aria-labelledby.
|
|
330
|
-
*/
|
|
331
|
-
label?: string;
|
|
332
|
-
/**
|
|
333
|
-
* Identifies the element (or elements) that labels the current element.
|
|
334
|
-
* @see aria-describedby.
|
|
335
|
-
*/
|
|
336
|
-
labelledBy?: string;
|
|
337
|
-
/**
|
|
338
|
-
* Defines the hierarchical level of an element within a structure.
|
|
339
|
-
*/
|
|
340
|
-
level?: number;
|
|
341
|
-
/**
|
|
342
|
-
* Indicates that an element will be updated, and describes the types of updates the user agents, assistive technologies, and user can expect from the live region.
|
|
343
|
-
*/
|
|
344
|
-
liveRegion?: 'off' | 'assertive' | 'polite';
|
|
345
|
-
/**
|
|
346
|
-
* Indicates whether an element is modal when displayed.
|
|
347
|
-
*/
|
|
348
|
-
modal?: boolean;
|
|
349
|
-
/**
|
|
350
|
-
* Indicates whether a text box accepts multiple lines of input or only a single line.
|
|
351
|
-
*/
|
|
352
|
-
multiline?: boolean;
|
|
353
|
-
/**
|
|
354
|
-
* Indicates that the user may select more than one item from the current selectable descendants.
|
|
355
|
-
*/
|
|
356
|
-
multiSelectable?: boolean;
|
|
357
|
-
/**
|
|
358
|
-
* Indicates whether the element's orientation is horizontal, vertical, or unknown/ambiguous.
|
|
359
|
-
*/
|
|
360
|
-
orientation?: 'horizontal' | 'vertical';
|
|
361
|
-
/**
|
|
362
|
-
* Identifies an element (or elements) in order to define a visual, functional, or contextual parent/child relationship
|
|
363
|
-
* between DOM elements where the DOM hierarchy cannot be used to represent the relationship.
|
|
364
|
-
* @see aria-controls.
|
|
365
|
-
*/
|
|
366
|
-
owns?: string;
|
|
367
|
-
/**
|
|
368
|
-
* Defines a short hint (a word or short phrase) intended to aid the user with data entry when the control has no value.
|
|
369
|
-
* A hint could be a sample value or a brief description of the expected format.
|
|
370
|
-
*/
|
|
371
|
-
placeholder?: string;
|
|
372
|
-
/**
|
|
373
|
-
* Defines an element's number or position in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM.
|
|
374
|
-
* @see aria-setsize.
|
|
375
|
-
*/
|
|
376
|
-
posInSet?: number;
|
|
377
|
-
/**
|
|
378
|
-
* Indicates the current "pressed" state of toggle buttons.
|
|
379
|
-
* @see aria-checked @see aria-selected.
|
|
380
|
-
*/
|
|
381
|
-
pressed?: boolean | 'mixed';
|
|
382
|
-
/**
|
|
383
|
-
* Indicates that the element is not editable, but is otherwise operable.
|
|
384
|
-
* @see aria-disabled.
|
|
385
|
-
*/
|
|
386
|
-
readOnly?: boolean;
|
|
387
|
-
/**
|
|
388
|
-
* Indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified.
|
|
389
|
-
* @see aria-atomic.
|
|
390
|
-
*/
|
|
391
|
-
relevant?: 'additions' | 'additions removals' | 'additions text' | 'all' | 'removals' | 'removals additions' | 'removals text' | 'text' | 'text additions' | 'text removals';
|
|
392
|
-
/**
|
|
393
|
-
* Indicates that user input is required on the element before a form may be submitted.
|
|
394
|
-
*/
|
|
395
|
-
required?: boolean;
|
|
396
|
-
/**
|
|
397
|
-
* Defines a human-readable, author-localized description for the role of an element.
|
|
398
|
-
*/
|
|
399
|
-
roleDescription?: string;
|
|
400
|
-
/**
|
|
401
|
-
* Defines the total number of rows in a table, grid, or treegrid.
|
|
402
|
-
* @see aria-rowindex.
|
|
403
|
-
*/
|
|
404
|
-
rowCount?: number;
|
|
405
|
-
/**
|
|
406
|
-
* Defines an element's row index or position with respect to the total number of rows within a table, grid, or treegrid.
|
|
407
|
-
* @see aria-rowcount @see aria-rowspan.
|
|
408
|
-
*/
|
|
409
|
-
rowIndex?: number;
|
|
410
|
-
/**
|
|
411
|
-
* Defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid.
|
|
412
|
-
* @see aria-rowindex @see aria-colspan.
|
|
413
|
-
*/
|
|
414
|
-
rowSpan?: number;
|
|
415
|
-
/**
|
|
416
|
-
* Indicates the current "selected" state of various widgets.
|
|
417
|
-
* @see aria-checked @see aria-pressed.
|
|
418
|
-
*/
|
|
419
|
-
selected?: boolean;
|
|
420
|
-
/**
|
|
421
|
-
* Defines the number of items in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM.
|
|
422
|
-
* @see aria-posinset.
|
|
423
|
-
*/
|
|
424
|
-
setSize?: number;
|
|
425
|
-
/**
|
|
426
|
-
* Indicates if items in a table or grid are sorted in ascending or descending order.
|
|
427
|
-
*/
|
|
428
|
-
sort?: 'none' | 'ascending' | 'descending' | 'other';
|
|
429
|
-
/**
|
|
430
|
-
* Defines the maximum allowed value for a range widget.
|
|
431
|
-
*/
|
|
432
|
-
valueMax?: number;
|
|
433
|
-
/**
|
|
434
|
-
* Defines the minimum allowed value for a range widget.
|
|
435
|
-
*/
|
|
436
|
-
valueMin?: number;
|
|
437
|
-
/**
|
|
438
|
-
* Defines the current value for a range widget.
|
|
439
|
-
* @see aria-valuetext.
|
|
440
|
-
*/
|
|
441
|
-
valueNow?: number;
|
|
442
|
-
/**
|
|
443
|
-
* Defines the human readable text alternative of aria-valuenow for a range widget.
|
|
444
|
-
*/
|
|
445
|
-
valueText?: string;
|
|
446
|
-
};
|
|
447
|
-
|
|
448
|
-
declare const makeAccessible: (props: Partial<AccessibilityProps>) => Record<string, unknown>;
|
|
449
|
-
|
|
450
|
-
declare const makeBezier: (x1: number, y1: number, x2: number, y2: number) => EasingFunctionFactory;
|
|
451
|
-
|
|
452
|
-
declare function makeBorderSize<T extends number>(size: T): `${T}px`;
|
|
453
|
-
declare function makeBorderSize<T extends string>(size: T): T;
|
|
454
|
-
|
|
455
|
-
declare type MakeMotionTime<Value extends number> = Platform$1.Select<{
|
|
456
|
-
native: number;
|
|
457
|
-
web: `${Value}ms`;
|
|
458
|
-
}>;
|
|
459
|
-
|
|
460
|
-
declare const makeMotionTime: <T extends number>(time: T) => MakeMotionTime<T>;
|
|
461
|
-
|
|
462
|
-
declare type MakeSize<T extends number> = `${T}px`;
|
|
463
|
-
declare const makeSize: <T extends number>(size: T) => `${T}px`;
|
|
464
|
-
|
|
465
|
-
declare const makeSpace: <T extends number>(size: T) => `${T}px`;
|
|
466
|
-
|
|
467
|
-
declare const makeTypographySize: <T extends number>(size: T) => `${T}px`;
|
|
468
|
-
|
|
469
|
-
declare const setupMatchMediaMock: (customArgs?: {}) => void;
|
|
470
|
-
|
|
471
|
-
declare const toTitleCase: (inputString: string) => string;
|
|
472
|
-
|
|
473
123
|
declare const deviceType: {
|
|
474
124
|
readonly desktop: "desktop";
|
|
475
125
|
readonly mobile: "mobile";
|
|
@@ -490,12 +140,6 @@ declare type UseColorScheme = {
|
|
|
490
140
|
};
|
|
491
141
|
declare const useColorScheme: (initialColorScheme?: ColorSchemeNamesInput) => UseColorScheme;
|
|
492
142
|
|
|
493
|
-
/**
|
|
494
|
-
* a type-safe version of the `usePrevious` hook described here:
|
|
495
|
-
* @see {@link https://reactjs.org/docs/hooks-faq.html#how-to-get-the-previous-props-or-state}
|
|
496
|
-
*/
|
|
497
|
-
declare function usePrevious<T>(value: T): MutableRefObject<T | undefined>['current'];
|
|
498
|
-
|
|
499
143
|
declare const isReactNative: () => boolean;
|
|
500
144
|
|
|
501
145
|
declare const getOS: () => typeof Platform$2.OS;
|
|
@@ -564,44 +208,33 @@ declare const castNativeType: <T>(value: T) => Extract<T, {
|
|
|
564
208
|
__brand__?: "platform-native" | "platform-all" | undefined;
|
|
565
209
|
}>;
|
|
566
210
|
|
|
211
|
+
declare function makeBorderSize<T extends number>(size: T): `${T}px`;
|
|
212
|
+
declare function makeBorderSize<T extends string>(size: T): T;
|
|
213
|
+
|
|
214
|
+
declare type MakeMotionTime<Value extends number> = Platform$1.Select<{
|
|
215
|
+
native: number;
|
|
216
|
+
web: `${Value}ms`;
|
|
217
|
+
}>;
|
|
218
|
+
|
|
219
|
+
declare const makeMotionTime: <T extends number>(time: T) => MakeMotionTime<T>;
|
|
220
|
+
|
|
221
|
+
declare const makeSpace: <T extends number>(size: T) => `${T}px`;
|
|
222
|
+
|
|
223
|
+
declare const makeTypographySize: <T extends number>(size: T) => `${T}px`;
|
|
224
|
+
|
|
225
|
+
declare type MakeSize<T extends number> = `${T}px`;
|
|
226
|
+
declare const makeSize: <T extends number>(size: T) => `${T}px`;
|
|
227
|
+
|
|
567
228
|
/**
|
|
568
|
-
*
|
|
569
|
-
*
|
|
570
|
-
* ## Usage
|
|
571
|
-
*
|
|
572
|
-
* ### ❌ Incorrect Code (Breaks treeshaking)
|
|
573
|
-
*
|
|
574
|
-
* ```ts
|
|
575
|
-
* const _MyComponent = () => {};
|
|
576
|
-
* const MyComponent = React.forwardRef(_MyComponent);
|
|
577
|
-
* const MyComponent.displayName = 'MyComponent'; // this breaks treeshaking
|
|
578
|
-
*
|
|
579
|
-
* export { MyComponent }
|
|
580
|
-
* ```
|
|
581
|
-
*
|
|
582
|
-
* ### ✅ Correct Code (No Side-Effects. Treeshaking continues to work)
|
|
583
|
-
*
|
|
584
|
-
* ```ts
|
|
585
|
-
* const _MyComponent = () => {};
|
|
586
|
-
* const MyComponentWithRef = React.forwardRef(_MyComponent);
|
|
587
|
-
* const MyComponent = assignWithoutSideEffects(
|
|
588
|
-
* MyComponentWithRef,
|
|
589
|
-
* { displayName: 'MyComponent' }
|
|
590
|
-
* );
|
|
591
|
-
*
|
|
592
|
-
* export { MyComponent }
|
|
593
|
-
* ```
|
|
594
|
-
*
|
|
595
|
-
* Checkout other components like [Button.tsx](../../components/Button/Button/Button.tsx), [SelectInput.tsx](../../components/Input/SelectInput/SelectInput.tsx) for example.
|
|
596
|
-
*
|
|
597
|
-
* _Note: You don't have to add PURE comment to this function as it is added during build-time by our `manualPureFunctions` babel plugin_
|
|
229
|
+
* @deprecated This utility will be deprecated in subsequent version.
|
|
598
230
|
*/
|
|
599
|
-
declare const
|
|
600
|
-
displayName?: string;
|
|
601
|
-
componentId?: string;
|
|
602
|
-
}) => T;
|
|
231
|
+
declare const toTitleCase: (inputString: string) => string;
|
|
603
232
|
|
|
604
|
-
|
|
605
|
-
|
|
233
|
+
/**
|
|
234
|
+
* a type-safe version of the `usePrevious` hook described here:
|
|
235
|
+
* @see {@link https://reactjs.org/docs/hooks-faq.html#how-to-get-the-previous-props-or-state}
|
|
236
|
+
* @deprecated This utility will be deprecated in subsequent version.
|
|
237
|
+
*/
|
|
238
|
+
declare function usePrevious<T>(value: T): MutableRefObject<T | undefined>['current'];
|
|
606
239
|
|
|
607
|
-
export {
|
|
240
|
+
export { MakeSize, Platform, PlatformTypes, UseColorScheme, castNativeType, castWebType, getColorScheme, getMediaQuery, getOS, getPlatformType, isAndroid, isReactNative, makeBorderSize, makeMotionTime, makeSize, makeSpace, makeTypographySize, toTitleCase, useBreakpoint, useColorScheme, usePrevious };
|