@kanso-labs/kanso-ui 0.48.4 → 0.50.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.
@@ -0,0 +1,242 @@
1
+ "use client";
2
+ import { c } from "react/compiler-runtime";
3
+ import { props } from "../../node_modules/@stylexjs/stylex/lib/es/stylex.js";
4
+ import { useMessages } from "../../i18n/index.js";
5
+ import { hasContent } from "../../render/content.js";
6
+ import { useRender } from "../../render/useRender.js";
7
+ import { rowStyles } from "../../row/styles.js";
8
+ import { mergeStyles } from "../../styles/merge.js";
9
+ import { jsx, jsxs } from "react/jsx-runtime";
10
+ // src/components/skeleton/index.tsx
11
+ const styles = { bar: {
12
+ kWkggS: "x1rrhr5q x1o55y2u",
13
+ kaIpWk: "x1tfhd1",
14
+ kB7OPa: "x9f619",
15
+ kmuXW: "x2lah0s",
16
+ kAXs8y: "x1g12otp",
17
+ ks0D6T: "x193iq5w",
18
+ $$css: true
19
+ } };
20
+ const barSizes = {
21
+ lg: {
22
+ kZKoxP: "x1fgtraw",
23
+ $$css: true
24
+ },
25
+ md: {
26
+ kZKoxP: "x1v9usgg",
27
+ $$css: true
28
+ },
29
+ sm: {
30
+ kZKoxP: "x1kpxq89",
31
+ $$css: true
32
+ }
33
+ };
34
+ const _temp = {
35
+ kzqmXN: "x1uyokj7",
36
+ "$$css": true
37
+ };
38
+ const barWidth = { width: (inlineSize) => [_temp, { "--x-inlineSize": ((val) => typeof val === "number" ? val + "px" : val != null ? val : void 0)(inlineSize) }] };
39
+ /**
40
+ * The shape of what is being read, drawn at once in its place: rows of bars
41
+ * and circles, fading gently, that a screen reader hears as one "Loading".
42
+ *
43
+ * ```tsx
44
+ * <Skeleton>
45
+ * <Skeleton.Row leading={<Skeleton.Circle />} lines={2}>
46
+ * <Skeleton.Bar size="md" width="60%" />
47
+ * <Skeleton.Bar width="40%" />
48
+ * </Skeleton.Row>
49
+ * </Skeleton>
50
+ * ```
51
+ *
52
+ * Draw it where the content will be, in its place rather than over it, and
53
+ * swap it for the content once that is read. It says "Loading" where a
54
+ * reader reaches it and announces nothing as it comes and goes; mark the
55
+ * container it is swapped in `aria-busy` while it loads, or announce the
56
+ * change through a live region, where that matters. The call site's `className` and
57
+ * `style` land on its own element.
58
+ */
59
+ function Skeleton(t0) {
60
+ const $ = c(10);
61
+ const { "aria-label": ariaLabel, children, render, ...props } = t0;
62
+ const messages = useMessages();
63
+ const t1 = "div";
64
+ const t2 = true;
65
+ const t3 = ariaLabel === void 0 || ariaLabel === "" ? messages.loading : ariaLabel;
66
+ const t4 = "progressbar";
67
+ const t5 = mergeStyles({ className: "x9f619" }, props);
68
+ let t6;
69
+ if ($[0] !== children) {
70
+ t6 = /* @__PURE__ */ jsx("div", {
71
+ "aria-hidden": "true",
72
+ className: "xpz12be xmg6eyc xa4qsjk x19utubg x1d1m1p8 x1aquc0h x4hg4is x9f619",
73
+ children
74
+ });
75
+ $[0] = children;
76
+ $[1] = t6;
77
+ } else t6 = $[1];
78
+ let t7;
79
+ if ($[2] !== props || $[3] !== t3 || $[4] !== t5 || $[5] !== t6) {
80
+ t7 = {
81
+ "aria-busy": t2,
82
+ "aria-label": t3,
83
+ role: t4,
84
+ ...props,
85
+ ...t5,
86
+ children: t6
87
+ };
88
+ $[2] = props;
89
+ $[3] = t3;
90
+ $[4] = t5;
91
+ $[5] = t6;
92
+ $[6] = t7;
93
+ } else t7 = $[6];
94
+ let t8;
95
+ if ($[7] !== render || $[8] !== t7) {
96
+ t8 = {
97
+ defaultTagName: t1,
98
+ props: t7,
99
+ render
100
+ };
101
+ $[7] = render;
102
+ $[8] = t7;
103
+ $[9] = t8;
104
+ } else t8 = $[9];
105
+ return useRender(t8);
106
+ }
107
+ /** A bar standing in for a line of text, at the width the call site gives. */
108
+ function SkeletonBar(t0) {
109
+ const $ = c(6);
110
+ let t1;
111
+ let t2;
112
+ if ($[0] !== t0) {
113
+ const { size: t3, width, ...props$1 } = t0;
114
+ const size = t3 === void 0 ? "sm" : t3;
115
+ t1 = props$1;
116
+ t2 = mergeStyles(props(styles.bar, barSizes[size], barWidth.width(typeof width === "number" ? `${width}px` : width)), props$1);
117
+ $[0] = t0;
118
+ $[1] = t1;
119
+ $[2] = t2;
120
+ } else {
121
+ t1 = $[1];
122
+ t2 = $[2];
123
+ }
124
+ let t3;
125
+ if ($[3] !== t1 || $[4] !== t2) {
126
+ t3 = /* @__PURE__ */ jsx("div", {
127
+ ...t1,
128
+ ...t2
129
+ });
130
+ $[3] = t1;
131
+ $[4] = t2;
132
+ $[5] = t3;
133
+ } else t3 = $[5];
134
+ return t3;
135
+ }
136
+ /** A 40px circle standing in for a row's mark, such as an avatar. */
137
+ function SkeletonCircle(props) {
138
+ const $ = c(5);
139
+ let t0;
140
+ if ($[0] !== props) {
141
+ t0 = mergeStyles({ className: "x1rrhr5q x1o55y2u x1rv7mn0 x1dkaolv x9f619 x2lah0s x1g12otp x1eujcsb" }, props);
142
+ $[0] = props;
143
+ $[1] = t0;
144
+ } else t0 = $[1];
145
+ let t1;
146
+ if ($[2] !== props || $[3] !== t0) {
147
+ t1 = /* @__PURE__ */ jsx("div", {
148
+ ...props,
149
+ ...t0
150
+ });
151
+ $[2] = props;
152
+ $[3] = t0;
153
+ $[4] = t1;
154
+ } else t1 = $[4];
155
+ return t1;
156
+ }
157
+ /**
158
+ * A row standing in for a list item: 56px for one line, 72px for two, with
159
+ * the lists page's padding, a leading and a trailing slot, and its bars one
160
+ * above the other between them.
161
+ */
162
+ function SkeletonRow(t0) {
163
+ const $ = c(18);
164
+ let children;
165
+ let leading;
166
+ let t1;
167
+ let t2;
168
+ let trailing;
169
+ if ($[0] !== t0) {
170
+ const { children: t3, leading: t4, lines: t5, trailing: t6, ...props$2 } = t0;
171
+ children = t3;
172
+ leading = t4;
173
+ trailing = t6;
174
+ const lines = t5 === void 0 ? 1 : t5;
175
+ t1 = props$2;
176
+ t2 = mergeStyles(props(rowStyles.base, rowStyles.list, lines === 2 && rowStyles.twoLine), props$2);
177
+ $[0] = t0;
178
+ $[1] = children;
179
+ $[2] = leading;
180
+ $[3] = t1;
181
+ $[4] = t2;
182
+ $[5] = trailing;
183
+ } else {
184
+ children = $[1];
185
+ leading = $[2];
186
+ t1 = $[3];
187
+ t2 = $[4];
188
+ trailing = $[5];
189
+ }
190
+ let t3;
191
+ if ($[6] !== leading) {
192
+ t3 = !hasContent(leading) ? null : /* @__PURE__ */ jsx("div", {
193
+ ...props(rowStyles.slot),
194
+ children: leading
195
+ });
196
+ $[6] = leading;
197
+ $[7] = t3;
198
+ } else t3 = $[7];
199
+ let t4;
200
+ if ($[8] !== children) {
201
+ t4 = /* @__PURE__ */ jsx("div", {
202
+ className: "x9f619 x78zum5 xdt5ytf x1iyjqo2 x126z3so xeuugli",
203
+ children
204
+ });
205
+ $[8] = children;
206
+ $[9] = t4;
207
+ } else t4 = $[9];
208
+ let t5;
209
+ if ($[10] !== trailing) {
210
+ t5 = !hasContent(trailing) ? null : /* @__PURE__ */ jsx("div", {
211
+ ...props(rowStyles.slot),
212
+ children: trailing
213
+ });
214
+ $[10] = trailing;
215
+ $[11] = t5;
216
+ } else t5 = $[11];
217
+ let t6;
218
+ if ($[12] !== t1 || $[13] !== t2 || $[14] !== t3 || $[15] !== t4 || $[16] !== t5) {
219
+ t6 = /* @__PURE__ */ jsxs("div", {
220
+ ...t1,
221
+ ...t2,
222
+ children: [
223
+ t3,
224
+ t4,
225
+ t5
226
+ ]
227
+ });
228
+ $[12] = t1;
229
+ $[13] = t2;
230
+ $[14] = t3;
231
+ $[15] = t4;
232
+ $[16] = t5;
233
+ $[17] = t6;
234
+ } else t6 = $[17];
235
+ return t6;
236
+ }
237
+ Skeleton.Bar = SkeletonBar;
238
+ Skeleton.Circle = SkeletonCircle;
239
+ Skeleton.Row = SkeletonRow;
240
+ export { SkeletonBar, SkeletonCircle, SkeletonRow, Skeleton as default };
241
+
242
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["_c","stylex","useMessages","hasContent","useRender","rowStyles","mergeStyles","styles","bar","kWkggS","kaIpWk","kB7OPa","kmuXW","kAXs8y","ks0D6T","$$css","barSizes","lg","kZKoxP","md","sm","_temp","kzqmXN","barWidth","width","inlineSize","val","undefined","size","children","leading","lines","trailing","Skeleton","t0","$","ariaLabel","render","props","messages","t1","t2","t3","loading","t4","t5","className","t6","t7","role","t8","defaultTagName","SkeletonBar","SkeletonCircle","SkeletonRow","base","list","twoLine","slot","Bar","Circle","Row"],"sources":["../../../src/components/skeleton/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport type { RenderComponentProps } from '../../render/useRender';\nimport { useMessages } from '../../i18n';\nimport { hasContent } from '../../render/content';\nimport { useRender } from '../../render/useRender';\nimport { rowStyles } from '../../row/styles';\nimport { mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, radii, sizing, spacing } from '../../tokens/design.tokens.stylex';\n\n// The shape of a page drawn at once, while what fills it is read: rows at the\n// lists page's 56dp and 72dp heights, holding bars in place of their lines\n// and 40dp circles in place of their marks. No Material Design page draws a\n// skeleton, so this is the library's own, drawn on the lists page's row as\n// ListItem draws it, from src/row: its 16dp inline padding and 16dp between a\n// slot and the lines.\n//\n// Every shape is surface container highest, the bars at the 4dp corner and\n// the circles round. A bar is 12dp tall for an eyebrow or a supporting line,\n// 14dp for a title or a figure and 28dp for a headline, each a little under\n// the line it stands in for, so a row of bars reads as a row of text rather\n// than as blocks. Those three heights fall between steps of the spacing scale\n// and are written out. Its width is the call site's, since only it knows how\n// long the words it stands in for tend to be.\n//\n// **No shimmer.** What is inside a skeleton fades from full opacity to 60%\n// over 1.5 seconds and back, eased at both ends, so a screen of rows breathes\n// as one rather than flickering row by row — the reading react-native-kanso-ui\n// takes too. Under reduced motion it holds at full opacity.\n//\n// **A screen reader hears one \"Loading\".** The skeleton is one element, a\n// busy progress bar named by `aria-label`, or by the library's own word for\n// loading in the `I18nProvider`'s locale, as a pending Button is. What it\n// holds is hidden from screen readers, so nothing inside is read past it.\n//\n// Under forced colours a fill is painted over in the page's own colour, which\n// would leave every shape invisible, so the shapes are drawn in `GrayText`,\n// the mode's colour for what cannot be used yet, and held at full opacity,\n// since `GrayText` at 60% on the page's colour is barely there.\n\nconst FORCED_COLORS = '@media (forced-colors: active)';\nconst REDUCED_MOTION = '@media (prefers-reduced-motion: reduce)';\nconst fade = \"xw0kf14-B\";\nconst styles = {\n bar: {\n kWkggS: \"x1rrhr5q x1o55y2u\",\n kaIpWk: \"x1tfhd1\",\n kB7OPa: \"x9f619\",\n kmuXW: \"x2lah0s\",\n kAXs8y: \"x1g12otp\",\n ks0D6T: \"x193iq5w\",\n $$css: true\n }\n};\n\n// The bars' heights, by what each stands in for, and their widths, which\n// are the call site's — see the header.\nconst barSizes = {\n lg: {\n kZKoxP: \"x1fgtraw\",\n $$css: true\n },\n md: {\n kZKoxP: \"x1v9usgg\",\n $$css: true\n },\n sm: {\n kZKoxP: \"x1kpxq89\",\n $$css: true\n }\n};\nconst _temp = {\n kzqmXN: \"x1uyokj7\",\n \"$$css\": true\n};\nconst barWidth = {\n width: (inlineSize: string) => [_temp, {\n \"--x-inlineSize\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(inlineSize)\n }]\n};\ntype SkeletonBarProps = Omit<RenderComponentProps<'div'>, 'children' | 'render'> & {\n /**\n * What the bar stands in for: `sm`, 12px, an eyebrow or a supporting line;\n * `md`, 14px, a title or a figure; `lg`, 28px, a headline.\n * @default 'sm'\n */\n size?: SkeletonBarSize;\n /**\n * How wide the bar is: a number of pixels, or a CSS length or percentage\n * of its row.\n */\n width: number | string;\n};\ntype SkeletonBarSize = 'lg' | 'md' | 'sm';\ntype SkeletonCircleProps = Omit<RenderComponentProps<'div'>, 'children' | 'render'>;\ntype SkeletonProps = RenderComponentProps<'div'> & {\n /**\n * What a screen reader hears. Left out, it is the library's word for\n * loading in the `I18nProvider`'s locale — \"Loading\" in English.\n */\n 'aria-label'?: string;\n /** The shapes: `Skeleton.Row`s, or bars and circles of the call site's. */\n children?: ReactNode;\n};\ntype SkeletonRowProps = Omit<RenderComponentProps<'div'>, 'render'> & {\n /** The bars standing in for the row's lines, one above the other. */\n children?: ReactNode;\n /** What stands before the lines, usually a `Skeleton.Circle`. */\n leading?: ReactNode;\n /**\n * How many lines the row stands in for: `1` is the lists page's 56px\n * one-line item, `2` its 72px two-line item.\n * @default 1\n */\n lines?: 1 | 2;\n /** What stands after the lines, such as a bar in place of a figure. */\n trailing?: ReactNode;\n};\n\n/**\n * The shape of what is being read, drawn at once in its place: rows of bars\n * and circles, fading gently, that a screen reader hears as one \"Loading\".\n *\n * ```tsx\n * <Skeleton>\n * <Skeleton.Row leading={<Skeleton.Circle />} lines={2}>\n * <Skeleton.Bar size=\"md\" width=\"60%\" />\n * <Skeleton.Bar width=\"40%\" />\n * </Skeleton.Row>\n * </Skeleton>\n * ```\n *\n * Draw it where the content will be, in its place rather than over it, and\n * swap it for the content once that is read. It says \"Loading\" where a\n * reader reaches it and announces nothing as it comes and goes; mark the\n * container it is swapped in `aria-busy` while it loads, or announce the\n * change through a live region, where that matters. The call site's `className` and\n * `style` land on its own element.\n */\nfunction Skeleton({\n 'aria-label': ariaLabel,\n children,\n render,\n ...props\n}: SkeletonProps) {\n const messages = useMessages();\n return useRender({\n defaultTagName: 'div',\n props: {\n 'aria-busy': true,\n // An empty name is no name, so it falls back as a missing one does.\n 'aria-label': ariaLabel === undefined || ariaLabel === '' ? messages.loading : ariaLabel,\n role: 'progressbar',\n ...props,\n ...mergeStyles({\n className: \"x9f619\"\n }, props),\n children: <div aria-hidden=\"true\" className=\"xpz12be xmg6eyc xa4qsjk x19utubg x1d1m1p8 x1aquc0h x4hg4is x9f619\">\n {children}\n </div>\n },\n render\n });\n}\n\n/** A bar standing in for a line of text, at the width the call site gives. */\nfunction SkeletonBar({\n size = 'sm',\n width,\n ...props\n}: RefAttributes<HTMLDivElement> & SkeletonBarProps) {\n return <div {...props} {...mergeStyles(stylex.props(styles.bar, barSizes[size], barWidth.width(typeof width === 'number' ? `${width}px` : width)), props)} />;\n}\n\n/** A 40px circle standing in for a row's mark, such as an avatar. */\nfunction SkeletonCircle(props: RefAttributes<HTMLDivElement> & SkeletonCircleProps) {\n return <div {...props} {...mergeStyles({\n className: \"x1rrhr5q x1o55y2u x1rv7mn0 x1dkaolv x9f619 x2lah0s x1g12otp x1eujcsb\"\n }, props)} />;\n}\n\n/**\n * A row standing in for a list item: 56px for one line, 72px for two, with\n * the lists page's padding, a leading and a trailing slot, and its bars one\n * above the other between them.\n */\nfunction SkeletonRow({\n children,\n leading,\n lines = 1,\n trailing,\n ...props\n}: RefAttributes<HTMLDivElement> & SkeletonRowProps) {\n return <div {...props} {...mergeStyles(stylex.props(rowStyles.base, rowStyles.list, lines === 2 && rowStyles.twoLine), props)}>\n {!hasContent(leading) ? null : <div {...stylex.props(rowStyles.slot)}>{leading}</div>}\n <div className=\"x9f619 x78zum5 xdt5ytf x1iyjqo2 x126z3so xeuugli\">{children}</div>\n {!hasContent(trailing) ? null : <div {...stylex.props(rowStyles.slot)}>{trailing}</div>}\n </div>;\n}\nSkeleton.Bar = SkeletonBar;\nSkeleton.Circle = SkeletonCircle;\nSkeleton.Row = SkeletonRow;\nexport type { SkeletonBarProps, SkeletonBarSize, SkeletonCircleProps, SkeletonProps, SkeletonRowProps };\nexport { SkeletonBar, SkeletonCircle, SkeletonRow };\nexport default Skeleton;"],"mappings":";;;;;;;;;;AA8CA,MAAMO,SAAS,EACbC,KAAK;CACHC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,OAAO;CACPC,QAAQ;CACRC,QAAQ;CACRC,OAAO;AACT,EACF;AAIA,MAAMC,WAAW;CACfC,IAAI;EACFC,QAAQ;EACRH,OAAO;CACT;CACAI,IAAI;EACFD,QAAQ;EACRH,OAAO;CACT;CACAK,IAAI;EACFF,QAAQ;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AAN;EAAAM,EAAA,KAAAS;CAAA,OAAAA,KAAAT,EAAA;CAAA,IAAAU;CAAA,IAAAV,EAAA,QAAAH,UAAA;EACjFa,KAAA,CAAC1C,WAAW6B,QAAQ,IAApB,OAA+B,oBAAA,OAAA;GAAuD,GAA9C/B,MAAaI,UAASqD,IAAK;GAAI1B,UAAAA;EAAe,CAAA;EAAAG,EAAA,MAAAH;EAAAG,EAAA,MAAAU;CAAA,OAAAA,KAAAV,EAAA;CAAA,IAAAY;CAAA,IAAAZ,EAAA,QAAAK,MAAAL,EAAA,QAAAM,MAAAN,EAAA,QAAAO,MAAAP,EAAA,QAAAS,MAAAT,EAAA,QAAAU,IAAA;EAHpFE,KAAA,qBAAA,OAAA;GAIC,GAJQT;GAAK,GAAMG;GAApB,UAAA;IACFC;IACDE;IACCC;GACG;;EAAAV,EAAA,MAAAK;EAAAL,EAAA,MAAAM;EAAAN,EAAA,MAAAO;EAAAP,EAAA,MAAAS;EAAAT,EAAA,MAAAU;EAAAV,EAAA,MAAAY;CAAA,OAAAA,KAAAZ,EAAA;CAAA,OAJDY;AAIC;AAEVd,SAAS0B,MAAMP;AACfnB,SAAS2B,SAASP;AAClBpB,SAAS4B,MAAMP"}
@@ -11,6 +11,7 @@ type SnackbarMessage = {
11
11
  action: SnackbarAction | undefined;
12
12
  message: ReactNode;
13
13
  showCloseButton: boolean;
14
+ tone?: SnackbarTone | undefined;
14
15
  };
15
16
  type SnackbarOptions = {
16
17
  /**
@@ -50,6 +51,13 @@ type SnackbarOptions = {
50
51
  * way to be rid of it.
51
52
  */
52
53
  timeout?: number;
54
+ /**
55
+ * `failure` leads the message with a warning glyph in the inverse error,
56
+ * so a failure does not look like a confirmation. Left out, the message is
57
+ * drawn as a confirmation. The glyph is not announced, so the message's
58
+ * words should say that something failed.
59
+ */
60
+ tone?: SnackbarTone;
53
61
  };
54
62
  type SnackbarProps = {
55
63
  /**
@@ -74,6 +82,8 @@ type SnackbarProps = {
74
82
  /** A function may compute the style from the region's render state. */
75
83
  style?: ToastRegionProps<SnackbarMessage>['style'];
76
84
  } & Omit<ToastRegionProps<SnackbarMessage>, 'aria-label' | 'children' | 'className' | 'queue' | 'style'>;
85
+ /** What a message reports: `failure`, where something did not happen. */
86
+ type SnackbarTone = 'failure';
77
87
  /**
78
88
  * The queue a snackbar is shown from. Make one where the app can reach it —
79
89
  * a module of its own is the usual place — mount `Snackbar` once with it,
@@ -139,4 +149,4 @@ declare function Snackbar({ closeLabel, queue, ...props }: RefAttributes<HTMLDiv
139
149
  declare namespace Snackbar {
140
150
  var Queue: typeof SnackbarQueue;
141
151
  }
142
- export { type SnackbarAction, type SnackbarMessage, type SnackbarOptions, type SnackbarProps, type SnackbarQueue, type ToastRegionRenderProps as SnackbarRegionRenderProps, Snackbar as default };
152
+ export { type SnackbarAction, type SnackbarMessage, type SnackbarOptions, type SnackbarProps, type SnackbarQueue, type ToastRegionRenderProps as SnackbarRegionRenderProps, type SnackbarTone, Snackbar as default };
@@ -3,7 +3,7 @@ import { c } from "react/compiler-runtime";
3
3
  import { props } from "../../node_modules/@stylexjs/stylex/lib/es/stylex.js";
4
4
  import { useSyncExternalStore } from "react";
5
5
  import { Button, Text, UNSTABLE_Toast, UNSTABLE_ToastContent, UNSTABLE_ToastQueue, UNSTABLE_ToastRegion } from "react-aria-components";
6
- import { CloseGlyph } from "../../glyphs/index.js";
6
+ import { CloseGlyph, ErrorGlyph } from "../../glyphs/index.js";
7
7
  import { useBottomEdgeClearance } from "../../hooks/useBottomEdge.js";
8
8
  import { useRipple } from "../../hooks/useRipple.js";
9
9
  import { mergeStatefulStyles } from "../../styles/merge.js";
@@ -163,12 +163,13 @@ var SnackbarQueue = class {
163
163
  * it does not come back.
164
164
  */
165
165
  add(message, options = {}) {
166
- const { action, onClose, showCloseButton = false, timeout } = options;
166
+ const { action, onClose, showCloseButton = false, timeout, tone } = options;
167
167
  this.clear();
168
168
  const key = this.#toasts.add({
169
169
  action,
170
170
  message,
171
- showCloseButton
171
+ showCloseButton,
172
+ tone
172
173
  }, { timeout: readableTimeout(timeout ?? (action === void 0 ? MESSAGE_MS : UNTIL_CLOSED)) });
173
174
  this.#open.set(key, onClose);
174
175
  return key;
@@ -364,9 +365,9 @@ function SnackbarControls(t0) {
364
365
  }
365
366
  /** One snackbar: its message, then whatever sits after it. */
366
367
  function SnackbarToast(t0) {
367
- const $ = c(14);
368
+ const $ = c(17);
368
369
  const { close, closeLabel, queue, toast } = t0;
369
- const { action, message, showCloseButton } = toast.content;
370
+ const { action, message, showCloseButton, tone } = toast.content;
370
371
  const fading = useFading(queue, toast.key);
371
372
  let t1;
372
373
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
@@ -378,47 +379,58 @@ function SnackbarToast(t0) {
378
379
  } else t1 = $[0];
379
380
  const t2 = t1[!!fading << 0];
380
381
  let t3;
381
- if ($[1] !== message) {
382
- t3 = /* @__PURE__ */ jsx(UNSTABLE_ToastContent, {
382
+ if ($[1] !== tone) {
383
+ t3 = tone === "failure" ? /* @__PURE__ */ jsx(ErrorGlyph, { className: "xqcrz7y x1qx5ct2 x9f619 x7yhsra x2lah0s xw4jnvo x1hmvnq2 xq0p5jb" }) : null;
384
+ $[1] = tone;
385
+ $[2] = t3;
386
+ } else t3 = $[2];
387
+ let t4;
388
+ if ($[3] !== message) {
389
+ t4 = /* @__PURE__ */ jsx(UNSTABLE_ToastContent, {
383
390
  className: "x9f619 x1girmi0 x4pfjvb x1iyjqo2 xpo2rfv x193rfdd x1hews6w xkjl1po xn43zvd xv61bfh xz158ff xeuugli xj0a0fe xxlmvz2",
384
391
  children: /* @__PURE__ */ jsx(Text, {
385
392
  slot: "title",
386
393
  children: message
387
394
  })
388
395
  });
389
- $[1] = message;
390
- $[2] = t3;
391
- } else t3 = $[2];
392
- let t4;
393
- if ($[3] !== action || $[4] !== close || $[5] !== closeLabel || $[6] !== fading || $[7] !== showCloseButton) {
394
- t4 = /* @__PURE__ */ jsx(SnackbarControls, {
396
+ $[3] = message;
397
+ $[4] = t4;
398
+ } else t4 = $[4];
399
+ let t5;
400
+ if ($[5] !== action || $[6] !== close || $[7] !== closeLabel || $[8] !== fading || $[9] !== showCloseButton) {
401
+ t5 = /* @__PURE__ */ jsx(SnackbarControls, {
395
402
  action,
396
403
  close,
397
404
  closeLabel,
398
405
  fading,
399
406
  showCloseButton
400
407
  });
401
- $[3] = action;
402
- $[4] = close;
403
- $[5] = closeLabel;
404
- $[6] = fading;
405
- $[7] = showCloseButton;
406
- $[8] = t4;
407
- } else t4 = $[8];
408
- let t5;
409
- if ($[9] !== t2 || $[10] !== t3 || $[11] !== t4 || $[12] !== toast) {
410
- t5 = /* @__PURE__ */ jsxs(UNSTABLE_Toast, {
408
+ $[5] = action;
409
+ $[6] = close;
410
+ $[7] = closeLabel;
411
+ $[8] = fading;
412
+ $[9] = showCloseButton;
413
+ $[10] = t5;
414
+ } else t5 = $[10];
415
+ let t6;
416
+ if ($[11] !== t2 || $[12] !== t3 || $[13] !== t4 || $[14] !== t5 || $[15] !== toast) {
417
+ t6 = /* @__PURE__ */ jsxs(UNSTABLE_Toast, {
411
418
  toast,
412
419
  ...t2,
413
- children: [t3, t4]
420
+ children: [
421
+ t3,
422
+ t4,
423
+ t5
424
+ ]
414
425
  });
415
- $[9] = t2;
416
- $[10] = t3;
417
- $[11] = t4;
418
- $[12] = toast;
419
- $[13] = t5;
420
- } else t5 = $[13];
421
- return t5;
426
+ $[11] = t2;
427
+ $[12] = t3;
428
+ $[13] = t4;
429
+ $[14] = t5;
430
+ $[15] = toast;
431
+ $[16] = t6;
432
+ } else t6 = $[16];
433
+ return t6;
422
434
  }
423
435
  /**
424
436
  * Whether a snackbar is fading out of its queue. `rac` is always the queue
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_c","stylex","useSyncExternalStore","RACToastQueue","RACToastRegion","useBottomEdgeClearance","useRipple","mergeStatefulStyles","MESSAGE_MS","MINIMUM_MS","UNTIL_CLOSED","EXIT_MS","_temp","krVfgx","kGO01o","styles","action","kgeoSG","kGOzcv","kpsdNU","kEoFBp","kMwMTN","kMv6JI","kGuDYH","k63SB2","kb6lSQ","kLWn49","kAzted","k8WAf4","kg3NbH","$$css","close","kZKoxP","kzqmXN","kmVPX3","control","kGNEyG","kWkggS","kaIpWk","kMzoRj","kB7OPa","kkrTdU","k1xSpc","kmuXW","kjj79g","kjBf7l","kInvED","k3XXqK","kMeerF","kVAEAm","controlFocused","controlHovered","controlPressed","region","kXwgrk","kOIVth","kkqhue","kLKAdn","kE3dHu","kpe85a","kfzvcC","kY2c9j","risen","clearance","val","undefined","label","onPress","message","showCloseButton","onClose","timeout","className","closeLabel","queue","SnackbarQueue","style","FadingToastQueue","fading","Set","onClosing","key","constructor","maxVisibleToasts","add","setTimeout","delete","listener","isFading","has","subscribeToFading","rac","Map","toasts","options","clear","readableTimeout","set","keys","get","actionPress","closeToast","controlClassName","state","isFocusVisible","isHovered","isPressed","props","Math","max","Snackbar","t0","$","T0","t1","t2","t3","snackbarContent","t4","SnackbarButton","children","ripple","handlers","surface","toast","SnackbarControls","SnackbarToast","content","useFading","Symbol","for","0","1","t5","_temp2","Queue","RACButton","RACToastContent","RACToast"],"sources":["../../../src/components/snackbar/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { FocusableElement, ToastRegionProps as RACToastRegionProps, ToastRegionRenderProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { useSyncExternalStore } from 'react';\nimport { Button as RACButton, UNSTABLE_Toast as RACToast, UNSTABLE_ToastContent as RACToastContent, UNSTABLE_ToastQueue as RACToastQueue, UNSTABLE_ToastRegion as RACToastRegion, Text } from 'react-aria-components';\nimport { CloseGlyph } from '../../glyphs';\nimport { useBottomEdgeClearance } from '../../hooks/useBottomEdge';\nimport { useRipple } from '../../hooks/useRipple';\nimport '../../styles/layers.stylex';\nimport { layers } from '../../styles/layers.stylex';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, motion, radii, shadows, sizing, spacing, stateLayerOpacity, typography } from '../../tokens/design.tokens.stylex';\n\n// The snackbar page's brief message at the bottom of the screen, with an\n// optional action beside it and an optional close button after that. The\n// page's container is the inverse surface at a 4dp corner and elevation 3,\n// its supporting text is body-medium in inverse on surface, its action label\n// is inverse primary, and its close icon takes the supporting text's colour.\n// The measurements are the page's too: 8dp of margin from the edges of the\n// screen, 8dp of padding inside the container with another 8dp either side\n// of the message, 14dp above and below on a single line, and between 320 and\n// 576dp wide above the page's 600dp breakpoint — full width below it.\n//\n// One at a time. The page shows a single snackbar and replaces it rather\n// than stacking, so a message added while another is up closes that one —\n// its `onClose` runs — and takes its place. Nothing waits behind it: React\n// Aria's queue, left to itself, kept every message and showed the one it had\n// replaced again once the newer closed, so an Undo could come back long after\n// the thing it undid.\n//\n// React Aria's toast is the behaviour: the region is a landmark that holds\n// the message, moves focus into it for a keyboard, and pauses every timer\n// while it is hovered or focused, so a message never expires while it is\n// being read or acted on.\n//\n// Three things are decided here rather than taken from React Aria or from\n// the page.\n//\n// **The queue is ours, not React Aria's.** React Aria's toast is still\n// `UNSTABLE_`, and `SnackbarQueue` is what keeps that name out of a\n// consumer's code — an upstream rename is this file rather than every call\n// site. It wraps their queue, defaults it to one visible message, and takes\n// the message and its options as one call.\n//\n// **The action and the close button are drawn here rather than through\n// Button and IconButton.** The page colours them inverse primary and inverse\n// on surface, which no variant of either carries, and a colour pushed in\n// from outside through `className` is the merge hazard AGENTS.md describes:\n// StyleX decides between two atomic classes by their order in the compiled\n// stylesheet, not by the order they are applied. Both are React Aria's\n// `Button` with the same ripple and the same state layers, over\n// `currentColor` so each takes the colour the snackbar gives it.\n//\n// **There is no `container` prop.** Every other overlay here takes one,\n// because React Aria's `Modal` and `Popover` accept a portal container, and\n// `src/components/portal-container.test.tsx` is what keeps that true.\n// Its toast region does not: it reads a portal provider that\n// `react-aria-components` does not export, so the region always lands at the\n// end of `<body>`. An app that scopes its StyleX theme to a subtree has to\n// put the theme on `:root` for the snackbar to be drawn in it.\n\n// How long a message is shown when the call site names no `timeout`. The\n// specs page gives no duration, so these come from the snackbar's guidelines\n// and accessibility pages.\n//\n// A message alone leaves after five seconds. The pages allow four to ten, and\n// React Aria's toast docs set five as the least a reader should be given.\n//\n// A call site's own `timeout` is held to the pages' four. A shorter one is\n// lengthened to that, since a message gone in a second cannot be read, and the\n// web gives a reader no setting to slow it down with — the same reason the\n// paragraph below gives. `0` is left alone: it is no timer at all.\n//\n// A message with an action stays until the action is taken or something\n// closes it, as the pages ask of every actionable snackbar. No timer can know\n// how long a reader needs to act: a screen reader user hears the message\n// first and has to reach the region before the action is any use, and the\n// pause while the region is hovered or focused only starts once they have.\n// Android's snackbar can keep shorter defaults because the platform lengthens\n// them from each user's accessibility settings, and the web has no such\n// setting to read.\nconst MESSAGE_MS = 5000;\nconst MINIMUM_MS = 4000;\nconst UNTIL_CLOSED = 0;\n\n// How long a closing snackbar takes to fade, and so how long it stays in the\n// document once something has closed it: `durationShort2`, the token the fade\n// below runs for. A theme that lengthens that token has its fade cut short\n// here, since the queue cannot read a duration out of the stylesheet.\nconst EXIT_MS = 150;\n\n// Below the page's 600dp breakpoint the snackbar runs the width of the\n// screen; above it, it takes between 320 and 576.\nconst WIDE = '@media (min-width: 600px)';\n\n// The page's own is a fade, in and out. It rises a little as it arrives too,\n// which is what the page draws and what says the message came from the edge\n// of the screen rather than appearing over it. It leaves by the fade alone,\n// and quicker than it came, on the curve for something going away: once it is\n// closed there is nothing left on it to read.\nconst rise = \"x15b941j-B\";\nconst fadeOut = \"x1jn504y-B\";\n\n// Windows High Contrast and the rest of the forced-colours modes. Spelled\n// here rather than imported, for the reason src/field/styles.ts records: the\n// StyleX compiler resolves a constant across files only out of a `.stylex.ts`\n// module, and the generated one holds design tokens rather than queries.\nconst FORCED_COLORS = '@media (forced-colors: active)';\n\n// The least press area the action keeps, as Button's medium size does. A\n// literal rather than a token, for the reason Button's `TARGET_SIZE` gives: a\n// consumer resizing their controls should not shrink a floor the page states.\nconst TARGET_SIZE = '48px';\nconst _temp = {\n krVfgx: \"xiicpxy\",\n kGO01o: \"xqf7pud\",\n \"$$css\": true\n};\nconst styles = {\n action: {\n kgeoSG: \"x1cpjm7i\",\n kGOzcv: \"xun2zgk\",\n kpsdNU: \"xm4btww\",\n kEoFBp: \"x1hmns74\",\n kMwMTN: \"x16bex6i\",\n kMv6JI: \"xkknnkr\",\n kGuDYH: \"x14zspaw\",\n k63SB2: \"x1v9cpvo\",\n kb6lSQ: \"x155f00i\",\n kLWn49: \"x1lz68p4\",\n kAzted: \"x1cio8j0\",\n k8WAf4: \"x1cmllll\",\n kg3NbH: \"x18fpw6u\",\n $$css: true\n },\n close: {\n kZKoxP: \"xbg5kjn\",\n kMwMTN: \"x1girmi0\",\n kzqmXN: \"xoqf9c6\",\n kmVPX3: \"x1717udv\",\n $$css: true\n },\n control: {\n kGNEyG: \"x6s0dn4\",\n kWkggS: \"xjbqb8w\",\n kaIpWk: \"x1dkaolv\",\n kMzoRj: \"xc342km\",\n kB7OPa: \"x9f619\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x3nfvp2\",\n kmuXW: \"x2lah0s\",\n kjj79g: \"xl56j7k\",\n kjBf7l: \"x14ytart\",\n kInvED: \"xr2mjdv\",\n k3XXqK: \"x9v5kkp x1t137rt\",\n kMeerF: \"x1s780dp\",\n kVAEAm: \"x1n2onr6\",\n $$css: true\n },\n controlFocused: {\n kWkggS: \"x1mbb5iu\",\n $$css: true\n },\n controlHovered: {\n kWkggS: \"x930l3l\",\n $$css: true\n },\n controlPressed: {\n kWkggS: \"xsykwg8\",\n $$css: true\n },\n region: {\n kGNEyG: \"x6s0dn4\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"x78zum5\",\n kXwgrk: \"xdt5ytf\",\n kOIVth: \"x126z3so\",\n krVfgx: \"x1ey2m1c\",\n kkqhue: \"x17y0mx6\",\n k3XXqK: \"x1t137rt\",\n kGO01o: \"x1u7mh7p\",\n kLKAdn: \"xi7mcox\",\n kE3dHu: \"xbpsoft\",\n kpe85a: \"xq5vm52\",\n kfzvcC: \"x47corl\",\n kVAEAm: \"xixxii4\",\n kY2c9j: \"x1bk8fjm\",\n $$css: true\n },\n risen: (clearance: string) => [_temp, {\n \"--x-insetBlockEnd\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(clearance)\n }]\n};\ntype SnackbarAction = {\n /** What the action says. The page gives it a single word where it can. */\n label: string;\n /** Run when the action is pressed, just before the snackbar closes. */\n onPress: () => void;\n};\n\n/** What a snackbar carries: its message, and what may sit beside it. */\ntype SnackbarMessage = {\n action: SnackbarAction | undefined;\n message: ReactNode;\n showCloseButton: boolean;\n};\ntype SnackbarOptions = {\n /**\n * A single action shown after the message. Pressing it runs `onPress` and\n * closes the snackbar, which is what the page draws.\n */\n action?: SnackbarAction;\n /**\n * Run when the snackbar closes, however it was closed: by its timer, its\n * action or close button, `close`, `clear`, or a newer message added in its\n * place. It runs as the snackbar starts to fade out, not once it has gone.\n */\n onClose?: () => void;\n /**\n * Whether a close button is shown at the end. The page draws one for a\n * message a reader may want out of the way before it expires.\n *\n * Named for what it draws rather than `isDismissable`, which on `Sheet`,\n * `Dialog` and React Aria's modals is whether a press outside them closes\n * them — a snackbar has no outside to press.\n * @default false\n */\n showCloseButton?: boolean;\n /**\n * How long the snackbar is shown, in milliseconds. Defaults to five seconds\n * for a message alone. A message with an action defaults to `0` and stays\n * until the action is taken or something closes it, as Material Design asks\n * of an actionable snackbar, since a reader may need longer to reach the\n * action than any timer allows. The timer is paused while the region is\n * hovered or focused, so a message never expires while it is being read.\n *\n * A timer shorter than four seconds, the least Material Design allows, is\n * lengthened to four, since a message gone sooner cannot be read.\n *\n * `0` is the page's indefinite length: the snackbar stays until something\n * closes it. Give one of those an action or `showCloseButton`, or there is no\n * way to be rid of it.\n */\n timeout?: number;\n};\ntype SnackbarProps = {\n /**\n * What a screen reader calls the region holding the snackbar. Left out,\n * React Aria names the region itself: a count of the messages it holds, in\n * the reader's own locale — \"1 notification.\" in English, and one of some\n * thirty languages otherwise. Pass a name only to replace that, and pass a\n * translated one, since whatever is passed is read as written.\n */\n 'aria-label'?: string;\n /** A function may compute the class from the region's render state. */\n className?: RACToastRegionProps<SnackbarMessage>['className'];\n /**\n * What a screen reader calls the button that dismisses a snackbar. It sits\n * here rather than on a message's own options because it does not vary by\n * message, so putting it there would make every `add` call repeat it. Left\n * out, React Aria names it in the reader's locale — \"Close\" in English.\n */\n closeLabel?: string;\n /** The queue the region shows messages from. */\n queue: SnackbarQueue;\n /** A function may compute the style from the region's render state. */\n style?: RACToastRegionProps<SnackbarMessage>['style'];\n} & Omit<RACToastRegionProps<SnackbarMessage>, 'aria-label' | 'children' | 'className' | 'queue' | 'style'>;\n\n// One entry of the queue, as React Aria hands it to the region's render\n// function. Taken from its render state rather than imported from\n// `react-stately`, which this package does not depend on.\ntype SnackbarToastItem = ToastRegionRenderProps<SnackbarMessage>['visibleToasts'][number];\n\n/**\n * React Aria's queue, made to keep a closing snackbar on screen while it\n * fades. React Aria drops a toast from its list the moment it closes, and the\n * region unmounts with its last toast, so a closing strip has no state of its\n * own to be drawn in. Every close reaches `close` here — React Aria's timer and\n * its close button call it on the queue they were handed, as `SnackbarQueue`\n * does — so this one override covers all of them: the strip is marked as\n * fading, and React Aria closes it once the fade has run.\n */\nclass FadingToastQueue extends RACToastQueue<SnackbarMessage> {\n // The strips fading out.\n readonly #fading = new Set<string>();\n readonly #listeners = new Set<() => void>();\n\n // Run as a strip starts to close — see `SnackbarQueue`.\n readonly #onClosing: (key: string) => void;\n constructor(onClosing: (key: string) => void) {\n // One at a time, which is what the page shows. React Aria shows the\n // newest, so a message added while another is up or fading takes its\n // place at once, and the older one runs out its fade unseen.\n super({\n maxVisibleToasts: 1\n });\n this.#onClosing = onClosing;\n }\n\n /** Starts a toast fading, and closes it once the fade has run. */\n override close(key: string) {\n this.#onClosing(key);\n this.#fading.add(key);\n setTimeout(() => {\n this.#fading.delete(key);\n super.close(key);\n }, EXIT_MS);\n for (const listener of this.#listeners) {\n listener();\n }\n }\n\n /** Whether a toast is fading out. */\n isFading(key: string) {\n return this.#fading.has(key);\n }\n\n /** Calls `listener` whenever a toast starts to fade. */\n subscribeToFading(listener: () => void) {\n this.#listeners.add(listener);\n return () => {\n this.#listeners.delete(listener);\n };\n }\n}\n\n/**\n * The queue a snackbar is shown from. Make one where the app can reach it —\n * a module of its own is the usual place — mount `Snackbar` once with it,\n * and call `add` from anywhere.\n *\n * ```ts\n * const messages = new Snackbar.Queue()\n * messages.add('Label', { action: { label: 'Undo', onPress: undo } })\n * ```\n *\n * It wraps React Aria's toast queue rather than exposing it, which is what\n * keeps that API's `UNSTABLE_` name out of a consumer's code.\n */\nclass SnackbarQueue {\n /**\n * React Aria's queue, which `Snackbar` subscribes to. Not part of the\n * package's API — read it and an upstream release may break the call site.\n */\n readonly rac: RACToastQueue<SnackbarMessage>;\n\n // The snackbars not yet closed, each with its `onClose`, which `add` and\n // `clear` close. Kept here because React Aria keeps its own list private,\n // and its own `clear` empties that list without running a single `onClose`.\n readonly #open = new Map<string, (() => void) | undefined>();\n\n // `rac` as the class it is, which `rac` itself is not declared as so that\n // the subclass stays out of the package's API.\n readonly #toasts: FadingToastQueue;\n constructor() {\n this.#toasts = new FadingToastQueue(key => {\n this.#closing(key);\n });\n this.rac = this.#toasts;\n }\n\n /**\n * Shows a message in place of the one on screen, and returns the key that\n * closes it. The message it replaces is closed, so its `onClose` runs, and\n * it does not come back.\n */\n add(message: ReactNode, options: SnackbarOptions = {}) {\n const {\n action,\n onClose,\n showCloseButton = false,\n timeout\n } = options;\n this.clear();\n const key = this.#toasts.add({\n action,\n message,\n showCloseButton\n }, {\n timeout: readableTimeout(timeout ?? (action === undefined ? MESSAGE_MS : UNTIL_CLOSED))\n });\n this.#open.set(key, onClose);\n return key;\n }\n\n /** Closes the snackbar on screen, running its `onClose`. */\n clear() {\n // Each close runs that message's `onClose`, which deletes its own key\n // from the map — the entry being visited, which a Map allows.\n for (const key of this.#open.keys()) {\n this.#toasts.close(key);\n }\n }\n\n /** Closes one snackbar, by the key `add` returned. */\n close(key: string) {\n this.#toasts.close(key);\n }\n\n // A snackbar starting to close, however it was closed — its timer runs\n // inside React Aria's queue, past this one — leaves the open map and runs\n // its `onClose` on the way out.\n #closing(key: string) {\n const onClose = this.#open.get(key);\n if (this.#open.delete(key)) {\n onClose?.();\n }\n }\n}\n\n// The three handlers the snackbar hands to something below it, each built by\n// a call rather than written inline at the prop, which is what react-perf's\n// no-new-function-as-prop is after; the React Compiler memoises the result on\n// its inputs.\nfunction actionPress(action: SnackbarAction, close: () => void) {\n return () => {\n action.onPress();\n close();\n };\n}\nfunction closeToast(queue: SnackbarQueue, key: string) {\n return () => {\n queue.close(key);\n };\n}\n\n// A control's classes, from its own render state — see `controlFocused`.\nfunction controlClassName(style: stylex.StyleXStyles) {\n return (state: {\n isFocusVisible: boolean;\n isHovered: boolean;\n isPressed: boolean;\n }) => stylex.props(styles.control, style, state.isHovered && styles.controlHovered, state.isFocusVisible && styles.controlFocused, state.isPressed && styles.controlPressed).className ?? '';\n}\n\n// A timer the reader has time to read by — see the durations at the top of\n// this file. Only a timer is held to the minimum: React Aria runs none for `0`\n// or below, which keep the message until something closes it.\nfunction readableTimeout(timeout: number) {\n return timeout > UNTIL_CLOSED ? Math.max(timeout, MINIMUM_MS) : timeout;\n}\n\n/**\n * A brief message at the bottom of the screen, with an optional action. Mount\n * one of these with a `Snackbar.Queue`, and call the queue's `add` to show a\n * message from anywhere.\n *\n * ```tsx\n * const messages = new Snackbar.Queue()\n *\n * <Snackbar queue={messages} />\n * ```\n *\n * The region is portalled to the end of `<body>` and renders nothing while\n * the queue is empty. It is one region rather than one per message, so mount\n * it once, near the root.\n *\n * The call site's `className` and `style` land on that region, which is the\n * element a layout positions.\n *\n * While a full-screen `Dialog` or a `Sheet` with a footer is open, the region\n * rises to sit above those actions rather than over them, since they share\n * the bottom edge of the window and the snackbar is drawn above both.\n *\n * While a `Dialog` or a `Sheet` is open, Tab stays inside it and never\n * reaches the snackbar. F6 does: React Aria moves focus between landmarks\n * with it, so it lands on the region, Tab then reaches the message and its\n * action, and tabbing on past the last of them leads back into the dialog. A\n * message with an action stays until it is answered, so a keyboard user has\n * the time that route takes.\n */\nfunction Snackbar({\n closeLabel,\n queue,\n ...props\n}: RefAttributes<HTMLDivElement> & SnackbarProps) {\n const clearance = useBottomEdgeClearance();\n return <RACToastRegion<SnackbarMessage> queue={queue.rac} {...props} {...mergeStatefulStyles(stylex.props(styles.region, clearance > 0 && styles.risen(`${clearance}px`)), props)}>\n {snackbarContent(queue, closeLabel)}\n </RACToastRegion>;\n}\n\n/**\n * One of the snackbar's two controls. React Aria's `Button` rather than the\n * library's, for the colour reason in the comment at the top of this file;\n * the ripple and the state layers are the same ones every other control\n * here draws, over `currentColor`.\n */\nfunction SnackbarButton({\n children,\n style,\n ...props\n}: {\n 'aria-label'?: string;\n children: ReactNode;\n onPress?: () => void;\n slot?: string;\n style: stylex.StyleXStyles;\n}) {\n const ripple = useRipple<FocusableElement>();\n return <RACButton {...ripple.handlers} {...props} className={controlClassName(style)}>\n {children}\n {ripple.surface}\n </RACButton>;\n}\nfunction snackbarContent(queue: SnackbarQueue, closeLabel: string | undefined) {\n return ({\n toast\n }: {\n toast: SnackbarToastItem;\n }) => <SnackbarToast close={closeToast(queue, toast.key)} closeLabel={closeLabel} queue={queue} toast={toast} />;\n}\n\n/**\n * The action, the close button, or nothing, after the message — together, so\n * they move beneath it together.\n */\nfunction SnackbarControls({\n action,\n close,\n closeLabel,\n fading,\n showCloseButton\n}: {\n action: SnackbarAction | undefined;\n close: () => void;\n closeLabel: string | undefined;\n fading: boolean;\n showCloseButton: boolean;\n}) {\n if (action === undefined && !showCloseButton) {\n return null;\n }\n return <div className=\"x6s0dn4 x9f619 x78zum5 x2lah0s xvc5jky\">\n {action === undefined ? null :\n // Nothing on a fading strip answers a press: its action has already\n // run, and an Undo pressed twice would undo twice.\n <SnackbarButton onPress={fading ? undefined : actionPress(action, close)} style={styles.action}>\n {action.label}\n </SnackbarButton>}\n {showCloseButton ? <SnackbarButton aria-label={closeLabel} slot=\"close\" style={styles.close}>\n <CloseGlyph className=\"xxk0z11 xvy4d1p\" />\n </SnackbarButton> : null}\n </div>;\n}\n\n/** One snackbar: its message, then whatever sits after it. */\nfunction SnackbarToast({\n close,\n closeLabel,\n queue,\n toast\n}: {\n close: () => void;\n closeLabel: string | undefined;\n queue: SnackbarQueue;\n toast: SnackbarToastItem;\n}) {\n const {\n action,\n message,\n showCloseButton\n } = toast.content;\n const fading = useFading(queue, toast.key);\n return <RACToast toast={toast} {...{\n 0: {\n className: \"x6s0dn4 x1n1nwrg x1u6grsq x1dwmuk9 x16dv9tl x1c5gpgi x1w1tqly x1tfhd1 xx61lck x13rsnn2 x1udv5rz x9f619 x78zum5 x1a02dak xh8yej3 x1x1rfll xlx31pv x1dry9sr xeuugli xuq8xha x1ulcdur xr2mjdv x9v5kkp x1t137rt x1s780dp xt970qd xn60lsn x67bb7w\"\n },\n 1: {\n className: \"x6s0dn4 x1c5gpgi x1w1tqly x1tfhd1 xx61lck x13rsnn2 x1udv5rz x9f619 x78zum5 x1a02dak xh8yej3 x1x1rfll xlx31pv x1dry9sr xeuugli xuq8xha x1ulcdur xr2mjdv x9v5kkp x1t137rt x1s780dp xt970qd xn60lsn x1vhuh8u x1u6grsq x10e4vud xxp0q0x xi22y15 x47corl\"\n }\n }[!!fading << 0]}>\n <RACToastContent className=\"x9f619 x1girmi0 x4pfjvb x1iyjqo2 xpo2rfv x193rfdd x1hews6w xkjl1po xn43zvd xv61bfh xz158ff xeuugli xj0a0fe xxlmvz2\">\n <Text slot=\"title\">{message}</Text>\n </RACToastContent>\n <SnackbarControls action={action} close={close} closeLabel={closeLabel} fading={fading} showCloseButton={showCloseButton} />\n </RACToast>;\n}\n\n/**\n * Whether a snackbar is fading out of its queue. `rac` is always the queue\n * that fades, but is declared as React Aria's, so it is narrowed back here.\n */\nfunction useFading(queue: SnackbarQueue, key: string) {\n const toasts = queue.rac instanceof FadingToastQueue ? queue.rac : undefined;\n return useSyncExternalStore(listener => toasts?.subscribeToFading(listener) ?? (() => {}), () => toasts?.isFading(key) ?? false);\n}\nSnackbar.Queue = SnackbarQueue;\n\n// The queue is reached as `Snackbar.Queue` rather than exported beside the\n// component: this file would otherwise export something that is not a\n// component, which is what turns fast refresh off for it.\nexport type { SnackbarAction, SnackbarMessage, SnackbarOptions, SnackbarProps, SnackbarQueue, ToastRegionRenderProps as SnackbarRegionRenderProps };\nexport default Snackbar;"],"mappings":";;;;;;;;;;;AAoFA,MAAMQ,aAAa;AACnB,MAAMC,aAAa;AACnB,MAAMC,eAAe;AAMrB,MAAMC,UAAU;AAwBhB,MAAMC,QAAQ;CACZC,QAAQ;CACRC,QAAQ;CACR,SAAS;AACX;AACA,MAAMC,SAAS;CACbC,QAAQ;EACNC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,OAAO;EACLC,QAAQ;EACRX,QAAQ;EACRY,QAAQ;EACRC,QAAQ;EACRJ,OAAO;CACT;CACAK,SAAS;EACPC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;EACPC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRnB,OAAO;CACT;CACAoB,gBAAgB;EACdb,QAAQ;EACRP,OAAO;CACT;CACAqB,gBAAgB;EACdd,QAAQ;EACRP,OAAO;CACT;CACAsB,gBAAgB;EACdf,QAAQ;EACRP,OAAO;CACT;CACAuB,QAAQ;EACNjB,QAAQ;EACR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AA;CAAA,IAAAE;CAAA,IAAAF,EAAA,OAAA/B,OAAA+B,EAAA,OAAAnB,QAAA;EAAEqB,WAAMrB,QAAML,SAAWP,GAAY,KAA7B;EAA8B+B,EAAA,KAAA/B;EAAA+B,EAAA,KAAAnB;EAAAmB,EAAA,KAAAE;CAAA,OAAAA,KAAAF,EAAA;CAAA,OAAxH9G,qBAAqB6G,IAA+DG,EAAoC;AAAC;AAFlI,SAAAoB,SAAA,CAAA;AAIAxB,SAASyB,QAAQ5D"}
1
+ {"version":3,"file":"index.js","names":["_c","stylex","useSyncExternalStore","RACToastQueue","RACToastRegion","useBottomEdgeClearance","useRipple","mergeStatefulStyles","MESSAGE_MS","MINIMUM_MS","UNTIL_CLOSED","EXIT_MS","_temp","krVfgx","kGO01o","styles","action","kgeoSG","kGOzcv","kpsdNU","kEoFBp","kMwMTN","kMv6JI","kGuDYH","k63SB2","kb6lSQ","kLWn49","kAzted","k8WAf4","kg3NbH","$$css","close","kZKoxP","kzqmXN","kmVPX3","control","kGNEyG","kWkggS","kaIpWk","kMzoRj","kB7OPa","kkrTdU","k1xSpc","kmuXW","kjj79g","kjBf7l","kInvED","k3XXqK","kMeerF","kVAEAm","controlFocused","controlHovered","controlPressed","region","kXwgrk","kOIVth","kkqhue","kLKAdn","kE3dHu","kpe85a","kfzvcC","kY2c9j","risen","clearance","val","undefined","label","onPress","message","showCloseButton","tone","onClose","timeout","className","closeLabel","queue","SnackbarQueue","style","FadingToastQueue","fading","Set","onClosing","key","constructor","maxVisibleToasts","add","setTimeout","delete","listener","isFading","has","subscribeToFading","rac","Map","toasts","options","clear","readableTimeout","set","keys","get","actionPress","closeToast","controlClassName","state","isFocusVisible","isHovered","isPressed","props","Math","max","Snackbar","t0","$","T0","t1","t2","t3","snackbarContent","t4","SnackbarButton","children","ripple","handlers","surface","toast","SnackbarControls","SnackbarToast","content","useFading","Symbol","for","0","1","t5","t6","_temp2","Queue","RACButton","RACToastContent","RACToast"],"sources":["../../../src/components/snackbar/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { FocusableElement, ToastRegionProps as RACToastRegionProps, ToastRegionRenderProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { useSyncExternalStore } from 'react';\nimport { Button as RACButton, UNSTABLE_Toast as RACToast, UNSTABLE_ToastContent as RACToastContent, UNSTABLE_ToastQueue as RACToastQueue, UNSTABLE_ToastRegion as RACToastRegion, Text } from 'react-aria-components';\nimport { CloseGlyph, ErrorGlyph } from '../../glyphs';\nimport { useBottomEdgeClearance } from '../../hooks/useBottomEdge';\nimport { useRipple } from '../../hooks/useRipple';\nimport '../../styles/layers.stylex';\nimport { layers } from '../../styles/layers.stylex';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, motion, radii, shadows, sizing, spacing, stateLayerOpacity, typography } from '../../tokens/design.tokens.stylex';\n\n// The snackbar page's brief message at the bottom of the screen, with an\n// optional action beside it and an optional close button after that. The\n// page's container is the inverse surface at a 4dp corner and elevation 3,\n// its supporting text is body-medium in inverse on surface, its action label\n// is inverse primary, and its close icon takes the supporting text's colour.\n// The measurements are the page's too: 8dp of margin from the edges of the\n// screen, 8dp of padding inside the container with another 8dp either side\n// of the message, 14dp above and below on a single line, and between 320 and\n// 576dp wide above the page's 600dp breakpoint — full width below it.\n//\n// One at a time. The page shows a single snackbar and replaces it rather\n// than stacking, so a message added while another is up closes that one —\n// its `onClose` runs — and takes its place. Nothing waits behind it: React\n// Aria's queue, left to itself, kept every message and showed the one it had\n// replaced again once the newer closed, so an Undo could come back long after\n// the thing it undid.\n//\n// React Aria's toast is the behaviour: the region is a landmark that holds\n// the message, moves focus into it for a keyboard, and pauses every timer\n// while it is hovered or focused, so a message never expires while it is\n// being read or acted on.\n//\n// Three things are decided here rather than taken from React Aria or from\n// the page.\n//\n// **The queue is ours, not React Aria's.** React Aria's toast is still\n// `UNSTABLE_`, and `SnackbarQueue` is what keeps that name out of a\n// consumer's code — an upstream rename is this file rather than every call\n// site. It wraps their queue, defaults it to one visible message, and takes\n// the message and its options as one call.\n//\n// **The action and the close button are drawn here rather than through\n// Button and IconButton.** The page colours them inverse primary and inverse\n// on surface, which no variant of either carries, and a colour pushed in\n// from outside through `className` is the merge hazard AGENTS.md describes:\n// StyleX decides between two atomic classes by their order in the compiled\n// stylesheet, not by the order they are applied. Both are React Aria's\n// `Button` with the same ripple and the same state layers, over\n// `currentColor` so each takes the colour the snackbar gives it.\n//\n// **A failure leads with a warning glyph**, which the page does not draw: a\n// message added with `tone: 'failure'` starts with a 20dp exclamation mark in\n// a filled circle, so it no longer looks like a confirmation. It is drawn in\n// the inverse error, the error made to read on the inverse surface, as\n// inverse primary is the primary made to read there: by default the other\n// scheme's error, and a theme's own where it states one. It sits beside the\n// message's first line, and is decorative, since the message's words say\n// what failed.\n//\n// **There is no `container` prop.** Every other overlay here takes one,\n// because React Aria's `Modal` and `Popover` accept a portal container, and\n// `src/components/portal-container.test.tsx` is what keeps that true.\n// Its toast region does not: it reads a portal provider that\n// `react-aria-components` does not export, so the region always lands at the\n// end of `<body>`. An app that scopes its StyleX theme to a subtree has to\n// put the theme on `:root` for the snackbar to be drawn in it.\n\n// How long a message is shown when the call site names no `timeout`. The\n// specs page gives no duration, so these come from the snackbar's guidelines\n// and accessibility pages.\n//\n// A message alone leaves after five seconds. The pages allow four to ten, and\n// React Aria's toast docs set five as the least a reader should be given.\n//\n// A call site's own `timeout` is held to the pages' four. A shorter one is\n// lengthened to that, since a message gone in a second cannot be read, and the\n// web gives a reader no setting to slow it down with — the same reason the\n// paragraph below gives. `0` is left alone: it is no timer at all.\n//\n// A message with an action stays until the action is taken or something\n// closes it, as the pages ask of every actionable snackbar. No timer can know\n// how long a reader needs to act: a screen reader user hears the message\n// first and has to reach the region before the action is any use, and the\n// pause while the region is hovered or focused only starts once they have.\n// Android's snackbar can keep shorter defaults because the platform lengthens\n// them from each user's accessibility settings, and the web has no such\n// setting to read.\nconst MESSAGE_MS = 5000;\nconst MINIMUM_MS = 4000;\nconst UNTIL_CLOSED = 0;\n\n// How long a closing snackbar takes to fade, and so how long it stays in the\n// document once something has closed it: `durationShort2`, the token the fade\n// below runs for. A theme that lengthens that token has its fade cut short\n// here, since the queue cannot read a duration out of the stylesheet.\nconst EXIT_MS = 150;\n\n// Below the page's 600dp breakpoint the snackbar runs the width of the\n// screen; above it, it takes between 320 and 576.\nconst WIDE = '@media (min-width: 600px)';\n\n// The page's own is a fade, in and out. It rises a little as it arrives too,\n// which is what the page draws and what says the message came from the edge\n// of the screen rather than appearing over it. It leaves by the fade alone,\n// and quicker than it came, on the curve for something going away: once it is\n// closed there is nothing left on it to read.\nconst rise = \"x15b941j-B\";\nconst fadeOut = \"x1jn504y-B\";\n\n// Windows High Contrast and the rest of the forced-colours modes. Spelled\n// here rather than imported, for the reason src/field/styles.ts records: the\n// StyleX compiler resolves a constant across files only out of a `.stylex.ts`\n// module, and the generated one holds design tokens rather than queries.\nconst FORCED_COLORS = '@media (forced-colors: active)';\n\n// The least press area the action keeps, as Button's medium size does. A\n// literal rather than a token, for the reason Button's `TARGET_SIZE` gives: a\n// consumer resizing their controls should not shrink a floor the page states.\nconst TARGET_SIZE = '48px';\nconst _temp = {\n krVfgx: \"xiicpxy\",\n kGO01o: \"xqf7pud\",\n \"$$css\": true\n};\nconst styles = {\n action: {\n kgeoSG: \"x1cpjm7i\",\n kGOzcv: \"xun2zgk\",\n kpsdNU: \"xm4btww\",\n kEoFBp: \"x1hmns74\",\n kMwMTN: \"x16bex6i\",\n kMv6JI: \"xkknnkr\",\n kGuDYH: \"x14zspaw\",\n k63SB2: \"x1v9cpvo\",\n kb6lSQ: \"x155f00i\",\n kLWn49: \"x1lz68p4\",\n kAzted: \"x1cio8j0\",\n k8WAf4: \"x1cmllll\",\n kg3NbH: \"x18fpw6u\",\n $$css: true\n },\n close: {\n kZKoxP: \"xbg5kjn\",\n kMwMTN: \"x1girmi0\",\n kzqmXN: \"xoqf9c6\",\n kmVPX3: \"x1717udv\",\n $$css: true\n },\n control: {\n kGNEyG: \"x6s0dn4\",\n kWkggS: \"xjbqb8w\",\n kaIpWk: \"x1dkaolv\",\n kMzoRj: \"xc342km\",\n kB7OPa: \"x9f619\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x3nfvp2\",\n kmuXW: \"x2lah0s\",\n kjj79g: \"xl56j7k\",\n kjBf7l: \"x14ytart\",\n kInvED: \"xr2mjdv\",\n k3XXqK: \"x9v5kkp x1t137rt\",\n kMeerF: \"x1s780dp\",\n kVAEAm: \"x1n2onr6\",\n $$css: true\n },\n controlFocused: {\n kWkggS: \"x1mbb5iu\",\n $$css: true\n },\n controlHovered: {\n kWkggS: \"x930l3l\",\n $$css: true\n },\n controlPressed: {\n kWkggS: \"xsykwg8\",\n $$css: true\n },\n region: {\n kGNEyG: \"x6s0dn4\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"x78zum5\",\n kXwgrk: \"xdt5ytf\",\n kOIVth: \"x126z3so\",\n krVfgx: \"x1ey2m1c\",\n kkqhue: \"x17y0mx6\",\n k3XXqK: \"x1t137rt\",\n kGO01o: \"x1u7mh7p\",\n kLKAdn: \"xi7mcox\",\n kE3dHu: \"xbpsoft\",\n kpe85a: \"xq5vm52\",\n kfzvcC: \"x47corl\",\n kVAEAm: \"xixxii4\",\n kY2c9j: \"x1bk8fjm\",\n $$css: true\n },\n risen: (clearance: string) => [_temp, {\n \"--x-insetBlockEnd\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(clearance)\n }]\n};\ntype SnackbarAction = {\n /** What the action says. The page gives it a single word where it can. */\n label: string;\n /** Run when the action is pressed, just before the snackbar closes. */\n onPress: () => void;\n};\n\n/** What a snackbar carries: its message, and what may sit beside it. */\ntype SnackbarMessage = {\n action: SnackbarAction | undefined;\n message: ReactNode;\n showCloseButton: boolean;\n tone?: SnackbarTone | undefined;\n};\ntype SnackbarOptions = {\n /**\n * A single action shown after the message. Pressing it runs `onPress` and\n * closes the snackbar, which is what the page draws.\n */\n action?: SnackbarAction;\n /**\n * Run when the snackbar closes, however it was closed: by its timer, its\n * action or close button, `close`, `clear`, or a newer message added in its\n * place. It runs as the snackbar starts to fade out, not once it has gone.\n */\n onClose?: () => void;\n /**\n * Whether a close button is shown at the end. The page draws one for a\n * message a reader may want out of the way before it expires.\n *\n * Named for what it draws rather than `isDismissable`, which on `Sheet`,\n * `Dialog` and React Aria's modals is whether a press outside them closes\n * them — a snackbar has no outside to press.\n * @default false\n */\n showCloseButton?: boolean;\n /**\n * How long the snackbar is shown, in milliseconds. Defaults to five seconds\n * for a message alone. A message with an action defaults to `0` and stays\n * until the action is taken or something closes it, as Material Design asks\n * of an actionable snackbar, since a reader may need longer to reach the\n * action than any timer allows. The timer is paused while the region is\n * hovered or focused, so a message never expires while it is being read.\n *\n * A timer shorter than four seconds, the least Material Design allows, is\n * lengthened to four, since a message gone sooner cannot be read.\n *\n * `0` is the page's indefinite length: the snackbar stays until something\n * closes it. Give one of those an action or `showCloseButton`, or there is no\n * way to be rid of it.\n */\n timeout?: number;\n /**\n * `failure` leads the message with a warning glyph in the inverse error,\n * so a failure does not look like a confirmation. Left out, the message is\n * drawn as a confirmation. The glyph is not announced, so the message's\n * words should say that something failed.\n */\n tone?: SnackbarTone;\n};\ntype SnackbarProps = {\n /**\n * What a screen reader calls the region holding the snackbar. Left out,\n * React Aria names the region itself: a count of the messages it holds, in\n * the reader's own locale — \"1 notification.\" in English, and one of some\n * thirty languages otherwise. Pass a name only to replace that, and pass a\n * translated one, since whatever is passed is read as written.\n */\n 'aria-label'?: string;\n /** A function may compute the class from the region's render state. */\n className?: RACToastRegionProps<SnackbarMessage>['className'];\n /**\n * What a screen reader calls the button that dismisses a snackbar. It sits\n * here rather than on a message's own options because it does not vary by\n * message, so putting it there would make every `add` call repeat it. Left\n * out, React Aria names it in the reader's locale — \"Close\" in English.\n */\n closeLabel?: string;\n /** The queue the region shows messages from. */\n queue: SnackbarQueue;\n /** A function may compute the style from the region's render state. */\n style?: RACToastRegionProps<SnackbarMessage>['style'];\n} & Omit<RACToastRegionProps<SnackbarMessage>, 'aria-label' | 'children' | 'className' | 'queue' | 'style'>;\n\n// One entry of the queue, as React Aria hands it to the region's render\n// function. Taken from its render state rather than imported from\n// `react-stately`, which this package does not depend on.\ntype SnackbarToastItem = ToastRegionRenderProps<SnackbarMessage>['visibleToasts'][number];\n\n/** What a message reports: `failure`, where something did not happen. */\ntype SnackbarTone = 'failure';\n\n/**\n * React Aria's queue, made to keep a closing snackbar on screen while it\n * fades. React Aria drops a toast from its list the moment it closes, and the\n * region unmounts with its last toast, so a closing strip has no state of its\n * own to be drawn in. Every close reaches `close` here — React Aria's timer and\n * its close button call it on the queue they were handed, as `SnackbarQueue`\n * does — so this one override covers all of them: the strip is marked as\n * fading, and React Aria closes it once the fade has run.\n */\nclass FadingToastQueue extends RACToastQueue<SnackbarMessage> {\n // The strips fading out.\n readonly #fading = new Set<string>();\n readonly #listeners = new Set<() => void>();\n\n // Run as a strip starts to close — see `SnackbarQueue`.\n readonly #onClosing: (key: string) => void;\n constructor(onClosing: (key: string) => void) {\n // One at a time, which is what the page shows. React Aria shows the\n // newest, so a message added while another is up or fading takes its\n // place at once, and the older one runs out its fade unseen.\n super({\n maxVisibleToasts: 1\n });\n this.#onClosing = onClosing;\n }\n\n /** Starts a toast fading, and closes it once the fade has run. */\n override close(key: string) {\n this.#onClosing(key);\n this.#fading.add(key);\n setTimeout(() => {\n this.#fading.delete(key);\n super.close(key);\n }, EXIT_MS);\n for (const listener of this.#listeners) {\n listener();\n }\n }\n\n /** Whether a toast is fading out. */\n isFading(key: string) {\n return this.#fading.has(key);\n }\n\n /** Calls `listener` whenever a toast starts to fade. */\n subscribeToFading(listener: () => void) {\n this.#listeners.add(listener);\n return () => {\n this.#listeners.delete(listener);\n };\n }\n}\n\n/**\n * The queue a snackbar is shown from. Make one where the app can reach it —\n * a module of its own is the usual place — mount `Snackbar` once with it,\n * and call `add` from anywhere.\n *\n * ```ts\n * const messages = new Snackbar.Queue()\n * messages.add('Label', { action: { label: 'Undo', onPress: undo } })\n * ```\n *\n * It wraps React Aria's toast queue rather than exposing it, which is what\n * keeps that API's `UNSTABLE_` name out of a consumer's code.\n */\nclass SnackbarQueue {\n /**\n * React Aria's queue, which `Snackbar` subscribes to. Not part of the\n * package's API — read it and an upstream release may break the call site.\n */\n readonly rac: RACToastQueue<SnackbarMessage>;\n\n // The snackbars not yet closed, each with its `onClose`, which `add` and\n // `clear` close. Kept here because React Aria keeps its own list private,\n // and its own `clear` empties that list without running a single `onClose`.\n readonly #open = new Map<string, (() => void) | undefined>();\n\n // `rac` as the class it is, which `rac` itself is not declared as so that\n // the subclass stays out of the package's API.\n readonly #toasts: FadingToastQueue;\n constructor() {\n this.#toasts = new FadingToastQueue(key => {\n this.#closing(key);\n });\n this.rac = this.#toasts;\n }\n\n /**\n * Shows a message in place of the one on screen, and returns the key that\n * closes it. The message it replaces is closed, so its `onClose` runs, and\n * it does not come back.\n */\n add(message: ReactNode, options: SnackbarOptions = {}) {\n const {\n action,\n onClose,\n showCloseButton = false,\n timeout,\n tone\n } = options;\n this.clear();\n const key = this.#toasts.add({\n action,\n message,\n showCloseButton,\n tone\n }, {\n timeout: readableTimeout(timeout ?? (action === undefined ? MESSAGE_MS : UNTIL_CLOSED))\n });\n this.#open.set(key, onClose);\n return key;\n }\n\n /** Closes the snackbar on screen, running its `onClose`. */\n clear() {\n // Each close runs that message's `onClose`, which deletes its own key\n // from the map — the entry being visited, which a Map allows.\n for (const key of this.#open.keys()) {\n this.#toasts.close(key);\n }\n }\n\n /** Closes one snackbar, by the key `add` returned. */\n close(key: string) {\n this.#toasts.close(key);\n }\n\n // A snackbar starting to close, however it was closed — its timer runs\n // inside React Aria's queue, past this one — leaves the open map and runs\n // its `onClose` on the way out.\n #closing(key: string) {\n const onClose = this.#open.get(key);\n if (this.#open.delete(key)) {\n onClose?.();\n }\n }\n}\n\n// The three handlers the snackbar hands to something below it, each built by\n// a call rather than written inline at the prop, which is what react-perf's\n// no-new-function-as-prop is after; the React Compiler memoises the result on\n// its inputs.\nfunction actionPress(action: SnackbarAction, close: () => void) {\n return () => {\n action.onPress();\n close();\n };\n}\nfunction closeToast(queue: SnackbarQueue, key: string) {\n return () => {\n queue.close(key);\n };\n}\n\n// A control's classes, from its own render state — see `controlFocused`.\nfunction controlClassName(style: stylex.StyleXStyles) {\n return (state: {\n isFocusVisible: boolean;\n isHovered: boolean;\n isPressed: boolean;\n }) => stylex.props(styles.control, style, state.isHovered && styles.controlHovered, state.isFocusVisible && styles.controlFocused, state.isPressed && styles.controlPressed).className ?? '';\n}\n\n// A timer the reader has time to read by — see the durations at the top of\n// this file. Only a timer is held to the minimum: React Aria runs none for `0`\n// or below, which keep the message until something closes it.\nfunction readableTimeout(timeout: number) {\n return timeout > UNTIL_CLOSED ? Math.max(timeout, MINIMUM_MS) : timeout;\n}\n\n/**\n * A brief message at the bottom of the screen, with an optional action. Mount\n * one of these with a `Snackbar.Queue`, and call the queue's `add` to show a\n * message from anywhere.\n *\n * ```tsx\n * const messages = new Snackbar.Queue()\n *\n * <Snackbar queue={messages} />\n * ```\n *\n * The region is portalled to the end of `<body>` and renders nothing while\n * the queue is empty. It is one region rather than one per message, so mount\n * it once, near the root.\n *\n * The call site's `className` and `style` land on that region, which is the\n * element a layout positions.\n *\n * While a full-screen `Dialog` or a `Sheet` with a footer is open, the region\n * rises to sit above those actions rather than over them, since they share\n * the bottom edge of the window and the snackbar is drawn above both.\n *\n * While a `Dialog` or a `Sheet` is open, Tab stays inside it and never\n * reaches the snackbar. F6 does: React Aria moves focus between landmarks\n * with it, so it lands on the region, Tab then reaches the message and its\n * action, and tabbing on past the last of them leads back into the dialog. A\n * message with an action stays until it is answered, so a keyboard user has\n * the time that route takes.\n */\nfunction Snackbar({\n closeLabel,\n queue,\n ...props\n}: RefAttributes<HTMLDivElement> & SnackbarProps) {\n const clearance = useBottomEdgeClearance();\n return <RACToastRegion<SnackbarMessage> queue={queue.rac} {...props} {...mergeStatefulStyles(stylex.props(styles.region, clearance > 0 && styles.risen(`${clearance}px`)), props)}>\n {snackbarContent(queue, closeLabel)}\n </RACToastRegion>;\n}\n\n/**\n * One of the snackbar's two controls. React Aria's `Button` rather than the\n * library's, for the colour reason in the comment at the top of this file;\n * the ripple and the state layers are the same ones every other control\n * here draws, over `currentColor`.\n */\nfunction SnackbarButton({\n children,\n style,\n ...props\n}: {\n 'aria-label'?: string;\n children: ReactNode;\n onPress?: () => void;\n slot?: string;\n style: stylex.StyleXStyles;\n}) {\n const ripple = useRipple<FocusableElement>();\n return <RACButton {...ripple.handlers} {...props} className={controlClassName(style)}>\n {children}\n {ripple.surface}\n </RACButton>;\n}\nfunction snackbarContent(queue: SnackbarQueue, closeLabel: string | undefined) {\n return ({\n toast\n }: {\n toast: SnackbarToastItem;\n }) => <SnackbarToast close={closeToast(queue, toast.key)} closeLabel={closeLabel} queue={queue} toast={toast} />;\n}\n\n/**\n * The action, the close button, or nothing, after the message — together, so\n * they move beneath it together.\n */\nfunction SnackbarControls({\n action,\n close,\n closeLabel,\n fading,\n showCloseButton\n}: {\n action: SnackbarAction | undefined;\n close: () => void;\n closeLabel: string | undefined;\n fading: boolean;\n showCloseButton: boolean;\n}) {\n if (action === undefined && !showCloseButton) {\n return null;\n }\n return <div className=\"x6s0dn4 x9f619 x78zum5 x2lah0s xvc5jky\">\n {action === undefined ? null :\n // Nothing on a fading strip answers a press: its action has already\n // run, and an Undo pressed twice would undo twice.\n <SnackbarButton onPress={fading ? undefined : actionPress(action, close)} style={styles.action}>\n {action.label}\n </SnackbarButton>}\n {showCloseButton ? <SnackbarButton aria-label={closeLabel} slot=\"close\" style={styles.close}>\n <CloseGlyph className=\"xxk0z11 xvy4d1p\" />\n </SnackbarButton> : null}\n </div>;\n}\n\n/** One snackbar: its message, then whatever sits after it. */\nfunction SnackbarToast({\n close,\n closeLabel,\n queue,\n toast\n}: {\n close: () => void;\n closeLabel: string | undefined;\n queue: SnackbarQueue;\n toast: SnackbarToastItem;\n}) {\n const {\n action,\n message,\n showCloseButton,\n tone\n } = toast.content;\n const fading = useFading(queue, toast.key);\n return <RACToast toast={toast} {...{\n 0: {\n className: \"x6s0dn4 x1n1nwrg x1u6grsq x1dwmuk9 x16dv9tl x1c5gpgi x1w1tqly x1tfhd1 xx61lck x13rsnn2 x1udv5rz x9f619 x78zum5 x1a02dak xh8yej3 x1x1rfll xlx31pv x1dry9sr xeuugli xuq8xha x1ulcdur xr2mjdv x9v5kkp x1t137rt x1s780dp xt970qd xn60lsn x67bb7w\"\n },\n 1: {\n className: \"x6s0dn4 x1c5gpgi x1w1tqly x1tfhd1 xx61lck x13rsnn2 x1udv5rz x9f619 x78zum5 x1a02dak xh8yej3 x1x1rfll xlx31pv x1dry9sr xeuugli xuq8xha x1ulcdur xr2mjdv x9v5kkp x1t137rt x1s780dp xt970qd xn60lsn x1vhuh8u x1u6grsq x10e4vud xxp0q0x xi22y15 x47corl\"\n }\n }[!!fading << 0]}>\n {tone === 'failure' ? <ErrorGlyph className=\"xqcrz7y x1qx5ct2 x9f619 x7yhsra x2lah0s xw4jnvo x1hmvnq2 xq0p5jb\" /> : null}\n <RACToastContent className=\"x9f619 x1girmi0 x4pfjvb x1iyjqo2 xpo2rfv x193rfdd x1hews6w xkjl1po xn43zvd xv61bfh xz158ff xeuugli xj0a0fe xxlmvz2\">\n <Text slot=\"title\">{message}</Text>\n </RACToastContent>\n <SnackbarControls action={action} close={close} closeLabel={closeLabel} fading={fading} showCloseButton={showCloseButton} />\n </RACToast>;\n}\n\n/**\n * Whether a snackbar is fading out of its queue. `rac` is always the queue\n * that fades, but is declared as React Aria's, so it is narrowed back here.\n */\nfunction useFading(queue: SnackbarQueue, key: string) {\n const toasts = queue.rac instanceof FadingToastQueue ? queue.rac : undefined;\n return useSyncExternalStore(listener => toasts?.subscribeToFading(listener) ?? (() => {}), () => toasts?.isFading(key) ?? false);\n}\nSnackbar.Queue = SnackbarQueue;\n\n// The queue is reached as `Snackbar.Queue` rather than exported beside the\n// component: this file would otherwise export something that is not a\n// component, which is what turns fast refresh off for it.\nexport type { SnackbarAction, SnackbarMessage, SnackbarOptions, SnackbarProps, SnackbarQueue, ToastRegionRenderProps as SnackbarRegionRenderProps, SnackbarTone };\nexport default Snackbar;"],"mappings":";;;;;;;;;;;AA6FA,MAAMQ,aAAa;AACnB,MAAMC,aAAa;AACnB,MAAMC,eAAe;AAMrB,MAAMC,UAAU;AAwBhB,MAAMC,QAAQ;CACZC,QAAQ;CACRC,QAAQ;CACR,SAAS;AACX;AACA,MAAMC,SAAS;CACbC,QAAQ;EACNC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,OAAO;EACLC,QAAQ;EACRX,QAAQ;EACRY,QAAQ;EACRC,QAAQ;EACRJ,OAAO;CACT;CACAK,SAAS;EACPC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;EACPC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRnB,OAAO;CACT;CACAoB,gBAAgB;EACdb,QAAQ;EACRP,OAAO;CACT;CACAqB,gBAAgB;EACdd,QAAQ;EACRP,OAAO;CACT;CACAsB,gBAAgB;EACdf,QAAQ;EACRP,OAAO;CACT;CACAuB,QAAQ;EACNjB,QAAQ;EACRI,QAAQ;EACRE,QAAQ;EACRY,QAAQ;EACRC,QAAQ;EACR1C,QAAQ;EACR2C,QAAQ;EACRT,QAAQ;EACRjC,QAAQ;EACR2C,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRX,QAAQ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