@kanso-labs/kanso-ui 0.26.6 → 0.27.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.
@@ -62,6 +62,13 @@ type AppBarProps = Omit<RenderComponentProps<'header'>, 'children'> & {
62
62
  * gutter. Unset, the row is as wide as the bar.
63
63
  */
64
64
  contentMaxInlineSize?: string;
65
+ /**
66
+ * Where the headline sits in the page's outline. A screen reader moves
67
+ * between headings, so a bar drawn beside another bar, or under a page
68
+ * heading of its own, should lower it.
69
+ * @default 1
70
+ */
71
+ headingLevel?: number;
65
72
  /** The page's title. Wraps rather than truncating, and grows the bar with it. */
66
73
  headline?: ReactNode;
67
74
  /** Usually a back or menu icon button. Sits before the text. */
@@ -101,7 +108,7 @@ type AppBarProps = Omit<RenderComponentProps<'header'>, 'children'> & {
101
108
  * and `collapsed` exist. Neither watches the page: only the app knows which
102
109
  * element scrolls, so both are set from its own scroll handler.
103
110
  */
104
- declare function AppBar({ align, collapsed, contentInset, contentMaxInlineSize, headline, leading, render, scrolled, size, subtitle, trailing, ...props }: AppBarProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
111
+ declare function AppBar({ align, collapsed, contentInset, contentMaxInlineSize, headingLevel, headline, leading, render, scrolled, size, subtitle, trailing, ...props }: AppBarProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
105
112
  //#endregion
106
113
  export { type AppBarProps, AppBar as default };
107
114
  //# sourceMappingURL=index.d.ts.map
@@ -3,6 +3,7 @@ import { useRender } from "../../render/useRender.js";
3
3
  import { mergeStyles } from "../../styles/merge.js";
4
4
  import Text from "../text/index.js";
5
5
  import { c } from "react/compiler-runtime";
6
+ import { createElement } from "react";
6
7
  import { jsx, jsxs } from "react/jsx-runtime";
7
8
  //#region src/components/app-bar/index.tsx
8
9
  const HEADLINE_OFFSET = "12px";
@@ -53,7 +54,18 @@ const HEADLINE_VARIANT = {
53
54
  medium: "headlineSmall",
54
55
  small: "titleLarge"
55
56
  };
56
- const HEADING_1 = /* @__PURE__ */ jsx("h1", {});
57
+ const HEADINGS = [
58
+ "h1",
59
+ "h2",
60
+ "h3",
61
+ "h4",
62
+ "h5",
63
+ "h6"
64
+ ];
65
+ function heading(level) {
66
+ const index = Math.min(Math.max(Math.round(level), 1), HEADINGS.length) - 1;
67
+ return createElement(HEADINGS[index]);
68
+ }
57
69
  const PARAGRAPH = /* @__PURE__ */ jsx("p", {});
58
70
  const _temp = {
59
71
  kAzted: "x1chvrdh",
@@ -83,7 +95,7 @@ const rowStyles = { root: (contentInset, maxInlineSize) => [_temp2, {
83
95
  * element scrolls, so both are set from its own scroll handler.
84
96
  */
85
97
  function AppBar(t0) {
86
- const $ = c(39);
98
+ const $ = c(40);
87
99
  let render;
88
100
  let t1;
89
101
  let t2;
@@ -91,105 +103,107 @@ function AppBar(t0) {
91
103
  let t4;
92
104
  let t5;
93
105
  if ($[0] !== t0) {
94
- const { align: t6, collapsed: t7, contentInset: t8, contentMaxInlineSize: t9, headline, leading, render: t10, scrolled: t11, size: t12, subtitle, trailing, ...props$1 } = t0;
95
- render = t10;
106
+ const { align: t6, collapsed: t7, contentInset: t8, contentMaxInlineSize: t9, headingLevel: t10, headline, leading, render: t11, scrolled: t12, size: t13, subtitle, trailing, ...props$1 } = t0;
107
+ render = t11;
96
108
  const align = t6 === void 0 ? "start" : t6;
97
109
  const collapsed = t7 === void 0 ? false : t7;
98
110
  const contentInset = t8 === void 0 ? DEFAULT_CONTENT_INSET : t8;
99
111
  const contentMaxInlineSize = t9 === void 0 ? "none" : t9;
100
- const scrolled = t11 === void 0 ? false : t11;
101
- const size = t12 === void 0 ? "small" : t12;
112
+ const headingLevel = t10 === void 0 ? 1 : t10;
113
+ const scrolled = t12 === void 0 ? false : t12;
114
+ const size = t13 === void 0 ? "small" : t13;
102
115
  const collapse = collapsed && size !== "small";
103
116
  const expandedHeight = subtitle === void 0 || subtitle === null ? HEIGHTS[size].plain : HEIGHTS[size].withSubtitle;
104
117
  const height = collapse ? COLLAPSED_HEIGHT : expandedHeight;
105
118
  t5 = useRender;
106
119
  t4 = "header";
107
120
  t1 = props$1;
108
- let t13;
121
+ let t14;
109
122
  if ($[7] !== contentInset || $[8] !== contentMaxInlineSize) {
110
- t13 = props(styles.row, rowStyles.root(contentInset, contentMaxInlineSize));
123
+ t14 = props(styles.row, rowStyles.root(contentInset, contentMaxInlineSize));
111
124
  $[7] = contentInset;
112
125
  $[8] = contentMaxInlineSize;
113
- $[9] = t13;
114
- } else t13 = $[9];
115
- let t14;
126
+ $[9] = t14;
127
+ } else t14 = $[9];
128
+ let t15;
116
129
  if ($[10] !== leading) {
117
- t14 = leading === void 0 ? null : /* @__PURE__ */ jsx("div", {
130
+ t15 = leading === void 0 ? null : /* @__PURE__ */ jsx("div", {
118
131
  className: "x6s0dn4 x78zum5 x2lah0s xzoy561",
119
132
  children: leading
120
133
  });
121
134
  $[10] = leading;
122
- $[11] = t14;
123
- } else t14 = $[11];
124
- let t15;
135
+ $[11] = t15;
136
+ } else t15 = $[11];
137
+ let t16;
125
138
  if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
126
- t15 = {
139
+ t16 = {
127
140
  0: { className: "x9f619 x78zum5 xdt5ytf x1iyjqo2 xl56j7k xeuugli x1cmllll xaope02" },
128
141
  1: { className: "x9f619 x78zum5 xdt5ytf x1iyjqo2 xl56j7k xeuugli x1cmllll xaope02 x2b8uid" }
129
142
  };
130
- $[12] = t15;
131
- } else t15 = $[12];
132
- const t16 = t15[!!(align === "center") << 0];
133
- let t17;
134
- if ($[13] !== collapse || $[14] !== headline || $[15] !== size) {
135
- t17 = headline === void 0 ? null : /* @__PURE__ */ jsx(Text, {
143
+ $[12] = t16;
144
+ } else t16 = $[12];
145
+ const t17 = t16[!!(align === "center") << 0];
146
+ let t18;
147
+ if ($[13] !== collapse || $[14] !== headingLevel || $[15] !== headline || $[16] !== size) {
148
+ t18 = headline === void 0 ? null : /* @__PURE__ */ jsx(Text, {
136
149
  className: "xioksi3 x1nxaspg x1seskgd",
137
- render: HEADING_1,
150
+ render: heading(headingLevel),
138
151
  variant: collapse ? HEADLINE_VARIANT.small : HEADLINE_VARIANT[size],
139
152
  children: headline
140
153
  });
141
154
  $[13] = collapse;
142
- $[14] = headline;
143
- $[15] = size;
144
- $[16] = t17;
145
- } else t17 = $[16];
146
- let t18;
147
- if ($[17] !== collapse || $[18] !== subtitle) {
148
- t18 = subtitle === void 0 || collapse ? null : /* @__PURE__ */ jsx(Text, {
155
+ $[14] = headingLevel;
156
+ $[15] = headline;
157
+ $[16] = size;
158
+ $[17] = t18;
159
+ } else t18 = $[17];
160
+ let t19;
161
+ if ($[18] !== collapse || $[19] !== subtitle) {
162
+ t19 = subtitle === void 0 || collapse ? null : /* @__PURE__ */ jsx(Text, {
149
163
  render: PARAGRAPH,
150
164
  tone: "muted",
151
165
  variant: "bodyMedium",
152
166
  children: subtitle
153
167
  });
154
- $[17] = collapse;
155
- $[18] = subtitle;
156
- $[19] = t18;
157
- } else t18 = $[19];
158
- let t19;
159
- if ($[20] !== t16 || $[21] !== t17 || $[22] !== t18) {
160
- t19 = /* @__PURE__ */ jsxs("div", {
161
- ...t16,
162
- children: [t17, t18]
168
+ $[18] = collapse;
169
+ $[19] = subtitle;
170
+ $[20] = t19;
171
+ } else t19 = $[20];
172
+ let t20;
173
+ if ($[21] !== t17 || $[22] !== t18 || $[23] !== t19) {
174
+ t20 = /* @__PURE__ */ jsxs("div", {
175
+ ...t17,
176
+ children: [t18, t19]
163
177
  });
164
- $[20] = t16;
165
178
  $[21] = t17;
166
179
  $[22] = t18;
167
180
  $[23] = t19;
168
- } else t19 = $[23];
169
- let t20;
170
- if ($[24] !== trailing) {
171
- t20 = trailing === void 0 ? null : /* @__PURE__ */ jsx("div", {
181
+ $[24] = t20;
182
+ } else t20 = $[24];
183
+ let t21;
184
+ if ($[25] !== trailing) {
185
+ t21 = trailing === void 0 ? null : /* @__PURE__ */ jsx("div", {
172
186
  className: "x6s0dn4 x78zum5 x2lah0s xzoy561",
173
187
  children: trailing
174
188
  });
175
- $[24] = trailing;
176
- $[25] = t20;
177
- } else t20 = $[25];
178
- if ($[26] !== t13 || $[27] !== t14 || $[28] !== t19 || $[29] !== t20) {
189
+ $[25] = trailing;
190
+ $[26] = t21;
191
+ } else t21 = $[26];
192
+ if ($[27] !== t14 || $[28] !== t15 || $[29] !== t20 || $[30] !== t21) {
179
193
  t2 = /* @__PURE__ */ jsxs("div", {
180
- ...t13,
194
+ ...t14,
181
195
  children: [
182
- t14,
183
- t19,
184
- t20
196
+ t15,
197
+ t20,
198
+ t21
185
199
  ]
186
200
  });
187
- $[26] = t13;
188
201
  $[27] = t14;
189
- $[28] = t19;
202
+ $[28] = t15;
190
203
  $[29] = t20;
191
- $[30] = t2;
192
- } else t2 = $[30];
204
+ $[30] = t21;
205
+ $[31] = t2;
206
+ } else t2 = $[31];
193
207
  t3 = mergeStyles(props(styles.root, heightStyles.root(height), scrolled && styles.scrolled), props$1);
194
208
  $[0] = t0;
195
209
  $[1] = render;
@@ -207,29 +221,29 @@ function AppBar(t0) {
207
221
  t5 = $[6];
208
222
  }
209
223
  let t6;
210
- if ($[31] !== t1 || $[32] !== t2 || $[33] !== t3) {
224
+ if ($[32] !== t1 || $[33] !== t2 || $[34] !== t3) {
211
225
  t6 = {
212
226
  ...t1,
213
227
  children: t2,
214
228
  ...t3
215
229
  };
216
- $[31] = t1;
217
- $[32] = t2;
218
- $[33] = t3;
219
- $[34] = t6;
220
- } else t6 = $[34];
230
+ $[32] = t1;
231
+ $[33] = t2;
232
+ $[34] = t3;
233
+ $[35] = t6;
234
+ } else t6 = $[35];
221
235
  let t7;
222
- if ($[35] !== render || $[36] !== t4 || $[37] !== t6) {
236
+ if ($[36] !== render || $[37] !== t4 || $[38] !== t6) {
223
237
  t7 = {
224
238
  defaultTagName: t4,
225
239
  props: t6,
226
240
  render
227
241
  };
228
- $[35] = render;
229
- $[36] = t4;
230
- $[37] = t6;
231
- $[38] = t7;
232
- } else t7 = $[38];
242
+ $[36] = render;
243
+ $[37] = t4;
244
+ $[38] = t6;
245
+ $[39] = t7;
246
+ } else t7 = $[39];
233
247
  return t5(t7);
234
248
  }
235
249
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["ReactNode","stylex","RenderComponentProps","useRender","mergeStyles","colors","motion","spacing","Text","HEADLINE_OFFSET","DEFAULT_CONTENT_INSET","HEIGHTS","large","plain","withSubtitle","medium","small","const","COLLAPSED_HEIGHT","styles","root","kGNEyG","kWkggS","kB7OPa","k1xSpc","kjj79g","kIyJzY","k1ekBW","kAMwcw","$$css","row","kOIVth","kzqmXN","kUOVxO","scrolled","HEADLINE_VARIANT","HEADING_1","PARAGRAPH","_temp","kAzted","heightStyles","minBlockSize","val","undefined","_temp2","ks0D6T","kg3NbH","rowStyles","contentInset","maxInlineSize","AppBarProps","Omit","align","collapsed","contentMaxInlineSize","headline","leading","size","subtitle","trailing","AppBar","t0","$","_c","render","t1","t2","t3","t4","t5","t6","t7","t8","t9","t10","t11","t12","props","collapse","expandedHeight","height","t13","t14","t15","Symbol","for","0","className","1","t16","t17","t18","t19","t20","children","defaultTagName"],"sources":["../../../src/components/app-bar/index.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport type { RenderComponentProps } from '../../render/useRender';\nimport { useRender } from '../../render/useRender';\nimport { mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, motion, spacing } from '../../tokens/design.tokens.stylex';\nimport Text from '../text';\n\n// Material Design's app bar, in the three sizes the spec recommends.\n//\n// `medium` and `large` are Material Design's *flexible* bars, the newer of the\n// two sets the spec gives and the one it recommends, which is why the short\n// names are theirs.\n//\n// Material Design also merged the old center-aligned variant into small as a\n// configuration rather than a variant, which is why alignment is a prop here\n// and applies to every size.\n//\n// Heights are Material Design's, and they are minimums rather than fixed. The\n// spec says the flexible bars \"hug the text contents\" and gives them multi-line\n// support and text wrapping, so a headline long enough to wrap has to be able\n// to make its bar taller. Fixing the height would truncate exactly the case\n// the variant was redesigned for.\n\n// How far the headline sits inside whatever comes before it, and the figure\n// an icon button's glyph is inset from the edge of its own touch target.\n// Material Design leans on the two agreeing, which is what makes a bar with a\n// leading icon and one without start their text in the same place.\nconst HEADLINE_OFFSET = '12px';\n\n// Where the bar's visible content starts by default, which is Material\n// Design's own margin for a top app bar and the same margin its body content\n// takes.\nconst DEFAULT_CONTENT_INSET = '16px';\nconst HEIGHTS = {\n large: {\n plain: '120px',\n withSubtitle: '152px'\n },\n medium: {\n plain: '112px',\n withSubtitle: '136px'\n },\n small: {\n plain: '64px',\n withSubtitle: '64px'\n }\n} as const;\n\n// What a flexible bar collapses to, which is the small bar exactly. Material\n// Design does not describe the collapsed large bar as a state of its own — it\n// describes it as becoming the small bar, which is why this reads off the same\n// table rather than being a fourth height.\nconst COLLAPSED_HEIGHT = HEIGHTS.small.plain;\nconst styles = {\n root: {\n kGNEyG: \"x6s0dn4\",\n kWkggS: \"x14s9m32\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"x78zum5\",\n kjj79g: \"xl56j7k\",\n kIyJzY: \"xioksi3\",\n k1ekBW: \"x8u3r54\",\n kAMwcw: \"x1seskgd\",\n $$css: true\n },\n row: {\n kGNEyG: \"x6s0dn4\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"x78zum5\",\n kOIVth: \"xzoy561\",\n kzqmXN: \"xh8yej3\",\n kUOVxO: \"xvueqy4\",\n $$css: true\n },\n scrolled: {\n kWkggS: \"x1mjdul6\",\n $$css: true\n }\n};\n\n// One entry per size, and each names a type role rather than a figure.\n// Material Design's own tokens are `md.comp.app-bar.<size>.title.font`,\n// aliases onto the type scale rather than sizes of their own, so this maps to\n// the scale the same way and lets Text apply it.\nconst HEADLINE_VARIANT = {\n large: 'headlineMedium',\n medium: 'headlineSmall',\n small: 'titleLarge'\n} as const;\n\n// The headline is the page's title in Material Design's model, so it is the\n// page's <h1>. A bar nested somewhere that already has one can pass its own\n// heading as `headline` instead.\n// oxlint-disable-next-line jsx-a11y/heading-has-content -- filled by useRender\nconst HEADING_1 = <h1 />;\nconst PARAGRAPH = <p />;\n\n// Height is the one value the call site does not choose, and it depends on two\n// props at once, so it is a function style rather than one key per\n// combination. StyleX writes it to a custom property inline, the same\n// mechanism Feed uses for its cell minimum.\nconst _temp = {\n kAzted: \"x1chvrdh\",\n \"$$css\": true\n};\nconst heightStyles = {\n root: (minBlockSize: string) => [_temp, {\n \"--x-minBlockSize\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(minBlockSize)\n }]\n};\n\n// The row's measure and inset both come from the call site, so both are\n// function styles too. The inset is where the bar's visible content starts,\n// and the row carries `contentInset` minus the offset the text block already\n// holds — which is what keeps a leading icon's glyph and a headline with no\n// icon before it starting in the same place.\nconst _temp2 = {\n ks0D6T: \"x13i5qev\",\n kg3NbH: \"x30g6up\",\n \"$$css\": true\n};\nconst rowStyles = {\n root: (contentInset: string, maxInlineSize: string) => [_temp2, {\n \"--x-maxInlineSize\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(maxInlineSize),\n \"--x-paddingInline\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(`calc(${contentInset} - ${HEADLINE_OFFSET})`)\n }]\n};\ntype AppBarProps = Omit<RenderComponentProps<'header'>, 'children'> & {\n /**\n * Which of Material Design's alignments the text takes. `center` is the\n * configuration that replaced the old center-aligned variant.\n * @default 'start'\n */\n align?: 'center' | 'start';\n /**\n * Collapses a flexible bar to the height and headline of the small one, for\n * a pinned bar over content that has been scrolled. Material Design\n * specifies it for the flexible sizes, and without it a pinned `large` costs\n * 152px of the viewport for as long as the page is open.\n *\n * Controlled, and for the same reason `scrolled` is: only the app knows\n * which element scrolls, and how far into it the bar should have finished\n * collapsing. Usually set from the same handler.\n *\n * Ignored on `small`, which is already the height this collapses to. The\n * subtitle goes with the height, since there is no room for a second line\n * in the small bar.\n *\n * **The scroll container needs `overflow-anchor: none`.** Collapsing hands\n * the page back the height the bar gives up, and browsers answer a change\n * in height above the viewport by moving the scroll offset by exactly that\n * amount, so the content underneath stays where it was. That offset is\n * what the call site derived `collapsed` from, so it lands back under the\n * threshold, the bar expands, the offset is restored, and the two take\n * turns for as long as the reader stays in that band. Turning anchoring off\n * is what breaks the loop, and it is also the movement you want: the\n * content follows the bar's bottom edge up rather than standing still while\n * the bar shrinks behind it.\n *\n * No threshold avoids this on its own. The unstable band is as tall as the\n * height the bar gives back and it sits directly above wherever the\n * threshold is put, so moving the threshold moves the band with it.\n * @default false\n */\n collapsed?: boolean;\n /**\n * Where the bar's content starts, measured to the headline. A leading slot\n * sits 12px before that, which is the room an icon button's own padding\n * fills around its glyph — Material Design's arrangement, and what makes a\n * bar with an icon and one without start their text in the same place.\n *\n * The default is Material Design's own margin for a top app bar, which is\n * also the margin it gives body content, so a bar and the page beneath line\n * up without either being told about the other. Set it to the page's gutter\n * where that differs.\n * @default '16px'\n */\n contentInset?: string;\n /**\n * How wide the bar's contents may run before they stop growing, with the\n * row centred in whatever is left. The bar's own surface still paints edge\n * to edge.\n *\n * This is what lines a full-bleed bar up with a page whose content sits in\n * a measure: give it the page's measure, and `contentInset` the page's\n * gutter. Unset, the row is as wide as the bar.\n */\n contentMaxInlineSize?: string;\n /** The page's title. Wraps rather than truncating, and grows the bar with it. */\n headline?: ReactNode;\n /** Usually a back or menu icon button. Sits before the text. */\n leading?: ReactNode;\n /**\n * Whether the content beneath has been scrolled. Material Design separates\n * a bar from scrolled content with a fill colour rather than a shadow, and\n * this is what applies it.\n *\n * Controlled, with no listener of its own: only the app knows which element\n * scrolls, and a bar that watched the window would be wrong inside every\n * pane and dialog that scrolls independently.\n * @default false\n */\n scrolled?: boolean;\n /**\n * Height and headline size. `medium` and `large` are Material Design's\n * flexible bars, which hug their text.\n * @default 'small'\n */\n size?: 'large' | 'medium' | 'small';\n /** A second line under the headline. Makes `medium` and `large` taller. */\n subtitle?: ReactNode;\n /** Actions, at the far end. Usually icon buttons. */\n trailing?: ReactNode;\n};\n\n/**\n * Material Design's app bar: the container at the top of a page carrying its\n * title, one or two actions, and the way back out.\n *\n * Three sizes. `small` is a fixed 64px bar for a page whose title is a label;\n * `medium` and `large` are the flexible bars, which give the headline a larger\n * type role and grow to fit a subtitle or a headline that wraps.\n *\n * It paints its own surface, unlike the layout components, because separating\n * itself from the content beneath is the job — which is also why `scrolled`\n * and `collapsed` exist. Neither watches the page: only the app knows which\n * element scrolls, so both are set from its own scroll handler.\n */\nfunction AppBar({\n align = 'start',\n collapsed = false,\n contentInset = DEFAULT_CONTENT_INSET,\n contentMaxInlineSize = 'none',\n headline,\n leading,\n render,\n scrolled = false,\n size = 'small',\n subtitle,\n trailing,\n ...props\n}: AppBarProps) {\n // `small` is already what the flexible bars collapse to, so collapsing it is\n // a no-op rather than an error. A bar whose size is chosen at the call site\n // from a breakpoint would otherwise have to guard the prop as well.\n const collapse = collapsed && size !== 'small';\n const expandedHeight = subtitle === undefined || subtitle === null ? HEIGHTS[size].plain : HEIGHTS[size].withSubtitle;\n const height = collapse ? COLLAPSED_HEIGHT : expandedHeight;\n return useRender({\n defaultTagName: 'header',\n props: {\n ...props,\n children: <div {...stylex.props(styles.row, rowStyles.root(contentInset, contentMaxInlineSize))}>\n {leading === undefined ? null : <div className=\"x6s0dn4 x78zum5 x2lah0s xzoy561\">{leading}</div>}\n <div {...{\n 0: {\n className: \"x9f619 x78zum5 xdt5ytf x1iyjqo2 xl56j7k xeuugli x1cmllll xaope02\"\n },\n 1: {\n className: \"x9f619 x78zum5 xdt5ytf x1iyjqo2 xl56j7k xeuugli x1cmllll xaope02 x2b8uid\"\n }\n }[!!(align === 'center') << 0]}>\n {headline === undefined ? null : <Text className=\"xioksi3 x1nxaspg x1seskgd\" render={HEADING_1} variant={collapse ? HEADLINE_VARIANT.small : HEADLINE_VARIANT[size]}>\n {headline}\n </Text>}\n {subtitle === undefined || collapse ? null : <Text render={PARAGRAPH} tone=\"muted\" variant=\"bodyMedium\">\n {subtitle}\n </Text>}\n </div>\n {trailing === undefined ? null : <div className=\"x6s0dn4 x78zum5 x2lah0s xzoy561\">{trailing}</div>}\n </div>,\n ...mergeStyles(stylex.props(styles.root, heightStyles.root(height), scrolled && styles.scrolled), props)\n },\n render\n });\n}\nexport type { AppBarProps };\nexport default AppBar;"],"mappings":";;;;;;;AA6BA,MAAMS,kBAAkB;AAKxB,MAAMC,wBAAwB;AAC9B,MAAMC,UAAU;CACdC,OAAO;EACLC,OAAO;EACPC,cAAc;CAChB;CACAC,QAAQ;EACNF,OAAO;EACPC,cAAc;CAChB;CACAE,OAAO;EACLH,OAAO;EACPC,cAAc;CAChB;AACF;AAMA,MAAMI,mBAAmBP,QAAQK,MAAMH;AACvC,MAAMM,SAAS;CACbC,MAAM;EACJC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,KAAK;EACHT,QAAQ;EACRE,QAAQ;EACRC,QAAQ;EACRO,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRJ,OAAO;CACT;CACAK,UAAU;EACRZ,QAAQ;EACRO,OAAO;CACT;AACF;AAMA,MAAMM,mBAAmB;CACvBvB,OAAO;CACPG,QAAQ;CACRC,OAAO;AACT;AAMA,MAAMoB,YAAY,oBAAC,MAAD,CAAG,CAAA;AACrB,MAAMC,YAAY,oBAAC,KAAD,CAAE,CAAA;AAMpB,MAAMC,QAAQ;CACZC,QAAQ;CACR,SAAS;AACX;AACA,MAAMC,eAAe,EACnBpB,OAAOqB,iBAAyB,CAACH,OAAO,EACtC,sBAAqBI,QAAO,OAAOA,QAAQ,WAAWA,MAAM,OAAOA,OAAO,OAAOA,MAAMC,KAAAA,EAAAA,CAAWF,YAAY,EAChH,CAAC,EACH;AAOA,MAAMG,SAAS;CACbC,QAAQ;CACRC,QAAQ;CACR,SAAS;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M;EAAAN,EAAA,KAAAO;CAAA,OAAA;EAAAL,SAAAF,EAAA;EAAAG,KAAAH,EAAA;EAAAI,KAAAJ,EAAA;EAAAK,KAAAL,EAAA;EAAAM,KAAAN,EAAA;EAAAO,KAAAP,EAAA;CAAA;CAAA,IAAAQ;CAAA,IAAAR,EAAA,QAAAG,MAAAH,EAAA,QAAAI,MAAAJ,EAAA,QAAAK,IAAA;EArBnGG,KAAA;GAAA,GACFO;GAAKiB,UACE5B;GAkBF,GACLC;EACL;EAACL,EAAA,MAAAG;EAAAH,EAAA,MAAAI;EAAAJ,EAAA,MAAAK;EAAAL,EAAA,MAAAQ;CAAA,OAAAA,KAAAR,EAAA;CAAA,IAAAS;CAAA,IAAAT,EAAA,QAAAE,UAAAF,EAAA,QAAAM,MAAAN,EAAA,QAAAQ,IAAA;EAxBcC,KAAA;GAAAwB,gBACC3B;GAAQS,OACjBP;GAsBNN;EAEH;EAACF,EAAA,MAAAE;EAAAF,EAAA,MAAAM;EAAAN,EAAA,MAAAQ;EAAAR,EAAA,MAAAS;CAAA,OAAAA,KAAAT,EAAA;CAAA,OA1BM3D,GAAUoE,EA0BhB;AAAC"}
1
+ {"version":3,"file":"index.js","names":["ReactNode","stylex","createElement","RenderComponentProps","useRender","mergeStyles","colors","motion","spacing","Text","HEADLINE_OFFSET","DEFAULT_CONTENT_INSET","HEIGHTS","large","plain","withSubtitle","medium","small","const","COLLAPSED_HEIGHT","styles","root","kGNEyG","kWkggS","kB7OPa","k1xSpc","kjj79g","kIyJzY","k1ekBW","kAMwcw","$$css","row","kOIVth","kzqmXN","kUOVxO","scrolled","HEADLINE_VARIANT","HEADINGS","heading","level","index","Math","min","max","round","length","PARAGRAPH","_temp","kAzted","heightStyles","minBlockSize","val","undefined","_temp2","ks0D6T","kg3NbH","rowStyles","contentInset","maxInlineSize","AppBarProps","Omit","align","collapsed","contentMaxInlineSize","headingLevel","headline","leading","size","subtitle","trailing","AppBar","t0","$","_c","render","t1","t2","t3","t4","t5","t6","t7","t8","t9","t10","t11","t12","t13","props","collapse","expandedHeight","height","t14","t15","t16","Symbol","for","0","className","1","t17","t18","t19","t20","t21","children","defaultTagName"],"sources":["../../../src/components/app-bar/index.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { createElement } from 'react';\nimport type { RenderComponentProps } from '../../render/useRender';\nimport { useRender } from '../../render/useRender';\nimport { mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, motion, spacing } from '../../tokens/design.tokens.stylex';\nimport Text from '../text';\n\n// Material Design's app bar, in the three sizes the spec recommends.\n//\n// `medium` and `large` are Material Design's *flexible* bars, the newer of the\n// two sets the spec gives and the one it recommends, which is why the short\n// names are theirs.\n//\n// Material Design also merged the old center-aligned variant into small as a\n// configuration rather than a variant, which is why alignment is a prop here\n// and applies to every size.\n//\n// Heights are Material Design's, and they are minimums rather than fixed. The\n// spec says the flexible bars \"hug the text contents\" and gives them multi-line\n// support and text wrapping, so a headline long enough to wrap has to be able\n// to make its bar taller. Fixing the height would truncate exactly the case\n// the variant was redesigned for.\n\n// How far the headline sits inside whatever comes before it, and the figure\n// an icon button's glyph is inset from the edge of its own touch target.\n// Material Design leans on the two agreeing, which is what makes a bar with a\n// leading icon and one without start their text in the same place.\nconst HEADLINE_OFFSET = '12px';\n\n// Where the bar's visible content starts by default, which is Material\n// Design's own margin for a top app bar and the same margin its body content\n// takes.\nconst DEFAULT_CONTENT_INSET = '16px';\nconst HEIGHTS = {\n large: {\n plain: '120px',\n withSubtitle: '152px'\n },\n medium: {\n plain: '112px',\n withSubtitle: '136px'\n },\n small: {\n plain: '64px',\n withSubtitle: '64px'\n }\n} as const;\n\n// What a flexible bar collapses to, which is the small bar exactly. Material\n// Design does not describe the collapsed large bar as a state of its own — it\n// describes it as becoming the small bar, which is why this reads off the same\n// table rather than being a fourth height.\nconst COLLAPSED_HEIGHT = HEIGHTS.small.plain;\nconst styles = {\n root: {\n kGNEyG: \"x6s0dn4\",\n kWkggS: \"x14s9m32\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"x78zum5\",\n kjj79g: \"xl56j7k\",\n kIyJzY: \"xioksi3\",\n k1ekBW: \"x8u3r54\",\n kAMwcw: \"x1seskgd\",\n $$css: true\n },\n row: {\n kGNEyG: \"x6s0dn4\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"x78zum5\",\n kOIVth: \"xzoy561\",\n kzqmXN: \"xh8yej3\",\n kUOVxO: \"xvueqy4\",\n $$css: true\n },\n scrolled: {\n kWkggS: \"x1mjdul6\",\n $$css: true\n }\n};\n\n// One entry per size, and each names a type role rather than a figure.\n// Material Design's own tokens are `md.comp.app-bar.<size>.title.font`,\n// aliases onto the type scale rather than sizes of their own, so this maps to\n// the scale the same way and lets Text apply it.\nconst HEADLINE_VARIANT = {\n large: 'headlineMedium',\n medium: 'headlineSmall',\n small: 'titleLarge'\n} as const;\n\n// The headline is the page's title in Material Design's model, so it is the\n// page's <h1> unless the call site says otherwise. `headingLevel` is what says\n// otherwise, and a bar drawn beside another bar — one per pane in a\n// `ListDetail` or a `SupportingPane` — or under a page heading of its own\n// should lower it.\n//\n// Built here rather than kept as a constant per level: `headline` becomes the\n// heading's children, so a call site cannot demote the heading by passing one\n// of its own. `headline={<h2>…</h2>}` renders an h2 inside the h1 — two\n// headings where one was wanted, which React does not warn about.\n//\n// The level is looked up rather than interpolated into a tag name. `h7` is a\n// custom element as far as React is concerned, so it renders without a word\n// said and leaves the outline worse than the default would have. Disclosure's\n// own `headingLevel` hands the number to React Aria, which is why that one\n// needs no equivalent.\nconst HEADINGS = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'] as const;\nfunction heading(level: number) {\n const index = Math.min(Math.max(Math.round(level), 1), HEADINGS.length) - 1;\n return createElement(HEADINGS[index]);\n}\nconst PARAGRAPH = <p />;\n\n// Height is the one value the call site does not choose, and it depends on two\n// props at once, so it is a function style rather than one key per\n// combination. StyleX writes it to a custom property inline, the same\n// mechanism Feed uses for its cell minimum.\nconst _temp = {\n kAzted: \"x1chvrdh\",\n \"$$css\": true\n};\nconst heightStyles = {\n root: (minBlockSize: string) => [_temp, {\n \"--x-minBlockSize\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(minBlockSize)\n }]\n};\n\n// The row's measure and inset both come from the call site, so both are\n// function styles too. The inset is where the bar's visible content starts,\n// and the row carries `contentInset` minus the offset the text block already\n// holds — which is what keeps a leading icon's glyph and a headline with no\n// icon before it starting in the same place.\nconst _temp2 = {\n ks0D6T: \"x13i5qev\",\n kg3NbH: \"x30g6up\",\n \"$$css\": true\n};\nconst rowStyles = {\n root: (contentInset: string, maxInlineSize: string) => [_temp2, {\n \"--x-maxInlineSize\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(maxInlineSize),\n \"--x-paddingInline\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(`calc(${contentInset} - ${HEADLINE_OFFSET})`)\n }]\n};\ntype AppBarProps = Omit<RenderComponentProps<'header'>, 'children'> & {\n /**\n * Which of Material Design's alignments the text takes. `center` is the\n * configuration that replaced the old center-aligned variant.\n * @default 'start'\n */\n align?: 'center' | 'start';\n /**\n * Collapses a flexible bar to the height and headline of the small one, for\n * a pinned bar over content that has been scrolled. Material Design\n * specifies it for the flexible sizes, and without it a pinned `large` costs\n * 152px of the viewport for as long as the page is open.\n *\n * Controlled, and for the same reason `scrolled` is: only the app knows\n * which element scrolls, and how far into it the bar should have finished\n * collapsing. Usually set from the same handler.\n *\n * Ignored on `small`, which is already the height this collapses to. The\n * subtitle goes with the height, since there is no room for a second line\n * in the small bar.\n *\n * **The scroll container needs `overflow-anchor: none`.** Collapsing hands\n * the page back the height the bar gives up, and browsers answer a change\n * in height above the viewport by moving the scroll offset by exactly that\n * amount, so the content underneath stays where it was. That offset is\n * what the call site derived `collapsed` from, so it lands back under the\n * threshold, the bar expands, the offset is restored, and the two take\n * turns for as long as the reader stays in that band. Turning anchoring off\n * is what breaks the loop, and it is also the movement you want: the\n * content follows the bar's bottom edge up rather than standing still while\n * the bar shrinks behind it.\n *\n * No threshold avoids this on its own. The unstable band is as tall as the\n * height the bar gives back and it sits directly above wherever the\n * threshold is put, so moving the threshold moves the band with it.\n * @default false\n */\n collapsed?: boolean;\n /**\n * Where the bar's content starts, measured to the headline. A leading slot\n * sits 12px before that, which is the room an icon button's own padding\n * fills around its glyph — Material Design's arrangement, and what makes a\n * bar with an icon and one without start their text in the same place.\n *\n * The default is Material Design's own margin for a top app bar, which is\n * also the margin it gives body content, so a bar and the page beneath line\n * up without either being told about the other. Set it to the page's gutter\n * where that differs.\n * @default '16px'\n */\n contentInset?: string;\n /**\n * How wide the bar's contents may run before they stop growing, with the\n * row centred in whatever is left. The bar's own surface still paints edge\n * to edge.\n *\n * This is what lines a full-bleed bar up with a page whose content sits in\n * a measure: give it the page's measure, and `contentInset` the page's\n * gutter. Unset, the row is as wide as the bar.\n */\n contentMaxInlineSize?: string;\n /**\n * Where the headline sits in the page's outline. A screen reader moves\n * between headings, so a bar drawn beside another bar, or under a page\n * heading of its own, should lower it.\n * @default 1\n */\n headingLevel?: number;\n /** The page's title. Wraps rather than truncating, and grows the bar with it. */\n headline?: ReactNode;\n /** Usually a back or menu icon button. Sits before the text. */\n leading?: ReactNode;\n /**\n * Whether the content beneath has been scrolled. Material Design separates\n * a bar from scrolled content with a fill colour rather than a shadow, and\n * this is what applies it.\n *\n * Controlled, with no listener of its own: only the app knows which element\n * scrolls, and a bar that watched the window would be wrong inside every\n * pane and dialog that scrolls independently.\n * @default false\n */\n scrolled?: boolean;\n /**\n * Height and headline size. `medium` and `large` are Material Design's\n * flexible bars, which hug their text.\n * @default 'small'\n */\n size?: 'large' | 'medium' | 'small';\n /** A second line under the headline. Makes `medium` and `large` taller. */\n subtitle?: ReactNode;\n /** Actions, at the far end. Usually icon buttons. */\n trailing?: ReactNode;\n};\n\n/**\n * Material Design's app bar: the container at the top of a page carrying its\n * title, one or two actions, and the way back out.\n *\n * Three sizes. `small` is a fixed 64px bar for a page whose title is a label;\n * `medium` and `large` are the flexible bars, which give the headline a larger\n * type role and grow to fit a subtitle or a headline that wraps.\n *\n * It paints its own surface, unlike the layout components, because separating\n * itself from the content beneath is the job — which is also why `scrolled`\n * and `collapsed` exist. Neither watches the page: only the app knows which\n * element scrolls, so both are set from its own scroll handler.\n */\nfunction AppBar({\n align = 'start',\n collapsed = false,\n contentInset = DEFAULT_CONTENT_INSET,\n contentMaxInlineSize = 'none',\n headingLevel = 1,\n headline,\n leading,\n render,\n scrolled = false,\n size = 'small',\n subtitle,\n trailing,\n ...props\n}: AppBarProps) {\n // `small` is already what the flexible bars collapse to, so collapsing it is\n // a no-op rather than an error. A bar whose size is chosen at the call site\n // from a breakpoint would otherwise have to guard the prop as well.\n const collapse = collapsed && size !== 'small';\n const expandedHeight = subtitle === undefined || subtitle === null ? HEIGHTS[size].plain : HEIGHTS[size].withSubtitle;\n const height = collapse ? COLLAPSED_HEIGHT : expandedHeight;\n return useRender({\n defaultTagName: 'header',\n props: {\n ...props,\n children: <div {...stylex.props(styles.row, rowStyles.root(contentInset, contentMaxInlineSize))}>\n {leading === undefined ? null : <div className=\"x6s0dn4 x78zum5 x2lah0s xzoy561\">{leading}</div>}\n <div {...{\n 0: {\n className: \"x9f619 x78zum5 xdt5ytf x1iyjqo2 xl56j7k xeuugli x1cmllll xaope02\"\n },\n 1: {\n className: \"x9f619 x78zum5 xdt5ytf x1iyjqo2 xl56j7k xeuugli x1cmllll xaope02 x2b8uid\"\n }\n }[!!(align === 'center') << 0]}>\n {headline === undefined ? null : <Text className=\"xioksi3 x1nxaspg x1seskgd\" render={heading(headingLevel)} variant={collapse ? HEADLINE_VARIANT.small : HEADLINE_VARIANT[size]}>\n {headline}\n </Text>}\n {subtitle === undefined || collapse ? null : <Text render={PARAGRAPH} tone=\"muted\" variant=\"bodyMedium\">\n {subtitle}\n </Text>}\n </div>\n {trailing === undefined ? null : <div className=\"x6s0dn4 x78zum5 x2lah0s xzoy561\">{trailing}</div>}\n </div>,\n ...mergeStyles(stylex.props(styles.root, heightStyles.root(height), scrolled && styles.scrolled), props)\n },\n render\n });\n}\nexport type { AppBarProps };\nexport default AppBar;"],"mappings":";;;;;;;;AA8BA,MAAMU,kBAAkB;AAKxB,MAAMC,wBAAwB;AAC9B,MAAMC,UAAU;CACdC,OAAO;EACLC,OAAO;EACPC,cAAc;CAChB;CACAC,QAAQ;EACNF,OAAO;EACPC,cAAc;CAChB;CACAE,OAAO;EACLH,OAAO;EACPC,cAAc;CAChB;AACF;AAMA,MAAMI,mBAAmBP,QAAQK,MAAMH;AACvC,MAAMM,SAAS;CACbC,MAAM;EACJC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,KAAK;EACHT,QAAQ;EACRE,QAAQ;EACRC,QAAQ;EACRO,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRJ,OAAO;CACT;CACAK,UAAU;EACRZ,QAAQ;EACRO,OAAO;CACT;AACF;AAMA,MAAMM,mBAAmB;CACvBvB,OAAO;CACPG,QAAQ;CACRC,OAAO;AACT;AAkBA,MAAMoB,WAAW;CAAC;CAAM;CAAM;CAAM;CAAM;CAAM;AAAI;AACpD,SAASC,QAAQC,OAAe;CAC9B,MAAMC,QAAQC,KAAKC,IAAID,KAAKE,IAAIF,KAAKG,MAAML,KAAK,GAAG,CAAC,GAAGF,SAASQ,MAAM,IAAI;CAC1E,OAAO3C,cAAcmC,SAASG,MAAM;AACtC;AACA,MAAMM,YAAY,oBAAC,KAAD,CAAE,CAAA;AAMpB,MAAMC,QAAQ;CACZC,QAAQ;CACR,SAAS;AACX;AACA,MAAMC,eAAe,EACnB5B,OAAO6B,iBAAyB,CAACH,OAAO,EACtC,sBAAqBI,QAAO,OAAOA,QAAQ,WAAWA,MAAM,OAAOA,OAAO,OAAOA,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KAAAxE,YAAYJ,MAAamB,OAAMC,MAAO4B,aAAY5B,KAAMsE,MAAM,GAAGxD,YAAYf,OAAMe,QAAS,GAAGqD,OAAK;EAAChB,EAAA,KAAAD;EAAAC,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAI;EAAAJ,EAAA,KAAAK;EAAAL,EAAA,KAAAM;EAAAN,EAAA,KAAAO;CAAA,OAAA;EAAAL,SAAAF,EAAA;EAAAG,KAAAH,EAAA;EAAAI,KAAAJ,EAAA;EAAAK,KAAAL,EAAA;EAAAM,KAAAN,EAAA;EAAAO,KAAAP,EAAA;CAAA;CAAA,IAAAQ;CAAA,IAAAR,EAAA,QAAAG,MAAAH,EAAA,QAAAI,MAAAJ,EAAA,QAAAK,IAAA;EArBnGG,KAAA;GAAA,GACFQ;GAAKiB,UACE7B;GAkBF,GACLC;EACL;EAACL,EAAA,MAAAG;EAAAH,EAAA,MAAAI;EAAAJ,EAAA,MAAAK;EAAAL,EAAA,MAAAQ;CAAA,OAAAA,KAAAR,EAAA;CAAA,IAAAS;CAAA,IAAAT,EAAA,QAAAE,UAAAF,EAAA,QAAAM,MAAAN,EAAA,QAAAQ,IAAA;EAxBcC,KAAA;GAAAyB,gBACC5B;GAAQU,OACjBR;GAsBNN;EAEH;EAACF,EAAA,MAAAE;EAAAF,EAAA,MAAAM;EAAAN,EAAA,MAAAQ;EAAAR,EAAA,MAAAS;CAAA,OAAAA,KAAAT,EAAA;CAAA,OA1BMpE,GAAU6E,EA0BhB;AAAC"}
@@ -1,7 +1,7 @@
1
1
  import { CSSProperties } from "react";
2
2
  import { FormProps } from "react-aria-components";
3
3
  //#region src/components/form/index.d.ts
4
- type FormProps$1 = Omit<FormProps, 'className' | 'style'> & {
4
+ type FormProps$1 = {
5
5
  className?: string;
6
6
  style?: CSSProperties;
7
7
  /**
@@ -10,10 +10,17 @@ type FormProps$1 = Omit<FormProps, 'className' | 'style'> & {
10
10
  * regardless. `native` hands validation to the browser: a required or
11
11
  * malformed field blocks submission, and its message is the browser's
12
12
  * own, shown once submission is tried.
13
+ *
14
+ * Under `aria`, moving focus after a server answers is the call site's.
15
+ * The errors are associated — `aria-invalid` on each control, the message
16
+ * in its `aria-describedby` — but nothing moves and nothing is read out,
17
+ * because no part of the form knows a round trip happened. `validationErrors`
18
+ * is a prop rather than an event, so a form cannot tell a submission coming
19
+ * back from a first render that was given errors to begin with.
13
20
  * @default 'aria'
14
21
  */
15
22
  validationBehavior?: 'aria' | 'native';
16
- };
23
+ } & Omit<FormProps, 'className' | 'style'>;
17
24
  /**
18
25
  * A form: the fields inside it and what they are told about validation. Pass
19
26
  * `validationErrors`, an object keyed by field `name`, to show what a server
@@ -22,6 +29,10 @@ type FormProps$1 = Omit<FormProps, 'className' | 'style'> & {
22
29
  * the submit event; call `preventDefault` on it to handle the submission
23
30
  * yourself, and read the values from `new FormData(event.currentTarget)`.
24
31
  *
32
+ * Handing `validationErrors` back from a submission is where a reader has to
33
+ * be told something arrived: see `validationBehavior` for what the form does
34
+ * and what it leaves to the call site.
35
+ *
25
36
  * The call site's `className` and `style` land on the form element, which is
26
37
  * the element a layout positions.
27
38
  */
@@ -12,6 +12,10 @@ import { Form } from "react-aria-components";
12
12
  * the submit event; call `preventDefault` on it to handle the submission
13
13
  * yourself, and read the values from `new FormData(event.currentTarget)`.
14
14
  *
15
+ * Handing `validationErrors` back from a submission is where a reader has to
16
+ * be told something arrived: see `validationBehavior` for what the form does
17
+ * and what it leaves to the call site.
18
+ *
15
19
  * The call site's `className` and `style` land on the form element, which is
16
20
  * the element a layout positions.
17
21
  */
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["CSSProperties","FormProps","RACFormProps","stylex","Form","RACForm","FIELD_VALIDATION_BEHAVIOR","mergeStyles","Omit","className","style","validationBehavior","t0","$","_c","T0","t1","t2","t3","t4","props","undefined"],"sources":["../../../src/components/form/index.tsx"],"sourcesContent":["import type { CSSProperties } from 'react';\nimport type { FormProps as RACFormProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { Form as RACForm } from 'react-aria-components';\nimport { FIELD_VALIDATION_BEHAVIOR } from '../../field/root';\nimport { mergeStyles } from '../../styles/merge';\n\n// No page of its own: a form is the fields inside it, and the text fields\n// page is what each of them draws — the error a form reports lands in the\n// field's supporting text, in the error role, under the box. The form\n// draws nothing, and lays nothing out either; a Stack inside it is what\n// spaces the fields.\n//\n// React Aria's `Form` is the element. It hands two things to the fields\n// inside it through context: `validationErrors`, keyed by each field's\n// `name`, which is how a server's answer reaches the fields without any of\n// them changing, and `validationBehavior`, which every field reads in place\n// of its own default. React Aria's own default for that is `native`; the\n// library's is `aria`, set here so a form and a field agree, with `native`\n// the opt-in.\n\ntype FormProps = Omit<RACFormProps, 'className' | 'style'> & {\n className?: string;\n style?: CSSProperties;\n /**\n * How the fields inside validate. `aria` marks a field invalid and shows\n * its message as soon as the field says so, and lets the form submit\n * regardless. `native` hands validation to the browser: a required or\n * malformed field blocks submission, and its message is the browser's\n * own, shown once submission is tried.\n * @default 'aria'\n */\n validationBehavior?: 'aria' | 'native';\n};\n\n/**\n * A form: the fields inside it and what they are told about validation. Pass\n * `validationErrors`, an object keyed by field `name`, to show what a server\n * sent back under each field, and `validationBehavior=\"native\"` to let the\n * browser's own constraint validation block submission. `onSubmit` is handed\n * the submit event; call `preventDefault` on it to handle the submission\n * yourself, and read the values from `new FormData(event.currentTarget)`.\n *\n * The call site's `className` and `style` land on the form element, which is\n * the element a layout positions.\n */\nfunction Form({\n validationBehavior = FIELD_VALIDATION_BEHAVIOR,\n ...props\n}: FormProps) {\n return <RACForm validationBehavior={validationBehavior} {...props} {...mergeStyles({\n className: \"x9f619\"\n }, props)} />;\n}\nexport type { FormProps };\nexport default Form;"],"mappings":";;;;;;;;;;;;;;;;;AA8CA,SAAAI,OAAAQ,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAL,EAAA,OAAAD,IAAA;EAAc,MAAA,EAAAD,oBAAAQ,IAAA,GAAAC,UAAAR;EACZ,MAAAD,qBAAAQ,OAAAE,KAAAA,IAAAf,4BAAAa;EAGQJ,KAAAV;EAA4BM,KAAAA;EAAwBS,KAAAA;EAAWF,KAAAX,YAAY,EAAAE,WACtE,SACb,GAAGW,KAAK;EAACP,EAAA,KAAAD;EAAAC,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAI;EAAAJ,EAAA,KAAAK;CAAA,OAAA;EAAAH,KAAAF,EAAA;EAAAG,KAAAH,EAAA;EAAAI,KAAAJ,EAAA;EAAAK,KAAAL,EAAA;CAAA;CAAA,IAAAM;CAAA,IAAAN,EAAA,OAAAE,MAAAF,EAAA,OAAAG,MAAAH,EAAA,OAAAI,MAAAJ,EAAA,OAAAK,IAAA;EAFFC,KAAA,oBAAC,IAAD;GAA6BR,oBAAAA;GAAkB,GAAMS;GAAK,GAAMF;EAE9D,CAAA;EAAIL,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAI;EAAAJ,EAAA,KAAAK;EAAAL,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CAAA,OAFNM;AAEM"}
1
+ {"version":3,"file":"index.js","names":["CSSProperties","FormProps","RACFormProps","stylex","Form","RACForm","FIELD_VALIDATION_BEHAVIOR","mergeStyles","className","style","validationBehavior","Omit","t0","$","_c","T0","t1","t2","t3","t4","props","undefined"],"sources":["../../../src/components/form/index.tsx"],"sourcesContent":["import type { CSSProperties } from 'react';\nimport type { FormProps as RACFormProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { Form as RACForm } from 'react-aria-components';\nimport { FIELD_VALIDATION_BEHAVIOR } from '../../field/root';\nimport { mergeStyles } from '../../styles/merge';\n\n// No page of its own: a form is the fields inside it, and the text fields\n// page is what each of them draws — the error a form reports lands in the\n// field's supporting text, in the error role, under the box. The form\n// draws nothing, and lays nothing out either; a Stack inside it is what\n// spaces the fields.\n//\n// React Aria's `Form` is the element. It hands two things to the fields\n// inside it through context: `validationErrors`, keyed by each field's\n// `name`, which is how a server's answer reaches the fields without any of\n// them changing, and `validationBehavior`, which every field reads in place\n// of its own default. React Aria's own default for that is `native`; the\n// library's is `aria`, set here so a form and a field agree, with `native`\n// the opt-in.\n\ntype FormProps = {\n className?: string;\n style?: CSSProperties;\n /**\n * How the fields inside validate. `aria` marks a field invalid and shows\n * its message as soon as the field says so, and lets the form submit\n * regardless. `native` hands validation to the browser: a required or\n * malformed field blocks submission, and its message is the browser's\n * own, shown once submission is tried.\n *\n * Under `aria`, moving focus after a server answers is the call site's.\n * The errors are associated — `aria-invalid` on each control, the message\n * in its `aria-describedby` — but nothing moves and nothing is read out,\n * because no part of the form knows a round trip happened. `validationErrors`\n * is a prop rather than an event, so a form cannot tell a submission coming\n * back from a first render that was given errors to begin with.\n * @default 'aria'\n */\n validationBehavior?: 'aria' | 'native';\n} & Omit<RACFormProps, 'className' | 'style'>;\n\n/**\n * A form: the fields inside it and what they are told about validation. Pass\n * `validationErrors`, an object keyed by field `name`, to show what a server\n * sent back under each field, and `validationBehavior=\"native\"` to let the\n * browser's own constraint validation block submission. `onSubmit` is handed\n * the submit event; call `preventDefault` on it to handle the submission\n * yourself, and read the values from `new FormData(event.currentTarget)`.\n *\n * Handing `validationErrors` back from a submission is where a reader has to\n * be told something arrived: see `validationBehavior` for what the form does\n * and what it leaves to the call site.\n *\n * The call site's `className` and `style` land on the form element, which is\n * the element a layout positions.\n */\nfunction Form({\n validationBehavior = FIELD_VALIDATION_BEHAVIOR,\n ...props\n}: FormProps) {\n return <RACForm validationBehavior={validationBehavior} {...props} {...mergeStyles({\n className: \"x9f619\"\n }, props)} />;\n}\nexport type { FormProps };\nexport default Form;"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAyDA,SAAAI,OAAAQ,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAL,EAAA,OAAAD,IAAA;EAAc,MAAA,EAAAF,oBAAAS,IAAA,GAAAC,UAAAR;EACZ,MAAAF,qBAAAS,OAAAE,KAAAA,IAAAf,4BAAAa;EAGQJ,KAAAV;EAA4BK,KAAAA;EAAwBU,KAAAA;EAAWF,KAAAX,YAAY,EAAAC,WACtE,SACb,GAAGY,KAAK;EAACP,EAAA,KAAAD;EAAAC,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAI;EAAAJ,EAAA,KAAAK;CAAA,OAAA;EAAAH,KAAAF,EAAA;EAAAG,KAAAH,EAAA;EAAAI,KAAAJ,EAAA;EAAAK,KAAAL,EAAA;CAAA;CAAA,IAAAM;CAAA,IAAAN,EAAA,OAAAE,MAAAF,EAAA,OAAAG,MAAAH,EAAA,OAAAI,MAAAJ,EAAA,OAAAK,IAAA;EAFFC,KAAA,oBAAC,IAAD;GAA6BT,oBAAAA;GAAkB,GAAMU;GAAK,GAAMF;EAE9D,CAAA;EAAIL,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAI;EAAAJ,EAAA,KAAAK;EAAAL,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CAAA,OAFNM;AAEM"}
@@ -33,7 +33,7 @@ import Form, { FormProps } from "./form/index.js";
33
33
  import IconButton, { IconButtonProps } from "./icon-button/index.js";
34
34
  import Keycap, { KeycapProps } from "./keycap/index.js";
35
35
  import Link, { LinkProps } from "./link/index.js";
36
- import List, { ListProps } from "./list/index.js";
36
+ import List, { ListLoadMoreProps, ListProps, ListRowProps, ListSectionProps } from "./list/index.js";
37
37
  import ListBox, { ListBoxProps } from "./list-box/index.js";
38
38
  import ListDetail, { ListDetailProps } from "./list-detail/index.js";
39
39
  import ListItem, { ListItemProps } from "./list-item/index.js";
@@ -67,4 +67,4 @@ import TokenField, { TokenFieldProps } from "./token-field/index.js";
67
67
  import Toolbar, { ToolbarProps } from "./toolbar/index.js";
68
68
  import Tooltip, { TooltipProps } from "./tooltip/index.js";
69
69
  import Tree, { TreeHeaderProps, TreeItemProps, TreeLoadMoreProps, TreeProps, TreeSectionProps } from "./tree/index.js";
70
- export { AppBar, type AppBarProps, Autocomplete, type AutocompleteProps, Avatar, type AvatarProps, Breadcrumbs, type BreadcrumbsProps, Button, type ButtonProps, Calendar, type CalendarProps, Card, type CardProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, Chip, ChipGroup, type ChipGroupProps, type ChipProps, Code, type CodeProps, ColorArea, type ColorAreaProps, ColorField, type ColorFieldProps, ColorPicker, type ColorPickerProps, ColorSlider, type ColorSliderProps, ColorSwatch, ColorSwatchPicker, type ColorSwatchPickerProps, type ColorSwatchProps, ColorWheel, type ColorWheelProps, ComboBox, type ComboBoxProps, Container, type ContainerProps, CopyField, type CopyFieldProps, Currency, type CurrencyProps, DateField, type DateFieldProps, DatePicker, type DatePickerProps, DateRangePicker, type DateRangePickerProps, Dialog, type DialogProps, Disclosure, DisclosureGroup, type DisclosureGroupProps, type DisclosureProps, DropZone, type DropZoneProps, Feed, type FeedProps, FileTrigger, type FileTriggerProps, Form, type FormProps, IconButton, type IconButtonProps, Keycap, type KeycapProps, Link, type LinkProps, List, ListBox, type ListBoxProps, ListDetail, type ListDetailProps, ListItem, type ListItemProps, type ListProps, Menu, type MenuProps, Meter, type MeterProps, NavigationTree, type NavigationTreeHeaderProps, type NavigationTreeItemProps, type NavigationTreeProps, type NavigationTreeSectionProps, NumberField, type NumberFieldProps, Popover, type PopoverProps, ProductIcon, type ProductIconProps, ProgressIndicator, type ProgressIndicatorProps, Radio, RadioGroup, type RadioGroupProps, type RadioProps, RangeCalendar, type RangeCalendarProps, SearchField, type SearchFieldProps, SegmentedButton, type SegmentedButtonProps, type SegmentedButtonSegmentProps, Select, type SelectProps, Separator, type SeparatorProps, Sheet, type SheetProps, Slider, type SliderProps, Snackbar, type SnackbarProps, Stack, type StackAlign, type StackGap, type StackJustify, type StackProps, SupportingPane, type SupportingPaneProps, Switch, type SwitchProps, Table, type TableBodyProps, type TableCellProps, type TableColumnProps, type TableFooterProps, type TableHeaderProps, type TableProps, type TableRowProps, Tabs, type TabsProps, Tag, type TagProps, Text, TextArea, type TextAreaProps, TextField, type TextFieldProps, type TextProps, TimeField, type TimeFieldProps, TokenField, type TokenFieldProps, Toolbar, type ToolbarProps, Tooltip, type TooltipProps, Tree, type TreeHeaderProps, type TreeItemProps, type TreeLoadMoreProps, type TreeProps, type TreeSectionProps };
70
+ export { AppBar, type AppBarProps, Autocomplete, type AutocompleteProps, Avatar, type AvatarProps, Breadcrumbs, type BreadcrumbsProps, Button, type ButtonProps, Calendar, type CalendarProps, Card, type CardProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, Chip, ChipGroup, type ChipGroupProps, type ChipProps, Code, type CodeProps, ColorArea, type ColorAreaProps, ColorField, type ColorFieldProps, ColorPicker, type ColorPickerProps, ColorSlider, type ColorSliderProps, ColorSwatch, ColorSwatchPicker, type ColorSwatchPickerProps, type ColorSwatchProps, ColorWheel, type ColorWheelProps, ComboBox, type ComboBoxProps, Container, type ContainerProps, CopyField, type CopyFieldProps, Currency, type CurrencyProps, DateField, type DateFieldProps, DatePicker, type DatePickerProps, DateRangePicker, type DateRangePickerProps, Dialog, type DialogProps, Disclosure, DisclosureGroup, type DisclosureGroupProps, type DisclosureProps, DropZone, type DropZoneProps, Feed, type FeedProps, FileTrigger, type FileTriggerProps, Form, type FormProps, IconButton, type IconButtonProps, Keycap, type KeycapProps, Link, type LinkProps, List, ListBox, type ListBoxProps, ListDetail, type ListDetailProps, ListItem, type ListItemProps, type ListLoadMoreProps, type ListProps, type ListRowProps, type ListSectionProps, Menu, type MenuProps, Meter, type MeterProps, NavigationTree, type NavigationTreeHeaderProps, type NavigationTreeItemProps, type NavigationTreeProps, type NavigationTreeSectionProps, NumberField, type NumberFieldProps, Popover, type PopoverProps, ProductIcon, type ProductIconProps, ProgressIndicator, type ProgressIndicatorProps, Radio, RadioGroup, type RadioGroupProps, type RadioProps, RangeCalendar, type RangeCalendarProps, SearchField, type SearchFieldProps, SegmentedButton, type SegmentedButtonProps, type SegmentedButtonSegmentProps, Select, type SelectProps, Separator, type SeparatorProps, Sheet, type SheetProps, Slider, type SliderProps, Snackbar, type SnackbarProps, Stack, type StackAlign, type StackGap, type StackJustify, type StackProps, SupportingPane, type SupportingPaneProps, Switch, type SwitchProps, Table, type TableBodyProps, type TableCellProps, type TableColumnProps, type TableFooterProps, type TableHeaderProps, type TableProps, type TableRowProps, Tabs, type TabsProps, Tag, type TagProps, Text, TextArea, type TextAreaProps, TextField, type TextFieldProps, type TextProps, TimeField, type TimeFieldProps, TokenField, type TokenFieldProps, Toolbar, type ToolbarProps, Tooltip, type TooltipProps, Tree, type TreeHeaderProps, type TreeItemProps, type TreeLoadMoreProps, type TreeProps, type TreeSectionProps };
@@ -1,20 +1,6 @@
1
1
  import { ReactNode } from "react";
2
2
  import { GridListItemProps, GridListLoadMoreItemProps, GridListProps, GridListSectionProps } from "react-aria-components";
3
3
  //#region src/components/list/index.d.ts
4
- type ListItemProps<T extends object = object> = {
5
- /** The row's headline — the one thing it is mostly about. */
6
- children?: ReactNode;
7
- /** A function may compute the class from the row's render state. */
8
- className?: GridListItemProps<T>['className'];
9
- /** Content before the headline: an avatar, an icon. */
10
- leading?: ReactNode;
11
- /** A function may compute the style from the row's render state. */
12
- style?: GridListItemProps<T>['style'];
13
- /** A second line under the headline, in the muted role. */
14
- supporting?: ReactNode;
15
- /** Content after the headline, such as an amount or a control. */
16
- trailing?: ReactNode;
17
- } & Omit<GridListItemProps<T>, 'children' | 'className' | 'style'>;
18
4
  type ListLoadMoreProps = Omit<GridListLoadMoreItemProps, 'children'> & {
19
5
  /**
20
6
  * What the row says while it is loading. Read by a screen reader; the ring
@@ -35,6 +21,20 @@ type ListProps<T extends object> = Omit<GridListProps<T>, 'className' | 'style'>
35
21
  /** A function may compute the style from the list's render state. */
36
22
  style?: GridListProps<T>['style'];
37
23
  };
24
+ type ListRowProps<T extends object = object> = {
25
+ /** The row's headline — the one thing it is mostly about. */
26
+ children?: ReactNode;
27
+ /** A function may compute the class from the row's render state. */
28
+ className?: GridListItemProps<T>['className'];
29
+ /** Content before the headline: an avatar, an icon. */
30
+ leading?: ReactNode;
31
+ /** A function may compute the style from the row's render state. */
32
+ style?: GridListItemProps<T>['style'];
33
+ /** A second line under the headline, in the muted role. */
34
+ supporting?: ReactNode;
35
+ /** Content after the headline, such as an amount or a control. */
36
+ trailing?: ReactNode;
37
+ } & Omit<GridListItemProps<T>, 'children' | 'className' | 'style'>;
38
38
  type ListSectionProps<T extends object = object> = Omit<GridListSectionProps<T>, 'children'> & {
39
39
  /**
40
40
  * The rows in the section. A section built from data puts React Aria's
@@ -80,7 +80,7 @@ declare namespace List {
80
80
  * A list that selects with checkboxes draws one before whatever `leading`
81
81
  * holds, from the state React Aria reports rather than from a prop here.
82
82
  */
83
- declare function ListItem<T extends object = object>({ children, leading, supporting, textValue, trailing, ...props }: ListItemProps<T>): import("react").JSX.Element;
83
+ declare function ListItem<T extends object = object>({ children, leading, supporting, textValue, trailing, ...props }: ListRowProps<T>): import("react").JSX.Element;
84
84
  /**
85
85
  * The row the list shows while it is fetching more. React Aria calls
86
86
  * `onLoadMore` when this comes into view, and draws it only while
@@ -93,5 +93,5 @@ declare function ListLoadMore({ label, ...props }: ListLoadMoreProps): import("r
93
93
  */
94
94
  declare function ListSection<T extends object = object>({ children, header, ...props }: ListSectionProps<T>): import("react").JSX.Element;
95
95
  //#endregion
96
- export { type ListItemProps, type ListLoadMoreProps, type ListProps, type ListSectionProps, List as default };
96
+ export { type ListLoadMoreProps, type ListProps, type ListRowProps, type ListSectionProps, List as default };
97
97
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["ReactNode","GridListItemRenderProps","GridListItemProps","RACGridListItemProps","GridListLoadMoreItemProps","RACGridListLoadMoreItemProps","GridListProps","RACGridListProps","GridListSectionProps","RACGridListSectionProps","stylex","createContext","useContext","GridList","RACGridList","GridListHeader","RACGridListHeader","GridListItem","RACGridListItem","GridListLoadMoreItem","RACGridListLoadMoreItem","GridListSection","RACGridListSection","CollectionLoadMore","collectionStyles","rowItemStyles","RowContent","mergeStatefulStyles","mergeStyles","Checkbox","SelectLabelContext","ListItemProps","children","className","T","leading","style","supporting","trailing","Omit","ListLoadMoreProps","label","ListProps","selectLabel","ListSectionProps","header","itemContent","state","isDisabled","isSelected","leadingFor","selectionBehavior","selectionMode","List","t0","$","_c","T0","T1","t1","t2","t3","t4","props","undefined","container","t5","ListItem","textValue","textOf","ListLoadMore","loading","ListSection","section","Item","LoadMore","Section"],"sources":["../../../src/components/list/index.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type { GridListItemRenderProps, GridListItemProps as RACGridListItemProps, GridListLoadMoreItemProps as RACGridListLoadMoreItemProps, GridListProps as RACGridListProps, GridListSectionProps as RACGridListSectionProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { createContext, useContext } from 'react';\nimport { GridList as RACGridList, GridListHeader as RACGridListHeader, GridListItem as RACGridListItem, GridListLoadMoreItem as RACGridListLoadMoreItem, GridListSection as RACGridListSection } from 'react-aria-components';\nimport { CollectionLoadMore } from '../../collection';\nimport { collectionStyles, rowItemStyles } from '../../collection/styles';\nimport { RowContent } from '../../row';\nimport { mergeStatefulStyles, mergeStyles } from '../../styles/merge';\nimport Checkbox from '../checkbox';\n\n// The lists page's interactive list. Each row is the row every list here\n// draws — `src/row`, shared with ListItem and ListBox — so the 56dp floor,\n// the body-large headline, the body-medium supporting line, the state layers\n// and the disabled treatment are all that module's.\n//\n// ListItem is the static row: one row, on its own, presenting. This is the\n// collection that draws the same row and adds selection, keyboard navigation\n// between rows, sections and a load-more sentinel. A page with one row uses\n// ListItem; a page with a list of them uses this.\n//\n// It is ListBox's shape over a different React Aria primitive, and the\n// difference is what the primitive allows inside a row. A listbox option is\n// a leaf: a screen reader reads its text and nothing inside it can be\n// focused, so a row with a checkbox or a button in it is not an option. A\n// grid list's row is a row of cells, and its contents can be reached and\n// operated. That is what a list with a checkbox on every row needs, and it\n// is why this exists beside ListBox rather than instead of it.\n//\n// Three things are this component's own.\n//\n// **A selecting list draws a checkbox.** React Aria reports the selection\n// mode and behaviour on each row, so a list that toggles draws one without\n// the call site saying so on every item — and it is the library's Checkbox\n// rather than a glyph, so it looks like every other checkbox on the page.\n//\n// **The checkbox is drawn first, before whatever the row was given.** The\n// page draws it leading on a plain row and trailing beside an avatar; one\n// place, always the same, is what keeps a column of rows reading down.\n//\n// **Drag and drop passes straight through.** `dragAndDropHooks` is React\n// Aria's and is not wrapped, since what a list can be dropped on is the\n// page's business rather than the row's.\n\n// What each row's selection checkbox is called. A context rather than a prop\n// on the row, since it is the list's decision and repeating it on every row\n// is how the two drift.\nconst SelectLabelContext = createContext('Select');\ntype ListItemProps<T extends object = object> = {\n /** The row's headline — the one thing it is mostly about. */\n children?: ReactNode;\n /** A function may compute the class from the row's render state. */\n className?: RACGridListItemProps<T>['className'];\n /** Content before the headline: an avatar, an icon. */\n leading?: ReactNode;\n /** A function may compute the style from the row's render state. */\n style?: RACGridListItemProps<T>['style'];\n /** A second line under the headline, in the muted role. */\n supporting?: ReactNode;\n /** Content after the headline, such as an amount or a control. */\n trailing?: ReactNode;\n} & Omit<RACGridListItemProps<T>, 'children' | 'className' | 'style'>;\ntype ListLoadMoreProps = Omit<RACGridListLoadMoreItemProps, 'children'> & {\n /**\n * What the row says while it is loading. Read by a screen reader; the ring\n * itself carries no text.\n * @default 'Loading more'\n */\n label?: string;\n};\ntype ListProps<T extends object> = Omit<RACGridListProps<T>, 'className' | 'style'> & {\n /** A function may compute the class from the list's render state. */\n className?: RACGridListProps<T>['className'];\n /**\n * What each row's selection checkbox is called, for a screen reader. The\n * row's own text is what names the row; this names the box inside it.\n * @default 'Select'\n */\n selectLabel?: string;\n /** A function may compute the style from the list's render state. */\n style?: RACGridListProps<T>['style'];\n};\ntype ListSectionProps<T extends object = object> = Omit<RACGridListSectionProps<T>, 'children'> & {\n /**\n * The rows in the section. A section built from data puts React Aria's\n * `Collection` in here rather than a render function, since the header is\n * an element beside them.\n */\n children?: ReactNode;\n /**\n * The section's heading, rendered through React Aria's header so the\n * section is named by it. A section without one is a group with no name.\n */\n header?: ReactNode;\n};\n\n// What the row draws, from React Aria's render state. Built by a call rather\n// 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.\n//\n// The state decides two things: whether a selection checkbox is drawn, and\n// which colour the supporting line takes — the muted role holds only while\n// the row is drawn on the surface.\nfunction itemContent(children: ReactNode, leading: ReactNode, supporting: ReactNode, trailing: ReactNode, selectLabel: string) {\n return (state: GridListItemRenderProps) => <RowContent isDisabled={state.isDisabled} isSelected={state.isSelected} leading={leadingFor(state, leading, selectLabel)} supporting={supporting} trailing={trailing}>\n {children}\n </RowContent>;\n}\n\n// StyleX cannot target `[data-selected]` on the element it is styling, so a\n// row's state comes from the render state React Aria hands its className.\n// The order matters: `disabled` is applied last so it wins over both the\n// interactive and the selected branches, and StyleX replaces a property\n// whole, so it takes their hover states with it.\n//\n// A supporting line moves the row from the page's one-line container height\n// to its two-line one, which is a floor rather than something the row's own\n// box arrives at — see `twoLine` in `src/row/styles.ts`. Taken as an\n// argument rather than read from the render state, since React Aria reports\n// what a row is doing and not what it holds; the row is built by a call for\n// the same reason `itemContent` is.\n/**\n * The selection checkbox, then whatever the row was given. Its return type is\n * written out rather than inferred: `ReactNode` is a union that includes a\n * promise, and a function inferred as returning one has to be `async`.\n */\nfunction leadingFor(state: GridListItemRenderProps, leading: ReactNode, selectLabel: string): ReactNode {\n if (state.selectionBehavior !== 'toggle' || state.selectionMode === 'none') {\n return leading;\n }\n return <>\n <Checkbox aria-label={selectLabel} slot=\"selection\" />\n {leading}\n </>;\n}\n\n/**\n * A list of rows one or more of which can be selected. Selection is React\n * Aria's: set `selectionMode` to `single` or `multiple`, and pass\n * `selectedKeys` with `onSelectionChange` to control it or\n * `defaultSelectedKeys` to let it keep its own. A list that only responds to\n * a press takes `onAction` on the row instead.\n *\n * ListItem is the static row — one row, presenting, on its own. This is the\n * collection that draws the same row and adds selection, keyboard navigation\n * between rows, sections and a load-more sentinel.\n *\n * Composed from parts, since a row's slots take arbitrary content:\n * `List.Item`, `List.Section` and `List.LoadMore`. Name the list with\n * `aria-label` or `aria-labelledby` — nothing here labels it for you.\n *\n * The call site's `className` and `style` land on the container, which is\n * the element a layout positions.\n */\nfunction List<T extends object>({\n selectLabel = 'Select',\n ...props\n}: ListProps<T>) {\n return <SelectLabelContext value={selectLabel}>\n <RACGridList {...props} {...mergeStatefulStyles(stylex.props(collectionStyles.container), props)} />\n </SelectLabelContext>;\n}\n\n/**\n * One row. Its slots are the row's: `leading`, the headline as children,\n * `supporting` under it, and `trailing`. Give every row an `id` — that is\n * the key selection is reported by.\n *\n * A list that selects with checkboxes draws one before whatever `leading`\n * holds, from the state React Aria reports rather than from a prop here.\n */\nfunction ListItem<T extends object = object>({\n children,\n leading,\n supporting,\n textValue,\n trailing,\n ...props\n}: ListItemProps<T>) {\n const selectLabel = useContext(SelectLabelContext);\n return <RACGridListItem textValue={textValue ?? textOf(children)} {...props} {...mergeStatefulStyles(rowItemStyles(supporting), props)}>\n {itemContent(children, leading, supporting, trailing, selectLabel)}\n </RACGridListItem>;\n}\n\n/**\n * The row the list shows while it is fetching more. React Aria calls\n * `onLoadMore` when this comes into view, and draws it only while\n * `isLoading`.\n */\nfunction ListLoadMore({\n label = 'Loading more',\n ...props\n}: ListLoadMoreProps) {\n return <RACGridListLoadMoreItem {...props} {...mergeStyles(stylex.props(collectionStyles.loading), props)}>\n <CollectionLoadMore label={label} size=\"24px\" />\n </RACGridListLoadMoreItem>;\n}\n\n/**\n * A named group of rows. `header` names it, and is what a screen reader\n * reads before the rows inside.\n */\nfunction ListSection<T extends object = object>({\n children,\n header,\n ...props\n}: ListSectionProps<T>) {\n return <RACGridListSection {...props} {...mergeStyles(stylex.props(collectionStyles.section), props)}>\n {header === undefined ? null : <RACGridListHeader {...stylex.props(collectionStyles.header)}>\n {header}\n </RACGridListHeader>}\n {children}\n </RACGridListSection>;\n}\n\n// What the row is worth as text, for the thing React Aria does with a row's\n// words rather than its element: typeahead. It reads that off the children\n// when they are a string and finds nothing when they are not — and a row\n// here is always an element, since it wraps its headline. So a plain-string\n// headline becomes the text value, and anything else has to say what it is\n// worth through `textValue`.\nfunction textOf(children: ReactNode) {\n return typeof children === 'string' ? children : undefined;\n}\nList.Item = ListItem;\nList.LoadMore = ListLoadMore;\nList.Section = ListSection;\nexport type { ListItemProps, ListLoadMoreProps, ListProps, ListSectionProps };\nexport default List;"],"mappings":";;;;;;;;;;;AA+CA,MAAM8B,qBAAqBnB,cAAc,QAAQ;AAyDjD,SAASmC,YAAYd,UAAqBG,SAAoBE,YAAuBC,UAAqBK,aAAqB;CAC7H,QAAQI,UAAmC,oBAAC,YAAD;EAAY,YAAYA,MAAMC;EAAY,YAAYD,MAAME;EAAY,SAASC,WAAWH,OAAOZ,SAASQ,WAAW;EAAeN;EAAsBC;EAClMN;CACS,CAAA;AAChB;;;;;;AAmBA,SAASkB,WAAWH,OAAgCZ,SAAoBQ,aAAgC;CACtG,IAAII,MAAMI,sBAAsB,YAAYJ,MAAMK,kBAAkB,QAClE,OAAOjB;CAET,OAAO,qBAAA,YAAA,EAAA,UAAA,CACH,oBAAC,UAAD;EAAU,cAAYQ;EAAa,MAAK;CAAW,CAAA,GAClDR,OACH,EAAA,CAAA;AACJ;;;;;;;;;;;;;;;;;;;AAoBA,SAAAkB,KAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAN,EAAA,OAAAD,IAAA;EAAgC,MAAA,EAAAX,aAAAmB,IAAA,GAA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;EAAAuB,EAAA,KAAAV;EAAAU,EAAA,KAAAI;EAAAJ,EAAA,KAAAK;CAAA,OAAA;EAAAH,KAAAF,EAAA;EAAAvB,WAAAuB,EAAA;EAAAV,SAAAU,EAAA;EAAAI,KAAAJ,EAAA;EAAAK,KAAAL,EAAA;CAAA;CAAA,IAAAM;CAAA,IAAAN,EAAA,OAAAV,QAAA;EAC/FgB,KAAAhB,WAAWmB,KAAAA,IAAX,OAA8B,oBAAC,gBAAD;GAAkB,GAAKtD,MAAac,iBAAgBqB,MAAO;GACrFA,UAAAA;EAD4C,CAAA;EAE3BU,EAAA,KAAAV;EAAAU,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CAAA,IAAAO;CAAA,IAAAP,EAAA,OAAAE,MAAAF,EAAA,OAAAvB,YAAAuB,EAAA,QAAAI,MAAAJ,EAAA,QAAAK,MAAAL,EAAA,QAAAM,IAAA;EAHnBC,KAAA,qBAAC,IAAD;GAAmB,GAAKC;GAAK,GAAMH;GAAnC,UAAA,CACFC,IAGA7B,QAJqB;;EAKHuB,EAAA,KAAAE;EAAAF,EAAA,KAAAvB;EAAAuB,EAAA,MAAAI;EAAAJ,EAAA,MAAAK;EAAAL,EAAA,MAAAM;EAAAN,EAAA,MAAAO;CAAA,OAAAA,KAAAP,EAAA;CAAA,OALhBO;AAKgB;AASzB,SAASO,OAAOrC,UAAqB;CACnC,OAAO,OAAOA,aAAa,WAAWA,WAAWgC,KAAAA;AACnD;AACAX,KAAKqB,OAAOP;AACZd,KAAKsB,WAAWL;AAChBjB,KAAKuB,UAAUJ"}
1
+ {"version":3,"file":"index.js","names":["ReactNode","GridListItemRenderProps","GridListItemProps","RACGridListItemProps","GridListLoadMoreItemProps","RACGridListLoadMoreItemProps","GridListProps","RACGridListProps","GridListSectionProps","RACGridListSectionProps","stylex","createContext","useContext","GridList","RACGridList","GridListHeader","RACGridListHeader","GridListItem","RACGridListItem","GridListLoadMoreItem","RACGridListLoadMoreItem","GridListSection","RACGridListSection","CollectionLoadMore","collectionStyles","rowItemStyles","RowContent","mergeStatefulStyles","mergeStyles","Checkbox","SelectLabelContext","ListLoadMoreProps","Omit","label","ListProps","T","className","selectLabel","style","ListRowProps","children","leading","supporting","trailing","ListSectionProps","header","itemContent","state","isDisabled","isSelected","leadingFor","selectionBehavior","selectionMode","List","t0","$","_c","T0","T1","t1","t2","t3","t4","props","undefined","container","t5","ListItem","textValue","textOf","ListLoadMore","loading","ListSection","section","Item","LoadMore","Section"],"sources":["../../../src/components/list/index.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type { GridListItemRenderProps, GridListItemProps as RACGridListItemProps, GridListLoadMoreItemProps as RACGridListLoadMoreItemProps, GridListProps as RACGridListProps, GridListSectionProps as RACGridListSectionProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { createContext, useContext } from 'react';\nimport { GridList as RACGridList, GridListHeader as RACGridListHeader, GridListItem as RACGridListItem, GridListLoadMoreItem as RACGridListLoadMoreItem, GridListSection as RACGridListSection } from 'react-aria-components';\nimport { CollectionLoadMore } from '../../collection';\nimport { collectionStyles, rowItemStyles } from '../../collection/styles';\nimport { RowContent } from '../../row';\nimport { mergeStatefulStyles, mergeStyles } from '../../styles/merge';\nimport Checkbox from '../checkbox';\n\n// The lists page's interactive list. Each row is the row every list here\n// draws — `src/row`, shared with ListItem and ListBox — so the 56dp floor,\n// the body-large headline, the body-medium supporting line, the state layers\n// and the disabled treatment are all that module's.\n//\n// ListItem is the static row: one row, on its own, presenting. This is the\n// collection that draws the same row and adds selection, keyboard navigation\n// between rows, sections and a load-more sentinel. A page with one row uses\n// ListItem; a page with a list of them uses this.\n//\n// It is ListBox's shape over a different React Aria primitive, and the\n// difference is what the primitive allows inside a row. A listbox option is\n// a leaf: a screen reader reads its text and nothing inside it can be\n// focused, so a row with a checkbox or a button in it is not an option. A\n// grid list's row is a row of cells, and its contents can be reached and\n// operated. That is what a list with a checkbox on every row needs, and it\n// is why this exists beside ListBox rather than instead of it.\n//\n// Three things are this component's own.\n//\n// **A selecting list draws a checkbox.** React Aria reports the selection\n// mode and behaviour on each row, so a list that toggles draws one without\n// the call site saying so on every item — and it is the library's Checkbox\n// rather than a glyph, so it looks like every other checkbox on the page.\n//\n// **The checkbox is drawn first, before whatever the row was given.** The\n// page draws it leading on a plain row and trailing beside an avatar; one\n// place, always the same, is what keeps a column of rows reading down.\n//\n// **Drag and drop passes straight through.** `dragAndDropHooks` is React\n// Aria's and is not wrapped, since what a list can be dropped on is the\n// page's business rather than the row's.\n\n// What each row's selection checkbox is called. A context rather than a prop\n// on the row, since it is the list's decision and repeating it on every row\n// is how the two drift.\nconst SelectLabelContext = createContext('Select');\ntype ListLoadMoreProps = Omit<RACGridListLoadMoreItemProps, 'children'> & {\n /**\n * What the row says while it is loading. Read by a screen reader; the ring\n * itself carries no text.\n * @default 'Loading more'\n */\n label?: string;\n};\ntype ListProps<T extends object> = Omit<RACGridListProps<T>, 'className' | 'style'> & {\n /** A function may compute the class from the list's render state. */\n className?: RACGridListProps<T>['className'];\n /**\n * What each row's selection checkbox is called, for a screen reader. The\n * row's own text is what names the row; this names the box inside it.\n * @default 'Select'\n */\n selectLabel?: string;\n /** A function may compute the style from the list's render state. */\n style?: RACGridListProps<T>['style'];\n};\n\n// `Row` rather than `Item`, though the component is `List.Item`, because\n// `ListItemProps` is the standalone `ListItem` component's and both are\n// exported from the package. The two overlap on four props, so a call site\n// reaching for the obvious name got something that typechecked until it\n// passed `textValue`, and an error pointing at `onClick` rather than at the\n// name. `row` is what this file and `src/row` call the thing anyway.\ntype ListRowProps<T extends object = object> = {\n /** The row's headline — the one thing it is mostly about. */\n children?: ReactNode;\n /** A function may compute the class from the row's render state. */\n className?: RACGridListItemProps<T>['className'];\n /** Content before the headline: an avatar, an icon. */\n leading?: ReactNode;\n /** A function may compute the style from the row's render state. */\n style?: RACGridListItemProps<T>['style'];\n /** A second line under the headline, in the muted role. */\n supporting?: ReactNode;\n /** Content after the headline, such as an amount or a control. */\n trailing?: ReactNode;\n} & Omit<RACGridListItemProps<T>, 'children' | 'className' | 'style'>;\ntype ListSectionProps<T extends object = object> = Omit<RACGridListSectionProps<T>, 'children'> & {\n /**\n * The rows in the section. A section built from data puts React Aria's\n * `Collection` in here rather than a render function, since the header is\n * an element beside them.\n */\n children?: ReactNode;\n /**\n * The section's heading, rendered through React Aria's header so the\n * section is named by it. A section without one is a group with no name.\n */\n header?: ReactNode;\n};\n\n// What the row draws, from React Aria's render state. Built by a call rather\n// 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.\n//\n// The state decides two things: whether a selection checkbox is drawn, and\n// which colour the supporting line takes — the muted role holds only while\n// the row is drawn on the surface.\nfunction itemContent(children: ReactNode, leading: ReactNode, supporting: ReactNode, trailing: ReactNode, selectLabel: string) {\n return (state: GridListItemRenderProps) => <RowContent isDisabled={state.isDisabled} isSelected={state.isSelected} leading={leadingFor(state, leading, selectLabel)} supporting={supporting} trailing={trailing}>\n {children}\n </RowContent>;\n}\n\n// StyleX cannot target `[data-selected]` on the element it is styling, so a\n// row's state comes from the render state React Aria hands its className.\n// The order matters: `disabled` is applied last so it wins over both the\n// interactive and the selected branches, and StyleX replaces a property\n// whole, so it takes their hover states with it.\n//\n// A supporting line moves the row from the page's one-line container height\n// to its two-line one, which is a floor rather than something the row's own\n// box arrives at — see `twoLine` in `src/row/styles.ts`. Taken as an\n// argument rather than read from the render state, since React Aria reports\n// what a row is doing and not what it holds; the row is built by a call for\n// the same reason `itemContent` is.\n/**\n * The selection checkbox, then whatever the row was given. Its return type is\n * written out rather than inferred: `ReactNode` is a union that includes a\n * promise, and a function inferred as returning one has to be `async`.\n */\nfunction leadingFor(state: GridListItemRenderProps, leading: ReactNode, selectLabel: string): ReactNode {\n if (state.selectionBehavior !== 'toggle' || state.selectionMode === 'none') {\n return leading;\n }\n return <>\n <Checkbox aria-label={selectLabel} slot=\"selection\" />\n {leading}\n </>;\n}\n\n/**\n * A list of rows one or more of which can be selected. Selection is React\n * Aria's: set `selectionMode` to `single` or `multiple`, and pass\n * `selectedKeys` with `onSelectionChange` to control it or\n * `defaultSelectedKeys` to let it keep its own. A list that only responds to\n * a press takes `onAction` on the row instead.\n *\n * ListItem is the static row — one row, presenting, on its own. This is the\n * collection that draws the same row and adds selection, keyboard navigation\n * between rows, sections and a load-more sentinel.\n *\n * Composed from parts, since a row's slots take arbitrary content:\n * `List.Item`, `List.Section` and `List.LoadMore`. Name the list with\n * `aria-label` or `aria-labelledby` — nothing here labels it for you.\n *\n * The call site's `className` and `style` land on the container, which is\n * the element a layout positions.\n */\nfunction List<T extends object>({\n selectLabel = 'Select',\n ...props\n}: ListProps<T>) {\n return <SelectLabelContext value={selectLabel}>\n <RACGridList {...props} {...mergeStatefulStyles(stylex.props(collectionStyles.container), props)} />\n </SelectLabelContext>;\n}\n\n/**\n * One row. Its slots are the row's: `leading`, the headline as children,\n * `supporting` under it, and `trailing`. Give every row an `id` — that is\n * the key selection is reported by.\n *\n * A list that selects with checkboxes draws one before whatever `leading`\n * holds, from the state React Aria reports rather than from a prop here.\n */\nfunction ListItem<T extends object = object>({\n children,\n leading,\n supporting,\n textValue,\n trailing,\n ...props\n}: ListRowProps<T>) {\n const selectLabel = useContext(SelectLabelContext);\n return <RACGridListItem textValue={textValue ?? textOf(children)} {...props} {...mergeStatefulStyles(rowItemStyles(supporting), props)}>\n {itemContent(children, leading, supporting, trailing, selectLabel)}\n </RACGridListItem>;\n}\n\n/**\n * The row the list shows while it is fetching more. React Aria calls\n * `onLoadMore` when this comes into view, and draws it only while\n * `isLoading`.\n */\nfunction ListLoadMore({\n label = 'Loading more',\n ...props\n}: ListLoadMoreProps) {\n return <RACGridListLoadMoreItem {...props} {...mergeStyles(stylex.props(collectionStyles.loading), props)}>\n <CollectionLoadMore label={label} size=\"24px\" />\n </RACGridListLoadMoreItem>;\n}\n\n/**\n * A named group of rows. `header` names it, and is what a screen reader\n * reads before the rows inside.\n */\nfunction ListSection<T extends object = object>({\n children,\n header,\n ...props\n}: ListSectionProps<T>) {\n return <RACGridListSection {...props} {...mergeStyles(stylex.props(collectionStyles.section), props)}>\n {header === undefined ? null : <RACGridListHeader {...stylex.props(collectionStyles.header)}>\n {header}\n </RACGridListHeader>}\n {children}\n </RACGridListSection>;\n}\n\n// What the row is worth as text, for the thing React Aria does with a row's\n// words rather than its element: typeahead. It reads that off the children\n// when they are a string and finds nothing when they are not — and a row\n// here is always an element, since it wraps its headline. So a plain-string\n// headline becomes the text value, and anything else has to say what it is\n// worth through `textValue`.\nfunction textOf(children: ReactNode) {\n return typeof children === 'string' ? children : undefined;\n}\nList.Item = ListItem;\nList.LoadMore = ListLoadMore;\nList.Section = ListSection;\nexport type { ListLoadMoreProps, ListProps, ListRowProps, ListSectionProps };\nexport default List;"],"mappings":";;;;;;;;;;;AA+CA,MAAM8B,qBAAqBnB,cAAc,QAAQ;AAgEjD,SAASmC,YAAYN,UAAqBC,SAAoBC,YAAuBC,UAAqBN,aAAqB;CAC7H,QAAQU,UAAmC,oBAAC,YAAD;EAAY,YAAYA,MAAMC;EAAY,YAAYD,MAAME;EAAY,SAASC,WAAWH,OAAON,SAASJ,WAAW;EAAeK;EAAsBC;EAClMH;CACS,CAAA;AAChB;;;;;;AAmBA,SAASU,WAAWH,OAAgCN,SAAoBJ,aAAgC;CACtG,IAAIU,MAAMI,sBAAsB,YAAYJ,MAAMK,kBAAkB,QAClE,OAAOX;CAET,OAAO,qBAAA,YAAA,EAAA,UAAA,CACH,oBAAC,UAAD;EAAU,cAAYJ;EAAa,MAAK;CAAW,CAAA,GAClDI,OACH,EAAA,CAAA;AACJ;;;;;;;;;;;;;;;;;;;AAoBA,SAAAY,KAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAN,EAAA,OAAAD,IAAA;EAAgC,MAAA,EAAAjB,aAAAyB,I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f;EAAAe,EAAA,KAAAV;EAAAU,EAAA,KAAAI;EAAAJ,EAAA,KAAAK;CAAA,OAAA;EAAAH,KAAAF,EAAA;EAAAf,WAAAe,EAAA;EAAAV,SAAAU,EAAA;EAAAI,KAAAJ,EAAA;EAAAK,KAAAL,EAAA;CAAA;CAAA,IAAAM;CAAA,IAAAN,EAAA,OAAAV,QAAA;EAC/FgB,KAAAhB,WAAWmB,KAAAA,IAAX,OAA8B,oBAAC,gBAAD;GAAkB,GAAKtD,MAAac,iBAAgBqB,MAAO;GACrFA,UAAAA;EAD4C,CAAA;EAE3BU,EAAA,KAAAV;EAAAU,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CAAA,IAAAO;CAAA,IAAAP,EAAA,OAAAE,MAAAF,EAAA,OAAAf,YAAAe,EAAA,QAAAI,MAAAJ,EAAA,QAAAK,MAAAL,EAAA,QAAAM,IAAA;EAHnBC,KAAA,qBAAC,IAAD;GAAmB,GAAKC;GAAK,GAAMH;GAAnC,UAAA,CACFC,IAGArB,QAJqB;;EAKHe,EAAA,KAAAE;EAAAF,EAAA,KAAAf;EAAAe,EAAA,MAAAI;EAAAJ,EAAA,MAAAK;EAAAL,EAAA,MAAAM;EAAAN,EAAA,MAAAO;CAAA,OAAAA,KAAAP,EAAA;CAAA,OALhBO;AAKgB;AASzB,SAASO,OAAO7B,UAAqB;CACnC,OAAO,OAAOA,aAAa,WAAWA,WAAWwB,KAAAA;AACnD;AACAX,KAAKqB,OAAOP;AACZd,KAAKsB,WAAWL;AAChBjB,KAAKuB,UAAUJ"}
@@ -19,6 +19,15 @@ type ListDetailProps = {
19
19
  * Controlled, with no uncontrolled fallback: the layout cannot know that an
20
20
  * item was selected or that the reader went back, so holding that state
21
21
  * here would only ever be wrong.
22
+ *
23
+ * **Moving focus into the revealed pane comes with flipping this.** The
24
+ * pane being left is hidden outright, so a keyboard or screen reader inside
25
+ * it lands on the body and the next Tab starts from the top of the page.
26
+ * The same reason this prop is controlled is why the move is not made here:
27
+ * only the call site knows whether a key, a pointer or the history put it
28
+ * in that state, and what inside the pane to send focus to. Both panes hold
29
+ * nodes it supplied, so it has something to aim at — a heading given
30
+ * `tabIndex={-1}`, or a ref it already holds.
22
31
  * @default 'list'
23
32
  */
24
33
  showing?: 'detail' | 'list';
@@ -34,6 +43,11 @@ type ListDetailProps = {
34
43
  * The panes are written to the DOM in the order they are shown, which is what
35
44
  * Material Design asks of co-planar panes: focus order has to match the
36
45
  * arrangement on screen.
46
+ *
47
+ * Below the expanded breakpoint the pane that is not showing is hidden
48
+ * outright, so focus inside it is dropped when `showing` changes. The call
49
+ * site that changed it is what puts focus in the pane it revealed — see the
50
+ * prop.
37
51
  */
38
52
  declare function ListDetail({ detail, list, render, showing, ...props }: ListDetailProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
39
53
  //#endregion
@@ -14,6 +14,11 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
14
14
  * The panes are written to the DOM in the order they are shown, which is what
15
15
  * Material Design asks of co-planar panes: focus order has to match the
16
16
  * arrangement on screen.
17
+ *
18
+ * Below the expanded breakpoint the pane that is not showing is hidden
19
+ * outright, so focus inside it is dropped when `showing` changes. The call
20
+ * site that changed it is what puts focus in the pane it revealed — see the
21
+ * prop.
17
22
  */
18
23
  function ListDetail(t0) {
19
24
  const $ = c(26);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["ReactNode","stylex","RenderComponentProps","useRender","mergeStyles","media","spacing","LIST_PANE","LIST_PANE_EXTRA_LARGE","ListDetailProps","detail","list","showing","Omit","ListDetail","t0","$","_c","render","t1","t2","t3","t4","t5","t6","t7","props","undefined","t8","Symbol","for","0","className","1","t9","t10","t11","t12","t13","children","defaultTagName"],"sources":["../../../src/components/list-detail/index.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport type { RenderComponentProps } from '../../render/useRender';\nimport { useRender } from '../../render/useRender';\nimport { mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { media, spacing } from '../../tokens/design.tokens.stylex';\n\n// Material Design's recommended snap widths for a fixed pane. The list is the\n// fixed one here — Material Design points a fixed pane at \"lists with light\n// information density\" — and the detail pane is the flexible one that absorbs\n// whatever is left, which satisfies the spec's rule that every layout carry at\n// least one flexible pane.\nconst LIST_PANE = '360px';\nconst LIST_PANE_EXTRA_LARGE = '412px';\n\n// One of Material Design's canonical layouts, and the fixed-and-flexible shape\n// of its two-pane layouts. Unlike SupportingPane, the detail pane here stands\n// on its own: a message, a product, a file. That is what makes showing it\n// *instead of* the list a coherent thing to do when only one pane fits, and\n// why this layout has to be told which pane is showing while SupportingPane\n// does not.\n//\n// Material Design puts the second pane on screen from expanded up. Below that\n// the spec shows one pane at a time, with selecting an item swapping to the\n// detail and back returning to the list — app navigation rather than layout,\n// which is why `showing` is controlled rather than held here.\n\ntype ListDetailProps = {\n /**\n * The selected item's content. Stands on its own, and takes the flexible\n * pane.\n */\n detail?: ReactNode;\n /**\n * The items to choose between. Takes the fixed pane — 360px wide, 412px at\n * extra-large.\n */\n list?: ReactNode;\n /**\n * Which pane to show while only one fits, below the expanded breakpoint.\n * Both are shown from expanded up, where this is ignored.\n *\n * Controlled, with no uncontrolled fallback: the layout cannot know that an\n * item was selected or that the reader went back, so holding that state\n * here would only ever be wrong.\n * @default 'list'\n */\n showing?: 'detail' | 'list';\n} & Omit<RenderComponentProps<'div'>, 'children'>;\n\n/**\n * Material Design's list-detail layout: a fixed list pane beside a flexible\n * detail pane, collapsing to one pane at a time below the expanded breakpoint.\n *\n * Layout only — neither pane paints a surface of its own, so what goes inside\n * them is composed at the call site. `render` swaps the container's element,\n * for a layout that should be a `<main>` rather than a `<div>`.\n *\n * The panes are written to the DOM in the order they are shown, which is what\n * Material Design asks of co-planar panes: focus order has to match the\n * arrangement on screen.\n */\nfunction ListDetail({\n detail,\n list,\n render,\n showing = 'list',\n ...props\n}: ListDetailProps) {\n return useRender({\n defaultTagName: 'div',\n props: {\n ...props,\n children: <>\n <div {...{\n 0: {\n className: \"x9f619 xeuugli\"\n },\n 1: {\n className: \"x9f619 xeuugli x1s85apg x9a4l8x\"\n }\n }[!!(showing === 'detail') << 0]}>\n {list}\n </div>\n <div {...{\n 0: {\n className: \"x9f619 xeuugli\"\n },\n 1: {\n className: \"x9f619 xeuugli x1s85apg x9a4l8x\"\n }\n }[!!(showing === 'list') << 0]}>\n {detail}\n </div>\n </>,\n ...mergeStyles({\n className: \"x9f619 xrvj5dj xj2l1yv x1mkdm3x xkgydl7 xxxc7o5\"\n }, props)\n },\n render\n });\n}\nexport type { ListDetailProps };\nexport default ListDetail;"],"mappings":";;;;;;;;;;;;;;;;;AA+DA,SAAAc,WAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAP,EAAA,OAAAD,IAAA;EAAoB,MAAA,EAAAL,QAAAC,MAAAO,QAAAM,IAAAZ,SAAAa,IAAA,GAAAC,UAAAX;EAAAG,SAAAM;EAIlB,MAAAZ,UAAAa,OAAAE,KAAAA,IAAA,SAAAF;EAGOtB,KAAAA;EACWmB,KAAA;EAEXI,KAAAA;EAAK,IAAAE;EAAA,IAAAZ,EAAA,OAAAa,OAAAC,IAAA,2BAAA,GAAA;GAEKF,KAAA;IAAAG,GACN,EAAAC,WACU,iBACb;IAACC,GACE,EAAAD,WACU,kCACb;GACF;GAAChB,EAAA,KAAAY;EAAA,OAAAA,KAAAZ,EAAA;EAPU,MAAAkB,KAAAN,GAOT,CAAC,EAAEhB,YAAY,aAAa;EAAE,IAAAuB;EAAA,IAAAnB,EAAA,OAAAL,QAAAK,EAAA,OAAAkB,IAAA;GAP9BC,MAAA,oBAAA,OAAA;IASM,GATGD;IAQNvB,UAAAA;GACG,CAAA;GAAAK,EAAA,KAAAL;GAAAK,EAAA,KAAAkB;GAAAlB,E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AAAG;EAAAH,EAAA,MAAAI;EAAAJ,EAAA,MAAAK;EAAAL,EAAA,MAAAQ;CAAA,OAAAA,KAAAR,EAAA;CAAA,IAAAS;CAAA,IAAAT,EAAA,QAAAE,UAAAF,EAAA,QAAAM,MAAAN,EAAA,QAAAQ,IAAA;EA7BcC,KAAA;GAAAe,gBACClB;GAAKI,OACdF;GA2BNN;EAEH;EAACF,EAAA,MAAAE;EAAAF,EAAA,MAAAM;EAAAN,EAAA,MAAAQ;EAAAR,EAAA,MAAAS;CAAA,OAAAA,KAAAT,EAAA;CAAA,OA/BMb,GAAUsB,EA+BhB;AAAC"}
1
+ {"version":3,"file":"index.js","names":["ReactNode","stylex","RenderComponentProps","useRender","mergeStyles","media","spacing","LIST_PANE","LIST_PANE_EXTRA_LARGE","ListDetailProps","detail","list","showing","Omit","ListDetail","t0","$","_c","render","t1","t2","t3","t4","t5","t6","t7","props","undefined","t8","Symbol","for","0","className","1","t9","t10","t11","t12","t13","children","defaultTagName"],"sources":["../../../src/components/list-detail/index.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport type { RenderComponentProps } from '../../render/useRender';\nimport { useRender } from '../../render/useRender';\nimport { mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { media, spacing } from '../../tokens/design.tokens.stylex';\n\n// Material Design's recommended snap widths for a fixed pane. The list is the\n// fixed one here — Material Design points a fixed pane at \"lists with light\n// information density\" — and the detail pane is the flexible one that absorbs\n// whatever is left, which satisfies the spec's rule that every layout carry at\n// least one flexible pane.\nconst LIST_PANE = '360px';\nconst LIST_PANE_EXTRA_LARGE = '412px';\n\n// One of Material Design's canonical layouts, and the fixed-and-flexible shape\n// of its two-pane layouts. Unlike SupportingPane, the detail pane here stands\n// on its own: a message, a product, a file. That is what makes showing it\n// *instead of* the list a coherent thing to do when only one pane fits, and\n// why this layout has to be told which pane is showing while SupportingPane\n// does not.\n//\n// Material Design puts the second pane on screen from expanded up. Below that\n// the spec shows one pane at a time, with selecting an item swapping to the\n// detail and back returning to the list — app navigation rather than layout,\n// which is why `showing` is controlled rather than held here.\n\ntype ListDetailProps = {\n /**\n * The selected item's content. Stands on its own, and takes the flexible\n * pane.\n */\n detail?: ReactNode;\n /**\n * The items to choose between. Takes the fixed pane — 360px wide, 412px at\n * extra-large.\n */\n list?: ReactNode;\n /**\n * Which pane to show while only one fits, below the expanded breakpoint.\n * Both are shown from expanded up, where this is ignored.\n *\n * Controlled, with no uncontrolled fallback: the layout cannot know that an\n * item was selected or that the reader went back, so holding that state\n * here would only ever be wrong.\n *\n * **Moving focus into the revealed pane comes with flipping this.** The\n * pane being left is hidden outright, so a keyboard or screen reader inside\n * it lands on the body and the next Tab starts from the top of the page.\n * The same reason this prop is controlled is why the move is not made here:\n * only the call site knows whether a key, a pointer or the history put it\n * in that state, and what inside the pane to send focus to. Both panes hold\n * nodes it supplied, so it has something to aim at — a heading given\n * `tabIndex={-1}`, or a ref it already holds.\n * @default 'list'\n */\n showing?: 'detail' | 'list';\n} & Omit<RenderComponentProps<'div'>, 'children'>;\n\n/**\n * Material Design's list-detail layout: a fixed list pane beside a flexible\n * detail pane, collapsing to one pane at a time below the expanded breakpoint.\n *\n * Layout only — neither pane paints a surface of its own, so what goes inside\n * them is composed at the call site. `render` swaps the container's element,\n * for a layout that should be a `<main>` rather than a `<div>`.\n *\n * The panes are written to the DOM in the order they are shown, which is what\n * Material Design asks of co-planar panes: focus order has to match the\n * arrangement on screen.\n *\n * Below the expanded breakpoint the pane that is not showing is hidden\n * outright, so focus inside it is dropped when `showing` changes. The call\n * site that changed it is what puts focus in the pane it revealed — see the\n * prop.\n */\nfunction ListDetail({\n detail,\n list,\n render,\n showing = 'list',\n ...props\n}: ListDetailProps) {\n return useRender({\n defaultTagName: 'div',\n props: {\n ...props,\n children: <>\n <div {...{\n 0: {\n className: \"x9f619 xeuugli\"\n },\n 1: {\n className: \"x9f619 xeuugli x1s85apg x9a4l8x\"\n }\n }[!!(showing === 'detail') << 0]}>\n {list}\n </div>\n <div {...{\n 0: {\n className: \"x9f619 xeuugli\"\n },\n 1: {\n className: \"x9f619 xeuugli x1s85apg x9a4l8x\"\n }\n }[!!(showing === 'list') << 0]}>\n {detail}\n </div>\n </>,\n ...mergeStyles({\n className: \"x9f619 xrvj5dj xj2l1yv x1mkdm3x xkgydl7 xxxc7o5\"\n }, props)\n },\n render\n });\n}\nexport type { ListDetailProps };\nexport default ListDetail;"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA6EA,SAAAc,WAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAP,EAAA,OAAAD,IAAA;EAAoB,MAAA,EAAAL,QAAAC,MAAAO,QAAAM,IAAAZ,SAAAa,IAAA,GAAAC,UAAAX;EAAAG,SAAAM;EAIlB,MAAAZ,UAAAa,OAAAE,KAAAA,IAAA,SAAAF;EAGOtB,KAAAA;EACWmB,KAAA;EAEXI,KAAAA;EAAK,IAAAE;EAAA,IAAAZ,EAAA,OAAAa,OAAAC,IAAA,2BAAA,GAAA;GAEKF,KAAA;IAAAG,GACN,EAAAC,WACU,iBACb;IAACC,GACE,EAAAD,WACU,kCACb;GACF;GAAChB,EAAA,KAAAY;EAAA,OAAAA,KAAAZ,EAAA;EAPU,MAAAkB,KAAAN,GAOT,CAAC,EAAEhB,YAAY,aAAa;EAAE,IAAAuB;EAAA,IAAAnB,EAAA,OAAAL,QAAAK,EAAA,OAAAkB,IAAA;GAP9BC,MAAA,oBAAA,OAAA;IASM,GATGD;IAQNvB,UAAAA;GACG,CAAA;GAAAK,EAAA,KAAAL;GAAAK,EAAA,KAAAkB;GAAAlB,EAAA,MAAAmB;EAAA,OAAAA,MAAAnB,EAAA;EAAA,IAAAoB;EAAA,IAAApB,EAAA,QAAAa,OAAAC,IAAA,2BAAA,GAAA;GACG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AA,IAAAT,EAAA,QAAAE,UAAAF,EAAA,QAAAM,MAAAN,EAAA,QAAAQ,IAAA;EA7BcC,KAAA;GAAAe,gBACClB;GAAKI,OACdF;GA2BNN;EAEH;EAACF,EAAA,MAAAE;EAAAF,EAAA,MAAAM;EAAAN,EAAA,MAAAQ;EAAAR,EAAA,MAAAS;CAAA,OAAAA,KAAAT,EAAA;CAAA,OA/BMb,GAAUsB,EA+BhB;AAAC"}
@@ -47,6 +47,13 @@ type SnackbarProps = Omit<ToastRegionProps<SnackbarMessage>, 'children' | 'class
47
47
  'aria-label'?: string;
48
48
  /** A function may compute the class from the region's render state. */
49
49
  className?: ToastRegionProps<SnackbarMessage>['className'];
50
+ /**
51
+ * What a screen reader calls the button that dismisses a snackbar. It sits
52
+ * here rather than on a message's own options because it does not vary by
53
+ * message, so putting it there would make every `add` call repeat it.
54
+ * @default 'Close'
55
+ */
56
+ closeLabel?: string;
50
57
  /** The queue the region shows messages from. */
51
58
  queue: SnackbarQueue;
52
59
  /** A function may compute the style from the region's render state. */
@@ -99,7 +106,7 @@ declare class SnackbarQueue {
99
106
  * The call site's `className` and `style` land on that region, which is the
100
107
  * element a layout positions.
101
108
  */
102
- declare function Snackbar({ queue, ...props }: SnackbarProps): import("react").JSX.Element;
109
+ declare function Snackbar({ closeLabel, queue, ...props }: SnackbarProps): import("react").JSX.Element;
103
110
  declare namespace Snackbar {
104
111
  var Queue: typeof SnackbarQueue;
105
112
  }
@@ -121,53 +121,58 @@ function closeToast(queue, key) {
121
121
  * element a layout positions.
122
122
  */
123
123
  function Snackbar(t0) {
124
- const $ = c(14);
124
+ const $ = c(16);
125
125
  let T0;
126
+ let closeLabel;
126
127
  let queue;
127
128
  let t1;
128
129
  let t2;
129
130
  let t3;
130
131
  if ($[0] !== t0) {
131
- const { queue: t4, ...props } = t0;
132
- queue = t4;
132
+ const { closeLabel: t4, queue: t5, ...props } = t0;
133
+ queue = t5;
134
+ closeLabel = t4 === void 0 ? "Close" : t4;
133
135
  T0 = UNSTABLE_ToastRegion;
134
136
  t1 = queue.rac;
135
137
  t2 = props;
136
138
  t3 = mergeStatefulStyles({ className: "x6s0dn4 x9f619 x78zum5 xdt5ytf x126z3so x1ey2m1c x17y0mx6 x1t137rt x1a7rqcl x47corl xixxii4 xfo81ep" }, props);
137
139
  $[0] = t0;
138
140
  $[1] = T0;
139
- $[2] = queue;
140
- $[3] = t1;
141
- $[4] = t2;
142
- $[5] = t3;
141
+ $[2] = closeLabel;
142
+ $[3] = queue;
143
+ $[4] = t1;
144
+ $[5] = t2;
145
+ $[6] = t3;
143
146
  } else {
144
147
  T0 = $[1];
145
- queue = $[2];
146
- t1 = $[3];
147
- t2 = $[4];
148
- t3 = $[5];
148
+ closeLabel = $[2];
149
+ queue = $[3];
150
+ t1 = $[4];
151
+ t2 = $[5];
152
+ t3 = $[6];
149
153
  }
150
154
  let t4;
151
- if ($[6] !== queue) {
152
- t4 = snackbarContent(queue);
153
- $[6] = queue;
154
- $[7] = t4;
155
- } else t4 = $[7];
155
+ if ($[7] !== closeLabel || $[8] !== queue) {
156
+ t4 = snackbarContent(queue, closeLabel);
157
+ $[7] = closeLabel;
158
+ $[8] = queue;
159
+ $[9] = t4;
160
+ } else t4 = $[9];
156
161
  let t5;
157
- if ($[8] !== T0 || $[9] !== t1 || $[10] !== t2 || $[11] !== t3 || $[12] !== t4) {
162
+ if ($[10] !== T0 || $[11] !== t1 || $[12] !== t2 || $[13] !== t3 || $[14] !== t4) {
158
163
  t5 = /* @__PURE__ */ jsx(T0, {
159
164
  queue: t1,
160
165
  ...t2,
161
166
  ...t3,
162
167
  children: t4
163
168
  });
164
- $[8] = T0;
165
- $[9] = t1;
166
- $[10] = t2;
167
- $[11] = t3;
168
- $[12] = t4;
169
- $[13] = t5;
170
- } else t5 = $[13];
169
+ $[10] = T0;
170
+ $[11] = t1;
171
+ $[12] = t2;
172
+ $[13] = t3;
173
+ $[14] = t4;
174
+ $[15] = t5;
175
+ } else t5 = $[15];
171
176
  return t5;
172
177
  }
173
178
  /**
@@ -217,16 +222,17 @@ function SnackbarButton(t0) {
217
222
  } else t3 = $[11];
218
223
  return t3;
219
224
  }
220
- function snackbarContent(queue) {
225
+ function snackbarContent(queue, closeLabel) {
221
226
  return ({ toast }) => /* @__PURE__ */ jsx(SnackbarToast, {
222
227
  close: closeToast(queue, toast.key),
228
+ closeLabel,
223
229
  toast
224
230
  });
225
231
  }
226
232
  /** The action, the close button, or nothing, after the message. */
227
233
  function SnackbarControls(t0) {
228
- const $ = c(8);
229
- const { action, close, isDismissable } = t0;
234
+ const $ = c(9);
235
+ const { action, close, closeLabel, isDismissable } = t0;
230
236
  let t1;
231
237
  if ($[0] !== action || $[1] !== close) {
232
238
  t1 = action === void 0 ? null : /* @__PURE__ */ jsx(SnackbarButton, {
@@ -239,29 +245,30 @@ function SnackbarControls(t0) {
239
245
  $[2] = t1;
240
246
  } else t1 = $[2];
241
247
  let t2;
242
- if ($[3] !== isDismissable) {
248
+ if ($[3] !== closeLabel || $[4] !== isDismissable) {
243
249
  t2 = isDismissable ? /* @__PURE__ */ jsx(SnackbarButton, {
244
- "aria-label": "Close",
250
+ "aria-label": closeLabel,
245
251
  slot: "close",
246
252
  style: styles.close,
247
253
  children: /* @__PURE__ */ jsx(CloseGlyph, { className: "xxk0z11 xvy4d1p" })
248
254
  }) : null;
249
- $[3] = isDismissable;
250
- $[4] = t2;
251
- } else t2 = $[4];
255
+ $[3] = closeLabel;
256
+ $[4] = isDismissable;
257
+ $[5] = t2;
258
+ } else t2 = $[5];
252
259
  let t3;
253
- if ($[5] !== t1 || $[6] !== t2) {
260
+ if ($[6] !== t1 || $[7] !== t2) {
254
261
  t3 = /* @__PURE__ */ jsxs(Fragment, { children: [t1, t2] });
255
- $[5] = t1;
256
- $[6] = t2;
257
- $[7] = t3;
258
- } else t3 = $[7];
262
+ $[6] = t1;
263
+ $[7] = t2;
264
+ $[8] = t3;
265
+ } else t3 = $[8];
259
266
  return t3;
260
267
  }
261
268
  /** One snackbar: its message, then whatever sits after it. */
262
269
  function SnackbarToast(t0) {
263
- const $ = c(10);
264
- const { close, toast } = t0;
270
+ const $ = c(11);
271
+ const { close, closeLabel, toast } = t0;
265
272
  const { action, isDismissable, message } = toast.content;
266
273
  let t1;
267
274
  if ($[0] !== message) {
@@ -276,29 +283,31 @@ function SnackbarToast(t0) {
276
283
  $[1] = t1;
277
284
  } else t1 = $[1];
278
285
  let t2;
279
- if ($[2] !== action || $[3] !== close || $[4] !== isDismissable) {
286
+ if ($[2] !== action || $[3] !== close || $[4] !== closeLabel || $[5] !== isDismissable) {
280
287
  t2 = /* @__PURE__ */ jsx(SnackbarControls, {
281
288
  action,
282
289
  close,
290
+ closeLabel,
283
291
  isDismissable
284
292
  });
285
293
  $[2] = action;
286
294
  $[3] = close;
287
- $[4] = isDismissable;
288
- $[5] = t2;
289
- } else t2 = $[5];
295
+ $[4] = closeLabel;
296
+ $[5] = isDismissable;
297
+ $[6] = t2;
298
+ } else t2 = $[6];
290
299
  let t3;
291
- if ($[6] !== t1 || $[7] !== t2 || $[8] !== toast) {
300
+ if ($[7] !== t1 || $[8] !== t2 || $[9] !== toast) {
292
301
  t3 = /* @__PURE__ */ jsxs(UNSTABLE_Toast, {
293
302
  toast,
294
303
  className: "x6s0dn4 x1n1nwrg x1u6grsq x1dwmuk9 x16dv9tl x1c5gpgi x1tfhd1 x1udv5rz x9f619 x78zum5 xh8yej3 x1x1rfll xlx31pv x1wxaq2x xeuugli xuq8xha x1ulcdur x1hl8ikr x9v5kkp x1t137rt x1de99jn xt970qd xn60lsn x67bb7w",
295
304
  children: [t1, t2]
296
305
  });
297
- $[6] = t1;
298
- $[7] = t2;
299
- $[8] = toast;
300
- $[9] = t3;
301
- } else t3 = $[9];
306
+ $[7] = t1;
307
+ $[8] = t2;
308
+ $[9] = toast;
309
+ $[10] = t3;
310
+ } else t3 = $[10];
302
311
  return t3;
303
312
  }
304
313
  Snackbar.Queue = SnackbarQueue;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["ReactNode","FocusableElement","ToastRegionProps","RACToastRegionProps","ToastRegionRenderProps","stylex","Button","RACButton","UNSTABLE_Toast","RACToast","UNSTABLE_ToastContent","RACToastContent","UNSTABLE_ToastQueue","RACToastQueue","UNSTABLE_ToastRegion","RACToastRegion","Text","CloseGlyph","useRipple","mergeStatefulStyles","colors","motion","radii","shadows","spacing","stateLayerOpacity","typography","SHORT_MS","LONG_MS","WIDE","rise","styles","action","kMwMTN","kMv6JI","kGuDYH","k63SB2","kb6lSQ","kLWn49","k8WAf4","kg3NbH","$$css","close","kZKoxP","kzqmXN","kmVPX3","control","kGNEyG","kWkggS","kaIpWk","kMzoRj","kB7OPa","kkrTdU","k1xSpc","kmuXW","kjj79g","kjBf7l","kInvED","k3XXqK","kMeerF","kVQacm","kVAEAm","SnackbarAction","label","onPress","SnackbarMessage","isDismissable","message","SnackbarOptions","onClose","timeout","SnackbarProps","Omit","className","queue","SnackbarQueue","style","SnackbarToastItem","rac","constructor","maxVisibleToasts","add","options","undefined","clear","key","actionPress","closeToast","Snackbar","t0","$","_c","T0","t1","t2","t3","t4","props","snackbarContent","t5","SnackbarButton","children","ripple","handlers","surface","toast","SnackbarControls","SnackbarToast","content","Queue","SnackbarRegionRenderProps"],"sources":["../../../src/components/snackbar/index.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type { FocusableElement, ToastRegionProps as RACToastRegionProps, ToastRegionRenderProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\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 { useRipple } from '../../hooks/useRipple';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, motion, radii, shadows, 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, which is `maxVisibleToasts: 1` on the queue.\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.\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// The page's two durations, from the same implementation its measurements\n// come from: a message alone is shown for the short one, a message with an\n// action for the long one, since an action has to be read before it can be\n// taken.\nconst SHORT_MS = 1500;\nconst LONG_MS = 2750;\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. It rises a little as it arrives too, which is\n// what the page draws and what says the message came from the edge of the\n// screen rather than appearing over it.\nconst rise = \"x15b941j-B\";\nconst styles = {\n action: {\n kMwMTN: \"x16bex6i\",\n kMv6JI: \"xkknnkr\",\n kGuDYH: \"x14zspaw\",\n k63SB2: \"x1v9cpvo\",\n kb6lSQ: \"x155f00i\",\n kLWn49: \"x1lz68p4\",\n k8WAf4: \"x1cmllll\",\n kg3NbH: \"x18fpw6u\",\n $$css: true\n },\n close: {\n kZKoxP: \"xsdox4t\",\n kMwMTN: \"x1girmi0\",\n kzqmXN: \"x1useyqa\",\n kmVPX3: \"x1717udv\",\n $$css: true\n },\n control: {\n kGNEyG: \"x6s0dn4\",\n kWkggS: \"xy3r1oc x1en43ny x15a1ka xjbqb8w\",\n kaIpWk: \"x3y1ksm\",\n kMzoRj: \"xc342km\",\n kB7OPa: \"x9f619\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x3nfvp2\",\n kmuXW: \"x2lah0s\",\n kjj79g: \"xl56j7k\",\n kjBf7l: \"x14ytart\",\n kInvED: \"x1hl8ikr\",\n k3XXqK: \"x9v5kkp x1t137rt\",\n kMeerF: \"x1de99jn\",\n kVQacm: \"xb3r6kr\",\n kVAEAm: \"x1n2onr6\",\n $$css: true\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 isDismissable: boolean;\n message: ReactNode;\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 * 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 * @default false\n */\n isDismissable?: boolean;\n /** Run when the snackbar closes, however it was closed. */\n onClose?: () => void;\n /**\n * How long the snackbar is shown, in milliseconds. Defaults to the page's\n * short duration, or its long one when there is an action to read, and the\n * timer is paused while the region is hovered or focused so a message never\n * expires while it is being 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 `isDismissable`, or there is no\n * way to be rid of it.\n */\n timeout?: number;\n};\ntype SnackbarProps = Omit<RACToastRegionProps<SnackbarMessage>, 'children' | 'className' | 'queue' | 'style'> & {\n /**\n * What a screen reader calls the region holding the snackbar.\n * @default 'Notifications'\n */\n 'aria-label'?: string;\n /** A function may compute the class from the region's render state. */\n className?: RACToastRegionProps<SnackbarMessage>['className'];\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};\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 * 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 constructor() {\n // One at a time, which is what the page shows: a second message replaces\n // the first rather than stacking under it.\n this.rac = new RACToastQueue<SnackbarMessage>({\n maxVisibleToasts: 1\n });\n }\n\n /**\n * Shows a message, and returns the key that closes it.\n */\n add(message: ReactNode, options: SnackbarOptions = {}) {\n const {\n action,\n isDismissable = false,\n onClose,\n timeout\n } = options;\n return this.rac.add({\n action,\n isDismissable,\n message\n }, {\n onClose,\n timeout: timeout ?? (action === undefined ? SHORT_MS : LONG_MS)\n });\n }\n\n /** Closes every snackbar, shown or waiting. */\n clear() {\n this.rac.clear();\n }\n\n /** Closes one snackbar, by the key `add` returned. */\n close(key: string) {\n this.rac.close(key);\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/**\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 */\nfunction Snackbar({\n queue,\n ...props\n}: SnackbarProps) {\n return <RACToastRegion<SnackbarMessage> queue={queue.rac} {...props} {...mergeStatefulStyles({\n className: \"x6s0dn4 x9f619 x78zum5 xdt5ytf x126z3so x1ey2m1c x17y0mx6 x1t137rt x1a7rqcl x47corl xixxii4 xfo81ep\"\n }, props)}>\n {snackbarContent(queue)}\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} {...stylex.props(styles.control, style)}>\n {children}\n {ripple.surface}\n </RACButton>;\n}\nfunction snackbarContent(queue: SnackbarQueue) {\n return ({\n toast\n }: {\n toast: SnackbarToastItem;\n }) => <SnackbarToast close={closeToast(queue, toast.key)} toast={toast} />;\n}\n\n/** The action, the close button, or nothing, after the message. */\nfunction SnackbarControls({\n action,\n close,\n isDismissable\n}: {\n action: SnackbarAction | undefined;\n close: () => void;\n isDismissable: boolean;\n}) {\n return <>\n {action === undefined ? null : <SnackbarButton onPress={actionPress(action, close)} style={styles.action}>\n {action.label}\n </SnackbarButton>}\n {isDismissable ? <SnackbarButton aria-label=\"Close\" slot=\"close\" style={styles.close}>\n <CloseGlyph className=\"xxk0z11 xvy4d1p\" />\n </SnackbarButton> : null}\n </>;\n}\n\n/** One snackbar: its message, then whatever sits after it. */\nfunction SnackbarToast({\n close,\n toast\n}: {\n close: () => void;\n toast: SnackbarToastItem;\n}) {\n const {\n action,\n isDismissable,\n message\n } = toast.content;\n return <RACToast toast={toast} className=\"x6s0dn4 x1n1nwrg x1u6grsq x1dwmuk9 x16dv9tl x1c5gpgi x1tfhd1 x1udv5rz x9f619 x78zum5 xh8yej3 x1x1rfll xlx31pv x1wxaq2x xeuugli xuq8xha x1ulcdur x1hl8ikr x9v5kkp x1t137rt x1de99jn xt970qd xn60lsn x67bb7w\">\n <RACToastContent className=\"x9f619 x1girmi0 x1iyjqo2 xpo2rfv x193rfdd x1hews6w xn43zvd xv61bfh xz158ff xeuugli xxlmvz2\">\n <Text slot=\"title\">{message}</Text>\n </RACToastContent>\n <SnackbarControls action={action} close={close} isDismissable={isDismissable} />\n </RACToast>;\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":";;;;;;;;AAyDA,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AClB4B,KAAA,oBAAC,kBAAD;GAA0B9D;GAAeU;GAAsBwB;EAAa,CAAA;EAAIwB,EAAA,KAAA1D;EAAA0D,EAAA,KAAAhD;EAAAgD,EAAA,KAAAxB;EAAAwB,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAAA,IAAAK;CAAA,IAAAL,EAAA,OAAAG,MAAAH,EAAA,OAAAI,MAAAJ,EAAA,OAAAe,OAAA;EAJ7EV,KAAA,qBAAC,gBAAD;GAAiBU;GAAiB,WAAA;GAAlC,UAAA,CACHZ,IAGAC,EAJY;;EAKHJ,EAAA,KAAAG;EAAAH,EAAA,KAAAI;EAAAJ,EAAA,KAAAe;EAAAf,EAAA,KAAAK;CAAA,OAAAA,KAAAL,EAAA;CAAA,OALNK;AAKM;AAEfP,SAASqB,QAAQlC"}
1
+ {"version":3,"file":"index.js","names":["ReactNode","FocusableElement","ToastRegionProps","RACToastRegionProps","ToastRegionRenderProps","stylex","Button","RACButton","UNSTABLE_Toast","RACToast","UNSTABLE_ToastContent","RACToastContent","UNSTABLE_ToastQueue","RACToastQueue","UNSTABLE_ToastRegion","RACToastRegion","Text","CloseGlyph","useRipple","mergeStatefulStyles","colors","motion","radii","shadows","spacing","stateLayerOpacity","typography","SHORT_MS","LONG_MS","WIDE","rise","styles","action","kMwMTN","kMv6JI","kGuDYH","k63SB2","kb6lSQ","kLWn49","k8WAf4","kg3NbH","$$css","close","kZKoxP","kzqmXN","kmVPX3","control","kGNEyG","kWkggS","kaIpWk","kMzoRj","kB7OPa","kkrTdU","k1xSpc","kmuXW","kjj79g","kjBf7l","kInvED","k3XXqK","kMeerF","kVQacm","kVAEAm","SnackbarAction","label","onPress","SnackbarMessage","isDismissable","message","SnackbarOptions","onClose","timeout","SnackbarProps","Omit","className","closeLabel","queue","SnackbarQueue","style","SnackbarToastItem","rac","constructor","maxVisibleToasts","add","options","undefined","clear","key","actionPress","closeToast","Snackbar","t0","$","_c","T0","t1","t2","t3","t4","t5","props","snackbarContent","SnackbarButton","children","ripple","handlers","surface","toast","SnackbarControls","SnackbarToast","content","Queue","SnackbarRegionRenderProps"],"sources":["../../../src/components/snackbar/index.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type { FocusableElement, ToastRegionProps as RACToastRegionProps, ToastRegionRenderProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\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 { useRipple } from '../../hooks/useRipple';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, motion, radii, shadows, 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, which is `maxVisibleToasts: 1` on the queue.\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.\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// The page's two durations, from the same implementation its measurements\n// come from: a message alone is shown for the short one, a message with an\n// action for the long one, since an action has to be read before it can be\n// taken.\nconst SHORT_MS = 1500;\nconst LONG_MS = 2750;\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. It rises a little as it arrives too, which is\n// what the page draws and what says the message came from the edge of the\n// screen rather than appearing over it.\nconst rise = \"x15b941j-B\";\nconst styles = {\n action: {\n kMwMTN: \"x16bex6i\",\n kMv6JI: \"xkknnkr\",\n kGuDYH: \"x14zspaw\",\n k63SB2: \"x1v9cpvo\",\n kb6lSQ: \"x155f00i\",\n kLWn49: \"x1lz68p4\",\n k8WAf4: \"x1cmllll\",\n kg3NbH: \"x18fpw6u\",\n $$css: true\n },\n close: {\n kZKoxP: \"xsdox4t\",\n kMwMTN: \"x1girmi0\",\n kzqmXN: \"x1useyqa\",\n kmVPX3: \"x1717udv\",\n $$css: true\n },\n control: {\n kGNEyG: \"x6s0dn4\",\n kWkggS: \"xy3r1oc x1en43ny x15a1ka xjbqb8w\",\n kaIpWk: \"x3y1ksm\",\n kMzoRj: \"xc342km\",\n kB7OPa: \"x9f619\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x3nfvp2\",\n kmuXW: \"x2lah0s\",\n kjj79g: \"xl56j7k\",\n kjBf7l: \"x14ytart\",\n kInvED: \"x1hl8ikr\",\n k3XXqK: \"x9v5kkp x1t137rt\",\n kMeerF: \"x1de99jn\",\n kVQacm: \"xb3r6kr\",\n kVAEAm: \"x1n2onr6\",\n $$css: true\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 isDismissable: boolean;\n message: ReactNode;\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 * 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 * @default false\n */\n isDismissable?: boolean;\n /** Run when the snackbar closes, however it was closed. */\n onClose?: () => void;\n /**\n * How long the snackbar is shown, in milliseconds. Defaults to the page's\n * short duration, or its long one when there is an action to read, and the\n * timer is paused while the region is hovered or focused so a message never\n * expires while it is being 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 `isDismissable`, or there is no\n * way to be rid of it.\n */\n timeout?: number;\n};\ntype SnackbarProps = Omit<RACToastRegionProps<SnackbarMessage>, 'children' | 'className' | 'queue' | 'style'> & {\n /**\n * What a screen reader calls the region holding the snackbar.\n * @default 'Notifications'\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.\n * @default 'Close'\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};\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 * 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 constructor() {\n // One at a time, which is what the page shows: a second message replaces\n // the first rather than stacking under it.\n this.rac = new RACToastQueue<SnackbarMessage>({\n maxVisibleToasts: 1\n });\n }\n\n /**\n * Shows a message, and returns the key that closes it.\n */\n add(message: ReactNode, options: SnackbarOptions = {}) {\n const {\n action,\n isDismissable = false,\n onClose,\n timeout\n } = options;\n return this.rac.add({\n action,\n isDismissable,\n message\n }, {\n onClose,\n timeout: timeout ?? (action === undefined ? SHORT_MS : LONG_MS)\n });\n }\n\n /** Closes every snackbar, shown or waiting. */\n clear() {\n this.rac.clear();\n }\n\n /** Closes one snackbar, by the key `add` returned. */\n close(key: string) {\n this.rac.close(key);\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/**\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 */\nfunction Snackbar({\n closeLabel = 'Close',\n queue,\n ...props\n}: SnackbarProps) {\n return <RACToastRegion<SnackbarMessage> queue={queue.rac} {...props} {...mergeStatefulStyles({\n className: \"x6s0dn4 x9f619 x78zum5 xdt5ytf x126z3so x1ey2m1c x17y0mx6 x1t137rt x1a7rqcl x47corl xixxii4 xfo81ep\"\n }, 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} {...stylex.props(styles.control, style)}>\n {children}\n {ripple.surface}\n </RACButton>;\n}\nfunction snackbarContent(queue: SnackbarQueue, closeLabel: string) {\n return ({\n toast\n }: {\n toast: SnackbarToastItem;\n }) => <SnackbarToast close={closeToast(queue, toast.key)} closeLabel={closeLabel} toast={toast} />;\n}\n\n/** The action, the close button, or nothing, after the message. */\nfunction SnackbarControls({\n action,\n close,\n closeLabel,\n isDismissable\n}: {\n action: SnackbarAction | undefined;\n close: () => void;\n closeLabel: string;\n isDismissable: boolean;\n}) {\n return <>\n {action === undefined ? null : <SnackbarButton onPress={actionPress(action, close)} style={styles.action}>\n {action.label}\n </SnackbarButton>}\n {isDismissable ? <SnackbarButton aria-label={closeLabel} slot=\"close\" style={styles.close}>\n <CloseGlyph className=\"xxk0z11 xvy4d1p\" />\n </SnackbarButton> : null}\n </>;\n}\n\n/** One snackbar: its message, then whatever sits after it. */\nfunction SnackbarToast({\n close,\n closeLabel,\n toast\n}: {\n close: () => void;\n closeLabel: string;\n toast: SnackbarToastItem;\n}) {\n const {\n action,\n isDismissable,\n message\n } = toast.content;\n return <RACToast toast={toast} className=\"x6s0dn4 x1n1nwrg x1u6grsq x1dwmuk9 x16dv9tl x1c5gpgi x1tfhd1 x1udv5rz x9f619 x78zum5 xh8yej3 x1x1rfll xlx31pv x1wxaq2x xeuugli xuq8xha x1ulcdur x1hl8ikr x9v5kkp x1t137rt x1de99jn xt970qd xn60lsn x67bb7w\">\n <RACToastContent className=\"x9f619 x1girmi0 x1iyjqo2 xpo2rfv x193rfdd x1hews6w xn43zvd xv61bfh xz158ff xeuugli xxlmvz2\">\n <Text slot=\"title\">{message}</Text>\n </RACToastContent>\n <SnackbarControls action={action} close={close} closeLabel={closeLabel} isDismissable={isDismissable} />\n </RACToast>;\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":";;;;;;;;AAyDA,MAAM2B,WAAW;AACjB,MAAMC,UAAU;AAUhB,MAAMG,SAAS;CACbC,QAAQ;EACNC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,OAAO;EACLC,QAAQ;EACRV,QAAQ;EACRW,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;EACRC,QAAQ;E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AAAA,KAAAJ,EAAA;CAAA,IAAAK;CAAA,IAAAL,EAAA,OAAAG,MAAAH,EAAA,OAAAI,MAAAJ,EAAA,OAAAe,OAAA;EAJrGV,KAAA,qBAAC,gBAAD;GAAiBU;GAAiB,WAAA;GAAlC,UAAA,CACHZ,IAGAC,EAJY;;EAKHJ,EAAA,KAAAG;EAAAH,EAAA,KAAAI;EAAAJ,EAAA,KAAAe;EAAAf,EAAA,MAAAK;CAAA,OAAAA,KAAAL,EAAA;CAAA,OALNK;AAKM;AAEfP,SAASqB,QAAQlC"}
@@ -6,6 +6,15 @@ import { FormContext, useSlottedContext } from "react-aria-components";
6
6
  * marks the control rather than surfacing the browser's own constraint UI.
7
7
  * One constant rather than a literal in each field, so the decision has one
8
8
  * place to be changed.
9
+ *
10
+ * **It leaves announcing and focusing to the app**, and that is the half of
11
+ * the browser's behaviour this gives up. An error under `aria` is associated
12
+ * the way it should be — `aria-invalid` on the control, the message in its
13
+ * `aria-describedby` — so a reader who moves to the field is told. What does
14
+ * not happen is the move: after a server answers, focus is still wherever
15
+ * the submit left it and nothing has been read out. Nothing here knows a
16
+ * round trip happened, so the call site that made it is what moves focus to
17
+ * the first field that came back invalid.
9
18
  */
10
19
  const FIELD_VALIDATION_BEHAVIOR = "aria";
11
20
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"root.js","names":["stylex","FormContext","useSlottedContext","FIELD_VALIDATION_BEHAVIOR","invalidFrom","error","undefined","useFieldValidationBehavior","form","validationBehavior","useInsideForm","fieldStyles","root","kB7OPa","k1xSpc","kXwgrk","$$css"],"sources":["../../src/field/root.ts"],"sourcesContent":["import * as stylex from '@stylexjs/stylex';\nimport { FormContext, useSlottedContext } from 'react-aria-components';\n\n// What a field applies to its own root, which is React Aria's field element\n// rather than a part of the chrome. Apart from the parts in ./index.tsx so\n// that file exports components alone, which is what keeps fast refresh working\n// for it.\n\n/**\n * What a field passes React Aria for `validationBehavior` outside a `Form`.\n * The message under a field is the library's to show, so validation only\n * marks the control rather than surfacing the browser's own constraint UI.\n * One constant rather than a literal in each field, so the decision has one\n * place to be changed.\n */\nconst FIELD_VALIDATION_BEHAVIOR = 'aria';\n\n/**\n * What a field passes React Aria for `isInvalid`, from its `error` prop. Any\n * value there, `false` included, makes the field's validation controlled: it\n * is exactly as invalid as the prop says, and what a `Form` reports for it —\n * a server's errors, or the browser's own — is never shown. So the prop is\n * left unset while the field has no error of its own, which is what lets\n * the form's reach it.\n */\nfunction invalidFrom(error: string | undefined): true | undefined {\n return error === undefined ? undefined : true;\n}\n\n/**\n * The validation behaviour a field passes React Aria: its `Form`'s, where it\n * is inside one, and {@link FIELD_VALIDATION_BEHAVIOR} otherwise. React Aria\n * takes a field's own prop over its form's, so a field that passed the\n * constant could never be opted into the native behaviour by the form around\n * it; reading the form here is what lets `Form` decide for every field at\n * once.\n */\nfunction useFieldValidationBehavior(): 'aria' | 'native' {\n const form = useSlottedContext(FormContext);\n return form?.validationBehavior ?? FIELD_VALIDATION_BEHAVIOR;\n}\n\n/**\n * Whether this field is inside a `Form`. A form is where a message arrives\n * after the fact — a server's answer, or the browser's own on submit — so it\n * is where the line under a field is kept clear whether or not there is\n * anything to say, and the fields below it stay where they are.\n */\nfunction useInsideForm() {\n return useSlottedContext(FormContext) !== null;\n}\nconst fieldStyles = {\n root: {\n kB7OPa: \"x9f619\",\n k1xSpc: \"x78zum5\",\n kXwgrk: \"xdt5ytf\",\n $$css: true\n }\n};\nexport { FIELD_VALIDATION_BEHAVIOR, fieldStyles, invalidFrom, useFieldValidationBehavior, useInsideForm };"],"mappings":";;;;;;;;;AAeA,MAAMG,4BAA4B;;;;;;;;;AAUlC,SAASC,YAAYC,OAA6C;CAChE,OAAOA,UAAUC,KAAAA,IAAYA,KAAAA,IAAY;AAC3C;;;;;;;;;AAUA,SAAAC,6BAAA;CAC8C,OAA/BL,kBAAkBD,WACxBO,CAAI,EAAAC,sBAAAA;AAAiD;;;;;;;AAS9D,SAAAC,gBAAA;CAAA,OACSR,kBAAkBD,WAAW,MAAM;AAAI;AAEhD,MAAMU,cAAc,EAClBC,MAAM;CACJC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,OAAO;AACT,EACF"}
1
+ {"version":3,"file":"root.js","names":["stylex","FormContext","useSlottedContext","FIELD_VALIDATION_BEHAVIOR","invalidFrom","error","undefined","useFieldValidationBehavior","form","validationBehavior","useInsideForm","fieldStyles","root","kB7OPa","k1xSpc","kXwgrk","$$css"],"sources":["../../src/field/root.ts"],"sourcesContent":["import * as stylex from '@stylexjs/stylex';\nimport { FormContext, useSlottedContext } from 'react-aria-components';\n\n// What a field applies to its own root, which is React Aria's field element\n// rather than a part of the chrome. Apart from the parts in ./index.tsx so\n// that file exports components alone, which is what keeps fast refresh working\n// for it.\n\n/**\n * What a field passes React Aria for `validationBehavior` outside a `Form`.\n * The message under a field is the library's to show, so validation only\n * marks the control rather than surfacing the browser's own constraint UI.\n * One constant rather than a literal in each field, so the decision has one\n * place to be changed.\n *\n * **It leaves announcing and focusing to the app**, and that is the half of\n * the browser's behaviour this gives up. An error under `aria` is associated\n * the way it should be — `aria-invalid` on the control, the message in its\n * `aria-describedby` — so a reader who moves to the field is told. What does\n * not happen is the move: after a server answers, focus is still wherever\n * the submit left it and nothing has been read out. Nothing here knows a\n * round trip happened, so the call site that made it is what moves focus to\n * the first field that came back invalid.\n */\nconst FIELD_VALIDATION_BEHAVIOR = 'aria';\n\n/**\n * What a field passes React Aria for `isInvalid`, from its `error` prop. Any\n * value there, `false` included, makes the field's validation controlled: it\n * is exactly as invalid as the prop says, and what a `Form` reports for it —\n * a server's errors, or the browser's own — is never shown. So the prop is\n * left unset while the field has no error of its own, which is what lets\n * the form's reach it.\n */\nfunction invalidFrom(error: string | undefined): true | undefined {\n return error === undefined ? undefined : true;\n}\n\n/**\n * The validation behaviour a field passes React Aria: its `Form`'s, where it\n * is inside one, and {@link FIELD_VALIDATION_BEHAVIOR} otherwise. React Aria\n * takes a field's own prop over its form's, so a field that passed the\n * constant could never be opted into the native behaviour by the form around\n * it; reading the form here is what lets `Form` decide for every field at\n * once.\n */\nfunction useFieldValidationBehavior(): 'aria' | 'native' {\n const form = useSlottedContext(FormContext);\n return form?.validationBehavior ?? FIELD_VALIDATION_BEHAVIOR;\n}\n\n/**\n * Whether this field is inside a `Form`. A form is where a message arrives\n * after the fact — a server's answer, or the browser's own on submit — so it\n * is where the line under a field is kept clear whether or not there is\n * anything to say, and the fields below it stay where they are.\n */\nfunction useInsideForm() {\n return useSlottedContext(FormContext) !== null;\n}\nconst fieldStyles = {\n root: {\n kB7OPa: \"x9f619\",\n k1xSpc: \"x78zum5\",\n kXwgrk: \"xdt5ytf\",\n $$css: true\n }\n};\nexport { FIELD_VALIDATION_BEHAVIOR, fieldStyles, invalidFrom, useFieldValidationBehavior, useInsideForm };"],"mappings":";;;;;;;;;;;;;;;;;;AAwBA,MAAMG,4BAA4B;;;;;;;;;AAUlC,SAASC,YAAYC,OAA6C;CAChE,OAAOA,UAAUC,KAAAA,IAAYA,KAAAA,IAAY;AAC3C;;;;;;;;;AAUA,SAAAC,6BAAA;CAC8C,OAA/BL,kBAAkBD,WACxBO,CAAI,EAAAC,sBAAAA;AAAiD;;;;;;;AAS9D,SAAAC,gBAAA;CAAA,OACSR,kBAAkBD,WAAW,MAAM;AAAI;AAEhD,MAAMU,cAAc,EAClBC,MAAM;CACJC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,OAAO;AACT,EACF"}
package/dist/index.d.ts CHANGED
@@ -33,7 +33,7 @@ import Form, { FormProps } from "./components/form/index.js";
33
33
  import IconButton, { IconButtonProps } from "./components/icon-button/index.js";
34
34
  import Keycap, { KeycapProps } from "./components/keycap/index.js";
35
35
  import Link, { LinkProps } from "./components/link/index.js";
36
- import List, { ListProps } from "./components/list/index.js";
36
+ import List, { ListLoadMoreProps, ListProps, ListRowProps, ListSectionProps } from "./components/list/index.js";
37
37
  import ListBox, { ListBoxProps } from "./components/list-box/index.js";
38
38
  import ListDetail, { ListDetailProps } from "./components/list-detail/index.js";
39
39
  import ListItem, { ListItemProps } from "./components/list-item/index.js";
@@ -72,4 +72,4 @@ import { collectionSizes } from "./layout.js";
72
72
  import { useDragAndDrop } from "./drag/hooks.js";
73
73
  import { Collection, DIRECTORY_DRAG_TYPE, Focusable, GridLayout, I18nProvider, Key, ListLayout, PressEvent, Pressable, RouterProvider, Selection, SharedElement, SharedElementTransition, SortDescriptor, TableLayout, TokenFieldValue, Virtualizer, VisuallyHidden, WaterfallLayout, getColorChannels, isDirectoryDropItem, isFileDropItem, isTextDropItem, parseColor, useAsyncList, useDrag, useDrop, useFilter, useListData, useLocale, useTreeData } from "./react-aria.js";
74
74
  import "./styles.css";
75
- export { AppBar, type AppBarProps, Autocomplete, type AutocompleteProps, Avatar, type AvatarProps, Breadcrumbs, type BreadcrumbsProps, Button, type ButtonProps, Calendar, type CalendarProps, Card, type CardProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, Chip, ChipGroup, type ChipGroupProps, type ChipProps, Code, type CodeProps, Collection, ColorArea, type ColorAreaProps, ColorField, type ColorFieldProps, ColorPicker, type ColorPickerProps, ColorSlider, type ColorSliderProps, ColorSwatch, ColorSwatchPicker, type ColorSwatchPickerProps, type ColorSwatchProps, ColorWheel, type ColorWheelProps, ComboBox, type ComboBoxProps, Container, type ContainerProps, CopyField, type CopyFieldProps, Currency, type CurrencyProps, DIRECTORY_DRAG_TYPE, DateField, type DateFieldProps, DatePicker, type DatePickerProps, DateRangePicker, type DateRangePickerProps, Dialog, type DialogProps, Disclosure, DisclosureGroup, type DisclosureGroupProps, type DisclosureProps, DropZone, type DropZoneProps, Feed, type FeedProps, FileTrigger, type FileTriggerProps, Focusable, Form, type FormProps, GridLayout, I18nProvider, IconButton, type IconButtonProps, type Key, Keycap, type KeycapProps, Link, type LinkProps, List, ListBox, type ListBoxProps, ListDetail, type ListDetailProps, ListItem, type ListItemProps, ListLayout, type ListProps, Menu, type MenuProps, Meter, type MeterProps, NavigationTree, type NavigationTreeHeaderProps, type NavigationTreeItemProps, type NavigationTreeProps, type NavigationTreeSectionProps, NumberField, type NumberFieldProps, Popover, type PopoverProps, type PressEvent, Pressable, ProductIcon, type ProductIconProps, ProgressIndicator, type ProgressIndicatorProps, Radio, RadioGroup, type RadioGroupProps, type RadioProps, RangeCalendar, type RangeCalendarProps, RouterProvider, SearchField, type SearchFieldProps, SegmentedButton, type SegmentedButtonProps, type SegmentedButtonSegmentProps, Select, type SelectProps, type Selection, Separator, type SeparatorProps, SharedElement, SharedElementTransition, Sheet, type SheetProps, Slider, type SliderProps, Snackbar, type SnackbarProps, type SortDescriptor, Stack, type StackAlign, type StackGap, type StackJustify, type StackProps, SupportingPane, type SupportingPaneProps, Switch, type SwitchProps, Table, type TableBodyProps, type TableCellProps, type TableColumnProps, type TableFooterProps, type TableHeaderProps, TableLayout, type TableProps, type TableRowProps, Tabs, type TabsProps, Tag, type TagProps, Text, TextArea, type TextAreaProps, TextField, type TextFieldProps, type TextProps, TimeField, type TimeFieldProps, TokenField, type TokenFieldProps, TokenFieldValue, Toolbar, type ToolbarProps, Tooltip, type TooltipProps, Tree, type TreeHeaderProps, type TreeItemProps, type TreeLoadMoreProps, type TreeProps, type TreeSectionProps, Virtualizer, VisuallyHidden, WaterfallLayout, collectionSizes, getColorChannels, isDirectoryDropItem, isFileDropItem, isTextDropItem, parseColor, useAsyncList, useDrag, useDragAndDrop, useDrop, useFilter, useListData, useLocale, useTreeData };
75
+ export { AppBar, type AppBarProps, Autocomplete, type AutocompleteProps, Avatar, type AvatarProps, Breadcrumbs, type BreadcrumbsProps, Button, type ButtonProps, Calendar, type CalendarProps, Card, type CardProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, Chip, ChipGroup, type ChipGroupProps, type ChipProps, Code, type CodeProps, Collection, ColorArea, type ColorAreaProps, ColorField, type ColorFieldProps, ColorPicker, type ColorPickerProps, ColorSlider, type ColorSliderProps, ColorSwatch, ColorSwatchPicker, type ColorSwatchPickerProps, type ColorSwatchProps, ColorWheel, type ColorWheelProps, ComboBox, type ComboBoxProps, Container, type ContainerProps, CopyField, type CopyFieldProps, Currency, type CurrencyProps, DIRECTORY_DRAG_TYPE, DateField, type DateFieldProps, DatePicker, type DatePickerProps, DateRangePicker, type DateRangePickerProps, Dialog, type DialogProps, Disclosure, DisclosureGroup, type DisclosureGroupProps, type DisclosureProps, DropZone, type DropZoneProps, Feed, type FeedProps, FileTrigger, type FileTriggerProps, Focusable, Form, type FormProps, GridLayout, I18nProvider, IconButton, type IconButtonProps, type Key, Keycap, type KeycapProps, Link, type LinkProps, List, ListBox, type ListBoxProps, ListDetail, type ListDetailProps, ListItem, type ListItemProps, ListLayout, type ListLoadMoreProps, type ListProps, type ListRowProps, type ListSectionProps, Menu, type MenuProps, Meter, type MeterProps, NavigationTree, type NavigationTreeHeaderProps, type NavigationTreeItemProps, type NavigationTreeProps, type NavigationTreeSectionProps, NumberField, type NumberFieldProps, Popover, type PopoverProps, type PressEvent, Pressable, ProductIcon, type ProductIconProps, ProgressIndicator, type ProgressIndicatorProps, Radio, RadioGroup, type RadioGroupProps, type RadioProps, RangeCalendar, type RangeCalendarProps, RouterProvider, SearchField, type SearchFieldProps, SegmentedButton, type SegmentedButtonProps, type SegmentedButtonSegmentProps, Select, type SelectProps, type Selection, Separator, type SeparatorProps, SharedElement, SharedElementTransition, Sheet, type SheetProps, Slider, type SliderProps, Snackbar, type SnackbarProps, type SortDescriptor, Stack, type StackAlign, type StackGap, type StackJustify, type StackProps, SupportingPane, type SupportingPaneProps, Switch, type SwitchProps, Table, type TableBodyProps, type TableCellProps, type TableColumnProps, type TableFooterProps, type TableHeaderProps, TableLayout, type TableProps, type TableRowProps, Tabs, type TabsProps, Tag, type TagProps, Text, TextArea, type TextAreaProps, TextField, type TextFieldProps, type TextProps, TimeField, type TimeFieldProps, TokenField, type TokenFieldProps, TokenFieldValue, Toolbar, type ToolbarProps, Tooltip, type TooltipProps, Tree, type TreeHeaderProps, type TreeItemProps, type TreeLoadMoreProps, type TreeProps, type TreeSectionProps, Virtualizer, VisuallyHidden, WaterfallLayout, collectionSizes, getColorChannels, isDirectoryDropItem, isFileDropItem, isTextDropItem, parseColor, useAsyncList, useDrag, useDragAndDrop, useDrop, useFilter, useListData, useLocale, useTreeData };
package/dist/styles.css CHANGED
@@ -1767,26 +1767,6 @@
1767
1767
  touch-action: none;
1768
1768
  }
1769
1769
 
1770
- .x18ouj0k {
1771
- transform-origin: bottom;
1772
- }
1773
-
1774
- .x1g0ag68 {
1775
- transform-origin: center;
1776
- }
1777
-
1778
- .x1nf803f {
1779
- transform-origin: 0;
1780
- }
1781
-
1782
- .xyibjs4 {
1783
- transform-origin: 100%;
1784
- }
1785
-
1786
- .x1dp6rp6 {
1787
- transform-origin: top;
1788
- }
1789
-
1790
1770
  .x1c071of {
1791
1771
  transform: none;
1792
1772
  }
@@ -1811,6 +1791,26 @@
1811
1791
  transform: translateY(-50%);
1812
1792
  }
1813
1793
 
1794
+ .x18ouj0k {
1795
+ transform-origin: bottom;
1796
+ }
1797
+
1798
+ .x1g0ag68 {
1799
+ transform-origin: center;
1800
+ }
1801
+
1802
+ .x1nf803f {
1803
+ transform-origin: 0;
1804
+ }
1805
+
1806
+ .xyibjs4 {
1807
+ transform-origin: 100%;
1808
+ }
1809
+
1810
+ .x1dp6rp6 {
1811
+ transform-origin: top;
1812
+ }
1813
+
1814
1814
  .xjl7l83 {
1815
1815
  transition-duration: .105s;
1816
1816
  }
@@ -2703,6 +2703,12 @@
2703
2703
  overflow-y: auto;
2704
2704
  }
2705
2705
 
2706
+ @media (width < 600px) {
2707
+ .xd76zvj.xd76zvj {
2708
+ padding: 0;
2709
+ }
2710
+ }
2711
+
2706
2712
  .x18d9i69 {
2707
2713
  padding-bottom: 0;
2708
2714
  }
@@ -2739,12 +2745,6 @@
2739
2745
  padding-top: var(--xod9tvo);
2740
2746
  }
2741
2747
 
2742
- @media (width < 600px) {
2743
- .xd76zvj.xd76zvj {
2744
- padding: 0;
2745
- }
2746
- }
2747
-
2748
2748
  .x13vifvy {
2749
2749
  top: 0;
2750
2750
  }
@@ -2987,6 +2987,10 @@
2987
2987
  .xkgydl7.xkgydl7 {
2988
2988
  grid-template-columns: 360px minmax(0, 1fr);
2989
2989
  }
2990
+
2991
+ .x1674ulc.x1674ulc {
2992
+ grid-template-columns: minmax(0, 1fr) 360px;
2993
+ }
2990
2994
  }
2991
2995
 
2992
2996
  @media (width >= 1600px) {
@@ -2995,12 +2999,6 @@
2995
2999
  }
2996
3000
  }
2997
3001
 
2998
- @media (width >= 840px) {
2999
- .x1674ulc.x1674ulc {
3000
- grid-template-columns: minmax(0, 1fr) 360px;
3001
- }
3002
- }
3003
-
3004
3002
  @media (width < 600px) {
3005
3003
  .x1upgybz.x1upgybz {
3006
3004
  inset-inline-start: 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kanso-labs/kanso-ui",
3
- "version": "0.26.6",
3
+ "version": "0.27.0",
4
4
  "description": "A React component library built on React Aria Components primitives and styled with StyleX, with design tokens sourced from a single W3C DTCG file and compiled via Style Dictionary",
5
5
  "keywords": [
6
6
  "react",
@@ -80,7 +80,7 @@
80
80
  "@storybook/addon-vitest": "10.6.0",
81
81
  "@storybook/builder-vite": "10.6.0",
82
82
  "@storybook/react-vite": "10.6.0",
83
- "@stylexjs/unplugin": "0.19.0",
83
+ "@stylexjs/unplugin": "0.19.1",
84
84
  "@testing-library/react": "16.3.3",
85
85
  "@types/react": "19.3.0",
86
86
  "@types/react-dom": "19.3.0",