react-aria-components 3.0.0-nightly-5ae234603-240925 → 3.0.0-nightly-a626c2596-240926

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;;;;;;;AAkBM,MAAM,0DAAqB,CAAA,GAAA,0BAAY,EAAyD;AAEvG,SAAS,kCAA8B,KAA0B,EAAE,GAAmC;IACpG,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,kBAAC,cAAc,EAAC,GAAG,CAAA,GAAA,uBAAS,EAAE,CAAA,GAAA,mDAAwB;IAC1D,IAAI,YAAC,QAAQ,EAAC,GAAG,CAAA,GAAA,+BAAa,EAAE;IAEhC,qBACE,0DAAC,CAAA,GAAA,6CAAgB;QAAE,uBAAS,0DAAC,CAAA,GAAA,sCAAS,GAAM;OACzC,CAAA;YAMc;eALb,0DAAC;YACC,KAAK;YACJ,GAAG,QAAQ;YACZ,MAAM,MAAM,IAAI,IAAI;YACpB,OAAO,MAAM,KAAK;YAClB,WAAW,CAAA,mBAAA,MAAM,SAAS,cAAf,8BAAA,mBAAmB;yBAC9B,0DAAC,0CAAmB,QAAQ;YAAC,OAAO;yBAClC,0DAAC;YAAe,YAAY;;IAE5B;AAIZ;AAEA;;CAEC,GACD,MAAM,2CAA6B,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB;AAwB3D,MAAM,4CAAa,WAAW,GAAG,CAAA,GAAA,+CAAkB,EAAE,QAAQ,SAAS,WAAW,KAAsB,EAAE,GAAgC,EAAE,IAAmB;IACnK,sGAAsG;IACtG,IAAI,YAAY,KAAK,OAAO,IAAI;IAChC,IAAI,cAAC,UAAU,YAAE,QAAQ,EAAC,GAAG,CAAA,GAAA,2CAAgB,EAAE;IAC/C,IAAI,YAAY;QACd,gBAAgB,YAAY,SAAS;QACrC,YAAY,cAAc;QAC1B,SAAS,IAAM,qBAAA,+BAAA,SAAW,KAAK,GAAG;IACpC;IAEA,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QAC/B,GAAG,KAAK,KAAK;QACb,UAAU,KAAK,QAAQ;QACvB,QAAQ;YAAC,YAAY,cAAc;uBAAW;QAAS;QACvD,kBAAkB;IACpB;IAEA,qBACE,0DAAC;QACE,GAAG,CAAA,GAAA,oCAAa,EAAE,MAAa;QAC/B,GAAG,WAAW;QACf,KAAK;QACL,iBAAe,cAAc,aAAa;QAC1C,gBAAc,aAAa;qBAC3B,0DAAC,CAAA,GAAA,qCAAU,EAAE,QAAQ;QAAC,OAAO;OAC1B,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/Breadcrumbs.tsx"],"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 */\nimport {AriaBreadcrumbsProps, useBreadcrumbs} from 'react-aria';\nimport {Collection, CollectionBuilder, createLeafComponent} from '@react-aria/collections';\nimport {CollectionProps, CollectionRendererContext} from './Collection';\nimport {ContextValue, RenderProps, SlotProps, StyleProps, useContextProps, useRenderProps, useSlottedContext} from './utils';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {forwardRefType, Key} from '@react-types/shared';\nimport {LinkContext} from './Link';\nimport {Node} from 'react-stately';\nimport React, {createContext, ForwardedRef, forwardRef, useContext} from 'react';\n\nexport interface BreadcrumbsProps<T> extends Omit<CollectionProps<T>, 'disabledKeys'>, AriaBreadcrumbsProps, StyleProps, SlotProps {\n /** Whether the breadcrumbs are disabled. */\n isDisabled?: boolean,\n /** Handler that is called when a breadcrumb is clicked. */\n onAction?: (key: Key) => void\n}\n\nexport const BreadcrumbsContext = createContext<ContextValue<BreadcrumbsProps<any>, HTMLOListElement>>(null);\n\nfunction Breadcrumbs<T extends object>(props: BreadcrumbsProps<T>, ref: ForwardedRef<HTMLOListElement>) {\n [props, ref] = useContextProps(props, ref, BreadcrumbsContext);\n let {CollectionRoot} = useContext(CollectionRendererContext);\n let {navProps} = useBreadcrumbs(props);\n\n return (\n <CollectionBuilder content={<Collection {...props} />}>\n {collection => (\n <ol\n ref={ref}\n {...navProps}\n slot={props.slot || undefined}\n style={props.style}\n className={props.className ?? 'react-aria-Breadcrumbs'}>\n <BreadcrumbsContext.Provider value={props}>\n <CollectionRoot collection={collection} />\n </BreadcrumbsContext.Provider>\n </ol>\n )}\n </CollectionBuilder>\n );\n}\n\n/**\n * Breadcrumbs display a hierarchy of links to the current page or resource in an application.\n */\nconst _Breadcrumbs = /*#__PURE__*/ (forwardRef as forwardRefType)(Breadcrumbs);\nexport {_Breadcrumbs as Breadcrumbs};\n\nexport interface BreadcrumbRenderProps {\n /**\n * Whether the breadcrumb is for the current page.\n * @selector [data-current]\n */\n isCurrent: boolean,\n /**\n * Whether the breadcrumb is disabled.\n * @selector [data-current]\n */\n isDisabled: boolean\n}\n\nexport interface BreadcrumbProps extends RenderProps<BreadcrumbRenderProps> {\n /** A unique id for the breadcrumb, which will be passed to `onAction` when the breadcrumb is pressed. */\n id?: Key\n}\n\n/**\n * A Breadcrumb represents an individual item in a `<Breadcrumbs>` list.\n */\nexport const Breadcrumb = /*#__PURE__*/ createLeafComponent('item', function Breadcrumb(props: BreadcrumbProps, ref: ForwardedRef<HTMLLIElement>, node: Node<unknown>) {\n // Recreating useBreadcrumbItem because we want to use composition instead of having the link builtin.\n let isCurrent = node.nextKey == null;\n let {isDisabled, onAction} = useSlottedContext(BreadcrumbsContext)!;\n let linkProps = {\n 'aria-current': isCurrent ? 'page' : null,\n isDisabled: isDisabled || isCurrent,\n onPress: () => onAction?.(node.key)\n };\n\n let renderProps = useRenderProps({\n ...node.props,\n children: node.rendered,\n values: {isDisabled: isDisabled || isCurrent, isCurrent},\n defaultClassName: 'react-aria-Breadcrumb'\n });\n\n return (\n <li\n {...filterDOMProps(props as any)}\n {...renderProps}\n ref={ref}\n data-disabled={isDisabled || isCurrent || undefined}\n data-current={isCurrent || undefined}>\n <LinkContext.Provider value={linkProps}>\n {renderProps.children}\n </LinkContext.Provider>\n </li>\n );\n});\n"],"names":[],"version":3,"file":"Breadcrumbs.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAkBM,MAAM,0DAAqB,CAAA,GAAA,0BAAY,EAAyD;AAEvG,SAAS,kCAA8B,KAA0B,EAAE,GAAmC;IACpG,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,kBAAC,cAAc,EAAC,GAAG,CAAA,GAAA,uBAAS,EAAE,CAAA,GAAA,mDAAwB;IAC1D,IAAI,YAAC,QAAQ,EAAC,GAAG,CAAA,GAAA,+BAAa,EAAE;IAEhC,qBACE,0DAAC,CAAA,GAAA,6CAAgB;QAAE,uBAAS,0DAAC,CAAA,GAAA,sCAAS,GAAM;OACzC,CAAA;YAMc;eALb,0DAAC;YACC,KAAK;YACJ,GAAG,QAAQ;YACZ,MAAM,MAAM,IAAI,IAAI;YACpB,OAAO,MAAM,KAAK;YAClB,WAAW,CAAA,mBAAA,MAAM,SAAS,cAAf,8BAAA,mBAAmB;yBAC9B,0DAAC,0CAAmB,QAAQ;YAAC,OAAO;yBAClC,0DAAC;YAAe,YAAY;;IAE5B;AAIZ;AAEA;;CAEC,GACD,MAAM,2CAA6B,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB;AAwB3D,MAAM,4CAAa,WAAW,GAAG,CAAA,GAAA,+CAAkB,EAAE,QAAQ,SAAS,WAAW,KAAsB,EAAE,GAAgC,EAAE,IAAmB;IACnK,sGAAsG;IACtG,IAAI,YAAY,KAAK,OAAO,IAAI;IAChC,IAAI,cAAC,UAAU,YAAE,QAAQ,EAAC,GAAG,CAAA,GAAA,2CAAgB,EAAE;IAC/C,IAAI,YAAY;QACd,gBAAgB,YAAY,SAAS;QACrC,YAAY,cAAc;QAC1B,SAAS,IAAM,qBAAA,+BAAA,SAAW,KAAK,GAAG;IACpC;IAEA,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QAC/B,GAAG,KAAK,KAAK;QACb,UAAU,KAAK,QAAQ;QACvB,QAAQ;YAAC,YAAY,cAAc;uBAAW;QAAS;QACvD,kBAAkB;IACpB;IAEA,qBACE,0DAAC;QACE,GAAG,CAAA,GAAA,oCAAa,EAAE,MAAa;QAC/B,GAAG,WAAW;QACf,KAAK;QACL,iBAAe,cAAc,aAAa;QAC1C,gBAAc,aAAa;qBAC3B,0DAAC,CAAA,GAAA,qCAAU,EAAE,QAAQ;QAAC,OAAO;OAC1B,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/Breadcrumbs.tsx"],"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 */\nimport {AriaBreadcrumbsProps, useBreadcrumbs} from 'react-aria';\nimport {Collection, CollectionBuilder, createLeafComponent} from '@react-aria/collections';\nimport {CollectionProps, CollectionRendererContext} from './Collection';\nimport {ContextValue, RenderProps, SlotProps, StyleProps, useContextProps, useRenderProps, useSlottedContext} from './utils';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {forwardRefType, Key} from '@react-types/shared';\nimport {LinkContext} from './Link';\nimport {Node} from 'react-stately';\nimport React, {createContext, ForwardedRef, forwardRef, useContext} from 'react';\n\nexport interface BreadcrumbsProps<T> extends Omit<CollectionProps<T>, 'disabledKeys'>, AriaBreadcrumbsProps, StyleProps, SlotProps {\n /** Whether the breadcrumbs are disabled. */\n isDisabled?: boolean,\n /** Handler that is called when a breadcrumb is clicked. */\n onAction?: (key: Key) => void\n}\n\nexport const BreadcrumbsContext = createContext<ContextValue<BreadcrumbsProps<any>, HTMLOListElement>>(null);\n\nfunction Breadcrumbs<T extends object>(props: BreadcrumbsProps<T>, ref: ForwardedRef<HTMLOListElement>) {\n [props, ref] = useContextProps(props, ref, BreadcrumbsContext);\n let {CollectionRoot} = useContext(CollectionRendererContext);\n let {navProps} = useBreadcrumbs(props);\n\n return (\n <CollectionBuilder content={<Collection {...props} />}>\n {collection => (\n <ol\n ref={ref}\n {...navProps}\n slot={props.slot || undefined}\n style={props.style}\n className={props.className ?? 'react-aria-Breadcrumbs'}>\n <BreadcrumbsContext.Provider value={props}>\n <CollectionRoot collection={collection} />\n </BreadcrumbsContext.Provider>\n </ol>\n )}\n </CollectionBuilder>\n );\n}\n\n/**\n * Breadcrumbs display a hierarchy of links to the current page or resource in an application.\n */\nconst _Breadcrumbs = /*#__PURE__*/ (forwardRef as forwardRefType)(Breadcrumbs);\nexport {_Breadcrumbs as Breadcrumbs};\n\nexport interface BreadcrumbRenderProps {\n /**\n * Whether the breadcrumb is for the current page.\n * @selector [data-current]\n */\n isCurrent: boolean,\n /**\n * Whether the breadcrumb is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean\n}\n\nexport interface BreadcrumbProps extends RenderProps<BreadcrumbRenderProps> {\n /** A unique id for the breadcrumb, which will be passed to `onAction` when the breadcrumb is pressed. */\n id?: Key\n}\n\n/**\n * A Breadcrumb represents an individual item in a `<Breadcrumbs>` list.\n */\nexport const Breadcrumb = /*#__PURE__*/ createLeafComponent('item', function Breadcrumb(props: BreadcrumbProps, ref: ForwardedRef<HTMLLIElement>, node: Node<unknown>) {\n // Recreating useBreadcrumbItem because we want to use composition instead of having the link builtin.\n let isCurrent = node.nextKey == null;\n let {isDisabled, onAction} = useSlottedContext(BreadcrumbsContext)!;\n let linkProps = {\n 'aria-current': isCurrent ? 'page' : null,\n isDisabled: isDisabled || isCurrent,\n onPress: () => onAction?.(node.key)\n };\n\n let renderProps = useRenderProps({\n ...node.props,\n children: node.rendered,\n values: {isDisabled: isDisabled || isCurrent, isCurrent},\n defaultClassName: 'react-aria-Breadcrumb'\n });\n\n return (\n <li\n {...filterDOMProps(props as any)}\n {...renderProps}\n ref={ref}\n data-disabled={isDisabled || isCurrent || undefined}\n data-current={isCurrent || undefined}>\n <LinkContext.Provider value={linkProps}>\n {renderProps.children}\n </LinkContext.Provider>\n </li>\n );\n});\n"],"names":[],"version":3,"file":"Breadcrumbs.main.js.map"}
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAkBM,MAAM,0DAAqB,CAAA,GAAA,oBAAY,EAAyD;AAEvG,SAAS,kCAA8B,KAA0B,EAAE,GAAmC;IACpG,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,kBAAC,cAAc,EAAC,GAAG,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,yCAAwB;IAC1D,IAAI,YAAC,QAAQ,EAAC,GAAG,CAAA,GAAA,qBAAa,EAAE;IAEhC,qBACE,gCAAC,CAAA,GAAA,wBAAgB;QAAE,uBAAS,gCAAC,CAAA,GAAA,iBAAS,GAAM;OACzC,CAAA;YAMc;eALb,gCAAC;YACC,KAAK;YACJ,GAAG,QAAQ;YACZ,MAAM,MAAM,IAAI,IAAI;YACpB,OAAO,MAAM,KAAK;YAClB,WAAW,CAAA,mBAAA,MAAM,SAAS,cAAf,8BAAA,mBAAmB;yBAC9B,gCAAC,0CAAmB,QAAQ;YAAC,OAAO;yBAClC,gCAAC;YAAe,YAAY;;IAE5B;AAIZ;AAEA;;CAEC,GACD,MAAM,2CAA6B,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB;AAwB3D,MAAM,4CAAa,WAAW,GAAG,CAAA,GAAA,0BAAkB,EAAE,QAAQ,SAAS,WAAW,KAAsB,EAAE,GAAgC,EAAE,IAAmB;IACnK,sGAAsG;IACtG,IAAI,YAAY,KAAK,OAAO,IAAI;IAChC,IAAI,cAAC,UAAU,YAAE,QAAQ,EAAC,GAAG,CAAA,GAAA,yCAAgB,EAAE;IAC/C,IAAI,YAAY;QACd,gBAAgB,YAAY,SAAS;QACrC,YAAY,cAAc;QAC1B,SAAS,IAAM,qBAAA,+BAAA,SAAW,KAAK,GAAG;IACpC;IAEA,IAAI,cAAc,CAAA,GAAA,uCAAa,EAAE;QAC/B,GAAG,KAAK,KAAK;QACb,UAAU,KAAK,QAAQ;QACvB,QAAQ;YAAC,YAAY,cAAc;uBAAW;QAAS;QACvD,kBAAkB;IACpB;IAEA,qBACE,gCAAC;QACE,GAAG,CAAA,GAAA,qBAAa,EAAE,MAAa;QAC/B,GAAG,WAAW;QACf,KAAK;QACL,iBAAe,cAAc,aAAa;QAC1C,gBAAc,aAAa;qBAC3B,gCAAC,CAAA,GAAA,yCAAU,EAAE,QAAQ;QAAC,OAAO;OAC1B,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/Breadcrumbs.tsx"],"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 */\nimport {AriaBreadcrumbsProps, useBreadcrumbs} from 'react-aria';\nimport {Collection, CollectionBuilder, createLeafComponent} from '@react-aria/collections';\nimport {CollectionProps, CollectionRendererContext} from './Collection';\nimport {ContextValue, RenderProps, SlotProps, StyleProps, useContextProps, useRenderProps, useSlottedContext} from './utils';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {forwardRefType, Key} from '@react-types/shared';\nimport {LinkContext} from './Link';\nimport {Node} from 'react-stately';\nimport React, {createContext, ForwardedRef, forwardRef, useContext} from 'react';\n\nexport interface BreadcrumbsProps<T> extends Omit<CollectionProps<T>, 'disabledKeys'>, AriaBreadcrumbsProps, StyleProps, SlotProps {\n /** Whether the breadcrumbs are disabled. */\n isDisabled?: boolean,\n /** Handler that is called when a breadcrumb is clicked. */\n onAction?: (key: Key) => void\n}\n\nexport const BreadcrumbsContext = createContext<ContextValue<BreadcrumbsProps<any>, HTMLOListElement>>(null);\n\nfunction Breadcrumbs<T extends object>(props: BreadcrumbsProps<T>, ref: ForwardedRef<HTMLOListElement>) {\n [props, ref] = useContextProps(props, ref, BreadcrumbsContext);\n let {CollectionRoot} = useContext(CollectionRendererContext);\n let {navProps} = useBreadcrumbs(props);\n\n return (\n <CollectionBuilder content={<Collection {...props} />}>\n {collection => (\n <ol\n ref={ref}\n {...navProps}\n slot={props.slot || undefined}\n style={props.style}\n className={props.className ?? 'react-aria-Breadcrumbs'}>\n <BreadcrumbsContext.Provider value={props}>\n <CollectionRoot collection={collection} />\n </BreadcrumbsContext.Provider>\n </ol>\n )}\n </CollectionBuilder>\n );\n}\n\n/**\n * Breadcrumbs display a hierarchy of links to the current page or resource in an application.\n */\nconst _Breadcrumbs = /*#__PURE__*/ (forwardRef as forwardRefType)(Breadcrumbs);\nexport {_Breadcrumbs as Breadcrumbs};\n\nexport interface BreadcrumbRenderProps {\n /**\n * Whether the breadcrumb is for the current page.\n * @selector [data-current]\n */\n isCurrent: boolean,\n /**\n * Whether the breadcrumb is disabled.\n * @selector [data-current]\n */\n isDisabled: boolean\n}\n\nexport interface BreadcrumbProps extends RenderProps<BreadcrumbRenderProps> {\n /** A unique id for the breadcrumb, which will be passed to `onAction` when the breadcrumb is pressed. */\n id?: Key\n}\n\n/**\n * A Breadcrumb represents an individual item in a `<Breadcrumbs>` list.\n */\nexport const Breadcrumb = /*#__PURE__*/ createLeafComponent('item', function Breadcrumb(props: BreadcrumbProps, ref: ForwardedRef<HTMLLIElement>, node: Node<unknown>) {\n // Recreating useBreadcrumbItem because we want to use composition instead of having the link builtin.\n let isCurrent = node.nextKey == null;\n let {isDisabled, onAction} = useSlottedContext(BreadcrumbsContext)!;\n let linkProps = {\n 'aria-current': isCurrent ? 'page' : null,\n isDisabled: isDisabled || isCurrent,\n onPress: () => onAction?.(node.key)\n };\n\n let renderProps = useRenderProps({\n ...node.props,\n children: node.rendered,\n values: {isDisabled: isDisabled || isCurrent, isCurrent},\n defaultClassName: 'react-aria-Breadcrumb'\n });\n\n return (\n <li\n {...filterDOMProps(props as any)}\n {...renderProps}\n ref={ref}\n data-disabled={isDisabled || isCurrent || undefined}\n data-current={isCurrent || undefined}>\n <LinkContext.Provider value={linkProps}>\n {renderProps.children}\n </LinkContext.Provider>\n </li>\n );\n});\n"],"names":[],"version":3,"file":"Breadcrumbs.module.js.map"}
1
+ {"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAkBM,MAAM,0DAAqB,CAAA,GAAA,oBAAY,EAAyD;AAEvG,SAAS,kCAA8B,KAA0B,EAAE,GAAmC;IACpG,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,kBAAC,cAAc,EAAC,GAAG,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,yCAAwB;IAC1D,IAAI,YAAC,QAAQ,EAAC,GAAG,CAAA,GAAA,qBAAa,EAAE;IAEhC,qBACE,gCAAC,CAAA,GAAA,wBAAgB;QAAE,uBAAS,gCAAC,CAAA,GAAA,iBAAS,GAAM;OACzC,CAAA;YAMc;eALb,gCAAC;YACC,KAAK;YACJ,GAAG,QAAQ;YACZ,MAAM,MAAM,IAAI,IAAI;YACpB,OAAO,MAAM,KAAK;YAClB,WAAW,CAAA,mBAAA,MAAM,SAAS,cAAf,8BAAA,mBAAmB;yBAC9B,gCAAC,0CAAmB,QAAQ;YAAC,OAAO;yBAClC,gCAAC;YAAe,YAAY;;IAE5B;AAIZ;AAEA;;CAEC,GACD,MAAM,2CAA6B,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB;AAwB3D,MAAM,4CAAa,WAAW,GAAG,CAAA,GAAA,0BAAkB,EAAE,QAAQ,SAAS,WAAW,KAAsB,EAAE,GAAgC,EAAE,IAAmB;IACnK,sGAAsG;IACtG,IAAI,YAAY,KAAK,OAAO,IAAI;IAChC,IAAI,cAAC,UAAU,YAAE,QAAQ,EAAC,GAAG,CAAA,GAAA,yCAAgB,EAAE;IAC/C,IAAI,YAAY;QACd,gBAAgB,YAAY,SAAS;QACrC,YAAY,cAAc;QAC1B,SAAS,IAAM,qBAAA,+BAAA,SAAW,KAAK,GAAG;IACpC;IAEA,IAAI,cAAc,CAAA,GAAA,uCAAa,EAAE;QAC/B,GAAG,KAAK,KAAK;QACb,UAAU,KAAK,QAAQ;QACvB,QAAQ;YAAC,YAAY,cAAc;uBAAW;QAAS;QACvD,kBAAkB;IACpB;IAEA,qBACE,gCAAC;QACE,GAAG,CAAA,GAAA,qBAAa,EAAE,MAAa;QAC/B,GAAG,WAAW;QACf,KAAK;QACL,iBAAe,cAAc,aAAa;QAC1C,gBAAc,aAAa;qBAC3B,gCAAC,CAAA,GAAA,yCAAU,EAAE,QAAQ;QAAC,OAAO;OAC1B,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/Breadcrumbs.tsx"],"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 */\nimport {AriaBreadcrumbsProps, useBreadcrumbs} from 'react-aria';\nimport {Collection, CollectionBuilder, createLeafComponent} from '@react-aria/collections';\nimport {CollectionProps, CollectionRendererContext} from './Collection';\nimport {ContextValue, RenderProps, SlotProps, StyleProps, useContextProps, useRenderProps, useSlottedContext} from './utils';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {forwardRefType, Key} from '@react-types/shared';\nimport {LinkContext} from './Link';\nimport {Node} from 'react-stately';\nimport React, {createContext, ForwardedRef, forwardRef, useContext} from 'react';\n\nexport interface BreadcrumbsProps<T> extends Omit<CollectionProps<T>, 'disabledKeys'>, AriaBreadcrumbsProps, StyleProps, SlotProps {\n /** Whether the breadcrumbs are disabled. */\n isDisabled?: boolean,\n /** Handler that is called when a breadcrumb is clicked. */\n onAction?: (key: Key) => void\n}\n\nexport const BreadcrumbsContext = createContext<ContextValue<BreadcrumbsProps<any>, HTMLOListElement>>(null);\n\nfunction Breadcrumbs<T extends object>(props: BreadcrumbsProps<T>, ref: ForwardedRef<HTMLOListElement>) {\n [props, ref] = useContextProps(props, ref, BreadcrumbsContext);\n let {CollectionRoot} = useContext(CollectionRendererContext);\n let {navProps} = useBreadcrumbs(props);\n\n return (\n <CollectionBuilder content={<Collection {...props} />}>\n {collection => (\n <ol\n ref={ref}\n {...navProps}\n slot={props.slot || undefined}\n style={props.style}\n className={props.className ?? 'react-aria-Breadcrumbs'}>\n <BreadcrumbsContext.Provider value={props}>\n <CollectionRoot collection={collection} />\n </BreadcrumbsContext.Provider>\n </ol>\n )}\n </CollectionBuilder>\n );\n}\n\n/**\n * Breadcrumbs display a hierarchy of links to the current page or resource in an application.\n */\nconst _Breadcrumbs = /*#__PURE__*/ (forwardRef as forwardRefType)(Breadcrumbs);\nexport {_Breadcrumbs as Breadcrumbs};\n\nexport interface BreadcrumbRenderProps {\n /**\n * Whether the breadcrumb is for the current page.\n * @selector [data-current]\n */\n isCurrent: boolean,\n /**\n * Whether the breadcrumb is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean\n}\n\nexport interface BreadcrumbProps extends RenderProps<BreadcrumbRenderProps> {\n /** A unique id for the breadcrumb, which will be passed to `onAction` when the breadcrumb is pressed. */\n id?: Key\n}\n\n/**\n * A Breadcrumb represents an individual item in a `<Breadcrumbs>` list.\n */\nexport const Breadcrumb = /*#__PURE__*/ createLeafComponent('item', function Breadcrumb(props: BreadcrumbProps, ref: ForwardedRef<HTMLLIElement>, node: Node<unknown>) {\n // Recreating useBreadcrumbItem because we want to use composition instead of having the link builtin.\n let isCurrent = node.nextKey == null;\n let {isDisabled, onAction} = useSlottedContext(BreadcrumbsContext)!;\n let linkProps = {\n 'aria-current': isCurrent ? 'page' : null,\n isDisabled: isDisabled || isCurrent,\n onPress: () => onAction?.(node.key)\n };\n\n let renderProps = useRenderProps({\n ...node.props,\n children: node.rendered,\n values: {isDisabled: isDisabled || isCurrent, isCurrent},\n defaultClassName: 'react-aria-Breadcrumb'\n });\n\n return (\n <li\n {...filterDOMProps(props as any)}\n {...renderProps}\n ref={ref}\n data-disabled={isDisabled || isCurrent || undefined}\n data-current={isCurrent || undefined}>\n <LinkContext.Provider value={linkProps}>\n {renderProps.children}\n </LinkContext.Provider>\n </li>\n );\n});\n"],"names":[],"version":3,"file":"Breadcrumbs.module.js.map"}
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;AAyBD,MAAM,yDAAqB,CAAA,GAAA,0BAAY,EAAqC;AAC5E,MAAM,oDAAgB,CAAA,GAAA,0BAAY,EAAkE;AAE7F,SAAS,0CAAe,KAA0B;IACvD,IAAI,YAAC,QAAQ,UAAE,MAAM,iBAAE,aAAa,EAAC,GAAG;IACxC,IAAI,WAA+B,CAAA,GAAA,oBA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Y;IACnF,IAAI,YAAY,oBAAoB;IACpC,IAAI,WAAW;QACb,IAAI,aAAa,aAAa,WAAW,CAAC,MAAM,CAAC,uBAAuB,CAAE;QAC1E,0BACE,0DAAC,CAAA,GAAA,2CAAc;YACb,YAAY;YACZ,aAAa,aAAa,WAAW;YACrC,MAAM,EAAE,mBAAA,6BAAA,OAAQ,UAAU;WACzB;IAGP;IAEA,OAAO;AACT","sources":["packages/react-aria-components/src/Virtualizer.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 {CollectionBranchProps, CollectionRenderer, CollectionRendererContext, CollectionRootProps} from './Collection';\nimport {DropPosition, DropTarget, DropTargetDelegate, ItemDropTarget, Node} from '@react-types/shared';\nimport {Layout, ReusableView, useVirtualizerState, VirtualizerState} from '@react-stately/virtualizer';\nimport React, {createContext, ReactElement, ReactNode, useContext, useMemo} from 'react';\nimport {useScrollView, VirtualizerItem} from '@react-aria/virtualizer';\n\ntype View = ReusableView<Node<unknown>, ReactNode>;\n\nexport interface LayoutOptionsDelegate<O> {\n useLayoutOptions?(): O\n}\n\ninterface ILayout<O> extends Layout<Node<unknown>, O>, Partial<DropTargetDelegate>, LayoutOptionsDelegate<O> {}\n\nexport interface VirtualizerProps<O> {\n /** The child collection to virtualize (e.g. ListBox, GridList, or Table). */\n children: ReactNode,\n /** The layout object that determines the position and size of the visible elements. */\n layout: ILayout<O>,\n /** Options for the layout. */\n layoutOptions?: O\n}\n\nconst VirtualizerContext = createContext<VirtualizerState<any, any> | null>(null);\nconst LayoutContext = createContext<Pick<VirtualizerProps<any>, 'layout' | 'layoutOptions'> | null>(null);\n\nexport function Virtualizer<O>(props: VirtualizerProps<O>) {\n let {children, layout, layoutOptions} = props;\n let renderer: CollectionRenderer = useMemo(() => ({\n isVirtualized: true,\n layoutDelegate: layout,\n dropTargetDelegate: layout.getDropTargetFromPoint ? layout as DropTargetDelegate : undefined,\n CollectionRoot,\n CollectionBranch\n }), [layout]);\n\n return (\n <CollectionRendererContext.Provider value={renderer}>\n <LayoutContext.Provider value={{layout, layoutOptions}}>\n {children}\n </LayoutContext.Provider>\n </CollectionRendererContext.Provider>\n );\n}\n\nfunction CollectionRoot({collection, persistedKeys, scrollRef, renderDropIndicator}: CollectionRootProps) {\n let {layout, layoutOptions} = useContext(LayoutContext)!;\n let layoutOptions2 = layout.useLayoutOptions?.();\n let state = useVirtualizerState({\n layout,\n collection,\n renderView: (type, item) => {\n return item?.render?.(item);\n },\n onVisibleRectChange(rect) {\n let element = scrollRef?.current;\n if (element) {\n element.scrollLeft = rect.x;\n element.scrollTop = rect.y;\n }\n },\n persistedKeys,\n layoutOptions: useMemo(() => {\n if (layoutOptions && layoutOptions2) {\n return {...layoutOptions, ...layoutOptions2};\n }\n return layoutOptions || layoutOptions2;\n }, [layoutOptions, layoutOptions2])\n });\n\n let {contentProps} = useScrollView({\n onVisibleRectChange: state.setVisibleRect,\n contentSize: state.contentSize,\n onScrollStart: state.startScrolling,\n onScrollEnd: state.endScrolling\n }, scrollRef!);\n\n if (state.contentSize.area === 0) {\n return null;\n }\n\n return (\n <div {...contentProps}>\n <VirtualizerContext.Provider value={state}>\n {renderChildren(null, state.visibleViews, renderDropIndicator)}\n </VirtualizerContext.Provider>\n </div>\n );\n}\n\nfunction CollectionBranch({parent, renderDropIndicator}: CollectionBranchProps) {\n let virtualizer = useContext(VirtualizerContext);\n let parentView = virtualizer!.virtualizer.getVisibleView(parent.key)!;\n return renderChildren(parentView, Array.from(parentView.children), renderDropIndicator);\n}\n\nfunction renderChildren(parent: View | null, children: View[], renderDropIndicator?: (target: ItemDropTarget) => ReactNode) {\n return children.map(view => renderWrapper(parent, view, renderDropIndicator));\n}\n\nfunction renderWrapper(\n parent: View | null,\n reusableView: View,\n renderDropIndicator?: (target: ItemDropTarget) => ReactNode\n): ReactElement {\n let rendered = (\n <VirtualizerItem\n key={reusableView.key}\n layoutInfo={reusableView.layoutInfo!}\n virtualizer={reusableView.virtualizer}\n parent={parent?.layoutInfo}>\n {reusableView.rendered}\n </VirtualizerItem>\n );\n\n let {collection, layout} = reusableView.virtualizer;\n let {key, type} = reusableView.content;\n if (type === 'item' && renderDropIndicator && layout.getDropTargetLayoutInfo) {\n rendered = (\n <React.Fragment key={reusableView.key}>\n {renderDropIndicatorWrapper(parent, reusableView, 'before', renderDropIndicator)}\n {rendered}\n {collection.getKeyAfter(key) == null && renderDropIndicatorWrapper(parent, reusableView, 'after', renderDropIndicator)}\n </React.Fragment>\n );\n }\n\n return rendered;\n}\n\nfunction renderDropIndicatorWrapper(\n parent: View | null,\n reusableView: View,\n dropPosition: DropPosition,\n renderDropIndicator: (target: ItemDropTarget) => ReactNode\n) {\n let target: DropTarget = {type: 'item', key: reusableView.content.key, dropPosition};\n let indicator = renderDropIndicator(target);\n if (indicator) {\n let layoutInfo = reusableView.virtualizer.layout.getDropTargetLayoutInfo!(target);\n indicator = (\n <VirtualizerItem\n layoutInfo={layoutInfo}\n virtualizer={reusableView.virtualizer}\n parent={parent?.layoutInfo}>\n {indicator}\n </VirtualizerItem>\n );\n }\n \n return indicator;\n}\n"],"names":[],"version":3,"file":"Virtualizer.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;AAyBD,MAAM,yDAAqB,CAAA,GAAA,0BAAY,EAAqC;AAC5E,MAAM,oDAAgB,CAAA,GAAA,0BAAY,EAAkE;AAE7F,SAAS,0CAAe,KAA0B;IACvD,IAAI,YAAC,QAAQ,UAAE,MAAM,iBAAE,aAAa,EAAC,GAAG;IACxC,IAAI,WAA+B,CA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G;sBAAE;IAAY;IACnF,IAAI,YAAY,oBAAoB;IACpC,IAAI,WAAW;QACb,IAAI,aAAa,aAAa,WAAW,CAAC,MAAM,CAAC,uBAAuB,CAAE;QAC1E,0BACE,0DAAC,CAAA,GAAA,2CAAc;YACb,YAAY;YACZ,aAAa,aAAa,WAAW;YACrC,MAAM,EAAE,mBAAA,6BAAA,OAAQ,UAAU;WACzB;IAGP;IAEA,OAAO;AACT","sources":["packages/react-aria-components/src/Virtualizer.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 {CollectionBranchProps, CollectionRenderer, CollectionRendererContext, CollectionRootProps} from './Collection';\nimport {DropPosition, DropTarget, DropTargetDelegate, ItemDropTarget, Node} from '@react-types/shared';\nimport {Layout, ReusableView, useVirtualizerState, VirtualizerState} from '@react-stately/virtualizer';\nimport React, {createContext, ReactElement, ReactNode, useContext, useMemo} from 'react';\nimport {useScrollView, VirtualizerItem} from '@react-aria/virtualizer';\n\ntype View = ReusableView<Node<unknown>, ReactNode>;\n\nexport interface LayoutOptionsDelegate<O> {\n useLayoutOptions?(): O\n}\n\ninterface ILayout<O> extends Layout<Node<unknown>, O>, Partial<DropTargetDelegate>, LayoutOptionsDelegate<O> {}\n\nexport interface VirtualizerProps<O> {\n /** The child collection to virtualize (e.g. ListBox, GridList, or Table). */\n children: ReactNode,\n /** The layout object that determines the position and size of the visible elements. */\n layout: ILayout<O>,\n /** Options for the layout. */\n layoutOptions?: O\n}\n\nconst VirtualizerContext = createContext<VirtualizerState<any, any> | null>(null);\nconst LayoutContext = createContext<Pick<VirtualizerProps<any>, 'layout' | 'layoutOptions'> | null>(null);\n\nexport function Virtualizer<O>(props: VirtualizerProps<O>) {\n let {children, layout, layoutOptions} = props;\n let renderer: CollectionRenderer = useMemo(() => ({\n isVirtualized: true,\n layoutDelegate: layout,\n dropTargetDelegate: layout.getDropTargetFromPoint ? layout as DropTargetDelegate : undefined,\n CollectionRoot,\n CollectionBranch\n }), [layout]);\n\n return (\n <CollectionRendererContext.Provider value={renderer}>\n <LayoutContext.Provider value={{layout, layoutOptions}}>\n {children}\n </LayoutContext.Provider>\n </CollectionRendererContext.Provider>\n );\n}\n\nfunction CollectionRoot({collection, persistedKeys, scrollRef, renderDropIndicator}: CollectionRootProps) {\n let {layout, layoutOptions} = useContext(LayoutContext)!;\n let layoutOptions2 = layout.useLayoutOptions?.();\n let state = useVirtualizerState({\n layout,\n collection,\n renderView: (type, item) => {\n return item?.render?.(item);\n },\n onVisibleRectChange(rect) {\n let element = scrollRef?.current;\n if (element) {\n element.scrollLeft = rect.x;\n element.scrollTop = rect.y;\n }\n },\n persistedKeys,\n layoutOptions: useMemo(() => {\n if (layoutOptions && layoutOptions2) {\n return {...layoutOptions, ...layoutOptions2};\n }\n return layoutOptions || layoutOptions2;\n }, [layoutOptions, layoutOptions2])\n });\n\n let {contentProps} = useScrollView({\n onVisibleRectChange: state.setVisibleRect,\n contentSize: state.contentSize,\n onScrollStart: state.startScrolling,\n onScrollEnd: state.endScrolling\n }, scrollRef!);\n\n if (state.contentSize.area === 0) {\n return null;\n }\n\n return (\n <div {...contentProps}>\n <VirtualizerContext.Provider value={state}>\n {renderChildren(null, state.visibleViews, renderDropIndicator)}\n </VirtualizerContext.Provider>\n </div>\n );\n}\n\nfunction CollectionBranch({parent, renderDropIndicator}: CollectionBranchProps) {\n let virtualizer = useContext(VirtualizerContext);\n let parentView = virtualizer!.virtualizer.getVisibleView(parent.key)!;\n return renderChildren(parentView, Array.from(parentView.children), renderDropIndicator);\n}\n\nfunction renderChildren(parent: View | null, children: View[], renderDropIndicator?: (target: ItemDropTarget) => ReactNode) {\n return children.map(view => renderWrapper(parent, view, renderDropIndicator));\n}\n\nfunction renderWrapper(\n parent: View | null,\n reusableView: View,\n renderDropIndicator?: (target: ItemDropTarget) => ReactNode\n): ReactElement {\n let rendered = (\n <VirtualizerItem\n key={reusableView.key}\n layoutInfo={reusableView.layoutInfo!}\n virtualizer={reusableView.virtualizer}\n parent={parent?.layoutInfo}>\n {reusableView.rendered}\n </VirtualizerItem>\n );\n\n let {collection, layout} = reusableView.virtualizer;\n let {key, type} = reusableView.content;\n if (type === 'item' && renderDropIndicator && layout.getDropTargetLayoutInfo) {\n rendered = (\n <React.Fragment key={reusableView.key}>\n {renderDropIndicatorWrapper(parent, reusableView, 'before', renderDropIndicator)}\n {rendered}\n {collection.getKeyAfter(key) == null && renderDropIndicatorWrapper(parent, reusableView, 'after', renderDropIndicator)}\n </React.Fragment>\n );\n }\n\n return rendered;\n}\n\nfunction renderDropIndicatorWrapper(\n parent: View | null,\n reusableView: View,\n dropPosition: DropPosition,\n renderDropIndicator: (target: ItemDropTarget) => ReactNode\n) {\n let target: DropTarget = {type: 'item', key: reusableView.content.key, dropPosition};\n let indicator = renderDropIndicator(target);\n if (indicator) {\n let layoutInfo = reusableView.virtualizer.layout.getDropTargetLayoutInfo!(target);\n indicator = (\n <VirtualizerItem\n layoutInfo={layoutInfo}\n virtualizer={reusableView.virtualizer}\n parent={parent?.layoutInfo}>\n {indicator}\n </VirtualizerItem>\n );\n }\n\n return indicator;\n}\n"],"names":[],"version":3,"file":"Virtualizer.main.js.map"}
@@ -1 +1 @@
1
- {"mappings":";;;;;AAAA;;;;;;;;;;CAUC;;;;AAyBD,MAAM,yDAAqB,CAAA,GAAA,oBAAY,EAAqC;AAC5E,MAAM,oDAAgB,CAAA,GAAA,oBAAY,EAAkE;AAE7F,SAAS,0CAAe,KAA0B;IACvD,IAAI,YAAC,QAAQ,UAAE,MAAM,iBAAE,aAAa,EAAC,GAAG;IACxC,I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,CAAC,GAAG;sBAAE;IAAY;IACnF,IAAI,YAAY,oBAAoB;IACpC,IAAI,WAAW;QACb,IAAI,aAAa,aAAa,WAAW,CAAC,MAAM,CAAC,uBAAuB,CAAE;QAC1E,0BACE,gCAAC,CAAA,GAAA,sBAAc;YACb,YAAY;YACZ,aAAa,aAAa,WAAW;YACrC,MAAM,EAAE,mBAAA,6BAAA,OAAQ,UAAU;WACzB;IAGP;IAEA,OAAO;AACT","sources":["packages/react-aria-components/src/Virtualizer.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 {CollectionBranchProps, CollectionRenderer, CollectionRendererContext, CollectionRootProps} from './Collection';\nimport {DropPosition, DropTarget, DropTargetDelegate, ItemDropTarget, Node} from '@react-types/shared';\nimport {Layout, ReusableView, useVirtualizerState, VirtualizerState} from '@react-stately/virtualizer';\nimport React, {createContext, ReactElement, ReactNode, useContext, useMemo} from 'react';\nimport {useScrollView, VirtualizerItem} from '@react-aria/virtualizer';\n\ntype View = ReusableView<Node<unknown>, ReactNode>;\n\nexport interface LayoutOptionsDelegate<O> {\n useLayoutOptions?(): O\n}\n\ninterface ILayout<O> extends Layout<Node<unknown>, O>, Partial<DropTargetDelegate>, LayoutOptionsDelegate<O> {}\n\nexport interface VirtualizerProps<O> {\n /** The child collection to virtualize (e.g. ListBox, GridList, or Table). */\n children: ReactNode,\n /** The layout object that determines the position and size of the visible elements. */\n layout: ILayout<O>,\n /** Options for the layout. */\n layoutOptions?: O\n}\n\nconst VirtualizerContext = createContext<VirtualizerState<any, any> | null>(null);\nconst LayoutContext = createContext<Pick<VirtualizerProps<any>, 'layout' | 'layoutOptions'> | null>(null);\n\nexport function Virtualizer<O>(props: VirtualizerProps<O>) {\n let {children, layout, layoutOptions} = props;\n let renderer: CollectionRenderer = useMemo(() => ({\n isVirtualized: true,\n layoutDelegate: layout,\n dropTargetDelegate: layout.getDropTargetFromPoint ? layout as DropTargetDelegate : undefined,\n CollectionRoot,\n CollectionBranch\n }), [layout]);\n\n return (\n <CollectionRendererContext.Provider value={renderer}>\n <LayoutContext.Provider value={{layout, layoutOptions}}>\n {children}\n </LayoutContext.Provider>\n </CollectionRendererContext.Provider>\n );\n}\n\nfunction CollectionRoot({collection, persistedKeys, scrollRef, renderDropIndicator}: CollectionRootProps) {\n let {layout, layoutOptions} = useContext(LayoutContext)!;\n let layoutOptions2 = layout.useLayoutOptions?.();\n let state = useVirtualizerState({\n layout,\n collection,\n renderView: (type, item) => {\n return item?.render?.(item);\n },\n onVisibleRectChange(rect) {\n let element = scrollRef?.current;\n if (element) {\n element.scrollLeft = rect.x;\n element.scrollTop = rect.y;\n }\n },\n persistedKeys,\n layoutOptions: useMemo(() => {\n if (layoutOptions && layoutOptions2) {\n return {...layoutOptions, ...layoutOptions2};\n }\n return layoutOptions || layoutOptions2;\n }, [layoutOptions, layoutOptions2])\n });\n\n let {contentProps} = useScrollView({\n onVisibleRectChange: state.setVisibleRect,\n contentSize: state.contentSize,\n onScrollStart: state.startScrolling,\n onScrollEnd: state.endScrolling\n }, scrollRef!);\n\n if (state.contentSize.area === 0) {\n return null;\n }\n\n return (\n <div {...contentProps}>\n <VirtualizerContext.Provider value={state}>\n {renderChildren(null, state.visibleViews, renderDropIndicator)}\n </VirtualizerContext.Provider>\n </div>\n );\n}\n\nfunction CollectionBranch({parent, renderDropIndicator}: CollectionBranchProps) {\n let virtualizer = useContext(VirtualizerContext);\n let parentView = virtualizer!.virtualizer.getVisibleView(parent.key)!;\n return renderChildren(parentView, Array.from(parentView.children), renderDropIndicator);\n}\n\nfunction renderChildren(parent: View | null, children: View[], renderDropIndicator?: (target: ItemDropTarget) => ReactNode) {\n return children.map(view => renderWrapper(parent, view, renderDropIndicator));\n}\n\nfunction renderWrapper(\n parent: View | null,\n reusableView: View,\n renderDropIndicator?: (target: ItemDropTarget) => ReactNode\n): ReactElement {\n let rendered = (\n <VirtualizerItem\n key={reusableView.key}\n layoutInfo={reusableView.layoutInfo!}\n virtualizer={reusableView.virtualizer}\n parent={parent?.layoutInfo}>\n {reusableView.rendered}\n </VirtualizerItem>\n );\n\n let {collection, layout} = reusableView.virtualizer;\n let {key, type} = reusableView.content;\n if (type === 'item' && renderDropIndicator && layout.getDropTargetLayoutInfo) {\n rendered = (\n <React.Fragment key={reusableView.key}>\n {renderDropIndicatorWrapper(parent, reusableView, 'before', renderDropIndicator)}\n {rendered}\n {collection.getKeyAfter(key) == null && renderDropIndicatorWrapper(parent, reusableView, 'after', renderDropIndicator)}\n </React.Fragment>\n );\n }\n\n return rendered;\n}\n\nfunction renderDropIndicatorWrapper(\n parent: View | null,\n reusableView: View,\n dropPosition: DropPosition,\n renderDropIndicator: (target: ItemDropTarget) => ReactNode\n) {\n let target: DropTarget = {type: 'item', key: reusableView.content.key, dropPosition};\n let indicator = renderDropIndicator(target);\n if (indicator) {\n let layoutInfo = reusableView.virtualizer.layout.getDropTargetLayoutInfo!(target);\n indicator = (\n <VirtualizerItem\n layoutInfo={layoutInfo}\n virtualizer={reusableView.virtualizer}\n parent={parent?.layoutInfo}>\n {indicator}\n </VirtualizerItem>\n );\n }\n \n return indicator;\n}\n"],"names":[],"version":3,"file":"Virtualizer.module.js.map"}
1
+ {"mappings":";;;;;AAAA;;;;;;;;;;CAUC;;;;AAyBD,MAAM,yDAAqB,CAAA,GAAA,oBAAY,EAAqC;AAC5E,MAAM,oDAAgB,CAAA,GAAA,oBAAY,EAAkE;AAE7F,SAAS,0CAAe,KAA0B;IACvD,IAAI,YAAC,QAAQ,UAAE,MAAM,iBAAE,aAAa,EAAC,GAAG;IACxC,IAA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AAC,GAAG;sBAAE;IAAY;IACnF,IAAI,YAAY,oBAAoB;IACpC,IAAI,WAAW;QACb,IAAI,aAAa,aAAa,WAAW,CAAC,MAAM,CAAC,uBAAuB,CAAE;QAC1E,0BACE,gCAAC,CAAA,GAAA,sBAAc;YACb,YAAY;YACZ,aAAa,aAAa,WAAW;YACrC,MAAM,EAAE,mBAAA,6BAAA,OAAQ,UAAU;WACzB;IAGP;IAEA,OAAO;AACT","sources":["packages/react-aria-components/src/Virtualizer.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 {CollectionBranchProps, CollectionRenderer, CollectionRendererContext, CollectionRootProps} from './Collection';\nimport {DropPosition, DropTarget, DropTargetDelegate, ItemDropTarget, Node} from '@react-types/shared';\nimport {Layout, ReusableView, useVirtualizerState, VirtualizerState} from '@react-stately/virtualizer';\nimport React, {createContext, ReactElement, ReactNode, useContext, useMemo} from 'react';\nimport {useScrollView, VirtualizerItem} from '@react-aria/virtualizer';\n\ntype View = ReusableView<Node<unknown>, ReactNode>;\n\nexport interface LayoutOptionsDelegate<O> {\n useLayoutOptions?(): O\n}\n\ninterface ILayout<O> extends Layout<Node<unknown>, O>, Partial<DropTargetDelegate>, LayoutOptionsDelegate<O> {}\n\nexport interface VirtualizerProps<O> {\n /** The child collection to virtualize (e.g. ListBox, GridList, or Table). */\n children: ReactNode,\n /** The layout object that determines the position and size of the visible elements. */\n layout: ILayout<O>,\n /** Options for the layout. */\n layoutOptions?: O\n}\n\nconst VirtualizerContext = createContext<VirtualizerState<any, any> | null>(null);\nconst LayoutContext = createContext<Pick<VirtualizerProps<any>, 'layout' | 'layoutOptions'> | null>(null);\n\nexport function Virtualizer<O>(props: VirtualizerProps<O>) {\n let {children, layout, layoutOptions} = props;\n let renderer: CollectionRenderer = useMemo(() => ({\n isVirtualized: true,\n layoutDelegate: layout,\n dropTargetDelegate: layout.getDropTargetFromPoint ? layout as DropTargetDelegate : undefined,\n CollectionRoot,\n CollectionBranch\n }), [layout]);\n\n return (\n <CollectionRendererContext.Provider value={renderer}>\n <LayoutContext.Provider value={{layout, layoutOptions}}>\n {children}\n </LayoutContext.Provider>\n </CollectionRendererContext.Provider>\n );\n}\n\nfunction CollectionRoot({collection, persistedKeys, scrollRef, renderDropIndicator}: CollectionRootProps) {\n let {layout, layoutOptions} = useContext(LayoutContext)!;\n let layoutOptions2 = layout.useLayoutOptions?.();\n let state = useVirtualizerState({\n layout,\n collection,\n renderView: (type, item) => {\n return item?.render?.(item);\n },\n onVisibleRectChange(rect) {\n let element = scrollRef?.current;\n if (element) {\n element.scrollLeft = rect.x;\n element.scrollTop = rect.y;\n }\n },\n persistedKeys,\n layoutOptions: useMemo(() => {\n if (layoutOptions && layoutOptions2) {\n return {...layoutOptions, ...layoutOptions2};\n }\n return layoutOptions || layoutOptions2;\n }, [layoutOptions, layoutOptions2])\n });\n\n let {contentProps} = useScrollView({\n onVisibleRectChange: state.setVisibleRect,\n contentSize: state.contentSize,\n onScrollStart: state.startScrolling,\n onScrollEnd: state.endScrolling\n }, scrollRef!);\n\n if (state.contentSize.area === 0) {\n return null;\n }\n\n return (\n <div {...contentProps}>\n <VirtualizerContext.Provider value={state}>\n {renderChildren(null, state.visibleViews, renderDropIndicator)}\n </VirtualizerContext.Provider>\n </div>\n );\n}\n\nfunction CollectionBranch({parent, renderDropIndicator}: CollectionBranchProps) {\n let virtualizer = useContext(VirtualizerContext);\n let parentView = virtualizer!.virtualizer.getVisibleView(parent.key)!;\n return renderChildren(parentView, Array.from(parentView.children), renderDropIndicator);\n}\n\nfunction renderChildren(parent: View | null, children: View[], renderDropIndicator?: (target: ItemDropTarget) => ReactNode) {\n return children.map(view => renderWrapper(parent, view, renderDropIndicator));\n}\n\nfunction renderWrapper(\n parent: View | null,\n reusableView: View,\n renderDropIndicator?: (target: ItemDropTarget) => ReactNode\n): ReactElement {\n let rendered = (\n <VirtualizerItem\n key={reusableView.key}\n layoutInfo={reusableView.layoutInfo!}\n virtualizer={reusableView.virtualizer}\n parent={parent?.layoutInfo}>\n {reusableView.rendered}\n </VirtualizerItem>\n );\n\n let {collection, layout} = reusableView.virtualizer;\n let {key, type} = reusableView.content;\n if (type === 'item' && renderDropIndicator && layout.getDropTargetLayoutInfo) {\n rendered = (\n <React.Fragment key={reusableView.key}>\n {renderDropIndicatorWrapper(parent, reusableView, 'before', renderDropIndicator)}\n {rendered}\n {collection.getKeyAfter(key) == null && renderDropIndicatorWrapper(parent, reusableView, 'after', renderDropIndicator)}\n </React.Fragment>\n );\n }\n\n return rendered;\n}\n\nfunction renderDropIndicatorWrapper(\n parent: View | null,\n reusableView: View,\n dropPosition: DropPosition,\n renderDropIndicator: (target: ItemDropTarget) => ReactNode\n) {\n let target: DropTarget = {type: 'item', key: reusableView.content.key, dropPosition};\n let indicator = renderDropIndicator(target);\n if (indicator) {\n let layoutInfo = reusableView.virtualizer.layout.getDropTargetLayoutInfo!(target);\n indicator = (\n <VirtualizerItem\n layoutInfo={layoutInfo}\n virtualizer={reusableView.virtualizer}\n parent={parent?.layoutInfo}>\n {indicator}\n </VirtualizerItem>\n );\n }\n\n return indicator;\n}\n"],"names":[],"version":3,"file":"Virtualizer.module.js.map"}
package/dist/types.d.ts CHANGED
@@ -665,7 +665,7 @@ export interface BreadcrumbRenderProps {
665
665
  isCurrent: boolean;
666
666
  /**
667
667
  * Whether the breadcrumb is disabled.
668
- * @selector [data-current]
668
+ * @selector [data-disabled]
669
669
  */
670
670
  isDisabled: boolean;
671
671
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-aria-components",
3
- "version": "3.0.0-nightly-5ae234603-240925",
3
+ "version": "3.0.0-nightly-a626c2596-240926",
4
4
  "description": "A library of styleable components built using React Aria",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
@@ -37,37 +37,37 @@
37
37
  "url": "https://github.com/adobe/react-spectrum"
38
38
  },
39
39
  "dependencies": {
40
- "@internationalized/date": "^3.0.0-nightly-5ae234603-240925",
41
- "@internationalized/string": "^3.0.0-nightly-5ae234603-240925",
42
- "@react-aria/accordion": "3.0.0-nightly-5ae234603-240925",
43
- "@react-aria/collections": "3.0.0-nightly-5ae234603-240925",
44
- "@react-aria/color": "3.0.0-nightly-5ae234603-240925",
45
- "@react-aria/disclosure": "3.0.0-nightly-5ae234603-240925",
46
- "@react-aria/dnd": "^3.0.0-nightly-5ae234603-240925",
47
- "@react-aria/focus": "^3.0.0-nightly-5ae234603-240925",
48
- "@react-aria/interactions": "^3.0.0-nightly-5ae234603-240925",
49
- "@react-aria/live-announcer": "^3.0.0-nightly-5ae234603-240925",
50
- "@react-aria/menu": "^3.0.0-nightly-5ae234603-240925",
51
- "@react-aria/toolbar": "3.0.0-nightly-5ae234603-240925",
52
- "@react-aria/tree": "3.0.0-nightly-5ae234603-240925",
53
- "@react-aria/utils": "^3.0.0-nightly-5ae234603-240925",
54
- "@react-aria/virtualizer": "^3.0.0-nightly-5ae234603-240925",
55
- "@react-stately/color": "^3.0.0-nightly-5ae234603-240925",
56
- "@react-stately/disclosure": "3.0.0-nightly-5ae234603-240925",
57
- "@react-stately/layout": "^3.0.0-nightly-5ae234603-240925",
58
- "@react-stately/menu": "^3.0.0-nightly-5ae234603-240925",
59
- "@react-stately/table": "^3.0.0-nightly-5ae234603-240925",
60
- "@react-stately/utils": "^3.0.0-nightly-5ae234603-240925",
61
- "@react-stately/virtualizer": "^3.0.0-nightly-5ae234603-240925",
62
- "@react-types/color": "3.0.0-nightly-5ae234603-240925",
63
- "@react-types/form": "^3.0.0-nightly-5ae234603-240925",
64
- "@react-types/grid": "^3.0.0-nightly-5ae234603-240925",
65
- "@react-types/shared": "^3.0.0-nightly-5ae234603-240925",
66
- "@react-types/table": "^3.0.0-nightly-5ae234603-240925",
40
+ "@internationalized/date": "^3.0.0-nightly-a626c2596-240926",
41
+ "@internationalized/string": "^3.0.0-nightly-a626c2596-240926",
42
+ "@react-aria/accordion": "3.0.0-nightly-a626c2596-240926",
43
+ "@react-aria/collections": "3.0.0-nightly-a626c2596-240926",
44
+ "@react-aria/color": "3.0.0-nightly-a626c2596-240926",
45
+ "@react-aria/disclosure": "3.0.0-nightly-a626c2596-240926",
46
+ "@react-aria/dnd": "^3.0.0-nightly-a626c2596-240926",
47
+ "@react-aria/focus": "^3.0.0-nightly-a626c2596-240926",
48
+ "@react-aria/interactions": "^3.0.0-nightly-a626c2596-240926",
49
+ "@react-aria/live-announcer": "^3.0.0-nightly-a626c2596-240926",
50
+ "@react-aria/menu": "^3.0.0-nightly-a626c2596-240926",
51
+ "@react-aria/toolbar": "3.0.0-nightly-a626c2596-240926",
52
+ "@react-aria/tree": "3.0.0-nightly-a626c2596-240926",
53
+ "@react-aria/utils": "^3.0.0-nightly-a626c2596-240926",
54
+ "@react-aria/virtualizer": "^3.0.0-nightly-a626c2596-240926",
55
+ "@react-stately/color": "^3.0.0-nightly-a626c2596-240926",
56
+ "@react-stately/disclosure": "3.0.0-nightly-a626c2596-240926",
57
+ "@react-stately/layout": "^3.0.0-nightly-a626c2596-240926",
58
+ "@react-stately/menu": "^3.0.0-nightly-a626c2596-240926",
59
+ "@react-stately/table": "^3.0.0-nightly-a626c2596-240926",
60
+ "@react-stately/utils": "^3.0.0-nightly-a626c2596-240926",
61
+ "@react-stately/virtualizer": "^3.0.0-nightly-a626c2596-240926",
62
+ "@react-types/color": "3.0.0-nightly-a626c2596-240926",
63
+ "@react-types/form": "^3.0.0-nightly-a626c2596-240926",
64
+ "@react-types/grid": "^3.0.0-nightly-a626c2596-240926",
65
+ "@react-types/shared": "^3.0.0-nightly-a626c2596-240926",
66
+ "@react-types/table": "^3.0.0-nightly-a626c2596-240926",
67
67
  "@swc/helpers": "^0.5.0",
68
68
  "client-only": "^0.0.1",
69
- "react-aria": "^3.0.0-nightly-5ae234603-240925",
70
- "react-stately": "^3.0.0-nightly-5ae234603-240925",
69
+ "react-aria": "^3.0.0-nightly-a626c2596-240926",
70
+ "react-stately": "^3.0.0-nightly-a626c2596-240926",
71
71
  "use-sync-external-store": "^1.2.0"
72
72
  },
73
73
  "peerDependencies": {
@@ -65,7 +65,7 @@ export interface BreadcrumbRenderProps {
65
65
  isCurrent: boolean,
66
66
  /**
67
67
  * Whether the breadcrumb is disabled.
68
- * @selector [data-current]
68
+ * @selector [data-disabled]
69
69
  */
70
70
  isDisabled: boolean
71
71
  }
@@ -159,6 +159,6 @@ function renderDropIndicatorWrapper(
159
159
  </VirtualizerItem>
160
160
  );
161
161
  }
162
-
162
+
163
163
  return indicator;
164
164
  }