react-aria-components 1.7.1 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Autocomplete.main.js.map +1 -1
- package/dist/Autocomplete.module.js.map +1 -1
- package/dist/Calendar.main.js +5 -7
- package/dist/Calendar.main.js.map +1 -1
- package/dist/Calendar.mjs +6 -8
- package/dist/Calendar.module.js +6 -8
- package/dist/Calendar.module.js.map +1 -1
- package/dist/Collection.main.js +1 -1
- package/dist/Collection.main.js.map +1 -1
- package/dist/Collection.mjs +1 -1
- package/dist/Collection.module.js +1 -1
- package/dist/Collection.module.js.map +1 -1
- package/dist/ColorPicker.main.js.map +1 -1
- package/dist/ColorPicker.module.js.map +1 -1
- package/dist/ColorWheel.main.js +3 -1
- package/dist/ColorWheel.main.js.map +1 -1
- package/dist/ColorWheel.mjs +3 -1
- package/dist/ColorWheel.module.js +3 -1
- package/dist/ColorWheel.module.js.map +1 -1
- package/dist/DateField.main.js +16 -9
- package/dist/DateField.main.js.map +1 -1
- package/dist/DateField.mjs +16 -9
- package/dist/DateField.module.js +16 -9
- package/dist/DateField.module.js.map +1 -1
- package/dist/Dialog.main.js +16 -2
- package/dist/Dialog.main.js.map +1 -1
- package/dist/Dialog.mjs +18 -4
- package/dist/Dialog.module.js +18 -4
- package/dist/Dialog.module.js.map +1 -1
- package/dist/DragAndDrop.main.js.map +1 -1
- package/dist/DragAndDrop.module.js.map +1 -1
- package/dist/GridList.main.js +61 -5
- package/dist/GridList.main.js.map +1 -1
- package/dist/GridList.mjs +62 -7
- package/dist/GridList.module.js +62 -7
- package/dist/GridList.module.js.map +1 -1
- package/dist/ListBox.main.js +63 -4
- package/dist/ListBox.main.js.map +1 -1
- package/dist/ListBox.mjs +64 -6
- package/dist/ListBox.module.js +64 -6
- package/dist/ListBox.module.js.map +1 -1
- package/dist/Menu.main.js.map +1 -1
- package/dist/Menu.module.js.map +1 -1
- package/dist/Modal.main.js.map +1 -1
- package/dist/Modal.module.js.map +1 -1
- package/dist/OverlayArrow.main.js +4 -1
- package/dist/OverlayArrow.main.js.map +1 -1
- package/dist/OverlayArrow.mjs +4 -1
- package/dist/OverlayArrow.module.js +4 -1
- package/dist/OverlayArrow.module.js.map +1 -1
- package/dist/Popover.main.js +1 -1
- package/dist/Popover.main.js.map +1 -1
- package/dist/Popover.mjs +1 -1
- package/dist/Popover.module.js +1 -1
- package/dist/Popover.module.js.map +1 -1
- package/dist/Select.main.js.map +1 -1
- package/dist/Select.module.js.map +1 -1
- package/dist/Separator.main.js +3 -2
- package/dist/Separator.main.js.map +1 -1
- package/dist/Separator.mjs +3 -2
- package/dist/Separator.module.js +3 -2
- package/dist/Separator.module.js.map +1 -1
- package/dist/Table.main.js +45 -12
- package/dist/Table.main.js.map +1 -1
- package/dist/Table.mjs +46 -13
- package/dist/Table.module.js +46 -13
- package/dist/Table.module.js.map +1 -1
- package/dist/TableLayout.main.js.map +1 -1
- package/dist/TableLayout.module.js.map +1 -1
- package/dist/TagGroup.main.js +2 -2
- package/dist/TagGroup.main.js.map +1 -1
- package/dist/TagGroup.mjs +2 -2
- package/dist/TagGroup.module.js +2 -2
- package/dist/TagGroup.module.js.map +1 -1
- package/dist/TextArea.main.js.map +1 -1
- package/dist/TextArea.module.js.map +1 -1
- package/dist/Toast.main.js +45 -16
- package/dist/Toast.main.js.map +1 -1
- package/dist/Toast.mjs +45 -18
- package/dist/Toast.module.js +45 -18
- package/dist/Toast.module.js.map +1 -1
- package/dist/Tooltip.main.js.map +1 -1
- package/dist/Tooltip.module.js.map +1 -1
- package/dist/Tree.main.js +2 -2
- package/dist/Tree.main.js.map +1 -1
- package/dist/Tree.mjs +2 -2
- package/dist/Tree.module.js +2 -2
- package/dist/Tree.module.js.map +1 -1
- package/dist/Virtualizer.main.js +0 -1
- package/dist/Virtualizer.main.js.map +1 -1
- package/dist/Virtualizer.mjs +0 -1
- package/dist/Virtualizer.module.js +0 -1
- package/dist/Virtualizer.module.js.map +1 -1
- package/dist/import.mjs +6 -6
- package/dist/main.js +6 -1
- package/dist/main.js.map +1 -1
- package/dist/module.js +6 -6
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +121 -45
- package/dist/types.d.ts.map +1 -1
- package/dist/utils.main.js.map +1 -1
- package/dist/utils.module.js.map +1 -1
- package/i18n/es-ES.js +1 -1
- package/i18n/es-ES.mjs +1 -1
- package/i18n/index.js +1 -1
- package/i18n/index.mjs +1 -1
- package/package.json +27 -25
- package/src/Autocomplete.tsx +2 -2
- package/src/Calendar.tsx +23 -11
- package/src/Collection.tsx +5 -2
- package/src/ColorPicker.tsx +2 -2
- package/src/ColorWheel.tsx +3 -1
- package/src/DateField.tsx +13 -9
- package/src/Dialog.tsx +19 -5
- package/src/DragAndDrop.tsx +4 -2
- package/src/GridList.tsx +73 -8
- package/src/ListBox.tsx +74 -7
- package/src/Menu.tsx +2 -1
- package/src/Modal.tsx +1 -0
- package/src/OverlayArrow.tsx +6 -3
- package/src/Popover.tsx +2 -1
- package/src/Select.tsx +7 -1
- package/src/Separator.tsx +3 -2
- package/src/Table.tsx +52 -19
- package/src/TableLayout.ts +1 -1
- package/src/TagGroup.tsx +2 -2
- package/src/TextArea.tsx +1 -1
- package/src/Toast.tsx +51 -13
- package/src/Tooltip.tsx +3 -2
- package/src/Tree.tsx +2 -2
- package/src/Virtualizer.tsx +3 -7
- package/src/index.ts +8 -8
- package/src/utils.tsx +8 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;AA4CM,MAAM,0DAAkB,CAAA,GAAA,0BAAY,EAA+C;AACnF,MAAM,0DAAiB,CAAA,GAAA,0BAAY,EAAmD;AAKtF,MAAM,4CAAyB,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,SAAS,KAAoB,EAAE,GAAiC;IAC5I,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,y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AAG,WAAW;QACd,GAAG,CAAA,GAAA,gCAAS,EAAE,CAAA,GAAA,oCAAa,EAAE,QAAe,UAAU,YAAY,WAAW;QAC9E,iBAAe,OAAO,UAAU,IAAI;QACpC,iBAAe,OAAO,UAAU,IAAI;QACpC,gBAAc,aAAa;QAC3B,gBAAc,OAAO,SAAS,IAAI;QAClC,sBAAoB,kBAAkB;QACtC,gBAAc,OAAO,SAAS,IAAI;QAClC,wBAAsB,OAAO,cAAc,IAAI;QAC/C,uBAAqB,MAAM,gBAAgB,CAAC,aAAa,KAAK,SAAS,YAAY,MAAM,gBAAgB,CAAC,aAAa;qBACvH,0DAAC;QAAK,GAAG,aAAa;QAAE,OAAO;YAAC,SAAS;QAAU;qBACjD,0DAAC,CAAA,GAAA,kCAAO;QACN,QAAQ;YACN;gBAAC,CAAA,GAAA,uCAAY;gBAAG;oBACd,OAAO;wBACL,QAAQ;oBACV;gBACF;aAAE;YACF;gBAAC,CAAA,GAAA,mDAAwB;gBAAG,CAAA,GAAA,mDAAwB;aAAE;SACvD;OACA,YAAY,QAAQ;AAK/B","sources":["packages/react-aria-components/src/TagGroup.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 */\n\nimport {AriaTagGroupProps, useFocusRing, useHover, useTag, useTagGroup} from 'react-aria';\nimport {ButtonContext} from './Button';\nimport {Collection, CollectionBuilder, createLeafComponent} from '@react-aria/collections';\nimport {CollectionProps, CollectionRendererContext, DefaultCollectionRenderer, ItemRenderProps, usePersistedKeys} from './Collection';\nimport {ContextValue, DOMProps, Provider, RenderProps, SlotProps, StyleRenderProps, useContextProps, useRenderProps, useSlot} from './utils';\nimport {filterDOMProps, mergeProps, useObjectRef} from '@react-aria/utils';\nimport {forwardRefType, HoverEvents, Key, LinkDOMProps} from '@react-types/shared';\nimport {LabelContext} from './Label';\nimport {ListState, Node, useListState} from 'react-stately';\nimport {ListStateContext} from './ListBox';\nimport React, {createContext, ForwardedRef, forwardRef, JSX, ReactNode, useContext, useEffect, useRef} from 'react';\nimport {TextContext} from './Text';\n\nexport interface TagGroupProps extends Omit<AriaTagGroupProps<unknown>, 'children' | 'items' | 'label' | 'description' | 'errorMessage' | 'keyboardDelegate'>, DOMProps, SlotProps {}\n\nexport interface TagListRenderProps {\n /**\n * Whether the tag list has no items and should display its empty state.\n * @selector [data-empty]\n */\n isEmpty: boolean,\n /**\n * Whether the tag list is currently focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the tag list is currently keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * State of the TagGroup.\n */\n state: ListState<unknown>\n}\n\nexport interface TagListProps<T> extends Omit<CollectionProps<T>, 'disabledKeys'>, StyleRenderProps<TagListRenderProps> {\n /** Provides content to display when there are no items in the tag list. */\n renderEmptyState?: (props: TagListRenderProps) => ReactNode\n}\n\nexport const TagGroupContext = createContext<ContextValue<TagGroupProps, HTMLDivElement>>(null);\nexport const TagListContext = createContext<ContextValue<TagListProps<any>, HTMLDivElement>>(null);\n\n/**\n * A tag group is a focusable list of labels, categories, keywords, filters, or other items, with support for keyboard navigation, selection, and removal.\n */\nexport const TagGroup = /*#__PURE__*/ (forwardRef as forwardRefType)(function TagGroup(props: TagGroupProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, TagGroupContext);\n return (\n <CollectionBuilder content={props.children}>\n {collection => <TagGroupInner props={props} forwardedRef={ref} collection={collection} />}\n </CollectionBuilder>\n );\n});\n\ninterface TagGroupInnerProps {\n props: TagGroupProps,\n forwardedRef: ForwardedRef<HTMLDivElement>,\n collection\n}\n\nfunction TagGroupInner({props, forwardedRef: ref, collection}: TagGroupInnerProps) {\n let tagListRef = useRef<HTMLDivElement>(null);\n let [labelRef, label] = useSlot(\n !props['aria-label'] && !props['aria-labelledby']\n );\n let state = useListState({\n ...props,\n children: undefined,\n collection\n });\n\n // Prevent DOM props from going to two places.\n let domProps = filterDOMProps(props);\n let domPropOverrides = Object.fromEntries(Object.entries(domProps).map(([k]) => [k, undefined]));\n let {\n gridProps,\n labelProps,\n descriptionProps,\n errorMessageProps\n } = useTagGroup({\n ...props,\n ...domPropOverrides,\n label\n }, state, tagListRef);\n\n return (\n <div\n {...domProps}\n ref={ref}\n slot={props.slot || undefined}\n className={props.className ?? 'react-aria-TagGroup'}\n style={props.style}>\n <Provider\n values={[\n [LabelContext, {...labelProps, elementType: 'span', ref: labelRef}],\n [TagListContext, {...gridProps, ref: tagListRef}],\n [ListStateContext, state],\n [TextContext, {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }]\n ]}>\n {props.children}\n </Provider>\n </div>\n );\n}\n\n/**\n * A tag list is a container for tags within a TagGroup.\n */\nexport const TagList = /*#__PURE__*/ (forwardRef as forwardRefType)(function TagList<T extends object>(props: TagListProps<T>, ref: ForwardedRef<HTMLDivElement>): JSX.Element {\n let state = useContext(ListStateContext);\n return state\n ? <TagListInner props={props} forwardedRef={ref} />\n : <Collection {...props} />;\n});\n\ninterface TagListInnerProps<T> {\n props: TagListProps<T>,\n forwardedRef: ForwardedRef<HTMLDivElement>\n}\n\nfunction TagListInner<T extends object>({props, forwardedRef}: TagListInnerProps<T>) {\n let state = useContext(ListStateContext)!;\n let {CollectionRoot} = useContext(CollectionRendererContext);\n let [gridProps, ref] = useContextProps(props, forwardedRef, TagListContext);\n delete gridProps.items;\n delete gridProps.renderEmptyState;\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n let renderValues = {\n isEmpty: state.collection.size === 0,\n isFocused,\n isFocusVisible,\n state\n };\n let renderProps = useRenderProps({\n className: props.className,\n style: props.style,\n defaultClassName: 'react-aria-TagList',\n values: renderValues\n });\n\n let persistedKeys = usePersistedKeys(state.selectionManager.focusedKey);\n\n return (\n <div\n {...mergeProps(gridProps, focusProps)}\n {...renderProps}\n ref={ref}\n data-empty={state.collection.size === 0 || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}>\n {state.collection.size === 0 && props.renderEmptyState\n ? props.renderEmptyState(renderValues)\n : <CollectionRoot collection={state.collection} persistedKeys={persistedKeys} />}\n </div>\n );\n}\n\nexport interface TagRenderProps extends Omit<ItemRenderProps, 'allowsDragging' | 'isDragging' | 'isDropTarget'> {\n /**\n * Whether the tag group allows items to be removed.\n * @selector [data-allows-removing]\n */\n allowsRemoving: boolean\n}\n\nexport interface TagProps extends RenderProps<TagRenderProps>, LinkDOMProps, HoverEvents {\n /** A unique id for the tag. */\n id?: Key,\n /**\n * A string representation of the tags's contents, used for accessibility.\n * Required if children is not a plain text string.\n */\n textValue?: string,\n /** Whether the tag is disabled. */\n isDisabled?: boolean\n}\n\n/**\n * A Tag is an individual item within a TagList.\n */\nexport const Tag = /*#__PURE__*/ createLeafComponent('item', (props: TagProps, forwardedRef: ForwardedRef<HTMLDivElement>, item: Node<unknown>) => {\n let state = useContext(ListStateContext)!;\n let ref = useObjectRef<HTMLDivElement>(forwardedRef);\n let {focusProps, isFocusVisible} = useFocusRing({within: true});\n let {rowProps, gridCellProps, removeButtonProps, ...states} = useTag({item}, state, ref);\n\n let {hoverProps, isHovered} = useHover({\n isDisabled: !states.allowsSelection,\n onHoverStart: item.props.onHoverStart,\n onHoverChange: item.props.onHoverChange,\n onHoverEnd: item.props.onHoverEnd\n });\n\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n children: item.rendered,\n defaultClassName: 'react-aria-Tag',\n values: {\n ...states,\n isFocusVisible,\n isHovered,\n selectionMode: state.selectionManager.selectionMode,\n selectionBehavior: state.selectionManager.selectionBehavior\n }\n });\n\n useEffect(() => {\n if (!item.textValue) {\n console.warn('A `textValue` prop is required for <Tag> elements with non-plain text children for accessibility.');\n }\n }, [item.textValue]);\n\n return (\n <div\n ref={ref}\n {...renderProps}\n {...mergeProps(filterDOMProps(props as any), rowProps, focusProps, hoverProps)}\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-allows-removing={states.allowsRemoving || undefined}\n data-selection-mode={state.selectionManager.selectionMode === 'none' ? undefined : state.selectionManager.selectionMode}>\n <div {...gridCellProps} style={{display: 'contents'}}>\n <Provider\n values={[\n [ButtonContext, {\n slots: {\n remove: removeButtonProps\n }\n }],\n [CollectionRendererContext, DefaultCollectionRenderer]\n ]}>\n {renderProps.children}\n </Provider>\n </div>\n </div>\n );\n});\n"],"names":[],"version":3,"file":"TagGroup.main.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;AA4CM,MAAM,0DAAkB,CAAA,GAAA,0BAAY,EAA+C;AACnF,MAAM,0DAAiB,CAAA,GAAA,0BAAY,EAAmD;AAKtF,MAAM,4CAAyB,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,SAAS,KAAoB,EAAE,GAAiC;IAC5I,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,qBACE,0DAAC,CAAA,GAAA,6CAAgB;QAAE,SAAS,MAAM,QAAQ;OACvC,CAAA,2BAAc,0DAAC;YAAc,OAAO;YAAO,cAAc;YAAK,YAAY;;AAGjF;AAQA,SAAS,oCAAc,SAAC,KAAK,EAAE,cAAc,GAAG,cAAE,UAAU,EAAqB;IAC/E,IAAI,aAAa,CAAA,GAAA,mBAAK,EAAkB;IACxC,IAAI,CAAC,UAAU,MAAM,G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AClC,wBAAsB,OAAO,cAAc,IAAI;QAC/C,uBAAqB,MAAM,gBAAgB,CAAC,aAAa,KAAK,SAAS,YAAY,MAAM,gBAAgB,CAAC,aAAa;qBACvH,0DAAC;QAAK,GAAG,aAAa;QAAE,OAAO;YAAC,SAAS;QAAU;qBACjD,0DAAC,CAAA,GAAA,kCAAO;QACN,QAAQ;YACN;gBAAC,CAAA,GAAA,uCAAY;gBAAG;oBACd,OAAO;wBACL,QAAQ;oBACV;gBACF;aAAE;YACF;gBAAC,CAAA,GAAA,mDAAwB;gBAAG,CAAA,GAAA,mDAAwB;aAAE;SACvD;OACA,YAAY,QAAQ;AAK/B","sources":["packages/react-aria-components/src/TagGroup.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 */\n\nimport {AriaTagGroupProps, useFocusRing, useHover, useTag, useTagGroup} from 'react-aria';\nimport {ButtonContext} from './Button';\nimport {Collection, CollectionBuilder, createLeafComponent} from '@react-aria/collections';\nimport {CollectionProps, CollectionRendererContext, DefaultCollectionRenderer, ItemRenderProps, usePersistedKeys} from './Collection';\nimport {ContextValue, DOMProps, Provider, RenderProps, SlotProps, StyleRenderProps, useContextProps, useRenderProps, useSlot} from './utils';\nimport {filterDOMProps, mergeProps, useObjectRef} from '@react-aria/utils';\nimport {forwardRefType, HoverEvents, Key, LinkDOMProps} from '@react-types/shared';\nimport {LabelContext} from './Label';\nimport {ListState, Node, useListState} from 'react-stately';\nimport {ListStateContext} from './ListBox';\nimport React, {createContext, ForwardedRef, forwardRef, JSX, ReactNode, useContext, useEffect, useRef} from 'react';\nimport {TextContext} from './Text';\n\nexport interface TagGroupProps extends Omit<AriaTagGroupProps<unknown>, 'children' | 'items' | 'label' | 'description' | 'errorMessage' | 'keyboardDelegate'>, DOMProps, SlotProps {}\n\nexport interface TagListRenderProps {\n /**\n * Whether the tag list has no items and should display its empty state.\n * @selector [data-empty]\n */\n isEmpty: boolean,\n /**\n * Whether the tag list is currently focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the tag list is currently keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * State of the TagGroup.\n */\n state: ListState<unknown>\n}\n\nexport interface TagListProps<T> extends Omit<CollectionProps<T>, 'disabledKeys'>, StyleRenderProps<TagListRenderProps> {\n /** Provides content to display when there are no items in the tag list. */\n renderEmptyState?: (props: TagListRenderProps) => ReactNode\n}\n\nexport const TagGroupContext = createContext<ContextValue<TagGroupProps, HTMLDivElement>>(null);\nexport const TagListContext = createContext<ContextValue<TagListProps<any>, HTMLDivElement>>(null);\n\n/**\n * A tag group is a focusable list of labels, categories, keywords, filters, or other items, with support for keyboard navigation, selection, and removal.\n */\nexport const TagGroup = /*#__PURE__*/ (forwardRef as forwardRefType)(function TagGroup(props: TagGroupProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, TagGroupContext);\n return (\n <CollectionBuilder content={props.children}>\n {collection => <TagGroupInner props={props} forwardedRef={ref} collection={collection} />}\n </CollectionBuilder>\n );\n});\n\ninterface TagGroupInnerProps {\n props: TagGroupProps,\n forwardedRef: ForwardedRef<HTMLDivElement>,\n collection\n}\n\nfunction TagGroupInner({props, forwardedRef: ref, collection}: TagGroupInnerProps) {\n let tagListRef = useRef<HTMLDivElement>(null);\n let [labelRef, label] = useSlot(\n !props['aria-label'] && !props['aria-labelledby']\n );\n let state = useListState({\n ...props,\n children: undefined,\n collection\n });\n\n // Prevent DOM props from going to two places.\n let domProps = filterDOMProps(props);\n let domPropOverrides = Object.fromEntries(Object.entries(domProps).map(([k]) => [k, undefined]));\n let {\n gridProps,\n labelProps,\n descriptionProps,\n errorMessageProps\n } = useTagGroup({\n ...props,\n ...domPropOverrides,\n label\n }, state, tagListRef);\n\n return (\n <div\n {...domProps}\n ref={ref}\n slot={props.slot || undefined}\n className={props.className ?? 'react-aria-TagGroup'}\n style={props.style}>\n <Provider\n values={[\n [LabelContext, {...labelProps, elementType: 'span', ref: labelRef}],\n [TagListContext, {...gridProps, ref: tagListRef}],\n [ListStateContext, state],\n [TextContext, {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }]\n ]}>\n {props.children}\n </Provider>\n </div>\n );\n}\n\n/**\n * A tag list is a container for tags within a TagGroup.\n */\nexport const TagList = /*#__PURE__*/ (forwardRef as forwardRefType)(function TagList<T extends object>(props: TagListProps<T>, ref: ForwardedRef<HTMLDivElement>): JSX.Element {\n let state = useContext(ListStateContext);\n return state\n ? <TagListInner props={props} forwardedRef={ref} />\n : <Collection {...props} />;\n});\n\ninterface TagListInnerProps<T> {\n props: TagListProps<T>,\n forwardedRef: ForwardedRef<HTMLDivElement>\n}\n\nfunction TagListInner<T extends object>({props, forwardedRef}: TagListInnerProps<T>) {\n let state = useContext(ListStateContext)!;\n let {CollectionRoot} = useContext(CollectionRendererContext);\n let [gridProps, ref] = useContextProps(props, forwardedRef, TagListContext);\n delete gridProps.items;\n delete gridProps.renderEmptyState;\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n let renderValues = {\n isEmpty: state.collection.size === 0,\n isFocused,\n isFocusVisible,\n state\n };\n let renderProps = useRenderProps({\n className: props.className,\n style: props.style,\n defaultClassName: 'react-aria-TagList',\n values: renderValues\n });\n\n let persistedKeys = usePersistedKeys(state.selectionManager.focusedKey);\n\n return (\n <div\n {...mergeProps(gridProps, focusProps)}\n {...renderProps}\n ref={ref}\n data-empty={state.collection.size === 0 || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}>\n {state.collection.size === 0 && props.renderEmptyState\n ? props.renderEmptyState(renderValues)\n : <CollectionRoot collection={state.collection} persistedKeys={persistedKeys} />}\n </div>\n );\n}\n\nexport interface TagRenderProps extends Omit<ItemRenderProps, 'allowsDragging' | 'isDragging' | 'isDropTarget'> {\n /**\n * Whether the tag group allows items to be removed.\n * @selector [data-allows-removing]\n */\n allowsRemoving: boolean\n}\n\nexport interface TagProps extends RenderProps<TagRenderProps>, LinkDOMProps, HoverEvents {\n /** A unique id for the tag. */\n id?: Key,\n /**\n * A string representation of the tags's contents, used for accessibility.\n * Required if children is not a plain text string.\n */\n textValue?: string,\n /** Whether the tag is disabled. */\n isDisabled?: boolean\n}\n\n/**\n * A Tag is an individual item within a TagList.\n */\nexport const Tag = /*#__PURE__*/ createLeafComponent('item', (props: TagProps, forwardedRef: ForwardedRef<HTMLDivElement>, item: Node<unknown>) => {\n let state = useContext(ListStateContext)!;\n let ref = useObjectRef<HTMLDivElement>(forwardedRef);\n let {focusProps, isFocusVisible} = useFocusRing({within: false});\n let {rowProps, gridCellProps, removeButtonProps, ...states} = useTag({item}, state, ref);\n\n let {hoverProps, isHovered} = useHover({\n isDisabled: !states.allowsSelection,\n onHoverStart: item.props.onHoverStart,\n onHoverChange: item.props.onHoverChange,\n onHoverEnd: item.props.onHoverEnd\n });\n\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n children: item.rendered,\n defaultClassName: 'react-aria-Tag',\n values: {\n ...states,\n isFocusVisible,\n isHovered,\n selectionMode: state.selectionManager.selectionMode,\n selectionBehavior: state.selectionManager.selectionBehavior\n }\n });\n\n useEffect(() => {\n if (!item.textValue && process.env.NODE_ENV !== 'production') {\n console.warn('A `textValue` prop is required for <Tag> elements with non-plain text children for accessibility.');\n }\n }, [item.textValue]);\n\n return (\n <div\n ref={ref}\n {...renderProps}\n {...mergeProps(filterDOMProps(props as any), rowProps, focusProps, hoverProps)}\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-allows-removing={states.allowsRemoving || undefined}\n data-selection-mode={state.selectionManager.selectionMode === 'none' ? undefined : state.selectionManager.selectionMode}>\n <div {...gridCellProps} style={{display: 'contents'}}>\n <Provider\n values={[\n [ButtonContext, {\n slots: {\n remove: removeButtonProps\n }\n }],\n [CollectionRendererContext, DefaultCollectionRenderer]\n ]}>\n {renderProps.children}\n </Provider>\n </div>\n </div>\n );\n});\n"],"names":[],"version":3,"file":"TagGroup.main.js.map"}
|
package/dist/TagGroup.mjs
CHANGED
|
@@ -145,7 +145,7 @@ const $eaf9e70818b436db$export$3288d34c523a1192 = /*#__PURE__*/ (0, $7lruP$creat
|
|
|
145
145
|
let state = (0, $7lruP$useContext)((0, $eed445e0843c11d0$export$7c5906fe4f1f2af2));
|
|
146
146
|
let ref = (0, $7lruP$useObjectRef)(forwardedRef);
|
|
147
147
|
let { focusProps: focusProps, isFocusVisible: isFocusVisible } = (0, $7lruP$useFocusRing)({
|
|
148
|
-
within:
|
|
148
|
+
within: false
|
|
149
149
|
});
|
|
150
150
|
let { rowProps: rowProps, gridCellProps: gridCellProps, removeButtonProps: removeButtonProps, ...states } = (0, $7lruP$useTag)({
|
|
151
151
|
item: item
|
|
@@ -170,7 +170,7 @@ const $eaf9e70818b436db$export$3288d34c523a1192 = /*#__PURE__*/ (0, $7lruP$creat
|
|
|
170
170
|
}
|
|
171
171
|
});
|
|
172
172
|
(0, $7lruP$useEffect)(()=>{
|
|
173
|
-
if (!item.textValue) console.warn('A `textValue` prop is required for <Tag> elements with non-plain text children for accessibility.');
|
|
173
|
+
if (!item.textValue && process.env.NODE_ENV !== 'production') console.warn('A `textValue` prop is required for <Tag> elements with non-plain text children for accessibility.');
|
|
174
174
|
}, [
|
|
175
175
|
item.textValue
|
|
176
176
|
]);
|
package/dist/TagGroup.module.js
CHANGED
|
@@ -145,7 +145,7 @@ const $eaf9e70818b436db$export$3288d34c523a1192 = /*#__PURE__*/ (0, $7lruP$creat
|
|
|
145
145
|
let state = (0, $7lruP$useContext)((0, $eed445e0843c11d0$export$7c5906fe4f1f2af2));
|
|
146
146
|
let ref = (0, $7lruP$useObjectRef)(forwardedRef);
|
|
147
147
|
let { focusProps: focusProps, isFocusVisible: isFocusVisible } = (0, $7lruP$useFocusRing)({
|
|
148
|
-
within:
|
|
148
|
+
within: false
|
|
149
149
|
});
|
|
150
150
|
let { rowProps: rowProps, gridCellProps: gridCellProps, removeButtonProps: removeButtonProps, ...states } = (0, $7lruP$useTag)({
|
|
151
151
|
item: item
|
|
@@ -170,7 +170,7 @@ const $eaf9e70818b436db$export$3288d34c523a1192 = /*#__PURE__*/ (0, $7lruP$creat
|
|
|
170
170
|
}
|
|
171
171
|
});
|
|
172
172
|
(0, $7lruP$useEffect)(()=>{
|
|
173
|
-
if (!item.textValue) console.warn('A `textValue` prop is required for <Tag> elements with non-plain text children for accessibility.');
|
|
173
|
+
if (!item.textValue && process.env.NODE_ENV !== 'production') console.warn('A `textValue` prop is required for <Tag> elements with non-plain text children for accessibility.');
|
|
174
174
|
}, [
|
|
175
175
|
item.textValue
|
|
176
176
|
]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;AA4CM,MAAM,0DAAkB,CAAA,GAAA,oBAAY,EAA+C;AACnF,MAAM,0DAAiB,CAAA,GAAA,oBAAY,EAAmD;AAKtF,MAAM,4CAAyB,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,SAAS,KAAoB,EAAE,GAAiC;IAC5I,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,qBACE,gCAAC,CAAA,GAAA,wBAAgB;QAAE,SAAS,MAAM,QAAQ;OACvC,CAAA,2BAAc,gCAAC;YAAc,OAAO;YAAO,cAAc;YAAK,YAAY;;AAGjF;AAQA,S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,aAAa;QAC3B,gBAAc,OAAO,SAAS,IAAI;QAClC,sBAAoB,kBAAkB;QACtC,gBAAc,OAAO,SAAS,IAAI;QAClC,wBAAsB,OAAO,cAAc,IAAI;QAC/C,uBAAqB,MAAM,gBAAgB,CAAC,aAAa,KAAK,SAAS,YAAY,MAAM,gBAAgB,CAAC,aAAa;qBACvH,gCAAC;QAAK,GAAG,aAAa;QAAE,OAAO;YAAC,SAAS;QAAU;qBACjD,gCAAC,CAAA,GAAA,yCAAO;QACN,QAAQ;YACN;gBAAC,CAAA,GAAA,yCAAY;gBAAG;oBACd,OAAO;wBACL,QAAQ;oBACV;gBACF;aAAE;YACF;gBAAC,CAAA,GAAA,yCAAwB;gBAAG,CAAA,GAAA,yCAAwB;aAAE;SACvD;OACA,YAAY,QAAQ;AAK/B","sources":["packages/react-aria-components/src/TagGroup.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 */\n\nimport {AriaTagGroupProps, useFocusRing, useHover, useTag, useTagGroup} from 'react-aria';\nimport {ButtonContext} from './Button';\nimport {Collection, CollectionBuilder, createLeafComponent} from '@react-aria/collections';\nimport {CollectionProps, CollectionRendererContext, DefaultCollectionRenderer, ItemRenderProps, usePersistedKeys} from './Collection';\nimport {ContextValue, DOMProps, Provider, RenderProps, SlotProps, StyleRenderProps, useContextProps, useRenderProps, useSlot} from './utils';\nimport {filterDOMProps, mergeProps, useObjectRef} from '@react-aria/utils';\nimport {forwardRefType, HoverEvents, Key, LinkDOMProps} from '@react-types/shared';\nimport {LabelContext} from './Label';\nimport {ListState, Node, useListState} from 'react-stately';\nimport {ListStateContext} from './ListBox';\nimport React, {createContext, ForwardedRef, forwardRef, JSX, ReactNode, useContext, useEffect, useRef} from 'react';\nimport {TextContext} from './Text';\n\nexport interface TagGroupProps extends Omit<AriaTagGroupProps<unknown>, 'children' | 'items' | 'label' | 'description' | 'errorMessage' | 'keyboardDelegate'>, DOMProps, SlotProps {}\n\nexport interface TagListRenderProps {\n /**\n * Whether the tag list has no items and should display its empty state.\n * @selector [data-empty]\n */\n isEmpty: boolean,\n /**\n * Whether the tag list is currently focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the tag list is currently keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * State of the TagGroup.\n */\n state: ListState<unknown>\n}\n\nexport interface TagListProps<T> extends Omit<CollectionProps<T>, 'disabledKeys'>, StyleRenderProps<TagListRenderProps> {\n /** Provides content to display when there are no items in the tag list. */\n renderEmptyState?: (props: TagListRenderProps) => ReactNode\n}\n\nexport const TagGroupContext = createContext<ContextValue<TagGroupProps, HTMLDivElement>>(null);\nexport const TagListContext = createContext<ContextValue<TagListProps<any>, HTMLDivElement>>(null);\n\n/**\n * A tag group is a focusable list of labels, categories, keywords, filters, or other items, with support for keyboard navigation, selection, and removal.\n */\nexport const TagGroup = /*#__PURE__*/ (forwardRef as forwardRefType)(function TagGroup(props: TagGroupProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, TagGroupContext);\n return (\n <CollectionBuilder content={props.children}>\n {collection => <TagGroupInner props={props} forwardedRef={ref} collection={collection} />}\n </CollectionBuilder>\n );\n});\n\ninterface TagGroupInnerProps {\n props: TagGroupProps,\n forwardedRef: ForwardedRef<HTMLDivElement>,\n collection\n}\n\nfunction TagGroupInner({props, forwardedRef: ref, collection}: TagGroupInnerProps) {\n let tagListRef = useRef<HTMLDivElement>(null);\n let [labelRef, label] = useSlot(\n !props['aria-label'] && !props['aria-labelledby']\n );\n let state = useListState({\n ...props,\n children: undefined,\n collection\n });\n\n // Prevent DOM props from going to two places.\n let domProps = filterDOMProps(props);\n let domPropOverrides = Object.fromEntries(Object.entries(domProps).map(([k]) => [k, undefined]));\n let {\n gridProps,\n labelProps,\n descriptionProps,\n errorMessageProps\n } = useTagGroup({\n ...props,\n ...domPropOverrides,\n label\n }, state, tagListRef);\n\n return (\n <div\n {...domProps}\n ref={ref}\n slot={props.slot || undefined}\n className={props.className ?? 'react-aria-TagGroup'}\n style={props.style}>\n <Provider\n values={[\n [LabelContext, {...labelProps, elementType: 'span', ref: labelRef}],\n [TagListContext, {...gridProps, ref: tagListRef}],\n [ListStateContext, state],\n [TextContext, {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }]\n ]}>\n {props.children}\n </Provider>\n </div>\n );\n}\n\n/**\n * A tag list is a container for tags within a TagGroup.\n */\nexport const TagList = /*#__PURE__*/ (forwardRef as forwardRefType)(function TagList<T extends object>(props: TagListProps<T>, ref: ForwardedRef<HTMLDivElement>): JSX.Element {\n let state = useContext(ListStateContext);\n return state\n ? <TagListInner props={props} forwardedRef={ref} />\n : <Collection {...props} />;\n});\n\ninterface TagListInnerProps<T> {\n props: TagListProps<T>,\n forwardedRef: ForwardedRef<HTMLDivElement>\n}\n\nfunction TagListInner<T extends object>({props, forwardedRef}: TagListInnerProps<T>) {\n let state = useContext(ListStateContext)!;\n let {CollectionRoot} = useContext(CollectionRendererContext);\n let [gridProps, ref] = useContextProps(props, forwardedRef, TagListContext);\n delete gridProps.items;\n delete gridProps.renderEmptyState;\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n let renderValues = {\n isEmpty: state.collection.size === 0,\n isFocused,\n isFocusVisible,\n state\n };\n let renderProps = useRenderProps({\n className: props.className,\n style: props.style,\n defaultClassName: 'react-aria-TagList',\n values: renderValues\n });\n\n let persistedKeys = usePersistedKeys(state.selectionManager.focusedKey);\n\n return (\n <div\n {...mergeProps(gridProps, focusProps)}\n {...renderProps}\n ref={ref}\n data-empty={state.collection.size === 0 || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}>\n {state.collection.size === 0 && props.renderEmptyState\n ? props.renderEmptyState(renderValues)\n : <CollectionRoot collection={state.collection} persistedKeys={persistedKeys} />}\n </div>\n );\n}\n\nexport interface TagRenderProps extends Omit<ItemRenderProps, 'allowsDragging' | 'isDragging' | 'isDropTarget'> {\n /**\n * Whether the tag group allows items to be removed.\n * @selector [data-allows-removing]\n */\n allowsRemoving: boolean\n}\n\nexport interface TagProps extends RenderProps<TagRenderProps>, LinkDOMProps, HoverEvents {\n /** A unique id for the tag. */\n id?: Key,\n /**\n * A string representation of the tags's contents, used for accessibility.\n * Required if children is not a plain text string.\n */\n textValue?: string,\n /** Whether the tag is disabled. */\n isDisabled?: boolean\n}\n\n/**\n * A Tag is an individual item within a TagList.\n */\nexport const Tag = /*#__PURE__*/ createLeafComponent('item', (props: TagProps, forwardedRef: ForwardedRef<HTMLDivElement>, item: Node<unknown>) => {\n let state = useContext(ListStateContext)!;\n let ref = useObjectRef<HTMLDivElement>(forwardedRef);\n let {focusProps, isFocusVisible} = useFocusRing({within: true});\n let {rowProps, gridCellProps, removeButtonProps, ...states} = useTag({item}, state, ref);\n\n let {hoverProps, isHovered} = useHover({\n isDisabled: !states.allowsSelection,\n onHoverStart: item.props.onHoverStart,\n onHoverChange: item.props.onHoverChange,\n onHoverEnd: item.props.onHoverEnd\n });\n\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n children: item.rendered,\n defaultClassName: 'react-aria-Tag',\n values: {\n ...states,\n isFocusVisible,\n isHovered,\n selectionMode: state.selectionManager.selectionMode,\n selectionBehavior: state.selectionManager.selectionBehavior\n }\n });\n\n useEffect(() => {\n if (!item.textValue) {\n console.warn('A `textValue` prop is required for <Tag> elements with non-plain text children for accessibility.');\n }\n }, [item.textValue]);\n\n return (\n <div\n ref={ref}\n {...renderProps}\n {...mergeProps(filterDOMProps(props as any), rowProps, focusProps, hoverProps)}\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-allows-removing={states.allowsRemoving || undefined}\n data-selection-mode={state.selectionManager.selectionMode === 'none' ? undefined : state.selectionManager.selectionMode}>\n <div {...gridCellProps} style={{display: 'contents'}}>\n <Provider\n values={[\n [ButtonContext, {\n slots: {\n remove: removeButtonProps\n }\n }],\n [CollectionRendererContext, DefaultCollectionRenderer]\n ]}>\n {renderProps.children}\n </Provider>\n </div>\n </div>\n );\n});\n"],"names":[],"version":3,"file":"TagGroup.module.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;AA4CM,MAAM,0DAAkB,CAAA,GAAA,oBAAY,EAA+C;AACnF,MAAM,0DAAiB,CAAA,GAAA,oBAAY,EAAmD;AAKtF,MAAM,4CAAyB,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,SAAS,KAAoB,EAAE,GAAiC;IAC5I,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,qBACE,gCAAC,CAAA,GAAA,wBAAgB;QAAE,SAAS,MAAM,QAAQ;OACvC,CAAA,2BAAc,gCAAC;YAAc,OAAO;YAAO,cAAc;YAAK,YAAY;;AAGjF;AAQA,SAAS,oCAAc,SAAC,KAAK,EAAE,cAAc,GAAG,cAAE,UAAU,EAAqB;IAC/E,IAAI,aAAa,CAAA,GAAA,aAAK,EAAkB;IACxC,IAAI,CAAC,UAAU,MAAM,GAAG,CAAA,GAAA,yCAAM,EAC5B,CAAC,KAAK,CAAC,aAAa,IAAI,CAAC,KAAK,CAAC,kBAAkB;IAEnD,IAAI,QAAQ,CAAA,GAAA,mBAAW,EAAE;QACvB,GAAG,KAAK;QACR,UAAU;oBACV;IACF;IAEA,8CAA8C;IA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C,CAAA,GAAA,yCAAO;QACN,QAAQ;YACN;gBAAC,CAAA,GAAA,yCAAY;gBAAG;oBACd,OAAO;wBACL,QAAQ;oBACV;gBACF;aAAE;YACF;gBAAC,CAAA,GAAA,yCAAwB;gBAAG,CAAA,GAAA,yCAAwB;aAAE;SACvD;OACA,YAAY,QAAQ;AAK/B","sources":["packages/react-aria-components/src/TagGroup.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 */\n\nimport {AriaTagGroupProps, useFocusRing, useHover, useTag, useTagGroup} from 'react-aria';\nimport {ButtonContext} from './Button';\nimport {Collection, CollectionBuilder, createLeafComponent} from '@react-aria/collections';\nimport {CollectionProps, CollectionRendererContext, DefaultCollectionRenderer, ItemRenderProps, usePersistedKeys} from './Collection';\nimport {ContextValue, DOMProps, Provider, RenderProps, SlotProps, StyleRenderProps, useContextProps, useRenderProps, useSlot} from './utils';\nimport {filterDOMProps, mergeProps, useObjectRef} from '@react-aria/utils';\nimport {forwardRefType, HoverEvents, Key, LinkDOMProps} from '@react-types/shared';\nimport {LabelContext} from './Label';\nimport {ListState, Node, useListState} from 'react-stately';\nimport {ListStateContext} from './ListBox';\nimport React, {createContext, ForwardedRef, forwardRef, JSX, ReactNode, useContext, useEffect, useRef} from 'react';\nimport {TextContext} from './Text';\n\nexport interface TagGroupProps extends Omit<AriaTagGroupProps<unknown>, 'children' | 'items' | 'label' | 'description' | 'errorMessage' | 'keyboardDelegate'>, DOMProps, SlotProps {}\n\nexport interface TagListRenderProps {\n /**\n * Whether the tag list has no items and should display its empty state.\n * @selector [data-empty]\n */\n isEmpty: boolean,\n /**\n * Whether the tag list is currently focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the tag list is currently keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * State of the TagGroup.\n */\n state: ListState<unknown>\n}\n\nexport interface TagListProps<T> extends Omit<CollectionProps<T>, 'disabledKeys'>, StyleRenderProps<TagListRenderProps> {\n /** Provides content to display when there are no items in the tag list. */\n renderEmptyState?: (props: TagListRenderProps) => ReactNode\n}\n\nexport const TagGroupContext = createContext<ContextValue<TagGroupProps, HTMLDivElement>>(null);\nexport const TagListContext = createContext<ContextValue<TagListProps<any>, HTMLDivElement>>(null);\n\n/**\n * A tag group is a focusable list of labels, categories, keywords, filters, or other items, with support for keyboard navigation, selection, and removal.\n */\nexport const TagGroup = /*#__PURE__*/ (forwardRef as forwardRefType)(function TagGroup(props: TagGroupProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, TagGroupContext);\n return (\n <CollectionBuilder content={props.children}>\n {collection => <TagGroupInner props={props} forwardedRef={ref} collection={collection} />}\n </CollectionBuilder>\n );\n});\n\ninterface TagGroupInnerProps {\n props: TagGroupProps,\n forwardedRef: ForwardedRef<HTMLDivElement>,\n collection\n}\n\nfunction TagGroupInner({props, forwardedRef: ref, collection}: TagGroupInnerProps) {\n let tagListRef = useRef<HTMLDivElement>(null);\n let [labelRef, label] = useSlot(\n !props['aria-label'] && !props['aria-labelledby']\n );\n let state = useListState({\n ...props,\n children: undefined,\n collection\n });\n\n // Prevent DOM props from going to two places.\n let domProps = filterDOMProps(props);\n let domPropOverrides = Object.fromEntries(Object.entries(domProps).map(([k]) => [k, undefined]));\n let {\n gridProps,\n labelProps,\n descriptionProps,\n errorMessageProps\n } = useTagGroup({\n ...props,\n ...domPropOverrides,\n label\n }, state, tagListRef);\n\n return (\n <div\n {...domProps}\n ref={ref}\n slot={props.slot || undefined}\n className={props.className ?? 'react-aria-TagGroup'}\n style={props.style}>\n <Provider\n values={[\n [LabelContext, {...labelProps, elementType: 'span', ref: labelRef}],\n [TagListContext, {...gridProps, ref: tagListRef}],\n [ListStateContext, state],\n [TextContext, {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }]\n ]}>\n {props.children}\n </Provider>\n </div>\n );\n}\n\n/**\n * A tag list is a container for tags within a TagGroup.\n */\nexport const TagList = /*#__PURE__*/ (forwardRef as forwardRefType)(function TagList<T extends object>(props: TagListProps<T>, ref: ForwardedRef<HTMLDivElement>): JSX.Element {\n let state = useContext(ListStateContext);\n return state\n ? <TagListInner props={props} forwardedRef={ref} />\n : <Collection {...props} />;\n});\n\ninterface TagListInnerProps<T> {\n props: TagListProps<T>,\n forwardedRef: ForwardedRef<HTMLDivElement>\n}\n\nfunction TagListInner<T extends object>({props, forwardedRef}: TagListInnerProps<T>) {\n let state = useContext(ListStateContext)!;\n let {CollectionRoot} = useContext(CollectionRendererContext);\n let [gridProps, ref] = useContextProps(props, forwardedRef, TagListContext);\n delete gridProps.items;\n delete gridProps.renderEmptyState;\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n let renderValues = {\n isEmpty: state.collection.size === 0,\n isFocused,\n isFocusVisible,\n state\n };\n let renderProps = useRenderProps({\n className: props.className,\n style: props.style,\n defaultClassName: 'react-aria-TagList',\n values: renderValues\n });\n\n let persistedKeys = usePersistedKeys(state.selectionManager.focusedKey);\n\n return (\n <div\n {...mergeProps(gridProps, focusProps)}\n {...renderProps}\n ref={ref}\n data-empty={state.collection.size === 0 || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}>\n {state.collection.size === 0 && props.renderEmptyState\n ? props.renderEmptyState(renderValues)\n : <CollectionRoot collection={state.collection} persistedKeys={persistedKeys} />}\n </div>\n );\n}\n\nexport interface TagRenderProps extends Omit<ItemRenderProps, 'allowsDragging' | 'isDragging' | 'isDropTarget'> {\n /**\n * Whether the tag group allows items to be removed.\n * @selector [data-allows-removing]\n */\n allowsRemoving: boolean\n}\n\nexport interface TagProps extends RenderProps<TagRenderProps>, LinkDOMProps, HoverEvents {\n /** A unique id for the tag. */\n id?: Key,\n /**\n * A string representation of the tags's contents, used for accessibility.\n * Required if children is not a plain text string.\n */\n textValue?: string,\n /** Whether the tag is disabled. */\n isDisabled?: boolean\n}\n\n/**\n * A Tag is an individual item within a TagList.\n */\nexport const Tag = /*#__PURE__*/ createLeafComponent('item', (props: TagProps, forwardedRef: ForwardedRef<HTMLDivElement>, item: Node<unknown>) => {\n let state = useContext(ListStateContext)!;\n let ref = useObjectRef<HTMLDivElement>(forwardedRef);\n let {focusProps, isFocusVisible} = useFocusRing({within: false});\n let {rowProps, gridCellProps, removeButtonProps, ...states} = useTag({item}, state, ref);\n\n let {hoverProps, isHovered} = useHover({\n isDisabled: !states.allowsSelection,\n onHoverStart: item.props.onHoverStart,\n onHoverChange: item.props.onHoverChange,\n onHoverEnd: item.props.onHoverEnd\n });\n\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n children: item.rendered,\n defaultClassName: 'react-aria-Tag',\n values: {\n ...states,\n isFocusVisible,\n isHovered,\n selectionMode: state.selectionManager.selectionMode,\n selectionBehavior: state.selectionManager.selectionBehavior\n }\n });\n\n useEffect(() => {\n if (!item.textValue && process.env.NODE_ENV !== 'production') {\n console.warn('A `textValue` prop is required for <Tag> elements with non-plain text children for accessibility.');\n }\n }, [item.textValue]);\n\n return (\n <div\n ref={ref}\n {...renderProps}\n {...mergeProps(filterDOMProps(props as any), rowProps, focusProps, hoverProps)}\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-allows-removing={states.allowsRemoving || undefined}\n data-selection-mode={state.selectionManager.selectionMode === 'none' ? undefined : state.selectionManager.selectionMode}>\n <div {...gridCellProps} style={{display: 'contents'}}>\n <Provider\n values={[\n [ButtonContext, {\n slots: {\n remove: removeButtonProps\n }\n }],\n [CollectionRendererContext, DefaultCollectionRenderer]\n ]}>\n {renderProps.children}\n </Provider>\n </div>\n </div>\n );\n});\n"],"names":[],"version":3,"file":"TagGroup.module.js.map"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;AAOO,MAAM,0DAAkB,CAAA,GAAA,0BAAY,EAAoD,CAAC;AAEhG,IAAI,yCAAmB,CAAC;IACtB,6DAA6D;IAC7D,IAAI,gBAAC,YAAY,iBAAE,aAAa,cAAE,UAAU,EAAE,GAAG,YAAW,GAAG;IAC/D,OAAO;AACT;AAKO,MAAM,0DAAW,CAAA,GAAA,uBAAS,EAAE,SAAS,SAAS,KAAoB,EAAE,GAAsC;IAC/G,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAE3C,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,yBAAO,EAAE;IACvC,IAAI,aAAC,SAAS,kBAAE,cAAc,cAAE,UAAU,EAAC,GAAG,CAAA,GAAA,6BAAW,EAAE;QACzD,aAAa;QACb,WAAW,MAAM,SAAS;IAC5B;IAEA,IAAI,YAAY,CAAC,CAAC,KAAK,CAAC,eAAe,IAAI,KAAK,CAAC,eAAe,KAAK;IACrE,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,QAAQ;uBACN;uBACA;4BACA;YACA,YAAY,MAAM,QAAQ,IAAI;uBAC9B;QACF;QACA,kBAAkB;IACpB;IAEA,qBACE,0DAAC;QACE,GAAG,CAAA,GAAA,2BAAS,EAAE,uCAAiB,QAAQ,YAAY,WAAW;QAC9D,GAAG,WAAW;QACf,KAAK;QACL,gBAAc,aAAa;QAC3B,iBAAe,MAAM,QAAQ,IAAI;QACjC,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;QACtC,gBAAc,aAAa;;AAEjC","sources":["packages/react-aria-components/src/TextArea.tsx"],"sourcesContent":["import {ContextValue, StyleRenderProps, useContextProps, useRenderProps} from './utils';\nimport {HoverEvents, mergeProps, useFocusRing, useHover} from 'react-aria';\nimport {InputRenderProps} from './Input';\nimport React, {createContext, ForwardedRef, forwardRef, TextareaHTMLAttributes} from 'react';\n\nexport interface TextAreaProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'className' | 'style'>, HoverEvents, StyleRenderProps<InputRenderProps> {}\n\nexport const TextAreaContext = createContext<ContextValue<TextAreaProps, HTMLTextAreaElement>>({});\n\nlet filterHoverProps = (props: TextAreaProps) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n let {onHoverStart, onHoverChange, onHoverEnd, ...otherProps} = props;\n return otherProps;\n};\n\n/**\n * A textarea allows a user to input mult-line text.\n */\nexport const TextArea = forwardRef(function TextArea(props: TextAreaProps, ref: ForwardedRef<HTMLTextAreaElement>) {\n [props, ref] = useContextProps(props, ref, TextAreaContext);\n\n let {hoverProps, isHovered} = useHover(props);\n let {isFocused, isFocusVisible, focusProps} = useFocusRing({\n isTextInput: true,\n autoFocus: props.autoFocus\n });\n\n let isInvalid = !!props['aria-invalid'] && props['aria-invalid'] !== 'false';\n let renderProps = useRenderProps({\n ...props,\n values: {\n isHovered,\n isFocused,\n isFocusVisible,\n isDisabled: props.disabled || false,\n isInvalid\n },\n defaultClassName: 'react-aria-TextArea'\n });\n\n return (\n <textarea\n {...mergeProps(filterHoverProps(props), focusProps, hoverProps)}\n {...renderProps}\n ref={ref}\n data-focused={isFocused || undefined}\n data-disabled={props.disabled || undefined}\n data-hovered={isHovered || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-invalid={isInvalid || undefined} />\n );\n});\n"],"names":[],"version":3,"file":"TextArea.main.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;AAOO,MAAM,0DAAkB,CAAA,GAAA,0BAAY,EAAoD,CAAC;AAEhG,IAAI,yCAAmB,CAAC;IACtB,6DAA6D;IAC7D,IAAI,gBAAC,YAAY,iBAAE,aAAa,cAAE,UAAU,EAAE,GAAG,YAAW,GAAG;IAC/D,OAAO;AACT;AAKO,MAAM,0DAAW,CAAA,GAAA,uBAAS,EAAE,SAAS,SAAS,KAAoB,EAAE,GAAsC;IAC/G,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAE3C,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,yBAAO,EAAE;IACvC,IAAI,aAAC,SAAS,kBAAE,cAAc,cAAE,UAAU,EAAC,GAAG,CAAA,GAAA,6BAAW,EAAE;QACzD,aAAa;QACb,WAAW,MAAM,SAAS;IAC5B;IAEA,IAAI,YAAY,CAAC,CAAC,KAAK,CAAC,eAAe,IAAI,KAAK,CAAC,eAAe,KAAK;IACrE,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,QAAQ;uBACN;uBACA;4BACA;YACA,YAAY,MAAM,QAAQ,IAAI;uBAC9B;QACF;QACA,kBAAkB;IACpB;IAEA,qBACE,0DAAC;QACE,GAAG,CAAA,GAAA,2BAAS,EAAE,uCAAiB,QAAQ,YAAY,WAAW;QAC9D,GAAG,WAAW;QACf,KAAK;QACL,gBAAc,aAAa;QAC3B,iBAAe,MAAM,QAAQ,IAAI;QACjC,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;QACtC,gBAAc,aAAa;;AAEjC","sources":["packages/react-aria-components/src/TextArea.tsx"],"sourcesContent":["import {ContextValue, StyleRenderProps, useContextProps, useRenderProps} from './utils';\nimport {HoverEvents, mergeProps, useFocusRing, useHover} from 'react-aria';\nimport {InputRenderProps} from './Input';\nimport React, {createContext, ForwardedRef, forwardRef, TextareaHTMLAttributes} from 'react';\n\nexport interface TextAreaProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'className' | 'style'>, HoverEvents, StyleRenderProps<InputRenderProps> {}\n\nexport const TextAreaContext = createContext<ContextValue<TextAreaProps, HTMLTextAreaElement>>({});\n\nlet filterHoverProps = (props: TextAreaProps): TextAreaProps => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n let {onHoverStart, onHoverChange, onHoverEnd, ...otherProps} = props;\n return otherProps;\n};\n\n/**\n * A textarea allows a user to input mult-line text.\n */\nexport const TextArea = forwardRef(function TextArea(props: TextAreaProps, ref: ForwardedRef<HTMLTextAreaElement>) {\n [props, ref] = useContextProps(props, ref, TextAreaContext);\n\n let {hoverProps, isHovered} = useHover(props);\n let {isFocused, isFocusVisible, focusProps} = useFocusRing({\n isTextInput: true,\n autoFocus: props.autoFocus\n });\n\n let isInvalid = !!props['aria-invalid'] && props['aria-invalid'] !== 'false';\n let renderProps = useRenderProps({\n ...props,\n values: {\n isHovered,\n isFocused,\n isFocusVisible,\n isDisabled: props.disabled || false,\n isInvalid\n },\n defaultClassName: 'react-aria-TextArea'\n });\n\n return (\n <textarea\n {...mergeProps(filterHoverProps(props), focusProps, hoverProps)}\n {...renderProps}\n ref={ref}\n data-focused={isFocused || undefined}\n data-disabled={props.disabled || undefined}\n data-hovered={isHovered || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-invalid={isInvalid || undefined} />\n );\n});\n"],"names":[],"version":3,"file":"TextArea.main.js.map"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;AAOO,MAAM,0DAAkB,CAAA,GAAA,oBAAY,EAAoD,CAAC;AAEhG,IAAI,yCAAmB,CAAC;IACtB,6DAA6D;IAC7D,IAAI,gBAAC,YAAY,iBAAE,aAAa,cAAE,UAAU,EAAE,GAAG,YAAW,GAAG;IAC/D,OAAO;AACT;AAKO,MAAM,0DAAW,CAAA,GAAA,iBAAS,EAAE,SAAS,SAAS,KAAoB,EAAE,GAAsC;IAC/G,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAE3C,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,eAAO,EAAE;IACvC,IAAI,aAAC,SAAS,kBAAE,cAAc,cAAE,UAAU,EAAC,GAAG,CAAA,GAAA,mBAAW,EAAE;QACzD,aAAa;QACb,WAAW,MAAM,SAAS;IAC5B;IAEA,IAAI,YAAY,CAAC,CAAC,KAAK,CAAC,eAAe,IAAI,KAAK,CAAC,eAAe,KAAK;IACrE,IAAI,cAAc,CAAA,GAAA,uCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,QAAQ;uBACN;uBACA;4BACA;YACA,YAAY,MAAM,QAAQ,IAAI;uBAC9B;QACF;QACA,kBAAkB;IACpB;IAEA,qBACE,gCAAC;QACE,GAAG,CAAA,GAAA,iBAAS,EAAE,uCAAiB,QAAQ,YAAY,WAAW;QAC9D,GAAG,WAAW;QACf,KAAK;QACL,gBAAc,aAAa;QAC3B,iBAAe,MAAM,QAAQ,IAAI;QACjC,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;QACtC,gBAAc,aAAa;;AAEjC","sources":["packages/react-aria-components/src/TextArea.tsx"],"sourcesContent":["import {ContextValue, StyleRenderProps, useContextProps, useRenderProps} from './utils';\nimport {HoverEvents, mergeProps, useFocusRing, useHover} from 'react-aria';\nimport {InputRenderProps} from './Input';\nimport React, {createContext, ForwardedRef, forwardRef, TextareaHTMLAttributes} from 'react';\n\nexport interface TextAreaProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'className' | 'style'>, HoverEvents, StyleRenderProps<InputRenderProps> {}\n\nexport const TextAreaContext = createContext<ContextValue<TextAreaProps, HTMLTextAreaElement>>({});\n\nlet filterHoverProps = (props: TextAreaProps) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n let {onHoverStart, onHoverChange, onHoverEnd, ...otherProps} = props;\n return otherProps;\n};\n\n/**\n * A textarea allows a user to input mult-line text.\n */\nexport const TextArea = forwardRef(function TextArea(props: TextAreaProps, ref: ForwardedRef<HTMLTextAreaElement>) {\n [props, ref] = useContextProps(props, ref, TextAreaContext);\n\n let {hoverProps, isHovered} = useHover(props);\n let {isFocused, isFocusVisible, focusProps} = useFocusRing({\n isTextInput: true,\n autoFocus: props.autoFocus\n });\n\n let isInvalid = !!props['aria-invalid'] && props['aria-invalid'] !== 'false';\n let renderProps = useRenderProps({\n ...props,\n values: {\n isHovered,\n isFocused,\n isFocusVisible,\n isDisabled: props.disabled || false,\n isInvalid\n },\n defaultClassName: 'react-aria-TextArea'\n });\n\n return (\n <textarea\n {...mergeProps(filterHoverProps(props), focusProps, hoverProps)}\n {...renderProps}\n ref={ref}\n data-focused={isFocused || undefined}\n data-disabled={props.disabled || undefined}\n data-hovered={isHovered || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-invalid={isInvalid || undefined} />\n );\n});\n"],"names":[],"version":3,"file":"TextArea.module.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;AAOO,MAAM,0DAAkB,CAAA,GAAA,oBAAY,EAAoD,CAAC;AAEhG,IAAI,yCAAmB,CAAC;IACtB,6DAA6D;IAC7D,IAAI,gBAAC,YAAY,iBAAE,aAAa,cAAE,UAAU,EAAE,GAAG,YAAW,GAAG;IAC/D,OAAO;AACT;AAKO,MAAM,0DAAW,CAAA,GAAA,iBAAS,EAAE,SAAS,SAAS,KAAoB,EAAE,GAAsC;IAC/G,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAE3C,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,eAAO,EAAE;IACvC,IAAI,aAAC,SAAS,kBAAE,cAAc,cAAE,UAAU,EAAC,GAAG,CAAA,GAAA,mBAAW,EAAE;QACzD,aAAa;QACb,WAAW,MAAM,SAAS;IAC5B;IAEA,IAAI,YAAY,CAAC,CAAC,KAAK,CAAC,eAAe,IAAI,KAAK,CAAC,eAAe,KAAK;IACrE,IAAI,cAAc,CAAA,GAAA,uCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,QAAQ;uBACN;uBACA;4BACA;YACA,YAAY,MAAM,QAAQ,IAAI;uBAC9B;QACF;QACA,kBAAkB;IACpB;IAEA,qBACE,gCAAC;QACE,GAAG,CAAA,GAAA,iBAAS,EAAE,uCAAiB,QAAQ,YAAY,WAAW;QAC9D,GAAG,WAAW;QACf,KAAK;QACL,gBAAc,aAAa;QAC3B,iBAAe,MAAM,QAAQ,IAAI;QACjC,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;QACtC,gBAAc,aAAa;;AAEjC","sources":["packages/react-aria-components/src/TextArea.tsx"],"sourcesContent":["import {ContextValue, StyleRenderProps, useContextProps, useRenderProps} from './utils';\nimport {HoverEvents, mergeProps, useFocusRing, useHover} from 'react-aria';\nimport {InputRenderProps} from './Input';\nimport React, {createContext, ForwardedRef, forwardRef, TextareaHTMLAttributes} from 'react';\n\nexport interface TextAreaProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'className' | 'style'>, HoverEvents, StyleRenderProps<InputRenderProps> {}\n\nexport const TextAreaContext = createContext<ContextValue<TextAreaProps, HTMLTextAreaElement>>({});\n\nlet filterHoverProps = (props: TextAreaProps): TextAreaProps => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n let {onHoverStart, onHoverChange, onHoverEnd, ...otherProps} = props;\n return otherProps;\n};\n\n/**\n * A textarea allows a user to input mult-line text.\n */\nexport const TextArea = forwardRef(function TextArea(props: TextAreaProps, ref: ForwardedRef<HTMLTextAreaElement>) {\n [props, ref] = useContextProps(props, ref, TextAreaContext);\n\n let {hoverProps, isHovered} = useHover(props);\n let {isFocused, isFocusVisible, focusProps} = useFocusRing({\n isTextInput: true,\n autoFocus: props.autoFocus\n });\n\n let isInvalid = !!props['aria-invalid'] && props['aria-invalid'] !== 'false';\n let renderProps = useRenderProps({\n ...props,\n values: {\n isHovered,\n isFocused,\n isFocusVisible,\n isDisabled: props.disabled || false,\n isInvalid\n },\n defaultClassName: 'react-aria-TextArea'\n });\n\n return (\n <textarea\n {...mergeProps(filterHoverProps(props), focusProps, hoverProps)}\n {...renderProps}\n ref={ref}\n data-focused={isFocused || undefined}\n data-disabled={props.disabled || undefined}\n data-hovered={isHovered || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-invalid={isInvalid || undefined} />\n );\n});\n"],"names":[],"version":3,"file":"TextArea.module.js.map"}
|
package/dist/Toast.main.js
CHANGED
|
@@ -5,7 +5,9 @@ var $coXVq$reactaria = require("react-aria");
|
|
|
5
5
|
var $coXVq$reactdom = require("react-dom");
|
|
6
6
|
var $coXVq$reactstately = require("react-stately");
|
|
7
7
|
var $coXVq$react = require("react");
|
|
8
|
+
var $coXVq$reactariassr = require("@react-aria/ssr");
|
|
8
9
|
var $coXVq$reactariautils = require("@react-aria/utils");
|
|
10
|
+
var $coXVq$reactariaoverlays = require("@react-aria/overlays");
|
|
9
11
|
|
|
10
12
|
|
|
11
13
|
function $parcel$interopDefault(a) {
|
|
@@ -16,7 +18,9 @@ function $parcel$export(e, n, v, s) {
|
|
|
16
18
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
17
19
|
}
|
|
18
20
|
|
|
21
|
+
$parcel$export(module.exports, "ToastStateContext", () => $4e3fafb90a1b5a5f$export$e9e2a1fc7373c1e1);
|
|
19
22
|
$parcel$export(module.exports, "ToastRegion", () => $4e3fafb90a1b5a5f$export$2cbf5519fbeaa538);
|
|
23
|
+
$parcel$export(module.exports, "ToastList", () => $4e3fafb90a1b5a5f$export$c20d626a86a69756);
|
|
20
24
|
$parcel$export(module.exports, "Toast", () => $4e3fafb90a1b5a5f$export$8d8dc7d5f743331b);
|
|
21
25
|
$parcel$export(module.exports, "ToastContent", () => $4e3fafb90a1b5a5f$export$b134a6cc89b08851);
|
|
22
26
|
/*
|
|
@@ -37,46 +41,71 @@ $parcel$export(module.exports, "ToastContent", () => $4e3fafb90a1b5a5f$export$b1
|
|
|
37
41
|
|
|
38
42
|
|
|
39
43
|
|
|
40
|
-
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
const $4e3fafb90a1b5a5f$export$e9e2a1fc7373c1e1 = /*#__PURE__*/ (0, $coXVq$react.createContext)(null);
|
|
41
47
|
const $4e3fafb90a1b5a5f$export$2cbf5519fbeaa538 = /*#__PURE__*/ (0, $coXVq$react.forwardRef)(function ToastRegion(props, ref) {
|
|
48
|
+
let isSSR = (0, $coXVq$reactariassr.useIsSSR)();
|
|
42
49
|
let state = (0, $coXVq$reactstately.useToastQueue)(props.queue);
|
|
43
50
|
let objectRef = (0, $coXVq$reactariautils.useObjectRef)(ref);
|
|
44
51
|
let { regionProps: regionProps } = (0, $coXVq$reactaria.useToastRegion)(props, state, objectRef);
|
|
45
52
|
let { focusProps: focusProps, isFocused: isFocused, isFocusVisible: isFocusVisible } = (0, $coXVq$reactaria.useFocusRing)();
|
|
53
|
+
let { hoverProps: hoverProps, isHovered: isHovered } = (0, $coXVq$reactaria.useHover)({});
|
|
46
54
|
let renderProps = (0, $c5ccf687772c0422$exports.useRenderProps)({
|
|
47
55
|
...props,
|
|
48
56
|
children: undefined,
|
|
49
57
|
defaultClassName: 'react-aria-ToastRegion',
|
|
50
58
|
values: {
|
|
51
59
|
visibleToasts: state.visibleToasts,
|
|
60
|
+
isHovered: isHovered,
|
|
52
61
|
isFocused: isFocused,
|
|
53
62
|
isFocusVisible: isFocusVisible
|
|
54
63
|
}
|
|
55
64
|
});
|
|
56
|
-
let
|
|
65
|
+
let { direction: direction } = (0, $coXVq$reactaria.useLocale)();
|
|
66
|
+
let portalContainer;
|
|
67
|
+
let { getContainer: getContainer } = (0, $coXVq$reactariaoverlays.useUNSAFE_PortalContext)();
|
|
68
|
+
if (!isSSR) {
|
|
69
|
+
portalContainer = document.body;
|
|
70
|
+
if (getContainer) portalContainer = getContainer();
|
|
71
|
+
}
|
|
72
|
+
let region = /*#__PURE__*/ (0, ($parcel$interopDefault($coXVq$react))).createElement($4e3fafb90a1b5a5f$export$e9e2a1fc7373c1e1.Provider, {
|
|
57
73
|
value: state
|
|
58
74
|
}, /*#__PURE__*/ (0, ($parcel$interopDefault($coXVq$react))).createElement("div", {
|
|
59
75
|
...renderProps,
|
|
60
|
-
...(0, $coXVq$reactaria.mergeProps)(regionProps, focusProps),
|
|
76
|
+
...(0, $coXVq$reactaria.mergeProps)(regionProps, focusProps, hoverProps),
|
|
77
|
+
dir: direction,
|
|
61
78
|
ref: objectRef,
|
|
79
|
+
"data-hovered": isHovered || undefined,
|
|
62
80
|
"data-focused": isFocused || undefined,
|
|
63
81
|
"data-focus-visible": isFocusVisible || undefined
|
|
64
|
-
}, typeof props.children === 'function' ? /*#__PURE__*/ (0, ($parcel$interopDefault($coXVq$react))).createElement($4e3fafb90a1b5a5f$
|
|
82
|
+
}, typeof props.children === 'function' ? /*#__PURE__*/ (0, ($parcel$interopDefault($coXVq$react))).createElement($4e3fafb90a1b5a5f$export$c20d626a86a69756, {
|
|
65
83
|
...props,
|
|
84
|
+
className: undefined,
|
|
66
85
|
style: {
|
|
67
86
|
display: 'contents'
|
|
68
87
|
}
|
|
69
|
-
}) : props.children));
|
|
70
|
-
return state.visibleToasts.length > 0 &&
|
|
88
|
+
}, props.children) : props.children));
|
|
89
|
+
return state.visibleToasts.length > 0 && portalContainer ? /*#__PURE__*/ (0, $coXVq$reactdom.createPortal)(region, portalContainer) : null;
|
|
71
90
|
});
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
let
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
91
|
+
const $4e3fafb90a1b5a5f$export$c20d626a86a69756 = /*#__PURE__*/ (0, $coXVq$react.forwardRef)(function ToastList(props, ref) {
|
|
92
|
+
let state = (0, $coXVq$react.useContext)($4e3fafb90a1b5a5f$export$e9e2a1fc7373c1e1);
|
|
93
|
+
let { hoverProps: hoverProps, isHovered: isHovered } = (0, $coXVq$reactaria.useHover)({});
|
|
94
|
+
let renderProps = (0, $c5ccf687772c0422$exports.useRenderProps)({
|
|
95
|
+
...props,
|
|
96
|
+
children: undefined,
|
|
97
|
+
defaultClassName: 'react-aria-ToastList',
|
|
98
|
+
values: {
|
|
99
|
+
visibleToasts: state.visibleToasts,
|
|
100
|
+
isFocused: false,
|
|
101
|
+
isFocusVisible: false,
|
|
102
|
+
isHovered: isHovered
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($coXVq$react))).createElement("ol", {
|
|
106
|
+
...hoverProps,
|
|
107
|
+
...renderProps,
|
|
108
|
+
ref: ref
|
|
80
109
|
}, state.visibleToasts.map((toast)=>/*#__PURE__*/ (0, ($parcel$interopDefault($coXVq$react))).createElement("li", {
|
|
81
110
|
key: toast.key,
|
|
82
111
|
style: {
|
|
@@ -84,10 +113,10 @@ const $4e3fafb90a1b5a5f$var$ToastList = /*#__PURE__*/ (0, $coXVq$react.forwardRe
|
|
|
84
113
|
}
|
|
85
114
|
}, props.children({
|
|
86
115
|
toast: toast
|
|
87
|
-
}))))
|
|
116
|
+
}))));
|
|
88
117
|
});
|
|
89
118
|
const $4e3fafb90a1b5a5f$export$8d8dc7d5f743331b = /*#__PURE__*/ (0, $coXVq$react.forwardRef)(function Toast(props, ref) {
|
|
90
|
-
let state = (0, $coXVq$react.useContext)($4e3fafb90a1b5a5f$
|
|
119
|
+
let state = (0, $coXVq$react.useContext)($4e3fafb90a1b5a5f$export$e9e2a1fc7373c1e1);
|
|
91
120
|
let objectRef = (0, $coXVq$reactariautils.useObjectRef)(ref);
|
|
92
121
|
let { toastProps: toastProps, contentProps: contentProps, titleProps: titleProps, descriptionProps: descriptionProps, closeButtonProps: closeButtonProps } = (0, $coXVq$reactaria.useToast)(props, state, objectRef);
|
|
93
122
|
let { focusProps: focusProps, isFocused: isFocused, isFocusVisible: isFocusVisible } = (0, $coXVq$reactaria.useFocusRing)();
|
package/dist/Toast.main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;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QAAQ;AAI7B;AAEO,MAAM,0DAAsB,CAAA,GAAA,0BAAY,EAA6D,CAAC;AAKtG,MAAM,4CAAe,WAAW,GAAG,CAAA,GAAA,uBAAS,EAAE,SAAS,aAAa,KAAkC,EAAE,GAAiC;IAC9I,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,qBACE,0DAAC;QAAI,WAAU;QAA2B,GAAG,KAAK;QAAE,KAAK;OACtD,MAAM,QAAQ;AAGrB","sources":["packages/react-aria-components/src/Toast.tsx"],"sourcesContent":["/*\n * Copyright 2025 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 {AriaToastProps, AriaToastRegionProps, mergeProps, useFocusRing, useToast, useToastRegion} from 'react-aria';\nimport {ButtonContext} from './Button';\nimport {ContextValue, DEFAULT_SLOT, Provider, RenderProps, StyleRenderProps, useContextProps, useRenderProps} from './utils';\nimport {createPortal} from 'react-dom';\nimport {forwardRefType} from '@react-types/shared';\nimport {QueuedToast, ToastQueue, ToastState, useToastQueue} from 'react-stately';\nimport React, {createContext, ForwardedRef, forwardRef, HTMLAttributes, JSX, ReactElement, useContext} from 'react';\nimport {TextContext} from './Text';\nimport {useObjectRef} from '@react-aria/utils';\n\nconst ToastStateContext = createContext<ToastState<any> | null>(null);\n\nexport interface ToastRegionRenderProps<T> {\n /** A list of all currently visible toasts. */\n visibleToasts: QueuedToast<T>[],\n /**\n * Whether the toast region is currently focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the toast region is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean\n}\n\nexport interface ToastRegionProps<T> extends AriaToastRegionProps, StyleRenderProps<ToastRegionRenderProps<T>> {\n /** The queue of toasts to display. */\n queue: ToastQueue<T>,\n /** A function to render each toast. */\n children: (renderProps: {toast: QueuedToast<T>}) => ReactElement\n}\n\n/**\n * A ToastRegion displays one or more toast notifications.\n */\nexport const ToastRegion = /*#__PURE__*/ (forwardRef as forwardRefType)(function ToastRegion<T>(props: ToastRegionProps<T>, ref: ForwardedRef<HTMLDivElement>): JSX.Element | null {\n let state = useToastQueue(props.queue);\n let objectRef = useObjectRef(ref);\n let {regionProps} = useToastRegion(props, state, objectRef);\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n let renderProps = useRenderProps({\n ...props,\n children: undefined,\n defaultClassName: 'react-aria-ToastRegion',\n values: {\n visibleToasts: state.visibleToasts,\n isFocused,\n isFocusVisible\n }\n });\n\n let region = (\n <ToastStateContext.Provider value={state}>\n <div\n {...renderProps}\n {...mergeProps(regionProps, focusProps)}\n ref={objectRef}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}>\n {typeof props.children === 'function' ? <ToastList {...props} style={{display: 'contents'}} /> : props.children}\n </div>\n </ToastStateContext.Provider>\n );\n\n return state.visibleToasts.length > 0 && typeof document !== 'undefined'\n ? createPortal(region, document.body)\n : null;\n});\n\n// TODO: possibly export this so additional children can be added to the region, outside the list.\nconst ToastList = /*#__PURE__*/ (forwardRef as forwardRefType)(function ToastList<T>(props: ToastRegionProps<T>, ref: ForwardedRef<HTMLOListElement>) {\n let state = useContext(ToastStateContext)!;\n return (\n // @ts-ignore\n <ol ref={ref} style={props.style} className={props.className}>\n {state.visibleToasts.map((toast) => (\n <li key={toast.key} style={{display: 'contents'}}>\n {props.children({toast})}\n </li>\n ))}\n </ol>\n );\n});\n\nexport interface ToastRenderProps<T> {\n /**\n * The toast object to display.\n */\n toast: QueuedToast<T>,\n /**\n * Whether the toast is currently focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the toast is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean\n}\n\nexport interface ToastProps<T> extends AriaToastProps<T>, RenderProps<ToastRenderProps<T>> {}\n\n/**\n * A Toast displays a brief, temporary notification of actions, errors, or other events in an application.\n */\nexport const Toast = /*#__PURE__*/ (forwardRef as forwardRefType)(function Toast<T>(props: ToastProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n let state = useContext(ToastStateContext)!;\n let objectRef = useObjectRef(ref);\n let {toastProps, contentProps, titleProps, descriptionProps, closeButtonProps} = useToast(\n props,\n state,\n objectRef\n );\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-Toast',\n values: {\n toast: props.toast,\n isFocused,\n isFocusVisible\n }\n });\n\n return (\n <div\n {...renderProps}\n {...mergeProps(toastProps, focusProps)}\n ref={objectRef}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}>\n <Provider\n values={[\n [ToastContentContext, contentProps],\n [TextContext, {\n slots: {\n [DEFAULT_SLOT]: {},\n title: titleProps,\n description: descriptionProps\n }\n }],\n [ButtonContext, {\n slots: {\n [DEFAULT_SLOT]: {},\n close: closeButtonProps\n }\n }]\n ]}>\n {renderProps.children}\n </Provider>\n </div>\n );\n});\n\nexport const ToastContentContext = createContext<ContextValue<HTMLAttributes<HTMLElement>, HTMLDivElement>>({});\n\n/**\n * ToastContent wraps the main content of a toast notification.\n */\nexport const ToastContent = /*#__PURE__*/ forwardRef(function ToastContent(props: HTMLAttributes<HTMLElement>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, ToastContentContext);\n return (\n <div className=\"react-aria-ToastContent\" {...props} ref={ref}>\n {props.children}\n </div>\n );\n});\n"],"names":[],"version":3,"file":"Toast.main.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;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AO,MAAM,KAAK;uBAClB;4BACA;QACF;IACF;IAEA,qBACE,0DAAC;QACE,GAAG,WAAW;QACd,GAAG,CAAA,GAAA,2BAAS,EAAE,YAAY,WAAW;QACtC,KAAK;QACL,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;qBACtC,0DAAC,CAAA,GAAA,kCAAO;QACN,QAAQ;YACN;gBAAC;gBAAqB;aAAa;YACnC;gBAAC,CAAA,GAAA,qCAAU;gBAAG;oBACZ,OAAO;wBACL,CAAC,CAAA,GAAA,sCAAW,EAAE,EAAE,CAAC;wBACjB,OAAO;wBACP,aAAa;oBACf;gBACF;aAAE;YACF;gBAAC,CAAA,GAAA,uCAAY;gBAAG;oBACd,OAAO;wBACL,CAAC,CAAA,GAAA,sCAAW,EAAE,EAAE,CAAC;wBACjB,OAAO;oBACT;gBACF;aAAE;SACH;OACA,YAAY,QAAQ;AAI7B;AAEO,MAAM,0DAAsB,CAAA,GAAA,0BAAY,EAA6D,CAAC;AAKtG,MAAM,4CAAe,WAAW,GAAG,CAAA,GAAA,uBAAS,EAAE,SAAS,aAAa,KAAkC,EAAE,GAAiC;IAC9I,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,qBACE,0DAAC;QAAI,WAAU;QAA2B,GAAG,KAAK;QAAE,KAAK;OACtD,MAAM,QAAQ;AAGrB","sources":["packages/react-aria-components/src/Toast.tsx"],"sourcesContent":["/*\n * Copyright 2025 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 {AriaToastProps, AriaToastRegionProps, mergeProps, useFocusRing, useHover, useLocale, useToast, useToastRegion} from 'react-aria';\nimport {ButtonContext} from './Button';\nimport {ContextValue, DEFAULT_SLOT, Provider, RenderProps, StyleRenderProps, useContextProps, useRenderProps} from './utils';\nimport {createPortal} from 'react-dom';\nimport {forwardRefType} from '@react-types/shared';\nimport {QueuedToast, ToastQueue, ToastState, useToastQueue} from 'react-stately';\nimport React, {createContext, ForwardedRef, forwardRef, HTMLAttributes, JSX, ReactElement, ReactNode, useContext} from 'react';\nimport {TextContext} from './Text';\nimport {useIsSSR} from '@react-aria/ssr';\nimport {useObjectRef} from '@react-aria/utils';\nimport {useUNSAFE_PortalContext} from '@react-aria/overlays';\n\nexport const ToastStateContext = createContext<ToastState<any> | null>(null);\n\nexport interface ToastRegionRenderProps<T> {\n /** A list of all currently visible toasts. */\n visibleToasts: QueuedToast<T>[],\n /**\n * Whether the toast region is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the toast region is currently focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the toast region is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean\n}\n\nexport interface ToastRegionProps<T> extends AriaToastRegionProps, StyleRenderProps<ToastRegionRenderProps<T>> {\n /** The queue of toasts to display. */\n queue: ToastQueue<T>,\n /** A function to render each toast, or children containing a `<ToastList>`. */\n children: ReactNode | ((renderProps: {toast: QueuedToast<T>}) => ReactElement)\n}\n\n/**\n * A ToastRegion displays one or more toast notifications.\n */\nexport const ToastRegion = /*#__PURE__*/ (forwardRef as forwardRefType)(function ToastRegion<T>(props: ToastRegionProps<T>, ref: ForwardedRef<HTMLDivElement>): JSX.Element | null {\n let isSSR = useIsSSR();\n let state = useToastQueue(props.queue);\n let objectRef = useObjectRef(ref);\n let {regionProps} = useToastRegion(props, state, objectRef);\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n let {hoverProps, isHovered} = useHover({});\n let renderProps = useRenderProps({\n ...props,\n children: undefined,\n defaultClassName: 'react-aria-ToastRegion',\n values: {\n visibleToasts: state.visibleToasts,\n isHovered,\n isFocused,\n isFocusVisible\n }\n });\n\n let {direction} = useLocale();\n let portalContainer;\n let {getContainer} = useUNSAFE_PortalContext();\n if (!isSSR) {\n portalContainer = document.body;\n if (getContainer) {\n portalContainer = getContainer();\n }\n }\n\n let region = (\n <ToastStateContext.Provider value={state}>\n <div\n {...renderProps}\n {...mergeProps(regionProps, focusProps, hoverProps)}\n dir={direction}\n ref={objectRef}\n data-hovered={isHovered || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}>\n {typeof props.children === 'function' ? <ToastList {...props} className={undefined} style={{display: 'contents'}}>{props.children}</ToastList> : props.children}\n </div>\n </ToastStateContext.Provider>\n );\n\n return state.visibleToasts.length > 0 && portalContainer\n ? createPortal(region, portalContainer)\n : null;\n});\n\nexport interface ToastListProps<T> extends Omit<ToastRegionProps<T>, 'queue' | 'children'> {\n /** A function to render each toast. */\n children: (renderProps: {toast: QueuedToast<T>}) => ReactElement\n}\n\nexport const ToastList = /*#__PURE__*/ (forwardRef as forwardRefType)(function ToastList<T>(props: ToastListProps<T>, ref: ForwardedRef<HTMLOListElement>) {\n let state = useContext(ToastStateContext)!;\n let {hoverProps, isHovered} = useHover({});\n let renderProps = useRenderProps({\n ...props,\n children: undefined,\n defaultClassName: 'react-aria-ToastList',\n values: {\n visibleToasts: state.visibleToasts,\n isFocused: false,\n isFocusVisible: false,\n isHovered\n }\n });\n\n return (\n <ol {...hoverProps} {...renderProps} ref={ref}>\n {state.visibleToasts.map((toast) => (\n <li key={toast.key} style={{display: 'contents'}}>\n {props.children({toast})}\n </li>\n ))}\n </ol>\n );\n});\n\nexport interface ToastRenderProps<T> {\n /**\n * The toast object to display.\n */\n toast: QueuedToast<T>,\n /**\n * Whether the toast is currently focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the toast is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean\n}\n\nexport interface ToastProps<T> extends AriaToastProps<T>, RenderProps<ToastRenderProps<T>> {}\n\n/**\n * A Toast displays a brief, temporary notification of actions, errors, or other events in an application.\n */\nexport const Toast = /*#__PURE__*/ (forwardRef as forwardRefType)(function Toast<T>(props: ToastProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n let state = useContext(ToastStateContext)!;\n let objectRef = useObjectRef(ref);\n let {toastProps, contentProps, titleProps, descriptionProps, closeButtonProps} = useToast(\n props,\n state,\n objectRef\n );\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-Toast',\n values: {\n toast: props.toast,\n isFocused,\n isFocusVisible\n }\n });\n\n return (\n <div\n {...renderProps}\n {...mergeProps(toastProps, focusProps)}\n ref={objectRef}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}>\n <Provider\n values={[\n [ToastContentContext, contentProps],\n [TextContext, {\n slots: {\n [DEFAULT_SLOT]: {},\n title: titleProps,\n description: descriptionProps\n }\n }],\n [ButtonContext, {\n slots: {\n [DEFAULT_SLOT]: {},\n close: closeButtonProps\n }\n }]\n ]}>\n {renderProps.children}\n </Provider>\n </div>\n );\n});\n\nexport const ToastContentContext = createContext<ContextValue<HTMLAttributes<HTMLElement>, HTMLDivElement>>({});\n\n/**\n * ToastContent wraps the main content of a toast notification.\n */\nexport const ToastContent = /*#__PURE__*/ forwardRef(function ToastContent(props: HTMLAttributes<HTMLElement>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, ToastContentContext);\n return (\n <div className=\"react-aria-ToastContent\" {...props} ref={ref}>\n {props.children}\n </div>\n );\n});\n"],"names":[],"version":3,"file":"Toast.main.js.map"}
|
package/dist/Toast.mjs
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import {ButtonContext as $d2b4bc8c273e7be6$export$24d547caef80ccd1} from "./Button.mjs";
|
|
2
2
|
import {DEFAULT_SLOT as $64fa3d84918910a7$export$c62b8e45d58ddad9, Provider as $64fa3d84918910a7$export$2881499e37b75b9a, useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3} from "./utils.mjs";
|
|
3
3
|
import {TextContext as $514c0188e459b4c0$export$9afb8bc826b033ea} from "./Text.mjs";
|
|
4
|
-
import {useToastRegion as $9il6O$useToastRegion, useFocusRing as $9il6O$useFocusRing, mergeProps as $9il6O$mergeProps, useToast as $9il6O$useToast} from "react-aria";
|
|
4
|
+
import {useToastRegion as $9il6O$useToastRegion, useFocusRing as $9il6O$useFocusRing, useHover as $9il6O$useHover, useLocale as $9il6O$useLocale, mergeProps as $9il6O$mergeProps, useToast as $9il6O$useToast} from "react-aria";
|
|
5
5
|
import {createPortal as $9il6O$createPortal} from "react-dom";
|
|
6
6
|
import {useToastQueue as $9il6O$useToastQueue} from "react-stately";
|
|
7
7
|
import $9il6O$react, {createContext as $9il6O$createContext, forwardRef as $9il6O$forwardRef, useContext as $9il6O$useContext} from "react";
|
|
8
|
+
import {useIsSSR as $9il6O$useIsSSR} from "@react-aria/ssr";
|
|
8
9
|
import {useObjectRef as $9il6O$useObjectRef} from "@react-aria/utils";
|
|
10
|
+
import {useUNSAFE_PortalContext as $9il6O$useUNSAFE_PortalContext} from "@react-aria/overlays";
|
|
9
11
|
|
|
10
12
|
/*
|
|
11
13
|
* Copyright 2025 Adobe. All rights reserved.
|
|
@@ -25,46 +27,71 @@ import {useObjectRef as $9il6O$useObjectRef} from "@react-aria/utils";
|
|
|
25
27
|
|
|
26
28
|
|
|
27
29
|
|
|
28
|
-
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
const $692df8403b6ac2c7$export$e9e2a1fc7373c1e1 = /*#__PURE__*/ (0, $9il6O$createContext)(null);
|
|
29
33
|
const $692df8403b6ac2c7$export$2cbf5519fbeaa538 = /*#__PURE__*/ (0, $9il6O$forwardRef)(function ToastRegion(props, ref) {
|
|
34
|
+
let isSSR = (0, $9il6O$useIsSSR)();
|
|
30
35
|
let state = (0, $9il6O$useToastQueue)(props.queue);
|
|
31
36
|
let objectRef = (0, $9il6O$useObjectRef)(ref);
|
|
32
37
|
let { regionProps: regionProps } = (0, $9il6O$useToastRegion)(props, state, objectRef);
|
|
33
38
|
let { focusProps: focusProps, isFocused: isFocused, isFocusVisible: isFocusVisible } = (0, $9il6O$useFocusRing)();
|
|
39
|
+
let { hoverProps: hoverProps, isHovered: isHovered } = (0, $9il6O$useHover)({});
|
|
34
40
|
let renderProps = (0, $64fa3d84918910a7$export$4d86445c2cf5e3)({
|
|
35
41
|
...props,
|
|
36
42
|
children: undefined,
|
|
37
43
|
defaultClassName: 'react-aria-ToastRegion',
|
|
38
44
|
values: {
|
|
39
45
|
visibleToasts: state.visibleToasts,
|
|
46
|
+
isHovered: isHovered,
|
|
40
47
|
isFocused: isFocused,
|
|
41
48
|
isFocusVisible: isFocusVisible
|
|
42
49
|
}
|
|
43
50
|
});
|
|
44
|
-
let
|
|
51
|
+
let { direction: direction } = (0, $9il6O$useLocale)();
|
|
52
|
+
let portalContainer;
|
|
53
|
+
let { getContainer: getContainer } = (0, $9il6O$useUNSAFE_PortalContext)();
|
|
54
|
+
if (!isSSR) {
|
|
55
|
+
portalContainer = document.body;
|
|
56
|
+
if (getContainer) portalContainer = getContainer();
|
|
57
|
+
}
|
|
58
|
+
let region = /*#__PURE__*/ (0, $9il6O$react).createElement($692df8403b6ac2c7$export$e9e2a1fc7373c1e1.Provider, {
|
|
45
59
|
value: state
|
|
46
60
|
}, /*#__PURE__*/ (0, $9il6O$react).createElement("div", {
|
|
47
61
|
...renderProps,
|
|
48
|
-
...(0, $9il6O$mergeProps)(regionProps, focusProps),
|
|
62
|
+
...(0, $9il6O$mergeProps)(regionProps, focusProps, hoverProps),
|
|
63
|
+
dir: direction,
|
|
49
64
|
ref: objectRef,
|
|
65
|
+
"data-hovered": isHovered || undefined,
|
|
50
66
|
"data-focused": isFocused || undefined,
|
|
51
67
|
"data-focus-visible": isFocusVisible || undefined
|
|
52
|
-
}, typeof props.children === 'function' ? /*#__PURE__*/ (0, $9il6O$react).createElement($692df8403b6ac2c7$
|
|
68
|
+
}, typeof props.children === 'function' ? /*#__PURE__*/ (0, $9il6O$react).createElement($692df8403b6ac2c7$export$c20d626a86a69756, {
|
|
53
69
|
...props,
|
|
70
|
+
className: undefined,
|
|
54
71
|
style: {
|
|
55
72
|
display: 'contents'
|
|
56
73
|
}
|
|
57
|
-
}) : props.children));
|
|
58
|
-
return state.visibleToasts.length > 0 &&
|
|
74
|
+
}, props.children) : props.children));
|
|
75
|
+
return state.visibleToasts.length > 0 && portalContainer ? /*#__PURE__*/ (0, $9il6O$createPortal)(region, portalContainer) : null;
|
|
59
76
|
});
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
let
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
77
|
+
const $692df8403b6ac2c7$export$c20d626a86a69756 = /*#__PURE__*/ (0, $9il6O$forwardRef)(function ToastList(props, ref) {
|
|
78
|
+
let state = (0, $9il6O$useContext)($692df8403b6ac2c7$export$e9e2a1fc7373c1e1);
|
|
79
|
+
let { hoverProps: hoverProps, isHovered: isHovered } = (0, $9il6O$useHover)({});
|
|
80
|
+
let renderProps = (0, $64fa3d84918910a7$export$4d86445c2cf5e3)({
|
|
81
|
+
...props,
|
|
82
|
+
children: undefined,
|
|
83
|
+
defaultClassName: 'react-aria-ToastList',
|
|
84
|
+
values: {
|
|
85
|
+
visibleToasts: state.visibleToasts,
|
|
86
|
+
isFocused: false,
|
|
87
|
+
isFocusVisible: false,
|
|
88
|
+
isHovered: isHovered
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
return /*#__PURE__*/ (0, $9il6O$react).createElement("ol", {
|
|
92
|
+
...hoverProps,
|
|
93
|
+
...renderProps,
|
|
94
|
+
ref: ref
|
|
68
95
|
}, state.visibleToasts.map((toast)=>/*#__PURE__*/ (0, $9il6O$react).createElement("li", {
|
|
69
96
|
key: toast.key,
|
|
70
97
|
style: {
|
|
@@ -72,10 +99,10 @@ const $692df8403b6ac2c7$var$ToastList = /*#__PURE__*/ (0, $9il6O$forwardRef)(fun
|
|
|
72
99
|
}
|
|
73
100
|
}, props.children({
|
|
74
101
|
toast: toast
|
|
75
|
-
}))))
|
|
102
|
+
}))));
|
|
76
103
|
});
|
|
77
104
|
const $692df8403b6ac2c7$export$8d8dc7d5f743331b = /*#__PURE__*/ (0, $9il6O$forwardRef)(function Toast(props, ref) {
|
|
78
|
-
let state = (0, $9il6O$useContext)($692df8403b6ac2c7$
|
|
105
|
+
let state = (0, $9il6O$useContext)($692df8403b6ac2c7$export$e9e2a1fc7373c1e1);
|
|
79
106
|
let objectRef = (0, $9il6O$useObjectRef)(ref);
|
|
80
107
|
let { toastProps: toastProps, contentProps: contentProps, titleProps: titleProps, descriptionProps: descriptionProps, closeButtonProps: closeButtonProps } = (0, $9il6O$useToast)(props, state, objectRef);
|
|
81
108
|
let { focusProps: focusProps, isFocused: isFocused, isFocusVisible: isFocusVisible } = (0, $9il6O$useFocusRing)();
|
|
@@ -133,5 +160,5 @@ const $692df8403b6ac2c7$export$b134a6cc89b08851 = /*#__PURE__*/ (0, $9il6O$forwa
|
|
|
133
160
|
});
|
|
134
161
|
|
|
135
162
|
|
|
136
|
-
export {$692df8403b6ac2c7$export$2cbf5519fbeaa538 as ToastRegion, $692df8403b6ac2c7$export$8d8dc7d5f743331b as Toast, $692df8403b6ac2c7$export$3a0d85872d9f73f2 as ToastContentContext, $692df8403b6ac2c7$export$b134a6cc89b08851 as ToastContent};
|
|
163
|
+
export {$692df8403b6ac2c7$export$e9e2a1fc7373c1e1 as ToastStateContext, $692df8403b6ac2c7$export$2cbf5519fbeaa538 as ToastRegion, $692df8403b6ac2c7$export$c20d626a86a69756 as ToastList, $692df8403b6ac2c7$export$8d8dc7d5f743331b as Toast, $692df8403b6ac2c7$export$3a0d85872d9f73f2 as ToastContentContext, $692df8403b6ac2c7$export$b134a6cc89b08851 as ToastContent};
|
|
137
164
|
//# sourceMappingURL=Toast.module.js.map
|