@kanso-labs/kanso-ui 0.35.0 → 0.37.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 +90 -9
- package/dist/button/context.js +7 -0
- package/dist/button/context.js.map +1 -0
- package/dist/button/group.js +25 -0
- package/dist/button/group.js.map +1 -0
- package/dist/button/hooks.js +81 -0
- package/dist/button/hooks.js.map +1 -0
- package/dist/button/index.d.ts +11 -0
- package/dist/button/index.js +273 -0
- package/dist/button/index.js.map +1 -0
- package/dist/button/styles.js +23 -0
- package/dist/button/styles.js.map +1 -0
- package/dist/calendar/index.js +473 -7
- package/dist/calendar/index.js.map +1 -1
- package/dist/calendar/styles.js +132 -4
- package/dist/calendar/styles.js.map +1 -1
- package/dist/chip/index.js +74 -9
- package/dist/chip/index.js.map +1 -1
- package/dist/chip/styles.js +78 -4
- package/dist/chip/styles.js.map +1 -1
- package/dist/collection/index.js +12 -9
- package/dist/collection/index.js.map +1 -1
- package/dist/collection/styles.js +21 -2
- package/dist/collection/styles.js.map +1 -1
- package/dist/color-scheme.d.ts +29 -0
- package/dist/color-scheme.js +32 -0
- package/dist/color-scheme.js.map +1 -0
- package/dist/components/avatar/index.js +35 -22
- package/dist/components/avatar/index.js.map +1 -1
- package/dist/components/badge/index.d.ts +40 -0
- package/dist/components/badge/index.js +102 -0
- package/dist/components/badge/index.js.map +1 -0
- package/dist/components/breadcrumbs/index.d.ts +1 -1
- package/dist/components/breadcrumbs/index.js +1 -1
- package/dist/components/breadcrumbs/index.js.map +1 -1
- package/dist/components/button/index.d.ts +58 -14
- package/dist/components/button/index.js +400 -147
- package/dist/components/button/index.js.map +1 -1
- package/dist/components/button-group/index.d.ts +54 -0
- package/dist/components/button-group/index.js +272 -0
- package/dist/components/button-group/index.js.map +1 -0
- package/dist/components/calendar/index.d.ts +9 -1
- package/dist/components/calendar/index.js +71 -44
- package/dist/components/calendar/index.js.map +1 -1
- package/dist/components/card/index.d.ts +1 -1
- package/dist/components/card/index.js +4 -4
- package/dist/components/card/index.js.map +1 -1
- package/dist/components/checkbox/index.js +15 -1
- package/dist/components/checkbox/index.js.map +1 -1
- package/dist/components/checkbox-group/index.js +1 -0
- package/dist/components/checkbox-group/index.js.map +1 -1
- package/dist/components/chip/index.d.ts +55 -8
- package/dist/components/chip/index.js +174 -63
- package/dist/components/chip/index.js.map +1 -1
- package/dist/components/chip-group/index.d.ts +16 -7
- package/dist/components/chip-group/index.js +58 -35
- package/dist/components/chip-group/index.js.map +1 -1
- package/dist/components/color-field/index.js +25 -23
- package/dist/components/color-field/index.js.map +1 -1
- package/dist/components/color-picker/index.js +42 -31
- package/dist/components/color-picker/index.js.map +1 -1
- package/dist/components/color-swatch-picker/index.d.ts +1 -1
- package/dist/components/color-swatch-picker/index.js +17 -13
- package/dist/components/color-swatch-picker/index.js.map +1 -1
- package/dist/components/combo-box/index.d.ts +5 -3
- package/dist/components/combo-box/index.js +63 -58
- package/dist/components/combo-box/index.js.map +1 -1
- package/dist/components/copy-field/index.d.ts +7 -6
- package/dist/components/copy-field/index.js +92 -90
- package/dist/components/copy-field/index.js.map +1 -1
- package/dist/components/currency/index.d.ts +8 -7
- package/dist/components/currency/index.js +43 -65
- package/dist/components/currency/index.js.map +1 -1
- package/dist/components/date-field/index.js +24 -22
- package/dist/components/date-field/index.js.map +1 -1
- package/dist/components/date-picker/index.d.ts +10 -2
- package/dist/components/date-picker/index.js +76 -69
- package/dist/components/date-picker/index.js.map +1 -1
- package/dist/components/date-range-picker/index.d.ts +10 -2
- package/dist/components/date-range-picker/index.js +93 -86
- package/dist/components/date-range-picker/index.js.map +1 -1
- package/dist/components/dialog/index.d.ts +1 -1
- package/dist/components/dialog/index.js +2 -2
- package/dist/components/dialog/index.js.map +1 -1
- package/dist/components/disclosure/index.d.ts +1 -1
- package/dist/components/disclosure/index.js +6 -6
- package/dist/components/disclosure/index.js.map +1 -1
- package/dist/components/fab/index.d.ts +72 -0
- package/dist/components/fab/index.js +89 -0
- package/dist/components/fab/index.js.map +1 -0
- package/dist/components/fab-menu/index.d.ts +90 -0
- package/dist/components/fab-menu/index.js +297 -0
- package/dist/components/fab-menu/index.js.map +1 -0
- package/dist/components/feed/index.d.ts +2 -1
- package/dist/components/feed/index.js +1 -1
- package/dist/components/feed/index.js.map +1 -1
- package/dist/components/icon-button/index.d.ts +11 -8
- package/dist/components/icon-button/index.js +244 -181
- package/dist/components/icon-button/index.js.map +1 -1
- package/dist/components/index.d.ts +30 -21
- package/dist/components/list/index.d.ts +15 -13
- package/dist/components/list/index.js +60 -61
- package/dist/components/list/index.js.map +1 -1
- package/dist/components/list-box/index.d.ts +3 -2
- package/dist/components/list-box/index.js +16 -16
- package/dist/components/list-box/index.js.map +1 -1
- package/dist/components/list-item/index.js +1 -1
- package/dist/components/list-item/index.js.map +1 -1
- package/dist/components/menu/index.d.ts +3 -2
- package/dist/components/menu/index.js +2 -2
- package/dist/components/menu/index.js.map +1 -1
- package/dist/components/navigation-bar/index.d.ts +50 -0
- package/dist/components/navigation-bar/index.js +129 -0
- package/dist/components/navigation-bar/index.js.map +1 -0
- package/dist/components/navigation-rail/index.d.ts +59 -0
- package/dist/components/navigation-rail/index.js +166 -0
- package/dist/components/navigation-rail/index.js.map +1 -0
- package/dist/components/navigation-tree/index.d.ts +1 -5
- package/dist/components/navigation-tree/index.js +3 -3
- package/dist/components/navigation-tree/index.js.map +1 -1
- package/dist/components/number-field/index.d.ts +6 -4
- package/dist/components/number-field/index.js +84 -84
- package/dist/components/number-field/index.js.map +1 -1
- package/dist/components/popover/index.d.ts +1 -1
- package/dist/components/popover/index.js +1 -1
- package/dist/components/popover/index.js.map +1 -1
- package/dist/components/radio-group/index.js +22 -11
- package/dist/components/radio-group/index.js.map +1 -1
- package/dist/components/range-calendar/index.d.ts +7 -1
- package/dist/components/range-calendar/index.js +71 -44
- package/dist/components/range-calendar/index.js.map +1 -1
- package/dist/components/search-field/index.d.ts +2 -1
- package/dist/components/search-field/index.js +24 -25
- package/dist/components/search-field/index.js.map +1 -1
- package/dist/components/search-view/index.d.ts +79 -0
- package/dist/components/search-view/index.js +255 -0
- package/dist/components/search-view/index.js.map +1 -0
- package/dist/components/segmented-button/index.d.ts +2 -2
- package/dist/components/segmented-button/index.js +60 -31
- package/dist/components/segmented-button/index.js.map +1 -1
- package/dist/components/select/index.js +1 -0
- package/dist/components/select/index.js.map +1 -1
- package/dist/components/sheet/index.d.ts +1 -1
- package/dist/components/sheet/index.js +2 -2
- package/dist/components/sheet/index.js.map +1 -1
- package/dist/components/slider/index.js +1 -1
- package/dist/components/slider/index.js.map +1 -1
- package/dist/components/snackbar/index.d.ts +2 -2
- package/dist/components/snackbar/index.js +28 -13
- package/dist/components/snackbar/index.js.map +1 -1
- package/dist/components/split-button/index.d.ts +83 -0
- package/dist/components/split-button/index.js +341 -0
- package/dist/components/split-button/index.js.map +1 -0
- package/dist/components/switch/index.js +11 -1
- package/dist/components/switch/index.js.map +1 -1
- package/dist/components/table/index.d.ts +11 -9
- package/dist/components/table/index.js +87 -31
- package/dist/components/table/index.js.map +1 -1
- package/dist/components/tabs/index.d.ts +35 -4
- package/dist/components/tabs/index.js +403 -93
- package/dist/components/tabs/index.js.map +1 -1
- package/dist/components/tag/index.d.ts +1 -1
- package/dist/components/tag/index.js.map +1 -1
- package/dist/components/text-area/index.d.ts +7 -5
- package/dist/components/text-area/index.js +28 -26
- package/dist/components/text-area/index.js.map +1 -1
- package/dist/components/text-field/index.d.ts +7 -5
- package/dist/components/text-field/index.js +28 -26
- package/dist/components/text-field/index.js.map +1 -1
- package/dist/components/time-field/index.js +24 -22
- package/dist/components/time-field/index.js.map +1 -1
- package/dist/components/tree/index.d.ts +7 -9
- package/dist/components/tree/index.js +15 -16
- package/dist/components/tree/index.js.map +1 -1
- package/dist/drag/index.js.map +1 -1
- package/dist/drag/styles.js +4 -1
- package/dist/drag/styles.js.map +1 -1
- package/dist/fab/styles.js +161 -0
- package/dist/fab/styles.js.map +1 -0
- package/dist/field/index.js +260 -214
- package/dist/field/index.js.map +1 -1
- package/dist/field/styles.js +10 -2
- package/dist/field/styles.js.map +1 -1
- package/dist/glyphs/index.js +55 -1
- package/dist/glyphs/index.js.map +1 -1
- package/dist/hooks/useRipple.js +199 -162
- package/dist/hooks/useRipple.js.map +1 -1
- package/dist/hooks/useToggleGroupDisabled.js +24 -0
- package/dist/hooks/useToggleGroupDisabled.js.map +1 -0
- package/dist/i18n/index.js +43 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/i18n/messages.js +387 -0
- package/dist/i18n/messages.js.map +1 -0
- package/dist/index.d.ts +31 -21
- package/dist/index.js +25 -16
- package/dist/navigation/context.js +7 -0
- package/dist/navigation/context.js.map +1 -0
- package/dist/navigation/index.d.ts +28 -0
- package/dist/navigation/index.js +96 -0
- package/dist/navigation/index.js.map +1 -0
- package/dist/navigation/styles.js +312 -0
- package/dist/navigation/styles.js.map +1 -0
- package/dist/react-aria.d.ts +2 -2
- package/dist/react-aria.js +2 -2
- package/dist/render/useRender.js +0 -1
- package/dist/render/useRender.js.map +1 -1
- package/dist/row/styles.js +33 -11
- package/dist/row/styles.js.map +1 -1
- package/dist/styles/focus.js.map +1 -1
- package/dist/styles/icon-button.js +9 -1
- package/dist/styles/icon-button.js.map +1 -1
- package/dist/styles/overlay.js +1 -0
- package/dist/styles/overlay.js.map +1 -1
- package/dist/styles/picker.js +1 -1
- package/dist/styles/picker.js.map +1 -1
- package/dist/styles.css +1104 -336
- package/dist/tokens/design.tokens.stylex.js +42 -1
- package/dist/tokens/design.tokens.stylex.js.map +1 -1
- package/dist/tokens.css +166 -53
- package/package.json +9 -5
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useRender } from "../../render/useRender.js";
|
|
3
|
+
import { mergeStyles } from "../../styles/merge.js";
|
|
4
|
+
import { NavigationContext } from "../../navigation/context.js";
|
|
5
|
+
import { NavigationItem } from "../../navigation/index.js";
|
|
6
|
+
import { c } from "react/compiler-runtime";
|
|
7
|
+
import "react";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
//#region src/components/navigation-bar/index.tsx
|
|
10
|
+
/**
|
|
11
|
+
* The bar of three to five top-level destinations a compact window keeps at
|
|
12
|
+
* its bottom edge. Each destination is a link, so it routes through React
|
|
13
|
+
* Aria's `RouterProvider` when the app has one.
|
|
14
|
+
*
|
|
15
|
+
* ```tsx
|
|
16
|
+
* <NavigationBar aria-label="Label" selectedRoute="/first">
|
|
17
|
+
* <NavigationBar.Item href="/first" icon={<FirstIcon />}>
|
|
18
|
+
* First item
|
|
19
|
+
* </NavigationBar.Item>
|
|
20
|
+
* <NavigationBar.Item href="/second" icon={<SecondIcon />}>
|
|
21
|
+
* Second item
|
|
22
|
+
* </NavigationBar.Item>
|
|
23
|
+
* <NavigationBar.Item href="/third" icon={<ThirdIcon />}>
|
|
24
|
+
* Third item
|
|
25
|
+
* </NavigationBar.Item>
|
|
26
|
+
* </NavigationBar>
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* The call site's `className` and `style` land on the `<nav>`.
|
|
30
|
+
*/
|
|
31
|
+
function NavigationBar(t0) {
|
|
32
|
+
const $ = c(19);
|
|
33
|
+
let context;
|
|
34
|
+
let render;
|
|
35
|
+
let t1;
|
|
36
|
+
let t2;
|
|
37
|
+
let t3;
|
|
38
|
+
let t4;
|
|
39
|
+
if ($[0] !== t0) {
|
|
40
|
+
const { render: t5, selectedRoute, ...props } = t0;
|
|
41
|
+
render = t5;
|
|
42
|
+
let t6;
|
|
43
|
+
if ($[7] !== selectedRoute) {
|
|
44
|
+
t6 = {
|
|
45
|
+
form: "bar",
|
|
46
|
+
selectedRoute
|
|
47
|
+
};
|
|
48
|
+
$[7] = selectedRoute;
|
|
49
|
+
$[8] = t6;
|
|
50
|
+
} else t6 = $[8];
|
|
51
|
+
context = t6;
|
|
52
|
+
t4 = useRender;
|
|
53
|
+
t3 = "nav";
|
|
54
|
+
t1 = props;
|
|
55
|
+
t2 = mergeStyles({ className: "x6s0dn4 x1mjdul6 x1peatla x9f619 x78zum5 xxhr3t x110hqo6 xh8yej3 xl56j7k" }, props);
|
|
56
|
+
$[0] = t0;
|
|
57
|
+
$[1] = context;
|
|
58
|
+
$[2] = render;
|
|
59
|
+
$[3] = t1;
|
|
60
|
+
$[4] = t2;
|
|
61
|
+
$[5] = t3;
|
|
62
|
+
$[6] = t4;
|
|
63
|
+
} else {
|
|
64
|
+
context = $[1];
|
|
65
|
+
render = $[2];
|
|
66
|
+
t1 = $[3];
|
|
67
|
+
t2 = $[4];
|
|
68
|
+
t3 = $[5];
|
|
69
|
+
t4 = $[6];
|
|
70
|
+
}
|
|
71
|
+
let t5;
|
|
72
|
+
if ($[9] !== t1 || $[10] !== t2) {
|
|
73
|
+
t5 = {
|
|
74
|
+
...t1,
|
|
75
|
+
...t2
|
|
76
|
+
};
|
|
77
|
+
$[9] = t1;
|
|
78
|
+
$[10] = t2;
|
|
79
|
+
$[11] = t5;
|
|
80
|
+
} else t5 = $[11];
|
|
81
|
+
let t6;
|
|
82
|
+
if ($[12] !== render || $[13] !== t3 || $[14] !== t5) {
|
|
83
|
+
t6 = {
|
|
84
|
+
defaultTagName: t3,
|
|
85
|
+
props: t5,
|
|
86
|
+
render
|
|
87
|
+
};
|
|
88
|
+
$[12] = render;
|
|
89
|
+
$[13] = t3;
|
|
90
|
+
$[14] = t5;
|
|
91
|
+
$[15] = t6;
|
|
92
|
+
} else t6 = $[15];
|
|
93
|
+
const bar = t4(t6);
|
|
94
|
+
let t7;
|
|
95
|
+
if ($[16] !== bar || $[17] !== context) {
|
|
96
|
+
t7 = /* @__PURE__ */ jsx(NavigationContext, {
|
|
97
|
+
value: context,
|
|
98
|
+
children: bar
|
|
99
|
+
});
|
|
100
|
+
$[16] = bar;
|
|
101
|
+
$[17] = context;
|
|
102
|
+
$[18] = t7;
|
|
103
|
+
} else t7 = $[18];
|
|
104
|
+
return t7;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* One destination of a navigation bar — an icon, a label and, when it is the
|
|
108
|
+
* current one, the active indicator. See `NavigationBar`.
|
|
109
|
+
*
|
|
110
|
+
* Defined here rather than re-exported from `src/navigation`: a re-export
|
|
111
|
+
* let the build hand the package entry that module directly, past this
|
|
112
|
+
* module's client directive, and a server component importing it got the
|
|
113
|
+
* component itself rather than a reference to a client one.
|
|
114
|
+
*/
|
|
115
|
+
function NavigationBarItem(props) {
|
|
116
|
+
const $ = c(2);
|
|
117
|
+
let t0;
|
|
118
|
+
if ($[0] !== props) {
|
|
119
|
+
t0 = /* @__PURE__ */ jsx(NavigationItem, { ...props });
|
|
120
|
+
$[0] = props;
|
|
121
|
+
$[1] = t0;
|
|
122
|
+
} else t0 = $[1];
|
|
123
|
+
return t0;
|
|
124
|
+
}
|
|
125
|
+
NavigationBar.Item = NavigationBarItem;
|
|
126
|
+
//#endregion
|
|
127
|
+
export { NavigationBarItem, NavigationBar as default };
|
|
128
|
+
|
|
129
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["c","_c","RefAttributes","stylex","useMemo","NavigationItemProps","RenderComponentProps","NavigationItem","NavigationContext","useRender","mergeStyles","colors","media","spacing","NavigationBarProps","selectedRoute","NavigationBar","t0","$","context","render","t1","t2","t3","t4","t5","props","t6","form","const","className","defaultTagName","bar","t7","NavigationBarItem","Item","NavigationBarItemProps","_c"],"sources":["../../../src/components/navigation-bar/index.tsx"],"sourcesContent":["'use client';\n\nimport type { RefAttributes } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { useMemo } from 'react';\nimport type { NavigationItemProps } from '../../navigation';\nimport type { RenderComponentProps } from '../../render/useRender';\nimport { NavigationItem } from '../../navigation';\nimport { NavigationContext } from '../../navigation/context';\nimport { useRender } from '../../render/useRender';\nimport { mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, media, spacing } from '../../tokens/design.tokens.stylex';\n\n// The navigation bar page's flexible bar: three to five destinations across\n// the bottom of a compact window, on the surface container, 64dp tall. Below\n// the medium breakpoint each destination is vertical and the destinations\n// share the bar's width equally; at it and above, each is the page's\n// horizontal pill, as wide as what it holds, and the group sits centred with\n// the spare width at the bar's ends. The destinations are `src/navigation`'s,\n// shared with NavigationRail, which holds the two forms' values.\n//\n// The 8dp between two horizontal pills is the library's own. The page puts\n// each pill in an item of a fixed width it does not give, and with no space\n// at all the pills met edge to edge.\n//\n// The bar is a `<nav>`, and a page usually has more than one navigation\n// landmark, so name it with `aria-label`.\n\ntype NavigationBarProps = RenderComponentProps<'nav'> & {\n /**\n * The route of the current destination, matched against each\n * destination's `href`. The match carries `aria-current=\"page\"` and the\n * active indicator.\n */\n selectedRoute?: string;\n};\n\n/**\n * The bar of three to five top-level destinations a compact window keeps at\n * its bottom edge. Each destination is a link, so it routes through React\n * Aria's `RouterProvider` when the app has one.\n *\n * ```tsx\n * <NavigationBar aria-label=\"Label\" selectedRoute=\"/first\">\n * <NavigationBar.Item href=\"/first\" icon={<FirstIcon />}>\n * First item\n * </NavigationBar.Item>\n * <NavigationBar.Item href=\"/second\" icon={<SecondIcon />}>\n * Second item\n * </NavigationBar.Item>\n * <NavigationBar.Item href=\"/third\" icon={<ThirdIcon />}>\n * Third item\n * </NavigationBar.Item>\n * </NavigationBar>\n * ```\n *\n * The call site's `className` and `style` land on the `<nav>`.\n */\nfunction NavigationBar({\n render,\n selectedRoute,\n ...props\n}: NavigationBarProps) {\n const context = useMemo(() => ({\n form: 'bar' as const,\n selectedRoute\n }), [selectedRoute]);\n const bar = useRender({\n defaultTagName: 'nav',\n props: {\n ...props,\n ...mergeStyles({\n className: \"x6s0dn4 x1mjdul6 x1peatla x9f619 x78zum5 xxhr3t x110hqo6 xh8yej3 xl56j7k\"\n }, props)\n },\n render\n });\n return <NavigationContext value={context}>{bar}</NavigationContext>;\n}\n\n/**\n * One destination of a navigation bar — an icon, a label and, when it is the\n * current one, the active indicator. See `NavigationBar`.\n *\n * Defined here rather than re-exported from `src/navigation`: a re-export\n * let the build hand the package entry that module directly, past this\n * module's client directive, and a server component importing it got the\n * component itself rather than a reference to a client one.\n */\nfunction NavigationBarItem(props: NavigationItemProps & RefAttributes<HTMLAnchorElement>) {\n return <NavigationItem {...props} />;\n}\nNavigationBar.Item = NavigationBarItem;\nexport type { NavigationItemProps as NavigationBarItemProps, NavigationBarProps };\nexport { NavigationBarItem };\nexport default NavigationBar;"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2DA,SAAAgB,cAAAC,IAAA;CAAA,MAAAC,IAAAjB,EAAA,EAAA;CAAA,IAAAkB;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAN,EAAA,OAAAD,IAAA;EAAuB,MAAA,EAAAG,QAAAK,IAAAV,eAAA,GAAAW,UAAAT;EAAAG,SAAAK;EAIF,IAAAE;EAAA,IAAAT,EAAA,OAAAH,eAAA;GACYY,KAAA;IAAAC,MACvB;IAAcb;GAEtB;GAACG,EAAA,KAAAH;GAAAG,EAAA,KAAAS;EAAA,OAAAA,KAAAT,EAAA;EAHDC,UAA+BQ;EAInBlB,KAAAA;EACMc,KAAA;EAEXG,KAAAA;EACAJ,KAAAZ,YAAY,EAAAoB,WACF,2EACb,GAAGJ,KAAK;EAACR,EAAA,KAAAD;EAAAC,EAAA,KAAAC;EAAAD,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAI;EAAAJ,EAAA,KAAAK;EAAAL,EAAA,KAAAM;CAAA,OAAA;EAAAL,UAAAD,EAAA;EAAAE,SAAAF,EAAA;EAAAG,KAAAH,EAAA;EAAAI,KAAAJ,EAAA;EAAAK,KAAAL,EAAA;EAAAM,KAAAN,EAAA;CAAA;CAAA,IAAAO;CAAA,IAAAP,EAAA,OAAAG,MAAAH,EAAA,QAAAI,IAAA;EAJJG,KAAA;GAAA,GACFC;GAAK,GACLJ;EAGL;EAACJ,EAAA,KAAAG;EAAAH,EAAA,MAAAI;EAAAJ,EAAA,MAAAO;CAAA,OAAAA,KAAAP,EAAA;CAAA,IAAAS;CAAA,IAAAT,EAAA,QAAAE,UAAAF,EAAA,QAAAK,MAAAL,EAAA,QAAAO,IAAA;EAPmBE,KAAA;GAAAI,gBACJR;GAAKG,OACdD;GAKNL;EAEH;EAACF,EAAA,MAAAE;EAAAF,EAAA,MAAAK;EAAAL,EAAA,MAAAO;EAAAP,EAAA,MAAAS;CAAA,OAAAA,KAAAT,EAAA;CATD,MAAAc,MAAYvB,GAAUkB,EASrB;CAAE,IAAAM;CAAA,IAAAf,EAAA,QAAAc,OAAAd,EAAA,QAAAC,SAAA;EACIc,KAAA,oBAAC,mBAAD;GAA0Bd,OAAAA;GAAUa,UAAAA;EAAlB,CAAA;EAA0Cd,EAAA,MAAAc;EAAAd,EAAA,MAAAC;EAAAD,EAAA,MAAAe;CAAA,OAAAA,KAAAf,EAAA;CAAA,OAA5De;AAA4D;;;;;;;;;;AAYrE,SAAAC,kBAAAR,OAAA;CAAA,MAAAR,IAAAjB,EAAA,CAAA;CAAA,IAAAgB;CAAA,IAAAC,EAAA,OAAAQ,OAAA;EACST,KAAA,oBAAC,gBAAD,EAAe,GAAKS,MAAK,CAAA;EAAIR,EAAA,KAAAQ;EAAAR,EAAA,KAAAD;CAAA,OAAAA,KAAAC,EAAA;CAAA,OAA7BD;AAA6B;AAEtCD,cAAcmB,OAAOD"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { RenderComponentProps } from "../../render/useRender.js";
|
|
2
|
+
import { NavigationItemProps } from "../../navigation/index.js";
|
|
3
|
+
import { ReactNode, RefAttributes } from "react";
|
|
4
|
+
//#region src/components/navigation-rail/index.d.ts
|
|
5
|
+
type NavigationRailProps = RenderComponentProps<'nav'> & {
|
|
6
|
+
/**
|
|
7
|
+
* What the rail draws above its destinations: a menu button that expands
|
|
8
|
+
* it, or a floating action button.
|
|
9
|
+
*/
|
|
10
|
+
header?: ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* Whether the rail is in its expanded form, each destination a pill with
|
|
13
|
+
* its label beside the icon, rather than collapsed with the label under it.
|
|
14
|
+
* @default false
|
|
15
|
+
*/
|
|
16
|
+
isExpanded?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* The route of the current destination, matched against each
|
|
19
|
+
* destination's `href`. The match carries `aria-current="page"` and the
|
|
20
|
+
* active indicator.
|
|
21
|
+
*/
|
|
22
|
+
selectedRoute?: string;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* The column of top-level destinations a medium or wider window keeps at its
|
|
26
|
+
* leading edge, collapsed or, with `isExpanded`, expanded. Each destination
|
|
27
|
+
* is a link, so it routes through React Aria's `RouterProvider` when the app
|
|
28
|
+
* has one.
|
|
29
|
+
*
|
|
30
|
+
* ```tsx
|
|
31
|
+
* <NavigationRail aria-label="Label" selectedRoute="/first">
|
|
32
|
+
* <NavigationRail.Item href="/first" icon={<FirstIcon />}>
|
|
33
|
+
* First item
|
|
34
|
+
* </NavigationRail.Item>
|
|
35
|
+
* <NavigationRail.Item href="/second" icon={<SecondIcon />}>
|
|
36
|
+
* Second item
|
|
37
|
+
* </NavigationRail.Item>
|
|
38
|
+
* </NavigationRail>
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* The call site's `className` and `style` land on the `<nav>`.
|
|
42
|
+
*/
|
|
43
|
+
declare function NavigationRail({ children, header, isExpanded, render, selectedRoute, ...props }: NavigationRailProps): import("react").JSX.Element;
|
|
44
|
+
declare namespace NavigationRail {
|
|
45
|
+
var Item: typeof NavigationRailItem;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* One destination of a navigation rail — an icon, a label and, when it is the
|
|
49
|
+
* current one, the active indicator. See `NavigationRail`.
|
|
50
|
+
*
|
|
51
|
+
* Defined here rather than re-exported from `src/navigation`: a re-export
|
|
52
|
+
* let the build hand the package entry that module directly, past this
|
|
53
|
+
* module's client directive, and a server component importing it got the
|
|
54
|
+
* component itself rather than a reference to a client one.
|
|
55
|
+
*/
|
|
56
|
+
declare function NavigationRailItem(props: NavigationItemProps & RefAttributes<HTMLAnchorElement>): import("react").JSX.Element;
|
|
57
|
+
//#endregion
|
|
58
|
+
export { NavigationRailItem, type NavigationItemProps as NavigationRailItemProps, type NavigationRailProps, NavigationRail as default };
|
|
59
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useRender } from "../../render/useRender.js";
|
|
3
|
+
import { mergeStyles } from "../../styles/merge.js";
|
|
4
|
+
import { NavigationContext } from "../../navigation/context.js";
|
|
5
|
+
import { NavigationItem } from "../../navigation/index.js";
|
|
6
|
+
import { c } from "react/compiler-runtime";
|
|
7
|
+
import "react";
|
|
8
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
//#region src/components/navigation-rail/index.tsx
|
|
10
|
+
/**
|
|
11
|
+
* The column of top-level destinations a medium or wider window keeps at its
|
|
12
|
+
* leading edge, collapsed or, with `isExpanded`, expanded. Each destination
|
|
13
|
+
* is a link, so it routes through React Aria's `RouterProvider` when the app
|
|
14
|
+
* has one.
|
|
15
|
+
*
|
|
16
|
+
* ```tsx
|
|
17
|
+
* <NavigationRail aria-label="Label" selectedRoute="/first">
|
|
18
|
+
* <NavigationRail.Item href="/first" icon={<FirstIcon />}>
|
|
19
|
+
* First item
|
|
20
|
+
* </NavigationRail.Item>
|
|
21
|
+
* <NavigationRail.Item href="/second" icon={<SecondIcon />}>
|
|
22
|
+
* Second item
|
|
23
|
+
* </NavigationRail.Item>
|
|
24
|
+
* </NavigationRail>
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* The call site's `className` and `style` land on the `<nav>`.
|
|
28
|
+
*/
|
|
29
|
+
function NavigationRail(t0) {
|
|
30
|
+
const $ = c(30);
|
|
31
|
+
let children;
|
|
32
|
+
let context;
|
|
33
|
+
let header;
|
|
34
|
+
let isExpanded;
|
|
35
|
+
let render;
|
|
36
|
+
let t1;
|
|
37
|
+
let t2;
|
|
38
|
+
let t3;
|
|
39
|
+
let t4;
|
|
40
|
+
if ($[0] !== t0) {
|
|
41
|
+
const { children: t5, header: t6, isExpanded: t7, render: t8, selectedRoute, ...props } = t0;
|
|
42
|
+
children = t5;
|
|
43
|
+
header = t6;
|
|
44
|
+
render = t8;
|
|
45
|
+
isExpanded = t7 === void 0 ? false : t7;
|
|
46
|
+
const t9 = isExpanded ? "expanded" : "collapsed";
|
|
47
|
+
let t10;
|
|
48
|
+
if ($[10] !== selectedRoute || $[11] !== t9) {
|
|
49
|
+
t10 = {
|
|
50
|
+
form: t9,
|
|
51
|
+
selectedRoute
|
|
52
|
+
};
|
|
53
|
+
$[10] = selectedRoute;
|
|
54
|
+
$[11] = t9;
|
|
55
|
+
$[12] = t10;
|
|
56
|
+
} else t10 = $[12];
|
|
57
|
+
context = t10;
|
|
58
|
+
t4 = useRender;
|
|
59
|
+
t3 = "nav";
|
|
60
|
+
t1 = props;
|
|
61
|
+
t2 = mergeStyles({
|
|
62
|
+
0: { className: "x6s0dn4 x14s9m32 x5yr21d x9f619 x78zum5 xdt5ytf x8i8c5o xlaft8j xzoy561 x13oubkp" },
|
|
63
|
+
1: { className: "x6s0dn4 x14s9m32 x5yr21d x9f619 x78zum5 xdt5ytf x8i8c5o xlaft8j xeq5yr9 xxc7z9f x12rczxh x17qtykl" }
|
|
64
|
+
}[!!isExpanded << 0], props);
|
|
65
|
+
$[0] = t0;
|
|
66
|
+
$[1] = children;
|
|
67
|
+
$[2] = context;
|
|
68
|
+
$[3] = header;
|
|
69
|
+
$[4] = isExpanded;
|
|
70
|
+
$[5] = render;
|
|
71
|
+
$[6] = t1;
|
|
72
|
+
$[7] = t2;
|
|
73
|
+
$[8] = t3;
|
|
74
|
+
$[9] = t4;
|
|
75
|
+
} else {
|
|
76
|
+
children = $[1];
|
|
77
|
+
context = $[2];
|
|
78
|
+
header = $[3];
|
|
79
|
+
isExpanded = $[4];
|
|
80
|
+
render = $[5];
|
|
81
|
+
t1 = $[6];
|
|
82
|
+
t2 = $[7];
|
|
83
|
+
t3 = $[8];
|
|
84
|
+
t4 = $[9];
|
|
85
|
+
}
|
|
86
|
+
let t5;
|
|
87
|
+
if ($[13] !== header || $[14] !== isExpanded) {
|
|
88
|
+
t5 = header === void 0 ? null : /* @__PURE__ */ jsx("div", {
|
|
89
|
+
...{
|
|
90
|
+
0: { className: "x6s0dn4 x9f619 x78zum5 xdt5ytf xqa3g7y" },
|
|
91
|
+
1: { className: "x9f619 x78zum5 xdt5ytf x1cy8zhl x1mgj515" }
|
|
92
|
+
}[!!isExpanded << 0],
|
|
93
|
+
children: header
|
|
94
|
+
});
|
|
95
|
+
$[13] = header;
|
|
96
|
+
$[14] = isExpanded;
|
|
97
|
+
$[15] = t5;
|
|
98
|
+
} else t5 = $[15];
|
|
99
|
+
let t6;
|
|
100
|
+
if ($[16] !== children || $[17] !== t5) {
|
|
101
|
+
t6 = /* @__PURE__ */ jsxs(Fragment$1, { children: [t5, children] });
|
|
102
|
+
$[16] = children;
|
|
103
|
+
$[17] = t5;
|
|
104
|
+
$[18] = t6;
|
|
105
|
+
} else t6 = $[18];
|
|
106
|
+
let t7;
|
|
107
|
+
if ($[19] !== t1 || $[20] !== t2 || $[21] !== t6) {
|
|
108
|
+
t7 = {
|
|
109
|
+
...t1,
|
|
110
|
+
...t2,
|
|
111
|
+
children: t6
|
|
112
|
+
};
|
|
113
|
+
$[19] = t1;
|
|
114
|
+
$[20] = t2;
|
|
115
|
+
$[21] = t6;
|
|
116
|
+
$[22] = t7;
|
|
117
|
+
} else t7 = $[22];
|
|
118
|
+
let t8;
|
|
119
|
+
if ($[23] !== render || $[24] !== t3 || $[25] !== t7) {
|
|
120
|
+
t8 = {
|
|
121
|
+
defaultTagName: t3,
|
|
122
|
+
props: t7,
|
|
123
|
+
render
|
|
124
|
+
};
|
|
125
|
+
$[23] = render;
|
|
126
|
+
$[24] = t3;
|
|
127
|
+
$[25] = t7;
|
|
128
|
+
$[26] = t8;
|
|
129
|
+
} else t8 = $[26];
|
|
130
|
+
const rail = t4(t8);
|
|
131
|
+
let t9;
|
|
132
|
+
if ($[27] !== context || $[28] !== rail) {
|
|
133
|
+
t9 = /* @__PURE__ */ jsx(NavigationContext, {
|
|
134
|
+
value: context,
|
|
135
|
+
children: rail
|
|
136
|
+
});
|
|
137
|
+
$[27] = context;
|
|
138
|
+
$[28] = rail;
|
|
139
|
+
$[29] = t9;
|
|
140
|
+
} else t9 = $[29];
|
|
141
|
+
return t9;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* One destination of a navigation rail — an icon, a label and, when it is the
|
|
145
|
+
* current one, the active indicator. See `NavigationRail`.
|
|
146
|
+
*
|
|
147
|
+
* Defined here rather than re-exported from `src/navigation`: a re-export
|
|
148
|
+
* let the build hand the package entry that module directly, past this
|
|
149
|
+
* module's client directive, and a server component importing it got the
|
|
150
|
+
* component itself rather than a reference to a client one.
|
|
151
|
+
*/
|
|
152
|
+
function NavigationRailItem(props) {
|
|
153
|
+
const $ = c(2);
|
|
154
|
+
let t0;
|
|
155
|
+
if ($[0] !== props) {
|
|
156
|
+
t0 = /* @__PURE__ */ jsx(NavigationItem, { ...props });
|
|
157
|
+
$[0] = props;
|
|
158
|
+
$[1] = t0;
|
|
159
|
+
} else t0 = $[1];
|
|
160
|
+
return t0;
|
|
161
|
+
}
|
|
162
|
+
NavigationRail.Item = NavigationRailItem;
|
|
163
|
+
//#endregion
|
|
164
|
+
export { NavigationRailItem, NavigationRail as default };
|
|
165
|
+
|
|
166
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["c","_c","ReactNode","RefAttributes","stylex","useMemo","NavigationItemProps","RenderComponentProps","NavigationItem","NavigationContext","useRender","mergeStyles","colors","spacing","NavigationRailProps","header","isExpanded","selectedRoute","NavigationRail","t0","$","children","context","render","t1","t2","t3","t4","t5","t6","t7","t8","props","undefined","t9","const","t10","form","0","className","1","defaultTagName","rail","NavigationRailItem","Item","NavigationRailItemProps","_c"],"sources":["../../../src/components/navigation-rail/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { useMemo } from 'react';\nimport type { NavigationItemProps } from '../../navigation';\nimport type { RenderComponentProps } from '../../render/useRender';\nimport { NavigationItem } from '../../navigation';\nimport { NavigationContext } from '../../navigation/context';\nimport { useRender } from '../../render/useRender';\nimport { mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, spacing } from '../../tokens/design.tokens.stylex';\n\n// The navigation rail page's rail, in both its forms: collapsed, a 96dp\n// column of vertical destinations down the leading edge of a medium or wider\n// window, and expanded, between 220dp and 360dp with each destination the\n// page's 56dp horizontal pill. The expanded rail is what the page has\n// replace the navigation drawer, so an app's top-level destinations reach\n// every window size between this and NavigationBar. Both forms are on the\n// surface role, with their contents 44dp from the top: the first destination,\n// or a header when the rail has one — a menu button that expands it, say —\n// with the first destination 40dp under it. The destinations are\n// `src/navigation`'s, shared with NavigationBar, which holds their values.\n//\n// The rail is a `<nav>`, and a page usually has more than one navigation\n// landmark, so name it with `aria-label`.\n\ntype NavigationRailProps = RenderComponentProps<'nav'> & {\n /**\n * What the rail draws above its destinations: a menu button that expands\n * it, or a floating action button.\n */\n header?: ReactNode;\n /**\n * Whether the rail is in its expanded form, each destination a pill with\n * its label beside the icon, rather than collapsed with the label under it.\n * @default false\n */\n isExpanded?: boolean;\n /**\n * The route of the current destination, matched against each\n * destination's `href`. The match carries `aria-current=\"page\"` and the\n * active indicator.\n */\n selectedRoute?: string;\n};\n\n/**\n * The column of top-level destinations a medium or wider window keeps at its\n * leading edge, collapsed or, with `isExpanded`, expanded. Each destination\n * is a link, so it routes through React Aria's `RouterProvider` when the app\n * has one.\n *\n * ```tsx\n * <NavigationRail aria-label=\"Label\" selectedRoute=\"/first\">\n * <NavigationRail.Item href=\"/first\" icon={<FirstIcon />}>\n * First item\n * </NavigationRail.Item>\n * <NavigationRail.Item href=\"/second\" icon={<SecondIcon />}>\n * Second item\n * </NavigationRail.Item>\n * </NavigationRail>\n * ```\n *\n * The call site's `className` and `style` land on the `<nav>`.\n */\nfunction NavigationRail({\n children,\n header,\n isExpanded = false,\n render,\n selectedRoute,\n ...props\n}: NavigationRailProps) {\n const context = useMemo(() => ({\n form: isExpanded ? 'expanded' as const : 'collapsed' as const,\n selectedRoute\n }), [isExpanded, selectedRoute]);\n const rail = useRender({\n defaultTagName: 'nav',\n props: {\n ...props,\n ...mergeStyles({\n 0: {\n className: \"x6s0dn4 x14s9m32 x5yr21d x9f619 x78zum5 xdt5ytf x8i8c5o xlaft8j xzoy561 x13oubkp\"\n },\n 1: {\n className: \"x6s0dn4 x14s9m32 x5yr21d x9f619 x78zum5 xdt5ytf x8i8c5o xlaft8j xeq5yr9 xxc7z9f x12rczxh x17qtykl\"\n }\n }[!!isExpanded << 0], props),\n children: <>\n {header === undefined ? null : <div {...{\n 0: {\n className: \"x6s0dn4 x9f619 x78zum5 xdt5ytf xqa3g7y\"\n },\n 1: {\n className: \"x9f619 x78zum5 xdt5ytf x1cy8zhl x1mgj515\"\n }\n }[!!isExpanded << 0]}>\n {header}\n </div>}\n {children}\n </>\n },\n render\n });\n return <NavigationContext value={context}>{rail}</NavigationContext>;\n}\n\n/**\n * One destination of a navigation rail — an icon, a label and, when it is the\n * current one, the active indicator. See `NavigationRail`.\n *\n * Defined here rather than re-exported from `src/navigation`: a re-export\n * let the build hand the package entry that module directly, past this\n * module's client directive, and a server component importing it got the\n * component itself rather than a reference to a client one.\n */\nfunction NavigationRailItem(props: NavigationItemProps & RefAttributes<HTMLAnchorElement>) {\n return <NavigationItem {...props} />;\n}\nNavigationRail.Item = NavigationRailItem;\nexport type { NavigationItemProps as NavigationRail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CAAA,IAAAd,EAAA,QAAAE,WAAAF,EAAA,QAAAsB,MAAA;EACIR,KAAA,oBAAC,mBAAD;GAA0BZ,OAAAA;GAAUoB,UAAAA;EAAlB,CAAA;EAA2CtB,EAAA,MAAAE;EAAAF,EAAA,MAAAsB;EAAAtB,EAAA,MAAAc;CAAA,OAAAA,KAAAd,EAAA;CAAA,OAA7Dc;AAA6D;;;;;;;;;;AAYtE,SAAAS,mBAAAX,OAAA;CAAA,MAAAZ,IAAAnB,EAAA,CAAA;CAAA,IAAAkB;CAAA,IAAAC,EAAA,OAAAY,OAAA;EACSb,KAAA,oBAAC,gBAAD,EAAe,GAAKa,MAAK,CAAA;EAAIZ,EAAA,KAAAY;EAAAZ,EAAA,KAAAD;CAAA,OAAAA,KAAAC,EAAA;CAAA,OAA7BD;AAA6B;AAEtCD,eAAe0B,OAAOD"}
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import { ReactNode, RefAttributes } from "react";
|
|
2
2
|
import { NavigationTreeItemProps, NavigationTreeProps, NavigationTreeSection } from "react-aria-components";
|
|
3
3
|
//#region src/components/navigation-tree/index.d.ts
|
|
4
|
-
type NavigationTreeHeaderProps = {
|
|
5
|
-
/** The section's heading. */
|
|
6
|
-
children?: ReactNode;
|
|
7
|
-
};
|
|
8
4
|
type NavigationTreeItemProps$1<T extends object = object> = NavigationTreeItemText & Omit<NavigationTreeItemProps<T>, 'children' | 'className' | 'style' | 'textValue'> & {
|
|
9
5
|
/** The rows nested under this one, as further `NavigationTree.Item` entries. */
|
|
10
6
|
children?: ReactNode;
|
|
@@ -90,5 +86,5 @@ declare function NavigationTreeItem$1<T extends object = object>({ children, lab
|
|
|
90
86
|
*/
|
|
91
87
|
declare function NavigationTreeSection$1<T extends object = object>({ children, header, ...props }: NavigationTreeSectionProps<T>): import("react").JSX.Element;
|
|
92
88
|
//#endregion
|
|
93
|
-
export {
|
|
89
|
+
export { NavigationTreeItem$1 as NavigationTreeItem, type NavigationTreeItemProps$1 as NavigationTreeItemProps, type NavigationTreeProps$1 as NavigationTreeProps, NavigationTreeSection$1 as NavigationTreeSection, type NavigationTreeSectionProps, NavigationTree$1 as default };
|
|
94
90
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -40,8 +40,8 @@ function chevronFor(state) {
|
|
|
40
40
|
className: chevronClassName,
|
|
41
41
|
slot: "chevron",
|
|
42
42
|
children: /* @__PURE__ */ jsx(ChevronEndGlyph, { ...{
|
|
43
|
-
0: { className: "x12w9bfk xxk0z11 xvy4d1p
|
|
44
|
-
1: { className: "x12w9bfk xxk0z11 xvy4d1p xkzkux9 x11xpdln xpc4ca7
|
|
43
|
+
0: { className: "x12w9bfk xxk0z11 xvy4d1p xu3v78v x1c071of xkzkux9 x11xpdln xpc4ca7" },
|
|
44
|
+
1: { className: "x12w9bfk xxk0z11 xvy4d1p xkzkux9 x11xpdln xpc4ca7 xaaet9u x1iffjtl" }
|
|
45
45
|
}[!!state.isExpanded << 0] })
|
|
46
46
|
});
|
|
47
47
|
}
|
|
@@ -261,6 +261,6 @@ function textValueFor(textValue, label) {
|
|
|
261
261
|
NavigationTree$1.Item = NavigationTreeItem$1;
|
|
262
262
|
NavigationTree$1.Section = NavigationTreeSection$1;
|
|
263
263
|
//#endregion
|
|
264
|
-
export { NavigationTree$1 as default };
|
|
264
|
+
export { NavigationTreeItem$1 as NavigationTreeItem, NavigationTreeSection$1 as NavigationTreeSection, NavigationTree$1 as default };
|
|
265
265
|
|
|
266
266
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["c","_c","ReactNode","RefAttributes","NavigationTreeItemRenderProps","NavigationTreeItemProps","RACNavigationTreeItemProps","NavigationTreeProps","RACNavigationTreeProps","stylex","Button","RACButton","NavigationTree","RACNavigationTree","NavigationTreeHeader","RACNavigationTreeHeader","NavigationTreeItem","RACNavigationTreeItem","NavigationTreeItemContent","RACNavigationTreeItemContent","NavigationTreeSection","RACNavigationTreeSection","collectionStyles","ChevronEndGlyph","useRipple","RowContent","rowStyles","focus","mergeStatefulStyles","mergeStyles","colors","motion","radii","spacing","typography","styles","chevron","kGNEyG","kWkggS","kaIpWk","kMzoRj","kB7OPa","kMwMTN","kkrTdU","k1xSpc","kmuXW","kjj79g","kmVPX3","$$css","indent","kZCmMZ","NavigationTreeHeaderProps","children","NavigationTreeItemText","Omit","T","className","leading","style","supporting","trailing","label","textValue","NavigationTreeSectionProps","Parameters","header","chevronClassName","props","ring","chevronFor","state","hasChildItems","isExpanded","itemContent","ripple","isDisabled","isCurrentAncestor","isCurrent","leadingFor","itemStyles","base","drawer","selectedDrawer","isHovered","hovered","isFocusVisible","focusVisible","isPressed","pressed","disabled","$","t0","container","t1","onContextMenu","onPointerCancel","onPointerDown","onPointerLeave","onPointerUp","T0","t2","textValueFor","t3","handlers","t4","t5","surface","t6","t7","section","undefined","Item","Section","stylex.props","RACButton","NavigationTree","_c","props","RACNavigationTree","NavigationTreeHeader","RACNavigationTreeHeader","NavigationTreeItem","RACNavigationTreeItem","RACNavigationTreeItemContent","NavigationTreeSection","RACNavigationTreeSection"],"sources":["../../../src/components/navigation-tree/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { NavigationTreeItemRenderProps, NavigationTreeItemProps as RACNavigationTreeItemProps, NavigationTreeProps as RACNavigationTreeProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { Button as RACButton, NavigationTree as RACNavigationTree, NavigationTreeHeader as RACNavigationTreeHeader, NavigationTreeItem as RACNavigationTreeItem, NavigationTreeItemContent as RACNavigationTreeItemContent, NavigationTreeSection as RACNavigationTreeSection } from 'react-aria-components';\nimport { collectionStyles } from '../../collection/styles';\nimport { ChevronEndGlyph } from '../../glyphs';\nimport { useRipple } from '../../hooks/useRipple';\nimport { RowContent } from '../../row';\nimport { rowStyles } from '../../row/styles';\nimport { focus } from '../../styles/focus';\nimport { mergeStatefulStyles, mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, motion, radii, spacing, typography } from '../../tokens/design.tokens.stylex';\n\n// The navigation drawer page's contents: a nested set of links with the\n// current one marked. Each row is the row every list here draws — `src/row`,\n// shared with ListItem, ListBox, List, Tree and Disclosure — under that\n// module's `drawer` variant, which is the page's own 56dp row with a\n// label-large label and a secondary-container pill on the current one.\n//\n// This is Tree's shape over React Aria's navigation primitive, and the\n// difference is what the two are for. A tree selects: rows are chosen and\n// the choice is reported. A navigation tree navigates: each row is a link,\n// and which one is current is decided by matching the route rather than by\n// anything the reader selected. So this takes `selectedRoute` where Tree\n// takes `selectedKeys`, and has no selection at all — React Aria omits every\n// selection prop from it.\n//\n// Three things are this component's own.\n//\n// **A level indents by one caret's width**, exactly as Tree does and for the\n// same reason: React Aria writes the depth on each row as a custom property,\n// and 24dp is the size the drawer page gives its icon, so a level of nesting\n// is as wide as the glyph beside it.\n//\n// **An ancestor of the current row is marked too, and softly.** React Aria\n// reports it, and a drawer whose current row is collapsed out of sight would\n// otherwise show nothing at all. It takes the label's weight rather than the\n// pill, so the trail reads as a trail rather than as a second current row.\n//\n// That weight goes on the label itself, through the row module's\n// `isEmphasized`, and it has to: the row's own `font-weight` never reaches\n// the text, since `RowContent` draws the label in a span stating the\n// label-large role in full, weight included. The pair also has to differ by\n// more than a step — the label's own weight is already the medium one, so a\n// trail set in medium is a trail nobody can see.\n//\n// **The pill's shape is the library's own.** The page gives the active\n// indicator's colour, height and width but keeps its shape behind a token\n// set that does not open to a script — the same gap recorded on the buttons\n// and lists pages. It is drawn as a full pill, which is what the page's own\n// images show and what 56dp of height comes to.\n\nconst styles = {\n chevron: {\n kGNEyG: \"x6s0dn4\",\n kWkggS: \"xjbqb8w\",\n kaIpWk: \"x1dkaolv\",\n kMzoRj: \"xc342km\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x1heor9g\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x78zum5\",\n kmuXW: \"x2lah0s\",\n kjj79g: \"xl56j7k\",\n kmVPX3: \"x1717udv\",\n $$css: true\n },\n indent: {\n kZCmMZ: \"x1187sqy\",\n $$css: true\n }\n};\ntype NavigationTreeHeaderProps = {\n /** The section's heading. */\n children?: ReactNode;\n};\ntype NavigationTreeItemProps<T extends object = object> = NavigationTreeItemText & Omit<RACNavigationTreeItemProps<T>, 'children' | 'className' | 'style' | 'textValue'> & {\n /** The rows nested under this one, as further `NavigationTree.Item` entries. */\n children?: ReactNode;\n /** A function may compute the class from the row's render state. */\n className?: RACNavigationTreeItemProps<T>['className'];\n /** Content before the label: an icon. */\n leading?: ReactNode;\n /** A function may compute the style from the row's render state. */\n style?: RACNavigationTreeItemProps<T>['style'];\n /** A second line under the label, in the muted role. */\n supporting?: ReactNode;\n /** Content after the label, such as a count. */\n trailing?: ReactNode;\n};\n\n// What the row is worth as text, which React Aria requires: a row here wraps\n// its label in elements, so it cannot read one off the children the way a\n// plain-string child would give it. A string label is taken as the value,\n// which is the common case; anything else has to say what it is worth, and\n// this is what makes the compiler ask rather than leaving a row unnamed.\ntype NavigationTreeItemText = {\n /** The row's label — where it goes. */\n label: string;\n /** What typeahead matches the row on. Defaults to the label. */\n textValue?: string;\n} | {\n /** The row's label, as something other than a plain string. */\n label?: ReactNode;\n /** What typeahead matches the row on, and what names it. */\n textValue: string;\n};\ntype NavigationTreeProps<T extends object = object> = Omit<RACNavigationTreeProps<T>, 'className' | 'style'> & {\n /** A function may compute the class from the tree's render state. */\n className?: RACNavigationTreeProps<T>['className'];\n /** A function may compute the style from the tree's render state. */\n style?: RACNavigationTreeProps<T>['style'];\n};\ntype NavigationTreeSectionProps<T extends object = object> = Omit<Parameters<typeof RACNavigationTreeSection<T>>[0], 'children'> & {\n /**\n * The rows in the section. A section built from data puts React Aria's\n * `Collection` in here rather than a render function, since the header is\n * an element beside them.\n */\n children?: ReactNode;\n /**\n * The section's heading, rendered through React Aria's header so the\n * section is named by it. A section without one is a group with no name.\n */\n header?: ReactNode;\n};\n\n// The button itself never turns — the glyph inside it does, so the press\n// target stays a square whichever way the row is pointing.\nfunction chevronClassName() {\n return stylex.props(styles.chevron, focus.ring).className ?? '';\n}\n\n// The caret, or the space it would have taken. Written as a call rather than\n// inline at the prop, which is what react-perf's no-new-function-as-prop and\n// jsx-no-jsx-as-prop are after; the React Compiler memoises the result on\n// its inputs.\n//\n// A leaf gets the space rather than nothing, so its label lines up with the\n// label of a sibling that opens.\nfunction chevronFor(state: NavigationTreeItemRenderProps): ReactNode {\n if (!state.hasChildItems) {\n return <span className=\"xxk0z11 x2lah0s xvy4d1p\" />;\n }\n return <RACButton className={chevronClassName} slot=\"chevron\">\n <ChevronEndGlyph {...{\n 0: {\n className: \"x12w9bfk xxk0z11 xvy4d1p x19axjrm x1c071of xkzkux9 x11xpdln xpc4ca7\"\n },\n 1: {\n className: \"x12w9bfk xxk0z11 xvy4d1p xkzkux9 x11xpdln xpc4ca7 x1y10d4b x1iffjtl\"\n }\n }[!!state.isExpanded << 0]} />\n </RACButton>;\n}\n\n// What a row draws, from React Aria's render state. The caret comes first,\n// then whatever the row was given — one order, always, which is what keeps a\n// column of rows reading down.\nfunction itemContent(label: ReactNode, leading: ReactNode, supporting: ReactNode, trailing: ReactNode, ripple: ReactNode) {\n return (state: NavigationTreeItemRenderProps): ReactNode => <>\n <RowContent isDisabled={state.isDisabled} isEmphasized={state.isCurrentAncestor} isSelected={state.isCurrent} leading={leadingFor(state, leading)} supporting={supporting} trailing={trailing} variant=\"drawer\">\n {label}\n </RowContent>\n {state.isDisabled ? null : ripple}\n </>;\n}\n\n// StyleX cannot target `[data-current]` on the element it is styling, so a\n// row's state comes from the render state React Aria hands its className.\n// The order matters: `disabled` is applied last so its ground and colour\n// win over the current container's. The state layers come from the render\n// state as well — see `focusVisible` in src/row/styles.ts — and React Aria\n// reports none of them on a disabled row, so nothing has to outrank them.\n// No overline, and so no three-line row: the navigation drawer page gives\n// one item height and one line of text. `List.Item` and `ListBox.Item` take\n// the prop because the lists page is what they draw; this row follows the\n// drawer's own metrics.\nfunction itemStyles(state: NavigationTreeItemRenderProps) {\n return stylex.props(rowStyles.base, rowStyles.drawer, styles.indent, state.isCurrent && rowStyles.selectedDrawer, state.isHovered && rowStyles.hovered, state.isFocusVisible && rowStyles.focusVisible, state.isPressed && rowStyles.pressed, state.isDisabled && rowStyles.disabled);\n}\n\n/**\n * The caret, then whatever the row was given. Its return type is written out\n * rather than inferred: `ReactNode` is a union that includes a promise, and\n * a function inferred as returning one has to be `async`.\n */\nfunction leadingFor(state: NavigationTreeItemRenderProps, leading: ReactNode): ReactNode {\n return <>\n {chevronFor(state)}\n {leading}\n </>;\n}\n\n/**\n * A nested set of links, with the current one marked. Which row is current\n * is React Aria's: give the tree a `selectedRoute` and each row an `href`,\n * and the row whose `href` matches is the current one — its ancestors are\n * marked too, so a collapsed trail still shows where you are.\n *\n * ```tsx\n * <NavigationTree aria-label=\"Label\" selectedRoute=\"#second\">\n * <NavigationTree.Item href=\"#first\" id=\"first\" label=\"First item\">\n * <NavigationTree.Item href=\"#second\" id=\"second\" label=\"Second item\" />\n * </NavigationTree.Item>\n * </NavigationTree>\n * ```\n *\n * There is no selection here, and that is React Aria's design rather than an\n * omission: a navigation tree navigates, so what is current comes from the\n * route rather than from anything the reader picked. `Tree` is the one that\n * selects.\n *\n * The call site's `className` and `style` land on the container, which is\n * the element a layout positions.\n */\nfunction NavigationTree<T extends object>(props: NavigationTreeProps<T> & RefAttributes<HTMLDivElement>) {\n return <RACNavigationTree<T> {...props} {...mergeStatefulStyles(stylex.props(collectionStyles.container), props)} />;\n}\n\n/**\n * A named group of rows. `header` names it, and is what a screen reader\n * reads before the rows inside.\n */\nfunction NavigationTreeHeader({\n children\n}: NavigationTreeHeaderProps) {\n return <RACNavigationTreeHeader className=\"x9f619 x1w5n3ug xkknnkr x14zspaw x1v9cpvo x155f00i x1lz68p4 xw3mh6e x1clyivc x140yoea\">\n {children}\n </RACNavigationTreeHeader>;\n}\n\n/**\n * One row, and the rows under it. Give it an `href` — that is what\n * `selectedRoute` is matched against — and an `id`, which is the key\n * expansion is reported by.\n *\n * Rows nested as `children` are what make it a branch; a row with none is a\n * leaf and draws no caret.\n */\nfunction NavigationTreeItem<T extends object = object>({\n children,\n label,\n leading,\n onContextMenu,\n onPointerCancel,\n onPointerDown,\n onPointerLeave,\n onPointerUp,\n supporting,\n textValue,\n trailing,\n ...props\n}: NavigationTreeItemProps<T>) {\n // The press ripple List's rows draw — see ListItem there.\n const ripple = useRipple<HTMLDivElement>(true, {\n onContextMenu,\n onPointerCancel,\n onPointerDown,\n onPointerLeave,\n onPointerUp\n }, true);\n return <RACNavigationTreeItem<T> textValue={textValueFor(textValue, label)} {...ripple.handlers} {...props} {...mergeStatefulStyles(itemStyles, props)}>\n <RACNavigationTreeItemContent>\n {itemContent(label, leading, supporting, trailing, ripple.surface)}\n </RACNavigationTreeItemContent>\n {children}\n </RACNavigationTreeItem>;\n}\n\n/**\n * A named group of rows, with its heading above them.\n */\nfunction NavigationTreeSection<T extends object = object>({\n children,\n header,\n ...props\n}: NavigationTreeSectionProps<T>) {\n return <RACNavigationTreeSection<T> {...props} {...mergeStyles(stylex.props(collectionStyles.section), props)}>\n {header === undefined ? null : <NavigationTreeHeader>{header}</NavigationTreeHeader>}\n {children}\n </RACNavigationTreeSection>;\n}\n\n// What React Aria matches typeahead on, and what names the row.\n// `NavigationTreeItemText` makes one of the two a string, so the last branch\n// is unreachable through the public type — it is there because destructuring\n// the two apart is what loses the narrowing, not because a row can arrive\n// without either.\nfunction textValueFor(textValue: string | undefined, label: ReactNode) {\n if (textValue !== undefined) {\n return textValue;\n }\n return typeof label === 'string' ? label : '';\n}\nNavigationTree.Item = NavigationTreeItem;\nNavigationTree.Section = NavigationTreeSection;\nexport type { NavigationTreeHeaderProps, NavigationTreeItemProps, NavigationTreeProps, NavigationTreeSectionProps };\nexport default NavigationTree;"],"mappings":";;;;;;;;;;;;;AAuDA,MAAMmC,SAAS;CACbC,SAAS;EACPC,Q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AAgCyB,EAAA,KAAAzB;EAAAyB,EAAA,KAAAY;CAAA,OAAAA,KAAAZ,EAAA;CAAA,IAAAc;CAAA,IAAAd,EAAA,OAAAS,MAAAT,EAAA,OAAAtC,YAAAsC,EAAA,QAAAG,MAAAH,EAAA,QAAAU,MAAAV,EAAA,QAAAY,IAAA;EADjFE,KAAA,qBAAC,IAAD;GAAyB,GAAQrC;GAAK,GAAMiC;GAA5C,UAAA,CACFE,IACAlD,QAF2B;;EAGHsC,EAAA,KAAAS;EAAAT,EAAA,KAAAtC;EAAAsC,EAAA,MAAAG;EAAAH,EAAA,MAAAU;EAAAV,EAAA,MAAAY;EAAAZ,EAAA,MAAAc;CAAA,OAAAA,KAAAd,EAAA;CAAA,OAHtBc;AAGsB;AAQ/B,SAASH,aAAavC,WAA+BD,OAAkB;CACrE,IAAIC,cAAcgD,KAAAA,GAChB,OAAOhD;CAET,OAAO,OAAOD,UAAU,WAAWA,QAAQ;AAC7C;AACAjD,iBAAemG,OAAO/F;AACtBJ,iBAAeoG,UAAU5F"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["c","_c","ReactNode","RefAttributes","NavigationTreeItemRenderProps","NavigationTreeItemProps","RACNavigationTreeItemProps","NavigationTreeProps","RACNavigationTreeProps","stylex","Button","RACButton","NavigationTree","RACNavigationTree","NavigationTreeHeader","RACNavigationTreeHeader","NavigationTreeItem","RACNavigationTreeItem","NavigationTreeItemContent","RACNavigationTreeItemContent","NavigationTreeSection","RACNavigationTreeSection","collectionStyles","ChevronEndGlyph","useRipple","RowContent","rowStyles","focus","mergeStatefulStyles","mergeStyles","colors","motion","radii","spacing","typography","styles","chevron","kGNEyG","kWkggS","kaIpWk","kMzoRj","kB7OPa","kMwMTN","kkrTdU","k1xSpc","kmuXW","kjj79g","kmVPX3","$$css","indent","kZCmMZ","NavigationTreeHeaderProps","children","NavigationTreeItemText","Omit","T","className","leading","style","supporting","trailing","label","textValue","NavigationTreeSectionProps","Parameters","header","chevronClassName","props","ring","chevronFor","state","hasChildItems","isExpanded","itemContent","ripple","isDisabled","isCurrentAncestor","isCurrent","leadingFor","itemStyles","base","drawer","selectedDrawer","isHovered","hovered","isFocusVisible","focusVisible","isPressed","pressed","disabled","$","t0","container","t1","onContextMenu","onPointerCancel","onPointerDown","onPointerLeave","onPointerUp","T0","t2","textValueFor","t3","handlers","t4","t5","surface","t6","t7","section","undefined","Item","Section","stylex.props","RACButton","NavigationTree","_c","props","RACNavigationTree","NavigationTreeHeader","RACNavigationTreeHeader","NavigationTreeItem","RACNavigationTreeItem","RACNavigationTreeItemContent","NavigationTreeSection","RACNavigationTreeSection"],"sources":["../../../src/components/navigation-tree/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { NavigationTreeItemRenderProps, NavigationTreeItemProps as RACNavigationTreeItemProps, NavigationTreeProps as RACNavigationTreeProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { Button as RACButton, NavigationTree as RACNavigationTree, NavigationTreeHeader as RACNavigationTreeHeader, NavigationTreeItem as RACNavigationTreeItem, NavigationTreeItemContent as RACNavigationTreeItemContent, NavigationTreeSection as RACNavigationTreeSection } from 'react-aria-components';\nimport { collectionStyles } from '../../collection/styles';\nimport { ChevronEndGlyph } from '../../glyphs';\nimport { useRipple } from '../../hooks/useRipple';\nimport { RowContent } from '../../row';\nimport { rowStyles } from '../../row/styles';\nimport { focus } from '../../styles/focus';\nimport { mergeStatefulStyles, mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, motion, radii, spacing, typography } from '../../tokens/design.tokens.stylex';\n\n// The navigation drawer page's contents: a nested set of links with the\n// current one marked. For an app's top-level destinations Material Design has\n// the expanded navigation rail replace the drawer, and NavigationRail draws\n// it; this is for a tree of links nested deeper than a rail holds. Each row is\n// the row every list here draws — `src/row`, shared with ListItem, ListBox,\n// List, Tree and Disclosure — under that module's `drawer` variant, which is\n// the page's own 56dp row with a label-large label and a secondary-container\n// pill on the current one.\n//\n// This is Tree's shape over React Aria's navigation primitive, and the\n// difference is what the two are for. A tree selects: rows are chosen and\n// the choice is reported. A navigation tree navigates: each row is a link,\n// and which one is current is decided by matching the route rather than by\n// anything the reader selected. So this takes `selectedRoute` where Tree\n// takes `selectedKeys`, and has no selection at all — React Aria omits every\n// selection prop from it.\n//\n// Three things are this component's own.\n//\n// **A level indents by one caret's width**, exactly as Tree does and for the\n// same reason: React Aria writes the depth on each row as a custom property,\n// and 24dp is the size the drawer page gives its icon, so a level of nesting\n// is as wide as the glyph beside it.\n//\n// **An ancestor of the current row is marked too, and softly.** React Aria\n// reports it, and a drawer whose current row is collapsed out of sight would\n// otherwise show nothing at all. It takes the label's weight rather than the\n// pill, so the trail reads as a trail rather than as a second current row.\n//\n// That weight goes on the label itself, through the row module's\n// `isEmphasized`, and it has to: the row's own `font-weight` never reaches\n// the text, since `RowContent` draws the label in a span stating the\n// label-large role in full, weight included. The pair also has to differ by\n// more than a step — the label's own weight is already the medium one, so a\n// trail set in medium is a trail nobody can see.\n//\n// **The pill's shape is the library's own.** The page gives the active\n// indicator's colour, height and width but keeps its shape behind a token\n// set that does not open to a script — the same gap recorded on the buttons\n// and lists pages. It is drawn as a full pill, which is what the page's own\n// images show and what 56dp of height comes to.\n\nconst styles = {\n chevron: {\n kGNEyG: \"x6s0dn4\",\n kWkggS: \"xjbqb8w\",\n kaIpWk: \"x1dkaolv\",\n kMzoRj: \"xc342km\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x1heor9g\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x78zum5\",\n kmuXW: \"x2lah0s\",\n kjj79g: \"xl56j7k\",\n kmVPX3: \"x1717udv\",\n $$css: true\n },\n indent: {\n kZCmMZ: \"x1187sqy\",\n $$css: true\n }\n};\ntype NavigationTreeHeaderProps = {\n /** The section's heading. */\n children?: ReactNode;\n};\ntype NavigationTreeItemProps<T extends object = object> = NavigationTreeItemText & Omit<RACNavigationTreeItemProps<T>, 'children' | 'className' | 'style' | 'textValue'> & {\n /** The rows nested under this one, as further `NavigationTree.Item` entries. */\n children?: ReactNode;\n /** A function may compute the class from the row's render state. */\n className?: RACNavigationTreeItemProps<T>['className'];\n /** Content before the label: an icon. */\n leading?: ReactNode;\n /** A function may compute the style from the row's render state. */\n style?: RACNavigationTreeItemProps<T>['style'];\n /** A second line under the label, in the muted role. */\n supporting?: ReactNode;\n /** Content after the label, such as a count. */\n trailing?: ReactNode;\n};\n\n// What the row is worth as text, which React Aria requires: a row here wraps\n// its label in elements, so it cannot read one off the children the way a\n// plain-string child would give it. A string label is taken as the value,\n// which is the common case; anything else has to say what it is worth, and\n// this is what makes the compiler ask rather than leaving a row unnamed.\ntype NavigationTreeItemText = {\n /** The row's label — where it goes. */\n label: string;\n /** What typeahead matches the row on. Defaults to the label. */\n textValue?: string;\n} | {\n /** The row's label, as something other than a plain string. */\n label?: ReactNode;\n /** What typeahead matches the row on, and what names it. */\n textValue: string;\n};\ntype NavigationTreeProps<T extends object = object> = Omit<RACNavigationTreeProps<T>, 'className' | 'style'> & {\n /** A function may compute the class from the tree's render state. */\n className?: RACNavigationTreeProps<T>['className'];\n /** A function may compute the style from the tree's render state. */\n style?: RACNavigationTreeProps<T>['style'];\n};\ntype NavigationTreeSectionProps<T extends object = object> = Omit<Parameters<typeof RACNavigationTreeSection<T>>[0], 'children'> & {\n /**\n * The rows in the section. A section built from data puts React Aria's\n * `Collection` in here rather than a render function, since the header is\n * an element beside them.\n */\n children?: ReactNode;\n /**\n * The section's heading, rendered through React Aria's header so the\n * section is named by it. A section without one is a group with no name.\n */\n header?: ReactNode;\n};\n\n// The button itself never turns — the glyph inside it does, so the press\n// target stays a square whichever way the row is pointing.\nfunction chevronClassName() {\n return stylex.props(styles.chevron, focus.ring).className ?? '';\n}\n\n// The caret, or the space it would have taken. Written as a call rather than\n// inline at the prop, which is what react-perf's no-new-function-as-prop and\n// jsx-no-jsx-as-prop are after; the React Compiler memoises the result on\n// its inputs.\n//\n// A leaf gets the space rather than nothing, so its label lines up with the\n// label of a sibling that opens.\nfunction chevronFor(state: NavigationTreeItemRenderProps): ReactNode {\n if (!state.hasChildItems) {\n return <span className=\"xxk0z11 x2lah0s xvy4d1p\" />;\n }\n return <RACButton className={chevronClassName} slot=\"chevron\">\n <ChevronEndGlyph {...{\n 0: {\n className: \"x12w9bfk xxk0z11 xvy4d1p xu3v78v x1c071of xkzkux9 x11xpdln xpc4ca7\"\n },\n 1: {\n className: \"x12w9bfk xxk0z11 xvy4d1p xkzkux9 x11xpdln xpc4ca7 xaaet9u x1iffjtl\"\n }\n }[!!state.isExpanded << 0]} />\n </RACButton>;\n}\n\n// What a row draws, from React Aria's render state. The caret comes first,\n// then whatever the row was given — one order, always, which is what keeps a\n// column of rows reading down.\nfunction itemContent(label: ReactNode, leading: ReactNode, supporting: ReactNode, trailing: ReactNode, ripple: ReactNode) {\n return (state: NavigationTreeItemRenderProps): ReactNode => <>\n <RowContent isDisabled={state.isDisabled} isEmphasized={state.isCurrentAncestor} isSelected={state.isCurrent} leading={leadingFor(state, leading)} supporting={supporting} trailing={trailing} variant=\"drawer\">\n {label}\n </RowContent>\n {state.isDisabled ? null : ripple}\n </>;\n}\n\n// StyleX cannot target `[data-current]` on the element it is styling, so a\n// row's state comes from the render state React Aria hands its className.\n// The order matters: `disabled` is applied last so its ground and colour\n// win over the current container's. The state layers come from the render\n// state as well — see `focusVisible` in src/row/styles.ts — and React Aria\n// reports none of them on a disabled row, so nothing has to outrank them.\n// No overline, and so no three-line row: the navigation drawer page gives\n// one item height and one line of text. `List.Item` and `ListBox.Item` take\n// the prop because the lists page is what they draw; this row follows the\n// drawer's own metrics.\nfunction itemStyles(state: NavigationTreeItemRenderProps) {\n return stylex.props(rowStyles.base, rowStyles.drawer, styles.indent, state.isCurrent && rowStyles.selectedDrawer, state.isHovered && rowStyles.hovered, state.isFocusVisible && rowStyles.focusVisible, state.isPressed && rowStyles.pressed, state.isDisabled && rowStyles.disabled);\n}\n\n/**\n * The caret, then whatever the row was given. Its return type is written out\n * rather than inferred: `ReactNode` is a union that includes a promise, and\n * a function inferred as returning one has to be `async`.\n */\nfunction leadingFor(state: NavigationTreeItemRenderProps, leading: ReactNode): ReactNode {\n return <>\n {chevronFor(state)}\n {leading}\n </>;\n}\n\n/**\n * A nested set of links, with the current one marked. Which row is current\n * is React Aria's: give the tree a `selectedRoute` and each row an `href`,\n * and the row whose `href` matches is the current one — its ancestors are\n * marked too, so a collapsed trail still shows where you are.\n *\n * ```tsx\n * <NavigationTree aria-label=\"Label\" selectedRoute=\"#second\">\n * <NavigationTree.Item href=\"#first\" id=\"first\" label=\"First item\">\n * <NavigationTree.Item href=\"#second\" id=\"second\" label=\"Second item\" />\n * </NavigationTree.Item>\n * </NavigationTree>\n * ```\n *\n * There is no selection here, and that is React Aria's design rather than an\n * omission: a navigation tree navigates, so what is current comes from the\n * route rather than from anything the reader picked. `Tree` is the one that\n * selects.\n *\n * The call site's `className` and `style` land on the container, which is\n * the element a layout positions.\n */\nfunction NavigationTree<T extends object>(props: NavigationTreeProps<T> & RefAttributes<HTMLDivElement>) {\n return <RACNavigationTree<T> {...props} {...mergeStatefulStyles(stylex.props(collectionStyles.container), props)} />;\n}\n\n/**\n * A named group of rows. `header` names it, and is what a screen reader\n * reads before the rows inside.\n */\nfunction NavigationTreeHeader({\n children\n}: NavigationTreeHeaderProps) {\n return <RACNavigationTreeHeader className=\"x9f619 x1w5n3ug xkknnkr x14zspaw x1v9cpvo x155f00i x1lz68p4 xw3mh6e x1clyivc x140yoea\">\n {children}\n </RACNavigationTreeHeader>;\n}\n\n/**\n * One row, and the rows under it. Give it an `href` — that is what\n * `selectedRoute` is matched against — and an `id`, which is the key\n * expansion is reported by.\n *\n * Rows nested as `children` are what make it a branch; a row with none is a\n * leaf and draws no caret.\n */\nfunction NavigationTreeItem<T extends object = object>({\n children,\n label,\n leading,\n onContextMenu,\n onPointerCancel,\n onPointerDown,\n onPointerLeave,\n onPointerUp,\n supporting,\n textValue,\n trailing,\n ...props\n}: NavigationTreeItemProps<T>) {\n // The press ripple List's rows draw — see ListItem there.\n const ripple = useRipple<HTMLDivElement>(true, {\n onContextMenu,\n onPointerCancel,\n onPointerDown,\n onPointerLeave,\n onPointerUp\n }, true);\n return <RACNavigationTreeItem<T> textValue={textValueFor(textValue, label)} {...ripple.handlers} {...props} {...mergeStatefulStyles(itemStyles, props)}>\n <RACNavigationTreeItemContent>\n {itemContent(label, leading, supporting, trailing, ripple.surface)}\n </RACNavigationTreeItemContent>\n {children}\n </RACNavigationTreeItem>;\n}\n\n/**\n * A named group of rows, with its heading above them.\n */\nfunction NavigationTreeSection<T extends object = object>({\n children,\n header,\n ...props\n}: NavigationTreeSectionProps<T>) {\n return <RACNavigationTreeSection<T> {...props} {...mergeStyles(stylex.props(collectionStyles.section), props)}>\n {header === undefined ? null : <NavigationTreeHeader>{header}</NavigationTreeHeader>}\n {children}\n </RACNavigationTreeSection>;\n}\n\n// What React Aria matches typeahead on, and what names the row.\n// `NavigationTreeItemText` makes one of the two a string, so the last branch\n// is unreachable through the public type — it is there because destructuring\n// the two apart is what loses the narrowing, not because a row can arrive\n// without either.\nfunction textValueFor(textValue: string | undefined, label: ReactNode) {\n if (textValue !== undefined) {\n return textValue;\n }\n return typeof label === 'string' ? label : '';\n}\nNavigationTree.Item = NavigationTreeItem;\nNavigationTree.Section = NavigationTreeSection;\nexport type { NavigationTreeItemProps, NavigationTreeProps, NavigationTreeSectionProps };\nexport { NavigationTreeItem, NavigationTreeSection };\nexport default NavigationTree;"],"mappings":";;;;;;;;;;;;;AA0DA,MAAMmC,SAAS;CACbC,SAAS;EACPC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;EACPC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,QAAQ;EACNC,QAAQ;EACRF,OAAO;CACT;AACF;AA0DA,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KAAA,qBAAC,IAAD;GAAyB,GAAQrC;GAAK,GAAMiC;GAA5C,UAAA,CACFE,IACAlD,QAF2B;;EAGHsC,EAAA,KAAAS;EAAAT,EAAA,KAAAtC;EAAAsC,EAAA,MAAAG;EAAAH,EAAA,MAAAU;EAAAV,EAAA,MAAAY;EAAAZ,EAAA,MAAAc;CAAA,OAAAA,KAAAd,EAAA;CAAA,OAHtBc;AAGsB;AAQ/B,SAASH,aAAavC,WAA+BD,OAAkB;CACrE,IAAIC,cAAcgD,KAAAA,GAChB,OAAOhD;CAET,OAAO,OAAOD,UAAU,WAAWA,QAAQ;AAC7C;AACAjD,iBAAemG,OAAO/F;AACtBJ,iBAAeoG,UAAU5F"}
|
|
@@ -4,8 +4,9 @@ import { NumberFieldProps } from "react-aria-components";
|
|
|
4
4
|
//#region src/components/number-field/index.d.ts
|
|
5
5
|
type NumberFieldProps$1 = {
|
|
6
6
|
/**
|
|
7
|
-
* The name of the stepper that lowers the value, for a screen reader.
|
|
8
|
-
*
|
|
7
|
+
* The name of the stepper that lowers the value, for a screen reader. Left
|
|
8
|
+
* out, React Aria names it in the reader's locale, followed by the field's
|
|
9
|
+
* own label — "Decrease Quantity" in English.
|
|
9
10
|
*/
|
|
10
11
|
decrementLabel?: string;
|
|
11
12
|
/**
|
|
@@ -31,8 +32,9 @@ type NumberFieldProps$1 = {
|
|
|
31
32
|
*/
|
|
32
33
|
floatingLabel?: boolean;
|
|
33
34
|
/**
|
|
34
|
-
* The name of the stepper that raises the value, for a screen reader.
|
|
35
|
-
*
|
|
35
|
+
* The name of the stepper that raises the value, for a screen reader. Left
|
|
36
|
+
* out, React Aria names it in the reader's locale, followed by the field's
|
|
37
|
+
* own label — "Increase Quantity" in English.
|
|
36
38
|
*/
|
|
37
39
|
incrementLabel?: string;
|
|
38
40
|
/**
|