@kanso-labs/kanso-ui 0.47.5 → 0.48.1
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/button/hooks.js +38 -4
- package/dist/button/hooks.js.map +1 -1
- package/dist/button/index.js +80 -67
- package/dist/button/index.js.map +1 -1
- package/dist/calendar/index.js +5 -5
- package/dist/calendar/styles.js +5 -5
- package/dist/calendar/styles.js.map +1 -1
- package/dist/chip/label.js +1 -1
- package/dist/chip/styles.js +1 -1
- package/dist/chip/styles.js.map +1 -1
- package/dist/collection/context.js +6 -0
- package/dist/collection/context.js.map +1 -0
- package/dist/collection/index.js +2 -2
- package/dist/collection/styles.js +29 -6
- package/dist/collection/styles.js.map +1 -1
- package/dist/components/app-bar/index.d.ts +1 -1
- package/dist/components/app-bar/index.js +2 -2
- package/dist/components/autocomplete/index.js +2 -2
- package/dist/components/avatar/index.d.ts +1 -1
- package/dist/components/avatar/index.js +1 -1
- package/dist/components/badge/index.js +3 -3
- package/dist/components/breadcrumbs/index.js +2 -2
- package/dist/components/button/index.d.ts +1 -1
- package/dist/components/button/index.js +3 -3
- package/dist/components/button/index.js.map +1 -1
- package/dist/components/button-group/index.d.ts +1 -1
- package/dist/components/button-group/index.js +3 -3
- package/dist/components/calendar/index.js +11 -4
- package/dist/components/calendar/index.js.map +1 -1
- package/dist/components/card/index.js +2 -2
- package/dist/components/carousel/index.d.ts +1 -1
- package/dist/components/carousel/index.js +2 -2
- package/dist/components/checkbox/index.js +13 -10
- package/dist/components/checkbox/index.js.map +1 -1
- package/dist/components/checkbox-group/index.js +4 -3
- package/dist/components/checkbox-group/index.js.map +1 -1
- package/dist/components/chip/index.js +2 -2
- package/dist/components/chip-group/index.js +72 -69
- package/dist/components/chip-group/index.js.map +1 -1
- package/dist/components/code/index.js +1 -1
- package/dist/components/color-area/index.js +2 -2
- package/dist/components/color-field/index.d.ts +1 -1
- package/dist/components/color-field/index.js +2 -2
- package/dist/components/color-picker/index.js +2 -2
- package/dist/components/color-slider/index.js +3 -3
- package/dist/components/color-swatch/index.js +3 -3
- package/dist/components/color-swatch-picker/index.js +3 -2
- package/dist/components/color-swatch-picker/index.js.map +1 -1
- package/dist/components/color-wheel/index.js +2 -2
- package/dist/components/combo-box/index.d.ts +1 -1
- package/dist/components/combo-box/index.js +8 -4
- package/dist/components/combo-box/index.js.map +1 -1
- package/dist/components/container/index.js +1 -1
- package/dist/components/copy-field/index.js +2 -2
- package/dist/components/currency/index.js +3 -3
- package/dist/components/date-field/index.d.ts +1 -1
- package/dist/components/date-field/index.js +2 -2
- package/dist/components/date-picker/index.d.ts +2 -2
- package/dist/components/date-picker/index.js +5 -5
- package/dist/components/date-range-picker/index.d.ts +2 -2
- package/dist/components/date-range-picker/index.js +3 -3
- package/dist/components/dialog/index.js +4 -4
- package/dist/components/disclosure/index.js +3 -3
- package/dist/components/disclosure-group/index.js +3 -3
- package/dist/components/drop-zone/index.js +2 -2
- package/dist/components/drop-zone/styles.js +11 -11
- package/dist/components/drop-zone/styles.js.map +1 -1
- package/dist/components/fab/index.d.ts +1 -1
- package/dist/components/fab/index.js +1 -1
- package/dist/components/fab-menu/index.d.ts +2 -2
- package/dist/components/fab-menu/index.js +6 -6
- package/dist/components/fab-menu/index.js.map +1 -1
- package/dist/components/feed/index.js +1 -1
- package/dist/components/form/index.js +2 -2
- package/dist/components/icon-button/index.d.ts +1 -1
- package/dist/components/icon-button/index.js +3 -3
- package/dist/components/icon-button/index.js.map +1 -1
- package/dist/components/keycap/index.js +2 -2
- package/dist/components/link/index.js +2 -2
- package/dist/components/list/index.js +61 -14
- package/dist/components/list/index.js.map +1 -1
- package/dist/components/list-box/index.js +84 -105
- package/dist/components/list-box/index.js.map +1 -1
- package/dist/components/list-detail/index.d.ts +1 -1
- package/dist/components/list-detail/index.js +1 -1
- package/dist/components/list-item/index.js +1 -1
- package/dist/components/loading-indicator/index.js +2 -2
- package/dist/components/menu/index.d.ts +2 -2
- package/dist/components/menu/index.js +3 -3
- package/dist/components/meter/index.d.ts +1 -1
- package/dist/components/meter/index.js +2 -2
- package/dist/components/navigation-bar/index.d.ts +1 -1
- package/dist/components/navigation-bar/index.js +2 -2
- package/dist/components/navigation-rail/index.d.ts +1 -1
- package/dist/components/navigation-rail/index.js +6 -6
- package/dist/components/navigation-rail/index.js.map +1 -1
- package/dist/components/navigation-tree/index.js +2 -2
- package/dist/components/number-field/index.d.ts +1 -1
- package/dist/components/number-field/index.js +5 -5
- package/dist/components/number-field/index.js.map +1 -1
- package/dist/components/popover/index.d.ts +1 -1
- package/dist/components/popover/index.js +7 -7
- package/dist/components/popover/index.js.map +1 -1
- package/dist/components/product-icon/index.d.ts +1 -1
- package/dist/components/product-icon/index.js +1 -1
- package/dist/components/progress-indicator/index.d.ts +1 -1
- package/dist/components/progress-indicator/index.js +2 -2
- package/dist/components/radio-group/index.js +14 -13
- package/dist/components/radio-group/index.js.map +1 -1
- package/dist/components/range-calendar/index.js +3 -3
- package/dist/components/search-field/index.js +6 -6
- package/dist/components/search-field/index.js.map +1 -1
- package/dist/components/search-view/index.d.ts +1 -1
- package/dist/components/search-view/index.js +2 -2
- package/dist/components/segmented-button/index.d.ts +1 -1
- package/dist/components/segmented-button/index.js +3 -3
- package/dist/components/select/index.d.ts +1 -1
- package/dist/components/select/index.js +8 -4
- package/dist/components/select/index.js.map +1 -1
- package/dist/components/separator/index.js +3 -3
- package/dist/components/sheet/index.js +4 -4
- package/dist/components/sheet/index.js.map +1 -1
- package/dist/components/slider/index.js +4 -4
- package/dist/components/slider/index.js.map +1 -1
- package/dist/components/snackbar/index.js +6 -6
- package/dist/components/snackbar/index.js.map +1 -1
- package/dist/components/split-button/index.d.ts +1 -1
- package/dist/components/split-button/index.js +56 -44
- package/dist/components/split-button/index.js.map +1 -1
- package/dist/components/stack/index.js +2 -2
- package/dist/components/supporting-pane/index.d.ts +1 -1
- package/dist/components/supporting-pane/index.js +1 -1
- package/dist/components/switch/index.d.ts +1 -1
- package/dist/components/switch/index.js +3 -3
- package/dist/components/table/index.js +61 -48
- package/dist/components/table/index.js.map +1 -1
- package/dist/components/tabs/index.js +84 -33
- package/dist/components/tabs/index.js.map +1 -1
- package/dist/components/tag/index.js +1 -1
- package/dist/components/text/index.js +1 -1
- package/dist/components/text-area/index.d.ts +1 -1
- package/dist/components/text-area/index.js +2 -2
- package/dist/components/text-field/index.d.ts +1 -1
- package/dist/components/text-field/index.js +2 -2
- package/dist/components/time-field/index.d.ts +1 -1
- package/dist/components/time-field/index.js +2 -2
- package/dist/components/time-picker/index.d.ts +1 -1
- package/dist/components/time-picker/index.js +9 -9
- package/dist/components/time-picker/index.js.map +1 -1
- package/dist/components/token-field/index.d.ts +1 -1
- package/dist/components/token-field/index.js +3 -3
- package/dist/components/toolbar/index.js +3 -3
- package/dist/components/tooltip/index.d.ts +1 -1
- package/dist/components/tooltip/index.js +2 -2
- package/dist/components/tree/index.js +81 -24
- package/dist/components/tree/index.js.map +1 -1
- package/dist/control/index.js +2 -2
- package/dist/drag/hooks.js +2 -2
- package/dist/drag/index.js +2 -2
- package/dist/field/index.js +106 -107
- package/dist/field/index.js.map +1 -1
- package/dist/field/styles.js +1 -1
- package/dist/field/styles.js.map +1 -1
- package/dist/glyphs/index.js +1 -1
- package/dist/hooks/useClippedTitle.js +1 -1
- package/dist/hooks/useEnlargedText.js +1 -1
- package/dist/hooks/useRipple.js +2 -2
- package/dist/hooks/useScrollEdges.js +73 -0
- package/dist/hooks/useScrollEdges.js.map +1 -0
- package/dist/i18n/index.js +2 -2
- package/dist/index.js +1 -1
- package/dist/indicator/index.js +2 -2
- package/dist/mark/index.js +2 -2
- package/dist/navigation/index.js +3 -3
- package/dist/navigation/styles.js +5 -5
- package/dist/navigation/styles.js.map +1 -1
- package/dist/overlay/index.js +1 -1
- package/dist/render/useRender.js +1 -1
- package/dist/row/index.js +2 -2
- package/dist/row/styles.js +7 -7
- package/dist/row/styles.js.map +1 -1
- package/dist/segments/index.js +1 -1
- package/dist/segments/literal.js +3 -3
- package/dist/styles/color.js +16 -16
- package/dist/styles/color.js.map +1 -1
- package/dist/styles/focus.js +4 -4
- package/dist/styles/focus.js.map +1 -1
- package/dist/styles/overlay.js +3 -3
- package/dist/styles/overlay.js.map +1 -1
- package/dist/styles/scroll-fade.js +33 -0
- package/dist/styles/scroll-fade.js.map +1 -0
- package/dist/styles.css +61 -20
- package/dist/theme-scope.js +4 -4
- package/package.json +8 -8
|
@@ -1,26 +1,40 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
2
3
|
import { props } from "../../node_modules/@stylexjs/stylex/lib/es/stylex.js";
|
|
4
|
+
import { useContext } from "react";
|
|
5
|
+
import { Header, ListBox as ListBox$1, ListBoxItem as ListBoxItem$1, ListBoxLoadMoreItem, ListBoxSection as ListBoxSection$1 } from "react-aria-components";
|
|
3
6
|
import { CollectionEmpty, CollectionLoadMore } from "../../collection/index.js";
|
|
7
|
+
import { OptionRowContext } from "../../collection/context.js";
|
|
4
8
|
import { collectionStyles, containerClasses, rowItemStyles } from "../../collection/styles.js";
|
|
5
9
|
import { textOf } from "../../collection/text.js";
|
|
6
10
|
import { useRipple } from "../../hooks/useRipple.js";
|
|
7
11
|
import { RowContent } from "../../row/index.js";
|
|
8
12
|
import { mergeStatefulStyles, mergeStyles } from "../../styles/merge.js";
|
|
9
|
-
import {
|
|
10
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
-
import { Header, ListBox as ListBox$1, ListBoxItem as ListBoxItem$1, ListBoxLoadMoreItem, ListBoxSection as ListBoxSection$1 } from "react-aria-components";
|
|
13
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
12
14
|
// src/components/list-box/index.tsx
|
|
15
|
+
function EmptyRow() {
|
|
16
|
+
const $ = c(2);
|
|
17
|
+
const t0 = useContext(OptionRowContext);
|
|
18
|
+
let t1;
|
|
19
|
+
if ($[0] !== t0) {
|
|
20
|
+
t1 = /* @__PURE__ */ jsx(CollectionEmpty, { variant: t0 });
|
|
21
|
+
$[0] = t0;
|
|
22
|
+
$[1] = t1;
|
|
23
|
+
} else t1 = $[1];
|
|
24
|
+
return t1;
|
|
25
|
+
}
|
|
13
26
|
function emptyState() {
|
|
14
|
-
return /* @__PURE__ */ jsx(
|
|
27
|
+
return /* @__PURE__ */ jsx(EmptyRow, {});
|
|
15
28
|
}
|
|
16
|
-
function itemContent(children, leading, overline, supporting, trailing, ripple) {
|
|
17
|
-
return (state) => /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(RowContent, {
|
|
29
|
+
function itemContent(children, leading, overline, supporting, trailing, ripple, variant) {
|
|
30
|
+
return (state) => /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(RowContent, {
|
|
18
31
|
isDisabled: state.isDisabled,
|
|
19
32
|
isSelected: state.isSelected,
|
|
20
33
|
leading,
|
|
21
34
|
overline,
|
|
22
35
|
supporting,
|
|
23
36
|
trailing,
|
|
37
|
+
variant,
|
|
24
38
|
children
|
|
25
39
|
}), state.isDisabled ? null : ripple] });
|
|
26
40
|
}
|
|
@@ -69,8 +83,9 @@ function ListBox(props) {
|
|
|
69
83
|
* the key selection is reported by.
|
|
70
84
|
*/
|
|
71
85
|
function ListBoxItem(t0) {
|
|
72
|
-
const $ = c(
|
|
86
|
+
const $ = c(24);
|
|
73
87
|
const { children, leading, onContextMenu, onPointerCancel, onPointerDown, onPointerLeave, onPointerUp, overline, supporting, textValue, trailing, ...props } = t0;
|
|
88
|
+
const variant = useContext(OptionRowContext);
|
|
74
89
|
let t1;
|
|
75
90
|
if ($[0] !== onContextMenu || $[1] !== onPointerCancel || $[2] !== onPointerDown || $[3] !== onPointerLeave || $[4] !== onPointerUp) {
|
|
76
91
|
t1 = {
|
|
@@ -97,20 +112,21 @@ function ListBoxItem(t0) {
|
|
|
97
112
|
$[8] = t2;
|
|
98
113
|
} else t2 = $[8];
|
|
99
114
|
const t3 = ripple.handlers;
|
|
100
|
-
const t4 = mergeStatefulStyles(rowItemStyles(supporting, overline), props);
|
|
115
|
+
const t4 = mergeStatefulStyles(rowItemStyles(supporting, overline, void 0, variant), props);
|
|
101
116
|
let t5;
|
|
102
|
-
if ($[9] !== children || $[10] !== leading || $[11] !== overline || $[12] !== ripple.surface || $[13] !== supporting || $[14] !== trailing) {
|
|
103
|
-
t5 = itemContent(children, leading, overline, supporting, trailing, ripple.surface);
|
|
117
|
+
if ($[9] !== children || $[10] !== leading || $[11] !== overline || $[12] !== ripple.surface || $[13] !== supporting || $[14] !== trailing || $[15] !== variant) {
|
|
118
|
+
t5 = itemContent(children, leading, overline, supporting, trailing, ripple.surface, variant);
|
|
104
119
|
$[9] = children;
|
|
105
120
|
$[10] = leading;
|
|
106
121
|
$[11] = overline;
|
|
107
122
|
$[12] = ripple.surface;
|
|
108
123
|
$[13] = supporting;
|
|
109
124
|
$[14] = trailing;
|
|
110
|
-
$[15] =
|
|
111
|
-
|
|
125
|
+
$[15] = variant;
|
|
126
|
+
$[16] = t5;
|
|
127
|
+
} else t5 = $[16];
|
|
112
128
|
let t6;
|
|
113
|
-
if ($[
|
|
129
|
+
if ($[17] !== T0 || $[18] !== props || $[19] !== ripple.handlers || $[20] !== t2 || $[21] !== t4 || $[22] !== t5) {
|
|
114
130
|
t6 = /* @__PURE__ */ jsx(T0, {
|
|
115
131
|
textValue: t2,
|
|
116
132
|
...t3,
|
|
@@ -118,14 +134,14 @@ function ListBoxItem(t0) {
|
|
|
118
134
|
...t4,
|
|
119
135
|
children: t5
|
|
120
136
|
});
|
|
121
|
-
$[
|
|
122
|
-
$[
|
|
123
|
-
$[
|
|
124
|
-
$[
|
|
125
|
-
$[
|
|
126
|
-
$[
|
|
127
|
-
$[
|
|
128
|
-
} else t6 = $[
|
|
137
|
+
$[17] = T0;
|
|
138
|
+
$[18] = props;
|
|
139
|
+
$[19] = ripple.handlers;
|
|
140
|
+
$[20] = t2;
|
|
141
|
+
$[21] = t4;
|
|
142
|
+
$[22] = t5;
|
|
143
|
+
$[23] = t6;
|
|
144
|
+
} else t6 = $[23];
|
|
129
145
|
return t6;
|
|
130
146
|
}
|
|
131
147
|
/**
|
|
@@ -134,107 +150,70 @@ function ListBoxItem(t0) {
|
|
|
134
150
|
* `isLoading` — so a list that pages as it scrolls needs nothing else.
|
|
135
151
|
*/
|
|
136
152
|
function ListBoxLoadMore(t0) {
|
|
137
|
-
const $ = c(
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
153
|
+
const $ = c(7);
|
|
154
|
+
const { label, ...props$1 } = t0;
|
|
155
|
+
const variant = useContext(OptionRowContext);
|
|
156
|
+
const T0 = ListBoxLoadMoreItem;
|
|
157
|
+
const t1 = mergeStyles(props(collectionStyles.loading, variant === "menu" && collectionStyles.loadingMenu), props$1);
|
|
141
158
|
let t2;
|
|
142
|
-
if ($[0] !==
|
|
143
|
-
|
|
144
|
-
label = t3;
|
|
145
|
-
T0 = ListBoxLoadMoreItem;
|
|
146
|
-
t1 = props$1;
|
|
147
|
-
t2 = mergeStyles(props(collectionStyles.loading), props$1);
|
|
148
|
-
$[0] = t0;
|
|
149
|
-
$[1] = T0;
|
|
150
|
-
$[2] = label;
|
|
151
|
-
$[3] = t1;
|
|
152
|
-
$[4] = t2;
|
|
153
|
-
} else {
|
|
154
|
-
T0 = $[1];
|
|
155
|
-
label = $[2];
|
|
156
|
-
t1 = $[3];
|
|
157
|
-
t2 = $[4];
|
|
158
|
-
}
|
|
159
|
-
let t3;
|
|
160
|
-
if ($[5] !== label) {
|
|
161
|
-
t3 = /* @__PURE__ */ jsx(CollectionLoadMore, {
|
|
159
|
+
if ($[0] !== label) {
|
|
160
|
+
t2 = /* @__PURE__ */ jsx(CollectionLoadMore, {
|
|
162
161
|
diameter: "24px",
|
|
163
162
|
label
|
|
164
163
|
});
|
|
165
|
-
$[
|
|
166
|
-
$[
|
|
167
|
-
} else
|
|
168
|
-
let
|
|
169
|
-
if ($[
|
|
170
|
-
|
|
164
|
+
$[0] = label;
|
|
165
|
+
$[1] = t2;
|
|
166
|
+
} else t2 = $[1];
|
|
167
|
+
let t3;
|
|
168
|
+
if ($[2] !== T0 || $[3] !== props$1 || $[4] !== t1 || $[5] !== t2) {
|
|
169
|
+
t3 = /* @__PURE__ */ jsx(T0, {
|
|
170
|
+
...props$1,
|
|
171
171
|
...t1,
|
|
172
|
-
|
|
173
|
-
children: t3
|
|
172
|
+
children: t2
|
|
174
173
|
});
|
|
175
|
-
$[
|
|
176
|
-
$[
|
|
177
|
-
$[
|
|
178
|
-
$[
|
|
179
|
-
$[
|
|
180
|
-
} else
|
|
181
|
-
return
|
|
174
|
+
$[2] = T0;
|
|
175
|
+
$[3] = props$1;
|
|
176
|
+
$[4] = t1;
|
|
177
|
+
$[5] = t2;
|
|
178
|
+
$[6] = t3;
|
|
179
|
+
} else t3 = $[6];
|
|
180
|
+
return t3;
|
|
182
181
|
}
|
|
183
182
|
/**
|
|
184
183
|
* A named group of options. `header` names it, and is what a screen reader
|
|
185
184
|
* reads before the options inside.
|
|
186
185
|
*/
|
|
187
186
|
function ListBoxSection(t0) {
|
|
188
|
-
const $ = c(
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
187
|
+
const $ = c(9);
|
|
188
|
+
const { children, header, ...props$2 } = t0;
|
|
189
|
+
const variant = useContext(OptionRowContext);
|
|
190
|
+
const T0 = ListBoxSection$1;
|
|
191
|
+
const t1 = mergeStyles(props(collectionStyles.section), props$2);
|
|
193
192
|
let t2;
|
|
194
|
-
if ($[0] !==
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
header = t4;
|
|
198
|
-
T0 = ListBoxSection$1;
|
|
199
|
-
t1 = props$2;
|
|
200
|
-
t2 = mergeStyles(props(collectionStyles.section), props$2);
|
|
201
|
-
$[0] = t0;
|
|
202
|
-
$[1] = T0;
|
|
203
|
-
$[2] = children;
|
|
204
|
-
$[3] = header;
|
|
205
|
-
$[4] = t1;
|
|
206
|
-
$[5] = t2;
|
|
207
|
-
} else {
|
|
208
|
-
T0 = $[1];
|
|
209
|
-
children = $[2];
|
|
210
|
-
header = $[3];
|
|
211
|
-
t1 = $[4];
|
|
212
|
-
t2 = $[5];
|
|
213
|
-
}
|
|
214
|
-
let t3;
|
|
215
|
-
if ($[6] !== header) {
|
|
216
|
-
t3 = header === void 0 ? null : /* @__PURE__ */ jsx(Header, {
|
|
217
|
-
...props(collectionStyles.header),
|
|
193
|
+
if ($[0] !== header || $[1] !== variant) {
|
|
194
|
+
t2 = header === void 0 ? null : /* @__PURE__ */ jsx(Header, {
|
|
195
|
+
...props(collectionStyles.header, variant === "menu" && collectionStyles.headerMenu),
|
|
218
196
|
children: header
|
|
219
197
|
});
|
|
220
|
-
$[
|
|
221
|
-
$[
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
198
|
+
$[0] = header;
|
|
199
|
+
$[1] = variant;
|
|
200
|
+
$[2] = t2;
|
|
201
|
+
} else t2 = $[2];
|
|
202
|
+
let t3;
|
|
203
|
+
if ($[3] !== T0 || $[4] !== children || $[5] !== props$2 || $[6] !== t1 || $[7] !== t2) {
|
|
204
|
+
t3 = /* @__PURE__ */ jsxs(T0, {
|
|
205
|
+
...props$2,
|
|
226
206
|
...t1,
|
|
227
|
-
|
|
228
|
-
children: [t3, children]
|
|
207
|
+
children: [t2, children]
|
|
229
208
|
});
|
|
230
|
-
$[
|
|
231
|
-
$[
|
|
232
|
-
$[
|
|
233
|
-
$[
|
|
234
|
-
$[
|
|
235
|
-
$[
|
|
236
|
-
} else
|
|
237
|
-
return
|
|
209
|
+
$[3] = T0;
|
|
210
|
+
$[4] = children;
|
|
211
|
+
$[5] = props$2;
|
|
212
|
+
$[6] = t1;
|
|
213
|
+
$[7] = t2;
|
|
214
|
+
$[8] = t3;
|
|
215
|
+
} else t3 = $[8];
|
|
216
|
+
return t3;
|
|
238
217
|
}
|
|
239
218
|
ListBox.Item = ListBoxItem;
|
|
240
219
|
ListBox.LoadMore = ListBoxLoadMore;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_c","stylex","ListBox","ListBoxItem","RACListBoxItem","RACListBoxLoadMoreItem","ListBoxSection","RACListBoxSection","collectionStyles","containerClasses","rowItemStyles","textOf","useRipple","mergeStatefulStyles","mergeStyles","children","leading","overline","supporting","trailing","label","header","emptyState","itemContent","ripple","state","isDisabled","isSelected","props","$","t0","t1","onContextMenu","onPointerCancel","onPointerDown","onPointerLeave","onPointerUp","textValue","T0","t2","t3","handlers","t4","t5","surface","t6","ListBoxLoadMore","loading","section","undefined","Item","LoadMore","Section","RACListBox"],"sources":["../../../src/components/list-box/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { ListBoxItemRenderProps, ListBoxItemProps as RACListBoxItemProps, ListBoxLoadMoreItemProps as RACListBoxLoadMoreItemProps, ListBoxProps as RACListBoxProps, ListBoxSectionProps as RACListBoxSectionProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { Header, ListBox as RACListBox, ListBoxItem as RACListBoxItem, ListBoxLoadMoreItem as RACListBoxLoadMoreItem, ListBoxSection as RACListBoxSection } from 'react-aria-components';\nimport { CollectionEmpty, CollectionLoadMore } from '../../collection';\nimport { collectionStyles, containerClasses, rowItemStyles } from '../../collection/styles';\nimport { textOf } from '../../collection/text';\nimport { useRipple } from '../../hooks/useRipple';\nimport { RowContent } from '../../row';\nimport { mergeStatefulStyles, mergeStyles } from '../../styles/merge';\n\n// The lists page's selectable list. Each option is the row every list here\n// draws — `src/row`, shared with ListItem and with every collection the\n// coverage plan adds after this one — so the 56dp floor, the body-large\n// headline, the body-medium supporting line, the state layers and the\n// disabled treatment are all that module's and none of them is written\n// again. What is here is the container around those rows, the section and\n// its header, and the row the list shows while it is fetching more.\n//\n// The container takes the page's 8dp above and below its rows and no\n// background of its own, which is what lets the same list sit on the page\n// and inside a popover without knowing which it is in. Select, ComboBox and\n// Autocomplete are each a field plus one of these in an overlay, so that is\n// not a detail — it is the reason the container is transparent.\n//\n// A selected option takes primary container and on primary container, the\n// page's selected state, through the row module's `list` variant. The page\n// also draws a checkbox in the trailing slot on a list that selects more\n// than one; that is left to the call site rather than added by the option,\n// since which of the two affordances a list wants is the list's decision and\n// the slot is already there for it.\n//\n// Three things are worth knowing about how this maps onto React Aria.\n//\n// **The option's styles are a function of its render state.** StyleX cannot\n// target `[data-selected]` on the element it is styling, so selection,\n// disabled and the rest are read from the state React Aria hands the\n// `className` function — the same mechanism Tabs and Chip use, wrapped in\n// `mergeStatefulStyles` so a call site's own `className` survives.\n//\n// **A section's heading is React Aria's `Header`**, which is what points the\n// section's `aria-labelledby` at it. The lists page names no subhead in its\n// anatomy, so the type is title-small in on surface variant at the row's own\n// 16dp inline padding, which is what the page's own guidance draws.\n//\n// **The load-more row is a sentinel, not a button.** React Aria's\n// `ListBoxLoadMoreItem` calls `onLoadMore` when it comes into view and\n// renders whatever it is given while `isLoading`; ours renders the ring, so\n// a list that fetches as it scrolls says so with the same indicator every\n// other pending state in the library uses.\n\ntype ListBoxItemProps<T extends object = object> = {\n /** The option's headline — the one thing it is mostly about. */\n children?: ReactNode;\n /** A function may compute the class from the option's render state. */\n className?: RACListBoxItemProps<T>['className'];\n /** Content before the headline: an avatar, an icon, a checkbox. */\n leading?: ReactNode;\n /**\n * A line above the headline, in the page's label-small and the same muted\n * role the supporting line takes — a category, a date, a status. Given\n * alongside `supporting` it makes the row the page's three-line item.\n */\n overline?: ReactNode;\n /** A function may compute the style from the option's render state. */\n style?: RACListBoxItemProps<T>['style'];\n /** A second line under the headline, in the muted role. */\n supporting?: ReactNode;\n /** Content after the headline, such as an amount or a control. */\n trailing?: ReactNode;\n} & Omit<RACListBoxItemProps<T>, 'children' | 'className' | 'style'>;\ntype ListBoxLoadMoreProps = Omit<RACListBoxLoadMoreItemProps, 'children'> & {\n /**\n * What the row says while it is loading. Read by a screen reader; the ring\n * itself carries no text.\n * Left out, it is the word for it in the I18nProvider's locale — \"Loading\n * more\" in English.\n */\n label?: string;\n};\ntype ListBoxProps<T extends object = object> = {\n /** A function may compute the class from the list's render state. */\n className?: RACListBoxProps<T>['className'];\n /**\n * What the list shows when nothing is in it — after a search that matched\n * nothing, usually. Left out, it is a muted row saying \"No results\" in the\n * I18nProvider's locale, which an `Autocomplete` around the list also\n * announces. One of the call site's own replaces the announcement as well\n * as the row, so what it says to a screen reader is the call site's too.\n */\n renderEmptyState?: RACListBoxProps<T>['renderEmptyState'];\n /** A function may compute the style from the list's render state. */\n style?: RACListBoxProps<T>['style'];\n} & Omit<RACListBoxProps<T>, 'className' | 'renderEmptyState' | 'style'>;\ntype ListBoxSectionProps<T extends object = object> = Omit<RACListBoxSectionProps<T>, 'children'> & {\n /**\n * The options in the section. A section built from data puts React Aria's\n * `Collection` in here rather than a render function, since the header is\n * an element beside them.\n */\n children?: ReactNode;\n /**\n * The section's heading, rendered through React Aria's header so the\n * section is named by it. A section without one is a group with no name.\n */\n header?: ReactNode;\n};\n\n// The default empty state, at module scope so every list hands React Aria\n// the same function.\nfunction emptyState() {\n return <CollectionEmpty variant=\"list\" />;\n}\n\n// What the option draws, from React Aria's render state. Built by a call\n// rather than written inline at the prop, which is what react-perf's\n// no-new-function-as-prop is after; the React Compiler memoises the result\n// on its inputs.\n//\n// It reads the render state for one thing: which colour the supporting line\n// takes. The muted role the page gives it holds only on the surface — over a\n// selected row's container it is a second colour family, and on a disabled\n// row it stays at full strength while the headline above it fades. The row\n// module decides; this hands it the two flags.\nfunction itemContent(children: ReactNode, leading: ReactNode, overline: ReactNode, supporting: ReactNode, trailing: ReactNode, ripple: ReactNode) {\n return (state: ListBoxItemRenderProps) => <>\n <RowContent isDisabled={state.isDisabled} isSelected={state.isSelected} leading={leading} overline={overline} supporting={supporting} trailing={trailing}>\n {children}\n </RowContent>\n {state.isDisabled ? null : ripple}\n </>;\n}\n\n// StyleX cannot target `[data-selected]` on the element it is styling, so an\n// option's state comes from the render state React Aria hands its className.\n// The order matters: `disabled` is applied last so its ground and colour\n// win over the selected container's. The state layers come from the render\n// state as well — see `focusVisible` in src/row/styles.ts — and React Aria\n// reports none of them on a disabled option, so nothing has to outrank them.\n//\n// A supporting line moves the option from the page's one-line container\n// height to its two-line one, which is a floor rather than something the\n// row's own box arrives at — see `twoLine` in `src/row/styles.ts`. Taken as\n// an argument rather than read from the render state, since React Aria\n// reports what an option is doing and not what it holds; the row is built by\n// a call for the same reason `itemContent` is.\n/**\n * A list of options one or more of which can be selected. Selection is React\n * Aria's: set `selectionMode` to `single` or `multiple`, and pass\n * `selectedKeys` with `onSelectionChange` to control it or\n * `defaultSelectedKeys` to let it keep its own. A list that only responds to\n * a press takes `onAction` on the option instead.\n *\n * Composed from parts, since an option's slots take arbitrary content:\n * `ListBox.Item`, `ListBox.Section` and `ListBox.LoadMore`. Name the list\n * with `aria-label` or `aria-labelledby` — nothing here labels it for you.\n *\n * The call site's `className` and `style` land on the container, which is\n * the element a layout positions.\n *\n * A list with nothing in it shows a muted \"No results\" row in place of its\n * options, which is what a search that matches nothing leaves; pass\n * `renderEmptyState` to draw something else.\n */\nfunction ListBox<T extends object>(props: ListBoxProps<T> & RefAttributes<HTMLDivElement>) {\n return <RACListBox renderEmptyState={emptyState} {...props} {...mergeStatefulStyles(containerClasses, props)} />;\n}\n\n/**\n * One option. Its slots are the row's: `leading`, the headline as children,\n * `supporting` under it, and `trailing`. Give every option an `id` — that is\n * the key selection is reported by.\n */\nfunction ListBoxItem<T extends object = object>({\n children,\n leading,\n onContextMenu,\n onPointerCancel,\n onPointerDown,\n onPointerLeave,\n onPointerUp,\n overline,\n supporting,\n textValue,\n trailing,\n ...props\n}: ListBoxItemProps<T> & RefAttributes<HTMLDivElement>) {\n // The press ripple List's rows draw — see ListItem there.\n const ripple = useRipple<HTMLDivElement>(true, {\n onContextMenu,\n onPointerCancel,\n onPointerDown,\n onPointerLeave,\n onPointerUp\n }, true);\n return <RACListBoxItem textValue={textValue ?? textOf(children)} {...ripple.handlers} {...props} {...mergeStatefulStyles(rowItemStyles(supporting, overline), props)}>\n {itemContent(children, leading, overline, supporting, trailing, ripple.surface)}\n </RACListBoxItem>;\n}\n\n/**\n * The row the list shows while it is fetching more. React Aria calls\n * `onLoadMore` when this comes into view, and draws it only while\n * `isLoading` — so a list that pages as it scrolls needs nothing else.\n */\nfunction ListBoxLoadMore({\n label,\n ...props\n}: ListBoxLoadMoreProps & RefAttributes<HTMLDivElement>) {\n return <RACListBoxLoadMoreItem {...props} {...mergeStyles(stylex.props(collectionStyles.loading), props)}>\n <CollectionLoadMore diameter=\"24px\" label={label} />\n </RACListBoxLoadMoreItem>;\n}\n\n/**\n * A named group of options. `header` names it, and is what a screen reader\n * reads before the options inside.\n */\nfunction ListBoxSection<T extends object = object>({\n children,\n header,\n ...props\n}: ListBoxSectionProps<T> & RefAttributes<HTMLElement>) {\n return <RACListBoxSection {...props} {...mergeStyles(stylex.props(collectionStyles.section), props)}>\n {header === undefined ? null : <Header {...stylex.props(collectionStyles.header)}>{header}</Header>}\n {children}\n </RACListBoxSection>;\n}\nListBox.Item = ListBoxItem;\nListBox.LoadMore = ListBoxLoadMore;\nListBox.Section = ListBoxSection;\nexport type { ListBoxItemProps, ListBoxLoadMoreProps, ListBoxProps, ListBoxSectionProps };\nexport { ListBoxItem, ListBoxLoadMore, ListBoxSection };\nexport default ListBox;"],"mappings":";;;;;;;;;;;;AAgHA,SAASsB,aAAa;CACpB,OAAO,oBAAC,iBAAD,EAAiB,SAAQ,OAAM,CAAA;AACxC;AAYA,SAASC,YAAYR,UAAqBC,SAAoBC,UAAqBC,YAAuBC,UAAqBK,QAAmB;CAChJ,QAAQC,UAAkC,qBAAA,UAAA,EAAA,UAAA,CACtC,oBAAC,YAAD;EAAY,YAAYA,MAAMC;EAAY,YAAYD,MAAME;EAAqBX;EAAmBC;EAAsBC;EAAsBC;EAC7IJ;CACS,CAAA,GACXU,MAAMC,aAAa,OAAOF,MAC7B,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AACC,EAAA,KAAAC;EAAAD,EAAA,KAAAS;EAAAT,EAAA,KAAAd;EAAAc,EAAA,KAAAR;EAAAQ,EAAA,KAAAE;EAAAF,EAAA,KAAAU;CAAA,OAAA;EAAAD,KAAAT,EAAA;EAAAd,WAAAc,EAAA;EAAAR,SAAAQ,EAAA;EAAAE,KAAAF,EAAA;EAAAU,KAAAV,EAAA;CAAA;CAAA,IAAAW;CAAA,IAAAX,EAAA,OAAAR,QAAA;EAC9FmB,KAAAnB,WAAW4B,KAAAA,IAAX,OAA8B,oBAAC,QAAD;GAAO,GAAKhD,MAAaO,iBAAgBa,MAAO;GAAIA,UAAAA;EAA7C,CAAA;EAA6DQ,EAAA,KAAAR;EAAAQ,EAAA,KAAAW;CAAA,OAAAA,KAAAX,EAAA;CAAA,IAAAa;CAAA,IAAAb,EAAA,OAAAS,MAAAT,EAAA,OAAAd,YAAAc,EAAA,QAAAE,MAAAF,EAAA,QAAAU,MAAAV,EAAA,QAAAW,IAAA;EADhGE,KAAA,qBAAC,IAAD;GAAkB,GAAKd;GAAK,GAAMW;GAAlC,UAAA,CACFC,IACAzB,QAFoB;;EAGHc,EAAA,KAAAS;EAAAT,EAAA,KAAAd;EAAAc,EAAA,MAAAE;EAAAF,EAAA,MAAAU;EAAAV,EAAA,MAAAW;EAAAX,EAAA,MAAAa;CAAA,OAAAA,KAAAb,EAAA;CAAA,OAHfa;AAGe;AAExBxC,QAAQgD,OAAO/C;AACfD,QAAQiD,WAAWL;AACnB5C,QAAQkD,UAAU9C"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["_c","stylex","useContext","ListBox","ListBoxItem","RACListBoxItem","RACListBoxLoadMoreItem","ListBoxSection","RACListBoxSection","OptionRowContext","collectionStyles","containerClasses","rowItemStyles","textOf","useRipple","mergeStatefulStyles","mergeStyles","children","leading","overline","supporting","trailing","label","header","EmptyRow","$","t0","t1","emptyState","itemContent","ripple","variant","state","isDisabled","isSelected","props","onContextMenu","onPointerCancel","onPointerDown","onPointerLeave","onPointerUp","textValue","T0","t2","t3","handlers","t4","undefined","t5","surface","t6","ListBoxLoadMore","loading","loadingMenu","section","headerMenu","Item","LoadMore","Section","RACListBox"],"sources":["../../../src/components/list-box/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { ListBoxItemRenderProps, ListBoxItemProps as RACListBoxItemProps, ListBoxLoadMoreItemProps as RACListBoxLoadMoreItemProps, ListBoxProps as RACListBoxProps, ListBoxSectionProps as RACListBoxSectionProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { useContext } from 'react';\nimport { Header, ListBox as RACListBox, ListBoxItem as RACListBoxItem, ListBoxLoadMoreItem as RACListBoxLoadMoreItem, ListBoxSection as RACListBoxSection } from 'react-aria-components';\nimport { CollectionEmpty, CollectionLoadMore } from '../../collection';\nimport { OptionRowContext } from '../../collection/context';\nimport { collectionStyles, containerClasses, rowItemStyles } from '../../collection/styles';\nimport { textOf } from '../../collection/text';\nimport { useRipple } from '../../hooks/useRipple';\nimport { RowContent } from '../../row';\nimport { mergeStatefulStyles, mergeStyles } from '../../styles/merge';\n\n// The lists page's selectable list. Each option is the row every list here\n// draws — `src/row`, shared with ListItem and with every collection the\n// coverage plan adds after this one — so the 56dp floor, the body-large\n// headline, the body-medium supporting line, the state layers and the\n// disabled treatment are all that module's and none of them is written\n// again. What is here is the container around those rows, the section and\n// its header, and the row the list shows while it is fetching more.\n//\n// The container takes the page's 8dp above and below its rows and no\n// background of its own, which is what lets the same list sit on the page\n// and inside a popover without knowing which it is in. Select, ComboBox and\n// Autocomplete are each a field plus one of these in an overlay, so that is\n// not a detail — it is the reason the container is transparent.\n//\n// A selected option takes primary container and on primary container, the\n// page's selected state, through the row module's `list` variant. The page\n// also draws a checkbox in the trailing slot on a list that selects more\n// than one; that is left to the call site rather than added by the option,\n// since which of the two affordances a list wants is the list's decision and\n// the slot is already there for it.\n//\n// **Inside a Select's or a ComboBox's popup the options are menu rows.**\n// Material Design draws an exposed dropdown menu, which is what those two\n// are, as a menu: 48dp rows at the menu's 12dp inset and icon gap, a\n// label-large label, and the menu's selected container. Each provides\n// `OptionRowContext` around its list, and the option, the section's header,\n// the empty row and the load-more row read it. A ListBox anywhere else keeps\n// the lists page's row.\n//\n// Three things are worth knowing about how this maps onto React Aria.\n//\n// **The option's styles are a function of its render state.** StyleX cannot\n// target `[data-selected]` on the element it is styling, so selection,\n// disabled and the rest are read from the state React Aria hands the\n// `className` function — the same mechanism Tabs and Chip use, wrapped in\n// `mergeStatefulStyles` so a call site's own `className` survives.\n//\n// **A section's heading is React Aria's `Header`**, which is what points the\n// section's `aria-labelledby` at it. The lists page names no subhead in its\n// anatomy, so the type is title-small in on surface variant at the row's own\n// 16dp inline padding, which is what the page's own guidance draws. Drawn as\n// a menu, it takes the menu's 12dp instead, so it lines up with the options\n// under it, as Menu's own section heading does.\n//\n// **The load-more row is a sentinel, not a button.** React Aria's\n// `ListBoxLoadMoreItem` calls `onLoadMore` when it comes into view and\n// renders whatever it is given while `isLoading`; ours renders the ring, so\n// a list that fetches as it scrolls says so with the same indicator every\n// other pending state in the library uses.\n\ntype ListBoxItemProps<T extends object = object> = {\n /** The option's headline — the one thing it is mostly about. */\n children?: ReactNode;\n /** A function may compute the class from the option's render state. */\n className?: RACListBoxItemProps<T>['className'];\n /** Content before the headline: an avatar, an icon, a checkbox. */\n leading?: ReactNode;\n /**\n * A line above the headline, in the page's label-small and the same muted\n * role the supporting line takes — a category, a date, a status. Given\n * alongside `supporting` it makes the row the page's three-line item.\n */\n overline?: ReactNode;\n /** A function may compute the style from the option's render state. */\n style?: RACListBoxItemProps<T>['style'];\n /** A second line under the headline, in the muted role. */\n supporting?: ReactNode;\n /** Content after the headline, such as an amount or a control. */\n trailing?: ReactNode;\n} & Omit<RACListBoxItemProps<T>, 'children' | 'className' | 'style'>;\ntype ListBoxLoadMoreProps = Omit<RACListBoxLoadMoreItemProps, 'children'> & {\n /**\n * What the row says while it is loading. Read by a screen reader; the ring\n * itself carries no text.\n * Left out, it is the word for it in the I18nProvider's locale — \"Loading\n * more\" in English.\n */\n label?: string;\n};\ntype ListBoxProps<T extends object = object> = {\n /** A function may compute the class from the list's render state. */\n className?: RACListBoxProps<T>['className'];\n /**\n * What the list shows when nothing is in it — after a search that matched\n * nothing, usually. Left out, it is a muted row saying \"No results\" in the\n * I18nProvider's locale, which an `Autocomplete` around the list also\n * announces. One of the call site's own replaces the announcement as well\n * as the row, so what it says to a screen reader is the call site's too.\n */\n renderEmptyState?: RACListBoxProps<T>['renderEmptyState'];\n /** A function may compute the style from the list's render state. */\n style?: RACListBoxProps<T>['style'];\n} & Omit<RACListBoxProps<T>, 'className' | 'renderEmptyState' | 'style'>;\ntype ListBoxSectionProps<T extends object = object> = Omit<RACListBoxSectionProps<T>, 'children'> & {\n /**\n * The options in the section. A section built from data puts React Aria's\n * `Collection` in here rather than a render function, since the header is\n * an element beside them.\n */\n children?: ReactNode;\n /**\n * The section's heading, rendered through React Aria's header so the\n * section is named by it. A section without one is a group with no name.\n */\n header?: ReactNode;\n};\nfunction EmptyRow() {\n return <CollectionEmpty variant={useContext(OptionRowContext)} />;\n}\n\n// The default empty state, at module scope so every list hands React Aria\n// the same function. A component rather than the element itself, so it reads\n// which row the list draws — a menu row inside a Select's or a ComboBox's\n// popup.\nfunction emptyState() {\n return <EmptyRow />;\n}\n\n// What the option draws, from React Aria's render state. Built by a call\n// rather than written inline at the prop, which is what react-perf's\n// no-new-function-as-prop is after; the React Compiler memoises the result\n// on its inputs.\n//\n// It reads the render state for one thing: which colour the supporting line\n// takes. The muted role the page gives it holds only on the surface — over a\n// selected row's container it is a second colour family, and on a disabled\n// row it stays at full strength while the headline above it fades. The row\n// module decides; this hands it the two flags.\nfunction itemContent(children: ReactNode, leading: ReactNode, overline: ReactNode, supporting: ReactNode, trailing: ReactNode, ripple: ReactNode, variant: 'list' | 'menu') {\n return (state: ListBoxItemRenderProps) => <>\n <RowContent isDisabled={state.isDisabled} isSelected={state.isSelected} leading={leading} overline={overline} supporting={supporting} trailing={trailing} variant={variant}>\n {children}\n </RowContent>\n {state.isDisabled ? null : ripple}\n </>;\n}\n\n// StyleX cannot target `[data-selected]` on the element it is styling, so an\n// option's state comes from the render state React Aria hands its className.\n// The order matters: `disabled` is applied last so its ground and colour\n// win over the selected container's. The state layers come from the render\n// state as well — see `focusVisible` in src/row/styles.ts — and React Aria\n// reports none of them on a disabled option, so nothing has to outrank them.\n//\n// A supporting line moves the option from the page's one-line container\n// height to its two-line one, which is a floor rather than something the\n// row's own box arrives at — see `twoLine` in `src/row/styles.ts`. Taken as\n// an argument rather than read from the render state, since React Aria\n// reports what an option is doing and not what it holds; the row is built by\n// a call for the same reason `itemContent` is.\n/**\n * A list of options one or more of which can be selected. Selection is React\n * Aria's: set `selectionMode` to `single` or `multiple`, and pass\n * `selectedKeys` with `onSelectionChange` to control it or\n * `defaultSelectedKeys` to let it keep its own. A list that only responds to\n * a press takes `onAction` on the option instead.\n *\n * Composed from parts, since an option's slots take arbitrary content:\n * `ListBox.Item`, `ListBox.Section` and `ListBox.LoadMore`. Name the list\n * with `aria-label` or `aria-labelledby` — nothing here labels it for you.\n *\n * The call site's `className` and `style` land on the container, which is\n * the element a layout positions.\n *\n * A list with nothing in it shows a muted \"No results\" row in place of its\n * options, which is what a search that matches nothing leaves; pass\n * `renderEmptyState` to draw something else.\n */\nfunction ListBox<T extends object>(props: ListBoxProps<T> & RefAttributes<HTMLDivElement>) {\n return <RACListBox renderEmptyState={emptyState} {...props} {...mergeStatefulStyles(containerClasses, props)} />;\n}\n\n/**\n * One option. Its slots are the row's: `leading`, the headline as children,\n * `supporting` under it, and `trailing`. Give every option an `id` — that is\n * the key selection is reported by.\n */\nfunction ListBoxItem<T extends object = object>({\n children,\n leading,\n onContextMenu,\n onPointerCancel,\n onPointerDown,\n onPointerLeave,\n onPointerUp,\n overline,\n supporting,\n textValue,\n trailing,\n ...props\n}: ListBoxItemProps<T> & RefAttributes<HTMLDivElement>) {\n const variant = useContext(OptionRowContext);\n // The press ripple List's rows draw — see ListItem there.\n const ripple = useRipple<HTMLDivElement>(true, {\n onContextMenu,\n onPointerCancel,\n onPointerDown,\n onPointerLeave,\n onPointerUp\n }, true);\n return <RACListBoxItem textValue={textValue ?? textOf(children)} {...ripple.handlers} {...props} {...mergeStatefulStyles(rowItemStyles(supporting, overline, undefined, variant), props)}>\n {itemContent(children, leading, overline, supporting, trailing, ripple.surface, variant)}\n </RACListBoxItem>;\n}\n\n/**\n * The row the list shows while it is fetching more. React Aria calls\n * `onLoadMore` when this comes into view, and draws it only while\n * `isLoading` — so a list that pages as it scrolls needs nothing else.\n */\nfunction ListBoxLoadMore({\n label,\n ...props\n}: ListBoxLoadMoreProps & RefAttributes<HTMLDivElement>) {\n const variant = useContext(OptionRowContext);\n return <RACListBoxLoadMoreItem {...props} {...mergeStyles(stylex.props(collectionStyles.loading, variant === 'menu' && collectionStyles.loadingMenu), props)}>\n <CollectionLoadMore diameter=\"24px\" label={label} />\n </RACListBoxLoadMoreItem>;\n}\n\n/**\n * A named group of options. `header` names it, and is what a screen reader\n * reads before the options inside.\n */\nfunction ListBoxSection<T extends object = object>({\n children,\n header,\n ...props\n}: ListBoxSectionProps<T> & RefAttributes<HTMLElement>) {\n const variant = useContext(OptionRowContext);\n return <RACListBoxSection {...props} {...mergeStyles(stylex.props(collectionStyles.section), props)}>\n {header === undefined ? null : <Header {...stylex.props(collectionStyles.header, variant === 'menu' && collectionStyles.headerMenu)}>\n {header}\n </Header>}\n {children}\n </RACListBoxSection>;\n}\nListBox.Item = ListBoxItem;\nListBox.LoadMore = ListBoxLoadMore;\nListBox.Section = ListBoxSection;\nexport type { ListBoxItemProps, ListBoxLoadMoreProps, ListBoxProps, ListBoxSectionProps };\nexport { ListBoxItem, ListBoxLoadMore, ListBoxSection };\nexport default ListBox;"],"mappings":";;;;;;;;;;;;;;AAyHA,SAAAwB,WAAA;CAAA,MAAAC,IAAAzB,EAAA,CAAA;CACmC,M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{ ReactNode } from "react";
|
|
2
|
+
import { RenderComponentProps } from "../../render/useRender.js";
|
|
3
3
|
type ListDetailProps = {
|
|
4
4
|
/**
|
|
5
5
|
* The selected item's content. Stands on its own, and takes the flexible
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
2
3
|
import { useRender } from "../../render/useRender.js";
|
|
3
4
|
import { mergeStyles } from "../../styles/merge.js";
|
|
4
|
-
import { c } from "react/compiler-runtime";
|
|
5
5
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
// src/components/list-detail/index.tsx
|
|
7
7
|
/**
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
2
3
|
import { props } from "../../node_modules/@stylexjs/stylex/lib/es/stylex.js";
|
|
3
4
|
import { useRipple } from "../../hooks/useRipple.js";
|
|
4
5
|
import { hasContent } from "../../render/content.js";
|
|
@@ -6,7 +7,6 @@ import { refCallback } from "../../render/ref.js";
|
|
|
6
7
|
import { RowContent } from "../../row/index.js";
|
|
7
8
|
import { rowStyles } from "../../row/styles.js";
|
|
8
9
|
import { mergeStyles } from "../../styles/merge.js";
|
|
9
|
-
import { c } from "react/compiler-runtime";
|
|
10
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
11
|
// src/components/list-item/index.tsx
|
|
12
12
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { mergeStatefulStyles } from "../../styles/merge.js";
|
|
3
2
|
import { c } from "react/compiler-runtime";
|
|
4
|
-
import { jsx } from "react/jsx-runtime";
|
|
5
3
|
import { ProgressBar } from "react-aria-components";
|
|
4
|
+
import { mergeStatefulStyles } from "../../styles/merge.js";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
// src/components/loading-indicator/index.tsx
|
|
7
7
|
/**
|
|
8
8
|
* A shape morphing as it turns, for a wait of a few seconds whose length is
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { OverlayAlign, OverlaySide } from "../../styles/overlay.js";
|
|
2
|
-
import Separator$1 from "../separator/index.js";
|
|
3
1
|
import { ComponentProps, ReactElement, ReactNode, RefAttributes } from "react";
|
|
4
2
|
import { ClassNameOrFunction, MenuItemProps as MenuItemProps$1, MenuLoadMoreItemProps, MenuProps as MenuProps$1, MenuSectionProps as MenuSectionProps$1, MenuTriggerProps, PopoverRenderProps, StyleOrFunction } from "react-aria-components";
|
|
3
|
+
import { OverlayAlign, OverlaySide } from "../../styles/overlay.js";
|
|
4
|
+
import Separator$1 from "../separator/index.js";
|
|
5
5
|
type MenuAlign = OverlayAlign;
|
|
6
6
|
type MenuContentProps<T extends object = object> = {
|
|
7
7
|
/**
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
2
3
|
import { props } from "../../node_modules/@stylexjs/stylex/lib/es/stylex.js";
|
|
4
|
+
import { useContext, useEffect, useRef } from "react";
|
|
5
|
+
import { AutocompleteStateContext, Header, Keyboard, Menu as Menu$1, MenuItem as MenuItem$1, MenuLoadMoreItem, MenuSection as MenuSection$1, MenuTrigger, Popover, SubmenuTrigger, Text } from "react-aria-components";
|
|
3
6
|
import { CollectionEmpty, CollectionLoadMore, CollectionStatus } from "../../collection/index.js";
|
|
4
7
|
import { textOf } from "../../collection/text.js";
|
|
5
8
|
import { CheckGlyph, ChevronEndGlyph } from "../../glyphs/index.js";
|
|
@@ -10,10 +13,7 @@ import { rowStyles, supportingTone } from "../../row/styles.js";
|
|
|
10
13
|
import { mergeStatefulStyles, mergeStyles } from "../../styles/merge.js";
|
|
11
14
|
import { overlay, placementOf, popupOrigin } from "../../styles/overlay.js";
|
|
12
15
|
import Separator$1 from "../separator/index.js";
|
|
13
|
-
import { c } from "react/compiler-runtime";
|
|
14
|
-
import { useContext, useEffect, useRef } from "react";
|
|
15
16
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
16
|
-
import { AutocompleteStateContext, Header, Keyboard, Menu as Menu$1, MenuItem as MenuItem$1, MenuLoadMoreItem, MenuSection as MenuSection$1, MenuTrigger, Popover, SubmenuTrigger, Text } from "react-aria-components";
|
|
17
17
|
// src/components/menu/index.tsx
|
|
18
18
|
const styles = {
|
|
19
19
|
content: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { IndicatorTone } from "../../indicator/styles.js";
|
|
2
1
|
import { ReactNode, RefAttributes } from "react";
|
|
3
2
|
import { MeterProps as MeterProps$1 } from "react-aria-components";
|
|
3
|
+
import { IndicatorTone } from "../../indicator/styles.js";
|
|
4
4
|
type MeterProps = Omit<MeterProps$1, 'children' | 'className' | 'style'> & {
|
|
5
5
|
/** A function may compute the class from the meter's render state. */
|
|
6
6
|
className?: MeterProps$1['className'];
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
2
3
|
import { props } from "../../node_modules/@stylexjs/stylex/lib/es/stylex.js";
|
|
4
|
+
import { Meter as Meter$1 } from "react-aria-components";
|
|
3
5
|
import { CheckCircleGlyph, ErrorGlyph } from "../../glyphs/index.js";
|
|
4
6
|
import { IndicatorLabels, IndicatorLine } from "../../indicator/index.js";
|
|
5
7
|
import { indicatorStyles } from "../../indicator/styles.js";
|
|
6
8
|
import { mergeStatefulStyles } from "../../styles/merge.js";
|
|
7
|
-
import { c } from "react/compiler-runtime";
|
|
8
9
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
-
import { Meter as Meter$1 } from "react-aria-components";
|
|
10
10
|
// src/components/meter/index.tsx
|
|
11
11
|
/**
|
|
12
12
|
* How full something is, on a scale it names: disk used, storage left,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { RefAttributes } from "react";
|
|
1
2
|
import { NavigationItemProps } from "../../navigation/index.js";
|
|
2
3
|
import { RenderComponentProps } from "../../render/useRender.js";
|
|
3
|
-
import { RefAttributes } from "react";
|
|
4
4
|
type NavigationBarProps = RenderComponentProps<'nav'> & {
|
|
5
5
|
/**
|
|
6
6
|
* The route of the current destination, matched exactly against each
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
3
|
+
import { useLayoutEffect, useState } from "react";
|
|
2
4
|
import { NavigationItem, NavigationList } from "../../navigation/index.js";
|
|
3
5
|
import { NavigationContext } from "../../navigation/context.js";
|
|
4
6
|
import { mergeRefs } from "../../render/ref.js";
|
|
5
7
|
import { useRender } from "../../render/useRender.js";
|
|
6
8
|
import { mergeStyles } from "../../styles/merge.js";
|
|
7
|
-
import { c } from "react/compiler-runtime";
|
|
8
|
-
import { useLayoutEffect, useState } from "react";
|
|
9
9
|
import { jsx } from "react/jsx-runtime";
|
|
10
10
|
// src/components/navigation-bar/index.tsx
|
|
11
11
|
const styles = { destinations: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { ReactNode, RefAttributes } from "react";
|
|
1
2
|
import { NavigationItemProps } from "../../navigation/index.js";
|
|
2
3
|
import { RenderComponentProps } from "../../render/useRender.js";
|
|
3
|
-
import { ReactNode, RefAttributes } from "react";
|
|
4
4
|
type NavigationRailProps = RenderComponentProps<'nav'> & {
|
|
5
5
|
/**
|
|
6
6
|
* What the rail draws above its destinations: a menu button that expands
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
3
|
+
import "react";
|
|
2
4
|
import { NavigationItem, NavigationList } from "../../navigation/index.js";
|
|
3
5
|
import { NavigationContext } from "../../navigation/context.js";
|
|
4
6
|
import { useRender } from "../../render/useRender.js";
|
|
5
7
|
import { mergeStyles } from "../../styles/merge.js";
|
|
6
|
-
import { c } from "react/compiler-runtime";
|
|
7
|
-
import "react";
|
|
8
8
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
9
9
|
// src/components/navigation-rail/index.tsx
|
|
10
10
|
const styles = { destinations: {
|
|
@@ -16,12 +16,12 @@ const styles = { destinations: {
|
|
|
16
16
|
kXwgrk: "xdt5ytf",
|
|
17
17
|
kzQI83: "x1iyjqo2",
|
|
18
18
|
kmuXW: "xs83m0k",
|
|
19
|
-
kqGvvJ: "
|
|
20
|
-
kUOVxO: "
|
|
19
|
+
kqGvvJ: "x15zwqr x196bl58",
|
|
20
|
+
kUOVxO: "x13jr4wj x1knonev",
|
|
21
21
|
kAzted: "x2lwn1j",
|
|
22
22
|
kORKVm: "x1odjw0f",
|
|
23
|
-
k8WAf4: "
|
|
24
|
-
kg3NbH: "
|
|
23
|
+
k8WAf4: "xifx94n x1flqomg",
|
|
24
|
+
kg3NbH: "xm9j1uf x1snzwe2",
|
|
25
25
|
$$css: true
|
|
26
26
|
} };
|
|
27
27
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_c","useRender","mergeStyles","styles","destinations","kGNEyG","kSGwAc","kB7OPa","k1xSpc","kCS8Yb","kXwgrk","kzQI83","kmuXW","kqGvvJ","kUOVxO","kAzted","kORKVm","k8WAf4","kg3NbH","$$css","header","isExpanded","selectedRoute","NavigationRail","t0","$","children","context","render","t1","t2","t3","t4","t5","t6","t7","t8","props","undefined","t9","t10","form","0","className","1","defaultTagName","rail","NavigationRailItem","Item"],"sources":["../../../src/components/navigation-rail/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { useMemo } from 'react';\nimport type { NavigationItemProps } from '../../navigation';\nimport type { RenderComponentProps } from '../../render/useRender';\nimport { NavigationItem, NavigationList } from '../../navigation';\nimport { NavigationContext } from '../../navigation/context';\nimport { useRender } from '../../render/useRender';\nimport { mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, spacing } from '../../tokens/design.tokens.stylex';\n\n// The navigation rail page's rail, in both its forms: collapsed, a 96dp\n// column of vertical destinations down the leading edge of a medium or wider\n// window, and expanded, between 220dp and 360dp with each destination the\n// page's 56dp horizontal pill. The expanded rail is what the page has\n// replace the navigation drawer, so an app's top-level destinations reach\n// every window size between this and NavigationBar. Both forms are on the\n// surface role, with their contents 44dp from the top: the first destination,\n// or a header when the rail has one — a menu button that expands it, say —\n// with the first destination 40dp under it. The destinations are\n// `src/navigation`'s, shared with NavigationBar, which holds their values.\n//\n// A collapsed destination's label stays on one line in the 88dp under its\n// indicator, about thirteen characters of label medium. A longer one is cut\n// short with an ellipsis and shows its full text in the browser's tooltip on\n// hover — see `src/navigation`. Once the reader has enlarged their text, by\n// a text-only zoom or a minimum font size, the label takes further lines\n// instead and its destination grows to hold them, since that text no longer\n// fits the lengths around it — see src/hooks/useEnlargedText.ts. The expanded\n// rail's labels sit beside their icons, with the rest of the rail's 360dp at\n// most.\n//\n// The rail is a `<nav>`, and a page usually has more than one navigation\n// landmark, so name it with `aria-label`.\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.\nconst FORCED_COLORS = '@media (forced-colors: active)';\n\n// How far a destination's focus ring reaches past it: the 2dp offset and\n// the 2dp ring, and 2dp more under forced colours, where the ring is twice\n// as heavy — see `ringWeight` in src/navigation/styles.ts. The destinations\n// scroll, and a scroll container clips what overflows it, so the block they\n// scroll in is padded by this much and pulled back out by as much, which\n// leaves every destination where it was and every ring whole.\nconst RING_REACH = {\n default: '4px',\n [FORCED_COLORS]: '6px'\n};\nconst RING_PULL = {\n default: '-4px',\n [FORCED_COLORS]: '-6px'\n};\nconst styles = {\n destinations: {\n kGNEyG: \"x6s0dn4\",\n kSGwAc: \"xkh2ocl\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"x78zum5\",\n kCS8Yb: \"xdl72j9\",\n kXwgrk: \"xdt5ytf\",\n kzQI83: \"x1iyjqo2\",\n kmuXW: \"xs83m0k\",\n kqGvvJ: \"x1k49i25 x1n2n1b5\",\n kUOVxO: \"xr6ywxm x1g55pzu\",\n kAzted: \"x2lwn1j\",\n kORKVm: \"x1odjw0f\",\n k8WAf4: \"x12ulsxz xf989l1\",\n kg3NbH: \"xfn1xvj x1rsxkid\",\n $$css: true\n }\n};\ntype NavigationRailProps = RenderComponentProps<'nav'> & {\n /**\n * What the rail draws above its destinations: a menu button that expands\n * it, or a floating action button.\n */\n header?: ReactNode;\n /**\n * Whether the rail is in its expanded form, each destination a pill with\n * its label beside the icon, rather than collapsed with the label under it.\n * @default false\n */\n isExpanded?: boolean;\n /**\n * The route of the current destination, matched exactly against each\n * destination's `href`. The match carries `aria-current=\"page\"` and the\n * active indicator. For a route nested under a destination, which no\n * `href` matches whole, mark that destination with its own `isCurrent`.\n */\n selectedRoute?: string;\n};\n\n/**\n * The column of top-level destinations a medium or wider window keeps at its\n * leading edge, collapsed or, with `isExpanded`, expanded. Each destination\n * is a link, so it routes through React Aria's `RouterProvider` when the app\n * has one.\n *\n * ```tsx\n * <NavigationRail aria-label=\"Label\" selectedRoute=\"/first\">\n * <NavigationRail.Item href=\"/first\" icon={<FirstIcon />}>\n * First item\n * </NavigationRail.Item>\n * <NavigationRail.Item href=\"/second\" icon={<SecondIcon />}>\n * Second item\n * </NavigationRail.Item>\n * </NavigationRail>\n * ```\n *\n * The call site's `className` and `style` land on the `<nav>`.\n */\nfunction NavigationRail({\n children,\n header,\n isExpanded = false,\n render,\n selectedRoute,\n ...props\n}: NavigationRailProps) {\n const context = useMemo(() => ({\n form: isExpanded ? 'expanded' as const : 'collapsed' as const,\n selectedRoute\n }), [isExpanded, selectedRoute]);\n const rail = useRender({\n defaultTagName: 'nav',\n props: {\n ...props,\n ...mergeStyles({\n 0: {\n className: \"x6s0dn4 x14s9m32 x5yr21d x9f619 x78zum5 xdt5ytf x2lah0s x8i8c5o xlaft8j xzoy561 x13oubkp\"\n },\n 1: {\n className: \"x6s0dn4 x14s9m32 x5yr21d x9f619 x78zum5 xdt5ytf x2lah0s x8i8c5o xlaft8j xeq5yr9 xxc7z9f x12rczxh x17qtykl\"\n }\n }[!!isExpanded << 0], props),\n children: <>\n {header === undefined ? null : <div {...{\n 0: {\n className: \"x6s0dn4 x9f619 x78zum5 xdt5ytf xqa3g7y\"\n },\n 1: {\n className: \"x9f619 x78zum5 xdt5ytf x1cy8zhl xkh2ocl x1mgj515 xdxifnh\"\n }\n }[!!isExpanded << 0]}>\n {header}\n </div>}\n <NavigationList layout={styles.destinations}>\n {children}\n </NavigationList>\n </>\n },\n render\n });\n return <NavigationContext value={context}>{rail}</NavigationContext>;\n}\n\n/**\n * One destination of a navigation rail — an icon, a label and, when it is the\n * current one, the active indicator. See `NavigationRail`.\n *\n * Defined here rather than re-exported from `src/navigation`: a re-export\n * let the build hand the package entry that module directly, past this\n * module's client directive, and a server component importing it got the\n * component itself rather than a reference to a client one.\n */\nfunction NavigationRailItem(props: NavigationItemProps & RefAttributes<HTMLAnchorElement>) {\n return <NavigationItem {...props} />;\n}\nNavigationRail.Item = NavigationRailItem;\nexport type { NavigationItemProps as NavigationRailItemProps, NavigationRailProps };\nexport { NavigationRailItem };\nexport default NavigationRail;"],"mappings":";;;;;;;;;AAwDA,MAAMG,SAAS,EACbC,cAAc;CACZC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,OAAO;CACPC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,OAAO;AACT,EACF;;;;;;;;;;;;;;;;;;;;AAyCA,SAAAI,eAAAC,IAAA;CAAA,MAAAC,IAAAzB,EAAA,EAAA;CAAA,IAAA0B;CAAA,IAAAC;CAAA,IAAAP;CAAA,IAAAC;CAAA,IAAAO;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAP,EAAA,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A;EAAlB,CAAA;EAA2CrB,EAAA,MAAAE;EAAAF,EAAA,MAAAqB;EAAArB,EAAA,MAAAe;CAAA,OAAAA,MAAAf,EAAA;CAAA,OAA7De;AAA6D;;;;;;;;;;AAYtE,SAAAO,mBAAAV,OAAA;CAAA,MAAAZ,IAAAzB,EAAA,CAAA;CAAA,IAAAwB;CAAA,IAAAC,EAAA,OAAAY,OAAA;EACSb,KAAA,oBAAC,gBAAD,EAAe,GAAKa,MAAK,CAAA;EAAIZ,EAAA,KAAAY;EAAAZ,EAAA,KAAAD;CAAA,OAAAA,KAAAC,EAAA;CAAA,OAA7BD;AAA6B;AAEtCD,eAAeyB,OAAOD"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["_c","useRender","mergeStyles","styles","destinations","kGNEyG","kSGwAc","kB7OPa","k1xSpc","kCS8Yb","kXwgrk","kzQI83","kmuXW","kqGvvJ","kUOVxO","kAzted","kORKVm","k8WAf4","kg3NbH","$$css","header","isExpanded","selectedRoute","NavigationRail","t0","$","children","context","render","t1","t2","t3","t4","t5","t6","t7","t8","props","undefined","t9","t10","form","0","className","1","defaultTagName","rail","NavigationRailItem","Item"],"sources":["../../../src/components/navigation-rail/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { useMemo } from 'react';\nimport type { NavigationItemProps } from '../../navigation';\nimport type { RenderComponentProps } from '../../render/useRender';\nimport { NavigationItem, NavigationList } from '../../navigation';\nimport { NavigationContext } from '../../navigation/context';\nimport { useRender } from '../../render/useRender';\nimport { mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, spacing } from '../../tokens/design.tokens.stylex';\n\n// The navigation rail page's rail, in both its forms: collapsed, a 96dp\n// column of vertical destinations down the leading edge of a medium or wider\n// window, and expanded, between 220dp and 360dp with each destination the\n// page's 56dp horizontal pill. The expanded rail is what the page has\n// replace the navigation drawer, so an app's top-level destinations reach\n// every window size between this and NavigationBar. Both forms are on the\n// surface role, with their contents 44dp from the top: the first destination,\n// or a header when the rail has one — a menu button that expands it, say —\n// with the first destination 40dp under it. The destinations are\n// `src/navigation`'s, shared with NavigationBar, which holds their values.\n//\n// A collapsed destination's label stays on one line in the 88dp under its\n// indicator, about thirteen characters of label medium. A longer one is cut\n// short with an ellipsis and shows its full text in the browser's tooltip on\n// hover — see `src/navigation`. Once the reader has enlarged their text, by\n// a text-only zoom or a minimum font size, the label takes further lines\n// instead and its destination grows to hold them, since that text no longer\n// fits the lengths around it — see src/hooks/useEnlargedText.ts. The expanded\n// rail's labels sit beside their icons, with the rest of the rail's 360dp at\n// most.\n//\n// The rail is a `<nav>`, and a page usually has more than one navigation\n// landmark, so name it with `aria-label`.\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.\nconst FORCED_COLORS = '@media (forced-colors: active)';\n\n// How far a destination's focus ring reaches past it: the 2dp offset and\n// the 3dp ring, and 3dp more under forced colours, where the ring is twice\n// as heavy — see `ringWeight` in src/navigation/styles.ts. The destinations\n// scroll, and a scroll container clips what overflows it, so the block they\n// scroll in is padded by this much and pulled back out by as much, which\n// leaves every destination where it was and every ring whole.\nconst RING_REACH = {\n default: '5px',\n [FORCED_COLORS]: '8px'\n};\nconst RING_PULL = {\n default: '-5px',\n [FORCED_COLORS]: '-8px'\n};\nconst styles = {\n destinations: {\n kGNEyG: \"x6s0dn4\",\n kSGwAc: \"xkh2ocl\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"x78zum5\",\n kCS8Yb: \"xdl72j9\",\n kXwgrk: \"xdt5ytf\",\n kzQI83: \"x1iyjqo2\",\n kmuXW: \"xs83m0k\",\n kqGvvJ: \"x15zwqr x196bl58\",\n kUOVxO: \"x13jr4wj x1knonev\",\n kAzted: \"x2lwn1j\",\n kORKVm: \"x1odjw0f\",\n k8WAf4: \"xifx94n x1flqomg\",\n kg3NbH: \"xm9j1uf x1snzwe2\",\n $$css: true\n }\n};\ntype NavigationRailProps = RenderComponentProps<'nav'> & {\n /**\n * What the rail draws above its destinations: a menu button that expands\n * it, or a floating action button.\n */\n header?: ReactNode;\n /**\n * Whether the rail is in its expanded form, each destination a pill with\n * its label beside the icon, rather than collapsed with the label under it.\n * @default false\n */\n isExpanded?: boolean;\n /**\n * The route of the current destination, matched exactly against each\n * destination's `href`. The match carries `aria-current=\"page\"` and the\n * active indicator. For a route nested under a destination, which no\n * `href` matches whole, mark that destination with its own `isCurrent`.\n */\n selectedRoute?: string;\n};\n\n/**\n * The column of top-level destinations a medium or wider window keeps at its\n * leading edge, collapsed or, with `isExpanded`, expanded. Each destination\n * is a link, so it routes through React Aria's `RouterProvider` when the app\n * has one.\n *\n * ```tsx\n * <NavigationRail aria-label=\"Label\" selectedRoute=\"/first\">\n * <NavigationRail.Item href=\"/first\" icon={<FirstIcon />}>\n * First item\n * </NavigationRail.Item>\n * <NavigationRail.Item href=\"/second\" icon={<SecondIcon />}>\n * Second item\n * </NavigationRail.Item>\n * </NavigationRail>\n * ```\n *\n * The call site's `className` and `style` land on the `<nav>`.\n */\nfunction NavigationRail({\n children,\n header,\n isExpanded = false,\n render,\n selectedRoute,\n ...props\n}: NavigationRailProps) {\n const context = useMemo(() => ({\n form: isExpanded ? 'expanded' as const : 'collapsed' as const,\n selectedRoute\n }), [isExpanded, selectedRoute]);\n const rail = useRender({\n defaultTagName: 'nav',\n props: {\n ...props,\n ...mergeStyles({\n 0: {\n className: \"x6s0dn4 x14s9m32 x5yr21d x9f619 x78zum5 xdt5ytf x2lah0s x8i8c5o xlaft8j xzoy561 x13oubkp\"\n },\n 1: {\n className: \"x6s0dn4 x14s9m32 x5yr21d x9f619 x78zum5 xdt5ytf x2lah0s x8i8c5o xlaft8j xeq5yr9 xxc7z9f x12rczxh x17qtykl\"\n }\n }[!!isExpanded << 0], props),\n children: <>\n {header === undefined ? null : <div {...{\n 0: {\n className: \"x6s0dn4 x9f619 x78zum5 xdt5ytf xqa3g7y\"\n },\n 1: {\n className: \"x9f619 x78zum5 xdt5ytf x1cy8zhl xkh2ocl x1mgj515 xdxifnh\"\n }\n }[!!isExpanded << 0]}>\n {header}\n </div>}\n <NavigationList layout={styles.destinations}>\n {children}\n </NavigationList>\n </>\n },\n render\n });\n return <NavigationContext value={context}>{rail}</NavigationContext>;\n}\n\n/**\n * One destination of a navigation rail — an icon, a label and, when it is the\n * current one, the active indicator. See `NavigationRail`.\n *\n * Defined here rather than re-exported from `src/navigation`: a re-export\n * let the build hand the package entry that module directly, past this\n * module's client directive, and a server component importing it got the\n * component itself rather than a reference to a client one.\n */\nfunction NavigationRailItem(props: NavigationItemProps & RefAttributes<HTMLAnchorElement>) {\n return <NavigationItem {...props} />;\n}\nNavigationRail.Item = NavigationRailItem;\nexport type { NavigationItemProps as NavigationRailItemProps, NavigationRailProps };\nexport { NavigationRailItem };\nexport default NavigationRail;"],"mappings":";;;;;;;;;AAwDA,MAAMG,SAAS,EACbC,cAAc;CACZC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,OAAO;CACPC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,OAAO;AACT,EACF;;;;;;;;;;;;;;;;;;;;AAyCA,SAAAI,eAAAC,IAAA;CAAA,MAAAC,IAAAzB,EAAA,EAAA;CAAA,IAAA0B;CAAA,IAAAC;CAAA,IAAAP;CAAA,IAAAC;CAAA,IAAAO;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAP,EAAA,OAAAD,IAAA;EAAwB,MAAA,EAAAE,UAAAO,IAAAb,QAAAc,IAAAb,YAAAc,IAAAP,QAAAQ,IAAAd,eAAA,GAAAe,UAAAb;EAAAE,WAAAO;EAAAb,SAAAc;EAAAN,SAAAQ;EAGtBf,aAAAc,OAAAG,KAAAA,IAAA,Q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,CAAA;CAAA,IAAAwB;CAAA,IAAAC,EAAA,OAAAY,OAAA;EACSb,KAAA,oBAAC,gBAAD,EAAe,GAAKa,MAAK,CAAA;EAAIZ,EAAA,KAAAY;EAAAZ,EAAA,KAAAD;CAAA,OAAAA,KAAAC,EAAA;CAAA,OAA7BD;AAA6B;AAEtCD,eAAeyB,OAAOD"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
2
3
|
import { props } from "../../node_modules/@stylexjs/stylex/lib/es/stylex.js";
|
|
4
|
+
import { Button, Link, NavigationTree as NavigationTree$1, NavigationTreeHeader as NavigationTreeHeader$1, NavigationTreeItem as NavigationTreeItem$1, NavigationTreeItemContent, NavigationTreeSection as NavigationTreeSection$1 } from "react-aria-components";
|
|
3
5
|
import { collectionStyles } from "../../collection/styles.js";
|
|
4
6
|
import { ChevronEndGlyph } from "../../glyphs/index.js";
|
|
5
7
|
import { useRipple } from "../../hooks/useRipple.js";
|
|
@@ -7,9 +9,7 @@ import { RowContent } from "../../row/index.js";
|
|
|
7
9
|
import { rowStyles } from "../../row/styles.js";
|
|
8
10
|
import { focus } from "../../styles/focus.js";
|
|
9
11
|
import { mergeStatefulStyles, mergeStyles } from "../../styles/merge.js";
|
|
10
|
-
import { c } from "react/compiler-runtime";
|
|
11
12
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
-
import { Button, Link, NavigationTree as NavigationTree$1, NavigationTreeHeader as NavigationTreeHeader$1, NavigationTreeItem as NavigationTreeItem$1, NavigationTreeItemContent, NavigationTreeSection as NavigationTreeSection$1 } from "react-aria-components";
|
|
13
13
|
// src/components/navigation-tree/index.tsx
|
|
14
14
|
const styles = {
|
|
15
15
|
chevron: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FieldVariant } from "../../field/index.js";
|
|
2
1
|
import { Ref, RefAttributes } from "react";
|
|
3
2
|
import { NumberFieldProps as NumberFieldProps$1 } from "react-aria-components";
|
|
3
|
+
import { FieldVariant } from "../../field/index.js";
|
|
4
4
|
type NumberFieldProps = {
|
|
5
5
|
/**
|
|
6
6
|
* The name of the stepper that lowers the value, for a screen reader. Left
|