@kanso-labs/kanso-ui 0.26.5 → 0.26.6
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 +2 -1
- package/dist/calendar/index.js.map +1 -1
- package/dist/calendar/styles.js +0 -13
- package/dist/calendar/styles.js.map +1 -1
- package/dist/collection/index.js +31 -0
- package/dist/collection/index.js.map +1 -0
- package/dist/collection/styles.js +57 -0
- package/dist/collection/styles.js.map +1 -0
- package/dist/components/checkbox/index.js +35 -56
- package/dist/components/checkbox/index.js.map +1 -1
- package/dist/components/checkbox-group/index.js +8 -6
- package/dist/components/checkbox-group/index.js.map +1 -1
- package/dist/components/chip-group/index.js +5 -4
- package/dist/components/chip-group/index.js.map +1 -1
- package/dist/components/color-slider/index.js +9 -4
- package/dist/components/color-slider/index.js.map +1 -1
- package/dist/components/dialog/index.js +1 -1
- package/dist/components/dialog/index.js.map +1 -1
- package/dist/components/list/index.js +16 -21
- package/dist/components/list/index.js.map +1 -1
- package/dist/components/list-box/index.js +20 -25
- package/dist/components/list-box/index.js.map +1 -1
- package/dist/components/menu/index.js +4 -6
- package/dist/components/menu/index.js.map +1 -1
- package/dist/components/navigation-tree/index.js +11 -10
- package/dist/components/navigation-tree/index.js.map +1 -1
- package/dist/components/radio-group/index.js +38 -58
- package/dist/components/radio-group/index.js.map +1 -1
- package/dist/components/sheet/index.js +1 -1
- package/dist/components/sheet/index.js.map +1 -1
- package/dist/components/slider/index.js +15 -7
- package/dist/components/slider/index.js.map +1 -1
- package/dist/components/snackbar/index.js +1 -1
- package/dist/components/snackbar/index.js.map +1 -1
- package/dist/components/switch/index.js +47 -40
- package/dist/components/switch/index.js.map +1 -1
- package/dist/components/table/index.js +4 -6
- package/dist/components/table/index.js.map +1 -1
- package/dist/components/text-area/index.d.ts +9 -1
- package/dist/components/text-area/index.js +21 -19
- package/dist/components/text-area/index.js.map +1 -1
- package/dist/components/text-field/index.d.ts +9 -1
- package/dist/components/text-field/index.js +21 -19
- package/dist/components/text-field/index.js.map +1 -1
- package/dist/components/tree/index.js +28 -28
- package/dist/components/tree/index.js.map +1 -1
- package/dist/control/index.js +38 -0
- package/dist/control/index.js.map +1 -0
- package/dist/control/styles.js +65 -0
- package/dist/control/styles.js.map +1 -0
- package/dist/field/index.js +205 -393
- package/dist/field/index.js.map +1 -1
- package/dist/field/styles.js +381 -0
- package/dist/field/styles.js.map +1 -0
- package/dist/styles/icon-button.js +21 -0
- package/dist/styles/icon-button.js.map +1 -0
- package/dist/styles/overlay.js +1 -1
- package/dist/styles/overlay.js.map +1 -1
- package/dist/styles/picker.js +2 -17
- package/dist/styles/picker.js.map +1 -1
- package/dist/styles.css +44 -0
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["ReactNode","ListBoxItemRenderProps","ListBoxItemProps","RACListBoxItemProps","ListBoxLoadMoreItemProps","RACListBoxLoadMoreItemProps","ListBoxProps","RACListBoxProps","ListBoxSectionProps","RACListBoxSectionProps","stylex","Header","ListBox","RACListBox","ListBoxItem","RACListBoxItem","ListBoxLoadMoreItem","RACListBoxLoadMoreItem","ListBoxSection","RACListBoxSection","RowContent","rowStyles","mergeStatefulStyles","mergeStyles","colors","spacing","typography","ProgressIndicator","children","className","T","leading","style","supporting","trailing","Omit","ListBoxLoadMoreProps","label","header","itemContent","state","isDisabled","isSelected","itemStyles","props","base","list","interactive","undefined","twoLine","selectedList","disabled","$","_c","t0","t1","T0","t2","t3","t4","t5","t6","textValue","t7","textOf","ListBoxLoadMore","Item","LoadMore","Section"],"sources":["../../../src/components/list-box/index.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type { ListBoxItemRenderProps, ListBoxItemProps as RACListBoxItemProps, ListBoxLoadMoreItemProps as RACListBoxLoadMoreItemProps, ListBoxProps as RACListBoxProps, ListBoxSectionProps as RACListBoxSectionProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { Header, ListBox as RACListBox, ListBoxItem as RACListBoxItem, ListBoxLoadMoreItem as RACListBoxLoadMoreItem, ListBoxSection as RACListBoxSection } from 'react-aria-components';\nimport { RowContent } from '../../row';\nimport { rowStyles } from '../../row/styles';\nimport { mergeStatefulStyles, mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, spacing, typography } from '../../tokens/design.tokens.stylex';\nimport ProgressIndicator from '../progress-indicator';\n\n// The lists page's selectable list. Each option is the row every list here\n// draws — `src/row`, shared with ListItem and with every collection the\n// coverage plan adds after this one — so the 56dp floor, the body-large\n// headline, the body-medium supporting line, the state layers and the\n// disabled treatment are all that module's and none of them is written\n// again. What is here is the container around those rows, the section and\n// its header, and the row the list shows while it is fetching more.\n//\n// The container takes the page's 8dp above and below its rows and no\n// background of its own, which is what lets the same list sit on the page\n// and inside a popover without knowing which it is in. Select, ComboBox and\n// Autocomplete are each a field plus one of these in an overlay, so that is\n// not a detail — it is the reason the container is transparent.\n//\n// A selected option takes primary container and on primary container, the\n// page's selected state, through the row module's `list` variant. The page\n// also draws a checkbox in the trailing slot on a list that selects more\n// than one; that is left to the call site rather than added by the option,\n// since which of the two affordances a list wants is the list's decision and\n// the slot is already there for it.\n//\n// Three things are worth knowing about how this maps onto React Aria.\n//\n// **The option's styles are a function of its render state.** StyleX cannot\n// target `[data-selected]` on the element it is styling, so selection,\n// disabled and the rest are read from the state React Aria hands the\n// `className` function — the same mechanism Tabs and Chip use, wrapped in\n// `mergeStatefulStyles` so a call site's own `className` survives.\n//\n// **A section's heading is React Aria's `Header`**, which is what points the\n// section's `aria-labelledby` at it. The lists page names no subhead in its\n// anatomy, so the type is title-small in on surface variant at the row's own\n// 16dp inline padding, which is what the page's own guidance draws.\n//\n// **The load-more row is a sentinel, not a button.** React Aria's\n// `ListBoxLoadMoreItem` calls `onLoadMore` when it comes into view and\n// renders whatever it is given while `isLoading`; ours renders the ring, so\n// a list that fetches as it scrolls says so with the same indicator every\n// other pending state in the library uses.\n\ntype ListBoxItemProps<T extends object = object> = {\n /** The option's headline — the one thing it is mostly about. */\n children?: ReactNode;\n /** A function may compute the class from the option's render state. */\n className?: RACListBoxItemProps<T>['className'];\n /** Content before the headline: an avatar, an icon, a checkbox. */\n leading?: ReactNode;\n /** A function may compute the style from the option's render state. */\n style?: RACListBoxItemProps<T>['style'];\n /** A second line under the headline, in the muted role. */\n supporting?: ReactNode;\n /** Content after the headline, such as an amount or a control. */\n trailing?: ReactNode;\n} & Omit<RACListBoxItemProps<T>, 'children' | 'className' | 'style'>;\ntype ListBoxLoadMoreProps = Omit<RACListBoxLoadMoreItemProps, 'children'> & {\n /**\n * What the row says while it is loading. Read by a screen reader; the ring\n * itself carries no text.\n * @default 'Loading more'\n */\n label?: string;\n};\ntype ListBoxProps<T extends object> = Omit<RACListBoxProps<T>, 'className' | 'style'> & {\n /** A function may compute the class from the list's render state. */\n className?: RACListBoxProps<T>['className'];\n /** A function may compute the style from the list's render state. */\n style?: RACListBoxProps<T>['style'];\n};\ntype ListBoxSectionProps<T extends object = object> = Omit<RACListBoxSectionProps<T>, 'children'> & {\n /**\n * The options in the section. A section built from data puts React Aria's\n * `Collection` in here rather than a render function, since the header is\n * an element beside them.\n */\n children?: ReactNode;\n /**\n * The section's heading, rendered through React Aria's header so the\n * section is named by it. A section without one is a group with no name.\n */\n header?: ReactNode;\n};\n\n// What the option draws, from React Aria's render state. Built by a call\n// rather than written inline at the prop, which is what react-perf's\n// no-new-function-as-prop is after; the React Compiler memoises the result\n// on its inputs.\n//\n// It reads the render state for one thing: which colour the supporting line\n// takes. The muted role the page gives it holds only on the surface — over a\n// selected row's container it is a second colour family, and on a disabled\n// row it stays at full strength while the headline above it fades. The row\n// module decides; this hands it the two flags.\nfunction itemContent(children: ReactNode, leading: ReactNode, supporting: ReactNode, trailing: ReactNode) {\n return (state: ListBoxItemRenderProps) => <RowContent isDisabled={state.isDisabled} isSelected={state.isSelected} leading={leading} supporting={supporting} trailing={trailing}>\n {children}\n </RowContent>;\n}\n\n// StyleX cannot target `[data-selected]` on the element it is styling, so an\n// option's state comes from the render state React Aria hands its className.\n// The order matters: `disabled` is applied last so it wins over both the\n// interactive and the selected branches, and StyleX replaces a property\n// whole, so it takes their hover states with it.\n//\n// A supporting line moves the option from the page's one-line container\n// height to its two-line one, which is a floor rather than something the\n// row's own box arrives at — see `twoLine` in `src/row/styles.ts`. Taken as\n// an argument rather than read from the render state, since React Aria\n// reports what an option is doing and not what it holds; the row is built by\n// a call for the same reason `itemContent` is.\nfunction itemStyles(supporting: ReactNode) {\n return (state: ListBoxItemRenderProps) => stylex.props(rowStyles.base, rowStyles.list, rowStyles.interactive, supporting !== undefined && rowStyles.twoLine, state.isSelected && rowStyles.selectedList, state.isDisabled && rowStyles.disabled);\n}\n\n/**\n * A list of options one or more of which can be selected. Selection is React\n * Aria's: set `selectionMode` to `single` or `multiple`, and pass\n * `selectedKeys` with `onSelectionChange` to control it or\n * `defaultSelectedKeys` to let it keep its own. A list that only responds to\n * a press takes `onAction` on the option instead.\n *\n * Composed from parts, since an option's slots take arbitrary content:\n * `ListBox.Item`, `ListBox.Section` and `ListBox.LoadMore`. Name the list\n * with `aria-label` or `aria-labelledby` — nothing here labels it for you.\n *\n * The call site's `className` and `style` land on the container, which is\n * the element a layout positions.\n */\nfunction ListBox<T extends object>(props: ListBoxProps<T>) {\n return <RACListBox {...props} {...mergeStatefulStyles({\n className: \"x9f619 x78zum5 xdt5ytf x1t137rt x1cmllll\"\n }, props)} />;\n}\n\n/**\n * One option. Its slots are the row's: `leading`, the headline as children,\n * `supporting` under it, and `trailing`. Give every option an `id` — that is\n * the key selection is reported by.\n */\nfunction ListBoxItem<T extends object = object>({\n children,\n leading,\n supporting,\n textValue,\n trailing,\n ...props\n}: ListBoxItemProps<T>) {\n return <RACListBoxItem textValue={textValue ?? textOf(children)} {...props} {...mergeStatefulStyles(itemStyles(supporting), props)}>\n {itemContent(children, leading, supporting, trailing)}\n </RACListBoxItem>;\n}\n\n/**\n * The row the list shows while it is fetching more. React Aria calls\n * `onLoadMore` when this comes into view, and draws it only while\n * `isLoading` — so a list that pages as it scrolls needs nothing else.\n */\nfunction ListBoxLoadMore({\n label = 'Loading more',\n ...props\n}: ListBoxLoadMoreProps) {\n return <RACListBoxLoadMoreItem {...props} {...mergeStyles({\n className: \"x6s0dn4 x9f619 x78zum5 xl56j7k xbktkl8\"\n }, props)}>\n <ProgressIndicator aria-label={label} isIndeterminate size=\"24px\" variant=\"circular\" />\n </RACListBoxLoadMoreItem>;\n}\n\n/**\n * A named group of options. `header` names it, and is what a screen reader\n * reads before the options inside.\n */\nfunction ListBoxSection<T extends object = object>({\n children,\n header,\n ...props\n}: ListBoxSectionProps<T>) {\n return <RACListBoxSection {...props} {...mergeStyles({\n className: \"x9f619 x78zum5 xdt5ytf\"\n }, props)}>\n {header === undefined ? null : <Header className=\"x9f619 x1w5n3ug xrgwony x12s497w x1szcwkt xo803ec xyl1r0q xw3mh6e x1clyivc x790zyz\">{header}</Header>}\n {children}\n </RACListBoxSection>;\n}\n\n// What the option is worth as text, for the things React Aria does with an\n// option's words rather than its element: typeahead, a combo box's filter,\n// and the value a select shows once it is chosen. React Aria reads it off\n// the children when they are a string and finds nothing when they are not —\n// and an option here is always an element, since the row wraps its headline.\n// So a plain-string headline becomes the text value, and anything else has\n// to say what it is worth through `textValue`.\nfunction textOf(children: ReactNode) {\n return typeof children === 'string' ? children : undefined;\n}\nListBox.Item = ListBoxItem;\nListBox.LoadMore = ListBoxLoadMore;\nListBox.Section = ListBoxSection;\nexport type { ListBoxItemProps, ListBoxLoadMoreProps, ListBoxProps, ListBoxSectionProps };\nexport default ListBox;"],"mappings":";;;;;;;;;AAuGA,SAASuC,YAAYX,UAAqBG,SAAoBE,YAAuBC,UAAqB;CACxG,QAAQM,UAAkC,oBAAC,YAAD;EAAY,YAAYA,MAAMC;EAAY,YAAYD,MAAME;EAAqBX;EAAqBE;EAAsBC;EACjKN;CACS,CAAA;AAChB;AAcA,SAASe,W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ode","ListBoxItemRenderProps","ListBoxItemProps","RACListBoxItemProps","ListBoxLoadMoreItemProps","RACListBoxLoadMoreItemProps","ListBoxProps","RACListBoxProps","ListBoxSectionProps","RACListBoxSectionProps","stylex","Header","ListBox","RACListBox","ListBoxItem","RACListBoxItem","ListBoxLoadMoreItem","RACListBoxLoadMoreItem","ListBoxSection","RACListBoxSection","CollectionLoadMore","collectionStyles","rowItemStyles","RowContent","mergeStatefulStyles","mergeStyles","children","className","T","leading","style","supporting","trailing","Omit","ListBoxLoadMoreProps","label","header","itemContent","state","isDisabled","isSelected","props","$","_c","t0","container","t1","T0","t2","t3","t4","t5","t6","textValue","t7","textOf","ListBoxLoadMore","undefined","loading","section","Item","LoadMore","Section"],"sources":["../../../src/components/list-box/index.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type { ListBoxItemRenderProps, ListBoxItemProps as RACListBoxItemProps, ListBoxLoadMoreItemProps as RACListBoxLoadMoreItemProps, ListBoxProps as RACListBoxProps, ListBoxSectionProps as RACListBoxSectionProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { Header, ListBox as RACListBox, ListBoxItem as RACListBoxItem, ListBoxLoadMoreItem as RACListBoxLoadMoreItem, ListBoxSection as RACListBoxSection } from 'react-aria-components';\nimport { CollectionLoadMore } from '../../collection';\nimport { collectionStyles, rowItemStyles } from '../../collection/styles';\nimport { RowContent } from '../../row';\nimport { mergeStatefulStyles, mergeStyles } from '../../styles/merge';\n\n// The lists page's selectable list. Each option is the row every list here\n// draws — `src/row`, shared with ListItem and with every collection the\n// coverage plan adds after this one — so the 56dp floor, the body-large\n// headline, the body-medium supporting line, the state layers and the\n// disabled treatment are all that module's and none of them is written\n// again. What is here is the container around those rows, the section and\n// its header, and the row the list shows while it is fetching more.\n//\n// The container takes the page's 8dp above and below its rows and no\n// background of its own, which is what lets the same list sit on the page\n// and inside a popover without knowing which it is in. Select, ComboBox and\n// Autocomplete are each a field plus one of these in an overlay, so that is\n// not a detail — it is the reason the container is transparent.\n//\n// A selected option takes primary container and on primary container, the\n// page's selected state, through the row module's `list` variant. The page\n// also draws a checkbox in the trailing slot on a list that selects more\n// than one; that is left to the call site rather than added by the option,\n// since which of the two affordances a list wants is the list's decision and\n// the slot is already there for it.\n//\n// Three things are worth knowing about how this maps onto React Aria.\n//\n// **The option's styles are a function of its render state.** StyleX cannot\n// target `[data-selected]` on the element it is styling, so selection,\n// disabled and the rest are read from the state React Aria hands the\n// `className` function — the same mechanism Tabs and Chip use, wrapped in\n// `mergeStatefulStyles` so a call site's own `className` survives.\n//\n// **A section's heading is React Aria's `Header`**, which is what points the\n// section's `aria-labelledby` at it. The lists page names no subhead in its\n// anatomy, so the type is title-small in on surface variant at the row's own\n// 16dp inline padding, which is what the page's own guidance draws.\n//\n// **The load-more row is a sentinel, not a button.** React Aria's\n// `ListBoxLoadMoreItem` calls `onLoadMore` when it comes into view and\n// renders whatever it is given while `isLoading`; ours renders the ring, so\n// a list that fetches as it scrolls says so with the same indicator every\n// other pending state in the library uses.\n\ntype ListBoxItemProps<T extends object = object> = {\n /** The option's headline — the one thing it is mostly about. */\n children?: ReactNode;\n /** A function may compute the class from the option's render state. */\n className?: RACListBoxItemProps<T>['className'];\n /** Content before the headline: an avatar, an icon, a checkbox. */\n leading?: ReactNode;\n /** A function may compute the style from the option's render state. */\n style?: RACListBoxItemProps<T>['style'];\n /** A second line under the headline, in the muted role. */\n supporting?: ReactNode;\n /** Content after the headline, such as an amount or a control. */\n trailing?: ReactNode;\n} & Omit<RACListBoxItemProps<T>, 'children' | 'className' | 'style'>;\ntype ListBoxLoadMoreProps = Omit<RACListBoxLoadMoreItemProps, 'children'> & {\n /**\n * What the row says while it is loading. Read by a screen reader; the ring\n * itself carries no text.\n * @default 'Loading more'\n */\n label?: string;\n};\ntype ListBoxProps<T extends object> = Omit<RACListBoxProps<T>, 'className' | 'style'> & {\n /** A function may compute the class from the list's render state. */\n className?: RACListBoxProps<T>['className'];\n /** A function may compute the style from the list's render state. */\n style?: RACListBoxProps<T>['style'];\n};\ntype ListBoxSectionProps<T extends object = object> = Omit<RACListBoxSectionProps<T>, 'children'> & {\n /**\n * The options in the section. A section built from data puts React Aria's\n * `Collection` in here rather than a render function, since the header is\n * an element beside them.\n */\n children?: ReactNode;\n /**\n * The section's heading, rendered through React Aria's header so the\n * section is named by it. A section without one is a group with no name.\n */\n header?: ReactNode;\n};\n\n// What the option draws, from React Aria's render state. Built by a call\n// rather than written inline at the prop, which is what react-perf's\n// no-new-function-as-prop is after; the React Compiler memoises the result\n// on its inputs.\n//\n// It reads the render state for one thing: which colour the supporting line\n// takes. The muted role the page gives it holds only on the surface — over a\n// selected row's container it is a second colour family, and on a disabled\n// row it stays at full strength while the headline above it fades. The row\n// module decides; this hands it the two flags.\nfunction itemContent(children: ReactNode, leading: ReactNode, supporting: ReactNode, trailing: ReactNode) {\n return (state: ListBoxItemRenderProps) => <RowContent isDisabled={state.isDisabled} isSelected={state.isSelected} leading={leading} supporting={supporting} trailing={trailing}>\n {children}\n </RowContent>;\n}\n\n// StyleX cannot target `[data-selected]` on the element it is styling, so an\n// option's state comes from the render state React Aria hands its className.\n// The order matters: `disabled` is applied last so it wins over both the\n// interactive and the selected branches, and StyleX replaces a property\n// whole, so it takes their hover states with it.\n//\n// A supporting line moves the option from the page's one-line container\n// height to its two-line one, which is a floor rather than something the\n// row's own box arrives at — see `twoLine` in `src/row/styles.ts`. Taken as\n// an argument rather than read from the render state, since React Aria\n// reports what an option is doing and not what it holds; the row is built by\n// a call for the same reason `itemContent` is.\n/**\n * A list of options one or more of which can be selected. Selection is React\n * Aria's: set `selectionMode` to `single` or `multiple`, and pass\n * `selectedKeys` with `onSelectionChange` to control it or\n * `defaultSelectedKeys` to let it keep its own. A list that only responds to\n * a press takes `onAction` on the option instead.\n *\n * Composed from parts, since an option's slots take arbitrary content:\n * `ListBox.Item`, `ListBox.Section` and `ListBox.LoadMore`. Name the list\n * with `aria-label` or `aria-labelledby` — nothing here labels it for you.\n *\n * The call site's `className` and `style` land on the container, which is\n * the element a layout positions.\n */\nfunction ListBox<T extends object>(props: ListBoxProps<T>) {\n return <RACListBox {...props} {...mergeStatefulStyles(stylex.props(collectionStyles.container), props)} />;\n}\n\n/**\n * One option. Its slots are the row's: `leading`, the headline as children,\n * `supporting` under it, and `trailing`. Give every option an `id` — that is\n * the key selection is reported by.\n */\nfunction ListBoxItem<T extends object = object>({\n children,\n leading,\n supporting,\n textValue,\n trailing,\n ...props\n}: ListBoxItemProps<T>) {\n return <RACListBoxItem textValue={textValue ?? textOf(children)} {...props} {...mergeStatefulStyles(rowItemStyles(supporting), props)}>\n {itemContent(children, leading, supporting, trailing)}\n </RACListBoxItem>;\n}\n\n/**\n * The row the list shows while it is fetching more. React Aria calls\n * `onLoadMore` when this comes into view, and draws it only while\n * `isLoading` — so a list that pages as it scrolls needs nothing else.\n */\nfunction ListBoxLoadMore({\n label = 'Loading more',\n ...props\n}: ListBoxLoadMoreProps) {\n return <RACListBoxLoadMoreItem {...props} {...mergeStyles(stylex.props(collectionStyles.loading), props)}>\n <CollectionLoadMore label={label} size=\"24px\" />\n </RACListBoxLoadMoreItem>;\n}\n\n/**\n * A named group of options. `header` names it, and is what a screen reader\n * reads before the options inside.\n */\nfunction ListBoxSection<T extends object = object>({\n children,\n header,\n ...props\n}: ListBoxSectionProps<T>) {\n return <RACListBoxSection {...props} {...mergeStyles(stylex.props(collectionStyles.section), props)}>\n {header === undefined ? null : <Header {...stylex.props(collectionStyles.header)}>{header}</Header>}\n {children}\n </RACListBoxSection>;\n}\n\n// What the option is worth as text, for the things React Aria does with an\n// option's words rather than its element: typeahead, a combo box's filter,\n// and the value a select shows once it is chosen. React Aria reads it off\n// the children when they are a string and finds nothing when they are not —\n// and an option here is always an element, since the row wraps its headline.\n// So a plain-string headline becomes the text value, and anything else has\n// to say what it is worth through `textValue`.\nfunction textOf(children: ReactNode) {\n return typeof children === 'string' ? children : undefined;\n}\nListBox.Item = ListBoxItem;\nListBox.LoadMore = ListBoxLoadMore;\nListBox.Section = ListBoxSection;\nexport type { ListBoxItemProps, ListBoxLoadMoreProps, ListBoxProps, ListBoxSectionProps };\nexport default ListBox;"],"mappings":";;;;;;;;;AAqGA,SAASqC,YAAYX,UAAqBG,SAAoBE,YAAuBC,UAAqB;CACxG,QAAQM,UAAkC,oBAAC,YAAD;EAAY,YAAYA,MAAMC;EAAY,YAAYD,MAAME;EAAqBX;EAAqBE;EAAsBC;EACjKN;CACS,CAAA;AAChB;;;;;;;;;;;;;;;AA4BA,SAAAd,UAAA6B,SAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAA,IAAAC;CAAA,IAAAF,EAAA,OAAAD,SAAA;EACoCG,KAAApB,oBAAoBd,MAAaW,iBAAgBwB,SAAU,GAAGJ,OAAK;EAACC,EAAA,KAAAD;EAAAC,EAAA,KAAAE;CAAA,OAAAA,KAAAF,EAAA;CAAA,IAAAI;CAAA,IAAAJ,EAAA,OAAAD,WAAAC,EAAA,OAAAE,IAAA;EAA/FE,KAAA,oBAAC,SAAD;GAAW,GAAKL;GAAK,GAAMG;EAAoE,CAAA;EAAIF,EAAA,KAAAD;EAAAC,EAAA,KAAAE;EAAAF,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAAA,OAAnGI;AAAmG;;;;;;AAQ5G,SAAAhC,cAAA8B,IAAA;CAAA,MAAAF,IAAAC,EAAA,EAAA;CAAA,IAAAI;CAAA,IAAArB;CAAA,IAAAG;CAAA,IAAAE;CAAA,IAAAe;CAAA,IAAAE;CAAA,IAAAC;CAAA,IAAAjB;CAAA,IAAAU,EAAA,OAAAE,IAAA;EAAgD,MAAA,EAAAlB,UAAAwB,IAAArB,SAAAsB,IAAApB,YAAAqB,IAAAC,WAAArB,UAAAsB,IAAA,GAAAb,UAAAG;EAAAlB,WAAAwB;EAAArB,UAAAsB;EAAApB,aAAAqB;EAAApB,WAAAsB;EAQtCP,KAAAhC;EAAc,IAAA2B,EAAA,OAAAhB,YAAAgB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;AACfF,UAAQiD,WAAWL;AACnB5C,UAAQkD,UAAU5C"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { props } from "../../node_modules/@stylexjs/stylex/lib/es/stylex.js";
|
|
2
2
|
import { mergeStatefulStyles, mergeStyles } from "../../styles/merge.js";
|
|
3
3
|
import { ChevronEndGlyph } from "../../glyphs/index.js";
|
|
4
|
-
import ProgressIndicator from "../progress-indicator/index.js";
|
|
5
4
|
import { overlay, placementOf, popupOrigin } from "../../styles/overlay.js";
|
|
5
|
+
import { CollectionLoadMore } from "../../collection/index.js";
|
|
6
6
|
import { rowStyles } from "../../row/styles.js";
|
|
7
7
|
import { RowContent } from "../../row/index.js";
|
|
8
8
|
import Separator$1 from "../separator/index.js";
|
|
@@ -288,11 +288,9 @@ function MenuLoadMore(t0) {
|
|
|
288
288
|
}
|
|
289
289
|
let t3;
|
|
290
290
|
if ($[5] !== label) {
|
|
291
|
-
t3 = /* @__PURE__ */ jsx(
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
size: "20px",
|
|
295
|
-
variant: "circular"
|
|
291
|
+
t3 = /* @__PURE__ */ jsx(CollectionLoadMore, {
|
|
292
|
+
label,
|
|
293
|
+
size: "20px"
|
|
296
294
|
});
|
|
297
295
|
$[5] = label;
|
|
298
296
|
$[6] = t3;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["ComponentProps","ReactElement","ReactNode","MenuItemRenderProps","PopoverRenderProps","MenuItemProps","RACMenuItemProps","MenuLoadMoreItemProps","RACMenuLoadMoreItemProps","MenuProps","RACMenuProps","MenuSectionProps","RACMenuSectionProps","MenuTriggerProps","RACMenuTriggerProps","stylex","Header","Keyboard","Menu","RACMenu","MenuItem","RACMenuItem","MenuLoadMoreItem","RACMenuLoadMoreItem","MenuSection","RACMenuSection","MenuTrigger","RACMenuTrigger","Popover","RACPopover","SubmenuTrigger","RACSubmenuTrigger","Text","OverlayAlign","OverlaySide","ChevronEndGlyph","RowContent","rowStyles","mergeStatefulStyles","mergeStyles","overlay","placementOf","popupOrigin","colors","radii","spacing","typography","ProgressIndicator","Separator","MENU_MIN","MENU_MAX","styles","content","kWkggS","kaIpWk","ks0D6T","k7Eaqz","k3XXqK","k8WAf4","$$css","MenuAlign","MenuContentProps","align","alignOffset","className","T","container","Element","search","side","MenuSide","sideOffset","style","Omit","children","leading","shortcut","trailing","MenuLoadMoreProps","label","header","MenuSeparatorProps","MenuSubmenuProps","delay","itemContent","state","isDisabled","isSelected","trailingOf","itemStyles","props","base","menu","interactive","selectedMenu","disabled","t0","$","_c","t1","MenuContent","t2","t3","undefined","t4","t5","Symbol","for","surfaceStyles","t6","t7","t8","t9","T0","textValue","textOf","MenuLoadMore","MenuSeparator","MenuSubmenu","popup","placement","hasSubmenu","Content","Item","LoadMore","Section","Submenu"],"sources":["../../../src/components/menu/index.tsx"],"sourcesContent":["import type { ComponentProps, ReactElement, ReactNode } from 'react';\nimport type { MenuItemRenderProps, PopoverRenderProps, MenuItemProps as RACMenuItemProps, MenuLoadMoreItemProps as RACMenuLoadMoreItemProps, MenuProps as RACMenuProps, MenuSectionProps as RACMenuSectionProps, MenuTriggerProps as RACMenuTriggerProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { Header, Keyboard, Menu as RACMenu, MenuItem as RACMenuItem, MenuLoadMoreItem as RACMenuLoadMoreItem, MenuSection as RACMenuSection, MenuTrigger as RACMenuTrigger, Popover as RACPopover, SubmenuTrigger as RACSubmenuTrigger, Text } from 'react-aria-components';\nimport type { OverlayAlign, OverlaySide } from '../../styles/overlay';\nimport { ChevronEndGlyph } from '../../glyphs';\nimport { RowContent } from '../../row';\nimport { rowStyles } from '../../row/styles';\nimport { mergeStatefulStyles, mergeStyles } from '../../styles/merge';\nimport { overlay, placementOf, popupOrigin } from '../../styles/overlay';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, radii, spacing, typography } from '../../tokens/design.tokens.stylex';\nimport ProgressIndicator from '../progress-indicator';\nimport Separator from '../separator';\n\n// The menus page's menu: a surface between 112 and 280 wide with a 4dp\n// corner and 8dp above and below its items, holding rows of the row module's\n// menu variant — 48dp tall, a label-large label, tertiary container when\n// selected. The surface itself is the overlay module's, shared with Popover\n// and Sheet, with the two things the menus page decides differently applied\n// over it: the corner, which is the extra-small step rather than the\n// medium one every other overlay takes, and the container colour, which is\n// the Expressive column's surface container low rather than the baseline's\n// surface container.\n//\n// Six parts, because everything a menu holds takes arbitrary content:\n// `Menu.Content`, `Menu.Item`, `Menu.Section`, `Menu.Separator`,\n// `Menu.Submenu` and `Menu.LoadMore`. A `Button` or `IconButton` placed\n// directly inside `Menu` is the trigger, wired through React Aria's context\n// rather than a part of ours — the same arrangement Sheet and Popover use.\n//\n// Four things are worth knowing about how this maps onto React Aria.\n//\n// **The item's styles are a function of its render state.** StyleX cannot\n// target `[data-selected]` on the element it is styling, so selection,\n// disabled and the rest are read from the state React Aria hands the\n// `className` function, wrapped in `mergeStatefulStyles` so a call site's own\n// `className` survives.\n//\n// **A shortcut goes through React Aria's `Keyboard` slot**, and the label\n// through its `Text` slot. The second is what makes the first work: React\n// Aria points the item's `aria-labelledby` at the labelled text, so a screen\n// reader reads the label alone and announces the keystroke separately. Left\n// as plain content, the item's name is its whole text and the shortcut is\n// read as part of what the item does. The keycap itself is the library's.\n//\n// **A submenu's arrow is drawn from render state, not from a prop.** React\n// Aria reports `hasSubmenu` on the item inside a `SubmenuTrigger`, so an item\n// that opens one gets the chevron without the call site saying so twice. The\n// glyph carries no direction of its own, so the style mirrors it under a\n// right-to-left writing mode.\n//\n// **A menu's children are a collection**, so anything that is not an item is\n// dropped: React Aria walks them looking for items and finds a search input\n// no place to be. `Menu.Content` therefore takes a `search` slot, drawn on\n// the surface above the items — which is also what puts the bar and the\n// items inside one `Autocomplete` when the menu is filtered.\n//\n// **A separator needs no slot from the call site.** React Aria's menu\n// provides the separator context, which is what `Menu.Separator` picks up —\n// that is why Separator moved onto React Aria in Phase 0. What is added here\n// is the menus page's 8dp either side of the rule.\n\nconst MENU_MIN = '112px';\nconst MENU_MAX = '280px';\nconst styles = {\n content: {\n kWkggS: \"x1vnz5z6\",\n kaIpWk: \"x1tfhd1\",\n ks0D6T: \"x1jkqq1h\",\n k7Eaqz: \"x1c7vg25\",\n k3XXqK: \"x1t137rt\",\n k8WAf4: \"x1cmllll\",\n $$css: true\n }\n};\ntype MenuAlign = OverlayAlign;\ntype MenuContentProps<T extends object = object> = {\n /** Where the menu lines up along that side. @default 'start' */\n align?: MenuAlign;\n /** Moves the menu along that side, in pixels. */\n alignOffset?: number;\n /** A function may compute the class from the menu's render state. */\n className?: RACMenuProps<T>['className'];\n /**\n * Where to portal the menu. Defaults to the end of `<body>`, which is right\n * for an app that sets its StyleX theme on `:root`. An app that scopes the\n * theme to a subtree has to point this at an element inside it, or the menu\n * renders outside the theme and falls back to the tokens'\n * `prefers-color-scheme` default.\n */\n container?: Element;\n /**\n * Content drawn on the surface above the items — a search bar that filters\n * them, usually. It goes here rather than among the children because a\n * menu's children are a collection: React Aria walks them for items and\n * drops anything else, so an input written beside them disappears.\n *\n * To filter with it, wrap this whole part in `Autocomplete`, which puts\n * the bar and the items inside one wrapper.\n */\n search?: ReactNode;\n /** Which side of the trigger the menu opens on. @default 'bottom' */\n side?: MenuSide;\n /** How far the menu sits from the trigger, in pixels. @default 8 */\n sideOffset?: number;\n /** A function may compute the style from the menu's render state. */\n style?: RACMenuProps<T>['style'];\n} & Omit<RACMenuProps<T>, 'className' | 'style'>;\ntype MenuItemProps<T extends object = object> = {\n /** The item's label — what it does. */\n children?: ReactNode;\n /** A function may compute the class from the item's render state. */\n className?: RACMenuItemProps<T>['className'];\n /** Content before the label, usually an icon. */\n leading?: ReactNode;\n /**\n * The keystroke that runs the item, drawn as a keycap at the end. Goes\n * through React Aria's keyboard slot, so a screen reader announces it\n * apart from the label rather than reading the two as one name.\n */\n shortcut?: ReactNode;\n /** A function may compute the style from the item's render state. */\n style?: RACMenuItemProps<T>['style'];\n /** Content after the label, before the shortcut. */\n trailing?: ReactNode;\n} & Omit<RACMenuItemProps<T>, 'children' | 'className' | 'style'>;\ntype MenuLoadMoreProps = Omit<RACMenuLoadMoreItemProps, 'children'> & {\n /**\n * What the row says while it is loading. Read by a screen reader; the ring\n * itself carries no text.\n * @default 'Loading more'\n */\n label?: string;\n};\n\n// `children` is optional here where React Aria makes it required, so the\n// type reads the way Sheet's and Popover's do: a root that composes rather\n// than one that has to be handed something. Sheet does the same for the same\n// reason.\ntype MenuProps = Omit<RACMenuTriggerProps, 'children'> & {\n /** The trigger, then the `Menu.Content` it opens. */\n children?: ReactNode;\n};\ntype MenuSectionProps<T extends object = object> = Omit<RACMenuSectionProps<T>, 'children'> & {\n /**\n * The items in the section. A section built from data puts React Aria's\n * `Collection` in here rather than a render function, since the header is\n * an element beside them.\n */\n children?: ReactNode;\n /**\n * The section's heading, rendered through React Aria's header so the\n * section is named by it. A section without one is a group with no name.\n */\n header?: ReactNode;\n};\ntype MenuSeparatorProps = Omit<ComponentProps<typeof Separator>, 'orientation'>;\ntype MenuSide = OverlaySide;\ntype MenuSubmenuProps = {\n /**\n * The item that opens the submenu, then the `Menu.Content` it opens.\n * Exactly those two, in that order.\n */\n children: ReactElement[];\n /**\n * How long the pointer rests on the item before the submenu opens, in\n * milliseconds.\n * @default 200\n */\n delay?: number;\n};\n\n// What the item draws, from React Aria's render state. Built by a call\n// rather than written inline at the prop, which is what react-perf's\n// no-new-function-as-prop is after; the React Compiler memoises the result\n// on its inputs.\n//\n// The render state decides two things: the chevron, which an item inside a\n// SubmenuTrigger gets without the call site asking twice, and the supporting\n// line's colour, which the row module takes from whether the row is selected\n// or disabled.\nfunction itemContent(children: ReactNode, leading: ReactNode, shortcut: ReactNode, trailing: ReactNode) {\n return (state: MenuItemRenderProps) => <RowContent isDisabled={state.isDisabled} isSelected={state.isSelected} leading={leading} trailing={trailingOf(state, shortcut, trailing)} variant=\"menu\">\n <Text slot=\"label\">{children}</Text>\n </RowContent>;\n}\n\n// StyleX cannot target `[data-selected]` on the element it is styling, so an\n// item's state comes from the render state React Aria hands its className.\n// The order matters: `disabled` is applied last so it wins over both the\n// interactive and the selected branches, and StyleX replaces a property\n// whole, so it takes their hover states with it.\nfunction itemStyles(state: MenuItemRenderProps) {\n return stylex.props(rowStyles.base, rowStyles.menu, rowStyles.interactive, state.isSelected && rowStyles.selectedMenu, state.isDisabled && rowStyles.disabled);\n}\n\n/**\n * A list of actions opened from a control. Open state is React Aria's: pass\n * `isOpen` with `onOpenChange` to control it, or `defaultOpen` to let it keep\n * its own.\n *\n * A `Button` or `IconButton` placed directly inside opens it; everything the\n * menu shows goes in `Menu.Content`, since the trigger lives in the page\n * while the menu is portalled out to the end of the body.\n *\n * ```tsx\n * <Menu>\n * <Button>Open</Button>\n * <Menu.Content aria-label=\"Label\">\n * <Menu.Item id=\"first\">First item</Menu.Item>\n * </Menu.Content>\n * </Menu>\n * ```\n */\nfunction Menu({\n children,\n ...props\n}: MenuProps) {\n return <RACMenuTrigger {...props}>{children}</RACMenuTrigger>;\n}\n\n/**\n * The menu itself, and the surface it is drawn on. React Aria names it after\n * the control that opened it, so `aria-label` here is ignored — name the\n * trigger instead.\n *\n * The call site's `className` and `style` land on the surface, which is the\n * element a layout positions.\n */\nfunction MenuContent<T extends object = object>({\n align = 'start',\n alignOffset,\n className,\n container,\n search,\n side = 'bottom',\n sideOffset = 8,\n style,\n ...props\n}: MenuContentProps<T>) {\n return <RACPopover crossOffset={alignOffset} offset={sideOffset} placement={placementOf(side, align)}\n // oxlint-disable-next-line typescript/no-deprecated -- its replacement, UNSAFE_PortalProvider, is not exported by react-aria-components\n UNSTABLE_portalContainer={container} {...mergeStatefulStyles(surfaceStyles, {})}>\n {search === undefined ? null : <div className=\"x9f619 xqf7pud xn60lsn\">{search}</div>}\n <RACMenu<T> {...props} {...mergeStatefulStyles({\n className: \"x9f619 x78zum5 xdt5ytf x1t137rt\"\n }, {\n className,\n style\n })} />\n </RACPopover>;\n}\n\n/**\n * One action. Its slots are the row's: `leading` before the label, the label\n * as children, and `trailing` after it, with `shortcut` at the end. An item\n * that opens a submenu draws the chevron itself.\n */\nfunction MenuItem<T extends object = object>({\n children,\n leading,\n shortcut,\n textValue,\n trailing,\n ...props\n}: MenuItemProps<T>) {\n return <RACMenuItem textValue={textValue ?? textOf(children)} {...props} {...mergeStatefulStyles(itemStyles, props)}>\n {itemContent(children, leading, shortcut, trailing)}\n </RACMenuItem>;\n}\n\n/**\n * The row shown while more items are being fetched. React Aria calls\n * `onLoadMore` when it comes into view, and draws it only while `isLoading`.\n */\nfunction MenuLoadMore({\n label = 'Loading more',\n ...props\n}: MenuLoadMoreProps) {\n return <RACMenuLoadMoreItem {...props} {...mergeStyles({\n className: \"x6s0dn4 x9f619 x78zum5 xl56j7k x1wxaq2x\"\n }, props)}>\n <ProgressIndicator aria-label={label} isIndeterminate size=\"20px\" variant=\"circular\" />\n </RACMenuLoadMoreItem>;\n}\n\n/**\n * A named group of items. `header` names it, and is what a screen reader\n * reads before the items inside.\n */\nfunction MenuSection<T extends object = object>({\n children,\n header,\n ...props\n}: MenuSectionProps<T>) {\n return <RACMenuSection {...props}>\n {header === undefined ? null : <Header className=\"x9f619 x1w5n3ug xrgwony x12s497w x1szcwkt xo803ec xyl1r0q xw3mh6e x6gmt8y x790zyz\">{header}</Header>}\n {children}\n </RACMenuSection>;\n}\n\n/**\n * A rule between groups of items. It takes its role from the menu around it,\n * so it needs no slot from the call site.\n */\nfunction MenuSeparator(props: MenuSeparatorProps) {\n return <Separator {...props} {...mergeStyles({\n className: \"xwpi13i\"\n }, props)} />;\n}\n\n/**\n * An item that opens a menu of its own. Takes exactly two children: the\n * `Menu.Item` that opens it, then the `Menu.Content` it opens.\n */\nfunction MenuSubmenu(props: MenuSubmenuProps) {\n return <RACSubmenuTrigger {...props} />;\n}\n\n// The surface grows from the edge it is anchored by, which is what makes it\n// read as coming out of the trigger. Built by a call rather than written\n// inline at the prop, which is what react-perf's no-new-function-as-prop is\n// after.\nfunction surfaceStyles(state: PopoverRenderProps) {\n return stylex.props(overlay.popup, styles.content, popupOrigin(state.placement));\n}\n\n// What the item is worth as text, for the typeahead React Aria drives from\n// an item's words rather than its element. It reads it off the children when\n// they are a string and finds nothing when they are not — and an item here\n// is always an element, since the row wraps its label. So a plain-string\n// label becomes the text value, and anything else has to say what it is\n// worth through `textValue`.\nfunction textOf(children: ReactNode) {\n return typeof children === 'string' ? children : undefined;\n}\n\n/** What sits after the label: the call site's content, then the shortcut or\n * the submenu's chevron. */\nfunction trailingOf(state: MenuItemRenderProps, shortcut: ReactNode, trailing: ReactNode) {\n if (state.hasSubmenu) {\n return <>\n {trailing}\n <ChevronEndGlyph className=\"x1qx5ct2 xw4jnvo x19axjrm x1c071of\" />\n </>;\n }\n if (shortcut === undefined && trailing === undefined) {\n return undefined;\n }\n return <>\n {trailing}\n {shortcut === undefined ? null : <Keyboard className=\"x1w5n3ug\">{shortcut}</Keyboard>}\n </>;\n}\nMenu.Content = MenuContent;\nMenu.Item = MenuItem;\nMenu.LoadMore = MenuLoadMore;\nMenu.Section = MenuSection;\nMenu.Separator = MenuSeparator;\nMenu.Submenu = MenuSubmenu;\nexport type { MenuAlign, MenuContentProps, MenuItemProps, MenuLoadMoreProps, MenuProps, MenuSectionProps, MenuSeparatorProps, MenuSide, MenuSubmenuProps };\nexport default Menu;"],"mappings":";;;;;;;;;;;;AAiEA,MAAMmD,SAAS,EACbC,SAAS;CACPC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,OAAO;AACT,EACF;AA2GA,SAASyB,YAAYV,UAAqBC,SAAoBC,UAAqBC,UAAqB;CACtG,QAAQQ,UAA+B,oBAAC,YAAD;EAAY,YAAYA,MAAMC;EAAY,YAAYD,MAAME;EAAqBZ;EAAS,UAAUa,WAAWH,OAAOT,UAAUC,QAAQ;EAAG,SAAQ;EACtL,UAAA,oBAAC,MAAD;GAAM,MA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AAA,OAAAA,KAAAF,EAAA;CAAA,OAFNE;AAEM;;;;;AAOf,SAAAmB,YAAA5B,OAAA;CAAA,MAAAO,IAAAC,EAAA,CAAA;CAAA,IAAAF;CAAA,IAAAC,EAAA,OAAAP,OAAA;EACSM,KAAA,oBAAC,gBAAD,EAAkB,GAAKN,MAAK,CAAA;EAAIO,EAAA,KAAAP;EAAAO,EAAA,KAAAD;CAAA,OAAAA,KAAAC,EAAA;CAAA,OAAhCD;AAAgC;AAOzC,SAASY,cAAcvB,OAA2B;CAChD,OAAOtE,MAAayB,QAAQ+E,OAAOpE,OAAOC,SAASV,YAAY2C,MAAMmC,SAAS,CAAC;AACjF;AAQA,SAASL,OAAOzC,UAAqB;CACnC,OAAO,OAAOA,aAAa,WAAWA,WAAW6B,KAAAA;AACnD;;;AAIA,SAASf,WAAWH,OAA4BT,UAAqBC,UAAqB;CACxF,IAAIQ,MAAMoC,YACR,OAAO,qBAAA,UAAA,EAAA,UAAA,CACF5C,UACD,oBAAC,iBAAD,EAAiB,WAAU,qCAAoC,CAAA,CACjE,EAAA,CAAA;CAEJ,IAAID,aAAa2B,KAAAA,KAAa1B,aAAa0B,KAAAA,GACzC;CAEF,OAAO,qBAAA,UAAA,EAAA,UAAA,CACF1B,UACAD,aAAa2B,KAAAA,IAAY,OAAO,oBAAC,UAAD;EAAU,WAAU;EAAY3B,UAAAA;CAAmB,CAAA,CACtF,EAAA,CAAA;AACJ;AACA1D,OAAKwG,UAAUtB;AACflF,OAAKyG,OAAOvG;AACZF,OAAK0G,WAAWR;AAChBlG,OAAK2G,UAAUrG;AACfN,OAAK8B,YAAYqE;AACjBnG,OAAK4G,UAAUR"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["ComponentProps","ReactElement","ReactNode","MenuItemRenderProps","PopoverRenderProps","MenuItemProps","RACMenuItemProps","MenuLoadMoreItemProps","RACMenuLoadMoreItemProps","MenuProps","RACMenuProps","MenuSectionProps","RACMenuSectionProps","MenuTriggerProps","RACMenuTriggerProps","stylex","Header","Keyboard","Menu","RACMenu","MenuItem","RACMenuItem","MenuLoadMoreItem","RACMenuLoadMoreItem","MenuSection","RACMenuSection","MenuTrigger","RACMenuTrigger","Popover","RACPopover","SubmenuTrigger","RACSubmenuTrigger","Text","OverlayAlign","OverlaySide","CollectionLoadMore","ChevronEndGlyph","RowContent","rowStyles","mergeStatefulStyles","mergeStyles","overlay","placementOf","popupOrigin","colors","radii","spacing","typography","Separator","MENU_MIN","MENU_MAX","styles","content","kWkggS","kaIpWk","ks0D6T","k7Eaqz","k3XXqK","k8WAf4","$$css","MenuAlign","MenuContentProps","align","alignOffset","className","T","container","Element","search","side","MenuSide","sideOffset","style","Omit","children","leading","shortcut","trailing","MenuLoadMoreProps","label","header","MenuSeparatorProps","MenuSubmenuProps","delay","itemContent","state","isDisabled","isSelected","trailingOf","itemStyles","props","base","menu","interactive","selectedMenu","disabled","t0","$","_c","t1","MenuContent","t2","t3","undefined","t4","t5","Symbol","for","surfaceStyles","t6","t7","t8","t9","T0","textValue","textOf","MenuLoadMore","MenuSeparator","MenuSubmenu","popup","placement","hasSubmenu","Content","Item","LoadMore","Section","Submenu"],"sources":["../../../src/components/menu/index.tsx"],"sourcesContent":["import type { ComponentProps, ReactElement, ReactNode } from 'react';\nimport type { MenuItemRenderProps, PopoverRenderProps, MenuItemProps as RACMenuItemProps, MenuLoadMoreItemProps as RACMenuLoadMoreItemProps, MenuProps as RACMenuProps, MenuSectionProps as RACMenuSectionProps, MenuTriggerProps as RACMenuTriggerProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { Header, Keyboard, Menu as RACMenu, MenuItem as RACMenuItem, MenuLoadMoreItem as RACMenuLoadMoreItem, MenuSection as RACMenuSection, MenuTrigger as RACMenuTrigger, Popover as RACPopover, SubmenuTrigger as RACSubmenuTrigger, Text } from 'react-aria-components';\nimport type { OverlayAlign, OverlaySide } from '../../styles/overlay';\nimport { CollectionLoadMore } from '../../collection';\nimport { ChevronEndGlyph } from '../../glyphs';\nimport { RowContent } from '../../row';\nimport { rowStyles } from '../../row/styles';\nimport { mergeStatefulStyles, mergeStyles } from '../../styles/merge';\nimport { overlay, placementOf, popupOrigin } from '../../styles/overlay';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, radii, spacing, typography } from '../../tokens/design.tokens.stylex';\nimport Separator from '../separator';\n\n// The menus page's menu: a surface between 112 and 280 wide with a 4dp\n// corner and 8dp above and below its items, holding rows of the row module's\n// menu variant — 48dp tall, a label-large label, tertiary container when\n// selected. The surface itself is the overlay module's, shared with Popover\n// and Sheet, with the two things the menus page decides differently applied\n// over it: the corner, which is the extra-small step rather than the\n// medium one every other overlay takes, and the container colour, which is\n// the Expressive column's surface container low rather than the baseline's\n// surface container.\n//\n// Six parts, because everything a menu holds takes arbitrary content:\n// `Menu.Content`, `Menu.Item`, `Menu.Section`, `Menu.Separator`,\n// `Menu.Submenu` and `Menu.LoadMore`. A `Button` or `IconButton` placed\n// directly inside `Menu` is the trigger, wired through React Aria's context\n// rather than a part of ours — the same arrangement Sheet and Popover use.\n//\n// Four things are worth knowing about how this maps onto React Aria.\n//\n// **The item's styles are a function of its render state.** StyleX cannot\n// target `[data-selected]` on the element it is styling, so selection,\n// disabled and the rest are read from the state React Aria hands the\n// `className` function, wrapped in `mergeStatefulStyles` so a call site's own\n// `className` survives.\n//\n// **A shortcut goes through React Aria's `Keyboard` slot**, and the label\n// through its `Text` slot. The second is what makes the first work: React\n// Aria points the item's `aria-labelledby` at the labelled text, so a screen\n// reader reads the label alone and announces the keystroke separately. Left\n// as plain content, the item's name is its whole text and the shortcut is\n// read as part of what the item does. The keycap itself is the library's.\n//\n// **A submenu's arrow is drawn from render state, not from a prop.** React\n// Aria reports `hasSubmenu` on the item inside a `SubmenuTrigger`, so an item\n// that opens one gets the chevron without the call site saying so twice. The\n// glyph carries no direction of its own, so the style mirrors it under a\n// right-to-left writing mode.\n//\n// **A menu's children are a collection**, so anything that is not an item is\n// dropped: React Aria walks them looking for items and finds a search input\n// no place to be. `Menu.Content` therefore takes a `search` slot, drawn on\n// the surface above the items — which is also what puts the bar and the\n// items inside one `Autocomplete` when the menu is filtered.\n//\n// **A separator needs no slot from the call site.** React Aria's menu\n// provides the separator context, which is what `Menu.Separator` picks up —\n// that is why Separator moved onto React Aria in Phase 0. What is added here\n// is the menus page's 8dp either side of the rule.\n\nconst MENU_MIN = '112px';\nconst MENU_MAX = '280px';\nconst styles = {\n content: {\n kWkggS: \"x1vnz5z6\",\n kaIpWk: \"x1tfhd1\",\n ks0D6T: \"x1jkqq1h\",\n k7Eaqz: \"x1c7vg25\",\n k3XXqK: \"x1t137rt\",\n k8WAf4: \"x1cmllll\",\n $$css: true\n }\n};\ntype MenuAlign = OverlayAlign;\ntype MenuContentProps<T extends object = object> = {\n /** Where the menu lines up along that side. @default 'start' */\n align?: MenuAlign;\n /** Moves the menu along that side, in pixels. */\n alignOffset?: number;\n /** A function may compute the class from the menu's render state. */\n className?: RACMenuProps<T>['className'];\n /**\n * Where to portal the menu. Defaults to the end of `<body>`, which is right\n * for an app that sets its StyleX theme on `:root`. An app that scopes the\n * theme to a subtree has to point this at an element inside it, or the menu\n * renders outside the theme and falls back to the tokens'\n * `prefers-color-scheme` default.\n */\n container?: Element;\n /**\n * Content drawn on the surface above the items — a search bar that filters\n * them, usually. It goes here rather than among the children because a\n * menu's children are a collection: React Aria walks them for items and\n * drops anything else, so an input written beside them disappears.\n *\n * To filter with it, wrap this whole part in `Autocomplete`, which puts\n * the bar and the items inside one wrapper.\n */\n search?: ReactNode;\n /** Which side of the trigger the menu opens on. @default 'bottom' */\n side?: MenuSide;\n /** How far the menu sits from the trigger, in pixels. @default 8 */\n sideOffset?: number;\n /** A function may compute the style from the menu's render state. */\n style?: RACMenuProps<T>['style'];\n} & Omit<RACMenuProps<T>, 'className' | 'style'>;\ntype MenuItemProps<T extends object = object> = {\n /** The item's label — what it does. */\n children?: ReactNode;\n /** A function may compute the class from the item's render state. */\n className?: RACMenuItemProps<T>['className'];\n /** Content before the label, usually an icon. */\n leading?: ReactNode;\n /**\n * The keystroke that runs the item, drawn as a keycap at the end. Goes\n * through React Aria's keyboard slot, so a screen reader announces it\n * apart from the label rather than reading the two as one name.\n */\n shortcut?: ReactNode;\n /** A function may compute the style from the item's render state. */\n style?: RACMenuItemProps<T>['style'];\n /** Content after the label, before the shortcut. */\n trailing?: ReactNode;\n} & Omit<RACMenuItemProps<T>, 'children' | 'className' | 'style'>;\ntype MenuLoadMoreProps = Omit<RACMenuLoadMoreItemProps, 'children'> & {\n /**\n * What the row says while it is loading. Read by a screen reader; the ring\n * itself carries no text.\n * @default 'Loading more'\n */\n label?: string;\n};\n\n// `children` is optional here where React Aria makes it required, so the\n// type reads the way Sheet's and Popover's do: a root that composes rather\n// than one that has to be handed something. Sheet does the same for the same\n// reason.\ntype MenuProps = Omit<RACMenuTriggerProps, 'children'> & {\n /** The trigger, then the `Menu.Content` it opens. */\n children?: ReactNode;\n};\ntype MenuSectionProps<T extends object = object> = Omit<RACMenuSectionProps<T>, 'children'> & {\n /**\n * The items in the section. A section built from data puts React Aria's\n * `Collection` in here rather than a render function, since the header is\n * an element beside them.\n */\n children?: ReactNode;\n /**\n * The section's heading, rendered through React Aria's header so the\n * section is named by it. A section without one is a group with no name.\n */\n header?: ReactNode;\n};\ntype MenuSeparatorProps = Omit<ComponentProps<typeof Separator>, 'orientation'>;\ntype MenuSide = OverlaySide;\ntype MenuSubmenuProps = {\n /**\n * The item that opens the submenu, then the `Menu.Content` it opens.\n * Exactly those two, in that order.\n */\n children: ReactElement[];\n /**\n * How long the pointer rests on the item before the submenu opens, in\n * milliseconds.\n * @default 200\n */\n delay?: number;\n};\n\n// What the item draws, from React Aria's render state. Built by a call\n// rather than written inline at the prop, which is what react-perf's\n// no-new-function-as-prop is after; the React Compiler memoises the result\n// on its inputs.\n//\n// The render state decides two things: the chevron, which an item inside a\n// SubmenuTrigger gets without the call site asking twice, and the supporting\n// line's colour, which the row module takes from whether the row is selected\n// or disabled.\nfunction itemContent(children: ReactNode, leading: ReactNode, shortcut: ReactNode, trailing: ReactNode) {\n return (state: MenuItemRenderProps) => <RowContent isDisabled={state.isDisabled} isSelected={state.isSelected} leading={leading} trailing={trailingOf(state, shortcut, trailing)} variant=\"menu\">\n <Text slot=\"label\">{children}</Text>\n </RowContent>;\n}\n\n// StyleX cannot target `[data-selected]` on the element it is styling, so an\n// item's state comes from the render state React Aria hands its className.\n// The order matters: `disabled` is applied last so it wins over both the\n// interactive and the selected branches, and StyleX replaces a property\n// whole, so it takes their hover states with it.\nfunction itemStyles(state: MenuItemRenderProps) {\n return stylex.props(rowStyles.base, rowStyles.menu, rowStyles.interactive, state.isSelected && rowStyles.selectedMenu, state.isDisabled && rowStyles.disabled);\n}\n\n/**\n * A list of actions opened from a control. Open state is React Aria's: pass\n * `isOpen` with `onOpenChange` to control it, or `defaultOpen` to let it keep\n * its own.\n *\n * A `Button` or `IconButton` placed directly inside opens it; everything the\n * menu shows goes in `Menu.Content`, since the trigger lives in the page\n * while the menu is portalled out to the end of the body.\n *\n * ```tsx\n * <Menu>\n * <Button>Open</Button>\n * <Menu.Content aria-label=\"Label\">\n * <Menu.Item id=\"first\">First item</Menu.Item>\n * </Menu.Content>\n * </Menu>\n * ```\n */\nfunction Menu({\n children,\n ...props\n}: MenuProps) {\n return <RACMenuTrigger {...props}>{children}</RACMenuTrigger>;\n}\n\n/**\n * The menu itself, and the surface it is drawn on. React Aria names it after\n * the control that opened it, so `aria-label` here is ignored — name the\n * trigger instead.\n *\n * The call site's `className` and `style` land on the surface, which is the\n * element a layout positions.\n */\nfunction MenuContent<T extends object = object>({\n align = 'start',\n alignOffset,\n className,\n container,\n search,\n side = 'bottom',\n sideOffset = 8,\n style,\n ...props\n}: MenuContentProps<T>) {\n return <RACPopover crossOffset={alignOffset} offset={sideOffset} placement={placementOf(side, align)}\n // oxlint-disable-next-line typescript/no-deprecated -- its replacement, UNSAFE_PortalProvider, is not exported by react-aria-components\n UNSTABLE_portalContainer={container} {...mergeStatefulStyles(surfaceStyles, {})}>\n {search === undefined ? null : <div className=\"x9f619 xqf7pud xn60lsn\">{search}</div>}\n <RACMenu<T> {...props} {...mergeStatefulStyles({\n className: \"x9f619 x78zum5 xdt5ytf x1t137rt\"\n }, {\n className,\n style\n })} />\n </RACPopover>;\n}\n\n/**\n * One action. Its slots are the row's: `leading` before the label, the label\n * as children, and `trailing` after it, with `shortcut` at the end. An item\n * that opens a submenu draws the chevron itself.\n */\nfunction MenuItem<T extends object = object>({\n children,\n leading,\n shortcut,\n textValue,\n trailing,\n ...props\n}: MenuItemProps<T>) {\n return <RACMenuItem textValue={textValue ?? textOf(children)} {...props} {...mergeStatefulStyles(itemStyles, props)}>\n {itemContent(children, leading, shortcut, trailing)}\n </RACMenuItem>;\n}\n\n/**\n * The row shown while more items are being fetched. React Aria calls\n * `onLoadMore` when it comes into view, and draws it only while `isLoading`.\n */\nfunction MenuLoadMore({\n label = 'Loading more',\n ...props\n}: MenuLoadMoreProps) {\n return <RACMenuLoadMoreItem {...props} {...mergeStyles({\n className: \"x6s0dn4 x9f619 x78zum5 xl56j7k x1wxaq2x\"\n }, props)}>\n <CollectionLoadMore label={label} size=\"20px\" />\n </RACMenuLoadMoreItem>;\n}\n\n/**\n * A named group of items. `header` names it, and is what a screen reader\n * reads before the items inside.\n */\nfunction MenuSection<T extends object = object>({\n children,\n header,\n ...props\n}: MenuSectionProps<T>) {\n return <RACMenuSection {...props}>\n {header === undefined ? null : <Header className=\"x9f619 x1w5n3ug xrgwony x12s497w x1szcwkt xo803ec xyl1r0q xw3mh6e x6gmt8y x790zyz\">{header}</Header>}\n {children}\n </RACMenuSection>;\n}\n\n/**\n * A rule between groups of items. It takes its role from the menu around it,\n * so it needs no slot from the call site.\n */\nfunction MenuSeparator(props: MenuSeparatorProps) {\n return <Separator {...props} {...mergeStyles({\n className: \"xwpi13i\"\n }, props)} />;\n}\n\n/**\n * An item that opens a menu of its own. Takes exactly two children: the\n * `Menu.Item` that opens it, then the `Menu.Content` it opens.\n */\nfunction MenuSubmenu(props: MenuSubmenuProps) {\n return <RACSubmenuTrigger {...props} />;\n}\n\n// The surface grows from the edge it is anchored by, which is what makes it\n// read as coming out of the trigger. Built by a call rather than written\n// inline at the prop, which is what react-perf's no-new-function-as-prop is\n// after.\nfunction surfaceStyles(state: PopoverRenderProps) {\n return stylex.props(overlay.popup, styles.content, popupOrigin(state.placement));\n}\n\n// What the item is worth as text, for the typeahead React Aria drives from\n// an item's words rather than its element. It reads it off the children when\n// they are a string and finds nothing when they are not — and an item here\n// is always an element, since the row wraps its label. So a plain-string\n// label becomes the text value, and anything else has to say what it is\n// worth through `textValue`.\nfunction textOf(children: ReactNode) {\n return typeof children === 'string' ? children : undefined;\n}\n\n/** What sits after the label: the call site's content, then the shortcut or\n * the submenu's chevron. */\nfunction trailingOf(state: MenuItemRenderProps, shortcut: ReactNode, trailing: ReactNode) {\n if (state.hasSubmenu) {\n return <>\n {trailing}\n <ChevronEndGlyph className=\"x1qx5ct2 xw4jnvo x19axjrm x1c071of\" />\n </>;\n }\n if (shortcut === undefined && trailing === undefined) {\n return undefined;\n }\n return <>\n {trailing}\n {shortcut === undefined ? null : <Keyboard className=\"x1w5n3ug\">{shortcut}</Keyboard>}\n </>;\n}\nMenu.Content = MenuContent;\nMenu.Item = MenuItem;\nMenu.LoadMore = MenuLoadMore;\nMenu.Section = MenuSection;\nMenu.Separator = MenuSeparator;\nMenu.Submenu = MenuSubmenu;\nexport type { MenuAlign, MenuContentProps, MenuItemProps, MenuLoadMoreProps, MenuProps, MenuSectionProps, MenuSeparatorProps, MenuSide, MenuSubmenuProps };\nexport default Menu;"],"mappings":";;;;;;;;;;;;AAiEA,MAAMmD,SAAS,EACbC,SAAS;CACPC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,QAAQ;CACRC,OAAO;AACT,EACF;AA2GA,SAASyB,YAAYV,UAAqBC,SAAoBC,UAAqBC,UAAq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merge.js";
|
|
|
3
3
|
import { ChevronEndGlyph } from "../../glyphs/index.js";
|
|
4
4
|
import { focus } from "../../styles/focus.js";
|
|
5
5
|
import { rowStyles } from "../../row/styles.js";
|
|
6
|
+
import { collectionStyles } from "../../collection/styles.js";
|
|
6
7
|
import { RowContent } from "../../row/index.js";
|
|
7
8
|
import { c } from "react/compiler-runtime";
|
|
8
9
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -90,21 +91,21 @@ function leadingFor(state, leading) {
|
|
|
90
91
|
* The call site's `className` and `style` land on the container, which is
|
|
91
92
|
* the element a layout positions.
|
|
92
93
|
*/
|
|
93
|
-
function NavigationTree$1(props) {
|
|
94
|
+
function NavigationTree$1(props$1) {
|
|
94
95
|
const $ = c(5);
|
|
95
96
|
let t0;
|
|
96
|
-
if ($[0] !== props) {
|
|
97
|
-
t0 = mergeStatefulStyles(
|
|
98
|
-
$[0] = props;
|
|
97
|
+
if ($[0] !== props$1) {
|
|
98
|
+
t0 = mergeStatefulStyles(props(collectionStyles.container), props$1);
|
|
99
|
+
$[0] = props$1;
|
|
99
100
|
$[1] = t0;
|
|
100
101
|
} else t0 = $[1];
|
|
101
102
|
let t1;
|
|
102
|
-
if ($[2] !== props || $[3] !== t0) {
|
|
103
|
+
if ($[2] !== props$1 || $[3] !== t0) {
|
|
103
104
|
t1 = /* @__PURE__ */ jsx(NavigationTree, {
|
|
104
|
-
...props,
|
|
105
|
+
...props$1,
|
|
105
106
|
...t0
|
|
106
107
|
});
|
|
107
|
-
$[2] = props;
|
|
108
|
+
$[2] = props$1;
|
|
108
109
|
$[3] = t0;
|
|
109
110
|
$[4] = t1;
|
|
110
111
|
} else t1 = $[4];
|
|
@@ -228,12 +229,12 @@ function NavigationTreeSection$1(t0) {
|
|
|
228
229
|
let t1;
|
|
229
230
|
let t2;
|
|
230
231
|
if ($[0] !== t0) {
|
|
231
|
-
const { children: t3, header: t4, ...props } = t0;
|
|
232
|
+
const { children: t3, header: t4, ...props$2 } = t0;
|
|
232
233
|
children = t3;
|
|
233
234
|
header = t4;
|
|
234
235
|
T0 = NavigationTreeSection;
|
|
235
|
-
t1 = props;
|
|
236
|
-
t2 = mergeStyles(
|
|
236
|
+
t1 = props$2;
|
|
237
|
+
t2 = mergeStyles(props(collectionStyles.section), props$2);
|
|
237
238
|
$[0] = t0;
|
|
238
239
|
$[1] = T0;
|
|
239
240
|
$[2] = children;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["ReactNode","NavigationTreeItemRenderProps","NavigationTreeItemProps","RACNavigationTreeItemProps","NavigationTreeProps","RACNavigationTreeProps","stylex","Button","RACButton","NavigationTree","RACNavigationTree","NavigationTreeHeader","RACNavigationTreeHeader","NavigationTreeItem","RACNavigationTreeItem","NavigationTreeItemContent","RACNavigationTreeItemContent","NavigationTreeSection","RACNavigationTreeSection","ChevronEndGlyph","RowContent","rowStyles","focus","mergeStatefulStyles","mergeStyles","colors","motion","radii","spacing","typography","styles","chevron","kGNEyG","kWkggS","kaIpWk","kMzoRj","kB7OPa","kMwMTN","kkrTdU","k1xSpc","kmuXW","kjj79g","kmVPX3","$$css","currentAncestor","k63SB2","indent","kZCmMZ","NavigationTreeHeaderProps","children","NavigationTreeItemText","Omit","T","className","leading","style","supporting","trailing","label","textValue","NavigationTreeSectionProps","Parameters","header","chevronClassName","props","ring","chevronFor","state","hasChildItems","isExpanded","itemContent","isDisabled","isCurrent","leadingFor","itemStyles","base","drawer","interactive","isCurrentAncestor","selectedDrawer","disabled","$","_c","t0","t1","T0","t2","t3","t4","t5","t6","t7","t8","textValueFor","undefined","Item","Section"],"sources":["../../../src/components/navigation-tree/index.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type { NavigationTreeItemRenderProps, NavigationTreeItemProps as RACNavigationTreeItemProps, NavigationTreeProps as RACNavigationTreeProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { Button as RACButton, NavigationTree as RACNavigationTree, NavigationTreeHeader as RACNavigationTreeHeader, NavigationTreeItem as RACNavigationTreeItem, NavigationTreeItemContent as RACNavigationTreeItemContent, NavigationTreeSection as RACNavigationTreeSection } from 'react-aria-components';\nimport { ChevronEndGlyph } from '../../glyphs';\nimport { RowContent } from '../../row';\nimport { rowStyles } from '../../row/styles';\nimport { focus } from '../../styles/focus';\nimport { mergeStatefulStyles, mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, motion, radii, spacing, typography } from '../../tokens/design.tokens.stylex';\n\n// The navigation drawer page's contents: a nested set of links with the\n// current one marked. Each row is the row every list here draws — `src/row`,\n// shared with ListItem, ListBox, List, Tree and Disclosure — under that\n// module's `drawer` variant, which is the page's own 56dp row with a\n// label-large label and a secondary-container pill on the current one.\n//\n// This is Tree's shape over React Aria's navigation primitive, and the\n// difference is what the two are for. A tree selects: rows are chosen and\n// the choice is reported. A navigation tree navigates: each row is a link,\n// and which one is current is decided by matching the route rather than by\n// anything the reader selected. So this takes `selectedRoute` where Tree\n// takes `selectedKeys`, and has no selection at all — React Aria omits every\n// selection prop from it.\n//\n// Three things are this component's own.\n//\n// **A level indents by one caret's width**, exactly as Tree does and for the\n// same reason: React Aria writes the depth on each row as a custom property,\n// and 24dp is the size the drawer page gives its icon, so a level of nesting\n// is as wide as the glyph beside it.\n//\n// **An ancestor of the current row is marked too, and softly.** React Aria\n// reports it, and a drawer whose current row is collapsed out of sight would\n// otherwise show nothing at all. It takes the label's weight rather than the\n// pill, so the trail reads as a trail rather than as a second current row.\n//\n// **The pill's shape is the library's own.** The page gives the active\n// indicator's colour, height and width but keeps its shape behind a token\n// set that does not open to a script — the same gap recorded on the buttons\n// and lists pages. It is drawn as a full pill, which is what the page's own\n// images show and what 56dp of height comes to.\n\nconst styles = {\n chevron: {\n kGNEyG: \"x6s0dn4\",\n kWkggS: \"xjbqb8w\",\n kaIpWk: \"x3y1ksm\",\n kMzoRj: \"xc342km\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x1heor9g\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x78zum5\",\n kmuXW: \"x2lah0s\",\n kjj79g: \"xl56j7k\",\n kmVPX3: \"x1717udv\",\n $$css: true\n },\n currentAncestor: {\n k63SB2: \"x1bf3uqz\",\n $$css: true\n },\n indent: {\n kZCmMZ: \"x1187sqy\",\n $$css: true\n }\n};\ntype NavigationTreeHeaderProps = {\n /** The section's heading. */\n children?: ReactNode;\n};\ntype NavigationTreeItemProps<T extends object = object> = NavigationTreeItemText & Omit<RACNavigationTreeItemProps<T>, 'children' | 'className' | 'style' | 'textValue'> & {\n /** The rows nested under this one, as further `NavigationTree.Item` entries. */\n children?: ReactNode;\n /** A function may compute the class from the row's render state. */\n className?: RACNavigationTreeItemProps<T>['className'];\n /** Content before the label: an icon. */\n leading?: ReactNode;\n /** A function may compute the style from the row's render state. */\n style?: RACNavigationTreeItemProps<T>['style'];\n /** A second line under the label, in the muted role. */\n supporting?: ReactNode;\n /** Content after the label, such as a count. */\n trailing?: ReactNode;\n};\n\n// What the row is worth as text, which React Aria requires: a row here wraps\n// its label in elements, so it cannot read one off the children the way a\n// plain-string child would give it. A string label is taken as the value,\n// which is the common case; anything else has to say what it is worth, and\n// this is what makes the compiler ask rather than leaving a row unnamed.\ntype NavigationTreeItemText = {\n /** The row's label — where it goes. */\n label: string;\n /** What typeahead matches the row on. Defaults to the label. */\n textValue?: string;\n} | {\n /** The row's label, as something other than a plain string. */\n label?: ReactNode;\n /** What typeahead matches the row on, and what names it. */\n textValue: string;\n};\ntype NavigationTreeProps<T extends object> = Omit<RACNavigationTreeProps<T>, 'className' | 'style'> & {\n /** A function may compute the class from the tree's render state. */\n className?: RACNavigationTreeProps<T>['className'];\n /** A function may compute the style from the tree's render state. */\n style?: RACNavigationTreeProps<T>['style'];\n};\ntype NavigationTreeSectionProps<T extends object = object> = Omit<Parameters<typeof RACNavigationTreeSection<T>>[0], 'children'> & {\n /**\n * The rows in the section. A section built from data puts React Aria's\n * `Collection` in here rather than a render function, since the header is\n * an element beside them.\n */\n children?: ReactNode;\n /**\n * The section's heading, rendered through React Aria's header so the\n * section is named by it. A section without one is a group with no name.\n */\n header?: ReactNode;\n};\n\n// The button itself never turns — the glyph inside it does, so the press\n// target stays a square whichever way the row is pointing.\nfunction chevronClassName() {\n return stylex.props(styles.chevron, focus.ring).className ?? '';\n}\n\n// The caret, or the space it would have taken. Written as a call rather than\n// inline at the prop, which is what react-perf's no-new-function-as-prop and\n// jsx-no-jsx-as-prop are after; the React Compiler memoises the result on\n// its inputs.\n//\n// A leaf gets the space rather than nothing, so its label lines up with the\n// label of a sibling that opens.\nfunction chevronFor(state: NavigationTreeItemRenderProps): ReactNode {\n if (!state.hasChildItems) {\n return <span className=\"xxk0z11 x2lah0s xvy4d1p\" />;\n }\n return <RACButton className={chevronClassName} slot=\"chevron\">\n <ChevronEndGlyph {...{\n 0: {\n className: \"xxk0z11 xvy4d1p x19axjrm x1c071of xkzkux9 x11xpdln xpc4ca7\"\n },\n 1: {\n className: \"xxk0z11 xvy4d1p xkzkux9 x11xpdln xpc4ca7 x1y10d4b x1iffjtl\"\n }\n }[!!state.isExpanded << 0]} />\n </RACButton>;\n}\n\n// What a row draws, from React Aria's render state. The caret comes first,\n// then whatever the row was given — one order, always, which is what keeps a\n// column of rows reading down.\nfunction itemContent(label: ReactNode, leading: ReactNode, supporting: ReactNode, trailing: ReactNode) {\n return (state: NavigationTreeItemRenderProps): ReactNode => <RowContent isDisabled={state.isDisabled} isSelected={state.isCurrent} leading={leadingFor(state, leading)} supporting={supporting} trailing={trailing} variant=\"drawer\">\n {label}\n </RowContent>;\n}\n\n// StyleX cannot target `[data-current]` on the element it is styling, so a\n// row's state comes from the render state React Aria hands its className.\n// The order matters: `disabled` is applied last so it wins over both the\n// interactive and the current branches, and StyleX replaces a property\n// whole, so it takes their hover states with it.\nfunction itemStyles(state: NavigationTreeItemRenderProps) {\n return stylex.props(rowStyles.base, rowStyles.drawer, rowStyles.interactive, styles.indent, state.isCurrentAncestor && styles.currentAncestor, state.isCurrent && rowStyles.selectedDrawer, state.isDisabled && rowStyles.disabled);\n}\n\n/**\n * The caret, then whatever the row was given. Its return type is written out\n * rather than inferred: `ReactNode` is a union that includes a promise, and\n * a function inferred as returning one has to be `async`.\n */\nfunction leadingFor(state: NavigationTreeItemRenderProps, leading: ReactNode): ReactNode {\n return <>\n {chevronFor(state)}\n {leading}\n </>;\n}\n\n/**\n * A nested set of links, with the current one marked. Which row is current\n * is React Aria's: give the tree a `selectedRoute` and each row an `href`,\n * and the row whose `href` matches is the current one — its ancestors are\n * marked too, so a collapsed trail still shows where you are.\n *\n * ```tsx\n * <NavigationTree aria-label=\"Label\" selectedRoute=\"#second\">\n * <NavigationTree.Item href=\"#first\" id=\"first\" label=\"First item\">\n * <NavigationTree.Item href=\"#second\" id=\"second\" label=\"Second item\" />\n * </NavigationTree.Item>\n * </NavigationTree>\n * ```\n *\n * There is no selection here, and that is React Aria's design rather than an\n * omission: a navigation tree navigates, so what is current comes from the\n * route rather than from anything the reader picked. `Tree` is the one that\n * selects.\n *\n * The call site's `className` and `style` land on the container, which is\n * the element a layout positions.\n */\nfunction NavigationTree<T extends object>(props: NavigationTreeProps<T>) {\n return <RACNavigationTree<T> {...props} {...mergeStatefulStyles({\n className: \"x9f619 x78zum5 xdt5ytf x1t137rt x1cmllll\"\n }, props)} />;\n}\n\n/**\n * A named group of rows. `header` names it, and is what a screen reader\n * reads before the rows inside.\n */\nfunction NavigationTreeHeader({\n children\n}: NavigationTreeHeaderProps) {\n return <RACNavigationTreeHeader className=\"x9f619 x1w5n3ug xkknnkr x14zspaw x1v9cpvo x155f00i x1lz68p4 xw3mh6e x1clyivc x140yoea\">\n {children}\n </RACNavigationTreeHeader>;\n}\n\n/**\n * One row, and the rows under it. Give it an `href` — that is what\n * `selectedRoute` is matched against — and an `id`, which is the key\n * expansion is reported by.\n *\n * Rows nested as `children` are what make it a branch; a row with none is a\n * leaf and draws no caret.\n */\nfunction NavigationTreeItem<T extends object = object>({\n children,\n label,\n leading,\n supporting,\n textValue,\n trailing,\n ...props\n}: NavigationTreeItemProps<T>) {\n return <RACNavigationTreeItem<T> textValue={textValueFor(textValue, label)} {...props} {...mergeStatefulStyles(itemStyles, props)}>\n <RACNavigationTreeItemContent>\n {itemContent(label, leading, supporting, trailing)}\n </RACNavigationTreeItemContent>\n {children}\n </RACNavigationTreeItem>;\n}\n\n/**\n * A named group of rows, with its heading above them.\n */\nfunction NavigationTreeSection<T extends object = object>({\n children,\n header,\n ...props\n}: NavigationTreeSectionProps<T>) {\n return <RACNavigationTreeSection<T> {...props} {...mergeStyles({\n className: \"x9f619 x78zum5 xdt5ytf\"\n }, props)}>\n {header === undefined ? null : <NavigationTreeHeader>{header}</NavigationTreeHeader>}\n {children}\n </RACNavigationTreeSection>;\n}\n\n// What React Aria matches typeahead on, and what names the row.\n// `NavigationTreeItemText` makes one of the two a string, so the last branch\n// is unreachable through the public type — it is there because destructuring\n// the two apart is what loses the narrowing, not because a row can arrive\n// without either.\nfunction textValueFor(textValue: string | undefined, label: ReactNode) {\n if (textValue !== undefined) {\n return textValue;\n }\n return typeof label === 'string' ? label : '';\n}\nNavigationTree.Item = NavigationTreeItem;\nNavigationTree.Section = NavigationTreeSection;\nexport type { NavigationTreeHeaderProps, NavigationTreeItemProps, NavigationTreeProps, NavigationTreeSectionProps };\nexport default NavigationTree;"],"mappings":";;;;;;;;;;AA4CA,MAAM8B,SAAS;CACbC,SAAS;EACPC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;EACPC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,iBAAiB;EACfC,QAAQ;EACRF,OAAO;CACT;CACAG,QAAQ;EACNC,QAAQ;EACRJ,OAAO;CACT;AACF;AA0DA,SAASoB,mBAAmB;CAC1B,OAAOzD,MAAawB,OAAOC,SAAST,MA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AAAH,EAAA,MAAAK;EAAAL,EAAA,MAAAM;EAAAN,EAAA,MAAAO;CAAA,OAAAA,KAAAP,EAAA;CAAA,OALtBO;AAKsB;AAQ/B,SAASK,aAAalC,WAA+BD,OAAkB;CACrE,IAAIC,cAAcmC,KAAAA,GAChB,OAAOnC;CAET,OAAO,OAAOD,UAAU,WAAWA,QAAQ;AAC7C;AACAjD,iBAAesF,OAAOlF;AACtBJ,iBAAeuF,UAAU/E"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["ReactNode","NavigationTreeItemRenderProps","NavigationTreeItemProps","RACNavigationTreeItemProps","NavigationTreeProps","RACNavigationTreeProps","stylex","Button","RACButton","NavigationTree","RACNavigationTree","NavigationTreeHeader","RACNavigationTreeHeader","NavigationTreeItem","RACNavigationTreeItem","NavigationTreeItemContent","RACNavigationTreeItemContent","NavigationTreeSection","RACNavigationTreeSection","collectionStyles","ChevronEndGlyph","RowContent","rowStyles","focus","mergeStatefulStyles","mergeStyles","colors","motion","radii","spacing","typography","styles","chevron","kGNEyG","kWkggS","kaIpWk","kMzoRj","kB7OPa","kMwMTN","kkrTdU","k1xSpc","kmuXW","kjj79g","kmVPX3","$$css","currentAncestor","k63SB2","indent","kZCmMZ","NavigationTreeHeaderProps","children","NavigationTreeItemText","Omit","T","className","leading","style","supporting","trailing","label","textValue","NavigationTreeSectionProps","Parameters","header","chevronClassName","props","ring","chevronFor","state","hasChildItems","isExpanded","itemContent","isDisabled","isCurrent","leadingFor","itemStyles","base","drawer","interactive","isCurrentAncestor","selectedDrawer","disabled","$","_c","t0","container","t1","T0","t2","t3","t4","t5","t6","t7","t8","textValueFor","section","undefined","Item","Section"],"sources":["../../../src/components/navigation-tree/index.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type { NavigationTreeItemRenderProps, NavigationTreeItemProps as RACNavigationTreeItemProps, NavigationTreeProps as RACNavigationTreeProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { Button as RACButton, NavigationTree as RACNavigationTree, NavigationTreeHeader as RACNavigationTreeHeader, NavigationTreeItem as RACNavigationTreeItem, NavigationTreeItemContent as RACNavigationTreeItemContent, NavigationTreeSection as RACNavigationTreeSection } from 'react-aria-components';\nimport { collectionStyles } from '../../collection/styles';\nimport { ChevronEndGlyph } from '../../glyphs';\nimport { RowContent } from '../../row';\nimport { rowStyles } from '../../row/styles';\nimport { focus } from '../../styles/focus';\nimport { mergeStatefulStyles, mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { colors, motion, radii, spacing, typography } from '../../tokens/design.tokens.stylex';\n\n// The navigation drawer page's contents: a nested set of links with the\n// current one marked. Each row is the row every list here draws — `src/row`,\n// shared with ListItem, ListBox, List, Tree and Disclosure — under that\n// module's `drawer` variant, which is the page's own 56dp row with a\n// label-large label and a secondary-container pill on the current one.\n//\n// This is Tree's shape over React Aria's navigation primitive, and the\n// difference is what the two are for. A tree selects: rows are chosen and\n// the choice is reported. A navigation tree navigates: each row is a link,\n// and which one is current is decided by matching the route rather than by\n// anything the reader selected. So this takes `selectedRoute` where Tree\n// takes `selectedKeys`, and has no selection at all — React Aria omits every\n// selection prop from it.\n//\n// Three things are this component's own.\n//\n// **A level indents by one caret's width**, exactly as Tree does and for the\n// same reason: React Aria writes the depth on each row as a custom property,\n// and 24dp is the size the drawer page gives its icon, so a level of nesting\n// is as wide as the glyph beside it.\n//\n// **An ancestor of the current row is marked too, and softly.** React Aria\n// reports it, and a drawer whose current row is collapsed out of sight would\n// otherwise show nothing at all. It takes the label's weight rather than the\n// pill, so the trail reads as a trail rather than as a second current row.\n//\n// **The pill's shape is the library's own.** The page gives the active\n// indicator's colour, height and width but keeps its shape behind a token\n// set that does not open to a script — the same gap recorded on the buttons\n// and lists pages. It is drawn as a full pill, which is what the page's own\n// images show and what 56dp of height comes to.\n\nconst styles = {\n chevron: {\n kGNEyG: \"x6s0dn4\",\n kWkggS: \"xjbqb8w\",\n kaIpWk: \"x3y1ksm\",\n kMzoRj: \"xc342km\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x1heor9g\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x78zum5\",\n kmuXW: \"x2lah0s\",\n kjj79g: \"xl56j7k\",\n kmVPX3: \"x1717udv\",\n $$css: true\n },\n currentAncestor: {\n k63SB2: \"x1bf3uqz\",\n $$css: true\n },\n indent: {\n kZCmMZ: \"x1187sqy\",\n $$css: true\n }\n};\ntype NavigationTreeHeaderProps = {\n /** The section's heading. */\n children?: ReactNode;\n};\ntype NavigationTreeItemProps<T extends object = object> = NavigationTreeItemText & Omit<RACNavigationTreeItemProps<T>, 'children' | 'className' | 'style' | 'textValue'> & {\n /** The rows nested under this one, as further `NavigationTree.Item` entries. */\n children?: ReactNode;\n /** A function may compute the class from the row's render state. */\n className?: RACNavigationTreeItemProps<T>['className'];\n /** Content before the label: an icon. */\n leading?: ReactNode;\n /** A function may compute the style from the row's render state. */\n style?: RACNavigationTreeItemProps<T>['style'];\n /** A second line under the label, in the muted role. */\n supporting?: ReactNode;\n /** Content after the label, such as a count. */\n trailing?: ReactNode;\n};\n\n// What the row is worth as text, which React Aria requires: a row here wraps\n// its label in elements, so it cannot read one off the children the way a\n// plain-string child would give it. A string label is taken as the value,\n// which is the common case; anything else has to say what it is worth, and\n// this is what makes the compiler ask rather than leaving a row unnamed.\ntype NavigationTreeItemText = {\n /** The row's label — where it goes. */\n label: string;\n /** What typeahead matches the row on. Defaults to the label. */\n textValue?: string;\n} | {\n /** The row's label, as something other than a plain string. */\n label?: ReactNode;\n /** What typeahead matches the row on, and what names it. */\n textValue: string;\n};\ntype NavigationTreeProps<T extends object> = Omit<RACNavigationTreeProps<T>, 'className' | 'style'> & {\n /** A function may compute the class from the tree's render state. */\n className?: RACNavigationTreeProps<T>['className'];\n /** A function may compute the style from the tree's render state. */\n style?: RACNavigationTreeProps<T>['style'];\n};\ntype NavigationTreeSectionProps<T extends object = object> = Omit<Parameters<typeof RACNavigationTreeSection<T>>[0], 'children'> & {\n /**\n * The rows in the section. A section built from data puts React Aria's\n * `Collection` in here rather than a render function, since the header is\n * an element beside them.\n */\n children?: ReactNode;\n /**\n * The section's heading, rendered through React Aria's header so the\n * section is named by it. A section without one is a group with no name.\n */\n header?: ReactNode;\n};\n\n// The button itself never turns — the glyph inside it does, so the press\n// target stays a square whichever way the row is pointing.\nfunction chevronClassName() {\n return stylex.props(styles.chevron, focus.ring).className ?? '';\n}\n\n// The caret, or the space it would have taken. Written as a call rather than\n// inline at the prop, which is what react-perf's no-new-function-as-prop and\n// jsx-no-jsx-as-prop are after; the React Compiler memoises the result on\n// its inputs.\n//\n// A leaf gets the space rather than nothing, so its label lines up with the\n// label of a sibling that opens.\nfunction chevronFor(state: NavigationTreeItemRenderProps): ReactNode {\n if (!state.hasChildItems) {\n return <span className=\"xxk0z11 x2lah0s xvy4d1p\" />;\n }\n return <RACButton className={chevronClassName} slot=\"chevron\">\n <ChevronEndGlyph {...{\n 0: {\n className: \"xxk0z11 xvy4d1p x19axjrm x1c071of xkzkux9 x11xpdln xpc4ca7\"\n },\n 1: {\n className: \"xxk0z11 xvy4d1p xkzkux9 x11xpdln xpc4ca7 x1y10d4b x1iffjtl\"\n }\n }[!!state.isExpanded << 0]} />\n </RACButton>;\n}\n\n// What a row draws, from React Aria's render state. The caret comes first,\n// then whatever the row was given — one order, always, which is what keeps a\n// column of rows reading down.\nfunction itemContent(label: ReactNode, leading: ReactNode, supporting: ReactNode, trailing: ReactNode) {\n return (state: NavigationTreeItemRenderProps): ReactNode => <RowContent isDisabled={state.isDisabled} isSelected={state.isCurrent} leading={leadingFor(state, leading)} supporting={supporting} trailing={trailing} variant=\"drawer\">\n {label}\n </RowContent>;\n}\n\n// StyleX cannot target `[data-current]` on the element it is styling, so a\n// row's state comes from the render state React Aria hands its className.\n// The order matters: `disabled` is applied last so it wins over both the\n// interactive and the current branches, and StyleX replaces a property\n// whole, so it takes their hover states with it.\nfunction itemStyles(state: NavigationTreeItemRenderProps) {\n return stylex.props(rowStyles.base, rowStyles.drawer, rowStyles.interactive, styles.indent, state.isCurrentAncestor && styles.currentAncestor, state.isCurrent && rowStyles.selectedDrawer, state.isDisabled && rowStyles.disabled);\n}\n\n/**\n * The caret, then whatever the row was given. Its return type is written out\n * rather than inferred: `ReactNode` is a union that includes a promise, and\n * a function inferred as returning one has to be `async`.\n */\nfunction leadingFor(state: NavigationTreeItemRenderProps, leading: ReactNode): ReactNode {\n return <>\n {chevronFor(state)}\n {leading}\n </>;\n}\n\n/**\n * A nested set of links, with the current one marked. Which row is current\n * is React Aria's: give the tree a `selectedRoute` and each row an `href`,\n * and the row whose `href` matches is the current one — its ancestors are\n * marked too, so a collapsed trail still shows where you are.\n *\n * ```tsx\n * <NavigationTree aria-label=\"Label\" selectedRoute=\"#second\">\n * <NavigationTree.Item href=\"#first\" id=\"first\" label=\"First item\">\n * <NavigationTree.Item href=\"#second\" id=\"second\" label=\"Second item\" />\n * </NavigationTree.Item>\n * </NavigationTree>\n * ```\n *\n * There is no selection here, and that is React Aria's design rather than an\n * omission: a navigation tree navigates, so what is current comes from the\n * route rather than from anything the reader picked. `Tree` is the one that\n * selects.\n *\n * The call site's `className` and `style` land on the container, which is\n * the element a layout positions.\n */\nfunction NavigationTree<T extends object>(props: NavigationTreeProps<T>) {\n return <RACNavigationTree<T> {...props} {...mergeStatefulStyles(stylex.props(collectionStyles.container), props)} />;\n}\n\n/**\n * A named group of rows. `header` names it, and is what a screen reader\n * reads before the rows inside.\n */\nfunction NavigationTreeHeader({\n children\n}: NavigationTreeHeaderProps) {\n return <RACNavigationTreeHeader className=\"x9f619 x1w5n3ug xkknnkr x14zspaw x1v9cpvo x155f00i x1lz68p4 xw3mh6e x1clyivc x140yoea\">\n {children}\n </RACNavigationTreeHeader>;\n}\n\n/**\n * One row, and the rows under it. Give it an `href` — that is what\n * `selectedRoute` is matched against — and an `id`, which is the key\n * expansion is reported by.\n *\n * Rows nested as `children` are what make it a branch; a row with none is a\n * leaf and draws no caret.\n */\nfunction NavigationTreeItem<T extends object = object>({\n children,\n label,\n leading,\n supporting,\n textValue,\n trailing,\n ...props\n}: NavigationTreeItemProps<T>) {\n return <RACNavigationTreeItem<T> textValue={textValueFor(textValue, label)} {...props} {...mergeStatefulStyles(itemStyles, props)}>\n <RACNavigationTreeItemContent>\n {itemContent(label, leading, supporting, trailing)}\n </RACNavigationTreeItemContent>\n {children}\n </RACNavigationTreeItem>;\n}\n\n/**\n * A named group of rows, with its heading above them.\n */\nfunction NavigationTreeSection<T extends object = object>({\n children,\n header,\n ...props\n}: NavigationTreeSectionProps<T>) {\n return <RACNavigationTreeSection<T> {...props} {...mergeStyles(stylex.props(collectionStyles.section), props)}>\n {header === undefined ? null : <NavigationTreeHeader>{header}</NavigationTreeHeader>}\n {children}\n </RACNavigationTreeSection>;\n}\n\n// What React Aria matches typeahead on, and what names the row.\n// `NavigationTreeItemText` makes one of the two a string, so the last branch\n// is unreachable through the public type — it is there because destructuring\n// the two apart is what loses the narrowing, not because a row can arrive\n// without either.\nfunction textValueFor(textValue: string | undefined, label: ReactNode) {\n if (textValue !== undefined) {\n return textValue;\n }\n return typeof label === 'string' ? label : '';\n}\nNavigationTree.Item = NavigationTreeItem;\nNavigationTree.Section = NavigationTreeSection;\nexport type { NavigationTreeHeaderProps, NavigationTreeItemProps, NavigationTreeProps, NavigationTreeSectionProps };\nexport default NavigationTree;"],"mappings":";;;;;;;;;;;AA6CA,MAAM+B,SAAS;CACbC,SAAS;EACPC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;EACPC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,iBAAiB;EACfC,QAAQ;EACRF,OAAO;CACT;CACAG,QAAQ;EACNC,QAAQ;EACRJ,OAAO;CACT;AACF;AA0DA,SAASoB,mBAAmB;CAC1B,OAAO1D,MAAayB,OAAOC,SAAST,MAAM2C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,EAAA,MAAAI;EAAAJ,EAAA,MAAAM;EAAAN,EAAA,MAAAO;EAAAP,EAAA,MAAAQ;CAAA,OAAAA,KAAAR,EAAA;CAAA,OAHtBQ;AAGsB;AAQ/B,SAASK,aAAanC,WAA+BD,OAAkB;CACrE,IAAIC,cAAcqC,KAAAA,GAChB,OAAOrC;CAET,OAAO,OAAOD,UAAU,WAAWA,QAAQ;AAC7C;AACAlD,iBAAeyF,OAAOrF;AACtBJ,iBAAe0F,UAAUlF"}
|
|
@@ -2,7 +2,10 @@ import { props } from "../../node_modules/@stylexjs/stylex/lib/es/stylex.js";
|
|
|
2
2
|
import { mergeStatefulStyles } from "../../styles/merge.js";
|
|
3
3
|
import { focus } from "../../styles/focus.js";
|
|
4
4
|
import { useRipple } from "../../hooks/useRipple.js";
|
|
5
|
+
import { controlStyles } from "../../control/styles.js";
|
|
6
|
+
import { ControlLabel } from "../../control/index.js";
|
|
5
7
|
import { invalidFrom, useFieldValidationBehavior } from "../../field/root.js";
|
|
8
|
+
import { groupStyles } from "../../field/styles.js";
|
|
6
9
|
import { FieldLabel, FieldMessage } from "../../field/index.js";
|
|
7
10
|
import { c } from "react/compiler-runtime";
|
|
8
11
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -10,30 +13,7 @@ import { RadioButton, RadioField, RadioGroup } from "react-aria-components";
|
|
|
10
13
|
//#region src/components/radio-group/index.tsx
|
|
11
14
|
const styles = {
|
|
12
15
|
control: {
|
|
13
|
-
kGNEyG: "x6s0dn4",
|
|
14
|
-
kWkggS: "xjbqb8w",
|
|
15
|
-
kZKoxP: "x1vqgdyp",
|
|
16
|
-
kaIpWk: "x3y1ksm",
|
|
17
|
-
kB7OPa: "x9f619",
|
|
18
16
|
kMwMTN: "x1w5n3ug",
|
|
19
|
-
kkrTdU: "x1ypdohk",
|
|
20
|
-
k1xSpc: "x78zum5",
|
|
21
|
-
kmuXW: "x2lah0s",
|
|
22
|
-
kzqmXN: "x100vrsf",
|
|
23
|
-
kjj79g: "xl56j7k",
|
|
24
|
-
kVAEAm: "x1n2onr6",
|
|
25
|
-
kIyJzY: "x1qno0dh",
|
|
26
|
-
k1ekBW: "x15406qy",
|
|
27
|
-
kAMwcw: "xpc4ca7",
|
|
28
|
-
$$css: true
|
|
29
|
-
},
|
|
30
|
-
controlDisabled: {
|
|
31
|
-
kkrTdU: "x1h6gzvc",
|
|
32
|
-
$$css: true
|
|
33
|
-
},
|
|
34
|
-
controlFocused: { $$css: true },
|
|
35
|
-
controlReadOnly: {
|
|
36
|
-
kkrTdU: "xt0e3qv",
|
|
37
17
|
$$css: true
|
|
38
18
|
},
|
|
39
19
|
toneActive: {
|
|
@@ -76,18 +56,13 @@ function buttonContent(children, ripple) {
|
|
|
76
56
|
const active = state.isHovered || state.isPressed || state.isFocusVisible;
|
|
77
57
|
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("span", {
|
|
78
58
|
...interactive ? ripple.handlers : {},
|
|
79
|
-
...props(styles.control, state.isSelected && styles.toneSelected, !state.isSelected && interactive && active && styles.toneActive, state.isDisabled && styles.toneDisabled, state.isReadOnly &&
|
|
59
|
+
...props(controlStyles.disc, styles.control, state.isSelected && styles.toneSelected, !state.isSelected && interactive && active && styles.toneActive, state.isDisabled && styles.toneDisabled, state.isReadOnly && controlStyles.controlReadOnly, state.isDisabled && controlStyles.controlDisabled, interactive && state.isHovered && hoverLayers[tone], interactive && state.isPressed && pressedLayers[tone], state.isFocusVisible && focus.ringVisible),
|
|
80
60
|
children: [/* @__PURE__ */ jsx("span", {
|
|
81
61
|
className: "x6s0dn4 x1qx5ct2 x1r7ld26 x3y1ksm x1y0btm7 xdh2fpr x9f619 x78zum5 xw4jnvo xl56j7k x1qno0dh xshfolx xpc4ca7",
|
|
82
62
|
children: state.isSelected ? /* @__PURE__ */ jsx("span", { className: "xtwfq29 x170jfvy x3y1ksm x1fsd2vl" }) : null
|
|
83
63
|
}), interactive ? ripple.surface : null]
|
|
84
|
-
}),
|
|
85
|
-
|
|
86
|
-
0: { className: "x9f619 x139gbkf x1ypdohk x16svsjw x1848etk x1c52epr x1qn8t5l xh7dzej x1cmllll" },
|
|
87
|
-
2: { className: "x9f619 x139gbkf x16svsjw x1848etk x1c52epr x1qn8t5l xh7dzej x1cmllll xt0e3qv" },
|
|
88
|
-
1: { className: "x9f619 x16svsjw x1848etk x1c52epr x1qn8t5l xh7dzej x1cmllll x1xj74d8 x1h6gzvc" },
|
|
89
|
-
3: { className: "x9f619 x16svsjw x1848etk x1c52epr x1qn8t5l xh7dzej x1cmllll x1xj74d8 x1h6gzvc" }
|
|
90
|
-
}[!!state.isReadOnly << 1 | !!state.isDisabled << 0],
|
|
64
|
+
}), /* @__PURE__ */ jsx(ControlLabel, {
|
|
65
|
+
state,
|
|
91
66
|
children
|
|
92
67
|
})] });
|
|
93
68
|
};
|
|
@@ -96,7 +71,7 @@ function groupContent(label, children, description, error, horizontal) {
|
|
|
96
71
|
return (state) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
97
72
|
/* @__PURE__ */ jsx(FieldLabel, {
|
|
98
73
|
state,
|
|
99
|
-
|
|
74
|
+
variant: "group",
|
|
100
75
|
children: label
|
|
101
76
|
}),
|
|
102
77
|
/* @__PURE__ */ jsx("div", {
|
|
@@ -123,11 +98,11 @@ function groupContent(label, children, description, error, horizontal) {
|
|
|
123
98
|
* which is the element a layout positions.
|
|
124
99
|
*/
|
|
125
100
|
function Radio(t0) {
|
|
126
|
-
const $ = c(
|
|
127
|
-
const { children, description, ...props } = t0;
|
|
101
|
+
const $ = c(14);
|
|
102
|
+
const { children, description, ...props$2 } = t0;
|
|
128
103
|
const ripple = useRipple();
|
|
129
104
|
const T0 = RadioField;
|
|
130
|
-
const t1 = mergeStatefulStyles(
|
|
105
|
+
const t1 = mergeStatefulStyles(props(controlStyles.field), props$2);
|
|
131
106
|
let t2;
|
|
132
107
|
if ($[0] !== children || $[1] !== ripple) {
|
|
133
108
|
t2 = buttonContent(children, ripple);
|
|
@@ -145,32 +120,37 @@ function Radio(t0) {
|
|
|
145
120
|
$[4] = t3;
|
|
146
121
|
} else t3 = $[4];
|
|
147
122
|
let t4;
|
|
148
|
-
if ($[5]
|
|
149
|
-
t4 =
|
|
150
|
-
|
|
123
|
+
if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
|
|
124
|
+
t4 = props(controlStyles.messages);
|
|
125
|
+
$[5] = t4;
|
|
126
|
+
} else t4 = $[5];
|
|
127
|
+
let t5;
|
|
128
|
+
if ($[6] !== description) {
|
|
129
|
+
t5 = /* @__PURE__ */ jsx("div", {
|
|
130
|
+
...t4,
|
|
151
131
|
children: /* @__PURE__ */ jsx(FieldMessage, {
|
|
152
132
|
description,
|
|
153
133
|
inset: false
|
|
154
134
|
})
|
|
155
135
|
});
|
|
156
|
-
$[
|
|
157
|
-
$[
|
|
158
|
-
} else
|
|
159
|
-
let
|
|
160
|
-
if ($[
|
|
161
|
-
|
|
162
|
-
...props,
|
|
136
|
+
$[6] = description;
|
|
137
|
+
$[7] = t5;
|
|
138
|
+
} else t5 = $[7];
|
|
139
|
+
let t6;
|
|
140
|
+
if ($[8] !== T0 || $[9] !== props$2 || $[10] !== t1 || $[11] !== t3 || $[12] !== t5) {
|
|
141
|
+
t6 = /* @__PURE__ */ jsxs(T0, {
|
|
142
|
+
...props$2,
|
|
163
143
|
...t1,
|
|
164
|
-
children: [t3,
|
|
144
|
+
children: [t3, t5]
|
|
165
145
|
});
|
|
166
|
-
$[
|
|
167
|
-
$[
|
|
168
|
-
$[
|
|
169
|
-
$[
|
|
170
|
-
$[11] = t4;
|
|
146
|
+
$[8] = T0;
|
|
147
|
+
$[9] = props$2;
|
|
148
|
+
$[10] = t1;
|
|
149
|
+
$[11] = t3;
|
|
171
150
|
$[12] = t5;
|
|
172
|
-
|
|
173
|
-
|
|
151
|
+
$[13] = t6;
|
|
152
|
+
} else t6 = $[13];
|
|
153
|
+
return t6;
|
|
174
154
|
}
|
|
175
155
|
/**
|
|
176
156
|
* A labelled set of radio buttons with one selected value between them. The
|
|
@@ -185,7 +165,7 @@ function Radio(t0) {
|
|
|
185
165
|
*/
|
|
186
166
|
function RadioGroup$1(t0) {
|
|
187
167
|
const $ = c(16);
|
|
188
|
-
const { children, description, error, label, orientation: t1, ...props } = t0;
|
|
168
|
+
const { children, description, error, label, orientation: t1, ...props$1 } = t0;
|
|
189
169
|
const orientation = t1 === void 0 ? "vertical" : t1;
|
|
190
170
|
const validationBehavior = useFieldValidationBehavior();
|
|
191
171
|
const T0 = RadioGroup;
|
|
@@ -195,7 +175,7 @@ function RadioGroup$1(t0) {
|
|
|
195
175
|
$[0] = error;
|
|
196
176
|
$[1] = t2;
|
|
197
177
|
} else t2 = $[1];
|
|
198
|
-
const t3 = mergeStatefulStyles(
|
|
178
|
+
const t3 = mergeStatefulStyles(props(groupStyles.root), props$1);
|
|
199
179
|
const t4 = orientation === "horizontal";
|
|
200
180
|
let t5;
|
|
201
181
|
if ($[2] !== children || $[3] !== description || $[4] !== error || $[5] !== label || $[6] !== t4) {
|
|
@@ -208,18 +188,18 @@ function RadioGroup$1(t0) {
|
|
|
208
188
|
$[7] = t5;
|
|
209
189
|
} else t5 = $[7];
|
|
210
190
|
let t6;
|
|
211
|
-
if ($[8] !== T0 || $[9] !== orientation || $[10] !== props || $[11] !== t2 || $[12] !== t3 || $[13] !== t5 || $[14] !== validationBehavior) {
|
|
191
|
+
if ($[8] !== T0 || $[9] !== orientation || $[10] !== props$1 || $[11] !== t2 || $[12] !== t3 || $[13] !== t5 || $[14] !== validationBehavior) {
|
|
212
192
|
t6 = /* @__PURE__ */ jsx(T0, {
|
|
213
193
|
isInvalid: t2,
|
|
214
194
|
orientation,
|
|
215
195
|
validationBehavior,
|
|
216
|
-
...props,
|
|
196
|
+
...props$1,
|
|
217
197
|
...t3,
|
|
218
198
|
children: t5
|
|
219
199
|
});
|
|
220
200
|
$[8] = T0;
|
|
221
201
|
$[9] = orientation;
|
|
222
|
-
$[10] = props;
|
|
202
|
+
$[10] = props$1;
|
|
223
203
|
$[11] = t2;
|
|
224
204
|
$[12] = t3;
|
|
225
205
|
$[13] = t5;
|