@kanso-labs/kanso-ui 0.45.21 → 0.45.22
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 +119 -11
- package/dist/calendar/index.js.map +1 -1
- package/dist/calendar/styles.js +19 -1
- package/dist/calendar/styles.js.map +1 -1
- package/dist/components/app-bar/index.d.ts +8 -2
- package/dist/components/app-bar/index.js +123 -73
- package/dist/components/app-bar/index.js.map +1 -1
- package/dist/components/calendar/index.d.ts +3 -3
- package/dist/components/calendar/index.js +8 -19
- package/dist/components/calendar/index.js.map +1 -1
- package/dist/components/carousel/index.d.ts +22 -3
- package/dist/components/carousel/index.js +26 -14
- package/dist/components/carousel/index.js.map +1 -1
- package/dist/components/chip-group/index.js +3 -0
- package/dist/components/chip-group/index.js.map +1 -1
- package/dist/components/color-picker/index.js +64 -46
- package/dist/components/color-picker/index.js.map +1 -1
- package/dist/components/color-swatch/index.js +20 -16
- package/dist/components/color-swatch/index.js.map +1 -1
- package/dist/components/copy-field/index.js +1 -0
- package/dist/components/copy-field/index.js.map +1 -1
- package/dist/components/date-range-picker/index.js +165 -81
- package/dist/components/date-range-picker/index.js.map +1 -1
- package/dist/components/index.d.ts +2 -2
- package/dist/components/popover/index.js +14 -4
- package/dist/components/popover/index.js.map +1 -1
- package/dist/components/range-calendar/index.js +53 -80
- package/dist/components/range-calendar/index.js.map +1 -1
- package/dist/components/segmented-button/index.js +261 -145
- package/dist/components/segmented-button/index.js.map +1 -1
- package/dist/components/sheet/index.js +149 -82
- package/dist/components/sheet/index.js.map +1 -1
- package/dist/components/table/index.js +251 -123
- package/dist/components/table/index.js.map +1 -1
- package/dist/hooks/useRipple.js +3 -2
- package/dist/hooks/useRipple.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/segments/index.js +2 -1
- package/dist/segments/index.js.map +1 -1
- package/dist/segments/styles.js +5 -1
- package/dist/segments/styles.js.map +1 -1
- package/dist/styles/focus.js.map +1 -1
- package/dist/styles.css +40 -8
- package/dist/swatch/index.js +19 -0
- package/dist/swatch/index.js.map +1 -0
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["c","_c","ReactNode","RefAttributes","ColumnRenderProps","ColumnResizerRenderProps","CellProps","RACCellProps","ColumnProps","RACColumnProps","RowProps","RACRowProps","TableBodyProps","RACTableBodyProps","TableFooterProps","RACTableFooterProps","TableHeaderProps","RACTableHeaderProps","TableLoadMoreItemProps","RACTableLoadMoreItemProps","TableProps","RACTableProps","ResizableTableContainerProps","RowRenderProps","TableBodyRenderProps","TableRenderProps","stylex","createContext","useContext","Cell","RACCell","Column","RACColumn","ColumnResizer","RACColumnResizer","ResizableTableContainer","RACResizableTableContainer","Row","RACRow","Table","RACTable","TableBody","RACTableBody","TableFooter","RACTableFooter","TableHeader","RACTableHeader","TableLoadMoreItem","RACTableLoadMoreItem","CollectionLoadMore","collectionStyles","ArrowDownwardGlyph","ArrowUpwardGlyph","mergeRefs","rowStyles","rowLayers","mergeStatefulStyles","mergeStyles","colors","sizing","spacing","stateLayerOpacity","typography","Checkbox","FORCED_COLORS","SelectAllLabelContext","undefined","SelectLabelContext","styles","cell","kB7OPa","kg3NbH","k9WMMc","kXLuUW","$$css","focus","kjBf7l","kInvED","k3XXqK","kMeerF","header","kZKoxP","kMwMTN","kMv6JI","kGuDYH","k63SB2","kb6lSQ","kLWn49","kVQacm","kVAEAm","headerHovered","kWkggS","headerPressed","headerSortable","kkrTdU","row","kLZC3w","kPef9Z","kEafiO","rowDisabled","kAXs8y","rowSelected","selection","kzqmXN","khDVqt","sticky","kGVxlE","k87sOh","kY2c9j","table","kLvRdT","Omit","T","className","renderEmptyState","style","TableCellProps","children","TableColumnProps","resizable","TableLoadMoreProps","label","onResize","onResizeEnd","resizeLabel","selectAllLabel","selectLabel","stickyHeader","TableRowProps","ResizeLabelContext","ResizableContext","StickyHeaderContext","cellContent","cellStyles","columnContent","state","sortArrowFor","sortDirection","resizerRule","columnStyles","props","allowsSorting","isHovered","isPressed","dropAriaLevel","node","HTMLTableRowElement","removeAttribute","emptyContent","resizableContainerClassName","isResizing","isFocusVisible","isDragging","dragging","isSelected","hovered","pressed","isDropTarget","dropTarget","isDisabled","direction","t0","$","T0","t1","t2","t3","t4","t5","t6","t7","t8","t9","tableClasses","TableCell","TableColumn","resizableTable","0","1","TableLoadMore","ref","TableRow","Body","Footer","Header","LoadMore","RACColumnResizer","stylex.props","rowLayers","Table","_c","RACTable","RACResizableTableContainer","TableBody","RACTableBody","RACCell","RACColumn","TableFooter","RACTableFooter","TableHeader","RACTableHeader","RACTableLoadMoreItem","RACRow"],"sources":["../../../src/components/table/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { ColumnRenderProps, ColumnResizerRenderProps, CellProps as RACCellProps, ColumnProps as RACColumnProps, RowProps as RACRowProps, TableBodyProps as RACTableBodyProps, TableFooterProps as RACTableFooterProps, TableHeaderProps as RACTableHeaderProps, TableLoadMoreItemProps as RACTableLoadMoreItemProps, TableProps as RACTableProps, ResizableTableContainerProps, RowRenderProps, TableBodyRenderProps, TableRenderProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { createContext, useContext } from 'react';\nimport { Cell as RACCell, Column as RACColumn, ColumnResizer as RACColumnResizer, ResizableTableContainer as RACResizableTableContainer, Row as RACRow, Table as RACTable, TableBody as RACTableBody, TableFooter as RACTableFooter, TableHeader as RACTableHeader, TableLoadMoreItem as RACTableLoadMoreItem } from 'react-aria-components';\nimport { CollectionLoadMore } from '../../collection';\nimport { collectionStyles } from '../../collection/styles';\nimport { ArrowDownwardGlyph, ArrowUpwardGlyph } from '../../glyphs';\nimport { mergeRefs } from '../../render/ref';\nimport { rowStyles as rowLayers } from '../../row/styles';\nimport { mergeStatefulStyles, mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, sizing, spacing, stateLayerOpacity, typography } from '../../tokens/design.tokens.stylex';\nimport Checkbox from '../checkbox';\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)';\n\n// A grid of rows and columns, with sorting and selection. The design system\n// carries no data table page — it was dropped after Material Design 2 — so\n// the geometry comes from the archived one at\n// <https://m2.material.io/components/data-tables>, which is the page this\n// component is drawn from: a 56dp header row, 52dp body rows, 16dp of\n// padding on each side of a cell, a medium-weight header to set it apart\n// from the rows, and an arrow beside the name of the column being sorted.\n//\n// Its colour roles are the current system's rather than that page's, since\n// a table sits beside lists, cards and menus that all draw from the tokens\n// here. That means the row's state layers are the ones `src/row` uses — the\n// same hover, pressed and selected treatment a list row takes — so a\n// selected table row and a selected list row on one page cannot disagree.\n//\n// The row is not `src/row`, and that is the one place this departs from the\n// library's other collections. That module's row is a headline with a\n// supporting line and a slot at each end; a table row is a run of cells with\n// no such shape, and forcing one into the other would give every cell the\n// row's 56dp floor and body-large headline. The state layers are shared by\n// being written from the same tokens rather than by sharing the module.\n//\n// Four things are this component's own.\n//\n// **The rule between rows is drawn on the row, not on its cells.** A cell\n// cannot see whether its row is the first one, so a rule per cell either\n// doubles under the header or needs the row's position passed down. The\n// table collapses its borders, which is what lets a `<tr>` carry one.\n//\n// **A selecting table draws its checkbox where the call site puts it.**\n// `selection` on a column and on a cell renders the library's Checkbox in\n// React Aria's selection slot — the column's is select-all, the cell's is\n// that row's. It is a prop rather than an injected column because the header\n// and every row have to agree on how many columns there are, and only the\n// call site can keep that true.\n//\n// **A sortable column is the press target itself.** React Aria puts no\n// button inside the header cell; it makes the cell pressable and sets\n// `aria-sort` on it. So the arrow is content next to the name, and the\n// hover and pressed layers belong to the cell.\n//\n// **The header sticks only when asked.** A sticky header needs an opaque\n// background to scroll rows under, and that colour is only right when the\n// table is in something that scrolls. `stickyHeader` is what says so.\n//\n// **Resizing is asked for twice, and both are needed.** React Aria puts the\n// resize state on a container around the table and the handle inside a\n// column, so `resizable` on the table is what brings the container and\n// `resizable` on a column is what draws its handle. The archived page has no\n// resizer to take a treatment from — it predates the feature — so the handle\n// draws the divider's own rule, thickening and taking the primary role while\n// it is dragged, over a target far wider than the rule.\n//\n// **A resizable table stops filling its width.** The container sets\n// `table-layout: fixed` and `width: min-content` on the table as inline\n// styles, which no rule here can outrank; the container fills the width\n// instead and scrolls when the columns together are wider than it.\n//\n// One thing about React Aria's collection is worth knowing before writing a\n// call site. **A column's `id` and a row's `id` share one namespace**, and a\n// value used by both silently drops every column — the table then throws\n// \"Cell count must match column count\", naming the cells rather than the\n// duplicate key that caused it. Nothing here can catch it, since both ids\n// are the call site's to choose; the docstrings below say to keep them\n// apart, and the stories and tests use `col`-prefixed column ids so the two\n// sets cannot meet.\n\n// What the selection checkboxes are called. A context rather than a prop on\n// every column and cell, since it is the table's decision and repeating it\n// per row is how the two drift. Undefined unless the table is given one,\n// which leaves the names React Aria gives in the reader's locale.\nconst SelectAllLabelContext = createContext<string | undefined>(undefined);\nconst SelectLabelContext = createContext<string | undefined>(undefined);\nconst styles = {\n cell: {\n kB7OPa: \"x9f619\",\n kg3NbH: \"x790zyz\",\n k9WMMc: \"x1yc453h\",\n kXLuUW: \"xxymvpz\",\n $$css: true\n },\n focus: {\n kjBf7l: \"xrgy624 x1v8yhc2\",\n kInvED: \"x2ssjo2\",\n k3XXqK: \"x9v5kkp x1t137rt\",\n kMeerF: \"x1de99jn\",\n $$css: true\n },\n header: {\n kZKoxP: \"x1ded5cy\",\n kMwMTN: \"x1w5n3ug\",\n kMv6JI: \"xkknnkr\",\n kGuDYH: \"x14zspaw\",\n k63SB2: \"x1v9cpvo\",\n kb6lSQ: \"x155f00i\",\n kLWn49: \"x1lz68p4\",\n kVQacm: \"x9h1dke\",\n kVAEAm: \"x1n2onr6\",\n $$css: true\n },\n headerHovered: {\n kWkggS: \"x1b18xnh\",\n $$css: true\n },\n headerPressed: {\n kWkggS: \"xjeeohs\",\n $$css: true\n },\n headerSortable: {\n kWkggS: \"xjbqb8w\",\n kkrTdU: \"x1ypdohk\",\n $$css: true\n },\n row: {\n kZKoxP: \"xdd8jsf\",\n kLZC3w: \"x12smttz\",\n kPef9Z: \"x13fuv20\",\n kEafiO: \"x1g31smg x178xt8z\",\n $$css: true\n },\n rowDisabled: {\n kWkggS: \"xjbqb8w\",\n kMwMTN: \"x1xj74d8\",\n kkrTdU: \"x1h6gzvc\",\n kAXs8y: \"xr5dkdi\",\n $$css: true\n },\n rowSelected: {\n kWkggS: \"xp89om9 x1jzqe4\",\n kMwMTN: \"xscdzaa x1k5gbb1\",\n kAXs8y: \"x1g12otp\",\n $$css: true\n },\n selection: {\n kzqmXN: \"x19ddzpn\",\n khDVqt: \"xuxw1ft\",\n $$css: true\n },\n sticky: {\n kWkggS: \"x14s9m32\",\n kGVxlE: \"x1ixd52e\",\n k87sOh: \"x13vifvy\",\n kVAEAm: \"x7wzq59\",\n kY2c9j: \"x1vjfegm\",\n $$css: true\n },\n table: {\n kLvRdT: \"x1mwwwfo\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x139gbkf\",\n kMv6JI: \"xpo2rfv\",\n kGuDYH: \"x193rfdd\",\n k63SB2: \"x1hews6w\",\n kzqmXN: \"xh8yej3\",\n kb6lSQ: \"xn43zvd\",\n kLWn49: \"xv61bfh\",\n k3XXqK: \"x1t137rt\",\n $$css: true\n }\n};\ntype TableBodyProps<T extends object = object> = Omit<RACTableBodyProps<T>, 'className' | 'renderEmptyState' | 'style'> & {\n /** A function may compute the class from the body's render state. */\n className?: RACTableBodyProps<T>['className'];\n /**\n * What the table shows in place of rows when it has none: React Aria's own\n * render function, under React Aria's own name, as List, ListBox, Tree and\n * ChipGroup take it. What it returns is drawn in a row of its own spanning\n * every column, inside the muted, padded box the table draws there.\n */\n renderEmptyState?: RACTableBodyProps<T>['renderEmptyState'];\n /** A function may compute the style from the body's render state. */\n style?: RACTableBodyProps<T>['style'];\n};\ntype TableCellProps = Omit<RACCellProps, 'children' | 'className' | 'style'> & {\n /** What the cell holds. */\n children?: ReactNode;\n /** A function may compute the class from the cell's render state. */\n className?: RACCellProps['className'];\n /**\n * Draws this row's selection checkbox instead of `children`. The row's own\n * text is what names the row; the box inside it takes the table's\n * `selectLabel`.\n */\n selection?: boolean;\n /** A function may compute the style from the cell's render state. */\n style?: RACCellProps['style'];\n};\ntype TableColumnProps = {\n /** The column's name. */\n children?: ReactNode;\n /** A function may compute the class from the column's render state. */\n className?: RACColumnProps['className'];\n /**\n * Draws a handle at the column's trailing edge that drags its width. Needs\n * the table's own `resizable` as well — React Aria keeps the resize state\n * on a container around the table, and without it there is nothing for a\n * handle to change. `defaultWidth`, `minWidth` and `maxWidth` are React\n * Aria's and apply only inside that container.\n */\n resizable?: boolean;\n /**\n * Draws the select-all checkbox instead of `children`, for the column the\n * rows put their own checkboxes in.\n */\n selection?: boolean;\n /** A function may compute the style from the column's render state. */\n style?: RACColumnProps['style'];\n} & Omit<RACColumnProps, 'children' | 'className' | 'style'>;\ntype TableFooterProps<T extends object = object> = RACTableFooterProps<T>;\ntype TableHeaderProps<T extends object = object> = RACTableHeaderProps<T>;\ntype TableLoadMoreProps = Omit<RACTableLoadMoreItemProps, 'children'> & {\n /**\n * What the row says while it is loading. Read by a screen reader; the ring\n * itself carries no text.\n * Left out, it is the word for it in the I18nProvider's locale — \"Loading\n * more\" in English.\n */\n label?: string;\n};\ntype TableProps = {\n /** A function may compute the class from the table's render state. */\n className?: RACTableProps['className'];\n /** Called as a column is dragged, with every column's width. */\n onResize?: ResizableTableContainerProps['onResize'];\n /** Called once a drag ends, with every column's width. */\n onResizeEnd?: ResizableTableContainerProps['onResizeEnd'];\n /**\n * Lets columns marked `resizable` be dragged, by putting the table in the\n * container React Aria keeps the resize state on. A resizable table sizes\n * to its columns rather than to its parent, and that container is what\n * fills the width and scrolls instead.\n */\n resizable?: boolean;\n /**\n * What the resize handle is called, for a screen reader. React Aria\n * composes it with the column's own name. Left out, React Aria names it in\n * the reader's locale — \"Resizer\" in English.\n */\n resizeLabel?: string;\n /**\n * What the select-all checkbox is called, for a screen reader. Left out,\n * React Aria names it in the reader's locale — \"Select All\" in English.\n */\n selectAllLabel?: string;\n /**\n * What each row's selection checkbox is called, for a screen reader. The\n * row's own text is what names the row; this names the box inside it.\n * Left out, React Aria names it in the reader's locale — \"Select\" in\n * English.\n */\n selectLabel?: string;\n /**\n * Holds the header row in place while the rows scroll under it. Needs the\n * table inside something that scrolls; on a table that does not, it draws\n * the same as without it.\n */\n stickyHeader?: boolean;\n /** A function may compute the style from the table's render state. */\n style?: RACTableProps['style'];\n} & Omit<RACTableProps, 'className' | 'style'>;\ntype TableRowProps<T extends object = object> = Omit<RACRowProps<T>, 'className' | 'style'> & {\n /** A function may compute the class from the row's render state. */\n className?: RACRowProps<T>['className'];\n /** A function may compute the style from the row's render state. */\n style?: RACRowProps<T>['style'];\n};\n\n// What the resize handles are called, for the same reason the selection\n// labels travel this way: it is the table's decision, and repeating it per\n// column is how the two drift. Undefined by default, as they are.\nconst ResizeLabelContext = createContext<string | undefined>(undefined);\n\n// Whether the table brought the container. React Aria's resizer throws\n// outright without one — \"Wrap your <Table> in a <ResizableTableContainer>\",\n// naming a component a consumer of this library never writes — so a column\n// asking to resize inside a table that does not would take the whole page\n// down. It draws no handle instead.\nconst ResizableContext = createContext(false);\n\n// Whether the header sticks, so a column reaches it without every call site\n// repeating the table's own decision on each one.\nconst StickyHeaderContext = createContext(false);\n\n// What a body cell draws, and the classes it draws with. Written as calls\n// rather than inline at the props, which is what react-perf's\n// no-new-function-as-prop and jsx-no-jsx-as-prop are after; the React\n// Compiler memoises the results on their inputs.\n// The return type is written out rather than inferred, here and in the two\n// below: `ReactNode` is a union that includes a promise, and a function\n// inferred as returning one has to be `async`.\nfunction cellContent(children: ReactNode, selection: boolean, label: string | undefined): ReactNode {\n if (!selection) {\n return children;\n }\n return <Checkbox aria-label={label} slot=\"selection\" />;\n}\nfunction cellStyles(selection: boolean) {\n return {\n 0: {\n className: \"x9f619 x790zyz x1yc453h xxymvpz xrgy624 x1v8yhc2 x2ssjo2 x9v5kkp x1t137rt x1de99jn\"\n },\n 1: {\n className: \"x9f619 x790zyz x1yc453h xxymvpz xrgy624 x1v8yhc2 x2ssjo2 x9v5kkp x1t137rt x1de99jn x19ddzpn xuxw1ft\"\n }\n }[!!selection << 0];\n}\nfunction columnContent(children: ReactNode, selection: boolean, label: string | undefined, resizable: boolean, resizeLabel: string | undefined): RACColumnProps['children'] {\n if (selection) {\n return <Checkbox aria-label={label} slot=\"selection\" />;\n }\n // The handle is a sibling of the name rather than part of it: React Aria\n // renders it as its own element, positioned against the cell's trailing\n // edge, which the name's own box does not reach.\n return (state: ColumnRenderProps): ReactNode => <>\n <span className=\"x6s0dn4 x78zum5 x126z3so\">\n {children}\n {sortArrowFor(state.sortDirection)}\n </span>\n {resizable ? <RACColumnResizer aria-label={resizeLabel} className=\"x5yr21d x9f619 xicojor xvy4d1p x13vifvy x18zu7yx x10l6tqk x5ve5x3 x1vjfegm\">\n {resizerRule}\n </RACColumnResizer> : null}\n </>;\n}\nfunction columnStyles(selection: boolean, sticky: boolean) {\n return (state: ColumnRenderProps) => stylex.props(styles.cell, styles.header, styles.focus, sticky && styles.sticky, selection && styles.selection, state.allowsSorting && styles.headerSortable, state.allowsSorting && state.isHovered && styles.headerHovered, state.allowsSorting && state.isPressed && styles.headerPressed);\n}\n\n// React Aria puts `aria-level` on the load-more row, and `aria-level` is only\n// valid on a row inside a `treegrid` — a grid's rows have no level. axe flags\n// it as `aria-conditional-attr`, and this library's stories run axe as an\n// error, so a table with a load-more row would fail on an attribute nothing\n// here asks for.\n//\n// It cannot be turned off through props: React Aria writes it after spreading\n// what the call site passed, so `aria-level={undefined}` is overwritten. The\n// attribute is taken off the element instead. React writes an attribute only\n// when its prop changes between renders, and this one is always 1, so the\n// removal holds rather than being undone by the next render. `load more` in\n// index.test.tsx pins that it is gone, which is what would notice if React\n// Aria stopped setting it or started varying it.\nfunction dropAriaLevel(node: HTMLTableRowElement | null) {\n node?.removeAttribute('aria-level');\n}\n\n// What the body draws in place of rows: whatever the call site's function\n// returns, inside the box that pads and centres it. A call rather than a\n// function written at the prop, for the same reason the others are.\n//\n// The box is the one thing this adds to React Aria's prop, and the one way\n// the table differs from its siblings, which pass theirs straight through and\n// draw nothing around it. A table's empty state goes in a spanning cell that\n// is not this component's and carries no padding, so without the box the\n// content would sit against the table's edge with no room around it.\nfunction emptyContent(renderEmptyState: (state: TableBodyRenderProps) => ReactNode) {\n // The return type is written out rather than inferred: `ReactNode` is a\n // union that includes a promise, and a function inferred as returning one\n // has to be `async`.\n return (state: TableBodyRenderProps): ReactNode => <span className=\"x9f619 x1w5n3ug x1lliihq xpo2rfv x193rfdd x1hews6w xn43zvd xv61bfh x1lrxzt4 x790zyz x2b8uid\">{renderEmptyState(state)}</span>;\n}\n\n// The container's class. React Aria takes a plain string here rather than a\n// function of render state, since the container reports none — so this is a\n// call rather than the function form the other parts pass.\nfunction resizableContainerClassName() {\n return {\n className: \"x9f619 xh8yej3 xw2csxc\"\n }.className ?? '';\n}\n\n// The rule a handle draws, from React Aria's own render state — it reports\n// the drag and the keyboard focus separately, and the two get one treatment.\nfunction resizerRule(state: ColumnResizerRenderProps): ReactNode {\n return <span {...{\n 0: {\n className: \"x1l12bh x5yr21d x1x0u81l xf1j0q2 xmzn1mo x9f619 x1g12otp x1i1rx1s x13vifvy x9q68il x47corl x10l6tqk\"\n },\n 1: {\n className: \"x5yr21d xf1j0q2 x9f619 x1g12otp x13vifvy x9q68il x47corl x10l6tqk xnety89 x1ksdfms x12inkfj xfo62xy\"\n }\n }[!!(state.isResizing || state.isFocusVisible) << 0]} />;\n}\nfunction rowStyles(state: RowRenderProps) {\n return stylex.props(styles.row,\n // The same ring a cell and a column header draw, and for the same\n // reason: React Aria moves focus to the row itself, so the row is where\n // it has to show. Unconditional, as it is on those two — `focus` carries\n // its own `:focus-visible`, and the browser's default ring is what shows\n // through without it: a colour and an offset the rest of the table does\n // not use, and one no forced-colours mode is obliged to keep.\n styles.focus,\n // The lists page's dragged row and the drop target a row draws, from\n // `src/row` as every other collection's row takes them — the dragged one\n // before the selected container, so a selected row keeps it while it\n // moves.\n state.isDragging && rowLayers.dragging, state.isSelected && styles.rowSelected,\n // The state layers come from the render state, which is what makes a\n // row that only runs an action — `onRowAction`, a row's `onAction` or\n // `href` — take them as a selectable one does: React Aria reports a row\n // hovered or pressed only when a press does something to it, whether\n // that is selecting it, running its action or dragging it.\n state.isHovered && rowLayers.hovered, state.isPressed && rowLayers.pressed, state.isDropTarget && rowLayers.dropTarget, state.isDisabled && styles.rowDisabled);\n}\n\n// The arrow beside a sorted column's name. Nothing is drawn on a column that\n// is sortable but not currently sorted: the page puts the arrow next to the\n// column being sorted, and an arrow on every sortable column would say every\n// one of them was.\nfunction sortArrowFor(direction: 'ascending' | 'descending' | undefined) {\n if (direction === undefined) {\n return null;\n }\n return direction === 'ascending' ? <ArrowUpwardGlyph className=\"xmix8c7 x2lah0s x1xp8n7a\" /> : <ArrowDownwardGlyph className=\"xmix8c7 x2lah0s x1xp8n7a\" />;\n}\n\n/**\n * A grid of rows and columns. Sorting and selection are React Aria's: pass\n * `sortDescriptor` with `onSortChange` and mark the sortable columns\n * `allowsSorting`, and set `selectionMode` to `single` or `multiple` with\n * `selectedKeys` and `onSelectionChange`, or `defaultSelectedKeys`.\n *\n * ```tsx\n * <Table aria-label=\"Label\" selectionMode=\"multiple\">\n * <Table.Header>\n * <Table.Column selection />\n * <Table.Column id=\"name\" isRowHeader>Label</Table.Column>\n * </Table.Header>\n * <Table.Body>\n * <Table.Row id=\"first\">\n * <Table.Cell selection />\n * <Table.Cell>First item</Table.Cell>\n * </Table.Row>\n * </Table.Body>\n * </Table>\n * ```\n *\n * Composed from parts, since a cell takes arbitrary content: `Table.Header`,\n * `Table.Column`, `Table.Body`, `Table.Row`, `Table.Cell` and\n * `Table.Footer`. Name the table with `aria-label` or `aria-labelledby`, and\n * mark one column `isRowHeader` so a screen reader has something to read a\n * row by.\n *\n * The call site's `className` and `style` land on the table, which is the\n * element a layout positions.\n */\nfunction Table({\n onResize,\n onResizeEnd,\n resizable = false,\n resizeLabel,\n selectAllLabel,\n selectLabel,\n stickyHeader = false,\n ...props\n}: RefAttributes<HTMLTableElement> & TableProps) {\n const table = <RACTable {...props} {...mergeStatefulStyles(tableClasses, props)} />;\n return <SelectAllLabelContext value={selectAllLabel}>\n <SelectLabelContext value={selectLabel}>\n <ResizeLabelContext value={resizeLabel}>\n <ResizableContext value={resizable}>\n <StickyHeaderContext value={stickyHeader}>\n {resizable ? <RACResizableTableContainer className={resizableContainerClassName()} onResize={onResize} onResizeEnd={onResizeEnd}>\n {table}\n </RACResizableTableContainer> : table}\n </StickyHeaderContext>\n </ResizableContext>\n </ResizeLabelContext>\n </SelectLabelContext>\n </SelectAllLabelContext>;\n}\n\n/**\n * The rows. `renderEmptyState` is what it shows when there are none — a table\n * with no rows and nothing to say in their place is a blank area with a\n * header over it.\n *\n * It carries no styles of its own, since every rule a body needs is drawn by\n * the rows inside it, so a `className` here lands on the `<tbody>` through\n * React Aria rather than through a merge.\n */\nfunction TableBody<T extends object = object>({\n renderEmptyState,\n ...props\n}: RefAttributes<HTMLTableSectionElement> & TableBodyProps<T>) {\n return <RACTableBody<T> {...props} renderEmptyState={renderEmptyState === undefined ? undefined : emptyContent(renderEmptyState)} />;\n}\n\n/**\n * One cell. `selection` draws this row's checkbox in place of whatever else\n * the cell would hold.\n */\nfunction TableCell({\n children,\n selection = false,\n ...props\n}: RefAttributes<HTMLTableCellElement> & TableCellProps) {\n const label = useContext(SelectLabelContext);\n return <RACCell {...props} {...mergeStatefulStyles(cellStyles(selection), props)}>\n {cellContent(children, selection, label)}\n </RACCell>;\n}\n\n// The table's own classes, with the drop target the other collections'\n// boxes draw while a drop would land on the table as a whole.\nfunction tableClasses(state: TableRenderProps) {\n return stylex.props(styles.table, state.isDropTarget && collectionStyles.dropTarget);\n}\n\n/**\n * One column. `allowsSorting` is React Aria's and makes the header cell\n * itself the control that sorts; the arrow appears on the column the\n * `sortDescriptor` names. `isRowHeader` marks the column a screen reader\n * reads a row by.\n *\n * Its `id` shares a namespace with the rows', so give the two sets values\n * that cannot collide — a column and a row with one id between them leaves\n * the table with no columns at all.\n */\nfunction TableColumn({\n children,\n resizable = false,\n selection = false,\n ...props\n}: RefAttributes<HTMLTableCellElement> & TableColumnProps) {\n const label = useContext(SelectAllLabelContext);\n const resizeLabel = useContext(ResizeLabelContext);\n const resizableTable = useContext(ResizableContext);\n const sticky = useContext(StickyHeaderContext);\n return <RACColumn {...props} {...mergeStatefulStyles(columnStyles(selection, sticky), props)}>\n {columnContent(children, selection, label, resizable && resizableTable, resizeLabel)}\n </RACColumn>;\n}\n\n/**\n * A row under the body, for totals and the like. It is not part of the\n * selection or the keyboard navigation — React Aria keeps it out of both.\n */\nfunction TableFooter<T extends object = object>(props: RefAttributes<HTMLTableSectionElement> & TableFooterProps<T>) {\n return <RACTableFooter<T> {...props} {...mergeStyles({\n className: \"x12smttz x13fuv20 x178xt8z x1w5n3ug xkknnkr x14zspaw x1v9cpvo x155f00i x1lz68p4\"\n }, props)} />;\n}\n\n/**\n * The header row, holding the columns, and the rule drawn under it — which\n * moves to the cells when the header sticks, since a row group's border does\n * not travel with cells `position: sticky` has lifted out of it.\n */\nfunction TableHeader<T extends object = object>(props: RefAttributes<HTMLTableSectionElement> & TableHeaderProps<T>) {\n const sticky = useContext(StickyHeaderContext);\n return <RACTableHeader<T> {...props} {...mergeStatefulStyles({\n 0: {\n className: \"x1j6faob x1q0q8m5 xso031l\"\n },\n 1: {}\n }[!!sticky << 0], props)} />;\n}\n\n/**\n * The row the table shows while it is fetching more. React Aria calls\n * `onLoadMore` when this comes into view, and draws it only while\n * `isLoading`. It goes inside `Table.Body`, after the rows.\n */\nfunction TableLoadMore({\n label,\n ref,\n ...props\n}: RefAttributes<HTMLTableRowElement> & TableLoadMoreProps) {\n return <RACTableLoadMoreItem {...props} {...mergeStyles({\n className: \"xdd8jsf\"\n }, props)} ref={mergeRefs(dropAriaLevel, ref ?? undefined)}>\n <span className=\"x6s0dn4 x9f619 x78zum5 xl56j7k\">\n <CollectionLoadMore diameter=\"24px\" label={label} />\n </span>\n </RACTableLoadMoreItem>;\n}\n\n/**\n * One row. Give every row an `id` — that is the key selection is reported\n * by, and it has to differ from every column's. `onAction` runs when the\n * row is pressed.\n */\nfunction TableRow<T extends object = object>(props: RefAttributes<HTMLTableRowElement> & TableRowProps<T>) {\n return <RACRow<T> {...props} {...mergeStatefulStyles(rowStyles, props)} />;\n}\nTable.Body = TableBody;\nTable.Cell = TableCell;\nTable.Column = TableColumn;\nTable.Footer = TableFooter;\nTable.Header = TableHeader;\nTable.LoadMore = TableLoadMore;\nTable.Row = TableRow;\nexport type { TableBodyProps, TableCellProps, TableColumnProps, TableFooterProps, TableHeaderProps, TableLoadMoreProps, TableProps, TableRowProps };\nexport { TableBody, TableCell, TableColumn, TableFooter, TableHeader, TableLoadMore, TableRow };\nexport default Table;"],"mappings":";;;;;;;;;;;;;;AA6FA,MAAMiE,wBAAwBtC,cAAkCuC,KAAAA,CAAS;AACzE,MAAMC,qBAAqBxC,cAAkCuC,KAAAA,CAAS;AACtE,MAAME,SAAS;CACbC,MAAM;EACJC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,OAAO;EACLC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRL,OAAO;CACT;CACAM,QAAQ;EACNC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRf,OAAO;CACT;CACAgB,eAAe;EACbC,QAAQ;EACRjB,OAAO;CACT;CACAkB,eAAe;EACbD,QAAQ;EACRjB,OAA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ZC,UAAAA;EAHwB,CAAA;EAMHN,EAAA,MAAAC;EAAAD,EAAA,MAAAE;EAAAF,EAAA,MAAAG;EAAAH,EAAA,MAAAK;EAAAL,EAAA,MAAAM;EAAAN,EAAA,MAAAO;CAAA,OAAAA,KAAAP,EAAA;CAAA,OANlBO;AAMkB;;;;;;AAQ3B,SAAAY,SAAAzC,OAAA;CAAA,MAAAsB,IAAAjK,EAAA,CAAA;CAAA,IAAAgK;CAAA,IAAAC,EAAA,OAAAtB,OAAA;EACmCqB,KAAAzG,oBAAoBF,WAAWsF,KAAK;EAACsB,EAAA,KAAAtB;EAAAsB,EAAA,KAAAD;CAAA,OAAAA,KAAAC,EAAA;CAAA,IAAAE;CAAA,IAAAF,EAAA,OAAAtB,SAAAsB,EAAA,OAAAD,IAAA;EAA/DG,KAAA,oBAACsC,KAAD;GAAO,GAAQ9D;GAAK,GAAMqB;EAAqC,CAAA;EAAIC,EAAA,KAAAtB;EAAAsB,EAAA,KAAAD;EAAAC,EAAA,KAAAE;CAAA,OAAAA,KAAAF,EAAA;CAAA,OAAnEE;AAAmE;AAE5E7H,QAAM+I,OAAO7I;AACbF,QAAMV,OAAOiJ;AACbvI,QAAMR,SAASgJ;AACfxI,QAAMgJ,SAAS5I;AACfJ,QAAMiJ,SAAS3I;AACfN,QAAMkJ,WAAWN;AACjB5I,QAAMF,MAAMgJ"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["c","_c","ReactNode","RefAttributes","ColumnRenderProps","ColumnResizerRenderProps","CellProps","RACCellProps","ColumnProps","RACColumnProps","RowProps","RACRowProps","TableBodyProps","RACTableBodyProps","TableFooterProps","RACTableFooterProps","TableHeaderProps","RACTableHeaderProps","TableLoadMoreItemProps","RACTableLoadMoreItemProps","TableProps","RACTableProps","ResizableTableContainerProps","RowRenderProps","TableBodyRenderProps","TableRenderProps","stylex","createContext","useContext","useLayoutEffect","useMemo","useState","Cell","RACCell","Column","RACColumn","ColumnResizer","RACColumnResizer","ResizableTableContainer","RACResizableTableContainer","Row","RACRow","Table","RACTable","TableBody","RACTableBody","TableFooter","RACTableFooter","TableHeader","RACTableHeader","TableLoadMoreItem","RACTableLoadMoreItem","CollectionLoadMore","collectionStyles","ArrowDownwardGlyph","ArrowUpwardGlyph","mergeRefs","rowStyles","rowLayers","mergeStatefulStyles","mergeStyles","colors","sizing","spacing","stateLayerOpacity","typography","Checkbox","FORCED_COLORS","SelectAllLabelContext","undefined","SelectLabelContext","styles","cell","kB7OPa","kg3NbH","k9WMMc","kXLuUW","$$css","focus","kjBf7l","kInvED","k3XXqK","kMeerF","header","kZKoxP","kMwMTN","kMv6JI","kGuDYH","k63SB2","kb6lSQ","kLWn49","kVQacm","kVAEAm","headerHovered","kWkggS","headerPressed","headerSortable","kkrTdU","row","kLZC3w","kPef9Z","kEafiO","rowDisabled","kAXs8y","rowSelected","selection","kzqmXN","khDVqt","sticky","kGVxlE","k87sOh","kY2c9j","table","kLvRdT","Omit","T","className","renderEmptyState","style","TableCellProps","children","TableColumnProps","resizable","TableLoadMoreProps","label","onResize","onResizeEnd","resizeLabel","selectAllLabel","selectLabel","stickyHeader","TableRowProps","ResizeLabelContext","ResizableContext","StickyHeaderContext","NO_MIN_WIDTHS","ReadonlyMap","Element","Map","ColumnMinWidthsContext","REACT_ARIA_MIN_WIDTH","cellContent","cellStyles","columnContent","state","sortArrowFor","sortDirection","resizerRule","columnStyles","props","allowsSorting","isHovered","isPressed","dropAriaLevel","node","HTMLTableRowElement","removeAttribute","emptyContent","measureColumns","HTMLTableElement","headers","HTMLTableCellElement","tHead","rows","push","cells","held","map","element","cssText","const","tableLayout","width","widths","Math","ceil","getBoundingClientRect","css","resizableContainerClassName","isResizing","isFocusVisible","isDragging","dragging","isSelected","hovered","pressed","isDropTarget","dropTarget","isDisabled","direction","t0","$","t1","t2","setElement","t3","ref","minWidths","useColumnMinWidths","t4","tableClasses","t5","t6","t7","t8","t9","t10","t11","t12","TableCell","T0","TableColumn","resizableTable","get","measured","minWidth","max","0","1","TableLoadMore","TableRow","setWidths","measure","next","current","size","every","changes","MutationObserver","observe","characterData","childList","subtree","document","fonts","addEventListener","disconnect","removeEventListener","Body","Footer","Header","LoadMore","RACColumnResizer","stylex.props","rowLayers","Table","_c","RACTable","RACResizableTableContainer","TableBody","RACTableBody","RACCell","RACColumn","TableFooter","RACTableFooter","TableHeader","RACTableHeader","RACTableLoadMoreItem","RACRow"],"sources":["../../../src/components/table/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { ColumnRenderProps, ColumnResizerRenderProps, CellProps as RACCellProps, ColumnProps as RACColumnProps, RowProps as RACRowProps, TableBodyProps as RACTableBodyProps, TableFooterProps as RACTableFooterProps, TableHeaderProps as RACTableHeaderProps, TableLoadMoreItemProps as RACTableLoadMoreItemProps, TableProps as RACTableProps, ResizableTableContainerProps, RowRenderProps, TableBodyRenderProps, TableRenderProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { createContext, useContext, useLayoutEffect, useMemo, useState } from 'react';\nimport { Cell as RACCell, Column as RACColumn, ColumnResizer as RACColumnResizer, ResizableTableContainer as RACResizableTableContainer, Row as RACRow, Table as RACTable, TableBody as RACTableBody, TableFooter as RACTableFooter, TableHeader as RACTableHeader, TableLoadMoreItem as RACTableLoadMoreItem } from 'react-aria-components';\nimport { CollectionLoadMore } from '../../collection';\nimport { collectionStyles } from '../../collection/styles';\nimport { ArrowDownwardGlyph, ArrowUpwardGlyph } from '../../glyphs';\nimport { mergeRefs } from '../../render/ref';\nimport { rowStyles as rowLayers } from '../../row/styles';\nimport { mergeStatefulStyles, mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, sizing, spacing, stateLayerOpacity, typography } from '../../tokens/design.tokens.stylex';\nimport Checkbox from '../checkbox';\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)';\n\n// A grid of rows and columns, with sorting and selection. The design system\n// carries no data table page — it was dropped after Material Design 2 — so\n// the geometry comes from the archived one at\n// <https://m2.material.io/components/data-tables>, which is the page this\n// component is drawn from: a 56dp header row, 52dp body rows, 16dp of\n// padding on each side of a cell, a medium-weight header to set it apart\n// from the rows, and an arrow beside the name of the column being sorted.\n//\n// Its colour roles are the current system's rather than that page's, since\n// a table sits beside lists, cards and menus that all draw from the tokens\n// here. That means the row's state layers are the ones `src/row` uses — the\n// same hover, pressed and selected treatment a list row takes — so a\n// selected table row and a selected list row on one page cannot disagree.\n//\n// The row is not `src/row`, and that is the one place this departs from the\n// library's other collections. That module's row is a headline with a\n// supporting line and a slot at each end; a table row is a run of cells with\n// no such shape, and forcing one into the other would give every cell the\n// row's 56dp floor and body-large headline. The state layers are shared by\n// being written from the same tokens rather than by sharing the module.\n//\n// Four things are this component's own.\n//\n// **The rule between rows is drawn on the row, not on its cells.** A cell\n// cannot see whether its row is the first one, so a rule per cell either\n// doubles under the header or needs the row's position passed down. The\n// table collapses its borders, which is what lets a `<tr>` carry one.\n//\n// **A selecting table draws its checkbox where the call site puts it.**\n// `selection` on a column and on a cell renders the library's Checkbox in\n// React Aria's selection slot — the column's is select-all, the cell's is\n// that row's. It is a prop rather than an injected column because the header\n// and every row have to agree on how many columns there are, and only the\n// call site can keep that true.\n//\n// **A sortable column is the press target itself.** React Aria puts no\n// button inside the header cell; it makes the cell pressable and sets\n// `aria-sort` on it. So the arrow is content next to the name, and the\n// hover and pressed layers belong to the cell.\n//\n// **The header sticks only when asked.** A sticky header needs an opaque\n// background to scroll rows under, and that colour is only right when the\n// table is in something that scrolls. `stickyHeader` is what says so.\n//\n// **Resizing is asked for twice, and both are needed.** React Aria puts the\n// resize state on a container around the table and the handle inside a\n// column, so `resizable` on the table is what brings the container and\n// `resizable` on a column is what draws its handle. The archived page has no\n// resizer to take a treatment from — it predates the feature — so the handle\n// draws the divider's own rule, thickening and taking the primary role while\n// it is dragged, over a target far wider than the rule.\n//\n// **A resizable table stops filling its width.** The container sets\n// `table-layout: fixed` and `width: min-content` on the table as inline\n// styles, which no rule here can outrank; the container fills the width\n// instead and scrolls when the columns together are wider than it.\n//\n// **And no column of it is narrower than its longest word.** A fixed layout\n// sizes columns without reading what is in them, so a column given less than\n// a word took the word apart, \"Waitin\" over \"g\", wherever a parent such as a\n// `Card` lets words break. So the container keeps words whole, and the table\n// measures what each column holds and hands React Aria that as the column's\n// `minWidth` — see `useColumnMinWidths`. Columns that stop fitting then\n// scroll in the container, as a wide table already does, and a handle stops\n// at the word rather than breaking it. A column given a `minWidth` of its own\n// keeps it.\n//\n// One thing about React Aria's collection is worth knowing before writing a\n// call site. **A column's `id` and a row's `id` share one namespace**, and a\n// value used by both silently drops every column — the table then throws\n// \"Cell count must match column count\", naming the cells rather than the\n// duplicate key that caused it. Nothing here can catch it, since both ids\n// are the call site's to choose; the docstrings below say to keep them\n// apart, and the stories and tests use `col`-prefixed column ids so the two\n// sets cannot meet.\n\n// What the selection checkboxes are called. A context rather than a prop on\n// every column and cell, since it is the table's decision and repeating it\n// per row is how the two drift. Undefined unless the table is given one,\n// which leaves the names React Aria gives in the reader's locale.\nconst SelectAllLabelContext = createContext<string | undefined>(undefined);\nconst SelectLabelContext = createContext<string | undefined>(undefined);\nconst styles = {\n cell: {\n kB7OPa: \"x9f619\",\n kg3NbH: \"x790zyz\",\n k9WMMc: \"x1yc453h\",\n kXLuUW: \"xxymvpz\",\n $$css: true\n },\n focus: {\n kjBf7l: \"xrgy624 x1v8yhc2\",\n kInvED: \"x2ssjo2\",\n k3XXqK: \"x9v5kkp x1t137rt\",\n kMeerF: \"x1de99jn\",\n $$css: true\n },\n header: {\n kZKoxP: \"x1ded5cy\",\n kMwMTN: \"x1w5n3ug\",\n kMv6JI: \"xkknnkr\",\n kGuDYH: \"x14zspaw\",\n k63SB2: \"x1v9cpvo\",\n kb6lSQ: \"x155f00i\",\n kLWn49: \"x1lz68p4\",\n kVQacm: \"x9h1dke\",\n kVAEAm: \"x1n2onr6\",\n $$css: true\n },\n headerHovered: {\n kWkggS: \"x1b18xnh\",\n $$css: true\n },\n headerPressed: {\n kWkggS: \"xjeeohs\",\n $$css: true\n },\n headerSortable: {\n kWkggS: \"xjbqb8w\",\n kkrTdU: \"x1ypdohk\",\n $$css: true\n },\n row: {\n kZKoxP: \"xdd8jsf\",\n kLZC3w: \"x12smttz\",\n kPef9Z: \"x13fuv20\",\n kEafiO: \"x1g31smg x178xt8z\",\n $$css: true\n },\n rowDisabled: {\n kWkggS: \"xjbqb8w\",\n kMwMTN: \"x1xj74d8\",\n kkrTdU: \"x1h6gzvc\",\n kAXs8y: \"xr5dkdi\",\n $$css: true\n },\n rowSelected: {\n kWkggS: \"xp89om9 x1jzqe4\",\n kMwMTN: \"xscdzaa x1k5gbb1\",\n kAXs8y: \"x1g12otp\",\n $$css: true\n },\n selection: {\n kzqmXN: \"x19ddzpn\",\n khDVqt: \"xuxw1ft\",\n $$css: true\n },\n sticky: {\n kWkggS: \"x14s9m32\",\n kGVxlE: \"x1ixd52e\",\n k87sOh: \"x13vifvy\",\n kVAEAm: \"x7wzq59\",\n kY2c9j: \"x1vjfegm\",\n $$css: true\n },\n table: {\n kLvRdT: \"x1mwwwfo\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x139gbkf\",\n kMv6JI: \"xpo2rfv\",\n kGuDYH: \"x193rfdd\",\n k63SB2: \"x1hews6w\",\n kzqmXN: \"xh8yej3\",\n kb6lSQ: \"xn43zvd\",\n kLWn49: \"xv61bfh\",\n k3XXqK: \"x1t137rt\",\n $$css: true\n }\n};\ntype TableBodyProps<T extends object = object> = Omit<RACTableBodyProps<T>, 'className' | 'renderEmptyState' | 'style'> & {\n /** A function may compute the class from the body's render state. */\n className?: RACTableBodyProps<T>['className'];\n /**\n * What the table shows in place of rows when it has none: React Aria's own\n * render function, under React Aria's own name, as List, ListBox, Tree and\n * ChipGroup take it. What it returns is drawn in a row of its own spanning\n * every column, inside the muted, padded box the table draws there.\n */\n renderEmptyState?: RACTableBodyProps<T>['renderEmptyState'];\n /** A function may compute the style from the body's render state. */\n style?: RACTableBodyProps<T>['style'];\n};\ntype TableCellProps = Omit<RACCellProps, 'children' | 'className' | 'style'> & {\n /** What the cell holds. */\n children?: ReactNode;\n /** A function may compute the class from the cell's render state. */\n className?: RACCellProps['className'];\n /**\n * Draws this row's selection checkbox instead of `children`. The row's own\n * text is what names the row; the box inside it takes the table's\n * `selectLabel`.\n */\n selection?: boolean;\n /** A function may compute the style from the cell's render state. */\n style?: RACCellProps['style'];\n};\ntype TableColumnProps = {\n /** The column's name. */\n children?: ReactNode;\n /** A function may compute the class from the column's render state. */\n className?: RACColumnProps['className'];\n /**\n * Draws a handle at the column's trailing edge that drags its width. Needs\n * the table's own `resizable` as well — React Aria keeps the resize state\n * on a container around the table, and without it there is nothing for a\n * handle to change. `defaultWidth`, `minWidth` and `maxWidth` are React\n * Aria's and apply only inside that container.\n */\n resizable?: boolean;\n /**\n * Draws the select-all checkbox instead of `children`, for the column the\n * rows put their own checkboxes in.\n */\n selection?: boolean;\n /** A function may compute the style from the column's render state. */\n style?: RACColumnProps['style'];\n} & Omit<RACColumnProps, 'children' | 'className' | 'style'>;\ntype TableFooterProps<T extends object = object> = RACTableFooterProps<T>;\ntype TableHeaderProps<T extends object = object> = RACTableHeaderProps<T>;\ntype TableLoadMoreProps = Omit<RACTableLoadMoreItemProps, 'children'> & {\n /**\n * What the row says while it is loading. Read by a screen reader; the ring\n * itself carries no text.\n * Left out, it is the word for it in the I18nProvider's locale — \"Loading\n * more\" in English.\n */\n label?: string;\n};\ntype TableProps = {\n /** A function may compute the class from the table's render state. */\n className?: RACTableProps['className'];\n /** Called as a column is dragged, with every column's width. */\n onResize?: ResizableTableContainerProps['onResize'];\n /** Called once a drag ends, with every column's width. */\n onResizeEnd?: ResizableTableContainerProps['onResizeEnd'];\n /**\n * Lets columns marked `resizable` be dragged, by putting the table in the\n * container React Aria keeps the resize state on. A resizable table sizes\n * to its columns rather than to its parent, and that container is what\n * fills the width and scrolls instead.\n */\n resizable?: boolean;\n /**\n * What the resize handle is called, for a screen reader. React Aria\n * composes it with the column's own name. Left out, React Aria names it in\n * the reader's locale — \"Resizer\" in English.\n */\n resizeLabel?: string;\n /**\n * What the select-all checkbox is called, for a screen reader. Left out,\n * React Aria names it in the reader's locale — \"Select All\" in English.\n */\n selectAllLabel?: string;\n /**\n * What each row's selection checkbox is called, for a screen reader. The\n * row's own text is what names the row; this names the box inside it.\n * Left out, React Aria names it in the reader's locale — \"Select\" in\n * English.\n */\n selectLabel?: string;\n /**\n * Holds the header row in place while the rows scroll under it. Needs the\n * table inside something that scrolls; on a table that does not, it draws\n * the same as without it.\n */\n stickyHeader?: boolean;\n /** A function may compute the style from the table's render state. */\n style?: RACTableProps['style'];\n} & Omit<RACTableProps, 'className' | 'style'>;\ntype TableRowProps<T extends object = object> = Omit<RACRowProps<T>, 'className' | 'style'> & {\n /** A function may compute the class from the row's render state. */\n className?: RACRowProps<T>['className'];\n /** A function may compute the style from the row's render state. */\n style?: RACRowProps<T>['style'];\n};\n\n// What the resize handles are called, for the same reason the selection\n// labels travel this way: it is the table's decision, and repeating it per\n// column is how the two drift. Undefined by default, as they are.\nconst ResizeLabelContext = createContext<string | undefined>(undefined);\n\n// Whether the table brought the container. React Aria's resizer throws\n// outright without one — \"Wrap your <Table> in a <ResizableTableContainer>\",\n// naming a component a consumer of this library never writes — so a column\n// asking to resize inside a table that does not would take the whole page\n// down. It draws no handle instead.\nconst ResizableContext = createContext(false);\n\n// Whether the header sticks, so a column reaches it without every call site\n// repeating the table's own decision on each one.\nconst StickyHeaderContext = createContext(false);\n\n// The narrowest each column of a resizable table can be with its words whole,\n// by the column's header cell. Empty for a table that does not resize, whose\n// columns size to what they hold anyway.\nconst NO_MIN_WIDTHS: ReadonlyMap<Element, number> = new Map();\nconst ColumnMinWidthsContext = createContext(NO_MIN_WIDTHS);\n\n// React Aria's own minimum for a column, which a measured one below it would\n// otherwise lower.\nconst REACT_ARIA_MIN_WIDTH = 75;\n\n// What a body cell draws, and the classes it draws with. Written as calls\n// rather than inline at the props, which is what react-perf's\n// no-new-function-as-prop and jsx-no-jsx-as-prop are after; the React\n// Compiler memoises the results on their inputs.\n// The return type is written out rather than inferred, here and in the two\n// below: `ReactNode` is a union that includes a promise, and a function\n// inferred as returning one has to be `async`.\nfunction cellContent(children: ReactNode, selection: boolean, label: string | undefined): ReactNode {\n if (!selection) {\n return children;\n }\n return <Checkbox aria-label={label} slot=\"selection\" />;\n}\nfunction cellStyles(selection: boolean) {\n return {\n 0: {\n className: \"x9f619 x790zyz x1yc453h xxymvpz xrgy624 x1v8yhc2 x2ssjo2 x9v5kkp x1t137rt x1de99jn\"\n },\n 1: {\n className: \"x9f619 x790zyz x1yc453h xxymvpz xrgy624 x1v8yhc2 x2ssjo2 x9v5kkp x1t137rt x1de99jn x19ddzpn xuxw1ft\"\n }\n }[!!selection << 0];\n}\nfunction columnContent(children: ReactNode, selection: boolean, label: string | undefined, resizable: boolean, resizeLabel: string | undefined): RACColumnProps['children'] {\n if (selection) {\n return <Checkbox aria-label={label} slot=\"selection\" />;\n }\n // The handle is a sibling of the name rather than part of it: React Aria\n // renders it as its own element, positioned against the cell's trailing\n // edge, which the name's own box does not reach.\n return (state: ColumnRenderProps): ReactNode => <>\n <span className=\"x6s0dn4 x78zum5 x126z3so\">\n {children}\n {sortArrowFor(state.sortDirection)}\n </span>\n {resizable ? <RACColumnResizer aria-label={resizeLabel} className=\"x5yr21d x9f619 xicojor xvy4d1p x13vifvy x18zu7yx x10l6tqk x5ve5x3 x1vjfegm\">\n {resizerRule}\n </RACColumnResizer> : null}\n </>;\n}\nfunction columnStyles(selection: boolean, sticky: boolean) {\n return (state: ColumnRenderProps) => stylex.props(styles.cell, styles.header, styles.focus, sticky && styles.sticky, selection && styles.selection, state.allowsSorting && styles.headerSortable, state.allowsSorting && state.isHovered && styles.headerHovered, state.allowsSorting && state.isPressed && styles.headerPressed);\n}\n\n// React Aria puts `aria-level` on the load-more row, and `aria-level` is only\n// valid on a row inside a `treegrid` — a grid's rows have no level. axe flags\n// it as `aria-conditional-attr`, and this library's stories run axe as an\n// error, so a table with a load-more row would fail on an attribute nothing\n// here asks for.\n//\n// It cannot be turned off through props: React Aria writes it after spreading\n// what the call site passed, so `aria-level={undefined}` is overwritten. The\n// attribute is taken off the element instead. React writes an attribute only\n// when its prop changes between renders, and this one is always 1, so the\n// removal holds rather than being undone by the next render. `load more` in\n// index.test.tsx pins that it is gone, which is what would notice if React\n// Aria stopped setting it or started varying it.\nfunction dropAriaLevel(node: HTMLTableRowElement | null) {\n node?.removeAttribute('aria-level');\n}\n\n// What the body draws in place of rows: whatever the call site's function\n// returns, inside the box that pads and centres it. A call rather than a\n// function written at the prop, for the same reason the others are.\n//\n// The box is the one thing this adds to React Aria's prop, and the one way\n// the table differs from its siblings, which pass theirs straight through and\n// draw nothing around it. A table's empty state goes in a spanning cell that\n// is not this component's and carries no padding, so without the box the\n// content would sit against the table's edge with no room around it.\nfunction emptyContent(renderEmptyState: (state: TableBodyRenderProps) => ReactNode) {\n // The return type is written out rather than inferred: `ReactNode` is a\n // union that includes a promise, and a function inferred as returning one\n // has to be `async`.\n return (state: TableBodyRenderProps): ReactNode => <span className=\"x9f619 x1w5n3ug x1lliihq xpo2rfv x193rfdd x1hews6w xn43zvd xv61bfh x1lrxzt4 x790zyz x2b8uid\">{renderEmptyState(state)}</span>;\n}\n\n/**\n * Each header cell's width with the table laid out to its content. A fixed\n * layout never reads a cell's content, so the table is laid out the other\n * way for the length of the measurement: automatically, at no width, and\n * with the widths React Aria put on the header cells lifted, which leaves\n * every column at the width of the longest word it holds, its padding\n * included. The styles are put back before returning, so nothing is painted\n * in between.\n */\nfunction measureColumns(table: HTMLTableElement): Map<Element, number> {\n const headers: HTMLTableCellElement[] = [];\n for (const row of table.tHead?.rows ?? []) {\n headers.push(...row.cells);\n }\n const held = [table, ...headers].map(element => [element, element.style.cssText] as const);\n table.style.tableLayout = 'auto';\n table.style.width = '0px';\n for (const header of headers) {\n header.style.width = '';\n }\n const widths = new Map(headers.map(header => [header, Math.ceil(header.getBoundingClientRect().width)]));\n for (const [element, css] of held) {\n element.style.cssText = css;\n }\n return widths;\n}\n\n// The container's class. React Aria takes a plain string here rather than a\n// function of render state, since the container reports none — so this is a\n// call rather than the function form the other parts pass.\nfunction resizableContainerClassName() {\n return {\n className: \"x9f619 xh8yej3 x1h4wwuj xw2csxc\"\n }.className ?? '';\n}\n\n// The rule a handle draws, from React Aria's own render state — it reports\n// the drag and the keyboard focus separately, and the two get one treatment.\nfunction resizerRule(state: ColumnResizerRenderProps): ReactNode {\n return <span {...{\n 0: {\n className: \"x1l12bh x5yr21d x1x0u81l xf1j0q2 xmzn1mo x9f619 x1g12otp x1i1rx1s x13vifvy x9q68il x47corl x10l6tqk\"\n },\n 1: {\n className: \"x5yr21d xf1j0q2 x9f619 x1g12otp x13vifvy x9q68il x47corl x10l6tqk xnety89 x1ksdfms x12inkfj xfo62xy\"\n }\n }[!!(state.isResizing || state.isFocusVisible) << 0]} />;\n}\nfunction rowStyles(state: RowRenderProps) {\n return stylex.props(styles.row,\n // The same ring a cell and a column header draw, and for the same\n // reason: React Aria moves focus to the row itself, so the row is where\n // it has to show. Unconditional, as it is on those two — `focus` carries\n // its own `:focus-visible`, and the browser's default ring is what shows\n // through without it: a colour and an offset the rest of the table does\n // not use, and one no forced-colours mode is obliged to keep.\n styles.focus,\n // The lists page's dragged row and the drop target a row draws, from\n // `src/row` as every other collection's row takes them — the dragged one\n // before the selected container, so a selected row keeps it while it\n // moves.\n state.isDragging && rowLayers.dragging, state.isSelected && styles.rowSelected,\n // The state layers come from the render state, which is what makes a\n // row that only runs an action — `onRowAction`, a row's `onAction` or\n // `href` — take them as a selectable one does: React Aria reports a row\n // hovered or pressed only when a press does something to it, whether\n // that is selecting it, running its action or dragging it.\n state.isHovered && rowLayers.hovered, state.isPressed && rowLayers.pressed, state.isDropTarget && rowLayers.dropTarget, state.isDisabled && styles.rowDisabled);\n}\n\n// The arrow beside a sorted column's name. Nothing is drawn on a column that\n// is sortable but not currently sorted: the page puts the arrow next to the\n// column being sorted, and an arrow on every sortable column would say every\n// one of them was.\nfunction sortArrowFor(direction: 'ascending' | 'descending' | undefined) {\n if (direction === undefined) {\n return null;\n }\n return direction === 'ascending' ? <ArrowUpwardGlyph className=\"xmix8c7 x2lah0s x1xp8n7a\" /> : <ArrowDownwardGlyph className=\"xmix8c7 x2lah0s x1xp8n7a\" />;\n}\n\n/**\n * A grid of rows and columns. Sorting and selection are React Aria's: pass\n * `sortDescriptor` with `onSortChange` and mark the sortable columns\n * `allowsSorting`, and set `selectionMode` to `single` or `multiple` with\n * `selectedKeys` and `onSelectionChange`, or `defaultSelectedKeys`.\n *\n * ```tsx\n * <Table aria-label=\"Label\" selectionMode=\"multiple\">\n * <Table.Header>\n * <Table.Column selection />\n * <Table.Column id=\"name\" isRowHeader>Label</Table.Column>\n * </Table.Header>\n * <Table.Body>\n * <Table.Row id=\"first\">\n * <Table.Cell selection />\n * <Table.Cell>First item</Table.Cell>\n * </Table.Row>\n * </Table.Body>\n * </Table>\n * ```\n *\n * Composed from parts, since a cell takes arbitrary content: `Table.Header`,\n * `Table.Column`, `Table.Body`, `Table.Row`, `Table.Cell` and\n * `Table.Footer`. Name the table with `aria-label` or `aria-labelledby`, and\n * mark one column `isRowHeader` so a screen reader has something to read a\n * row by.\n *\n * The call site's `className` and `style` land on the table, which is the\n * element a layout positions.\n */\nfunction Table({\n onResize,\n onResizeEnd,\n resizable = false,\n resizeLabel,\n selectAllLabel,\n selectLabel,\n stickyHeader = false,\n ...props\n}: RefAttributes<HTMLTableElement> & TableProps) {\n // Held as state rather than in a ref object, since the columns are\n // measured from an effect that has to run again when it changes, and only\n // for a table that resizes, so no other table renders twice for it. The\n // call site's ref lands on the same element, read off `props` for the\n // reason NavigationBar gives.\n const [element, setElement] = useState<HTMLTableElement | null>(null);\n const ref = useMemo(() => resizable ? mergeRefs<HTMLTableElement>(setElement, props.ref ?? undefined) : props.ref, [props.ref, resizable]);\n const minWidths = useColumnMinWidths(resizable ? element : null);\n const table = <RACTable {...props} {...mergeStatefulStyles(tableClasses, props)} ref={ref} />;\n return <SelectAllLabelContext value={selectAllLabel}>\n <SelectLabelContext value={selectLabel}>\n <ResizeLabelContext value={resizeLabel}>\n <ResizableContext value={resizable}>\n <StickyHeaderContext value={stickyHeader}>\n <ColumnMinWidthsContext value={minWidths}>\n {resizable ? <RACResizableTableContainer className={resizableContainerClassName()} onResize={onResize} onResizeEnd={onResizeEnd}>\n {table}\n </RACResizableTableContainer> : table}\n </ColumnMinWidthsContext>\n </StickyHeaderContext>\n </ResizableContext>\n </ResizeLabelContext>\n </SelectLabelContext>\n </SelectAllLabelContext>;\n}\n\n/**\n * The rows. `renderEmptyState` is what it shows when there are none — a table\n * with no rows and nothing to say in their place is a blank area with a\n * header over it.\n *\n * It carries no styles of its own, since every rule a body needs is drawn by\n * the rows inside it, so a `className` here lands on the `<tbody>` through\n * React Aria rather than through a merge.\n */\nfunction TableBody<T extends object = object>({\n renderEmptyState,\n ...props\n}: RefAttributes<HTMLTableSectionElement> & TableBodyProps<T>) {\n return <RACTableBody<T> {...props} renderEmptyState={renderEmptyState === undefined ? undefined : emptyContent(renderEmptyState)} />;\n}\n\n/**\n * One cell. `selection` draws this row's checkbox in place of whatever else\n * the cell would hold.\n */\nfunction TableCell({\n children,\n selection = false,\n ...props\n}: RefAttributes<HTMLTableCellElement> & TableCellProps) {\n const label = useContext(SelectLabelContext);\n return <RACCell {...props} {...mergeStatefulStyles(cellStyles(selection), props)}>\n {cellContent(children, selection, label)}\n </RACCell>;\n}\n\n// The table's own classes, with the drop target the other collections'\n// boxes draw while a drop would land on the table as a whole.\nfunction tableClasses(state: TableRenderProps) {\n return stylex.props(styles.table, state.isDropTarget && collectionStyles.dropTarget);\n}\n\n/**\n * One column. `allowsSorting` is React Aria's and makes the header cell\n * itself the control that sorts; the arrow appears on the column the\n * `sortDescriptor` names. `isRowHeader` marks the column a screen reader\n * reads a row by.\n *\n * Its `id` shares a namespace with the rows', so give the two sets values\n * that cannot collide — a column and a row with one id between them leaves\n * the table with no columns at all.\n */\nfunction TableColumn({\n children,\n resizable = false,\n selection = false,\n ...props\n}: RefAttributes<HTMLTableCellElement> & TableColumnProps) {\n const label = useContext(SelectAllLabelContext);\n const resizeLabel = useContext(ResizeLabelContext);\n const resizableTable = useContext(ResizableContext);\n const sticky = useContext(StickyHeaderContext);\n // The header cell, which is what the table's measurements are keyed by,\n // held only in a table that measures them.\n const [element, setElement] = useState<HTMLTableCellElement | null>(null);\n const ref = useMemo(() => resizableTable ? mergeRefs<HTMLTableCellElement>(setElement, props.ref ?? undefined) : props.ref, [props.ref, resizableTable]);\n const minWidths = useContext(ColumnMinWidthsContext);\n const measured = element === null ? undefined : minWidths.get(element);\n return <RACColumn {...props} {...mergeStatefulStyles(columnStyles(selection, sticky), props)} minWidth={props.minWidth ?? (measured === undefined ? undefined : Math.max(measured, REACT_ARIA_MIN_WIDTH))} ref={ref}>\n {columnContent(children, selection, label, resizable && resizableTable, resizeLabel)}\n </RACColumn>;\n}\n\n/**\n * A row under the body, for totals and the like. It is not part of the\n * selection or the keyboard navigation — React Aria keeps it out of both.\n */\nfunction TableFooter<T extends object = object>(props: RefAttributes<HTMLTableSectionElement> & TableFooterProps<T>) {\n return <RACTableFooter<T> {...props} {...mergeStyles({\n className: \"x12smttz x13fuv20 x178xt8z x1w5n3ug xkknnkr x14zspaw x1v9cpvo x155f00i x1lz68p4\"\n }, props)} />;\n}\n\n/**\n * The header row, holding the columns, and the rule drawn under it — which\n * moves to the cells when the header sticks, since a row group's border does\n * not travel with cells `position: sticky` has lifted out of it.\n */\nfunction TableHeader<T extends object = object>(props: RefAttributes<HTMLTableSectionElement> & TableHeaderProps<T>) {\n const sticky = useContext(StickyHeaderContext);\n return <RACTableHeader<T> {...props} {...mergeStatefulStyles({\n 0: {\n className: \"x1j6faob x1q0q8m5 xso031l\"\n },\n 1: {}\n }[!!sticky << 0], props)} />;\n}\n\n/**\n * The row the table shows while it is fetching more. React Aria calls\n * `onLoadMore` when this comes into view, and draws it only while\n * `isLoading`. It goes inside `Table.Body`, after the rows.\n */\nfunction TableLoadMore({\n label,\n ref,\n ...props\n}: RefAttributes<HTMLTableRowElement> & TableLoadMoreProps) {\n return <RACTableLoadMoreItem {...props} {...mergeStyles({\n className: \"xdd8jsf\"\n }, props)} ref={mergeRefs(dropAriaLevel, ref ?? undefined)}>\n <span className=\"x6s0dn4 x9f619 x78zum5 xl56j7k\">\n <CollectionLoadMore diameter=\"24px\" label={label} />\n </span>\n </RACTableLoadMoreItem>;\n}\n\n/**\n * One row. Give every row an `id` — that is the key selection is reported\n * by, and it has to differ from every column's. `onAction` runs when the\n * row is pressed.\n */\nfunction TableRow<T extends object = object>(props: RefAttributes<HTMLTableRowElement> & TableRowProps<T>) {\n return <RACRow<T> {...props} {...mergeStatefulStyles(rowStyles, props)} />;\n}\n\n/**\n * The narrowest each column of a resizable table can be with none of its\n * words broken, by the column's header cell, for the columns to take as\n * their minimum — see the header.\n *\n * Measured again when a row, a cell or its text changes, and when a font\n * finishes loading, which is when a word's width changes; never when the\n * table is resized, since what a column holds does not change with it.\n */\nfunction useColumnMinWidths(table: HTMLTableElement | null) {\n const [widths, setWidths] = useState(NO_MIN_WIDTHS);\n useLayoutEffect(() => {\n if (table === null) {\n return undefined;\n }\n const measure = () => {\n const next = measureColumns(table);\n setWidths(current => current.size === next.size && [...next].every(([header, width]) => current.get(header) === width) ? current : next);\n };\n measure();\n const changes = new MutationObserver(measure);\n changes.observe(table, {\n characterData: true,\n childList: true,\n subtree: true\n });\n document.fonts.addEventListener('loadingdone', measure);\n return () => {\n changes.disconnect();\n document.fonts.removeEventListener('loadingdone', measure);\n };\n }, [table]);\n return widths;\n}\nTable.Body = TableBody;\nTable.Cell = TableCell;\nTable.Column = TableColumn;\nTable.Footer = TableFooter;\nTable.Header = TableHeader;\nTable.LoadMore = TableLoadMore;\nTable.Row = TableRow;\nexport type { TableBodyProps, TableCellProps, TableColumnProps, TableFooterProps, TableHeaderProps, TableLoadMoreProps, TableProps, TableRowProps };\nexport { TableBody, TableCell, TableColumn, TableFooter, TableHeader, TableLoadMore, TableRow };\nexport default Table;"],"mappings":";;;;;;;;;;;;;;AAuGA,MAAMoE,wBAAwBzC,cAAkC0C,KAAAA,CAAS;AACzE,MAAMC,qBAAqB3C,cAAkC0C,KAAAA,CAAS;AACtE,MAAME,SAAS;CACbC,MAAM;EACJC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,OAAO;EACLC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRL,OAAO;CACT;CACAM,QAAQ;EACNC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRf,OAAO;CACT;CACAgB,eAAe;EACbC,QAAQ;EACRjB,OAAO;CACT;CACAkB,eAAe;EACbD,QAAQ;EACRjB,OAAO;CACT;CACAmB,gBAAgB;EACdF,QAAQ;EACRG,QAAQ;EACRpB,OAAO;CACT;CACAqB,KAAK;EACHd,QAAQ;EACRe,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRxB,OAAO;CACT;CACAyB,aAAa;EACXR,QAAQ;EACRT,QAAQ;EACRY,QAAQ;EACRM,QAAQ;EACR1B,OAAO;CACT;CACA2B,aAAa;EACXV,QAAQ;EACRT,QAAQ;EACRkB,QAAQ;EACR1B,OAAO;CACT;CACA4B,WAAW;EACTC,QAAQ;EACRC,QAAQ;EACR9B,OAAO;CACT;CACA+B,QAAQ;EACNd,QAAQ;EACRe,QAAQ;EACRC,QAAQ;EACRlB,QAAQ;EACRmB,QAAQ;EACRlC,O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,KAAAC,EAAA;EAAAC,KAAAD,EAAA;CAAA;CApBVlK,gBAAgBiK,IAoBbE,EAAO;CAAC,OACJnB;AAAM;AAEfnI,QAAMoM,OAAOlM;AACbF,QAAMV,OAAOiL;AACbvK,QAAMR,SAASiL;AACfzK,QAAMqM,SAASjM;AACfJ,QAAMsM,SAAShM;AACfN,QAAMuM,WAAWtB;AACjBjL,QAAMF,MAAMoL"}
|
package/dist/hooks/useRipple.js
CHANGED
|
@@ -129,11 +129,12 @@ function useRipple(t0, t1, t2, t3) {
|
|
|
129
129
|
t9 = (target, positionEvent_0) => {
|
|
130
130
|
const ripple = rippleRef.current;
|
|
131
131
|
if (!ripple) return;
|
|
132
|
-
setPressed(true);
|
|
133
|
-
growAnimation.current?.cancel();
|
|
134
132
|
const surface = ripple.parentElement?.getBoundingClientRect();
|
|
135
133
|
const rect_1 = surface && (surface.width > 0 || surface.height > 0) ? surface : target.getBoundingClientRect();
|
|
136
134
|
const size_1 = determineRippleSize(rect_1);
|
|
135
|
+
if (initialSize.current === 0) return;
|
|
136
|
+
setPressed(true);
|
|
137
|
+
growAnimation.current?.cancel();
|
|
137
138
|
const { endPoint: endPoint_0, startPoint: startPoint_0 } = getTranslationCoordinates(rect_1, centred ? void 0 : positionEvent_0);
|
|
138
139
|
ripple.style.width = size_1;
|
|
139
140
|
ripple.style.height = size_1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRipple.js","names":["MouseEvent","MouseEventHandler","PointerEvent","PointerEventHandler","ReactNode","stylex","useCallback","useEffect","useMemo","useRef","useState","rippleStyles","motionDurationMs","motionEasing","spacingPx","PADDING","sm","INITIAL_ORIGIN_SCALE","SOFT_EDGE_MINIMUM_SIZE","SOFT_EDGE_CONTAINER_RATIO","surfaceProps","props","surface","RippleState","Holding","Inactive","TouchDelay","WaitingForClick","const","ReleaseHandlers","Element","Omit","RippleEventHandlers","HostElement","onClick","onContextMenu","onPointerCancel","onPointerDown","onPointerLeave","onPointerUp","isTouch","event","pointerType","prefersReducedMotion","window","matchMedia","matches","useRipple","enabled","externalHandlers","endsOnRelease","centred","handlers","play","t0","t1","t2","t3","$","_c","undefined","t4","pressed","setPressed","rippleRef","state","growAnimation","rippleStartEvent","initialSize","rippleScale","removeDocumentListeners","t5","Symbol","for","isPrimary","startEvent","current","pointerId","isPressPointer","t6","event_0","buttons","shouldReactToEvent","t7","rect","height","width","maxDimension","Math","max","softEdgeSize","size","floor","hypotenuse","hypot","maxRadius","determineRippleSize","t8","rect_0","positionEvent","height_0","left","top","width_0","size_0","endPoint","x","y","origin","clientX","clientY","startPoint","getTranslationCoordinates","t9","target","positionEvent_0","ripple","cancel","parentElement","getBoundingClientRect","rect_1","size_1","endPoint_0","startPoint_0","style","animate","transform","duration","long1","easing","standard","fill","startPressAnimation","t10","animation","elapsed","currentTime","Infinity","medium1","Promise","resolve","setTimeout","endPressAnimation","t11","host","document","ownerDocument","handleEnd","event_1","composedPath","includes","addEventListener","removeEventListener","listenBeyondHost","t12","t13","t14","getState","t15","event_2","target_0","currentTarget","_temp","handlePointerDownAsync","t16","event_3","handlePointerDown","t17","event_4","handlePointerUp","t18","event_5","handlePointerLeave","t19","event_6","handlePointerCancel","t20","event_7","handleClick","t21","host_0","t22","handleContextMenu","onClickProp","onContextMenuProp","onPointerCancelProp","onPointerDownProp","onPointerLeaveProp","onPointerUpProp","t23","event_8","t24","event_9","t25","event_10","t26","event_11","t27","event_12","t28","event_13","t29","pointer","t30","t31","press","t32","surface_0","t33","enabledResult","t34","disabledResult","resolve_0","short2","stylex.props","rippleStyles","_c","disabledResult"],"sources":["../../src/hooks/useRipple.tsx"],"sourcesContent":["import type { MouseEvent, MouseEventHandler, PointerEvent, PointerEventHandler, ReactNode } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { rippleStyles } from '../styles/ripple';\nimport { motionDurationMs, motionEasing, spacingPx } from '../tokens/values';\n\n// Every timing this file drives is a motion token, spent at the point of use\n// below. They come from tokens/values rather than the StyleX theme because\n// element.animate() and setTimeout both reject a token's var() form, and the\n// same is true of the one geometry token: `PADDING` is added to a radius, and\n// a var() would concatenate rather than add. See src/styles/ripple.ts for the\n// opacity half of the mechanism, whose three timings are deliberately not\n// tokens.\n\n/** How far the ripple grows past the host's corners. `spacing.sm`. */\nconst PADDING = spacingPx.sm;\n\n// The rest are ratios and a pixel floor that no token group covers — spacing\n// is layout rhythm, and nothing in the set holds bare geometric ratios.\nconst INITIAL_ORIGIN_SCALE = 0.2;\nconst SOFT_EDGE_MINIMUM_SIZE = 75;\nconst SOFT_EDGE_CONTAINER_RATIO = 0.35;\n\n// Static input, so this is computed once for every consumer of the module\n// rather than once per component instance.\nconst surfaceProps = stylex.props(rippleStyles.surface);\n\n/**\n * On touch: `Inactive -> TouchDelay -> WaitingForClick -> Inactive`, or\n * `Inactive -> TouchDelay -> Holding -> WaitingForClick -> Inactive` for a\n * held press.\n *\n * On mouse or pen: `Inactive -> WaitingForClick -> Inactive`.\n */\nconst RippleState = {\n /** A touch has been confirmed as a press (held past the touch delay). */\n Holding: 2,\n /** No press in progress. Touch down moves to TouchDelay; mouse/pen down moves to WaitingForClick. */\n Inactive: 0,\n /** Touch down received; waiting to see if it's a tap or a scroll/swipe. */\n TouchDelay: 1,\n /** The press has finished growing; waiting for the click that ends it. */\n WaitingForClick: 3\n} as const;\ntype ReleaseHandlers<HostElement extends Element> = Omit<RippleEventHandlers<HostElement>, 'onClick'>;\ninterface RippleEventHandlers<HostElement extends Element> {\n onClick?: MouseEventHandler<HostElement>;\n onContextMenu?: MouseEventHandler<HostElement>;\n onPointerCancel?: PointerEventHandler<HostElement>;\n onPointerDown?: PointerEventHandler<HostElement>;\n onPointerLeave?: PointerEventHandler<HostElement>;\n onPointerUp?: PointerEventHandler<HostElement>;\n}\ntype RippleState = (typeof RippleState)[keyof typeof RippleState];\nfunction isTouch(event: PointerEvent) {\n return event.pointerType === 'touch';\n}\n\n/**\n * Whether the reader has asked the OS for less motion.\n *\n * Growth is a Web Animations call, which makes it the one animation in the\n * library no `@media (prefers-reduced-motion: reduce)` branch can reach — see\n * src/styles/ripple.ts for the opacity half, which is CSS and carries one.\n *\n * Read at the press rather than once at mount, so a reader who changes the\n * setting is answered by their next press rather than by their next reload.\n * The press already reads layout through `getBoundingClientRect`, which costs\n * more than this does.\n */\nfunction prefersReducedMotion() {\n return window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n}\n\n/**\n * Renders a press ripple that grows from the pointer's position, or from\n * the element's center for a keyboard or other non-pointer activation.\n *\n * Growth runs via the Web Animations API on a single reused element (no\n * per-click DOM nodes to clean up), over a fixed duration independent of how\n * long the element is held — a real press-and-hold keeps the ripple\n * growing until release, while a quick tap is still held visible for a\n * minimum duration so it plays a complete animation rather than a flicker.\n *\n * Merges its own handlers with `externalHandlers` (e.g. a component's own\n * consumer-supplied props — ripple's own run first, then the external\n * ones) and returns `handlers` to spread onto the interactive element and\n * `surface`, the node to render as a child. The host element must\n * establish a positioning context (`position: relative` or similar) so\n * `surface`, which fills it via `inset: 0`, clips to its bounds and\n * inherits its shape. A host can render `surface` in a positioned part of\n * itself instead, and the ripple then grows in that part alone, from where\n * the pointer is over it: a navigation destination draws it in its\n * indicator.\n *\n * Pass `enabled: false` to opt out — no ripple listeners are attached and\n * no surface is rendered, leaving `externalHandlers` and a component's own\n * hover/press state layer (if any) untouched.\n *\n * Pass `endsOnRelease` for a host that never hears its own click: a\n * collection row, whose clicks React Aria's press handling keeps for itself.\n * The press then ends when the pointer is released over the host rather than\n * on the click that would follow, still held for the minimum a short press\n * gets. A keyboard press reaches such a host as no pointer event at all, so\n * it draws no ripple there unless the host plays one.\n *\n * `play` is that: a whole press from the middle of the surface, as a click\n * with no pointer before it plays, for a host that learns of a press some\n * other way. A checkbox calls it for a key, which reaches its input rather\n * than the label its ripple listens on.\n *\n * Pass `centred` for a host whose presses land beside its surface as well as\n * on it: a checkbox, whose label runs the width of its row. Every press then\n * grows from the middle of the surface, as a key's does. Following the\n * pointer, a press at the far end of the label grew from hundreds of pixels\n * away and reached the control only as the growth ended.\n *\n * `handlers`, `play` and `surface` are hand-memoized (not left to build-tool\n * optimization) so a consumer rendering many instances — a list of icon\n * buttons, say — can memoize around them too, and so stability doesn't\n * depend on any particular compiler being configured.\n */\n// A host ending on the release never hears a click, so nothing is taken for\n// one and none is handed back: the handlers are the pointer ones alone, which\n// is also what a collection row's type admits.\nfunction useRipple<HostElement extends Element = Element>(enabled: boolean, externalHandlers: ReleaseHandlers<HostElement>, endsOnRelease: true, centred?: boolean): {\n handlers: ReleaseHandlers<HostElement>;\n play: () => void;\n surface: ReactNode;\n};\nfunction useRipple<HostElement extends Element = Element>(enabled?: boolean, externalHandlers?: RippleEventHandlers<HostElement>, endsOnRelease?: false, centred?: boolean): {\n handlers: RippleEventHandlers<HostElement>;\n play: () => void;\n surface: ReactNode;\n};\nfunction useRipple<HostElement extends Element = Element>(enabled = true, externalHandlers: RippleEventHandlers<HostElement> = {}, endsOnRelease = false, centred = false): {\n handlers: RippleEventHandlers<HostElement>;\n play: () => void;\n surface: ReactNode;\n} {\n const [pressed, setPressed] = useState(false);\n const rippleRef = useRef<HTMLSpanElement>(null);\n const state = useRef<RippleState>(RippleState.Inactive);\n const growAnimation = useRef<Animation | undefined>(undefined);\n const rippleStartEvent = useRef<PointerEvent<HostElement> | undefined>(undefined);\n const initialSize = useRef(0);\n const rippleScale = useRef('1');\n // Removes the listeners a press keeps on its host's document, while one is\n // in flight — see `listenBeyondHost`.\n const removeDocumentListeners = useRef<(() => void) | undefined>(undefined);\n\n // Whether `event` comes from the pointer a press would follow: the primary\n // one, and the one that started the press already in flight, if any.\n const isPressPointer = useCallback((event: PointerEvent<HostElement>) => {\n if (!event.isPrimary) {\n return false;\n }\n const startEvent = rippleStartEvent.current;\n return !startEvent || startEvent.pointerId === event.pointerId;\n }, []);\n const shouldReactToEvent = useCallback((event: PointerEvent<HostElement>) => isPressPointer(event) && (isTouch(event) || event.buttons === 1), [isPressPointer]);\n const determineRippleSize = useCallback((rect: DOMRect) => {\n const {\n height,\n width\n } = rect;\n const maxDimension = Math.max(height, width);\n const softEdgeSize = Math.max(SOFT_EDGE_CONTAINER_RATIO * maxDimension, SOFT_EDGE_MINIMUM_SIZE);\n const size = Math.floor(maxDimension * INITIAL_ORIGIN_SCALE);\n const hypotenuse = Math.hypot(width, height);\n const maxRadius = hypotenuse + PADDING;\n initialSize.current = size;\n rippleScale.current = `${(maxRadius + softEdgeSize) / size}`;\n return `${size}px`;\n }, []);\n const getTranslationCoordinates = useCallback((rect: DOMRect, positionEvent?: PointerEvent<HostElement>) => {\n const {\n height,\n left,\n top,\n width\n } = rect;\n const size = initialSize.current;\n const endPoint = {\n x: (width - size) / 2,\n y: (height - size) / 2\n };\n const origin = positionEvent ? {\n x: positionEvent.clientX - left,\n y: positionEvent.clientY - top\n } : {\n x: width / 2,\n y: height / 2\n };\n const startPoint = {\n x: origin.x - size / 2,\n y: origin.y - size / 2\n };\n return {\n endPoint,\n startPoint\n };\n }, []);\n const startPressAnimation = useCallback((target: Element, positionEvent?: PointerEvent<HostElement>) => {\n const ripple = rippleRef.current;\n if (!ripple) {\n return;\n }\n setPressed(true);\n growAnimation.current?.cancel();\n\n // Read once and share: the two helpers below both only need the\n // rect, and a second `getBoundingClientRect()` call back to back with\n // the first would be a redundant layout read.\n //\n // The surface's rect rather than the host's, since the ripple is placed\n // inside the surface. The two are one box wherever the surface fills\n // the host, which is every host but one drawing the surface in a part\n // of itself. Under forced colours the surface is not drawn and has no\n // box, so the host's stands in for a ripple nobody sees.\n const surface = ripple.parentElement?.getBoundingClientRect();\n const rect = surface && (surface.width > 0 || surface.height > 0) ? surface : target.getBoundingClientRect();\n const size = determineRippleSize(rect);\n const {\n endPoint,\n startPoint\n } = getTranslationCoordinates(rect, centred ? undefined : positionEvent);\n ripple.style.width = size;\n ripple.style.height = size;\n growAnimation.current = ripple.animate({\n transform: [`translate(${startPoint.x}px, ${startPoint.y}px) scale(1)`, `translate(${endPoint.x}px, ${endPoint.y}px) scale(${rippleScale.current})`]\n }, {\n // Growth runs over a fixed duration regardless of how long the\n // press is held, so the token is spent here rather than named as a\n // constant — element.animate() is one of the two places a StyleX\n // token could not have gone.\n //\n // Zeroed rather than skipped under reduced motion, which lands the\n // disc at its full size with the growth never drawn. Skipping the\n // call outright would leave `growAnimation` unset, and the release\n // below reads its `currentTime` to decide whether the press has\n // been visible long enough — so the press would still be shown, and\n // would stop being held for its minimum.\n duration: prefersReducedMotion() ? 0 : motionDurationMs.long1,\n easing: motionEasing.standard,\n fill: 'forwards'\n });\n }, [centred, determineRippleSize, getTranslationCoordinates]);\n const endPressAnimation = useCallback(async () => {\n removeDocumentListeners.current?.();\n removeDocumentListeners.current = undefined;\n rippleStartEvent.current = undefined;\n state.current = RippleState.Inactive;\n const animation = growAnimation.current;\n const elapsed = typeof animation?.currentTime === 'number' ? animation.currentTime : Infinity;\n\n // The floor on how briefly a ripple may be visible, so a quick tap reads\n // as a deliberate ripple rather than a flicker.\n if (elapsed >= motionDurationMs.medium1) {\n setPressed(false);\n return;\n }\n await new Promise(resolve => {\n setTimeout(resolve, motionDurationMs.medium1 - elapsed);\n });\n if (growAnimation.current !== animation) {\n // A newer press started; let it own the pressed state instead.\n return;\n }\n setPressed(false);\n }, []);\n\n // A press can end somewhere other than its host. React Aria's press\n // handling releases the capture a touch takes on its pointerdown, so that a\n // finger can leave the element, and a press that turns into a scroll — or\n // a finger that slides off and lifts — then ends with a pointercancel or\n // pointerup on whatever is under it, which the host never hears. Left to\n // the host's handlers alone, the ripple held at its pressed opacity until\n // the next press on that host finished a cycle.\n //\n // So the press listens on its host's document, in the capture phase, for\n // its own pointer, the way React Aria's own press handling does. An end the\n // host does hear is left to the host's handlers, which run after these.\n const listenBeyondHost = useCallback((host: HostElement, pointerId: number) => {\n removeDocumentListeners.current?.();\n const document = host.ownerDocument;\n const handleEnd = (event: globalThis.PointerEvent) => {\n if (event.pointerId !== pointerId || event.composedPath().includes(host)) {\n return;\n }\n void endPressAnimation();\n };\n document.addEventListener('pointercancel', handleEnd, true);\n document.addEventListener('pointerup', handleEnd, true);\n removeDocumentListeners.current = () => {\n document.removeEventListener('pointercancel', handleEnd, true);\n document.removeEventListener('pointerup', handleEnd, true);\n };\n }, [endPressAnimation]);\n\n // A host unmounted mid-press leaves nothing listening behind it.\n useEffect(() => () => {\n removeDocumentListeners.current?.();\n }, []);\n\n // Reads through a function so a stale narrowing of `state.current` from\n // before the `await` below isn't (incorrectly) carried across it — the\n // ref can change via a different handler while this one is suspended.\n const getState = useCallback(() => state.current, []);\n const handlePointerDownAsync = useCallback(async (event: PointerEvent<HostElement>) => {\n if (!shouldReactToEvent(event)) {\n return;\n }\n rippleStartEvent.current = event;\n const target = event.currentTarget;\n listenBeyondHost(target, event.pointerId);\n if (!isTouch(event)) {\n state.current = RippleState.WaitingForClick;\n startPressAnimation(target, event);\n return;\n }\n\n // Delay so a scroll/swipe starting on the element doesn't flash a\n // ripple — only a held (or quickly released) touch counts as a press.\n state.current = RippleState.TouchDelay;\n await new Promise(resolve => {\n setTimeout(resolve, motionDurationMs.short2);\n });\n if (getState() !== RippleState.TouchDelay) {\n return;\n }\n state.current = RippleState.Holding;\n startPressAnimation(target, event);\n }, [getState, listenBeyondHost, shouldReactToEvent, startPressAnimation]);\n const handlePointerDown = useCallback((event: PointerEvent<HostElement>) => {\n void handlePointerDownAsync(event);\n }, [handlePointerDownAsync]);\n const handlePointerUp = useCallback((event: PointerEvent<HostElement>) => {\n // A mouse or pen release carries no pressed button, so the guard the\n // other handlers share turns it away, which is right while a click\n // follows to end the press. A host ending on the release matches it by\n // its pointer alone.\n if (endsOnRelease && !isTouch(event)) {\n if (isPressPointer(event) && state.current === RippleState.WaitingForClick) {\n void endPressAnimation();\n }\n return;\n }\n if (!shouldReactToEvent(event)) {\n return;\n }\n if (state.current === RippleState.Holding) {\n state.current = RippleState.WaitingForClick;\n } else if (state.current === RippleState.TouchDelay) {\n // Released before the delay elapsed: treat as a completed tap.\n state.current = RippleState.WaitingForClick;\n startPressAnimation(event.currentTarget, rippleStartEvent.current);\n }\n\n // The release is as far as such a host hears, so it is where the\n // press ends — see `endsOnRelease` above.\n if (endsOnRelease && state.current === RippleState.WaitingForClick) {\n void endPressAnimation();\n }\n }, [endPressAnimation, endsOnRelease, isPressPointer, shouldReactToEvent, startPressAnimation]);\n const handlePointerLeave = useCallback((event: PointerEvent<HostElement>) => {\n if (isTouch(event) || !shouldReactToEvent(event)) {\n return;\n }\n if (state.current !== RippleState.Inactive) {\n void endPressAnimation();\n }\n }, [endPressAnimation, shouldReactToEvent]);\n const handlePointerCancel = useCallback((event: PointerEvent<HostElement>) => {\n if (!shouldReactToEvent(event)) {\n return;\n }\n void endPressAnimation();\n }, [endPressAnimation, shouldReactToEvent]);\n const handleClick = useCallback((event: MouseEvent<HostElement>) => {\n if (state.current === RippleState.WaitingForClick) {\n void endPressAnimation();\n return;\n }\n if (state.current === RippleState.Inactive) {\n // No pointerdown preceded this click — keyboard activation, a\n // programmatic `.click()`, or assistive-tech-synthesized activation.\n // Play a complete, centered press immediately.\n startPressAnimation(event.currentTarget);\n void endPressAnimation();\n }\n }, [endPressAnimation, startPressAnimation]);\n\n // The element the surface is rendered in stands in for the host a click\n // would have named. With no surface rendered there is nothing to play, and\n // a press already in flight is left to the pointer that started it.\n const play = useCallback(() => {\n const host = rippleRef.current?.parentElement?.parentElement;\n if (!host || state.current !== RippleState.Inactive) {\n return;\n }\n startPressAnimation(host);\n void endPressAnimation();\n }, [endPressAnimation, startPressAnimation]);\n const handleContextMenu = useCallback(() => {\n void endPressAnimation();\n }, [endPressAnimation]);\n const {\n onClick: onClickProp,\n onContextMenu: onContextMenuProp,\n onPointerCancel: onPointerCancelProp,\n onPointerDown: onPointerDownProp,\n onPointerLeave: onPointerLeaveProp,\n onPointerUp: onPointerUpProp\n } = externalHandlers;\n const onClick = useCallback((event: MouseEvent<HostElement>) => {\n handleClick(event);\n onClickProp?.(event);\n }, [handleClick, onClickProp]);\n const onContextMenu = useCallback((event: MouseEvent<HostElement>) => {\n handleContextMenu();\n onContextMenuProp?.(event);\n }, [handleContextMenu, onContextMenuProp]);\n const onPointerCancel = useCallback((event: PointerEvent<HostElement>) => {\n handlePointerCancel(event);\n onPointerCancelProp?.(event);\n }, [handlePointerCancel, onPointerCancelProp]);\n const onPointerDown = useCallback((event: PointerEvent<HostElement>) => {\n handlePointerDown(event);\n onPointerDownProp?.(event);\n }, [handlePointerDown, onPointerDownProp]);\n const onPointerLeave = useCallback((event: PointerEvent<HostElement>) => {\n handlePointerLeave(event);\n onPointerLeaveProp?.(event);\n }, [handlePointerLeave, onPointerLeaveProp]);\n const onPointerUp = useCallback((event: PointerEvent<HostElement>) => {\n handlePointerUp(event);\n onPointerUpProp?.(event);\n }, [handlePointerUp, onPointerUpProp]);\n const handlers = useMemo(() => {\n const pointer = {\n onContextMenu,\n onPointerCancel,\n onPointerDown,\n onPointerLeave,\n onPointerUp\n };\n return endsOnRelease ? pointer : {\n onClick,\n ...pointer\n };\n }, [endsOnRelease, onClick, onContextMenu, onPointerCancel, onPointerDown, onPointerLeave, onPointerUp]);\n const surface = useMemo(() => <span aria-hidden=\"true\" {...surfaceProps}>\n <span ref={rippleRef} {...stylex.props(rippleStyles.press, pressed && rippleStyles.pressed)} />\n </span>, [pressed]);\n\n // Two separate memos rather than one branching on `enabled`, so that\n // whichever branch is actually active stays keyed only on its own\n // inputs — the enabled result doesn't get a new identity every time\n // `externalHandlers` does (a component typically passes a fresh object\n // literal each render), and vice versa.\n const enabledResult = useMemo(() => ({\n handlers,\n play,\n surface\n }), [handlers, play, surface]);\n const disabledResult = useMemo(() => ({\n handlers: externalHandlers,\n play,\n surface: null\n }), [externalHandlers, play]);\n return enabled ? enabledResult : disabledResult;\n}\nexport { useRipple };"],"mappings":";;;;;;;;AAeA,MAAMe,UAAUD,UAAUE;AAI1B,MAAMC,uBAAuB;AAC7B,MAAMC,yBAAyB;AAC/B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GnCA;EACF;EAACoC,EAAA,MAAAN;EAAAM,EAAA,MAAAL;EAAAK,EAAA,MAAAqJ;EAAArJ,EAAA,MAAAsJ;CAAA,OAAAA,MAAAtJ,EAAA;CAJD,MAAAuJ,gBAAqCD;CAIN,IAAAE;CAAA,IAAAxJ,EAAA,QAAAT,oBAAAS,EAAA,QAAAL,MAAA;EACO6J,MAAA;GAAA9J,UAC1BH;GAAgBI;GAAA/B,SAEjB;EACX;EAACoC,EAAA,MAAAT;EAAAS,EAAA,MAAAL;EAAAK,EAAA,MAAAwJ;CAAA,OAAAA,MAAAxJ,EAAA;CAA6B,OACvBV,UAAAiK,gBAAAE;AAAwC;AAhVjD,SAAAjD,MAAAkD,WAAA;CA+LMvE,WAAWD,WAAShI,iBAAgByM,MAAO;AAAC"}
|
|
1
|
+
{"version":3,"file":"useRipple.js","names":["MouseEvent","MouseEventHandler","PointerEvent","PointerEventHandler","ReactNode","stylex","useCallback","useEffect","useMemo","useRef","useState","rippleStyles","motionDurationMs","motionEasing","spacingPx","PADDING","sm","INITIAL_ORIGIN_SCALE","SOFT_EDGE_MINIMUM_SIZE","SOFT_EDGE_CONTAINER_RATIO","surfaceProps","props","surface","RippleState","Holding","Inactive","TouchDelay","WaitingForClick","const","ReleaseHandlers","Element","Omit","RippleEventHandlers","HostElement","onClick","onContextMenu","onPointerCancel","onPointerDown","onPointerLeave","onPointerUp","isTouch","event","pointerType","prefersReducedMotion","window","matchMedia","matches","useRipple","enabled","externalHandlers","endsOnRelease","centred","handlers","play","t0","t1","t2","t3","$","_c","undefined","t4","pressed","setPressed","rippleRef","state","growAnimation","rippleStartEvent","initialSize","rippleScale","removeDocumentListeners","t5","Symbol","for","isPrimary","startEvent","current","pointerId","isPressPointer","t6","event_0","buttons","shouldReactToEvent","t7","rect","height","width","maxDimension","Math","max","softEdgeSize","size","floor","hypotenuse","hypot","maxRadius","determineRippleSize","t8","rect_0","positionEvent","height_0","left","top","width_0","size_0","endPoint","x","y","origin","clientX","clientY","startPoint","getTranslationCoordinates","t9","target","positionEvent_0","ripple","parentElement","getBoundingClientRect","rect_1","size_1","cancel","endPoint_0","startPoint_0","style","animate","transform","duration","long1","easing","standard","fill","startPressAnimation","t10","animation","elapsed","currentTime","Infinity","medium1","Promise","resolve","setTimeout","endPressAnimation","t11","host","document","ownerDocument","handleEnd","event_1","composedPath","includes","addEventListener","removeEventListener","listenBeyondHost","t12","t13","t14","getState","t15","event_2","target_0","currentTarget","_temp","handlePointerDownAsync","t16","event_3","handlePointerDown","t17","event_4","handlePointerUp","t18","event_5","handlePointerLeave","t19","event_6","handlePointerCancel","t20","event_7","handleClick","t21","host_0","t22","handleContextMenu","onClickProp","onContextMenuProp","onPointerCancelProp","onPointerDownProp","onPointerLeaveProp","onPointerUpProp","t23","event_8","t24","event_9","t25","event_10","t26","event_11","t27","event_12","t28","event_13","t29","pointer","t30","t31","press","t32","surface_0","t33","enabledResult","t34","disabledResult","resolve_0","short2","stylex.props","rippleStyles","_c","disabledResult"],"sources":["../../src/hooks/useRipple.tsx"],"sourcesContent":["import type { MouseEvent, MouseEventHandler, PointerEvent, PointerEventHandler, ReactNode } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { rippleStyles } from '../styles/ripple';\nimport { motionDurationMs, motionEasing, spacingPx } from '../tokens/values';\n\n// Every timing this file drives is a motion token, spent at the point of use\n// below. They come from tokens/values rather than the StyleX theme because\n// element.animate() and setTimeout both reject a token's var() form, and the\n// same is true of the one geometry token: `PADDING` is added to a radius, and\n// a var() would concatenate rather than add. See src/styles/ripple.ts for the\n// opacity half of the mechanism, whose three timings are deliberately not\n// tokens.\n\n/** How far the ripple grows past the host's corners. `spacing.sm`. */\nconst PADDING = spacingPx.sm;\n\n// The rest are ratios and a pixel floor that no token group covers — spacing\n// is layout rhythm, and nothing in the set holds bare geometric ratios.\nconst INITIAL_ORIGIN_SCALE = 0.2;\nconst SOFT_EDGE_MINIMUM_SIZE = 75;\nconst SOFT_EDGE_CONTAINER_RATIO = 0.35;\n\n// Static input, so this is computed once for every consumer of the module\n// rather than once per component instance.\nconst surfaceProps = stylex.props(rippleStyles.surface);\n\n/**\n * On touch: `Inactive -> TouchDelay -> WaitingForClick -> Inactive`, or\n * `Inactive -> TouchDelay -> Holding -> WaitingForClick -> Inactive` for a\n * held press.\n *\n * On mouse or pen: `Inactive -> WaitingForClick -> Inactive`.\n */\nconst RippleState = {\n /** A touch has been confirmed as a press (held past the touch delay). */\n Holding: 2,\n /** No press in progress. Touch down moves to TouchDelay; mouse/pen down moves to WaitingForClick. */\n Inactive: 0,\n /** Touch down received; waiting to see if it's a tap or a scroll/swipe. */\n TouchDelay: 1,\n /** The press has finished growing; waiting for the click that ends it. */\n WaitingForClick: 3\n} as const;\ntype ReleaseHandlers<HostElement extends Element> = Omit<RippleEventHandlers<HostElement>, 'onClick'>;\ninterface RippleEventHandlers<HostElement extends Element> {\n onClick?: MouseEventHandler<HostElement>;\n onContextMenu?: MouseEventHandler<HostElement>;\n onPointerCancel?: PointerEventHandler<HostElement>;\n onPointerDown?: PointerEventHandler<HostElement>;\n onPointerLeave?: PointerEventHandler<HostElement>;\n onPointerUp?: PointerEventHandler<HostElement>;\n}\ntype RippleState = (typeof RippleState)[keyof typeof RippleState];\nfunction isTouch(event: PointerEvent) {\n return event.pointerType === 'touch';\n}\n\n/**\n * Whether the reader has asked the OS for less motion.\n *\n * Growth is a Web Animations call, which makes it the one animation in the\n * library no `@media (prefers-reduced-motion: reduce)` branch can reach — see\n * src/styles/ripple.ts for the opacity half, which is CSS and carries one.\n *\n * Read at the press rather than once at mount, so a reader who changes the\n * setting is answered by their next press rather than by their next reload.\n * The press already reads layout through `getBoundingClientRect`, which costs\n * more than this does.\n */\nfunction prefersReducedMotion() {\n return window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n}\n\n/**\n * Renders a press ripple that grows from the pointer's position, or from\n * the element's center for a keyboard or other non-pointer activation.\n *\n * Growth runs via the Web Animations API on a single reused element (no\n * per-click DOM nodes to clean up), over a fixed duration independent of how\n * long the element is held — a real press-and-hold keeps the ripple\n * growing until release, while a quick tap is still held visible for a\n * minimum duration so it plays a complete animation rather than a flicker.\n *\n * Merges its own handlers with `externalHandlers` (e.g. a component's own\n * consumer-supplied props — ripple's own run first, then the external\n * ones) and returns `handlers` to spread onto the interactive element and\n * `surface`, the node to render as a child. The host element must\n * establish a positioning context (`position: relative` or similar) so\n * `surface`, which fills it via `inset: 0`, clips to its bounds and\n * inherits its shape. A host can render `surface` in a positioned part of\n * itself instead, and the ripple then grows in that part alone, from where\n * the pointer is over it: a navigation destination draws it in its\n * indicator.\n *\n * Pass `enabled: false` to opt out — no ripple listeners are attached and\n * no surface is rendered, leaving `externalHandlers` and a component's own\n * hover/press state layer (if any) untouched.\n *\n * Pass `endsOnRelease` for a host that never hears its own click: a\n * collection row, whose clicks React Aria's press handling keeps for itself.\n * The press then ends when the pointer is released over the host rather than\n * on the click that would follow, still held for the minimum a short press\n * gets. A keyboard press reaches such a host as no pointer event at all, so\n * it draws no ripple there unless the host plays one.\n *\n * `play` is that: a whole press from the middle of the surface, as a click\n * with no pointer before it plays, for a host that learns of a press some\n * other way. A checkbox calls it for a key, which reaches its input rather\n * than the label its ripple listens on.\n *\n * Pass `centred` for a host whose presses land beside its surface as well as\n * on it: a checkbox, whose label runs the width of its row. Every press then\n * grows from the middle of the surface, as a key's does. Following the\n * pointer, a press at the far end of the label grew from hundreds of pixels\n * away and reached the control only as the growth ended.\n *\n * `handlers`, `play` and `surface` are hand-memoized (not left to build-tool\n * optimization) so a consumer rendering many instances — a list of icon\n * buttons, say — can memoize around them too, and so stability doesn't\n * depend on any particular compiler being configured.\n */\n// A host ending on the release never hears a click, so nothing is taken for\n// one and none is handed back: the handlers are the pointer ones alone, which\n// is also what a collection row's type admits.\nfunction useRipple<HostElement extends Element = Element>(enabled: boolean, externalHandlers: ReleaseHandlers<HostElement>, endsOnRelease: true, centred?: boolean): {\n handlers: ReleaseHandlers<HostElement>;\n play: () => void;\n surface: ReactNode;\n};\nfunction useRipple<HostElement extends Element = Element>(enabled?: boolean, externalHandlers?: RippleEventHandlers<HostElement>, endsOnRelease?: false, centred?: boolean): {\n handlers: RippleEventHandlers<HostElement>;\n play: () => void;\n surface: ReactNode;\n};\nfunction useRipple<HostElement extends Element = Element>(enabled = true, externalHandlers: RippleEventHandlers<HostElement> = {}, endsOnRelease = false, centred = false): {\n handlers: RippleEventHandlers<HostElement>;\n play: () => void;\n surface: ReactNode;\n} {\n const [pressed, setPressed] = useState(false);\n const rippleRef = useRef<HTMLSpanElement>(null);\n const state = useRef<RippleState>(RippleState.Inactive);\n const growAnimation = useRef<Animation | undefined>(undefined);\n const rippleStartEvent = useRef<PointerEvent<HostElement> | undefined>(undefined);\n const initialSize = useRef(0);\n const rippleScale = useRef('1');\n // Removes the listeners a press keeps on its host's document, while one is\n // in flight — see `listenBeyondHost`.\n const removeDocumentListeners = useRef<(() => void) | undefined>(undefined);\n\n // Whether `event` comes from the pointer a press would follow: the primary\n // one, and the one that started the press already in flight, if any.\n const isPressPointer = useCallback((event: PointerEvent<HostElement>) => {\n if (!event.isPrimary) {\n return false;\n }\n const startEvent = rippleStartEvent.current;\n return !startEvent || startEvent.pointerId === event.pointerId;\n }, []);\n const shouldReactToEvent = useCallback((event: PointerEvent<HostElement>) => isPressPointer(event) && (isTouch(event) || event.buttons === 1), [isPressPointer]);\n const determineRippleSize = useCallback((rect: DOMRect) => {\n const {\n height,\n width\n } = rect;\n const maxDimension = Math.max(height, width);\n const softEdgeSize = Math.max(SOFT_EDGE_CONTAINER_RATIO * maxDimension, SOFT_EDGE_MINIMUM_SIZE);\n const size = Math.floor(maxDimension * INITIAL_ORIGIN_SCALE);\n const hypotenuse = Math.hypot(width, height);\n const maxRadius = hypotenuse + PADDING;\n initialSize.current = size;\n rippleScale.current = `${(maxRadius + softEdgeSize) / size}`;\n return `${size}px`;\n }, []);\n const getTranslationCoordinates = useCallback((rect: DOMRect, positionEvent?: PointerEvent<HostElement>) => {\n const {\n height,\n left,\n top,\n width\n } = rect;\n const size = initialSize.current;\n const endPoint = {\n x: (width - size) / 2,\n y: (height - size) / 2\n };\n const origin = positionEvent ? {\n x: positionEvent.clientX - left,\n y: positionEvent.clientY - top\n } : {\n x: width / 2,\n y: height / 2\n };\n const startPoint = {\n x: origin.x - size / 2,\n y: origin.y - size / 2\n };\n return {\n endPoint,\n startPoint\n };\n }, []);\n const startPressAnimation = useCallback((target: Element, positionEvent?: PointerEvent<HostElement>) => {\n const ripple = rippleRef.current;\n if (!ripple) {\n return;\n }\n\n // Read once and share: the two helpers below both only need the\n // rect, and a second `getBoundingClientRect()` call back to back with\n // the first would be a redundant layout read.\n //\n // The surface's rect rather than the host's, since the ripple is placed\n // inside the surface. The two are one box wherever the surface fills\n // the host, which is every host but one drawing the surface in a part\n // of itself. Under forced colours the surface is not drawn and has no\n // box, so the host's stands in for a ripple nobody sees.\n const surface = ripple.parentElement?.getBoundingClientRect();\n const rect = surface && (surface.width > 0 || surface.height > 0) ? surface : target.getBoundingClientRect();\n const size = determineRippleSize(rect);\n // A host with no box has nowhere to draw: one hidden while it is\n // pressed, or a row whose press hides the pane it sits in, which is\n // gone before the click that plays the keyboard's ripple arrives.\n // The disc would start at 0px, and the scale it grows by divides by\n // that, which came out as `scale(Infinity)` — a keyframe the browser\n // rejects with a warning.\n if (initialSize.current === 0) {\n return;\n }\n setPressed(true);\n growAnimation.current?.cancel();\n const {\n endPoint,\n startPoint\n } = getTranslationCoordinates(rect, centred ? undefined : positionEvent);\n ripple.style.width = size;\n ripple.style.height = size;\n growAnimation.current = ripple.animate({\n transform: [`translate(${startPoint.x}px, ${startPoint.y}px) scale(1)`, `translate(${endPoint.x}px, ${endPoint.y}px) scale(${rippleScale.current})`]\n }, {\n // Growth runs over a fixed duration regardless of how long the\n // press is held, so the token is spent here rather than named as a\n // constant — element.animate() is one of the two places a StyleX\n // token could not have gone.\n //\n // Zeroed rather than skipped under reduced motion, which lands the\n // disc at its full size with the growth never drawn. Skipping the\n // call outright would leave `growAnimation` unset, and the release\n // below reads its `currentTime` to decide whether the press has\n // been visible long enough — so the press would still be shown, and\n // would stop being held for its minimum.\n duration: prefersReducedMotion() ? 0 : motionDurationMs.long1,\n easing: motionEasing.standard,\n fill: 'forwards'\n });\n }, [centred, determineRippleSize, getTranslationCoordinates]);\n const endPressAnimation = useCallback(async () => {\n removeDocumentListeners.current?.();\n removeDocumentListeners.current = undefined;\n rippleStartEvent.current = undefined;\n state.current = RippleState.Inactive;\n const animation = growAnimation.current;\n const elapsed = typeof animation?.currentTime === 'number' ? animation.currentTime : Infinity;\n\n // The floor on how briefly a ripple may be visible, so a quick tap reads\n // as a deliberate ripple rather than a flicker.\n if (elapsed >= motionDurationMs.medium1) {\n setPressed(false);\n return;\n }\n await new Promise(resolve => {\n setTimeout(resolve, motionDurationMs.medium1 - elapsed);\n });\n if (growAnimation.current !== animation) {\n // A newer press started; let it own the pressed state instead.\n return;\n }\n setPressed(false);\n }, []);\n\n // A press can end somewhere other than its host. React Aria's press\n // handling releases the capture a touch takes on its pointerdown, so that a\n // finger can leave the element, and a press that turns into a scroll — or\n // a finger that slides off and lifts — then ends with a pointercancel or\n // pointerup on whatever is under it, which the host never hears. Left to\n // the host's handlers alone, the ripple held at its pressed opacity until\n // the next press on that host finished a cycle.\n //\n // So the press listens on its host's document, in the capture phase, for\n // its own pointer, the way React Aria's own press handling does. An end the\n // host does hear is left to the host's handlers, which run after these.\n const listenBeyondHost = useCallback((host: HostElement, pointerId: number) => {\n removeDocumentListeners.current?.();\n const document = host.ownerDocument;\n const handleEnd = (event: globalThis.PointerEvent) => {\n if (event.pointerId !== pointerId || event.composedPath().includes(host)) {\n return;\n }\n void endPressAnimation();\n };\n document.addEventListener('pointercancel', handleEnd, true);\n document.addEventListener('pointerup', handleEnd, true);\n removeDocumentListeners.current = () => {\n document.removeEventListener('pointercancel', handleEnd, true);\n document.removeEventListener('pointerup', handleEnd, true);\n };\n }, [endPressAnimation]);\n\n // A host unmounted mid-press leaves nothing listening behind it.\n useEffect(() => () => {\n removeDocumentListeners.current?.();\n }, []);\n\n // Reads through a function so a stale narrowing of `state.current` from\n // before the `await` below isn't (incorrectly) carried across it — the\n // ref can change via a different handler while this one is suspended.\n const getState = useCallback(() => state.current, []);\n const handlePointerDownAsync = useCallback(async (event: PointerEvent<HostElement>) => {\n if (!shouldReactToEvent(event)) {\n return;\n }\n rippleStartEvent.current = event;\n const target = event.currentTarget;\n listenBeyondHost(target, event.pointerId);\n if (!isTouch(event)) {\n state.current = RippleState.WaitingForClick;\n startPressAnimation(target, event);\n return;\n }\n\n // Delay so a scroll/swipe starting on the element doesn't flash a\n // ripple — only a held (or quickly released) touch counts as a press.\n state.current = RippleState.TouchDelay;\n await new Promise(resolve => {\n setTimeout(resolve, motionDurationMs.short2);\n });\n if (getState() !== RippleState.TouchDelay) {\n return;\n }\n state.current = RippleState.Holding;\n startPressAnimation(target, event);\n }, [getState, listenBeyondHost, shouldReactToEvent, startPressAnimation]);\n const handlePointerDown = useCallback((event: PointerEvent<HostElement>) => {\n void handlePointerDownAsync(event);\n }, [handlePointerDownAsync]);\n const handlePointerUp = useCallback((event: PointerEvent<HostElement>) => {\n // A mouse or pen release carries no pressed button, so the guard the\n // other handlers share turns it away, which is right while a click\n // follows to end the press. A host ending on the release matches it by\n // its pointer alone.\n if (endsOnRelease && !isTouch(event)) {\n if (isPressPointer(event) && state.current === RippleState.WaitingForClick) {\n void endPressAnimation();\n }\n return;\n }\n if (!shouldReactToEvent(event)) {\n return;\n }\n if (state.current === RippleState.Holding) {\n state.current = RippleState.WaitingForClick;\n } else if (state.current === RippleState.TouchDelay) {\n // Released before the delay elapsed: treat as a completed tap.\n state.current = RippleState.WaitingForClick;\n startPressAnimation(event.currentTarget, rippleStartEvent.current);\n }\n\n // The release is as far as such a host hears, so it is where the\n // press ends — see `endsOnRelease` above.\n if (endsOnRelease && state.current === RippleState.WaitingForClick) {\n void endPressAnimation();\n }\n }, [endPressAnimation, endsOnRelease, isPressPointer, shouldReactToEvent, startPressAnimation]);\n const handlePointerLeave = useCallback((event: PointerEvent<HostElement>) => {\n if (isTouch(event) || !shouldReactToEvent(event)) {\n return;\n }\n if (state.current !== RippleState.Inactive) {\n void endPressAnimation();\n }\n }, [endPressAnimation, shouldReactToEvent]);\n const handlePointerCancel = useCallback((event: PointerEvent<HostElement>) => {\n if (!shouldReactToEvent(event)) {\n return;\n }\n void endPressAnimation();\n }, [endPressAnimation, shouldReactToEvent]);\n const handleClick = useCallback((event: MouseEvent<HostElement>) => {\n if (state.current === RippleState.WaitingForClick) {\n void endPressAnimation();\n return;\n }\n if (state.current === RippleState.Inactive) {\n // No pointerdown preceded this click — keyboard activation, a\n // programmatic `.click()`, or assistive-tech-synthesized activation.\n // Play a complete, centered press immediately.\n startPressAnimation(event.currentTarget);\n void endPressAnimation();\n }\n }, [endPressAnimation, startPressAnimation]);\n\n // The element the surface is rendered in stands in for the host a click\n // would have named. With no surface rendered there is nothing to play, and\n // a press already in flight is left to the pointer that started it.\n const play = useCallback(() => {\n const host = rippleRef.current?.parentElement?.parentElement;\n if (!host || state.current !== RippleState.Inactive) {\n return;\n }\n startPressAnimation(host);\n void endPressAnimation();\n }, [endPressAnimation, startPressAnimation]);\n const handleContextMenu = useCallback(() => {\n void endPressAnimation();\n }, [endPressAnimation]);\n const {\n onClick: onClickProp,\n onContextMenu: onContextMenuProp,\n onPointerCancel: onPointerCancelProp,\n onPointerDown: onPointerDownProp,\n onPointerLeave: onPointerLeaveProp,\n onPointerUp: onPointerUpProp\n } = externalHandlers;\n const onClick = useCallback((event: MouseEvent<HostElement>) => {\n handleClick(event);\n onClickProp?.(event);\n }, [handleClick, onClickProp]);\n const onContextMenu = useCallback((event: MouseEvent<HostElement>) => {\n handleContextMenu();\n onContextMenuProp?.(event);\n }, [handleContextMenu, onContextMenuProp]);\n const onPointerCancel = useCallback((event: PointerEvent<HostElement>) => {\n handlePointerCancel(event);\n onPointerCancelProp?.(event);\n }, [handlePointerCancel, onPointerCancelProp]);\n const onPointerDown = useCallback((event: PointerEvent<HostElement>) => {\n handlePointerDown(event);\n onPointerDownProp?.(event);\n }, [handlePointerDown, onPointerDownProp]);\n const onPointerLeave = useCallback((event: PointerEvent<HostElement>) => {\n handlePointerLeave(event);\n onPointerLeaveProp?.(event);\n }, [handlePointerLeave, onPointerLeaveProp]);\n const onPointerUp = useCallback((event: PointerEvent<HostElement>) => {\n handlePointerUp(event);\n onPointerUpProp?.(event);\n }, [handlePointerUp, onPointerUpProp]);\n const handlers = useMemo(() => {\n const pointer = {\n onContextMenu,\n onPointerCancel,\n onPointerDown,\n onPointerLeave,\n onPointerUp\n };\n return endsOnRelease ? pointer : {\n onClick,\n ...pointer\n };\n }, [endsOnRelease, onClick, onContextMenu, onPointerCancel, onPointerDown, onPointerLeave, onPointerUp]);\n const surface = useMemo(() => <span aria-hidden=\"true\" {...surfaceProps}>\n <span ref={rippleRef} {...stylex.props(rippleStyles.press, pressed && rippleStyles.pressed)} />\n </span>, [pressed]);\n\n // Two separate memos rather than one branching on `enabled`, so that\n // whichever branch is actually active stays keyed only on its own\n // inputs — the enabled result doesn't get a new identity every time\n // `externalHandlers` does (a component typically passes a fresh object\n // literal each render), and vice versa.\n const enabledResult = useMemo(() => ({\n handlers,\n play,\n surface\n }), [handlers, play, surface]);\n const disabledResult = useMemo(() => ({\n handlers: externalHandlers,\n play,\n surface: null\n }), [externalHandlers, play]);\n return enabled ? enabledResult : disabledResult;\n}\nexport { useRipple };"],"mappings":";;;;;;;;AAeA,MAAMe,UAAUD,UAAUE;AAI1B,MAAMC,uBAAuB;AAC7B,MAAMC,yBAAyB;AAC/B,MAAMC,4BAA4B;AAIlC,MAAMC,eAAef,MAAaM,OAAaW,OAAO;;;;;;;;AAStD,MAAMC,cAAc;;CAElBC,SAAS;;CAETC,UAAU;;CAEVC,YAAY;;CAEZC,iBAAiB;AACnB;AAWA,SAASa,QAAQC,OAAqB;CAC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,gBAAqCD;CAIN,IAAAE;CAAA,IAAAxJ,EAAA,QAAAT,oBAAAS,EAAA,QAAAL,MAAA;EACO6J,MAAA;GAAA9J,UAC1BH;GAAgBI;GAAA/B,SAEjB;EACX;EAACoC,EAAA,MAAAT;EAAAS,EAAA,MAAAL;EAAAK,EAAA,MAAAwJ;CAAA,OAAAA,MAAAxJ,EAAA;CAA6B,OACvBV,UAAAiK,gBAAAE;AAAwC;AAzVjD,SAAAjD,MAAAkD,WAAA;CAwMMvE,WAAWD,WAAShI,iBAAgByM,MAAO;AAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ import ButtonGroup, { ButtonGroupProps, ButtonGroupVariant } from "./components/
|
|
|
11
11
|
import Calendar, { CalendarProps } from "./components/calendar/index.js";
|
|
12
12
|
import Card, { CardProps, CardVariant } from "./components/card/index.js";
|
|
13
13
|
import { CarouselLayout } from "./carousel/arrangement.js";
|
|
14
|
-
import Carousel, { CarouselItem, CarouselItemProps, CarouselProps } from "./components/carousel/index.js";
|
|
14
|
+
import Carousel, { CarouselItem, CarouselItemProps, CarouselItemRenderProps, CarouselProps } from "./components/carousel/index.js";
|
|
15
15
|
import Checkbox, { CheckboxProps } from "./components/checkbox/index.js";
|
|
16
16
|
import CheckboxGroup, { CheckboxGroupProps } from "./components/checkbox-group/index.js";
|
|
17
17
|
import Chip, { ChipActionProps, ChipFilterProps, ChipProps, ChipVariant } from "./components/chip/index.js";
|
|
@@ -89,4 +89,4 @@ import { useDragAndDrop } from "./drag/hooks.js";
|
|
|
89
89
|
import { Collection, DIRECTORY_DRAG_TYPE, Focusable, FocusableElement, GridLayout, HoverEvent, I18nProvider, Key, KeyboardEvent, ListLayout, PressEvent, Pressable, RouterProvider, Selection, SharedElement, SharedElementTransition, SortDescriptor, TableLayout, TokenFieldValue, Virtualizer, VisuallyHidden, WaterfallLayout, getColorChannels, isDirectoryDropItem, isFileDropItem, isTextDropItem, parseColor, useAsyncList, useDrag, useDrop, useFilter, useListData, useLocale, useTreeData } from "./react-aria.js";
|
|
90
90
|
import { t as KuiTheme } from "./kanso-ui-core/defaults-DMH0HWCw.js";
|
|
91
91
|
import { ThemeScope, ThemeScopeProps } from "./theme-scope.js";
|
|
92
|
-
export { AppBar, type AppBarProps, type AppBarScroll, type AppBarScrollOptions, Autocomplete, type AutocompleteFilter, type AutocompleteProps, Avatar, type AvatarProps, Badge, type BadgeProps, Breadcrumbs, BreadcrumbsItem, type BreadcrumbsItemProps, type BreadcrumbsProps, Button, ButtonGroup, type ButtonGroupProps, type ButtonGroupVariant, type ButtonProps, type ButtonShape, type ButtonSize, type ButtonVariant, Calendar, type CalendarProps, Card, type CardProps, type CardVariant, Carousel, CarouselItem, type CarouselItemProps, type CarouselLayout, type CarouselProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, Chip, type ChipActionProps, type ChipFilterProps, ChipGroup, ChipGroupChip, type ChipGroupChipProps, type ChipGroupProps, type ChipProps, type ChipVariant, Code, type CodeProps, Collection, ColorArea, type ColorAreaProps, ColorField, type ColorFieldProps, ColorPicker, type ColorPickerProps, ColorSlider, type ColorSliderProps, ColorSwatch, ColorSwatchPicker, ColorSwatchPickerItem, type ColorSwatchPickerItemProps, type ColorSwatchPickerProps, type ColorSwatchProps, ColorWheel, type ColorWheelProps, ComboBox, type ComboBoxProps, type ComboBoxSelectionMode, Container, type ContainerProps, CopyField, type CopyFieldProps, Currency, type CurrencyDisplay, type CurrencyNotation, type CurrencyProps, type CurrencySignDisplay, type CurrencyTone, DIRECTORY_DRAG_TYPE, DateField, type DateFieldProps, DatePicker, type DatePickerProps, DateRangePicker, type DateRangePickerProps, Dialog, DialogBody, DialogContent, type DialogContentProps, DialogFooter, DialogHeader, type DialogProps, DialogTitle, type DialogTitleProps, Disclosure, DisclosureGroup, type DisclosureGroupProps, DisclosureHeader, type DisclosureHeaderProps, DisclosurePanel, type DisclosurePanelProps, type DisclosureProps, DropZone, type DropZoneProps, Fab, FabMenu, FabMenuItem, type FabMenuItemProps, type FabMenuProps, type FabProps, type FabSize, type FabTone, type FabVariant, Feed, type FeedProps, type FieldVariant, FileTrigger, type FileTriggerProps, Focusable, type FocusableElement, Form, type FormProps, GridLayout, type HoverEvent, I18nProvider, IconButton, type IconButtonProps, type IconButtonSize, type IconButtonVariant, type Key, type KeyboardEvent, Keycap, type KeycapProps, type KuiTheme, Link, type LinkProps, type LinkTone, type LinkUnderline, List, ListBox, ListBoxItem, type ListBoxItemProps, ListBoxLoadMore, type ListBoxLoadMoreProps, type ListBoxProps, ListBoxSection, type ListBoxSectionProps, ListDetail, type ListDetailProps, ListItem, type ListItemProps, ListLayout, ListLoadMore, type ListLoadMoreProps, type ListProps, ListRow, type ListRowProps, ListSection, type ListSectionProps, LoadingIndicator, type LoadingIndicatorProps, Menu, type MenuAlign, MenuContent, type MenuContentProps, MenuItem, type MenuItemProps, MenuLoadMore, type MenuLoadMoreProps, type MenuProps, MenuSection, type MenuSectionProps, MenuSeparator, type MenuSeparatorProps, type MenuSide, MenuSubmenu, type MenuSubmenuProps, Meter, type MeterProps, type MeterTone, NavigationBar, NavigationBarItem, type NavigationItemProps as NavigationBarItemProps, type NavigationBarProps, NavigationRail, NavigationRailItem, type NavigationItemProps as NavigationRailItemProps, type NavigationRailProps, NavigationTree, NavigationTreeItem, type NavigationTreeItemProps, type NavigationTreeProps, NavigationTreeSection, type NavigationTreeSectionProps, NumberField, type NumberFieldProps, Popover, type PopoverAlign, PopoverContent, type PopoverContentProps, PopoverDescription, type PopoverDescriptionProps, type PopoverProps, type PopoverSide, type PopoverSize, PopoverTitle, type PopoverTitleProps, type PopoverTrigger, type PressEvent, Pressable, ProductIcon, type ProductIconProps, ProgressIndicator, type ProgressIndicatorProps, type ProgressIndicatorShape, type ProgressIndicatorTone, type ProgressIndicatorVariant, Radio, RadioGroup, type RadioGroupProps, type RadioProps, RangeCalendar, type RangeCalendarProps, RouterProvider, SearchField, type SearchFieldProps, SearchView, SearchViewContent, type SearchViewContentProps, type SearchViewProps, SegmentedButton, type SegmentedButtonProps, SegmentedButtonSegment, type SegmentedButtonSegmentProps, Select, type SelectProps, type Selection, Separator, type SeparatorInset, type SeparatorProps, SharedElement, SharedElementTransition, Sheet, SheetBody, SheetContent, type SheetContentProps, SheetFooter, SheetHandle, SheetHeader, type SheetProps, SheetTitle, type SheetTitleProps, Slider, type SliderProps, type SliderSize, Snackbar, type SnackbarAction, type SnackbarMessage, type SnackbarOptions, type SnackbarProps, type SnackbarQueue, type ToastRegionRenderProps as SnackbarRegionRenderProps, type SortDescriptor, SplitButton, SplitButtonAction, type SplitButtonActionProps, SplitButtonMenu, type SplitButtonMenuProps, type SplitButtonProps, type SplitButtonVariant, Stack, type StackAlign, type StackGap, type StackJustify, type StackProps, SupportingPane, type SupportingPaneProps, Switch, type SwitchProps, Table, TableBody, type TableBodyProps, TableCell, type TableCellProps, TableColumn, type TableColumnProps, TableFooter, type TableFooterProps, TableHeader, type TableHeaderProps, TableLayout, TableLoadMore, type TableLoadMoreProps, type TableProps, TableRow, type TableRowProps, Tabs, type TabsLayout, TabsList, type TabsListProps, TabsPanel, type TabsPanelProps, TabsPanels, type TabsPanelsProps, type TabsProps, TabsTab, type TabsTabProps, type TabsVariant, Tag, type TagProps, type TagTone, type TagVariant, Text, TextArea, type TextAreaProps, TextField, type TextFieldProps, type TextProps, ThemeScope, type ThemeScopeProps, TimeField, type TimeFieldProps, TimePicker, type TimePickerMode, type TimePickerProps, TokenField, type TokenFieldProps, TokenFieldValue, type TokenSegment, Toolbar, type ToolbarProps, type ToolbarTone, Tooltip, type TooltipAlign, type TooltipProps, type TooltipSide, Tree, TreeItem, type TreeItemProps, TreeLoadMore, type TreeLoadMoreProps, type TreeProps, TreeSection, type TreeSectionProps, Virtualizer, VisuallyHidden, WaterfallLayout, collectionSizes, colorScheme, getColorChannels, isDirectoryDropItem, isFileDropItem, isTextDropItem, parseColor, themeScope, useAppBarScroll, useAsyncList, useDrag, useDragAndDrop, useDrop, useFilter, useListData, useLocale, useTreeData };
|
|
92
|
+
export { AppBar, type AppBarProps, type AppBarScroll, type AppBarScrollOptions, Autocomplete, type AutocompleteFilter, type AutocompleteProps, Avatar, type AvatarProps, Badge, type BadgeProps, Breadcrumbs, BreadcrumbsItem, type BreadcrumbsItemProps, type BreadcrumbsProps, Button, ButtonGroup, type ButtonGroupProps, type ButtonGroupVariant, type ButtonProps, type ButtonShape, type ButtonSize, type ButtonVariant, Calendar, type CalendarProps, Card, type CardProps, type CardVariant, Carousel, CarouselItem, type CarouselItemProps, type CarouselItemRenderProps, type CarouselLayout, type CarouselProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, Chip, type ChipActionProps, type ChipFilterProps, ChipGroup, ChipGroupChip, type ChipGroupChipProps, type ChipGroupProps, type ChipProps, type ChipVariant, Code, type CodeProps, Collection, ColorArea, type ColorAreaProps, ColorField, type ColorFieldProps, ColorPicker, type ColorPickerProps, ColorSlider, type ColorSliderProps, ColorSwatch, ColorSwatchPicker, ColorSwatchPickerItem, type ColorSwatchPickerItemProps, type ColorSwatchPickerProps, type ColorSwatchProps, ColorWheel, type ColorWheelProps, ComboBox, type ComboBoxProps, type ComboBoxSelectionMode, Container, type ContainerProps, CopyField, type CopyFieldProps, Currency, type CurrencyDisplay, type CurrencyNotation, type CurrencyProps, type CurrencySignDisplay, type CurrencyTone, DIRECTORY_DRAG_TYPE, DateField, type DateFieldProps, DatePicker, type DatePickerProps, DateRangePicker, type DateRangePickerProps, Dialog, DialogBody, DialogContent, type DialogContentProps, DialogFooter, DialogHeader, type DialogProps, DialogTitle, type DialogTitleProps, Disclosure, DisclosureGroup, type DisclosureGroupProps, DisclosureHeader, type DisclosureHeaderProps, DisclosurePanel, type DisclosurePanelProps, type DisclosureProps, DropZone, type DropZoneProps, Fab, FabMenu, FabMenuItem, type FabMenuItemProps, type FabMenuProps, type FabProps, type FabSize, type FabTone, type FabVariant, Feed, type FeedProps, type FieldVariant, FileTrigger, type FileTriggerProps, Focusable, type FocusableElement, Form, type FormProps, GridLayout, type HoverEvent, I18nProvider, IconButton, type IconButtonProps, type IconButtonSize, type IconButtonVariant, type Key, type KeyboardEvent, Keycap, type KeycapProps, type KuiTheme, Link, type LinkProps, type LinkTone, type LinkUnderline, List, ListBox, ListBoxItem, type ListBoxItemProps, ListBoxLoadMore, type ListBoxLoadMoreProps, type ListBoxProps, ListBoxSection, type ListBoxSectionProps, ListDetail, type ListDetailProps, ListItem, type ListItemProps, ListLayout, ListLoadMore, type ListLoadMoreProps, type ListProps, ListRow, type ListRowProps, ListSection, type ListSectionProps, LoadingIndicator, type LoadingIndicatorProps, Menu, type MenuAlign, MenuContent, type MenuContentProps, MenuItem, type MenuItemProps, MenuLoadMore, type MenuLoadMoreProps, type MenuProps, MenuSection, type MenuSectionProps, MenuSeparator, type MenuSeparatorProps, type MenuSide, MenuSubmenu, type MenuSubmenuProps, Meter, type MeterProps, type MeterTone, NavigationBar, NavigationBarItem, type NavigationItemProps as NavigationBarItemProps, type NavigationBarProps, NavigationRail, NavigationRailItem, type NavigationItemProps as NavigationRailItemProps, type NavigationRailProps, NavigationTree, NavigationTreeItem, type NavigationTreeItemProps, type NavigationTreeProps, NavigationTreeSection, type NavigationTreeSectionProps, NumberField, type NumberFieldProps, Popover, type PopoverAlign, PopoverContent, type PopoverContentProps, PopoverDescription, type PopoverDescriptionProps, type PopoverProps, type PopoverSide, type PopoverSize, PopoverTitle, type PopoverTitleProps, type PopoverTrigger, type PressEvent, Pressable, ProductIcon, type ProductIconProps, ProgressIndicator, type ProgressIndicatorProps, type ProgressIndicatorShape, type ProgressIndicatorTone, type ProgressIndicatorVariant, Radio, RadioGroup, type RadioGroupProps, type RadioProps, RangeCalendar, type RangeCalendarProps, RouterProvider, SearchField, type SearchFieldProps, SearchView, SearchViewContent, type SearchViewContentProps, type SearchViewProps, SegmentedButton, type SegmentedButtonProps, SegmentedButtonSegment, type SegmentedButtonSegmentProps, Select, type SelectProps, type Selection, Separator, type SeparatorInset, type SeparatorProps, SharedElement, SharedElementTransition, Sheet, SheetBody, SheetContent, type SheetContentProps, SheetFooter, SheetHandle, SheetHeader, type SheetProps, SheetTitle, type SheetTitleProps, Slider, type SliderProps, type SliderSize, Snackbar, type SnackbarAction, type SnackbarMessage, type SnackbarOptions, type SnackbarProps, type SnackbarQueue, type ToastRegionRenderProps as SnackbarRegionRenderProps, type SortDescriptor, SplitButton, SplitButtonAction, type SplitButtonActionProps, SplitButtonMenu, type SplitButtonMenuProps, type SplitButtonProps, type SplitButtonVariant, Stack, type StackAlign, type StackGap, type StackJustify, type StackProps, SupportingPane, type SupportingPaneProps, Switch, type SwitchProps, Table, TableBody, type TableBodyProps, TableCell, type TableCellProps, TableColumn, type TableColumnProps, TableFooter, type TableFooterProps, TableHeader, type TableHeaderProps, TableLayout, TableLoadMore, type TableLoadMoreProps, type TableProps, TableRow, type TableRowProps, Tabs, type TabsLayout, TabsList, type TabsListProps, TabsPanel, type TabsPanelProps, TabsPanels, type TabsPanelsProps, type TabsProps, TabsTab, type TabsTabProps, type TabsVariant, Tag, type TagProps, type TagTone, type TagVariant, Text, TextArea, type TextAreaProps, TextField, type TextFieldProps, type TextProps, ThemeScope, type ThemeScopeProps, TimeField, type TimeFieldProps, TimePicker, type TimePickerMode, type TimePickerProps, TokenField, type TokenFieldProps, TokenFieldValue, type TokenSegment, Toolbar, type ToolbarProps, type ToolbarTone, Tooltip, type TooltipAlign, type TooltipProps, type TooltipSide, Tree, TreeItem, type TreeItemProps, TreeLoadMore, type TreeLoadMoreProps, type TreeProps, TreeSection, type TreeSectionProps, Virtualizer, VisuallyHidden, WaterfallLayout, collectionSizes, colorScheme, getColorChannels, isDirectoryDropItem, isFileDropItem, isTextDropItem, parseColor, themeScope, useAppBarScroll, useAsyncList, useDrag, useDragAndDrop, useDrop, useFilter, useListData, useLocale, useTreeData };
|
package/dist/segments/index.js
CHANGED
|
@@ -3,9 +3,10 @@ import { segmentStyles } from "./styles.js";
|
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
import { DateSegment } from "react-aria-components";
|
|
5
5
|
// src/segments/index.tsx
|
|
6
|
+
const UNSEEN = /^[\u061c\u200e\u200f\u202a-\u202e\u2066-\u2069]*$/u;
|
|
6
7
|
function renderSegment(segment) {
|
|
7
8
|
if (segment.type === "literal") return /* @__PURE__ */ jsx(DateSegment, {
|
|
8
|
-
...props(segmentStyles.segment, segmentStyles.segmentLiteral),
|
|
9
|
+
...props(segmentStyles.segment, segmentStyles.segmentLiteral, !UNSEEN.test(segment.text) && segmentStyles.segmentSeparator),
|
|
9
10
|
segment
|
|
10
11
|
});
|
|
11
12
|
return /* @__PURE__ */ jsx(DateSegment, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["ReactElement","stylex","DateInput","RACDateInput","DateSegment","RACDateSegment","segmentStyles","Segment","Parameters","NonNullable","renderSegment","segment","type","props","segmentLiteral","segmentClassName","state","isDisabled","isFocused","isPlaceholder","segmentPlaceholder","segmentFocused","segmentDisabled","className","RACDateSegment","stylex.props"],"sources":["../../src/segments/index.tsx"],"sourcesContent":["import type { ReactElement } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { DateInput as RACDateInput, DateSegment as RACDateSegment } from 'react-aria-components';\nimport { segmentStyles } from './styles';\n\n// How a date or a time is drawn once React Aria has decided what its parts\n// are. Shared by DateField and TimeField, which differ only in the value they\n// hold: the segments, their order and their number all come from React Aria,\n// so what is here is the same for both.\n\n// What React Aria hands the input for each part of the date. Taken off the\n// component rather than imported, since the segment type is not on the\n// package's public surface.\ntype Segment = Parameters<NonNullable<Parameters<typeof RACDateInput>[0]['children']>>[0];\n\n// What each segment draws. A literal — the slash or colon between two\n// segments — takes a style of its own, since it is punctuation rather than\n// something a reader types into.\nfunction renderSegment(segment: Segment): ReactElement {\n if (segment.type === 'literal') {\n return <RACDateSegment {...stylex.props(segmentStyles.segment, segmentStyles.segmentLiteral)} segment={segment} />;\n }\n return <RACDateSegment className={segmentClassName} segment={segment} />;\n}\n\n// A segment's classes, from React Aria's render state. StyleX cannot target\n// `[data-placeholder]` on the element it is styling, so the state comes from\n// what React Aria hands the className.\n//\n// The order matters: `disabled` is last, and StyleX replaces a property\n// whole, so it wins over both the placeholder and the focused branches.\nfunction segmentClassName(state: {\n isDisabled: boolean;\n isFocused: boolean;\n isPlaceholder: boolean;\n}) {\n return stylex.props(segmentStyles.segment, state.isPlaceholder && segmentStyles.segmentPlaceholder, state.isFocused && segmentStyles.segmentFocused, state.isDisabled && segmentStyles.segmentDisabled).className ?? '';\n}\nexport { renderSegment };"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"index.js","names":["ReactElement","stylex","DateInput","RACDateInput","DateSegment","RACDateSegment","segmentStyles","Segment","Parameters","NonNullable","UNSEEN","renderSegment","segment","type","props","segmentLiteral","test","text","segmentSeparator","segmentClassName","state","isDisabled","isFocused","isPlaceholder","segmentPlaceholder","segmentFocused","segmentDisabled","className","RACDateSegment","stylex.props"],"sources":["../../src/segments/index.tsx"],"sourcesContent":["import type { ReactElement } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { DateInput as RACDateInput, DateSegment as RACDateSegment } from 'react-aria-components';\nimport { segmentStyles } from './styles';\n\n// How a date or a time is drawn once React Aria has decided what its parts\n// are. Shared by DateField and TimeField, which differ only in the value they\n// hold: the segments, their order and their number all come from React Aria,\n// so what is here is the same for both.\n\n// What React Aria hands the input for each part of the date. Taken off the\n// component rather than imported, since the segment type is not on the\n// package's public surface.\ntype Segment = Parameters<NonNullable<Parameters<typeof RACDateInput>[0]['children']>>[0];\n\n// The invisible marks that keep a value's direction, which a locale can put\n// at either end of it as a literal of their own.\nconst UNSEEN = /^[\\u061c\\u200e\\u200f\\u202a-\\u202e\\u2066-\\u2069]*$/u;\n\n// What each segment draws. A literal — the slash or colon between two\n// segments — takes a style of its own, since it is punctuation rather than\n// something a reader types into, and the room either side of it only where\n// it takes up room: a direction mark at the start of a time is a literal\n// too, and spaced, it moved the value off the label's edge. A space is spaced\n// like a slash, since it is what stands between a time and its AM or PM.\nfunction renderSegment(segment: Segment): ReactElement {\n if (segment.type === 'literal') {\n return <RACDateSegment {...stylex.props(segmentStyles.segment, segmentStyles.segmentLiteral, !UNSEEN.test(segment.text) && segmentStyles.segmentSeparator)} segment={segment} />;\n }\n return <RACDateSegment className={segmentClassName} segment={segment} />;\n}\n\n// A segment's classes, from React Aria's render state. StyleX cannot target\n// `[data-placeholder]` on the element it is styling, so the state comes from\n// what React Aria hands the className.\n//\n// The order matters: `disabled` is last, and StyleX replaces a property\n// whole, so it wins over both the placeholder and the focused branches.\nfunction segmentClassName(state: {\n isDisabled: boolean;\n isFocused: boolean;\n isPlaceholder: boolean;\n}) {\n return stylex.props(segmentStyles.segment, state.isPlaceholder && segmentStyles.segmentPlaceholder, state.isFocused && segmentStyles.segmentFocused, state.isDisabled && segmentStyles.segmentDisabled).className ?? '';\n}\nexport { renderSegment };"],"mappings":";;;;;AAiBA,MAAMU,SAAS;AAQf,SAASC,cAAcC,SAAgC;CACrD,IAAIA,QAAQC,SAAS,WACnB,OAAO,oBAACe,aAAD;EAAgB,GAAI3B,MAAaK,cAAcM,SAASN,cAAcS,gBAAgB,CAACL,OAAOM,KAAKJ,QAAQK,IAAI,KAAKX,cAAcY,gBAAgB;EAAYN;CAAQ,CAAA;CAE/K,OAAO,oBAACgB,aAAD;EAAgB,WAAWT;EAA2BP;CAAQ,CAAA;AACvE;AAQA,SAASO,iBAAiBC,OAIvB;CACD,OAAOnB,MAAaK,cAAcM,SAASQ,MAAMG,iBAAiBjB,cAAckB,oBAAoBJ,MAAME,aAAahB,cAAcmB,gBAAgBL,MAAMC,cAAcf,cAAcoB,eAAe,CAAC,CAACC,aAAa;AACvN"}
|
package/dist/segments/styles.js
CHANGED
|
@@ -13,7 +13,7 @@ const segmentStyles = {
|
|
|
13
13
|
knGrYV: "xbuiw85",
|
|
14
14
|
kMwMTN: "x139gbkf",
|
|
15
15
|
kjBf7l: "x1x84bn5",
|
|
16
|
-
kInvED: "
|
|
16
|
+
kInvED: "xs9jlpd",
|
|
17
17
|
k3XXqK: "x1t137rt xc0lcac x1894zjx",
|
|
18
18
|
kMeerF: "x1jrff4x",
|
|
19
19
|
kg3NbH: "xdomwbk",
|
|
@@ -37,6 +37,10 @@ const segmentStyles = {
|
|
|
37
37
|
segmentPlaceholder: {
|
|
38
38
|
kMwMTN: "x1w5n3ug",
|
|
39
39
|
$$css: true
|
|
40
|
+
},
|
|
41
|
+
segmentSeparator: {
|
|
42
|
+
kg3NbH: "ximhkdq",
|
|
43
|
+
$$css: true
|
|
40
44
|
}
|
|
41
45
|
};
|
|
42
46
|
export { segmentStyles };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","names":["stylex","colors","radii","spacing","stateLayerOpacity","FORCED_COLORS","segmentStyles","input","kGNEyG","kB7OPa","k1xSpc","k3XXqK","$$css","segment","kaIpWk","knGrYV","kMwMTN","kjBf7l","kInvED","kMeerF","kg3NbH","k9WMMc","segmentDisabled","segmentFocused","kWkggS","segmentLiteral","segmentPlaceholder"],"sources":["../../src/segments/styles.ts"],"sourcesContent":["import * as stylex from '@stylexjs/stylex';\nimport '../tokens/design.tokens.stylex';\nimport { colors, radii, spacing, stateLayerOpacity } from '../tokens/design.tokens.stylex';\n\n// The segments a date or a time is typed into, shared by DateField and\n// TimeField. Apart from either component so the two cannot drift, and outside\n// `src/components` because a directory there is a public component with\n// stories, a barrel entry and a `styling.test.tsx` case — which shared styles\n// are none of.\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 segmentStyles = {\n input: {\n kGNEyG: \"x6s0dn4\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"x78zum5\",\n k3XXqK: \"x1t137rt\",\n $$css: true\n },\n segment: {\n kaIpWk: \"x1tfhd1\",\n kB7OPa: \"x9f619\",\n knGrYV: \"xbuiw85\",\n kMwMTN: \"x139gbkf\",\n kjBf7l: \"x1x84bn5\",\n kInvED: \"
|
|
1
|
+
{"version":3,"file":"styles.js","names":["stylex","colors","radii","spacing","stateLayerOpacity","FORCED_COLORS","segmentStyles","input","kGNEyG","kB7OPa","k1xSpc","k3XXqK","$$css","segment","kaIpWk","knGrYV","kMwMTN","kjBf7l","kInvED","kMeerF","kg3NbH","k9WMMc","segmentDisabled","segmentFocused","kWkggS","segmentLiteral","segmentPlaceholder","segmentSeparator"],"sources":["../../src/segments/styles.ts"],"sourcesContent":["import * as stylex from '@stylexjs/stylex';\nimport '../tokens/design.tokens.stylex';\nimport { colors, radii, spacing, stateLayerOpacity } from '../tokens/design.tokens.stylex';\n\n// The segments a date or a time is typed into, shared by DateField and\n// TimeField. Apart from either component so the two cannot drift, and outside\n// `src/components` because a directory there is a public component with\n// stories, a barrel entry and a `styling.test.tsx` case — which shared styles\n// are none of.\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 segmentStyles = {\n input: {\n kGNEyG: \"x6s0dn4\",\n kB7OPa: \"x9f619\",\n k1xSpc: \"x78zum5\",\n k3XXqK: \"x1t137rt\",\n $$css: true\n },\n segment: {\n kaIpWk: \"x1tfhd1\",\n kB7OPa: \"x9f619\",\n knGrYV: \"xbuiw85\",\n kMwMTN: \"x139gbkf\",\n kjBf7l: \"x1x84bn5\",\n kInvED: \"xs9jlpd\",\n k3XXqK: \"x1t137rt xc0lcac x1894zjx\",\n kMeerF: \"x1jrff4x\",\n kg3NbH: \"xdomwbk\",\n k9WMMc: \"xp4054r\",\n $$css: true\n },\n segmentDisabled: {\n kMwMTN: \"x1xj74d8\",\n $$css: true\n },\n segmentFocused: {\n kWkggS: \"xnety89\",\n kMwMTN: \"xwjo7ld\",\n $$css: true\n },\n segmentLiteral: {\n kMwMTN: \"x1w5n3ug\",\n kg3NbH: \"xnjsko4\",\n $$css: true\n },\n segmentPlaceholder: {\n kMwMTN: \"x1w5n3ug\",\n $$css: true\n },\n segmentSeparator: {\n kg3NbH: \"ximhkdq\",\n $$css: true\n }\n};\nexport { segmentStyles };"],"mappings":";AAeA,MAAMM,gBAAgB;CACpBC,OAAO;EACLC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,SAAS;EACPC,QAAQ;EACRL,QAAQ;EACRM,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRP,QAAQ;EACRQ,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRT,OAAO;CACT;CACAU,iBAAiB;EACfN,QAAQ;EACRJ,OAAO;CACT;CACAW,gBAAgB;EACdC,QAAQ;EACRR,QAAQ;EACRJ,OAAO;CACT;CACAa,gBAAgB;EACdT,QAAQ;EACRI,QAAQ;EACRR,OAAO;CACT;CACAc,oBAAoB;EAClBV,QAAQ;EACRJ,OAAO;CACT;CACAe,kBAAkB;EAChBP,QAAQ;EACRR,OAAO;CACT;AACF"}
|
package/dist/styles/focus.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"focus.js","names":["stylex","colors","focus","ring","kjBf7l","kInvED","k3XXqK","kMeerF","$$css","ringVisible"],"sources":["../../src/styles/focus.ts"],"sourcesContent":["import * as stylex from '@stylexjs/stylex';\nimport '../tokens/design.tokens.stylex';\nimport { colors } from '../tokens/design.tokens.stylex';\n\n// The focus ring, drawn once. Eighteen components spelled the same four\n// declarations out, which made a change to the ring eighteen edits with\n// nothing failing if one were missed.\n//\n// Only these two forms are shared, and the difference is who decides the\n// element has focus. `ring` lets the browser decide, through\n// `:focus-visible`, which is what a natively focusable element wants.\n// `ringVisible` is always solid, for a component that computes focus from\n// React Aria's render state and applies this style only when that state says\n// so — a checkbox, radio or switch, where the ring belongs on the drawn\n// control rather than on the input that actually holds focus.\n//\n// What deliberately stays with its component is every ring that differs, and\n// each of those already carries a comment saying why:\n//\n// - A different colour, because the surface underneath is not the default\n// one: Snackbar's action and close, and Chip's remove.\n// - A different colour, because the spec gives the component its own focus\n// indicator: Card, in secondary or on surface by variant.\n// - A negative offset, drawing the ring inside the element rather than\n// around it: DropZone, NumberField, Table, a Tab and its panel, the shared\n// row, the body of a Dialog or a Sheet while it scrolls, and a bottom\n// sheet's drag handle.\n// - An offset of its own, sized to what the ring surrounds: the colour\n// thumb at 4px, the swatch at 6px, Chip's remove at 1px.\n// - A base of `outlineStyle: 'none'` that a separate style turns solid,\n// which is a different mechanism rather than a different value: the slider\n// thumb, the colour swatch picker, and the shared colour styles.\n// - An `outlineStyle` keyed on a breakpoint, for a ring that moves from one\n// element to another as the window widens: a navigation bar's destination.\n// - A shadow inside a box whose input holds focus, keyed on `:focus-within`,\n// with an outline under forced colours alone: the field chrome's box and\n// SearchField's bar.\nconst focus = {\n ring: {\n kjBf7l: \"xrgy624\",\n kInvED: \"x1hl8ikr\",\n k3XXqK: \"x9v5kkp x1t137rt\",\n kMeerF: \"x1de99jn\",\n $$css: true\n },\n ringVisible: {\n kjBf7l: \"xrgy624\",\n kInvED: \"x1hl8ikr\",\n k3XXqK: \"xaatb59\",\n kMeerF: \"x1de99jn\",\n $$css: true\n }\n};\nexport { focus };"],"mappings":";
|
|
1
|
+
{"version":3,"file":"focus.js","names":["stylex","colors","focus","ring","kjBf7l","kInvED","k3XXqK","kMeerF","$$css","ringVisible"],"sources":["../../src/styles/focus.ts"],"sourcesContent":["import * as stylex from '@stylexjs/stylex';\nimport '../tokens/design.tokens.stylex';\nimport { colors } from '../tokens/design.tokens.stylex';\n\n// The focus ring, drawn once. Eighteen components spelled the same four\n// declarations out, which made a change to the ring eighteen edits with\n// nothing failing if one were missed.\n//\n// Only these two forms are shared, and the difference is who decides the\n// element has focus. `ring` lets the browser decide, through\n// `:focus-visible`, which is what a natively focusable element wants.\n// `ringVisible` is always solid, for a component that computes focus from\n// React Aria's render state and applies this style only when that state says\n// so — a checkbox, radio or switch, where the ring belongs on the drawn\n// control rather than on the input that actually holds focus.\n//\n// What deliberately stays with its component is every ring that differs, and\n// each of those already carries a comment saying why:\n//\n// - A different colour, because the surface underneath is not the default\n// one: Snackbar's action and close, and Chip's remove.\n// - A different colour, because the spec gives the component its own focus\n// indicator: Card, in secondary or on surface by variant.\n// - A negative offset, drawing the ring inside the element rather than\n// around it: DropZone, NumberField, Table, a Tab and its panel, the shared\n// row, the body of a Dialog or a Sheet while it scrolls, and a bottom\n// sheet's drag handle.\n// - An offset of its own, sized to what the ring surrounds: the colour\n// thumb at 4px, the swatch at 6px, Chip's remove at 1px.\n// - A base of `outlineStyle: 'none'` that a separate style turns solid,\n// which is a different mechanism rather than a different value: the slider\n// thumb, the colour swatch picker, and the shared colour styles.\n// - An `outlineStyle` keyed on a breakpoint, for a ring that moves from one\n// element to another as the window widens: a navigation bar's destination.\n// - Drawn by the element around the one holding focus, keyed on `:has()`,\n// for a focused element whose own edge is not the boundary a reader sees:\n// a Popover's dialog, inset inside its panel.\n// - A shadow inside a box whose input holds focus, keyed on `:focus-within`,\n// with an outline under forced colours alone: the field chrome's box and\n// SearchField's bar.\nconst focus = {\n ring: {\n kjBf7l: \"xrgy624\",\n kInvED: \"x1hl8ikr\",\n k3XXqK: \"x9v5kkp x1t137rt\",\n kMeerF: \"x1de99jn\",\n $$css: true\n },\n ringVisible: {\n kjBf7l: \"xrgy624\",\n kInvED: \"x1hl8ikr\",\n k3XXqK: \"xaatb59\",\n kMeerF: \"x1de99jn\",\n $$css: true\n }\n};\nexport { focus };"],"mappings":";AAwCA,MAAME,QAAQ;CACZC,MAAM;EACJC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,aAAa;EACXL,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;AACF"}
|