@kanso-labs/kanso-ui 0.40.8 → 0.41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/color-scheme.d.ts +6 -0
- package/dist/color-scheme.js +9 -2
- package/dist/color-scheme.js.map +1 -1
- package/dist/components/app-bar/index.d.ts +11 -2
- package/dist/components/app-bar/index.js +53 -46
- package/dist/components/app-bar/index.js.map +1 -1
- package/dist/components/avatar/index.d.ts +7 -0
- package/dist/components/avatar/index.js.map +1 -1
- package/dist/components/badge/index.js +7 -3
- package/dist/components/badge/index.js.map +1 -1
- package/dist/components/card/index.d.ts +12 -1
- package/dist/components/card/index.js +136 -66
- package/dist/components/card/index.js.map +1 -1
- package/dist/components/dialog/index.js +3 -2
- package/dist/components/dialog/index.js.map +1 -1
- package/dist/components/popover/index.d.ts +4 -1
- package/dist/components/popover/index.js +241 -138
- package/dist/components/popover/index.js.map +1 -1
- package/dist/components/product-icon/index.d.ts +3 -1
- package/dist/components/product-icon/index.js.map +1 -1
- package/dist/components/progress-indicator/index.js +1 -1
- package/dist/components/progress-indicator/index.js.map +1 -1
- package/dist/components/search-field/index.js +7 -3
- package/dist/components/search-field/index.js.map +1 -1
- package/dist/components/segmented-button/index.d.ts +20 -1
- package/dist/components/segmented-button/index.js +253 -114
- package/dist/components/segmented-button/index.js.map +1 -1
- package/dist/components/separator/index.js +2 -2
- package/dist/components/separator/index.js.map +1 -1
- package/dist/components/sheet/index.js +17 -16
- package/dist/components/sheet/index.js.map +1 -1
- package/dist/components/snackbar/index.d.ts +10 -3
- package/dist/components/snackbar/index.js +32 -12
- package/dist/components/snackbar/index.js.map +1 -1
- package/dist/components/switch/index.js +12 -3
- package/dist/components/switch/index.js.map +1 -1
- package/dist/components/toolbar/index.d.ts +3 -2
- package/dist/components/toolbar/index.js +3 -2
- package/dist/components/toolbar/index.js.map +1 -1
- package/dist/field/index.js +67 -61
- package/dist/field/index.js.map +1 -1
- package/dist/field/press.js +27 -0
- package/dist/field/press.js.map +1 -0
- package/dist/mark/initials.js +41 -26
- package/dist/mark/initials.js.map +1 -1
- package/dist/overlay/index.js +24 -0
- package/dist/overlay/index.js.map +1 -0
- package/dist/styles/scheme.js +19 -0
- package/dist/styles/scheme.js.map +1 -0
- package/dist/styles.css +106 -34
- package/dist/theme-scope.d.ts +5 -2
- package/dist/theme-scope.js +2 -1
- package/dist/theme-scope.js.map +1 -1
- package/package.json +1 -1
|
@@ -5,7 +5,8 @@ import { mergeStyles } from "../../styles/merge.js";
|
|
|
5
5
|
import { focus } from "../../styles/focus.js";
|
|
6
6
|
import { useRipple } from "../../hooks/useRipple.js";
|
|
7
7
|
import { c } from "react/compiler-runtime";
|
|
8
|
-
import {
|
|
8
|
+
import { cloneElement, isValidElement } from "react";
|
|
9
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
9
10
|
//#region src/components/card/index.tsx
|
|
10
11
|
const styles = {
|
|
11
12
|
base: {
|
|
@@ -26,6 +27,28 @@ const styles = {
|
|
|
26
27
|
kAzted: "x1us19tq",
|
|
27
28
|
$$css: true
|
|
28
29
|
},
|
|
30
|
+
disabled: {
|
|
31
|
+
kVAM5u: "xmnqt3w",
|
|
32
|
+
kkrTdU: "xt0e3qv",
|
|
33
|
+
$$css: true
|
|
34
|
+
},
|
|
35
|
+
disabledContent: {
|
|
36
|
+
kSiTet: "x1ppv7y9",
|
|
37
|
+
$$css: true
|
|
38
|
+
},
|
|
39
|
+
disabledElevated: {
|
|
40
|
+
kWkggS: "x1jfv5e4",
|
|
41
|
+
kGVxlE: "x1gnnqk1",
|
|
42
|
+
$$css: true
|
|
43
|
+
},
|
|
44
|
+
disabledFilled: {
|
|
45
|
+
kWkggS: "x6mg230",
|
|
46
|
+
$$css: true
|
|
47
|
+
},
|
|
48
|
+
disabledOutlined: {
|
|
49
|
+
kVAM5u: "x1y3ic1l xmnqt3w",
|
|
50
|
+
$$css: true
|
|
51
|
+
},
|
|
29
52
|
elevated: {
|
|
30
53
|
kWkggS: "x1vnz5z6",
|
|
31
54
|
kGVxlE: "x19efjv6",
|
|
@@ -92,87 +115,134 @@ const interactionStyles = {
|
|
|
92
115
|
* navigates.
|
|
93
116
|
*/
|
|
94
117
|
function Card(t0) {
|
|
95
|
-
const $ = c(
|
|
96
|
-
const { children, interactive: t1, onClick, onContextMenu, onPointerCancel, onPointerDown, onPointerLeave, onPointerUp, padding:
|
|
118
|
+
const $ = c(34);
|
|
119
|
+
const { children, interactive: t1, isDisabled: t2, onClick, onContextMenu, onPointerCancel, onPointerDown, onPointerLeave, onPointerUp, padding: t3, render, variant: t4, ...props$1 } = t0;
|
|
97
120
|
const interactive = t1 === void 0 ? false : t1;
|
|
98
|
-
const
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
121
|
+
const isDisabled = t2 === void 0 ? false : t2;
|
|
122
|
+
const padding = t3 === void 0 ? "default" : t3;
|
|
123
|
+
const variant = t4 === void 0 ? "elevated" : t4;
|
|
124
|
+
const disabled = interactive && isDisabled;
|
|
125
|
+
const t5 = disabled ? void 0 : onClick;
|
|
126
|
+
let t6;
|
|
127
|
+
if ($[0] !== onContextMenu || $[1] !== onPointerCancel || $[2] !== onPointerDown || $[3] !== onPointerLeave || $[4] !== onPointerUp || $[5] !== t5) {
|
|
128
|
+
t6 = {
|
|
129
|
+
onClick: t5,
|
|
104
130
|
onContextMenu,
|
|
105
131
|
onPointerCancel,
|
|
106
132
|
onPointerDown,
|
|
107
133
|
onPointerLeave,
|
|
108
134
|
onPointerUp
|
|
109
135
|
};
|
|
110
|
-
$[0] =
|
|
111
|
-
$[1] =
|
|
112
|
-
$[2] =
|
|
113
|
-
$[3] =
|
|
114
|
-
$[4] =
|
|
115
|
-
$[5] =
|
|
116
|
-
$[6] =
|
|
117
|
-
} else
|
|
118
|
-
const ripple = useRipple(interactive,
|
|
136
|
+
$[0] = onContextMenu;
|
|
137
|
+
$[1] = onPointerCancel;
|
|
138
|
+
$[2] = onPointerDown;
|
|
139
|
+
$[3] = onPointerLeave;
|
|
140
|
+
$[4] = onPointerUp;
|
|
141
|
+
$[5] = t5;
|
|
142
|
+
$[6] = t6;
|
|
143
|
+
} else t6 = $[6];
|
|
144
|
+
const ripple = useRipple(interactive && !disabled, t6);
|
|
119
145
|
const padded = padding === "none" ? styles.paddingNone : styles.paddingDefault;
|
|
120
|
-
const
|
|
121
|
-
let
|
|
146
|
+
const t7 = interactive ? "button" : "div";
|
|
147
|
+
let t8;
|
|
122
148
|
if ($[7] !== interactive || $[8] !== render) {
|
|
123
|
-
|
|
149
|
+
t8 = interactive && render === void 0 ? { type: "button" } : void 0;
|
|
124
150
|
$[7] = interactive;
|
|
125
151
|
$[8] = render;
|
|
126
|
-
$[9] =
|
|
127
|
-
} else
|
|
128
|
-
const
|
|
129
|
-
let
|
|
130
|
-
if ($[10] !==
|
|
131
|
-
|
|
132
|
-
|
|
152
|
+
$[9] = t8;
|
|
153
|
+
} else t8 = $[9];
|
|
154
|
+
const t9 = ripple.handlers;
|
|
155
|
+
let t10;
|
|
156
|
+
if ($[10] !== disabled || $[11] !== render) {
|
|
157
|
+
t10 = disabledAttributes(disabled, render);
|
|
158
|
+
$[10] = disabled;
|
|
159
|
+
$[11] = render;
|
|
160
|
+
$[12] = t10;
|
|
161
|
+
} else t10 = $[12];
|
|
162
|
+
let t11;
|
|
163
|
+
if ($[13] !== children || $[14] !== disabled || $[15] !== interactive) {
|
|
164
|
+
t11 = interactive ? /* @__PURE__ */ jsx("span", {
|
|
165
|
+
...{
|
|
166
|
+
0: { className: "x9f619 x1lliihq x1us19tq" },
|
|
167
|
+
1: { className: "x9f619 x1lliihq x1us19tq x1ppv7y9" }
|
|
168
|
+
}[!!disabled << 0],
|
|
133
169
|
children
|
|
134
170
|
}) : children;
|
|
135
|
-
$[
|
|
136
|
-
$[
|
|
137
|
-
$[
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
$[
|
|
143
|
-
$[
|
|
144
|
-
$[
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
171
|
+
$[13] = children;
|
|
172
|
+
$[14] = disabled;
|
|
173
|
+
$[15] = interactive;
|
|
174
|
+
$[16] = t11;
|
|
175
|
+
} else t11 = $[16];
|
|
176
|
+
let t12;
|
|
177
|
+
if ($[17] !== ripple.surface || $[18] !== t11) {
|
|
178
|
+
t12 = /* @__PURE__ */ jsxs(Fragment$1, { children: [t11, ripple.surface] });
|
|
179
|
+
$[17] = ripple.surface;
|
|
180
|
+
$[18] = t11;
|
|
181
|
+
$[19] = t12;
|
|
182
|
+
} else t12 = $[19];
|
|
183
|
+
const t13 = mergeStyles(props(styles.base, styles[variant], padded, interactive && styles.interactive, interactive && variant !== "outlined" && styles.interactiveBoundary, interactive && !disabled && focus.ring, interactive && !disabled && interactionStyles[variant], disabled && styles.disabled, disabled && disabledStyles[variant]), props$1);
|
|
184
|
+
let t14;
|
|
185
|
+
if ($[20] !== props$1 || $[21] !== ripple.handlers || $[22] !== t10 || $[23] !== t12 || $[24] !== t13 || $[25] !== t8) {
|
|
186
|
+
t14 = {
|
|
150
187
|
...props$1,
|
|
151
|
-
...
|
|
152
|
-
...
|
|
153
|
-
|
|
154
|
-
|
|
188
|
+
...t8,
|
|
189
|
+
...t9,
|
|
190
|
+
...t10,
|
|
191
|
+
children: t12,
|
|
192
|
+
...t13
|
|
155
193
|
};
|
|
156
|
-
$[
|
|
157
|
-
$[
|
|
158
|
-
$[
|
|
159
|
-
$[
|
|
160
|
-
$[
|
|
161
|
-
$[
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
194
|
+
$[20] = props$1;
|
|
195
|
+
$[21] = ripple.handlers;
|
|
196
|
+
$[22] = t10;
|
|
197
|
+
$[23] = t12;
|
|
198
|
+
$[24] = t13;
|
|
199
|
+
$[25] = t8;
|
|
200
|
+
$[26] = t14;
|
|
201
|
+
} else t14 = $[26];
|
|
202
|
+
let t15;
|
|
203
|
+
if ($[27] !== disabled || $[28] !== render) {
|
|
204
|
+
t15 = disabled ? withoutActivation(render) : render;
|
|
205
|
+
$[27] = disabled;
|
|
206
|
+
$[28] = render;
|
|
207
|
+
$[29] = t15;
|
|
208
|
+
} else t15 = $[29];
|
|
209
|
+
let t16;
|
|
210
|
+
if ($[30] !== t14 || $[31] !== t15 || $[32] !== t7) {
|
|
211
|
+
t16 = {
|
|
212
|
+
defaultTagName: t7,
|
|
213
|
+
props: t14,
|
|
214
|
+
render: t15
|
|
169
215
|
};
|
|
170
|
-
$[
|
|
171
|
-
$[
|
|
172
|
-
$[
|
|
173
|
-
$[
|
|
174
|
-
} else
|
|
175
|
-
return useRender(
|
|
216
|
+
$[30] = t14;
|
|
217
|
+
$[31] = t15;
|
|
218
|
+
$[32] = t7;
|
|
219
|
+
$[33] = t16;
|
|
220
|
+
} else t16 = $[33];
|
|
221
|
+
return useRender(t16);
|
|
222
|
+
}
|
|
223
|
+
const disabledStyles = {
|
|
224
|
+
elevated: styles.disabledElevated,
|
|
225
|
+
filled: styles.disabledFilled,
|
|
226
|
+
outlined: styles.disabledOutlined
|
|
227
|
+
};
|
|
228
|
+
function disabledAttributes(disabled, render) {
|
|
229
|
+
if (!disabled) return;
|
|
230
|
+
if (render === void 0) return { disabled: true };
|
|
231
|
+
return {
|
|
232
|
+
"aria-disabled": true,
|
|
233
|
+
onClick: preventDefault
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
function preventDefault(event) {
|
|
237
|
+
event.preventDefault();
|
|
238
|
+
}
|
|
239
|
+
function withoutActivation(render) {
|
|
240
|
+
if (!isValidElement(render)) return render;
|
|
241
|
+
return cloneElement(render, {
|
|
242
|
+
href: void 0,
|
|
243
|
+
onClick: preventDefault,
|
|
244
|
+
tabIndex: void 0
|
|
245
|
+
});
|
|
176
246
|
}
|
|
177
247
|
//#endregion
|
|
178
248
|
export { Card as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["c","_c","stylex","RenderComponentProps","useRipple","useRender","focus","mergeStyles","colors","radii","shadows","spacing","stateLayerOpacity","FORCED_COLORS","styles","base","kaIpWk","kMzoRj","kB7OPa","kMwMTN","k1xSpc","kVQacm","kHjlTd","kVAEAm","kybGjl","$$css","content","kAzted","elevated","kWkggS","kGVxlE","filled","interactive","kkrTdU","kVVagm","kzqmXN","k9WMMc","interactiveBoundary","kVAM5u","ksu8eU","outlined","paddingDefault","kmVPX3","paddingNone","HOVER_CAPABLE","interactionStyles","CardProps","padding","variant","CardVariant","Card","t0","$","children","t1","onClick","onContextMenu","onPointerCancel","onPointerDown","onPointerLeave","onPointerUp","t2","render","t3","props","undefined","t4","ripple","padded","t5","t6","type","t7","handlers","t8","t9","surface","t10","ring","t11","t12","defaultTagName","_c","props","stylex.props"],"sources":["../../../src/components/card/index.tsx"],"sourcesContent":["'use client';\n\nimport * as stylex from '@stylexjs/stylex';\nimport type { RenderComponentProps } from '../../render/useRender';\nimport { useRipple } from '../../hooks/useRipple';\nimport { useRender } from '../../render/useRender';\nimport { focus } from '../../styles/focus';\nimport { mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, radii, shadows, spacing, stateLayerOpacity } from '../../tokens/design.tokens.stylex';\n\n// The three variants differ only in how they separate themselves from the\n// page: a shadow, a darker fill, or a border. Each therefore sits on a\n// different background, which is why the interaction styles below are keyed\n// by variant too — a state layer composites an 'on-color' over whatever the\n// container already is, so it cannot be written once for all three.\n//\n// color-mix() is inlined at each property rather than factored into a helper:\n// @stylexjs/babel-plugin only statically recognizes expressions written\n// directly as property values. Button's header comment records the same\n// constraint.\n// Windows High Contrast and the rest of the forced-colours modes. Spelled\n// here rather than imported, for the reason src/field/styles.ts records: the\n// StyleX compiler resolves a constant across files only out of a `.stylex.ts`\n// module, and the generated one holds design tokens rather than queries.\nconst FORCED_COLORS = '@media (forced-colors: active)';\nconst styles = {\n base: {\n kaIpWk: \"x62ce2h\",\n kMzoRj: \"xc342km\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x1heor9g\",\n k1xSpc: \"x1lliihq\",\n kVQacm: \"x7giv3\",\n kHjlTd: \"xj0a0fe\",\n kVAEAm: \"x1n2onr6\",\n kybGjl: \"x1hl2dhg\",\n $$css: true\n },\n content: {\n kB7OPa: \"x9f619\",\n k1xSpc: \"x1lliihq\",\n kAzted: \"x1us19tq\",\n $$css: true\n },\n elevated: {\n kWkggS: \"x1vnz5z6\",\n kGVxlE: \"x19efjv6\",\n $$css: true\n },\n filled: {\n kWkggS: \"x1rrhr5q\",\n $$css: true\n },\n interactive: {\n kkrTdU: \"x1ypdohk\",\n kVVagm: \"xln7xf2\",\n kzqmXN: \"xh8yej3\",\n k9WMMc: \"x1yc453h\",\n $$css: true\n },\n interactiveBoundary: {\n kVAM5u: \"x1ylmb6m\",\n ksu8eU: \"xx61lck\",\n kMzoRj: \"xc342km x13rsnn2\",\n $$css: true\n },\n outlined: {\n kWkggS: \"x14s9m32\",\n kVAM5u: \"x133yhug\",\n ksu8eU: \"x1y0btm7\",\n kMzoRj: \"xmkeg23\",\n $$css: true\n },\n paddingDefault: {\n kmVPX3: \"xgc26li\",\n $$css: true\n },\n paddingNone: {\n kmVPX3: \"x1717udv\",\n $$css: true\n }\n};\n\n// A pointer that can hover: a mouse or a trackpad, not a finger. An\n// interactive card is a plain element React Aria does not host, so it has no\n// `isHovered` to draw its hover layer from, and Chromium leaves `:hover` on\n// whatever a touch last tapped — a card tapped and then navigated back to\n// stayed lifted. Inside this query a touch screen draws no hover at all. A\n// touchscreen laptop still matches it for its trackpad, which is the limit of\n// asking the device rather than the event.\nconst HOVER_CAPABLE = '@media (hover: hover)';\n\n// The state layers, from pseudo-classes, since the card has no render state\n// to read — see `HOVER_CAPABLE`.\n// `:active` is written twice, bare for a touch and again inside the query.\n// StyleX orders a rule by the sum of its conditions, so a hover inside the\n// query would otherwise come after a bare press and win while both held.\nconst interactionStyles = {\n elevated: {\n kWkggS: \"xu5m21g x17zbzf9 x1ru19e0 x1vnz5z6\",\n kGVxlE: \"x1g60mc1 x14zlms8 xqmo4o3 x19efjv6\",\n $$css: true\n },\n filled: {\n kWkggS: \"x1w49kxs x10l1pcx xt0lj0h x1rrhr5q\",\n $$css: true\n },\n outlined: {\n kWkggS: \"x1jqfdmz x1ie1ydn x1dau0i7 x14s9m32\",\n $$css: true\n }\n};\n\n// Typed as the attributes a <div> accepts, because that is the surface every\n// element this can render shares. Anything element-specific — a button's\n// `type`, an anchor's `href` — would be wrong for the others, and does not\n// need to be here anyway: those are written on the element handed to\n// `render`, where TypeScript checks them against that element's own props.\ntype CardProps = {\n /**\n * Makes the card the thing you press: it ripples, lifts on hover, and takes\n * a focus ring. Renders a `<button>` unless `render` says otherwise. Leave\n * it off for a card that merely holds content, including one containing its\n * own buttons.\n * @default false\n */\n interactive?: boolean;\n /**\n * `none` removes the card's own padding, for a card whose children run to\n * its edges — a list of rows separated by rules.\n * @default 'default'\n */\n padding?: 'default' | 'none';\n /**\n * How the card separates itself from the page: `elevated` casts a shadow,\n * `filled` sits on a darker surface, `outlined` draws a border.\n * @default 'elevated'\n */\n variant?: CardVariant;\n} & RenderComponentProps<'div'>;\ntype CardVariant = 'elevated' | 'filled' | 'outlined';\n\n/**\n * A surface holding related content. `render` decides which element that\n * surface is, so a card that navigates can be a real `<a href>` — announced\n * as a link and opening in a new tab on a modifier click, which a `<button>`\n * with an onClick does neither of.\n *\n * `interactive` and `render` are separate axes. `interactive` says the card\n * is pressable and gives it the ripple, the hover lift, and a focus ring;\n * `render` says what it is. A pressable card with no `render` is a\n * `<button>`, which is the right default for one that acts rather than\n * navigates.\n */\nfunction Card({\n children,\n interactive = false,\n onClick,\n onContextMenu,\n onPointerCancel,\n onPointerDown,\n onPointerLeave,\n onPointerUp,\n padding = 'default',\n render,\n variant = 'elevated',\n ...props\n}: CardProps) {\n // The consumer's own pointer handlers are handed to useRipple to merge\n // rather than spread over its handlers afterwards, which is what Button\n // does and for the same reason: a plain spread means whichever object\n // comes last silently wins, so an onPointerDown on the call site would\n // replace the one driving the ripple and the card would stop rippling.\n const ripple = useRipple(interactive, {\n onClick,\n onContextMenu,\n onPointerCancel,\n onPointerDown,\n onPointerLeave,\n onPointerUp\n });\n const padded = padding === 'none' ? styles.paddingNone : styles.paddingDefault;\n return useRender({\n defaultTagName: interactive ? 'button' : 'div',\n props: {\n ...props,\n // Only when the default <button> is what renders. On an element the\n // call site chose, `type` is either meaningless or wrong — an <a>'s\n // `type` is a hint about the MIME type of what it links to — and that\n // element's own attributes are the call site's to write.\n ...(interactive && render === undefined ? {\n type: 'button'\n } : undefined),\n ...ripple.handlers,\n children: <>\n {interactive ? <span className=\"x9f619 x1lliihq x1us19tq\">{children}</span> : children}\n {ripple.surface}\n </>,\n ...mergeStyles(stylex.props(styles.base, styles[variant], padded, interactive && styles.interactive, interactive && variant !== 'outlined' && styles.interactiveBoundary, interactive && focus.ring, interactive && interactionStyles[variant]), props)\n },\n render\n });\n}\nexport type { CardProps, CardVariant };\nexport default Card;"],"mappings":";;;;;;;;;AA0BA,MAAMc,SAAS;CACbC,MAAM;EACJC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,SAAS;EACPR,QAAQ;EACRE,QAAQ;EACRO,QAAQ;EACRF,OAAO;CACT;CACAG,UAAU;EACRC,QAAQ;EACRC,QAAQ;EACRL,OAAO;CACT;CACAM,QAAQ;EACNF,QAAQ;EACRJ,OAAO;CACT;CACAO,aAAa;EACXC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRX,OAAO;CACT;CACAY,qBAAqB;EACnBC,QAAQ;EACRC,QAAQ;EACRtB,QAAQ;EACRQ,OAAO;CAC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AAZ,EAAA,MAAAe,OAAAM;EAAArB,EAAA,MAAAyB;EAAAzB,EAAA,MAAAkB;EAAAlB,EAAA,MAAAuB;EAAAvB,EAAA,MAAA2B;CAAA,OAAAA,MAAA3B,EAAA;CAAA,IAAA4B;CAAA,IAAA5B,EAAA,QAAAU,UAAAV,EAAA,QAAA2B,OAAA3B,EAAA,QAAAiB,IAAA;EAjBcW,MAAA;GAAAC,gBACCZ;GAA8BL,OACvCe;GAeNjB;EAEH;EAACV,EAAA,MAAAU;EAAAV,EAAA,MAAA2B;EAAA3B,EAAA,MAAAiB;EAAAjB,EAAA,MAAA4B;CAAA,OAAAA,MAAA5B,EAAA;CAAA,OAnBM/C,UAAU2E,GAmBhB;AAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["c","_c","MouseEvent","stylex","cloneElement","isValidElement","RenderComponentProps","useRipple","useRender","focus","mergeStyles","colors","radii","shadows","spacing","stateLayerOpacity","FORCED_COLORS","styles","base","kaIpWk","kMzoRj","kB7OPa","kMwMTN","k1xSpc","kVQacm","kHjlTd","kVAEAm","kybGjl","$$css","content","kAzted","disabled","kVAM5u","kkrTdU","disabledContent","kSiTet","disabledElevated","kWkggS","kGVxlE","disabledFilled","disabledOutlined","elevated","filled","interactive","kVVagm","kzqmXN","k9WMMc","interactiveBoundary","ksu8eU","outlined","paddingDefault","kmVPX3","paddingNone","HOVER_CAPABLE","interactionStyles","CardProps","isDisabled","padding","variant","CardVariant","Card","t0","$","children","t1","t2","onClick","onContextMenu","onPointerCancel","onPointerDown","onPointerLeave","onPointerUp","t3","render","t4","props","undefined","t5","t6","ripple","padded","t7","t8","type","t9","handlers","t10","disabledAttributes","t11","0","className","1","t12","surface","t13","ring","disabledStyles","t14","t15","withoutActivation","t16","defaultTagName","preventDefault","event","Record","href","tabIndex","_c","props","stylex.props"],"sources":["../../../src/components/card/index.tsx"],"sourcesContent":["'use client';\n\nimport type { MouseEvent } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { cloneElement, isValidElement } from 'react';\nimport type { RenderComponentProps } from '../../render/useRender';\nimport { useRipple } from '../../hooks/useRipple';\nimport { useRender } from '../../render/useRender';\nimport { focus } from '../../styles/focus';\nimport { mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, radii, shadows, spacing, stateLayerOpacity } from '../../tokens/design.tokens.stylex';\n\n// The three variants differ only in how they separate themselves from the\n// page: a shadow, a darker fill, or a border. Each therefore sits on a\n// different background, which is why the interaction styles below are keyed\n// by variant too — a state layer composites an 'on-color' over whatever the\n// container already is, so it cannot be written once for all three.\n//\n// color-mix() is inlined at each property rather than factored into a helper:\n// @stylexjs/babel-plugin only statically recognizes expressions written\n// directly as property values. Button's header comment records the same\n// constraint.\n// Windows High Contrast and the rest of the forced-colours modes. Spelled\n// here rather than imported, for the reason src/field/styles.ts records: the\n// StyleX compiler resolves a constant across files only out of a `.stylex.ts`\n// module, and the generated one holds design tokens rather than queries.\nconst FORCED_COLORS = '@media (forced-colors: active)';\nconst styles = {\n base: {\n kaIpWk: \"x62ce2h\",\n kMzoRj: \"xc342km\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x1heor9g\",\n k1xSpc: \"x1lliihq\",\n kVQacm: \"x7giv3\",\n kHjlTd: \"xj0a0fe\",\n kVAEAm: \"x1n2onr6\",\n kybGjl: \"x1hl2dhg\",\n $$css: true\n },\n content: {\n kB7OPa: \"x9f619\",\n k1xSpc: \"x1lliihq\",\n kAzted: \"x1us19tq\",\n $$css: true\n },\n disabled: {\n kVAM5u: \"xmnqt3w\",\n kkrTdU: \"xt0e3qv\",\n $$css: true\n },\n disabledContent: {\n kSiTet: \"x1ppv7y9\",\n $$css: true\n },\n disabledElevated: {\n kWkggS: \"x1jfv5e4\",\n kGVxlE: \"x1gnnqk1\",\n $$css: true\n },\n disabledFilled: {\n kWkggS: \"x6mg230\",\n $$css: true\n },\n disabledOutlined: {\n kVAM5u: \"x1y3ic1l xmnqt3w\",\n $$css: true\n },\n elevated: {\n kWkggS: \"x1vnz5z6\",\n kGVxlE: \"x19efjv6\",\n $$css: true\n },\n filled: {\n kWkggS: \"x1rrhr5q\",\n $$css: true\n },\n interactive: {\n kkrTdU: \"x1ypdohk\",\n kVVagm: \"xln7xf2\",\n kzqmXN: \"xh8yej3\",\n k9WMMc: \"x1yc453h\",\n $$css: true\n },\n interactiveBoundary: {\n kVAM5u: \"x1ylmb6m\",\n ksu8eU: \"xx61lck\",\n kMzoRj: \"xc342km x13rsnn2\",\n $$css: true\n },\n outlined: {\n kWkggS: \"x14s9m32\",\n kVAM5u: \"x133yhug\",\n ksu8eU: \"x1y0btm7\",\n kMzoRj: \"xmkeg23\",\n $$css: true\n },\n paddingDefault: {\n kmVPX3: \"xgc26li\",\n $$css: true\n },\n paddingNone: {\n kmVPX3: \"x1717udv\",\n $$css: true\n }\n};\n\n// A pointer that can hover: a mouse or a trackpad, not a finger. An\n// interactive card is a plain element React Aria does not host, so it has no\n// `isHovered` to draw its hover layer from, and Chromium leaves `:hover` on\n// whatever a touch last tapped — a card tapped and then navigated back to\n// stayed lifted. Inside this query a touch screen draws no hover at all. A\n// touchscreen laptop still matches it for its trackpad, which is the limit of\n// asking the device rather than the event.\nconst HOVER_CAPABLE = '@media (hover: hover)';\n\n// The state layers, from pseudo-classes, since the card has no render state\n// to read — see `HOVER_CAPABLE`.\n// `:active` is written twice, bare for a touch and again inside the query.\n// StyleX orders a rule by the sum of its conditions, so a hover inside the\n// query would otherwise come after a bare press and win while both held.\nconst interactionStyles = {\n elevated: {\n kWkggS: \"xu5m21g x17zbzf9 x1ru19e0 x1vnz5z6\",\n kGVxlE: \"x1g60mc1 x14zlms8 xqmo4o3 x19efjv6\",\n $$css: true\n },\n filled: {\n kWkggS: \"x1w49kxs x10l1pcx xt0lj0h x1rrhr5q\",\n $$css: true\n },\n outlined: {\n kWkggS: \"x1jqfdmz x1ie1ydn x1dau0i7 x14s9m32\",\n $$css: true\n }\n};\n\n// Typed as the attributes a <div> accepts, because that is the surface every\n// element this can render shares. Anything element-specific — a button's\n// `type`, an anchor's `href` — would be wrong for the others, and does not\n// need to be here anyway: those are written on the element handed to\n// `render`, where TypeScript checks them against that element's own props.\ntype CardProps = {\n /**\n * Makes the card the thing you press: it ripples, lifts on hover, and takes\n * a focus ring. Renders a `<button>` unless `render` says otherwise. Leave\n * it off for a card that merely holds content, including one containing its\n * own buttons.\n * @default false\n */\n interactive?: boolean;\n /**\n * Turns an interactive card off: it fades as the cards page draws a\n * disabled card, stops rippling and lifting, and takes no press. The\n * default `<button>` is disabled outright. An element of the call site's\n * own through `render` is marked `aria-disabled`, and an element handed in\n * directly loses its `href`, `tabIndex` and `onClick`, so a link card can\n * neither be followed nor focused. Has no effect on a card that is not\n * `interactive`, which cannot be pressed to begin with.\n * @default false\n */\n isDisabled?: boolean;\n /**\n * `none` removes the card's own padding, for a card whose children run to\n * its edges — a list of rows separated by rules.\n * @default 'default'\n */\n padding?: 'default' | 'none';\n /**\n * How the card separates itself from the page: `elevated` casts a shadow,\n * `filled` sits on a darker surface, `outlined` draws a border.\n * @default 'elevated'\n */\n variant?: CardVariant;\n} & RenderComponentProps<'div'>;\ntype CardVariant = 'elevated' | 'filled' | 'outlined';\n\n/**\n * A surface holding related content. `render` decides which element that\n * surface is, so a card that navigates can be a real `<a href>` — announced\n * as a link and opening in a new tab on a modifier click, which a `<button>`\n * with an onClick does neither of.\n *\n * `interactive` and `render` are separate axes. `interactive` says the card\n * is pressable and gives it the ripple, the hover lift, and a focus ring;\n * `render` says what it is. A pressable card with no `render` is a\n * `<button>`, which is the right default for one that acts rather than\n * navigates.\n */\nfunction Card({\n children,\n interactive = false,\n isDisabled = false,\n onClick,\n onContextMenu,\n onPointerCancel,\n onPointerDown,\n onPointerLeave,\n onPointerUp,\n padding = 'default',\n render,\n variant = 'elevated',\n ...props\n}: CardProps) {\n // The consumer's own pointer handlers are handed to useRipple to merge\n // rather than spread over its handlers afterwards, which is what Button\n // does and for the same reason: a plain spread means whichever object\n // comes last silently wins, so an onPointerDown on the call site would\n // replace the one driving the ripple and the card would stop rippling.\n const disabled = interactive && isDisabled;\n const ripple = useRipple(interactive && !disabled, {\n onClick: disabled ? undefined : onClick,\n onContextMenu,\n onPointerCancel,\n onPointerDown,\n onPointerLeave,\n onPointerUp\n });\n const padded = padding === 'none' ? styles.paddingNone : styles.paddingDefault;\n return useRender({\n defaultTagName: interactive ? 'button' : 'div',\n props: {\n ...props,\n // Only when the default <button> is what renders. On an element the\n // call site chose, `type` is either meaningless or wrong — an <a>'s\n // `type` is a hint about the MIME type of what it links to — and that\n // element's own attributes are the call site's to write.\n ...(interactive && render === undefined ? {\n type: 'button'\n } : undefined),\n ...ripple.handlers,\n // After the ripple's handlers, whose click it replaces while disabled.\n ...disabledAttributes(disabled, render),\n children: <>\n {interactive ? <span {...{\n 0: {\n className: \"x9f619 x1lliihq x1us19tq\"\n },\n 1: {\n className: \"x9f619 x1lliihq x1us19tq x1ppv7y9\"\n }\n }[!!disabled << 0]}>\n {children}\n </span> : children}\n {ripple.surface}\n </>,\n ...mergeStyles(stylex.props(styles.base, styles[variant], padded, interactive && styles.interactive, interactive && variant !== 'outlined' && styles.interactiveBoundary, interactive && !disabled && focus.ring, interactive && !disabled && interactionStyles[variant], disabled && styles.disabled, disabled && disabledStyles[variant]), props)\n },\n render: disabled ? withoutActivation(render) : render\n });\n}\nconst disabledStyles = {\n elevated: styles.disabledElevated,\n filled: styles.disabledFilled,\n outlined: styles.disabledOutlined\n};\n\n// How a disabled card says so, by the element it renders. The default\n// <button> takes the native `disabled`, which removes it from the tab order\n// and fires nothing on a press. Any other element has no such attribute, so\n// it is marked `aria-disabled` for assistive technology, and a click on it\n// has its default prevented, which is what would follow a link — the click\n// a function passed as `render` wires up is its own, and runs first.\nfunction disabledAttributes(disabled: boolean, render: CardProps['render']) {\n if (!disabled) {\n return undefined;\n }\n if (render === undefined) {\n return {\n disabled: true\n };\n }\n return {\n 'aria-disabled': true,\n onClick: preventDefault\n };\n}\nfunction preventDefault(event: MouseEvent) {\n event.preventDefault();\n}\n\n// An element handed in as `render`, without what would still activate it: an\n// element's own props win over the card's, so an <a href> stays a link the\n// card cannot switch off from outside. Without an `href` it is neither\n// followed nor focusable, and without its `tabIndex` it is not focusable\n// either. Its `onClick` is replaced rather than removed, since a key the\n// element carries wins even when its value is undefined, and would drop the\n// card's own prevented click along with it.\nfunction withoutActivation(render: CardProps['render']): CardProps['render'] {\n if (!isValidElement<Record<string, unknown>>(render)) {\n return render;\n }\n return cloneElement(render, {\n href: undefined,\n onClick: preventDefault,\n tabIndex: undefined\n });\n}\nexport type { CardProps, CardVariant };\nexport default Card;"],"mappings":";;;;;;;;;;AA4BA,MAAMiB,SAAS;CACbC,MAAM;EACJC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,SAAS;EACPR,QAAQ;EACRE,QAAQ;EACRO,QAAQ;EACRF,OAAO;CACT;CACAG,UAAU;EACRC,QAAQ;EACRC,QAAQ;EACRL,OAAO;CACT;CACAM,iBAAiB;EACfC,QAAQ;EACRP,OAAO;CACT;CACAQ,kBAAkB;EAChBC,QAAQ;EACRC,QAAQ;EACRV,OAAO;CACT;CACAW,gBAAgB;EACdF,QAAQ;EACRT,OAAO;CACT;CACAY,kBAAkB;EAChBR,QAAQ;EACRJ,OAAO;CACT;CACAa,UAAU;EACRJ,QAAQ;EACRC,QAAQ;EACRV,OAAO;CACT;CACAc,QAAQ;EACNL,QAAQ;EACRT,OAAO;CACT;CACAe,aAAa;EACXV,QAAQ;EACRW,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRlB,OAAO;CACT;CACAmB,qBAAqB;EACnBf,QAAQ;EACRgB,QAAQ;EACR5B,QAAQ;EACRQ,OAAO;CACT;CACAqB,UAAU;EACRZ,QAAQ;EACRL,QAAQ;EACRgB,QAAQ;EACR5B,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OA9BMtD,UAAU4F,GA8BhB;AAAC;AAEJ,MAAMJ,iBAAiB;CACrBvD,UAAUxB,OAAOmB;CACjBM,QAAQzB,OAAOsB;CACfU,UAAUhC,OAAOuB;AACnB;AAQA,SAAS+C,mBAAmBxD,UAAmB0C,QAA6B;CAC1E,IAAI,CAAC1C,UACH;CAEF,IAAI0C,WAAWG,KAAAA,GACb,OAAO,EACL7C,UAAU,KACZ;CAEF,OAAO;EACL,iBAAiB;EACjBmC,SAASoC;CACX;AACF;AACA,SAASA,eAAeC,OAAmB;CACzCA,MAAMD,eAAe;AACvB;AASA,SAASH,kBAAkB1B,QAAkD;CAC3E,IAAI,CAACpE,eAAwCoE,MAAM,GACjD,OAAOA;CAET,OAAOrE,aAAaqE,QAAQ;EAC1BgC,MAAM7B,KAAAA;EACNV,SAASoC;EACTI,UAAU9B,KAAAA;CACZ,CAAC;AACH"}
|
|
@@ -5,6 +5,7 @@ import { mergeStatefulStyles, mergeStyles } from "../../styles/merge.js";
|
|
|
5
5
|
import { overlay } from "../../styles/overlay.js";
|
|
6
6
|
import { useHoldBottomEdge } from "../../hooks/useBottomEdge.js";
|
|
7
7
|
import { useScrollable } from "../../hooks/useScrollable.js";
|
|
8
|
+
import { OverlayScope } from "../../overlay/index.js";
|
|
8
9
|
import { c } from "react/compiler-runtime";
|
|
9
10
|
import { createContext, useContext, useRef, useSyncExternalStore } from "react";
|
|
10
11
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -247,7 +248,7 @@ function DialogContent(t0) {
|
|
|
247
248
|
} else t6 = $[25];
|
|
248
249
|
let t7;
|
|
249
250
|
if ($[26] !== container || $[27] !== defaultOpen || $[28] !== isDismissable || $[29] !== isKeyboardDismissDisabled || $[30] !== isOpen || $[31] !== onOpenChange || $[32] !== t2 || $[33] !== t6) {
|
|
250
|
-
t7 = /* @__PURE__ */ jsx(ModalOverlay, {
|
|
251
|
+
t7 = /* @__PURE__ */ jsx(OverlayScope, { children: /* @__PURE__ */ jsx(ModalOverlay, {
|
|
251
252
|
defaultOpen,
|
|
252
253
|
isDismissable,
|
|
253
254
|
isKeyboardDismissDisabled,
|
|
@@ -256,7 +257,7 @@ function DialogContent(t0) {
|
|
|
256
257
|
UNSTABLE_portalContainer: container,
|
|
257
258
|
...t2,
|
|
258
259
|
children: t6
|
|
259
|
-
});
|
|
260
|
+
}) });
|
|
260
261
|
$[26] = container;
|
|
261
262
|
$[27] = defaultOpen;
|
|
262
263
|
$[28] = isDismissable;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["c","_c","HTMLAttributes","ReactNode","RefAttributes","ClassNameOrFunction","DialogTriggerProps","HeadingProps","ModalOverlayProps","ModalRenderProps","DialogProps","RACDialogProps","StyleOrFunction","stylex","createContext","useContext","useMemo","useRef","useSyncExternalStore","DialogTrigger","Heading","Modal","ModalOverlay","Dialog","RACDialog","useHoldBottomEdge","useScrollable","mergeRefs","mergeStatefulStyles","mergeStyles","overlay","colors","media","motion","radii","shadows","spacing","typography","FORCED_COLORS","FULL_SCREEN","scaleIn","slideInFromBottom","styles","body","kB7OPa","kMwMTN","k1xSpc","kXwgrk","kzQI83","kMv6JI","kGuDYH","k63SB2","kOIVth","kb6lSQ","kLWn49","kORKVm","kGO01o","kLKAdn","kg3NbH","$$css","centre","kGNEyG","kjj79g","kmVPX3","basic","BasicContext","Omit","children","t0","$","props","t1","DialogBody","ref","callerRef","isBasic","scrollable","undefined","t2","merged","t3","t4","modalBodyRing","t5","DialogContent","className","container","defaultOpen","isKeyboardDismissDisabled","isOpen","onOpenChange","style","isDismissable","role","scrim","0","1","Symbol","for","modalDialog","t6","t7","t8","DialogFooter","useFullScreen","DialogHeader","DialogTitle","isFullScreen","window","matchMedia","matches","isFullScreenOnServer","subscribeToFullScreen","listener","query","addEventListener","removeEventListener","Body","Content","Footer","Header","Title","DialogContentProps","Element","Pick","DialogTitleProps","Dialog","_c","props","stylex.props","RACDialog"],"sources":["../../../src/components/dialog/index.tsx"],"sourcesContent":["'use client';\n\nimport type { HTMLAttributes, ReactNode, RefAttributes } from 'react';\nimport type { ClassNameOrFunction, DialogTriggerProps, HeadingProps, ModalOverlayProps, ModalRenderProps, DialogProps as RACDialogProps, StyleOrFunction } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { createContext, useContext, useMemo, useRef, useSyncExternalStore } from 'react';\nimport { DialogTrigger, Heading, Modal, ModalOverlay, Dialog as RACDialog } from 'react-aria-components';\nimport { useHoldBottomEdge } from '../../hooks/useBottomEdge';\nimport { useScrollable } from '../../hooks/useScrollable';\nimport { mergeRefs } from '../../render/ref';\nimport { mergeStatefulStyles, mergeStyles } from '../../styles/merge';\nimport { overlay } from '../../styles/overlay';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, media, motion, radii, shadows, spacing, typography } from '../../tokens/design.tokens.stylex';\n\n// Windows High Contrast and the rest of the forced-colours modes. Spelled\n// here rather than imported, for the reason src/field/styles.ts records: the\n// StyleX compiler resolves a constant across files only out of a `.stylex.ts`\n// module, and the generated one holds design tokens rather than queries.\nconst FORCED_COLORS = '@media (forced-colors: active)';\n\n// The window size the full-screen dialog is drawn at, which the styles read\n// as `media.belowMedium`. Spelled again for `matchMedia`, which is the one\n// thing in this file that has to know it outside a stylesheet: the footer\n// holds the window's bottom edge only there. See `useFullScreen`.\nconst FULL_SCREEN = '(width < 600px)';\n\n// The dialogs page's two dialogs, which are one component here for the same\n// reason Sheet's two presentations are: the page pairs them by window size\n// rather than offering a choice. Above the medium breakpoint it is the basic\n// dialog — a container on surface container high with a 28dp corner, between\n// 280 and 560dp wide, centred over the scrim, with 24dp of padding all round,\n// 16dp between the headline and the body and 24dp between the body and the\n// actions. Below it the same dialog fills the window as the page's\n// full-screen dialog: square corners, a 56dp header with the headline and a\n// divider under it, and a 56dp action bar with a divider over it.\n//\n// The pairing is for a dialog that is a task, which needs the room. An alert\n// dialog is a question with two or three answers, and the page keeps the\n// full-screen dialog for tasks, so `role=\"alertdialog\"` stays the basic dialog\n// at every width. Filled to a phone's window it read as a headline at the top\n// of the screen and its answers at the bottom, with nothing between them but\n// the chrome. The `basic` styles below are how: each restates, without the\n// breakpoint, the properties the paired styles change below it.\n//\n// The headline is headline-small on surface, the body body-medium on surface\n// variant, and the buttons are the call site's — the page draws text buttons\n// there, which is `Button`'s `text` variant.\n//\n// Two things the page draws are the call site's rather than the component's.\n// The optional icon above the headline, which the page centres the headline\n// and body with when it is there, is anything a `Dialog.Header` is given; a\n// dialog that wants it centres its own header. And the dividers a basic\n// dialog may show around a scrolling body are left out, since the page has\n// them only for that case and the body here scrolls with the header and\n// footer pinned either side of it, which is what they were marking.\n//\n// React Aria's overlay is three nested elements — the scrim, the container,\n// and the dialog inside it — so the styles split the same way, and the scrim\n// and the element carrying the dialog role are the ones every modal overlay\n// shares.\nconst scaleIn = \"xnirehn-B\";\nconst slideInFromBottom = \"x1itx4s0-B\";\nconst styles = {\n body: {\n kB7OPa: \"x9f619\",\n kMwMTN: \"x1w5n3ug\",\n k1xSpc: \"x78zum5\",\n kXwgrk: \"xdt5ytf\",\n kzQI83: \"x1iyjqo2\",\n kMv6JI: \"xpo2rfv\",\n kGuDYH: \"x193rfdd\",\n k63SB2: \"x1hews6w\",\n kOIVth: \"xxj4525\",\n kb6lSQ: \"xn43zvd\",\n kLWn49: \"xv61bfh\",\n kORKVm: \"x1odjw0f\",\n kGO01o: \"x1az23kl x18d9i69\",\n kLKAdn: \"x886u18 xexx8yu x3reb9c\",\n kg3NbH: \"xg0ps1x\",\n $$css: true\n },\n centre: {\n kGNEyG: \"x6s0dn4\",\n k1xSpc: \"x78zum5\",\n kjj79g: \"xl56j7k\",\n kmVPX3: \"x1apw6a7 xd76zvj\",\n $$css: true\n }\n};\n\n// The basic dialog at every width, for an alert dialog. Each entry is the\n// above-breakpoint value of every property its namesake in `styles` changes\n// below the breakpoint, laid over that namesake, so a property it leaves out\n// is the same in both presentations already. A value changed above the\n// breakpoint there has to change here too, which `index.test.tsx` checks by\n// comparing an alert dialog on a phone with any dialog on a desktop.\nconst basic = {\n body: {\n kLKAdn: \"x886u18 xexx8yu\",\n $$css: true\n },\n centre: {\n kmVPX3: \"x1apw6a7\",\n $$css: true\n }\n};\n\n// Whether this dialog is the basic one at every width. Content decides it from\n// the role and the parts read it, since each part carries its own share of\n// the full-screen presentation.\nconst BasicContext = createContext(false);\ntype DialogProps = Omit<DialogTriggerProps, 'children'> & {\n children?: ReactNode;\n};\n\n/**\n * A modal dialog centred over the page, and the same dialog filling the\n * window below the medium breakpoint — the dialogs page's basic and\n * full-screen dialogs, paired by window size as the page pairs them. An\n * alert dialog stays the basic one at every width. Open state is React\n * Aria's: pass `isOpen` with `onOpenChange` to control it, or\n * `defaultOpen` to let it keep its own.\n *\n * Composed rather than configured by props, as `Sheet` is, since a dialog's\n * header, body and actions all take arbitrary content — the parts are\n * `Dialog.Content`, `Dialog.Header`, `Dialog.Title`, `Dialog.Body` and\n * `Dialog.Footer`. A `Button` or `IconButton` placed directly inside\n * `Dialog` opens it, and one given `slot=\"close\"` anywhere inside the\n * content closes it; neither needs a part of its own.\n *\n * `Dialog` is the trigger's half, so a dialog nothing on the page opens — one\n * a route shows, or a menu item raises — leaves it out and passes `isOpen`\n * and `onOpenChange` to `Dialog.Content` instead. Wrapped in `Dialog` with no\n * button inside it, React Aria warns that its press responder found nothing\n * to press.\n */\nfunction Dialog({\n children,\n ...props\n}: DialogProps) {\n return <DialogTrigger {...props}>{children}</DialogTrigger>;\n}\nfunction DialogBody({\n ref: callerRef,\n ...props\n}: HTMLAttributes<HTMLDivElement> & RefAttributes<HTMLDivElement>) {\n const isBasic = useContext(BasicContext);\n const ref = useRef<HTMLDivElement>(null);\n // A body its content runs past is a tab stop, so a keyboard can scroll it\n // when nothing inside it takes focus; a call site's own tabIndex still\n // wins. See useScrollable.\n const scrollable = useScrollable(ref);\n // The body measures itself through its own ref, and the call site's lands\n // on the same element.\n const merged = useMemo(() => mergeRefs(ref, callerRef ?? undefined), [callerRef]);\n return <div\n // oxlint-disable-next-line jsx-a11y/no-noninteractive-tabindex -- a scroll container with nothing focusable inside is otherwise out of a keyboard's reach, which axe's scrollable-region-focusable reports\n tabIndex={scrollable ? 0 : undefined} {...props} ref={merged} {...mergeStyles(stylex.props(styles.body, isBasic && basic.body, overlay.modalBodyRing), props)} />;\n}\n\n/**\n * The dialog itself, and the scrim behind it. Everything the dialog shows\n * goes in here; the trigger stays outside it, since the trigger lives in the\n * page while this is portalled out to the end of the body.\n *\n * `role=\"alertdialog\"` is React Aria's, for a dialog interrupting with\n * something that has to be answered before the page carries on — a screen\n * reader announces it rather than waiting to be asked. It also keeps the\n * dialog the basic one below the medium breakpoint, centred and sized to its\n * content, where a dialog of the default role fills the window.\n *\n * A press on the scrim closes the dialog unless `isDismissable` says\n * otherwise, which is the same default `Sheet` takes and the reverse of\n * React Aria's own. Escape is a separate prop, `isKeyboardDismissDisabled`,\n * and `isDismissable` says nothing about it — so a dialog that has to be\n * answered from one of its actions, as an alert dialog usually does, turns\n * off both.\n *\n * Inside `Dialog`, the open state is the trigger's. On its own, with no\n * trigger, it is this part's: `isOpen` with `onOpenChange` controls it, and\n * a `slot=\"close\"` button, Escape and the scrim all report through\n * `onOpenChange`, as they would to `Dialog`.\n *\n * The scrim draws at `z-index: 900`, over any page content layered below\n * that, such as a sticky header, and the panel draws inside it. A\n * `Snackbar` draws at 1000, so a toast raised from inside the dialog is read\n * over it, and React Aria's popovers and menus draw above both.\n */\nfunction DialogContent({\n children,\n className,\n container,\n defaultOpen,\n isDismissable = true,\n isKeyboardDismissDisabled,\n isOpen,\n onOpenChange,\n ref,\n style,\n ...props\n}: DialogContentProps & RefAttributes<HTMLDivElement>) {\n const isBasic = props.role === 'alertdialog';\n return <BasicContext value={isBasic}>\n <ModalOverlay defaultOpen={defaultOpen} isDismissable={isDismissable} isKeyboardDismissDisabled={isKeyboardDismissDisabled} isOpen={isOpen} onOpenChange={onOpenChange}\n // oxlint-disable-next-line typescript/no-deprecated -- its replacement, UNSAFE_PortalProvider, is not exported by react-aria-components\n UNSTABLE_portalContainer={container} {...stylex.props(overlay.scrim, styles.centre, isBasic && basic.centre)}>\n <Modal\n // The panel, where the call site's class and style land, rather\n // than the dialog inside it, which takes the rest of the props.\n ref={ref} {...mergeStatefulStyles({\n 0: {\n className: \"x1n1nwrg x1u6grsq xbhiib0 x1ebxanj x16dv9tl xvkjz1l xt7dq6l x1ju3lih x1w1tqly x19pkqky x1f120ba xx61lck x1gb867b x13rsnn2 x1udv5rz x9f619 x139gbkf x78zum5 xdt5ytf xh8yej3 xmz0i5r x27kpxv x6iovhr x1u2d2a2 xxzqys8 xb3r6kr x9xqwrn xg8iv3o x19b5e0v xsds98l\"\n },\n 1: {\n className: \"x1n1nwrg x1u6grsq x16dv9tl xvkjz1l x1w1tqly x13rsnn2 x1udv5rz x9f619 x139gbkf x78zum5 xdt5ytf xh8yej3 xmz0i5r xb3r6kr xbhiib0 xt7dq6l x19pkqky xx61lck x27kpxv x1u2d2a2\"\n }\n }[!!isBasic << 0], {\n className,\n style\n })}>\n <RACDialog {...props} {...stylex.props(overlay.modalDialog)}>\n {children}\n </RACDialog>\n </Modal>\n </ModalOverlay>\n </BasicContext>;\n}\n\n/**\n * The dialog's actions. Full screen they are the action bar on the window's\n * bottom edge, which a toast rises clear of while the dialog is open, so a\n * tap meant for one of them never lands on the toast's own action instead.\n */\nfunction DialogFooter({\n ref: callerRef,\n ...props\n}: HTMLAttributes<HTMLDivElement> & RefAttributes<HTMLDivElement>) {\n const isBasic = useContext(BasicContext);\n const ref = useRef<HTMLDivElement>(null);\n useHoldBottomEdge(ref, useFullScreen() && !isBasic);\n // The footer measures itself through its own ref, and the call site's\n // lands on the same element.\n const merged = useMemo(() => mergeRefs(ref, callerRef ?? undefined), [callerRef]);\n return <div {...props} ref={merged} {...mergeStyles({\n 0: {\n className: \"x6s0dn4 x12smttz x1ejq31n x1vv4zg8 x178xt8z x9f619 x78zum5 x2lah0s x1a02dak x126z3so x13a6bvl xnvi70j x8i8c5o x1pr6p50 x13h71tw xs3zajk xg0ps1x\"\n },\n 1: {\n className: \"x6s0dn4 x12smttz x178xt8z x9f619 x78zum5 x2lah0s x1a02dak x126z3so x13a6bvl xg0ps1x x1ejq31n x8i8c5o x13h71tw\"\n }\n }[!!isBasic << 0], props)} />;\n}\nfunction DialogHeader(props: HTMLAttributes<HTMLDivElement> & RefAttributes<HTMLDivElement>) {\n const isBasic = useContext(BasicContext);\n return <div {...props} {...mergeStyles({\n 0: {\n className: \"x6s0dn4 x1j6faob x1sy0etr xf6te7g xso031l x9f619 x78zum5 x2lah0s x1gka490 x1qughib xnvi70j xzfxn0k x1pr6p50 x13h71tw xs3zajk xg0ps1x\"\n },\n 1: {\n className: \"x6s0dn4 x1j6faob xso031l x9f619 x78zum5 x2lah0s x1gka490 x1qughib xg0ps1x x1sy0etr xzfxn0k x13h71tw\"\n }\n }[!!isBasic << 0], props)} />;\n}\n\n/**\n * Names the dialog. Rendered through React Aria's title slot, which is what\n * points the dialog's `aria-labelledby` at it — a dialog without one\n * announces itself unnamed.\n */\nfunction DialogTitle(props: DialogTitleProps & RefAttributes<HTMLHeadingElement>) {\n const isBasic = useContext(BasicContext);\n return <Heading slot=\"title\" {...props} {...mergeStyles({\n 0: {\n className: \"x9f619 x139gbkf x1fz0g89 xl849ld xkb6epg xcji80f x76yrz5 x6ksu6j x1s1qhaa x1khanjg x1voeury xrr2tf9 x1ghz6dp xeuugli xj0a0fe\"\n },\n 1: {\n className: \"x9f619 x139gbkf x1ghz6dp xeuugli xj0a0fe x1fz0g89 xkb6epg x76yrz5 x1s1qhaa x1voeury\"\n }\n }[!!isBasic << 0], props)} />;\n}\n\n// Whether the window is at the size the full-screen dialog is drawn at, kept\n// current as it resizes. False on the server, where there is no window and\n// nothing is open.\nfunction isFullScreen() {\n return window.matchMedia(FULL_SCREEN).matches;\n}\nfunction isFullScreenOnServer() {\n return false;\n}\nfunction subscribeToFullScreen(listener: () => void) {\n const query = window.matchMedia(FULL_SCREEN);\n query.addEventListener('change', listener);\n return () => {\n query.removeEventListener('change', listener);\n };\n}\nfunction useFullScreen() {\n return useSyncExternalStore(subscribeToFullScreen, isFullScreen, isFullScreenOnServer);\n}\nDialog.Body = DialogBody;\nDialog.Content = DialogContent;\nDialog.Footer = DialogFooter;\nDialog.Header = DialogHeader;\nDialog.Title = DialogTitle;\n\n// The dialog's own props, plus the scrim's open state and dismissal settings\n// and the container's styling. A call site has no reason to know there are\n// three elements: `className` and `style` reach the container, which is the\n// one worth restyling, the open state and the dismissal settings reach the\n// scrim, and everything else lands on the dialog.\n//\n// `isDismissable` is declared here rather than picked with its siblings,\n// since the picked one carries React Aria's documentation, whose default is\n// the reverse of this component's.\ntype DialogContentProps = {\n /** A function may compute the class from the container's render state. */\n className?: ClassNameOrFunction<ModalRenderProps>;\n /**\n * Where to portal the dialog and scrim. Defaults to the container of the\n * `ThemeScope` around it, which keeps the dialog on that scope's tokens, or\n * to the end of `<body>` where there is none. A subtree themed through the\n * `themeScope` class has no container of its own, so point this inside it, or\n * the dialog renders outside and keeps the page's tokens.\n */\n container?: Element;\n /**\n * Whether a press on the scrim, outside the container, closes the\n * dialog. `true` here where React Aria's own default is `false`, the\n * same default `Sheet` takes. Escape is `isKeyboardDismissDisabled`'s,\n * and this says nothing about it — an alert dialog, which has to be\n * answered from one of its actions, turns off both.\n * @default true\n */\n isDismissable?: boolean;\n /** A function may compute the style from the container's render state. */\n style?: StyleOrFunction<ModalRenderProps>;\n} & Omit<RACDialogProps, 'className' | 'style'> & Pick<ModalOverlayProps, 'defaultOpen' | 'isKeyboardDismissDisabled' | 'isOpen' | 'onOpenChange'>;\ntype DialogTitleProps = HeadingProps;\nexport type { DialogContentProps, DialogProps, DialogTitleProps };\nexport { DialogBody, DialogContent, DialogFooter, DialogHeader, DialogTitle };\nexport default Dialog;"],"mappings":";;;;;;;;;;;;AAyBA,MAAMuC,cAAc;AAsCpB,MAAMG,SAAS;CACbC,MAAM;EACJC,QAAQ;EACRC,QA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SAAAT,gBAAA;CAAA,OACStF,qBAAqB8F,uBAAuBL,cAAcI,oBAAoB;AAAC;AAExFxF,SAAO8F,OAAO7C;AACdjD,SAAO+F,UAAUlC;AACjB7D,SAAOgG,SAAShB;AAChBhF,SAAOiG,SAASf;AAChBlF,SAAOkG,QAAQf"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["c","_c","HTMLAttributes","ReactNode","RefAttributes","ClassNameOrFunction","DialogTriggerProps","HeadingProps","ModalOverlayProps","ModalRenderProps","DialogProps","RACDialogProps","StyleOrFunction","stylex","createContext","useContext","useMemo","useRef","useSyncExternalStore","DialogTrigger","Heading","Modal","ModalOverlay","Dialog","RACDialog","useHoldBottomEdge","useScrollable","OverlayScope","mergeRefs","mergeStatefulStyles","mergeStyles","overlay","colors","media","motion","radii","shadows","spacing","typography","FORCED_COLORS","FULL_SCREEN","scaleIn","slideInFromBottom","styles","body","kB7OPa","kMwMTN","k1xSpc","kXwgrk","kzQI83","kMv6JI","kGuDYH","k63SB2","kOIVth","kb6lSQ","kLWn49","kORKVm","kGO01o","kLKAdn","kg3NbH","$$css","centre","kGNEyG","kjj79g","kmVPX3","basic","BasicContext","Omit","children","t0","$","props","t1","DialogBody","ref","callerRef","isBasic","scrollable","undefined","t2","merged","t3","t4","modalBodyRing","t5","DialogContent","className","container","defaultOpen","isKeyboardDismissDisabled","isOpen","onOpenChange","style","isDismissable","role","scrim","0","1","Symbol","for","modalDialog","t6","t7","t8","DialogFooter","useFullScreen","DialogHeader","DialogTitle","isFullScreen","window","matchMedia","matches","isFullScreenOnServer","subscribeToFullScreen","listener","query","addEventListener","removeEventListener","Body","Content","Footer","Header","Title","DialogContentProps","Element","Pick","DialogTitleProps","Dialog","_c","props","stylex.props","RACDialog"],"sources":["../../../src/components/dialog/index.tsx"],"sourcesContent":["'use client';\n\nimport type { HTMLAttributes, ReactNode, RefAttributes } from 'react';\nimport type { ClassNameOrFunction, DialogTriggerProps, HeadingProps, ModalOverlayProps, ModalRenderProps, DialogProps as RACDialogProps, StyleOrFunction } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { createContext, useContext, useMemo, useRef, useSyncExternalStore } from 'react';\nimport { DialogTrigger, Heading, Modal, ModalOverlay, Dialog as RACDialog } from 'react-aria-components';\nimport { useHoldBottomEdge } from '../../hooks/useBottomEdge';\nimport { useScrollable } from '../../hooks/useScrollable';\nimport { OverlayScope } from '../../overlay';\nimport { mergeRefs } from '../../render/ref';\nimport { mergeStatefulStyles, mergeStyles } from '../../styles/merge';\nimport { overlay } from '../../styles/overlay';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, media, motion, radii, shadows, spacing, typography } from '../../tokens/design.tokens.stylex';\n\n// Windows High Contrast and the rest of the forced-colours modes. Spelled\n// here rather than imported, for the reason src/field/styles.ts records: the\n// StyleX compiler resolves a constant across files only out of a `.stylex.ts`\n// module, and the generated one holds design tokens rather than queries.\nconst FORCED_COLORS = '@media (forced-colors: active)';\n\n// The window size the full-screen dialog is drawn at, which the styles read\n// as `media.belowMedium`. Spelled again for `matchMedia`, which is the one\n// thing in this file that has to know it outside a stylesheet: the footer\n// holds the window's bottom edge only there. See `useFullScreen`.\nconst FULL_SCREEN = '(width < 600px)';\n\n// The dialogs page's two dialogs, which are one component here for the same\n// reason Sheet's two presentations are: the page pairs them by window size\n// rather than offering a choice. Above the medium breakpoint it is the basic\n// dialog — a container on surface container high with a 28dp corner, between\n// 280 and 560dp wide, centred over the scrim, with 24dp of padding all round,\n// 16dp between the headline and the body and 24dp between the body and the\n// actions. Below it the same dialog fills the window as the page's\n// full-screen dialog: square corners, a 56dp header with the headline and a\n// divider under it, and a 56dp action bar with a divider over it.\n//\n// The pairing is for a dialog that is a task, which needs the room. An alert\n// dialog is a question with two or three answers, and the page keeps the\n// full-screen dialog for tasks, so `role=\"alertdialog\"` stays the basic dialog\n// at every width. Filled to a phone's window it read as a headline at the top\n// of the screen and its answers at the bottom, with nothing between them but\n// the chrome. The `basic` styles below are how: each restates, without the\n// breakpoint, the properties the paired styles change below it.\n//\n// The headline is headline-small on surface, the body body-medium on surface\n// variant, and the buttons are the call site's — the page draws text buttons\n// there, which is `Button`'s `text` variant.\n//\n// Two things the page draws are the call site's rather than the component's.\n// The optional icon above the headline, which the page centres the headline\n// and body with when it is there, is anything a `Dialog.Header` is given; a\n// dialog that wants it centres its own header. And the dividers a basic\n// dialog may show around a scrolling body are left out, since the page has\n// them only for that case and the body here scrolls with the header and\n// footer pinned either side of it, which is what they were marking.\n//\n// React Aria's overlay is three nested elements — the scrim, the container,\n// and the dialog inside it — so the styles split the same way, and the scrim\n// and the element carrying the dialog role are the ones every modal overlay\n// shares.\nconst scaleIn = \"xnirehn-B\";\nconst slideInFromBottom = \"x1itx4s0-B\";\nconst styles = {\n body: {\n kB7OPa: \"x9f619\",\n kMwMTN: \"x1w5n3ug\",\n k1xSpc: \"x78zum5\",\n kXwgrk: \"xdt5ytf\",\n kzQI83: \"x1iyjqo2\",\n kMv6JI: \"xpo2rfv\",\n kGuDYH: \"x193rfdd\",\n k63SB2: \"x1hews6w\",\n kOIVth: \"xxj4525\",\n kb6lSQ: \"xn43zvd\",\n kLWn49: \"xv61bfh\",\n kORKVm: \"x1odjw0f\",\n kGO01o: \"x1az23kl x18d9i69\",\n kLKAdn: \"x886u18 xexx8yu x3reb9c\",\n kg3NbH: \"xg0ps1x\",\n $$css: true\n },\n centre: {\n kGNEyG: \"x6s0dn4\",\n k1xSpc: \"x78zum5\",\n kjj79g: \"xl56j7k\",\n kmVPX3: \"x1apw6a7 xd76zvj\",\n $$css: true\n }\n};\n\n// The basic dialog at every width, for an alert dialog. Each entry is the\n// above-breakpoint value of every property its namesake in `styles` changes\n// below the breakpoint, laid over that namesake, so a property it leaves out\n// is the same in both presentations already. A value changed above the\n// breakpoint there has to change here too, which `index.test.tsx` checks by\n// comparing an alert dialog on a phone with any dialog on a desktop.\nconst basic = {\n body: {\n kLKAdn: \"x886u18 xexx8yu\",\n $$css: true\n },\n centre: {\n kmVPX3: \"x1apw6a7\",\n $$css: true\n }\n};\n\n// Whether this dialog is the basic one at every width. Content decides it from\n// the role and the parts read it, since each part carries its own share of\n// the full-screen presentation.\nconst BasicContext = createContext(false);\ntype DialogProps = Omit<DialogTriggerProps, 'children'> & {\n children?: ReactNode;\n};\n\n/**\n * A modal dialog centred over the page, and the same dialog filling the\n * window below the medium breakpoint — the dialogs page's basic and\n * full-screen dialogs, paired by window size as the page pairs them. An\n * alert dialog stays the basic one at every width. Open state is React\n * Aria's: pass `isOpen` with `onOpenChange` to control it, or\n * `defaultOpen` to let it keep its own.\n *\n * Composed rather than configured by props, as `Sheet` is, since a dialog's\n * header, body and actions all take arbitrary content — the parts are\n * `Dialog.Content`, `Dialog.Header`, `Dialog.Title`, `Dialog.Body` and\n * `Dialog.Footer`. A `Button` or `IconButton` placed directly inside\n * `Dialog` opens it, and one given `slot=\"close\"` anywhere inside the\n * content closes it; neither needs a part of its own.\n *\n * `Dialog` is the trigger's half, so a dialog nothing on the page opens — one\n * a route shows, or a menu item raises — leaves it out and passes `isOpen`\n * and `onOpenChange` to `Dialog.Content` instead. Wrapped in `Dialog` with no\n * button inside it, React Aria warns that its press responder found nothing\n * to press.\n */\nfunction Dialog({\n children,\n ...props\n}: DialogProps) {\n return <DialogTrigger {...props}>{children}</DialogTrigger>;\n}\nfunction DialogBody({\n ref: callerRef,\n ...props\n}: HTMLAttributes<HTMLDivElement> & RefAttributes<HTMLDivElement>) {\n const isBasic = useContext(BasicContext);\n const ref = useRef<HTMLDivElement>(null);\n // A body its content runs past is a tab stop, so a keyboard can scroll it\n // when nothing inside it takes focus; a call site's own tabIndex still\n // wins. See useScrollable.\n const scrollable = useScrollable(ref);\n // The body measures itself through its own ref, and the call site's lands\n // on the same element.\n const merged = useMemo(() => mergeRefs(ref, callerRef ?? undefined), [callerRef]);\n return <div\n // oxlint-disable-next-line jsx-a11y/no-noninteractive-tabindex -- a scroll container with nothing focusable inside is otherwise out of a keyboard's reach, which axe's scrollable-region-focusable reports\n tabIndex={scrollable ? 0 : undefined} {...props} ref={merged} {...mergeStyles(stylex.props(styles.body, isBasic && basic.body, overlay.modalBodyRing), props)} />;\n}\n\n/**\n * The dialog itself, and the scrim behind it. Everything the dialog shows\n * goes in here; the trigger stays outside it, since the trigger lives in the\n * page while this is portalled out to the end of the body.\n *\n * `role=\"alertdialog\"` is React Aria's, for a dialog interrupting with\n * something that has to be answered before the page carries on — a screen\n * reader announces it rather than waiting to be asked. It also keeps the\n * dialog the basic one below the medium breakpoint, centred and sized to its\n * content, where a dialog of the default role fills the window.\n *\n * A press on the scrim closes the dialog unless `isDismissable` says\n * otherwise, which is the same default `Sheet` takes and the reverse of\n * React Aria's own. Escape is a separate prop, `isKeyboardDismissDisabled`,\n * and `isDismissable` says nothing about it — so a dialog that has to be\n * answered from one of its actions, as an alert dialog usually does, turns\n * off both.\n *\n * Inside `Dialog`, the open state is the trigger's. On its own, with no\n * trigger, it is this part's: `isOpen` with `onOpenChange` controls it, and\n * a `slot=\"close\"` button, Escape and the scrim all report through\n * `onOpenChange`, as they would to `Dialog`.\n *\n * The scrim draws at `z-index: 900`, over any page content layered below\n * that, such as a sticky header, and the panel draws inside it. A\n * `Snackbar` draws at 1000, so a toast raised from inside the dialog is read\n * over it, and React Aria's popovers and menus draw above both.\n */\nfunction DialogContent({\n children,\n className,\n container,\n defaultOpen,\n isDismissable = true,\n isKeyboardDismissDisabled,\n isOpen,\n onOpenChange,\n ref,\n style,\n ...props\n}: DialogContentProps & RefAttributes<HTMLDivElement>) {\n const isBasic = props.role === 'alertdialog';\n return <BasicContext value={isBasic}>\n <OverlayScope>\n <ModalOverlay defaultOpen={defaultOpen} isDismissable={isDismissable} isKeyboardDismissDisabled={isKeyboardDismissDisabled} isOpen={isOpen} onOpenChange={onOpenChange}\n // oxlint-disable-next-line typescript/no-deprecated -- its replacement, UNSAFE_PortalProvider, is not exported by react-aria-components\n UNSTABLE_portalContainer={container} {...stylex.props(overlay.scrim, styles.centre, isBasic && basic.centre)}>\n <Modal\n // The panel, where the call site's class and style land, rather\n // than the dialog inside it, which takes the rest of the props.\n ref={ref} {...mergeStatefulStyles({\n 0: {\n className: \"x1n1nwrg x1u6grsq xbhiib0 x1ebxanj x16dv9tl xvkjz1l xt7dq6l x1ju3lih x1w1tqly x19pkqky x1f120ba xx61lck x1gb867b x13rsnn2 x1udv5rz x9f619 x139gbkf x78zum5 xdt5ytf xh8yej3 xmz0i5r x27kpxv x6iovhr x1u2d2a2 xxzqys8 xb3r6kr x9xqwrn xg8iv3o x19b5e0v xsds98l\"\n },\n 1: {\n className: \"x1n1nwrg x1u6grsq x16dv9tl xvkjz1l x1w1tqly x13rsnn2 x1udv5rz x9f619 x139gbkf x78zum5 xdt5ytf xh8yej3 xmz0i5r xb3r6kr xbhiib0 xt7dq6l x19pkqky xx61lck x27kpxv x1u2d2a2\"\n }\n }[!!isBasic << 0], {\n className,\n style\n })}>\n <RACDialog {...props} {...stylex.props(overlay.modalDialog)}>\n {children}\n </RACDialog>\n </Modal>\n </ModalOverlay>\n </OverlayScope>\n </BasicContext>;\n}\n\n/**\n * The dialog's actions. Full screen they are the action bar on the window's\n * bottom edge, which a toast rises clear of while the dialog is open, so a\n * tap meant for one of them never lands on the toast's own action instead.\n */\nfunction DialogFooter({\n ref: callerRef,\n ...props\n}: HTMLAttributes<HTMLDivElement> & RefAttributes<HTMLDivElement>) {\n const isBasic = useContext(BasicContext);\n const ref = useRef<HTMLDivElement>(null);\n useHoldBottomEdge(ref, useFullScreen() && !isBasic);\n // The footer measures itself through its own ref, and the call site's\n // lands on the same element.\n const merged = useMemo(() => mergeRefs(ref, callerRef ?? undefined), [callerRef]);\n return <div {...props} ref={merged} {...mergeStyles({\n 0: {\n className: \"x6s0dn4 x12smttz x1ejq31n x1vv4zg8 x178xt8z x9f619 x78zum5 x2lah0s x1a02dak x126z3so x13a6bvl xnvi70j x8i8c5o x1pr6p50 x13h71tw xs3zajk xg0ps1x\"\n },\n 1: {\n className: \"x6s0dn4 x12smttz x178xt8z x9f619 x78zum5 x2lah0s x1a02dak x126z3so x13a6bvl xg0ps1x x1ejq31n x8i8c5o x13h71tw\"\n }\n }[!!isBasic << 0], props)} />;\n}\nfunction DialogHeader(props: HTMLAttributes<HTMLDivElement> & RefAttributes<HTMLDivElement>) {\n const isBasic = useContext(BasicContext);\n return <div {...props} {...mergeStyles({\n 0: {\n className: \"x6s0dn4 x1j6faob x1sy0etr xf6te7g xso031l x9f619 x78zum5 x2lah0s x1gka490 x1qughib xnvi70j xzfxn0k x1pr6p50 x13h71tw xs3zajk xg0ps1x\"\n },\n 1: {\n className: \"x6s0dn4 x1j6faob xso031l x9f619 x78zum5 x2lah0s x1gka490 x1qughib xg0ps1x x1sy0etr xzfxn0k x13h71tw\"\n }\n }[!!isBasic << 0], props)} />;\n}\n\n/**\n * Names the dialog. Rendered through React Aria's title slot, which is what\n * points the dialog's `aria-labelledby` at it — a dialog without one\n * announces itself unnamed.\n */\nfunction DialogTitle(props: DialogTitleProps & RefAttributes<HTMLHeadingElement>) {\n const isBasic = useContext(BasicContext);\n return <Heading slot=\"title\" {...props} {...mergeStyles({\n 0: {\n className: \"x9f619 x139gbkf x1fz0g89 xl849ld xkb6epg xcji80f x76yrz5 x6ksu6j x1s1qhaa x1khanjg x1voeury xrr2tf9 x1ghz6dp xeuugli xj0a0fe\"\n },\n 1: {\n className: \"x9f619 x139gbkf x1ghz6dp xeuugli xj0a0fe x1fz0g89 xkb6epg x76yrz5 x1s1qhaa x1voeury\"\n }\n }[!!isBasic << 0], props)} />;\n}\n\n// Whether the window is at the size the full-screen dialog is drawn at, kept\n// current as it resizes. False on the server, where there is no window and\n// nothing is open.\nfunction isFullScreen() {\n return window.matchMedia(FULL_SCREEN).matches;\n}\nfunction isFullScreenOnServer() {\n return false;\n}\nfunction subscribeToFullScreen(listener: () => void) {\n const query = window.matchMedia(FULL_SCREEN);\n query.addEventListener('change', listener);\n return () => {\n query.removeEventListener('change', listener);\n };\n}\nfunction useFullScreen() {\n return useSyncExternalStore(subscribeToFullScreen, isFullScreen, isFullScreenOnServer);\n}\nDialog.Body = DialogBody;\nDialog.Content = DialogContent;\nDialog.Footer = DialogFooter;\nDialog.Header = DialogHeader;\nDialog.Title = DialogTitle;\n\n// The dialog's own props, plus the scrim's open state and dismissal settings\n// and the container's styling. A call site has no reason to know there are\n// three elements: `className` and `style` reach the container, which is the\n// one worth restyling, the open state and the dismissal settings reach the\n// scrim, and everything else lands on the dialog.\n//\n// `isDismissable` is declared here rather than picked with its siblings,\n// since the picked one carries React Aria's documentation, whose default is\n// the reverse of this component's.\ntype DialogContentProps = {\n /** A function may compute the class from the container's render state. */\n className?: ClassNameOrFunction<ModalRenderProps>;\n /**\n * Where to portal the dialog and scrim. Defaults to the container of the\n * `ThemeScope` around it, which keeps the dialog on that scope's tokens, or\n * to the end of `<body>` where there is none. A subtree themed through the\n * `themeScope` class has no container of its own, so point this inside it, or\n * the dialog renders outside and keeps the page's tokens.\n */\n container?: Element;\n /**\n * Whether a press on the scrim, outside the container, closes the\n * dialog. `true` here where React Aria's own default is `false`, the\n * same default `Sheet` takes. Escape is `isKeyboardDismissDisabled`'s,\n * and this says nothing about it — an alert dialog, which has to be\n * answered from one of its actions, turns off both.\n * @default true\n */\n isDismissable?: boolean;\n /** A function may compute the style from the container's render state. */\n style?: StyleOrFunction<ModalRenderProps>;\n} & Omit<RACDialogProps, 'className' | 'style'> & Pick<ModalOverlayProps, 'defaultOpen' | 'isKeyboardDismissDisabled' | 'isOpen' | 'onOpenChange'>;\ntype DialogTitleProps = HeadingProps;\nexport type { DialogContentProps, DialogProps, DialogTitleProps };\nexport { DialogBody, DialogContent, DialogFooter, DialogHeader, DialogTitle };\nexport default Dialog;"],"mappings":";;;;;;;;;;;;;AA0BA,MAAMwC,cAAc;AAsCpB,MAAMG,SAAS;CACbC,MAAM;EACJC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ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F,uBAAuBL,cAAcI,oBAAoB;AAAC;AAExFzF,SAAO+F,OAAO7C;AACdlD,SAAOgG,UAAUlC;AACjB9D,SAAOiG,SAAShB;AAChBjF,SAAOkG,SAASf;AAChBnF,SAAOmG,QAAQf"}
|
|
@@ -48,7 +48,10 @@ type PopoverTrigger = 'hover' | 'press';
|
|
|
48
48
|
* keep its own.
|
|
49
49
|
*
|
|
50
50
|
* Non-modal by design — the page behind stays scrollable and clickable, which
|
|
51
|
-
* is the difference from `Sheet`. Pass `modal` to change that.
|
|
51
|
+
* is the difference from `Sheet`. Pass `modal` to change that. Escape, a press
|
|
52
|
+
* anywhere outside the panel and a button given `slot="close"` close it, and
|
|
53
|
+
* a press on its trigger toggles it. Inside a dialog, a press on the scrim
|
|
54
|
+
* closes the popover first and the dialog on the next, as a menu does.
|
|
52
55
|
*
|
|
53
56
|
* Composed rather than configured by props, because a popover's contents are
|
|
54
57
|
* arbitrary — the parts are `Popover.Content`, `Popover.Title`, and
|