toastory 0.1.3 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -1
- package/dist/angular.cjs +1 -3
- package/dist/angular.cjs.map +1 -1
- package/dist/angular.d.cts +12 -5
- package/dist/angular.d.ts +12 -5
- package/dist/angular.js +1 -3
- package/dist/angular.js.map +1 -1
- package/dist/core.cjs +1 -2
- package/dist/core.cjs.map +1 -1
- package/dist/core.d.cts +41 -6
- package/dist/core.d.ts +41 -6
- package/dist/core.js +1 -2
- package/dist/core.js.map +1 -1
- package/dist/{dialog-Buemfm7I.d.ts → dialog-D-y37Xl5.d.ts} +1 -1
- package/dist/{dialog-fziFV6J0.d.cts → dialog-mUI__8O3.d.cts} +1 -1
- package/dist/index.cjs +1 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -5
- package/dist/index.d.ts +6 -5
- package/dist/index.js +1 -6
- package/dist/index.js.map +1 -1
- package/dist/native.cjs +1 -2
- package/dist/native.cjs.map +1 -1
- package/dist/native.d.cts +85 -5
- package/dist/native.d.ts +85 -5
- package/dist/native.js +1 -2
- package/dist/native.js.map +1 -1
- package/dist/react.cjs +1 -3
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +5 -4
- package/dist/react.d.ts +5 -4
- package/dist/react.js +1 -3
- package/dist/react.js.map +1 -1
- package/dist/sound-DLXnQDzO.d.cts +18 -0
- package/dist/sound-UiOhOgA9.d.ts +18 -0
- package/dist/svelte.cjs +1 -3
- package/dist/svelte.cjs.map +1 -1
- package/dist/svelte.d.cts +6 -3
- package/dist/svelte.d.ts +6 -3
- package/dist/svelte.js +1 -3
- package/dist/svelte.js.map +1 -1
- package/dist/themes/_base.css +1 -1
- package/dist/themes/_base.dialog.css +1 -1
- package/dist/themes/_base.toast.css +1 -1
- package/dist/themes/all.css +1 -1
- package/dist/themes/aurora.css +1 -1
- package/dist/themes/aurora.dialog.css +1 -1
- package/dist/themes/aurora.toast.css +1 -1
- package/dist/themes/basic.css +1 -1
- package/dist/themes/basic.dialog.css +1 -1
- package/dist/themes/basic.toast.css +1 -1
- package/dist/themes/brutal.css +1 -1
- package/dist/themes/brutal.dialog.css +1 -1
- package/dist/themes/brutal.toast.css +1 -1
- package/dist/themes/classic-bar.css +1 -1
- package/dist/themes/classic-bar.dialog.css +1 -1
- package/dist/themes/classic-bar.toast.css +1 -1
- package/dist/themes/classic-stack.css +1 -1
- package/dist/themes/classic-stack.dialog.css +1 -1
- package/dist/themes/classic-stack.toast.css +1 -1
- package/dist/themes/dialogs.css +1 -1
- package/dist/themes/dialogs.dialog.css +1 -1
- package/dist/themes/dialogs.toast.css +1 -1
- package/dist/themes/essentials.css +1 -1
- package/dist/themes/essentials.dialog.css +1 -1
- package/dist/themes/essentials.toast.css +1 -1
- package/dist/themes/flat.css +1 -1
- package/dist/themes/flat.dialog.css +1 -1
- package/dist/themes/flat.toast.css +1 -1
- package/dist/themes/gradient-strip.css +1 -1
- package/dist/themes/gradient-strip.dialog.css +1 -1
- package/dist/themes/gradient-strip.toast.css +1 -1
- package/dist/themes/gradient.css +1 -1
- package/dist/themes/gradient.dialog.css +1 -1
- package/dist/themes/gradient.toast.css +1 -1
- package/dist/themes/ios-glass.css +1 -1
- package/dist/themes/ios-glass.dialog.css +1 -1
- package/dist/themes/ios-glass.toast.css +1 -1
- package/dist/themes/liquid-glass.css +1 -1
- package/dist/themes/liquid-glass.dialog.css +1 -1
- package/dist/themes/liquid-glass.toast.css +1 -1
- package/dist/themes/material.css +1 -1
- package/dist/themes/material.dialog.css +1 -1
- package/dist/themes/material.toast.css +1 -1
- package/dist/themes/minimal.css +1 -1
- package/dist/themes/minimal.dialog.css +1 -1
- package/dist/themes/minimal.toast.css +1 -1
- package/dist/themes/neon.css +1 -1
- package/dist/themes/neon.dialog.css +1 -1
- package/dist/themes/neon.toast.css +1 -1
- package/dist/themes/outline.css +1 -1
- package/dist/themes/outline.dialog.css +1 -1
- package/dist/themes/outline.toast.css +1 -1
- package/dist/themes/pastel.css +1 -1
- package/dist/themes/pastel.dialog.css +1 -1
- package/dist/themes/pastel.toast.css +1 -1
- package/dist/themes/pill.css +1 -1
- package/dist/themes/pill.dialog.css +1 -1
- package/dist/themes/pill.toast.css +1 -1
- package/dist/themes/ripple.css +1 -1
- package/dist/themes/ripple.dialog.css +1 -1
- package/dist/themes/ripple.toast.css +1 -1
- package/dist/themes/showcase.css +1 -1
- package/dist/themes/showcase.dialog.css +1 -1
- package/dist/themes/showcase.toast.css +1 -1
- package/dist/themes/sweet.css +1 -1
- package/dist/themes/sweet.dialog.css +1 -1
- package/dist/themes/sweet.toast.css +1 -1
- package/dist/{toast-api-D6WYDtUy.d.cts → toast-api-C5nqvDgA.d.cts} +79 -6
- package/dist/{toast-api-D6WYDtUy.d.ts → toast-api-C5nqvDgA.d.ts} +79 -6
- package/dist/{ui-Cs1AjRNH.d.ts → ui-C1Zh-Kff.d.ts} +4 -2
- package/dist/{ui-D5FwMD8Y.d.cts → ui-D1WECTSn.d.cts} +4 -2
- package/dist/vue.cjs +1 -3
- package/dist/vue.cjs.map +1 -1
- package/dist/vue.d.cts +42 -5
- package/dist/vue.d.ts +42 -5
- package/dist/vue.js +1 -3
- package/dist/vue.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
.gk-root
|
|
1
|
+
.gk-root *{box-sizing:border-box}.gk-root{box-sizing:border-box;font-family:var(--gk-font,system-ui, sans-serif);--gk-ease:cubic-bezier(.22, 1, .36, 1);--gk-duration:.38s}.gk-root [hidden]{display:none!important}.gk-region,.gk-toast-list{margin:0;padding:0}.gk-region{z-index:var(--gk-z,2147480000);width:var(--gk-width,360px);pointer-events:none;max-width:calc(100vw - 32px);transition:height var(--gk-duration) var(--gk-ease);position:fixed}.gk-region[data-contained]{position:absolute}.gk-region[data-position^=top]{top:max(var(--gk-offset-top,16px), env(safe-area-inset-top,0))}.gk-region[data-position^=bottom]{bottom:max(var(--gk-offset-bottom,16px), env(safe-area-inset-bottom,0))}.gk-region[data-position$=left]{left:max(var(--gk-offset-left,16px), env(safe-area-inset-left,0))}.gk-region[data-position$=right]{right:max(var(--gk-offset-right,16px), env(safe-area-inset-right,0))}.gk-region:is([data-position$=center],[data-position=middle]){left:50%;transform:translate(-50%)}.gk-region:is([data-position=center],[data-position=middle]){top:50%;transform:translate(-50%,-50%)}@media (width<=600px){.gk-region{width:calc(100vw - var(--gk-mobile-offset,32px))!important;max-width:100vw!important;left:50%!important;right:auto!important;transform:translate(-50%)!important}.gk-region:is([data-position=center],[data-position=middle]){transform:translate(-50%,-50%)!important}.gk-toast{--gk-blur:min(var(--gk-blur),12px)}}.gk-toast-list{height:100%;list-style:none;position:relative}.gk-toast{--gk-y:calc(var(--gk-dir,1) * var(--gk-offset,0px));color:var(--gk-fg);background:var(--gk-bg);border:var(--gk-border-w,1px) solid var(--gk-border);border-radius:var(--gk-radius);box-shadow:var(--gk-shadow);backdrop-filter:blur(var(--gk-blur)) saturate(var(--gk-saturate));pointer-events:auto;touch-action:pan-y;user-select:none;transform-origin:top;transform:translate(var(--gk-sx,0px), calc(var(--gk-y) + var(--gk-sy,0px)));transition:var(--gk-duration) var(--gk-ease);flex-wrap:wrap;align-items:flex-start;gap:8px 12px;padding:14px 16px;display:flex;position:absolute;inset:0 0 auto;overflow:hidden}.gk-toast[data-has-close]{padding-inline-end:38px}.gk-region[data-position^=bottom] .gk-toast{transform-origin:bottom;inset:auto 0 0}.gk-region[data-shadow=false] .gk-toast{box-shadow:none}:is(.gk-toast,.gk-btn,.gk-close,.gk-link):focus-visible{outline:2px solid var(--gk-accent);outline-offset:2px}.gk-region[data-expanded=false] .gk-toast{--gk-y:calc(var(--gk-dir,1) * var(--gk-index,0) * 10px);transform:translate(var(--gk-sx,0px), calc(var(--gk-y) + var(--gk-sy,0px))) scale(calc(1 - var(--gk-index,0) * .05))}.gk-region[data-expanded=false] .gk-toast:not(:last-child){height:var(--gk-front);pointer-events:none}.gk-region[data-expanded=false] :is(.gk-toast:not(:last-child)>*,.gk-toast[data-far]){opacity:0}.gk-toast[data-type=success]{--gk-type:var(--gk-success)}.gk-toast[data-type=error]{--gk-type:var(--gk-error)}.gk-toast[data-type=warning]{--gk-type:var(--gk-warning)}.gk-toast[data-type=info]{--gk-type:var(--gk-info)}.gk-toast[data-type=loading]{--gk-type:var(--gk-accent)}.gk-toast[data-rich]{background:color-mix(in srgb, var(--gk-type,transparent) 16%, var(--gk-bg-solid));border-color:var(--gk-type,var(--gk-border))}.gk-toast[data-clickable]{cursor:pointer}.gk-icon{color:var(--gk-type,var(--gk-muted));flex:none;margin-top:1px;display:flex}.gk-avatar img{object-fit:cover;border-radius:50%;width:32px;height:32px;display:block}.gk-content,.gk-link{overflow-wrap:break-word;word-break:normal;flex:140px;min-width:140px}.gk-link{color:inherit;text-decoration:none;display:block}.gk-link:hover{text-decoration:underline}.gk-title{font:600 14px/1.4 inherit}.gk-desc{color:var(--gk-muted);margin-top:2px;font:13px/1.4 inherit}.gk-desc a{color:inherit}.gk-count{border:1px solid var(--gk-border);color:var(--gk-muted);border-radius:9px;margin-top:4px;padding:0 6px;font:11px/18px inherit;display:inline-block}.gk-actions{flex-wrap:wrap;align-items:center;gap:8px;margin-inline-start:auto;display:flex}.gk-toast[data-wrap] .gk-actions{justify-content:end;width:100%}.gk-btn,.gk-close{cursor:pointer;background:0 0}.gk-btn{min-height:28px;color:var(--gk-fg);border:1px solid var(--gk-border);border-radius:calc(var(--gk-radius) / 2);white-space:nowrap;padding:0 12px;font:600 13px inherit}.gk-action{color:var(--gk-accent-fg);background:var(--gk-accent);border-color:var(--gk-accent)}.gk-close{top:12px;width:24px;height:24px;color:var(--gk-muted);z-index:2;border:0;border-radius:50%;justify-content:center;align-items:center;padding:0;display:flex;position:absolute;inset-inline-end:12px}.gk-close svg{width:16px;height:16px}.gk-close:hover{color:var(--gk-fg)}.gk-progress{height:3px;position:absolute;inset:auto 0 0}.gk-progress i{background:var(--gk-type,var(--gk-accent));transform-origin:0;height:100%;animation:gk-shrink var(--gk-d) linear forwards;animation-delay:var(--gk-delay,0s);display:block}[dir=rtl] .gk-progress i{transform-origin:100%}.gk-toast[data-paused] .gk-progress i{animation-play-state:paused}.gk-spin{animation:.9s linear infinite gk-spin}@keyframes gk-shrink{to{transform:scaleX(0)}}@keyframes gk-spin{to{transform:rotate(360deg)}}@keyframes gk-bounce{0%{opacity:0;transform:scale(.8)}}@keyframes gk-zoom{0%{opacity:0;transform:scale(.85)}}@keyframes gk-flip{0%{opacity:0;transform:perspective(600px)rotateX(80deg)}}@keyframes gk-spring{0%{opacity:0;transform:translateY(-35px)}}@keyframes gk-fade{0%{opacity:0}}.gk-toast[data-animation]{animation:var(--gk-duration) var(--gk-ease)}.gk-toast[data-animation=bounce]{animation-name:gk-bounce}.gk-toast[data-animation=zoom]{animation-name:gk-zoom}.gk-toast[data-animation=flip]{animation-name:gk-flip}.gk-toast[data-animation=spring]{animation-name:gk-spring}.gk-toast[data-animation=fade]{animation-name:gk-fade}.gk-toast[data-animation=none]{transition:none;animation:none}.gk-toast[data-mounted=false]{opacity:0;transform:translate(0, calc(var(--gk-y) + var(--gk-dir,1) * -60%)) scale(.96)}.gk-toast[data-swiping]{transition:none}.gk-toast[data-dismissed]{opacity:0;pointer-events:none}@supports not (backdrop-filter:blur(1px)){.gk-toast{background:var(--gk-bg-solid)}}@media (prefers-reduced-transparency:reduce){.gk-toast{background:var(--gk-bg-solid);backdrop-filter:none}}@media (forced-colors:active){.gk-toast{background:var(--gk-bg-solid);color:canvastext;border-color:buttonborder}}@media (prefers-reduced-motion:reduce){.gk-region{transition:opacity .15s!important}.gk-toast{transition:opacity .15s!important;animation:.15s gk-fade!important}.gk-spin{animation:none}}[data-gk-theme=sweet]{color-scheme:light;--gk-radius:14px;--gk-blur:0px;--gk-saturate:100%;--gk-font:-apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;--gk-bg:#fff;--gk-bg-solid:#fff;--gk-fg:#1d1d1f;--gk-muted:#515156;--gk-border:#3c3c4338;--gk-shadow:0 12px 34px #0003;--gk-accent:#0057c2;--gk-accent-fg:#fff;--gk-danger:#b71c1c;--gk-danger-fg:#fff;--gk-success:#1a7f37;--gk-error:#b71c1c;--gk-warning:#8a5a00;--gk-info:#0b5cc7}[data-gk-theme=sweet][data-gk-mode=dark],:is(.dark,[data-theme=dark]) [data-gk-theme=sweet]{color-scheme:dark;--gk-bg:#26262b;--gk-bg-solid:#26262b;--gk-fg:#f5f5f7;--gk-muted:#b4b4bb;--gk-border:#ffffff29;--gk-shadow:0 12px 34px #0000008c;--gk-accent:#4da3ff;--gk-accent-fg:#00152e;--gk-danger:#ff8a8a;--gk-danger-fg:#2b0000;--gk-success:#4ade80;--gk-error:#ff7b7b;--gk-warning:#ffc857;--gk-info:#6cb6ff}@media (prefers-color-scheme:dark){[data-gk-theme=sweet][data-gk-mode=auto]{color-scheme:dark;--gk-bg:#26262b;--gk-bg-solid:#26262b;--gk-fg:#f5f5f7;--gk-muted:#b4b4bb;--gk-border:#ffffff29;--gk-shadow:0 12px 34px #0000008c;--gk-accent:#4da3ff;--gk-accent-fg:#00152e;--gk-danger:#ff8a8a;--gk-danger-fg:#2b0000;--gk-success:#4ade80;--gk-error:#ff7b7b;--gk-warning:#ffc857;--gk-info:#6cb6ff}}.gk-toast[data-gk-theme=sweet]{align-items:center;padding:16px 18px}.gk-toast[data-gk-theme=sweet] .gk-icon{border:3px solid var(--gk-type,var(--gk-border));border-radius:50%;justify-content:center;align-items:center;width:36px;height:36px;margin:0}.gk-toast[data-gk-theme=sweet] .gk-title{font-size:15px;font-weight:700}.gk-toast[data-gk-theme=sweet] .gk-btn{border-radius:10px;transition:all .16s}.gk-toast[data-gk-theme=sweet] .gk-action{background:var(--gk-accent);color:var(--gk-accent-fg);box-shadow:0 3px 10px color-mix(in srgb,var(--gk-accent) 30%,transparent);border-color:#0000}.gk-toast[data-gk-theme=sweet] .gk-btn:not(.gk-action){background:color-mix(in srgb,var(--gk-fg) 8%,transparent);border-color:var(--gk-border)}
|
|
@@ -35,8 +35,8 @@ type Renderable = unknown;
|
|
|
35
35
|
type BuiltInToastType = 'default' | 'message' | 'success' | 'error' | 'info' | 'warning' | 'loading';
|
|
36
36
|
/** Toast type name: a built-in type or custom registered type string. */
|
|
37
37
|
type ToastType = BuiltInToastType | (string & {});
|
|
38
|
-
/** Placements supported by toast regions (
|
|
39
|
-
type ToastPosition = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
|
|
38
|
+
/** Placements supported by toast regions (7 positions: 3 top, 1 middle, 3 bottom). */
|
|
39
|
+
type ToastPosition = 'top-left' | 'top-center' | 'top-right' | 'center' | 'middle' | 'bottom-left' | 'bottom-center' | 'bottom-right';
|
|
40
40
|
/** The five rows of the dialog placement grid. */
|
|
41
41
|
type DialogRow = 'top' | 'upper' | 'center' | 'lower' | 'bottom';
|
|
42
42
|
/** The three columns of the dialog placement grid. */
|
|
@@ -103,8 +103,6 @@ interface ToastAction {
|
|
|
103
103
|
/** Optional accessible label when the text alone is ambiguous. */
|
|
104
104
|
ariaLabel?: string;
|
|
105
105
|
}
|
|
106
|
-
/** Alias for ToastAction. */
|
|
107
|
-
type ToastButton = ToastAction;
|
|
108
106
|
/** Slot class names a consumer can override. */
|
|
109
107
|
interface ToastClassNames {
|
|
110
108
|
toast?: string;
|
|
@@ -112,6 +110,8 @@ interface ToastClassNames {
|
|
|
112
110
|
description?: string;
|
|
113
111
|
icon?: string;
|
|
114
112
|
avatar?: string;
|
|
113
|
+
image?: string;
|
|
114
|
+
character?: string;
|
|
115
115
|
actionButton?: string;
|
|
116
116
|
cancelButton?: string;
|
|
117
117
|
closeButton?: string;
|
|
@@ -145,6 +145,35 @@ interface ToastRenderContext {
|
|
|
145
145
|
}
|
|
146
146
|
/** Custom renderer callback. */
|
|
147
147
|
type ToastCustomRenderer = (context: ToastRenderContext) => Renderable;
|
|
148
|
+
/** Built-in sound cue names for audio feedback. */
|
|
149
|
+
type BuiltInSoundCue = 'success' | 'error' | 'warning' | 'info' | 'ding' | 'pop' | 'chime' | 'bell' | 'message' | 'bubble' | 'marimba' | 'crystal' | 'subtle' | 'harp';
|
|
150
|
+
/** Audio feedback sound cue name or custom string. */
|
|
151
|
+
type SoundCue = BuiltInSoundCue | (string & {});
|
|
152
|
+
/** CTA Button definition inside toast notification. */
|
|
153
|
+
interface ToastButton {
|
|
154
|
+
/** Visible button text. */
|
|
155
|
+
label: string;
|
|
156
|
+
/** Click/press handler. */
|
|
157
|
+
onClick?: (event: {
|
|
158
|
+
preventDefault(): void;
|
|
159
|
+
defaultPrevented: boolean;
|
|
160
|
+
}) => void;
|
|
161
|
+
/** React Native press handler alias. */
|
|
162
|
+
onPress?: (event: {
|
|
163
|
+
preventDefault(): void;
|
|
164
|
+
defaultPrevented: boolean;
|
|
165
|
+
}) => void;
|
|
166
|
+
/** Optional CSS class. */
|
|
167
|
+
className?: string;
|
|
168
|
+
/** Optional inline styles. */
|
|
169
|
+
style?: Record<string, string | number>;
|
|
170
|
+
/** Visual button kind. */
|
|
171
|
+
kind?: 'primary' | 'secondary' | 'danger';
|
|
172
|
+
/** Whether clicking automatically dismisses the toast. Defaults to true. */
|
|
173
|
+
autoDismiss?: boolean;
|
|
174
|
+
}
|
|
175
|
+
/** Mascot character / robot avatar preset names. */
|
|
176
|
+
type RobotCharacter = 'wave' | 'success' | 'error' | 'think' | 'loading' | 'sleep' | 'shock' | 'search' | 'headPalm' | 'base';
|
|
148
177
|
/**
|
|
149
178
|
* Options accepted by every toast creation call.
|
|
150
179
|
*/
|
|
@@ -155,8 +184,12 @@ interface ToastOptions {
|
|
|
155
184
|
type?: ToastType;
|
|
156
185
|
/** Heading text or renderable node. */
|
|
157
186
|
title?: Renderable;
|
|
187
|
+
/** react-native-toast-message title alias. */
|
|
188
|
+
text1?: Renderable;
|
|
158
189
|
/** Secondary subtitle or body text. */
|
|
159
190
|
description?: Renderable;
|
|
191
|
+
/** react-native-toast-message description alias. */
|
|
192
|
+
text2?: Renderable;
|
|
160
193
|
/** Theme-declared variant preset. */
|
|
161
194
|
variant?: ToastVariant;
|
|
162
195
|
/** Tone icon chip badge or custom badge description. */
|
|
@@ -179,6 +212,8 @@ interface ToastOptions {
|
|
|
179
212
|
progressLabel?: string;
|
|
180
213
|
/** Action buttons array. */
|
|
181
214
|
actions?: ToastActionItem[];
|
|
215
|
+
/** Multiple CTA buttons list (robot-toast & react-native compatible). */
|
|
216
|
+
buttons?: ToastButton[];
|
|
182
217
|
/** Interactive toggle switch. */
|
|
183
218
|
toggle?: ToastToggleOption;
|
|
184
219
|
/** Group key for grouped notifications stack. */
|
|
@@ -197,10 +232,30 @@ interface ToastOptions {
|
|
|
197
232
|
icon?: Renderable | false;
|
|
198
233
|
/** Avatar URL, initials object, or node shown before text. */
|
|
199
234
|
avatar?: Renderable | ToastAvatarOption;
|
|
235
|
+
/** Hero image banner or image URL. */
|
|
236
|
+
image?: string | ToastAvatarOption;
|
|
237
|
+
/** Mascot robot/character avatar variant. */
|
|
238
|
+
character?: RobotCharacter | (string & {});
|
|
239
|
+
/** Mascot robot variant alias. */
|
|
240
|
+
robotVariant?: RobotCharacter | (string & {});
|
|
200
241
|
/** Duration in ms. `0` or `Infinity` makes it persistent. */
|
|
201
242
|
duration?: number;
|
|
243
|
+
/** react-native-toast-message duration alias. */
|
|
244
|
+
visibilityTime?: number;
|
|
245
|
+
/** react-native-toast-message autoHide control: false makes it persistent. */
|
|
246
|
+
autoHide?: boolean;
|
|
202
247
|
/** Screen region placement. */
|
|
203
248
|
position?: ToastPosition;
|
|
249
|
+
/** Optional top offset in pixels (react-native-toast-message compatible). */
|
|
250
|
+
topOffset?: number;
|
|
251
|
+
/** Optional bottom offset in pixels (react-native-toast-message compatible). */
|
|
252
|
+
bottomOffset?: number;
|
|
253
|
+
/** Optional keyboard offset in pixels (react-native-toast-message compatible). */
|
|
254
|
+
keyboardOffset?: number;
|
|
255
|
+
/** Play audio feedback cue, sound url, or custom generator. */
|
|
256
|
+
sound?: boolean | SoundCue | string | ((type: ToastType) => void);
|
|
257
|
+
/** Audio playback volume (0.0 to 1.0). Defaults to 0.5. */
|
|
258
|
+
soundVolume?: number;
|
|
204
259
|
/** Primary action button. */
|
|
205
260
|
action?: ToastAction;
|
|
206
261
|
/** Secondary cancel button. */
|
|
@@ -209,6 +264,16 @@ interface ToastOptions {
|
|
|
209
264
|
closeButton?: boolean;
|
|
210
265
|
/** Accessible label for the close button. */
|
|
211
266
|
closeButtonLabel?: string;
|
|
267
|
+
/** Custom close / discard button icon. */
|
|
268
|
+
closeIcon?: Renderable;
|
|
269
|
+
/** Custom text for close / discard button (e.g., 'Dismiss', 'Close'). */
|
|
270
|
+
closeText?: string;
|
|
271
|
+
/** Discard button text alias. */
|
|
272
|
+
discardText?: string;
|
|
273
|
+
/** Discard button icon alias. */
|
|
274
|
+
discardIcon?: Renderable;
|
|
275
|
+
/** Toast body press/click handler. */
|
|
276
|
+
onPress?: (toast?: ToastRecord) => void;
|
|
212
277
|
/** Enter/exit animation preset. */
|
|
213
278
|
animation?: AnimationType;
|
|
214
279
|
/** Allow user dismissal. */
|
|
@@ -253,8 +318,12 @@ interface ToastOptions {
|
|
|
253
318
|
important?: boolean;
|
|
254
319
|
/** Lifecycle hook: fired when toast mounts/opens. Exactly once. */
|
|
255
320
|
onOpen?: (toast: ToastRecord) => void;
|
|
321
|
+
/** react-native-toast-message open callback alias. */
|
|
322
|
+
onShow?: () => void;
|
|
256
323
|
/** Lifecycle hook: fired when toast closes/exits. Exactly once. */
|
|
257
324
|
onClose?: (toast: ToastRecord, reason: CloseReason) => void;
|
|
325
|
+
/** react-native-toast-message close callback alias. */
|
|
326
|
+
onHide?: () => void;
|
|
258
327
|
/** Lifecycle hook: fired on user dismissal. Exactly once. */
|
|
259
328
|
onDismiss?: (toast: ToastRecord, reason: CloseReason) => void;
|
|
260
329
|
/** Lifecycle hook: fired when auto-close timer elapses. Exactly once. */
|
|
@@ -324,6 +393,10 @@ interface GlazeConfig {
|
|
|
324
393
|
startPaused: boolean;
|
|
325
394
|
newestOnTop: boolean;
|
|
326
395
|
dedupeWindow: number;
|
|
396
|
+
/** Global audio cue sound toggle or default cue name. */
|
|
397
|
+
sound?: boolean | SoundCue;
|
|
398
|
+
/** Global sound volume between 0.0 and 1.0. Defaults to 0.5. */
|
|
399
|
+
soundVolume?: number;
|
|
327
400
|
animation?: AnimationType;
|
|
328
401
|
offset?: OffsetConfig;
|
|
329
402
|
mobileOffset?: number | string;
|
|
@@ -702,5 +775,5 @@ interface ToastApi extends ToastFn {
|
|
|
702
775
|
/** Builds the `ui.toast` API on top of a store/manager. */
|
|
703
776
|
declare function createToastApi(store: ToastStore): ToastApi;
|
|
704
777
|
|
|
705
|
-
export { DEFAULT_CONFIG as D, MANUAL_PAUSE as M, createConfigStore as
|
|
706
|
-
export type {
|
|
778
|
+
export { DEFAULT_CONFIG as D, MANUAL_PAUSE as M, createConfigStore as at, createToastApi as au, createToastManager as av, createToastStore as aw, createTypeRegistry as ax, defaultClock as ay, resolvePrecedence as az };
|
|
779
|
+
export type { ShowcaseToastVariant as $, AddToastInput as A, BottomSheetHandle as B, Clock as C, EssentialsToastVariant as E, GlazeConfigPatch as F, GlazeConfig as G, LoadingHandle as H, IosGlassToastVariant as I, LoadingOptions as J, Mode as K, Listener as L, Position as N, OffsetConfig as O, PauseOn as P, PromiseData as Q, PromiseHandle as R, PromiseMessage as S, ToastApi as T, PromiseMessages as U, PromiseOutcome as V, Renderable as W, RobotCharacter as X, SheetAction as Y, SheetActionStyle as Z, SheetOptions as _, ToastRecord as a, SoundCue as a0, StackMode as a1, Store as a2, SwipeDirection as a3, ThemeName as a4, ToastAction as a5, ToastActionItem as a6, ToastAvatarOption as a7, ToastButton as a8, ToastClassNames as a9, ToastCustomRenderer as aa, ToastFn as ab, ToastId as ac, ToastManager as ad, ToastManagerOptions as ae, ToastOptions as af, ToastPatch as ag, ToastPosition as ah, ToastRenderContext as ai, ToastToggleOption as aj, ToastType as ak, ToastTypeDefinition as al, ToastVariant as am, ToastoryConfig as an, ToastoryConfigPatch as ao, TypeRegistry as ap, TypedDialogOptions as aq, Unsubscribe as ar, ValidateResult as as, ToastStore as b, AnimationType as c, BottomSheetOptions as d, BuiltInSoundCue as e, BuiltInToastType as f, CloseReason as g, ColorMode as h, Config as i, ConfigStore as j, DialogBackdrop as k, DialogButton as l, DialogChoice as m, DialogColumn as n, DialogHandle as o, DialogIcon as p, DialogInputType as q, DialogOptions as r, DialogPosition as s, DialogResult as t, DialogRow as u, DialogState as v, DialogTone as w, DialogVariant as x, Direction as y, DismissReason as z };
|
|
@@ -35,8 +35,8 @@ type Renderable = unknown;
|
|
|
35
35
|
type BuiltInToastType = 'default' | 'message' | 'success' | 'error' | 'info' | 'warning' | 'loading';
|
|
36
36
|
/** Toast type name: a built-in type or custom registered type string. */
|
|
37
37
|
type ToastType = BuiltInToastType | (string & {});
|
|
38
|
-
/** Placements supported by toast regions (
|
|
39
|
-
type ToastPosition = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
|
|
38
|
+
/** Placements supported by toast regions (7 positions: 3 top, 1 middle, 3 bottom). */
|
|
39
|
+
type ToastPosition = 'top-left' | 'top-center' | 'top-right' | 'center' | 'middle' | 'bottom-left' | 'bottom-center' | 'bottom-right';
|
|
40
40
|
/** The five rows of the dialog placement grid. */
|
|
41
41
|
type DialogRow = 'top' | 'upper' | 'center' | 'lower' | 'bottom';
|
|
42
42
|
/** The three columns of the dialog placement grid. */
|
|
@@ -103,8 +103,6 @@ interface ToastAction {
|
|
|
103
103
|
/** Optional accessible label when the text alone is ambiguous. */
|
|
104
104
|
ariaLabel?: string;
|
|
105
105
|
}
|
|
106
|
-
/** Alias for ToastAction. */
|
|
107
|
-
type ToastButton = ToastAction;
|
|
108
106
|
/** Slot class names a consumer can override. */
|
|
109
107
|
interface ToastClassNames {
|
|
110
108
|
toast?: string;
|
|
@@ -112,6 +110,8 @@ interface ToastClassNames {
|
|
|
112
110
|
description?: string;
|
|
113
111
|
icon?: string;
|
|
114
112
|
avatar?: string;
|
|
113
|
+
image?: string;
|
|
114
|
+
character?: string;
|
|
115
115
|
actionButton?: string;
|
|
116
116
|
cancelButton?: string;
|
|
117
117
|
closeButton?: string;
|
|
@@ -145,6 +145,35 @@ interface ToastRenderContext {
|
|
|
145
145
|
}
|
|
146
146
|
/** Custom renderer callback. */
|
|
147
147
|
type ToastCustomRenderer = (context: ToastRenderContext) => Renderable;
|
|
148
|
+
/** Built-in sound cue names for audio feedback. */
|
|
149
|
+
type BuiltInSoundCue = 'success' | 'error' | 'warning' | 'info' | 'ding' | 'pop' | 'chime' | 'bell' | 'message' | 'bubble' | 'marimba' | 'crystal' | 'subtle' | 'harp';
|
|
150
|
+
/** Audio feedback sound cue name or custom string. */
|
|
151
|
+
type SoundCue = BuiltInSoundCue | (string & {});
|
|
152
|
+
/** CTA Button definition inside toast notification. */
|
|
153
|
+
interface ToastButton {
|
|
154
|
+
/** Visible button text. */
|
|
155
|
+
label: string;
|
|
156
|
+
/** Click/press handler. */
|
|
157
|
+
onClick?: (event: {
|
|
158
|
+
preventDefault(): void;
|
|
159
|
+
defaultPrevented: boolean;
|
|
160
|
+
}) => void;
|
|
161
|
+
/** React Native press handler alias. */
|
|
162
|
+
onPress?: (event: {
|
|
163
|
+
preventDefault(): void;
|
|
164
|
+
defaultPrevented: boolean;
|
|
165
|
+
}) => void;
|
|
166
|
+
/** Optional CSS class. */
|
|
167
|
+
className?: string;
|
|
168
|
+
/** Optional inline styles. */
|
|
169
|
+
style?: Record<string, string | number>;
|
|
170
|
+
/** Visual button kind. */
|
|
171
|
+
kind?: 'primary' | 'secondary' | 'danger';
|
|
172
|
+
/** Whether clicking automatically dismisses the toast. Defaults to true. */
|
|
173
|
+
autoDismiss?: boolean;
|
|
174
|
+
}
|
|
175
|
+
/** Mascot character / robot avatar preset names. */
|
|
176
|
+
type RobotCharacter = 'wave' | 'success' | 'error' | 'think' | 'loading' | 'sleep' | 'shock' | 'search' | 'headPalm' | 'base';
|
|
148
177
|
/**
|
|
149
178
|
* Options accepted by every toast creation call.
|
|
150
179
|
*/
|
|
@@ -155,8 +184,12 @@ interface ToastOptions {
|
|
|
155
184
|
type?: ToastType;
|
|
156
185
|
/** Heading text or renderable node. */
|
|
157
186
|
title?: Renderable;
|
|
187
|
+
/** react-native-toast-message title alias. */
|
|
188
|
+
text1?: Renderable;
|
|
158
189
|
/** Secondary subtitle or body text. */
|
|
159
190
|
description?: Renderable;
|
|
191
|
+
/** react-native-toast-message description alias. */
|
|
192
|
+
text2?: Renderable;
|
|
160
193
|
/** Theme-declared variant preset. */
|
|
161
194
|
variant?: ToastVariant;
|
|
162
195
|
/** Tone icon chip badge or custom badge description. */
|
|
@@ -179,6 +212,8 @@ interface ToastOptions {
|
|
|
179
212
|
progressLabel?: string;
|
|
180
213
|
/** Action buttons array. */
|
|
181
214
|
actions?: ToastActionItem[];
|
|
215
|
+
/** Multiple CTA buttons list (robot-toast & react-native compatible). */
|
|
216
|
+
buttons?: ToastButton[];
|
|
182
217
|
/** Interactive toggle switch. */
|
|
183
218
|
toggle?: ToastToggleOption;
|
|
184
219
|
/** Group key for grouped notifications stack. */
|
|
@@ -197,10 +232,30 @@ interface ToastOptions {
|
|
|
197
232
|
icon?: Renderable | false;
|
|
198
233
|
/** Avatar URL, initials object, or node shown before text. */
|
|
199
234
|
avatar?: Renderable | ToastAvatarOption;
|
|
235
|
+
/** Hero image banner or image URL. */
|
|
236
|
+
image?: string | ToastAvatarOption;
|
|
237
|
+
/** Mascot robot/character avatar variant. */
|
|
238
|
+
character?: RobotCharacter | (string & {});
|
|
239
|
+
/** Mascot robot variant alias. */
|
|
240
|
+
robotVariant?: RobotCharacter | (string & {});
|
|
200
241
|
/** Duration in ms. `0` or `Infinity` makes it persistent. */
|
|
201
242
|
duration?: number;
|
|
243
|
+
/** react-native-toast-message duration alias. */
|
|
244
|
+
visibilityTime?: number;
|
|
245
|
+
/** react-native-toast-message autoHide control: false makes it persistent. */
|
|
246
|
+
autoHide?: boolean;
|
|
202
247
|
/** Screen region placement. */
|
|
203
248
|
position?: ToastPosition;
|
|
249
|
+
/** Optional top offset in pixels (react-native-toast-message compatible). */
|
|
250
|
+
topOffset?: number;
|
|
251
|
+
/** Optional bottom offset in pixels (react-native-toast-message compatible). */
|
|
252
|
+
bottomOffset?: number;
|
|
253
|
+
/** Optional keyboard offset in pixels (react-native-toast-message compatible). */
|
|
254
|
+
keyboardOffset?: number;
|
|
255
|
+
/** Play audio feedback cue, sound url, or custom generator. */
|
|
256
|
+
sound?: boolean | SoundCue | string | ((type: ToastType) => void);
|
|
257
|
+
/** Audio playback volume (0.0 to 1.0). Defaults to 0.5. */
|
|
258
|
+
soundVolume?: number;
|
|
204
259
|
/** Primary action button. */
|
|
205
260
|
action?: ToastAction;
|
|
206
261
|
/** Secondary cancel button. */
|
|
@@ -209,6 +264,16 @@ interface ToastOptions {
|
|
|
209
264
|
closeButton?: boolean;
|
|
210
265
|
/** Accessible label for the close button. */
|
|
211
266
|
closeButtonLabel?: string;
|
|
267
|
+
/** Custom close / discard button icon. */
|
|
268
|
+
closeIcon?: Renderable;
|
|
269
|
+
/** Custom text for close / discard button (e.g., 'Dismiss', 'Close'). */
|
|
270
|
+
closeText?: string;
|
|
271
|
+
/** Discard button text alias. */
|
|
272
|
+
discardText?: string;
|
|
273
|
+
/** Discard button icon alias. */
|
|
274
|
+
discardIcon?: Renderable;
|
|
275
|
+
/** Toast body press/click handler. */
|
|
276
|
+
onPress?: (toast?: ToastRecord) => void;
|
|
212
277
|
/** Enter/exit animation preset. */
|
|
213
278
|
animation?: AnimationType;
|
|
214
279
|
/** Allow user dismissal. */
|
|
@@ -253,8 +318,12 @@ interface ToastOptions {
|
|
|
253
318
|
important?: boolean;
|
|
254
319
|
/** Lifecycle hook: fired when toast mounts/opens. Exactly once. */
|
|
255
320
|
onOpen?: (toast: ToastRecord) => void;
|
|
321
|
+
/** react-native-toast-message open callback alias. */
|
|
322
|
+
onShow?: () => void;
|
|
256
323
|
/** Lifecycle hook: fired when toast closes/exits. Exactly once. */
|
|
257
324
|
onClose?: (toast: ToastRecord, reason: CloseReason) => void;
|
|
325
|
+
/** react-native-toast-message close callback alias. */
|
|
326
|
+
onHide?: () => void;
|
|
258
327
|
/** Lifecycle hook: fired on user dismissal. Exactly once. */
|
|
259
328
|
onDismiss?: (toast: ToastRecord, reason: CloseReason) => void;
|
|
260
329
|
/** Lifecycle hook: fired when auto-close timer elapses. Exactly once. */
|
|
@@ -324,6 +393,10 @@ interface GlazeConfig {
|
|
|
324
393
|
startPaused: boolean;
|
|
325
394
|
newestOnTop: boolean;
|
|
326
395
|
dedupeWindow: number;
|
|
396
|
+
/** Global audio cue sound toggle or default cue name. */
|
|
397
|
+
sound?: boolean | SoundCue;
|
|
398
|
+
/** Global sound volume between 0.0 and 1.0. Defaults to 0.5. */
|
|
399
|
+
soundVolume?: number;
|
|
327
400
|
animation?: AnimationType;
|
|
328
401
|
offset?: OffsetConfig;
|
|
329
402
|
mobileOffset?: number | string;
|
|
@@ -702,5 +775,5 @@ interface ToastApi extends ToastFn {
|
|
|
702
775
|
/** Builds the `ui.toast` API on top of a store/manager. */
|
|
703
776
|
declare function createToastApi(store: ToastStore): ToastApi;
|
|
704
777
|
|
|
705
|
-
export { DEFAULT_CONFIG as D, MANUAL_PAUSE as M, createConfigStore as
|
|
706
|
-
export type {
|
|
778
|
+
export { DEFAULT_CONFIG as D, MANUAL_PAUSE as M, createConfigStore as at, createToastApi as au, createToastManager as av, createToastStore as aw, createTypeRegistry as ax, defaultClock as ay, resolvePrecedence as az };
|
|
779
|
+
export type { ShowcaseToastVariant as $, AddToastInput as A, BottomSheetHandle as B, Clock as C, EssentialsToastVariant as E, GlazeConfigPatch as F, GlazeConfig as G, LoadingHandle as H, IosGlassToastVariant as I, LoadingOptions as J, Mode as K, Listener as L, Position as N, OffsetConfig as O, PauseOn as P, PromiseData as Q, PromiseHandle as R, PromiseMessage as S, ToastApi as T, PromiseMessages as U, PromiseOutcome as V, Renderable as W, RobotCharacter as X, SheetAction as Y, SheetActionStyle as Z, SheetOptions as _, ToastRecord as a, SoundCue as a0, StackMode as a1, Store as a2, SwipeDirection as a3, ThemeName as a4, ToastAction as a5, ToastActionItem as a6, ToastAvatarOption as a7, ToastButton as a8, ToastClassNames as a9, ToastCustomRenderer as aa, ToastFn as ab, ToastId as ac, ToastManager as ad, ToastManagerOptions as ae, ToastOptions as af, ToastPatch as ag, ToastPosition as ah, ToastRenderContext as ai, ToastToggleOption as aj, ToastType as ak, ToastTypeDefinition as al, ToastVariant as am, ToastoryConfig as an, ToastoryConfigPatch as ao, TypeRegistry as ap, TypedDialogOptions as aq, Unsubscribe as ar, ValidateResult as as, ToastStore as b, AnimationType as c, BottomSheetOptions as d, BuiltInSoundCue as e, BuiltInToastType as f, CloseReason as g, ColorMode as h, Config as i, ConfigStore as j, DialogBackdrop as k, DialogButton as l, DialogChoice as m, DialogColumn as n, DialogHandle as o, DialogIcon as p, DialogInputType as q, DialogOptions as r, DialogPosition as s, DialogResult as t, DialogRow as u, DialogState as v, DialogTone as w, DialogVariant as x, Direction as y, DismissReason as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as ToastApi,
|
|
2
|
-
import { a as DialogPromise, S as StepsResult } from './dialog-
|
|
1
|
+
import { T as ToastApi, r as DialogOptions, _ as SheetOptions, d as BottomSheetOptions, B as BottomSheetHandle, J as LoadingOptions, H as LoadingHandle, G as GlazeConfig, a0 as SoundCue, b as ToastStore } from './toast-api-C5nqvDgA.js';
|
|
2
|
+
import { a as DialogPromise, S as StepsResult } from './dialog-D-y37Xl5.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Theme definitions. The build script turns each definition into a CSS file; the tests check every
|
|
@@ -81,6 +81,8 @@ interface Ui {
|
|
|
81
81
|
loading(options?: LoadingOptions): LoadingHandle;
|
|
82
82
|
/** Sets global configuration. Returns the resulting configuration. */
|
|
83
83
|
configure(patch: Partial<GlazeConfig>): Readonly<GlazeConfig>;
|
|
84
|
+
/** Plays an audio feedback sound cue, synthesizer chime, or audio URL. */
|
|
85
|
+
sound(cue?: SoundCue | string | boolean, volume?: number): void;
|
|
84
86
|
/** Defines a custom theme with tokens and optional CSS rules. */
|
|
85
87
|
defineTheme(name: string, definition: CustomThemeDefinition): string;
|
|
86
88
|
/** The underlying toast store. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as ToastApi,
|
|
2
|
-
import { a as DialogPromise, S as StepsResult } from './dialog-
|
|
1
|
+
import { T as ToastApi, r as DialogOptions, _ as SheetOptions, d as BottomSheetOptions, B as BottomSheetHandle, J as LoadingOptions, H as LoadingHandle, G as GlazeConfig, a0 as SoundCue, b as ToastStore } from './toast-api-C5nqvDgA.cjs';
|
|
2
|
+
import { a as DialogPromise, S as StepsResult } from './dialog-mUI__8O3.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Theme definitions. The build script turns each definition into a CSS file; the tests check every
|
|
@@ -81,6 +81,8 @@ interface Ui {
|
|
|
81
81
|
loading(options?: LoadingOptions): LoadingHandle;
|
|
82
82
|
/** Sets global configuration. Returns the resulting configuration. */
|
|
83
83
|
configure(patch: Partial<GlazeConfig>): Readonly<GlazeConfig>;
|
|
84
|
+
/** Plays an audio feedback sound cue, synthesizer chime, or audio URL. */
|
|
85
|
+
sound(cue?: SoundCue | string | boolean, volume?: number): void;
|
|
84
86
|
/** Defines a custom theme with tokens and optional CSS rules. */
|
|
85
87
|
defineTheme(name: string, definition: CustomThemeDefinition): string;
|
|
86
88
|
/** The underlying toast store. */
|