@bacon-pos/ui 0.2.1 → 0.4.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/lib/commonjs/components/Dialog/Dialog.js +234 -0
- package/lib/commonjs/components/Dialog/Dialog.js.map +1 -0
- package/lib/commonjs/components/Dialog/Dialog.stories.js +217 -0
- package/lib/commonjs/components/Dialog/Dialog.stories.js.map +1 -0
- package/lib/commonjs/components/Dialog/Dialog.test.js +71 -0
- package/lib/commonjs/components/Dialog/Dialog.test.js.map +1 -0
- package/lib/commonjs/components/Dialog/index.js +13 -0
- package/lib/commonjs/components/Dialog/index.js.map +1 -0
- package/lib/commonjs/components/Toast/Toast.js +184 -0
- package/lib/commonjs/components/Toast/Toast.js.map +1 -0
- package/lib/commonjs/components/Toast/Toast.stories.js +109 -0
- package/lib/commonjs/components/Toast/Toast.stories.js.map +1 -0
- package/lib/commonjs/components/Toast/Toast.test.js +70 -0
- package/lib/commonjs/components/Toast/Toast.test.js.map +1 -0
- package/lib/commonjs/components/Toast/ToastProvider.js +95 -0
- package/lib/commonjs/components/Toast/ToastProvider.js.map +1 -0
- package/lib/commonjs/components/Toast/index.js +26 -0
- package/lib/commonjs/components/Toast/index.js.map +1 -0
- package/lib/commonjs/components/_internal/ScrollArea.js +96 -0
- package/lib/commonjs/components/_internal/ScrollArea.js.map +1 -0
- package/lib/commonjs/components/index.js +33 -11
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/module/components/Dialog/Dialog.js +230 -0
- package/lib/module/components/Dialog/Dialog.js.map +1 -0
- package/lib/module/components/Dialog/Dialog.stories.js +213 -0
- package/lib/module/components/Dialog/Dialog.stories.js.map +1 -0
- package/lib/module/components/Dialog/Dialog.test.js +70 -0
- package/lib/module/components/Dialog/Dialog.test.js.map +1 -0
- package/lib/module/components/Dialog/index.js +4 -0
- package/lib/module/components/Dialog/index.js.map +1 -0
- package/lib/module/components/Toast/Toast.js +180 -0
- package/lib/module/components/Toast/Toast.js.map +1 -0
- package/lib/module/components/Toast/Toast.stories.js +105 -0
- package/lib/module/components/Toast/Toast.stories.js.map +1 -0
- package/lib/module/components/Toast/Toast.test.js +69 -0
- package/lib/module/components/Toast/Toast.test.js.map +1 -0
- package/lib/module/components/Toast/ToastProvider.js +90 -0
- package/lib/module/components/Toast/ToastProvider.js.map +1 -0
- package/lib/module/components/Toast/index.js +5 -0
- package/lib/module/components/Toast/index.js.map +1 -0
- package/lib/module/components/_internal/ScrollArea.js +92 -0
- package/lib/module/components/_internal/ScrollArea.js.map +1 -0
- package/lib/module/components/index.js +2 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/typescript/commonjs/components/Dialog/Dialog.d.ts +79 -0
- package/lib/typescript/commonjs/components/Dialog/Dialog.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Dialog/index.d.ts +2 -0
- package/lib/typescript/commonjs/components/Dialog/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Toast/Toast.d.ts +40 -0
- package/lib/typescript/commonjs/components/Toast/Toast.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Toast/ToastProvider.d.ts +34 -0
- package/lib/typescript/commonjs/components/Toast/ToastProvider.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Toast/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Toast/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/_internal/ScrollArea.d.ts +20 -0
- package/lib/typescript/commonjs/components/_internal/ScrollArea.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/index.d.ts +2 -0
- package/lib/typescript/commonjs/components/index.d.ts.map +1 -1
- package/lib/typescript/module/components/Dialog/Dialog.d.ts +79 -0
- package/lib/typescript/module/components/Dialog/Dialog.d.ts.map +1 -0
- package/lib/typescript/module/components/Dialog/index.d.ts +2 -0
- package/lib/typescript/module/components/Dialog/index.d.ts.map +1 -0
- package/lib/typescript/module/components/Toast/Toast.d.ts +40 -0
- package/lib/typescript/module/components/Toast/Toast.d.ts.map +1 -0
- package/lib/typescript/module/components/Toast/ToastProvider.d.ts +34 -0
- package/lib/typescript/module/components/Toast/ToastProvider.d.ts.map +1 -0
- package/lib/typescript/module/components/Toast/index.d.ts +3 -0
- package/lib/typescript/module/components/Toast/index.d.ts.map +1 -0
- package/lib/typescript/module/components/_internal/ScrollArea.d.ts +20 -0
- package/lib/typescript/module/components/_internal/ScrollArea.d.ts.map +1 -0
- package/lib/typescript/module/components/index.d.ts +2 -0
- package/lib/typescript/module/components/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/Dialog/Dialog.tsx +299 -0
- package/src/components/Dialog/index.ts +6 -0
- package/src/components/Toast/Toast.tsx +173 -0
- package/src/components/Toast/ToastProvider.tsx +126 -0
- package/src/components/Toast/index.ts +7 -0
- package/src/components/_internal/ScrollArea.tsx +95 -0
- package/src/components/index.ts +2 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useRef","useState","Animated","jsx","_jsx","jsxs","_jsxs","ScrollArea","children","indicatorColor","indicatorWidth","keyboardShouldPersistTaps","keyboardDismissMode","style","contentContainerStyle","viewportH","setViewportH","contentH","setContentH","scrollY","Value","current","opacity","hideTimer","scrollable","thumbH","Math","max","maxScroll","translateY","interpolate","inputRange","outputRange","extrapolate","reveal","timing","toValue","duration","useNativeDriver","start","clearTimeout","setTimeout","View","position","ScrollView","flexShrink","showsVerticalScrollIndicator","scrollEventThrottle","onLayout","e","nativeEvent","layout","height","onContentSizeChange","_w","h","onScroll","event","contentOffset","y","listener","_e","pointerEvents","top","right","width","borderRadius","backgroundColor","transform"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/_internal/ScrollArea.tsx"],"mappings":";;AAAA,SAASA,MAAM,EAAEC,QAAQ,QAAwB,OAAO;AACxD,SACEC,QAAQ,QAKH,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AActB;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,UAAU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,CAACwC,IAAI;MACZoB,aAAa,EAAC,MAAM;MACpBjD,KAAK,EAAE;QACL8B,QAAQ,EAAE,UAAU;QACpBoB,GAAG,EAAE,CAAC;QACNC,KAAK,EAAE,CAAC;QACRC,KAAK,EAAEvD,cAAc;QACrB0C,MAAM,EAAE3B,MAAM;QACdyC,YAAY,EAAExD,cAAc,GAAG,CAAC;QAChCyD,eAAe,EAAE1D,cAAc;QAC/Ba,OAAO;QACP8C,SAAS,EAAE,CAAC;UAAEvC;QAAW,CAAC;MAC5B;IAAE,CACH,CAAC,GACA,IAAI;EAAA,CACK,CAAC;AAEpB","ignoreList":[]}
|
|
@@ -8,6 +8,7 @@ export * from "./Checkbox/index.js";
|
|
|
8
8
|
export * from "./Chip/index.js";
|
|
9
9
|
export * from "./CodeField/index.js";
|
|
10
10
|
export * from "./CodeInput/index.js";
|
|
11
|
+
export * from "./Dialog/index.js";
|
|
11
12
|
export * from "./Icon/index.js";
|
|
12
13
|
export * from "./IconButton/index.js";
|
|
13
14
|
export * from "./Input/index.js";
|
|
@@ -19,4 +20,5 @@ export * from "./Spinner/index.js";
|
|
|
19
20
|
export * from "./Surface/index.js";
|
|
20
21
|
export * from "./Switch/index.js";
|
|
21
22
|
export * from "./Text/index.js";
|
|
23
|
+
export * from "./Toast/index.js";
|
|
22
24
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"..\\..\\..\\src","sources":["components/index.ts"],"mappings":";;AAAA,cAAc,mBAAU;AACxB,cAAc,kBAAS;AACvB,cAAc,mBAAU;AACxB,cAAc,iBAAQ;AACtB,cAAc,qBAAY;AAC1B,cAAc,iBAAQ;AACtB,cAAc,sBAAa;AAC3B,cAAc,sBAAa;AAC3B,cAAc,iBAAQ;AACtB,cAAc,uBAAc;AAC5B,cAAc,kBAAS;AACvB,cAAc,uBAAc;AAC5B,cAAc,wBAAe;AAC7B,cAAc,4BAAmB;AACjC,cAAc,kBAAS;AACvB,cAAc,oBAAW;AACzB,cAAc,oBAAW;AACzB,cAAc,mBAAU;AACxB,cAAc,iBAAQ","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"..\\..\\..\\src","sources":["components/index.ts"],"mappings":";;AAAA,cAAc,mBAAU;AACxB,cAAc,kBAAS;AACvB,cAAc,mBAAU;AACxB,cAAc,iBAAQ;AACtB,cAAc,qBAAY;AAC1B,cAAc,iBAAQ;AACtB,cAAc,sBAAa;AAC3B,cAAc,sBAAa;AAC3B,cAAc,mBAAU;AACxB,cAAc,iBAAQ;AACtB,cAAc,uBAAc;AAC5B,cAAc,kBAAS;AACvB,cAAc,uBAAc;AAC5B,cAAc,wBAAe;AAC7B,cAAc,4BAAmB;AACjC,cAAc,kBAAS;AACvB,cAAc,oBAAW;AACzB,cAAc,oBAAW;AACzB,cAAc,mBAAU;AACxB,cAAc,iBAAQ;AACtB,cAAc,kBAAS","ignoreList":[]}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type StyleProp, type ViewStyle } from 'react-native';
|
|
3
|
+
import { type ButtonVariant } from '../Button/Button';
|
|
4
|
+
export interface DialogAction {
|
|
5
|
+
label: string;
|
|
6
|
+
onPress?: () => void;
|
|
7
|
+
/** Button variant. Defaults to `default` (lime). Pass another for other colors. */
|
|
8
|
+
variant?: ButtonVariant;
|
|
9
|
+
loading?: boolean;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface DialogCancelConfig {
|
|
13
|
+
/** Cancel label. Defaults to "Cancel". */
|
|
14
|
+
label?: string;
|
|
15
|
+
/** Handler. Defaults to `onClose`. */
|
|
16
|
+
onPress?: () => void;
|
|
17
|
+
/** Use the destructive style (subtle red) instead of the neutral secondary. */
|
|
18
|
+
destructive?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface DialogProps {
|
|
21
|
+
/** Whether the dialog is shown. */
|
|
22
|
+
visible: boolean;
|
|
23
|
+
/** Called on backdrop press, close button, or Android back. */
|
|
24
|
+
onClose: () => void;
|
|
25
|
+
/** Required title. */
|
|
26
|
+
title: string;
|
|
27
|
+
/** Optional subtitle. */
|
|
28
|
+
subtitle?: string;
|
|
29
|
+
/** Any content — from text to a full form. */
|
|
30
|
+
children?: ReactNode;
|
|
31
|
+
/** Primary/secondary action buttons (right side). Keep total buttons ≤ 3. */
|
|
32
|
+
actions?: DialogAction[];
|
|
33
|
+
/** Optional cancel button (left side). */
|
|
34
|
+
cancel?: DialogCancelConfig;
|
|
35
|
+
/** Show the top-right close (×). Defaults to true. */
|
|
36
|
+
showClose?: boolean;
|
|
37
|
+
/** Render the close (×) in the destructive color. */
|
|
38
|
+
closeDestructive?: boolean;
|
|
39
|
+
/** Dismiss when the backdrop (overlay) is pressed. Defaults to false. */
|
|
40
|
+
dismissOnBackdrop?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* `inner` (default): the card caps at the screen height and its content
|
|
43
|
+
* scrolls inside. `page`: the card grows to its content and the whole modal
|
|
44
|
+
* scrolls (nothing behind moves) — better for short screens.
|
|
45
|
+
*/
|
|
46
|
+
scrollMode?: 'inner' | 'page';
|
|
47
|
+
/** Keep the header pinned while content scrolls (inner mode). Defaults to true. */
|
|
48
|
+
stickyHeader?: boolean;
|
|
49
|
+
/** Keep the footer pinned while content scrolls (inner mode). Defaults to true. */
|
|
50
|
+
stickyFooter?: boolean;
|
|
51
|
+
/** Inner padding. Defaults to 24. */
|
|
52
|
+
padding?: number;
|
|
53
|
+
/** Vertical space between header↔content and content↔footer. Defaults to 24. */
|
|
54
|
+
contentSpacing?: number;
|
|
55
|
+
/** Corner radius. Defaults to 24. */
|
|
56
|
+
radius?: number;
|
|
57
|
+
/** Max width of the dialog card. Defaults to 560. */
|
|
58
|
+
maxWidth?: number;
|
|
59
|
+
/** Fixed card width (overrides `maxWidth`). */
|
|
60
|
+
width?: number;
|
|
61
|
+
/** Fill the whole screen — for small devices. Overrides width/maxWidth/scrollMode. */
|
|
62
|
+
fullscreen?: boolean;
|
|
63
|
+
/** Fraction of screen height the card may occupy (inner mode). Defaults to 0.9. */
|
|
64
|
+
maxHeightRatio?: number;
|
|
65
|
+
/** Scroll indicator color (a design-system color). Defaults to a subtle neutral. */
|
|
66
|
+
scrollbarColor?: string;
|
|
67
|
+
/** Override the card style. */
|
|
68
|
+
style?: StyleProp<ViewStyle>;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Dialog — an accessible, keyboard-aware modal that can hold anything from a
|
|
72
|
+
* short message to a full form (selects, date pickers, etc. keep working thanks
|
|
73
|
+
* to `keyboardShouldPersistTaps`). Content scrolls with an elegant thin,
|
|
74
|
+
* auto-hiding indicator. `scrollMode="page"` scrolls the whole modal on short
|
|
75
|
+
* screens instead of scrolling inside the card. Footer composes the
|
|
76
|
+
* design-system `Button`.
|
|
77
|
+
*/
|
|
78
|
+
export declare function Dialog({ visible, onClose, title, subtitle, children, actions, cancel, showClose, closeDestructive, dismissOnBackdrop, scrollMode, stickyHeader, stickyFooter, padding, contentSpacing, radius, maxWidth, width, fullscreen, maxHeightRatio, scrollbarColor, style, }: DialogProps): import("react/jsx-runtime").JSX.Element;
|
|
79
|
+
//# sourceMappingURL=Dialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../../../../src/components/Dialog/Dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EASL,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAU,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAK9D,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,mFAAmF;IACnF,OAAO,CAAC,EAAE,aAAa,CA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;IACf,sFAAsF;IACtF,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,mFAAmF;IACnF,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oFAAoF;IACpF,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,+BAA+B;IAC/B,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED;;;;;;;GAOG;AACH,wBAAgB,MAAM,CAAC,EACrB,OAAO,EACP,OAAO,EACP,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,OAAY,EACZ,MAAM,EACN,SAAgB,EAChB,gBAAwB,EACxB,iBAAyB,EACzB,UAAoB,EACpB,YAAmB,EACnB,YAAmB,EACnB,OAAY,EACZ,cAAmB,EACnB,MAAW,EACX,QAAc,EACd,KAAK,EACL,UAAkB,EAClB,cAAoB,EACpB,cAAc,EACd,KAAK,GACN,EAAE,WAAW,2CAmLb"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Dialog/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,kBAAkB,GACxB,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { IconName } from '../Icon/icons.generated';
|
|
2
|
+
/** Built-in statuses. More can be added later, or use custom colors. */
|
|
3
|
+
export type ToastStatus = 'success' | 'error' | 'warning' | 'info';
|
|
4
|
+
export interface ToastOptions {
|
|
5
|
+
/** Message text. Ellipsized on a single line if it overflows. */
|
|
6
|
+
message: string;
|
|
7
|
+
/** Visual status. Defaults to `info`. */
|
|
8
|
+
status?: ToastStatus;
|
|
9
|
+
/** Optional leading icon. */
|
|
10
|
+
icon?: IconName;
|
|
11
|
+
/** Time on screen in ms. `0` keeps it until dismissed. */
|
|
12
|
+
duration?: number;
|
|
13
|
+
/** Custom fixed height. */
|
|
14
|
+
height?: number;
|
|
15
|
+
/** Custom fixed width. Defaults to full width. */
|
|
16
|
+
width?: number;
|
|
17
|
+
/** Show a countdown progress bar for the remaining time (needs duration > 0). */
|
|
18
|
+
showProgress?: boolean;
|
|
19
|
+
/** Custom background (overrides status). */
|
|
20
|
+
backgroundColor?: string;
|
|
21
|
+
/** Custom text/icon color (overrides status). */
|
|
22
|
+
color?: string;
|
|
23
|
+
/** Countdown bar color. Defaults to the status foreground. */
|
|
24
|
+
progressColor?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface ToastViewProps extends ToastOptions {
|
|
27
|
+
id: number;
|
|
28
|
+
position: 'top' | 'bottom';
|
|
29
|
+
/** When true, the toast animates out and then calls `onRemove`. */
|
|
30
|
+
leaving: boolean;
|
|
31
|
+
onRequestClose: (id: number) => void;
|
|
32
|
+
onRemove: (id: number) => void;
|
|
33
|
+
maxWidth?: number;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* A single toast with an elegant slide + fade in/out. Self-contained: it runs
|
|
37
|
+
* its own duration timer and exit animation. Managed by `ToastProvider`.
|
|
38
|
+
*/
|
|
39
|
+
export declare function ToastView({ id, message, status, icon, duration, height, width, showProgress, backgroundColor, color, progressColor, position, leaving, onRequestClose, onRemove, maxWidth, }: ToastViewProps): import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
//# sourceMappingURL=Toast.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Toast.d.ts","sourceRoot":"","sources":["../../../../../src/components/Toast/Toast.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAGxD,wEAAwE;AACxE,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;AAEnE,MAAM,WAAW,YAAY;IAC3B,iEAAiE;IACjE,OAAO,EAAE,MAAM,CAAC;IAChB,yCAAyC;IACzC,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,6BAA6B;IAC7B,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,2BAA2B;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kDAAkD;IAClD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iFAAiF;IACjF,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,4CAA4C;IAC5C,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,iDAAiD;IACjD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8DAA8D;IAC9D,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAgBD,MAAM,WAAW,cAAe,SAAQ,YAAY;IAClD,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,KAAK,GAAG,QAAQ,CAAC;IAC3B,mEAAmE;IACnE,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,EACxB,EAAE,EACF,OAAO,EACP,MAAe,EACf,IAAI,EACJ,QAAe,EACf,MAAM,EACN,KAAK,EACL,YAAoB,EACpB,eAAe,EACf,KAAK,EACL,aAAa,EACb,QAAQ,EACR,OAAO,EACP,cAAc,EACd,QAAQ,EACR,QAAQ,GACT,EAAE,cAAc,2CAuFhB"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type ToastOptions } from './Toast';
|
|
3
|
+
export interface ToastApi {
|
|
4
|
+
/** Show a toast; returns its id. */
|
|
5
|
+
show: (options: ToastOptions) => number;
|
|
6
|
+
/** Dismiss a toast by id (animates out). */
|
|
7
|
+
hide: (id: number) => void;
|
|
8
|
+
/** Dismiss all toasts. */
|
|
9
|
+
hideAll: () => void;
|
|
10
|
+
}
|
|
11
|
+
export interface ToastProviderProps {
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
/** Where toasts appear. Defaults to `bottom`. */
|
|
14
|
+
position?: 'top' | 'bottom';
|
|
15
|
+
/** Max toasts on screen at once. Defaults to 2. */
|
|
16
|
+
maxVisible?: number;
|
|
17
|
+
/** Default time on screen in ms. Defaults to 3000. */
|
|
18
|
+
duration?: number;
|
|
19
|
+
/** Distance from the screen edge. Defaults to 24. */
|
|
20
|
+
offset?: number;
|
|
21
|
+
/** Gap between stacked toasts. Defaults to 8. */
|
|
22
|
+
gap?: number;
|
|
23
|
+
/** Max toast width. Defaults to full width (no cap). */
|
|
24
|
+
maxWidth?: number;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Provides the imperative toast API and renders the toast stack. Wrap your app
|
|
28
|
+
* (inside ThemeProvider). Trigger toasts with `useToast().show(...)`. Newest
|
|
29
|
+
* toasts appear nearest the edge; at most `maxVisible` show at once.
|
|
30
|
+
*/
|
|
31
|
+
export declare function ToastProvider({ children, position, maxVisible, duration, offset, gap, maxWidth, }: ToastProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
/** Access the toast API. Must be used within a `ToastProvider`. */
|
|
33
|
+
export declare function useToast(): ToastApi;
|
|
34
|
+
//# sourceMappingURL=ToastProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToastProvider.d.ts","sourceRoot":"","sources":["../../../../../src/components/Toast/ToastProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,EAAa,KAAK,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvD,MAAM,WAAW,QAAQ;IACvB,oCAAoC;IACpC,IAAI,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,MAAM,CAAC;IACxC,4CAA4C;IAC5C,IAAI,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3B,0BAA0B;IAC1B,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AASD,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,SAAS,CAAC;IACpB,iDAAiD;IACjD,QAAQ,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;IAC5B,mDAAmD;IACnD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,sDAAsD;IACtD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,qDAAqD;IACrD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iDAAiD;IACjD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,wDAAwD;IACxD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,QAAmB,EACnB,UAAc,EACd,QAAe,EACf,MAAW,EACX,GAAO,EACP,QAAQ,GACT,EAAE,kBAAkB,2CA6DpB;AAED,mEAAmE;AACnE,wBAAgB,QAAQ,IAAI,QAAQ,CAInC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Toast/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,YAAY,EAAE,KAAK,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,SAAS,CAAC;AAC9F,OAAO,EACL,aAAa,EACb,QAAQ,EACR,KAAK,QAAQ,EACb,KAAK,kBAAkB,GACxB,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type StyleProp, type ViewStyle } from 'react-native';
|
|
3
|
+
export interface ScrollAreaProps {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
/** Thin indicator color (a design-system color). */
|
|
6
|
+
indicatorColor: string;
|
|
7
|
+
/** Indicator thickness. Defaults to 4. */
|
|
8
|
+
indicatorWidth?: number;
|
|
9
|
+
keyboardShouldPersistTaps?: 'always' | 'never' | 'handled';
|
|
10
|
+
keyboardDismissMode?: 'none' | 'on-drag' | 'interactive';
|
|
11
|
+
style?: StyleProp<ViewStyle>;
|
|
12
|
+
contentContainerStyle?: StyleProp<ViewStyle>;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* ScrollView with an elegant custom vertical indicator: thin, rounded, colored,
|
|
16
|
+
* and only visible while scrolling (fades out when idle). The native indicator
|
|
17
|
+
* is hidden so it looks the same on iOS, Android and web.
|
|
18
|
+
*/
|
|
19
|
+
export declare function ScrollArea({ children, indicatorColor, indicatorWidth, keyboardShouldPersistTaps, keyboardDismissMode, style, contentContainerStyle, }: ScrollAreaProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
//# sourceMappingURL=ScrollArea.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScrollArea.d.ts","sourceRoot":"","sources":["../../../../../src/components/_internal/ScrollArea.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAIL,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAEtB,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,SAAS,CAAC;IACpB,oDAAoD;IACpD,cAAc,EAAE,MAAM,CAAC;IACvB,0CAA0C;IAC1C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,yBAAyB,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,SAAS,CAAC;IAC3D,mBAAmB,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,aAAa,CAAC;IACzD,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,qBAAqB,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9C;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,EACzB,QAAQ,EACR,cAAc,EACd,cAAkB,EAClB,yBAAyB,EACzB,mBAAmB,EACnB,KAAK,EACL,qBAAqB,GACtB,EAAE,eAAe,2CA4DjB"}
|
|
@@ -6,6 +6,7 @@ export * from './Checkbox';
|
|
|
6
6
|
export * from './Chip';
|
|
7
7
|
export * from './CodeField';
|
|
8
8
|
export * from './CodeInput';
|
|
9
|
+
export * from './Dialog';
|
|
9
10
|
export * from './Icon';
|
|
10
11
|
export * from './IconButton';
|
|
11
12
|
export * from './Input';
|
|
@@ -17,5 +18,6 @@ export * from './Spinner';
|
|
|
17
18
|
export * from './Surface';
|
|
18
19
|
export * from './Switch';
|
|
19
20
|
export * from './Text';
|
|
21
|
+
export * from './Toast';
|
|
20
22
|
export type { LabelPosition } from './_internal/Labeled';
|
|
21
23
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AAExB,YAAY,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type StyleProp, type ViewStyle } from 'react-native';
|
|
3
|
+
import { type ButtonVariant } from '../Button/Button';
|
|
4
|
+
export interface DialogAction {
|
|
5
|
+
label: string;
|
|
6
|
+
onPress?: () => void;
|
|
7
|
+
/** Button variant. Defaults to `default` (lime). Pass another for other colors. */
|
|
8
|
+
variant?: ButtonVariant;
|
|
9
|
+
loading?: boolean;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface DialogCancelConfig {
|
|
13
|
+
/** Cancel label. Defaults to "Cancel". */
|
|
14
|
+
label?: string;
|
|
15
|
+
/** Handler. Defaults to `onClose`. */
|
|
16
|
+
onPress?: () => void;
|
|
17
|
+
/** Use the destructive style (subtle red) instead of the neutral secondary. */
|
|
18
|
+
destructive?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface DialogProps {
|
|
21
|
+
/** Whether the dialog is shown. */
|
|
22
|
+
visible: boolean;
|
|
23
|
+
/** Called on backdrop press, close button, or Android back. */
|
|
24
|
+
onClose: () => void;
|
|
25
|
+
/** Required title. */
|
|
26
|
+
title: string;
|
|
27
|
+
/** Optional subtitle. */
|
|
28
|
+
subtitle?: string;
|
|
29
|
+
/** Any content — from text to a full form. */
|
|
30
|
+
children?: ReactNode;
|
|
31
|
+
/** Primary/secondary action buttons (right side). Keep total buttons ≤ 3. */
|
|
32
|
+
actions?: DialogAction[];
|
|
33
|
+
/** Optional cancel button (left side). */
|
|
34
|
+
cancel?: DialogCancelConfig;
|
|
35
|
+
/** Show the top-right close (×). Defaults to true. */
|
|
36
|
+
showClose?: boolean;
|
|
37
|
+
/** Render the close (×) in the destructive color. */
|
|
38
|
+
closeDestructive?: boolean;
|
|
39
|
+
/** Dismiss when the backdrop (overlay) is pressed. Defaults to false. */
|
|
40
|
+
dismissOnBackdrop?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* `inner` (default): the card caps at the screen height and its content
|
|
43
|
+
* scrolls inside. `page`: the card grows to its content and the whole modal
|
|
44
|
+
* scrolls (nothing behind moves) — better for short screens.
|
|
45
|
+
*/
|
|
46
|
+
scrollMode?: 'inner' | 'page';
|
|
47
|
+
/** Keep the header pinned while content scrolls (inner mode). Defaults to true. */
|
|
48
|
+
stickyHeader?: boolean;
|
|
49
|
+
/** Keep the footer pinned while content scrolls (inner mode). Defaults to true. */
|
|
50
|
+
stickyFooter?: boolean;
|
|
51
|
+
/** Inner padding. Defaults to 24. */
|
|
52
|
+
padding?: number;
|
|
53
|
+
/** Vertical space between header↔content and content↔footer. Defaults to 24. */
|
|
54
|
+
contentSpacing?: number;
|
|
55
|
+
/** Corner radius. Defaults to 24. */
|
|
56
|
+
radius?: number;
|
|
57
|
+
/** Max width of the dialog card. Defaults to 560. */
|
|
58
|
+
maxWidth?: number;
|
|
59
|
+
/** Fixed card width (overrides `maxWidth`). */
|
|
60
|
+
width?: number;
|
|
61
|
+
/** Fill the whole screen — for small devices. Overrides width/maxWidth/scrollMode. */
|
|
62
|
+
fullscreen?: boolean;
|
|
63
|
+
/** Fraction of screen height the card may occupy (inner mode). Defaults to 0.9. */
|
|
64
|
+
maxHeightRatio?: number;
|
|
65
|
+
/** Scroll indicator color (a design-system color). Defaults to a subtle neutral. */
|
|
66
|
+
scrollbarColor?: string;
|
|
67
|
+
/** Override the card style. */
|
|
68
|
+
style?: StyleProp<ViewStyle>;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Dialog — an accessible, keyboard-aware modal that can hold anything from a
|
|
72
|
+
* short message to a full form (selects, date pickers, etc. keep working thanks
|
|
73
|
+
* to `keyboardShouldPersistTaps`). Content scrolls with an elegant thin,
|
|
74
|
+
* auto-hiding indicator. `scrollMode="page"` scrolls the whole modal on short
|
|
75
|
+
* screens instead of scrolling inside the card. Footer composes the
|
|
76
|
+
* design-system `Button`.
|
|
77
|
+
*/
|
|
78
|
+
export declare function Dialog({ visible, onClose, title, subtitle, children, actions, cancel, showClose, closeDestructive, dismissOnBackdrop, scrollMode, stickyHeader, stickyFooter, padding, contentSpacing, radius, maxWidth, width, fullscreen, maxHeightRatio, scrollbarColor, style, }: DialogProps): import("react/jsx-runtime").JSX.Element;
|
|
79
|
+
//# sourceMappingURL=Dialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../../../../src/components/Dialog/Dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EASL,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAU,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAK9D,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,mFAAmF;IACnF,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,OAAO,CAAC,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AAU,CAAC,EAAE,OAAO,CAAC;IACrB,mFAAmF;IACnF,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oFAAoF;IACpF,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,+BAA+B;IAC/B,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED;;;;;;;GAOG;AACH,wBAAgB,MAAM,CAAC,EACrB,OAAO,EACP,OAAO,EACP,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,OAAY,EACZ,MAAM,EACN,SAAgB,EAChB,gBAAwB,EACxB,iBAAyB,EACzB,UAAoB,EACpB,YAAmB,EACnB,YAAmB,EACnB,OAAY,EACZ,cAAmB,EACnB,MAAW,EACX,QAAc,EACd,KAAK,EACL,UAAkB,EAClB,cAAoB,EACpB,cAAc,EACd,KAAK,GACN,EAAE,WAAW,2CAmLb"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Dialog/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,kBAAkB,GACxB,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { IconName } from '../Icon/icons.generated';
|
|
2
|
+
/** Built-in statuses. More can be added later, or use custom colors. */
|
|
3
|
+
export type ToastStatus = 'success' | 'error' | 'warning' | 'info';
|
|
4
|
+
export interface ToastOptions {
|
|
5
|
+
/** Message text. Ellipsized on a single line if it overflows. */
|
|
6
|
+
message: string;
|
|
7
|
+
/** Visual status. Defaults to `info`. */
|
|
8
|
+
status?: ToastStatus;
|
|
9
|
+
/** Optional leading icon. */
|
|
10
|
+
icon?: IconName;
|
|
11
|
+
/** Time on screen in ms. `0` keeps it until dismissed. */
|
|
12
|
+
duration?: number;
|
|
13
|
+
/** Custom fixed height. */
|
|
14
|
+
height?: number;
|
|
15
|
+
/** Custom fixed width. Defaults to full width. */
|
|
16
|
+
width?: number;
|
|
17
|
+
/** Show a countdown progress bar for the remaining time (needs duration > 0). */
|
|
18
|
+
showProgress?: boolean;
|
|
19
|
+
/** Custom background (overrides status). */
|
|
20
|
+
backgroundColor?: string;
|
|
21
|
+
/** Custom text/icon color (overrides status). */
|
|
22
|
+
color?: string;
|
|
23
|
+
/** Countdown bar color. Defaults to the status foreground. */
|
|
24
|
+
progressColor?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface ToastViewProps extends ToastOptions {
|
|
27
|
+
id: number;
|
|
28
|
+
position: 'top' | 'bottom';
|
|
29
|
+
/** When true, the toast animates out and then calls `onRemove`. */
|
|
30
|
+
leaving: boolean;
|
|
31
|
+
onRequestClose: (id: number) => void;
|
|
32
|
+
onRemove: (id: number) => void;
|
|
33
|
+
maxWidth?: number;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* A single toast with an elegant slide + fade in/out. Self-contained: it runs
|
|
37
|
+
* its own duration timer and exit animation. Managed by `ToastProvider`.
|
|
38
|
+
*/
|
|
39
|
+
export declare function ToastView({ id, message, status, icon, duration, height, width, showProgress, backgroundColor, color, progressColor, position, leaving, onRequestClose, onRemove, maxWidth, }: ToastViewProps): import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
//# sourceMappingURL=Toast.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Toast.d.ts","sourceRoot":"","sources":["../../../../../src/components/Toast/Toast.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAGxD,wEAAwE;AACxE,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;AAEnE,MAAM,WAAW,YAAY;IAC3B,iEAAiE;IACjE,OAAO,EAAE,MAAM,CAAC;IAChB,yCAAyC;IACzC,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,6BAA6B;IAC7B,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,2BAA2B;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kDAAkD;IAClD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iFAAiF;IACjF,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,4CAA4C;IAC5C,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,iDAAiD;IACjD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8DAA8D;IAC9D,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAgBD,MAAM,WAAW,cAAe,SAAQ,YAAY;IAClD,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,KAAK,GAAG,QAAQ,CAAC;IAC3B,mEAAmE;IACnE,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,EACxB,EAAE,EACF,OAAO,EACP,MAAe,EACf,IAAI,EACJ,QAAe,EACf,MAAM,EACN,KAAK,EACL,YAAoB,EACpB,eAAe,EACf,KAAK,EACL,aAAa,EACb,QAAQ,EACR,OAAO,EACP,cAAc,EACd,QAAQ,EACR,QAAQ,GACT,EAAE,cAAc,2CAuFhB"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type ToastOptions } from './Toast';
|
|
3
|
+
export interface ToastApi {
|
|
4
|
+
/** Show a toast; returns its id. */
|
|
5
|
+
show: (options: ToastOptions) => number;
|
|
6
|
+
/** Dismiss a toast by id (animates out). */
|
|
7
|
+
hide: (id: number) => void;
|
|
8
|
+
/** Dismiss all toasts. */
|
|
9
|
+
hideAll: () => void;
|
|
10
|
+
}
|
|
11
|
+
export interface ToastProviderProps {
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
/** Where toasts appear. Defaults to `bottom`. */
|
|
14
|
+
position?: 'top' | 'bottom';
|
|
15
|
+
/** Max toasts on screen at once. Defaults to 2. */
|
|
16
|
+
maxVisible?: number;
|
|
17
|
+
/** Default time on screen in ms. Defaults to 3000. */
|
|
18
|
+
duration?: number;
|
|
19
|
+
/** Distance from the screen edge. Defaults to 24. */
|
|
20
|
+
offset?: number;
|
|
21
|
+
/** Gap between stacked toasts. Defaults to 8. */
|
|
22
|
+
gap?: number;
|
|
23
|
+
/** Max toast width. Defaults to full width (no cap). */
|
|
24
|
+
maxWidth?: number;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Provides the imperative toast API and renders the toast stack. Wrap your app
|
|
28
|
+
* (inside ThemeProvider). Trigger toasts with `useToast().show(...)`. Newest
|
|
29
|
+
* toasts appear nearest the edge; at most `maxVisible` show at once.
|
|
30
|
+
*/
|
|
31
|
+
export declare function ToastProvider({ children, position, maxVisible, duration, offset, gap, maxWidth, }: ToastProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
/** Access the toast API. Must be used within a `ToastProvider`. */
|
|
33
|
+
export declare function useToast(): ToastApi;
|
|
34
|
+
//# sourceMappingURL=ToastProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToastProvider.d.ts","sourceRoot":"","sources":["../../../../../src/components/Toast/ToastProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,EAAa,KAAK,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvD,MAAM,WAAW,QAAQ;IACvB,oCAAoC;IACpC,IAAI,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,MAAM,CAAC;IACxC,4CAA4C;IAC5C,IAAI,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3B,0BAA0B;IAC1B,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AASD,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,SAAS,CAAC;IACpB,iDAAiD;IACjD,QAAQ,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;IAC5B,mDAAmD;IACnD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,sDAAsD;IACtD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,qDAAqD;IACrD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iDAAiD;IACjD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,wDAAwD;IACxD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,QAAmB,EACnB,UAAc,EACd,QAAe,EACf,MAAW,EACX,GAAO,EACP,QAAQ,GACT,EAAE,kBAAkB,2CA6DpB;AAED,mEAAmE;AACnE,wBAAgB,QAAQ,IAAI,QAAQ,CAInC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Toast/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,YAAY,EAAE,KAAK,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,SAAS,CAAC;AAC9F,OAAO,EACL,aAAa,EACb,QAAQ,EACR,KAAK,QAAQ,EACb,KAAK,kBAAkB,GACxB,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type StyleProp, type ViewStyle } from 'react-native';
|
|
3
|
+
export interface ScrollAreaProps {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
/** Thin indicator color (a design-system color). */
|
|
6
|
+
indicatorColor: string;
|
|
7
|
+
/** Indicator thickness. Defaults to 4. */
|
|
8
|
+
indicatorWidth?: number;
|
|
9
|
+
keyboardShouldPersistTaps?: 'always' | 'never' | 'handled';
|
|
10
|
+
keyboardDismissMode?: 'none' | 'on-drag' | 'interactive';
|
|
11
|
+
style?: StyleProp<ViewStyle>;
|
|
12
|
+
contentContainerStyle?: StyleProp<ViewStyle>;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* ScrollView with an elegant custom vertical indicator: thin, rounded, colored,
|
|
16
|
+
* and only visible while scrolling (fades out when idle). The native indicator
|
|
17
|
+
* is hidden so it looks the same on iOS, Android and web.
|
|
18
|
+
*/
|
|
19
|
+
export declare function ScrollArea({ children, indicatorColor, indicatorWidth, keyboardShouldPersistTaps, keyboardDismissMode, style, contentContainerStyle, }: ScrollAreaProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
//# sourceMappingURL=ScrollArea.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScrollArea.d.ts","sourceRoot":"","sources":["../../../../../src/components/_internal/ScrollArea.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAIL,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAEtB,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,SAAS,CAAC;IACpB,oDAAoD;IACpD,cAAc,EAAE,MAAM,CAAC;IACvB,0CAA0C;IAC1C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,yBAAyB,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,SAAS,CAAC;IAC3D,mBAAmB,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,aAAa,CAAC;IACzD,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,qBAAqB,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9C;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,EACzB,QAAQ,EACR,cAAc,EACd,cAAkB,EAClB,yBAAyB,EACzB,mBAAmB,EACnB,KAAK,EACL,qBAAqB,GACtB,EAAE,eAAe,2CA4DjB"}
|
|
@@ -6,6 +6,7 @@ export * from './Checkbox';
|
|
|
6
6
|
export * from './Chip';
|
|
7
7
|
export * from './CodeField';
|
|
8
8
|
export * from './CodeInput';
|
|
9
|
+
export * from './Dialog';
|
|
9
10
|
export * from './Icon';
|
|
10
11
|
export * from './IconButton';
|
|
11
12
|
export * from './Input';
|
|
@@ -17,5 +18,6 @@ export * from './Spinner';
|
|
|
17
18
|
export * from './Surface';
|
|
18
19
|
export * from './Switch';
|
|
19
20
|
export * from './Text';
|
|
21
|
+
export * from './Toast';
|
|
20
22
|
export type { LabelPosition } from './_internal/Labeled';
|
|
21
23
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AAExB,YAAY,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC"}
|