react-aria-components 3.0.0-nightly-9421c1409-240923 → 3.0.0-nightly-5ae234603-240925

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.
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;AAeD,MAAM;IAYJ,mGAAmG;IACnG,+GAA+G;IAC/G,CAAC,CAAC,OAAO,QAAQ,CAAC,GAAG;QACnB,OAAO,IAAI,CAAC,aAAa;IAC3B;IAEA,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,aAAa,CAAC,MAAM;IAClC;IAEA,UAAU;QACR,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI;IACzB;IAEA,QAAQ,GAAQ,EAAkB;QAChC,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ;IACjC;IAEA,GAAG,GAAW,EAAE;QACd,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI;IAChC;IAEA,cAAc;YACL;QAAP,QAAO,uBAAA,IAAI,CAAC,aAAa,CAAC,EAAE,cAArB,2CAAA,qBAAuB,GAAG;IACnC;IAEA,aAAa;YACJ;QAAP,QAAO,uBAAA,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,GAAG,EAAE,cAAjC,2CAAA,qBAAmC,GAAG;IAC/C;IAEA,YAAY,GAAQ,EAAE;YAEb;QADP,IAAI,QAAQ,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,CAAA,MAAO,IAAI,GAAG,KAAK;QAC5D,QAAO,uBAAA,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,cAA7B,2CAAA,qBAA+B,GAAG;IAC3C;IAEA,aAAa,GAAQ,EAAE;YAEd;QADP,IAAI,QAAQ,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,CAAA,MAAO,IAAI,GAAG,KAAK;QAC5D,QAAO,uBAAA,IAAI,CAAC,aAAa,C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c,IAAI,CAAC,OAAO,GAAG,CAAC,KAAK,GAAG,KAAK;QAE/C,OAAO,IAAI,KAAK,IAAI,KAAK,MACvB,OAAO,GAAG,CAAC,KAAK,GAAG,EAAE;QAGvB,KAAK,IAAI,SAAS,WAAW,WAAW,CAAC,KAAK,GAAG,EAC/C,UAAU;IAEd;IAEA,KAAK,IAAI,QAAQ,WACf,UAAU;IAGZ,OAAO;uBACL;gBACA;IACF;AACF","sources":["packages/react-aria-components/src/Tree.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaTreeGridListProps, useTreeGridList, useTreeGridListItem} from '@react-aria/tree';\nimport {ButtonContext} from './Button';\nimport {CheckboxContext} from './RSPContexts';\nimport {Collection, CollectionBuilder, CollectionNode, createBranchComponent, createLeafComponent, useCachedChildren} from '@react-aria/collections';\nimport {CollectionProps, CollectionRendererContext, DefaultCollectionRenderer, ItemRenderProps, usePersistedKeys} from './Collection';\nimport {ContextValue, DEFAULT_SLOT, Provider, RenderProps, ScrollableProps, SlotProps, StyleRenderProps, useContextProps, useRenderProps} from './utils';\nimport {DisabledBehavior, Expandable, forwardRefType, HoverEvents, Key, LinkDOMProps, RefObject} from '@react-types/shared';\nimport {filterDOMProps, useObjectRef} from '@react-aria/utils';\nimport {FocusScope, mergeProps, useFocusRing, useGridListSelectionCheckbox, useHover} from 'react-aria';\nimport {Collection as ICollection, Node, SelectionBehavior, TreeState, useTreeState} from 'react-stately';\nimport React, {createContext, ForwardedRef, forwardRef, HTMLAttributes, ReactNode, useContext, useEffect, useMemo, useRef} from 'react';\nimport {useControlledState} from '@react-stately/utils';\n\nclass TreeCollection<T> implements ICollection<Node<T>> {\n private flattenedRows: Node<T>[];\n private keyMap: Map<Key, CollectionNode<T>> = new Map();\n\n constructor(opts) {\n let {collection, expandedKeys} = opts;\n let {flattenedRows, keyMap} = flattenTree<T>(collection, {expandedKeys});\n this.flattenedRows = flattenedRows;\n // Use generated keyMap because it contains the modified collection nodes (aka it adjusts the indexes so that they ignore the existence of the Content items)\n this.keyMap = keyMap;\n }\n\n // TODO: should this collection's getters reflect the flattened structure or the original structure\n // If we respresent the flattened structure, it is easier for the keyboard nav but harder to find all the nodes\n *[Symbol.iterator]() {\n yield* this.flattenedRows;\n }\n\n get size() {\n return this.flattenedRows.length;\n }\n\n getKeys() {\n return this.keyMap.keys();\n }\n\n getItem(key: Key): Node<T> | null {\n return this.keyMap.get(key) || null;\n }\n\n at(idx: number) {\n return this.flattenedRows[idx];\n }\n\n getFirstKey() {\n return this.flattenedRows[0]?.key;\n }\n\n getLastKey() {\n return this.flattenedRows[this.size - 1]?.key;\n }\n\n getKeyAfter(key: Key) {\n let index = this.flattenedRows.findIndex(row => row.key === key);\n return this.flattenedRows[index + 1]?.key;\n }\n\n getKeyBefore(key: Key) {\n let index = this.flattenedRows.findIndex(row => row.key === key);\n return this.flattenedRows[index - 1]?.key;\n }\n\n // Note that this will return Content nodes in addition to nested TreeItems\n getChildren(key: Key): Iterable<Node<T>> {\n let keyMap = this.keyMap;\n return {\n *[Symbol.iterator]() {\n let parent = keyMap.get(key);\n let node = parent?.firstChildKey != null ? keyMap.get(parent.firstChildKey) : null;\n while (node) {\n yield node as Node<T>;\n node = node.nextKey != null ? keyMap.get(node.nextKey) : undefined;\n }\n }\n };\n }\n\n getTextValue(key: Key): string {\n let item = this.getItem(key);\n return item ? item.textValue : '';\n }\n}\n\nexport interface TreeRenderProps {\n /**\n * Whether the tree has no items and should display its empty state.\n * @selector [data-empty]\n */\n isEmpty: boolean,\n /**\n * Whether the tree is currently focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the tree is currently keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * State of the tree.\n */\n state: TreeState<unknown>\n}\n\nexport interface TreeProps<T> extends Omit<AriaTreeGridListProps<T>, 'children'>, CollectionProps<T>, StyleRenderProps<TreeRenderProps>, SlotProps, ScrollableProps<HTMLDivElement>, Expandable {\n /** How multiple selection should behave in the tree. */\n selectionBehavior?: SelectionBehavior,\n /** Provides content to display when there are no items in the list. */\n renderEmptyState?: (props: Omit<TreeRenderProps, 'isEmpty'>) => ReactNode,\n /**\n * Whether `disabledKeys` applies to all interactions, or only selection.\n * @default 'selection'\n */\n disabledBehavior?: DisabledBehavior\n}\n\n\nexport const UNSTABLE_TreeContext = createContext<ContextValue<TreeProps<any>, HTMLDivElement>>(null);\nexport const UNSTABLE_TreeStateContext = createContext<TreeState<any> | null>(null);\n\nfunction Tree<T extends object>(props: TreeProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n // Render the portal first so that we have the collection by the time we render the DOM in SSR.\n [props, ref] = useContextProps(props, ref, UNSTABLE_TreeContext);\n\n return (\n <CollectionBuilder content={<Collection {...props} />}>\n {collection => <TreeInner props={props} collection={collection} treeRef={ref} />}\n </CollectionBuilder>\n );\n}\n\ninterface TreeInnerProps<T extends object> {\n props: TreeProps<T>,\n collection: ICollection<unknown>,\n treeRef: RefObject<HTMLDivElement | null>\n}\n\nfunction TreeInner<T extends object>({props, collection, treeRef: ref}: TreeInnerProps<T>) {\n let {\n selectionMode = 'none',\n expandedKeys: propExpandedKeys,\n defaultExpandedKeys: propDefaultExpandedKeys,\n onExpandedChange,\n disabledBehavior = 'selection'\n } = props;\n let {CollectionRoot, isVirtualized, layoutDelegate} = useContext(CollectionRendererContext);\n\n // Kinda annoying that we have to replicate this code here as well as in useTreeState, but don't want to add\n // flattenCollection stuff to useTreeState. Think about this later\n let [expandedKeys, setExpandedKeys] = useControlledState(\n propExpandedKeys ? convertExpanded(propExpandedKeys) : undefined,\n propDefaultExpandedKeys ? convertExpanded(propDefaultExpandedKeys) : new Set(),\n onExpandedChange\n );\n\n let flattenedCollection = useMemo(() => {\n return new TreeCollection<object>({collection, expandedKeys});\n }, [collection, expandedKeys]);\n\n let state = useTreeState({\n ...props,\n selectionMode,\n expandedKeys,\n onExpandedChange: setExpandedKeys,\n collection: flattenedCollection,\n children: undefined,\n disabledBehavior\n });\n\n let {gridProps} = useTreeGridList({\n ...props,\n isVirtualized,\n layoutDelegate\n }, state, ref);\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n let renderValues = {\n isEmpty: state.collection.size === 0,\n isFocused,\n isFocusVisible,\n state\n };\n\n let renderProps = useRenderProps({\n className: props.className,\n style: props.style,\n defaultClassName: 'react-aria-Tree',\n values: renderValues\n });\n\n let emptyState: ReactNode = null;\n let emptyStatePropOverrides: HTMLAttributes<HTMLElement> | null = null;\n if (state.collection.size === 0 && props.renderEmptyState) {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n let {isEmpty, ...values} = renderValues;\n let content = props.renderEmptyState({...values});\n let treeGridRowProps = {\n 'aria-level': 1,\n 'aria-posinset': 1,\n 'aria-setsize': 1\n };\n\n emptyState = (\n <div role=\"row\" style={{display: 'contents'}} {...treeGridRowProps}>\n <div role=\"gridcell\" style={{display: 'contents'}}>\n {content}\n </div>\n </div>\n );\n }\n\n return (\n <FocusScope>\n <div\n {...filterDOMProps(props)}\n {...renderProps}\n {...mergeProps(gridProps, focusProps, emptyStatePropOverrides)}\n ref={ref}\n slot={props.slot || undefined}\n onScroll={props.onScroll}\n data-empty={state.collection.size === 0 || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}>\n <Provider\n values={[\n [UNSTABLE_TreeStateContext, state]\n ]}>\n <CollectionRoot\n collection={state.collection}\n persistedKeys={usePersistedKeys(state.selectionManager.focusedKey)}\n scrollRef={ref} />\n </Provider>\n {emptyState}\n </div>\n </FocusScope>\n );\n}\n\n/**\n * A tree provides users with a way to navigate nested hierarchical information, with support for keyboard navigation\n * and selection.\n */\nconst _Tree = /*#__PURE__*/ (forwardRef as forwardRefType)(Tree);\nexport {_Tree as UNSTABLE_Tree};\n\n// TODO: readd the rest of the render props when tree supports them\nexport interface TreeItemRenderProps extends Omit<ItemRenderProps, 'allowsDragging' | 'isDragging' | 'isDropTarget'> {\n /** Whether the tree item is expanded. */\n isExpanded: boolean,\n // TODO: api discussion, how do we feel about the below? This is so we can still style the row as grey when a child element within is focused\n // Maybe should have this for the other collection item render props\n /** Whether the tree item's children have keyboard focus. */\n isFocusVisibleWithin: boolean\n}\n\nexport interface TreeItemContentRenderProps extends ItemRenderProps {\n // Whether the tree item is expanded.\n isExpanded: boolean,\n // Whether the tree item has child rows.\n hasChildRows: boolean,\n // What level the tree item has within the tree.\n level: number,\n // Whether the tree item's children have keyboard focus.\n isFocusVisibleWithin: boolean\n}\n\n// The TreeItemContent is the one that accepts RenderProps because we would get much more complicated logic in TreeItem otherwise since we'd\n// need to do a bunch of check to figure out what is the Content and what are the actual collection elements (aka child rows) of the TreeItem\nexport interface TreeItemContentProps extends Pick<RenderProps<TreeItemContentRenderProps>, 'children'> {}\n\nexport const UNSTABLE_TreeItemContent = /*#__PURE__*/ createLeafComponent('content', function TreeItemContent(props: TreeItemContentProps) {\n let values = useContext(TreeItemContentContext)!;\n let renderProps = useRenderProps({\n children: props.children,\n values\n });\n return (\n <CollectionRendererContext.Provider value={DefaultCollectionRenderer}>\n {renderProps.children}\n </CollectionRendererContext.Provider>\n );\n});\n\nexport const TreeItemContentContext = createContext<TreeItemContentRenderProps | null>(null);\n\nexport interface TreeItemProps<T = object> extends StyleRenderProps<TreeItemRenderProps>, LinkDOMProps, HoverEvents {\n /** The unique id of the tree row. */\n id?: Key,\n /** The object value that this tree item represents. When using dynamic collections, this is set automatically. */\n value?: T,\n /** A string representation of the tree item's contents, used for features like typeahead. */\n textValue: string,\n /** An accessibility label for this tree item. */\n 'aria-label'?: string,\n /** The content of the tree item along with any nested children. Supports static nested tree items or use of a Collection to dynamically render nested tree items. */\n children: ReactNode\n}\n\n/**\n * A TreeItem represents an individual item in a Tree.\n */\nexport const UNSTABLE_TreeItem = /*#__PURE__*/ createBranchComponent('item', <T extends object>(props: TreeItemProps<T>, ref: ForwardedRef<HTMLDivElement>, item: Node<T>) => {\n let state = useContext(UNSTABLE_TreeStateContext)!;\n ref = useObjectRef<HTMLDivElement>(ref);\n // TODO: remove this when we support description in tree row\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n let {rowProps, gridCellProps, expandButtonProps, descriptionProps, ...states} = useTreeGridListItem({node: item}, state, ref);\n let isExpanded = rowProps['aria-expanded'] === true;\n let hasChildRows = [...state.collection.getChildren!(item.key)]?.length > 1;\n let level = rowProps['aria-level'] || 1;\n\n let {hoverProps, isHovered} = useHover({\n isDisabled: !states.allowsSelection && !states.hasAction,\n onHoverStart: props.onHoverStart,\n onHoverChange: props.onHoverChange,\n onHoverEnd: props.onHoverEnd\n });\n\n let {isFocusVisible, focusProps} = useFocusRing();\n let {\n isFocusVisible: isFocusVisibleWithin,\n focusProps: focusWithinProps\n } = useFocusRing({within: true});\n let {checkboxProps} = useGridListSelectionCheckbox(\n {key: item.key},\n state\n );\n\n let renderPropValues = React.useMemo<TreeItemContentRenderProps>(() => ({\n ...states,\n isHovered,\n isFocusVisible,\n isExpanded,\n hasChildRows,\n level,\n selectionMode: state.selectionManager.selectionMode,\n selectionBehavior: state.selectionManager.selectionBehavior,\n isFocusVisibleWithin\n }), [states, isHovered, isFocusVisible, state.selectionManager, isExpanded, hasChildRows, level, isFocusVisibleWithin]);\n\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n children: item.rendered,\n defaultClassName: 'react-aria-TreeItem',\n values: renderPropValues\n });\n\n useEffect(() => {\n if (!item.textValue) {\n console.warn('A `textValue` prop is required for <TreeItem> elements in order to support accessibility features such as type to select.');\n }\n }, [item.textValue]);\n\n let expandButtonRef = useRef<HTMLButtonElement>(null);\n useEffect(() => {\n if (hasChildRows && !expandButtonRef.current) {\n console.warn('Expandable tree items must contain a expand button so screen reader users can expand/collapse the item.');\n }\n // eslint-disable-next-line\n }, []);\n\n let children = useCachedChildren({\n items: state.collection.getChildren!(item.key),\n children: item => {\n switch (item.type) {\n case 'content': {\n return item.render!(item);\n }\n // Skip item since we don't render the nested rows as children of the parent row, the flattened collection\n // will render them each as siblings instead\n case 'loader':\n case 'item':\n return <></>;\n default:\n throw new Error('Unsupported element type in TreeRow: ' + item.type);\n }\n }\n });\n\n return (\n <>\n <div\n {...mergeProps(filterDOMProps(props as any), rowProps, focusProps, hoverProps, focusWithinProps)}\n {...renderProps}\n ref={ref}\n // TODO: missing selectionBehavior, hasAction and allowsSelection data attribute equivalents (available in renderProps). Do we want those?\n data-expanded={hasChildRows ? isExpanded : undefined}\n data-has-child-rows={hasChildRows}\n data-level={level}\n data-selected={states.isSelected || undefined}\n data-disabled={states.isDisabled || undefined}\n data-hovered={isHovered || undefined}\n data-focused={states.isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-pressed={states.isPressed || undefined}\n data-selection-mode={state.selectionManager.selectionMode === 'none' ? undefined : state.selectionManager.selectionMode}>\n <div {...gridCellProps} style={{display: 'contents'}}>\n <Provider\n values={[\n [CheckboxContext, {\n slots: {\n selection: checkboxProps\n }\n }],\n // TODO: support description in the tree row\n // TODO: don't think I need to pass isExpanded to the button here since it can be sourced from the renderProps? Might be worthwhile passing it down?\n [ButtonContext, {\n slots: {\n [DEFAULT_SLOT]: {},\n chevron: {\n ...expandButtonProps,\n ref: expandButtonRef\n }\n }\n }],\n [TreeItemContentContext, {\n ...renderPropValues\n }]\n ]}>\n {children}\n </Provider>\n </div>\n </div>\n </>\n );\n});\n\nexport interface TreeLoadingIndicatorRenderProps {\n /**\n * What level the tree item has within the tree.\n * @selector [data-level]\n */\n level: number\n}\n\nexport interface TreeLoaderProps extends RenderProps<TreeLoadingIndicatorRenderProps>, StyleRenderProps<TreeLoadingIndicatorRenderProps> {}\n\nexport const UNSTABLE_TreeLoadingIndicator = createLeafComponent('loader', function TreeLoader<T extends object>(props: TreeLoaderProps, ref: ForwardedRef<HTMLDivElement>, item: Node<T>) {\n let state = useContext(UNSTABLE_TreeStateContext);\n // This loader row is is non-interactable, but we want the same aria props calculated as a typical row\n // @ts-ignore\n let {rowProps} = useTreeGridListItem({node: item}, state, ref);\n let level = rowProps['aria-level'] || 1;\n\n let ariaProps = {\n 'aria-level': rowProps['aria-level'],\n 'aria-posinset': rowProps['aria-posinset'],\n 'aria-setsize': rowProps['aria-setsize']\n };\n\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n children: item.rendered,\n defaultClassName: 'react-aria-TreeLoader',\n values: {\n level\n }\n });\n\n return (\n <>\n <div\n role=\"row\"\n ref={ref}\n {...mergeProps(filterDOMProps(props as any), ariaProps)}\n {...renderProps}\n data-level={level}>\n <div role=\"gridcell\" aria-colindex={1}>\n {renderProps.children}\n </div>\n </div>\n </>\n );\n});\n\nfunction convertExpanded(expanded: 'all' | Iterable<Key>): 'all' | Set<Key> {\n if (!expanded) {\n return new Set<Key>();\n }\n\n return expanded === 'all'\n ? 'all'\n : new Set(expanded);\n}\ninterface TreeGridCollectionOptions {\n expandedKeys: Set<Key>\n}\n\ninterface FlattenedTree<T> {\n flattenedRows: Node<T>[],\n keyMap: Map<Key, CollectionNode<T>>\n}\n\nfunction flattenTree<T>(collection: TreeCollection<T>, opts: TreeGridCollectionOptions): FlattenedTree<T> {\n let {\n expandedKeys = new Set()\n } = opts;\n let keyMap: Map<Key, CollectionNode<T>> = new Map();\n let flattenedRows: Node<T>[] = [];\n\n let visitNode = (node: Node<T>) => {\n if (node.type === 'item' || node.type === 'loader') {\n let parentKey = node?.parentKey;\n let clone = {...node};\n if (parentKey != null) {\n // TODO: assumes that non item content node (aka TreeItemContent always placed before Collection) will be always placed before the child rows. If we can't make this assumption then we can filter out\n // every non-item per level and assign indicies based off the node's position in said filtered array\n let hasContentNode = [...collection.getChildren(parentKey)][0].type !== 'item';\n if (hasContentNode) {\n clone.index = node?.index != null ? node?.index - 1 : 0;\n }\n\n // For loader nodes that have a parent (aka non-root level loaders), these need their levels incremented by 1 for parity with their sibiling rows\n // (Collection only increments the level if it is a \"item\" type node).\n if (node.type === 'loader') {\n clone.level = node.level + 1;\n }\n\n keyMap.set(clone.key, clone as CollectionNode<T>);\n } else {\n keyMap.set(node.key, node as CollectionNode<T>);\n }\n\n if (node.level === 0 || (parentKey != null && expandedKeys.has(parentKey) && flattenedRows.find(row => row.key === parentKey))) {\n // Grab the modified node from the key map so our flattened list and modified key map point to the same nodes\n flattenedRows.push(keyMap.get(node.key) || node);\n }\n } else if (node.type !== null) {\n keyMap.set(node.key, node as CollectionNode<T>);\n }\n\n for (let child of collection.getChildren(node.key)) {\n visitNode(child);\n }\n };\n\n for (let node of collection) {\n visitNode(node);\n }\n\n return {\n flattenedRows,\n keyMap\n };\n}\n"],"names":[],"version":3,"file":"Tree.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;AAeD,MAAM;IAYJ,mGAAmG;IACnG,+GAA+G;IAC/G,CAAC,CAAC,OAAO,QAAQ,CAAC,GAAG;QACnB,OAAO,IAAI,CAAC,aAAa;IAC3B;IAEA,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,aAAa,CAAC,MAAM;IAClC;IAEA,UAAU;QACR,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI;IACzB;IAEA,QAAQ,GAAQ,EAAkB;QAChC,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ;IACjC;IAEA,GAAG,GAAW,EAAE;QACd,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI;IAChC;IAEA,cAAc;YACL;QAAP,QAAO,uBAAA,IAAI,CAAC,aAAa,CAAC,EAAE,cAArB,2CAAA,qBAAuB,GAAG;IACnC;IAEA,aAAa;YACJ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BAAI,WAAW,WAAW,CAAC;iBAAW,CAAC,EAAE,CAAC,IAAI,KAAK;gBACxE,IAAI,gBACF,MAAM,KAAK,GAAG,CAAA,iBAAA,2BAAA,KAAM,KAAK,KAAI,OAAO,CAAA,iBAAA,2BAAA,KAAM,KAAK,IAAG,IAAI;gBAGxD,iJAAiJ;gBACjJ,sEAAsE;gBACtE,IAAI,KAAK,IAAI,KAAK,UAChB,MAAM,KAAK,GAAG,KAAK,KAAK,GAAG;gBAG7B,OAAO,GAAG,CAAC,MAAM,GAAG,EAAE;YACxB,OACE,OAAO,GAAG,CAAC,KAAK,GAAG,EAAE;YAGvB,IAAI,KAAK,KAAK,KAAK,KAAM,aAAa,QAAQ,aAAa,GAAG,CAAC,cAAc,cAAc,IAAI,CAAC,CAAA,MAAO,IAAI,GAAG,KAAK,YACjH,6GAA6G;YAC7G,cAAc,IAAI,CAAC,OAAO,GAAG,CAAC,KAAK,GAAG,KAAK;QAE/C,OAAO,IAAI,KAAK,IAAI,KAAK,MACvB,OAAO,GAAG,CAAC,KAAK,GAAG,EAAE;QAGvB,KAAK,IAAI,SAAS,WAAW,WAAW,CAAC,KAAK,GAAG,EAC/C,UAAU;IAEd;IAEA,KAAK,IAAI,QAAQ,WACf,UAAU;IAGZ,OAAO;uBACL;gBACA;IACF;AACF","sources":["packages/react-aria-components/src/Tree.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaTreeGridListProps, useTreeGridList, useTreeGridListItem} from '@react-aria/tree';\nimport {ButtonContext} from './Button';\nimport {CheckboxContext} from './RSPContexts';\nimport {Collection, CollectionBuilder, CollectionNode, createBranchComponent, createLeafComponent, useCachedChildren} from '@react-aria/collections';\nimport {CollectionProps, CollectionRendererContext, DefaultCollectionRenderer, ItemRenderProps, usePersistedKeys} from './Collection';\nimport {ContextValue, DEFAULT_SLOT, Provider, RenderProps, ScrollableProps, SlotProps, StyleRenderProps, useContextProps, useRenderProps} from './utils';\nimport {DisabledBehavior, Expandable, forwardRefType, HoverEvents, Key, LinkDOMProps, RefObject} from '@react-types/shared';\nimport {filterDOMProps, useObjectRef} from '@react-aria/utils';\nimport {FocusScope, mergeProps, useFocusRing, useGridListSelectionCheckbox, useHover} from 'react-aria';\nimport {Collection as ICollection, Node, SelectionBehavior, TreeState, useTreeState} from 'react-stately';\nimport React, {createContext, ForwardedRef, forwardRef, HTMLAttributes, ReactNode, useContext, useEffect, useMemo, useRef} from 'react';\nimport {useControlledState} from '@react-stately/utils';\n\nclass TreeCollection<T> implements ICollection<Node<T>> {\n private flattenedRows: Node<T>[];\n private keyMap: Map<Key, CollectionNode<T>> = new Map();\n\n constructor(opts) {\n let {collection, expandedKeys} = opts;\n let {flattenedRows, keyMap} = flattenTree<T>(collection, {expandedKeys});\n this.flattenedRows = flattenedRows;\n // Use generated keyMap because it contains the modified collection nodes (aka it adjusts the indexes so that they ignore the existence of the Content items)\n this.keyMap = keyMap;\n }\n\n // TODO: should this collection's getters reflect the flattened structure or the original structure\n // If we respresent the flattened structure, it is easier for the keyboard nav but harder to find all the nodes\n *[Symbol.iterator]() {\n yield* this.flattenedRows;\n }\n\n get size() {\n return this.flattenedRows.length;\n }\n\n getKeys() {\n return this.keyMap.keys();\n }\n\n getItem(key: Key): Node<T> | null {\n return this.keyMap.get(key) || null;\n }\n\n at(idx: number) {\n return this.flattenedRows[idx];\n }\n\n getFirstKey() {\n return this.flattenedRows[0]?.key;\n }\n\n getLastKey() {\n return this.flattenedRows[this.size - 1]?.key;\n }\n\n getKeyAfter(key: Key) {\n let index = this.flattenedRows.findIndex(row => row.key === key);\n return this.flattenedRows[index + 1]?.key;\n }\n\n getKeyBefore(key: Key) {\n let index = this.flattenedRows.findIndex(row => row.key === key);\n return this.flattenedRows[index - 1]?.key;\n }\n\n // Note that this will return Content nodes in addition to nested TreeItems\n getChildren(key: Key): Iterable<Node<T>> {\n let keyMap = this.keyMap;\n return {\n *[Symbol.iterator]() {\n let parent = keyMap.get(key);\n let node = parent?.firstChildKey != null ? keyMap.get(parent.firstChildKey) : null;\n while (node) {\n yield node as Node<T>;\n node = node.nextKey != null ? keyMap.get(node.nextKey) : undefined;\n }\n }\n };\n }\n\n getTextValue(key: Key): string {\n let item = this.getItem(key);\n return item ? item.textValue : '';\n }\n}\n\nexport interface TreeRenderProps {\n /**\n * Whether the tree has no items and should display its empty state.\n * @selector [data-empty]\n */\n isEmpty: boolean,\n /**\n * Whether the tree is currently focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the tree is currently keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * State of the tree.\n */\n state: TreeState<unknown>\n}\n\nexport interface TreeEmptyStateRenderProps extends Omit<TreeRenderProps, 'isEmpty'> {}\n\nexport interface TreeProps<T> extends Omit<AriaTreeGridListProps<T>, 'children'>, CollectionProps<T>, StyleRenderProps<TreeRenderProps>, SlotProps, ScrollableProps<HTMLDivElement>, Expandable {\n /** How multiple selection should behave in the tree. */\n selectionBehavior?: SelectionBehavior,\n /** Provides content to display when there are no items in the list. */\n renderEmptyState?: (props: TreeEmptyStateRenderProps) => ReactNode,\n /**\n * Whether `disabledKeys` applies to all interactions, or only selection.\n * @default 'selection'\n */\n disabledBehavior?: DisabledBehavior\n}\n\n\nexport const UNSTABLE_TreeContext = createContext<ContextValue<TreeProps<any>, HTMLDivElement>>(null);\nexport const UNSTABLE_TreeStateContext = createContext<TreeState<any> | null>(null);\n\nfunction Tree<T extends object>(props: TreeProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n // Render the portal first so that we have the collection by the time we render the DOM in SSR.\n [props, ref] = useContextProps(props, ref, UNSTABLE_TreeContext);\n\n return (\n <CollectionBuilder content={<Collection {...props} />}>\n {collection => <TreeInner props={props} collection={collection} treeRef={ref} />}\n </CollectionBuilder>\n );\n}\n\ninterface TreeInnerProps<T extends object> {\n props: TreeProps<T>,\n collection: ICollection<unknown>,\n treeRef: RefObject<HTMLDivElement | null>\n}\n\nfunction TreeInner<T extends object>({props, collection, treeRef: ref}: TreeInnerProps<T>) {\n let {\n selectionMode = 'none',\n expandedKeys: propExpandedKeys,\n defaultExpandedKeys: propDefaultExpandedKeys,\n onExpandedChange,\n disabledBehavior = 'selection'\n } = props;\n let {CollectionRoot, isVirtualized, layoutDelegate} = useContext(CollectionRendererContext);\n\n // Kinda annoying that we have to replicate this code here as well as in useTreeState, but don't want to add\n // flattenCollection stuff to useTreeState. Think about this later\n let [expandedKeys, setExpandedKeys] = useControlledState(\n propExpandedKeys ? convertExpanded(propExpandedKeys) : undefined,\n propDefaultExpandedKeys ? convertExpanded(propDefaultExpandedKeys) : new Set(),\n onExpandedChange\n );\n\n let flattenedCollection = useMemo(() => {\n return new TreeCollection<object>({collection, expandedKeys});\n }, [collection, expandedKeys]);\n\n let state = useTreeState({\n ...props,\n selectionMode,\n expandedKeys,\n onExpandedChange: setExpandedKeys,\n collection: flattenedCollection,\n children: undefined,\n disabledBehavior\n });\n\n let {gridProps} = useTreeGridList({\n ...props,\n isVirtualized,\n layoutDelegate\n }, state, ref);\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n let renderValues = {\n isEmpty: state.collection.size === 0,\n isFocused,\n isFocusVisible,\n state\n };\n\n let renderProps = useRenderProps({\n className: props.className,\n style: props.style,\n defaultClassName: 'react-aria-Tree',\n values: renderValues\n });\n\n let emptyState: ReactNode = null;\n let emptyStatePropOverrides: HTMLAttributes<HTMLElement> | null = null;\n if (state.collection.size === 0 && props.renderEmptyState) {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n let {isEmpty, ...values} = renderValues;\n let content = props.renderEmptyState({...values});\n let treeGridRowProps = {\n 'aria-level': 1,\n 'aria-posinset': 1,\n 'aria-setsize': 1\n };\n\n emptyState = (\n <div role=\"row\" style={{display: 'contents'}} {...treeGridRowProps}>\n <div role=\"gridcell\" style={{display: 'contents'}}>\n {content}\n </div>\n </div>\n );\n }\n\n return (\n <FocusScope>\n <div\n {...filterDOMProps(props)}\n {...renderProps}\n {...mergeProps(gridProps, focusProps, emptyStatePropOverrides)}\n ref={ref}\n slot={props.slot || undefined}\n onScroll={props.onScroll}\n data-empty={state.collection.size === 0 || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}>\n <Provider\n values={[\n [UNSTABLE_TreeStateContext, state]\n ]}>\n <CollectionRoot\n collection={state.collection}\n persistedKeys={usePersistedKeys(state.selectionManager.focusedKey)}\n scrollRef={ref} />\n </Provider>\n {emptyState}\n </div>\n </FocusScope>\n );\n}\n\n/**\n * A tree provides users with a way to navigate nested hierarchical information, with support for keyboard navigation\n * and selection.\n */\nconst _Tree = /*#__PURE__*/ (forwardRef as forwardRefType)(Tree);\nexport {_Tree as UNSTABLE_Tree};\n\n// TODO: readd the rest of the render props when tree supports them\nexport interface TreeItemRenderProps extends Omit<ItemRenderProps, 'allowsDragging' | 'isDragging' | 'isDropTarget'> {\n /** Whether the tree item is expanded. */\n isExpanded: boolean,\n // TODO: api discussion, how do we feel about the below? This is so we can still style the row as grey when a child element within is focused\n // Maybe should have this for the other collection item render props\n /** Whether the tree item's children have keyboard focus. */\n isFocusVisibleWithin: boolean\n}\n\nexport interface TreeItemContentRenderProps extends ItemRenderProps {\n // Whether the tree item is expanded.\n isExpanded: boolean,\n // Whether the tree item has child rows.\n hasChildRows: boolean,\n // What level the tree item has within the tree.\n level: number,\n // Whether the tree item's children have keyboard focus.\n isFocusVisibleWithin: boolean\n}\n\n// The TreeItemContent is the one that accepts RenderProps because we would get much more complicated logic in TreeItem otherwise since we'd\n// need to do a bunch of check to figure out what is the Content and what are the actual collection elements (aka child rows) of the TreeItem\nexport interface TreeItemContentProps extends Pick<RenderProps<TreeItemContentRenderProps>, 'children'> {}\n\nexport const UNSTABLE_TreeItemContent = /*#__PURE__*/ createLeafComponent('content', function TreeItemContent(props: TreeItemContentProps) {\n let values = useContext(TreeItemContentContext)!;\n let renderProps = useRenderProps({\n children: props.children,\n values\n });\n return (\n <CollectionRendererContext.Provider value={DefaultCollectionRenderer}>\n {renderProps.children}\n </CollectionRendererContext.Provider>\n );\n});\n\nexport const TreeItemContentContext = createContext<TreeItemContentRenderProps | null>(null);\n\nexport interface TreeItemProps<T = object> extends StyleRenderProps<TreeItemRenderProps>, LinkDOMProps, HoverEvents {\n /** The unique id of the tree row. */\n id?: Key,\n /** The object value that this tree item represents. When using dynamic collections, this is set automatically. */\n value?: T,\n /** A string representation of the tree item's contents, used for features like typeahead. */\n textValue: string,\n /** An accessibility label for this tree item. */\n 'aria-label'?: string,\n /** The content of the tree item along with any nested children. Supports static nested tree items or use of a Collection to dynamically render nested tree items. */\n children: ReactNode\n}\n\n/**\n * A TreeItem represents an individual item in a Tree.\n */\nexport const UNSTABLE_TreeItem = /*#__PURE__*/ createBranchComponent('item', <T extends object>(props: TreeItemProps<T>, ref: ForwardedRef<HTMLDivElement>, item: Node<T>) => {\n let state = useContext(UNSTABLE_TreeStateContext)!;\n ref = useObjectRef<HTMLDivElement>(ref);\n // TODO: remove this when we support description in tree row\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n let {rowProps, gridCellProps, expandButtonProps, descriptionProps, ...states} = useTreeGridListItem({node: item}, state, ref);\n let isExpanded = rowProps['aria-expanded'] === true;\n let hasChildRows = [...state.collection.getChildren!(item.key)]?.length > 1;\n let level = rowProps['aria-level'] || 1;\n\n let {hoverProps, isHovered} = useHover({\n isDisabled: !states.allowsSelection && !states.hasAction,\n onHoverStart: props.onHoverStart,\n onHoverChange: props.onHoverChange,\n onHoverEnd: props.onHoverEnd\n });\n\n let {isFocusVisible, focusProps} = useFocusRing();\n let {\n isFocusVisible: isFocusVisibleWithin,\n focusProps: focusWithinProps\n } = useFocusRing({within: true});\n let {checkboxProps} = useGridListSelectionCheckbox(\n {key: item.key},\n state\n );\n\n let renderPropValues = React.useMemo<TreeItemContentRenderProps>(() => ({\n ...states,\n isHovered,\n isFocusVisible,\n isExpanded,\n hasChildRows,\n level,\n selectionMode: state.selectionManager.selectionMode,\n selectionBehavior: state.selectionManager.selectionBehavior,\n isFocusVisibleWithin\n }), [states, isHovered, isFocusVisible, state.selectionManager, isExpanded, hasChildRows, level, isFocusVisibleWithin]);\n\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n children: item.rendered,\n defaultClassName: 'react-aria-TreeItem',\n defaultStyle: {\n // @ts-ignore\n '--tree-item-level': level\n },\n values: renderPropValues\n });\n\n useEffect(() => {\n if (!item.textValue) {\n console.warn('A `textValue` prop is required for <TreeItem> elements in order to support accessibility features such as type to select.');\n }\n }, [item.textValue]);\n\n let expandButtonRef = useRef<HTMLButtonElement>(null);\n useEffect(() => {\n if (hasChildRows && !expandButtonRef.current) {\n console.warn('Expandable tree items must contain a expand button so screen reader users can expand/collapse the item.');\n }\n // eslint-disable-next-line\n }, []);\n\n let children = useCachedChildren({\n items: state.collection.getChildren!(item.key),\n children: item => {\n switch (item.type) {\n case 'content': {\n return item.render!(item);\n }\n // Skip item since we don't render the nested rows as children of the parent row, the flattened collection\n // will render them each as siblings instead\n case 'loader':\n case 'item':\n return <></>;\n default:\n throw new Error('Unsupported element type in TreeRow: ' + item.type);\n }\n }\n });\n\n return (\n <>\n <div\n {...mergeProps(filterDOMProps(props as any), rowProps, focusProps, hoverProps, focusWithinProps)}\n {...renderProps}\n ref={ref}\n // TODO: missing selectionBehavior, hasAction and allowsSelection data attribute equivalents (available in renderProps). Do we want those?\n data-expanded={(hasChildRows && isExpanded) || undefined}\n data-has-child-rows={hasChildRows || undefined}\n data-level={level}\n data-selected={states.isSelected || undefined}\n data-disabled={states.isDisabled || undefined}\n data-hovered={isHovered || undefined}\n data-focused={states.isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-pressed={states.isPressed || undefined}\n data-selection-mode={state.selectionManager.selectionMode === 'none' ? undefined : state.selectionManager.selectionMode}>\n <div {...gridCellProps} style={{display: 'contents'}}>\n <Provider\n values={[\n [CheckboxContext, {\n slots: {\n selection: checkboxProps\n }\n }],\n // TODO: support description in the tree row\n // TODO: don't think I need to pass isExpanded to the button here since it can be sourced from the renderProps? Might be worthwhile passing it down?\n [ButtonContext, {\n slots: {\n [DEFAULT_SLOT]: {},\n chevron: {\n ...expandButtonProps,\n ref: expandButtonRef\n }\n }\n }],\n [TreeItemContentContext, {\n ...renderPropValues\n }]\n ]}>\n {children}\n </Provider>\n </div>\n </div>\n </>\n );\n});\n\nexport interface TreeLoadingIndicatorRenderProps {\n /**\n * What level the tree item has within the tree.\n * @selector [data-level]\n */\n level: number\n}\n\nexport interface TreeLoaderProps extends RenderProps<TreeLoadingIndicatorRenderProps>, StyleRenderProps<TreeLoadingIndicatorRenderProps> {}\n\nexport const UNSTABLE_TreeLoadingIndicator = createLeafComponent('loader', function TreeLoader<T extends object>(props: TreeLoaderProps, ref: ForwardedRef<HTMLDivElement>, item: Node<T>) {\n let state = useContext(UNSTABLE_TreeStateContext);\n // This loader row is is non-interactable, but we want the same aria props calculated as a typical row\n // @ts-ignore\n let {rowProps} = useTreeGridListItem({node: item}, state, ref);\n let level = rowProps['aria-level'] || 1;\n\n let ariaProps = {\n 'aria-level': rowProps['aria-level'],\n 'aria-posinset': rowProps['aria-posinset'],\n 'aria-setsize': rowProps['aria-setsize']\n };\n\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n children: item.rendered,\n defaultClassName: 'react-aria-TreeLoader',\n values: {\n level\n }\n });\n\n return (\n <>\n <div\n role=\"row\"\n ref={ref}\n {...mergeProps(filterDOMProps(props as any), ariaProps)}\n {...renderProps}\n data-level={level}>\n <div role=\"gridcell\" aria-colindex={1}>\n {renderProps.children}\n </div>\n </div>\n </>\n );\n});\n\nfunction convertExpanded(expanded: 'all' | Iterable<Key>): 'all' | Set<Key> {\n if (!expanded) {\n return new Set<Key>();\n }\n\n return expanded === 'all'\n ? 'all'\n : new Set(expanded);\n}\ninterface TreeGridCollectionOptions {\n expandedKeys: Set<Key>\n}\n\ninterface FlattenedTree<T> {\n flattenedRows: Node<T>[],\n keyMap: Map<Key, CollectionNode<T>>\n}\n\nfunction flattenTree<T>(collection: TreeCollection<T>, opts: TreeGridCollectionOptions): FlattenedTree<T> {\n let {\n expandedKeys = new Set()\n } = opts;\n let keyMap: Map<Key, CollectionNode<T>> = new Map();\n let flattenedRows: Node<T>[] = [];\n\n let visitNode = (node: Node<T>) => {\n if (node.type === 'item' || node.type === 'loader') {\n let parentKey = node?.parentKey;\n let clone = {...node};\n if (parentKey != null) {\n // TODO: assumes that non item content node (aka TreeItemContent always placed before Collection) will be always placed before the child rows. If we can't make this assumption then we can filter out\n // every non-item per level and assign indicies based off the node's position in said filtered array\n let hasContentNode = [...collection.getChildren(parentKey)][0].type !== 'item';\n if (hasContentNode) {\n clone.index = node?.index != null ? node?.index - 1 : 0;\n }\n\n // For loader nodes that have a parent (aka non-root level loaders), these need their levels incremented by 1 for parity with their sibiling rows\n // (Collection only increments the level if it is a \"item\" type node).\n if (node.type === 'loader') {\n clone.level = node.level + 1;\n }\n\n keyMap.set(clone.key, clone as CollectionNode<T>);\n } else {\n keyMap.set(node.key, node as CollectionNode<T>);\n }\n\n if (node.level === 0 || (parentKey != null && expandedKeys.has(parentKey) && flattenedRows.find(row => row.key === parentKey))) {\n // Grab the modified node from the key map so our flattened list and modified key map point to the same nodes\n flattenedRows.push(keyMap.get(node.key) || node);\n }\n } else if (node.type !== null) {\n keyMap.set(node.key, node as CollectionNode<T>);\n }\n\n for (let child of collection.getChildren(node.key)) {\n visitNode(child);\n }\n };\n\n for (let node of collection) {\n visitNode(node);\n }\n\n return {\n flattenedRows,\n keyMap\n };\n}\n"],"names":[],"version":3,"file":"Tree.main.js.map"}
package/dist/Tree.mjs CHANGED
@@ -267,6 +267,10 @@ const $2f5eaf4a2a47b4cf$export$635b3358b7a3dfbb = /*#__PURE__*/ (0, $kUtXx$creat
267
267
  id: undefined,
268
268
  children: item.rendered,
269
269
  defaultClassName: 'react-aria-TreeItem',
270
+ defaultStyle: {
271
+ // @ts-ignore
272
+ '--tree-item-level': level
273
+ },
270
274
  values: renderPropValues
271
275
  });
272
276
  (0, $kUtXx$useEffect)(()=>{
@@ -300,8 +304,8 @@ const $2f5eaf4a2a47b4cf$export$635b3358b7a3dfbb = /*#__PURE__*/ (0, $kUtXx$creat
300
304
  ...renderProps,
301
305
  ref: ref,
302
306
  // TODO: missing selectionBehavior, hasAction and allowsSelection data attribute equivalents (available in renderProps). Do we want those?
303
- "data-expanded": hasChildRows ? isExpanded : undefined,
304
- "data-has-child-rows": hasChildRows,
307
+ "data-expanded": hasChildRows && isExpanded || undefined,
308
+ "data-has-child-rows": hasChildRows || undefined,
305
309
  "data-level": level,
306
310
  "data-selected": states.isSelected || undefined,
307
311
  "data-disabled": states.isDisabled || undefined,
@@ -267,6 +267,10 @@ const $2f5eaf4a2a47b4cf$export$635b3358b7a3dfbb = /*#__PURE__*/ (0, $kUtXx$creat
267
267
  id: undefined,
268
268
  children: item.rendered,
269
269
  defaultClassName: 'react-aria-TreeItem',
270
+ defaultStyle: {
271
+ // @ts-ignore
272
+ '--tree-item-level': level
273
+ },
270
274
  values: renderPropValues
271
275
  });
272
276
  (0, $kUtXx$useEffect)(()=>{
@@ -300,8 +304,8 @@ const $2f5eaf4a2a47b4cf$export$635b3358b7a3dfbb = /*#__PURE__*/ (0, $kUtXx$creat
300
304
  ...renderProps,
301
305
  ref: ref,
302
306
  // TODO: missing selectionBehavior, hasAction and allowsSelection data attribute equivalents (available in renderProps). Do we want those?
303
- "data-expanded": hasChildRows ? isExpanded : undefined,
304
- "data-has-child-rows": hasChildRows,
307
+ "data-expanded": hasChildRows && isExpanded || undefined,
308
+ "data-has-child-rows": hasChildRows || undefined,
305
309
  "data-level": level,
306
310
  "data-selected": states.isSelected || undefined,
307
311
  "data-disabled": states.isDisabled || undefined,
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;AAeD,MAAM;IAYJ,mGAAmG;IACnG,+GAA+G;IAC/G,CAAC,CAAC,OAAO,QAAQ,CAAC,GAAG;QACnB,OAAO,IAAI,CAAC,aAAa;IAC3B;IAEA,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,aAAa,CAAC,MAAM;IAClC;IAEA,UAAU;QACR,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI;IACzB;IAEA,QAAQ,GAAQ,EAAkB;QAChC,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ;IACjC;IAEA,GAAG,GAAW,EAAE;QACd,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI;IAChC;IAEA,cAAc;YACL;QAAP,QAAO,uBAAA,IAAI,CAAC,aAAa,CAAC,EAAE,cAArB,2CAAA,qBAAuB,GAAG;IACnC;IAEA,aAAa;YACJ;QAAP,QAAO,uBAAA,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,GAAG,EAAE,cAAjC,2CAAA,qBAAmC,GAAG;IAC/C;IAEA,YAAY,GAAQ,EAAE;YAEb;QADP,IAAI,QAAQ,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,CAAA,MAAO,IAAI,GAAG,KAAK;QAC5D,QAAO,uBAAA,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,cAA7B,2CAAA,qBAA+B,GAAG;IAC3C;IAEA,aAAa,GAAQ,EAAE;YAEd;QADP,IAAI,QAAQ,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,CAAA,MAAO,IAAI,GAAG,KAAK;QAC5D,QAAO,uBAAA,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,cAA7B,2CAAA,qBAA+B,GAAG;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AE/C,OAAO,IAAI,KAAK,IAAI,KAAK,MACvB,OAAO,GAAG,CAAC,KAAK,GAAG,EAAE;QAGvB,KAAK,IAAI,SAAS,WAAW,WAAW,CAAC,KAAK,GAAG,EAC/C,UAAU;IAEd;IAEA,KAAK,IAAI,QAAQ,WACf,UAAU;IAGZ,OAAO;uBACL;gBACA;IACF;AACF","sources":["packages/react-aria-components/src/Tree.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaTreeGridListProps, useTreeGridList, useTreeGridListItem} from '@react-aria/tree';\nimport {ButtonContext} from './Button';\nimport {CheckboxContext} from './RSPContexts';\nimport {Collection, CollectionBuilder, CollectionNode, createBranchComponent, createLeafComponent, useCachedChildren} from '@react-aria/collections';\nimport {CollectionProps, CollectionRendererContext, DefaultCollectionRenderer, ItemRenderProps, usePersistedKeys} from './Collection';\nimport {ContextValue, DEFAULT_SLOT, Provider, RenderProps, ScrollableProps, SlotProps, StyleRenderProps, useContextProps, useRenderProps} from './utils';\nimport {DisabledBehavior, Expandable, forwardRefType, HoverEvents, Key, LinkDOMProps, RefObject} from '@react-types/shared';\nimport {filterDOMProps, useObjectRef} from '@react-aria/utils';\nimport {FocusScope, mergeProps, useFocusRing, useGridListSelectionCheckbox, useHover} from 'react-aria';\nimport {Collection as ICollection, Node, SelectionBehavior, TreeState, useTreeState} from 'react-stately';\nimport React, {createContext, ForwardedRef, forwardRef, HTMLAttributes, ReactNode, useContext, useEffect, useMemo, useRef} from 'react';\nimport {useControlledState} from '@react-stately/utils';\n\nclass TreeCollection<T> implements ICollection<Node<T>> {\n private flattenedRows: Node<T>[];\n private keyMap: Map<Key, CollectionNode<T>> = new Map();\n\n constructor(opts) {\n let {collection, expandedKeys} = opts;\n let {flattenedRows, keyMap} = flattenTree<T>(collection, {expandedKeys});\n this.flattenedRows = flattenedRows;\n // Use generated keyMap because it contains the modified collection nodes (aka it adjusts the indexes so that they ignore the existence of the Content items)\n this.keyMap = keyMap;\n }\n\n // TODO: should this collection's getters reflect the flattened structure or the original structure\n // If we respresent the flattened structure, it is easier for the keyboard nav but harder to find all the nodes\n *[Symbol.iterator]() {\n yield* this.flattenedRows;\n }\n\n get size() {\n return this.flattenedRows.length;\n }\n\n getKeys() {\n return this.keyMap.keys();\n }\n\n getItem(key: Key): Node<T> | null {\n return this.keyMap.get(key) || null;\n }\n\n at(idx: number) {\n return this.flattenedRows[idx];\n }\n\n getFirstKey() {\n return this.flattenedRows[0]?.key;\n }\n\n getLastKey() {\n return this.flattenedRows[this.size - 1]?.key;\n }\n\n getKeyAfter(key: Key) {\n let index = this.flattenedRows.findIndex(row => row.key === key);\n return this.flattenedRows[index + 1]?.key;\n }\n\n getKeyBefore(key: Key) {\n let index = this.flattenedRows.findIndex(row => row.key === key);\n return this.flattenedRows[index - 1]?.key;\n }\n\n // Note that this will return Content nodes in addition to nested TreeItems\n getChildren(key: Key): Iterable<Node<T>> {\n let keyMap = this.keyMap;\n return {\n *[Symbol.iterator]() {\n let parent = keyMap.get(key);\n let node = parent?.firstChildKey != null ? keyMap.get(parent.firstChildKey) : null;\n while (node) {\n yield node as Node<T>;\n node = node.nextKey != null ? keyMap.get(node.nextKey) : undefined;\n }\n }\n };\n }\n\n getTextValue(key: Key): string {\n let item = this.getItem(key);\n return item ? item.textValue : '';\n }\n}\n\nexport interface TreeRenderProps {\n /**\n * Whether the tree has no items and should display its empty state.\n * @selector [data-empty]\n */\n isEmpty: boolean,\n /**\n * Whether the tree is currently focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the tree is currently keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * State of the tree.\n */\n state: TreeState<unknown>\n}\n\nexport interface TreeProps<T> extends Omit<AriaTreeGridListProps<T>, 'children'>, CollectionProps<T>, StyleRenderProps<TreeRenderProps>, SlotProps, ScrollableProps<HTMLDivElement>, Expandable {\n /** How multiple selection should behave in the tree. */\n selectionBehavior?: SelectionBehavior,\n /** Provides content to display when there are no items in the list. */\n renderEmptyState?: (props: Omit<TreeRenderProps, 'isEmpty'>) => ReactNode,\n /**\n * Whether `disabledKeys` applies to all interactions, or only selection.\n * @default 'selection'\n */\n disabledBehavior?: DisabledBehavior\n}\n\n\nexport const UNSTABLE_TreeContext = createContext<ContextValue<TreeProps<any>, HTMLDivElement>>(null);\nexport const UNSTABLE_TreeStateContext = createContext<TreeState<any> | null>(null);\n\nfunction Tree<T extends object>(props: TreeProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n // Render the portal first so that we have the collection by the time we render the DOM in SSR.\n [props, ref] = useContextProps(props, ref, UNSTABLE_TreeContext);\n\n return (\n <CollectionBuilder content={<Collection {...props} />}>\n {collection => <TreeInner props={props} collection={collection} treeRef={ref} />}\n </CollectionBuilder>\n );\n}\n\ninterface TreeInnerProps<T extends object> {\n props: TreeProps<T>,\n collection: ICollection<unknown>,\n treeRef: RefObject<HTMLDivElement | null>\n}\n\nfunction TreeInner<T extends object>({props, collection, treeRef: ref}: TreeInnerProps<T>) {\n let {\n selectionMode = 'none',\n expandedKeys: propExpandedKeys,\n defaultExpandedKeys: propDefaultExpandedKeys,\n onExpandedChange,\n disabledBehavior = 'selection'\n } = props;\n let {CollectionRoot, isVirtualized, layoutDelegate} = useContext(CollectionRendererContext);\n\n // Kinda annoying that we have to replicate this code here as well as in useTreeState, but don't want to add\n // flattenCollection stuff to useTreeState. Think about this later\n let [expandedKeys, setExpandedKeys] = useControlledState(\n propExpandedKeys ? convertExpanded(propExpandedKeys) : undefined,\n propDefaultExpandedKeys ? convertExpanded(propDefaultExpandedKeys) : new Set(),\n onExpandedChange\n );\n\n let flattenedCollection = useMemo(() => {\n return new TreeCollection<object>({collection, expandedKeys});\n }, [collection, expandedKeys]);\n\n let state = useTreeState({\n ...props,\n selectionMode,\n expandedKeys,\n onExpandedChange: setExpandedKeys,\n collection: flattenedCollection,\n children: undefined,\n disabledBehavior\n });\n\n let {gridProps} = useTreeGridList({\n ...props,\n isVirtualized,\n layoutDelegate\n }, state, ref);\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n let renderValues = {\n isEmpty: state.collection.size === 0,\n isFocused,\n isFocusVisible,\n state\n };\n\n let renderProps = useRenderProps({\n className: props.className,\n style: props.style,\n defaultClassName: 'react-aria-Tree',\n values: renderValues\n });\n\n let emptyState: ReactNode = null;\n let emptyStatePropOverrides: HTMLAttributes<HTMLElement> | null = null;\n if (state.collection.size === 0 && props.renderEmptyState) {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n let {isEmpty, ...values} = renderValues;\n let content = props.renderEmptyState({...values});\n let treeGridRowProps = {\n 'aria-level': 1,\n 'aria-posinset': 1,\n 'aria-setsize': 1\n };\n\n emptyState = (\n <div role=\"row\" style={{display: 'contents'}} {...treeGridRowProps}>\n <div role=\"gridcell\" style={{display: 'contents'}}>\n {content}\n </div>\n </div>\n );\n }\n\n return (\n <FocusScope>\n <div\n {...filterDOMProps(props)}\n {...renderProps}\n {...mergeProps(gridProps, focusProps, emptyStatePropOverrides)}\n ref={ref}\n slot={props.slot || undefined}\n onScroll={props.onScroll}\n data-empty={state.collection.size === 0 || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}>\n <Provider\n values={[\n [UNSTABLE_TreeStateContext, state]\n ]}>\n <CollectionRoot\n collection={state.collection}\n persistedKeys={usePersistedKeys(state.selectionManager.focusedKey)}\n scrollRef={ref} />\n </Provider>\n {emptyState}\n </div>\n </FocusScope>\n );\n}\n\n/**\n * A tree provides users with a way to navigate nested hierarchical information, with support for keyboard navigation\n * and selection.\n */\nconst _Tree = /*#__PURE__*/ (forwardRef as forwardRefType)(Tree);\nexport {_Tree as UNSTABLE_Tree};\n\n// TODO: readd the rest of the render props when tree supports them\nexport interface TreeItemRenderProps extends Omit<ItemRenderProps, 'allowsDragging' | 'isDragging' | 'isDropTarget'> {\n /** Whether the tree item is expanded. */\n isExpanded: boolean,\n // TODO: api discussion, how do we feel about the below? This is so we can still style the row as grey when a child element within is focused\n // Maybe should have this for the other collection item render props\n /** Whether the tree item's children have keyboard focus. */\n isFocusVisibleWithin: boolean\n}\n\nexport interface TreeItemContentRenderProps extends ItemRenderProps {\n // Whether the tree item is expanded.\n isExpanded: boolean,\n // Whether the tree item has child rows.\n hasChildRows: boolean,\n // What level the tree item has within the tree.\n level: number,\n // Whether the tree item's children have keyboard focus.\n isFocusVisibleWithin: boolean\n}\n\n// The TreeItemContent is the one that accepts RenderProps because we would get much more complicated logic in TreeItem otherwise since we'd\n// need to do a bunch of check to figure out what is the Content and what are the actual collection elements (aka child rows) of the TreeItem\nexport interface TreeItemContentProps extends Pick<RenderProps<TreeItemContentRenderProps>, 'children'> {}\n\nexport const UNSTABLE_TreeItemContent = /*#__PURE__*/ createLeafComponent('content', function TreeItemContent(props: TreeItemContentProps) {\n let values = useContext(TreeItemContentContext)!;\n let renderProps = useRenderProps({\n children: props.children,\n values\n });\n return (\n <CollectionRendererContext.Provider value={DefaultCollectionRenderer}>\n {renderProps.children}\n </CollectionRendererContext.Provider>\n );\n});\n\nexport const TreeItemContentContext = createContext<TreeItemContentRenderProps | null>(null);\n\nexport interface TreeItemProps<T = object> extends StyleRenderProps<TreeItemRenderProps>, LinkDOMProps, HoverEvents {\n /** The unique id of the tree row. */\n id?: Key,\n /** The object value that this tree item represents. When using dynamic collections, this is set automatically. */\n value?: T,\n /** A string representation of the tree item's contents, used for features like typeahead. */\n textValue: string,\n /** An accessibility label for this tree item. */\n 'aria-label'?: string,\n /** The content of the tree item along with any nested children. Supports static nested tree items or use of a Collection to dynamically render nested tree items. */\n children: ReactNode\n}\n\n/**\n * A TreeItem represents an individual item in a Tree.\n */\nexport const UNSTABLE_TreeItem = /*#__PURE__*/ createBranchComponent('item', <T extends object>(props: TreeItemProps<T>, ref: ForwardedRef<HTMLDivElement>, item: Node<T>) => {\n let state = useContext(UNSTABLE_TreeStateContext)!;\n ref = useObjectRef<HTMLDivElement>(ref);\n // TODO: remove this when we support description in tree row\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n let {rowProps, gridCellProps, expandButtonProps, descriptionProps, ...states} = useTreeGridListItem({node: item}, state, ref);\n let isExpanded = rowProps['aria-expanded'] === true;\n let hasChildRows = [...state.collection.getChildren!(item.key)]?.length > 1;\n let level = rowProps['aria-level'] || 1;\n\n let {hoverProps, isHovered} = useHover({\n isDisabled: !states.allowsSelection && !states.hasAction,\n onHoverStart: props.onHoverStart,\n onHoverChange: props.onHoverChange,\n onHoverEnd: props.onHoverEnd\n });\n\n let {isFocusVisible, focusProps} = useFocusRing();\n let {\n isFocusVisible: isFocusVisibleWithin,\n focusProps: focusWithinProps\n } = useFocusRing({within: true});\n let {checkboxProps} = useGridListSelectionCheckbox(\n {key: item.key},\n state\n );\n\n let renderPropValues = React.useMemo<TreeItemContentRenderProps>(() => ({\n ...states,\n isHovered,\n isFocusVisible,\n isExpanded,\n hasChildRows,\n level,\n selectionMode: state.selectionManager.selectionMode,\n selectionBehavior: state.selectionManager.selectionBehavior,\n isFocusVisibleWithin\n }), [states, isHovered, isFocusVisible, state.selectionManager, isExpanded, hasChildRows, level, isFocusVisibleWithin]);\n\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n children: item.rendered,\n defaultClassName: 'react-aria-TreeItem',\n values: renderPropValues\n });\n\n useEffect(() => {\n if (!item.textValue) {\n console.warn('A `textValue` prop is required for <TreeItem> elements in order to support accessibility features such as type to select.');\n }\n }, [item.textValue]);\n\n let expandButtonRef = useRef<HTMLButtonElement>(null);\n useEffect(() => {\n if (hasChildRows && !expandButtonRef.current) {\n console.warn('Expandable tree items must contain a expand button so screen reader users can expand/collapse the item.');\n }\n // eslint-disable-next-line\n }, []);\n\n let children = useCachedChildren({\n items: state.collection.getChildren!(item.key),\n children: item => {\n switch (item.type) {\n case 'content': {\n return item.render!(item);\n }\n // Skip item since we don't render the nested rows as children of the parent row, the flattened collection\n // will render them each as siblings instead\n case 'loader':\n case 'item':\n return <></>;\n default:\n throw new Error('Unsupported element type in TreeRow: ' + item.type);\n }\n }\n });\n\n return (\n <>\n <div\n {...mergeProps(filterDOMProps(props as any), rowProps, focusProps, hoverProps, focusWithinProps)}\n {...renderProps}\n ref={ref}\n // TODO: missing selectionBehavior, hasAction and allowsSelection data attribute equivalents (available in renderProps). Do we want those?\n data-expanded={hasChildRows ? isExpanded : undefined}\n data-has-child-rows={hasChildRows}\n data-level={level}\n data-selected={states.isSelected || undefined}\n data-disabled={states.isDisabled || undefined}\n data-hovered={isHovered || undefined}\n data-focused={states.isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-pressed={states.isPressed || undefined}\n data-selection-mode={state.selectionManager.selectionMode === 'none' ? undefined : state.selectionManager.selectionMode}>\n <div {...gridCellProps} style={{display: 'contents'}}>\n <Provider\n values={[\n [CheckboxContext, {\n slots: {\n selection: checkboxProps\n }\n }],\n // TODO: support description in the tree row\n // TODO: don't think I need to pass isExpanded to the button here since it can be sourced from the renderProps? Might be worthwhile passing it down?\n [ButtonContext, {\n slots: {\n [DEFAULT_SLOT]: {},\n chevron: {\n ...expandButtonProps,\n ref: expandButtonRef\n }\n }\n }],\n [TreeItemContentContext, {\n ...renderPropValues\n }]\n ]}>\n {children}\n </Provider>\n </div>\n </div>\n </>\n );\n});\n\nexport interface TreeLoadingIndicatorRenderProps {\n /**\n * What level the tree item has within the tree.\n * @selector [data-level]\n */\n level: number\n}\n\nexport interface TreeLoaderProps extends RenderProps<TreeLoadingIndicatorRenderProps>, StyleRenderProps<TreeLoadingIndicatorRenderProps> {}\n\nexport const UNSTABLE_TreeLoadingIndicator = createLeafComponent('loader', function TreeLoader<T extends object>(props: TreeLoaderProps, ref: ForwardedRef<HTMLDivElement>, item: Node<T>) {\n let state = useContext(UNSTABLE_TreeStateContext);\n // This loader row is is non-interactable, but we want the same aria props calculated as a typical row\n // @ts-ignore\n let {rowProps} = useTreeGridListItem({node: item}, state, ref);\n let level = rowProps['aria-level'] || 1;\n\n let ariaProps = {\n 'aria-level': rowProps['aria-level'],\n 'aria-posinset': rowProps['aria-posinset'],\n 'aria-setsize': rowProps['aria-setsize']\n };\n\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n children: item.rendered,\n defaultClassName: 'react-aria-TreeLoader',\n values: {\n level\n }\n });\n\n return (\n <>\n <div\n role=\"row\"\n ref={ref}\n {...mergeProps(filterDOMProps(props as any), ariaProps)}\n {...renderProps}\n data-level={level}>\n <div role=\"gridcell\" aria-colindex={1}>\n {renderProps.children}\n </div>\n </div>\n </>\n );\n});\n\nfunction convertExpanded(expanded: 'all' | Iterable<Key>): 'all' | Set<Key> {\n if (!expanded) {\n return new Set<Key>();\n }\n\n return expanded === 'all'\n ? 'all'\n : new Set(expanded);\n}\ninterface TreeGridCollectionOptions {\n expandedKeys: Set<Key>\n}\n\ninterface FlattenedTree<T> {\n flattenedRows: Node<T>[],\n keyMap: Map<Key, CollectionNode<T>>\n}\n\nfunction flattenTree<T>(collection: TreeCollection<T>, opts: TreeGridCollectionOptions): FlattenedTree<T> {\n let {\n expandedKeys = new Set()\n } = opts;\n let keyMap: Map<Key, CollectionNode<T>> = new Map();\n let flattenedRows: Node<T>[] = [];\n\n let visitNode = (node: Node<T>) => {\n if (node.type === 'item' || node.type === 'loader') {\n let parentKey = node?.parentKey;\n let clone = {...node};\n if (parentKey != null) {\n // TODO: assumes that non item content node (aka TreeItemContent always placed before Collection) will be always placed before the child rows. If we can't make this assumption then we can filter out\n // every non-item per level and assign indicies based off the node's position in said filtered array\n let hasContentNode = [...collection.getChildren(parentKey)][0].type !== 'item';\n if (hasContentNode) {\n clone.index = node?.index != null ? node?.index - 1 : 0;\n }\n\n // For loader nodes that have a parent (aka non-root level loaders), these need their levels incremented by 1 for parity with their sibiling rows\n // (Collection only increments the level if it is a \"item\" type node).\n if (node.type === 'loader') {\n clone.level = node.level + 1;\n }\n\n keyMap.set(clone.key, clone as CollectionNode<T>);\n } else {\n keyMap.set(node.key, node as CollectionNode<T>);\n }\n\n if (node.level === 0 || (parentKey != null && expandedKeys.has(parentKey) && flattenedRows.find(row => row.key === parentKey))) {\n // Grab the modified node from the key map so our flattened list and modified key map point to the same nodes\n flattenedRows.push(keyMap.get(node.key) || node);\n }\n } else if (node.type !== null) {\n keyMap.set(node.key, node as CollectionNode<T>);\n }\n\n for (let child of collection.getChildren(node.key)) {\n visitNode(child);\n }\n };\n\n for (let node of collection) {\n visitNode(node);\n }\n\n return {\n flattenedRows,\n keyMap\n };\n}\n"],"names":[],"version":3,"file":"Tree.module.js.map"}
1
+ {"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;AAeD,MAAM;IAYJ,mGAAmG;IACnG,+GAA+G;IAC/G,CAAC,CAAC,OAAO,QAAQ,CAAC,GAAG;QACnB,OAAO,IAAI,CAAC,aAAa;IAC3B;IAEA,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,aAAa,CAAC,MAAM;IAClC;IAEA,UAAU;QACR,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI;IACzB;IAEA,QAAQ,GAAQ,EAAkB;QAChC,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ;IACjC;IAEA,GAAG,GAAW,EAAE;QACd,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI;IAChC;IAEA,cAAc;YACL;QAAP,QAAO,uBAAA,IAAI,CAAC,aAAa,CAAC,EAAE,cAArB,2CAAA,qBAAuB,GAAG;IACnC;IAEA,aAAa;YACJ;QAAP,QAAO,uBAAA,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,GAAG,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gBACF,MAAM,KAAK,GAAG,CAAA,iBAAA,2BAAA,KAAM,KAAK,KAAI,OAAO,CAAA,iBAAA,2BAAA,KAAM,KAAK,IAAG,IAAI;gBAGxD,iJAAiJ;gBACjJ,sEAAsE;gBACtE,IAAI,KAAK,IAAI,KAAK,UAChB,MAAM,KAAK,GAAG,KAAK,KAAK,GAAG;gBAG7B,OAAO,GAAG,CAAC,MAAM,GAAG,EAAE;YACxB,OACE,OAAO,GAAG,CAAC,KAAK,GAAG,EAAE;YAGvB,IAAI,KAAK,KAAK,KAAK,KAAM,aAAa,QAAQ,aAAa,GAAG,CAAC,cAAc,cAAc,IAAI,CAAC,CAAA,MAAO,IAAI,GAAG,KAAK,YACjH,6GAA6G;YAC7G,cAAc,IAAI,CAAC,OAAO,GAAG,CAAC,KAAK,GAAG,KAAK;QAE/C,OAAO,IAAI,KAAK,IAAI,KAAK,MACvB,OAAO,GAAG,CAAC,KAAK,GAAG,EAAE;QAGvB,KAAK,IAAI,SAAS,WAAW,WAAW,CAAC,KAAK,GAAG,EAC/C,UAAU;IAEd;IAEA,KAAK,IAAI,QAAQ,WACf,UAAU;IAGZ,OAAO;uBACL;gBACA;IACF;AACF","sources":["packages/react-aria-components/src/Tree.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaTreeGridListProps, useTreeGridList, useTreeGridListItem} from '@react-aria/tree';\nimport {ButtonContext} from './Button';\nimport {CheckboxContext} from './RSPContexts';\nimport {Collection, CollectionBuilder, CollectionNode, createBranchComponent, createLeafComponent, useCachedChildren} from '@react-aria/collections';\nimport {CollectionProps, CollectionRendererContext, DefaultCollectionRenderer, ItemRenderProps, usePersistedKeys} from './Collection';\nimport {ContextValue, DEFAULT_SLOT, Provider, RenderProps, ScrollableProps, SlotProps, StyleRenderProps, useContextProps, useRenderProps} from './utils';\nimport {DisabledBehavior, Expandable, forwardRefType, HoverEvents, Key, LinkDOMProps, RefObject} from '@react-types/shared';\nimport {filterDOMProps, useObjectRef} from '@react-aria/utils';\nimport {FocusScope, mergeProps, useFocusRing, useGridListSelectionCheckbox, useHover} from 'react-aria';\nimport {Collection as ICollection, Node, SelectionBehavior, TreeState, useTreeState} from 'react-stately';\nimport React, {createContext, ForwardedRef, forwardRef, HTMLAttributes, ReactNode, useContext, useEffect, useMemo, useRef} from 'react';\nimport {useControlledState} from '@react-stately/utils';\n\nclass TreeCollection<T> implements ICollection<Node<T>> {\n private flattenedRows: Node<T>[];\n private keyMap: Map<Key, CollectionNode<T>> = new Map();\n\n constructor(opts) {\n let {collection, expandedKeys} = opts;\n let {flattenedRows, keyMap} = flattenTree<T>(collection, {expandedKeys});\n this.flattenedRows = flattenedRows;\n // Use generated keyMap because it contains the modified collection nodes (aka it adjusts the indexes so that they ignore the existence of the Content items)\n this.keyMap = keyMap;\n }\n\n // TODO: should this collection's getters reflect the flattened structure or the original structure\n // If we respresent the flattened structure, it is easier for the keyboard nav but harder to find all the nodes\n *[Symbol.iterator]() {\n yield* this.flattenedRows;\n }\n\n get size() {\n return this.flattenedRows.length;\n }\n\n getKeys() {\n return this.keyMap.keys();\n }\n\n getItem(key: Key): Node<T> | null {\n return this.keyMap.get(key) || null;\n }\n\n at(idx: number) {\n return this.flattenedRows[idx];\n }\n\n getFirstKey() {\n return this.flattenedRows[0]?.key;\n }\n\n getLastKey() {\n return this.flattenedRows[this.size - 1]?.key;\n }\n\n getKeyAfter(key: Key) {\n let index = this.flattenedRows.findIndex(row => row.key === key);\n return this.flattenedRows[index + 1]?.key;\n }\n\n getKeyBefore(key: Key) {\n let index = this.flattenedRows.findIndex(row => row.key === key);\n return this.flattenedRows[index - 1]?.key;\n }\n\n // Note that this will return Content nodes in addition to nested TreeItems\n getChildren(key: Key): Iterable<Node<T>> {\n let keyMap = this.keyMap;\n return {\n *[Symbol.iterator]() {\n let parent = keyMap.get(key);\n let node = parent?.firstChildKey != null ? keyMap.get(parent.firstChildKey) : null;\n while (node) {\n yield node as Node<T>;\n node = node.nextKey != null ? keyMap.get(node.nextKey) : undefined;\n }\n }\n };\n }\n\n getTextValue(key: Key): string {\n let item = this.getItem(key);\n return item ? item.textValue : '';\n }\n}\n\nexport interface TreeRenderProps {\n /**\n * Whether the tree has no items and should display its empty state.\n * @selector [data-empty]\n */\n isEmpty: boolean,\n /**\n * Whether the tree is currently focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the tree is currently keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * State of the tree.\n */\n state: TreeState<unknown>\n}\n\nexport interface TreeEmptyStateRenderProps extends Omit<TreeRenderProps, 'isEmpty'> {}\n\nexport interface TreeProps<T> extends Omit<AriaTreeGridListProps<T>, 'children'>, CollectionProps<T>, StyleRenderProps<TreeRenderProps>, SlotProps, ScrollableProps<HTMLDivElement>, Expandable {\n /** How multiple selection should behave in the tree. */\n selectionBehavior?: SelectionBehavior,\n /** Provides content to display when there are no items in the list. */\n renderEmptyState?: (props: TreeEmptyStateRenderProps) => ReactNode,\n /**\n * Whether `disabledKeys` applies to all interactions, or only selection.\n * @default 'selection'\n */\n disabledBehavior?: DisabledBehavior\n}\n\n\nexport const UNSTABLE_TreeContext = createContext<ContextValue<TreeProps<any>, HTMLDivElement>>(null);\nexport const UNSTABLE_TreeStateContext = createContext<TreeState<any> | null>(null);\n\nfunction Tree<T extends object>(props: TreeProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n // Render the portal first so that we have the collection by the time we render the DOM in SSR.\n [props, ref] = useContextProps(props, ref, UNSTABLE_TreeContext);\n\n return (\n <CollectionBuilder content={<Collection {...props} />}>\n {collection => <TreeInner props={props} collection={collection} treeRef={ref} />}\n </CollectionBuilder>\n );\n}\n\ninterface TreeInnerProps<T extends object> {\n props: TreeProps<T>,\n collection: ICollection<unknown>,\n treeRef: RefObject<HTMLDivElement | null>\n}\n\nfunction TreeInner<T extends object>({props, collection, treeRef: ref}: TreeInnerProps<T>) {\n let {\n selectionMode = 'none',\n expandedKeys: propExpandedKeys,\n defaultExpandedKeys: propDefaultExpandedKeys,\n onExpandedChange,\n disabledBehavior = 'selection'\n } = props;\n let {CollectionRoot, isVirtualized, layoutDelegate} = useContext(CollectionRendererContext);\n\n // Kinda annoying that we have to replicate this code here as well as in useTreeState, but don't want to add\n // flattenCollection stuff to useTreeState. Think about this later\n let [expandedKeys, setExpandedKeys] = useControlledState(\n propExpandedKeys ? convertExpanded(propExpandedKeys) : undefined,\n propDefaultExpandedKeys ? convertExpanded(propDefaultExpandedKeys) : new Set(),\n onExpandedChange\n );\n\n let flattenedCollection = useMemo(() => {\n return new TreeCollection<object>({collection, expandedKeys});\n }, [collection, expandedKeys]);\n\n let state = useTreeState({\n ...props,\n selectionMode,\n expandedKeys,\n onExpandedChange: setExpandedKeys,\n collection: flattenedCollection,\n children: undefined,\n disabledBehavior\n });\n\n let {gridProps} = useTreeGridList({\n ...props,\n isVirtualized,\n layoutDelegate\n }, state, ref);\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n let renderValues = {\n isEmpty: state.collection.size === 0,\n isFocused,\n isFocusVisible,\n state\n };\n\n let renderProps = useRenderProps({\n className: props.className,\n style: props.style,\n defaultClassName: 'react-aria-Tree',\n values: renderValues\n });\n\n let emptyState: ReactNode = null;\n let emptyStatePropOverrides: HTMLAttributes<HTMLElement> | null = null;\n if (state.collection.size === 0 && props.renderEmptyState) {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n let {isEmpty, ...values} = renderValues;\n let content = props.renderEmptyState({...values});\n let treeGridRowProps = {\n 'aria-level': 1,\n 'aria-posinset': 1,\n 'aria-setsize': 1\n };\n\n emptyState = (\n <div role=\"row\" style={{display: 'contents'}} {...treeGridRowProps}>\n <div role=\"gridcell\" style={{display: 'contents'}}>\n {content}\n </div>\n </div>\n );\n }\n\n return (\n <FocusScope>\n <div\n {...filterDOMProps(props)}\n {...renderProps}\n {...mergeProps(gridProps, focusProps, emptyStatePropOverrides)}\n ref={ref}\n slot={props.slot || undefined}\n onScroll={props.onScroll}\n data-empty={state.collection.size === 0 || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}>\n <Provider\n values={[\n [UNSTABLE_TreeStateContext, state]\n ]}>\n <CollectionRoot\n collection={state.collection}\n persistedKeys={usePersistedKeys(state.selectionManager.focusedKey)}\n scrollRef={ref} />\n </Provider>\n {emptyState}\n </div>\n </FocusScope>\n );\n}\n\n/**\n * A tree provides users with a way to navigate nested hierarchical information, with support for keyboard navigation\n * and selection.\n */\nconst _Tree = /*#__PURE__*/ (forwardRef as forwardRefType)(Tree);\nexport {_Tree as UNSTABLE_Tree};\n\n// TODO: readd the rest of the render props when tree supports them\nexport interface TreeItemRenderProps extends Omit<ItemRenderProps, 'allowsDragging' | 'isDragging' | 'isDropTarget'> {\n /** Whether the tree item is expanded. */\n isExpanded: boolean,\n // TODO: api discussion, how do we feel about the below? This is so we can still style the row as grey when a child element within is focused\n // Maybe should have this for the other collection item render props\n /** Whether the tree item's children have keyboard focus. */\n isFocusVisibleWithin: boolean\n}\n\nexport interface TreeItemContentRenderProps extends ItemRenderProps {\n // Whether the tree item is expanded.\n isExpanded: boolean,\n // Whether the tree item has child rows.\n hasChildRows: boolean,\n // What level the tree item has within the tree.\n level: number,\n // Whether the tree item's children have keyboard focus.\n isFocusVisibleWithin: boolean\n}\n\n// The TreeItemContent is the one that accepts RenderProps because we would get much more complicated logic in TreeItem otherwise since we'd\n// need to do a bunch of check to figure out what is the Content and what are the actual collection elements (aka child rows) of the TreeItem\nexport interface TreeItemContentProps extends Pick<RenderProps<TreeItemContentRenderProps>, 'children'> {}\n\nexport const UNSTABLE_TreeItemContent = /*#__PURE__*/ createLeafComponent('content', function TreeItemContent(props: TreeItemContentProps) {\n let values = useContext(TreeItemContentContext)!;\n let renderProps = useRenderProps({\n children: props.children,\n values\n });\n return (\n <CollectionRendererContext.Provider value={DefaultCollectionRenderer}>\n {renderProps.children}\n </CollectionRendererContext.Provider>\n );\n});\n\nexport const TreeItemContentContext = createContext<TreeItemContentRenderProps | null>(null);\n\nexport interface TreeItemProps<T = object> extends StyleRenderProps<TreeItemRenderProps>, LinkDOMProps, HoverEvents {\n /** The unique id of the tree row. */\n id?: Key,\n /** The object value that this tree item represents. When using dynamic collections, this is set automatically. */\n value?: T,\n /** A string representation of the tree item's contents, used for features like typeahead. */\n textValue: string,\n /** An accessibility label for this tree item. */\n 'aria-label'?: string,\n /** The content of the tree item along with any nested children. Supports static nested tree items or use of a Collection to dynamically render nested tree items. */\n children: ReactNode\n}\n\n/**\n * A TreeItem represents an individual item in a Tree.\n */\nexport const UNSTABLE_TreeItem = /*#__PURE__*/ createBranchComponent('item', <T extends object>(props: TreeItemProps<T>, ref: ForwardedRef<HTMLDivElement>, item: Node<T>) => {\n let state = useContext(UNSTABLE_TreeStateContext)!;\n ref = useObjectRef<HTMLDivElement>(ref);\n // TODO: remove this when we support description in tree row\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n let {rowProps, gridCellProps, expandButtonProps, descriptionProps, ...states} = useTreeGridListItem({node: item}, state, ref);\n let isExpanded = rowProps['aria-expanded'] === true;\n let hasChildRows = [...state.collection.getChildren!(item.key)]?.length > 1;\n let level = rowProps['aria-level'] || 1;\n\n let {hoverProps, isHovered} = useHover({\n isDisabled: !states.allowsSelection && !states.hasAction,\n onHoverStart: props.onHoverStart,\n onHoverChange: props.onHoverChange,\n onHoverEnd: props.onHoverEnd\n });\n\n let {isFocusVisible, focusProps} = useFocusRing();\n let {\n isFocusVisible: isFocusVisibleWithin,\n focusProps: focusWithinProps\n } = useFocusRing({within: true});\n let {checkboxProps} = useGridListSelectionCheckbox(\n {key: item.key},\n state\n );\n\n let renderPropValues = React.useMemo<TreeItemContentRenderProps>(() => ({\n ...states,\n isHovered,\n isFocusVisible,\n isExpanded,\n hasChildRows,\n level,\n selectionMode: state.selectionManager.selectionMode,\n selectionBehavior: state.selectionManager.selectionBehavior,\n isFocusVisibleWithin\n }), [states, isHovered, isFocusVisible, state.selectionManager, isExpanded, hasChildRows, level, isFocusVisibleWithin]);\n\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n children: item.rendered,\n defaultClassName: 'react-aria-TreeItem',\n defaultStyle: {\n // @ts-ignore\n '--tree-item-level': level\n },\n values: renderPropValues\n });\n\n useEffect(() => {\n if (!item.textValue) {\n console.warn('A `textValue` prop is required for <TreeItem> elements in order to support accessibility features such as type to select.');\n }\n }, [item.textValue]);\n\n let expandButtonRef = useRef<HTMLButtonElement>(null);\n useEffect(() => {\n if (hasChildRows && !expandButtonRef.current) {\n console.warn('Expandable tree items must contain a expand button so screen reader users can expand/collapse the item.');\n }\n // eslint-disable-next-line\n }, []);\n\n let children = useCachedChildren({\n items: state.collection.getChildren!(item.key),\n children: item => {\n switch (item.type) {\n case 'content': {\n return item.render!(item);\n }\n // Skip item since we don't render the nested rows as children of the parent row, the flattened collection\n // will render them each as siblings instead\n case 'loader':\n case 'item':\n return <></>;\n default:\n throw new Error('Unsupported element type in TreeRow: ' + item.type);\n }\n }\n });\n\n return (\n <>\n <div\n {...mergeProps(filterDOMProps(props as any), rowProps, focusProps, hoverProps, focusWithinProps)}\n {...renderProps}\n ref={ref}\n // TODO: missing selectionBehavior, hasAction and allowsSelection data attribute equivalents (available in renderProps). Do we want those?\n data-expanded={(hasChildRows && isExpanded) || undefined}\n data-has-child-rows={hasChildRows || undefined}\n data-level={level}\n data-selected={states.isSelected || undefined}\n data-disabled={states.isDisabled || undefined}\n data-hovered={isHovered || undefined}\n data-focused={states.isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-pressed={states.isPressed || undefined}\n data-selection-mode={state.selectionManager.selectionMode === 'none' ? undefined : state.selectionManager.selectionMode}>\n <div {...gridCellProps} style={{display: 'contents'}}>\n <Provider\n values={[\n [CheckboxContext, {\n slots: {\n selection: checkboxProps\n }\n }],\n // TODO: support description in the tree row\n // TODO: don't think I need to pass isExpanded to the button here since it can be sourced from the renderProps? Might be worthwhile passing it down?\n [ButtonContext, {\n slots: {\n [DEFAULT_SLOT]: {},\n chevron: {\n ...expandButtonProps,\n ref: expandButtonRef\n }\n }\n }],\n [TreeItemContentContext, {\n ...renderPropValues\n }]\n ]}>\n {children}\n </Provider>\n </div>\n </div>\n </>\n );\n});\n\nexport interface TreeLoadingIndicatorRenderProps {\n /**\n * What level the tree item has within the tree.\n * @selector [data-level]\n */\n level: number\n}\n\nexport interface TreeLoaderProps extends RenderProps<TreeLoadingIndicatorRenderProps>, StyleRenderProps<TreeLoadingIndicatorRenderProps> {}\n\nexport const UNSTABLE_TreeLoadingIndicator = createLeafComponent('loader', function TreeLoader<T extends object>(props: TreeLoaderProps, ref: ForwardedRef<HTMLDivElement>, item: Node<T>) {\n let state = useContext(UNSTABLE_TreeStateContext);\n // This loader row is is non-interactable, but we want the same aria props calculated as a typical row\n // @ts-ignore\n let {rowProps} = useTreeGridListItem({node: item}, state, ref);\n let level = rowProps['aria-level'] || 1;\n\n let ariaProps = {\n 'aria-level': rowProps['aria-level'],\n 'aria-posinset': rowProps['aria-posinset'],\n 'aria-setsize': rowProps['aria-setsize']\n };\n\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n children: item.rendered,\n defaultClassName: 'react-aria-TreeLoader',\n values: {\n level\n }\n });\n\n return (\n <>\n <div\n role=\"row\"\n ref={ref}\n {...mergeProps(filterDOMProps(props as any), ariaProps)}\n {...renderProps}\n data-level={level}>\n <div role=\"gridcell\" aria-colindex={1}>\n {renderProps.children}\n </div>\n </div>\n </>\n );\n});\n\nfunction convertExpanded(expanded: 'all' | Iterable<Key>): 'all' | Set<Key> {\n if (!expanded) {\n return new Set<Key>();\n }\n\n return expanded === 'all'\n ? 'all'\n : new Set(expanded);\n}\ninterface TreeGridCollectionOptions {\n expandedKeys: Set<Key>\n}\n\ninterface FlattenedTree<T> {\n flattenedRows: Node<T>[],\n keyMap: Map<Key, CollectionNode<T>>\n}\n\nfunction flattenTree<T>(collection: TreeCollection<T>, opts: TreeGridCollectionOptions): FlattenedTree<T> {\n let {\n expandedKeys = new Set()\n } = opts;\n let keyMap: Map<Key, CollectionNode<T>> = new Map();\n let flattenedRows: Node<T>[] = [];\n\n let visitNode = (node: Node<T>) => {\n if (node.type === 'item' || node.type === 'loader') {\n let parentKey = node?.parentKey;\n let clone = {...node};\n if (parentKey != null) {\n // TODO: assumes that non item content node (aka TreeItemContent always placed before Collection) will be always placed before the child rows. If we can't make this assumption then we can filter out\n // every non-item per level and assign indicies based off the node's position in said filtered array\n let hasContentNode = [...collection.getChildren(parentKey)][0].type !== 'item';\n if (hasContentNode) {\n clone.index = node?.index != null ? node?.index - 1 : 0;\n }\n\n // For loader nodes that have a parent (aka non-root level loaders), these need their levels incremented by 1 for parity with their sibiling rows\n // (Collection only increments the level if it is a \"item\" type node).\n if (node.type === 'loader') {\n clone.level = node.level + 1;\n }\n\n keyMap.set(clone.key, clone as CollectionNode<T>);\n } else {\n keyMap.set(node.key, node as CollectionNode<T>);\n }\n\n if (node.level === 0 || (parentKey != null && expandedKeys.has(parentKey) && flattenedRows.find(row => row.key === parentKey))) {\n // Grab the modified node from the key map so our flattened list and modified key map point to the same nodes\n flattenedRows.push(keyMap.get(node.key) || node);\n }\n } else if (node.type !== null) {\n keyMap.set(node.key, node as CollectionNode<T>);\n }\n\n for (let child of collection.getChildren(node.key)) {\n visitNode(child);\n }\n };\n\n for (let node of collection) {\n visitNode(node);\n }\n\n return {\n flattenedRows,\n keyMap\n };\n}\n"],"names":[],"version":3,"file":"Tree.module.js.map"}
package/dist/import.mjs CHANGED
@@ -1,5 +1,4 @@
1
1
  import {CheckboxContext as $4e85f108e88277b8$export$b085522c77523c51, ColorAreaContext as $4e85f108e88277b8$export$ebe63fadcdce34ed, ColorFieldContext as $4e85f108e88277b8$export$44644b8a16031b5b, ColorSliderContext as $4e85f108e88277b8$export$717b2c0a523a0b53, ColorWheelContext as $4e85f108e88277b8$export$265015d6dc85bf21, HeadingContext as $4e85f108e88277b8$export$d688439359537581} from "./RSPContexts.mjs";
2
- import {Disclosure as $28f4fd908f0de97f$export$74a362b31437ec83, DisclosureContext as $28f4fd908f0de97f$export$d665dd135a51b28a, DisclosurePanel as $28f4fd908f0de97f$export$feabaa331e1d464c, DisclosureStateContext as $28f4fd908f0de97f$export$dab3ea4a6ef094da} from "./Disclosure.mjs";
3
2
  import {Breadcrumb as $778035c5624f61e7$export$dabcc1ec9dd9d1cc, Breadcrumbs as $778035c5624f61e7$export$2dc68d50d56fbbd, BreadcrumbsContext as $778035c5624f61e7$export$65596d3621b0a4a0} from "./Breadcrumbs.mjs";
4
3
  import {Button as $d2b4bc8c273e7be6$export$353f5b6fc5456de1, ButtonContext as $d2b4bc8c273e7be6$export$24d547caef80ccd1} from "./Button.mjs";
5
4
  import {Calendar as $dfd62f934fc76fed$export$e1aef45b828286de, CalendarCell as $dfd62f934fc76fed$export$5d847498420df57b, CalendarContext as $dfd62f934fc76fed$export$3b805cea1f178355, CalendarGrid as $dfd62f934fc76fed$export$5bd780d491cfc46c, CalendarGridBody as $dfd62f934fc76fed$export$e11f8ba65d857bff, CalendarGridHeader as $dfd62f934fc76fed$export$22e2d15eaa4d2377, CalendarHeaderCell as $dfd62f934fc76fed$export$ad2135cac3a11b3d, CalendarStateContext as $dfd62f934fc76fed$export$9e31dcedda1dadc7, RangeCalendar as $dfd62f934fc76fed$export$a4f5c8b89d277a8d, RangeCalendarContext as $dfd62f934fc76fed$export$233dd9682e1ad64b, RangeCalendarStateContext as $dfd62f934fc76fed$export$5e0fc348c00f87a0} from "./Calendar.mjs";
@@ -17,6 +16,7 @@ import {composeRenderProps as $64fa3d84918910a7$export$c245e6201fed2f75, DEFAULT
17
16
  import {DateField as $40825cdb76e74f70$export$d9781c7894a82487, DateFieldContext as $40825cdb76e74f70$export$7b3e670c86da5fe8, DateFieldStateContext as $40825cdb76e74f70$export$3b08bebcf796eea0, DateInput as $40825cdb76e74f70$export$7edc06cf1783b30f, DateSegment as $40825cdb76e74f70$export$336ab7fa954c4b5f, TimeField as $40825cdb76e74f70$export$5eaee2322dd727eb, TimeFieldContext as $40825cdb76e74f70$export$8e17ddc448e87c1e, TimeFieldStateContext as $40825cdb76e74f70$export$5d8dc44abd10a920} from "./DateField.mjs";
18
17
  import {DatePicker as $06d5b8ec9ee5d538$export$5109c6dd95d8fb00, DatePickerContext as $06d5b8ec9ee5d538$export$cf316c7f3b44c11e, DatePickerStateContext as $06d5b8ec9ee5d538$export$50a10c048fdcdee9, DateRangePicker as $06d5b8ec9ee5d538$export$17334619f3ac2224, DateRangePickerContext as $06d5b8ec9ee5d538$export$8282edba42ee28a, DateRangePickerStateContext as $06d5b8ec9ee5d538$export$80d7ae1f804790be} from "./DatePicker.mjs";
19
18
  import {Dialog as $de32f1b87079253c$export$3ddf2d174ce01153, DialogContext as $de32f1b87079253c$export$8b93a07348a7730c, DialogTrigger as $de32f1b87079253c$export$2e1e1122cf0cba88, OverlayTriggerStateContext as $de32f1b87079253c$export$d2f961adcb0afbe} from "./Dialog.mjs";
19
+ import {Disclosure as $28f4fd908f0de97f$export$74a362b31437ec83, DisclosureContext as $28f4fd908f0de97f$export$d665dd135a51b28a, DisclosureGroup as $28f4fd908f0de97f$export$944aceb4f8c89f10, DisclosureGroupStateContext as $28f4fd908f0de97f$export$1d40e3e0cc4d5de, DisclosurePanel as $28f4fd908f0de97f$export$feabaa331e1d464c, DisclosureStateContext as $28f4fd908f0de97f$export$dab3ea4a6ef094da} from "./Disclosure.mjs";
20
20
  import {DropZone as $cb088e721efb9218$export$3c6489d84dc98b6, DropZoneContext as $cb088e721efb9218$export$14a72053295ff9a6} from "./DropZone.mjs";
21
21
  import {FieldError as $ee014567cb39d3f0$export$f551688fc98f2e09, FieldErrorContext as $ee014567cb39d3f0$export$ff05c3ac10437e03} from "./FieldError.mjs";
22
22
  import {FileTrigger as $1e2864c73f66a4da$export$6fb4a10d2c950550} from "./FileTrigger.mjs";
@@ -145,5 +145,5 @@ import {ListLayout as $67da31f5140672c4$re_export$UNSTABLE_ListLayout, GridLayou
145
145
 
146
146
 
147
147
 
148
- export {$4e85f108e88277b8$export$b085522c77523c51 as CheckboxContext, $4e85f108e88277b8$export$ebe63fadcdce34ed as ColorAreaContext, $4e85f108e88277b8$export$44644b8a16031b5b as ColorFieldContext, $4e85f108e88277b8$export$717b2c0a523a0b53 as ColorSliderContext, $4e85f108e88277b8$export$265015d6dc85bf21 as ColorWheelContext, $4e85f108e88277b8$export$d688439359537581 as HeadingContext, $28f4fd908f0de97f$export$74a362b31437ec83 as Disclosure, $28f4fd908f0de97f$export$feabaa331e1d464c as DisclosurePanel, $28f4fd908f0de97f$export$dab3ea4a6ef094da as DisclosureStateContext, $28f4fd908f0de97f$export$d665dd135a51b28a as DisclosureContext, $778035c5624f61e7$export$2dc68d50d56fbbd as Breadcrumbs, $778035c5624f61e7$export$65596d3621b0a4a0 as BreadcrumbsContext, $778035c5624f61e7$export$dabcc1ec9dd9d1cc as Breadcrumb, $d2b4bc8c273e7be6$export$353f5b6fc5456de1 as Button, $d2b4bc8c273e7be6$export$24d547caef80ccd1 as ButtonContext, $dfd62f934fc76fed$export$e1aef45b828286de as Calendar, $dfd62f934fc76fed$export$5bd780d491cfc46c as CalendarGrid, $dfd62f934fc76fed$export$22e2d15eaa4d2377 as CalendarGridHeader, $dfd62f934fc76fed$export$e11f8ba65d857bff as CalendarGridBody, $dfd62f934fc76fed$export$ad2135cac3a11b3d as CalendarHeaderCell, $dfd62f934fc76fed$export$5d847498420df57b as CalendarCell, $dfd62f934fc76fed$export$a4f5c8b89d277a8d as RangeCalendar, $dfd62f934fc76fed$export$3b805cea1f178355 as CalendarContext, $dfd62f934fc76fed$export$233dd9682e1ad64b as RangeCalendarContext, $dfd62f934fc76fed$export$9e31dcedda1dadc7 as CalendarStateContext, $dfd62f934fc76fed$export$5e0fc348c00f87a0 as RangeCalendarStateContext, $bc237834342dbd75$export$48513f6b9f8ce62d as Checkbox, $bc237834342dbd75$export$4aa08d5625cb8ead as CheckboxGroup, $bc237834342dbd75$export$baf37c4be89255b8 as CheckboxGroupContext, $bc237834342dbd75$export$139c5b8563afc1fc as CheckboxGroupStateContext, $0de070065d44825d$export$b2103f68a961418e as ColorArea, $0de070065d44825d$export$6b32221de49982e as ColorAreaStateContext, $3ada01a82feafb94$export$b865d4358897bb17 as ColorField, $3ada01a82feafb94$export$96b6d32b05a1a8ed as ColorFieldStateContext, $2637d3f5efb23186$export$9feb1bc2e5f1ccb3 as ColorPicker, $2637d3f5efb23186$export$cfac98503b32f6d6 as ColorPickerContext, $2637d3f5efb23186$export$2c14261be40a385f as ColorPickerStateContext, $1cca5300a3c2e7f9$export$44fd664bcca5b6fb as ColorSlider, $1cca5300a3c2e7f9$export$c7fad7ea00194428 as ColorSliderStateContext, $251c695a52d94a8d$export$cae13e90592f246a as ColorSwatch, $251c695a52d94a8d$export$83cc445538396800 as ColorSwatchContext, $0bb41941cfe72bd4$export$b46792416e3d8515 as ColorSwatchPicker, $0bb41941cfe72bd4$export$abcd89c27081c2ef as ColorSwatchPickerItem, $0bb41941cfe72bd4$export$7214f50881fc1eaf as ColorSwatchPickerContext, $e2b71ec1d6016406$export$a3cc47cee1c1ccc as ColorThumb, $66beab92e74e495f$export$f80663f808113381 as ColorWheel, $66beab92e74e495f$export$aaae3dd1f909c692 as ColorWheelTrack, $66beab92e74e495f$export$aec8299548648839 as ColorWheelTrackContext, $66beab92e74e495f$export$f5327df9fc840d47 as ColorWheelStateContext, $d01f2c01039c0eec$export$72b9695b8216309a as ComboBox, $d01f2c01039c0eec$export$d414ccceff7063c3 as ComboBoxContext, $d01f2c01039c0eec$export$c02625b26074192c as ComboBoxStateContext, $64fa3d84918910a7$export$c245e6201fed2f75 as composeRenderProps, $64fa3d84918910a7$export$c62b8e45d58ddad9 as DEFAULT_SLOT, $64fa3d84918910a7$export$2881499e37b75b9a as Provider, $64fa3d84918910a7$export$29f1550f4b0d4415 as useContextProps, $64fa3d84918910a7$export$fabf2dc03a41866e as useSlottedContext, $40825cdb76e74f70$export$d9781c7894a82487 as DateField, $40825cdb76e74f70$export$7edc06cf1783b30f as DateInput, $40825cdb76e74f70$export$336ab7fa954c4b5f as DateSegment, $40825cdb76e74f70$export$5eaee2322dd727eb as TimeField, $40825cdb76e74f70$export$7b3e670c86da5fe8 as DateFieldContext, $40825cdb76e74f70$export$8e17ddc448e87c1e as TimeFieldContext, $40825cdb76e74f70$export$3b08bebcf796eea0 as DateFieldStateContext, $40825cdb76e74f70$export$5d8dc44abd10a920 as TimeFieldStateContext, $06d5b8ec9ee5d538$export$5109c6dd95d8fb00 as DatePicker, $06d5b8ec9ee5d538$export$17334619f3ac2224 as DateRangePicker, $06d5b8ec9ee5d538$export$cf316c7f3b44c11e as DatePickerContext, $06d5b8ec9ee5d538$export$8282edba42ee28a as DateRangePickerContext, $06d5b8ec9ee5d538$export$50a10c048fdcdee9 as DatePickerStateContext, $06d5b8ec9ee5d538$export$80d7ae1f804790be as DateRangePickerStateContext, $de32f1b87079253c$export$2e1e1122cf0cba88 as DialogTrigger, $de32f1b87079253c$export$3ddf2d174ce01153 as Dialog, $de32f1b87079253c$export$8b93a07348a7730c as DialogContext, $de32f1b87079253c$export$d2f961adcb0afbe as OverlayTriggerStateContext, $cb088e721efb9218$export$3c6489d84dc98b6 as DropZone, $cb088e721efb9218$export$14a72053295ff9a6 as DropZoneContext, $ee014567cb39d3f0$export$f551688fc98f2e09 as FieldError, $ee014567cb39d3f0$export$ff05c3ac10437e03 as FieldErrorContext, $1e2864c73f66a4da$export$6fb4a10d2c950550 as FileTrigger, $d3e0e05bdfcf66bd$export$a7fed597f4b8afd8 as Form, $d3e0e05bdfcf66bd$export$c24727297075ec6a as FormContext, $72e60046c03fbe42$export$a7bfbda1311ca015 as GridList, $72e60046c03fbe42$export$e96fc9a8407faa6b as GridListItem, $72e60046c03fbe42$export$54fe942636b6416d as GridListContext, $a049562f99e7db0e$export$eb2fcfdbd7ba97d4 as Group, $a049562f99e7db0e$export$f9c6924e160136d1 as GroupContext, $72a5793c14baf454$export$8b251419efc915eb as Header, $72a5793c14baf454$export$e0e4026c12a8bdbb as HeaderContext, $5cb03073d3f54797$export$a8a3e93435678ff9 as Heading, $3985021b0ad6602f$export$f5b8910cec6cf069 as Input, $3985021b0ad6602f$export$37fb8590cf2c088c as InputContext, $7135fc7d473fd974$export$6e2c8f0811a474ce as Section, $7135fc7d473fd974$export$4feb769f8ddf26c5 as UNSTABLE_CollectionRendererContext, $7135fc7d473fd974$export$a164736487e3f0ae as UNSTABLE_DefaultCollectionRenderer, $67da31f5140672c4$re_export$Collection as Collection, $67da31f5140672c4$re_export$UNSTABLE_createLeafComponent as UNSTABLE_createLeafComponent, $67da31f5140672c4$re_export$UNSTABLE_createBranchComponent as UNSTABLE_createBranchComponent, $67da31f5140672c4$re_export$UNSTABLE_CollectionBuilder as UNSTABLE_CollectionBuilder, $63df2425e2108aa8$export$16e4d70cc375e707 as Keyboard, $63df2425e2108aa8$export$744d98a3b8a94e1c as KeyboardContext, $01b77f81d0f07f68$export$b04be29aa201d4f5 as Label, $01b77f81d0f07f68$export$75b6ee27786ba447 as LabelContext, $4f118338184dc1d9$export$a6c7ac8248d6e38a as Link, $4f118338184dc1d9$export$e2509388b49734e7 as LinkContext, $eed445e0843c11d0$export$41f133550aa26f48 as ListBox, $eed445e0843c11d0$export$a11e76429ed99b4 as ListBoxItem, $eed445e0843c11d0$export$7ff8f37d2d81a48d as ListBoxContext, $eed445e0843c11d0$export$7c5906fe4f1f2af2 as ListStateContext, $3674c52c6b3c5bce$export$d9b273488cd8ce6f as Menu, $3674c52c6b3c5bce$export$2ce376c2cc3355c8 as MenuItem, $3674c52c6b3c5bce$export$27d2ad3c5815583e as MenuTrigger, $3674c52c6b3c5bce$export$c7e742effb1c51e2 as MenuContext, $3674c52c6b3c5bce$export$24aad8519b95b41b as MenuStateContext, $3674c52c6b3c5bce$export$795aec4671cbae19 as RootMenuTriggerStateContext, $3674c52c6b3c5bce$export$ecabc99eeffab7ca as SubmenuTrigger, $c0c9ced265f3594c$export$62e3ae2a4090b879 as Meter, $c0c9ced265f3594c$export$8b645da15a96b44f as MeterContext, $f3f84453ead64de5$export$2b77a92f1a5ad772 as Modal, $f3f84453ead64de5$export$8948f78d83984c69 as ModalOverlay, $f3f84453ead64de5$export$ab57792b9b6974a6 as ModalContext, $b91743d66a0ed188$export$63c5fa0b2fdccd2e as NumberField, $b91743d66a0ed188$export$b414a48cf5dcbc11 as NumberFieldContext, $b91743d66a0ed188$export$6cc906c6cff9bec5 as NumberFieldStateContext, $44f671af83e7d9e0$export$746d02f47f4d381 as OverlayArrow, $07b14b47974efb58$export$5b6b19405a83ff9d as Popover, $07b14b47974efb58$export$9b9a0cd73afb7ca4 as PopoverContext, $0393f8ab869a0f1a$export$c17561cb55d4db30 as ProgressBar, $0393f8ab869a0f1a$export$e9f3bf65a26ce129 as ProgressBarContext, $b6c3ddc6086f204d$export$a98f0dcb43a68a25 as RadioGroup, $b6c3ddc6086f204d$export$d7b12c4107be0d61 as Radio, $b6c3ddc6086f204d$export$a79eda4ff50e30b6 as RadioGroupContext, $b6c3ddc6086f204d$export$b118023277d4a5c3 as RadioContext, $b6c3ddc6086f204d$export$29d84393af70866c as RadioGroupStateContext, $440f4836bcb56932$export$b94867ecbd698f21 as SearchField, $440f4836bcb56932$export$d1c4e4c63cb03a11 as SearchFieldContext, $82d7e5349645de74$export$ef9b1a59e592288f as Select, $82d7e5349645de74$export$e288731fd71264f0 as SelectValue, $82d7e5349645de74$export$7540cee5be7dc19b as SelectContext, $82d7e5349645de74$export$f8f745c04421623f as SelectValueContext, $82d7e5349645de74$export$ef445b55be0601bd as SelectStateContext, $431f98aba6844401$export$1ff3c3f08ae963c0 as Separator, $431f98aba6844401$export$6615d83f6de245ce as SeparatorContext, $6f909507e6374d18$export$472062a354075cee as Slider, $6f909507e6374d18$export$a590f758a961cb5b as SliderOutput, $6f909507e6374d18$export$105594979f116971 as SliderTrack, $6f909507e6374d18$export$2c1b491743890dec as SliderThumb, $6f909507e6374d18$export$e99164f0030f3bff as SliderContext, $6f909507e6374d18$export$6189c2744041d8f8 as SliderOutputContext, $6f909507e6374d18$export$f1fce0420cc6d8ee as SliderTrackContext, $6f909507e6374d18$export$1e7083018727fa60 as SliderStateContext, $8e59e948500a8fe1$export$b5d5cf8927ab7262 as Switch, $8e59e948500a8fe1$export$8699e3b644d5a28a as SwitchContext, $1910c06f0ca9905e$export$f241c45dcdfa4093 as UNSTABLE_TableLoadingIndicator, $1910c06f0ca9905e$export$54ec01a60f47d33d as Table, $1910c06f0ca9905e$export$b59bdbef9ce70de2 as Row, $1910c06f0ca9905e$export$f6f0c3fe4ec306ea as Cell, $1910c06f0ca9905e$export$816b5d811295e6bc as Column, $1910c06f0ca9905e$export$ee689e97a7664bfd as ColumnResizer, $1910c06f0ca9905e$export$f850895b287ef28e as TableHeader, $1910c06f0ca9905e$export$76ccd210b9029917 as TableBody, $1910c06f0ca9905e$export$93e4b0b2cc49b648 as TableContext, $1910c06f0ca9905e$export$7063e69b8a954175 as ResizableTableContainer, $1910c06f0ca9905e$export$fddc468cd8cb4db9 as useTableOptions, $1910c06f0ca9905e$export$38de1cb0526c21fb as TableStateContext, $1910c06f0ca9905e$export$a2680a798823803c as TableColumnResizeStateContext, $2f9e0b0e857fd9ba$export$62444c3c724b1b20 as UNSTABLE_TableLayout, $5e8ad37a45e1c704$export$b2539bed5023c21c as Tabs, $5e8ad37a45e1c704$export$e51a686c67fdaa2d as TabList, $5e8ad37a45e1c704$export$3d96ec278d3efce4 as TabPanel, $5e8ad37a45e1c704$export$3e41faf802a29e71 as Tab, $5e8ad37a45e1c704$export$cfa7aa87c26e7d1f as TabsContext, $5e8ad37a45e1c704$export$364712098d2aa57c as TabListStateContext, $eaf9e70818b436db$export$67ea30858aaf75e3 as TagGroup, $eaf9e70818b436db$export$5b07b5dd2cbd96e3 as TagGroupContext, $eaf9e70818b436db$export$f9fef0f55402315b as TagList, $eaf9e70818b436db$export$e755ce3685dd0ca9 as TagListContext, $eaf9e70818b436db$export$3288d34c523a1192 as Tag, $514c0188e459b4c0$export$5f1af8db9871e1d6 as Text, $514c0188e459b4c0$export$9afb8bc826b033ea as TextContext, $216918bed6669f72$export$f5c9f3c2c4054eec as TextArea, $216918bed6669f72$export$2dc6166a7e65358c as TextAreaContext, $bcdf0525bf22703d$export$2c73285ae9390cec as TextField, $bcdf0525bf22703d$export$2129e27b3ef0d483 as TextFieldContext, $efde0372d7a700fe$export$d2b052e7b4be1756 as ToggleButton, $efde0372d7a700fe$export$43506d75ebd2e218 as ToggleButtonContext, $13c3c67164f4d5be$export$4c260019440d418f as Toolbar, $13c3c67164f4d5be$export$6311e7ab80ef752f as ToolbarContext, $4e3b923658d69c60$export$8c610744efcf8a1d as TooltipTrigger, $4e3b923658d69c60$export$28c660c63b792dea as Tooltip, $4e3b923658d69c60$export$7a7623236eec67fa as TooltipTriggerStateContext, $4e3b923658d69c60$export$39ae08fa83328b12 as TooltipContext, $2f5eaf4a2a47b4cf$export$9d1a587784d97b41 as UNSTABLE_TreeLoadingIndicator, $2f5eaf4a2a47b4cf$export$d0a8e7e54b84533e as UNSTABLE_Tree, $2f5eaf4a2a47b4cf$export$635b3358b7a3dfbb as UNSTABLE_TreeItem, $2f5eaf4a2a47b4cf$export$3bc9de6f50aaf218 as UNSTABLE_TreeContext, $2f5eaf4a2a47b4cf$export$c6dbc5e1eadc6d13 as UNSTABLE_TreeItemContent, $2f5eaf4a2a47b4cf$export$284f9562065cdd9d as UNSTABLE_TreeStateContext, $d8f176866e6dc039$export$2cfc5be7a55829f6 as useDragAndDrop, $612b8eb6cb90e02d$export$62ed72bc21f6b8a6 as DropIndicator, $612b8eb6cb90e02d$export$f55761759794cf55 as DropIndicatorContext, $612b8eb6cb90e02d$export$d188a835a7bc5783 as DragAndDropContext, $ce3a951440fc273f$export$89be5a243e59c4b2 as UNSTABLE_Virtualizer, $67da31f5140672c4$re_export$DIRECTORY_DRAG_TYPE as DIRECTORY_DRAG_TYPE, $67da31f5140672c4$re_export$isDirectoryDropItem as isDirectoryDropItem, $67da31f5140672c4$re_export$isFileDropItem as isFileDropItem, $67da31f5140672c4$re_export$isTextDropItem as isTextDropItem, $67da31f5140672c4$re_export$SSRProvider as SSRProvider, $67da31f5140672c4$re_export$RouterProvider as RouterProvider, $67da31f5140672c4$re_export$I18nProvider as I18nProvider, $67da31f5140672c4$re_export$useLocale as useLocale, $67da31f5140672c4$re_export$FormValidationContext as FormValidationContext, $67da31f5140672c4$re_export$parseColor as parseColor, $67da31f5140672c4$re_export$getColorChannels as getColorChannels, $67da31f5140672c4$re_export$UNSTABLE_ListLayout as UNSTABLE_ListLayout, $67da31f5140672c4$re_export$UNSTABLE_GridLayout as UNSTABLE_GridLayout};
148
+ export {$4e85f108e88277b8$export$b085522c77523c51 as CheckboxContext, $4e85f108e88277b8$export$ebe63fadcdce34ed as ColorAreaContext, $4e85f108e88277b8$export$44644b8a16031b5b as ColorFieldContext, $4e85f108e88277b8$export$717b2c0a523a0b53 as ColorSliderContext, $4e85f108e88277b8$export$265015d6dc85bf21 as ColorWheelContext, $4e85f108e88277b8$export$d688439359537581 as HeadingContext, $778035c5624f61e7$export$2dc68d50d56fbbd as Breadcrumbs, $778035c5624f61e7$export$65596d3621b0a4a0 as BreadcrumbsContext, $778035c5624f61e7$export$dabcc1ec9dd9d1cc as Breadcrumb, $d2b4bc8c273e7be6$export$353f5b6fc5456de1 as Button, $d2b4bc8c273e7be6$export$24d547caef80ccd1 as ButtonContext, $dfd62f934fc76fed$export$e1aef45b828286de as Calendar, $dfd62f934fc76fed$export$5bd780d491cfc46c as CalendarGrid, $dfd62f934fc76fed$export$22e2d15eaa4d2377 as CalendarGridHeader, $dfd62f934fc76fed$export$e11f8ba65d857bff as CalendarGridBody, $dfd62f934fc76fed$export$ad2135cac3a11b3d as CalendarHeaderCell, $dfd62f934fc76fed$export$5d847498420df57b as CalendarCell, $dfd62f934fc76fed$export$a4f5c8b89d277a8d as RangeCalendar, $dfd62f934fc76fed$export$3b805cea1f178355 as CalendarContext, $dfd62f934fc76fed$export$233dd9682e1ad64b as RangeCalendarContext, $dfd62f934fc76fed$export$9e31dcedda1dadc7 as CalendarStateContext, $dfd62f934fc76fed$export$5e0fc348c00f87a0 as RangeCalendarStateContext, $bc237834342dbd75$export$48513f6b9f8ce62d as Checkbox, $bc237834342dbd75$export$4aa08d5625cb8ead as CheckboxGroup, $bc237834342dbd75$export$baf37c4be89255b8 as CheckboxGroupContext, $bc237834342dbd75$export$139c5b8563afc1fc as CheckboxGroupStateContext, $0de070065d44825d$export$b2103f68a961418e as ColorArea, $0de070065d44825d$export$6b32221de49982e as ColorAreaStateContext, $3ada01a82feafb94$export$b865d4358897bb17 as ColorField, $3ada01a82feafb94$export$96b6d32b05a1a8ed as ColorFieldStateContext, $2637d3f5efb23186$export$9feb1bc2e5f1ccb3 as ColorPicker, $2637d3f5efb23186$export$cfac98503b32f6d6 as ColorPickerContext, $2637d3f5efb23186$export$2c14261be40a385f as ColorPickerStateContext, $1cca5300a3c2e7f9$export$44fd664bcca5b6fb as ColorSlider, $1cca5300a3c2e7f9$export$c7fad7ea00194428 as ColorSliderStateContext, $251c695a52d94a8d$export$cae13e90592f246a as ColorSwatch, $251c695a52d94a8d$export$83cc445538396800 as ColorSwatchContext, $0bb41941cfe72bd4$export$b46792416e3d8515 as ColorSwatchPicker, $0bb41941cfe72bd4$export$abcd89c27081c2ef as ColorSwatchPickerItem, $0bb41941cfe72bd4$export$7214f50881fc1eaf as ColorSwatchPickerContext, $e2b71ec1d6016406$export$a3cc47cee1c1ccc as ColorThumb, $66beab92e74e495f$export$f80663f808113381 as ColorWheel, $66beab92e74e495f$export$aaae3dd1f909c692 as ColorWheelTrack, $66beab92e74e495f$export$aec8299548648839 as ColorWheelTrackContext, $66beab92e74e495f$export$f5327df9fc840d47 as ColorWheelStateContext, $d01f2c01039c0eec$export$72b9695b8216309a as ComboBox, $d01f2c01039c0eec$export$d414ccceff7063c3 as ComboBoxContext, $d01f2c01039c0eec$export$c02625b26074192c as ComboBoxStateContext, $64fa3d84918910a7$export$c245e6201fed2f75 as composeRenderProps, $64fa3d84918910a7$export$c62b8e45d58ddad9 as DEFAULT_SLOT, $64fa3d84918910a7$export$2881499e37b75b9a as Provider, $64fa3d84918910a7$export$29f1550f4b0d4415 as useContextProps, $64fa3d84918910a7$export$fabf2dc03a41866e as useSlottedContext, $40825cdb76e74f70$export$d9781c7894a82487 as DateField, $40825cdb76e74f70$export$7edc06cf1783b30f as DateInput, $40825cdb76e74f70$export$336ab7fa954c4b5f as DateSegment, $40825cdb76e74f70$export$5eaee2322dd727eb as TimeField, $40825cdb76e74f70$export$7b3e670c86da5fe8 as DateFieldContext, $40825cdb76e74f70$export$8e17ddc448e87c1e as TimeFieldContext, $40825cdb76e74f70$export$3b08bebcf796eea0 as DateFieldStateContext, $40825cdb76e74f70$export$5d8dc44abd10a920 as TimeFieldStateContext, $06d5b8ec9ee5d538$export$5109c6dd95d8fb00 as DatePicker, $06d5b8ec9ee5d538$export$17334619f3ac2224 as DateRangePicker, $06d5b8ec9ee5d538$export$cf316c7f3b44c11e as DatePickerContext, $06d5b8ec9ee5d538$export$8282edba42ee28a as DateRangePickerContext, $06d5b8ec9ee5d538$export$50a10c048fdcdee9 as DatePickerStateContext, $06d5b8ec9ee5d538$export$80d7ae1f804790be as DateRangePickerStateContext, $de32f1b87079253c$export$2e1e1122cf0cba88 as DialogTrigger, $de32f1b87079253c$export$3ddf2d174ce01153 as Dialog, $de32f1b87079253c$export$8b93a07348a7730c as DialogContext, $de32f1b87079253c$export$d2f961adcb0afbe as OverlayTriggerStateContext, $28f4fd908f0de97f$export$74a362b31437ec83 as UNSTABLE_Disclosure, $28f4fd908f0de97f$export$944aceb4f8c89f10 as UNSTABLE_DisclosureGroup, $28f4fd908f0de97f$export$1d40e3e0cc4d5de as DisclosureGroupStateContext, $28f4fd908f0de97f$export$feabaa331e1d464c as UNSTABLE_DisclosurePanel, $28f4fd908f0de97f$export$dab3ea4a6ef094da as DisclosureStateContext, $28f4fd908f0de97f$export$d665dd135a51b28a as DisclosureContext, $cb088e721efb9218$export$3c6489d84dc98b6 as DropZone, $cb088e721efb9218$export$14a72053295ff9a6 as DropZoneContext, $ee014567cb39d3f0$export$f551688fc98f2e09 as FieldError, $ee014567cb39d3f0$export$ff05c3ac10437e03 as FieldErrorContext, $1e2864c73f66a4da$export$6fb4a10d2c950550 as FileTrigger, $d3e0e05bdfcf66bd$export$a7fed597f4b8afd8 as Form, $d3e0e05bdfcf66bd$export$c24727297075ec6a as FormContext, $72e60046c03fbe42$export$a7bfbda1311ca015 as GridList, $72e60046c03fbe42$export$e96fc9a8407faa6b as GridListItem, $72e60046c03fbe42$export$54fe942636b6416d as GridListContext, $a049562f99e7db0e$export$eb2fcfdbd7ba97d4 as Group, $a049562f99e7db0e$export$f9c6924e160136d1 as GroupContext, $72a5793c14baf454$export$8b251419efc915eb as Header, $72a5793c14baf454$export$e0e4026c12a8bdbb as HeaderContext, $5cb03073d3f54797$export$a8a3e93435678ff9 as Heading, $3985021b0ad6602f$export$f5b8910cec6cf069 as Input, $3985021b0ad6602f$export$37fb8590cf2c088c as InputContext, $7135fc7d473fd974$export$6e2c8f0811a474ce as Section, $7135fc7d473fd974$export$4feb769f8ddf26c5 as UNSTABLE_CollectionRendererContext, $7135fc7d473fd974$export$a164736487e3f0ae as UNSTABLE_DefaultCollectionRenderer, $67da31f5140672c4$re_export$Collection as Collection, $67da31f5140672c4$re_export$UNSTABLE_createLeafComponent as UNSTABLE_createLeafComponent, $67da31f5140672c4$re_export$UNSTABLE_createBranchComponent as UNSTABLE_createBranchComponent, $67da31f5140672c4$re_export$UNSTABLE_CollectionBuilder as UNSTABLE_CollectionBuilder, $63df2425e2108aa8$export$16e4d70cc375e707 as Keyboard, $63df2425e2108aa8$export$744d98a3b8a94e1c as KeyboardContext, $01b77f81d0f07f68$export$b04be29aa201d4f5 as Label, $01b77f81d0f07f68$export$75b6ee27786ba447 as LabelContext, $4f118338184dc1d9$export$a6c7ac8248d6e38a as Link, $4f118338184dc1d9$export$e2509388b49734e7 as LinkContext, $eed445e0843c11d0$export$41f133550aa26f48 as ListBox, $eed445e0843c11d0$export$a11e76429ed99b4 as ListBoxItem, $eed445e0843c11d0$export$7ff8f37d2d81a48d as ListBoxContext, $eed445e0843c11d0$export$7c5906fe4f1f2af2 as ListStateContext, $3674c52c6b3c5bce$export$d9b273488cd8ce6f as Menu, $3674c52c6b3c5bce$export$2ce376c2cc3355c8 as MenuItem, $3674c52c6b3c5bce$export$27d2ad3c5815583e as MenuTrigger, $3674c52c6b3c5bce$export$c7e742effb1c51e2 as MenuContext, $3674c52c6b3c5bce$export$24aad8519b95b41b as MenuStateContext, $3674c52c6b3c5bce$export$795aec4671cbae19 as RootMenuTriggerStateContext, $3674c52c6b3c5bce$export$ecabc99eeffab7ca as SubmenuTrigger, $c0c9ced265f3594c$export$62e3ae2a4090b879 as Meter, $c0c9ced265f3594c$export$8b645da15a96b44f as MeterContext, $f3f84453ead64de5$export$2b77a92f1a5ad772 as Modal, $f3f84453ead64de5$export$8948f78d83984c69 as ModalOverlay, $f3f84453ead64de5$export$ab57792b9b6974a6 as ModalContext, $b91743d66a0ed188$export$63c5fa0b2fdccd2e as NumberField, $b91743d66a0ed188$export$b414a48cf5dcbc11 as NumberFieldContext, $b91743d66a0ed188$export$6cc906c6cff9bec5 as NumberFieldStateContext, $44f671af83e7d9e0$export$746d02f47f4d381 as OverlayArrow, $07b14b47974efb58$export$5b6b19405a83ff9d as Popover, $07b14b47974efb58$export$9b9a0cd73afb7ca4 as PopoverContext, $0393f8ab869a0f1a$export$c17561cb55d4db30 as ProgressBar, $0393f8ab869a0f1a$export$e9f3bf65a26ce129 as ProgressBarContext, $b6c3ddc6086f204d$export$a98f0dcb43a68a25 as RadioGroup, $b6c3ddc6086f204d$export$d7b12c4107be0d61 as Radio, $b6c3ddc6086f204d$export$a79eda4ff50e30b6 as RadioGroupContext, $b6c3ddc6086f204d$export$b118023277d4a5c3 as RadioContext, $b6c3ddc6086f204d$export$29d84393af70866c as RadioGroupStateContext, $440f4836bcb56932$export$b94867ecbd698f21 as SearchField, $440f4836bcb56932$export$d1c4e4c63cb03a11 as SearchFieldContext, $82d7e5349645de74$export$ef9b1a59e592288f as Select, $82d7e5349645de74$export$e288731fd71264f0 as SelectValue, $82d7e5349645de74$export$7540cee5be7dc19b as SelectContext, $82d7e5349645de74$export$f8f745c04421623f as SelectValueContext, $82d7e5349645de74$export$ef445b55be0601bd as SelectStateContext, $431f98aba6844401$export$1ff3c3f08ae963c0 as Separator, $431f98aba6844401$export$6615d83f6de245ce as SeparatorContext, $6f909507e6374d18$export$472062a354075cee as Slider, $6f909507e6374d18$export$a590f758a961cb5b as SliderOutput, $6f909507e6374d18$export$105594979f116971 as SliderTrack, $6f909507e6374d18$export$2c1b491743890dec as SliderThumb, $6f909507e6374d18$export$e99164f0030f3bff as SliderContext, $6f909507e6374d18$export$6189c2744041d8f8 as SliderOutputContext, $6f909507e6374d18$export$f1fce0420cc6d8ee as SliderTrackContext, $6f909507e6374d18$export$1e7083018727fa60 as SliderStateContext, $8e59e948500a8fe1$export$b5d5cf8927ab7262 as Switch, $8e59e948500a8fe1$export$8699e3b644d5a28a as SwitchContext, $1910c06f0ca9905e$export$f241c45dcdfa4093 as UNSTABLE_TableLoadingIndicator, $1910c06f0ca9905e$export$54ec01a60f47d33d as Table, $1910c06f0ca9905e$export$b59bdbef9ce70de2 as Row, $1910c06f0ca9905e$export$f6f0c3fe4ec306ea as Cell, $1910c06f0ca9905e$export$816b5d811295e6bc as Column, $1910c06f0ca9905e$export$ee689e97a7664bfd as ColumnResizer, $1910c06f0ca9905e$export$f850895b287ef28e as TableHeader, $1910c06f0ca9905e$export$76ccd210b9029917 as TableBody, $1910c06f0ca9905e$export$93e4b0b2cc49b648 as TableContext, $1910c06f0ca9905e$export$7063e69b8a954175 as ResizableTableContainer, $1910c06f0ca9905e$export$fddc468cd8cb4db9 as useTableOptions, $1910c06f0ca9905e$export$38de1cb0526c21fb as TableStateContext, $1910c06f0ca9905e$export$a2680a798823803c as TableColumnResizeStateContext, $2f9e0b0e857fd9ba$export$62444c3c724b1b20 as UNSTABLE_TableLayout, $5e8ad37a45e1c704$export$b2539bed5023c21c as Tabs, $5e8ad37a45e1c704$export$e51a686c67fdaa2d as TabList, $5e8ad37a45e1c704$export$3d96ec278d3efce4 as TabPanel, $5e8ad37a45e1c704$export$3e41faf802a29e71 as Tab, $5e8ad37a45e1c704$export$cfa7aa87c26e7d1f as TabsContext, $5e8ad37a45e1c704$export$364712098d2aa57c as TabListStateContext, $eaf9e70818b436db$export$67ea30858aaf75e3 as TagGroup, $eaf9e70818b436db$export$5b07b5dd2cbd96e3 as TagGroupContext, $eaf9e70818b436db$export$f9fef0f55402315b as TagList, $eaf9e70818b436db$export$e755ce3685dd0ca9 as TagListContext, $eaf9e70818b436db$export$3288d34c523a1192 as Tag, $514c0188e459b4c0$export$5f1af8db9871e1d6 as Text, $514c0188e459b4c0$export$9afb8bc826b033ea as TextContext, $216918bed6669f72$export$f5c9f3c2c4054eec as TextArea, $216918bed6669f72$export$2dc6166a7e65358c as TextAreaContext, $bcdf0525bf22703d$export$2c73285ae9390cec as TextField, $bcdf0525bf22703d$export$2129e27b3ef0d483 as TextFieldContext, $efde0372d7a700fe$export$d2b052e7b4be1756 as ToggleButton, $efde0372d7a700fe$export$43506d75ebd2e218 as ToggleButtonContext, $13c3c67164f4d5be$export$4c260019440d418f as Toolbar, $13c3c67164f4d5be$export$6311e7ab80ef752f as ToolbarContext, $4e3b923658d69c60$export$8c610744efcf8a1d as TooltipTrigger, $4e3b923658d69c60$export$28c660c63b792dea as Tooltip, $4e3b923658d69c60$export$7a7623236eec67fa as TooltipTriggerStateContext, $4e3b923658d69c60$export$39ae08fa83328b12 as TooltipContext, $2f5eaf4a2a47b4cf$export$9d1a587784d97b41 as UNSTABLE_TreeLoadingIndicator, $2f5eaf4a2a47b4cf$export$d0a8e7e54b84533e as UNSTABLE_Tree, $2f5eaf4a2a47b4cf$export$635b3358b7a3dfbb as UNSTABLE_TreeItem, $2f5eaf4a2a47b4cf$export$3bc9de6f50aaf218 as UNSTABLE_TreeContext, $2f5eaf4a2a47b4cf$export$c6dbc5e1eadc6d13 as UNSTABLE_TreeItemContent, $2f5eaf4a2a47b4cf$export$284f9562065cdd9d as UNSTABLE_TreeStateContext, $d8f176866e6dc039$export$2cfc5be7a55829f6 as useDragAndDrop, $612b8eb6cb90e02d$export$62ed72bc21f6b8a6 as DropIndicator, $612b8eb6cb90e02d$export$f55761759794cf55 as DropIndicatorContext, $612b8eb6cb90e02d$export$d188a835a7bc5783 as DragAndDropContext, $ce3a951440fc273f$export$89be5a243e59c4b2 as UNSTABLE_Virtualizer, $67da31f5140672c4$re_export$DIRECTORY_DRAG_TYPE as DIRECTORY_DRAG_TYPE, $67da31f5140672c4$re_export$isDirectoryDropItem as isDirectoryDropItem, $67da31f5140672c4$re_export$isFileDropItem as isFileDropItem, $67da31f5140672c4$re_export$isTextDropItem as isTextDropItem, $67da31f5140672c4$re_export$SSRProvider as SSRProvider, $67da31f5140672c4$re_export$RouterProvider as RouterProvider, $67da31f5140672c4$re_export$I18nProvider as I18nProvider, $67da31f5140672c4$re_export$useLocale as useLocale, $67da31f5140672c4$re_export$FormValidationContext as FormValidationContext, $67da31f5140672c4$re_export$parseColor as parseColor, $67da31f5140672c4$re_export$getColorChannels as getColorChannels, $67da31f5140672c4$re_export$UNSTABLE_ListLayout as UNSTABLE_ListLayout, $67da31f5140672c4$re_export$UNSTABLE_GridLayout as UNSTABLE_GridLayout};
149
149
  //# sourceMappingURL=module.js.map
package/dist/main.js CHANGED
@@ -1,5 +1,4 @@
1
1
  var $525402dfec7da5bc$exports = require("./RSPContexts.main.js");
2
- var $11c780105231f6ef$exports = require("./Disclosure.main.js");
3
2
  var $afa44b644f65ed30$exports = require("./Breadcrumbs.main.js");
4
3
  var $b856e6788a7ea5bf$exports = require("./Button.main.js");
5
4
  var $3f539f26b167ddde$exports = require("./Calendar.main.js");
@@ -17,6 +16,7 @@ var $c5ccf687772c0422$exports = require("./utils.main.js");
17
16
  var $9eb4e1c2268ca198$exports = require("./DateField.main.js");
18
17
  var $adfe8d3f75d5162e$exports = require("./DatePicker.main.js");
19
18
  var $2979ab89b336194b$exports = require("./Dialog.main.js");
19
+ var $11c780105231f6ef$exports = require("./Disclosure.main.js");
20
20
  var $80a65baccb138f12$exports = require("./DropZone.main.js");
21
21
  var $846a838139f2ac6b$exports = require("./FieldError.main.js");
22
22
  var $8e055a19745f522c$exports = require("./FileTrigger.main.js");
@@ -76,10 +76,6 @@ $parcel$export(module.exports, "ColorFieldContext", () => $525402dfec7da5bc$expo
76
76
  $parcel$export(module.exports, "ColorSliderContext", () => $525402dfec7da5bc$exports.ColorSliderContext);
77
77
  $parcel$export(module.exports, "ColorWheelContext", () => $525402dfec7da5bc$exports.ColorWheelContext);
78
78
  $parcel$export(module.exports, "HeadingContext", () => $525402dfec7da5bc$exports.HeadingContext);
79
- $parcel$export(module.exports, "Disclosure", () => $11c780105231f6ef$exports.Disclosure);
80
- $parcel$export(module.exports, "DisclosurePanel", () => $11c780105231f6ef$exports.DisclosurePanel);
81
- $parcel$export(module.exports, "DisclosureStateContext", () => $11c780105231f6ef$exports.DisclosureStateContext);
82
- $parcel$export(module.exports, "DisclosureContext", () => $11c780105231f6ef$exports.DisclosureContext);
83
79
  $parcel$export(module.exports, "Breadcrumbs", () => $afa44b644f65ed30$exports.Breadcrumbs);
84
80
  $parcel$export(module.exports, "BreadcrumbsContext", () => $afa44b644f65ed30$exports.BreadcrumbsContext);
85
81
  $parcel$export(module.exports, "Breadcrumb", () => $afa44b644f65ed30$exports.Breadcrumb);
@@ -145,6 +141,12 @@ $parcel$export(module.exports, "DialogTrigger", () => $2979ab89b336194b$exports.
145
141
  $parcel$export(module.exports, "Dialog", () => $2979ab89b336194b$exports.Dialog);
146
142
  $parcel$export(module.exports, "DialogContext", () => $2979ab89b336194b$exports.DialogContext);
147
143
  $parcel$export(module.exports, "OverlayTriggerStateContext", () => $2979ab89b336194b$exports.OverlayTriggerStateContext);
144
+ $parcel$export(module.exports, "UNSTABLE_Disclosure", () => $11c780105231f6ef$exports.Disclosure);
145
+ $parcel$export(module.exports, "UNSTABLE_DisclosureGroup", () => $11c780105231f6ef$exports.DisclosureGroup);
146
+ $parcel$export(module.exports, "DisclosureGroupStateContext", () => $11c780105231f6ef$exports.DisclosureGroupStateContext);
147
+ $parcel$export(module.exports, "UNSTABLE_DisclosurePanel", () => $11c780105231f6ef$exports.DisclosurePanel);
148
+ $parcel$export(module.exports, "DisclosureStateContext", () => $11c780105231f6ef$exports.DisclosureStateContext);
149
+ $parcel$export(module.exports, "DisclosureContext", () => $11c780105231f6ef$exports.DisclosureContext);
148
150
  $parcel$export(module.exports, "DropZone", () => $80a65baccb138f12$exports.DropZone);
149
151
  $parcel$export(module.exports, "DropZoneContext", () => $80a65baccb138f12$exports.DropZoneContext);
150
152
  $parcel$export(module.exports, "FieldError", () => $846a838139f2ac6b$exports.FieldError);
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,+EAA+E;AAC/E,0EAA0E","sources":["packages/react-aria-components/src/index.ts"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// Mark as a client only package. This will cause a build time error if you try\n// to import it from a React Server Component in a framework like Next.js.\nimport 'client-only';\n\nexport {CheckboxContext, ColorAreaContext, ColorFieldContext, ColorSliderContext, ColorWheelContext, HeadingContext} from './RSPContexts';\n\nexport {Disclosure, DisclosurePanel, DisclosureStateContext, DisclosureContext} from './Disclosure';\nexport {Breadcrumbs, BreadcrumbsContext, Breadcrumb} from './Breadcrumbs';\nexport {Button, ButtonContext} from './Button';\nexport {Calendar, CalendarGrid, CalendarGridHeader, CalendarGridBody, CalendarHeaderCell, CalendarCell, RangeCalendar, CalendarContext, RangeCalendarContext, CalendarStateContext, RangeCalendarStateContext} from './Calendar';\nexport {Checkbox, CheckboxGroup, CheckboxGroupContext, CheckboxGroupStateContext} from './Checkbox';\nexport {ColorArea, ColorAreaStateContext} from './ColorArea';\nexport {ColorField, ColorFieldStateContext} from './ColorField';\nexport {ColorPicker, ColorPickerContext, ColorPickerStateContext} from './ColorPicker';\nexport {ColorSlider, ColorSliderStateContext} from './ColorSlider';\nexport {ColorSwatch, ColorSwatchContext} from './ColorSwatch';\nexport {ColorSwatchPicker, ColorSwatchPickerItem, ColorSwatchPickerContext} from './ColorSwatchPicker';\nexport {ColorThumb} from './ColorThumb';\nexport {ColorWheel, ColorWheelTrack, ColorWheelTrackContext, ColorWheelStateContext} from './ColorWheel';\nexport {ComboBox, ComboBoxContext, ComboBoxStateContext} from './ComboBox';\nexport {composeRenderProps, DEFAULT_SLOT, Provider, useContextProps, useSlottedContext} from './utils';\nexport {DateField, DateInput, DateSegment, TimeField, DateFieldContext, TimeFieldContext, DateFieldStateContext, TimeFieldStateContext} from './DateField';\nexport {DatePicker, DateRangePicker, DatePickerContext, DateRangePickerContext, DatePickerStateContext, DateRangePickerStateContext} from './DatePicker';\nexport {DialogTrigger, Dialog, DialogContext, OverlayTriggerStateContext} from './Dialog';\nexport {DropZone, DropZoneContext} from './DropZone';\nexport {FieldError, FieldErrorContext} from './FieldError';\nexport {FileTrigger} from './FileTrigger';\nexport {Form, FormContext} from './Form';\nexport {GridList, GridListItem, GridListContext} from './GridList';\nexport {Group, GroupContext} from './Group';\nexport {Header, HeaderContext} from './Header';\nexport {Heading} from './Heading';\nexport {Input, InputContext} from './Input';\nexport {Section, CollectionRendererContext as UNSTABLE_CollectionRendererContext, DefaultCollectionRenderer as UNSTABLE_DefaultCollectionRenderer} from './Collection';\nexport {Collection, createLeafComponent as UNSTABLE_createLeafComponent, createBranchComponent as UNSTABLE_createBranchComponent, CollectionBuilder as UNSTABLE_CollectionBuilder} from '@react-aria/collections';\nexport {Keyboard, KeyboardContext} from './Keyboard';\nexport {Label, LabelContext} from './Label';\nexport {Link, LinkContext} from './Link';\nexport {ListBox, ListBoxItem, ListBoxContext, ListStateContext} from './ListBox';\nexport {Menu, MenuItem, MenuTrigger, MenuContext, MenuStateContext, RootMenuTriggerStateContext, SubmenuTrigger} from './Menu';\nexport {Meter, MeterContext} from './Meter';\nexport {Modal, ModalOverlay, ModalContext} from './Modal';\nexport {NumberField, NumberFieldContext, NumberFieldStateContext} from './NumberField';\nexport {OverlayArrow} from './OverlayArrow';\nexport {Popover, PopoverContext} from './Popover';\nexport {ProgressBar, ProgressBarContext} from './ProgressBar';\nexport {RadioGroup, Radio, RadioGroupContext, RadioContext, RadioGroupStateContext} from './RadioGroup';\nexport {SearchField, SearchFieldContext} from './SearchField';\nexport {Select, SelectValue, SelectContext, SelectValueContext, SelectStateContext} from './Select';\nexport {Separator, SeparatorContext} from './Separator';\nexport {Slider, SliderOutput, SliderTrack, SliderThumb, SliderContext, SliderOutputContext, SliderTrackContext, SliderStateContext} from './Slider';\nexport {Switch, SwitchContext} from './Switch';\nexport {UNSTABLE_TableLoadingIndicator, Table, Row, Cell, Column, ColumnResizer, TableHeader, TableBody, TableContext, ResizableTableContainer, useTableOptions, TableStateContext, TableColumnResizeStateContext} from './Table';\nexport {TableLayout as UNSTABLE_TableLayout} from './TableLayout';\nexport {Tabs, TabList, TabPanel, Tab, TabsContext, TabListStateContext} from './Tabs';\nexport {TagGroup, TagGroupContext, TagList, TagListContext, Tag} from './TagGroup';\nexport {Text, TextContext} from './Text';\nexport {TextArea, TextAreaContext} from './TextArea';\nexport {TextField, TextFieldContext} from './TextField';\nexport {ToggleButton, ToggleButtonContext} from './ToggleButton';\nexport {Toolbar, ToolbarContext} from './Toolbar';\nexport {TooltipTrigger, Tooltip, TooltipTriggerStateContext, TooltipContext} from './Tooltip';\nexport {UNSTABLE_TreeLoadingIndicator, UNSTABLE_Tree, UNSTABLE_TreeItem, UNSTABLE_TreeContext, UNSTABLE_TreeItemContent, UNSTABLE_TreeStateContext} from './Tree';\nexport {useDragAndDrop} from './useDragAndDrop';\nexport {DropIndicator, DropIndicatorContext, DragAndDropContext} from './DragAndDrop';\nexport {Virtualizer as UNSTABLE_Virtualizer} from './Virtualizer';\nexport {DIRECTORY_DRAG_TYPE, isDirectoryDropItem, isFileDropItem, isTextDropItem, SSRProvider, RouterProvider, I18nProvider, useLocale} from 'react-aria';\nexport {FormValidationContext} from 'react-stately';\nexport {parseColor, getColorChannels} from '@react-stately/color';\nexport {ListLayout as UNSTABLE_ListLayout, GridLayout as UNSTABLE_GridLayout} from '@react-stately/layout';\n\nexport type {DisclosureProps, DisclosurePanelProps} from './Disclosure';\nexport type {BreadcrumbsProps, BreadcrumbProps, BreadcrumbRenderProps} from './Breadcrumbs';\nexport type {ButtonProps, ButtonRenderProps} from './Button';\nexport type {CalendarCellProps, CalendarProps, CalendarRenderProps, CalendarGridProps, CalendarGridHeaderProps, CalendarGridBodyProps, CalendarHeaderCellProps, CalendarCellRenderProps, RangeCalendarProps, RangeCalendarRenderProps} from './Calendar';\nexport type {CheckboxGroupProps, CheckboxGroupRenderProps, CheckboxRenderProps, CheckboxProps} from './Checkbox';\nexport type {ColorAreaProps, ColorAreaRenderProps} from './ColorArea';\nexport type {ColorFieldProps, ColorFieldRenderProps} from './ColorField';\nexport type {ColorSliderProps, ColorSliderRenderProps} from './ColorSlider';\nexport type {ColorSwatchProps, ColorSwatchRenderProps} from './ColorSwatch';\nexport type {ColorSwatchPickerProps, ColorSwatchPickerRenderProps, ColorSwatchPickerItemProps, ColorSwatchPickerItemRenderProps} from './ColorSwatchPicker';\nexport type {ColorThumbProps, ColorThumbRenderProps} from './ColorThumb';\nexport type {ColorPickerProps, ColorPickerRenderProps} from './ColorPicker';\nexport type {ColorWheelProps, ColorWheelRenderProps, ColorWheelTrackProps, ColorWheelTrackRenderProps} from './ColorWheel';\nexport type {ComboBoxProps, ComboBoxRenderProps} from './ComboBox';\nexport type {DateFieldProps, DateFieldRenderProps, DateInputProps, DateInputRenderProps, DateSegmentProps, DateSegmentRenderProps, TimeFieldProps} from './DateField';\nexport type {DatePickerProps, DatePickerRenderProps, DateRangePickerProps, DateRangePickerRenderProps} from './DatePicker';\nexport type {DialogProps, DialogTriggerProps} from './Dialog';\nexport type {DropZoneProps, DropZoneRenderProps} from './DropZone';\nexport type {FieldErrorProps, FieldErrorRenderProps} from './FieldError';\nexport type {FileTriggerProps} from './FileTrigger';\nexport type {FormProps} from './Form';\nexport type {GridListProps, GridListRenderProps, GridListItemProps, GridListItemRenderProps} from './GridList';\nexport type {GroupProps, GroupRenderProps} from './Group';\nexport type {HeadingProps} from './Heading';\nexport type {InputProps, InputRenderProps} from './Input';\nexport type {SectionProps, CollectionRenderer} from './Collection';\nexport type {LabelProps} from './Label';\nexport type {LinkProps} from './Link';\nexport type {LinkRenderProps} from './Link';\nexport type {ListBoxProps, ListBoxRenderProps, ListBoxItemProps, ListBoxItemRenderProps} from './ListBox';\nexport type {MenuProps, MenuItemProps, MenuItemRenderProps, MenuTriggerProps, SubmenuTriggerProps} from './Menu';\nexport type {MeterProps, MeterRenderProps} from './Meter';\nexport type {ModalOverlayProps, ModalRenderProps} from './Modal';\nexport type {NumberFieldProps, NumberFieldRenderProps} from './NumberField';\nexport type {OverlayArrowProps, OverlayArrowRenderProps} from './OverlayArrow';\nexport type {PopoverProps, PopoverRenderProps} from './Popover';\nexport type {ProgressBarProps, ProgressBarRenderProps} from './ProgressBar';\nexport type {RadioGroupProps, RadioGroupRenderProps, RadioProps, RadioRenderProps} from './RadioGroup';\nexport type {SearchFieldProps, SearchFieldRenderProps} from './SearchField';\nexport type {SelectProps, SelectValueProps, SelectValueRenderProps, SelectRenderProps} from './Select';\nexport type {SeparatorProps} from './Separator';\nexport type {SliderOutputProps, SliderProps, SliderRenderProps, SliderThumbProps, SliderTrackProps, SliderTrackRenderProps, SliderThumbRenderProps} from './Slider';\nexport type {SwitchProps, SwitchRenderProps} from './Switch';\nexport type {TableProps, TableRenderProps, TableHeaderProps, TableBodyProps, TableBodyRenderProps, ResizableTableContainerProps, ColumnProps, ColumnRenderProps, ColumnResizerProps, ColumnResizerRenderProps, RowProps, RowRenderProps, CellProps, CellRenderProps} from './Table';\nexport type {TabListProps, TabListRenderProps, TabPanelProps, TabPanelRenderProps, TabProps, TabsProps, TabRenderProps, TabsRenderProps} from './Tabs';\nexport type {TagGroupProps, TagListProps, TagListRenderProps, TagProps, TagRenderProps} from './TagGroup';\nexport type {TextAreaProps} from './TextArea';\nexport type {TextFieldProps, TextFieldRenderProps} from './TextField';\nexport type {TextProps} from './Text';\nexport type {ToggleButtonProps, ToggleButtonRenderProps} from './ToggleButton';\nexport type {ToolbarProps, ToolbarRenderProps} from './Toolbar';\nexport type {TooltipProps, TooltipRenderProps, TooltipTriggerComponentProps} from './Tooltip';\nexport type {TreeProps, TreeRenderProps, TreeItemProps, TreeItemRenderProps, TreeItemContentProps, TreeItemContentRenderProps} from './Tree';\nexport type {DragAndDropHooks, DragAndDropOptions} from './useDragAndDrop';\nexport type {DropIndicatorProps} from './DragAndDrop';\nexport type {ContextValue, SlotProps} from './utils';\nexport type {VirtualizerProps} from './Virtualizer';\n\nexport type {DateValue, DateRange, TimeValue} from 'react-aria';\nexport type {DirectoryDropItem, DraggableCollectionEndEvent, DraggableCollectionMoveEvent, DraggableCollectionStartEvent, DragPreviewRenderer, DragTypes, DropItem, DropOperation, DroppableCollectionDropEvent, DroppableCollectionEnterEvent, DroppableCollectionExitEvent, DroppableCollectionInsertDropEvent, DroppableCollectionMoveEvent, DroppableCollectionOnItemDropEvent, DroppableCollectionReorderEvent, DroppableCollectionRootDropEvent, DropPosition, DropTarget, FileDropItem, ItemDropTarget, RootDropTarget, TextDropItem, PressEvent} from 'react-aria';\nexport type {Key, Selection, SortDescriptor, SortDirection, SelectionMode} from 'react-stately';\nexport type {ValidationResult, RouterConfig} from '@react-types/shared';\nexport type {Color, ColorSpace, ColorFormat} from '@react-types/color';\nexport type {ListLayoutOptions, GridLayoutOptions} from '@react-stately/layout';\n"],"names":[],"version":3,"file":"main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,+EAA+E;AAC/E,0EAA0E","sources":["packages/react-aria-components/src/index.ts"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// Mark as a client only package. This will cause a build time error if you try\n// to import it from a React Server Component in a framework like Next.js.\nimport 'client-only';\n\nexport {CheckboxContext, ColorAreaContext, ColorFieldContext, ColorSliderContext, ColorWheelContext, HeadingContext} from './RSPContexts';\n\nexport {Breadcrumbs, BreadcrumbsContext, Breadcrumb} from './Breadcrumbs';\nexport {Button, ButtonContext} from './Button';\nexport {Calendar, CalendarGrid, CalendarGridHeader, CalendarGridBody, CalendarHeaderCell, CalendarCell, RangeCalendar, CalendarContext, RangeCalendarContext, CalendarStateContext, RangeCalendarStateContext} from './Calendar';\nexport {Checkbox, CheckboxGroup, CheckboxGroupContext, CheckboxGroupStateContext} from './Checkbox';\nexport {ColorArea, ColorAreaStateContext} from './ColorArea';\nexport {ColorField, ColorFieldStateContext} from './ColorField';\nexport {ColorPicker, ColorPickerContext, ColorPickerStateContext} from './ColorPicker';\nexport {ColorSlider, ColorSliderStateContext} from './ColorSlider';\nexport {ColorSwatch, ColorSwatchContext} from './ColorSwatch';\nexport {ColorSwatchPicker, ColorSwatchPickerItem, ColorSwatchPickerContext} from './ColorSwatchPicker';\nexport {ColorThumb} from './ColorThumb';\nexport {ColorWheel, ColorWheelTrack, ColorWheelTrackContext, ColorWheelStateContext} from './ColorWheel';\nexport {ComboBox, ComboBoxContext, ComboBoxStateContext} from './ComboBox';\nexport {composeRenderProps, DEFAULT_SLOT, Provider, useContextProps, useSlottedContext} from './utils';\nexport {DateField, DateInput, DateSegment, TimeField, DateFieldContext, TimeFieldContext, DateFieldStateContext, TimeFieldStateContext} from './DateField';\nexport {DatePicker, DateRangePicker, DatePickerContext, DateRangePickerContext, DatePickerStateContext, DateRangePickerStateContext} from './DatePicker';\nexport {DialogTrigger, Dialog, DialogContext, OverlayTriggerStateContext} from './Dialog';\nexport {Disclosure as UNSTABLE_Disclosure, DisclosureGroup as UNSTABLE_DisclosureGroup, DisclosureGroupStateContext, DisclosurePanel as UNSTABLE_DisclosurePanel, DisclosureStateContext, DisclosureContext} from './Disclosure';\nexport {DropZone, DropZoneContext} from './DropZone';\nexport {FieldError, FieldErrorContext} from './FieldError';\nexport {FileTrigger} from './FileTrigger';\nexport {Form, FormContext} from './Form';\nexport {GridList, GridListItem, GridListContext} from './GridList';\nexport {Group, GroupContext} from './Group';\nexport {Header, HeaderContext} from './Header';\nexport {Heading} from './Heading';\nexport {Input, InputContext} from './Input';\nexport {Section, CollectionRendererContext as UNSTABLE_CollectionRendererContext, DefaultCollectionRenderer as UNSTABLE_DefaultCollectionRenderer} from './Collection';\nexport {Collection, createLeafComponent as UNSTABLE_createLeafComponent, createBranchComponent as UNSTABLE_createBranchComponent, CollectionBuilder as UNSTABLE_CollectionBuilder} from '@react-aria/collections';\nexport {Keyboard, KeyboardContext} from './Keyboard';\nexport {Label, LabelContext} from './Label';\nexport {Link, LinkContext} from './Link';\nexport {ListBox, ListBoxItem, ListBoxContext, ListStateContext} from './ListBox';\nexport {Menu, MenuItem, MenuTrigger, MenuContext, MenuStateContext, RootMenuTriggerStateContext, SubmenuTrigger} from './Menu';\nexport {Meter, MeterContext} from './Meter';\nexport {Modal, ModalOverlay, ModalContext} from './Modal';\nexport {NumberField, NumberFieldContext, NumberFieldStateContext} from './NumberField';\nexport {OverlayArrow} from './OverlayArrow';\nexport {Popover, PopoverContext} from './Popover';\nexport {ProgressBar, ProgressBarContext} from './ProgressBar';\nexport {RadioGroup, Radio, RadioGroupContext, RadioContext, RadioGroupStateContext} from './RadioGroup';\nexport {SearchField, SearchFieldContext} from './SearchField';\nexport {Select, SelectValue, SelectContext, SelectValueContext, SelectStateContext} from './Select';\nexport {Separator, SeparatorContext} from './Separator';\nexport {Slider, SliderOutput, SliderTrack, SliderThumb, SliderContext, SliderOutputContext, SliderTrackContext, SliderStateContext} from './Slider';\nexport {Switch, SwitchContext} from './Switch';\nexport {UNSTABLE_TableLoadingIndicator, Table, Row, Cell, Column, ColumnResizer, TableHeader, TableBody, TableContext, ResizableTableContainer, useTableOptions, TableStateContext, TableColumnResizeStateContext} from './Table';\nexport {TableLayout as UNSTABLE_TableLayout} from './TableLayout';\nexport {Tabs, TabList, TabPanel, Tab, TabsContext, TabListStateContext} from './Tabs';\nexport {TagGroup, TagGroupContext, TagList, TagListContext, Tag} from './TagGroup';\nexport {Text, TextContext} from './Text';\nexport {TextArea, TextAreaContext} from './TextArea';\nexport {TextField, TextFieldContext} from './TextField';\nexport {ToggleButton, ToggleButtonContext} from './ToggleButton';\nexport {Toolbar, ToolbarContext} from './Toolbar';\nexport {TooltipTrigger, Tooltip, TooltipTriggerStateContext, TooltipContext} from './Tooltip';\nexport {UNSTABLE_TreeLoadingIndicator, UNSTABLE_Tree, UNSTABLE_TreeItem, UNSTABLE_TreeContext, UNSTABLE_TreeItemContent, UNSTABLE_TreeStateContext} from './Tree';\nexport {useDragAndDrop} from './useDragAndDrop';\nexport {DropIndicator, DropIndicatorContext, DragAndDropContext} from './DragAndDrop';\nexport {Virtualizer as UNSTABLE_Virtualizer} from './Virtualizer';\nexport {DIRECTORY_DRAG_TYPE, isDirectoryDropItem, isFileDropItem, isTextDropItem, SSRProvider, RouterProvider, I18nProvider, useLocale} from 'react-aria';\nexport {FormValidationContext} from 'react-stately';\nexport {parseColor, getColorChannels} from '@react-stately/color';\nexport {ListLayout as UNSTABLE_ListLayout, GridLayout as UNSTABLE_GridLayout} from '@react-stately/layout';\n\nexport type {BreadcrumbsProps, BreadcrumbProps, BreadcrumbRenderProps} from './Breadcrumbs';\nexport type {ButtonProps, ButtonRenderProps} from './Button';\nexport type {CalendarCellProps, CalendarProps, CalendarRenderProps, CalendarGridProps, CalendarGridHeaderProps, CalendarGridBodyProps, CalendarHeaderCellProps, CalendarCellRenderProps, RangeCalendarProps, RangeCalendarRenderProps} from './Calendar';\nexport type {CheckboxGroupProps, CheckboxGroupRenderProps, CheckboxRenderProps, CheckboxProps} from './Checkbox';\nexport type {ColorAreaProps, ColorAreaRenderProps} from './ColorArea';\nexport type {ColorFieldProps, ColorFieldRenderProps} from './ColorField';\nexport type {ColorSliderProps, ColorSliderRenderProps} from './ColorSlider';\nexport type {ColorSwatchProps, ColorSwatchRenderProps} from './ColorSwatch';\nexport type {ColorSwatchPickerProps, ColorSwatchPickerRenderProps, ColorSwatchPickerItemProps, ColorSwatchPickerItemRenderProps} from './ColorSwatchPicker';\nexport type {ColorThumbProps, ColorThumbRenderProps} from './ColorThumb';\nexport type {ColorPickerProps, ColorPickerRenderProps} from './ColorPicker';\nexport type {ColorWheelProps, ColorWheelRenderProps, ColorWheelTrackProps, ColorWheelTrackRenderProps} from './ColorWheel';\nexport type {ComboBoxProps, ComboBoxRenderProps} from './ComboBox';\nexport type {DateFieldProps, DateFieldRenderProps, DateInputProps, DateInputRenderProps, DateSegmentProps, DateSegmentRenderProps, TimeFieldProps} from './DateField';\nexport type {DatePickerProps, DatePickerRenderProps, DateRangePickerProps, DateRangePickerRenderProps} from './DatePicker';\nexport type {DialogProps, DialogTriggerProps} from './Dialog';\nexport type {DisclosureProps, DisclosureRenderProps, DisclosurePanelProps, DisclosureGroupProps, DisclosureGroupRenderProps} from './Disclosure';\nexport type {DropZoneProps, DropZoneRenderProps} from './DropZone';\nexport type {FieldErrorProps, FieldErrorRenderProps} from './FieldError';\nexport type {FileTriggerProps} from './FileTrigger';\nexport type {FormProps} from './Form';\nexport type {GridListProps, GridListRenderProps, GridListItemProps, GridListItemRenderProps} from './GridList';\nexport type {GroupProps, GroupRenderProps} from './Group';\nexport type {HeadingProps} from './Heading';\nexport type {InputProps, InputRenderProps} from './Input';\nexport type {SectionProps, CollectionRenderer} from './Collection';\nexport type {LabelProps} from './Label';\nexport type {LinkProps} from './Link';\nexport type {LinkRenderProps} from './Link';\nexport type {ListBoxProps, ListBoxRenderProps, ListBoxItemProps, ListBoxItemRenderProps} from './ListBox';\nexport type {MenuProps, MenuItemProps, MenuItemRenderProps, MenuTriggerProps, SubmenuTriggerProps} from './Menu';\nexport type {MeterProps, MeterRenderProps} from './Meter';\nexport type {ModalOverlayProps, ModalRenderProps} from './Modal';\nexport type {NumberFieldProps, NumberFieldRenderProps} from './NumberField';\nexport type {OverlayArrowProps, OverlayArrowRenderProps} from './OverlayArrow';\nexport type {PopoverProps, PopoverRenderProps} from './Popover';\nexport type {ProgressBarProps, ProgressBarRenderProps} from './ProgressBar';\nexport type {RadioGroupProps, RadioGroupRenderProps, RadioProps, RadioRenderProps} from './RadioGroup';\nexport type {SearchFieldProps, SearchFieldRenderProps} from './SearchField';\nexport type {SelectProps, SelectValueProps, SelectValueRenderProps, SelectRenderProps} from './Select';\nexport type {SeparatorProps} from './Separator';\nexport type {SliderOutputProps, SliderProps, SliderRenderProps, SliderThumbProps, SliderTrackProps, SliderTrackRenderProps, SliderThumbRenderProps} from './Slider';\nexport type {SwitchProps, SwitchRenderProps} from './Switch';\nexport type {TableProps, TableRenderProps, TableHeaderProps, TableBodyProps, TableBodyRenderProps, ResizableTableContainerProps, ColumnProps, ColumnRenderProps, ColumnResizerProps, ColumnResizerRenderProps, RowProps, RowRenderProps, CellProps, CellRenderProps} from './Table';\nexport type {TabListProps, TabListRenderProps, TabPanelProps, TabPanelRenderProps, TabProps, TabsProps, TabRenderProps, TabsRenderProps} from './Tabs';\nexport type {TagGroupProps, TagListProps, TagListRenderProps, TagProps, TagRenderProps} from './TagGroup';\nexport type {TextAreaProps} from './TextArea';\nexport type {TextFieldProps, TextFieldRenderProps} from './TextField';\nexport type {TextProps} from './Text';\nexport type {ToggleButtonProps, ToggleButtonRenderProps} from './ToggleButton';\nexport type {ToolbarProps, ToolbarRenderProps} from './Toolbar';\nexport type {TooltipProps, TooltipRenderProps, TooltipTriggerComponentProps} from './Tooltip';\nexport type {TreeProps, TreeRenderProps, TreeItemProps, TreeItemRenderProps, TreeItemContentProps, TreeItemContentRenderProps} from './Tree';\nexport type {DragAndDropHooks, DragAndDropOptions} from './useDragAndDrop';\nexport type {DropIndicatorProps} from './DragAndDrop';\nexport type {ContextValue, SlotProps} from './utils';\nexport type {VirtualizerProps} from './Virtualizer';\n\nexport type {DateValue, DateRange, TimeValue} from 'react-aria';\nexport type {DirectoryDropItem, DraggableCollectionEndEvent, DraggableCollectionMoveEvent, DraggableCollectionStartEvent, DragPreviewRenderer, DragTypes, DropItem, DropOperation, DroppableCollectionDropEvent, DroppableCollectionEnterEvent, DroppableCollectionExitEvent, DroppableCollectionInsertDropEvent, DroppableCollectionMoveEvent, DroppableCollectionOnItemDropEvent, DroppableCollectionReorderEvent, DroppableCollectionRootDropEvent, DropPosition, DropTarget, FileDropItem, ItemDropTarget, RootDropTarget, TextDropItem, PressEvent} from 'react-aria';\nexport type {Key, Selection, SortDescriptor, SortDirection, SelectionMode} from 'react-stately';\nexport type {ValidationResult, RouterConfig} from '@react-types/shared';\nexport type {Color, ColorSpace, ColorFormat} from '@react-types/color';\nexport type {ListLayoutOptions, GridLayoutOptions} from '@react-stately/layout';\n"],"names":[],"version":3,"file":"main.js.map"}