@kanso-labs/kanso-ui 0.8.0 → 0.8.2
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 +41 -3
- package/dist/components/app-bar/index.js +4 -3
- package/dist/components/app-bar/index.js.map +1 -1
- package/dist/components/avatar/index.js +3 -1
- package/dist/components/avatar/index.js.map +1 -1
- package/dist/components/badge/index.js +3 -1
- package/dist/components/badge/index.js.map +1 -1
- package/dist/components/button/index.d.ts +20 -3
- package/dist/components/button/index.js +7 -2
- package/dist/components/button/index.js.map +1 -1
- package/dist/components/card/index.js +3 -1
- package/dist/components/card/index.js.map +1 -1
- package/dist/components/chip/index.js +32 -26
- package/dist/components/chip/index.js.map +1 -1
- package/dist/components/code/index.js +42 -30
- package/dist/components/code/index.js.map +1 -1
- package/dist/components/copy-field/index.js +2 -1
- package/dist/components/copy-field/index.js.map +1 -1
- package/dist/components/currency/index.js +3 -1
- package/dist/components/currency/index.js.map +1 -1
- package/dist/components/feed/index.js +3 -1
- package/dist/components/feed/index.js.map +1 -1
- package/dist/components/icon-button/index.d.ts +20 -3
- package/dist/components/icon-button/index.js +7 -2
- package/dist/components/icon-button/index.js.map +1 -1
- package/dist/components/keycap/index.js +42 -30
- package/dist/components/keycap/index.js.map +1 -1
- package/dist/components/link/index.js +3 -1
- package/dist/components/link/index.js.map +1 -1
- package/dist/components/list-detail/index.js +6 -5
- package/dist/components/list-detail/index.js.map +1 -1
- package/dist/components/list-item/index.js +3 -2
- package/dist/components/list-item/index.js.map +1 -1
- package/dist/components/product-icon/index.js +3 -1
- package/dist/components/product-icon/index.js.map +1 -1
- package/dist/components/separator/index.js +3 -1
- package/dist/components/separator/index.js.map +1 -1
- package/dist/components/sheet/index.js +88 -67
- package/dist/components/sheet/index.js.map +1 -1
- package/dist/components/supporting-pane/index.js +69 -61
- package/dist/components/supporting-pane/index.js.map +1 -1
- package/dist/components/tabs/index.js +48 -26
- package/dist/components/tabs/index.js.map +1 -1
- package/dist/components/text/index.js +3 -1
- package/dist/components/text/index.js.map +1 -1
- package/dist/components/text-field/index.js +12 -11
- package/dist/components/text-field/index.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/render/nativeButton.js +26 -0
- package/dist/render/nativeButton.js.map +1 -0
- package/dist/styles/merge.js +57 -0
- package/dist/styles/merge.js.map +1 -0
- package/package.json +4 -3
- /package/dist/{assets/stylex.css → styles.css} +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { props } from "../../node_modules/@stylexjs/stylex/lib/es/stylex.js";
|
|
2
|
+
import { mergeStatefulStyles } from "../../styles/merge.js";
|
|
2
3
|
import { jsx } from "react/jsx-runtime";
|
|
3
4
|
import { Separator } from "@base-ui/react/separator";
|
|
4
5
|
//#region src/components/separator/index.tsx
|
|
@@ -6,6 +7,7 @@ const styles = {
|
|
|
6
7
|
base: {
|
|
7
8
|
kWkggS: "x1l12bh",
|
|
8
9
|
kMzoRj: "xc342km",
|
|
10
|
+
kB7OPa: "x9f619",
|
|
9
11
|
kmuXW: "x2lah0s",
|
|
10
12
|
kogj98: "x1ghz6dp",
|
|
11
13
|
$$css: true
|
|
@@ -25,7 +27,7 @@ function Separator$1({ orientation = "horizontal", ...props$1 }) {
|
|
|
25
27
|
return /* @__PURE__ */ jsx(Separator, {
|
|
26
28
|
orientation,
|
|
27
29
|
...props$1,
|
|
28
|
-
...props(styles.base, styles[orientation])
|
|
30
|
+
...mergeStatefulStyles(props(styles.base, styles[orientation]), props$1)
|
|
29
31
|
});
|
|
30
32
|
}
|
|
31
33
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/separator/index.tsx"],"sourcesContent":["import type { SeparatorProps as BaseUISeparatorProps } from '@base-ui/react/separator';\nimport { Separator as BaseUISeparator } from '@base-ui/react/separator';\nimport * as stylex from '@stylexjs/stylex';\nimport '../../tokens/design.tokens.stylex';\nimport { colors } from '../../tokens/design.tokens.stylex';\n\n// A divider is the same colour as a border, so it draws from outlineVariant\n// rather than a role of its own — the design system treats the two as one\n// decision, and a separator that drifted from the borders around it would\n// read as a mistake.\n//\n// Drawn as a background on a 1px box rather than as a border, so the rule is\n// the element itself. A border would leave the element's own box at zero\n// size, which makes it invisible to flex `gap` and to anything measuring it.\n//\n// Vertical has no length of its own. `alignSelf: stretch` takes it from the\n// flex or grid parent, since a divider between two rows should match\n// whatever they turn out to be rather than being told a height at the call\n// site. In a plain block parent there is nothing to stretch to and it will\n// have no height — that is the documented cost of the prop.\nconst styles = {\n base: {\n kWkggS: \"x1l12bh\",\n kMzoRj: \"xc342km\",\n kmuXW: \"x2lah0s\",\n kogj98: \"x1ghz6dp\",\n $$css: true\n },\n horizontal: {\n kZKoxP: \"xjm9jq1\",\n kzqmXN: \"xh8yej3\",\n $$css: true\n },\n vertical: {\n kSGwAc: \"xkh2ocl\",\n kzqmXN: \"x1i1rx1s\",\n $$css: true\n }\n};\ntype SeparatorProps = Omit<BaseUISeparatorProps, 'orientation'> & {\n /**\n * Which way the rule runs. A vertical separator takes its length from a\n * flex or grid parent and has none of its own.\n * @default 'horizontal'\n */\n orientation?: 'horizontal' | 'vertical';\n};\nfunction Separator({\n orientation = 'horizontal',\n ...props\n}: SeparatorProps) {\n return <BaseUISeparator orientation={orientation} {...props} {...stylex.props(styles.base, styles[orientation])} />;\n}\nexport type { SeparatorProps };\nexport default Separator;"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/separator/index.tsx"],"sourcesContent":["import type { SeparatorProps as BaseUISeparatorProps } from '@base-ui/react/separator';\nimport { Separator as BaseUISeparator } from '@base-ui/react/separator';\nimport * as stylex from '@stylexjs/stylex';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors } from '../../tokens/design.tokens.stylex';\n\n// A divider is the same colour as a border, so it draws from outlineVariant\n// rather than a role of its own — the design system treats the two as one\n// decision, and a separator that drifted from the borders around it would\n// read as a mistake.\n//\n// Drawn as a background on a 1px box rather than as a border, so the rule is\n// the element itself. A border would leave the element's own box at zero\n// size, which makes it invisible to flex `gap` and to anything measuring it.\n//\n// Vertical has no length of its own. `alignSelf: stretch` takes it from the\n// flex or grid parent, since a divider between two rows should match\n// whatever they turn out to be rather than being told a height at the call\n// site. In a plain block parent there is nothing to stretch to and it will\n// have no height — that is the documented cost of the prop.\nconst styles = {\n base: {\n kWkggS: \"x1l12bh\",\n kMzoRj: \"xc342km\",\n kB7OPa: \"x9f619\",\n kmuXW: \"x2lah0s\",\n kogj98: \"x1ghz6dp\",\n $$css: true\n },\n horizontal: {\n kZKoxP: \"xjm9jq1\",\n kzqmXN: \"xh8yej3\",\n $$css: true\n },\n vertical: {\n kSGwAc: \"xkh2ocl\",\n kzqmXN: \"x1i1rx1s\",\n $$css: true\n }\n};\ntype SeparatorProps = Omit<BaseUISeparatorProps, 'orientation'> & {\n /**\n * Which way the rule runs. A vertical separator takes its length from a\n * flex or grid parent and has none of its own.\n * @default 'horizontal'\n */\n orientation?: 'horizontal' | 'vertical';\n};\nfunction Separator({\n orientation = 'horizontal',\n ...props\n}: SeparatorProps) {\n return <BaseUISeparator orientation={orientation} {...props} {...mergeStatefulStyles(stylex.props(styles.base, styles[orientation]), props)} />;\n}\nexport type { SeparatorProps };\nexport default Separator;"],"mappings":";;;;;AAqBA,MAAM,SAAS;CACb,MAAM;EACJ,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;EACP,QAAQ;EACR,OAAO;CACT;CACA,YAAY;EACV,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,UAAU;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;AACF;AASA,SAAS,YAAU,EACjB,cAAc,cACd,GAAG,WACc;CACjB,OAAO,oBAAC,WAAD;EAA8B;EAAa,GAAI;EAAO,GAAI,oBAAoB,MAAa,OAAO,MAAM,OAAO,YAAY,GAAG,OAAK;CAAE,CAAA;AAC9I"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { props } from "../../node_modules/@stylexjs/stylex/lib/es/stylex.js";
|
|
2
|
+
import { mergeStatefulStyles, mergeStyles } from "../../styles/merge.js";
|
|
2
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
4
|
import { c } from "react/compiler-runtime";
|
|
4
5
|
import { createContext, useContext } from "react";
|
|
@@ -15,6 +16,7 @@ const styles = {
|
|
|
15
16
|
$$css: true
|
|
16
17
|
},
|
|
17
18
|
body: {
|
|
19
|
+
kB7OPa: "x9f619",
|
|
18
20
|
k1xSpc: "x78zum5",
|
|
19
21
|
kXwgrk: "xdt5ytf",
|
|
20
22
|
kzQI83: "x1iyjqo2",
|
|
@@ -33,6 +35,7 @@ const styles = {
|
|
|
33
35
|
kfmiAY: "x1a37zkv xys6ro8",
|
|
34
36
|
krdFHd: "x6xk272 x9t1vth",
|
|
35
37
|
kGVxlE: "x19efjv6",
|
|
38
|
+
kB7OPa: "x9f619",
|
|
36
39
|
kMwMTN: "x139gbkf",
|
|
37
40
|
k1xSpc: "x78zum5",
|
|
38
41
|
kXwgrk: "xdt5ytf",
|
|
@@ -49,6 +52,7 @@ const styles = {
|
|
|
49
52
|
kLZC3w: "x12smttz",
|
|
50
53
|
kPef9Z: "x13fuv20",
|
|
51
54
|
kEafiO: "x178xt8z",
|
|
55
|
+
kB7OPa: "x9f619",
|
|
52
56
|
k1xSpc: "x78zum5",
|
|
53
57
|
kmuXW: "x2lah0s",
|
|
54
58
|
kOIVth: "x126z3so",
|
|
@@ -62,6 +66,7 @@ const styles = {
|
|
|
62
66
|
kL6WhQ: "x1j6faob",
|
|
63
67
|
kfdmCh: "x1q0q8m5",
|
|
64
68
|
kt9PQ7: "xso031l",
|
|
69
|
+
kB7OPa: "x9f619",
|
|
65
70
|
k1xSpc: "x78zum5",
|
|
66
71
|
kmuXW: "x2lah0s",
|
|
67
72
|
kOIVth: "x1gka490",
|
|
@@ -79,6 +84,7 @@ const styles = {
|
|
|
79
84
|
$$css: true
|
|
80
85
|
},
|
|
81
86
|
title: {
|
|
87
|
+
kB7OPa: "x9f619",
|
|
82
88
|
kMwMTN: "x139gbkf",
|
|
83
89
|
kMv6JI: "xdy5w5q",
|
|
84
90
|
kGuDYH: "xete2z3",
|
|
@@ -111,17 +117,24 @@ function Sheet({ children, size = "md", ...props }) {
|
|
|
111
117
|
});
|
|
112
118
|
}
|
|
113
119
|
function SheetBody(props) {
|
|
114
|
-
const $ = c(
|
|
120
|
+
const $ = c(5);
|
|
115
121
|
let t0;
|
|
116
122
|
if ($[0] !== props) {
|
|
117
|
-
t0 =
|
|
118
|
-
...props,
|
|
119
|
-
className: "x78zum5 xdt5ytf x1iyjqo2 xxj4525 x1odjw0f xgc26li"
|
|
120
|
-
});
|
|
123
|
+
t0 = mergeStyles({ className: "x9f619 x78zum5 xdt5ytf x1iyjqo2 xxj4525 x1odjw0f xgc26li" }, props);
|
|
121
124
|
$[0] = props;
|
|
122
125
|
$[1] = t0;
|
|
123
126
|
} else t0 = $[1];
|
|
124
|
-
|
|
127
|
+
let t1;
|
|
128
|
+
if ($[2] !== props || $[3] !== t0) {
|
|
129
|
+
t1 = /* @__PURE__ */ jsx("div", {
|
|
130
|
+
...props,
|
|
131
|
+
...t0
|
|
132
|
+
});
|
|
133
|
+
$[2] = props;
|
|
134
|
+
$[3] = t0;
|
|
135
|
+
$[4] = t1;
|
|
136
|
+
} else t1 = $[4];
|
|
137
|
+
return t1;
|
|
125
138
|
}
|
|
126
139
|
/**
|
|
127
140
|
* Closes the sheet when pressed. Carries no styling of its own, so give it
|
|
@@ -144,82 +157,83 @@ function SheetClose(props) {
|
|
|
144
157
|
* page while this is portalled out to the end of the body.
|
|
145
158
|
*/
|
|
146
159
|
function SheetContent(t0) {
|
|
147
|
-
const $ = c(
|
|
148
|
-
|
|
149
|
-
let container;
|
|
150
|
-
let props$1;
|
|
151
|
-
if ($[0] !== t0) {
|
|
152
|
-
({children, container, ...props$1} = t0);
|
|
153
|
-
$[0] = t0;
|
|
154
|
-
$[1] = children;
|
|
155
|
-
$[2] = container;
|
|
156
|
-
$[3] = props$1;
|
|
157
|
-
} else {
|
|
158
|
-
children = $[1];
|
|
159
|
-
container = $[2];
|
|
160
|
-
props$1 = $[3];
|
|
161
|
-
}
|
|
160
|
+
const $ = c(11);
|
|
161
|
+
const { children, container, ...props$1 } = t0;
|
|
162
162
|
const size = useContext(SheetSizeContext);
|
|
163
|
-
|
|
164
|
-
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
165
|
-
t1 = /* @__PURE__ */ jsx(Dialog.Backdrop, { className: "x1vhuh8u xqcmdr3 x1yujl0p x1iqbvzf x10a8y8t xixxii4" });
|
|
166
|
-
$[4] = t1;
|
|
167
|
-
} else t1 = $[4];
|
|
163
|
+
const t1 = Dialog;
|
|
168
164
|
let t2;
|
|
169
|
-
if ($[
|
|
170
|
-
t2 =
|
|
171
|
-
$[
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
165
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
166
|
+
t2 = /* @__PURE__ */ jsx(Dialog.Backdrop, { className: "x1vhuh8u xqcmdr3 x1yujl0p x1iqbvzf x10a8y8t xixxii4" });
|
|
167
|
+
$[0] = t2;
|
|
168
|
+
} else t2 = $[0];
|
|
169
|
+
const t3 = Dialog;
|
|
170
|
+
const t4 = mergeStatefulStyles(props(styles.content, styles[size]), props$1);
|
|
171
|
+
let t5;
|
|
172
|
+
if ($[1] !== children || $[2] !== props$1 || $[3] !== t3.Popup || $[4] !== t4) {
|
|
173
|
+
t5 = /* @__PURE__ */ jsx(t3.Popup, {
|
|
177
174
|
...props$1,
|
|
178
|
-
...
|
|
175
|
+
...t4,
|
|
179
176
|
children
|
|
180
177
|
});
|
|
181
|
-
$[
|
|
182
|
-
$[
|
|
183
|
-
$[
|
|
184
|
-
$[
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
178
|
+
$[1] = children;
|
|
179
|
+
$[2] = props$1;
|
|
180
|
+
$[3] = t3.Popup;
|
|
181
|
+
$[4] = t4;
|
|
182
|
+
$[5] = t5;
|
|
183
|
+
} else t5 = $[5];
|
|
184
|
+
let t6;
|
|
185
|
+
if ($[6] !== container || $[7] !== t1.Portal || $[8] !== t2 || $[9] !== t5) {
|
|
186
|
+
t6 = /* @__PURE__ */ jsxs(t1.Portal, {
|
|
189
187
|
container,
|
|
190
|
-
children: [
|
|
188
|
+
children: [t2, t5]
|
|
191
189
|
});
|
|
192
|
-
$[
|
|
193
|
-
$[
|
|
194
|
-
$[
|
|
195
|
-
|
|
196
|
-
|
|
190
|
+
$[6] = container;
|
|
191
|
+
$[7] = t1.Portal;
|
|
192
|
+
$[8] = t2;
|
|
193
|
+
$[9] = t5;
|
|
194
|
+
$[10] = t6;
|
|
195
|
+
} else t6 = $[10];
|
|
196
|
+
return t6;
|
|
197
197
|
}
|
|
198
198
|
function SheetFooter(props) {
|
|
199
|
-
const $ = c(
|
|
199
|
+
const $ = c(5);
|
|
200
200
|
let t0;
|
|
201
201
|
if ($[0] !== props) {
|
|
202
|
-
t0 =
|
|
203
|
-
...props,
|
|
204
|
-
className: "x12smttz x13fuv20 x178xt8z x78zum5 x2lah0s x126z3so x13a6bvl x1uvvd8r x790zyz"
|
|
205
|
-
});
|
|
202
|
+
t0 = mergeStyles({ className: "x12smttz x13fuv20 x178xt8z x9f619 x78zum5 x2lah0s x126z3so x13a6bvl x1uvvd8r x790zyz" }, props);
|
|
206
203
|
$[0] = props;
|
|
207
204
|
$[1] = t0;
|
|
208
205
|
} else t0 = $[1];
|
|
209
|
-
|
|
206
|
+
let t1;
|
|
207
|
+
if ($[2] !== props || $[3] !== t0) {
|
|
208
|
+
t1 = /* @__PURE__ */ jsx("div", {
|
|
209
|
+
...props,
|
|
210
|
+
...t0
|
|
211
|
+
});
|
|
212
|
+
$[2] = props;
|
|
213
|
+
$[3] = t0;
|
|
214
|
+
$[4] = t1;
|
|
215
|
+
} else t1 = $[4];
|
|
216
|
+
return t1;
|
|
210
217
|
}
|
|
211
218
|
function SheetHeader(props) {
|
|
212
|
-
const $ = c(
|
|
219
|
+
const $ = c(5);
|
|
213
220
|
let t0;
|
|
214
221
|
if ($[0] !== props) {
|
|
215
|
-
t0 =
|
|
216
|
-
...props,
|
|
217
|
-
className: "x6s0dn4 x1j6faob x1q0q8m5 xso031l x78zum5 x2lah0s x1gka490 x1qughib x1cmllll x790zyz"
|
|
218
|
-
});
|
|
222
|
+
t0 = mergeStyles({ className: "x6s0dn4 x1j6faob x1q0q8m5 xso031l x9f619 x78zum5 x2lah0s x1gka490 x1qughib x1cmllll x790zyz" }, props);
|
|
219
223
|
$[0] = props;
|
|
220
224
|
$[1] = t0;
|
|
221
225
|
} else t0 = $[1];
|
|
222
|
-
|
|
226
|
+
let t1;
|
|
227
|
+
if ($[2] !== props || $[3] !== t0) {
|
|
228
|
+
t1 = /* @__PURE__ */ jsx("div", {
|
|
229
|
+
...props,
|
|
230
|
+
...t0
|
|
231
|
+
});
|
|
232
|
+
$[2] = props;
|
|
233
|
+
$[3] = t0;
|
|
234
|
+
$[4] = t1;
|
|
235
|
+
} else t1 = $[4];
|
|
236
|
+
return t1;
|
|
223
237
|
}
|
|
224
238
|
/**
|
|
225
239
|
* Names the sheet. Rendered through Base UI's title part, which is what
|
|
@@ -227,17 +241,24 @@ function SheetHeader(props) {
|
|
|
227
241
|
* itself as an unnamed dialog.
|
|
228
242
|
*/
|
|
229
243
|
function SheetTitle(props) {
|
|
230
|
-
const $ = c(
|
|
244
|
+
const $ = c(5);
|
|
231
245
|
let t0;
|
|
232
246
|
if ($[0] !== props) {
|
|
233
|
-
t0 =
|
|
234
|
-
...props,
|
|
235
|
-
className: "x139gbkf xdy5w5q xete2z3 x14ijtet xug9e1u x2divse x1ghz6dp"
|
|
236
|
-
});
|
|
247
|
+
t0 = mergeStatefulStyles({ className: "x9f619 x139gbkf xdy5w5q xete2z3 x14ijtet xug9e1u x2divse x1ghz6dp" }, props);
|
|
237
248
|
$[0] = props;
|
|
238
249
|
$[1] = t0;
|
|
239
250
|
} else t0 = $[1];
|
|
240
|
-
|
|
251
|
+
let t1;
|
|
252
|
+
if ($[2] !== props || $[3] !== t0) {
|
|
253
|
+
t1 = /* @__PURE__ */ jsx(Dialog.Title, {
|
|
254
|
+
...props,
|
|
255
|
+
...t0
|
|
256
|
+
});
|
|
257
|
+
$[2] = props;
|
|
258
|
+
$[3] = t0;
|
|
259
|
+
$[4] = t1;
|
|
260
|
+
} else t1 = $[4];
|
|
261
|
+
return t1;
|
|
241
262
|
}
|
|
242
263
|
/**
|
|
243
264
|
* Opens the sheet when pressed. Unstyled like `Sheet.Close`, so pass the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["children","container"],"sources":["../../../src/components/sheet/index.tsx"],"sourcesContent":["import type { DialogCloseProps as BaseUIDialogCloseProps, DialogPopupProps as BaseUIDialogPopupProps, DialogPortalProps as BaseUIDialogPortalProps, DialogRootProps as BaseUIDialogRootProps, DialogTitleProps as BaseUIDialogTitleProps, DialogTriggerProps as BaseUIDialogTriggerProps } from '@base-ui/react/dialog';\nimport type { HTMLAttributes, ReactNode } from 'react';\nimport { Dialog as BaseUIDialog } from '@base-ui/react/dialog';\nimport * as stylex from '@stylexjs/stylex';\nimport { createContext, useContext } from 'react';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, media, motion, radii, shadows, spacing, typography } from '../../tokens/design.tokens.stylex';\n\n// One component, two presentations. Above the medium breakpoint it is a side\n// sheet pinned to the inline end of the viewport; below it, the same panel\n// becomes a bottom sheet. That is M3's own pairing rather than two components,\n// and it is why nothing here takes a `side` prop — a sheet that stayed on the\n// right at 375px would be a drawer covering the whole screen.\n//\n// The two differ in three things and no more: which edges they are pinned to,\n// which two corners are rounded, and which axis they arrive along.\nconst slideInFromEnd = \"x17cjob-B\";\nconst slideInFromBottom = \"x15b941j-B\";\nconst fadeIn = \"x18re5ia-B\";\n\n// Entry only, so there is no exit animation to wait for and closing is\n// immediate. See the comment on `SheetContent` for why that is a design call\n// rather than a limit of StyleX.\nconst styles = {\n backdrop: {\n k44tkh: \"x1vhuh8u\",\n kKVMdj: \"xqcmdr3\",\n kyAemX: \"x1yujl0p\",\n kWkggS: \"x1iqbvzf\",\n kpwlN0: \"x10a8y8t\",\n kVAEAm: \"xixxii4\",\n $$css: true\n },\n body: {\n k1xSpc: \"x78zum5\",\n kXwgrk: \"xdt5ytf\",\n kzQI83: \"x1iyjqo2\",\n kOIVth: \"xxj4525\",\n kORKVm: \"x1odjw0f\",\n kmVPX3: \"xgc26li\",\n $$css: true\n },\n content: {\n k44tkh: \"x1n1nwrg\",\n kKVMdj: \"xu2fq7p x18ihq2d\",\n kyAemX: \"x16dv9tl\",\n kWkggS: \"x1vnz5z6\",\n kT0f0o: \"xkducg2\",\n kVL7Gh: \"xrzall9 xb0nsol\",\n kfmiAY: \"x1a37zkv xys6ro8\",\n krdFHd: \"x6xk272 x9t1vth\",\n kGVxlE: \"x19efjv6\",\n kMwMTN: \"x139gbkf\",\n k1xSpc: \"x78zum5\",\n kXwgrk: \"xdt5ytf\",\n krVfgx: \"x1ey2m1c\",\n k87sOh: \"x13vifvy xmpip4z\",\n kt4wiu: \"xtijo5x\",\n kLqNvP: \"xhi6v0a x1upgybz\",\n kskxy: \"x7ab17h x1dexy1j\",\n kVQacm: \"xb3r6kr\",\n kVAEAm: \"xixxii4\",\n $$css: true\n },\n footer: {\n kLZC3w: \"x12smttz\",\n kPef9Z: \"x13fuv20\",\n kEafiO: \"x178xt8z\",\n k1xSpc: \"x78zum5\",\n kmuXW: \"x2lah0s\",\n kOIVth: \"x126z3so\",\n kjj79g: \"x13a6bvl\",\n k8WAf4: \"x1uvvd8r\",\n kg3NbH: \"x790zyz\",\n $$css: true\n },\n header: {\n kGNEyG: \"x6s0dn4\",\n kL6WhQ: \"x1j6faob\",\n kfdmCh: \"x1q0q8m5\",\n kt9PQ7: \"xso031l\",\n k1xSpc: \"x78zum5\",\n kmuXW: \"x2lah0s\",\n kOIVth: \"x1gka490\",\n kjj79g: \"x1qughib\",\n k8WAf4: \"x1cmllll\",\n kg3NbH: \"x790zyz\",\n $$css: true\n },\n md: {\n kzqmXN: \"x1l2rt3b xwvxfow\",\n $$css: true\n },\n sm: {\n kzqmXN: \"x1m258z3 xwvxfow\",\n $$css: true\n },\n title: {\n kMwMTN: \"x139gbkf\",\n kMv6JI: \"xdy5w5q\",\n kGuDYH: \"xete2z3\",\n k63SB2: \"x14ijtet\",\n kb6lSQ: \"xug9e1u\",\n kLWn49: \"x2divse\",\n kogj98: \"x1ghz6dp\",\n $$css: true\n }\n};\ntype SheetSize = 'md' | 'sm';\n\n// `size` is declared on the root, where a reader expects to set the shape of\n// the whole sheet, but it is `Sheet.Content` that has to apply it. One string\n// through context rather than making the call site repeat it on both.\nconst SheetSizeContext = createContext<SheetSize>('md');\n\n// `children` is narrowed to nodes. Base UI also accepts a function there, to\n// hand the sheet a payload passed by whichever trigger opened it, and that\n// form cannot be wrapped in a context provider without calling it first —\n// which would be doing Base UI's job with none of its state. Nothing in this\n// component needs the payload, so the narrower type says so rather than\n// leaving a signature that type-checks and then fails to render.\ntype SheetProps = Omit<BaseUIDialogRootProps, 'children'> & {\n children?: ReactNode;\n /**\n * Panel width on the side-sheet presentation: `sm` 320px, `md` 400px.\n * Ignored below the medium breakpoint, where the sheet is full width.\n * @default 'md'\n */\n size?: SheetSize;\n};\n\n/**\n * A modal panel that arrives from the edge of the screen — a side sheet on a\n * wide viewport, a bottom sheet on a narrow one. Open state is Base UI's:\n * pass `open` with `onOpenChange` to control it, or `defaultOpen` to let it\n * keep its own.\n *\n * Composed rather than configured by props, because a sheet's header, body,\n * and footer all take arbitrary content — the parts are `Sheet.Trigger`,\n * `Sheet.Content`, `Sheet.Header`, `Sheet.Title`, `Sheet.Body`,\n * `Sheet.Footer`, and `Sheet.Close`.\n */\nfunction Sheet({\n children,\n size = 'md',\n ...props\n}: SheetProps) {\n return <BaseUIDialog.Root {...props}>\n <SheetSizeContext value={size}>{children}</SheetSizeContext>\n </BaseUIDialog.Root>;\n}\nfunction SheetBody(props: HTMLAttributes<HTMLDivElement>) {\n return <div {...props} className=\"x78zum5 xdt5ytf x1iyjqo2 xxj4525 x1odjw0f xgc26li\" />;\n}\n\n/**\n * Closes the sheet when pressed. Carries no styling of its own, so give it\n * the control it should be through `render` — an `IconButton` in the header,\n * a `Button` in the footer.\n */\nfunction SheetClose(props: BaseUIDialogCloseProps) {\n return <BaseUIDialog.Close {...props} />;\n}\n\n/**\n * The panel itself, and the scrim behind it. Everything the sheet shows goes\n * in here; `Sheet.Trigger` stays outside it, since the trigger lives in the\n * page while this is portalled out to the end of the body.\n */\nfunction SheetContent({\n children,\n container,\n ...props\n}: SheetContentProps) {\n const size = useContext(SheetSizeContext);\n return <BaseUIDialog.Portal container={container}>\n <BaseUIDialog.Backdrop className=\"x1vhuh8u xqcmdr3 x1yujl0p x1iqbvzf x10a8y8t xixxii4\" />\n <BaseUIDialog.Popup {...props} {...stylex.props(styles.content, styles[size])}>\n {children}\n </BaseUIDialog.Popup>\n </BaseUIDialog.Portal>;\n}\nfunction SheetFooter(props: HTMLAttributes<HTMLDivElement>) {\n return <div {...props} className=\"x12smttz x13fuv20 x178xt8z x78zum5 x2lah0s x126z3so x13a6bvl x1uvvd8r x790zyz\" />;\n}\nfunction SheetHeader(props: HTMLAttributes<HTMLDivElement>) {\n return <div {...props} className=\"x6s0dn4 x1j6faob x1q0q8m5 xso031l x78zum5 x2lah0s x1gka490 x1qughib x1cmllll x790zyz\" />;\n}\n\n/**\n * Names the sheet. Rendered through Base UI's title part, which is what\n * points the dialog's `aria-labelledby` at it — a sheet without one announces\n * itself as an unnamed dialog.\n */\nfunction SheetTitle(props: BaseUIDialogTitleProps) {\n return <BaseUIDialog.Title {...props} className=\"x139gbkf xdy5w5q xete2z3 x14ijtet xug9e1u x2divse x1ghz6dp\" />;\n}\n\n/**\n * Opens the sheet when pressed. Unstyled like `Sheet.Close`, so pass the\n * control through `render`.\n */\nfunction SheetTrigger(props: BaseUIDialogTriggerProps) {\n return <BaseUIDialog.Trigger {...props} />;\n}\nSheet.Body = SheetBody;\nSheet.Close = SheetClose;\nSheet.Content = SheetContent;\nSheet.Footer = SheetFooter;\nSheet.Header = SheetHeader;\nSheet.Title = SheetTitle;\nSheet.Trigger = SheetTrigger;\ntype SheetCloseProps = BaseUIDialogCloseProps;\ntype SheetContentProps = BaseUIDialogPopupProps & {\n /**\n * Where to portal the panel and scrim. Defaults to the end of `<body>`,\n * which is right for an app that sets its StyleX theme on `:root`. An app\n * that scopes the theme to a subtree has to point this at an element inside\n * it, or the sheet renders outside the theme and falls back to the tokens'\n * `prefers-color-scheme` default.\n */\n container?: BaseUIDialogPortalProps['container'];\n};\ntype SheetTitleProps = BaseUIDialogTitleProps;\ntype SheetTriggerProps = BaseUIDialogTriggerProps;\nexport type { SheetCloseProps, SheetContentProps, SheetProps, SheetSize, SheetTitleProps, SheetTriggerProps };\nexport default Sheet;"],"mappings":";;;;;;AAuBA,MAAM,SAAS;CACb,UAAU;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,MAAM;EACJ,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,SAAS;EACP,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;EACP,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,QAAQ;EACN,QAAQ;EACR,QAAQ;EAC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,KAAA;CAAA,OAAA,KAAA,EAAA;CAAA,OAA5G;AAA4G;AAErH,SAAA,YAAA,OAAA;CAAA,MAAA,IAAA,EAAA,CAAA;CAAA,IAAA;CAAA,IAAA,EAAA,OAAA,OAAA;EACS,KAAA,oBAAA,OAAA;GAAmH,GAA1G;GAAiB,WAAA;EAAsF,CAAA;EAAG,EAAA,KAAA;EAAA,EAAA,KAAA;CAAA,OAAA,KAAA,EAAA;CAAA,OAAnH;AAAmH;;;;;;AAQ5H,SAAA,WAAA,OAAA;CAAA,MAAA,IAAA,EAAA,CAAA;CAAA,IAAA;CAAA,IAAA,EAAA,OAAA,OAAA;EACS,KAAA,oBAAA,OAAA,OAAA;GAAA,GAAwB;GAAiB,WAAA;EAA4D,CAAA;EAAG,EAAA,KAAA;EAAA,EAAA,KAAA;CAAA,OAAA,KAAA,EAAA;CAAA,OAAxG;AAAwG;;;;;AAOjH,SAAA,aAAA,OAAA;CAAA,MAAA,IAAA,EAAA,CAAA;CAAA,IAAA;CAAA,IAAA,EAAA,OAAA,OAAA;EACS,KAAA,oBAAA,OAAA,SAAA,EAAA,GAA0B,MAAK,CAAA;EAAI,EAAA,KAAA;EAAA,EAAA,KAAA;CAAA,OAAA,KAAA,EAAA;CAAA,OAAnC;AAAmC;AAE5C,MAAM,OAAO;AACb,MAAM,QAAQ;AACd,MAAM,UAAU;AAChB,MAAM,SAAS;AACf,MAAM,SAAS;AACf,MAAM,QAAQ;AACd,MAAM,UAAU"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["children","container"],"sources":["../../../src/components/sheet/index.tsx"],"sourcesContent":["import type { DialogCloseProps as BaseUIDialogCloseProps, DialogPopupProps as BaseUIDialogPopupProps, DialogPortalProps as BaseUIDialogPortalProps, DialogRootProps as BaseUIDialogRootProps, DialogTitleProps as BaseUIDialogTitleProps, DialogTriggerProps as BaseUIDialogTriggerProps } from '@base-ui/react/dialog';\nimport type { HTMLAttributes, ReactNode } from 'react';\nimport { Dialog as BaseUIDialog } from '@base-ui/react/dialog';\nimport * as stylex from '@stylexjs/stylex';\nimport { createContext, useContext } from 'react';\nimport { mergeStatefulStyles, mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, media, motion, radii, shadows, spacing, typography } from '../../tokens/design.tokens.stylex';\n\n// One component, two presentations. Above the medium breakpoint it is a side\n// sheet pinned to the inline end of the viewport; below it, the same panel\n// becomes a bottom sheet. That is M3's own pairing rather than two components,\n// and it is why nothing here takes a `side` prop — a sheet that stayed on the\n// right at 375px would be a drawer covering the whole screen.\n//\n// The two differ in three things and no more: which edges they are pinned to,\n// which two corners are rounded, and which axis they arrive along.\nconst slideInFromEnd = \"x17cjob-B\";\nconst slideInFromBottom = \"x15b941j-B\";\nconst fadeIn = \"x18re5ia-B\";\n\n// Entry only, so there is no exit animation to wait for and closing is\n// immediate. See the comment on `SheetContent` for why that is a design call\n// rather than a limit of StyleX.\nconst styles = {\n backdrop: {\n k44tkh: \"x1vhuh8u\",\n kKVMdj: \"xqcmdr3\",\n kyAemX: \"x1yujl0p\",\n kWkggS: \"x1iqbvzf\",\n kpwlN0: \"x10a8y8t\",\n kVAEAm: \"xixxii4\",\n $$css: true\n },\n body: {\n kB7OPa: \"x9f619\",\n k1xSpc: \"x78zum5\",\n kXwgrk: \"xdt5ytf\",\n kzQI83: \"x1iyjqo2\",\n kOIVth: \"xxj4525\",\n kORKVm: \"x1odjw0f\",\n kmVPX3: \"xgc26li\",\n $$css: true\n },\n content: {\n k44tkh: \"x1n1nwrg\",\n kKVMdj: \"xu2fq7p x18ihq2d\",\n kyAemX: \"x16dv9tl\",\n kWkggS: \"x1vnz5z6\",\n kT0f0o: \"xkducg2\",\n kVL7Gh: \"xrzall9 xb0nsol\",\n kfmiAY: \"x1a37zkv xys6ro8\",\n krdFHd: \"x6xk272 x9t1vth\",\n kGVxlE: \"x19efjv6\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x139gbkf\",\n k1xSpc: \"x78zum5\",\n kXwgrk: \"xdt5ytf\",\n krVfgx: \"x1ey2m1c\",\n k87sOh: \"x13vifvy xmpip4z\",\n kt4wiu: \"xtijo5x\",\n kLqNvP: \"xhi6v0a x1upgybz\",\n kskxy: \"x7ab17h x1dexy1j\",\n kVQacm: \"xb3r6kr\",\n kVAEAm: \"xixxii4\",\n $$css: true\n },\n footer: {\n kLZC3w: \"x12smttz\",\n kPef9Z: \"x13fuv20\",\n kEafiO: \"x178xt8z\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"x78zum5\",\n kmuXW: \"x2lah0s\",\n kOIVth: \"x126z3so\",\n kjj79g: \"x13a6bvl\",\n k8WAf4: \"x1uvvd8r\",\n kg3NbH: \"x790zyz\",\n $$css: true\n },\n header: {\n kGNEyG: \"x6s0dn4\",\n kL6WhQ: \"x1j6faob\",\n kfdmCh: \"x1q0q8m5\",\n kt9PQ7: \"xso031l\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"x78zum5\",\n kmuXW: \"x2lah0s\",\n kOIVth: \"x1gka490\",\n kjj79g: \"x1qughib\",\n k8WAf4: \"x1cmllll\",\n kg3NbH: \"x790zyz\",\n $$css: true\n },\n md: {\n kzqmXN: \"x1l2rt3b xwvxfow\",\n $$css: true\n },\n sm: {\n kzqmXN: \"x1m258z3 xwvxfow\",\n $$css: true\n },\n title: {\n kB7OPa: \"x9f619\",\n kMwMTN: \"x139gbkf\",\n kMv6JI: \"xdy5w5q\",\n kGuDYH: \"xete2z3\",\n k63SB2: \"x14ijtet\",\n kb6lSQ: \"xug9e1u\",\n kLWn49: \"x2divse\",\n kogj98: \"x1ghz6dp\",\n $$css: true\n }\n};\ntype SheetSize = 'md' | 'sm';\n\n// `size` is declared on the root, where a reader expects to set the shape of\n// the whole sheet, but it is `Sheet.Content` that has to apply it. One string\n// through context rather than making the call site repeat it on both.\nconst SheetSizeContext = createContext<SheetSize>('md');\n\n// `children` is narrowed to nodes. Base UI also accepts a function there, to\n// hand the sheet a payload passed by whichever trigger opened it, and that\n// form cannot be wrapped in a context provider without calling it first —\n// which would be doing Base UI's job with none of its state. Nothing in this\n// component needs the payload, so the narrower type says so rather than\n// leaving a signature that type-checks and then fails to render.\ntype SheetProps = Omit<BaseUIDialogRootProps, 'children'> & {\n children?: ReactNode;\n /**\n * Panel width on the side-sheet presentation: `sm` 320px, `md` 400px.\n * Ignored below the medium breakpoint, where the sheet is full width.\n * @default 'md'\n */\n size?: SheetSize;\n};\n\n/**\n * A modal panel that arrives from the edge of the screen — a side sheet on a\n * wide viewport, a bottom sheet on a narrow one. Open state is Base UI's:\n * pass `open` with `onOpenChange` to control it, or `defaultOpen` to let it\n * keep its own.\n *\n * Composed rather than configured by props, because a sheet's header, body,\n * and footer all take arbitrary content — the parts are `Sheet.Trigger`,\n * `Sheet.Content`, `Sheet.Header`, `Sheet.Title`, `Sheet.Body`,\n * `Sheet.Footer`, and `Sheet.Close`.\n */\nfunction Sheet({\n children,\n size = 'md',\n ...props\n}: SheetProps) {\n return <BaseUIDialog.Root {...props}>\n <SheetSizeContext value={size}>{children}</SheetSizeContext>\n </BaseUIDialog.Root>;\n}\nfunction SheetBody(props: HTMLAttributes<HTMLDivElement>) {\n return <div {...props} {...mergeStyles({\n className: \"x9f619 x78zum5 xdt5ytf x1iyjqo2 xxj4525 x1odjw0f xgc26li\"\n }, props)} />;\n}\n\n/**\n * Closes the sheet when pressed. Carries no styling of its own, so give it\n * the control it should be through `render` — an `IconButton` in the header,\n * a `Button` in the footer.\n */\nfunction SheetClose(props: BaseUIDialogCloseProps) {\n return <BaseUIDialog.Close {...props} />;\n}\n\n/**\n * The panel itself, and the scrim behind it. Everything the sheet shows goes\n * in here; `Sheet.Trigger` stays outside it, since the trigger lives in the\n * page while this is portalled out to the end of the body.\n */\nfunction SheetContent({\n children,\n container,\n ...props\n}: SheetContentProps) {\n const size = useContext(SheetSizeContext);\n return <BaseUIDialog.Portal container={container}>\n <BaseUIDialog.Backdrop className=\"x1vhuh8u xqcmdr3 x1yujl0p x1iqbvzf x10a8y8t xixxii4\" />\n <BaseUIDialog.Popup {...props} {...mergeStatefulStyles(stylex.props(styles.content, styles[size]), props)}>\n {children}\n </BaseUIDialog.Popup>\n </BaseUIDialog.Portal>;\n}\nfunction SheetFooter(props: HTMLAttributes<HTMLDivElement>) {\n return <div {...props} {...mergeStyles({\n className: \"x12smttz x13fuv20 x178xt8z x9f619 x78zum5 x2lah0s x126z3so x13a6bvl x1uvvd8r x790zyz\"\n }, props)} />;\n}\nfunction SheetHeader(props: HTMLAttributes<HTMLDivElement>) {\n return <div {...props} {...mergeStyles({\n className: \"x6s0dn4 x1j6faob x1q0q8m5 xso031l x9f619 x78zum5 x2lah0s x1gka490 x1qughib x1cmllll x790zyz\"\n }, props)} />;\n}\n\n/**\n * Names the sheet. Rendered through Base UI's title part, which is what\n * points the dialog's `aria-labelledby` at it — a sheet without one announces\n * itself as an unnamed dialog.\n */\nfunction SheetTitle(props: BaseUIDialogTitleProps) {\n return <BaseUIDialog.Title {...props} {...mergeStatefulStyles({\n className: \"x9f619 x139gbkf xdy5w5q xete2z3 x14ijtet xug9e1u x2divse x1ghz6dp\"\n }, props)} />;\n}\n\n/**\n * Opens the sheet when pressed. Unstyled like `Sheet.Close`, so pass the\n * control through `render`.\n */\nfunction SheetTrigger(props: BaseUIDialogTriggerProps) {\n return <BaseUIDialog.Trigger {...props} />;\n}\nSheet.Body = SheetBody;\nSheet.Close = SheetClose;\nSheet.Content = SheetContent;\nSheet.Footer = SheetFooter;\nSheet.Header = SheetHeader;\nSheet.Title = SheetTitle;\nSheet.Trigger = SheetTrigger;\ntype SheetCloseProps = BaseUIDialogCloseProps;\ntype SheetContentProps = BaseUIDialogPopupProps & {\n /**\n * Where to portal the panel and scrim. Defaults to the end of `<body>`,\n * which is right for an app that sets its StyleX theme on `:root`. An app\n * that scopes the theme to a subtree has to point this at an element inside\n * it, or the sheet renders outside the theme and falls back to the tokens'\n * `prefers-color-scheme` default.\n */\n container?: BaseUIDialogPortalProps['container'];\n};\ntype SheetTitleProps = BaseUIDialogTitleProps;\ntype SheetTriggerProps = BaseUIDialogTriggerProps;\nexport type { SheetCloseProps, SheetContentProps, SheetProps, SheetSize, SheetTitleProps, SheetTriggerProps };\nexport default Sheet;"],"mappings":";;;;;;;AAwBA,MAAM,SAAS;CACb,UAAU;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,MAAM;EACJ,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,SAAS;EACP,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;EACP,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,QAAQ;EACN,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;EACP,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,QAAQ;EACN,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;EACP,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,IAAI;EACF,QAAQ;EACR,OAAO;CACT;CACA,IAAI;EACF,QAAQ;EACR,OAAO;CACT;CACA,OAAO;EACL,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;AACF;AAMA,MAAM,mBAAmB,cAAyB,IAAI;;;;;;;;;;;;AA6BtD,SAAS,MAAM,EACb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CAAA,IAAA;CAAA,IAAA,EAAA,OAAA,SAAA,EAAA,OAAA,IAAA;EAFF,KAAA,oBAAA,OAAA;GAEM,GAFG;GAAK,GAAM;EAElB,CAAA;EAAI,EAAA,KAAA;EAAA,EAAA,KAAA;EAAA,EAAA,KAAA;CAAA,OAAA,KAAA,EAAA;CAAA,OAFN;AAEM;;;;;;AAQf,SAAA,WAAA,OAAA;CAAA,MAAA,IAAA,EAAA,CAAA;CAAA,IAAA;CAAA,IAAA,EAAA,OAAA,OAAA;EAC4C,KAAA,oBAAoB,EAAA,WACjD,oEACb,GAAG,KAAK;EAAC,EAAA,KAAA;EAAA,EAAA,KAAA;CAAA,OAAA,KAAA,EAAA;CAAA,IAAA;CAAA,IAAA,EAAA,OAAA,SAAA,EAAA,OAAA,IAAA;EAFF,KAAA,oBAAA,OAAA,OAAA;GAAA,GAAwB;GAAK,GAAM;EAEjC,CAAA;EAAI,EAAA,KAAA;EAAA,EAAA,KAAA;EAAA,EAAA,KAAA;CAAA,OAAA,KAAA,EAAA;CAAA,OAFN;AAEM;;;;;AAOf,SAAA,aAAA,OAAA;CAAA,MAAA,IAAA,EAAA,CAAA;CAAA,IAAA;CAAA,IAAA,EAAA,OAAA,OAAA;EACS,KAAA,oBAAA,OAAA,SAAA,EAAA,GAA0B,MAAK,CAAA;EAAI,EAAA,KAAA;EAAA,EAAA,KAAA;CAAA,OAAA,KAAA,EAAA;CAAA,OAAnC;AAAmC;AAE5C,MAAM,OAAO;AACb,MAAM,QAAQ;AACd,MAAM,UAAU;AAChB,MAAM,SAAS;AACf,MAAM,SAAS;AACf,MAAM,QAAQ;AACd,MAAM,UAAU"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { mergeStyles } from "../../styles/merge.js";
|
|
1
2
|
import { useRender } from "@base-ui/react/use-render";
|
|
2
3
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
4
|
import { c } from "react/compiler-runtime";
|
|
@@ -16,77 +17,84 @@ import { c } from "react/compiler-runtime";
|
|
|
16
17
|
* screen.
|
|
17
18
|
*/
|
|
18
19
|
function SupportingPane(t0) {
|
|
19
|
-
const $ = c(
|
|
20
|
-
let main;
|
|
21
|
-
let props;
|
|
20
|
+
const $ = c(22);
|
|
22
21
|
let render;
|
|
23
|
-
let supporting;
|
|
24
|
-
if ($[0] !== t0) {
|
|
25
|
-
({main, render, supporting, ...props} = t0);
|
|
26
|
-
$[0] = t0;
|
|
27
|
-
$[1] = main;
|
|
28
|
-
$[2] = props;
|
|
29
|
-
$[3] = render;
|
|
30
|
-
$[4] = supporting;
|
|
31
|
-
} else {
|
|
32
|
-
main = $[1];
|
|
33
|
-
props = $[2];
|
|
34
|
-
render = $[3];
|
|
35
|
-
supporting = $[4];
|
|
36
|
-
}
|
|
37
22
|
let t1;
|
|
38
|
-
if ($[5] !== main) {
|
|
39
|
-
t1 = /* @__PURE__ */ jsx("div", {
|
|
40
|
-
className: "xeuugli",
|
|
41
|
-
children: main
|
|
42
|
-
});
|
|
43
|
-
$[5] = main;
|
|
44
|
-
$[6] = t1;
|
|
45
|
-
} else t1 = $[6];
|
|
46
23
|
let t2;
|
|
47
|
-
if ($[7] !== supporting) {
|
|
48
|
-
t2 = /* @__PURE__ */ jsx("div", {
|
|
49
|
-
className: "xeuugli",
|
|
50
|
-
children: supporting
|
|
51
|
-
});
|
|
52
|
-
$[7] = supporting;
|
|
53
|
-
$[8] = t2;
|
|
54
|
-
} else t2 = $[8];
|
|
55
24
|
let t3;
|
|
56
|
-
if ($[9] !== t1 || $[10] !== t2) {
|
|
57
|
-
t3 = /* @__PURE__ */ jsxs(Fragment, { children: [t1, t2] });
|
|
58
|
-
$[9] = t1;
|
|
59
|
-
$[10] = t2;
|
|
60
|
-
$[11] = t3;
|
|
61
|
-
} else t3 = $[11];
|
|
62
25
|
let t4;
|
|
63
|
-
if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
|
|
64
|
-
t4 = { className: "xrvj5dj xj2l1yv x1mkdm3x xj1h9sb x1bg1yrb" };
|
|
65
|
-
$[12] = t4;
|
|
66
|
-
} else t4 = $[12];
|
|
67
26
|
let t5;
|
|
68
|
-
if ($[
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
$[
|
|
76
|
-
|
|
77
|
-
|
|
27
|
+
if ($[0] !== t0) {
|
|
28
|
+
const { main, render: t6, supporting, ...props } = t0;
|
|
29
|
+
render = t6;
|
|
30
|
+
t5 = useRender;
|
|
31
|
+
t4 = "div";
|
|
32
|
+
t1 = props;
|
|
33
|
+
let t7;
|
|
34
|
+
if ($[7] !== main) {
|
|
35
|
+
t7 = /* @__PURE__ */ jsx("div", {
|
|
36
|
+
className: "x9f619 xeuugli",
|
|
37
|
+
children: main
|
|
38
|
+
});
|
|
39
|
+
$[7] = main;
|
|
40
|
+
$[8] = t7;
|
|
41
|
+
} else t7 = $[8];
|
|
42
|
+
let t8;
|
|
43
|
+
if ($[9] !== supporting) {
|
|
44
|
+
t8 = /* @__PURE__ */ jsx("div", {
|
|
45
|
+
className: "x9f619 xeuugli",
|
|
46
|
+
children: supporting
|
|
47
|
+
});
|
|
48
|
+
$[9] = supporting;
|
|
49
|
+
$[10] = t8;
|
|
50
|
+
} else t8 = $[10];
|
|
51
|
+
if ($[11] !== t7 || $[12] !== t8) {
|
|
52
|
+
t2 = /* @__PURE__ */ jsxs(Fragment, { children: [t7, t8] });
|
|
53
|
+
$[11] = t7;
|
|
54
|
+
$[12] = t8;
|
|
55
|
+
$[13] = t2;
|
|
56
|
+
} else t2 = $[13];
|
|
57
|
+
t3 = mergeStyles({ className: "x9f619 xrvj5dj xj2l1yv x1mkdm3x xj1h9sb x1bg1yrb" }, props);
|
|
58
|
+
$[0] = t0;
|
|
59
|
+
$[1] = render;
|
|
60
|
+
$[2] = t1;
|
|
61
|
+
$[3] = t2;
|
|
62
|
+
$[4] = t3;
|
|
63
|
+
$[5] = t4;
|
|
64
|
+
$[6] = t5;
|
|
65
|
+
} else {
|
|
66
|
+
render = $[1];
|
|
67
|
+
t1 = $[2];
|
|
68
|
+
t2 = $[3];
|
|
69
|
+
t3 = $[4];
|
|
70
|
+
t4 = $[5];
|
|
71
|
+
t5 = $[6];
|
|
72
|
+
}
|
|
78
73
|
let t6;
|
|
79
|
-
if ($[
|
|
74
|
+
if ($[14] !== t1 || $[15] !== t2 || $[16] !== t3) {
|
|
80
75
|
t6 = {
|
|
81
|
-
|
|
82
|
-
|
|
76
|
+
...t1,
|
|
77
|
+
children: t2,
|
|
78
|
+
...t3
|
|
79
|
+
};
|
|
80
|
+
$[14] = t1;
|
|
81
|
+
$[15] = t2;
|
|
82
|
+
$[16] = t3;
|
|
83
|
+
$[17] = t6;
|
|
84
|
+
} else t6 = $[17];
|
|
85
|
+
let t7;
|
|
86
|
+
if ($[18] !== render || $[19] !== t4 || $[20] !== t6) {
|
|
87
|
+
t7 = {
|
|
88
|
+
defaultTagName: t4,
|
|
89
|
+
props: t6,
|
|
83
90
|
render
|
|
84
91
|
};
|
|
85
|
-
$[
|
|
86
|
-
$[
|
|
87
|
-
$[
|
|
88
|
-
|
|
89
|
-
|
|
92
|
+
$[18] = render;
|
|
93
|
+
$[19] = t4;
|
|
94
|
+
$[20] = t6;
|
|
95
|
+
$[21] = t7;
|
|
96
|
+
} else t7 = $[21];
|
|
97
|
+
return t5(t7);
|
|
90
98
|
}
|
|
91
99
|
//#endregion
|
|
92
100
|
export { SupportingPane as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["main","supporting"],"sources":["../../../src/components/supporting-pane/index.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport { useRender } from '@base-ui/react/use-render';\nimport * as stylex from '@stylexjs/stylex';\nimport '../../tokens/design.tokens.stylex';\nimport { media, spacing } from '../../tokens/design.tokens.stylex';\n\n// One of Material 3's canonical layouts. The supporting pane holds content\n// that only means anything next to the main pane — reviewer comments, related\n// items, a tool panel — which is what separates it from list-detail, where\n// the second pane stands on its own.\n//\n// M3 gives this layout three shapes across the breakpoints, and all three are\n// reachable in CSS because none of them depends on what the reader selected:\n// stacked at compact, an even split at medium, two thirds to one third from\n// expanded up. Stacking is M3's \"reflow\" strategy, where the supporting pane\n// moves under the main one rather than being dismissed. The spec's other\n// compact option is a bottom sheet, which is a different component's job —\n// reach for Sheet at the call site when the supporting content should be\n// summoned rather than scrolled to.\n//\n\ntype SupportingPaneProps = Omit<useRender.ComponentProps<'div'>, 'children'> & {\n /** The primary content. Takes two thirds of the width from expanded up. */\n main?: ReactNode;\n /**\n * Content that only means something beside `main`. Sits below it at compact,\n * and beside it from medium up.\n */\n supporting?: ReactNode;\n};\n\n/**\n * Material 3's supporting pane layout: a main pane and a companion that\n * reflows underneath it when there is no room beside it.\n *\n * Layout only — neither pane paints a surface or a border of its own, so what\n * goes in them is composed at the call site out of Cards, lists, or plain\n * content. `render` swaps the container's element, for a layout that should\n * be a `<main>` rather than a `<div>`.\n *\n * The panes are written to the DOM in the order they are shown, which is what\n * M3 asks of co-planar panes: focus order has to match the arrangement on\n * screen.\n */\nfunction SupportingPane({\n main,\n render,\n supporting,\n ...props\n}: SupportingPaneProps) {\n return useRender({\n defaultTagName: 'div',\n props: {\n ...props,\n children: <>\n <div className=\"xeuugli\">{main}</div>\n <div className=\"xeuugli\">{supporting}</div>\n </>,\n ...{\n className: \"xrvj5dj xj2l1yv x1mkdm3x xj1h9sb x1bg1yrb\"\n }\n },\n render\n });\n}\nexport type { SupportingPaneProps };\nexport default SupportingPane;"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":["useRender","props","main","supporting"],"sources":["../../../src/components/supporting-pane/index.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport { useRender } from '@base-ui/react/use-render';\nimport * as stylex from '@stylexjs/stylex';\nimport { mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { media, spacing } from '../../tokens/design.tokens.stylex';\n\n// One of Material 3's canonical layouts. The supporting pane holds content\n// that only means anything next to the main pane — reviewer comments, related\n// items, a tool panel — which is what separates it from list-detail, where\n// the second pane stands on its own.\n//\n// M3 gives this layout three shapes across the breakpoints, and all three are\n// reachable in CSS because none of them depends on what the reader selected:\n// stacked at compact, an even split at medium, two thirds to one third from\n// expanded up. Stacking is M3's \"reflow\" strategy, where the supporting pane\n// moves under the main one rather than being dismissed. The spec's other\n// compact option is a bottom sheet, which is a different component's job —\n// reach for Sheet at the call site when the supporting content should be\n// summoned rather than scrolled to.\n//\n\ntype SupportingPaneProps = Omit<useRender.ComponentProps<'div'>, 'children'> & {\n /** The primary content. Takes two thirds of the width from expanded up. */\n main?: ReactNode;\n /**\n * Content that only means something beside `main`. Sits below it at compact,\n * and beside it from medium up.\n */\n supporting?: ReactNode;\n};\n\n/**\n * Material 3's supporting pane layout: a main pane and a companion that\n * reflows underneath it when there is no room beside it.\n *\n * Layout only — neither pane paints a surface or a border of its own, so what\n * goes in them is composed at the call site out of Cards, lists, or plain\n * content. `render` swaps the container's element, for a layout that should\n * be a `<main>` rather than a `<div>`.\n *\n * The panes are written to the DOM in the order they are shown, which is what\n * M3 asks of co-planar panes: focus order has to match the arrangement on\n * screen.\n */\nfunction SupportingPane({\n main,\n render,\n supporting,\n ...props\n}: SupportingPaneProps) {\n return useRender({\n defaultTagName: 'div',\n props: {\n ...props,\n children: <>\n <div className=\"x9f619 xeuugli\">{main}</div>\n <div className=\"x9f619 xeuugli\">{supporting}</div>\n </>,\n ...mergeStyles({\n className: \"x9f619 xrvj5dj xj2l1yv x1mkdm3x xj1h9sb x1bg1yrb\"\n }, props)\n },\n render\n });\n}\nexport type { SupportingPaneProps };\nexport default SupportingPane;"],"mappings":";;;;;;;;;;;;;;;;;;AA6CA,SAAA,eAAA,IAAA;CAAA,MAAA,IAAA,EAAA,EAAA;CAAA,IAAA;CAAA,IAAA;CAAA,IAAA;CAAA,IAAA;CAAA,IAAA;CAAA,IAAA;CAAA,IAAA,EAAA,OAA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AAA,IAAA;EAXc,KAAA;GAAA,gBACC;GAAK,OACd;GASN;EAEH;EAAC,EAAA,MAAA;EAAA,EAAA,MAAA;EAAA,EAAA,MAAA;EAAA,EAAA,MAAA;CAAA,OAAA,KAAA,EAAA;CAAA,OAbMD,GAAU,EAahB;AAAC"}
|
|
@@ -1,15 +1,8 @@
|
|
|
1
|
+
import { mergeStatefulStyles } from "../../styles/merge.js";
|
|
1
2
|
import { jsx } from "react/jsx-runtime";
|
|
2
3
|
import { c } from "react/compiler-runtime";
|
|
3
4
|
import { Tabs } from "@base-ui/react/tabs";
|
|
4
5
|
//#region src/components/tabs/index.tsx
|
|
5
|
-
function tabClassName(state) {
|
|
6
|
-
return {
|
|
7
|
-
0: { className: "x6s0dn4 x10w6t97 x1xdvaa9 xc342km x1ypdohk x3nfvp2 x2lah0s xkknnkr x14zspaw x1v9cpvo xl56j7k x155f00i x1lz68p4 xrgy624 x1hl8ikr x9v5kkp x1t137rt x1de99jn xt970qd x18fpw6u x1qno0dh xs2xxs2 xpc4ca7 x1p2om7n xjbqb8w x1w5n3ug" },
|
|
8
|
-
2: { className: "x6s0dn4 x10w6t97 x1xdvaa9 xc342km x1ypdohk x3nfvp2 x2lah0s xkknnkr x14zspaw x1v9cpvo xl56j7k x155f00i x1lz68p4 xrgy624 x1hl8ikr x9v5kkp x1t137rt x1de99jn xt970qd x18fpw6u x1qno0dh xs2xxs2 xpc4ca7 x1hei0q8 xp89om9 xscdzaa" },
|
|
9
|
-
1: { className: "x6s0dn4 x10w6t97 x1xdvaa9 xc342km x3nfvp2 x2lah0s xkknnkr x14zspaw x1v9cpvo xl56j7k x155f00i x1lz68p4 xrgy624 x1hl8ikr x9v5kkp x1t137rt x1de99jn xt970qd x18fpw6u x1qno0dh xs2xxs2 xpc4ca7 xjbqb8w x1xj74d8 x1h6gzvc" },
|
|
10
|
-
3: { className: "x6s0dn4 x10w6t97 x1xdvaa9 xc342km x3nfvp2 x2lah0s xkknnkr x14zspaw x1v9cpvo xl56j7k x155f00i x1lz68p4 xrgy624 x1hl8ikr x9v5kkp x1t137rt x1de99jn xt970qd x18fpw6u x1qno0dh xs2xxs2 xpc4ca7 xjbqb8w x1xj74d8 x1h6gzvc" }
|
|
11
|
-
}[!!state.active << 1 | !!state.disabled << 0].className;
|
|
12
|
-
}
|
|
13
6
|
/**
|
|
14
7
|
* A tab strip and its panels. Selection is Base UI's `value`: pass `value`
|
|
15
8
|
* with `onValueChange` to control it, or `defaultValue` to let it keep its
|
|
@@ -30,43 +23,72 @@ function Tabs$1(props) {
|
|
|
30
23
|
return t0;
|
|
31
24
|
}
|
|
32
25
|
function TabsList(props) {
|
|
33
|
-
const $ = c(
|
|
26
|
+
const $ = c(5);
|
|
34
27
|
let t0;
|
|
35
28
|
if ($[0] !== props) {
|
|
36
|
-
t0 =
|
|
37
|
-
...props,
|
|
38
|
-
className: "x78zum5 x14qo01y"
|
|
39
|
-
});
|
|
29
|
+
t0 = mergeStatefulStyles({ className: "x9f619 x78zum5 x14qo01y" }, props);
|
|
40
30
|
$[0] = props;
|
|
41
31
|
$[1] = t0;
|
|
42
32
|
} else t0 = $[1];
|
|
43
|
-
|
|
33
|
+
let t1;
|
|
34
|
+
if ($[2] !== props || $[3] !== t0) {
|
|
35
|
+
t1 = /* @__PURE__ */ jsx(Tabs.List, {
|
|
36
|
+
...props,
|
|
37
|
+
...t0
|
|
38
|
+
});
|
|
39
|
+
$[2] = props;
|
|
40
|
+
$[3] = t0;
|
|
41
|
+
$[4] = t1;
|
|
42
|
+
} else t1 = $[4];
|
|
43
|
+
return t1;
|
|
44
44
|
}
|
|
45
45
|
function TabsPanel(props) {
|
|
46
|
-
const $ = c(
|
|
46
|
+
const $ = c(5);
|
|
47
47
|
let t0;
|
|
48
48
|
if ($[0] !== props) {
|
|
49
|
-
t0 =
|
|
50
|
-
...props,
|
|
51
|
-
className: "xrgy624 x1hl8ikr x9v5kkp x1t137rt x1de99jn"
|
|
52
|
-
});
|
|
49
|
+
t0 = mergeStatefulStyles({ className: "x9f619 xrgy624 x1hl8ikr x9v5kkp x1t137rt x1de99jn" }, props);
|
|
53
50
|
$[0] = props;
|
|
54
51
|
$[1] = t0;
|
|
55
52
|
} else t0 = $[1];
|
|
56
|
-
|
|
53
|
+
let t1;
|
|
54
|
+
if ($[2] !== props || $[3] !== t0) {
|
|
55
|
+
t1 = /* @__PURE__ */ jsx(Tabs.Panel, {
|
|
56
|
+
...props,
|
|
57
|
+
...t0
|
|
58
|
+
});
|
|
59
|
+
$[2] = props;
|
|
60
|
+
$[3] = t0;
|
|
61
|
+
$[4] = t1;
|
|
62
|
+
} else t1 = $[4];
|
|
63
|
+
return t1;
|
|
57
64
|
}
|
|
58
65
|
function TabsTab(props) {
|
|
59
|
-
const $ = c(
|
|
66
|
+
const $ = c(5);
|
|
60
67
|
let t0;
|
|
61
68
|
if ($[0] !== props) {
|
|
62
|
-
t0 =
|
|
63
|
-
...props,
|
|
64
|
-
className: tabClassName
|
|
65
|
-
});
|
|
69
|
+
t0 = mergeStatefulStyles(tabStyles, props);
|
|
66
70
|
$[0] = props;
|
|
67
71
|
$[1] = t0;
|
|
68
72
|
} else t0 = $[1];
|
|
69
|
-
|
|
73
|
+
let t1;
|
|
74
|
+
if ($[2] !== props || $[3] !== t0) {
|
|
75
|
+
t1 = /* @__PURE__ */ jsx(Tabs.Tab, {
|
|
76
|
+
...props,
|
|
77
|
+
...t0
|
|
78
|
+
});
|
|
79
|
+
$[2] = props;
|
|
80
|
+
$[3] = t0;
|
|
81
|
+
$[4] = t1;
|
|
82
|
+
} else t1 = $[4];
|
|
83
|
+
return t1;
|
|
84
|
+
}
|
|
85
|
+
function tabStyles(state) {
|
|
86
|
+
return {
|
|
87
|
+
0: { className: "x6s0dn4 x10w6t97 x1xdvaa9 xc342km x9f619 x1ypdohk x3nfvp2 x2lah0s xkknnkr x14zspaw x1v9cpvo xl56j7k x155f00i x1lz68p4 xrgy624 x1hl8ikr x9v5kkp x1t137rt x1de99jn xt970qd x18fpw6u x1qno0dh xs2xxs2 xpc4ca7 x1p2om7n xjbqb8w x1w5n3ug" },
|
|
88
|
+
2: { className: "x6s0dn4 x10w6t97 x1xdvaa9 xc342km x9f619 x1ypdohk x3nfvp2 x2lah0s xkknnkr x14zspaw x1v9cpvo xl56j7k x155f00i x1lz68p4 xrgy624 x1hl8ikr x9v5kkp x1t137rt x1de99jn xt970qd x18fpw6u x1qno0dh xs2xxs2 xpc4ca7 x1hei0q8 xp89om9 xscdzaa" },
|
|
89
|
+
1: { className: "x6s0dn4 x10w6t97 x1xdvaa9 xc342km x9f619 x3nfvp2 x2lah0s xkknnkr x14zspaw x1v9cpvo xl56j7k x155f00i x1lz68p4 xrgy624 x1hl8ikr x9v5kkp x1t137rt x1de99jn xt970qd x18fpw6u x1qno0dh xs2xxs2 xpc4ca7 xjbqb8w x1xj74d8 x1h6gzvc" },
|
|
90
|
+
3: { className: "x6s0dn4 x10w6t97 x1xdvaa9 xc342km x9f619 x3nfvp2 x2lah0s xkknnkr x14zspaw x1v9cpvo xl56j7k x155f00i x1lz68p4 xrgy624 x1hl8ikr x9v5kkp x1t137rt x1de99jn xt970qd x18fpw6u x1qno0dh xs2xxs2 xpc4ca7 xjbqb8w x1xj74d8 x1h6gzvc" }
|
|
91
|
+
}[!!state.active << 1 | !!state.disabled << 0];
|
|
70
92
|
}
|
|
71
93
|
Tabs$1.List = TabsList;
|
|
72
94
|
Tabs$1.Panel = TabsPanel;
|