@kanso-labs/kanso-ui 0.45.28 → 0.45.29
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/calendar/index.js +4 -4
- package/dist/calendar/index.js.map +1 -1
- package/dist/components/app-bar/index.js +1 -0
- package/dist/components/app-bar/index.js.map +1 -1
- package/dist/components/autocomplete/index.d.ts +6 -6
- package/dist/components/autocomplete/index.js +4 -4
- package/dist/components/autocomplete/index.js.map +1 -1
- package/dist/components/breadcrumbs/index.d.ts +5 -5
- package/dist/components/breadcrumbs/index.js +5 -5
- package/dist/components/breadcrumbs/index.js.map +1 -1
- package/dist/components/button/index.d.ts +3 -3
- package/dist/components/button/index.js +2 -2
- package/dist/components/button/index.js.map +1 -1
- package/dist/components/calendar/index.d.ts +7 -7
- package/dist/components/calendar/index.js +4 -4
- package/dist/components/calendar/index.js.map +1 -1
- package/dist/components/checkbox-group/index.d.ts +5 -5
- package/dist/components/checkbox-group/index.js +4 -4
- package/dist/components/checkbox-group/index.js.map +1 -1
- package/dist/components/color-area/index.d.ts +4 -4
- package/dist/components/color-area/index.js +4 -4
- package/dist/components/color-area/index.js.map +1 -1
- package/dist/components/color-field/index.d.ts +7 -7
- package/dist/components/color-field/index.js +4 -4
- package/dist/components/color-field/index.js.map +1 -1
- package/dist/components/color-picker/index.d.ts +4 -4
- package/dist/components/color-picker/index.js +4 -4
- package/dist/components/color-picker/index.js.map +1 -1
- package/dist/components/color-slider/index.d.ts +6 -6
- package/dist/components/color-slider/index.js +4 -4
- package/dist/components/color-slider/index.js.map +1 -1
- package/dist/components/color-swatch/index.d.ts +4 -4
- package/dist/components/color-swatch/index.js +4 -4
- package/dist/components/color-swatch/index.js.map +1 -1
- package/dist/components/color-swatch-picker/index.d.ts +12 -12
- package/dist/components/color-swatch-picker/index.js +7 -7
- package/dist/components/color-swatch-picker/index.js.map +1 -1
- package/dist/components/color-wheel/index.d.ts +6 -6
- package/dist/components/color-wheel/index.js +4 -4
- package/dist/components/color-wheel/index.js.map +1 -1
- package/dist/components/combo-box/index.d.ts +5 -5
- package/dist/components/combo-box/index.js +4 -4
- package/dist/components/combo-box/index.js.map +1 -1
- package/dist/components/date-field/index.d.ts +6 -6
- package/dist/components/date-field/index.js +4 -4
- package/dist/components/date-field/index.js.map +1 -1
- package/dist/components/date-picker/index.d.ts +6 -6
- package/dist/components/date-picker/index.js +4 -4
- package/dist/components/date-picker/index.js.map +1 -1
- package/dist/components/date-range-picker/index.d.ts +6 -6
- package/dist/components/date-range-picker/index.js +4 -4
- package/dist/components/date-range-picker/index.js.map +1 -1
- package/dist/components/dialog/index.d.ts +6 -6
- package/dist/components/dialog/index.js +9 -9
- package/dist/components/dialog/index.js.map +1 -1
- package/dist/components/disclosure/index.d.ts +10 -10
- package/dist/components/disclosure/index.js +8 -8
- package/dist/components/disclosure/index.js.map +1 -1
- package/dist/components/disclosure-group/index.d.ts +4 -4
- package/dist/components/disclosure-group/index.js +4 -4
- package/dist/components/disclosure-group/index.js.map +1 -1
- package/dist/components/drop-zone/index.d.ts +8 -8
- package/dist/components/drop-zone/index.js +6 -6
- package/dist/components/drop-zone/index.js.map +1 -1
- package/dist/components/form/index.d.ts +5 -5
- package/dist/components/form/index.js +4 -4
- package/dist/components/form/index.js.map +1 -1
- package/dist/components/link/index.d.ts +6 -6
- package/dist/components/link/index.js +4 -4
- package/dist/components/link/index.js.map +1 -1
- package/dist/components/list-box/index.d.ts +18 -18
- package/dist/components/list-box/index.js +11 -11
- package/dist/components/list-box/index.js.map +1 -1
- package/dist/components/menu/index.d.ts +16 -16
- package/dist/components/menu/index.js +14 -14
- package/dist/components/menu/index.js.map +1 -1
- package/dist/components/meter/index.d.ts +6 -6
- package/dist/components/meter/index.js +4 -4
- package/dist/components/meter/index.js.map +1 -1
- package/dist/components/navigation-tree/index.d.ts +15 -15
- package/dist/components/navigation-tree/index.js +13 -13
- package/dist/components/navigation-tree/index.js.map +1 -1
- package/dist/components/number-field/index.d.ts +5 -5
- package/dist/components/number-field/index.js +4 -4
- package/dist/components/number-field/index.js.map +1 -1
- package/dist/components/popover/index.d.ts +3 -3
- package/dist/components/popover/index.js +12 -12
- package/dist/components/popover/index.js.map +1 -1
- package/dist/components/radio-group/index.d.ts +5 -5
- package/dist/components/radio-group/index.js +4 -4
- package/dist/components/radio-group/index.js.map +1 -1
- package/dist/components/range-calendar/index.d.ts +7 -7
- package/dist/components/range-calendar/index.js +4 -4
- package/dist/components/range-calendar/index.js.map +1 -1
- package/dist/components/search-field/index.d.ts +6 -6
- package/dist/components/search-field/index.js +4 -4
- package/dist/components/search-field/index.js.map +1 -1
- package/dist/components/select/index.d.ts +5 -5
- package/dist/components/select/index.js +4 -4
- package/dist/components/select/index.js.map +1 -1
- package/dist/components/separator/index.d.ts +5 -5
- package/dist/components/separator/index.js +4 -4
- package/dist/components/separator/index.js.map +1 -1
- package/dist/components/sheet/index.d.ts +5 -5
- package/dist/components/sheet/index.js +12 -12
- package/dist/components/sheet/index.js.map +1 -1
- package/dist/components/slider/index.d.ts +4 -4
- package/dist/components/slider/index.js +4 -4
- package/dist/components/slider/index.js.map +1 -1
- package/dist/components/table/index.d.ts +20 -20
- package/dist/components/table/index.js +17 -17
- package/dist/components/table/index.js.map +1 -1
- package/dist/components/tabs/index.d.ts +5 -5
- package/dist/components/tabs/index.js +8 -8
- package/dist/components/tabs/index.js.map +1 -1
- package/dist/components/text-area/index.d.ts +2 -2
- package/dist/components/text-area/index.js +2 -2
- package/dist/components/text-area/index.js.map +1 -1
- package/dist/components/text-field/index.d.ts +4 -4
- package/dist/components/text-field/index.js +4 -4
- package/dist/components/text-field/index.js.map +1 -1
- package/dist/components/time-field/index.d.ts +6 -6
- package/dist/components/time-field/index.js +4 -4
- package/dist/components/time-field/index.js.map +1 -1
- package/dist/components/token-field/index.d.ts +7 -7
- package/dist/components/token-field/index.js +4 -4
- package/dist/components/token-field/index.js.map +1 -1
- package/dist/components/toolbar/index.d.ts +6 -6
- package/dist/components/toolbar/index.js +4 -4
- package/dist/components/toolbar/index.js.map +1 -1
- package/dist/components/tooltip/index.d.ts +2 -2
- package/dist/components/tooltip/index.js +4 -4
- package/dist/components/tooltip/index.js.map +1 -1
- package/dist/components/tree/index.d.ts +17 -17
- package/dist/components/tree/index.js +14 -14
- package/dist/components/tree/index.js.map +1 -1
- package/dist/drag/hooks.d.ts +3 -3
- package/dist/drag/hooks.js +4 -4
- package/dist/drag/hooks.js.map +1 -1
- package/dist/drag/index.js +4 -4
- package/dist/drag/index.js.map +1 -1
- package/dist/react-aria.d.ts +2 -2
- package/dist/react-aria.js +2 -2
- package/package.json +8 -8
package/dist/calendar/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import { calendarStyles, dateLayers, menuLayers } from "./styles.js";
|
|
|
7
7
|
import { c } from "react/compiler-runtime";
|
|
8
8
|
import { useContext, useId, useRef, useState } from "react";
|
|
9
9
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
-
import { Button, ButtonContext, CalendarGrid, CalendarGridBody, CalendarGridHeader, CalendarHeaderCell, CalendarMonthPicker, CalendarStateContext, CalendarYearPicker, Heading, ListBox, ListBoxItem, RangeCalendarStateContext } from "react-aria-components";
|
|
10
|
+
import { Button, ButtonContext, CalendarGrid, CalendarGridBody, CalendarGridHeader as CalendarGridHeader$1, CalendarHeaderCell, CalendarMonthPicker, CalendarStateContext, CalendarYearPicker, Heading, ListBox, ListBoxItem, RangeCalendarStateContext } from "react-aria-components";
|
|
11
11
|
import { endOfMonth, startOfMonth } from "@internationalized/date";
|
|
12
12
|
import { useDateFormatter } from "react-aria";
|
|
13
13
|
// src/calendar/index.tsx
|
|
@@ -57,14 +57,14 @@ function CalendarFrame(t0) {
|
|
|
57
57
|
* assistive technology, since every date's name opens with its weekday in
|
|
58
58
|
* full, so a letter that two days share is never read out.
|
|
59
59
|
*/
|
|
60
|
-
function CalendarGridHeader
|
|
60
|
+
function CalendarGridHeader() {
|
|
61
61
|
const $ = c(2);
|
|
62
62
|
const single = useContext(CalendarStateContext);
|
|
63
63
|
const range = useContext(RangeCalendarStateContext);
|
|
64
64
|
const t0 = (single ?? range)?.isDisabled ?? false ? disabledHeaderCell : calendarHeaderCell;
|
|
65
65
|
let t1;
|
|
66
66
|
if ($[0] !== t0) {
|
|
67
|
-
t1 = /* @__PURE__ */ jsx(CalendarGridHeader, { children: t0 });
|
|
67
|
+
t1 = /* @__PURE__ */ jsx(CalendarGridHeader$1, { children: t0 });
|
|
68
68
|
$[0] = t0;
|
|
69
69
|
$[1] = t1;
|
|
70
70
|
} else t1 = $[1];
|
|
@@ -392,7 +392,7 @@ function CalendarMonths(t0) {
|
|
|
392
392
|
children: [isStackable ? /* @__PURE__ */ jsx(MonthCaption, { offset }) : null, /* @__PURE__ */ jsxs(CalendarGrid, {
|
|
393
393
|
offset,
|
|
394
394
|
...props(calendarStyles.grid),
|
|
395
|
-
children: [/* @__PURE__ */ jsx(CalendarGridHeader
|
|
395
|
+
children: [/* @__PURE__ */ jsx(CalendarGridHeader, {}), /* @__PURE__ */ jsx(CalendarGridBody, { children })]
|
|
396
396
|
})]
|
|
397
397
|
}, offset.months);
|
|
398
398
|
$[6] = children;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["endOfMonth","startOfMonth","stylex","useContext","useId","useRef","useState","useDateFormatter","CalendarStateContext","CalendarGridHeader","RangeCalendarStateContext","focus","iconButton","monthOffsets","calendarStyles","dateLayers","menuLayers","date","formatted","id","items","onChange","key","value","LISTED_YEARS","CalendarFrame","t0","$","_c","children","months","showMonthYearMenus","t1","Symbol","for","t2","single","range","isDisabled","disabledHeaderCell","calendarHeaderCell","CalendarHeader","header","chevronClassName","chevronGlyph","chevronGlyphPrevious","heading","t3","day","headerCell","CalendarMenus","state","open","setOpen","listId","monthButton","yearButton","button","requestAnimationFrame","current","close","_temp","toggleMonth","_temp2","toggleYear","t4","picker","filter","entry","maxValue","compare","minValue","map","_temp3","outsideBounds","t5","t6","headerGroup","t7","t8","chevronClassNameWhile","t9","t10","t11","picker_0","t12","t13","t14","t15","t16","t17","picker_1","t18","t19","t20","picker_2","t21","picker_3","t22","entry_0","current_0","CalendarMonths","offsets","isStackable","length","monthsStacked","offset","month","grid","centreInList","check","closest","list","HTMLElement","scrollTop","getBoundingClientRect","top","clientHeight","offsetHeight","isHovered","isPressed","isHidden","chrome","chevron","ring","chromeHovered","chromePressed","chromeDisabled","chevronHidden","className","isListOpen","headerCellDisabled","MenuButton","controls","isExpanded","onPress","ref","valueId","nameId","find","shown","undefined","menuArrow","menuArrowExpanded","menuButtonClassName","menuButton","menuEntry","menuItemClassName","menuEntryContent","label","isSelected","menuCheck","isFocusVisible","menuItem","menuItemSelected","selectedHovered","plainHovered","selectedPressed","plainPressed","menuItemFocused","menuItemDisabled","MenuList","disabledKeys","onClose","selected","keys","choose","menuList","MonthCaption","start","visibleRange","add","formatter","calendar","identifier","era","timeZone","year","getFormattableMonth","monthCaption","format","toDate","CalendarGridHeader","RACCalendarGridHeader","RACButton","RACHeading","RACCalendarMonthPicker","RACCalendarYearPicker","RACCalendarGrid","RACCalendarGridBody","RACCalendarHeaderCell","RACListBoxItem","RACListBox"],"sources":["../../src/calendar/index.tsx"],"sourcesContent":["import type { CalendarDate } from '@internationalized/date';\nimport type { ReactElement, ReactNode, Ref } from 'react';\nimport type { Key, Selection } from 'react-aria-components';\nimport { endOfMonth, startOfMonth } from '@internationalized/date';\nimport * as stylex from '@stylexjs/stylex';\nimport { useCallback, useContext, useId, useMemo, useRef, useState } from 'react';\nimport { useDateFormatter } from 'react-aria';\nimport { ButtonContext, CalendarStateContext, Button as RACButton, CalendarGrid as RACCalendarGrid, CalendarGridBody as RACCalendarGridBody, CalendarGridHeader as RACCalendarGridHeader, CalendarHeaderCell as RACCalendarHeaderCell, CalendarMonthPicker as RACCalendarMonthPicker, CalendarYearPicker as RACCalendarYearPicker, Heading as RACHeading, ListBox as RACListBox, ListBoxItem as RACListBoxItem, RangeCalendarStateContext } from 'react-aria-components';\nimport { ArrowDropDownGlyph, CheckGlyph, ChevronEndGlyph } from '../glyphs';\nimport { focus } from '../styles/focus';\nimport { iconButton } from '../styles/icon-button';\nimport { monthOffsets } from './months';\nimport { calendarStyles, dateLayers, menuLayers } from './styles';\n\n// The parts Calendar and RangeCalendar both render: the row that moves the\n// month, the months themselves with their weekday header, and the name each\n// month takes while more than one stack. Apart from either component so the two cannot drift, and\n// outside `src/components` for the reason ./styles.ts gives.\n\n/** One entry of React Aria's month or year picker, as either lists it. */\ntype MenuEntry = {\n date: CalendarDate;\n formatted: string;\n id: number;\n};\n\n/** What React Aria's month and year pickers hand the element they render. */\ntype MenuPicker = {\n 'aria-label': string;\n items: MenuEntry[];\n onChange: (key: Key | null) => void;\n value: Key;\n};\ntype OpenMenu = 'month' | 'year';\n\n// How many years the open year list holds: a century either side of the year\n// shown, and that year. Material Design's own list scrolls a whole range of\n// years rather than a window that moves with each choice, and Compose's\n// default range is two centuries. Bounds cut it short where they fall inside.\nconst LISTED_YEARS = 201;\n\n/**\n * What a calendar draws above its months, and the months themselves. With\n * `showMonthYearMenus` the header is the date pickers page's docked one —\n * the month and the year as menu buttons — and while either is open its list\n * takes the months' place.\n *\n * The menus are for one visible month. They name and pick the first month\n * alone, so a second grid beside it would have no visible month or year of\n * its own; with more than one month the header is the plain one, whose\n * heading names the whole range, both years included where it spans two.\n */\nfunction CalendarFrame({\n children,\n months,\n showMonthYearMenus\n}: {\n children: ReactNode;\n /** How many months the calendar shows side by side. */\n months: number;\n showMonthYearMenus: boolean;\n}): ReactElement {\n if (showMonthYearMenus && months <= 1) {\n return <CalendarMenus>{children}</CalendarMenus>;\n }\n return <>\n <CalendarHeader />\n {children}\n </>;\n}\n\n/**\n * The weekday row, faded with the rest of a calendar that is disabled. The\n * state comes from React Aria's context rather than a prop, so the two\n * calendars draw it the same way without either passing anything down.\n *\n * The narrow letters are for the eye alone. React Aria hides the row from\n * assistive technology, since every date's name opens with its weekday in\n * full, so a letter that two days share is never read out.\n */\nfunction CalendarGridHeader(): ReactElement {\n const single = useContext(CalendarStateContext);\n const range = useContext(RangeCalendarStateContext);\n const isDisabled = (single ?? range)?.isDisabled ?? false;\n return <RACCalendarGridHeader>\n {isDisabled ? disabledHeaderCell : calendarHeaderCell}\n </RACCalendarGridHeader>;\n}\n\n/**\n * The two chevrons with the month between them. React Aria wires\n * `slot=\"previous\"` and `slot=\"next\"` on its own `Button`, and `IconButton`\n * renders React Aria's `Button` too — so nesting one inside a slot would put\n * two buttons where the date pickers page draws one. The chevrons take the\n * icon buttons page's 40dp square and its state layer instead.\n *\n * A plain element rather than a `<header>`: a header is a banner landmark,\n * landmarks may not nest, and React Aria puts a calendar in\n * `role=\"application\"` — axe fails the page on it.\n *\n * React Aria hides the heading between the chevrons from assistive\n * technology. The one a reader reaches is React Aria's own, out of sight,\n * naming the calendar's label with the month, so a calendar adds one heading\n * to the page's outline rather than two.\n */\nfunction CalendarHeader(): ReactElement {\n return <div {...stylex.props(calendarStyles.header)}>\n <RACButton className={chevronClassName} slot=\"previous\">\n <ChevronEndGlyph {...stylex.props(calendarStyles.chevronGlyph, calendarStyles.chevronGlyphPrevious)} />\n </RACButton>\n <RACHeading {...stylex.props(calendarStyles.heading)} />\n <RACButton className={chevronClassName} slot=\"next\">\n <ChevronEndGlyph {...stylex.props(calendarStyles.chevronGlyph)} />\n </RACButton>\n </div>;\n}\n\n/** The weekday row, in the type the page gives both it and the dates. */\nfunction calendarHeaderCell(day: string): ReactElement {\n return headerCell(day, false);\n}\n\n/**\n * The docked header: the month's menu button between the chevrons that step\n * it, and the year's menu button at the end. A press opens the button's list\n * in the months' place, where the page draws it, rather than in a popover over\n * them; a calendar inside a picker is already in one. While a list is open\n * the chevrons are hidden and the other menu is disabled, as the page draws\n * them, and choosing an entry — or pressing the one already checked, or\n * Escape — closes the list and puts focus back on its button.\n *\n * The lists are React Aria's month and year pickers, rendered twice: the\n * header names the month short, as the page's button does, and the list in\n * full. The year list runs a century either side of the year shown — React\n * Aria's own default is ten, which took several passes through the list to\n * reach a date of birth — and `minValue` and `maxValue` cut it short, which\n * React Aria does itself. A month with no day inside them is disabled here.\n */\nfunction CalendarMenus({\n children\n}: {\n children: ReactNode;\n}): ReactElement {\n const single = useContext(CalendarStateContext);\n const range = useContext(RangeCalendarStateContext);\n const state = single ?? range;\n const [open, setOpen] = useState<null | OpenMenu>(null);\n const listId = useId();\n const monthButton = useRef<HTMLButtonElement>(null);\n const yearButton = useRef<HTMLButtonElement>(null);\n\n // A frame after the choice, and focus back on the button before the list\n // goes, rather than lost with it. The key that chose still has a keypress\n // to deliver: React Aria leaves Enter's default alone on a Mac, and with\n // focus already moved the keypress pressed the menu button and opened the\n // list again. A frame later it has landed on the list instead, as the\n // click after a pointer's choice has.\n const close = useCallback(() => {\n const button = open === 'month' ? monthButton : yearButton;\n requestAnimationFrame(() => {\n button.current?.focus();\n setOpen(null);\n });\n }, [open]);\n const toggleMonth = useCallback(() => {\n setOpen(current => current === 'month' ? null : 'month');\n }, []);\n const toggleYear = useCallback(() => {\n setOpen(current => current === 'year' ? null : 'year');\n }, []);\n const isDisabled = state?.isDisabled ?? false;\n const outsideBounds = (picker: MenuPicker) => picker.items.filter(entry => state?.maxValue != null && startOfMonth(entry.date).compare(state.maxValue) > 0 || state?.minValue != null && endOfMonth(entry.date).compare(state.minValue) < 0).map(entry => entry.id);\n return <>\n <div {...stylex.props(calendarStyles.header)}>\n <div {...stylex.props(calendarStyles.headerGroup)}>\n <RACButton className={chevronClassNameWhile(open !== null)} slot=\"previous\">\n <ChevronEndGlyph {...stylex.props(calendarStyles.chevronGlyph, calendarStyles.chevronGlyphPrevious)} />\n </RACButton>\n <RACCalendarMonthPicker>\n {picker => <MenuButton controls={listId} isDisabled={isDisabled || open === 'year'} isExpanded={open === 'month'} onPress={toggleMonth} picker={picker} ref={monthButton} />}\n </RACCalendarMonthPicker>\n <RACButton className={chevronClassNameWhile(open !== null)} slot=\"next\">\n <ChevronEndGlyph {...stylex.props(calendarStyles.chevronGlyph)} />\n </RACButton>\n </div>\n <RACCalendarYearPicker>\n {picker => <MenuButton controls={listId} isDisabled={isDisabled || open === 'month'} isExpanded={open === 'year'} onPress={toggleYear} picker={picker} ref={yearButton} />}\n </RACCalendarYearPicker>\n </div>\n {open === null ? children : null}\n {open === 'month' ? <RACCalendarMonthPicker format=\"long\">\n {picker => <MenuList disabledKeys={outsideBounds(picker)} id={listId} onClose={close} picker={picker} />}\n </RACCalendarMonthPicker> : null}\n {open === 'year' ? <RACCalendarYearPicker visibleYears={LISTED_YEARS}>\n {picker => <MenuList id={listId} onClose={close} picker={picker} />}\n </RACCalendarYearPicker> : null}\n </>;\n}\n\n/**\n * The month grids, one per visible month, each with the weekday row over\n * its dates. React Aria positions each grid from its own offset, so\n * `visibleDuration` of more than one draws the months side by side rather\n * than one grid that scrolls between them, and stacks them below the\n * expanded breakpoint. Stacked, each month is named over its grid by\n * `MonthCaption`, since the heading above them all names the range as a\n * whole; see `monthCaption` in ./styles.ts.\n *\n * The date's cell is the one thing the two calendars draw differently, so it\n * is the child.\n */\nfunction CalendarMonths({\n children,\n months\n}: {\n /** The cell each date of every month renders in. */\n children: (date: CalendarDate) => ReactElement;\n /** How many months the calendar shows. */\n months: number;\n}): ReactElement {\n const offsets = monthOffsets(months);\n const isStackable = offsets.length > 1;\n return <div {...stylex.props(calendarStyles.months, isStackable && calendarStyles.monthsStacked)}>\n {offsets.map(offset => <div key={offset.months} {...stylex.props(calendarStyles.month)}>\n {isStackable ? <MonthCaption offset={offset} /> : null}\n <RACCalendarGrid offset={offset} {...stylex.props(calendarStyles.grid)}>\n <CalendarGridHeader />\n <RACCalendarGridBody>{children}</RACCalendarGridBody>\n </RACCalendarGrid>\n </div>)}\n </div>;\n}\n\n/**\n * Scrolls an open list so its checked entry sits in the middle, as the page\n * draws it, with the entries either side of it in view. React Aria scrolls\n * the entry it focuses only as far as the nearest edge, which left the year\n * shown at the bottom with every later year out of sight; with it already\n * centred, that scroll has nothing to do.\n *\n * A ref on the checked entry's check rather than an effect on the list,\n * because React Aria builds its entries in a render of its own, after the\n * list's effects have run: the ref is called as the entry is attached,\n * before the first paint, so the list never draws a frame at its top and\n * then jumps. The list's own scroll alone moves, where `scrollIntoView` would\n * move the page around it too. A check rendered anywhere but an attached\n * list — React Aria renders its entries once out of the document to collect\n * them — finds no list and does nothing.\n */\nfunction centreInList(check: null | SVGSVGElement) {\n const entry = check?.closest('[role=\"option\"]');\n const list = check?.closest('[role=\"listbox\"]');\n if (!(entry instanceof HTMLElement) || !(list instanceof HTMLElement)) {\n return;\n }\n list.scrollTop += entry.getBoundingClientRect().top - list.getBoundingClientRect().top - (list.clientHeight - entry.offsetHeight) / 2;\n}\n\n// A chevron's classes, from React Aria's own render state. React Aria\n// disables one when the month it would move to is outside `minValue` and\n// `maxValue`, or the whole calendar is disabled, and a press on it then does\n// nothing — so it takes the shared fade, which drops the state layer too.\nfunction chevronClassName(state: {\n isDisabled: boolean;\n isHovered: boolean;\n isPressed: boolean;\n}, isHidden = false) {\n return stylex.props(iconButton.chrome, calendarStyles.chevron, focus.ring, state.isHovered && iconButton.chromeHovered, state.isPressed && iconButton.chromePressed, state.isDisabled && iconButton.chromeDisabled, isHidden && calendarStyles.chevronHidden).className ?? '';\n}\n\n// The same, hidden while a month or year list is open.\nfunction chevronClassNameWhile(isListOpen: boolean) {\n return (state: {\n isDisabled: boolean;\n isHovered: boolean;\n isPressed: boolean;\n }) => chevronClassName(state, isListOpen);\n}\n\n// A weekday in a disabled calendar, at the fade its dates take.\nfunction disabledHeaderCell(day: string): ReactElement {\n return headerCell(day, true);\n}\nfunction headerCell(day: string, isDisabled: boolean): ReactElement {\n return <RACCalendarHeaderCell {...stylex.props(calendarStyles.headerCell, isDisabled && calendarStyles.headerCellDisabled)}>\n {day}\n </RACCalendarHeaderCell>;\n}\n\n/**\n * The month or the year as the page's menu button, opening its list. Named\n * by what it shows and then by what it is — \"Sep month\" — which keeps the\n * visible text the start of the name, so a reader who says what they see\n * reaches it.\n *\n * Outside React Aria's button context, which a calendar fills with its\n * `previous` and `next` slots alone: a button with no slot inside it is an\n * error, and these are not either chevron.\n */\nfunction MenuButton({\n controls,\n isDisabled,\n isExpanded,\n onPress,\n picker,\n ref\n}: {\n controls: string;\n isDisabled: boolean;\n isExpanded: boolean;\n onPress: () => void;\n picker: MenuPicker;\n ref: Ref<HTMLButtonElement>;\n}): ReactElement {\n const valueId = useId();\n const nameId = useId();\n const shown = picker.items.find(entry => entry.id === picker.value);\n return <ButtonContext value={null}>\n <RACButton aria-controls={isExpanded ? controls : undefined} aria-expanded={isExpanded} aria-haspopup=\"listbox\" aria-labelledby={`${valueId} ${nameId}`} className={menuButtonClassName} isDisabled={isDisabled} onPress={onPress} ref={ref}>\n <span id={valueId}>{shown?.formatted}</span>\n <span hidden id={nameId}>\n {picker['aria-label']}\n </span>\n <ArrowDropDownGlyph {...stylex.props(calendarStyles.menuArrow, isExpanded && calendarStyles.menuArrowExpanded)} />\n </RACButton>\n </ButtonContext>;\n}\n\n// A menu button's classes, from React Aria's render state, with the icon\n// buttons' state layers and fade — see `menuButton`.\nfunction menuButtonClassName(state: {\n isDisabled: boolean;\n isHovered: boolean;\n isPressed: boolean;\n}) {\n return stylex.props(calendarStyles.menuButton, focus.ring, state.isHovered && iconButton.chromeHovered, state.isPressed && iconButton.chromePressed, state.isDisabled && iconButton.chromeDisabled).className ?? '';\n}\n\n// One row of an open list: the check where the row is the one shown, the\n// room it takes where it is not, then the month or the year. Built by a call\n// rather than written inline at the prop, which is what react-perf's\n// no-new-function-as-prop is after.\nfunction menuEntry(entry: MenuEntry): ReactElement {\n return <RACListBoxItem className={menuItemClassName} id={entry.id} textValue={entry.formatted}>\n {menuEntryContent(entry.formatted)}\n </RACListBoxItem>;\n}\nfunction menuEntryContent(label: string) {\n return ({\n isSelected\n }: {\n isSelected: boolean;\n }) => <>\n {isSelected ? <CheckGlyph ref={centreInList} {...stylex.props(calendarStyles.menuCheck)} /> : <span {...stylex.props(calendarStyles.menuCheck)} />}\n {label}\n </>;\n}\n\n// A row's classes, from React Aria's render state. The layers come after the\n// checked row's surface variant, written for whichever ground the row has,\n// and the fade last, which StyleX lets drop them by replacing a property\n// whole.\nfunction menuItemClassName(state: {\n isDisabled: boolean;\n isFocusVisible: boolean;\n isHovered: boolean;\n isPressed: boolean;\n isSelected: boolean;\n}) {\n return stylex.props(calendarStyles.menuItem, state.isSelected && calendarStyles.menuItemSelected, state.isHovered && (state.isSelected ? menuLayers.selectedHovered : dateLayers.plainHovered), state.isPressed && (state.isSelected ? menuLayers.selectedPressed : dateLayers.plainPressed), state.isFocusVisible && calendarStyles.menuItemFocused, state.isDisabled && calendarStyles.menuItemDisabled).className ?? '';\n}\n\n/**\n * An open month or year list, in the months' place. React Aria's list box,\n * with the entry the calendar shows selected and focused when it opens.\n *\n * Choosing closes it, and so does pressing the checked entry or Escape. A\n * single selection that may empty is what tells those apart: choosing\n * replaces the selection, while the checked entry toggles it off and Escape\n * clears it — and the clearing is what stops Escape there rather than letting\n * it close a picker's dialog around the calendar.\n */\nfunction MenuList({\n disabledKeys,\n id,\n onClose,\n picker\n}: {\n disabledKeys?: Key[];\n id: string;\n onClose: () => void;\n picker: MenuPicker;\n}): ReactElement {\n const selected = useMemo(() => [picker.value], [picker.value]);\n const choose = useCallback((keys: Selection) => {\n // The one entry a single selection holds after a choice, and none\n // after the checked entry is pressed again or Escape clears it.\n if (keys !== 'all') {\n for (const key of keys) {\n picker.onChange(key);\n }\n }\n onClose();\n }, [onClose, picker]);\n return <RACListBox aria-label={picker['aria-label']}\n // oxlint-disable-next-line jsx-a11y/no-autofocus -- a list opened from its button takes focus, as a select's does\n autoFocus disabledKeys={disabledKeys} id={id} items={picker.items} onSelectionChange={choose} selectedKeys={selected} selectionMode=\"single\"\n // On the release rather than the press, so the pointer is done with the\n // list before it closes: chosen on the press, the release landed on\n // whatever the closing list uncovered beneath it.\n shouldSelectOnPressUp {...stylex.props(calendarStyles.menuList)}>\n {menuEntry}\n </RACListBox>;\n}\n\n/**\n * The name of the month a grid shows, over the grid, for a calendar drawing\n * more than one. It is formatted as React Aria names the grid itself — the\n * month in full and the year, in the calendar system and time zone the\n * calendar runs in, with the era where a Gregorian date falls before the\n * common one — so the two say the same thing.\n *\n * Hidden from assistive technology, which hears the same name already: React\n * Aria labels every grid with the calendar's name and its own month.\n */\nfunction MonthCaption({\n offset\n}: {\n offset: {\n months: number;\n };\n}): null | ReactElement {\n const single = useContext(CalendarStateContext);\n const range = useContext(RangeCalendarStateContext);\n const state = single ?? range;\n const start = state?.visibleRange.start.add(offset);\n const formatter = useDateFormatter({\n calendar: start?.calendar.identifier,\n era: start?.calendar.identifier === 'gregory' && start.era === 'BC' ? 'short' : undefined,\n month: 'long',\n timeZone: state?.timeZone,\n year: 'numeric'\n });\n if (state == null || start == null) {\n return null;\n }\n const month = start.calendar.getFormattableMonth?.(start) ?? start;\n return <div aria-hidden {...stylex.props(calendarStyles.monthCaption)}>\n {formatter.format(month.toDate(state.timeZone))}\n </div>;\n}\nexport { CalendarFrame, CalendarMonths };"],"mappings":";;;;;;;;;;;;;AAuCA,MAAMwB,eAAe;;;;;;;;;;;;AAarB,SAAAC,cAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAuB,MAAA,EAAAC,UAAAC,QAAAC,uBAAAL;CAUrB,IAAIK,sBAAsBD,UAAU,GAAC;EAAA,IAAAE;EAAA,IAAAL,EAAA,OAAAE,UAAA;GAC5BG,KAAA,oBAAC,eAAD,EAAgBH,SAAF,CAAA;GAA2BF,EAAA,KAAAE;GAAAF,EAAA,KAAAK;EAAA,OAAAA,KAAAL,EAAA;EAAA,OAAzCK;CAAyC;CACjD,IAAAA;CAAA,IAAAL,EAAA,OAAAM,OAAAC,IAAA,2BAAA,GAAA;EAEGF,KAAA,oBAAC,gBAAD,CAAe,CAAA;EAAGL,EAAA,KAAAK;CAAA,OAAAA,KAAAL,EAAA;CAAA,IAAAQ;CAAA,IAAA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AM;CAClD,MAAAkE,YAAkBrK,iBAAiB;EAAAsK,UACvBJ,OAAKI,SAAqBC;EAAAC,KAC/BN,OAAKI,SAAqBC,eAAK,aAAaL,MAAKM,QAAS,OAA1D,UAAAlC,KAAAA;EAAoFlC,OAClF;EAAMqE,UACH7H,OAAK6H;EAAUC,MACnB;CACR,CAAC;CACD,IAAI9H,SAAS,QAAQsH,SAAS,MAAI,OACzB;CAET,MAAA9D,QAAc8D,MAAKI,SAASK,sBAAuBT,KAAc,KAAnDA;CACF,MAAAzI,KAAA;CAAW,IAAAG;CAAA,IAAAR,EAAA,OAAAM,OAAAC,IAAA,2BAAA,GAAA;EAAKC,KAAAjC,MAAaY,eAAcqK,YAAa;EAACxJ,EAAA,KAAAQ;CAAA,OAAAA,KAAAR,EAAA;CAChE,MAAAoB,KAAA6H,UAASQ,OAAQzE,MAAK0E,OAAQlI,MAAK6H,QAAS,CAAC;CAAC,IAAA/G;CAAA,IAAAtC,EAAA,OAAAQ,MAAAR,EAAA,OAAAoB,IAAA;EAD5CkB,KAAA,oBAAA,OAAA;GAAK,eAAAjC;GAAW,GAAKG;GACvBY,UAAAA;EACG,CAAA;EAAApB,EAAA,KAAAQ;EAAAR,EAAA,KAAAoB;EAAApB,EAAA,KAAAsC;CAAA,OAAAA,KAAAtC,EAAA;CAAA,OAFDsC;AAEC"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["endOfMonth","startOfMonth","stylex","useContext","useId","useRef","useState","useDateFormatter","CalendarStateContext","CalendarGridHeader","RangeCalendarStateContext","focus","iconButton","monthOffsets","calendarStyles","dateLayers","menuLayers","date","formatted","id","items","onChange","key","value","LISTED_YEARS","CalendarFrame","t0","$","_c","children","months","showMonthYearMenus","t1","Symbol","for","t2","single","range","isDisabled","disabledHeaderCell","calendarHeaderCell","CalendarHeader","header","chevronClassName","chevronGlyph","chevronGlyphPrevious","heading","t3","day","headerCell","CalendarMenus","state","open","setOpen","listId","monthButton","yearButton","button","requestAnimationFrame","current","close","_temp","toggleMonth","_temp2","toggleYear","t4","picker","filter","entry","maxValue","compare","minValue","map","_temp3","outsideBounds","t5","t6","headerGroup","t7","t8","chevronClassNameWhile","t9","t10","t11","picker_0","t12","t13","t14","t15","t16","t17","picker_1","t18","t19","t20","picker_2","t21","picker_3","t22","entry_0","current_0","CalendarMonths","offsets","isStackable","length","monthsStacked","offset","month","grid","centreInList","check","closest","list","HTMLElement","scrollTop","getBoundingClientRect","top","clientHeight","offsetHeight","isHovered","isPressed","isHidden","chrome","chevron","ring","chromeHovered","chromePressed","chromeDisabled","chevronHidden","className","isListOpen","headerCellDisabled","MenuButton","controls","isExpanded","onPress","ref","valueId","nameId","find","shown","undefined","menuArrow","menuArrowExpanded","menuButtonClassName","menuButton","menuEntry","menuItemClassName","menuEntryContent","label","isSelected","menuCheck","isFocusVisible","menuItem","menuItemSelected","selectedHovered","plainHovered","selectedPressed","plainPressed","menuItemFocused","menuItemDisabled","MenuList","disabledKeys","onClose","selected","keys","choose","menuList","MonthCaption","start","visibleRange","add","formatter","calendar","identifier","era","timeZone","year","getFormattableMonth","monthCaption","format","toDate","RACCalendarGridHeader","RACButton","RACHeading","RACCalendarMonthPicker","RACCalendarYearPicker","RACCalendarGrid","RACCalendarGridBody","RACCalendarHeaderCell","RACListBoxItem","RACListBox"],"sources":["../../src/calendar/index.tsx"],"sourcesContent":["import type { CalendarDate } from '@internationalized/date';\nimport type { ReactElement, ReactNode, Ref } from 'react';\nimport type { Key, Selection } from 'react-aria-components';\nimport { endOfMonth, startOfMonth } from '@internationalized/date';\nimport * as stylex from '@stylexjs/stylex';\nimport { useCallback, useContext, useId, useMemo, useRef, useState } from 'react';\nimport { useDateFormatter } from 'react-aria';\nimport { ButtonContext, CalendarStateContext, Button as RACButton, CalendarGrid as RACCalendarGrid, CalendarGridBody as RACCalendarGridBody, CalendarGridHeader as RACCalendarGridHeader, CalendarHeaderCell as RACCalendarHeaderCell, CalendarMonthPicker as RACCalendarMonthPicker, CalendarYearPicker as RACCalendarYearPicker, Heading as RACHeading, ListBox as RACListBox, ListBoxItem as RACListBoxItem, RangeCalendarStateContext } from 'react-aria-components';\nimport { ArrowDropDownGlyph, CheckGlyph, ChevronEndGlyph } from '../glyphs';\nimport { focus } from '../styles/focus';\nimport { iconButton } from '../styles/icon-button';\nimport { monthOffsets } from './months';\nimport { calendarStyles, dateLayers, menuLayers } from './styles';\n\n// The parts Calendar and RangeCalendar both render: the row that moves the\n// month, the months themselves with their weekday header, and the name each\n// month takes while more than one stack. Apart from either component so the two cannot drift, and\n// outside `src/components` for the reason ./styles.ts gives.\n\n/** One entry of React Aria's month or year picker, as either lists it. */\ntype MenuEntry = {\n date: CalendarDate;\n formatted: string;\n id: number;\n};\n\n/** What React Aria's month and year pickers hand the element they render. */\ntype MenuPicker = {\n 'aria-label': string;\n items: MenuEntry[];\n onChange: (key: Key | null) => void;\n value: Key;\n};\ntype OpenMenu = 'month' | 'year';\n\n// How many years the open year list holds: a century either side of the year\n// shown, and that year. Material Design's own list scrolls a whole range of\n// years rather than a window that moves with each choice, and Compose's\n// default range is two centuries. Bounds cut it short where they fall inside.\nconst LISTED_YEARS = 201;\n\n/**\n * What a calendar draws above its months, and the months themselves. With\n * `showMonthYearMenus` the header is the date pickers page's docked one —\n * the month and the year as menu buttons — and while either is open its list\n * takes the months' place.\n *\n * The menus are for one visible month. They name and pick the first month\n * alone, so a second grid beside it would have no visible month or year of\n * its own; with more than one month the header is the plain one, whose\n * heading names the whole range, both years included where it spans two.\n */\nfunction CalendarFrame({\n children,\n months,\n showMonthYearMenus\n}: {\n children: ReactNode;\n /** How many months the calendar shows side by side. */\n months: number;\n showMonthYearMenus: boolean;\n}): ReactElement {\n if (showMonthYearMenus && months <= 1) {\n return <CalendarMenus>{children}</CalendarMenus>;\n }\n return <>\n <CalendarHeader />\n {children}\n </>;\n}\n\n/**\n * The weekday row, faded with the rest of a calendar that is disabled. The\n * state comes from React Aria's context rather than a prop, so the two\n * calendars draw it the same way without either passing anything down.\n *\n * The narrow letters are for the eye alone. React Aria hides the row from\n * assistive technology, since every date's name opens with its weekday in\n * full, so a letter that two days share is never read out.\n */\nfunction CalendarGridHeader(): ReactElement {\n const single = useContext(CalendarStateContext);\n const range = useContext(RangeCalendarStateContext);\n const isDisabled = (single ?? range)?.isDisabled ?? false;\n return <RACCalendarGridHeader>\n {isDisabled ? disabledHeaderCell : calendarHeaderCell}\n </RACCalendarGridHeader>;\n}\n\n/**\n * The two chevrons with the month between them. React Aria wires\n * `slot=\"previous\"` and `slot=\"next\"` on its own `Button`, and `IconButton`\n * renders React Aria's `Button` too — so nesting one inside a slot would put\n * two buttons where the date pickers page draws one. The chevrons take the\n * icon buttons page's 40dp square and its state layer instead.\n *\n * A plain element rather than a `<header>`: a header is a banner landmark,\n * landmarks may not nest, and React Aria puts a calendar in\n * `role=\"application\"` — axe fails the page on it.\n *\n * React Aria hides the heading between the chevrons from assistive\n * technology. The one a reader reaches is React Aria's own, out of sight,\n * naming the calendar's label with the month, so a calendar adds one heading\n * to the page's outline rather than two.\n */\nfunction CalendarHeader(): ReactElement {\n return <div {...stylex.props(calendarStyles.header)}>\n <RACButton className={chevronClassName} slot=\"previous\">\n <ChevronEndGlyph {...stylex.props(calendarStyles.chevronGlyph, calendarStyles.chevronGlyphPrevious)} />\n </RACButton>\n <RACHeading {...stylex.props(calendarStyles.heading)} />\n <RACButton className={chevronClassName} slot=\"next\">\n <ChevronEndGlyph {...stylex.props(calendarStyles.chevronGlyph)} />\n </RACButton>\n </div>;\n}\n\n/** The weekday row, in the type the page gives both it and the dates. */\nfunction calendarHeaderCell(day: string): ReactElement {\n return headerCell(day, false);\n}\n\n/**\n * The docked header: the month's menu button between the chevrons that step\n * it, and the year's menu button at the end. A press opens the button's list\n * in the months' place, where the page draws it, rather than in a popover over\n * them; a calendar inside a picker is already in one. While a list is open\n * the chevrons are hidden and the other menu is disabled, as the page draws\n * them, and choosing an entry — or pressing the one already checked, or\n * Escape — closes the list and puts focus back on its button.\n *\n * The lists are React Aria's month and year pickers, rendered twice: the\n * header names the month short, as the page's button does, and the list in\n * full. The year list runs a century either side of the year shown — React\n * Aria's own default is ten, which took several passes through the list to\n * reach a date of birth — and `minValue` and `maxValue` cut it short, which\n * React Aria does itself. A month with no day inside them is disabled here.\n */\nfunction CalendarMenus({\n children\n}: {\n children: ReactNode;\n}): ReactElement {\n const single = useContext(CalendarStateContext);\n const range = useContext(RangeCalendarStateContext);\n const state = single ?? range;\n const [open, setOpen] = useState<null | OpenMenu>(null);\n const listId = useId();\n const monthButton = useRef<HTMLButtonElement>(null);\n const yearButton = useRef<HTMLButtonElement>(null);\n\n // A frame after the choice, and focus back on the button before the list\n // goes, rather than lost with it. The key that chose still has a keypress\n // to deliver: React Aria leaves Enter's default alone on a Mac, and with\n // focus already moved the keypress pressed the menu button and opened the\n // list again. A frame later it has landed on the list instead, as the\n // click after a pointer's choice has.\n const close = useCallback(() => {\n const button = open === 'month' ? monthButton : yearButton;\n requestAnimationFrame(() => {\n button.current?.focus();\n setOpen(null);\n });\n }, [open]);\n const toggleMonth = useCallback(() => {\n setOpen(current => current === 'month' ? null : 'month');\n }, []);\n const toggleYear = useCallback(() => {\n setOpen(current => current === 'year' ? null : 'year');\n }, []);\n const isDisabled = state?.isDisabled ?? false;\n const outsideBounds = (picker: MenuPicker) => picker.items.filter(entry => state?.maxValue != null && startOfMonth(entry.date).compare(state.maxValue) > 0 || state?.minValue != null && endOfMonth(entry.date).compare(state.minValue) < 0).map(entry => entry.id);\n return <>\n <div {...stylex.props(calendarStyles.header)}>\n <div {...stylex.props(calendarStyles.headerGroup)}>\n <RACButton className={chevronClassNameWhile(open !== null)} slot=\"previous\">\n <ChevronEndGlyph {...stylex.props(calendarStyles.chevronGlyph, calendarStyles.chevronGlyphPrevious)} />\n </RACButton>\n <RACCalendarMonthPicker>\n {picker => <MenuButton controls={listId} isDisabled={isDisabled || open === 'year'} isExpanded={open === 'month'} onPress={toggleMonth} picker={picker} ref={monthButton} />}\n </RACCalendarMonthPicker>\n <RACButton className={chevronClassNameWhile(open !== null)} slot=\"next\">\n <ChevronEndGlyph {...stylex.props(calendarStyles.chevronGlyph)} />\n </RACButton>\n </div>\n <RACCalendarYearPicker>\n {picker => <MenuButton controls={listId} isDisabled={isDisabled || open === 'month'} isExpanded={open === 'year'} onPress={toggleYear} picker={picker} ref={yearButton} />}\n </RACCalendarYearPicker>\n </div>\n {open === null ? children : null}\n {open === 'month' ? <RACCalendarMonthPicker format=\"long\">\n {picker => <MenuList disabledKeys={outsideBounds(picker)} id={listId} onClose={close} picker={picker} />}\n </RACCalendarMonthPicker> : null}\n {open === 'year' ? <RACCalendarYearPicker visibleYears={LISTED_YEARS}>\n {picker => <MenuList id={listId} onClose={close} picker={picker} />}\n </RACCalendarYearPicker> : null}\n </>;\n}\n\n/**\n * The month grids, one per visible month, each with the weekday row over\n * its dates. React Aria positions each grid from its own offset, so\n * `visibleDuration` of more than one draws the months side by side rather\n * than one grid that scrolls between them, and stacks them below the\n * expanded breakpoint. Stacked, each month is named over its grid by\n * `MonthCaption`, since the heading above them all names the range as a\n * whole; see `monthCaption` in ./styles.ts.\n *\n * The date's cell is the one thing the two calendars draw differently, so it\n * is the child.\n */\nfunction CalendarMonths({\n children,\n months\n}: {\n /** The cell each date of every month renders in. */\n children: (date: CalendarDate) => ReactElement;\n /** How many months the calendar shows. */\n months: number;\n}): ReactElement {\n const offsets = monthOffsets(months);\n const isStackable = offsets.length > 1;\n return <div {...stylex.props(calendarStyles.months, isStackable && calendarStyles.monthsStacked)}>\n {offsets.map(offset => <div key={offset.months} {...stylex.props(calendarStyles.month)}>\n {isStackable ? <MonthCaption offset={offset} /> : null}\n <RACCalendarGrid offset={offset} {...stylex.props(calendarStyles.grid)}>\n <CalendarGridHeader />\n <RACCalendarGridBody>{children}</RACCalendarGridBody>\n </RACCalendarGrid>\n </div>)}\n </div>;\n}\n\n/**\n * Scrolls an open list so its checked entry sits in the middle, as the page\n * draws it, with the entries either side of it in view. React Aria scrolls\n * the entry it focuses only as far as the nearest edge, which left the year\n * shown at the bottom with every later year out of sight; with it already\n * centred, that scroll has nothing to do.\n *\n * A ref on the checked entry's check rather than an effect on the list,\n * because React Aria builds its entries in a render of its own, after the\n * list's effects have run: the ref is called as the entry is attached,\n * before the first paint, so the list never draws a frame at its top and\n * then jumps. The list's own scroll alone moves, where `scrollIntoView` would\n * move the page around it too. A check rendered anywhere but an attached\n * list — React Aria renders its entries once out of the document to collect\n * them — finds no list and does nothing.\n */\nfunction centreInList(check: null | SVGSVGElement) {\n const entry = check?.closest('[role=\"option\"]');\n const list = check?.closest('[role=\"listbox\"]');\n if (!(entry instanceof HTMLElement) || !(list instanceof HTMLElement)) {\n return;\n }\n list.scrollTop += entry.getBoundingClientRect().top - list.getBoundingClientRect().top - (list.clientHeight - entry.offsetHeight) / 2;\n}\n\n// A chevron's classes, from React Aria's own render state. React Aria\n// disables one when the month it would move to is outside `minValue` and\n// `maxValue`, or the whole calendar is disabled, and a press on it then does\n// nothing — so it takes the shared fade, which drops the state layer too.\nfunction chevronClassName(state: {\n isDisabled: boolean;\n isHovered: boolean;\n isPressed: boolean;\n}, isHidden = false) {\n return stylex.props(iconButton.chrome, calendarStyles.chevron, focus.ring, state.isHovered && iconButton.chromeHovered, state.isPressed && iconButton.chromePressed, state.isDisabled && iconButton.chromeDisabled, isHidden && calendarStyles.chevronHidden).className ?? '';\n}\n\n// The same, hidden while a month or year list is open.\nfunction chevronClassNameWhile(isListOpen: boolean) {\n return (state: {\n isDisabled: boolean;\n isHovered: boolean;\n isPressed: boolean;\n }) => chevronClassName(state, isListOpen);\n}\n\n// A weekday in a disabled calendar, at the fade its dates take.\nfunction disabledHeaderCell(day: string): ReactElement {\n return headerCell(day, true);\n}\nfunction headerCell(day: string, isDisabled: boolean): ReactElement {\n return <RACCalendarHeaderCell {...stylex.props(calendarStyles.headerCell, isDisabled && calendarStyles.headerCellDisabled)}>\n {day}\n </RACCalendarHeaderCell>;\n}\n\n/**\n * The month or the year as the page's menu button, opening its list. Named\n * by what it shows and then by what it is — \"Sep month\" — which keeps the\n * visible text the start of the name, so a reader who says what they see\n * reaches it.\n *\n * Outside React Aria's button context, which a calendar fills with its\n * `previous` and `next` slots alone: a button with no slot inside it is an\n * error, and these are not either chevron.\n */\nfunction MenuButton({\n controls,\n isDisabled,\n isExpanded,\n onPress,\n picker,\n ref\n}: {\n controls: string;\n isDisabled: boolean;\n isExpanded: boolean;\n onPress: () => void;\n picker: MenuPicker;\n ref: Ref<HTMLButtonElement>;\n}): ReactElement {\n const valueId = useId();\n const nameId = useId();\n const shown = picker.items.find(entry => entry.id === picker.value);\n return <ButtonContext value={null}>\n <RACButton aria-controls={isExpanded ? controls : undefined} aria-expanded={isExpanded} aria-haspopup=\"listbox\" aria-labelledby={`${valueId} ${nameId}`} className={menuButtonClassName} isDisabled={isDisabled} onPress={onPress} ref={ref}>\n <span id={valueId}>{shown?.formatted}</span>\n <span hidden id={nameId}>\n {picker['aria-label']}\n </span>\n <ArrowDropDownGlyph {...stylex.props(calendarStyles.menuArrow, isExpanded && calendarStyles.menuArrowExpanded)} />\n </RACButton>\n </ButtonContext>;\n}\n\n// A menu button's classes, from React Aria's render state, with the icon\n// buttons' state layers and fade — see `menuButton`.\nfunction menuButtonClassName(state: {\n isDisabled: boolean;\n isHovered: boolean;\n isPressed: boolean;\n}) {\n return stylex.props(calendarStyles.menuButton, focus.ring, state.isHovered && iconButton.chromeHovered, state.isPressed && iconButton.chromePressed, state.isDisabled && iconButton.chromeDisabled).className ?? '';\n}\n\n// One row of an open list: the check where the row is the one shown, the\n// room it takes where it is not, then the month or the year. Built by a call\n// rather than written inline at the prop, which is what react-perf's\n// no-new-function-as-prop is after.\nfunction menuEntry(entry: MenuEntry): ReactElement {\n return <RACListBoxItem className={menuItemClassName} id={entry.id} textValue={entry.formatted}>\n {menuEntryContent(entry.formatted)}\n </RACListBoxItem>;\n}\nfunction menuEntryContent(label: string) {\n return ({\n isSelected\n }: {\n isSelected: boolean;\n }) => <>\n {isSelected ? <CheckGlyph ref={centreInList} {...stylex.props(calendarStyles.menuCheck)} /> : <span {...stylex.props(calendarStyles.menuCheck)} />}\n {label}\n </>;\n}\n\n// A row's classes, from React Aria's render state. The layers come after the\n// checked row's surface variant, written for whichever ground the row has,\n// and the fade last, which StyleX lets drop them by replacing a property\n// whole.\nfunction menuItemClassName(state: {\n isDisabled: boolean;\n isFocusVisible: boolean;\n isHovered: boolean;\n isPressed: boolean;\n isSelected: boolean;\n}) {\n return stylex.props(calendarStyles.menuItem, state.isSelected && calendarStyles.menuItemSelected, state.isHovered && (state.isSelected ? menuLayers.selectedHovered : dateLayers.plainHovered), state.isPressed && (state.isSelected ? menuLayers.selectedPressed : dateLayers.plainPressed), state.isFocusVisible && calendarStyles.menuItemFocused, state.isDisabled && calendarStyles.menuItemDisabled).className ?? '';\n}\n\n/**\n * An open month or year list, in the months' place. React Aria's list box,\n * with the entry the calendar shows selected and focused when it opens.\n *\n * Choosing closes it, and so does pressing the checked entry or Escape. A\n * single selection that may empty is what tells those apart: choosing\n * replaces the selection, while the checked entry toggles it off and Escape\n * clears it — and the clearing is what stops Escape there rather than letting\n * it close a picker's dialog around the calendar.\n */\nfunction MenuList({\n disabledKeys,\n id,\n onClose,\n picker\n}: {\n disabledKeys?: Key[];\n id: string;\n onClose: () => void;\n picker: MenuPicker;\n}): ReactElement {\n const selected = useMemo(() => [picker.value], [picker.value]);\n const choose = useCallback((keys: Selection) => {\n // The one entry a single selection holds after a choice, and none\n // after the checked entry is pressed again or Escape clears it.\n if (keys !== 'all') {\n for (const key of keys) {\n picker.onChange(key);\n }\n }\n onClose();\n }, [onClose, picker]);\n return <RACListBox aria-label={picker['aria-label']}\n // oxlint-disable-next-line jsx-a11y/no-autofocus -- a list opened from its button takes focus, as a select's does\n autoFocus disabledKeys={disabledKeys} id={id} items={picker.items} onSelectionChange={choose} selectedKeys={selected} selectionMode=\"single\"\n // On the release rather than the press, so the pointer is done with the\n // list before it closes: chosen on the press, the release landed on\n // whatever the closing list uncovered beneath it.\n shouldSelectOnPressUp {...stylex.props(calendarStyles.menuList)}>\n {menuEntry}\n </RACListBox>;\n}\n\n/**\n * The name of the month a grid shows, over the grid, for a calendar drawing\n * more than one. It is formatted as React Aria names the grid itself — the\n * month in full and the year, in the calendar system and time zone the\n * calendar runs in, with the era where a Gregorian date falls before the\n * common one — so the two say the same thing.\n *\n * Hidden from assistive technology, which hears the same name already: React\n * Aria labels every grid with the calendar's name and its own month.\n */\nfunction MonthCaption({\n offset\n}: {\n offset: {\n months: number;\n };\n}): null | ReactElement {\n const single = useContext(CalendarStateContext);\n const range = useContext(RangeCalendarStateContext);\n const state = single ?? range;\n const start = state?.visibleRange.start.add(offset);\n const formatter = useDateFormatter({\n calendar: start?.calendar.identifier,\n era: start?.calendar.identifier === 'gregory' && start.era === 'BC' ? 'short' : undefined,\n month: 'long',\n timeZone: state?.timeZone,\n year: 'numeric'\n });\n if (state == null || start == null) {\n return null;\n }\n const month = start.calendar.getFormattableMonth?.(start) ?? start;\n return <div aria-hidden {...stylex.props(calendarStyles.monthCaption)}>\n {formatter.format(month.toDate(state.timeZone))}\n </div>;\n}\nexport { CalendarFrame, CalendarMonths };"],"mappings":";;;;;;;;;;;;;AAuCA,MAAMwB,eAAe;;;;;;;;;;;;AAarB,SAAAC,cAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAuB,MAAA,EAAAC,UAAAC,QAAAC,uBAAAL;CAUrB,IAAIK,sBAAsBD,UAAU,GAAC;EAAA,IAAAE;EAAA,IAAAL,EAAA,OAAAE,UAAA;GAC5BG,KAAA,oBAAC,eAAD,EAAgBH,SAAF,CAAA;GAA2BF,EAAA,KAAAE;GAAAF,EAAA,KAAAK;EAAA,OAAAA,KAAAL,EAAA;EAAA,OAAzCK;CAAyC;CACjD,IAAAA;CAAA,IAAAL,EAAA,OAAAM,OAAAC,IAAA,2BAAA,GAAA;EAEGF,KAAA,oBAAC,gBAAD,CAAe,CAAA;EAAGL,EAAA,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AAC;CACd,MAAAoI,QAActH,OAAKuH,aAAoBD,MAAIE,IAACjE,MAAM;CAClD,MAAAkE,YAAkBrK,iBAAiB;EAAAsK,UACvBJ,OAAKI,SAAqBC;EAAAC,KAC/BN,OAAKI,SAAqBC,eAAK,aAAaL,MAAKM,QAAS,OAA1D,UAAAlC,KAAAA;EAAoFlC,OAClF;EAAMqE,UACH7H,OAAK6H;EAAUC,MACnB;CACR,CAAC;CACD,IAAI9H,SAAS,QAAQsH,SAAS,MAAI,OACzB;CAET,MAAA9D,QAAc8D,MAAKI,SAASK,sBAAuBT,KAAc,KAAnDA;CACF,MAAAzI,KAAA;CAAW,IAAAG;CAAA,IAAAR,EAAA,OAAAM,OAAAC,IAAA,2BAAA,GAAA;EAAKC,KAAAjC,MAAaY,eAAcqK,YAAa;EAACxJ,EAAA,KAAAQ;CAAA,OAAAA,KAAAR,EAAA;CAChE,MAAAoB,KAAA6H,UAASQ,OAAQzE,MAAK0E,OAAQlI,MAAK6H,QAAS,CAAC;CAAC,IAAA/G;CAAA,IAAAtC,EAAA,OAAAQ,MAAAR,EAAA,OAAAoB,IAAA;EAD5CkB,KAAA,oBAAA,OAAA;GAAK,eAAAjC;GAAW,GAAKG;GACvBY,UAAAA;EACG,CAAA;EAAApB,EAAA,KAAAQ;EAAAR,EAAA,KAAAoB;EAAApB,EAAA,KAAAsC;CAAA,OAAAA,KAAAtC,EAAA;CAAA,OAFDsC;AAEC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { props } from "../../node_modules/@stylexjs/stylex/lib/es/stylex.js";
|
|
3
|
+
import "../../hooks/useAppBarScroll.js";
|
|
3
4
|
import { hasContent } from "../../render/content.js";
|
|
4
5
|
import { useRender } from "../../render/useRender.js";
|
|
5
6
|
import { mergeStyles } from "../../styles/merge.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_c","stylex","createElement","useEffect","useLayoutEffect","useRef","hasContent","useRender","mergeStyles","spacing","motionDurationMs","motionEasing","ICON_BUTTON_TARGET","GLYPH_INSET","HEIGHTS","lg","plain","withSubtitle","md","sm","COLLAPSED_HEIGHT","styles","pinned","k87sOh","kVAEAm","kY2c9j","$$css","root","k6CgDc","kGNEyG","kWkggS","kB7OPa","k1xSpc","kjj79g","kIyJzY","k1ekBW","kAMwcw","row","kfiyM8","kC13JO","kzqmXN","kUOVxO","scrolled","kL6WhQ","kfdmCh","kt9PQ7","text","kSGwAc","kXwgrk","kJuA4N","kE4Cay","k7Eaqz","kHjlTd","k8WAf4","textBelow","textCenter","k9WMMc","twoRows","kTDh7v","k4zj60","kWgvks","k5JduY","kVb13B","k5jvz2","HEADLINE_VARIANT","SUBTITLE_VARIANT","HEADINGS","heading","level","Number","isInteger","PARAGRAPH","_temp","kAzted","heightStyles","minBlockSize","val","undefined","_temp2","ks0D6T","rowStyles","start","end","maxInlineSize","kwRFfy","kZCmMZ","tracks","gridTemplateColumns","gridTemplateRows","kumcoG","k9llMU","START_COLUMNS","_temp3","keoZOQ","textStyles","inset","reach","marginBlockStart","UNDER_TARGETS","align","collapsed","contentInset","contentMaxInlineSize","headingLevel","headline","leading","size","subtitle","trailing","LINES","height","lines","x","y","AppBar","t0","$","t1","t2","t3","t4","t5","t6","render","t7","t8","props","collapse","below","expandedHeight","hasLeading","hasTrailing","centred","hasSlot","padsForStart","padsForEnd","t9","Symbol","for","0","1","className","line","textRef","useCollapseMotion","t10","t11","edgePadding","centredColumns","t12","t13","glyphRoom","t14","t15","t16","t17","t18","t19","t20","children","t21","defaultTagName","room","side","drawnAt","bar","settled","getBoundingClientRect","map","selector","index","element","querySelector","moved","matrixOf","a","e","f","withUnit","geometryOf","frame","box","edge","left","right","isRightToLeft","parseFloat","getComputedStyle","fontSize","glyphTopOf","top","range","document","createRange","selectNodeContents","first","getClientRects","item","direction","DOMMatrixReadOnly","transform","originOf","prefersReducedMotion","window","matchMedia","matches","collapsedBefore","animations","current","parentElement","moving","some","_temp4","last","from","animation_0","animation","cancel","to","timing","duration","medium1","easing","emphasized","heights","animate","blockSize","clipPath","entries","was","is","origin","push","transformOrigin","text_0","bar_0","remeasure","_temp5","resize","ResizeObserver","observe","fonts","addEventListener","disconnect","removeEventListener","animation_1","playState","trim"],"sources":["../../../src/components/app-bar/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { createElement, useEffect, useLayoutEffect, useRef } from 'react';\nimport type { RenderComponentProps } from '../../render/useRender';\nimport { COLLAPSED_BLOCK_SIZE } from '../../hooks/useAppBarScroll';\nimport { hasContent } from '../../render/content';\nimport { useRender } from '../../render/useRender';\nimport '../../styles/layers.stylex';\nimport { layers } from '../../styles/layers.stylex';\nimport { mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, motion, sizing, spacing } from '../../tokens/design.tokens.stylex';\nimport { motionDurationMs, motionEasing } from '../../tokens/values';\nimport Text from '../text';\n\n// Material Design's app bar, in the three sizes the spec recommends.\n//\n// `md` and `lg` are Material Design's medium and large *flexible* bars, the\n// newer of the two sets the spec gives and the one it recommends, which is why\n// those two steps are theirs: their heights, their two rows, and their type\n// roles, which HEADLINE_VARIANT and SUBTITLE_VARIANT name.\n//\n// Material Design also merged the old center-aligned variant into small as a\n// configuration rather than a variant, which is why alignment is a prop here\n// and applies to every size.\n//\n// Heights are Material Design's, and they are minimums rather than fixed. The\n// spec says the flexible bars \"hug the text contents\" and gives them multi-line\n// support and text wrapping, so a headline long enough to wrap has to be able\n// to make its bar taller. Fixing the height would truncate exactly the case\n// the variant was redesigned for.\n//\n// The small bar is one row: the leading slot, the text and the trailing slot\n// side by side in a 64px strip. The flexible bars are two, as Material Design\n// lays them out. The first is that same strip holding the slots alone, and the\n// second runs the text under it across the whole measure, so a long headline\n// wraps against the bar's width rather than against what the slots leave.\n// Collapsing moves the text up into the strip, which is the small bar exactly,\n// and the slots never move: they are in the strip in both states.\n//\n// Centred text is centred on the bar, not in the room the slots leave, which\n// is how Material Design places it: with a leading icon and no actions, the\n// room between the two is off the bar's middle by half the icon. So a centred\n// strip's side columns share what the text leaves equally, whatever is in\n// them, and the text moves off the middle only where a wide slot needs the\n// room — see `centredColumns`.\n//\n// A centred bar's text takes one line beside its slots, cut short with an\n// ellipsis, as Material Design gives the centre-aligned bar one line of\n// headline. Everywhere else the text wraps and the bar grows with it, but\n// centred lines wrapping between a back button and three actions at a phone's\n// width made a ragged column four or five lines tall in the middle of the bar. The\n// flexible bars' second row runs under the slots across the whole width, so\n// it keeps wrapping when centred; collapsed, they are the small bar, and cut\n// their lines as it does. The headline is still the heading's whole text, so\n// it stays the bar's accessible name.\n//\n// The slots set the colours the page gives their icons: on surface for the\n// leading one and on surface variant for the trailing ones. The second is a\n// standard icon button's own colour, and the first is not, so the leading\n// slot also sets the property a standard icon button reads its colour from —\n// see `standard` in src/components/icon-button/index.tsx.\n\n// The geometry Material Design lays a bar's icon buttons out on. Its tokens\n// give a 4dp leading and trailing space between the bar's edge and the first\n// button's 48dp target, no space between one target and the next, and a 24dp\n// icon centred in each — so a glyph lands 4 + 12 = 16dp in, on the page's own\n// margin.\n//\n// The library's icon button draws a 40dp box with its 48dp target out of\n// flow, so a slot pads half the difference either side and puts the whole\n// difference between two buttons, which lays the targets edge to edge as the\n// tokens do. The target is IconButton's TARGET_SIZE, a literal there for the\n// reason it gives: it is a floor the page states, not a step of the control\n// scale.\nconst ICON_BUTTON_TARGET = '48px';\nconst ICON_SIZE = '24px';\n\n// How far an icon sits inside its target, which is how much less than the\n// content inset the row is padded on an edge that holds a slot. That is what\n// puts a leading glyph, rather than the edge of its target, at the inset.\nconst GLYPH_INSET = `(${ICON_BUTTON_TARGET} - ${ICON_SIZE}) / 2`;\nconst HEIGHTS = {\n lg: {\n plain: '120px',\n withSubtitle: '152px'\n },\n md: {\n plain: '112px',\n withSubtitle: '136px'\n },\n sm: {\n plain: `${COLLAPSED_BLOCK_SIZE}px`,\n withSubtitle: `${COLLAPSED_BLOCK_SIZE}px`\n }\n} as const;\n\n// What a flexible bar collapses to, which is the small bar exactly. Material\n// Design does not describe the collapsed large bar as a state of its own — it\n// describes it as becoming the small bar, which is why this reads off the same\n// table rather than being a fourth height.\nconst COLLAPSED_HEIGHT = HEIGHTS.sm.plain;\n\n// Windows High Contrast and the rest of the forced-colours modes. Spelled\n// here rather than imported, for the reason src/field/styles.ts records: the\n// StyleX compiler resolves a constant across files only out of a `.stylex.ts`\n// module, and the generated one holds design tokens rather than queries.\nconst FORCED_COLORS = '@media (forced-colors: active)';\nconst styles = {\n pinned: {\n k87sOh: \"x13vifvy\",\n kVAEAm: \"x7wzq59\",\n kY2c9j: \"xfj7q76\",\n $$css: true\n },\n root: {\n k6CgDc: \"x12w9bfk\",\n kGNEyG: \"x1qjc9v5\",\n kWkggS: \"x14s9m32\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"x78zum5\",\n kjj79g: \"xl56j7k\",\n kIyJzY: \"xioksi3\",\n k1ekBW: \"x15406qy\",\n kAMwcw: \"x1seskgd\",\n $$css: true\n },\n row: {\n kfiyM8: \"x10ukxgv\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"xrvj5dj\",\n kC13JO: \"x97ohe\",\n kzqmXN: \"xh8yej3\",\n kUOVxO: \"xvueqy4\",\n $$css: true\n },\n scrolled: {\n kWkggS: \"x1mjdul6\",\n kL6WhQ: \"xszdk7l\",\n kfdmCh: \"xe3zi7u\",\n kt9PQ7: \"x15anc7y\",\n $$css: true\n },\n text: {\n kSGwAc: \"xamitd3\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"x78zum5\",\n kXwgrk: \"xdt5ytf\",\n kJuA4N: \"x12gd1sl\",\n kE4Cay: \"xkjl1po\",\n k7Eaqz: \"xeuugli\",\n kHjlTd: \"xj0a0fe\",\n k8WAf4: \"x1cmllll\",\n $$css: true\n },\n textBelow: {\n kSGwAc: \"xnav3zx\",\n k8WAf4: \"xt970qd\",\n $$css: true\n },\n textCenter: {\n k9WMMc: \"x2b8uid\",\n $$css: true\n }\n};\n\n// The flexible bars' two rows: the strip with the slots at either end, and the\n// text under it across all three columns. The second row takes whatever height\n// the bar has beyond the strip, and the text sits at its bottom.\n//\n// Material Design places that text by its last baseline, 28px above the large\n// bar's bottom edge and 24px above the medium one's, and that is the reading\n// that makes the heights above come out, together with the reach textStyles\n// gives the text: the same figures as padding under the line box would make a\n// plain large bar 64 + 44 + 28 = 136px rather than 120px. CSS gives a box no\n// margin below its baseline, so the strut does it.\n// An empty box in the same grid area, aligned on its last baseline with the\n// text, has its baseline at its own bottom edge and the margin under that, so\n// the pair is held that far off the row's end. Literals rather than tokens,\n// like HEIGHTS: they are measurements the spec gives this component, not steps\n// of the spacing scale, which has no 28.\nconst twoRows = {\n lg: {\n kTDh7v: \"x1mna9mr\",\n k4zj60: \"x1gmr53x\",\n kWgvks: \"xx38sju\",\n k5JduY: \"x1s928wv\",\n kVb13B: \"x1vlsijy\",\n k5jvz2: \"x1fh8phi\",\n kC13JO: \"xc3o5yk\",\n $$css: true\n },\n md: {\n kTDh7v: \"x1mna9mr\",\n k4zj60: \"x1gmr53x\",\n kWgvks: \"xx38sju\",\n k5JduY: \"x1s928wv\",\n kVb13B: \"x1vlsijy\",\n k5jvz2: \"x1v6yq59\",\n kC13JO: \"xc3o5yk\",\n $$css: true\n }\n};\n\n// One entry per size, and each names a type role rather than a figure.\n// Material Design's own tokens are `md.comp.app-bar.<size>.title.font`,\n// aliases onto the type scale rather than sizes of their own, so this maps to\n// the scale the same way and lets Text apply it. The roles are the flexible\n// bars': headlineMedium on medium and displaySmall on large, which is a step\n// up from what the spec's other medium and large bars take, and the small\n// bar's titleLarge.\nconst HEADLINE_VARIANT = {\n lg: 'displaySmall',\n md: 'headlineMedium',\n sm: 'titleLarge'\n} as const;\n\n// The subtitle's role, by the same tokens' `subtitle.font`. Material Design\n// gives each size its own rather than one role at every size, and a collapsed\n// bar takes the small bar's, as it takes its headline's.\nconst SUBTITLE_VARIANT = {\n lg: 'titleMedium',\n md: 'labelLarge',\n sm: 'labelMedium'\n} as const;\n\n// The headline is the page's title in Material Design's model, so it is the\n// page's <h1> unless the call site says otherwise. `headingLevel` is what says\n// otherwise, and a bar drawn beside another bar — one per pane in a\n// `ListDetail` or a `SupportingPane` — or under a page heading of its own\n// should lower it.\n//\n// Built here rather than kept as a constant per level: `headline` becomes the\n// heading's children, so a call site cannot demote the heading by passing one\n// of its own. `headline={<h2>…</h2>}` renders an h2 inside the h1 — two\n// headings where one was wanted, which React does not warn about.\n//\n// The level is looked up rather than interpolated into a tag name. `h7` is a\n// custom element as far as React is concerned, so it renders without a word\n// said and leaves the outline worse than the default would have. The prop's\n// type is the six levels, and a value outside them from a call site the type\n// does not reach — `NaN`, which rounded and clamped to no element at all and\n// took the headline out of the outline — falls back to the default h1.\n// Disclosure's own `headingLevel` hands the number to React Aria, which is\n// why that one needs no equivalent.\nconst HEADINGS = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'] as const;\nfunction heading(level: number) {\n const known = Number.isInteger(level) && level >= 1 && level <= 6;\n return createElement(known ? HEADINGS[level - 1] : HEADINGS[0]);\n}\nconst PARAGRAPH = <p />;\n\n// Height is the one value the call site does not choose, and it depends on two\n// props at once, so it is a function style rather than one key per\n// combination. StyleX writes it to a custom property inline, the same\n// mechanism Feed uses for its cell minimum.\n//\n// The row takes it too, and that is for the collapse's motion. The bar's\n// height is animated, and a row that only stretched to it would be laid out\n// at every height the bar passed through: the second row is the room the bar\n// has beyond the strip, so its text would ride up and down with the bar\n// rather than holding the place the animation moves it to. With the minimum\n// of its own, the row is laid out once, at the height the bar is heading for,\n// and the bar clips it until it gets there.\nconst _temp = {\n kAzted: \"x1chvrdh\",\n \"$$css\": true\n};\nconst heightStyles = {\n root: (minBlockSize: string) => [_temp, {\n \"--x-minBlockSize\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(minBlockSize)\n }]\n};\n\n// The row's measure and inset both come from the call site, so both are\n// function styles too. Each edge is worked out on its own: where it holds a\n// slot the row stops short of the inset by GLYPH_INSET, so the glyph rather\n// than its target is what sits at the inset, and where it holds none the\n// headline itself starts there. Clamped at zero, since an inset smaller than\n// a glyph's own room would otherwise ask for a negative padding, which CSS\n// throws away whole.\n//\n// The tracks are a function style for two other reasons: the strip is the\n// small bar's height, which is the hook's constant, and the compiler cannot\n// read a constant out of another module — see FORCED_COLORS; and a centred\n// bar's columns depend on the inset — see `centredColumns`.\nconst _temp2 = {\n ks0D6T: \"x13i5qev\",\n \"$$css\": true\n};\nconst rowStyles = {\n root: (start: string, end: string, maxInlineSize: string) => [_temp2, {\n kwRFfy: end != null ? \"x120eax6\" : end,\n kZCmMZ: start != null ? \"xnvo3vl\" : start,\n $$css: true\n }, {\n \"--x-maxInlineSize\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(maxInlineSize),\n \"--x-paddingInlineEnd\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(end),\n \"--x-paddingInlineStart\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(start)\n }],\n tracks: (gridTemplateColumns: string, gridTemplateRows: string) => [{\n kumcoG: gridTemplateColumns != null ? \"xqketvx\" : gridTemplateColumns,\n k9llMU: gridTemplateRows != null ? \"x1xxtoay\" : gridTemplateRows,\n $$css: true\n }, {\n \"--x-gridTemplateColumns\": gridTemplateColumns != null ? gridTemplateColumns : undefined,\n \"--x-gridTemplateRows\": gridTemplateRows != null ? gridTemplateRows : undefined\n }]\n};\n\n// A bar's columns with its text at the start: the slots at their own widths\n// and the text taking what they leave.\nconst START_COLUMNS = 'auto minmax(0, 1fr) auto';\n\n// The text in the second row runs under the slots as well as between them, so\n// it puts back what the row's padding held off an edge for a slot's glyph, and\n// the headline starts on the inset again. A function style for the reason the\n// row's padding is one.\n//\n// It also reaches up into the strip, by the band under the slots' targets,\n// and Material Design's heights depend on that. A large bar's 36/44 headline\n// with its baseline 28px above a 120px bar's edge has the top of its line box\n// inside the strip, and so does the medium bar's 28/36 one: measured, the two\n// bars came out 126px and 115px tall without it. What reaches in is the line's\n// leading and the room above its capitals rather than any glyph, and it stops\n// where the targets do, so nothing a reader can press is under it. A function\n// style because the strip's height is the hook's constant — see rowStyles.\nconst _temp3 = {\n keoZOQ: \"x1vhfslr\",\n \"$$css\": true\n};\nconst textStyles = {\n inset: (start: string, end: string) => [{\n kwRFfy: end != null ? \"x120eax6\" : end,\n kZCmMZ: start != null ? \"xnvo3vl\" : start,\n $$css: true\n }, {\n \"--x-paddingInlineEnd\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(end),\n \"--x-paddingInlineStart\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(start)\n }],\n reach: (marginBlockStart: string) => [_temp3, {\n \"--x-marginBlockStart\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(marginBlockStart)\n }]\n};\n\n// How far the strip runs on below the slots' targets, which are centred in it.\nconst UNDER_TARGETS = `calc((${COLLAPSED_HEIGHT} - ${ICON_BUTTON_TARGET}) / 2)`;\ntype AppBarProps = Omit<RenderComponentProps<'header'>, 'children'> & {\n /**\n * Which of Material Design's alignments the text takes. `center` is the\n * configuration that replaced the old center-aligned variant, and centres\n * the text on the bar rather than between the slots, so a bar with a\n * leading icon and no actions still has its headline in the middle. The\n * text moves off the middle only as far as a slot wider than the other\n * needs, rather than running under it. Beside the slots, which is `sm` and\n * a collapsed flexible bar, each line of centred text takes one line and\n * is cut short with an ellipsis rather than wrapping.\n * @default 'start'\n */\n align?: 'center' | 'start';\n /**\n * Collapses a flexible bar to the height and headline of the small one, for\n * a bar `pinned` over content that has been scrolled. Material Design\n * specifies it for the flexible sizes, and without it a pinned `lg` costs\n * 152px of the viewport for as long as the page is open.\n *\n * Controlled, and for the same reason `scrolled` is: only the app knows\n * which element scrolls, and how far into it the bar should have finished\n * collapsing. `useAppBarScroll` derives both from that element's scroll,\n * and is the way to set them unless the app needs a rule of its own.\n *\n * Ignored on `sm`, which is already the height this collapses to. The\n * headline and the subtitle move up into the row the slots sit in and take\n * the small bar's type roles, which fit both lines in its 64px, and the\n * slots never leave that row: they stay where they are while the bar\n * shrinks under them.\n *\n * Collapsing hands the page back the height the bar gives up, and a bar\n * whose state is read off the scroll offset can then undo itself in two\n * ways. Both move the offset back under the threshold, so the bar expands,\n * the page regains its height, and the two take turns for as long as the\n * reader stays there.\n *\n * - **Scroll anchoring.** Browsers answer a change in height above the\n * viewport by moving the offset by the same amount, to keep the content\n * in place. Give the scroll container `overflow-anchor: none`, which is\n * also the movement you want: the content follows the bar's bottom edge\n * up rather than standing still while the bar shrinks behind it.\n * - **The shorter page.** A page that overflows by less than the threshold\n * plus the height the bar gives back cannot scroll that far once the bar\n * has collapsed, so the browser pulls the offset back inside it. No\n * threshold avoids this, since the band moves with it; what does is not\n * collapsing on such a page, which is the rule `useAppBarScroll` applies.\n * @default false\n */\n collapsed?: boolean;\n /**\n * Where the bar's content starts on each edge: the headline where nothing\n * comes before it, and the leading icon's glyph where something does, with\n * the headline after the icon button's target. The trailing edge is the\n * same mirrored. Any length works, `0` included, for a bar drawn flush.\n *\n * The default is Material Design's own margin for a top app bar, the\n * spacing scale's `lg` step, which is also the margin it gives body\n * content, so a bar and the page beneath line up without either being told\n * about the other. Set it to the page's gutter where that differs.\n * @default spacing.lg\n */\n contentInset?: string;\n /**\n * How wide the bar's contents may run before they stop growing, with the\n * row centred in whatever is left. The bar's own surface still paints edge\n * to edge.\n *\n * This is what lines a full-bleed bar up with a page whose content sits in\n * a measure: give it the page's measure, and `contentInset` the page's\n * gutter. Unset, the row is as wide as the bar.\n */\n contentMaxInlineSize?: string;\n /**\n * Where the headline sits in the page's outline, as one of the six heading\n * levels. A screen reader moves between headings, so a bar drawn beside\n * another bar, or under a page heading of its own, should lower it. A value\n * outside the six that reaches it untyped falls back to 1.\n * @default 1\n */\n headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;\n /**\n * The page's title. Wraps rather than truncating, and grows the bar with\n * it, except beside the slots of a centred bar, where it takes one line and\n * is cut short with an ellipsis — see `align`.\n */\n headline?: ReactNode;\n /**\n * Usually a back or menu icon button. Sits before the text, and a standard\n * icon button here draws its icon in on surface, the colour the page gives\n * a bar's leading icon, rather than its own on surface variant.\n */\n leading?: ReactNode;\n /**\n * Holds the bar at the top of its scroll container while the content\n * scrolls beneath it, and keeps it painted over that content. The bar\n * still needs a scrolling ancestor to stick inside: the window, or an\n * element with its own overflow. A pinned bar is the one `collapsed` and\n * `scrolled` are for.\n * @default false\n */\n pinned?: boolean;\n /**\n * Whether the content beneath has been scrolled. Material Design separates\n * a bar from scrolled content with a fill colour rather than a shadow, and\n * this is what applies it.\n *\n * Controlled, with no listener of its own: only the app knows which element\n * scrolls, and a bar that watched the window would be wrong inside every\n * pane and dialog that scrolls independently.\n * @default false\n */\n scrolled?: boolean;\n /**\n * Height and headline size, as steps of the library's size scale. `sm` is\n * Material Design's small bar, a fixed 64px row; `md` and `lg` are its\n * medium and large flexible bars, which put the text in a row of its own\n * under the slots and hug it.\n * @default 'sm'\n */\n size?: 'lg' | 'md' | 'sm';\n /** A second line under the headline. Makes `md` and `lg` taller. */\n subtitle?: ReactNode;\n /** Actions, at the far end. Usually icon buttons. */\n trailing?: ReactNode;\n};\n\n// The text block's two lines: the headline, and the subtitle beside it. The\n// block holds nothing else, and each is drawn as one kind of element.\nconst LINES = [':scope > :is(h1, h2, h3, h4, h5, h6)', ':scope > p'] as const;\n\n/**\n * What collapsing moves, and so what its animation runs between: the bar's\n * height, and each of the text's lines, in the order LINES gives them, with\n * `null` for a line the bar does not draw.\n */\ntype Geometry = {\n height: number;\n lines: (Line | null)[];\n};\n\n/**\n * Where one of the text's lines is drawn: the point its glyphs hang from,\n * measured from the bar's own corner, and its type size. The point is the\n * top of the line's first glyphs, on the edge the text hangs from.\n */\ntype Line = {\n size: number;\n x: number;\n y: number;\n};\n\n/**\n * Material Design's app bar: the container at the top of a page carrying its\n * title, one or two actions, and the way back out.\n *\n * ```tsx\n * <AppBar headline=\"Headline\" leading={back} size=\"md\" trailing={actions} />\n * ```\n *\n * Three sizes. `sm` is a fixed 64px bar for a page whose title is a label;\n * `md` and `lg` are the flexible bars, which give the headline a larger\n * type role in a row of its own under the slots, and grow to fit a subtitle\n * or a headline that wraps.\n *\n * It paints its own surface, unlike the layout components, because separating\n * itself from the content beneath is the job — which is also why `scrolled`\n * and `collapsed` exist. Neither watches the page: only the app knows which\n * element scrolls, so both are set from its own scroll handler.\n */\nfunction AppBar({\n align = 'start',\n collapsed = false,\n contentInset = spacing.lg,\n contentMaxInlineSize = 'none',\n headingLevel = 1,\n headline,\n leading,\n pinned = false,\n render,\n scrolled = false,\n size = 'sm',\n subtitle,\n trailing,\n ...props\n}: AppBarProps) {\n // `sm` is already what the flexible bars collapse to, so collapsing it is\n // a no-op rather than an error. A bar whose size is chosen at the call site\n // from a breakpoint would otherwise have to guard the prop as well.\n const collapse = collapsed && size !== 'sm';\n // The flexible bars at their full height are the only state with a second\n // row. Collapsed, they are the small bar.\n const below = size !== 'sm' && !collapse;\n const expandedHeight = hasContent(subtitle) ? HEIGHTS[size].withSubtitle : HEIGHTS[size].plain;\n const height = collapse ? COLLAPSED_HEIGHT : expandedHeight;\n const hasLeading = hasContent(leading);\n const hasTrailing = hasContent(trailing);\n // A centred bar pads both edges as one holding a slot would, so the row\n // is the same either side of the middle — see `centredColumns`.\n const centred = align === 'center';\n const hasSlot = hasLeading || hasTrailing;\n const padsForStart = centred ? hasSlot : hasLeading;\n const padsForEnd = centred ? hasSlot : hasTrailing;\n // Each line of a centred bar's text takes one beside the slots — see the\n // header.\n const line = {\n 0: {},\n 1: {\n className: \"xb3r6kr xlyipyv xuxw1ft\"\n }\n }[!!(centred && !below) << 0];\n const textRef = useCollapseMotion(collapse, align);\n return useRender({\n defaultTagName: 'header',\n props: {\n ...props,\n children: <div {...stylex.props(styles.row, rowStyles.root(edgePadding(contentInset, padsForStart), edgePadding(contentInset, padsForEnd), contentMaxInlineSize), rowStyles.tracks(centred ? centredColumns(contentInset, hasLeading, hasTrailing) : START_COLUMNS, below ? `minmax(${COLLAPSED_HEIGHT}, auto) 1fr` : `minmax(${COLLAPSED_HEIGHT}, auto)`), heightStyles.root(height), below && twoRows[size])}>\n {!hasLeading ? null : <div className=\"x6s0dn4 xamitd3 x9f619 x78zum5 x1r8zjiw x1let9r4 x155k8fu x139gbkf x1kxrqrs x1lqcxt8 x15ir4sr\">{leading}</div>}\n <div {...stylex.props(styles.text, below && styles.textBelow, below && textStyles.inset(glyphRoom(contentInset, padsForStart), glyphRoom(contentInset, padsForEnd)), below && textStyles.reach(`calc(-1 * ${UNDER_TARGETS})`), align === 'center' && styles.textCenter)} ref={textRef}>\n {!hasContent(headline) ? null : <Text {...line} render={heading(headingLevel)} variant={collapse ? HEADLINE_VARIANT.sm : HEADLINE_VARIANT[size]}>\n {headline}\n </Text>}\n {!hasContent(subtitle) ? null : <Text {...line} render={PARAGRAPH} tone=\"muted\" variant={collapse ? SUBTITLE_VARIANT.sm : SUBTITLE_VARIANT[size]}>\n {subtitle}\n </Text>}\n </div>\n {!hasTrailing ? null : <div className=\"x6s0dn4 xamitd3 x9f619 x78zum5 x1r8zjiw x1let9r4 x1w5n3ug x1txd71x x1qab1bc x6aqprb\">\n {trailing}\n </div>}\n </div>,\n ...mergeStyles(stylex.props(styles.root, heightStyles.root(height), scrolled && styles.scrolled, pinned && styles.pinned), props)\n },\n render\n });\n}\n\n/**\n * A centred bar's columns: the text in the middle at its own width, and a\n * column either side sharing what it leaves equally, so the text is centred\n * on the row. A side column is never narrower than its slot, which is what\n * moves the text off the middle when a slot is wider than the other side's\n * share, and never as far as overlapping it.\n *\n * The row pads both edges for a slot, so the two sides match, and an edge\n * with no slot puts back what that padding held off for a glyph as its\n * column's least width. A headline long enough to reach that edge stops on\n * the inset, as it does at the start.\n */\nfunction centredColumns(contentInset: string, hasLeading: boolean, hasTrailing: boolean) {\n const room = glyphRoom(contentInset, hasLeading || hasTrailing);\n const side = (hasSlot: boolean) => hasSlot ? 'minmax(auto, 1fr)' : `minmax(${room}, 1fr)`;\n return `${side(hasLeading)} auto ${side(hasTrailing)}`;\n}\n\n/**\n * Where an animation still under way has the bar and the text drawn: the\n * height it holds the bar at, and each line where its transform has taken it\n * and at the size its scale has reached. A line scales about the point it\n * hangs from, so the transform's translation is how far that point has moved.\n */\nfunction drawnAt(bar: HTMLElement, text: HTMLElement, settled: Geometry): Geometry {\n return {\n height: bar.getBoundingClientRect().height,\n lines: LINES.map((selector, index) => {\n const line = settled.lines[index];\n const element = text.querySelector(selector);\n if (line === null || element === null) {\n return null;\n }\n const moved = matrixOf(element);\n return {\n size: line.size * moved.a,\n x: line.x + moved.e,\n y: line.y + moved.f\n };\n })\n };\n}\n\n/** The row's padding on one edge, for the inset the call site gave. */\nfunction edgePadding(contentInset: string, hasSlot: boolean) {\n const inset = withUnit(contentInset);\n return hasSlot ? `max(0px, ${inset} - ${GLYPH_INSET})` : inset;\n}\n\n/**\n * Where the bar and each of the text's lines are drawn. A line's point is on\n * the edge its text hangs from: the middle when it is centred, and the start\n * edge otherwise, which is the right edge in a right-to-left page. Each line\n * is as wide as the text block, so that edge is its box's.\n */\nfunction geometryOf(bar: HTMLElement, text: HTMLElement, align: 'center' | 'start'): Geometry {\n const frame = bar.getBoundingClientRect();\n return {\n height: frame.height,\n lines: LINES.map(selector => {\n const element = text.querySelector(selector);\n if (element === null) {\n return null;\n }\n const box = element.getBoundingClientRect();\n const edge = align === 'center' ? (box.left + box.right) / 2 : isRightToLeft(element) ? box.right : box.left;\n return {\n size: Number.parseFloat(getComputedStyle(element).fontSize),\n x: edge - frame.left,\n y: glyphTopOf(element) - frame.top\n };\n })\n };\n}\n\n/**\n * What the row's padding held back on one edge for a slot's glyph, which the\n * text in the second row puts back: the inset less `edgePadding`, so the\n * smaller of the inset and GLYPH_INSET.\n */\nfunction glyphRoom(contentInset: string, hasSlot: boolean) {\n return hasSlot ? `min(${withUnit(contentInset)}, ${GLYPH_INSET})` : '0px';\n}\n\n/**\n * Where an element's first glyphs start, which is below its box's top by\n * half its line's leading. The leading is a share of the line height, and\n * the two roles a line moves between do not keep line height and type size\n * in one ratio, so a line scaled by its type size from its box's corner\n * starts its glyphs off where they were drawn: about a pixel, for a large\n * bar's headline.\n */\nfunction glyphTopOf(element: Element) {\n const range = document.createRange();\n range.selectNodeContents(element);\n const first = range.getClientRects().item(0);\n return first === null ? element.getBoundingClientRect().top : first.top;\n}\n\n/** Whether the text runs right to left, which decides the edge it hangs from. */\nfunction isRightToLeft(element: Element) {\n return getComputedStyle(element).direction === 'rtl';\n}\n\n/** The transform an element is drawn with, `none` reading as no change. */\nfunction matrixOf(element: Element) {\n return new DOMMatrixReadOnly(getComputedStyle(element).transform);\n}\n\n/**\n * The point a line scales about, in its own box: the top of its glyphs, on\n * the edge its text hangs from.\n */\nfunction originOf(element: Element, align: 'center' | 'start') {\n const edge = align === 'center' ? 'center' : isRightToLeft(element) ? 'right' : 'left';\n const glyphs = glyphTopOf(element) - element.getBoundingClientRect().top;\n return `${edge} ${glyphs}px`;\n}\n\n/**\n * Read when the bar changes state rather than once at mount, so a reader who\n * changes the setting is answered by the next collapse.\n */\nfunction prefersReducedMotion() {\n return window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n}\n\n/**\n * Animates a flexible bar between its two states, and returns the ref for the\n * text block whose lines it moves.\n *\n * Collapsing changes the bar's layout rather than a value — the text leaves\n * the second row for the strip, both lines take the small bar's type roles,\n * and the bar's height drops from a minimum to whatever its content takes —\n * so there is nothing for a CSS transition to interpolate. This plays it the\n * other way round: the change has already been laid out when the effect runs,\n * so the bar is animated from the height it had to the one it has, and each\n * line from where and how large it was drawn to where and how large it is,\n * by a transform that starts at the difference and ends at none. A line\n * scales about the point its glyphs hang from, which is what lands its first\n * frame on the glyphs it replaces — see glyphTopOf. A scale rather than a\n * transition of the type itself, which would lay the text out again on every\n * frame and move it away from the place it was measured at. Each line moves\n * on its own rather than with the block, since the subtitle starts under the\n * headline's line, whose height changes with its role. The slots need\n * nothing: they are in the strip in both states.\n *\n * The bar's height is animated through `min-block-size` as well as its\n * height, since the minimum would otherwise hold an expanding bar at its new\n * height from the first frame, and it is clipped while it moves, since an\n * expanding bar's second row is laid out at full height from the start.\n *\n * Where the text was is measured after every commit that leaves the state\n * alone, so it is current when the state does change, and again whenever the\n * bar or its text changes size or a font finishes loading in between: the\n * window narrowing until the headline wraps, the stylesheet arriving after the\n * first frame, a web font replacing its fallback. None of those renders, so\n * a measure taken only at a commit left the next collapse starting from a bar\n * that was no longer drawn: a large bar first laid out without its stylesheet\n * began its collapse 28px taller than it stood. A change that lands\n * while the last one is still moving starts from where the bar and the text\n * are drawn at that moment, read off the running animations, so reversing\n * mid-way turns round rather than jumping to the end first.\n *\n * Its timing is the root's `background-color` transition's, the `medium1`\n * duration and the emphasized curve, so the fill and the height move as one.\n * Those come from tokens/values rather than the theme, since `animate()`\n * throws on a var(), and the motion is skipped under reduced motion, as the\n * root's transition is.\n */\nfunction useCollapseMotion(collapse: boolean, align: 'center' | 'start') {\n const textRef = useRef<HTMLDivElement>(null);\n const settled = useRef<Geometry | null>(null);\n const collapsedBefore = useRef(collapse);\n const animations = useRef<Animation[]>([]);\n useLayoutEffect(() => {\n const text = textRef.current;\n const bar = text?.parentElement?.parentElement;\n if (text == null || bar == null) {\n return;\n }\n const moving = animations.current.some(animation => animation.playState === 'running');\n if (collapsedBefore.current === collapse) {\n if (!moving) {\n settled.current = geometryOf(bar, text, align);\n }\n return;\n }\n collapsedBefore.current = collapse;\n const last = settled.current;\n const from = moving && last !== null ? drawnAt(bar, text, last) : last;\n for (const animation of animations.current) {\n animation.cancel();\n }\n animations.current = [];\n const to = geometryOf(bar, text, align);\n settled.current = to;\n if (from === null || prefersReducedMotion()) {\n return;\n }\n const timing = {\n duration: motionDurationMs.medium1,\n easing: motionEasing.emphasized\n };\n const heights = [`${from.height}px`, `${to.height}px`];\n animations.current = [bar.animate({\n blockSize: heights,\n clipPath: ['inset(0)', 'inset(0)'],\n minBlockSize: heights\n }, timing)];\n for (const [index, selector] of LINES.entries()) {\n const element = text.querySelector(selector);\n const was = from.lines[index];\n const is = to.lines[index];\n if (element === null || was == null || is == null || is.size === 0) {\n continue;\n }\n const origin = originOf(element, align);\n animations.current.push(element.animate({\n transform: [`translate(${was.x - is.x}px, ${was.y - is.y}px) scale(${was.size / is.size})`, 'none'],\n transformOrigin: [origin, origin]\n }, timing));\n }\n });\n useEffect(() => {\n const text = textRef.current;\n const bar = text?.parentElement?.parentElement;\n if (text == null || bar == null) {\n return undefined;\n }\n const remeasure = () => {\n const moving = animations.current.some(animation => animation.playState === 'running');\n if (!moving) {\n settled.current = geometryOf(bar, text, align);\n }\n };\n const resize = new ResizeObserver(remeasure);\n resize.observe(bar);\n resize.observe(text);\n document.fonts.addEventListener('loadingdone', remeasure);\n return () => {\n resize.disconnect();\n document.fonts.removeEventListener('loadingdone', remeasure);\n };\n }, [align]);\n return textRef;\n}\n\n/**\n * The inset as a length CSS arithmetic accepts. A bare `0` is the one length\n * CSS takes without a unit, and the one it rejects inside `max()` and `min()`,\n * where it reads as a number.\n */\nfunction withUnit(contentInset: string) {\n return contentInset.trim() === '0' ? '0px' : contentInset;\n}\nexport type { AppBarProps };\nexport default AppBar;"],"mappings":";;;;;;;;;;;;AA6EA,MAAMY,qBAAqB;AAM3B,MAAMC,cAAc,IAAID,mBAAkB;AAC1C,MAAME,UAAU;CACdC,IAAI;EACFC,OAAO;EACPC,cAAc;CAChB;CACAC,IAAI;EACFF,OAAO;EACPC,cAAc;CAChB;CACAE,IAAI;EACFH,OAAO;EACPC,cAAc;CAChB;AACF;AAMA,MAAMG,mBAAmBN,QAAQK,GAAGH;AAOpC,MAAMK,SAAS;CACbC,QAAQ;EACNC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,MAAM;EACJC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAA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E,OAAME,QAASlM,MAAI;GACnBkJ,SAAQiD,MAAMC,iBAAkB,eAAeN,SAAS;GAAC,aAClD;IACLE,OAAMK,WAAY;IAClBnD,SAAQiD,MAAMG,oBAAqB,eAAeR,SAAS;GAAC;EAC7D;EACArH,KAAA,CAACpB,KAAK;EAACiB,EAAA,KAAAjB;EAAAiB,EAAA,KAAAE;EAAAF,EAAA,KAAAG;CAAA,OAAA;EAAAD,KAAAF,EAAA;EAAAG,KAAAH,EAAA;CAAA;CApBVjH,UAAUmH,IAoBPC,EAAO;CAAC,OACJwB;AAAO;;;;;;AA3EhB,SAAA8F,OAAAQ,aAAA;CAAA,OA6D0D7B,YAAS8B,cAAe;AAAS;AA7D3F,SAAAlC,OAAAI,WAAA;CAAA,OAWwDA,UAAS8B,cAAe;AAAS;AAwEzF,SAASpE,SAAS7E,cAAsB;CACtC,OAAOA,aAAakJ,KAAK,MAAM,MAAM,QAAQlJ;AAC/C"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["_c","stylex","createElement","useEffect","useLayoutEffect","useRef","hasContent","useRender","mergeStyles","spacing","motionDurationMs","motionEasing","ICON_BUTTON_TARGET","GLYPH_INSET","HEIGHTS","lg","plain","withSubtitle","md","sm","COLLAPSED_HEIGHT","styles","pinned","k87sOh","kVAEAm","kY2c9j","$$css","root","k6CgDc","kGNEyG","kWkggS","kB7OPa","k1xSpc","kjj79g","kIyJzY","k1ekBW","kAMwcw","row","kfiyM8","kC13JO","kzqmXN","kUOVxO","scrolled","kL6WhQ","kfdmCh","kt9PQ7","text","kSGwAc","kXwgrk","kJuA4N","kE4Cay","k7Eaqz","kHjlTd","k8WAf4","textBelow","textCenter","k9WMMc","twoRows","kTDh7v","k4zj60","kWgvks","k5JduY","kVb13B","k5jvz2","HEADLINE_VARIANT","SUBTITLE_VARIANT","HEADINGS","heading","level","Number","isInteger","PARAGRAPH","_temp","kAzted","heightStyles","minBlockSize","val","undefined","_temp2","ks0D6T","rowStyles","start","end","maxInlineSize","kwRFfy","kZCmMZ","tracks","gridTemplateColumns","gridTemplateRows","kumcoG","k9llMU","START_COLUMNS","_temp3","keoZOQ","textStyles","inset","reach","marginBlockStart","UNDER_TARGETS","align","collapsed","contentInset","contentMaxInlineSize","headingLevel","headline","leading","size","subtitle","trailing","LINES","height","lines","x","y","AppBar","t0","$","t1","t2","t3","t4","t5","t6","render","t7","t8","props","collapse","below","expandedHeight","hasLeading","hasTrailing","centred","hasSlot","padsForStart","padsForEnd","t9","Symbol","for","0","1","className","line","textRef","useCollapseMotion","t10","t11","edgePadding","centredColumns","t12","t13","glyphRoom","t14","t15","t16","t17","t18","t19","t20","children","t21","defaultTagName","room","side","drawnAt","bar","settled","getBoundingClientRect","map","selector","index","element","querySelector","moved","matrixOf","a","e","f","withUnit","geometryOf","frame","box","edge","left","right","isRightToLeft","parseFloat","getComputedStyle","fontSize","glyphTopOf","top","range","document","createRange","selectNodeContents","first","getClientRects","item","direction","DOMMatrixReadOnly","transform","originOf","prefersReducedMotion","window","matchMedia","matches","collapsedBefore","animations","current","parentElement","moving","some","_temp4","last","from","animation_0","animation","cancel","to","timing","duration","medium1","easing","emphasized","heights","animate","blockSize","clipPath","entries","was","is","origin","push","transformOrigin","text_0","bar_0","remeasure","_temp5","resize","ResizeObserver","observe","fonts","addEventListener","disconnect","removeEventListener","animation_1","playState","trim"],"sources":["../../../src/components/app-bar/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { createElement, useEffect, useLayoutEffect, useRef } from 'react';\nimport type { RenderComponentProps } from '../../render/useRender';\nimport { COLLAPSED_BLOCK_SIZE } from '../../hooks/useAppBarScroll';\nimport { hasContent } from '../../render/content';\nimport { useRender } from '../../render/useRender';\nimport '../../styles/layers.stylex';\nimport { layers } from '../../styles/layers.stylex';\nimport { mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, motion, sizing, spacing } from '../../tokens/design.tokens.stylex';\nimport { motionDurationMs, motionEasing } from '../../tokens/values';\nimport Text from '../text';\n\n// Material Design's app bar, in the three sizes the spec recommends.\n//\n// `md` and `lg` are Material Design's medium and large *flexible* bars, the\n// newer of the two sets the spec gives and the one it recommends, which is why\n// those two steps are theirs: their heights, their two rows, and their type\n// roles, which HEADLINE_VARIANT and SUBTITLE_VARIANT name.\n//\n// Material Design also merged the old center-aligned variant into small as a\n// configuration rather than a variant, which is why alignment is a prop here\n// and applies to every size.\n//\n// Heights are Material Design's, and they are minimums rather than fixed. The\n// spec says the flexible bars \"hug the text contents\" and gives them multi-line\n// support and text wrapping, so a headline long enough to wrap has to be able\n// to make its bar taller. Fixing the height would truncate exactly the case\n// the variant was redesigned for.\n//\n// The small bar is one row: the leading slot, the text and the trailing slot\n// side by side in a 64px strip. The flexible bars are two, as Material Design\n// lays them out. The first is that same strip holding the slots alone, and the\n// second runs the text under it across the whole measure, so a long headline\n// wraps against the bar's width rather than against what the slots leave.\n// Collapsing moves the text up into the strip, which is the small bar exactly,\n// and the slots never move: they are in the strip in both states.\n//\n// Centred text is centred on the bar, not in the room the slots leave, which\n// is how Material Design places it: with a leading icon and no actions, the\n// room between the two is off the bar's middle by half the icon. So a centred\n// strip's side columns share what the text leaves equally, whatever is in\n// them, and the text moves off the middle only where a wide slot needs the\n// room — see `centredColumns`.\n//\n// A centred bar's text takes one line beside its slots, cut short with an\n// ellipsis, as Material Design gives the centre-aligned bar one line of\n// headline. Everywhere else the text wraps and the bar grows with it, but\n// centred lines wrapping between a back button and three actions at a phone's\n// width made a ragged column four or five lines tall in the middle of the bar. The\n// flexible bars' second row runs under the slots across the whole width, so\n// it keeps wrapping when centred; collapsed, they are the small bar, and cut\n// their lines as it does. The headline is still the heading's whole text, so\n// it stays the bar's accessible name.\n//\n// The slots set the colours the page gives their icons: on surface for the\n// leading one and on surface variant for the trailing ones. The second is a\n// standard icon button's own colour, and the first is not, so the leading\n// slot also sets the property a standard icon button reads its colour from —\n// see `standard` in src/components/icon-button/index.tsx.\n\n// The geometry Material Design lays a bar's icon buttons out on. Its tokens\n// give a 4dp leading and trailing space between the bar's edge and the first\n// button's 48dp target, no space between one target and the next, and a 24dp\n// icon centred in each — so a glyph lands 4 + 12 = 16dp in, on the page's own\n// margin.\n//\n// The library's icon button draws a 40dp box with its 48dp target out of\n// flow, so a slot pads half the difference either side and puts the whole\n// difference between two buttons, which lays the targets edge to edge as the\n// tokens do. The target is IconButton's TARGET_SIZE, a literal there for the\n// reason it gives: it is a floor the page states, not a step of the control\n// scale.\nconst ICON_BUTTON_TARGET = '48px';\nconst ICON_SIZE = '24px';\n\n// How far an icon sits inside its target, which is how much less than the\n// content inset the row is padded on an edge that holds a slot. That is what\n// puts a leading glyph, rather than the edge of its target, at the inset.\nconst GLYPH_INSET = `(${ICON_BUTTON_TARGET} - ${ICON_SIZE}) / 2`;\nconst HEIGHTS = {\n lg: {\n plain: '120px',\n withSubtitle: '152px'\n },\n md: {\n plain: '112px',\n withSubtitle: '136px'\n },\n sm: {\n plain: `${COLLAPSED_BLOCK_SIZE}px`,\n withSubtitle: `${COLLAPSED_BLOCK_SIZE}px`\n }\n} as const;\n\n// What a flexible bar collapses to, which is the small bar exactly. Material\n// Design does not describe the collapsed large bar as a state of its own — it\n// describes it as becoming the small bar, which is why this reads off the same\n// table rather than being a fourth height.\nconst COLLAPSED_HEIGHT = HEIGHTS.sm.plain;\n\n// Windows High Contrast and the rest of the forced-colours modes. Spelled\n// here rather than imported, for the reason src/field/styles.ts records: the\n// StyleX compiler resolves a constant across files only out of a `.stylex.ts`\n// module, and the generated one holds design tokens rather than queries.\nconst FORCED_COLORS = '@media (forced-colors: active)';\nconst styles = {\n pinned: {\n k87sOh: \"x13vifvy\",\n kVAEAm: \"x7wzq59\",\n kY2c9j: \"xfj7q76\",\n $$css: true\n },\n root: {\n k6CgDc: \"x12w9bfk\",\n kGNEyG: \"x1qjc9v5\",\n kWkggS: \"x14s9m32\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"x78zum5\",\n kjj79g: \"xl56j7k\",\n kIyJzY: \"xioksi3\",\n k1ekBW: \"x15406qy\",\n kAMwcw: \"x1seskgd\",\n $$css: true\n },\n row: {\n kfiyM8: \"x10ukxgv\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"xrvj5dj\",\n kC13JO: \"x97ohe\",\n kzqmXN: \"xh8yej3\",\n kUOVxO: \"xvueqy4\",\n $$css: true\n },\n scrolled: {\n kWkggS: \"x1mjdul6\",\n kL6WhQ: \"xszdk7l\",\n kfdmCh: \"xe3zi7u\",\n kt9PQ7: \"x15anc7y\",\n $$css: true\n },\n text: {\n kSGwAc: \"xamitd3\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"x78zum5\",\n kXwgrk: \"xdt5ytf\",\n kJuA4N: \"x12gd1sl\",\n kE4Cay: \"xkjl1po\",\n k7Eaqz: \"xeuugli\",\n kHjlTd: \"xj0a0fe\",\n k8WAf4: \"x1cmllll\",\n $$css: true\n },\n textBelow: {\n kSGwAc: \"xnav3zx\",\n k8WAf4: \"xt970qd\",\n $$css: true\n },\n textCenter: {\n k9WMMc: \"x2b8uid\",\n $$css: true\n }\n};\n\n// The flexible bars' two rows: the strip with the slots at either end, and the\n// text under it across all three columns. The second row takes whatever height\n// the bar has beyond the strip, and the text sits at its bottom.\n//\n// Material Design places that text by its last baseline, 28px above the large\n// bar's bottom edge and 24px above the medium one's, and that is the reading\n// that makes the heights above come out, together with the reach textStyles\n// gives the text: the same figures as padding under the line box would make a\n// plain large bar 64 + 44 + 28 = 136px rather than 120px. CSS gives a box no\n// margin below its baseline, so the strut does it.\n// An empty box in the same grid area, aligned on its last baseline with the\n// text, has its baseline at its own bottom edge and the margin under that, so\n// the pair is held that far off the row's end. Literals rather than tokens,\n// like HEIGHTS: they are measurements the spec gives this component, not steps\n// of the spacing scale, which has no 28.\nconst twoRows = {\n lg: {\n kTDh7v: \"x1mna9mr\",\n k4zj60: \"x1gmr53x\",\n kWgvks: \"xx38sju\",\n k5JduY: \"x1s928wv\",\n kVb13B: \"x1vlsijy\",\n k5jvz2: \"x1fh8phi\",\n kC13JO: \"xc3o5yk\",\n $$css: true\n },\n md: {\n kTDh7v: \"x1mna9mr\",\n k4zj60: \"x1gmr53x\",\n kWgvks: \"xx38sju\",\n k5JduY: \"x1s928wv\",\n kVb13B: \"x1vlsijy\",\n k5jvz2: \"x1v6yq59\",\n kC13JO: \"xc3o5yk\",\n $$css: true\n }\n};\n\n// One entry per size, and each names a type role rather than a figure.\n// Material Design's own tokens are `md.comp.app-bar.<size>.title.font`,\n// aliases onto the type scale rather than sizes of their own, so this maps to\n// the scale the same way and lets Text apply it. The roles are the flexible\n// bars': headlineMedium on medium and displaySmall on large, which is a step\n// up from what the spec's other medium and large bars take, and the small\n// bar's titleLarge.\nconst HEADLINE_VARIANT = {\n lg: 'displaySmall',\n md: 'headlineMedium',\n sm: 'titleLarge'\n} as const;\n\n// The subtitle's role, by the same tokens' `subtitle.font`. Material Design\n// gives each size its own rather than one role at every size, and a collapsed\n// bar takes the small bar's, as it takes its headline's.\nconst SUBTITLE_VARIANT = {\n lg: 'titleMedium',\n md: 'labelLarge',\n sm: 'labelMedium'\n} as const;\n\n// The headline is the page's title in Material Design's model, so it is the\n// page's <h1> unless the call site says otherwise. `headingLevel` is what says\n// otherwise, and a bar drawn beside another bar — one per pane in a\n// `ListDetail` or a `SupportingPane` — or under a page heading of its own\n// should lower it.\n//\n// Built here rather than kept as a constant per level: `headline` becomes the\n// heading's children, so a call site cannot demote the heading by passing one\n// of its own. `headline={<h2>…</h2>}` renders an h2 inside the h1 — two\n// headings where one was wanted, which React does not warn about.\n//\n// The level is looked up rather than interpolated into a tag name. `h7` is a\n// custom element as far as React is concerned, so it renders without a word\n// said and leaves the outline worse than the default would have. The prop's\n// type is the six levels, and a value outside them from a call site the type\n// does not reach — `NaN`, which rounded and clamped to no element at all and\n// took the headline out of the outline — falls back to the default h1.\n// Disclosure's own `headingLevel` hands the number to React Aria, which is\n// why that one needs no equivalent.\nconst HEADINGS = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'] as const;\nfunction heading(level: number) {\n const known = Number.isInteger(level) && level >= 1 && level <= 6;\n return createElement(known ? HEADINGS[level - 1] : HEADINGS[0]);\n}\nconst PARAGRAPH = <p />;\n\n// Height is the one value the call site does not choose, and it depends on two\n// props at once, so it is a function style rather than one key per\n// combination. StyleX writes it to a custom property inline, the same\n// mechanism Feed uses for its cell minimum.\n//\n// The row takes it too, and that is for the collapse's motion. The bar's\n// height is animated, and a row that only stretched to it would be laid out\n// at every height the bar passed through: the second row is the room the bar\n// has beyond the strip, so its text would ride up and down with the bar\n// rather than holding the place the animation moves it to. With the minimum\n// of its own, the row is laid out once, at the height the bar is heading for,\n// and the bar clips it until it gets there.\nconst _temp = {\n kAzted: \"x1chvrdh\",\n \"$$css\": true\n};\nconst heightStyles = {\n root: (minBlockSize: string) => [_temp, {\n \"--x-minBlockSize\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(minBlockSize)\n }]\n};\n\n// The row's measure and inset both come from the call site, so both are\n// function styles too. Each edge is worked out on its own: where it holds a\n// slot the row stops short of the inset by GLYPH_INSET, so the glyph rather\n// than its target is what sits at the inset, and where it holds none the\n// headline itself starts there. Clamped at zero, since an inset smaller than\n// a glyph's own room would otherwise ask for a negative padding, which CSS\n// throws away whole.\n//\n// The tracks are a function style for two other reasons: the strip is the\n// small bar's height, which is the hook's constant, and the compiler cannot\n// read a constant out of another module — see FORCED_COLORS; and a centred\n// bar's columns depend on the inset — see `centredColumns`.\nconst _temp2 = {\n ks0D6T: \"x13i5qev\",\n \"$$css\": true\n};\nconst rowStyles = {\n root: (start: string, end: string, maxInlineSize: string) => [_temp2, {\n kwRFfy: end != null ? \"x120eax6\" : end,\n kZCmMZ: start != null ? \"xnvo3vl\" : start,\n $$css: true\n }, {\n \"--x-maxInlineSize\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(maxInlineSize),\n \"--x-paddingInlineEnd\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(end),\n \"--x-paddingInlineStart\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(start)\n }],\n tracks: (gridTemplateColumns: string, gridTemplateRows: string) => [{\n kumcoG: gridTemplateColumns != null ? \"xqketvx\" : gridTemplateColumns,\n k9llMU: gridTemplateRows != null ? \"x1xxtoay\" : gridTemplateRows,\n $$css: true\n }, {\n \"--x-gridTemplateColumns\": gridTemplateColumns != null ? gridTemplateColumns : undefined,\n \"--x-gridTemplateRows\": gridTemplateRows != null ? gridTemplateRows : undefined\n }]\n};\n\n// A bar's columns with its text at the start: the slots at their own widths\n// and the text taking what they leave.\nconst START_COLUMNS = 'auto minmax(0, 1fr) auto';\n\n// The text in the second row runs under the slots as well as between them, so\n// it puts back what the row's padding held off an edge for a slot's glyph, and\n// the headline starts on the inset again. A function style for the reason the\n// row's padding is one.\n//\n// It also reaches up into the strip, by the band under the slots' targets,\n// and Material Design's heights depend on that. A large bar's 36/44 headline\n// with its baseline 28px above a 120px bar's edge has the top of its line box\n// inside the strip, and so does the medium bar's 28/36 one: measured, the two\n// bars came out 126px and 115px tall without it. What reaches in is the line's\n// leading and the room above its capitals rather than any glyph, and it stops\n// where the targets do, so nothing a reader can press is under it. A function\n// style because the strip's height is the hook's constant — see rowStyles.\nconst _temp3 = {\n keoZOQ: \"x1vhfslr\",\n \"$$css\": true\n};\nconst textStyles = {\n inset: (start: string, end: string) => [{\n kwRFfy: end != null ? \"x120eax6\" : end,\n kZCmMZ: start != null ? \"xnvo3vl\" : start,\n $$css: true\n }, {\n \"--x-paddingInlineEnd\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(end),\n \"--x-paddingInlineStart\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(start)\n }],\n reach: (marginBlockStart: string) => [_temp3, {\n \"--x-marginBlockStart\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : undefined)(marginBlockStart)\n }]\n};\n\n// How far the strip runs on below the slots' targets, which are centred in it.\nconst UNDER_TARGETS = `calc((${COLLAPSED_HEIGHT} - ${ICON_BUTTON_TARGET}) / 2)`;\ntype AppBarProps = Omit<RenderComponentProps<'header'>, 'children'> & {\n /**\n * Which of Material Design's alignments the text takes. `center` is the\n * configuration that replaced the old center-aligned variant, and centres\n * the text on the bar rather than between the slots, so a bar with a\n * leading icon and no actions still has its headline in the middle. The\n * text moves off the middle only as far as a slot wider than the other\n * needs, rather than running under it. Beside the slots, which is `sm` and\n * a collapsed flexible bar, each line of centred text takes one line and\n * is cut short with an ellipsis rather than wrapping.\n * @default 'start'\n */\n align?: 'center' | 'start';\n /**\n * Collapses a flexible bar to the height and headline of the small one, for\n * a bar `pinned` over content that has been scrolled. Material Design\n * specifies it for the flexible sizes, and without it a pinned `lg` costs\n * 152px of the viewport for as long as the page is open.\n *\n * Controlled, and for the same reason `scrolled` is: only the app knows\n * which element scrolls, and how far into it the bar should have finished\n * collapsing. `useAppBarScroll` derives both from that element's scroll,\n * and is the way to set them unless the app needs a rule of its own.\n *\n * Ignored on `sm`, which is already the height this collapses to. The\n * headline and the subtitle move up into the row the slots sit in and take\n * the small bar's type roles, which fit both lines in its 64px, and the\n * slots never leave that row: they stay where they are while the bar\n * shrinks under them.\n *\n * Collapsing hands the page back the height the bar gives up, and a bar\n * whose state is read off the scroll offset can then undo itself in two\n * ways. Both move the offset back under the threshold, so the bar expands,\n * the page regains its height, and the two take turns for as long as the\n * reader stays there.\n *\n * - **Scroll anchoring.** Browsers answer a change in height above the\n * viewport by moving the offset by the same amount, to keep the content\n * in place. Give the scroll container `overflow-anchor: none`, which is\n * also the movement you want: the content follows the bar's bottom edge\n * up rather than standing still while the bar shrinks behind it.\n * - **The shorter page.** A page that overflows by less than the threshold\n * plus the height the bar gives back cannot scroll that far once the bar\n * has collapsed, so the browser pulls the offset back inside it. No\n * threshold avoids this, since the band moves with it; what does is not\n * collapsing on such a page, which is the rule `useAppBarScroll` applies.\n * @default false\n */\n collapsed?: boolean;\n /**\n * Where the bar's content starts on each edge: the headline where nothing\n * comes before it, and the leading icon's glyph where something does, with\n * the headline after the icon button's target. The trailing edge is the\n * same mirrored. Any length works, `0` included, for a bar drawn flush.\n *\n * The default is Material Design's own margin for a top app bar, the\n * spacing scale's `lg` step, which is also the margin it gives body\n * content, so a bar and the page beneath line up without either being told\n * about the other. Set it to the page's gutter where that differs.\n * @default spacing.lg\n */\n contentInset?: string;\n /**\n * How wide the bar's contents may run before they stop growing, with the\n * row centred in whatever is left. The bar's own surface still paints edge\n * to edge.\n *\n * This is what lines a full-bleed bar up with a page whose content sits in\n * a measure: give it the page's measure, and `contentInset` the page's\n * gutter. Unset, the row is as wide as the bar.\n */\n contentMaxInlineSize?: string;\n /**\n * Where the headline sits in the page's outline, as one of the six heading\n * levels. A screen reader moves between headings, so a bar drawn beside\n * another bar, or under a page heading of its own, should lower it. A value\n * outside the six that reaches it untyped falls back to 1.\n * @default 1\n */\n headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;\n /**\n * The page's title. Wraps rather than truncating, and grows the bar with\n * it, except beside the slots of a centred bar, where it takes one line and\n * is cut short with an ellipsis — see `align`.\n */\n headline?: ReactNode;\n /**\n * Usually a back or menu icon button. Sits before the text, and a standard\n * icon button here draws its icon in on surface, the colour the page gives\n * a bar's leading icon, rather than its own on surface variant.\n */\n leading?: ReactNode;\n /**\n * Holds the bar at the top of its scroll container while the content\n * scrolls beneath it, and keeps it painted over that content. The bar\n * still needs a scrolling ancestor to stick inside: the window, or an\n * element with its own overflow. A pinned bar is the one `collapsed` and\n * `scrolled` are for.\n * @default false\n */\n pinned?: boolean;\n /**\n * Whether the content beneath has been scrolled. Material Design separates\n * a bar from scrolled content with a fill colour rather than a shadow, and\n * this is what applies it.\n *\n * Controlled, with no listener of its own: only the app knows which element\n * scrolls, and a bar that watched the window would be wrong inside every\n * pane and dialog that scrolls independently.\n * @default false\n */\n scrolled?: boolean;\n /**\n * Height and headline size, as steps of the library's size scale. `sm` is\n * Material Design's small bar, a fixed 64px row; `md` and `lg` are its\n * medium and large flexible bars, which put the text in a row of its own\n * under the slots and hug it.\n * @default 'sm'\n */\n size?: 'lg' | 'md' | 'sm';\n /** A second line under the headline. Makes `md` and `lg` taller. */\n subtitle?: ReactNode;\n /** Actions, at the far end. Usually icon buttons. */\n trailing?: ReactNode;\n};\n\n// The text block's two lines: the headline, and the subtitle beside it. The\n// block holds nothing else, and each is drawn as one kind of element.\nconst LINES = [':scope > :is(h1, h2, h3, h4, h5, h6)', ':scope > p'] as const;\n\n/**\n * What collapsing moves, and so what its animation runs between: the bar's\n * height, and each of the text's lines, in the order LINES gives them, with\n * `null` for a line the bar does not draw.\n */\ntype Geometry = {\n height: number;\n lines: (Line | null)[];\n};\n\n/**\n * Where one of the text's lines is drawn: the point its glyphs hang from,\n * measured from the bar's own corner, and its type size. The point is the\n * top of the line's first glyphs, on the edge the text hangs from.\n */\ntype Line = {\n size: number;\n x: number;\n y: number;\n};\n\n/**\n * Material Design's app bar: the container at the top of a page carrying its\n * title, one or two actions, and the way back out.\n *\n * ```tsx\n * <AppBar headline=\"Headline\" leading={back} size=\"md\" trailing={actions} />\n * ```\n *\n * Three sizes. `sm` is a fixed 64px bar for a page whose title is a label;\n * `md` and `lg` are the flexible bars, which give the headline a larger\n * type role in a row of its own under the slots, and grow to fit a subtitle\n * or a headline that wraps.\n *\n * It paints its own surface, unlike the layout components, because separating\n * itself from the content beneath is the job — which is also why `scrolled`\n * and `collapsed` exist. Neither watches the page: only the app knows which\n * element scrolls, so both are set from its own scroll handler.\n */\nfunction AppBar({\n align = 'start',\n collapsed = false,\n contentInset = spacing.lg,\n contentMaxInlineSize = 'none',\n headingLevel = 1,\n headline,\n leading,\n pinned = false,\n render,\n scrolled = false,\n size = 'sm',\n subtitle,\n trailing,\n ...props\n}: AppBarProps) {\n // `sm` is already what the flexible bars collapse to, so collapsing it is\n // a no-op rather than an error. A bar whose size is chosen at the call site\n // from a breakpoint would otherwise have to guard the prop as well.\n const collapse = collapsed && size !== 'sm';\n // The flexible bars at their full height are the only state with a second\n // row. Collapsed, they are the small bar.\n const below = size !== 'sm' && !collapse;\n const expandedHeight = hasContent(subtitle) ? HEIGHTS[size].withSubtitle : HEIGHTS[size].plain;\n const height = collapse ? COLLAPSED_HEIGHT : expandedHeight;\n const hasLeading = hasContent(leading);\n const hasTrailing = hasContent(trailing);\n // A centred bar pads both edges as one holding a slot would, so the row\n // is the same either side of the middle — see `centredColumns`.\n const centred = align === 'center';\n const hasSlot = hasLeading || hasTrailing;\n const padsForStart = centred ? hasSlot : hasLeading;\n const padsForEnd = centred ? hasSlot : hasTrailing;\n // Each line of a centred bar's text takes one beside the slots — see the\n // header.\n const line = {\n 0: {},\n 1: {\n className: \"xb3r6kr xlyipyv xuxw1ft\"\n }\n }[!!(centred && !below) << 0];\n const textRef = useCollapseMotion(collapse, align);\n return useRender({\n defaultTagName: 'header',\n props: {\n ...props,\n children: <div {...stylex.props(styles.row, rowStyles.root(edgePadding(contentInset, padsForStart), edgePadding(contentInset, padsForEnd), contentMaxInlineSize), rowStyles.tracks(centred ? centredColumns(contentInset, hasLeading, hasTrailing) : START_COLUMNS, below ? `minmax(${COLLAPSED_HEIGHT}, auto) 1fr` : `minmax(${COLLAPSED_HEIGHT}, auto)`), heightStyles.root(height), below && twoRows[size])}>\n {!hasLeading ? null : <div className=\"x6s0dn4 xamitd3 x9f619 x78zum5 x1r8zjiw x1let9r4 x155k8fu x139gbkf x1kxrqrs x1lqcxt8 x15ir4sr\">{leading}</div>}\n <div {...stylex.props(styles.text, below && styles.textBelow, below && textStyles.inset(glyphRoom(contentInset, padsForStart), glyphRoom(contentInset, padsForEnd)), below && textStyles.reach(`calc(-1 * ${UNDER_TARGETS})`), align === 'center' && styles.textCenter)} ref={textRef}>\n {!hasContent(headline) ? null : <Text {...line} render={heading(headingLevel)} variant={collapse ? HEADLINE_VARIANT.sm : HEADLINE_VARIANT[size]}>\n {headline}\n </Text>}\n {!hasContent(subtitle) ? null : <Text {...line} render={PARAGRAPH} tone=\"muted\" variant={collapse ? SUBTITLE_VARIANT.sm : SUBTITLE_VARIANT[size]}>\n {subtitle}\n </Text>}\n </div>\n {!hasTrailing ? null : <div className=\"x6s0dn4 xamitd3 x9f619 x78zum5 x1r8zjiw x1let9r4 x1w5n3ug x1txd71x x1qab1bc x6aqprb\">\n {trailing}\n </div>}\n </div>,\n ...mergeStyles(stylex.props(styles.root, heightStyles.root(height), scrolled && styles.scrolled, pinned && styles.pinned), props)\n },\n render\n });\n}\n\n/**\n * A centred bar's columns: the text in the middle at its own width, and a\n * column either side sharing what it leaves equally, so the text is centred\n * on the row. A side column is never narrower than its slot, which is what\n * moves the text off the middle when a slot is wider than the other side's\n * share, and never as far as overlapping it.\n *\n * The row pads both edges for a slot, so the two sides match, and an edge\n * with no slot puts back what that padding held off for a glyph as its\n * column's least width. A headline long enough to reach that edge stops on\n * the inset, as it does at the start.\n */\nfunction centredColumns(contentInset: string, hasLeading: boolean, hasTrailing: boolean) {\n const room = glyphRoom(contentInset, hasLeading || hasTrailing);\n const side = (hasSlot: boolean) => hasSlot ? 'minmax(auto, 1fr)' : `minmax(${room}, 1fr)`;\n return `${side(hasLeading)} auto ${side(hasTrailing)}`;\n}\n\n/**\n * Where an animation still under way has the bar and the text drawn: the\n * height it holds the bar at, and each line where its transform has taken it\n * and at the size its scale has reached. A line scales about the point it\n * hangs from, so the transform's translation is how far that point has moved.\n */\nfunction drawnAt(bar: HTMLElement, text: HTMLElement, settled: Geometry): Geometry {\n return {\n height: bar.getBoundingClientRect().height,\n lines: LINES.map((selector, index) => {\n const line = settled.lines[index];\n const element = text.querySelector(selector);\n if (line === null || element === null) {\n return null;\n }\n const moved = matrixOf(element);\n return {\n size: line.size * moved.a,\n x: line.x + moved.e,\n y: line.y + moved.f\n };\n })\n };\n}\n\n/** The row's padding on one edge, for the inset the call site gave. */\nfunction edgePadding(contentInset: string, hasSlot: boolean) {\n const inset = withUnit(contentInset);\n return hasSlot ? `max(0px, ${inset} - ${GLYPH_INSET})` : inset;\n}\n\n/**\n * Where the bar and each of the text's lines are drawn. A line's point is on\n * the edge its text hangs from: the middle when it is centred, and the start\n * edge otherwise, which is the right edge in a right-to-left page. Each line\n * is as wide as the text block, so that edge is its box's.\n */\nfunction geometryOf(bar: HTMLElement, text: HTMLElement, align: 'center' | 'start'): Geometry {\n const frame = bar.getBoundingClientRect();\n return {\n height: frame.height,\n lines: LINES.map(selector => {\n const element = text.querySelector(selector);\n if (element === null) {\n return null;\n }\n const box = element.getBoundingClientRect();\n const edge = align === 'center' ? (box.left + box.right) / 2 : isRightToLeft(element) ? box.right : box.left;\n return {\n size: Number.parseFloat(getComputedStyle(element).fontSize),\n x: edge - frame.left,\n y: glyphTopOf(element) - frame.top\n };\n })\n };\n}\n\n/**\n * What the row's padding held back on one edge for a slot's glyph, which the\n * text in the second row puts back: the inset less `edgePadding`, so the\n * smaller of the inset and GLYPH_INSET.\n */\nfunction glyphRoom(contentInset: string, hasSlot: boolean) {\n return hasSlot ? `min(${withUnit(contentInset)}, ${GLYPH_INSET})` : '0px';\n}\n\n/**\n * Where an element's first glyphs start, which is below its box's top by\n * half its line's leading. The leading is a share of the line height, and\n * the two roles a line moves between do not keep line height and type size\n * in one ratio, so a line scaled by its type size from its box's corner\n * starts its glyphs off where they were drawn: about a pixel, for a large\n * bar's headline.\n */\nfunction glyphTopOf(element: Element) {\n const range = document.createRange();\n range.selectNodeContents(element);\n const first = range.getClientRects().item(0);\n return first === null ? element.getBoundingClientRect().top : first.top;\n}\n\n/** Whether the text runs right to left, which decides the edge it hangs from. */\nfunction isRightToLeft(element: Element) {\n return getComputedStyle(element).direction === 'rtl';\n}\n\n/** The transform an element is drawn with, `none` reading as no change. */\nfunction matrixOf(element: Element) {\n return new DOMMatrixReadOnly(getComputedStyle(element).transform);\n}\n\n/**\n * The point a line scales about, in its own box: the top of its glyphs, on\n * the edge its text hangs from.\n */\nfunction originOf(element: Element, align: 'center' | 'start') {\n const edge = align === 'center' ? 'center' : isRightToLeft(element) ? 'right' : 'left';\n const glyphs = glyphTopOf(element) - element.getBoundingClientRect().top;\n return `${edge} ${glyphs}px`;\n}\n\n/**\n * Read when the bar changes state rather than once at mount, so a reader who\n * changes the setting is answered by the next collapse.\n */\nfunction prefersReducedMotion() {\n return window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n}\n\n/**\n * Animates a flexible bar between its two states, and returns the ref for the\n * text block whose lines it moves.\n *\n * Collapsing changes the bar's layout rather than a value — the text leaves\n * the second row for the strip, both lines take the small bar's type roles,\n * and the bar's height drops from a minimum to whatever its content takes —\n * so there is nothing for a CSS transition to interpolate. This plays it the\n * other way round: the change has already been laid out when the effect runs,\n * so the bar is animated from the height it had to the one it has, and each\n * line from where and how large it was drawn to where and how large it is,\n * by a transform that starts at the difference and ends at none. A line\n * scales about the point its glyphs hang from, which is what lands its first\n * frame on the glyphs it replaces — see glyphTopOf. A scale rather than a\n * transition of the type itself, which would lay the text out again on every\n * frame and move it away from the place it was measured at. Each line moves\n * on its own rather than with the block, since the subtitle starts under the\n * headline's line, whose height changes with its role. The slots need\n * nothing: they are in the strip in both states.\n *\n * The bar's height is animated through `min-block-size` as well as its\n * height, since the minimum would otherwise hold an expanding bar at its new\n * height from the first frame, and it is clipped while it moves, since an\n * expanding bar's second row is laid out at full height from the start.\n *\n * Where the text was is measured after every commit that leaves the state\n * alone, so it is current when the state does change, and again whenever the\n * bar or its text changes size or a font finishes loading in between: the\n * window narrowing until the headline wraps, the stylesheet arriving after the\n * first frame, a web font replacing its fallback. None of those renders, so\n * a measure taken only at a commit left the next collapse starting from a bar\n * that was no longer drawn: a large bar first laid out without its stylesheet\n * began its collapse 28px taller than it stood. A change that lands\n * while the last one is still moving starts from where the bar and the text\n * are drawn at that moment, read off the running animations, so reversing\n * mid-way turns round rather than jumping to the end first.\n *\n * Its timing is the root's `background-color` transition's, the `medium1`\n * duration and the emphasized curve, so the fill and the height move as one.\n * Those come from tokens/values rather than the theme, since `animate()`\n * throws on a var(), and the motion is skipped under reduced motion, as the\n * root's transition is.\n */\nfunction useCollapseMotion(collapse: boolean, align: 'center' | 'start') {\n const textRef = useRef<HTMLDivElement>(null);\n const settled = useRef<Geometry | null>(null);\n const collapsedBefore = useRef(collapse);\n const animations = useRef<Animation[]>([]);\n useLayoutEffect(() => {\n const text = textRef.current;\n const bar = text?.parentElement?.parentElement;\n if (text == null || bar == null) {\n return;\n }\n const moving = animations.current.some(animation => animation.playState === 'running');\n if (collapsedBefore.current === collapse) {\n if (!moving) {\n settled.current = geometryOf(bar, text, align);\n }\n return;\n }\n collapsedBefore.current = collapse;\n const last = settled.current;\n const from = moving && last !== null ? drawnAt(bar, text, last) : last;\n for (const animation of animations.current) {\n animation.cancel();\n }\n animations.current = [];\n const to = geometryOf(bar, text, align);\n settled.current = to;\n if (from === null || prefersReducedMotion()) {\n return;\n }\n const timing = {\n duration: motionDurationMs.medium1,\n easing: motionEasing.emphasized\n };\n const heights = [`${from.height}px`, `${to.height}px`];\n animations.current = [bar.animate({\n blockSize: heights,\n clipPath: ['inset(0)', 'inset(0)'],\n minBlockSize: heights\n }, timing)];\n for (const [index, selector] of LINES.entries()) {\n const element = text.querySelector(selector);\n const was = from.lines[index];\n const is = to.lines[index];\n if (element === null || was == null || is == null || is.size === 0) {\n continue;\n }\n const origin = originOf(element, align);\n animations.current.push(element.animate({\n transform: [`translate(${was.x - is.x}px, ${was.y - is.y}px) scale(${was.size / is.size})`, 'none'],\n transformOrigin: [origin, origin]\n }, timing));\n }\n });\n useEffect(() => {\n const text = textRef.current;\n const bar = text?.parentElement?.parentElement;\n if (text == null || bar == null) {\n return undefined;\n }\n const remeasure = () => {\n const moving = animations.current.some(animation => animation.playState === 'running');\n if (!moving) {\n settled.current = geometryOf(bar, text, align);\n }\n };\n const resize = new ResizeObserver(remeasure);\n resize.observe(bar);\n resize.observe(text);\n document.fonts.addEventListener('loadingdone', remeasure);\n return () => {\n resize.disconnect();\n document.fonts.removeEventListener('loadingdone', remeasure);\n };\n }, [align]);\n return textRef;\n}\n\n/**\n * The inset as a length CSS arithmetic accepts. A bare `0` is the one length\n * CSS takes without a unit, and the one it rejects inside `max()` and `min()`,\n * where it reads as a number.\n */\nfunction withUnit(contentInset: string) {\n return contentInset.trim() === '0' ? '0px' : contentInset;\n}\nexport type { AppBarProps };\nexport default AppBar;"],"mappings":";;;;;;;;;;;;;AA6EA,MAAMY,qBAAqB;AAM3B,MAAMC,cAAc,IAAID,mBAAkB;AAC1C,MAAME,UAAU;CACdC,IAAI;EACFC,OAAO;EACPC,cAAc;CAChB;CACAC,IAAI;EACFF,OAAO;EACPC,cAAc;CAChB;CACAE,IAAI;EACFH,OAAO;EACPC,cAAc;CAChB;AACF;AAMA,MAAMG,mBAAmBN,QAAQK,GAAGH;AAOpC,MAAMK,SAAS;CACbC,QAAQ;EACNC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,MAAM;EACJC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRV,OAAO;CACT;CACAW,KAAK;EACHC,QAAQ;EACRP,QAAQ;EACRC,QAAQ;EACRO,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRf,OAAO;CACT;CACAgB,UAAU;EACRZ,QAAQ;EACRa,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRnB,OAAO;CACT;CACAoB,MAAM;EACJC,QAAQ;EACRhB,QAAQ;EACRC,QAAQ;EACRgB,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACR3B,OAAO;CACT;CACA4B,WAAW;EACTP,QAAQ;EACRM,QAAQ;EACR3B,OAAO;CACT;CACA6B,YAAY;EACVC,QAAQ;EACR9B,OAAO;CACT;AACF;AAiBA,MAAM+B,UAAU;CACd1C,IAAI;EACF2C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QAAQlJ;AAC/C"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
|
-
import { AutocompleteProps } from "react-aria-components";
|
|
3
|
-
type AutocompleteFilter<T extends object = object> = NonNullable<AutocompleteProps<T>['filter']>;
|
|
4
|
-
type AutocompleteProps
|
|
2
|
+
import { AutocompleteProps as AutocompleteProps$1 } from "react-aria-components";
|
|
3
|
+
type AutocompleteFilter<T extends object = object> = NonNullable<AutocompleteProps$1<T>['filter']>;
|
|
4
|
+
type AutocompleteProps<T extends object = object> = {
|
|
5
5
|
/**
|
|
6
6
|
* The search input and the collection it filters, in whatever the page
|
|
7
7
|
* puts around them. React Aria needs both somewhere inside.
|
|
@@ -14,7 +14,7 @@ type AutocompleteProps$1<T extends object = object> = {
|
|
|
14
14
|
* written out in the page.
|
|
15
15
|
*/
|
|
16
16
|
filter?: AutocompleteFilter<T>;
|
|
17
|
-
} & Omit<AutocompleteProps<T>, 'children' | 'filter'>;
|
|
17
|
+
} & Omit<AutocompleteProps$1<T>, 'children' | 'filter'>;
|
|
18
18
|
/**
|
|
19
19
|
* A search input that filters the collection under it. Its value is React
|
|
20
20
|
* Aria's: pass `inputValue` with `onInputChange` to control what has been
|
|
@@ -84,5 +84,5 @@ type AutocompleteProps$1<T extends object = object> = {
|
|
|
84
84
|
* collection, which is React Aria's virtual focus. `disableVirtualFocus`
|
|
85
85
|
* turns that off and makes the collection tabbable instead.
|
|
86
86
|
*/
|
|
87
|
-
declare function Autocomplete
|
|
88
|
-
export { type AutocompleteFilter, type AutocompleteProps
|
|
87
|
+
declare function Autocomplete<T extends object = object>({ children, filter, ...props }: AutocompleteProps<T>): import("react").JSX.Element;
|
|
88
|
+
export { type AutocompleteFilter, type AutocompleteProps, Autocomplete as default };
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { CollectionStatus } from "../../collection/index.js";
|
|
3
3
|
import { c } from "react/compiler-runtime";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
|
-
import { Autocomplete, useFilter } from "react-aria-components";
|
|
5
|
+
import { Autocomplete as Autocomplete$1, useFilter } from "react-aria-components";
|
|
6
6
|
// src/components/autocomplete/index.tsx
|
|
7
7
|
/**
|
|
8
8
|
* A search input that filters the collection under it. Its value is React
|
|
@@ -73,7 +73,7 @@ import { Autocomplete, useFilter } from "react-aria-components";
|
|
|
73
73
|
* collection, which is React Aria's virtual focus. `disableVirtualFocus`
|
|
74
74
|
* turns that off and makes the collection tabbable instead.
|
|
75
75
|
*/
|
|
76
|
-
function Autocomplete
|
|
76
|
+
function Autocomplete(t0) {
|
|
77
77
|
const $ = c(14);
|
|
78
78
|
let children;
|
|
79
79
|
let filter;
|
|
@@ -110,7 +110,7 @@ function Autocomplete$1(t0) {
|
|
|
110
110
|
} else t3 = $[9];
|
|
111
111
|
let t4;
|
|
112
112
|
if ($[10] !== props || $[11] !== t2 || $[12] !== t3) {
|
|
113
|
-
t4 = /* @__PURE__ */ jsx(Autocomplete, {
|
|
113
|
+
t4 = /* @__PURE__ */ jsx(Autocomplete$1, {
|
|
114
114
|
filter: t2,
|
|
115
115
|
...props,
|
|
116
116
|
children: t3
|
|
@@ -125,6 +125,6 @@ function Autocomplete$1(t0) {
|
|
|
125
125
|
function containsFilter(contains) {
|
|
126
126
|
return (textValue, inputValue) => contains(textValue, inputValue);
|
|
127
127
|
}
|
|
128
|
-
export { Autocomplete
|
|
128
|
+
export { Autocomplete as default };
|
|
129
129
|
|
|
130
130
|
//# sourceMappingURL=index.js.map
|