@tamagui/toast 1.13.2 → 1.13.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Toast.js +1 -181
- package/dist/cjs/Toast.js.map +3 -3
- package/dist/cjs/ToastAnnounce.js +1 -92
- package/dist/cjs/ToastAnnounce.js.map +2 -2
- package/dist/cjs/ToastImperative.js +1 -110
- package/dist/cjs/ToastImperative.js.map +2 -2
- package/dist/cjs/ToastImpl.js +1 -352
- package/dist/cjs/ToastImpl.js.map +2 -2
- package/dist/cjs/ToastProvider.js +1 -119
- package/dist/cjs/ToastProvider.js.map +2 -2
- package/dist/cjs/ToastViewport.js +1 -312
- package/dist/cjs/ToastViewport.js.map +2 -2
- package/dist/cjs/constants.js +1 -28
- package/dist/cjs/constants.js.map +2 -2
- package/dist/cjs/createNativeToast.js +1 -69
- package/dist/cjs/createNativeToast.js.map +2 -2
- package/dist/cjs/createNativeToast.native.js +1 -43
- package/dist/cjs/createNativeToast.native.js.map +2 -2
- package/dist/cjs/index.js +1 -18
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/types.js +1 -16
- package/dist/cjs/types.js.map +2 -2
- package/dist/esm/Toast.js +1 -157
- package/dist/esm/Toast.js.map +3 -3
- package/dist/esm/Toast.mjs +1 -157
- package/dist/esm/Toast.mjs.map +3 -3
- package/dist/esm/ToastAnnounce.js +1 -63
- package/dist/esm/ToastAnnounce.js.map +2 -2
- package/dist/esm/ToastAnnounce.mjs +1 -63
- package/dist/esm/ToastAnnounce.mjs.map +2 -2
- package/dist/esm/ToastImperative.js +1 -73
- package/dist/esm/ToastImperative.js.map +2 -2
- package/dist/esm/ToastImperative.mjs +1 -73
- package/dist/esm/ToastImperative.mjs.map +2 -2
- package/dist/esm/ToastImpl.js +1 -328
- package/dist/esm/ToastImpl.js.map +2 -2
- package/dist/esm/ToastImpl.mjs +1 -328
- package/dist/esm/ToastImpl.mjs.map +2 -2
- package/dist/esm/ToastProvider.js +1 -80
- package/dist/esm/ToastProvider.js.map +2 -2
- package/dist/esm/ToastProvider.mjs +1 -80
- package/dist/esm/ToastProvider.mjs.map +2 -2
- package/dist/esm/ToastViewport.js +1 -279
- package/dist/esm/ToastViewport.js.map +2 -2
- package/dist/esm/ToastViewport.mjs +1 -279
- package/dist/esm/ToastViewport.mjs.map +2 -2
- package/dist/esm/constants.js +1 -4
- package/dist/esm/constants.js.map +2 -2
- package/dist/esm/constants.mjs +1 -4
- package/dist/esm/constants.mjs.map +2 -2
- package/dist/esm/createNativeToast.js +1 -44
- package/dist/esm/createNativeToast.js.map +2 -2
- package/dist/esm/createNativeToast.mjs +1 -44
- package/dist/esm/createNativeToast.mjs.map +2 -2
- package/dist/esm/createNativeToast.native.js +1 -18
- package/dist/esm/createNativeToast.native.js.map +2 -2
- package/dist/esm/createNativeToast.native.mjs +1 -18
- package/dist/esm/createNativeToast.native.mjs.map +2 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/jsx/Toast.js +1 -150
- package/dist/jsx/Toast.js.map +3 -3
- package/dist/jsx/Toast.mjs +1 -150
- package/dist/jsx/Toast.mjs.map +3 -3
- package/dist/jsx/ToastAnnounce.js +1 -59
- package/dist/jsx/ToastAnnounce.js.map +2 -2
- package/dist/jsx/ToastAnnounce.mjs +1 -59
- package/dist/jsx/ToastAnnounce.mjs.map +2 -2
- package/dist/jsx/ToastImperative.js +1 -72
- package/dist/jsx/ToastImperative.js.map +2 -2
- package/dist/jsx/ToastImperative.mjs +1 -72
- package/dist/jsx/ToastImperative.mjs.map +2 -2
- package/dist/jsx/ToastImpl.js +1 -307
- package/dist/jsx/ToastImpl.js.map +2 -2
- package/dist/jsx/ToastImpl.mjs +1 -307
- package/dist/jsx/ToastImpl.mjs.map +2 -2
- package/dist/jsx/ToastProvider.js +1 -75
- package/dist/jsx/ToastProvider.js.map +2 -2
- package/dist/jsx/ToastProvider.mjs +1 -75
- package/dist/jsx/ToastProvider.mjs.map +2 -2
- package/dist/jsx/ToastViewport.js +1 -259
- package/dist/jsx/ToastViewport.js.map +2 -2
- package/dist/jsx/ToastViewport.mjs +1 -259
- package/dist/jsx/ToastViewport.mjs.map +2 -2
- package/dist/jsx/constants.js +1 -4
- package/dist/jsx/constants.js.map +2 -2
- package/dist/jsx/constants.mjs +1 -4
- package/dist/jsx/constants.mjs.map +2 -2
- package/dist/jsx/createNativeToast.js +1 -44
- package/dist/jsx/createNativeToast.js.map +2 -2
- package/dist/jsx/createNativeToast.mjs +1 -44
- package/dist/jsx/createNativeToast.mjs.map +2 -2
- package/dist/jsx/createNativeToast.native.js +1 -18
- package/dist/jsx/createNativeToast.native.js.map +2 -2
- package/dist/jsx/createNativeToast.native.mjs +1 -18
- package/dist/jsx/createNativeToast.native.mjs.map +2 -2
- package/dist/jsx/index.js +1 -1
- package/dist/jsx/index.js.map +1 -1
- package/dist/jsx/index.mjs +1 -1
- package/dist/jsx/index.mjs.map +1 -1
- package/package.json +13 -13
- package/src/Toast.tsx +9 -1
- package/types/Toast.d.ts +2 -2
- package/types/Toast.d.ts.map +1 -1
package/dist/cjs/index.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts"],
|
|
4
4
|
"sourcesContent": ["export * from './Toast.js'\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "iaAAA,IAAAA,EAAA,kBAAAC,EAAAD,GAAAE,EAAAF,EAAc,sBAAd",
|
|
6
|
+
"names": ["src_exports", "__toCommonJS", "__reExport"]
|
|
7
7
|
}
|
package/dist/cjs/types.js
CHANGED
|
@@ -1,17 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
-
}
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
-
var types_exports = {};
|
|
16
|
-
module.exports = __toCommonJS(types_exports);
|
|
1
|
+
"use strict";var i=Object.defineProperty;var n=Object.getOwnPropertyDescriptor;var r=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var u=(e,t,s,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of r(t))!p.call(e,o)&&o!==s&&i(e,o,{get:()=>t[o],enumerable:!(a=n(t,o))||a.enumerable});return e};var T=e=>u(i({},"__esModule",{value:!0}),e);var m={};module.exports=T(m);
|
|
17
2
|
//# sourceMappingURL=types.js.map
|
package/dist/cjs/types.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/types.ts"],
|
|
4
4
|
"sourcesContent": ["// from `burnt`\ntype BurntLayout = {\n iconSize?: {\n width: number\n height: number\n }\n}\n\n// from `burnt`\nexport type BurntToastOptions = {\n title: string\n message?: string\n /**\n * Defaults to `done`.\n */\n preset?: 'done' | 'error' | 'none'\n /**\n * Duration in seconds.\n */\n duration?: number\n haptic?: 'success' | 'warning' | 'error' | 'none'\n /**\n * Defaults to `true`.\n */\n shouldDismissByDrag?: boolean\n /**\n * Change the presentation side.\n * @platform ios\n */\n from?: 'top' | 'bottom'\n layout?: BurntLayout\n}\n\nexport interface CreateNativeToastOptions {\n /**\n * Body of the toast\n */\n message?: BurntToastOptions['message']\n /**\n * Duration of toast in ms\n *\n * @example 1000\n */\n duration?: BurntToastOptions['duration']\n /**\n * Options for the burnt package if you're using native toasts on mobile\n */\n burntOptions?: Omit<BurntToastOptions, 'title' | 'message' | 'duration'>\n /**\n * Options for the notification API if you're using native toasts on web\n */\n notificationOptions?: NotificationOptions\n}\n\nexport interface NativeToastRef {\n /**\n * Used to close web notifications\n */\n close: () => void\n}\n\nexport type CreateNativeToastsFn = (\n title: string,\n options: CreateNativeToastOptions\n) =>\n | {\n nativeToastRef?: NativeToastRef\n }\n | boolean\n\nexport type HideNativeToastsFn = (ref?: NativeToastRef) => void\n\nexport type ToastNativePlatform = 'web' | 'mobile' | 'android' | 'ios'\nexport type ToastNativeValue = boolean | ToastNativePlatform | ToastNativePlatform[]\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
|
|
6
|
+
"names": ["types_exports", "__toCommonJS"]
|
|
7
7
|
}
|
package/dist/esm/Toast.js
CHANGED
|
@@ -1,158 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
composeEventHandlers,
|
|
4
|
-
styled,
|
|
5
|
-
themeable,
|
|
6
|
-
useEvent,
|
|
7
|
-
useId,
|
|
8
|
-
withStaticProperties
|
|
9
|
-
} from "@tamagui/core";
|
|
10
|
-
import { ThemeableStack } from "@tamagui/stacks";
|
|
11
|
-
import { SizableText } from "@tamagui/text";
|
|
12
|
-
import { useControllableState } from "@tamagui/use-controllable-state";
|
|
13
|
-
import * as React from "react";
|
|
14
|
-
import { TOAST_NAME } from "./constants";
|
|
15
|
-
import { ToastAnnounceExclude } from "./ToastAnnounce";
|
|
16
|
-
import { useToast } from "./ToastImperative.js";
|
|
17
|
-
import {
|
|
18
|
-
ToastImpl,
|
|
19
|
-
ToastImplFrame,
|
|
20
|
-
useToastInteractiveContext
|
|
21
|
-
} from "./ToastImpl";
|
|
22
|
-
import {
|
|
23
|
-
ToastProvider,
|
|
24
|
-
createToastScope
|
|
25
|
-
} from "./ToastProvider";
|
|
26
|
-
import { ToastViewport } from "./ToastViewport";
|
|
27
|
-
const TITLE_NAME = "ToastTitle";
|
|
28
|
-
const ToastTitleFrame = styled(SizableText, {
|
|
29
|
-
name: TITLE_NAME,
|
|
30
|
-
variants: {
|
|
31
|
-
unstyled: {
|
|
32
|
-
false: {
|
|
33
|
-
color: "$color",
|
|
34
|
-
size: "$4"
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
defaultVariants: {
|
|
39
|
-
unstyled: false
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
const ToastTitle = React.forwardRef(
|
|
43
|
-
(props, forwardedRef) => {
|
|
44
|
-
const { __scopeToast, ...titleProps } = props;
|
|
45
|
-
return /* @__PURE__ */ jsx(ToastTitleFrame, { ...titleProps, ref: forwardedRef });
|
|
46
|
-
}
|
|
47
|
-
);
|
|
48
|
-
ToastTitle.displayName = TITLE_NAME;
|
|
49
|
-
const DESCRIPTION_NAME = "ToastDescription";
|
|
50
|
-
const ToastDescriptionFrame = styled(SizableText, {
|
|
51
|
-
name: DESCRIPTION_NAME,
|
|
52
|
-
variants: {
|
|
53
|
-
unstyled: {
|
|
54
|
-
false: {
|
|
55
|
-
color: "$color11",
|
|
56
|
-
size: "$1"
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
defaultVariants: {
|
|
61
|
-
unstyled: false
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
const ToastDescription = React.forwardRef(
|
|
65
|
-
(props, forwardedRef) => {
|
|
66
|
-
const { __scopeToast, ...descriptionProps } = props;
|
|
67
|
-
return /* @__PURE__ */ jsx(ToastDescriptionFrame, { ...descriptionProps, ref: forwardedRef });
|
|
68
|
-
}
|
|
69
|
-
);
|
|
70
|
-
ToastDescription.displayName = DESCRIPTION_NAME;
|
|
71
|
-
const ACTION_NAME = "ToastAction";
|
|
72
|
-
const ToastAction = React.forwardRef(
|
|
73
|
-
(props, forwardedRef) => {
|
|
74
|
-
const { altText, ...actionProps } = props;
|
|
75
|
-
if (!altText)
|
|
76
|
-
return null;
|
|
77
|
-
return /* @__PURE__ */ jsx(ToastAnnounceExclude, { altText, asChild: true, children: /* @__PURE__ */ jsx(ToastClose, { ...actionProps, ref: forwardedRef }) });
|
|
78
|
-
}
|
|
79
|
-
);
|
|
80
|
-
ToastAction.propTypes = {
|
|
81
|
-
altText(props) {
|
|
82
|
-
if (!props.altText) {
|
|
83
|
-
return new Error(`Missing prop \`altText\` expected on \`${ACTION_NAME}\``);
|
|
84
|
-
}
|
|
85
|
-
return null;
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
ToastAction.displayName = ACTION_NAME;
|
|
89
|
-
const CLOSE_NAME = "ToastClose";
|
|
90
|
-
const ToastCloseFrame = styled(ThemeableStack, {
|
|
91
|
-
name: CLOSE_NAME,
|
|
92
|
-
tag: "button"
|
|
93
|
-
});
|
|
94
|
-
const ToastClose = React.forwardRef(
|
|
95
|
-
(props, forwardedRef) => {
|
|
96
|
-
const { __scopeToast, ...closeProps } = props;
|
|
97
|
-
const interactiveContext = useToastInteractiveContext(CLOSE_NAME, __scopeToast);
|
|
98
|
-
return /* @__PURE__ */ jsx(ToastAnnounceExclude, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
99
|
-
ToastCloseFrame,
|
|
100
|
-
{
|
|
101
|
-
accessibilityLabel: "Dialog Close",
|
|
102
|
-
...closeProps,
|
|
103
|
-
ref: forwardedRef,
|
|
104
|
-
onPress: composeEventHandlers(props.onPress, interactiveContext.onClose)
|
|
105
|
-
}
|
|
106
|
-
) });
|
|
107
|
-
}
|
|
108
|
-
);
|
|
109
|
-
ToastClose.displayName = CLOSE_NAME;
|
|
110
|
-
const ToastComponent = React.forwardRef(
|
|
111
|
-
ToastImplFrame.extractable((props, forwardedRef) => {
|
|
112
|
-
const { forceMount, open: openProp, defaultOpen, onOpenChange, ...toastProps } = props;
|
|
113
|
-
const [open, setOpen] = useControllableState({
|
|
114
|
-
prop: openProp,
|
|
115
|
-
defaultProp: defaultOpen ?? true,
|
|
116
|
-
onChange: onOpenChange
|
|
117
|
-
});
|
|
118
|
-
const id = useId();
|
|
119
|
-
const onPause = useEvent(props.onPause);
|
|
120
|
-
const onResume = useEvent(props.onResume);
|
|
121
|
-
const shouldShow = forceMount || open;
|
|
122
|
-
if (!shouldShow)
|
|
123
|
-
return null;
|
|
124
|
-
return /* @__PURE__ */ jsx(
|
|
125
|
-
ToastImpl,
|
|
126
|
-
{
|
|
127
|
-
id,
|
|
128
|
-
open,
|
|
129
|
-
...toastProps,
|
|
130
|
-
ref: forwardedRef,
|
|
131
|
-
onClose: () => setOpen(false),
|
|
132
|
-
onPause,
|
|
133
|
-
onResume,
|
|
134
|
-
onSwipeEnd: composeEventHandlers(props.onSwipeEnd, (event) => {
|
|
135
|
-
setOpen(false);
|
|
136
|
-
})
|
|
137
|
-
}
|
|
138
|
-
);
|
|
139
|
-
})
|
|
140
|
-
);
|
|
141
|
-
ToastComponent.displayName = TOAST_NAME;
|
|
142
|
-
const Toast = withStaticProperties(
|
|
143
|
-
themeable(ToastComponent, ToastImplFrame.staticConfig),
|
|
144
|
-
{
|
|
145
|
-
Title: ToastTitle,
|
|
146
|
-
Description: ToastDescription,
|
|
147
|
-
Action: ToastAction,
|
|
148
|
-
Close: ToastClose
|
|
149
|
-
}
|
|
150
|
-
);
|
|
151
|
-
export {
|
|
152
|
-
Toast,
|
|
153
|
-
ToastProvider,
|
|
154
|
-
ToastViewport,
|
|
155
|
-
createToastScope,
|
|
156
|
-
useToast
|
|
157
|
-
};
|
|
1
|
+
import{jsx as a}from"react/jsx-runtime";import{composeEventHandlers as P,styled as p,themeable as F,useEvent as u,useId as _,withStaticProperties as R}from"@tamagui/core";import{ThemeableStack as b}from"@tamagui/stacks";import{SizableText as f}from"@tamagui/text";import{useControllableState as I}from"@tamagui/use-controllable-state";import*as r from"react";import{TOAST_NAME as M}from"./constants";import{ToastAnnounceExclude as d}from"./ToastAnnounce";import{useToast as O,useToastController as V,useToastState as $}from"./ToastImperative.js";import{ToastImpl as G,ToastImplFrame as C,useToastInteractiveContext as z}from"./ToastImpl";import{ToastProvider as L,createToastScope as k}from"./ToastProvider";import{ToastViewport as H}from"./ToastViewport";const y="ToastTitle",q=p(f,{name:y,variants:{unstyled:{false:{color:"$color",size:"$4"}}},defaultVariants:{unstyled:!1}}),E=r.forwardRef((o,t)=>{const{__scopeToast:s,...e}=o;return a(q,{...e,ref:t})});E.displayName=y;const S="ToastDescription",B=p(f,{name:S,variants:{unstyled:{false:{color:"$color11",size:"$1"}}},defaultVariants:{unstyled:!1}}),v=r.forwardRef((o,t)=>{const{__scopeToast:s,...e}=o;return a(B,{...e,ref:t})});v.displayName=S;const A="ToastAction",i=r.forwardRef((o,t)=>{const{altText:s,...e}=o;return s?a(d,{altText:s,asChild:!0,children:a(T,{...e,ref:t})}):null});i.propTypes={altText(o){return o.altText?null:new Error(`Missing prop \`altText\` expected on \`${A}\``)}},i.displayName=A;const l="ToastClose",J=p(b,{name:l,tag:"button"}),T=r.forwardRef((o,t)=>{const{__scopeToast:s,...e}=o,n=z(l,s);return a(d,{asChild:!0,children:a(J,{accessibilityLabel:"Dialog Close",...e,ref:t,onPress:P(o.onPress,n.onClose)})})});T.displayName=l;const N=r.forwardRef(C.extractable((o,t)=>{const{forceMount:s,open:e,defaultOpen:n,onOpenChange:x,...D}=o,[c,m]=I({prop:e,defaultProp:n??!0,onChange:x}),w=_(),g=u(o.onPause),h=u(o.onResume);return s||c?a(G,{id:w,open:c,...D,ref:t,onClose:()=>m(!1),onPause:g,onResume:h,onSwipeEnd:P(o.onSwipeEnd,U=>{m(!1)})}):null}));N.displayName=M;const K=R(F(N,C.staticConfig),{Title:E,Description:v,Action:i,Close:T});export{K as Toast,L as ToastProvider,H as ToastViewport,k as createToastScope,O as useToast,V as useToastController,$ as useToastState};
|
|
158
2
|
//# sourceMappingURL=Toast.js.map
|
package/dist/esm/Toast.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Toast.tsx"],
|
|
4
|
-
"sourcesContent": ["import {\n GetProps,\n TamaguiElement,\n composeEventHandlers,\n styled,\n themeable,\n useEvent,\n useId,\n withStaticProperties,\n} from '@tamagui/core'\nimport { ThemeableStack } from '@tamagui/stacks'\nimport { SizableText } from '@tamagui/text'\nimport { useControllableState } from '@tamagui/use-controllable-state'\nimport * as React from 'react'\n\nimport { TOAST_NAME } from './constants'\nimport { ToastAnnounceExclude } from './ToastAnnounce'\nimport {
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": []
|
|
4
|
+
"sourcesContent": ["import {\n GetProps,\n TamaguiElement,\n composeEventHandlers,\n styled,\n themeable,\n useEvent,\n useId,\n withStaticProperties,\n} from '@tamagui/core'\nimport { ThemeableStack } from '@tamagui/stacks'\nimport { SizableText } from '@tamagui/text'\nimport { useControllableState } from '@tamagui/use-controllable-state'\nimport * as React from 'react'\n\nimport { TOAST_NAME } from './constants'\nimport { ToastAnnounceExclude } from './ToastAnnounce'\nimport {\n ToastNativePlatform,\n ToastNativeValue,\n useToast,\n useToastController,\n useToastState,\n} from './ToastImperative.js'\nimport {\n ToastImpl,\n ToastImplFrame,\n ToastProps,\n useToastInteractiveContext,\n} from './ToastImpl'\nimport {\n ScopedProps,\n ToastProvider,\n ToastProviderProps,\n createToastScope,\n} from './ToastProvider'\nimport { ToastViewport, ToastViewportProps } from './ToastViewport'\n\n/* -------------------------------------------------------------------------------------------------\n * ToastTitle\n * -----------------------------------------------------------------------------------------------*/\n\nconst TITLE_NAME = 'ToastTitle'\n\nconst ToastTitleFrame = styled(SizableText, {\n name: TITLE_NAME,\n variants: {\n unstyled: {\n false: {\n color: '$color',\n size: '$4',\n },\n },\n },\n defaultVariants: {\n unstyled: false,\n },\n})\n\ntype PrimitiveDivProps = GetProps<typeof ToastTitleFrame>\ntype ToastTitleProps = PrimitiveDivProps & {}\n\nconst ToastTitle = React.forwardRef<TamaguiElement, ToastTitleProps>(\n (props: ScopedProps<ToastTitleProps>, forwardedRef) => {\n const { __scopeToast, ...titleProps } = props\n return <ToastTitleFrame {...titleProps} ref={forwardedRef} />\n }\n)\n\nToastTitle.displayName = TITLE_NAME\n\n/* -------------------------------------------------------------------------------------------------\n * ToastDescription\n * -----------------------------------------------------------------------------------------------*/\n\nconst DESCRIPTION_NAME = 'ToastDescription'\n\nconst ToastDescriptionFrame = styled(SizableText, {\n name: DESCRIPTION_NAME,\n\n variants: {\n unstyled: {\n false: {\n color: '$color11',\n size: '$1',\n },\n },\n },\n\n defaultVariants: {\n unstyled: false,\n },\n})\n\ntype ToastDescriptionFrameProps = GetProps<typeof ToastDescriptionFrame>\ntype ToastDescriptionProps = ToastDescriptionFrameProps & {}\n\nconst ToastDescription = React.forwardRef<TamaguiElement, ToastDescriptionProps>(\n (props: ScopedProps<ToastDescriptionProps>, forwardedRef) => {\n const { __scopeToast, ...descriptionProps } = props\n return <ToastDescriptionFrame {...descriptionProps} ref={forwardedRef} />\n }\n)\n\nToastDescription.displayName = DESCRIPTION_NAME\n\n/* -------------------------------------------------------------------------------------------------\n * ToastAction\n * -----------------------------------------------------------------------------------------------*/\n\nconst ACTION_NAME = 'ToastAction'\n\ntype ToastActionProps = ToastCloseProps & {\n /**\n * A short description for an alternate way to carry out the action. For screen reader users\n * who will not be able to navigate to the button easily/quickly.\n * @example <ToastAction altText=\"Goto account settings to updgrade\">Upgrade</ToastAction>\n * @example <ToastAction altText=\"Undo (Alt+U)\">Undo</ToastAction>\n */\n altText: string\n}\n\nconst ToastAction = React.forwardRef<TamaguiElement, ToastActionProps>(\n (props: ScopedProps<ToastActionProps>, forwardedRef) => {\n const { altText, ...actionProps } = props\n if (!altText) return null\n return (\n <ToastAnnounceExclude altText={altText} asChild>\n <ToastClose {...actionProps} ref={forwardedRef} />\n </ToastAnnounceExclude>\n )\n }\n)\n\nToastAction.propTypes = {\n altText(props) {\n if (!props.altText) {\n return new Error(`Missing prop \\`altText\\` expected on \\`${ACTION_NAME}\\``)\n }\n return null\n },\n}\n\nToastAction.displayName = ACTION_NAME\n\n/* -------------------------------------------------------------------------------------------------\n * ToastClose\n * -----------------------------------------------------------------------------------------------*/\n\nconst CLOSE_NAME = 'ToastClose'\n\nconst ToastCloseFrame = styled(ThemeableStack, {\n name: CLOSE_NAME,\n tag: 'button',\n})\ntype ToastCloseFrameProps = GetProps<typeof ToastCloseFrame>\ntype ToastCloseProps = ToastCloseFrameProps & {}\n\nconst ToastClose = React.forwardRef<TamaguiElement, ToastCloseProps>(\n (props: ScopedProps<ToastCloseProps>, forwardedRef) => {\n const { __scopeToast, ...closeProps } = props\n const interactiveContext = useToastInteractiveContext(CLOSE_NAME, __scopeToast)\n\n return (\n <ToastAnnounceExclude asChild>\n <ToastCloseFrame\n accessibilityLabel=\"Dialog Close\"\n {...closeProps}\n ref={forwardedRef}\n onPress={composeEventHandlers(props.onPress as any, interactiveContext.onClose)}\n />\n </ToastAnnounceExclude>\n )\n }\n)\n\nToastClose.displayName = CLOSE_NAME\n\n/* -------------------------------------------------------------------------------------------------\n * Toast\n * -----------------------------------------------------------------------------------------------*/\n\nconst ToastComponent = React.forwardRef<TamaguiElement, ToastProps>(\n ToastImplFrame.extractable((props: ScopedProps<ToastProps>, forwardedRef) => {\n const { forceMount, open: openProp, defaultOpen, onOpenChange, ...toastProps } = props\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen ?? true,\n onChange: onOpenChange,\n })\n\n const id = useId()\n const onPause = useEvent(props.onPause)\n const onResume = useEvent(props.onResume)\n const shouldShow = forceMount || open\n\n if (!shouldShow) return null\n\n return (\n <ToastImpl\n id={id}\n open={open}\n {...toastProps}\n ref={forwardedRef}\n onClose={() => setOpen(false)}\n onPause={onPause}\n onResume={onResume}\n onSwipeEnd={composeEventHandlers(props.onSwipeEnd, (event) => {\n setOpen(false)\n })}\n />\n )\n })\n)\n\nToastComponent.displayName = TOAST_NAME\n\nconst Toast = withStaticProperties(\n themeable(ToastComponent, ToastImplFrame.staticConfig),\n {\n Title: ToastTitle,\n Description: ToastDescription,\n Action: ToastAction,\n Close: ToastClose,\n }\n)\n\n/* ---------------------------------------------------------------------------------------------- */\n\nexport {\n Toast,\n ToastProvider,\n ToastViewport,\n //\n createToastScope,\n // imperative\n useToast,\n useToastController,\n useToastState,\n}\nexport type {\n ToastActionProps,\n ToastCloseProps,\n ToastDescriptionProps,\n ToastProps,\n ToastProviderProps,\n ToastTitleProps,\n ToastViewportProps,\n // imperative\n ToastNativeValue,\n ToastNativePlatform,\n}\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["jsx", "composeEventHandlers", "styled", "themeable", "useEvent", "useId", "withStaticProperties", "ThemeableStack", "SizableText", "useControllableState", "React", "TOAST_NAME", "ToastAnnounceExclude", "useToast", "useToastController", "useToastState", "ToastImpl", "ToastImplFrame", "useToastInteractiveContext", "ToastProvider", "createToastScope", "ToastViewport", "TITLE_NAME", "ToastTitleFrame", "ToastTitle", "props", "forwardedRef", "__scopeToast", "titleProps", "DESCRIPTION_NAME", "ToastDescriptionFrame", "ToastDescription", "descriptionProps", "ACTION_NAME", "ToastAction", "altText", "actionProps", "ToastClose", "CLOSE_NAME", "ToastCloseFrame", "closeProps", "interactiveContext", "ToastComponent", "forceMount", "openProp", "defaultOpen", "onOpenChange", "toastProps", "open", "setOpen", "id", "onPause", "onResume", "event", "Toast"]
|
|
7
7
|
}
|
package/dist/esm/Toast.mjs
CHANGED
|
@@ -1,158 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
composeEventHandlers,
|
|
4
|
-
styled,
|
|
5
|
-
themeable,
|
|
6
|
-
useEvent,
|
|
7
|
-
useId,
|
|
8
|
-
withStaticProperties
|
|
9
|
-
} from "@tamagui/core";
|
|
10
|
-
import { ThemeableStack } from "@tamagui/stacks";
|
|
11
|
-
import { SizableText } from "@tamagui/text";
|
|
12
|
-
import { useControllableState } from "@tamagui/use-controllable-state";
|
|
13
|
-
import * as React from "react";
|
|
14
|
-
import { TOAST_NAME } from "./constants";
|
|
15
|
-
import { ToastAnnounceExclude } from "./ToastAnnounce";
|
|
16
|
-
import { useToast } from "./ToastImperative.js";
|
|
17
|
-
import {
|
|
18
|
-
ToastImpl,
|
|
19
|
-
ToastImplFrame,
|
|
20
|
-
useToastInteractiveContext
|
|
21
|
-
} from "./ToastImpl";
|
|
22
|
-
import {
|
|
23
|
-
ToastProvider,
|
|
24
|
-
createToastScope
|
|
25
|
-
} from "./ToastProvider";
|
|
26
|
-
import { ToastViewport } from "./ToastViewport";
|
|
27
|
-
const TITLE_NAME = "ToastTitle";
|
|
28
|
-
const ToastTitleFrame = styled(SizableText, {
|
|
29
|
-
name: TITLE_NAME,
|
|
30
|
-
variants: {
|
|
31
|
-
unstyled: {
|
|
32
|
-
false: {
|
|
33
|
-
color: "$color",
|
|
34
|
-
size: "$4"
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
defaultVariants: {
|
|
39
|
-
unstyled: false
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
const ToastTitle = React.forwardRef(
|
|
43
|
-
(props, forwardedRef) => {
|
|
44
|
-
const { __scopeToast, ...titleProps } = props;
|
|
45
|
-
return /* @__PURE__ */ jsx(ToastTitleFrame, { ...titleProps, ref: forwardedRef });
|
|
46
|
-
}
|
|
47
|
-
);
|
|
48
|
-
ToastTitle.displayName = TITLE_NAME;
|
|
49
|
-
const DESCRIPTION_NAME = "ToastDescription";
|
|
50
|
-
const ToastDescriptionFrame = styled(SizableText, {
|
|
51
|
-
name: DESCRIPTION_NAME,
|
|
52
|
-
variants: {
|
|
53
|
-
unstyled: {
|
|
54
|
-
false: {
|
|
55
|
-
color: "$color11",
|
|
56
|
-
size: "$1"
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
defaultVariants: {
|
|
61
|
-
unstyled: false
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
const ToastDescription = React.forwardRef(
|
|
65
|
-
(props, forwardedRef) => {
|
|
66
|
-
const { __scopeToast, ...descriptionProps } = props;
|
|
67
|
-
return /* @__PURE__ */ jsx(ToastDescriptionFrame, { ...descriptionProps, ref: forwardedRef });
|
|
68
|
-
}
|
|
69
|
-
);
|
|
70
|
-
ToastDescription.displayName = DESCRIPTION_NAME;
|
|
71
|
-
const ACTION_NAME = "ToastAction";
|
|
72
|
-
const ToastAction = React.forwardRef(
|
|
73
|
-
(props, forwardedRef) => {
|
|
74
|
-
const { altText, ...actionProps } = props;
|
|
75
|
-
if (!altText)
|
|
76
|
-
return null;
|
|
77
|
-
return /* @__PURE__ */ jsx(ToastAnnounceExclude, { altText, asChild: true, children: /* @__PURE__ */ jsx(ToastClose, { ...actionProps, ref: forwardedRef }) });
|
|
78
|
-
}
|
|
79
|
-
);
|
|
80
|
-
ToastAction.propTypes = {
|
|
81
|
-
altText(props) {
|
|
82
|
-
if (!props.altText) {
|
|
83
|
-
return new Error(`Missing prop \`altText\` expected on \`${ACTION_NAME}\``);
|
|
84
|
-
}
|
|
85
|
-
return null;
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
ToastAction.displayName = ACTION_NAME;
|
|
89
|
-
const CLOSE_NAME = "ToastClose";
|
|
90
|
-
const ToastCloseFrame = styled(ThemeableStack, {
|
|
91
|
-
name: CLOSE_NAME,
|
|
92
|
-
tag: "button"
|
|
93
|
-
});
|
|
94
|
-
const ToastClose = React.forwardRef(
|
|
95
|
-
(props, forwardedRef) => {
|
|
96
|
-
const { __scopeToast, ...closeProps } = props;
|
|
97
|
-
const interactiveContext = useToastInteractiveContext(CLOSE_NAME, __scopeToast);
|
|
98
|
-
return /* @__PURE__ */ jsx(ToastAnnounceExclude, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
99
|
-
ToastCloseFrame,
|
|
100
|
-
{
|
|
101
|
-
accessibilityLabel: "Dialog Close",
|
|
102
|
-
...closeProps,
|
|
103
|
-
ref: forwardedRef,
|
|
104
|
-
onPress: composeEventHandlers(props.onPress, interactiveContext.onClose)
|
|
105
|
-
}
|
|
106
|
-
) });
|
|
107
|
-
}
|
|
108
|
-
);
|
|
109
|
-
ToastClose.displayName = CLOSE_NAME;
|
|
110
|
-
const ToastComponent = React.forwardRef(
|
|
111
|
-
ToastImplFrame.extractable((props, forwardedRef) => {
|
|
112
|
-
const { forceMount, open: openProp, defaultOpen, onOpenChange, ...toastProps } = props;
|
|
113
|
-
const [open, setOpen] = useControllableState({
|
|
114
|
-
prop: openProp,
|
|
115
|
-
defaultProp: defaultOpen ?? true,
|
|
116
|
-
onChange: onOpenChange
|
|
117
|
-
});
|
|
118
|
-
const id = useId();
|
|
119
|
-
const onPause = useEvent(props.onPause);
|
|
120
|
-
const onResume = useEvent(props.onResume);
|
|
121
|
-
const shouldShow = forceMount || open;
|
|
122
|
-
if (!shouldShow)
|
|
123
|
-
return null;
|
|
124
|
-
return /* @__PURE__ */ jsx(
|
|
125
|
-
ToastImpl,
|
|
126
|
-
{
|
|
127
|
-
id,
|
|
128
|
-
open,
|
|
129
|
-
...toastProps,
|
|
130
|
-
ref: forwardedRef,
|
|
131
|
-
onClose: () => setOpen(false),
|
|
132
|
-
onPause,
|
|
133
|
-
onResume,
|
|
134
|
-
onSwipeEnd: composeEventHandlers(props.onSwipeEnd, (event) => {
|
|
135
|
-
setOpen(false);
|
|
136
|
-
})
|
|
137
|
-
}
|
|
138
|
-
);
|
|
139
|
-
})
|
|
140
|
-
);
|
|
141
|
-
ToastComponent.displayName = TOAST_NAME;
|
|
142
|
-
const Toast = withStaticProperties(
|
|
143
|
-
themeable(ToastComponent, ToastImplFrame.staticConfig),
|
|
144
|
-
{
|
|
145
|
-
Title: ToastTitle,
|
|
146
|
-
Description: ToastDescription,
|
|
147
|
-
Action: ToastAction,
|
|
148
|
-
Close: ToastClose
|
|
149
|
-
}
|
|
150
|
-
);
|
|
151
|
-
export {
|
|
152
|
-
Toast,
|
|
153
|
-
ToastProvider,
|
|
154
|
-
ToastViewport,
|
|
155
|
-
createToastScope,
|
|
156
|
-
useToast
|
|
157
|
-
};
|
|
1
|
+
import{jsx as a}from"react/jsx-runtime";import{composeEventHandlers as P,styled as p,themeable as F,useEvent as u,useId as _,withStaticProperties as R}from"@tamagui/core";import{ThemeableStack as b}from"@tamagui/stacks";import{SizableText as f}from"@tamagui/text";import{useControllableState as I}from"@tamagui/use-controllable-state";import*as r from"react";import{TOAST_NAME as M}from"./constants";import{ToastAnnounceExclude as d}from"./ToastAnnounce";import{useToast as O,useToastController as V,useToastState as $}from"./ToastImperative.js";import{ToastImpl as G,ToastImplFrame as C,useToastInteractiveContext as z}from"./ToastImpl";import{ToastProvider as L,createToastScope as k}from"./ToastProvider";import{ToastViewport as H}from"./ToastViewport";const y="ToastTitle",q=p(f,{name:y,variants:{unstyled:{false:{color:"$color",size:"$4"}}},defaultVariants:{unstyled:!1}}),E=r.forwardRef((o,t)=>{const{__scopeToast:s,...e}=o;return a(q,{...e,ref:t})});E.displayName=y;const S="ToastDescription",B=p(f,{name:S,variants:{unstyled:{false:{color:"$color11",size:"$1"}}},defaultVariants:{unstyled:!1}}),v=r.forwardRef((o,t)=>{const{__scopeToast:s,...e}=o;return a(B,{...e,ref:t})});v.displayName=S;const A="ToastAction",i=r.forwardRef((o,t)=>{const{altText:s,...e}=o;return s?a(d,{altText:s,asChild:!0,children:a(T,{...e,ref:t})}):null});i.propTypes={altText(o){return o.altText?null:new Error(`Missing prop \`altText\` expected on \`${A}\``)}},i.displayName=A;const l="ToastClose",J=p(b,{name:l,tag:"button"}),T=r.forwardRef((o,t)=>{const{__scopeToast:s,...e}=o,n=z(l,s);return a(d,{asChild:!0,children:a(J,{accessibilityLabel:"Dialog Close",...e,ref:t,onPress:P(o.onPress,n.onClose)})})});T.displayName=l;const N=r.forwardRef(C.extractable((o,t)=>{const{forceMount:s,open:e,defaultOpen:n,onOpenChange:x,...D}=o,[c,m]=I({prop:e,defaultProp:n??!0,onChange:x}),w=_(),g=u(o.onPause),h=u(o.onResume);return s||c?a(G,{id:w,open:c,...D,ref:t,onClose:()=>m(!1),onPause:g,onResume:h,onSwipeEnd:P(o.onSwipeEnd,U=>{m(!1)})}):null}));N.displayName=M;const K=R(F(N,C.staticConfig),{Title:E,Description:v,Action:i,Close:T});export{K as Toast,L as ToastProvider,H as ToastViewport,k as createToastScope,O as useToast,V as useToastController,$ as useToastState};
|
|
158
2
|
//# sourceMappingURL=Toast.mjs.map
|
package/dist/esm/Toast.mjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Toast.tsx"],
|
|
4
|
-
"sourcesContent": ["import {\n GetProps,\n TamaguiElement,\n composeEventHandlers,\n styled,\n themeable,\n useEvent,\n useId,\n withStaticProperties,\n} from '@tamagui/core'\nimport { ThemeableStack } from '@tamagui/stacks'\nimport { SizableText } from '@tamagui/text'\nimport { useControllableState } from '@tamagui/use-controllable-state'\nimport * as React from 'react'\n\nimport { TOAST_NAME } from './constants'\nimport { ToastAnnounceExclude } from './ToastAnnounce'\nimport {
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": []
|
|
4
|
+
"sourcesContent": ["import {\n GetProps,\n TamaguiElement,\n composeEventHandlers,\n styled,\n themeable,\n useEvent,\n useId,\n withStaticProperties,\n} from '@tamagui/core'\nimport { ThemeableStack } from '@tamagui/stacks'\nimport { SizableText } from '@tamagui/text'\nimport { useControllableState } from '@tamagui/use-controllable-state'\nimport * as React from 'react'\n\nimport { TOAST_NAME } from './constants'\nimport { ToastAnnounceExclude } from './ToastAnnounce'\nimport {\n ToastNativePlatform,\n ToastNativeValue,\n useToast,\n useToastController,\n useToastState,\n} from './ToastImperative.js'\nimport {\n ToastImpl,\n ToastImplFrame,\n ToastProps,\n useToastInteractiveContext,\n} from './ToastImpl'\nimport {\n ScopedProps,\n ToastProvider,\n ToastProviderProps,\n createToastScope,\n} from './ToastProvider'\nimport { ToastViewport, ToastViewportProps } from './ToastViewport'\n\n/* -------------------------------------------------------------------------------------------------\n * ToastTitle\n * -----------------------------------------------------------------------------------------------*/\n\nconst TITLE_NAME = 'ToastTitle'\n\nconst ToastTitleFrame = styled(SizableText, {\n name: TITLE_NAME,\n variants: {\n unstyled: {\n false: {\n color: '$color',\n size: '$4',\n },\n },\n },\n defaultVariants: {\n unstyled: false,\n },\n})\n\ntype PrimitiveDivProps = GetProps<typeof ToastTitleFrame>\ntype ToastTitleProps = PrimitiveDivProps & {}\n\nconst ToastTitle = React.forwardRef<TamaguiElement, ToastTitleProps>(\n (props: ScopedProps<ToastTitleProps>, forwardedRef) => {\n const { __scopeToast, ...titleProps } = props\n return <ToastTitleFrame {...titleProps} ref={forwardedRef} />\n }\n)\n\nToastTitle.displayName = TITLE_NAME\n\n/* -------------------------------------------------------------------------------------------------\n * ToastDescription\n * -----------------------------------------------------------------------------------------------*/\n\nconst DESCRIPTION_NAME = 'ToastDescription'\n\nconst ToastDescriptionFrame = styled(SizableText, {\n name: DESCRIPTION_NAME,\n\n variants: {\n unstyled: {\n false: {\n color: '$color11',\n size: '$1',\n },\n },\n },\n\n defaultVariants: {\n unstyled: false,\n },\n})\n\ntype ToastDescriptionFrameProps = GetProps<typeof ToastDescriptionFrame>\ntype ToastDescriptionProps = ToastDescriptionFrameProps & {}\n\nconst ToastDescription = React.forwardRef<TamaguiElement, ToastDescriptionProps>(\n (props: ScopedProps<ToastDescriptionProps>, forwardedRef) => {\n const { __scopeToast, ...descriptionProps } = props\n return <ToastDescriptionFrame {...descriptionProps} ref={forwardedRef} />\n }\n)\n\nToastDescription.displayName = DESCRIPTION_NAME\n\n/* -------------------------------------------------------------------------------------------------\n * ToastAction\n * -----------------------------------------------------------------------------------------------*/\n\nconst ACTION_NAME = 'ToastAction'\n\ntype ToastActionProps = ToastCloseProps & {\n /**\n * A short description for an alternate way to carry out the action. For screen reader users\n * who will not be able to navigate to the button easily/quickly.\n * @example <ToastAction altText=\"Goto account settings to updgrade\">Upgrade</ToastAction>\n * @example <ToastAction altText=\"Undo (Alt+U)\">Undo</ToastAction>\n */\n altText: string\n}\n\nconst ToastAction = React.forwardRef<TamaguiElement, ToastActionProps>(\n (props: ScopedProps<ToastActionProps>, forwardedRef) => {\n const { altText, ...actionProps } = props\n if (!altText) return null\n return (\n <ToastAnnounceExclude altText={altText} asChild>\n <ToastClose {...actionProps} ref={forwardedRef} />\n </ToastAnnounceExclude>\n )\n }\n)\n\nToastAction.propTypes = {\n altText(props) {\n if (!props.altText) {\n return new Error(`Missing prop \\`altText\\` expected on \\`${ACTION_NAME}\\``)\n }\n return null\n },\n}\n\nToastAction.displayName = ACTION_NAME\n\n/* -------------------------------------------------------------------------------------------------\n * ToastClose\n * -----------------------------------------------------------------------------------------------*/\n\nconst CLOSE_NAME = 'ToastClose'\n\nconst ToastCloseFrame = styled(ThemeableStack, {\n name: CLOSE_NAME,\n tag: 'button',\n})\ntype ToastCloseFrameProps = GetProps<typeof ToastCloseFrame>\ntype ToastCloseProps = ToastCloseFrameProps & {}\n\nconst ToastClose = React.forwardRef<TamaguiElement, ToastCloseProps>(\n (props: ScopedProps<ToastCloseProps>, forwardedRef) => {\n const { __scopeToast, ...closeProps } = props\n const interactiveContext = useToastInteractiveContext(CLOSE_NAME, __scopeToast)\n\n return (\n <ToastAnnounceExclude asChild>\n <ToastCloseFrame\n accessibilityLabel=\"Dialog Close\"\n {...closeProps}\n ref={forwardedRef}\n onPress={composeEventHandlers(props.onPress as any, interactiveContext.onClose)}\n />\n </ToastAnnounceExclude>\n )\n }\n)\n\nToastClose.displayName = CLOSE_NAME\n\n/* -------------------------------------------------------------------------------------------------\n * Toast\n * -----------------------------------------------------------------------------------------------*/\n\nconst ToastComponent = React.forwardRef<TamaguiElement, ToastProps>(\n ToastImplFrame.extractable((props: ScopedProps<ToastProps>, forwardedRef) => {\n const { forceMount, open: openProp, defaultOpen, onOpenChange, ...toastProps } = props\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen ?? true,\n onChange: onOpenChange,\n })\n\n const id = useId()\n const onPause = useEvent(props.onPause)\n const onResume = useEvent(props.onResume)\n const shouldShow = forceMount || open\n\n if (!shouldShow) return null\n\n return (\n <ToastImpl\n id={id}\n open={open}\n {...toastProps}\n ref={forwardedRef}\n onClose={() => setOpen(false)}\n onPause={onPause}\n onResume={onResume}\n onSwipeEnd={composeEventHandlers(props.onSwipeEnd, (event) => {\n setOpen(false)\n })}\n />\n )\n })\n)\n\nToastComponent.displayName = TOAST_NAME\n\nconst Toast = withStaticProperties(\n themeable(ToastComponent, ToastImplFrame.staticConfig),\n {\n Title: ToastTitle,\n Description: ToastDescription,\n Action: ToastAction,\n Close: ToastClose,\n }\n)\n\n/* ---------------------------------------------------------------------------------------------- */\n\nexport {\n Toast,\n ToastProvider,\n ToastViewport,\n //\n createToastScope,\n // imperative\n useToast,\n useToastController,\n useToastState,\n}\nexport type {\n ToastActionProps,\n ToastCloseProps,\n ToastDescriptionProps,\n ToastProps,\n ToastProviderProps,\n ToastTitleProps,\n ToastViewportProps,\n // imperative\n ToastNativeValue,\n ToastNativePlatform,\n}\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["jsx", "composeEventHandlers", "styled", "themeable", "useEvent", "useId", "withStaticProperties", "ThemeableStack", "SizableText", "useControllableState", "React", "TOAST_NAME", "ToastAnnounceExclude", "useToast", "useToastController", "useToastState", "ToastImpl", "ToastImplFrame", "useToastInteractiveContext", "ToastProvider", "createToastScope", "ToastViewport", "TITLE_NAME", "ToastTitleFrame", "ToastTitle", "props", "forwardedRef", "__scopeToast", "titleProps", "DESCRIPTION_NAME", "ToastDescriptionFrame", "ToastDescription", "descriptionProps", "ACTION_NAME", "ToastAction", "altText", "actionProps", "ToastClose", "CLOSE_NAME", "ToastCloseFrame", "closeProps", "interactiveContext", "ToastComponent", "forceMount", "openProp", "defaultOpen", "onOpenChange", "toastProps", "open", "setOpen", "id", "onPause", "onResume", "event", "Toast"]
|
|
7
7
|
}
|
|
@@ -1,64 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
Stack,
|
|
4
|
-
Text,
|
|
5
|
-
styled,
|
|
6
|
-
useEvent,
|
|
7
|
-
useIsomorphicLayoutEffect
|
|
8
|
-
} from "@tamagui/core";
|
|
9
|
-
import { Portal } from "@tamagui/portal";
|
|
10
|
-
import { VisuallyHidden } from "@tamagui/visually-hidden";
|
|
11
|
-
import * as React from "react";
|
|
12
|
-
import { useToastProviderContext } from "./ToastProvider";
|
|
13
|
-
import { TOAST_NAME } from "./constants";
|
|
14
|
-
const ToastAnnounceExcludeFrame = styled(Stack, {
|
|
15
|
-
name: "ToastAnnounceExclude"
|
|
16
|
-
});
|
|
17
|
-
const ToastAnnounceExclude = React.forwardRef(
|
|
18
|
-
(props, forwardedRef) => {
|
|
19
|
-
const { __scopeToast, altText, ...announceExcludeProps } = props;
|
|
20
|
-
return /* @__PURE__ */ jsx(
|
|
21
|
-
ToastAnnounceExcludeFrame,
|
|
22
|
-
{
|
|
23
|
-
"data-toast-announce-exclude": "",
|
|
24
|
-
"data-toast-announce-alt": altText || void 0,
|
|
25
|
-
...announceExcludeProps,
|
|
26
|
-
ref: forwardedRef
|
|
27
|
-
}
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
);
|
|
31
|
-
const ToastAnnounce = (props) => {
|
|
32
|
-
const { __scopeToast, children, ...announceProps } = props;
|
|
33
|
-
const context = useToastProviderContext(TOAST_NAME, __scopeToast);
|
|
34
|
-
const [renderAnnounceText, setRenderAnnounceText] = React.useState(false);
|
|
35
|
-
const [isAnnounced, setIsAnnounced] = React.useState(false);
|
|
36
|
-
useNextFrame(() => setRenderAnnounceText(true));
|
|
37
|
-
React.useEffect(() => {
|
|
38
|
-
const timer = setTimeout(() => setIsAnnounced(true), 1e3);
|
|
39
|
-
return () => clearTimeout(timer);
|
|
40
|
-
}, []);
|
|
41
|
-
return isAnnounced ? null : /* @__PURE__ */ jsx(Portal, { asChild: true, children: /* @__PURE__ */ jsx(VisuallyHidden, { ...announceProps, children: renderAnnounceText && /* @__PURE__ */ jsxs(Text, { children: [
|
|
42
|
-
context.label,
|
|
43
|
-
" ",
|
|
44
|
-
children
|
|
45
|
-
] }) }) });
|
|
46
|
-
};
|
|
47
|
-
function useNextFrame(callback = () => {
|
|
48
|
-
}) {
|
|
49
|
-
const fn = useEvent(callback);
|
|
50
|
-
useIsomorphicLayoutEffect(() => {
|
|
51
|
-
let raf1 = 0;
|
|
52
|
-
let raf2 = 0;
|
|
53
|
-
raf1 = requestAnimationFrame(() => raf2 = requestAnimationFrame(fn));
|
|
54
|
-
return () => {
|
|
55
|
-
cancelAnimationFrame(raf1);
|
|
56
|
-
cancelAnimationFrame(raf2);
|
|
57
|
-
};
|
|
58
|
-
}, [fn]);
|
|
59
|
-
}
|
|
60
|
-
export {
|
|
61
|
-
ToastAnnounce,
|
|
62
|
-
ToastAnnounceExclude
|
|
63
|
-
};
|
|
1
|
+
import{jsx as a,jsxs as g}from"react/jsx-runtime";import{Stack as p,Text as m,styled as T,useEvent as A,useIsomorphicLayoutEffect as f}from"@tamagui/core";import{Portal as x}from"@tamagui/portal";import{VisuallyHidden as P}from"@tamagui/visually-hidden";import*as s from"react";import{useToastProviderContext as E}from"./ToastProvider";import{TOAST_NAME as F}from"./constants";const y=T(p,{name:"ToastAnnounceExclude"}),S=s.forwardRef((o,e)=>{const{__scopeToast:t,altText:n,...r}=o;return a(y,{"data-toast-announce-exclude":"","data-toast-announce-alt":n||void 0,...r,ref:e})}),h=o=>{const{__scopeToast:e,children:t,...n}=o,r=E(F,e),[c,u]=s.useState(!1),[l,d]=s.useState(!1);return _(()=>u(!0)),s.useEffect(()=>{const i=setTimeout(()=>d(!0),1e3);return()=>clearTimeout(i)},[]),l?null:a(x,{asChild:!0,children:a(P,{...n,children:c&&g(m,{children:[r.label," ",t]})})})};function _(o=()=>{}){const e=A(o);f(()=>{let t=0,n=0;return t=requestAnimationFrame(()=>n=requestAnimationFrame(e)),()=>{cancelAnimationFrame(t),cancelAnimationFrame(n)}},[e])}export{h as ToastAnnounce,S as ToastAnnounceExclude};
|
|
64
2
|
//# sourceMappingURL=ToastAnnounce.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/ToastAnnounce.tsx"],
|
|
4
4
|
"sourcesContent": ["import {\n GetProps,\n Stack,\n TamaguiElement,\n Text,\n styled,\n useEvent,\n useIsomorphicLayoutEffect,\n} from '@tamagui/core'\nimport { Portal } from '@tamagui/portal'\nimport { VisuallyHidden } from '@tamagui/visually-hidden'\nimport * as React from 'react'\n\nimport { ScopedProps, useToastProviderContext } from './ToastProvider'\nimport { TOAST_NAME } from './constants'\n\nconst ToastAnnounceExcludeFrame = styled(Stack, {\n name: 'ToastAnnounceExclude',\n})\ntype ToastAnnounceExcludeFrameProps = GetProps<typeof ToastAnnounceExcludeFrame>\ntype ToastAnnounceExcludeProps = ToastAnnounceExcludeFrameProps & {\n altText?: string\n}\n\nconst ToastAnnounceExclude = React.forwardRef<TamaguiElement, ToastAnnounceExcludeProps>(\n (props: ScopedProps<ToastAnnounceExcludeProps>, forwardedRef) => {\n const { __scopeToast, altText, ...announceExcludeProps } = props\n\n return (\n <ToastAnnounceExcludeFrame\n data-toast-announce-exclude=\"\"\n data-toast-announce-alt={altText || undefined}\n {...announceExcludeProps}\n ref={forwardedRef}\n />\n )\n }\n)\n\n/* -----------------------------------------------------------------------------------------------*/\n\ninterface ToastAnnounceProps\n extends Omit<GetProps<typeof VisuallyHidden>, 'children'>,\n ScopedProps<{ children: string[] }> {}\n\nconst ToastAnnounce: React.FC<ToastAnnounceProps> = (\n props: ScopedProps<ToastAnnounceProps>\n) => {\n const { __scopeToast, children, ...announceProps } = props\n const context = useToastProviderContext(TOAST_NAME, __scopeToast)\n const [renderAnnounceText, setRenderAnnounceText] = React.useState(false)\n const [isAnnounced, setIsAnnounced] = React.useState(false)\n\n // render text content in the next frame to ensure toast is announced in NVDA\n useNextFrame(() => setRenderAnnounceText(true))\n\n // cleanup after announcing\n React.useEffect(() => {\n const timer = setTimeout(() => setIsAnnounced(true), 1000)\n return () => clearTimeout(timer)\n }, [])\n\n return isAnnounced ? null : (\n <Portal asChild>\n <VisuallyHidden {...announceProps}>\n {renderAnnounceText && (\n <Text>\n {context.label} {children}\n </Text>\n )}\n </VisuallyHidden>\n </Portal>\n )\n}\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction useNextFrame(callback = () => {}) {\n const fn = useEvent(callback)\n useIsomorphicLayoutEffect(() => {\n let raf1 = 0\n let raf2 = 0\n raf1 = requestAnimationFrame(() => (raf2 = requestAnimationFrame(fn)))\n return () => {\n cancelAnimationFrame(raf1)\n cancelAnimationFrame(raf2)\n }\n }, [fn])\n}\n\n\nexport {\n ToastAnnounce,\n ToastAnnounceProps,\n ToastAnnounceExclude,\n ToastAnnounceExcludeProps,\n}\n"],
|
|
5
|
-
"mappings": "AA6BM,
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "AA6BM,cAAAA,EAqCI,QAAAC,MArCJ,oBA7BN,OAEE,SAAAC,EAEA,QAAAC,EACA,UAAAC,EACA,YAAAC,EACA,6BAAAC,MACK,gBACP,OAAS,UAAAC,MAAc,kBACvB,OAAS,kBAAAC,MAAsB,2BAC/B,UAAYC,MAAW,QAEvB,OAAsB,2BAAAC,MAA+B,kBACrD,OAAS,cAAAC,MAAkB,cAE3B,MAAMC,EAA4BR,EAAOF,EAAO,CAC9C,KAAM,sBACR,CAAC,EAMKW,EAAuBJ,EAAM,WACjC,CAACK,EAA+CC,IAAiB,CAC/D,KAAM,CAAE,aAAAC,EAAc,QAAAC,EAAS,GAAGC,CAAqB,EAAIJ,EAE3D,OACEd,EAACY,EAAA,CACC,8BAA4B,GAC5B,0BAAyBK,GAAW,OACnC,GAAGC,EACJ,IAAKH,EACP,CAEJ,CACF,EAQMI,EACJL,GACG,CACH,KAAM,CAAE,aAAAE,EAAc,SAAAI,EAAU,GAAGC,CAAc,EAAIP,EAC/CQ,EAAUZ,EAAwBC,EAAYK,CAAY,EAC1D,CAACO,EAAoBC,CAAqB,EAAIf,EAAM,SAAS,EAAK,EAClE,CAACgB,EAAaC,CAAc,EAAIjB,EAAM,SAAS,EAAK,EAG1D,OAAAkB,EAAa,IAAMH,EAAsB,EAAI,CAAC,EAG9Cf,EAAM,UAAU,IAAM,CACpB,MAAMmB,EAAQ,WAAW,IAAMF,EAAe,EAAI,EAAG,GAAI,EACzD,MAAO,IAAM,aAAaE,CAAK,CACjC,EAAG,CAAC,CAAC,EAEEH,EAAc,KACnBzB,EAACO,EAAA,CAAO,QAAO,GACb,SAAAP,EAACQ,EAAA,CAAgB,GAAGa,EACjB,SAAAE,GACCtB,EAACE,EAAA,CACE,UAAAmB,EAAQ,MAAM,IAAEF,GACnB,EAEJ,EACF,CAEJ,EAIA,SAASO,EAAaE,EAAW,IAAM,CAAC,EAAG,CACzC,MAAMC,EAAKzB,EAASwB,CAAQ,EAC5BvB,EAA0B,IAAM,CAC9B,IAAIyB,EAAO,EACPC,EAAO,EACX,OAAAD,EAAO,sBAAsB,IAAOC,EAAO,sBAAsBF,CAAE,CAAE,EAC9D,IAAM,CACX,qBAAqBC,CAAI,EACzB,qBAAqBC,CAAI,CAC3B,CACF,EAAG,CAACF,CAAE,CAAC,CACT",
|
|
6
|
+
"names": ["jsx", "jsxs", "Stack", "Text", "styled", "useEvent", "useIsomorphicLayoutEffect", "Portal", "VisuallyHidden", "React", "useToastProviderContext", "TOAST_NAME", "ToastAnnounceExcludeFrame", "ToastAnnounceExclude", "props", "forwardedRef", "__scopeToast", "altText", "announceExcludeProps", "ToastAnnounce", "children", "announceProps", "context", "renderAnnounceText", "setRenderAnnounceText", "isAnnounced", "setIsAnnounced", "useNextFrame", "timer", "callback", "fn", "raf1", "raf2"]
|
|
7
7
|
}
|