@kanso-labs/kanso-ui 0.40.7 → 0.40.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/badge/index.js +15 -0
- package/dist/badge/index.js.map +1 -0
- package/dist/components/avatar/index.d.ts +7 -0
- package/dist/components/avatar/index.js.map +1 -1
- package/dist/components/badge/index.js +96 -48
- package/dist/components/badge/index.js.map +1 -1
- package/dist/components/dialog/index.d.ts +6 -1
- package/dist/components/dialog/index.js +54 -24
- package/dist/components/dialog/index.js.map +1 -1
- package/dist/components/form/index.d.ts +5 -4
- package/dist/components/form/index.js.map +1 -1
- package/dist/components/link/index.js +16 -5
- package/dist/components/link/index.js.map +1 -1
- package/dist/components/menu/index.js +29 -21
- package/dist/components/menu/index.js.map +1 -1
- package/dist/components/navigation-bar/index.js +134 -54
- package/dist/components/navigation-bar/index.js.map +1 -1
- package/dist/components/navigation-rail/index.js +56 -37
- package/dist/components/navigation-rail/index.js.map +1 -1
- package/dist/components/number-field/index.d.ts +13 -2
- package/dist/components/number-field/index.js +95 -84
- package/dist/components/number-field/index.js.map +1 -1
- package/dist/components/popover/index.d.ts +4 -1
- package/dist/components/popover/index.js +239 -137
- package/dist/components/popover/index.js.map +1 -1
- package/dist/components/product-icon/index.d.ts +3 -1
- package/dist/components/product-icon/index.js.map +1 -1
- package/dist/components/progress-indicator/index.js +1 -1
- package/dist/components/progress-indicator/index.js.map +1 -1
- package/dist/components/search-field/index.js +7 -3
- package/dist/components/search-field/index.js.map +1 -1
- package/dist/components/segmented-button/index.d.ts +17 -1
- package/dist/components/segmented-button/index.js +132 -59
- package/dist/components/segmented-button/index.js.map +1 -1
- package/dist/components/sheet/index.d.ts +8 -1
- package/dist/components/sheet/index.js +45 -29
- package/dist/components/sheet/index.js.map +1 -1
- package/dist/components/snackbar/index.d.ts +4 -0
- package/dist/components/snackbar/index.js +54 -49
- package/dist/components/snackbar/index.js.map +1 -1
- package/dist/field/index.js +314 -284
- package/dist/field/index.js.map +1 -1
- package/dist/field/press.js +27 -0
- package/dist/field/press.js.map +1 -0
- package/dist/field/root.js +8 -8
- package/dist/field/root.js.map +1 -1
- package/dist/field/styles.js +22 -0
- package/dist/field/styles.js.map +1 -1
- package/dist/hooks/useBottomEdge.js +83 -0
- package/dist/hooks/useBottomEdge.js.map +1 -0
- package/dist/mark/initials.js +41 -26
- package/dist/mark/initials.js.map +1 -1
- package/dist/navigation/context.js.map +1 -1
- package/dist/navigation/index.js +16 -4
- package/dist/navigation/index.js.map +1 -1
- package/dist/navigation/styles.js +35 -1
- package/dist/navigation/styles.js.map +1 -1
- package/dist/row/styles.js +2 -1
- package/dist/row/styles.js.map +1 -1
- package/dist/styles.css +110 -32
- package/package.json +2 -2
|
@@ -27,7 +27,7 @@ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
|
27
27
|
* The call site's `className` and `style` land on the `<nav>`.
|
|
28
28
|
*/
|
|
29
29
|
function NavigationRail(t0) {
|
|
30
|
-
const $ = c(
|
|
30
|
+
const $ = c(34);
|
|
31
31
|
let children;
|
|
32
32
|
let context;
|
|
33
33
|
let header;
|
|
@@ -59,8 +59,8 @@ function NavigationRail(t0) {
|
|
|
59
59
|
t3 = "nav";
|
|
60
60
|
t1 = props;
|
|
61
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" }
|
|
62
|
+
0: { className: "x6s0dn4 x14s9m32 x5yr21d x9f619 x78zum5 xdt5ytf x2lah0s x8i8c5o xlaft8j xzoy561 x13oubkp" },
|
|
63
|
+
1: { className: "x6s0dn4 x14s9m32 x5yr21d x9f619 x78zum5 xdt5ytf x2lah0s x8i8c5o xlaft8j xeq5yr9 xxc7z9f x12rczxh x17qtykl" }
|
|
64
64
|
}[!!isExpanded << 0], props);
|
|
65
65
|
$[0] = t0;
|
|
66
66
|
$[1] = children;
|
|
@@ -88,7 +88,7 @@ function NavigationRail(t0) {
|
|
|
88
88
|
t5 = header === void 0 ? null : /* @__PURE__ */ jsx("div", {
|
|
89
89
|
...{
|
|
90
90
|
0: { className: "x6s0dn4 x9f619 x78zum5 xdt5ytf xqa3g7y" },
|
|
91
|
-
1: { className: "x9f619 x78zum5 xdt5ytf x1cy8zhl x1mgj515" }
|
|
91
|
+
1: { className: "x9f619 x78zum5 xdt5ytf x1cy8zhl xkh2ocl x1mgj515 xdxifnh" }
|
|
92
92
|
}[!!isExpanded << 0],
|
|
93
93
|
children: header
|
|
94
94
|
});
|
|
@@ -97,48 +97,67 @@ function NavigationRail(t0) {
|
|
|
97
97
|
$[15] = t5;
|
|
98
98
|
} else t5 = $[15];
|
|
99
99
|
let t6;
|
|
100
|
-
if ($[16]
|
|
101
|
-
t6 =
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
100
|
+
if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
|
|
101
|
+
t6 = {
|
|
102
|
+
0: { className: "x6s0dn4 xkh2ocl x9f619 x78zum5 xdl72j9 xdt5ytf x1iyjqo2 xs83m0k x1fh6m6z xfll3lq x2lwn1j x1odjw0f x12ulsxz xfn1xvj" },
|
|
103
|
+
1: { className: "x6s0dn4 xkh2ocl x9f619 x78zum5 xdl72j9 xdt5ytf x1iyjqo2 xs83m0k x1fh6m6z xfll3lq x2lwn1j x1odjw0f x12ulsxz xfn1xvj xzoy561" }
|
|
104
|
+
};
|
|
105
|
+
$[16] = t6;
|
|
106
|
+
} else t6 = $[16];
|
|
107
|
+
const t7 = t6[!!!isExpanded << 0];
|
|
108
|
+
let t8;
|
|
109
|
+
if ($[17] !== children || $[18] !== t7) {
|
|
110
|
+
t8 = /* @__PURE__ */ jsx("div", {
|
|
111
|
+
...t7,
|
|
112
|
+
children
|
|
113
|
+
});
|
|
114
|
+
$[17] = children;
|
|
115
|
+
$[18] = t7;
|
|
116
|
+
$[19] = t8;
|
|
117
|
+
} else t8 = $[19];
|
|
118
|
+
let t9;
|
|
119
|
+
if ($[20] !== t5 || $[21] !== t8) {
|
|
120
|
+
t9 = /* @__PURE__ */ jsxs(Fragment$1, { children: [t5, t8] });
|
|
121
|
+
$[20] = t5;
|
|
122
|
+
$[21] = t8;
|
|
123
|
+
$[22] = t9;
|
|
124
|
+
} else t9 = $[22];
|
|
125
|
+
let t10;
|
|
126
|
+
if ($[23] !== t1 || $[24] !== t2 || $[25] !== t9) {
|
|
127
|
+
t10 = {
|
|
109
128
|
...t1,
|
|
110
129
|
...t2,
|
|
111
|
-
children:
|
|
130
|
+
children: t9
|
|
112
131
|
};
|
|
113
|
-
$[
|
|
114
|
-
$[
|
|
115
|
-
$[
|
|
116
|
-
$[
|
|
117
|
-
} else
|
|
118
|
-
let
|
|
119
|
-
if ($[
|
|
120
|
-
|
|
132
|
+
$[23] = t1;
|
|
133
|
+
$[24] = t2;
|
|
134
|
+
$[25] = t9;
|
|
135
|
+
$[26] = t10;
|
|
136
|
+
} else t10 = $[26];
|
|
137
|
+
let t11;
|
|
138
|
+
if ($[27] !== render || $[28] !== t10 || $[29] !== t3) {
|
|
139
|
+
t11 = {
|
|
121
140
|
defaultTagName: t3,
|
|
122
|
-
props:
|
|
141
|
+
props: t10,
|
|
123
142
|
render
|
|
124
143
|
};
|
|
125
|
-
$[
|
|
126
|
-
$[
|
|
127
|
-
$[
|
|
128
|
-
$[
|
|
129
|
-
} else
|
|
130
|
-
const rail = t4(
|
|
131
|
-
let
|
|
132
|
-
if ($[
|
|
133
|
-
|
|
144
|
+
$[27] = render;
|
|
145
|
+
$[28] = t10;
|
|
146
|
+
$[29] = t3;
|
|
147
|
+
$[30] = t11;
|
|
148
|
+
} else t11 = $[30];
|
|
149
|
+
const rail = t4(t11);
|
|
150
|
+
let t12;
|
|
151
|
+
if ($[31] !== context || $[32] !== rail) {
|
|
152
|
+
t12 = /* @__PURE__ */ jsx(NavigationContext, {
|
|
134
153
|
value: context,
|
|
135
154
|
children: rail
|
|
136
155
|
});
|
|
137
|
-
$[
|
|
138
|
-
$[
|
|
139
|
-
$[
|
|
140
|
-
} else
|
|
141
|
-
return
|
|
156
|
+
$[31] = context;
|
|
157
|
+
$[32] = rail;
|
|
158
|
+
$[33] = t12;
|
|
159
|
+
} else t12 = $[33];
|
|
160
|
+
return t12;
|
|
142
161
|
}
|
|
143
162
|
/**
|
|
144
163
|
* One destination of a navigation rail — an icon, a label and, when it is the
|
|
@@ -1 +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 NavigationRailItemProps, NavigationRailProps };\nexport { NavigationRailItem };\nexport default NavigationRail;"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","names":["c","_c","ReactNode","RefAttributes","stylex","useMemo","NavigationItemProps","RenderComponentProps","NavigationItem","NavigationContext","useRender","mergeStyles","colors","spacing","RING_REACH","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","Symbol","for","t11","defaultTagName","rail","t12","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\n// How far a destination's focus ring reaches past it: the 2dp offset and\n// the 2dp ring. The destinations scroll, and a scroll container clips what\n// overflows it, so the block they scroll in is padded by this much and\n// pulled back out by as much, which leaves every destination where it was\n// and every ring whole.\nconst RING_REACH = '4px';\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 x2lah0s x8i8c5o xlaft8j xzoy561 x13oubkp\"\n },\n 1: {\n className: \"x6s0dn4 x14s9m32 x5yr21d x9f619 x78zum5 xdt5ytf x2lah0s x8i8c5o xlaft8j xeq5yr9 xxc7z9f x12rczxh x17qtykl\"\n }\n }[!!isExpanded << 0], props),\n children: <>\n {header === undefined ? null : <div {...{\n 0: {\n className: \"x6s0dn4 x9f619 x78zum5 xdt5ytf xqa3g7y\"\n },\n 1: {\n className: \"x9f619 x78zum5 xdt5ytf x1cy8zhl xkh2ocl x1mgj515 xdxifnh\"\n }\n }[!!isExpanded << 0]}>\n {header}\n </div>}\n <div {...{\n 0: {\n className: \"x6s0dn4 xkh2ocl x9f619 x78zum5 xdl72j9 xdt5ytf x1iyjqo2 xs83m0k x1fh6m6z xfll3lq x2lwn1j x1odjw0f x12ulsxz xfn1xvj\"\n },\n 1: {\n className: \"x6s0dn4 xkh2ocl x9f619 x78zum5 xdl72j9 xdt5ytf x1iyjqo2 xs83m0k x1fh6m6z xfll3lq x2lwn1j x1odjw0f x12ulsxz xfn1xvj xzoy561\"\n }\n }[!!!isExpanded << 0]}>\n {children}\n </div>\n </>\n },\n render\n });\n return <NavigationContext value={context}>{rail}</NavigationContext>;\n}\n\n/**\n * One destination of a navigation rail — an icon, a label and, when it is the\n * current one, the active indicator. See `NavigationRail`.\n *\n * Defined here rather than re-exported from `src/navigation`: a re-export\n * let the build hand the package entry that module directly, past this\n * module's client directive, and a server component importing it got the\n * component itself rather than a reference to a client one.\n */\nfunction NavigationRailItem(props: NavigationItemProps & RefAttributes<HTMLAnchorElement>) {\n return <NavigationItem {...props} />;\n}\nNavigationRail.Item = NavigationRailItem;\nexport type { NavigationItemProps as NavigationRailItemProps, NavigationRailProps };\nexport { NavigationRailItem };\nexport default NavigationRail;"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyEA,SAAAmB,eAAAC,IAAA;CAAA,MAAAC,IAAApB,EAAA,EAAA;CAAA,IAAAqB;CAAA,IAAAC;CAAA,IAAAP;CAAA,IAAAC;CAAA,IAAAO;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAP,EAAA,OAAAD,IAAA;EAAwB,MAAA,EAAAE,UAAAO,IAAAb,QAAAc,IAAAb,YAAAc,IAAAP,QAAAQ,IAAAd,eAAA,GAAAe,UAAAb;EAAAE,WAAAO;EAAAb,SAAAc;EAAAN,SAAAQ;EAGtBf,aAAAc,OAAAG,KAAAA,IAAA,QAAAH;EAMQ,MAAAI,KAAAlB,aAAa,aAAsB;EAAoB,IAAAoB;EAAA,IAAAhB,EAAA,QAAAH,iBAAAG,EAAA,QAAAc,IAAA;GADhCE,MAAA;IAAAC,MACvBH;IAAuDjB;GAE/D;GAACG,EAAA,MAAAH;GAAAG,EAAA,MAAAc;GAAAd,EAAA,MAAAgB;EAAA,OAAAA,MAAAhB,EAAA;EAHDE,UAA+Bc;EAIlB3B,KAAAA;EACKiB,KAAA;EAEXM,KAAAA;EACAP,KAAAf,YAAY;GAAA4B,GACV,EAAAC,WACU,2FACb;GAACC,GACE,EAAAD,WACU,4GACb;EACF,EAAE,CAAC,CAACvB,cAAc,IAAIgB,KAAK;EAACZ,EAAA,KAAAD;EAAAC,EAAA,KAAAC;EAAAD,EAAA,KAAAE;EAAAF,EAAA,KAAAL;EAAAK,EAAA,KAAAJ;EAAAI,EAAA,KAAAG;EAAAH,EAAA,KAAAI;EAAAJ,EAAA,KAAAK;EAAAL,EAAA,KAAAM;EAAAN,EAAA,KAAAO;CAA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TMLInputElement>;
|
|
45
|
+
/**
|
|
46
|
+
* Whether the mouse wheel and a trackpad's scroll leave the value alone.
|
|
47
|
+
* React Aria steps a focused number field's value with the wheel, so a
|
|
48
|
+
* reader scrolling a long form past a field they had left focused changed
|
|
49
|
+
* its value instead of moving the page. Stepping from the wheel is the
|
|
50
|
+
* call site's to ask for, with `false`.
|
|
51
|
+
* @default true
|
|
52
|
+
*/
|
|
53
|
+
isWheelDisabled?: boolean;
|
|
45
54
|
/**
|
|
46
55
|
* What the field is for. Required rather than optional: a field with no
|
|
47
56
|
* label is a box a screen reader cannot name.
|
|
@@ -68,7 +77,7 @@ type NumberFieldProps$1 = {
|
|
|
68
77
|
* @default 'filled'
|
|
69
78
|
*/
|
|
70
79
|
variant?: FieldVariant;
|
|
71
|
-
} & Omit<NumberFieldProps, 'children' | 'isInvalid' | 'validationBehavior'>;
|
|
80
|
+
} & Omit<NumberFieldProps, 'children' | 'isInvalid' | 'isWheelDisabled' | 'validationBehavior'>;
|
|
72
81
|
/**
|
|
73
82
|
* A labelled number input with steppers. Its value is React Aria's: pass
|
|
74
83
|
* `value` with `onChange` to control it, or `defaultValue` to let it keep
|
|
@@ -76,12 +85,14 @@ type NumberFieldProps$1 = {
|
|
|
76
85
|
* empty. `minValue`, `maxValue` and `step` shape it, and `formatOptions`
|
|
77
86
|
* says how it reads, in the locale the page is in: a currency, a percentage,
|
|
78
87
|
* a unit. Arrow keys step the value, and Page Up and Page Down by ten steps.
|
|
88
|
+
* The mouse wheel scrolls the page past it rather than stepping it, unless
|
|
89
|
+
* `isWheelDisabled` is `false`.
|
|
79
90
|
*
|
|
80
91
|
* The call site's `className` and `style` land on the field as a whole,
|
|
81
92
|
* which is the element a layout positions. The box, label, input and message
|
|
82
93
|
* are the field chrome in `src/field`, shared with every other field.
|
|
83
94
|
*/
|
|
84
|
-
declare function NumberField$1({ decrementLabel, description, error, floatingLabel, incrementLabel, inputRef, isDisabled, label, numeric, steppers, variant, ...props }: NumberFieldProps$1 & RefAttributes<HTMLDivElement>): import("react").JSX.Element;
|
|
95
|
+
declare function NumberField$1({ decrementLabel, description, error, floatingLabel, incrementLabel, inputRef, isDisabled, isWheelDisabled, label, numeric, steppers, variant, ...props }: NumberFieldProps$1 & RefAttributes<HTMLDivElement>): import("react").JSX.Element;
|
|
85
96
|
//#endregion
|
|
86
97
|
export { type NumberFieldProps$1 as NumberFieldProps, NumberField$1 as default };
|
|
87
98
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { props } from "../../node_modules/@stylexjs/stylex/lib/es/stylex.js";
|
|
3
|
-
import { spacing, typography } from "../../tokens/design.tokens.stylex.js";
|
|
3
|
+
import { sizing, spacing, typography } from "../../tokens/design.tokens.stylex.js";
|
|
4
4
|
import { mergeStatefulStyles } from "../../styles/merge.js";
|
|
5
5
|
import { MinusGlyph, PlusGlyph } from "../../glyphs/index.js";
|
|
6
6
|
import IconButton from "../icon-button/index.js";
|
|
@@ -12,6 +12,9 @@ import { Button, NumberField } from "react-aria-components";
|
|
|
12
12
|
//#region src/components/number-field/index.tsx
|
|
13
13
|
`${spacing.sm}${typography.bodySmallLineHeight}${typography.bodyLargeLineHeight}`;
|
|
14
14
|
`${spacing.lg}${typography.bodyLargeLineHeight}`;
|
|
15
|
+
`${typography.bodyLargeLineHeight}${sizing.controlXs}`;
|
|
16
|
+
const STACKED_INSET = `calc(32px - ${spacing.lg} + ${spacing.sm})`;
|
|
17
|
+
const INLINE_INSET = `calc(2 * ${sizing.controlXs} + ${spacing.sm} + ${spacing.md} - ${spacing.lg} + ${spacing.sm})`;
|
|
15
18
|
const styles = {
|
|
16
19
|
stepper: {
|
|
17
20
|
k6CgDc: "x12w9bfk",
|
|
@@ -73,62 +76,66 @@ const styles = {
|
|
|
73
76
|
* empty. `minValue`, `maxValue` and `step` shape it, and `formatOptions`
|
|
74
77
|
* says how it reads, in the locale the page is in: a currency, a percentage,
|
|
75
78
|
* a unit. Arrow keys step the value, and Page Up and Page Down by ten steps.
|
|
79
|
+
* The mouse wheel scrolls the page past it rather than stepping it, unless
|
|
80
|
+
* `isWheelDisabled` is `false`.
|
|
76
81
|
*
|
|
77
82
|
* The call site's `className` and `style` land on the field as a whole,
|
|
78
83
|
* which is the element a layout positions. The box, label, input and message
|
|
79
84
|
* are the field chrome in `src/field`, shared with every other field.
|
|
80
85
|
*/
|
|
81
86
|
function NumberField$1(t0) {
|
|
82
|
-
const $ = c(
|
|
83
|
-
const { decrementLabel, description, error, floatingLabel: t1, incrementLabel, inputRef, isDisabled: t2, label, numeric:
|
|
87
|
+
const $ = c(39);
|
|
88
|
+
const { decrementLabel, description, error, floatingLabel: t1, incrementLabel, inputRef, isDisabled: t2, isWheelDisabled: t3, label, numeric: t4, steppers: t5, variant: t6, ...props$1 } = t0;
|
|
84
89
|
const floatingLabel = t1 === void 0 ? true : t1;
|
|
85
90
|
const isDisabled = t2 === void 0 ? false : t2;
|
|
86
|
-
const
|
|
87
|
-
const
|
|
88
|
-
const
|
|
91
|
+
const isWheelDisabled = t3 === void 0 ? true : t3;
|
|
92
|
+
const numeric = t4 === void 0 ? true : t4;
|
|
93
|
+
const steppers = t5 === void 0 ? "vertical" : t5;
|
|
94
|
+
const variant = t6 === void 0 ? "filled" : t6;
|
|
89
95
|
const inline = steppers === "horizontal";
|
|
90
96
|
const validationBehavior = useFieldValidationBehavior();
|
|
91
97
|
const T0 = NumberField;
|
|
92
|
-
let
|
|
98
|
+
let t7;
|
|
93
99
|
if ($[0] !== error) {
|
|
94
|
-
|
|
100
|
+
t7 = invalidFrom(error);
|
|
95
101
|
$[0] = error;
|
|
96
|
-
$[1] =
|
|
97
|
-
} else
|
|
98
|
-
const
|
|
99
|
-
|
|
102
|
+
$[1] = t7;
|
|
103
|
+
} else t7 = $[1];
|
|
104
|
+
const t8 = mergeStatefulStyles(props(fieldStyles.root), props$1);
|
|
105
|
+
const t9 = inline ? INLINE_INSET : STACKED_INSET;
|
|
106
|
+
let t10;
|
|
100
107
|
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
101
|
-
|
|
108
|
+
t10 = {
|
|
102
109
|
0: { className: "x1cy8zhl x9f619 x78zum5 x126z3so" },
|
|
103
110
|
1: { className: "x9f619 x78zum5 x126z3so x6s0dn4" }
|
|
104
111
|
};
|
|
105
|
-
$[2] =
|
|
106
|
-
} else
|
|
107
|
-
const
|
|
108
|
-
let
|
|
112
|
+
$[2] = t10;
|
|
113
|
+
} else t10 = $[2];
|
|
114
|
+
const t11 = t10[!!inline << 0];
|
|
115
|
+
let t12;
|
|
109
116
|
if ($[3] !== inputRef || $[4] !== numeric) {
|
|
110
|
-
|
|
117
|
+
t12 = /* @__PURE__ */ jsx(FieldInput, {
|
|
111
118
|
numeric,
|
|
112
119
|
ref: inputRef
|
|
113
120
|
});
|
|
114
121
|
$[3] = inputRef;
|
|
115
122
|
$[4] = numeric;
|
|
116
|
-
$[5] =
|
|
117
|
-
} else
|
|
118
|
-
let
|
|
123
|
+
$[5] = t12;
|
|
124
|
+
} else t12 = $[5];
|
|
125
|
+
let t13;
|
|
119
126
|
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
120
|
-
|
|
121
|
-
0: { className: "x78zum5 xdt5ytf x2lah0s x1motrhk xk4mfur" },
|
|
122
|
-
2: { className: "x78zum5 x2lah0s x1q0g3np x126z3so
|
|
123
|
-
1: { className: "x78zum5 xdt5ytf x2lah0s xk4mfur x17v9ssf" },
|
|
124
|
-
3: { className: "x78zum5 x2lah0s x1q0g3np x126z3so x1tn5xpv x17v9ssf" }
|
|
127
|
+
t13 = {
|
|
128
|
+
0: { className: "x9f619 x78zum5 xdt5ytf x2lah0s x1motrhk xk4mfur" },
|
|
129
|
+
2: { className: "x9f619 x78zum5 x2lah0s x1q0g3np x126z3so x1jblbm6 x6rec7h x1tn5xpv" },
|
|
130
|
+
1: { className: "x9f619 x78zum5 xdt5ytf x2lah0s xk4mfur x17v9ssf" },
|
|
131
|
+
3: { className: "x9f619 x78zum5 x2lah0s x1q0g3np x126z3so x1jblbm6 x1tn5xpv x17v9ssf" }
|
|
125
132
|
};
|
|
126
|
-
$[6] =
|
|
127
|
-
} else
|
|
128
|
-
const
|
|
129
|
-
let
|
|
133
|
+
$[6] = t13;
|
|
134
|
+
} else t13 = $[6];
|
|
135
|
+
const t14 = t13[!!inline << 1 | !!(!inline && variant === "outlined") << 0];
|
|
136
|
+
let t15;
|
|
130
137
|
if ($[7] !== decrementLabel || $[8] !== incrementLabel || $[9] !== inline || $[10] !== variant) {
|
|
131
|
-
|
|
138
|
+
t15 = inline ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(IconButton, {
|
|
132
139
|
"aria-label": decrementLabel,
|
|
133
140
|
size: "xs",
|
|
134
141
|
slot: "decrement",
|
|
@@ -153,76 +160,80 @@ function NumberField$1(t0) {
|
|
|
153
160
|
$[8] = incrementLabel;
|
|
154
161
|
$[9] = inline;
|
|
155
162
|
$[10] = variant;
|
|
156
|
-
$[11] =
|
|
157
|
-
} else
|
|
158
|
-
let
|
|
159
|
-
if ($[12] !==
|
|
160
|
-
|
|
161
|
-
...
|
|
162
|
-
children:
|
|
163
|
+
$[11] = t15;
|
|
164
|
+
} else t15 = $[11];
|
|
165
|
+
let t16;
|
|
166
|
+
if ($[12] !== t14 || $[13] !== t15) {
|
|
167
|
+
t16 = /* @__PURE__ */ jsx("div", {
|
|
168
|
+
...t14,
|
|
169
|
+
children: t15
|
|
163
170
|
});
|
|
164
|
-
$[12] =
|
|
165
|
-
$[13] =
|
|
166
|
-
$[14] =
|
|
167
|
-
} else
|
|
168
|
-
let
|
|
169
|
-
if ($[15] !==
|
|
170
|
-
|
|
171
|
-
...
|
|
172
|
-
children: [
|
|
171
|
+
$[12] = t14;
|
|
172
|
+
$[13] = t15;
|
|
173
|
+
$[14] = t16;
|
|
174
|
+
} else t16 = $[14];
|
|
175
|
+
let t17;
|
|
176
|
+
if ($[15] !== t11 || $[16] !== t12 || $[17] !== t16) {
|
|
177
|
+
t17 = /* @__PURE__ */ jsxs("div", {
|
|
178
|
+
...t11,
|
|
179
|
+
children: [t12, t16]
|
|
173
180
|
});
|
|
174
|
-
$[15] =
|
|
175
|
-
$[16] =
|
|
176
|
-
$[17] =
|
|
177
|
-
$[18] =
|
|
178
|
-
} else
|
|
179
|
-
let
|
|
180
|
-
if ($[19] !== floatingLabel || $[20] !== label || $[21] !== props$1.isRequired || $[22] !==
|
|
181
|
-
|
|
181
|
+
$[15] = t11;
|
|
182
|
+
$[16] = t12;
|
|
183
|
+
$[17] = t16;
|
|
184
|
+
$[18] = t17;
|
|
185
|
+
} else t17 = $[18];
|
|
186
|
+
let t18;
|
|
187
|
+
if ($[19] !== floatingLabel || $[20] !== label || $[21] !== props$1.isRequired || $[22] !== t17 || $[23] !== t9 || $[24] !== variant) {
|
|
188
|
+
t18 = /* @__PURE__ */ jsx(FieldBox, {
|
|
189
|
+
endInset: t9,
|
|
182
190
|
floatingLabel,
|
|
183
191
|
isRequired: props$1.isRequired,
|
|
184
192
|
label,
|
|
185
193
|
variant,
|
|
186
|
-
children:
|
|
194
|
+
children: t17
|
|
187
195
|
});
|
|
188
196
|
$[19] = floatingLabel;
|
|
189
197
|
$[20] = label;
|
|
190
198
|
$[21] = props$1.isRequired;
|
|
191
|
-
$[22] =
|
|
192
|
-
$[23] =
|
|
193
|
-
$[24] =
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
199
|
+
$[22] = t17;
|
|
200
|
+
$[23] = t9;
|
|
201
|
+
$[24] = variant;
|
|
202
|
+
$[25] = t18;
|
|
203
|
+
} else t18 = $[25];
|
|
204
|
+
let t19;
|
|
205
|
+
if ($[26] !== description || $[27] !== error) {
|
|
206
|
+
t19 = /* @__PURE__ */ jsx(FieldMessage, {
|
|
198
207
|
description,
|
|
199
208
|
error
|
|
200
209
|
});
|
|
201
|
-
$[
|
|
202
|
-
$[
|
|
203
|
-
$[
|
|
204
|
-
} else
|
|
205
|
-
let
|
|
206
|
-
if ($[
|
|
207
|
-
|
|
210
|
+
$[26] = description;
|
|
211
|
+
$[27] = error;
|
|
212
|
+
$[28] = t19;
|
|
213
|
+
} else t19 = $[28];
|
|
214
|
+
let t20;
|
|
215
|
+
if ($[29] !== T0 || $[30] !== isDisabled || $[31] !== isWheelDisabled || $[32] !== props$1 || $[33] !== t18 || $[34] !== t19 || $[35] !== t7 || $[36] !== t8 || $[37] !== validationBehavior) {
|
|
216
|
+
t20 = /* @__PURE__ */ jsxs(T0, {
|
|
208
217
|
isDisabled,
|
|
209
|
-
isInvalid:
|
|
218
|
+
isInvalid: t7,
|
|
219
|
+
isWheelDisabled,
|
|
210
220
|
validationBehavior,
|
|
211
221
|
...props$1,
|
|
212
|
-
...
|
|
213
|
-
children: [
|
|
222
|
+
...t8,
|
|
223
|
+
children: [t18, t19]
|
|
214
224
|
});
|
|
215
|
-
$[
|
|
216
|
-
$[
|
|
217
|
-
$[
|
|
218
|
-
$[
|
|
219
|
-
$[
|
|
220
|
-
$[
|
|
221
|
-
$[
|
|
222
|
-
$[
|
|
223
|
-
$[
|
|
224
|
-
|
|
225
|
-
|
|
225
|
+
$[29] = T0;
|
|
226
|
+
$[30] = isDisabled;
|
|
227
|
+
$[31] = isWheelDisabled;
|
|
228
|
+
$[32] = props$1;
|
|
229
|
+
$[33] = t18;
|
|
230
|
+
$[34] = t19;
|
|
231
|
+
$[35] = t7;
|
|
232
|
+
$[36] = t8;
|
|
233
|
+
$[37] = validationBehavior;
|
|
234
|
+
$[38] = t20;
|
|
235
|
+
} else t20 = $[38];
|
|
236
|
+
return t20;
|
|
226
237
|
}
|
|
227
238
|
function StackedStepper(t0) {
|
|
228
239
|
const $ = c(8);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["c","_c","ReactNode","Ref","RefAttributes","ButtonRenderProps","NumberFieldProps","RACNumberFieldProps","stylex","Button","RACButton","NumberField","RACNumberField","FieldVariant","FieldBox","FieldInput","FieldMessage","fieldStyles","invalidFrom","useFieldValidationBehavior","MinusGlyph","PlusGlyph","mergeStatefulStyles","colors","motion","radii","spacing","stateLayerOpacity","typography","IconButton","BOX_HALF","sm","bodySmallLineHeight","bodyLargeLineHeight","BOX_OUTLINED_HALF","lg","styles","stepper","k6CgDc","kGNEyG","kWkggS","kZKoxP","kaIpWk","kMzoRj","kB7OPa","kMwMTN","kkrTdU","k1xSpc","kzqmXN","kjj79g","kjBf7l","kInvED","k3XXqK","kMeerF","kmVPX3","kIyJzY","k1ekBW","kAMwcw","$$css","stepperBottomOutlined","kT0f0o","stepperDisabled","stepperFocused","stepperHovered","stepperOutlined","stepperPressed","stepperTop","kfmiAY","decrementLabel","description","error","floatingLabel","incrementLabel","inputRef","HTMLInputElement","label","numeric","steppers","variant","Omit","t0","$","t1","isDisabled","t2","t3","t4","t5","props","undefined","inline","validationBehavior","T0","t6","t7","root","t8","Symbol","for","0","className","1","t9","t10","t11","2","3","t12","t13","t14","t15","t16","isRequired","t17","t18","StackedStepper","children","outlined","slot","stepperStyles","top","state","isHovered","isPressed","isFocusVisible","NumberField","_c","props","RACNumberField","stylex.props","RACButton"],"sources":["../../../src/components/number-field/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, Ref, RefAttributes } from 'react';\nimport type { ButtonRenderProps, NumberFieldProps as RACNumberFieldProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { Button as RACButton, NumberField as RACNumberField } from 'react-aria-components';\nimport type { FieldVariant } from '../../field';\nimport { FieldBox, FieldInput, FieldMessage } from '../../field';\nimport { fieldStyles, invalidFrom, useFieldValidationBehavior } from '../../field/root';\nimport { MinusGlyph, PlusGlyph } from '../../glyphs';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, motion, radii, spacing, stateLayerOpacity, typography } from '../../tokens/design.tokens.stylex';\nimport IconButton from '../icon-button';\n\n// The text fields page's field, holding a number: the same box, floating\n// label, underline and message as TextField, with the value in the mono\n// face and tabular figures by default, since a number is what those are\n// for, and two steppers at the trailing end.\n//\n// The steppers come in two layouts. Stacked, the plus over the minus, they\n// are a column flush with the box's top, end and bottom, each half of the\n// box's 56dp and 32dp wide, drawn here since the smallest icon button is\n// 32dp and two of those do not fit; the glyph is the icon buttons page's\n// 20dp for that size, and the hover, pressed, focus and disabled treatments\n// are the standard icon button's. Side by side, they are extra-small icon\n// buttons, the page's trailing icons in the library's own control, 12dp\n// from the end where the page puts a field's icons — the box's 16dp of\n// padding less the 4dp they pull back.\n//\n// **The stacked pair is the one control here that does not reach the 48dp\n// target**, and it is the layout rather than an oversight. Every other small\n// control in the library draws that target out of flow, over whatever sits\n// beside it — src/control/styles.ts carries the decision. These two have only\n// each other beside them: the column is 56dp tall in total, so two 48dp\n// targets inside it would overlap across most of their height, and the half\n// of a press that landed in the overlap would go to whichever box was\n// uppermost rather than to the glyph under the finger. Incrementing when a\n// reader meant to decrement is worse than a target that is short, so the\n// stacked layout keeps its 32 by 28 and the reader who needs the larger one\n// has `steppers=\"horizontal\"`, where each is an extra-small icon button and\n// gets the target from there — with the gap that keeps those two targets off\n// each other, which is the room the column has none of.\n//\n// React Aria's `NumberField` is the root and the box is its `Group`, which\n// is what names the box and the two steppers as one control; the steppers\n// are its increment and decrement buttons through context, disabled at the\n// ends of the range and kept out of the tab order, and the formatting is its\n// `formatOptions`.\n// Half the box, spelled from the same tokens the box derives its height\n// from rather than as the 28 that half of 56 comes to. A theme with a longer\n// body line makes the box taller — `Editorial` in src/theming/themes.ts does\n// — and a stated half leaves the pair short of the bottom edge they are\n// flush with.\n//\n// Written here rather than imported from src/field/styles.ts, which spells\n// the same two expressions: the StyleX compiler resolves a constant across\n// files only out of a `.stylex.ts` module, the same reason that file gives\n// for re-declaring the forced-colours query. The two have to move together.\nconst BOX_HALF = `calc((2 * ${spacing.sm} + ${typography.bodySmallLineHeight} + ${typography.bodyLargeLineHeight}) / 2)`;\nconst BOX_OUTLINED_HALF = `calc((2 * ${spacing.lg} + ${typography.bodyLargeLineHeight}) / 2)`;\nconst styles = {\n stepper: {\n k6CgDc: \"x12w9bfk\",\n kGNEyG: \"x6s0dn4\",\n kWkggS: \"xjbqb8w\",\n kZKoxP: \"x1viytl0\",\n kaIpWk: \"x2u8bby\",\n kMzoRj: \"xc342km\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x1w5n3ug\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x78zum5\",\n kzqmXN: \"x1td3qas\",\n kjj79g: \"xl56j7k\",\n kjBf7l: \"xrgy624\",\n kInvED: \"x2ssjo2\",\n k3XXqK: \"x1t137rt\",\n kMeerF: \"x1de99jn\",\n kmVPX3: \"x1717udv\",\n kIyJzY: \"x1qno0dh\",\n k1ekBW: \"xs2xxs2\",\n kAMwcw: \"xpc4ca7\",\n $$css: true\n },\n stepperBottomOutlined: {\n kT0f0o: \"x4gcak0\",\n $$css: true\n },\n stepperDisabled: {\n kMwMTN: \"x1xj74d8\",\n kkrTdU: \"x1h6gzvc\",\n $$css: true\n },\n stepperFocused: {\n k3XXqK: \"xaatb59\",\n $$css: true\n },\n stepperHovered: {\n kWkggS: \"x14noynh\",\n $$css: true\n },\n stepperOutlined: {\n kZKoxP: \"x1o675yb\",\n $$css: true\n },\n stepperPressed: {\n kWkggS: \"x123fei2\",\n $$css: true\n },\n stepperTop: {\n kfmiAY: \"xirz1nw\",\n $$css: true\n }\n};\ntype NumberFieldProps = {\n /**\n * The name of the stepper that lowers the value, for a screen reader. Left\n * out, React Aria names it in the reader's locale, followed by the field's\n * own label — \"Decrease Quantity\" in English.\n */\n decrementLabel?: string;\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 * Outside a `Form` the message line arrives with the message, so the\n * field grows when this does and moves what is under it. A `Form` holds\n * that space from the start; so does a permanent `description`.\n */\n error?: string;\n /**\n * Whether the label sits in the empty box and floats to the top once the\n * field is focused or holds a value, as the text fields page draws it.\n * `false` keeps it small at the top in every state.\n * @default true\n */\n floatingLabel?: boolean;\n /**\n * The name of the stepper that raises the value, for a screen reader. Left\n * out, React Aria names it in the reader's locale, followed by the field's\n * own label — \"Increase Quantity\" in English.\n */\n incrementLabel?: string;\n /**\n * A ref to the field's own `<input>`, which is the element a call site moves\n * focus to — after a server's error, say. `ref` is the field as a whole.\n */\n inputRef?: Ref<HTMLInputElement>;\n /**\n * What the field is for. Required rather than optional: a field with no\n * 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. On by default, since a\n * number field holds nothing else.\n * @default true\n */\n numeric?: boolean;\n /**\n * How the two steppers sit at the end of the box: stacked, the plus over\n * the minus, flush with the box's edge, or side by side as extra-small\n * icon buttons.\n * @default 'vertical'\n */\n steppers?: 'horizontal' | 'vertical';\n /**\n * The filled box, or the outlined one: no fill, an outline that thickens\n * and takes the primary role while focused, and the label cutting it once\n * it floats — the text fields page's two fields.\n * @default 'filled'\n */\n variant?: FieldVariant;\n} & Omit<RACNumberFieldProps, 'children' | 'isInvalid' | 'validationBehavior'>;\n\n/**\n * A labelled number input with steppers. Its value is React Aria's: pass\n * `value` with `onChange` to control it, or `defaultValue` to let it keep\n * its own — and `onChange` is handed the number, `NaN` while the field is\n * empty. `minValue`, `maxValue` and `step` shape it, and `formatOptions`\n * says how it reads, in the locale the page is in: a currency, a percentage,\n * a unit. Arrow keys step the value, and Page Up and Page Down by ten steps.\n *\n * The call site's `className` and `style` land on the field as a whole,\n * which is the element a layout positions. The box, label, input and message\n * are the field chrome in `src/field`, shared with every other field.\n */\nfunction NumberField({\n decrementLabel,\n description,\n error,\n floatingLabel = true,\n incrementLabel,\n inputRef,\n isDisabled = false,\n label,\n numeric = true,\n steppers = 'vertical',\n variant = 'filled',\n ...props\n}: NumberFieldProps & RefAttributes<HTMLDivElement>) {\n const inline = steppers === 'horizontal';\n const validationBehavior = useFieldValidationBehavior();\n return <RACNumberField isDisabled={isDisabled} isInvalid={invalidFrom(error)} validationBehavior={validationBehavior} {...props} {...mergeStatefulStyles(stylex.props(fieldStyles.root), props)}>\n <FieldBox floatingLabel={floatingLabel} isRequired={props.isRequired} label={label} variant={variant}>\n <div {...{\n 0: {\n className: \"x1cy8zhl x9f619 x78zum5 x126z3so\"\n },\n 1: {\n className: \"x9f619 x78zum5 x126z3so x6s0dn4\"\n }\n }[!!inline << 0]}>\n <FieldInput numeric={numeric} ref={inputRef} />\n <div {...{\n 0: {\n className: \"x78zum5 xdt5ytf x2lah0s x1motrhk xk4mfur\"\n },\n 2: {\n className: \"x78zum5 x2lah0s x1q0g3np x126z3so xdj266r x1tn5xpv\"\n },\n 1: {\n className: \"x78zum5 xdt5ytf x2lah0s xk4mfur x17v9ssf\"\n },\n 3: {\n className: \"x78zum5 x2lah0s x1q0g3np x126z3so x1tn5xpv x17v9ssf\"\n }\n }[!!inline << 1 | !!(!inline && variant === 'outlined') << 0]}>\n {inline ? <>\n <IconButton aria-label={decrementLabel} size=\"xs\" slot=\"decrement\">\n <MinusGlyph className=\"xlzyvqe x1lliihq x15vhz18\" />\n </IconButton>\n <IconButton aria-label={incrementLabel} size=\"xs\" slot=\"increment\">\n <PlusGlyph className=\"xlzyvqe x1lliihq x15vhz18\" />\n </IconButton>\n </> : <>\n <StackedStepper label={incrementLabel} outlined={variant === 'outlined'} slot=\"increment\">\n <PlusGlyph className=\"x1qx5ct2 x1lliihq xw4jnvo\" />\n </StackedStepper>\n <StackedStepper label={decrementLabel} outlined={variant === 'outlined'} slot=\"decrement\">\n <MinusGlyph className=\"x1qx5ct2 x1lliihq xw4jnvo\" />\n </StackedStepper>\n </>}\n </div>\n </div>\n </FieldBox>\n <FieldMessage description={description} error={error} />\n </RACNumberField>;\n}\nfunction StackedStepper({\n children,\n label,\n outlined,\n slot\n}: {\n children: ReactNode;\n label: string | undefined;\n outlined: boolean;\n slot: 'decrement' | 'increment';\n}) {\n return <RACButton aria-label={label} slot={slot} {...mergeStatefulStyles(stepperStyles(slot === 'increment', outlined), {})}>\n {children}\n </RACButton>;\n}\n\n// A stacked stepper: React Aria's button with the slot the field's context\n// looks for, drawn from its render state. Built by a call rather than\n// written inline at the prop, which is what react-perf's\n// no-new-function-as-prop is after.\nfunction stepperStyles(top: boolean, outlined: boolean) {\n return (state: ButtonRenderProps) => stylex.props(styles.stepper, outlined && styles.stepperOutlined, top && styles.stepperTop, !top && outlined && styles.stepperBottomOutlined, state.isHovered && !state.isDisabled && styles.stepperHovered, state.isPressed && !state.isDisabled && styles.stepperPressed, state.isFocusVisible && styles.stepperFocused, state.isDisabled && styles.stepperDisabled);\n}\nexport type { NumberFieldProps };\nexport default NumberField;"],"mappings":";;;;;;;;;;;;AA2DiB,GAAa0B,QAAQK,KAAQH,WAAWI,sBAAyBJ,WAAWK;AACnE,GAAaP,QAAQS,KAAQP,WAAWK;AAClE,MAAMG,SAAS;CACbC,SAAS;EACPC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,uBAAuB;EACrBC,QAAQ;EACRF,OAAO;CACT;CACAG,iBAAiB;EACfhB,QAAQ;EACRC,QAAQ;EACRY,OAAO;CACT;CACAI,gBAAgB;EACdV,QAAQ;EACRM,OAAO;CACT;CACAK,gBAAgB;EACdvB,QAAQ;EACRkB,OAAO;CACT;CACAM,iBAAiB;EACfvB,QAAQ;EACRiB,OAAO;CACT;CACAO,gBAAgB;EACdzB,QAAQ;EACR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KAAAH,EAAA;CAAA,OAFPG;AAEO;AAOhB,SAASmC,cAAcC,KAAcH,UAAmB;CACtD,QAAQI,UAA6BjH,MAAa4B,OAAOC,SAASgF,YAAYjF,OAAO4B,iBAAiBwD,OAAOpF,OAAO8B,YAAY,CAACsD,OAAOH,YAAYjF,OAAOuB,uBAAuB8D,MAAMC,aAAa,CAACD,MAAMtC,cAAc/C,OAAO2B,gBAAgB0D,MAAME,aAAa,CAACF,MAAMtC,cAAc/C,OAAO6B,gBAAgBwD,MAAMG,kBAAkBxF,OAAO0B,gBAAgB2D,MAAMtC,cAAc/C,OAAOyB,eAAe;AAC3Y"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["c","_c","ReactNode","Ref","RefAttributes","ButtonRenderProps","NumberFieldProps","RACNumberFieldProps","stylex","Button","RACButton","NumberField","RACNumberField","FieldVariant","FieldBox","FieldInput","FieldMessage","fieldStyles","invalidFrom","useFieldValidationBehavior","MinusGlyph","PlusGlyph","mergeStatefulStyles","colors","motion","radii","sizing","spacing","stateLayerOpacity","typography","IconButton","BOX_HALF","sm","bodySmallLineHeight","bodyLargeLineHeight","BOX_OUTLINED_HALF","lg","STEPPER_REACH","controlXs","STACKED_INSET","INLINE_INSET","md","styles","stepper","k6CgDc","kGNEyG","kWkggS","kZKoxP","kaIpWk","kMzoRj","kB7OPa","kMwMTN","kkrTdU","k1xSpc","kzqmXN","kjj79g","kjBf7l","kInvED","k3XXqK","kMeerF","kmVPX3","kIyJzY","k1ekBW","kAMwcw","$$css","stepperBottomOutlined","kT0f0o","stepperDisabled","stepperFocused","stepperHovered","stepperOutlined","stepperPressed","stepperTop","kfmiAY","decrementLabel","description","error","floatingLabel","incrementLabel","inputRef","HTMLInputElement","isWheelDisabled","label","numeric","steppers","variant","Omit","t0","$","t1","isDisabled","t2","t3","t4","t5","t6","props","undefined","inline","validationBehavior","T0","t7","t8","root","t9","t10","Symbol","for","0","className","1","t11","t12","t13","2","3","t14","t15","t16","t17","t18","isRequired","t19","t20","StackedStepper","children","outlined","slot","stepperStyles","top","state","isHovered","isPressed","isFocusVisible","NumberField","_c","props","RACNumberField","stylex.props","RACButton"],"sources":["../../../src/components/number-field/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, Ref, RefAttributes } from 'react';\nimport type { ButtonRenderProps, NumberFieldProps as RACNumberFieldProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { Button as RACButton, NumberField as RACNumberField } from 'react-aria-components';\nimport type { FieldVariant } from '../../field';\nimport { FieldBox, FieldInput, FieldMessage } from '../../field';\nimport { fieldStyles, invalidFrom, useFieldValidationBehavior } from '../../field/root';\nimport { MinusGlyph, PlusGlyph } from '../../glyphs';\nimport { mergeStatefulStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, motion, radii, sizing, spacing, stateLayerOpacity, typography } from '../../tokens/design.tokens.stylex';\nimport IconButton from '../icon-button';\n\n// The text fields page's field, holding a number: the same box, floating\n// label, underline and message as TextField, with the value in the mono\n// face and tabular figures by default, since a number is what those are\n// for, and two steppers at the trailing end.\n//\n// The steppers come in two layouts. Stacked, the plus over the minus, they\n// are a column flush with the box's top, end and bottom, each half of the\n// box's 56dp and 32dp wide, drawn here since the smallest icon button is\n// 32dp and two of those do not fit; the glyph is the icon buttons page's\n// 20dp for that size, and the hover, pressed, focus and disabled treatments\n// are the standard icon button's. Side by side, they are extra-small icon\n// buttons, the page's trailing icons in the library's own control, 12dp\n// from the end where the page puts a field's icons — the box's 16dp of\n// padding less the 4dp they pull back.\n//\n// **The stacked pair is the one control here that does not reach the 48dp\n// target**, and it is the layout rather than an oversight. Every other small\n// control in the library draws that target out of flow, over whatever sits\n// beside it — src/control/styles.ts carries the decision. These two have only\n// each other beside them: the column is 56dp tall in total, so two 48dp\n// targets inside it would overlap across most of their height, and the half\n// of a press that landed in the overlap would go to whichever box was\n// uppermost rather than to the glyph under the finger. Incrementing when a\n// reader meant to decrement is worse than a target that is short, so the\n// stacked layout keeps its 32 by 28 and the reader who needs the larger one\n// has `steppers=\"horizontal\"`, where each is an extra-small icon button and\n// gets the target from there — with the gap that keeps those two targets off\n// each other, which is the room the column has none of.\n//\n// React Aria's `NumberField` is the root and the box is its `Group`, which\n// is what names the box and the two steppers as one control; the steppers\n// are its increment and decrement buttons through context, disabled at the\n// ends of the range and kept out of the tab order, and the formatting is its\n// `formatOptions`.\n// Half the box, spelled from the same tokens the box derives its height\n// from rather than as the 28 that half of 56 comes to. A theme with a longer\n// body line makes the box taller — `Editorial` in src/theming/themes.ts does\n// — and a stated half leaves the pair short of the bottom edge they are\n// flush with.\n//\n// Written here rather than imported from src/field/styles.ts, which spells\n// the same two expressions: the StyleX compiler resolves a constant across\n// files only out of a `.stylex.ts` module, the same reason that file gives\n// for re-declaring the forced-colours query. The two have to move together.\nconst BOX_HALF = `calc((2 * ${spacing.sm} + ${typography.bodySmallLineHeight} + ${typography.bodyLargeLineHeight}) / 2)`;\nconst BOX_OUTLINED_HALF = `calc((2 * ${spacing.lg} + ${typography.bodyLargeLineHeight}) / 2)`;\n\n// How much of the end of the box's column the steppers take, with the 8dp\n// between them and the input, which the label stops short of — FieldBox's\n// `endInset`. Without it the label ran the column's width, under the\n// steppers, and a long one was cut short beneath them. Each is the input's\n// own end, so the label ends where the value does.\n//\n// Stacked, the 32dp column less the 16dp of the box's padding it reaches\n// into; side by side, the two extra-small buttons and the 8dp between them,\n// less the 4dp they reach into the padding.\n// How far a side-by-side stepper reaches past the control's line above and\n// below it: a negative margin, half the difference between the two.\nconst STEPPER_REACH = `calc((${typography.bodyLargeLineHeight} - ${sizing.controlXs}) / 2)`;\nconst STACKED_INSET = `calc(32px - ${spacing.lg} + ${spacing.sm})`;\nconst INLINE_INSET = `calc(2 * ${sizing.controlXs} + ${spacing.sm} + ${spacing.md} - ${spacing.lg} + ${spacing.sm})`;\nconst styles = {\n stepper: {\n k6CgDc: \"x12w9bfk\",\n kGNEyG: \"x6s0dn4\",\n kWkggS: \"xjbqb8w\",\n kZKoxP: \"x1viytl0\",\n kaIpWk: \"x2u8bby\",\n kMzoRj: \"xc342km\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x1w5n3ug\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x78zum5\",\n kzqmXN: \"x1td3qas\",\n kjj79g: \"xl56j7k\",\n kjBf7l: \"xrgy624\",\n kInvED: \"x2ssjo2\",\n k3XXqK: \"x1t137rt\",\n kMeerF: \"x1de99jn\",\n kmVPX3: \"x1717udv\",\n kIyJzY: \"x1qno0dh\",\n k1ekBW: \"xs2xxs2\",\n kAMwcw: \"xpc4ca7\",\n $$css: true\n },\n stepperBottomOutlined: {\n kT0f0o: \"x4gcak0\",\n $$css: true\n },\n stepperDisabled: {\n kMwMTN: \"x1xj74d8\",\n kkrTdU: \"x1h6gzvc\",\n $$css: true\n },\n stepperFocused: {\n k3XXqK: \"xaatb59\",\n $$css: true\n },\n stepperHovered: {\n kWkggS: \"x14noynh\",\n $$css: true\n },\n stepperOutlined: {\n kZKoxP: \"x1o675yb\",\n $$css: true\n },\n stepperPressed: {\n kWkggS: \"x123fei2\",\n $$css: true\n },\n stepperTop: {\n kfmiAY: \"xirz1nw\",\n $$css: true\n }\n};\ntype NumberFieldProps = {\n /**\n * The name of the stepper that lowers the value, for a screen reader. Left\n * out, React Aria names it in the reader's locale, followed by the field's\n * own label — \"Decrease Quantity\" in English.\n */\n decrementLabel?: string;\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 * Outside a `Form` the message line arrives with the message, so the\n * field grows when this does and moves what is under it. A `Form` holds\n * that space from the start; so does a permanent `description`.\n */\n error?: string;\n /**\n * Whether the label sits in the empty box and floats to the top once the\n * field is focused or holds a value, as the text fields page draws it.\n * `false` keeps it small at the top in every state.\n * @default true\n */\n floatingLabel?: boolean;\n /**\n * The name of the stepper that raises the value, for a screen reader. Left\n * out, React Aria names it in the reader's locale, followed by the field's\n * own label — \"Increase Quantity\" in English.\n */\n incrementLabel?: string;\n /**\n * A ref to the field's own `<input>`, which is the element a call site moves\n * focus to — after a server's error, say. `ref` is the field as a whole.\n */\n inputRef?: Ref<HTMLInputElement>;\n /**\n * Whether the mouse wheel and a trackpad's scroll leave the value alone.\n * React Aria steps a focused number field's value with the wheel, so a\n * reader scrolling a long form past a field they had left focused changed\n * its value instead of moving the page. Stepping from the wheel is the\n * call site's to ask for, with `false`.\n * @default true\n */\n isWheelDisabled?: boolean;\n /**\n * What the field is for. Required rather than optional: a field with no\n * 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. On by default, since a\n * number field holds nothing else.\n * @default true\n */\n numeric?: boolean;\n /**\n * How the two steppers sit at the end of the box: stacked, the plus over\n * the minus, flush with the box's edge, or side by side as extra-small\n * icon buttons.\n * @default 'vertical'\n */\n steppers?: 'horizontal' | 'vertical';\n /**\n * The filled box, or the outlined one: no fill, an outline that thickens\n * and takes the primary role while focused, and the label cutting it once\n * it floats — the text fields page's two fields.\n * @default 'filled'\n */\n variant?: FieldVariant;\n} & Omit<RACNumberFieldProps, 'children' | 'isInvalid' | 'isWheelDisabled' | 'validationBehavior'>;\n\n/**\n * A labelled number input with steppers. Its value is React Aria's: pass\n * `value` with `onChange` to control it, or `defaultValue` to let it keep\n * its own — and `onChange` is handed the number, `NaN` while the field is\n * empty. `minValue`, `maxValue` and `step` shape it, and `formatOptions`\n * says how it reads, in the locale the page is in: a currency, a percentage,\n * a unit. Arrow keys step the value, and Page Up and Page Down by ten steps.\n * The mouse wheel scrolls the page past it rather than stepping it, unless\n * `isWheelDisabled` is `false`.\n *\n * The call site's `className` and `style` land on the field as a whole,\n * which is the element a layout positions. The box, label, input and message\n * are the field chrome in `src/field`, shared with every other field.\n */\nfunction NumberField({\n decrementLabel,\n description,\n error,\n floatingLabel = true,\n incrementLabel,\n inputRef,\n isDisabled = false,\n isWheelDisabled = true,\n label,\n numeric = true,\n steppers = 'vertical',\n variant = 'filled',\n ...props\n}: NumberFieldProps & RefAttributes<HTMLDivElement>) {\n const inline = steppers === 'horizontal';\n const validationBehavior = useFieldValidationBehavior();\n return <RACNumberField isDisabled={isDisabled} isInvalid={invalidFrom(error)} isWheelDisabled={isWheelDisabled} validationBehavior={validationBehavior} {...props} {...mergeStatefulStyles(stylex.props(fieldStyles.root), props)}>\n <FieldBox endInset={inline ? INLINE_INSET : STACKED_INSET} floatingLabel={floatingLabel} isRequired={props.isRequired} label={label} variant={variant}>\n <div {...{\n 0: {\n className: \"x1cy8zhl x9f619 x78zum5 x126z3so\"\n },\n 1: {\n className: \"x9f619 x78zum5 x126z3so x6s0dn4\"\n }\n }[!!inline << 0]}>\n <FieldInput numeric={numeric} ref={inputRef} />\n <div {...{\n 0: {\n className: \"x9f619 x78zum5 xdt5ytf x2lah0s x1motrhk xk4mfur\"\n },\n 2: {\n className: \"x9f619 x78zum5 x2lah0s x1q0g3np x126z3so x1jblbm6 x6rec7h x1tn5xpv\"\n },\n 1: {\n className: \"x9f619 x78zum5 xdt5ytf x2lah0s xk4mfur x17v9ssf\"\n },\n 3: {\n className: \"x9f619 x78zum5 x2lah0s x1q0g3np x126z3so x1jblbm6 x1tn5xpv x17v9ssf\"\n }\n }[!!inline << 1 | !!(!inline && variant === 'outlined') << 0]}>\n {inline ? <>\n <IconButton aria-label={decrementLabel} size=\"xs\" slot=\"decrement\">\n <MinusGlyph className=\"xlzyvqe x1lliihq x15vhz18\" />\n </IconButton>\n <IconButton aria-label={incrementLabel} size=\"xs\" slot=\"increment\">\n <PlusGlyph className=\"xlzyvqe x1lliihq x15vhz18\" />\n </IconButton>\n </> : <>\n <StackedStepper label={incrementLabel} outlined={variant === 'outlined'} slot=\"increment\">\n <PlusGlyph className=\"x1qx5ct2 x1lliihq xw4jnvo\" />\n </StackedStepper>\n <StackedStepper label={decrementLabel} outlined={variant === 'outlined'} slot=\"decrement\">\n <MinusGlyph className=\"x1qx5ct2 x1lliihq xw4jnvo\" />\n </StackedStepper>\n </>}\n </div>\n </div>\n </FieldBox>\n <FieldMessage description={description} error={error} />\n </RACNumberField>;\n}\nfunction StackedStepper({\n children,\n label,\n outlined,\n slot\n}: {\n children: ReactNode;\n label: string | undefined;\n outlined: boolean;\n slot: 'decrement' | 'increment';\n}) {\n return <RACButton aria-label={label} slot={slot} {...mergeStatefulStyles(stepperStyles(slot === 'increment', outlined), {})}>\n {children}\n </RACButton>;\n}\n\n// A stacked stepper: React Aria's button with the slot the field's context\n// looks for, drawn from its render state. Built by a call rather than\n// written inline at the prop, which is what react-perf's\n// no-new-function-as-prop is after.\nfunction stepperStyles(top: boolean, outlined: boolean) {\n return (state: ButtonRenderProps) => stylex.props(styles.stepper, outlined && styles.stepperOutlined, top && styles.stepperTop, !top && outlined && styles.stepperBottomOutlined, state.isHovered && !state.isDisabled && styles.stepperHovered, state.isPressed && !state.isDisabled && styles.stepperPressed, state.isFocusVisible && styles.stepperFocused, state.isDisabled && styles.stepperDisabled);\n}\nexport type { NumberFieldProps };\nexport default NumberField;"],"mappings":";;;;;;;;;;;;AA2DiB,GAAa2B,QAAQK,KAAQH,WAAWI,sBAAyBJ,WAAWK;AACnE,GAAaP,QAAQS,KAAQP,WAAWK;AAa5C,GAASL,WAAWK,sBAAyBR,OAAOY;AAC1E,MAAMC,gBAAgB,eAAeZ,QAAQS,GAAE,KAAMT,QAAQK,GAAE;AAC/D,MAAMQ,eAAe,YAAYd,OAAOY,UAAS,KAAMX,QAAQK,GAAE,KAAML,QAAQc,GAAE,KAAMd,QAAQS,GAAE,KAAMT,QAAQK,GAAE;AACjH,MAAMU,SAAS;CACbC,SAAS;EACPC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;E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AAA;CAAA,MAAAC,IAAAvF,EAAA,CAAA;CAAwB,MAAA,EAAA4H,UAAA3C,OAAA4C,UAAAC,SAAAxC;CAUvB,IAAAE;CAAA,IAAAD,EAAA,OAAAsC,YAAAtC,EAAA,OAAAuC,MAAA;EACsDtC,KAAAnE,oBAAoB0G,cAAcD,SAAS,aAAaD,QAAQ,GAAG,CAAC,CAAC;EAACtC,EAAA,KAAAsC;EAAAtC,EAAA,KAAAuC;EAAAvC,EAAA,KAAAC;CAAA,OAAAA,KAAAD,EAAA;CAAA,IAAAG;CAAA,IAAAH,EAAA,OAAAqC,YAAArC,EAAA,OAAAN,SAAAM,EAAA,OAAAuC,QAAAvC,EAAA,OAAAC,IAAA;EAApHE,KAAA,oBAACgD,QAAD;GAAuBzD,cAAAA;GAAa6C;GAAI,GAAMtC;GAChDoC;EADY,CAAA;EAEHrC,EAAA,KAAAqC;EAAArC,EAAA,KAAAN;EAAAM,EAAA,KAAAuC;EAAAvC,EAAA,KAAAC;EAAAD,EAAA,KAAAG;CAAA,OAAAA,KAAAH,EAAA;CAAA,OAFPG;AAEO;AAOhB,SAASqC,cAAcC,KAAcH,UAAmB;CACtD,QAAQI,UAA6B1H,MAAakC,OAAOC,SAASmF,YAAYpF,OAAO4B,iBAAiB2D,OAAOvF,OAAO8B,YAAY,CAACyD,OAAOH,YAAYpF,OAAOuB,uBAAuBiE,MAAMC,aAAa,CAACD,MAAMxC,cAAchD,OAAO2B,gBAAgB6D,MAAME,aAAa,CAACF,MAAMxC,cAAchD,OAAO6B,gBAAgB2D,MAAMG,kBAAkB3F,OAAO0B,gBAAgB8D,MAAMxC,cAAchD,OAAOyB,eAAe;AAC3Y"}
|
|
@@ -48,7 +48,10 @@ type PopoverTrigger = 'hover' | 'press';
|
|
|
48
48
|
* keep its own.
|
|
49
49
|
*
|
|
50
50
|
* Non-modal by design — the page behind stays scrollable and clickable, which
|
|
51
|
-
* is the difference from `Sheet`. Pass `modal` to change that.
|
|
51
|
+
* is the difference from `Sheet`. Pass `modal` to change that. Escape, a press
|
|
52
|
+
* anywhere outside the panel and a button given `slot="close"` close it, and
|
|
53
|
+
* a press on its trigger toggles it. Inside a dialog, a press on the scrim
|
|
54
|
+
* closes the popover first and the dialog on the next, as a menu does.
|
|
52
55
|
*
|
|
53
56
|
* Composed rather than configured by props, because a popover's contents are
|
|
54
57
|
* arbitrary — the parts are `Popover.Content`, `Popover.Title`, and
|