@kanso-labs/kanso-ui 0.44.1 → 0.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +59 -7
- package/dist/chip/index.js +24 -4
- package/dist/chip/index.js.map +1 -1
- package/dist/chip/styles.js +13 -5
- package/dist/chip/styles.js.map +1 -1
- package/dist/components/app-bar/index.d.ts +14 -2
- package/dist/components/app-bar/index.js +36 -7
- package/dist/components/app-bar/index.js.map +1 -1
- package/dist/components/autocomplete/index.d.ts +44 -0
- package/dist/components/autocomplete/index.js +44 -0
- package/dist/components/autocomplete/index.js.map +1 -1
- package/dist/components/button/index.d.ts +3 -2
- package/dist/components/button/index.js +53 -59
- package/dist/components/button/index.js.map +1 -1
- package/dist/components/card/index.d.ts +11 -3
- package/dist/components/card/index.js +23 -1
- package/dist/components/card/index.js.map +1 -1
- package/dist/components/checkbox/index.js +65 -58
- package/dist/components/checkbox/index.js.map +1 -1
- package/dist/components/chip/index.d.ts +46 -30
- package/dist/components/chip/index.js +38 -17
- package/dist/components/chip/index.js.map +1 -1
- package/dist/components/chip-group/index.d.ts +5 -2
- package/dist/components/chip-group/index.js +8 -2
- package/dist/components/chip-group/index.js.map +1 -1
- package/dist/components/dialog/index.d.ts +27 -0
- package/dist/components/dialog/index.js +81 -37
- package/dist/components/dialog/index.js.map +1 -1
- package/dist/components/fab/index.d.ts +1 -1
- package/dist/components/fab/index.js.map +1 -1
- package/dist/components/form/index.d.ts +14 -4
- package/dist/components/form/index.js +6 -3
- package/dist/components/form/index.js.map +1 -1
- package/dist/components/icon-button/index.d.ts +15 -1
- package/dist/components/icon-button/index.js +15 -1
- package/dist/components/icon-button/index.js.map +1 -1
- package/dist/components/link/index.d.ts +4 -0
- package/dist/components/link/index.js +4 -0
- package/dist/components/link/index.js.map +1 -1
- package/dist/components/list/index.d.ts +34 -0
- package/dist/components/list/index.js +47 -13
- package/dist/components/list/index.js.map +1 -1
- package/dist/components/list-detail/index.d.ts +34 -1
- package/dist/components/list-detail/index.js +34 -1
- package/dist/components/list-detail/index.js.map +1 -1
- package/dist/components/list-item/index.d.ts +21 -2
- package/dist/components/list-item/index.js +6 -0
- package/dist/components/list-item/index.js.map +1 -1
- package/dist/components/menu/index.d.ts +6 -3
- package/dist/components/menu/index.js +3 -1
- package/dist/components/menu/index.js.map +1 -1
- package/dist/components/meter/index.d.ts +4 -0
- package/dist/components/meter/index.js +4 -0
- package/dist/components/meter/index.js.map +1 -1
- package/dist/components/navigation-bar/index.d.ts +14 -2
- package/dist/components/navigation-bar/index.js +14 -2
- package/dist/components/navigation-bar/index.js.map +1 -1
- package/dist/components/navigation-tree/index.js +2 -9
- package/dist/components/navigation-tree/index.js.map +1 -1
- package/dist/components/number-field/index.d.ts +7 -1
- package/dist/components/number-field/index.js +7 -1
- package/dist/components/number-field/index.js.map +1 -1
- package/dist/components/popover/index.d.ts +15 -1
- package/dist/components/popover/index.js +15 -1
- package/dist/components/popover/index.js.map +1 -1
- package/dist/components/product-icon/index.d.ts +8 -1
- package/dist/components/product-icon/index.js +8 -1
- package/dist/components/product-icon/index.js.map +1 -1
- package/dist/components/progress-indicator/index.d.ts +12 -6
- package/dist/components/progress-indicator/index.js +57 -46
- package/dist/components/progress-indicator/index.js.map +1 -1
- package/dist/components/radio-group/index.d.ts +7 -0
- package/dist/components/radio-group/index.js +23 -14
- package/dist/components/radio-group/index.js.map +1 -1
- package/dist/components/search-field/index.d.ts +13 -4
- package/dist/components/search-field/index.js +10 -4
- package/dist/components/search-field/index.js.map +1 -1
- package/dist/components/search-view/index.d.ts +2 -0
- package/dist/components/search-view/index.js.map +1 -1
- package/dist/components/segmented-button/index.d.ts +1 -1
- package/dist/components/segmented-button/index.js.map +1 -1
- package/dist/components/separator/index.d.ts +31 -6
- package/dist/components/separator/index.js +30 -6
- package/dist/components/separator/index.js.map +1 -1
- package/dist/components/sheet/index.d.ts +96 -37
- package/dist/components/sheet/index.js +420 -136
- package/dist/components/sheet/index.js.map +1 -1
- package/dist/components/snackbar/index.d.ts +8 -1
- package/dist/components/snackbar/index.js +7 -0
- package/dist/components/snackbar/index.js.map +1 -1
- package/dist/components/stack/index.d.ts +21 -5
- package/dist/components/stack/index.js +10 -0
- package/dist/components/stack/index.js.map +1 -1
- package/dist/components/switch/index.d.ts +12 -0
- package/dist/components/switch/index.js +12 -0
- package/dist/components/switch/index.js.map +1 -1
- package/dist/components/text-field/index.d.ts +39 -9
- package/dist/components/text-field/index.js +29 -7
- package/dist/components/text-field/index.js.map +1 -1
- package/dist/components/tree/index.js +11 -15
- package/dist/components/tree/index.js.map +1 -1
- package/dist/hooks/useBottomEdge.js +6 -3
- package/dist/hooks/useBottomEdge.js.map +1 -1
- package/dist/hooks/useRipple.js +216 -192
- package/dist/hooks/useRipple.js.map +1 -1
- package/dist/i18n/index.js +1 -0
- package/dist/i18n/index.js.map +1 -1
- package/dist/i18n/messages.js +34 -0
- package/dist/i18n/messages.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/indicator/styles.js +7 -4
- package/dist/indicator/styles.js.map +1 -1
- package/dist/mark/styles.js +11 -5
- package/dist/mark/styles.js.map +1 -1
- package/dist/react-aria.d.ts +2 -2
- package/dist/row/index.js +90 -62
- package/dist/row/index.js.map +1 -1
- package/dist/row/styles.js +6 -1
- package/dist/row/styles.js.map +1 -1
- package/dist/styles/focus.js.map +1 -1
- package/dist/styles/overlay.js +8 -0
- package/dist/styles/overlay.js.map +1 -1
- package/dist/styles.css +135 -114
- package/dist/theme-scope.d.ts +14 -2
- package/dist/theme-scope.js +12 -0
- package/dist/theme-scope.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { props } from "../../node_modules/@stylexjs/stylex/lib/es/stylex.js";
|
|
3
|
+
import { sizing, typography } from "../../tokens/design.tokens.stylex.js";
|
|
3
4
|
import { mergeRefs } from "../../render/ref.js";
|
|
4
5
|
import { mergeStatefulStyles, mergeStyles } from "../../styles/merge.js";
|
|
5
6
|
import { overlay } from "../../styles/overlay.js";
|
|
@@ -11,6 +12,7 @@ import { createContext, useContext, useId, useLayoutEffect, useRef, useState, us
|
|
|
11
12
|
import { jsx } from "react/jsx-runtime";
|
|
12
13
|
import { Dialog, DialogTrigger, Heading, HeadingContext, Modal, ModalOverlay, useSlottedContext } from "react-aria-components";
|
|
13
14
|
//#region src/components/dialog/index.tsx
|
|
15
|
+
`${sizing.controlSm}${typography.headlineSmallLineHeight}`;
|
|
14
16
|
const FULL_SCREEN = "(width < 600px)";
|
|
15
17
|
const styles = {
|
|
16
18
|
body: {
|
|
@@ -51,6 +53,7 @@ const basic = {
|
|
|
51
53
|
}
|
|
52
54
|
};
|
|
53
55
|
const BasicContext = createContext(false);
|
|
56
|
+
const HeaderContext = createContext(false);
|
|
54
57
|
const DescriptionContext = createContext(null);
|
|
55
58
|
/**
|
|
56
59
|
* A modal dialog centred over the page, and the same dialog filling the
|
|
@@ -67,11 +70,38 @@ const DescriptionContext = createContext(null);
|
|
|
67
70
|
* `Dialog` opens it, and one given `slot="close"` anywhere inside the
|
|
68
71
|
* content closes it; neither needs a part of its own.
|
|
69
72
|
*
|
|
73
|
+
* ```tsx
|
|
74
|
+
* <Dialog>
|
|
75
|
+
* <Button>Open dialog</Button>
|
|
76
|
+
* <Dialog.Content>
|
|
77
|
+
* <Dialog.Header>
|
|
78
|
+
* <Dialog.Title>Headline</Dialog.Title>
|
|
79
|
+
* <IconButton aria-label="Close" slot="close">
|
|
80
|
+
* <CloseIcon />
|
|
81
|
+
* </IconButton>
|
|
82
|
+
* </Dialog.Header>
|
|
83
|
+
* <Dialog.Body>Supporting text</Dialog.Body>
|
|
84
|
+
* <Dialog.Footer>
|
|
85
|
+
* <Button slot="close" variant="text">
|
|
86
|
+
* Cancel
|
|
87
|
+
* </Button>
|
|
88
|
+
* <Button onPress={confirm} slot="close" variant="text">
|
|
89
|
+
* Confirm
|
|
90
|
+
* </Button>
|
|
91
|
+
* </Dialog.Footer>
|
|
92
|
+
* </Dialog.Content>
|
|
93
|
+
* </Dialog>
|
|
94
|
+
* ```
|
|
95
|
+
*
|
|
70
96
|
* `Dialog` is the trigger's half, so a dialog nothing on the page opens — one
|
|
71
97
|
* a route shows, or a menu item raises — leaves it out and passes `isOpen`
|
|
72
98
|
* and `onOpenChange` to `Dialog.Content` instead. Wrapped in `Dialog` with no
|
|
73
99
|
* button inside it, React Aria warns that its press responder found nothing
|
|
74
100
|
* to press.
|
|
101
|
+
*
|
|
102
|
+
* Tab stays inside an open dialog, so a `Snackbar` shown meanwhile is
|
|
103
|
+
* reached with F6, which React Aria uses to move between landmarks. Tabbing
|
|
104
|
+
* on past the snackbar's last control leads back into the dialog.
|
|
75
105
|
*/
|
|
76
106
|
function Dialog$1(t0) {
|
|
77
107
|
const $ = c(6);
|
|
@@ -100,11 +130,11 @@ function Dialog$1(t0) {
|
|
|
100
130
|
}
|
|
101
131
|
function DialogBody(t0) {
|
|
102
132
|
const $ = c(8);
|
|
103
|
-
const { ref: callerRef, ...props$
|
|
133
|
+
const { ref: callerRef, ...props$2 } = t0;
|
|
104
134
|
const isBasic = useContext(BasicContext);
|
|
105
135
|
const describe = useContext(DescriptionContext);
|
|
106
136
|
const generated = useId();
|
|
107
|
-
const id = props$
|
|
137
|
+
const id = props$2.id ?? (describe === null ? void 0 : generated);
|
|
108
138
|
useLayoutEffect(() => {
|
|
109
139
|
if (describe === null || id === void 0) return;
|
|
110
140
|
describe(id);
|
|
@@ -115,7 +145,7 @@ function DialogBody(t0) {
|
|
|
115
145
|
const ref = useRef(null);
|
|
116
146
|
const title = useSlottedContext(HeadingContext, "title");
|
|
117
147
|
const scrollStop = useScrollStop(ref, {
|
|
118
|
-
label: props$
|
|
148
|
+
label: props$2["aria-label"],
|
|
119
149
|
title: title?.id
|
|
120
150
|
});
|
|
121
151
|
const t1 = callerRef ?? void 0;
|
|
@@ -126,19 +156,19 @@ function DialogBody(t0) {
|
|
|
126
156
|
$[1] = t2;
|
|
127
157
|
} else t2 = $[1];
|
|
128
158
|
const merged = t2;
|
|
129
|
-
const t3 = mergeStyles(props(styles.body, isBasic && basic.body, overlay.modalBodyRing), props$
|
|
159
|
+
const t3 = mergeStyles(props(styles.body, isBasic && basic.body, overlay.modalBodyRing), props$2);
|
|
130
160
|
let t4;
|
|
131
|
-
if ($[2] !== id || $[3] !== merged || $[4] !== props$
|
|
161
|
+
if ($[2] !== id || $[3] !== merged || $[4] !== props$2 || $[5] !== scrollStop || $[6] !== t3) {
|
|
132
162
|
t4 = /* @__PURE__ */ jsx("div", {
|
|
133
163
|
...scrollStop,
|
|
134
164
|
id,
|
|
135
|
-
...props$
|
|
165
|
+
...props$2,
|
|
136
166
|
ref: merged,
|
|
137
167
|
...t3
|
|
138
168
|
});
|
|
139
169
|
$[2] = id;
|
|
140
170
|
$[3] = merged;
|
|
141
|
-
$[4] = props$
|
|
171
|
+
$[4] = props$2;
|
|
142
172
|
$[5] = scrollStop;
|
|
143
173
|
$[6] = t3;
|
|
144
174
|
$[7] = t4;
|
|
@@ -184,12 +214,12 @@ function DialogContent(t0) {
|
|
|
184
214
|
let isKeyboardDismissDisabled;
|
|
185
215
|
let isOpen;
|
|
186
216
|
let onOpenChange;
|
|
187
|
-
let props$
|
|
217
|
+
let props$1;
|
|
188
218
|
let ref;
|
|
189
219
|
let style;
|
|
190
220
|
let t1;
|
|
191
221
|
if ($[0] !== t0) {
|
|
192
|
-
({children, className, container, defaultOpen, isDismissable: t1, isKeyboardDismissDisabled, isOpen, onOpenChange, ref, style, ...props$
|
|
222
|
+
({children, className, container, defaultOpen, isDismissable: t1, isKeyboardDismissDisabled, isOpen, onOpenChange, ref, style, ...props$1} = t0);
|
|
193
223
|
$[0] = t0;
|
|
194
224
|
$[1] = children;
|
|
195
225
|
$[2] = className;
|
|
@@ -198,7 +228,7 @@ function DialogContent(t0) {
|
|
|
198
228
|
$[5] = isKeyboardDismissDisabled;
|
|
199
229
|
$[6] = isOpen;
|
|
200
230
|
$[7] = onOpenChange;
|
|
201
|
-
$[8] = props$
|
|
231
|
+
$[8] = props$1;
|
|
202
232
|
$[9] = ref;
|
|
203
233
|
$[10] = style;
|
|
204
234
|
$[11] = t1;
|
|
@@ -210,13 +240,13 @@ function DialogContent(t0) {
|
|
|
210
240
|
isKeyboardDismissDisabled = $[5];
|
|
211
241
|
isOpen = $[6];
|
|
212
242
|
onOpenChange = $[7];
|
|
213
|
-
props$
|
|
243
|
+
props$1 = $[8];
|
|
214
244
|
ref = $[9];
|
|
215
245
|
style = $[10];
|
|
216
246
|
t1 = $[11];
|
|
217
247
|
}
|
|
218
248
|
const isDismissable = t1 === void 0 ? true : t1;
|
|
219
|
-
const isBasic = props$
|
|
249
|
+
const isBasic = props$1.role === "alertdialog";
|
|
220
250
|
const [body, setBody] = useState();
|
|
221
251
|
const t2 = isBasic ? setBody : null;
|
|
222
252
|
let t3;
|
|
@@ -239,22 +269,25 @@ function DialogContent(t0) {
|
|
|
239
269
|
$[16] = style;
|
|
240
270
|
$[17] = t4;
|
|
241
271
|
} else t4 = $[17];
|
|
242
|
-
const t5 = props$
|
|
272
|
+
const t5 = props$1["aria-describedby"] ?? (isBasic ? body : void 0);
|
|
243
273
|
let t6;
|
|
244
274
|
if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
|
|
245
275
|
t6 = props(overlay.modalDialog);
|
|
246
276
|
$[18] = t6;
|
|
247
277
|
} else t6 = $[18];
|
|
248
278
|
let t7;
|
|
249
|
-
if ($[19] !== children || $[20] !== props$
|
|
250
|
-
t7 = /* @__PURE__ */ jsx(
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
279
|
+
if ($[19] !== children || $[20] !== props$1 || $[21] !== t5) {
|
|
280
|
+
t7 = /* @__PURE__ */ jsx(HeaderContext, {
|
|
281
|
+
value: false,
|
|
282
|
+
children: /* @__PURE__ */ jsx(Dialog, {
|
|
283
|
+
...props$1,
|
|
284
|
+
"aria-describedby": t5,
|
|
285
|
+
...t6,
|
|
286
|
+
children
|
|
287
|
+
})
|
|
255
288
|
});
|
|
256
289
|
$[19] = children;
|
|
257
|
-
$[20] = props$
|
|
290
|
+
$[20] = props$1;
|
|
258
291
|
$[21] = t5;
|
|
259
292
|
$[22] = t7;
|
|
260
293
|
} else t7 = $[22];
|
|
@@ -357,8 +390,8 @@ function DialogHeader(props) {
|
|
|
357
390
|
let t0;
|
|
358
391
|
if ($[0] !== isBasic || $[1] !== props) {
|
|
359
392
|
t0 = mergeStyles({
|
|
360
|
-
0: { className: "x6s0dn4 x1j6faob x1sy0etr xf6te7g xso031l x9f619 x78zum5 x2lah0s x1gka490 x1qughib xnvi70j
|
|
361
|
-
1: { className: "x6s0dn4 x1j6faob xso031l x9f619 x78zum5 x2lah0s x1gka490 x1qughib xg0ps1x x1sy0etr
|
|
393
|
+
0: { className: "x6s0dn4 x1j6faob x1sy0etr xf6te7g xso031l x9f619 x78zum5 x2lah0s x1gka490 x1qughib xnvi70j x11wnguw x1pr6p50 x1837goc xs3zajk xg0ps1x" },
|
|
394
|
+
1: { className: "x6s0dn4 x1j6faob xso031l x9f619 x78zum5 x2lah0s x1gka490 x1qughib xg0ps1x x1sy0etr x11wnguw x1837goc" }
|
|
362
395
|
}[!!isBasic << 0], props);
|
|
363
396
|
$[0] = isBasic;
|
|
364
397
|
$[1] = props;
|
|
@@ -366,9 +399,12 @@ function DialogHeader(props) {
|
|
|
366
399
|
} else t0 = $[2];
|
|
367
400
|
let t1;
|
|
368
401
|
if ($[3] !== props || $[4] !== t0) {
|
|
369
|
-
t1 = /* @__PURE__ */ jsx(
|
|
370
|
-
|
|
371
|
-
|
|
402
|
+
t1 = /* @__PURE__ */ jsx(HeaderContext, {
|
|
403
|
+
value: true,
|
|
404
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
405
|
+
...props,
|
|
406
|
+
...t0
|
|
407
|
+
})
|
|
372
408
|
});
|
|
373
409
|
$[3] = props;
|
|
374
410
|
$[4] = t0;
|
|
@@ -382,29 +418,37 @@ function DialogHeader(props) {
|
|
|
382
418
|
* announces itself unnamed.
|
|
383
419
|
*/
|
|
384
420
|
function DialogTitle(props) {
|
|
385
|
-
const $ = c(
|
|
421
|
+
const $ = c(7);
|
|
386
422
|
const isBasic = useContext(BasicContext);
|
|
423
|
+
const isHeaded = useContext(HeaderContext);
|
|
387
424
|
let t0;
|
|
388
|
-
if ($[0] !== isBasic || $[1] !== props) {
|
|
425
|
+
if ($[0] !== isBasic || $[1] !== isHeaded || $[2] !== props) {
|
|
389
426
|
t0 = mergeStyles({
|
|
390
427
|
0: { className: "x9f619 x139gbkf x1fz0g89 xl849ld xkb6epg xcji80f x76yrz5 x6ksu6j x1s1qhaa x1khanjg x1voeury xrr2tf9 x1ghz6dp xeuugli xj0a0fe" },
|
|
391
|
-
|
|
392
|
-
|
|
428
|
+
4: { className: "x9f619 x139gbkf x1fz0g89 xl849ld xkb6epg xcji80f x76yrz5 x6ksu6j x1s1qhaa x1khanjg x1voeury xrr2tf9 x1ghz6dp xeuugli xj0a0fe xs2ltda xa4amcs" },
|
|
429
|
+
2: { className: "x9f619 x139gbkf x1ghz6dp xeuugli xj0a0fe x1fz0g89 xkb6epg x76yrz5 x1s1qhaa x1voeury" },
|
|
430
|
+
6: { className: "x9f619 x139gbkf x1ghz6dp xeuugli xj0a0fe xs2ltda xa4amcs x1fz0g89 xkb6epg x76yrz5 x1s1qhaa x1voeury" },
|
|
431
|
+
1: { className: "x9f619 x139gbkf x1fz0g89 xl849ld xkb6epg xcji80f x76yrz5 x6ksu6j x1s1qhaa x1khanjg x1voeury xrr2tf9 x1ghz6dp xeuugli xj0a0fe xs2ltda" },
|
|
432
|
+
5: { className: "x9f619 x139gbkf x1fz0g89 xl849ld xkb6epg xcji80f x76yrz5 x6ksu6j x1s1qhaa x1khanjg x1voeury xrr2tf9 x1ghz6dp xeuugli xj0a0fe xs2ltda" },
|
|
433
|
+
3: { className: "x9f619 x139gbkf x1ghz6dp xeuugli xj0a0fe x1fz0g89 xkb6epg x76yrz5 x1s1qhaa x1voeury xs2ltda" },
|
|
434
|
+
7: { className: "x9f619 x139gbkf x1ghz6dp xeuugli xj0a0fe x1fz0g89 xkb6epg x76yrz5 x1s1qhaa x1voeury xs2ltda" }
|
|
435
|
+
}[!!isHeaded << 2 | !!isBasic << 1 | !!(isBasic && isHeaded) << 0], props);
|
|
393
436
|
$[0] = isBasic;
|
|
394
|
-
$[1] =
|
|
395
|
-
$[2] =
|
|
396
|
-
|
|
437
|
+
$[1] = isHeaded;
|
|
438
|
+
$[2] = props;
|
|
439
|
+
$[3] = t0;
|
|
440
|
+
} else t0 = $[3];
|
|
397
441
|
let t1;
|
|
398
|
-
if ($[
|
|
442
|
+
if ($[4] !== props || $[5] !== t0) {
|
|
399
443
|
t1 = /* @__PURE__ */ jsx(Heading, {
|
|
400
444
|
slot: "title",
|
|
401
445
|
...props,
|
|
402
446
|
...t0
|
|
403
447
|
});
|
|
404
|
-
$[
|
|
405
|
-
$[
|
|
406
|
-
$[
|
|
407
|
-
} else t1 = $[
|
|
448
|
+
$[4] = props;
|
|
449
|
+
$[5] = t0;
|
|
450
|
+
$[6] = t1;
|
|
451
|
+
} else t1 = $[6];
|
|
408
452
|
return t1;
|
|
409
453
|
}
|
|
410
454
|
function isFullScreen() {
|
|
@@ -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","useId","useLayoutEffect","useMemo","useRef","useState","useSyncExternalStore","DialogTrigger","Heading","HeadingContext","Modal","ModalOverlay","Dialog","RACDialog","useSlottedContext","useHoldBottomEdge","useScrollStop","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","kHjlTd","kORKVm","kGO01o","kLKAdn","kg3NbH","$$css","centre","kGNEyG","kjj79g","kmVPX3","basic","BasicContext","DescriptionContext","id","Omit","children","t0","$","props","t1","DialogBody","ref","callerRef","isBasic","describe","generated","undefined","title","scrollStop","label","t2","merged","t3","modalBodyRing","t4","DialogContent","className","container","defaultOpen","isKeyboardDismissDisabled","isOpen","onOpenChange","style","isDismissable","role","setBody","scrim","0","1","t5","t6","Symbol","for","modalDialog","t7","t8","t9","t10","t11","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, useId, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from 'react';\nimport { DialogTrigger, Heading, HeadingContext, Modal, ModalOverlay, Dialog as RACDialog, useSlottedContext } from 'react-aria-components';\nimport { useHoldBottomEdge } from '../../hooks/useBottomEdge';\nimport { useScrollStop } from '../../hooks/useScrollStop';\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 kHjlTd: \"xj0a0fe\",\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);\n\n// Where an alert dialog's body hands Content its id, so the dialog can name\n// the body as its description: the message an alert dialog interrupts with\n// is what a screen reader should read out with the title. Null in a dialog\n// of any other role, whose body may hold a form or a long document rather\n// than one message.\nconst DescriptionContext = createContext<((id: string | undefined) => void) | null>(null);\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 describe = useContext(DescriptionContext);\n const generated = useId();\n // An alert dialog's body describes the dialog, so it carries an id for the\n // dialog to point at: the call site's own, or one of its own. In a layout\n // effect, so the dialog carries its description from its first paint.\n const id = props.id ?? (describe === null ? undefined : generated);\n useLayoutEffect(() => {\n if (describe === null || id === undefined) {\n return undefined;\n }\n describe(id);\n return () => {\n describe(undefined);\n };\n }, [describe, id]);\n const ref = useRef<HTMLDivElement>(null);\n // A body its content runs past is a tab stop named by the title, so a\n // keyboard can scroll it, when nothing inside it takes focus; a call\n // site's own name, role and tabIndex still win. See useScrollStop.\n const title = useSlottedContext(HeadingContext, 'title');\n const scrollStop = useScrollStop(ref, {\n label: props['aria-label'],\n title: title?.id\n });\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 {...scrollStop} id={id} {...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. Its\n * `Dialog.Body` is its description, so the message is read out with the\n * title; an `aria-describedby` of the call site's own names another.\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 // The id of the body, which an alert dialog is described by unless the\n // call site names a description of its own.\n const [body, setBody] = useState<string>();\n return <BasicContext value={isBasic}>\n <DescriptionContext value={isBasic ? setBody : null}>\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} aria-describedby={props['aria-describedby'] ?? (isBasic ? body : undefined)} {...stylex.props(overlay.modalDialog)}>\n {children}\n </RACDialog>\n </Modal>\n </ModalOverlay>\n </OverlayScope>\n </DescriptionContext>\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,MAAM6C,cAAc;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AAQf"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["c","_c","HTMLAttributes","ReactNode","RefAttributes","ClassNameOrFunction","DialogTriggerProps","HeadingProps","ModalOverlayProps","ModalRenderProps","DialogProps","RACDialogProps","StyleOrFunction","stylex","createContext","useContext","useId","useLayoutEffect","useMemo","useRef","useState","useSyncExternalStore","DialogTrigger","Heading","HeadingContext","Modal","ModalOverlay","Dialog","RACDialog","useSlottedContext","useHoldBottomEdge","useScrollStop","OverlayScope","mergeRefs","mergeStatefulStyles","mergeStyles","overlay","colors","media","motion","radii","shadows","sizing","spacing","typography","FORCED_COLORS","HEADLINE_REACH","controlSm","headlineSmallLineHeight","FULL_SCREEN","scaleIn","slideInFromBottom","styles","body","kB7OPa","kMwMTN","k1xSpc","kXwgrk","kzQI83","kMv6JI","kGuDYH","k63SB2","kOIVth","kb6lSQ","kLWn49","kHjlTd","kORKVm","kGO01o","kLKAdn","kg3NbH","$$css","centre","kGNEyG","kjj79g","kmVPX3","basic","BasicContext","HeaderContext","DescriptionContext","id","Omit","children","t0","$","props","t1","DialogBody","ref","callerRef","isBasic","describe","generated","undefined","title","scrollStop","label","t2","merged","t3","modalBodyRing","t4","DialogContent","className","container","defaultOpen","isKeyboardDismissDisabled","isOpen","onOpenChange","style","isDismissable","role","setBody","scrim","0","1","t5","t6","Symbol","for","modalDialog","t7","t8","t9","t10","t11","DialogFooter","useFullScreen","DialogHeader","DialogTitle","isHeaded","4","2","6","5","3","7","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, useId, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from 'react';\nimport { DialogTrigger, Heading, HeadingContext, Modal, ModalOverlay, Dialog as RACDialog, useSlottedContext } from 'react-aria-components';\nimport { useHoldBottomEdge } from '../../hooks/useBottomEdge';\nimport { useScrollStop } from '../../hooks/useScrollStop';\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, sizing, 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// How far a headline in a header reaches past its own line, above and below:\n// half of what the headline-small line lacks of a standard control's\n// height, which is 4 at the default tokens. The header gives the same back\n// out of its padding. See `header`.\nconst HEADLINE_REACH = `max(0px, calc((${sizing.controlSm} - ${typography.headlineSmallLineHeight}) / 2))`;\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 kHjlTd: \"xj0a0fe\",\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);\n\n// Whether a title sits in a header, which is what it reaches past its line\n// in; see `header`. Content clears it, so a dialog opened from inside a\n// header starts outside one.\nconst HeaderContext = createContext(false);\n\n// Where an alert dialog's body hands Content its id, so the dialog can name\n// the body as its description: the message an alert dialog interrupts with\n// is what a screen reader should read out with the title. Null in a dialog\n// of any other role, whose body may hold a form or a long document rather\n// than one message.\nconst DescriptionContext = createContext<((id: string | undefined) => void) | null>(null);\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 * ```tsx\n * <Dialog>\n * <Button>Open dialog</Button>\n * <Dialog.Content>\n * <Dialog.Header>\n * <Dialog.Title>Headline</Dialog.Title>\n * <IconButton aria-label=\"Close\" slot=\"close\">\n * <CloseIcon />\n * </IconButton>\n * </Dialog.Header>\n * <Dialog.Body>Supporting text</Dialog.Body>\n * <Dialog.Footer>\n * <Button slot=\"close\" variant=\"text\">\n * Cancel\n * </Button>\n * <Button onPress={confirm} slot=\"close\" variant=\"text\">\n * Confirm\n * </Button>\n * </Dialog.Footer>\n * </Dialog.Content>\n * </Dialog>\n * ```\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 *\n * Tab stays inside an open dialog, so a `Snackbar` shown meanwhile is\n * reached with F6, which React Aria uses to move between landmarks. Tabbing\n * on past the snackbar's last control leads back into the dialog.\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 describe = useContext(DescriptionContext);\n const generated = useId();\n // An alert dialog's body describes the dialog, so it carries an id for the\n // dialog to point at: the call site's own, or one of its own. In a layout\n // effect, so the dialog carries its description from its first paint.\n const id = props.id ?? (describe === null ? undefined : generated);\n useLayoutEffect(() => {\n if (describe === null || id === undefined) {\n return undefined;\n }\n describe(id);\n return () => {\n describe(undefined);\n };\n }, [describe, id]);\n const ref = useRef<HTMLDivElement>(null);\n // A body its content runs past is a tab stop named by the title, so a\n // keyboard can scroll it, when nothing inside it takes focus; a call\n // site's own name, role and tabIndex still win. See useScrollStop.\n const title = useSlottedContext(HeadingContext, 'title');\n const scrollStop = useScrollStop(ref, {\n label: props['aria-label'],\n title: title?.id\n });\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 {...scrollStop} id={id} {...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. Its\n * `Dialog.Body` is its description, so the message is read out with the\n * title; an `aria-describedby` of the call site's own names another.\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 // The id of the body, which an alert dialog is described by unless the\n // call site names a description of its own.\n const [body, setBody] = useState<string>();\n return <BasicContext value={isBasic}>\n <DescriptionContext value={isBasic ? setBody : null}>\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 <HeaderContext value={false}>\n <RACDialog {...props} aria-describedby={props['aria-describedby'] ?? (isBasic ? body : undefined)} {...stylex.props(overlay.modalDialog)}>\n {children}\n </RACDialog>\n </HeaderContext>\n </Modal>\n </ModalOverlay>\n </OverlayScope>\n </DescriptionContext>\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 <HeaderContext value>\n <div {...props} {...mergeStyles({\n 0: {\n className: \"x6s0dn4 x1j6faob x1sy0etr xf6te7g xso031l x9f619 x78zum5 x2lah0s x1gka490 x1qughib xnvi70j x11wnguw x1pr6p50 x1837goc xs3zajk xg0ps1x\"\n },\n 1: {\n className: \"x6s0dn4 x1j6faob xso031l x9f619 x78zum5 x2lah0s x1gka490 x1qughib xg0ps1x x1sy0etr x11wnguw x1837goc\"\n }\n }[!!isBasic << 0], props)} />\n </HeaderContext>;\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 const isHeaded = useContext(HeaderContext);\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 4: {\n className: \"x9f619 x139gbkf x1fz0g89 xl849ld xkb6epg xcji80f x76yrz5 x6ksu6j x1s1qhaa x1khanjg x1voeury xrr2tf9 x1ghz6dp xeuugli xj0a0fe xs2ltda xa4amcs\"\n },\n 2: {\n className: \"x9f619 x139gbkf x1ghz6dp xeuugli xj0a0fe x1fz0g89 xkb6epg x76yrz5 x1s1qhaa x1voeury\"\n },\n 6: {\n className: \"x9f619 x139gbkf x1ghz6dp xeuugli xj0a0fe xs2ltda xa4amcs x1fz0g89 xkb6epg x76yrz5 x1s1qhaa x1voeury\"\n },\n 1: {\n className: \"x9f619 x139gbkf x1fz0g89 xl849ld xkb6epg xcji80f x76yrz5 x6ksu6j x1s1qhaa x1khanjg x1voeury xrr2tf9 x1ghz6dp xeuugli xj0a0fe xs2ltda\"\n },\n 5: {\n className: \"x9f619 x139gbkf x1fz0g89 xl849ld xkb6epg xcji80f x76yrz5 x6ksu6j x1s1qhaa x1khanjg x1voeury xrr2tf9 x1ghz6dp xeuugli xj0a0fe xs2ltda\"\n },\n 3: {\n className: \"x9f619 x139gbkf x1ghz6dp xeuugli xj0a0fe x1fz0g89 xkb6epg x76yrz5 x1s1qhaa x1voeury xs2ltda\"\n },\n 7: {\n className: \"x9f619 x139gbkf x1ghz6dp xeuugli xj0a0fe x1fz0g89 xkb6epg x76yrz5 x1s1qhaa x1voeury xs2ltda\"\n }\n }[!!isHeaded << 2 | !!isBasic << 1 | !!(isBasic && isHeaded) << 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":";;;;;;;;;;;;;;AA0BuB,GAAkB0C,OAAOK,YAAeH,WAAWI;AAM1E,MAAMC,cAAc;AAsCpB,MAAMG,SAAS;CACbC,MAAM;EACJC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,QAAQ;EACNC,QAAQ;EACRhB,QAAQ;EACRiB,QAAQ;EACRC,QAAQ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AhB,gBAAA;CAAA,OACSzG,qBAAqBwH,uBAAuBL,cAAcI,oBAAoB;AAAC;AAExFjH,SAAOuH,OAAO5D;AACd3D,SAAOwH,UAAU9C;AACjB1E,SAAOyH,SAASvB;AAChBlG,SAAO0H,SAAStB;AAChBpG,SAAO2H,QAAQtB"}
|
|
@@ -51,7 +51,7 @@ type FabProps = {
|
|
|
51
51
|
* @default 'tonal'
|
|
52
52
|
*/
|
|
53
53
|
variant?: FabVariant;
|
|
54
|
-
} & Omit<ButtonDOMProps, 'isPending'>;
|
|
54
|
+
} & Omit<ButtonDOMProps, 'aria-label' | 'isPending'>;
|
|
55
55
|
type FabSize = 'lg' | 'md' | 'xl';
|
|
56
56
|
type FabTone = 'primary' | 'secondary' | 'tertiary';
|
|
57
57
|
type FabVariant = 'filled' | 'tonal';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["c","_c","ReactNode","RefAttributes","ClassNameOrFunction","StyleOrFunction","stylex","ButtonDOMProps","ButtonState","ButtonBase","extendedFabSizes","fabIconSizes","fabSizes","fabStyles","fabTones","focus","FabProps","children","className","disableRipple","href","label","rel","size","FabSize","style","target","tone","FabTone","variant","FabVariant","Omit","Fab","t0","$","props","t1","t2","t3","undefined","t4","t5","fabClasses","t6","icon","t7","isExtended","state","base","ring","isHovered","hovered","isFocusVisible","focused","isPressed","pressed","isDisabled","disabled","_c","props","stylex.props"],"sources":["../../../src/components/fab/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { ClassNameOrFunction, StyleOrFunction } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport type { ButtonDOMProps, ButtonState } from '../../button';\nimport { ButtonBase } from '../../button';\nimport { extendedFabSizes, fabIconSizes, fabSizes, fabStyles, fabTones } from '../../fab/styles';\nimport { focus } from '../../styles/focus';\n\n// The FAB page's floating action button, and the extended FAB page's form of\n// it with a label: a screen's primary action, raised over the content on the\n// pages' level 3 shadow and lifted to level 4 under a hovering pointer.\n//\n// Three sizes, the pages' FAB, medium FAB and large FAB: `md` is 56dp with a\n// 24dp icon and a 16dp corner, `lg` 80dp with 28dp and 20dp, and `xl` 96dp\n// with 36dp and 28dp. The extended form keeps the size's height and corner\n// and sets a label after the icon in the size's type role — title medium,\n// title large and headline small — with 16dp, 26dp and 28dp of padding and\n// 8dp, 12dp and 16dp before the label. The 80dp size, the 20dp corner and\n// the 26dp and 28dp paddings fall between steps of their scales and are\n// written out. The pages' small FAB is gone from the newer set, so there is\n// no `xs`.\n//\n// Six colour pairs, by `tone` and `variant`: `tonal` draws the tone's\n// container pair — primary container is the pages' default — and `filled`\n// the tone itself, as Button's two variants of those names do.\n//\n// The hover, focus and pressed layers are the label colour at the usual 8%,\n// 10% and 10%, drawn as an image over the container, as the row module draws\n// its layers, so one style serves all six pairs. The pages give no disabled\n// FAB; a disabled one takes the 12% and 38% every disabled container takes,\n// and drops its shadow.\n//\n// Under forced colours the shadow goes and the container is painted over, so\n// the button is drawn as a 1px `ButtonText` rule, as Button's are.\n//\n// What every button does past its own styles — the ripple, the link form, a\n// parent's disabled state — is `src/button`'s, shared with Button and\n// IconButton. The styles below are `src/fab`'s, shared with FabMenu's FAB.\n\ntype FabProps = {\n /**\n * What the FAB does, in words. A FAB without a `label` is an icon alone,\n * which has no name of its own, so give it this; with a `label` the label\n * is its name.\n */\n 'aria-label'?: string;\n /** The FAB's icon, drawn at the size's icon size. */\n children?: ReactNode;\n /** A function may compute the class from the FAB's render state. */\n className?: ClassNameOrFunction<ButtonState>;\n /**\n * Disables the press ripple. The state layers are unaffected.\n * @default false\n */\n disableRipple?: boolean;\n /**\n * Where the FAB leads. Given one, it is rendered as a link — an `<a>`,\n * announced as the link it is — with the same styles and ripple.\n */\n href?: string;\n /**\n * A label after the icon, which makes this the extended FAB: as tall as\n * the size, as wide as what it holds.\n */\n label?: ReactNode;\n /** The link's `rel`, when `href` is set. */\n rel?: string;\n /**\n * The pages' three sizes: `md` the FAB at 56px, `lg` the medium FAB at\n * 80px and `xl` the large FAB at 96px.\n * @default 'md'\n */\n size?: FabSize;\n /** A function may compute the style from the FAB's render state. */\n style?: StyleOrFunction<ButtonState>;\n /** The link's `target`, when `href` is set. */\n target?: string;\n /**\n * The colour role the FAB is drawn in.\n * @default 'primary'\n */\n tone?: FabTone;\n /**\n * `tonal` draws the tone's container pair, the pages' default; `filled`\n * draws the tone itself.\n * @default 'tonal'\n */\n variant?: FabVariant;\n} & Omit<ButtonDOMProps, 'isPending'>;\ntype FabSize = 'lg' | 'md' | 'xl';\ntype FabTone = 'primary' | 'secondary' | 'tertiary';\ntype FabVariant = 'filled' | 'tonal';\n\n/**\n * A screen's primary action, raised over its content. Its icon is its\n * children; given a `label` it is the extended FAB, with the label after the\n * icon. Given `href` it is a link with the same appearance.\n *\n * ```tsx\n * <Fab aria-label=\"Label\">\n * <PlusIcon />\n * </Fab>\n * ```\n */\nfunction Fab({\n children,\n label,\n size = 'md',\n tone = 'primary',\n variant = 'tonal',\n ...props\n}: FabProps & RefAttributes<HTMLAnchorElement | HTMLButtonElement>) {\n return <ButtonBase {...props} classes={fabClasses(label !== undefined, size, tone, variant)}>\n {children === undefined ? null : <span {...stylex.props(fabStyles.icon, fabIconSizes[size])}>\n {children}\n </span>}\n {label}\n </ButtonBase>;\n}\n\n// The FAB's classes, from React Aria's render state: the layers from what it\n// reports rather than from `:hover` and `:active`, for Button's reasons — see\n// its header. Built by a call rather than written inline at the prop, which\n// is what react-perf's no-new-function-as-prop is after.\nfunction fabClasses(isExtended: boolean, size: FabSize, tone: FabTone, variant: FabVariant) {\n return (state: ButtonState) => stylex.props(fabStyles.base, focus.ring, fabTones[variant][tone], isExtended ? extendedFabSizes[size] : fabSizes[size], state.isHovered && fabStyles.hovered, state.isFocusVisible && fabStyles.focused, state.isPressed && fabStyles.pressed, state.isDisabled && fabStyles.disabled);\n}\nexport type { FabProps, FabSize, FabTone, FabVariant };\nexport default Fab;"],"mappings":";;;;;;;;;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AA;EAAAiB,EAAA,MAAAjB;EAAAiB,EAAA,MAAAX;EAAAW,EAAA,MAAAS;CAAA,OAAAA,KAAAT,EAAA;CAAA,IAAAW;CAAA,IAAAX,EAAA,QAAAb,SAAAa,EAAA,QAAAC,WAAAD,EAAA,QAAAO,MAAAP,EAAA,QAAAS,IAAA;EAHNE,KAAA,qBAAC,YAAD;GAAW,GAAKV;GAAgB,SAAAM;GAAhC,UAAA,CACFE,IAGAtB,KAJa;;EAKHa,EAAA,MAAAb;EAAAa,EAAA,MAAAC;EAAAD,EAAA,MAAAO;EAAAP,EAAA,MAAAS;EAAAT,EAAA,MAAAW;CAAA,OAAAA,KAAAX,EAAA;CAAA,OALRW;AAKQ;AAOjB,SAASH,WAAWI,YAAqBvB,MAAeI,MAAeE,SAAqB;CAC1F,QAAQkB,UAAuBzC,MAAaO,UAAUmC,MAAMjC,MAAMkC,MAAMnC,SAASe,QAAQ,CAACF,OAAOmB,aAAapC,iBAAiBa,QAAQX,SAASW,OAAOwB,MAAMG,aAAarC,UAAUsC,SAASJ,MAAMK,kBAAkBvC,UAAUwC,SAASN,MAAMO,aAAazC,UAAU0C,SAASR,MAAMS,cAAc3C,UAAU4C,QAAQ;AACtT"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["c","_c","ReactNode","RefAttributes","ClassNameOrFunction","StyleOrFunction","stylex","ButtonDOMProps","ButtonState","ButtonBase","extendedFabSizes","fabIconSizes","fabSizes","fabStyles","fabTones","focus","FabProps","children","className","disableRipple","href","label","rel","size","FabSize","style","target","tone","FabTone","variant","FabVariant","Omit","Fab","t0","$","props","t1","t2","t3","undefined","t4","t5","fabClasses","t6","icon","t7","isExtended","state","base","ring","isHovered","hovered","isFocusVisible","focused","isPressed","pressed","isDisabled","disabled","_c","props","stylex.props"],"sources":["../../../src/components/fab/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { ClassNameOrFunction, StyleOrFunction } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport type { ButtonDOMProps, ButtonState } from '../../button';\nimport { ButtonBase } from '../../button';\nimport { extendedFabSizes, fabIconSizes, fabSizes, fabStyles, fabTones } from '../../fab/styles';\nimport { focus } from '../../styles/focus';\n\n// The FAB page's floating action button, and the extended FAB page's form of\n// it with a label: a screen's primary action, raised over the content on the\n// pages' level 3 shadow and lifted to level 4 under a hovering pointer.\n//\n// Three sizes, the pages' FAB, medium FAB and large FAB: `md` is 56dp with a\n// 24dp icon and a 16dp corner, `lg` 80dp with 28dp and 20dp, and `xl` 96dp\n// with 36dp and 28dp. The extended form keeps the size's height and corner\n// and sets a label after the icon in the size's type role — title medium,\n// title large and headline small — with 16dp, 26dp and 28dp of padding and\n// 8dp, 12dp and 16dp before the label. The 80dp size, the 20dp corner and\n// the 26dp and 28dp paddings fall between steps of their scales and are\n// written out. The pages' small FAB is gone from the newer set, so there is\n// no `xs`.\n//\n// Six colour pairs, by `tone` and `variant`: `tonal` draws the tone's\n// container pair — primary container is the pages' default — and `filled`\n// the tone itself, as Button's two variants of those names do.\n//\n// The hover, focus and pressed layers are the label colour at the usual 8%,\n// 10% and 10%, drawn as an image over the container, as the row module draws\n// its layers, so one style serves all six pairs. The pages give no disabled\n// FAB; a disabled one takes the 12% and 38% every disabled container takes,\n// and drops its shadow.\n//\n// Under forced colours the shadow goes and the container is painted over, so\n// the button is drawn as a 1px `ButtonText` rule, as Button's are.\n//\n// What every button does past its own styles — the ripple, the link form, a\n// parent's disabled state — is `src/button`'s, shared with Button and\n// IconButton. The styles below are `src/fab`'s, shared with FabMenu's FAB.\n\ntype FabProps = {\n /**\n * What the FAB does, in words. A FAB without a `label` is an icon alone,\n * which has no name of its own, so give it this; with a `label` the label\n * is its name.\n */\n 'aria-label'?: string;\n /** The FAB's icon, drawn at the size's icon size. */\n children?: ReactNode;\n /** A function may compute the class from the FAB's render state. */\n className?: ClassNameOrFunction<ButtonState>;\n /**\n * Disables the press ripple. The state layers are unaffected.\n * @default false\n */\n disableRipple?: boolean;\n /**\n * Where the FAB leads. Given one, it is rendered as a link — an `<a>`,\n * announced as the link it is — with the same styles and ripple.\n */\n href?: string;\n /**\n * A label after the icon, which makes this the extended FAB: as tall as\n * the size, as wide as what it holds.\n */\n label?: ReactNode;\n /** The link's `rel`, when `href` is set. */\n rel?: string;\n /**\n * The pages' three sizes: `md` the FAB at 56px, `lg` the medium FAB at\n * 80px and `xl` the large FAB at 96px.\n * @default 'md'\n */\n size?: FabSize;\n /** A function may compute the style from the FAB's render state. */\n style?: StyleOrFunction<ButtonState>;\n /** The link's `target`, when `href` is set. */\n target?: string;\n /**\n * The colour role the FAB is drawn in.\n * @default 'primary'\n */\n tone?: FabTone;\n /**\n * `tonal` draws the tone's container pair, the pages' default; `filled`\n * draws the tone itself.\n * @default 'tonal'\n */\n variant?: FabVariant;\n} & Omit<ButtonDOMProps, 'aria-label' | 'isPending'>;\ntype FabSize = 'lg' | 'md' | 'xl';\ntype FabTone = 'primary' | 'secondary' | 'tertiary';\ntype FabVariant = 'filled' | 'tonal';\n\n/**\n * A screen's primary action, raised over its content. Its icon is its\n * children; given a `label` it is the extended FAB, with the label after the\n * icon. Given `href` it is a link with the same appearance.\n *\n * ```tsx\n * <Fab aria-label=\"Label\">\n * <PlusIcon />\n * </Fab>\n * ```\n */\nfunction Fab({\n children,\n label,\n size = 'md',\n tone = 'primary',\n variant = 'tonal',\n ...props\n}: FabProps & RefAttributes<HTMLAnchorElement | HTMLButtonElement>) {\n return <ButtonBase {...props} classes={fabClasses(label !== undefined, size, tone, variant)}>\n {children === undefined ? null : <span {...stylex.props(fabStyles.icon, fabIconSizes[size])}>\n {children}\n </span>}\n {label}\n </ButtonBase>;\n}\n\n// The FAB's classes, from React Aria's render state: the layers from what it\n// reports rather than from `:hover` and `:active`, for Button's reasons — see\n// its header. Built by a call rather than written inline at the prop, which\n// is what react-perf's no-new-function-as-prop is after.\nfunction fabClasses(isExtended: boolean, size: FabSize, tone: FabTone, variant: FabVariant) {\n return (state: ButtonState) => stylex.props(fabStyles.base, focus.ring, fabTones[variant][tone], isExtended ? extendedFabSizes[size] : fabSizes[size], state.isHovered && fabStyles.hovered, state.isFocusVisible && fabStyles.focused, state.isPressed && fabStyles.pressed, state.isDisabled && fabStyles.disabled);\n}\nexport type { FabProps, FabSize, FabTone, FabVariant };\nexport default Fab;"],"mappings":";;;;;;;;;;;;;;;;;;;AA0GA,SAAAgC,IAAAC,IAAA;CAAA,MAAAC,IAAAjC,EAAA,EAAA;CAAA,IAAAgB;CAAA,IAAAI;CAAA,IAAAc;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAJ,EAAA,OAAAD,IAAA;EAAa,CAAA,CAAAhB,UAAAI,OAAAE,MAAAa,IAAAT,MAAAU,IAAAR,SAAAS,IAAA,GAAAH,WAAAF;EAOqDC,EAAA,KAAAD;EAAAC,EAAA,KAAAjB;EAAAiB,EAAA,KAAAb;EAAAa,EAAA,KAAAC;EAAAD,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAI;CAAA,OAAA;EAAArB,WAAAiB,EAAA;EAAAb,QAAAa,EAAA;EAAAC,UAAAD,EAAA;EAAAE,KAAAF,EAAA;EAAAG,KAAAH,EAAA;EAAAI,KAAAJ,EAAA;CAAA;CAJhE,MAAAX,OAAAa,OAAAG,KAAAA,IAAA,OAAAH;CACA,MAAAT,OAAAU,OAAAE,KAAAA,IAAA,YAAAF;CACA,MAAAR,UAAAS,OAAAC,KAAAA,IAAA,UAAAD;CAGkD,MAAAE,KAAAnB,UAAUkB,KAAAA;CAAS,IAAAE;CAAA,IAAAP,EAAA,OAAAX,QAAAW,EAAA,OAAAM,MAAAN,EAAA,OAAAP,QAAAO,EAAA,QAAAL,SAAA;EAA9BY,KAAAC,WAAWF,IAAqBjB,MAAMI,MAAME,OAAO;EAACK,EAAA,KAAAX;EAAAW,EAAA,KAAAM;EAAAN,EAAA,KAAAP;EAAAO,EAAA,MAAAL;EAAAK,EAAA,MAAAO;CAAA,OAAAA,KAAAP,EAAA;CAAA,IAAAS;CAAA,IAAAT,EAAA,QAAAjB,YAAAiB,EAAA,QAAAX,MAAA;EACtFoB,KAAA1B,aAAasB,KAAAA,IAAb,OAAgC,oBAAA,QAAA;GAExB,GAFkCjC,MAAaO,UAAS+B,MAAOjC,aAAaY,KAAK;GACrFN;EACI,CAAA;EAAAiB,EAAA,MAAAjB;EAAAiB,EAAA,MAAAX;EAAAW,EAAA,MAAAS;CAAA,OAAAA,KAAAT,EAAA;CAAA,IAAAW;CAAA,IAAAX,EAAA,QAAAb,SAAAa,EAAA,QAAAC,WAAAD,EAAA,QAAAO,MAAAP,EAAA,QAAAS,IAAA;EAHNE,KAAA,qBAAC,YAAD;GAAW,GAAKV;GAAgB,SAAAM;GAAhC,UAAA,CACFE,IAGAtB,KAJa;;EAKHa,EAAA,MAAAb;EAAAa,EAAA,MAAAC;EAAAD,EAAA,MAAAO;EAAAP,EAAA,MAAAS;EAAAT,EAAA,MAAAW;CAAA,OAAAA,KAAAX,EAAA;CAAA,OALRW;AAKQ;AAOjB,SAASH,WAAWI,YAAqBvB,MAAeI,MAAeE,SAAqB;CAC1F,QAAQkB,UAAuBzC,MAAaO,UAAUmC,MAAMjC,MAAMkC,MAAMnC,SAASe,QAAQ,CAACF,OAAOmB,aAAapC,iBAAiBa,QAAQX,SAASW,OAAOwB,MAAMG,aAAarC,UAAUsC,SAASJ,MAAMK,kBAAkBvC,UAAUwC,SAASN,MAAMO,aAAazC,UAAU0C,SAASR,MAAMS,cAAc3C,UAAU4C,QAAQ;AACtT"}
|
|
@@ -11,6 +11,13 @@ type FormProps$1 = {
|
|
|
11
11
|
* malformed field blocks submission, and its message is the browser's
|
|
12
12
|
* own, shown once submission is tried.
|
|
13
13
|
*
|
|
14
|
+
* Under `aria`, `isRequired` marks a field and checks nothing. The label
|
|
15
|
+
* takes its asterisk and the control `aria-required`, but an empty
|
|
16
|
+
* required field neither stops the form submitting nor shows a message,
|
|
17
|
+
* since the control carries no `required` for the browser to enforce. A
|
|
18
|
+
* form that must not go out with one empty checks it in `onSubmit` and
|
|
19
|
+
* hands the field its `error`, as the Client validation story does.
|
|
20
|
+
*
|
|
14
21
|
* Under `aria`, moving focus after a server answers is the call site's.
|
|
15
22
|
* The errors are associated — `aria-invalid` on each control, the message
|
|
16
23
|
* in its `aria-describedby` — and each is read out politely as it appears
|
|
@@ -21,7 +28,7 @@ type FormProps$1 = {
|
|
|
21
28
|
* @default 'aria'
|
|
22
29
|
*/
|
|
23
30
|
validationBehavior?: 'aria' | 'native';
|
|
24
|
-
} & Omit<FormProps, 'className' | 'style'>;
|
|
31
|
+
} & Omit<FormProps, 'className' | 'style' | 'validationBehavior'>;
|
|
25
32
|
/**
|
|
26
33
|
* A form: the fields inside it and what they are told about validation. Pass
|
|
27
34
|
* `validationErrors`, an object keyed by field `name`, to show what a server
|
|
@@ -37,9 +44,12 @@ type FormProps$1 = {
|
|
|
37
44
|
* A form also reserves each field's message line. A field on its own draws
|
|
38
45
|
* that line only once it has something to say, so an error arriving after a
|
|
39
46
|
* submit or an async check makes the field taller and moves everything below
|
|
40
|
-
* it down the page. Inside a form the line is there from the start, empty
|
|
41
|
-
* and
|
|
42
|
-
*
|
|
47
|
+
* it down the page. Inside a form the line is there from the start, empty
|
|
48
|
+
* and one line tall, so a message that fits on it moves nothing when it
|
|
49
|
+
* arrives — which is the whole reason a form is where a message arrives
|
|
50
|
+
* after the fact. A longer message wraps, and each line past the first
|
|
51
|
+
* pushes everything below it down, so keep a message that arrives after the
|
|
52
|
+
* fact to one line.
|
|
43
53
|
*
|
|
44
54
|
* The call site's `className` and `style` land on the form element, which is
|
|
45
55
|
* the element a layout positions.
|
|
@@ -20,9 +20,12 @@ import { Form } from "react-aria-components";
|
|
|
20
20
|
* A form also reserves each field's message line. A field on its own draws
|
|
21
21
|
* that line only once it has something to say, so an error arriving after a
|
|
22
22
|
* submit or an async check makes the field taller and moves everything below
|
|
23
|
-
* it down the page. Inside a form the line is there from the start, empty
|
|
24
|
-
* and
|
|
25
|
-
*
|
|
23
|
+
* it down the page. Inside a form the line is there from the start, empty
|
|
24
|
+
* and one line tall, so a message that fits on it moves nothing when it
|
|
25
|
+
* arrives — which is the whole reason a form is where a message arrives
|
|
26
|
+
* after the fact. A longer message wraps, and each line past the first
|
|
27
|
+
* pushes everything below it down, so keep a message that arrives after the
|
|
28
|
+
* fact to one line.
|
|
26
29
|
*
|
|
27
30
|
* The call site's `className` and `style` land on the form element, which is
|
|
28
31
|
* the element a layout positions.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["c","_c","CSSProperties","RefAttributes","FormProps","RACFormProps","stylex","Form","RACForm","FIELD_VALIDATION_BEHAVIOR","mergeStyles","className","style","validationBehavior","Omit","t0","$","T0","t1","t2","t3","t4","props","undefined","Form","_c","RACForm"],"sources":["../../../src/components/form/index.tsx"],"sourcesContent":["'use client';\n\nimport type { CSSProperties, RefAttributes } 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` — and each is read out politely as it appears\n * under its field, but nothing moves, because no part of the form knows a\n * round trip happened. `validationErrors` is a prop rather than an event,\n * so a form cannot tell a submission coming back from a first render that\n * was given errors to begin with. The Async submit story shows the move.\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 * A form also reserves each field's message line. A field on its own draws\n * that line only once it has something to say, so an error arriving after a\n * submit or an async check makes the field taller and moves everything below\n * it down the page. Inside a form the line is there from the start, empty
|
|
1
|
+
{"version":3,"file":"index.js","names":["c","_c","CSSProperties","RefAttributes","FormProps","RACFormProps","stylex","Form","RACForm","FIELD_VALIDATION_BEHAVIOR","mergeStyles","className","style","validationBehavior","Omit","t0","$","T0","t1","t2","t3","t4","props","undefined","Form","_c","RACForm"],"sources":["../../../src/components/form/index.tsx"],"sourcesContent":["'use client';\n\nimport type { CSSProperties, RefAttributes } 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`, `isRequired` marks a field and checks nothing. The label\n * takes its asterisk and the control `aria-required`, but an empty\n * required field neither stops the form submitting nor shows a message,\n * since the control carries no `required` for the browser to enforce. A\n * form that must not go out with one empty checks it in `onSubmit` and\n * hands the field its `error`, as the Client validation story does.\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` — and each is read out politely as it appears\n * under its field, but nothing moves, because no part of the form knows a\n * round trip happened. `validationErrors` is a prop rather than an event,\n * so a form cannot tell a submission coming back from a first render that\n * was given errors to begin with. The Async submit story shows the move.\n * @default 'aria'\n */\n validationBehavior?: 'aria' | 'native';\n} & Omit<RACFormProps, 'className' | 'style' | 'validationBehavior'>;\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 * A form also reserves each field's message line. A field on its own draws\n * that line only once it has something to say, so an error arriving after a\n * submit or an async check makes the field taller and moves everything below\n * it down the page. Inside a form the line is there from the start, empty\n * and one line tall, so a message that fits on it moves nothing when it\n * arrives — which is the whole reason a form is where a message arrives\n * after the fact. A longer message wraps, and each line past the first\n * pushes everything below it down, so keep a message that arrives after the\n * fact to one line.\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 & RefAttributes<HTMLFormElement>) {\n return <RACForm validationBehavior={validationBehavior} {...props} {...mergeStyles({\n className: \"x9f619\"\n }, props)} />;\n}\nexport type { FormProps };\nexport default Form;"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6EA,SAAAO,OAAAQ,IAAA;CAAA,MAAAC,IAAAf,EAAA,EAAA;CAAA,IAAAgB;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAJ,EAAA,OAAAD,IAAA;EAAc,MAAA,EAAAF,oBAAAQ,IAAA,GAAAC,UAAAP;EACZ,MAAAF,qBAAAQ,OAAAE,KAAAA,IAAAd,4BAAAY;EAGQJ,KAAAT;EAA4BK,KAAAA;EAAwBS,KAAAA;EAAWF,KAAAV,YAAY,EAAAC,WACtE,SACb,GAAGW,KAAK;EAACN,EAAA,KAAAD;EAAAC,EAAA,KAAAC;EAAAD,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAI;CAAA,OAAA;EAAAH,KAAAD,EAAA;EAAAE,KAAAF,EAAA;EAAAG,KAAAH,EAAA;EAAAI,KAAAJ,EAAA;CAAA;CAAA,IAAAK;CAAA,IAAAL,EAAA,OAAAC,MAAAD,EAAA,OAAAE,MAAAF,EAAA,OAAAG,MAAAH,EAAA,OAAAI,IAAA;EAFFC,KAAA,oBAAC,IAAD;GAA6BR,oBAAAA;GAAkB,GAAMS;GAAK,GAAMF;EAE9D,CAAA;EAAIJ,EAAA,KAAAC;EAAAD,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAI;EAAAJ,EAAA,KAAAK;CAAA,OAAAA,KAAAL,EAAA;CAAA,OAFNK;AAEM"}
|
|
@@ -52,7 +52,7 @@ type IconButtonProps = {
|
|
|
52
52
|
* @default 'standard'
|
|
53
53
|
*/
|
|
54
54
|
variant?: IconButtonVariant;
|
|
55
|
-
} & ButtonForm & Omit<ButtonDOMProps, 'render'>;
|
|
55
|
+
} & ButtonForm & Omit<ButtonDOMProps, 'aria-label' | 'render'>;
|
|
56
56
|
type IconButtonSize = 'lg' | 'md' | 'xl' | 'xs' | 'xxl';
|
|
57
57
|
type IconButtonState = ButtonState;
|
|
58
58
|
type IconButtonVariant = 'filled' | 'outlined' | 'standard' | 'tonal';
|
|
@@ -73,6 +73,20 @@ type IconButtonVariant = 'filled' | 'outlined' | 'standard' | 'tonal';
|
|
|
73
73
|
* <StarIcon />
|
|
74
74
|
* </IconButton>
|
|
75
75
|
* ```
|
|
76
|
+
*
|
|
77
|
+
* An icon shows a sighted reader no words, so one whose meaning is not plain
|
|
78
|
+
* from its shape goes inside a `Tooltip` that repeats its `aria-label`,
|
|
79
|
+
* shown while a pointer rests on it or it holds focus. The tooltip repeats
|
|
80
|
+
* the name rather than giving it: touch never shows one, so `aria-label` is
|
|
81
|
+
* still what names the button.
|
|
82
|
+
*
|
|
83
|
+
* ```tsx
|
|
84
|
+
* <Tooltip label="Search">
|
|
85
|
+
* <IconButton aria-label="Search">
|
|
86
|
+
* <SearchIcon />
|
|
87
|
+
* </IconButton>
|
|
88
|
+
* </Tooltip>
|
|
89
|
+
* ```
|
|
76
90
|
*/
|
|
77
91
|
declare function IconButton({ defaultSelected, href, isPending, isSelected, onChange, pendingLabel, rel, size: ownSize, target, variant, ...props }: IconButtonProps & RefAttributes<HTMLAnchorElement | HTMLButtonElement>): import("react").JSX.Element;
|
|
78
92
|
//#endregion
|
|
@@ -101,7 +101,7 @@ const styles = {
|
|
|
101
101
|
standard: {
|
|
102
102
|
kWkggS: "xjbqb8w",
|
|
103
103
|
kMzoRj: "xc342km",
|
|
104
|
-
kMwMTN: "
|
|
104
|
+
kMwMTN: "x11wi6qo",
|
|
105
105
|
$$css: true
|
|
106
106
|
},
|
|
107
107
|
standardDisabled: {
|
|
@@ -421,6 +421,20 @@ function groupStyles(group, size, state) {
|
|
|
421
421
|
* <StarIcon />
|
|
422
422
|
* </IconButton>
|
|
423
423
|
* ```
|
|
424
|
+
*
|
|
425
|
+
* An icon shows a sighted reader no words, so one whose meaning is not plain
|
|
426
|
+
* from its shape goes inside a `Tooltip` that repeats its `aria-label`,
|
|
427
|
+
* shown while a pointer rests on it or it holds focus. The tooltip repeats
|
|
428
|
+
* the name rather than giving it: touch never shows one, so `aria-label` is
|
|
429
|
+
* still what names the button.
|
|
430
|
+
*
|
|
431
|
+
* ```tsx
|
|
432
|
+
* <Tooltip label="Search">
|
|
433
|
+
* <IconButton aria-label="Search">
|
|
434
|
+
* <SearchIcon />
|
|
435
|
+
* </IconButton>
|
|
436
|
+
* </Tooltip>
|
|
437
|
+
* ```
|
|
424
438
|
*/
|
|
425
439
|
function IconButton(t0) {
|
|
426
440
|
const $ = c(25);
|