@kanso-labs/kanso-ui 0.8.1 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +66 -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/container/index.d.ts +36 -0
- package/dist/components/container/index.js +49 -0
- package/dist/components/container/index.js.map +1 -0
- 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/index.d.ts +3 -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/stack/index.d.ts +60 -0
- package/dist/components/stack/index.js +131 -0
- package/dist/components/stack/index.js.map +1 -0
- 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 +4 -1
- package/dist/index.js +4 -1
- 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/dist/{assets/stylex.css → styles.css} +61 -0
- package/package.json +2 -1
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { props } from "../../node_modules/@stylexjs/stylex/lib/es/stylex.js";
|
|
2
|
+
import { mergeStyles } from "../../styles/merge.js";
|
|
3
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
4
|
+
//#region src/components/stack/index.tsx
|
|
5
|
+
const alignments = {
|
|
6
|
+
baseline: {
|
|
7
|
+
kGNEyG: "x1pha0wt",
|
|
8
|
+
$$css: true
|
|
9
|
+
},
|
|
10
|
+
center: {
|
|
11
|
+
kGNEyG: "x6s0dn4",
|
|
12
|
+
$$css: true
|
|
13
|
+
},
|
|
14
|
+
end: {
|
|
15
|
+
kGNEyG: "xuk3077",
|
|
16
|
+
$$css: true
|
|
17
|
+
},
|
|
18
|
+
start: {
|
|
19
|
+
kGNEyG: "x1cy8zhl",
|
|
20
|
+
$$css: true
|
|
21
|
+
},
|
|
22
|
+
stretch: {
|
|
23
|
+
kGNEyG: "x1qjc9v5",
|
|
24
|
+
$$css: true
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
const gaps = {
|
|
28
|
+
lg: {
|
|
29
|
+
kOIVth: "xxj4525",
|
|
30
|
+
$$css: true
|
|
31
|
+
},
|
|
32
|
+
md: {
|
|
33
|
+
kOIVth: "x1gka490",
|
|
34
|
+
$$css: true
|
|
35
|
+
},
|
|
36
|
+
none: {
|
|
37
|
+
kOIVth: "xxhr3t",
|
|
38
|
+
$$css: true
|
|
39
|
+
},
|
|
40
|
+
sm: {
|
|
41
|
+
kOIVth: "x126z3so",
|
|
42
|
+
$$css: true
|
|
43
|
+
},
|
|
44
|
+
xl: {
|
|
45
|
+
kOIVth: "xj2l1yv",
|
|
46
|
+
$$css: true
|
|
47
|
+
},
|
|
48
|
+
xs: {
|
|
49
|
+
kOIVth: "xzoy561",
|
|
50
|
+
$$css: true
|
|
51
|
+
},
|
|
52
|
+
xxl: {
|
|
53
|
+
kOIVth: "xghv2kt",
|
|
54
|
+
$$css: true
|
|
55
|
+
},
|
|
56
|
+
xxs: {
|
|
57
|
+
kOIVth: "x14qo01y",
|
|
58
|
+
$$css: true
|
|
59
|
+
},
|
|
60
|
+
xxxl: {
|
|
61
|
+
kOIVth: "xvm9ira",
|
|
62
|
+
$$css: true
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
const justifications = {
|
|
66
|
+
around: {
|
|
67
|
+
kjj79g: "x1l1ennw",
|
|
68
|
+
$$css: true
|
|
69
|
+
},
|
|
70
|
+
between: {
|
|
71
|
+
kjj79g: "x1qughib",
|
|
72
|
+
$$css: true
|
|
73
|
+
},
|
|
74
|
+
center: {
|
|
75
|
+
kjj79g: "xl56j7k",
|
|
76
|
+
$$css: true
|
|
77
|
+
},
|
|
78
|
+
end: {
|
|
79
|
+
kjj79g: "x13a6bvl",
|
|
80
|
+
$$css: true
|
|
81
|
+
},
|
|
82
|
+
start: {
|
|
83
|
+
kjj79g: "x1nhvcw1",
|
|
84
|
+
$$css: true
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
const styles = {
|
|
88
|
+
base: {
|
|
89
|
+
kB7OPa: "x9f619",
|
|
90
|
+
k1xSpc: "x78zum5",
|
|
91
|
+
$$css: true
|
|
92
|
+
},
|
|
93
|
+
column: {
|
|
94
|
+
kXwgrk: "xdt5ytf",
|
|
95
|
+
$$css: true
|
|
96
|
+
},
|
|
97
|
+
row: {
|
|
98
|
+
kXwgrk: "x1q0g3np",
|
|
99
|
+
$$css: true
|
|
100
|
+
},
|
|
101
|
+
wrap: {
|
|
102
|
+
kwnvtZ: "x1a02dak",
|
|
103
|
+
$$css: true
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
/**
|
|
107
|
+
* A row or a column of children with one gap between them, taken from the
|
|
108
|
+
* spacing scale.
|
|
109
|
+
*
|
|
110
|
+
* Layout only — it paints no surface and wraps no child, so each child is a
|
|
111
|
+
* flex item exactly as it was written. It is the answer to spacing a group of
|
|
112
|
+
* things, which is why no component here carries a margin of its own: the
|
|
113
|
+
* space between two things belongs to whatever holds both of them.
|
|
114
|
+
*
|
|
115
|
+
* `render` swaps the element, for a stack that should be a `<ul>`, a `<nav>`,
|
|
116
|
+
* or a `<section>` rather than a `<div>`.
|
|
117
|
+
*/
|
|
118
|
+
function Stack({ align, direction = "column", gap = "md", justify, render, wrap = false, ...props$1 }) {
|
|
119
|
+
return useRender({
|
|
120
|
+
defaultTagName: "div",
|
|
121
|
+
props: {
|
|
122
|
+
...props$1,
|
|
123
|
+
...mergeStyles(props(styles.base, styles[direction], gaps[gap], align !== void 0 && alignments[align], justify !== void 0 && justifications[justify], wrap && styles.wrap), props$1)
|
|
124
|
+
},
|
|
125
|
+
render
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
//#endregion
|
|
129
|
+
export { Stack as default };
|
|
130
|
+
|
|
131
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/stack/index.tsx"],"sourcesContent":["import { useRender } from '@base-ui/react/use-render';\nimport * as stylex from '@stylexjs/stylex';\nimport { mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { spacing } from '../../tokens/design.tokens.stylex';\n\n// Short names rather than the CSS values they map to, so a call site reads\n// `align=\"start\"` instead of `align=\"flex-start\"`. A lookup is unavoidable\n// either way — `alignItems` takes `flex-start` and `justifyContent` takes\n// `space-between`, neither of which is a word anyone wants in a prop.\nconst alignments = {\n baseline: {\n kGNEyG: \"x1pha0wt\",\n $$css: true\n },\n center: {\n kGNEyG: \"x6s0dn4\",\n $$css: true\n },\n end: {\n kGNEyG: \"xuk3077\",\n $$css: true\n },\n start: {\n kGNEyG: \"x1cy8zhl\",\n $$css: true\n },\n stretch: {\n kGNEyG: \"x1qjc9v5\",\n $$css: true\n }\n};\n\n// One key per step of the spacing scale, named exactly as the token group\n// names it, so `gaps[gap]` indexes straight off the prop with no lookup table\n// to keep in sync — the same arrangement Text's type scale uses.\n//\n// `none` is the one key with no token behind it, and deliberately so: zero is\n// the absence of a spacing decision rather than a step of the scale, so there\n// is nothing for the scale to name. It exists because a stack that only wants\n// the direction and the alignment is otherwise a plain flex container written\n// out by hand.\nconst gaps = {\n lg: {\n kOIVth: \"xxj4525\",\n $$css: true\n },\n md: {\n kOIVth: \"x1gka490\",\n $$css: true\n },\n none: {\n kOIVth: \"xxhr3t\",\n $$css: true\n },\n sm: {\n kOIVth: \"x126z3so\",\n $$css: true\n },\n xl: {\n kOIVth: \"xj2l1yv\",\n $$css: true\n },\n xs: {\n kOIVth: \"xzoy561\",\n $$css: true\n },\n xxl: {\n kOIVth: \"xghv2kt\",\n $$css: true\n },\n xxs: {\n kOIVth: \"x14qo01y\",\n $$css: true\n },\n xxxl: {\n kOIVth: \"xvm9ira\",\n $$css: true\n }\n};\nconst justifications = {\n around: {\n kjj79g: \"x1l1ennw\",\n $$css: true\n },\n between: {\n kjj79g: \"x1qughib\",\n $$css: true\n },\n center: {\n kjj79g: \"xl56j7k\",\n $$css: true\n },\n end: {\n kjj79g: \"x13a6bvl\",\n $$css: true\n },\n start: {\n kjj79g: \"x1nhvcw1\",\n $$css: true\n }\n};\nconst styles = {\n base: {\n kB7OPa: \"x9f619\",\n k1xSpc: \"x78zum5\",\n $$css: true\n },\n column: {\n kXwgrk: \"xdt5ytf\",\n $$css: true\n },\n row: {\n kXwgrk: \"x1q0g3np\",\n $$css: true\n },\n wrap: {\n kwnvtZ: \"x1a02dak\",\n $$css: true\n }\n};\ntype StackAlign = 'baseline' | 'center' | 'end' | 'start' | 'stretch';\ntype StackGap = 'lg' | 'md' | 'none' | 'sm' | 'xl' | 'xs' | 'xxl' | 'xxs' | 'xxxl';\ntype StackJustify = 'around' | 'between' | 'center' | 'end' | 'start';\ntype StackProps = {\n /**\n * How the children line up across the stack: down the inline axis of a\n * column, down the block axis of a row. Left unset, they stretch, which is\n * what makes every card in a column the same width.\n *\n * `start` is what an inline-sized child needs in a column — a Badge or a\n * Chip spans the whole width otherwise.\n */\n align?: StackAlign;\n /**\n * Which way the children run.\n * @default 'column'\n */\n direction?: 'column' | 'row';\n /**\n * The space between children, as a step of the spacing scale. `none` closes\n * it entirely.\n *\n * Worth setting. The default is a middle step, and how much air a group of\n * things wants is the one thing a stack cannot work out for itself.\n * @default 'md'\n */\n gap?: StackGap;\n /**\n * How leftover space is distributed along the stack. Left unset, the\n * children sit at the start and the space collects after them.\n *\n * `between` is the one that puts a headline at one end of a row and its\n * actions at the other.\n */\n justify?: StackJustify;\n /**\n * Lets a row wrap onto further lines rather than overflowing. Has no effect\n * on a column, which has as many lines as it has children.\n * @default false\n */\n wrap?: boolean;\n} & useRender.ComponentProps<'div'>;\n\n/**\n * A row or a column of children with one gap between them, taken from the\n * spacing scale.\n *\n * Layout only — it paints no surface and wraps no child, so each child is a\n * flex item exactly as it was written. It is the answer to spacing a group of\n * things, which is why no component here carries a margin of its own: the\n * space between two things belongs to whatever holds both of them.\n *\n * `render` swaps the element, for a stack that should be a `<ul>`, a `<nav>`,\n * or a `<section>` rather than a `<div>`.\n */\nfunction Stack({\n align,\n direction = 'column',\n gap = 'md',\n justify,\n render,\n wrap = false,\n ...props\n}: StackProps) {\n return useRender({\n defaultTagName: 'div',\n props: {\n ...props,\n ...mergeStyles(stylex.props(styles.base, styles[direction], gaps[gap], align !== undefined && alignments[align], justify !== undefined && justifications[justify], wrap && styles.wrap), props)\n },\n render\n });\n}\nexport type { StackAlign, StackGap, StackJustify, StackProps };\nexport default Stack;"],"mappings":";;;;AAUA,MAAM,aAAa;CACjB,UAAU;EACR,QAAQ;EACR,OAAO;CACT;CACA,QAAQ;EACN,QAAQ;EACR,OAAO;CACT;CACA,KAAK;EACH,QAAQ;EACR,OAAO;CACT;CACA,OAAO;EACL,QAAQ;EACR,OAAO;CACT;CACA,SAAS;EACP,QAAQ;EACR,OAAO;CACT;AACF;AAWA,MAAM,OAAO;CACX,IAAI;EACF,QAAQ;EACR,OAAO;CACT;CACA,IAAI;EACF,QAAQ;EACR,OAAO;CACT;CACA,MAAM;EACJ,QAAQ;EACR,OAAO;CACT;CACA,IAAI;EACF,QAAQ;EACR,OAAO;CACT;CACA,IAAI;EACF,QAAQ;EACR,OAAO;CACT;CACA,IAAI;EACF,QAAQ;EACR,OAAO;CACT;CACA,KAAK;EACH,QAAQ;EACR,OAAO;CACT;CACA,KAAK;EACH,QAAQ;EACR,OAAO;CACT;CACA,MAAM;EACJ,QAAQ;EACR,OAAO;CACT;AACF;AACA,MAAM,iBAAiB;CACrB,QAAQ;EACN,QAAQ;EACR,OAAO;CACT;CACA,SAAS;EACP,QAAQ;EACR,OAAO;CACT;CACA,QAAQ;EACN,QAAQ;EACR,OAAO;CACT;CACA,KAAK;EACH,QAAQ;EACR,OAAO;CACT;CACA,OAAO;EACL,QAAQ;EACR,OAAO;CACT;AACF;AACA,MAAM,SAAS;CACb,MAAM;EACJ,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,QAAQ;EACN,QAAQ;EACR,OAAO;CACT;CACA,KAAK;EACH,QAAQ;EACR,OAAO;CACT;CACA,MAAM;EACJ,QAAQ;EACR,OAAO;CACT;AACF;;;;;;;;;;;;;AAwDA,SAAS,MAAM,EACb,OACA,YAAY,UACZ,MAAM,MACN,SACA,QACA,OAAO,OACP,GAAG,WACU;CACb,OAAO,UAAU;EACf,gBAAgB;EAChB,OAAO;GACL,GAAG;GACH,GAAG,YAAY,MAAa,OAAO,MAAM,OAAO,YAAY,KAAK,MAAM,UAAU,KAAA,KAAa,WAAW,QAAQ,YAAY,KAAA,KAAa,eAAe,UAAU,QAAQ,OAAO,IAAI,GAAG,OAAK;EAChM;EACA;CACF,CAAC;AACH"}
|
|
@@ -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,OAAA,IAAA;EAAwB,MAAA,EAAA,MAAA,QAAA,IAAA,YAAA,GAAA,UAAA;EAAA,SAAA;EAMfA,KAAA;EACW,KAAA;EAEXC,KAAA;EAAK,IAAA;EAAA,IAAA,EAAA,OAAA,MAAA;GAEJ,KAAA,oBAAA,OAAA;IAAe,WAAA;IAAkB,UAAA;GAAW,CAAA;GAAA,EAAA,KAAA;GAAA,EAAA,KAAA;EAAA,OAAA,KAAA,EAAA;EAAA,IAAA;EAAA,IAAA,EAAA,OAAA,YAAA;GAC5C,KAAA,oBAAA,OAAA;IAAe,WAAA;IAAkB,UAAA;GAAiB,CAAA;GAAA,EAAA,KAAA;GAAA,EAAA,MAAA;EAAA,OAAA,KAAA,EAAA;EAAA,IAAA,EAAA,QAAA,MAAA,EAAA,QAAA,IAAA;GAF5C,KAAA,qBAAA,UAAA,EAAA,UAAA,CACN,IACA,EAAkD,EAAA,CAAA;GACjD,EAAA,MAAA;GAAA,EAAA,MAAA;GAAA,EAAA,MAAA;EAAA,OAAA,KAAA,EAAA;EACF,KAAA,YAAY,EAAA,WACF,mDACb,GAAG,KAAK;EAAC,EAAA,KAAA;EAAA,EAAA,KAAA;EAAA,EAAA,KAAA;EAAA,EAAA,KAAA;EAAA,EAAA,KAAA;EAAA,EAAA,KAAA;EAAA,EAAA,KAAA;CAAA,OAAA;EAAA,SAAA,EAAA;EAAA,KAAA,EAAA;EAAA,KAAA,EAAA;EAAA,KAAA,EAAA;EAAA,KAAA,EAAA;EAAA,KAAA,EAAA;CAAA;CAAA,IAAA;CAAA,IAAA,EAAA,QAAA,MAAA,EAAA,QAAA,MAAA,EAAA,QAAA,IAAA;EARJ,KAAA;GAAA,GACFA;GAAK,UACE;GAGL,GACF;EAGL;EAAC,EAAA,MAAA;EAAA,EAAA,MAAA;EAAA,EAAA,MAAA;EAAA,EAAA,MAAA;CAAA,OAAA,KAAA,EAAA;CAAA,IAAA;CAAA,IAAA,EAAA,QAAA,UAAA,EAAA,QAAA,MAAA,EAAA,QAAA,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;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/tabs/index.tsx"],"sourcesContent":["import type { TabsListProps as BaseUITabsListProps, TabsPanelProps as BaseUITabsPanelProps, TabsRootProps as BaseUITabsRootProps, TabsTabProps as BaseUITabsTabProps, TabsTabState as BaseUITabsTabState } from '@base-ui/react/tabs';\nimport { Tabs as BaseUITabs } from '@base-ui/react/tabs';\nimport * as stylex from '@stylexjs/stylex';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, motion, radii, spacing, stateLayerOpacity, typography } from '../../tokens/design.tokens.stylex';\n\n// A tinted pill marks the active tab, not the underline Material draws. That\n// is what the source design uses, and the two are different controls wearing\n// the same name: an underline belongs to a full-width tab bar, while a row of\n// pills reads as a segmented control sitting inside a section.\n//\n// The pill takes the same height, radius, and type as Chip. Both are\n// pill-shaped selection controls, and a row of tabs above a row of chips\n// looks wrong the moment the two disagree about either.\n\n/**\n * A tab strip and its panels. Selection is Base UI's `value`: pass `value`\n * with `onValueChange` to control it, or `defaultValue` to let it keep its\n * own.\n *\n * Composed rather than configured by props, because the number of tabs and\n * what each panel holds are the call site's to decide — the parts are\n * `Tabs.List`, `Tabs.Tab`, and `Tabs.Panel`.\n */\nfunction Tabs(props: BaseUITabsRootProps) {\n return <BaseUITabs.Root {...props} />;\n}\nfunction TabsList(props: BaseUITabsListProps) {\n return <BaseUITabs.List {...props} {...mergeStatefulStyles({\n className: \"x9f619 x78zum5 x14qo01y\"\n }, props)} />;\n}\nfunction TabsPanel(props: BaseUITabsPanelProps) {\n return <BaseUITabs.Panel {...props} {...mergeStatefulStyles({\n className: \"x9f619 xrgy624 x1hl8ikr x9v5kkp x1t137rt x1de99jn\"\n }, props)} />;\n}\nfunction TabsTab(props: BaseUITabsTabProps) {\n return <BaseUITabs.Tab {...props} {...mergeStatefulStyles(tabStyles, props)} />;\n}\n\n// StyleX cannot target [data-selected] on the element it is styling, so the\n// active pill cannot be chosen in CSS. Base UI's answer is a className that is\n// a function of the tab's own state, the same mechanism Chip uses —\n// mergeStatefulStyles wraps this one so a tab still keeps a className the call\n// site passed.\nfunction tabStyles(state: BaseUITabsTabState) {\n return {\n 0: {\n 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\"\n },\n 2: {\n 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\"\n },\n 1: {\n 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\"\n },\n 3: {\n 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\"\n }\n }[!!state.active << 1 | !!state.disabled << 0];\n}\nTabs.List = TabsList;\nTabs.Panel = TabsPanel;\nTabs.Tab = TabsTab;\ntype TabsListProps = BaseUITabsListProps;\ntype TabsPanelProps = BaseUITabsPanelProps;\ntype TabsProps = BaseUITabsRootProps;\ntype TabsTabProps = BaseUITabsTabProps;\nexport type { TabsListProps, TabsPanelProps, TabsProps, TabsTabProps };\nexport default Tabs;"],"mappings":";;;;;;;;;;;;;;AAyBA,SAAA,OAAA,OAAA;CAAA,MAAA,IAAA,EAAA,CAAA;CAAA,IAAA;CAAA,IAAA,EAAA,OAAA,OAAA;EACS,KAAA,oBAAA,KAAA,MAAA,EAAA,GAAqB,MAAK,CAAA;EAAI,EAAA,KAAA;EAAA,EAAA,KAAA;CAAA,OAAA,KAAA,EAAA;CAAA,OAA9B;AAA8B;AAEvC,SAAA,SAAA,OAAA;CAAA,MAAA,IAAA,EAAA,CAAA;CAAA,IAAA;CAAA,IAAA,EAAA,OAAA,OAAA;EACyC,KAAA,oBAAoB,EAAA,WAC9C,0BACb,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,KAAA,MAAA;GAAA,GAAqB;GAAK,GAAM;EAE9B,CAAA;EAAI,EAAA,KAAA;EAAA,EAAA,KAAA;EAAA,EAAA,KAAA;CAAA,OAAA,KAAA,EAAA;CAAA,OAFN;AAEM;AAEf,SAAA,UAAA,OAAA;CAAA,MAAA,IAAA,EAAA,CAAA;CAAA,IAAA;CAAA,IAAA,EAAA,OAAA,OAAA;EAC0C,KAAA,oBAAoB,EAAA,WAC/C,oDACb,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,KAAA,OAAA;GAAA,GAAsB;GAAK,GAAM;EAE/B,CAAA;EAAI,EAAA,KAAA;EAAA,EAAA,KAAA;EAAA,EAAA,KAAA;CAAA,OAAA,KAAA,EAAA;CAAA,OAFN;AAEM;AAEf,SAAA,QAAA,OAAA;CAAA,MAAA,IAAA,EAAA,CAAA;CAAA,IAAA;CAAA,IAAA,EAAA,OAAA,OAAA;EACwC,KAAA,oBAAoB,WAAW,KAAK;EAAC,EAAA,KAAA;EAAA,EAAA,KAAA;CAAA,OAAA,KAAA,EAAA;CAAA,IAAA;CAAA,IAAA,EAAA,OAAA,SAAA,EAAA,OAAA,IAAA;EAApE,KAAA,oBAAA,KAAA,KAAA;GAAA,GAAoB;GAAK,GAAM;EAAqC,CAAA;EAAI,EAAA,KAAA;EAAA,EAAA,KAAA;EAAA,EAAA,KAAA;CAAA,OAAA,KAAA,EAAA;CAAA,OAAxE;AAAwE;AAQjF,SAAS,UAAU,OAA2B;CAC5C,OAAO;EACL,GAAG,EACD,WAAW,uOACb;EACA,GAAG,EACD,WAAW,sOACb;EACA,GAAG,EACD,WAAW,8NACb;EACA,GAAG,EACD,WAAW,8NACb;CACF,EAAE,CAAC,CAAC,MAAM,UAAU,IAAI,CAAC,CAAC,MAAM,YAAY;AAC9C;AACA,OAAK,OAAO;AACZ,OAAK,QAAQ;AACb,OAAK,MAAM"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { props } from "../../node_modules/@stylexjs/stylex/lib/es/stylex.js";
|
|
2
|
+
import { mergeStyles } from "../../styles/merge.js";
|
|
2
3
|
import { useRender } from "@base-ui/react/use-render";
|
|
3
4
|
//#region src/components/text/index.tsx
|
|
4
5
|
const styles = {
|
|
5
6
|
base: {
|
|
7
|
+
kB7OPa: "x9f619",
|
|
6
8
|
kogj98: "x1ghz6dp",
|
|
7
9
|
$$css: true
|
|
8
10
|
},
|
|
@@ -162,7 +164,7 @@ function Text({ render, tone = "default", variant = "bodyMedium", ...props$1 })
|
|
|
162
164
|
defaultTagName: "span",
|
|
163
165
|
props: {
|
|
164
166
|
...props$1,
|
|
165
|
-
...props(styles.base, styles[variant], tones[tone])
|
|
167
|
+
...mergeStyles(props(styles.base, styles[variant], tones[tone]), props$1)
|
|
166
168
|
},
|
|
167
169
|
render
|
|
168
170
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/text/index.tsx"],"sourcesContent":["import { useRender } from '@base-ui/react/use-render';\nimport * as stylex from '@stylexjs/stylex';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, typography } from '../../tokens/design.tokens.stylex';\n\n// One key per style in the 15-entry type scale, named exactly as the token\n// group names it, so `styles[variant]` indexes straight off the prop with no\n// lookup table to keep in sync. Every style sets all five fields the scale\n// defines rather than inheriting any of them: a Text nested inside another\n// Text would otherwise pick up the outer line-height or tracking, which is\n// the kind of drift the scale exists to prevent.\n//\n// `margin: 0` is the one UA reset here. Text renders a <span> by default, but\n// `render` is how a consumer reaches for semantic markup — `<Text\n// render={<h2 />}>` — and an h2's UA margin would then vary the spacing\n// around otherwise identical type.\nconst styles = {\n base: {\n kogj98: \"x1ghz6dp\",\n $$css: true\n },\n bodyLarge: {\n kMv6JI: \"x16svsjw\",\n kGuDYH: \"x1848etk\",\n k63SB2: \"x1c52epr\",\n kb6lSQ: \"x1qn8t5l\",\n kLWn49: \"xh7dzej\",\n $$css: true\n },\n bodyMedium: {\n kMv6JI: \"xpo2rfv\",\n kGuDYH: \"x193rfdd\",\n k63SB2: \"x1hews6w\",\n kb6lSQ: \"xn43zvd\",\n kLWn49: \"xv61bfh\",\n $$css: true\n },\n bodySmall: {\n kMv6JI: \"x1yicsit\",\n kGuDYH: \"x1b35g6e\",\n k63SB2: \"x9d6959\",\n kb6lSQ: \"xwth0xh\",\n kLWn49: \"xybisxh\",\n $$css: true\n },\n displayLarge: {\n kMv6JI: \"xjaampf\",\n kGuDYH: \"xuyiek4\",\n k63SB2: \"x1n2oj23\",\n kb6lSQ: \"x1hxa6v5\",\n kLWn49: \"x1iwmiir\",\n $$css: true\n },\n displayMedium: {\n kMv6JI: \"x1gi70vc\",\n kGuDYH: \"xlzzeuu\",\n k63SB2: \"xh9quta\",\n kb6lSQ: \"x148mp24\",\n kLWn49: \"xs5hucj\",\n $$css: true\n },\n displaySmall: {\n kMv6JI: \"x1eslvzl\",\n kGuDYH: \"x1g52wnc\",\n k63SB2: \"x1x664hp\",\n kb6lSQ: \"x1rnjaw4\",\n kLWn49: \"x92ldg4\",\n $$css: true\n },\n headlineLarge: {\n kMv6JI: \"x1vsmgmf\",\n kGuDYH: \"xh9c4x\",\n k63SB2: \"x1y15vu6\",\n kb6lSQ: \"xoqu3bc\",\n kLWn49: \"x10x9d6x\",\n $$css: true\n },\n headlineMedium: {\n kMv6JI: \"x18s19nt\",\n kGuDYH: \"xcohea8\",\n k63SB2: \"x1mtpwof\",\n kb6lSQ: \"x1kuyk5j\",\n kLWn49: \"xucx483\",\n $$css: true\n },\n headlineSmall: {\n kMv6JI: \"x1fz0g89\",\n kGuDYH: \"xkb6epg\",\n k63SB2: \"x76yrz5\",\n kb6lSQ: \"x1s1qhaa\",\n kLWn49: \"x1voeury\",\n $$css: true\n },\n labelLarge: {\n kMv6JI: \"xkknnkr\",\n kGuDYH: \"x14zspaw\",\n k63SB2: \"x1v9cpvo\",\n kb6lSQ: \"x155f00i\",\n kLWn49: \"x1lz68p4\",\n $$css: true\n },\n labelMedium: {\n kMv6JI: \"xp6n8n2\",\n kGuDYH: \"xkucv67\",\n k63SB2: \"x14hhc5u\",\n kb6lSQ: \"x12utw95\",\n kLWn49: \"xvzb9hk\",\n $$css: true\n },\n labelSmall: {\n kMv6JI: \"xs1w0rn\",\n kGuDYH: \"x1n35her\",\n k63SB2: \"x1su64ma\",\n kb6lSQ: \"xdlnduh\",\n kLWn49: \"xaomhve\",\n $$css: true\n },\n titleLarge: {\n kMv6JI: \"xdy5w5q\",\n kGuDYH: \"xete2z3\",\n k63SB2: \"x14ijtet\",\n kb6lSQ: \"xug9e1u\",\n kLWn49: \"x2divse\",\n $$css: true\n },\n titleMedium: {\n kMv6JI: \"x46eyla\",\n kGuDYH: \"x5ehqhr\",\n k63SB2: \"xrf6cl6\",\n kb6lSQ: \"x1g135zh\",\n kLWn49: \"x1ggk5va\",\n $$css: true\n },\n titleSmall: {\n kMv6JI: \"xrgwony\",\n kGuDYH: \"x12s497w\",\n k63SB2: \"x1szcwkt\",\n kb6lSQ: \"xo803ec\",\n kLWn49: \"xyl1r0q\",\n $$css: true\n }\n};\n\n// Tone is a separate axis from variant so the two compose freely — any of the\n// 15 scale styles in any of these colors. Kept to the roles text actually\n// takes on a surface; a consumer needing something outside this set uses\n// `inherit` and colors the parent, rather than this growing a case per role.\nconst tones = {\n default: {\n kMwMTN: \"x139gbkf\",\n $$css: true\n },\n error: {\n kMwMTN: \"x4ii1qj\",\n $$css: true\n },\n inherit: {\n kMwMTN: \"x1heor9g\",\n $$css: true\n },\n muted: {\n kMwMTN: \"x1w5n3ug\",\n $$css: true\n },\n negative: {\n kMwMTN: \"x12gp0t\",\n $$css: true\n },\n positive: {\n kMwMTN: \"x4no3js\",\n $$css: true\n },\n primary: {\n kMwMTN: \"x1mxwv8y\",\n $$css: true\n }\n};\ntype TextProps = useRender.ComponentProps<'span'> & {\n /**\n * The color role to render in. `inherit` takes the color of the nearest\n * colored ancestor instead of setting one.\n * @default 'default'\n */\n tone?: 'default' | 'error' | 'inherit' | 'muted' | 'negative' | 'positive' | 'primary';\n /**\n * Which style of the type scale to render.\n * @default 'bodyMedium'\n */\n variant?: 'bodyLarge' | 'bodyMedium' | 'bodySmall' | 'displayLarge' | 'displayMedium' | 'displaySmall' | 'headlineLarge' | 'headlineMedium' | 'headlineSmall' | 'labelLarge' | 'labelMedium' | 'labelSmall' | 'titleLarge' | 'titleMedium' | 'titleSmall';\n};\nfunction Text({\n render,\n tone = 'default',\n variant = 'bodyMedium',\n ...props\n}: TextProps) {\n
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/text/index.tsx"],"sourcesContent":["import { useRender } from '@base-ui/react/use-render';\nimport * as stylex from '@stylexjs/stylex';\nimport { mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, typography } from '../../tokens/design.tokens.stylex';\n\n// One key per style in the 15-entry type scale, named exactly as the token\n// group names it, so `styles[variant]` indexes straight off the prop with no\n// lookup table to keep in sync. Every style sets all five fields the scale\n// defines rather than inheriting any of them: a Text nested inside another\n// Text would otherwise pick up the outer line-height or tracking, which is\n// the kind of drift the scale exists to prevent.\n//\n// `margin: 0` is the one UA reset here. Text renders a <span> by default, but\n// `render` is how a consumer reaches for semantic markup — `<Text\n// render={<h2 />}>` — and an h2's UA margin would then vary the spacing\n// around otherwise identical type.\nconst styles = {\n base: {\n kB7OPa: \"x9f619\",\n kogj98: \"x1ghz6dp\",\n $$css: true\n },\n bodyLarge: {\n kMv6JI: \"x16svsjw\",\n kGuDYH: \"x1848etk\",\n k63SB2: \"x1c52epr\",\n kb6lSQ: \"x1qn8t5l\",\n kLWn49: \"xh7dzej\",\n $$css: true\n },\n bodyMedium: {\n kMv6JI: \"xpo2rfv\",\n kGuDYH: \"x193rfdd\",\n k63SB2: \"x1hews6w\",\n kb6lSQ: \"xn43zvd\",\n kLWn49: \"xv61bfh\",\n $$css: true\n },\n bodySmall: {\n kMv6JI: \"x1yicsit\",\n kGuDYH: \"x1b35g6e\",\n k63SB2: \"x9d6959\",\n kb6lSQ: \"xwth0xh\",\n kLWn49: \"xybisxh\",\n $$css: true\n },\n displayLarge: {\n kMv6JI: \"xjaampf\",\n kGuDYH: \"xuyiek4\",\n k63SB2: \"x1n2oj23\",\n kb6lSQ: \"x1hxa6v5\",\n kLWn49: \"x1iwmiir\",\n $$css: true\n },\n displayMedium: {\n kMv6JI: \"x1gi70vc\",\n kGuDYH: \"xlzzeuu\",\n k63SB2: \"xh9quta\",\n kb6lSQ: \"x148mp24\",\n kLWn49: \"xs5hucj\",\n $$css: true\n },\n displaySmall: {\n kMv6JI: \"x1eslvzl\",\n kGuDYH: \"x1g52wnc\",\n k63SB2: \"x1x664hp\",\n kb6lSQ: \"x1rnjaw4\",\n kLWn49: \"x92ldg4\",\n $$css: true\n },\n headlineLarge: {\n kMv6JI: \"x1vsmgmf\",\n kGuDYH: \"xh9c4x\",\n k63SB2: \"x1y15vu6\",\n kb6lSQ: \"xoqu3bc\",\n kLWn49: \"x10x9d6x\",\n $$css: true\n },\n headlineMedium: {\n kMv6JI: \"x18s19nt\",\n kGuDYH: \"xcohea8\",\n k63SB2: \"x1mtpwof\",\n kb6lSQ: \"x1kuyk5j\",\n kLWn49: \"xucx483\",\n $$css: true\n },\n headlineSmall: {\n kMv6JI: \"x1fz0g89\",\n kGuDYH: \"xkb6epg\",\n k63SB2: \"x76yrz5\",\n kb6lSQ: \"x1s1qhaa\",\n kLWn49: \"x1voeury\",\n $$css: true\n },\n labelLarge: {\n kMv6JI: \"xkknnkr\",\n kGuDYH: \"x14zspaw\",\n k63SB2: \"x1v9cpvo\",\n kb6lSQ: \"x155f00i\",\n kLWn49: \"x1lz68p4\",\n $$css: true\n },\n labelMedium: {\n kMv6JI: \"xp6n8n2\",\n kGuDYH: \"xkucv67\",\n k63SB2: \"x14hhc5u\",\n kb6lSQ: \"x12utw95\",\n kLWn49: \"xvzb9hk\",\n $$css: true\n },\n labelSmall: {\n kMv6JI: \"xs1w0rn\",\n kGuDYH: \"x1n35her\",\n k63SB2: \"x1su64ma\",\n kb6lSQ: \"xdlnduh\",\n kLWn49: \"xaomhve\",\n $$css: true\n },\n titleLarge: {\n kMv6JI: \"xdy5w5q\",\n kGuDYH: \"xete2z3\",\n k63SB2: \"x14ijtet\",\n kb6lSQ: \"xug9e1u\",\n kLWn49: \"x2divse\",\n $$css: true\n },\n titleMedium: {\n kMv6JI: \"x46eyla\",\n kGuDYH: \"x5ehqhr\",\n k63SB2: \"xrf6cl6\",\n kb6lSQ: \"x1g135zh\",\n kLWn49: \"x1ggk5va\",\n $$css: true\n },\n titleSmall: {\n kMv6JI: \"xrgwony\",\n kGuDYH: \"x12s497w\",\n k63SB2: \"x1szcwkt\",\n kb6lSQ: \"xo803ec\",\n kLWn49: \"xyl1r0q\",\n $$css: true\n }\n};\n\n// Tone is a separate axis from variant so the two compose freely — any of the\n// 15 scale styles in any of these colors. Kept to the roles text actually\n// takes on a surface; a consumer needing something outside this set uses\n// `inherit` and colors the parent, rather than this growing a case per role.\nconst tones = {\n default: {\n kMwMTN: \"x139gbkf\",\n $$css: true\n },\n error: {\n kMwMTN: \"x4ii1qj\",\n $$css: true\n },\n inherit: {\n kMwMTN: \"x1heor9g\",\n $$css: true\n },\n muted: {\n kMwMTN: \"x1w5n3ug\",\n $$css: true\n },\n negative: {\n kMwMTN: \"x12gp0t\",\n $$css: true\n },\n positive: {\n kMwMTN: \"x4no3js\",\n $$css: true\n },\n primary: {\n kMwMTN: \"x1mxwv8y\",\n $$css: true\n }\n};\ntype TextProps = useRender.ComponentProps<'span'> & {\n /**\n * The color role to render in. `inherit` takes the color of the nearest\n * colored ancestor instead of setting one.\n * @default 'default'\n */\n tone?: 'default' | 'error' | 'inherit' | 'muted' | 'negative' | 'positive' | 'primary';\n /**\n * Which style of the type scale to render.\n * @default 'bodyMedium'\n */\n variant?: 'bodyLarge' | 'bodyMedium' | 'bodySmall' | 'displayLarge' | 'displayMedium' | 'displaySmall' | 'headlineLarge' | 'headlineMedium' | 'headlineSmall' | 'labelLarge' | 'labelMedium' | 'labelSmall' | 'titleLarge' | 'titleMedium' | 'titleSmall';\n};\nfunction Text({\n render,\n tone = 'default',\n variant = 'bodyMedium',\n ...props\n}: TextProps) {\n return useRender({\n defaultTagName: 'span',\n props: {\n ...props,\n ...mergeStyles(stylex.props(styles.base, styles[variant], tones[tone]), props)\n },\n render\n });\n}\nexport type { TextProps };\nexport default Text;"],"mappings":";;;;AAiBA,MAAM,SAAS;CACb,MAAM;EACJ,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,WAAW;EACT,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,YAAY;EACV,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,WAAW;EACT,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,cAAc;EACZ,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,eAAe;EACb,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,cAAc;EACZ,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,eAAe;EACb,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,gBAAgB;EACd,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,eAAe;EACb,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,YAAY;EACV,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,aAAa;EACX,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,YAAY;EACV,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,YAAY;EACV,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,aAAa;EACX,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,YAAY;EACV,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;AACF;AAMA,MAAM,QAAQ;CACZ,SAAS;EACP,QAAQ;EACR,OAAO;CACT;CACA,OAAO;EACL,QAAQ;EACR,OAAO;CACT;CACA,SAAS;EACP,QAAQ;EACR,OAAO;CACT;CACA,OAAO;EACL,QAAQ;EACR,OAAO;CACT;CACA,UAAU;EACR,QAAQ;EACR,OAAO;CACT;CACA,UAAU;EACR,QAAQ;EACR,OAAO;CACT;CACA,SAAS;EACP,QAAQ;EACR,OAAO;CACT;AACF;AAcA,SAAS,KAAK,EACZ,QACA,OAAO,WACP,UAAU,cACV,GAAG,WACS;CACZ,OAAO,UAAU;EACf,gBAAgB;EAChB,OAAO;GACL,GAAG;GACH,GAAG,YAAY,MAAa,OAAO,MAAM,OAAO,UAAU,MAAM,KAAK,GAAG,OAAK;EAC/E;EACA;CACF,CAAC;AACH"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { mergeStatefulStyles } from "../../styles/merge.js";
|
|
1
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
3
|
import { useCallback } from "react";
|
|
3
4
|
import { Field } from "@base-ui/react/field";
|
|
@@ -17,25 +18,25 @@ function TextField({ description, disabled = false, error, label, numeric = fals
|
|
|
17
18
|
return /* @__PURE__ */ jsxs(Field.Root, {
|
|
18
19
|
disabled,
|
|
19
20
|
invalid,
|
|
20
|
-
className: "x78zum5 xdt5ytf",
|
|
21
|
+
className: "x9f619 x78zum5 xdt5ytf",
|
|
21
22
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
22
23
|
...{
|
|
23
|
-
0: { className: "x1rrhr5q xnnlda6 x16uus16 xbiv7yw xirz1nw xzcck0f x89kqus x18rfq6m x18d9i69 xi7mcox x790zyz x1n2onr6 x1qno0dh xkdsq27 xpc4ca7" },
|
|
24
|
-
2: { className: "x1rrhr5q xnnlda6 x16uus16 xbiv7yw xirz1nw xzcck0f x18d9i69 xi7mcox x790zyz x1n2onr6 x1qno0dh xkdsq27 xpc4ca7 x1lxxh4i x1d6xoej" },
|
|
25
|
-
1: { className: "xnnlda6 x16uus16 xbiv7yw xirz1nw xzcck0f x18d9i69 xi7mcox x790zyz x1n2onr6 x1qno0dh xkdsq27 xpc4ca7 xepofeg x1pqbjc1" },
|
|
26
|
-
3: { className: "xnnlda6 x16uus16 xbiv7yw xirz1nw xzcck0f x18d9i69 xi7mcox x790zyz x1n2onr6 x1qno0dh xkdsq27 xpc4ca7 xepofeg x1pqbjc1" }
|
|
24
|
+
0: { className: "x1rrhr5q xnnlda6 x16uus16 xbiv7yw xirz1nw xzcck0f x89kqus x18rfq6m x9f619 x18d9i69 xi7mcox x790zyz x1n2onr6 x1qno0dh xkdsq27 xpc4ca7" },
|
|
25
|
+
2: { className: "x1rrhr5q xnnlda6 x16uus16 xbiv7yw xirz1nw xzcck0f x9f619 x18d9i69 xi7mcox x790zyz x1n2onr6 x1qno0dh xkdsq27 xpc4ca7 x1lxxh4i x1d6xoej" },
|
|
26
|
+
1: { className: "xnnlda6 x16uus16 xbiv7yw xirz1nw xzcck0f x9f619 x18d9i69 xi7mcox x790zyz x1n2onr6 x1qno0dh xkdsq27 xpc4ca7 xepofeg x1pqbjc1" },
|
|
27
|
+
3: { className: "xnnlda6 x16uus16 xbiv7yw xirz1nw xzcck0f x9f619 x18d9i69 xi7mcox x790zyz x1n2onr6 x1qno0dh xkdsq27 xpc4ca7 xepofeg x1pqbjc1" }
|
|
27
28
|
}[!!invalid << 1 | !!disabled << 0],
|
|
28
29
|
children: [/* @__PURE__ */ jsx(Field.Label, {
|
|
29
30
|
className: labelClassName,
|
|
30
31
|
children: label
|
|
31
32
|
}), /* @__PURE__ */ jsx(Field.Control, {
|
|
32
33
|
...props,
|
|
33
|
-
...{
|
|
34
|
-
0: { className: "xjbqb8w xc342km x139gbkf x16svsjw x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1hmvnq2 x1t137rt x1717udv" },
|
|
35
|
-
2: { className: "xjbqb8w xc342km x139gbkf x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1hmvnq2 x1t137rt x1717udv xbppi91 xss6m8b" },
|
|
36
|
-
1: { className: "xjbqb8w xc342km x16svsjw x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1hmvnq2 x1t137rt x1717udv x1xj74d8" },
|
|
37
|
-
3: { className: "xjbqb8w xc342km x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1hmvnq2 x1t137rt x1717udv xbppi91 xss6m8b x1xj74d8" }
|
|
38
|
-
}[!!numeric << 1 | !!disabled << 0]
|
|
34
|
+
...mergeStatefulStyles({
|
|
35
|
+
0: { className: "xjbqb8w xc342km x9f619 x139gbkf x16svsjw x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1hmvnq2 x1t137rt x1717udv" },
|
|
36
|
+
2: { className: "xjbqb8w xc342km x9f619 x139gbkf x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1hmvnq2 x1t137rt x1717udv xbppi91 xss6m8b" },
|
|
37
|
+
1: { className: "xjbqb8w xc342km x9f619 x16svsjw x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1hmvnq2 x1t137rt x1717udv x1xj74d8" },
|
|
38
|
+
3: { className: "xjbqb8w xc342km x9f619 x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1hmvnq2 x1t137rt x1717udv xbppi91 xss6m8b x1xj74d8" }
|
|
39
|
+
}[!!numeric << 1 | !!disabled << 0], props)
|
|
39
40
|
})]
|
|
40
41
|
}), invalid ? /* @__PURE__ */ jsx(Field.Error, {
|
|
41
42
|
match: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/text-field/index.tsx"],"sourcesContent":["import type { FieldControlProps as BaseUIFieldControlProps, FieldLabelState as BaseUIFieldLabelState } from '@base-ui/react/field';\nimport { Field as BaseUIField } from '@base-ui/react/field';\nimport * as stylex from '@stylexjs/stylex';\nimport { useCallback } from 'react';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, motion, radii, spacing, stateLayerOpacity, typography } from '../../tokens/design.tokens.stylex';\n\n// The focus indicator is an inset box-shadow on the bottom edge rather than a\n// border that thickens. A real border going 1px -> 2px on focus grows the\n// box, which pushes every sibling below it down by a pixel — so a form\n// twitches each time focus moves between its fields. A shadow is drawn inside\n// the box and changes nothing about its size.\n//\n// The label sits at a fixed size at the top rather than floating up out of\n// the input on focus: the design draws it small and in place at all times, so\n// there is no transition between two positions to get right.\n\ntype TextFieldProps = {\n /**\n * A hint shown under the field. Replaced by `error` when there is one, so\n * the two never stack.\n */\n description?: string;\n /**\n * The problem with the current value, in words. Its presence is what puts\n * the field in its error state — the message, the red underline, and\n * `aria-invalid` all follow from it.\n */\n error?: string;\n /**\n * What the field is for. Required rather than optional: a text field with\n * no label is a box a screen reader cannot name.\n */\n label: string;\n /**\n * Renders the value in the mono face with tabular figures, for amounts and\n * other numbers meant to be compared down a column.\n * @default false\n */\n numeric?: boolean;\n} & Omit<BaseUIFieldControlProps, 'render'>;\nfunction TextField({\n description,\n disabled = false,\n error,\n label,\n numeric = false,\n ...props\n}: TextFieldProps) {\n const invalid = error !== undefined;\n\n // The label's colour follows the field's focus, which is a state only Base\n // UI knows — StyleX cannot express `.box:focus-within .label`, because the\n // label is the input's sibling rather than its ancestor. useCallback keeps\n // it one reference between renders, which is what react-perf is after.\n const labelClassName = useCallback((state: BaseUIFieldLabelState) => ({\n 0: {\n className: \"x1w5n3ug xp6n8n2 xkucv67 x14hhc5u x1we8soy x19v39ok x12utw95 xvzb9hk x10l6tqk x1qno0dh xt3l3uh xpc4ca7\"\n },\n 4: {\n className: \"xp6n8n2 xkucv67 x14hhc5u x1we8soy x19v39ok x12utw95 xvzb9hk x10l6tqk x1qno0dh xt3l3uh xpc4ca7 x1xj74d8\"\n },\n 2: {\n className: \"xp6n8n2 xkucv67 x14hhc5u x1we8soy x19v39ok x12utw95 xvzb9hk x10l6tqk x1qno0dh xt3l3uh xpc4ca7 x4ii1qj\"\n },\n 6: {\n className: \"xp6n8n2 xkucv67 x14hhc5u x1we8soy x19v39ok x12utw95 xvzb9hk x10l6tqk x1qno0dh xt3l3uh xpc4ca7 x4ii1qj\"\n },\n 1: {\n className: \"xp6n8n2 xkucv67 x14hhc5u x1we8soy x19v39ok x12utw95 xvzb9hk x10l6tqk x1qno0dh xt3l3uh xpc4ca7 x1mxwv8y\"\n },\n 5: {\n className: \"xp6n8n2 xkucv67 x14hhc5u x1we8soy x19v39ok x12utw95 xvzb9hk x10l6tqk x1qno0dh xt3l3uh xpc4ca7 x1mxwv8y\"\n },\n 3: {\n className: \"xp6n8n2 xkucv67 x14hhc5u x1we8soy x19v39ok x12utw95 xvzb9hk x10l6tqk x1qno0dh xt3l3uh xpc4ca7 x1mxwv8y\"\n },\n 7: {\n className: \"xp6n8n2 xkucv67 x14hhc5u x1we8soy x19v39ok x12utw95 xvzb9hk x10l6tqk x1qno0dh xt3l3uh xpc4ca7 x1mxwv8y\"\n }\n })[!!disabled << 2 | !!invalid << 1 | !!(!disabled && !invalid && state.focused) << 0].className, [disabled, invalid]);\n return <BaseUIField.Root disabled={disabled} invalid={invalid} className=\"x78zum5 xdt5ytf\">\n <div {...{\n 0: {\n className: \"x1rrhr5q xnnlda6 x16uus16 xbiv7yw xirz1nw xzcck0f x89kqus x18rfq6m x18d9i69 xi7mcox x790zyz x1n2onr6 x1qno0dh xkdsq27 xpc4ca7\"\n },\n 2: {\n className: \"x1rrhr5q xnnlda6 x16uus16 xbiv7yw xirz1nw xzcck0f x18d9i69 xi7mcox x790zyz x1n2onr6 x1qno0dh xkdsq27 xpc4ca7 x1lxxh4i x1d6xoej\"\n },\n 1: {\n className: \"xnnlda6 x16uus16 xbiv7yw xirz1nw xzcck0f x18d9i69 xi7mcox x790zyz x1n2onr6 x1qno0dh xkdsq27 xpc4ca7 xepofeg x1pqbjc1\"\n },\n 3: {\n className: \"xnnlda6 x16uus16 xbiv7yw xirz1nw xzcck0f x18d9i69 xi7mcox x790zyz x1n2onr6 x1qno0dh xkdsq27 xpc4ca7 xepofeg x1pqbjc1\"\n }\n }[!!invalid << 1 | !!disabled << 0]}>\n <BaseUIField.Label className={labelClassName}>\n {label}\n </BaseUIField.Label>\n <BaseUIField.Control {...props} {...{\n 0: {\n className: \"xjbqb8w xc342km x139gbkf x16svsjw x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1hmvnq2 x1t137rt x1717udv\"\n },\n 2: {\n className: \"xjbqb8w xc342km x139gbkf x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1hmvnq2 x1t137rt x1717udv xbppi91 xss6m8b\"\n },\n 1: {\n className: \"xjbqb8w xc342km x16svsjw x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1hmvnq2 x1t137rt x1717udv x1xj74d8\"\n },\n 3: {\n className: \"xjbqb8w xc342km x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1hmvnq2 x1t137rt x1717udv xbppi91 xss6m8b x1xj74d8\"\n }\n }[!!numeric << 1 | !!disabled << 0]} />\n </div>\n {invalid ? <BaseUIField.Error match className=\"x1yicsit x1b35g6e x9d6959 xwth0xh xybisxh x10im51j x1y88zpp xboopgi x4ii1qj\">\n {error}\n </BaseUIField.Error> : description === undefined ? null : <BaseUIField.Description className=\"x1w5n3ug x1yicsit x1b35g6e x9d6959 xwth0xh xybisxh x10im51j x1y88zpp xboopgi\">\n {description}\n </BaseUIField.Description>}\n </BaseUIField.Root>;\n}\nexport type { TextFieldProps };\nexport default TextField;"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/text-field/index.tsx"],"sourcesContent":["import type { FieldControlProps as BaseUIFieldControlProps, FieldLabelState as BaseUIFieldLabelState } from '@base-ui/react/field';\nimport { Field as BaseUIField } from '@base-ui/react/field';\nimport * as stylex from '@stylexjs/stylex';\nimport { useCallback } from 'react';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, motion, radii, spacing, stateLayerOpacity, typography } from '../../tokens/design.tokens.stylex';\n\n// The focus indicator is an inset box-shadow on the bottom edge rather than a\n// border that thickens. A real border going 1px -> 2px on focus grows the\n// box, which pushes every sibling below it down by a pixel — so a form\n// twitches each time focus moves between its fields. A shadow is drawn inside\n// the box and changes nothing about its size.\n//\n// The label sits at a fixed size at the top rather than floating up out of\n// the input on focus: the design draws it small and in place at all times, so\n// there is no transition between two positions to get right.\n\ntype TextFieldProps = {\n /**\n * A hint shown under the field. Replaced by `error` when there is one, so\n * the two never stack.\n */\n description?: string;\n /**\n * The problem with the current value, in words. Its presence is what puts\n * the field in its error state — the message, the red underline, and\n * `aria-invalid` all follow from it.\n */\n error?: string;\n /**\n * What the field is for. Required rather than optional: a text field with\n * no label is a box a screen reader cannot name.\n */\n label: string;\n /**\n * Renders the value in the mono face with tabular figures, for amounts and\n * other numbers meant to be compared down a column.\n * @default false\n */\n numeric?: boolean;\n} & Omit<BaseUIFieldControlProps, 'render'>;\nfunction TextField({\n description,\n disabled = false,\n error,\n label,\n numeric = false,\n ...props\n}: TextFieldProps) {\n const invalid = error !== undefined;\n\n // The label's colour follows the field's focus, which is a state only Base\n // UI knows — StyleX cannot express `.box:focus-within .label`, because the\n // label is the input's sibling rather than its ancestor. useCallback keeps\n // it one reference between renders, which is what react-perf is after.\n const labelClassName = useCallback((state: BaseUIFieldLabelState) => ({\n 0: {\n className: \"x1w5n3ug xp6n8n2 xkucv67 x14hhc5u x1we8soy x19v39ok x12utw95 xvzb9hk x10l6tqk x1qno0dh xt3l3uh xpc4ca7\"\n },\n 4: {\n className: \"xp6n8n2 xkucv67 x14hhc5u x1we8soy x19v39ok x12utw95 xvzb9hk x10l6tqk x1qno0dh xt3l3uh xpc4ca7 x1xj74d8\"\n },\n 2: {\n className: \"xp6n8n2 xkucv67 x14hhc5u x1we8soy x19v39ok x12utw95 xvzb9hk x10l6tqk x1qno0dh xt3l3uh xpc4ca7 x4ii1qj\"\n },\n 6: {\n className: \"xp6n8n2 xkucv67 x14hhc5u x1we8soy x19v39ok x12utw95 xvzb9hk x10l6tqk x1qno0dh xt3l3uh xpc4ca7 x4ii1qj\"\n },\n 1: {\n className: \"xp6n8n2 xkucv67 x14hhc5u x1we8soy x19v39ok x12utw95 xvzb9hk x10l6tqk x1qno0dh xt3l3uh xpc4ca7 x1mxwv8y\"\n },\n 5: {\n className: \"xp6n8n2 xkucv67 x14hhc5u x1we8soy x19v39ok x12utw95 xvzb9hk x10l6tqk x1qno0dh xt3l3uh xpc4ca7 x1mxwv8y\"\n },\n 3: {\n className: \"xp6n8n2 xkucv67 x14hhc5u x1we8soy x19v39ok x12utw95 xvzb9hk x10l6tqk x1qno0dh xt3l3uh xpc4ca7 x1mxwv8y\"\n },\n 7: {\n className: \"xp6n8n2 xkucv67 x14hhc5u x1we8soy x19v39ok x12utw95 xvzb9hk x10l6tqk x1qno0dh xt3l3uh xpc4ca7 x1mxwv8y\"\n }\n })[!!disabled << 2 | !!invalid << 1 | !!(!disabled && !invalid && state.focused) << 0].className, [disabled, invalid]);\n return <BaseUIField.Root disabled={disabled} invalid={invalid} className=\"x9f619 x78zum5 xdt5ytf\">\n <div {...{\n 0: {\n className: \"x1rrhr5q xnnlda6 x16uus16 xbiv7yw xirz1nw xzcck0f x89kqus x18rfq6m x9f619 x18d9i69 xi7mcox x790zyz x1n2onr6 x1qno0dh xkdsq27 xpc4ca7\"\n },\n 2: {\n className: \"x1rrhr5q xnnlda6 x16uus16 xbiv7yw xirz1nw xzcck0f x9f619 x18d9i69 xi7mcox x790zyz x1n2onr6 x1qno0dh xkdsq27 xpc4ca7 x1lxxh4i x1d6xoej\"\n },\n 1: {\n className: \"xnnlda6 x16uus16 xbiv7yw xirz1nw xzcck0f x9f619 x18d9i69 xi7mcox x790zyz x1n2onr6 x1qno0dh xkdsq27 xpc4ca7 xepofeg x1pqbjc1\"\n },\n 3: {\n className: \"xnnlda6 x16uus16 xbiv7yw xirz1nw xzcck0f x9f619 x18d9i69 xi7mcox x790zyz x1n2onr6 x1qno0dh xkdsq27 xpc4ca7 xepofeg x1pqbjc1\"\n }\n }[!!invalid << 1 | !!disabled << 0]}>\n <BaseUIField.Label className={labelClassName}>\n {label}\n </BaseUIField.Label>\n {/* `props` is the control's, which is what TextFieldProps extends,\n so a className or style from the call site lands on the <input>\n rather than on the wrapper around it. */}\n <BaseUIField.Control {...props} {...mergeStatefulStyles({\n 0: {\n className: \"xjbqb8w xc342km x9f619 x139gbkf x16svsjw x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1hmvnq2 x1t137rt x1717udv\"\n },\n 2: {\n className: \"xjbqb8w xc342km x9f619 x139gbkf x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1hmvnq2 x1t137rt x1717udv xbppi91 xss6m8b\"\n },\n 1: {\n className: \"xjbqb8w xc342km x9f619 x16svsjw x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1hmvnq2 x1t137rt x1717udv x1xj74d8\"\n },\n 3: {\n className: \"xjbqb8w xc342km x9f619 x1848etk x1c52epr xh8yej3 x1qn8t5l xh7dzej x1hmvnq2 x1t137rt x1717udv xbppi91 xss6m8b x1xj74d8\"\n }\n }[!!numeric << 1 | !!disabled << 0], props)} />\n </div>\n {invalid ? <BaseUIField.Error match className=\"x1yicsit x1b35g6e x9d6959 xwth0xh xybisxh x10im51j x1y88zpp xboopgi x4ii1qj\">\n {error}\n </BaseUIField.Error> : description === undefined ? null : <BaseUIField.Description className=\"x1w5n3ug x1yicsit x1b35g6e x9d6959 xwth0xh xybisxh x10im51j x1y88zpp xboopgi\">\n {description}\n </BaseUIField.Description>}\n </BaseUIField.Root>;\n}\nexport type { TextFieldProps };\nexport default TextField;"],"mappings":";;;;;AA0CA,SAAS,UAAU,EACjB,aACA,WAAW,OACX,OACA,OACA,UAAU,OACV,GAAG,SACc;CACjB,MAAM,UAAU,UAAU,KAAA;CAM1B,MAAM,iBAAiB,aAAa,WAAkC;EACpE,GAAG,EACD,WAAW,yGACb;EACA,GAAG,EACD,WAAW,yGACb;EACA,GAAG,EACD,WAAW,wGACb;EACA,GAAG,EACD,WAAW,wGACb;EACA,GAAG,EACD,WAAW,yGACb;EACA,GAAG,EACD,WAAW,yGACb;EACA,GAAG,EACD,WAAW,yGACb;EACA,GAAG,EACD,WAAW,yGACb;CACF,EAAA,CAAG,CAAC,CAAC,YAAY,IAAI,CAAC,CAAC,WAAW,IAAI,CAAC,EAAE,CAAC,YAAY,CAAC,WAAW,MAAM,YAAY,EAAE,CAAC,WAAW,CAAC,UAAU,OAAO,CAAC;CACrH,OAAO,qBAAC,MAAY,MAAb;EAA4B;EAAmB;EAAS,WAAU;EAAlE,UAAA,CACH,qBAAC,OAAD;GAAK,GAAI;IACT,GAAG,EACD,WAAW,uIACb;IACA,GAAG,EACD,WAAW,wIACb;IACA,GAAG,EACD,WAAW,8HACb;IACA,GAAG,EACD,WAAW,8HACb;GACF,EAAE,CAAC,CAAC,WAAW,IAAI,CAAC,CAAC,YAAY;GAb/B,UAAA,CAcE,oBAAC,MAAY,OAAb;IAAmB,WAAW;IAC3B,UAAA;GACgB,CAAA,GAInB,oBAAC,MAAY,SAAb;IAAqB,GAAI;IAAO,GAAI,oBAAoB;KACxD,GAAG,EACD,WAAW,iHACb;KACA,GAAG,EACD,WAAW,wHACb;KACA,GAAG,EACD,WAAW,iHACb;KACA,GAAG,EACD,WAAW,wHACb;IACF,EAAE,CAAC,CAAC,WAAW,IAAI,CAAC,CAAC,YAAY,IAAI,KAAK;GAAE,CAAA,CACvC;EACJ,CAAA,GAAA,UAAU,oBAAC,MAAY,OAAb;GAAmB,OAAA;GAAM,WAAU;GACzC,UAAA;EACgB,CAAA,IAAI,gBAAgB,KAAA,IAAY,OAAO,oBAAC,MAAY,aAAb;GAAyB,WAAU;GAC1F,UAAA;EACsB,CAAA,CACX;;AACtB"}
|
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import Button, { ButtonProps } from "./components/button/index.js";
|
|
|
5
5
|
import Card, { CardProps } from "./components/card/index.js";
|
|
6
6
|
import Chip, { ChipProps } from "./components/chip/index.js";
|
|
7
7
|
import Code, { CodeProps } from "./components/code/index.js";
|
|
8
|
+
import Container, { ContainerProps } from "./components/container/index.js";
|
|
8
9
|
import CopyField, { CopyFieldProps } from "./components/copy-field/index.js";
|
|
9
10
|
import Currency, { CurrencyProps } from "./components/currency/index.js";
|
|
10
11
|
import Feed, { FeedProps } from "./components/feed/index.js";
|
|
@@ -16,9 +17,11 @@ import ListItem, { ListItemProps } from "./components/list-item/index.js";
|
|
|
16
17
|
import ProductIcon, { ProductIconProps } from "./components/product-icon/index.js";
|
|
17
18
|
import Separator, { SeparatorProps } from "./components/separator/index.js";
|
|
18
19
|
import Sheet, { SheetProps } from "./components/sheet/index.js";
|
|
20
|
+
import Stack, { StackAlign, StackGap, StackJustify, StackProps } from "./components/stack/index.js";
|
|
19
21
|
import SupportingPane, { SupportingPaneProps } from "./components/supporting-pane/index.js";
|
|
20
22
|
import Tabs, { TabsProps } from "./components/tabs/index.js";
|
|
21
23
|
import Text, { TextProps } from "./components/text/index.js";
|
|
22
24
|
import TextField, { TextFieldProps } from "./components/text-field/index.js";
|
|
23
25
|
import "./components/index.js";
|
|
24
|
-
|
|
26
|
+
import "./styles.css";
|
|
27
|
+
export { AppBar, type AppBarProps, Avatar, type AvatarProps, Badge, type BadgeProps, Button, type ButtonProps, Card, type CardProps, Chip, type ChipProps, Code, type CodeProps, Container, type ContainerProps, CopyField, type CopyFieldProps, Currency, type CurrencyProps, Feed, type FeedProps, IconButton, type IconButtonProps, Keycap, type KeycapProps, Link, type LinkProps, ListDetail, type ListDetailProps, ListItem, type ListItemProps, ProductIcon, type ProductIconProps, Separator, type SeparatorProps, Sheet, type SheetProps, Stack, type StackAlign, type StackGap, type StackJustify, type StackProps, SupportingPane, type SupportingPaneProps, Tabs, type TabsProps, Text, TextField, type TextFieldProps, type TextProps };
|