@servicetitan/anvil2 2.6.1 → 2.7.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/CHANGELOG.md +22 -0
- package/dist/{Calendar-B5d2SUrH.js → Calendar-C1U2npPP.js} +2 -2
- package/dist/{Calendar-B5d2SUrH.js.map → Calendar-C1U2npPP.js.map} +1 -1
- package/dist/{Calendar-B0u3EgCY.js → Calendar-SGlTt-bs.js} +2 -2
- package/dist/{Calendar-B0u3EgCY.js.map → Calendar-SGlTt-bs.js.map} +1 -1
- package/dist/Calendar.js +2 -2
- package/dist/{Checkbox-CIj37_vY.js → Checkbox-CjEKa5Iv.js} +2 -2
- package/dist/{Checkbox-CIj37_vY.js.map → Checkbox-CjEKa5Iv.js.map} +1 -1
- package/dist/{Checkbox-BwULIo4D.js → Checkbox-CtKUNeyu.js} +14 -5
- package/dist/Checkbox-CtKUNeyu.js.map +1 -0
- package/dist/Checkbox.js +1 -1
- package/dist/{Combobox-Clymsgli.js → Combobox-By8-34bw.js} +2 -2
- package/dist/{Combobox-Clymsgli.js.map → Combobox-By8-34bw.js.map} +1 -1
- package/dist/Combobox.js +1 -1
- package/dist/{DataTable-qoseu_e2.js → DataTable-BYOS6icI.js} +17 -10
- package/dist/DataTable-BYOS6icI.js.map +1 -0
- package/dist/{DateFieldRange-rks7jQor.js → DateFieldRange-C8Uzrboc.js} +5 -5
- package/dist/{DateFieldRange-rks7jQor.js.map → DateFieldRange-C8Uzrboc.js.map} +1 -1
- package/dist/DateFieldRange.js +1 -1
- package/dist/{DateFieldSingle-C0WXU7H1.js → DateFieldSingle-DrhLIjlK.js} +5 -5
- package/dist/{DateFieldSingle-C0WXU7H1.js.map → DateFieldSingle-DrhLIjlK.js.map} +1 -1
- package/dist/DateFieldSingle.js +1 -1
- package/dist/{DateFieldYearless-2p3a7Xgo.js → DateFieldYearless-DbivK4Hm.js} +2 -2
- package/dist/{DateFieldYearless-2p3a7Xgo.js.map → DateFieldYearless-DbivK4Hm.js.map} +1 -1
- package/dist/DateFieldYearless.js +1 -1
- package/dist/{DateFieldYearlessRange-DLmhPug8.js → DateFieldYearlessRange-BEqJe4Uf.js} +2 -2
- package/dist/{DateFieldYearlessRange-DLmhPug8.js.map → DateFieldYearlessRange-BEqJe4Uf.js.map} +1 -1
- package/dist/DateFieldYearlessRange.js +1 -1
- package/dist/{Dialog-CMhypnCD.js → Dialog-CGhwkwvq.js} +2 -2
- package/dist/{Dialog-CMhypnCD.js.map → Dialog-CGhwkwvq.js.map} +1 -1
- package/dist/Dialog.js +1 -1
- package/dist/DndSort.js +3 -5
- package/dist/DndSort.js.map +1 -1
- package/dist/{Drawer-CSelPi8t.js → Drawer-DA4iAgt-.js} +2 -2
- package/dist/{Drawer-CSelPi8t.js.map → Drawer-DA4iAgt-.js.map} +1 -1
- package/dist/Drawer.js +1 -1
- package/dist/DrillDown.js +1 -1
- package/dist/{InputMask-BKs-x6ds.js → InputMask-HjaNCb73.js} +3 -3
- package/dist/{InputMask-BKs-x6ds.js.map → InputMask-HjaNCb73.js.map} +1 -1
- package/dist/InputMask.js +1 -1
- package/dist/{ListView-CeGwrRbt.js → ListView-mujFK6mQ.js} +2 -2
- package/dist/{ListView-CeGwrRbt.js.map → ListView-mujFK6mQ.js.map} +1 -1
- package/dist/ListView.js +1 -1
- package/dist/MultiSelectField.js +1 -1
- package/dist/{MultiSelectFieldSync-EELhdoD6.js → MultiSelectFieldSync-DGpGgu8q.js} +3 -3
- package/dist/{MultiSelectFieldSync-EELhdoD6.js.map → MultiSelectFieldSync-DGpGgu8q.js.map} +1 -1
- package/dist/MultiSelectMenu.js +1 -1
- package/dist/{MultiSelectMenuSync-CAPhhkK1.js → MultiSelectMenuSync-DiLddJDw.js} +3 -3
- package/dist/{MultiSelectMenuSync-CAPhhkK1.js.map → MultiSelectMenuSync-DiLddJDw.js.map} +1 -1
- package/dist/{Page-BpV1yHkm.js → Page-Be029Dij.js} +113 -72
- package/dist/Page-Be029Dij.js.map +1 -0
- package/dist/Page.css +84 -72
- package/dist/Page.js +1 -1
- package/dist/{Popover-Br6qPgKe.js → Popover-D0qSKZ1J.js} +2 -2
- package/dist/{Popover-Br6qPgKe.js.map → Popover-D0qSKZ1J.js.map} +1 -1
- package/dist/{Popover-Dkw_8dZx.js → Popover-DxZF6lbJ.js} +8 -8
- package/dist/Popover-DxZF6lbJ.js.map +1 -0
- package/dist/Popover.js +1 -1
- package/dist/{Radio-M7lc0BsU.js → Radio-BOq9UkpC.js} +2 -2
- package/dist/{Radio-M7lc0BsU.js.map → Radio-BOq9UkpC.js.map} +1 -1
- package/dist/{Radio-8DmfWHYq.js → Radio-BQg7exDG.js} +11 -2
- package/dist/{Radio-8DmfWHYq.js.map → Radio-BQg7exDG.js.map} +1 -1
- package/dist/Radio.js +1 -1
- package/dist/{SelectCard-D5dcOIuf.js → SelectCard-cu4MBuh8.js} +21 -12
- package/dist/{SelectCard-D5dcOIuf.js.map → SelectCard-cu4MBuh8.js.map} +1 -1
- package/dist/SelectCard.css +23 -18
- package/dist/SelectCard.js +1 -1
- package/dist/SelectField.js +1 -1
- package/dist/{SelectFieldSync-BPopU0om.js → SelectFieldSync-CJ2Ie_v1.js} +3 -3
- package/dist/{SelectFieldSync-BPopU0om.js.map → SelectFieldSync-CJ2Ie_v1.js.map} +1 -1
- package/dist/SelectMenu.js +1 -1
- package/dist/{SelectMenuSync-DeMYO1m_.js → SelectMenuSync-CJA_coqD.js} +3 -3
- package/dist/{SelectMenuSync-DeMYO1m_.js.map → SelectMenuSync-CJA_coqD.js.map} +1 -1
- package/dist/{SelectOptions-DBe5ZN_-.js → SelectOptions-Bf4xsFek.js} +2 -2
- package/dist/{SelectOptions-DBe5ZN_-.js.map → SelectOptions-Bf4xsFek.js.map} +1 -1
- package/dist/Table.js +1 -1
- package/dist/{TextField--co7QJ4r.js → TextField-BW8sJAls.js} +2 -2
- package/dist/{TextField--co7QJ4r.js.map → TextField-BW8sJAls.js.map} +1 -1
- package/dist/{TextField-Cax4UeNl.js → TextField-DeHpgPag.js} +7 -2
- package/dist/TextField-DeHpgPag.js.map +1 -0
- package/dist/TextField.js +1 -1
- package/dist/{TimeField-BfcLCWMG.js → TimeField-Dc0Y1JD-.js} +3 -4
- package/dist/{TimeField-BfcLCWMG.js.map → TimeField-Dc0Y1JD-.js.map} +1 -1
- package/dist/TimeField.js +1 -1
- package/dist/{Toolbar-DqYMc_w8.js → Toolbar-DAuz4Gs2.js} +10 -10
- package/dist/{Toolbar-DqYMc_w8.js.map → Toolbar-DAuz4Gs2.js.map} +1 -1
- package/dist/Toolbar.js +1 -1
- package/dist/{YearlessDateInputWithPicker-aq99rKJU.js → YearlessDateInputWithPicker-DFi08TLG.js} +3 -4
- package/dist/YearlessDateInputWithPicker-DFi08TLG.js.map +1 -0
- package/dist/beta/components/Table/DataTable/DataTable.d.ts +7 -1
- package/dist/beta/components/Table/DataTable/internal/util/getTanStackColumnDef.d.ts +7 -1
- package/dist/beta/components/Table/createColumnHelper.d.ts +6 -0
- package/dist/beta/components/Table/types.d.ts +6 -0
- package/dist/beta.js +9 -9
- package/dist/components/Announcement/Announcement.figma.d.ts +1 -0
- package/dist/components/Checkbox/internal/Checkbox.d.ts +8 -0
- package/dist/components/DndSort/internal/test-utils.d.ts +15 -8
- package/dist/components/FieldMessage/FieldMessage.figma.d.ts +1 -0
- package/dist/components/Page/Page.d.ts +1 -1
- package/dist/components/Page/PageContent.d.ts +5 -5
- package/dist/components/Page/PageContext.d.ts +2 -0
- package/dist/components/Page/PageFooter.d.ts +1 -0
- package/dist/components/Radio/internal/Radio.d.ts +8 -0
- package/dist/{floating-ui.react-aKYfs-aw.js → floating-ui.react-C_s3_nEb.js} +2 -2
- package/dist/{floating-ui.react-aKYfs-aw.js.map → floating-ui.react-C_s3_nEb.js.map} +1 -1
- package/dist/{index.esm-K9kxJhLx.js → index.esm-BZV0wNKZ.js} +1 -2
- package/dist/{index.esm-K9kxJhLx.js.map → index.esm-BZV0wNKZ.js.map} +1 -1
- package/dist/index.js +19 -19
- package/dist/internal/components/Popover/Popover.d.ts +2 -2
- package/dist/internal/components/Popover/internal/PopoverContext.d.ts +2 -2
- package/dist/{syncFilterUtils-BRKjFwxk.js → syncFilterUtils-vt8ldsES.js} +2 -2
- package/dist/{syncFilterUtils-BRKjFwxk.js.map → syncFilterUtils-vt8ldsES.js.map} +1 -1
- package/dist/{useDrilldown-CqBBB_r1.js → useDrilldown-wwXRpNgb.js} +2 -2
- package/dist/{useDrilldown-CqBBB_r1.js.map → useDrilldown-wwXRpNgb.js.map} +1 -1
- package/dist/{useInitialFocus-BRRbylek.js → useInitialFocus-CdoVwSbr.js} +2 -2
- package/dist/{useInitialFocus-BRRbylek.js.map → useInitialFocus-CdoVwSbr.js.map} +1 -1
- package/dist/{useToggleSelection-JD62Jzqu.js → useToggleSelection-BdXW3Zg3.js} +2 -2
- package/dist/{useToggleSelection-JD62Jzqu.js.map → useToggleSelection-BdXW3Zg3.js.map} +1 -1
- package/package.json +8 -7
- package/dist/Checkbox-BwULIo4D.js.map +0 -1
- package/dist/DataTable-qoseu_e2.js.map +0 -1
- package/dist/Page-BpV1yHkm.js.map +0 -1
- package/dist/Popover-Dkw_8dZx.js.map +0 -1
- package/dist/TextField-Cax4UeNl.js.map +0 -1
- package/dist/YearlessDateInputWithPicker-aq99rKJU.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Popover-Br6qPgKe.js","sources":["../src/components/Popover/internal/PopoverContext.ts","../src/components/Popover/internal/usePopoverContext.tsx","../src/components/Popover/PopoverClose.tsx","../src/components/Popover/PopoverButton.tsx","../src/components/Popover/PopoverContent.tsx","../src/components/Popover/PopoverTrigger.tsx","../src/components/Popover/Popover.tsx"],"sourcesContent":["import {\n createContext,\n CSSProperties,\n Dispatch,\n RefObject,\n SetStateAction,\n} from \"react\";\nimport { PopoverProps } from \"../Popover\";\nimport { Placement } from \"@floating-ui/react-dom\";\n\nexport type PopoverContextProps = {\n popoverId: string;\n invoker?: HTMLElement;\n setInvoker?: Dispatch<SetStateAction<HTMLElement | undefined>>;\n popover?: HTMLElement;\n setPopover?: Dispatch<SetStateAction<HTMLElement | undefined>>;\n rootNode?: Node;\n setRootNode?: Dispatch<SetStateAction<Node | undefined>>;\n arrowElement?: HTMLSpanElement;\n setArrowElement?: Dispatch<SetStateAction<HTMLSpanElement | undefined>>;\n openState: boolean;\n popoverStyle?: CSSProperties;\n placement?: Placement;\n actualPlacement?: Placement;\n openPopover: () => void;\n closePopover: (replacementFn?: () => void) => void;\n onClose?: PopoverProps[\"onClose\"];\n openOnHover: PopoverProps[\"openOnHover\"];\n controlled: boolean;\n disableCloseOnClickOutside?: PopoverProps[\"disableCloseOnClickOutside\"];\n disableCloseOnEscape?: PopoverProps[\"disableCloseOnEscape\"];\n modal?: PopoverProps[\"modal\"];\n noPadding?: PopoverProps[\"noPadding\"];\n fillAvailableHeight: PopoverProps[\"fillAvailableHeight\"];\n maxHeight: PopoverProps[\"maxHeight\"];\n matchReferenceWidth: PopoverProps[\"matchReferenceWidth\"];\n fixedWidth: PopoverProps[\"fixedWidth\"];\n disableCaret: PopoverProps[\"disableCaret\"];\n disableFlipFallback: PopoverProps[\"disableFlipFallback\"];\n disableTriggerFocus: PopoverProps[\"disableTriggerFocus\"];\n arrowRef: RefObject<HTMLSpanElement>;\n delay: PopoverProps[\"delay\"];\n triggerHovered: boolean;\n setTriggerHovered: Dispatch<SetStateAction<boolean>>;\n contentHovered: boolean;\n setContentHovered: Dispatch<SetStateAction<boolean>>;\n};\n\nexport const PopoverContext = createContext<PopoverContextProps | null>(null);\n","import {\n useRef,\n useContext,\n useLayoutEffect,\n KeyboardEvent,\n useEffect,\n} from \"react\";\nimport { PopoverContext } from \"./PopoverContext\";\nimport { tabbable } from \"tabbable\";\n\nexport type dataStateType = \"open\" | \"closed\";\n\nexport function usePopoverContext() {\n const context = useContext(PopoverContext);\n const invokerRef = useRef<HTMLButtonElement>(null);\n const popoverRef = useRef<HTMLDivElement>(null);\n const arrowRef = useRef<HTMLSpanElement>(null);\n const { triggerHovered, setTriggerHovered, contentHovered } = context || {};\n\n useLayoutEffect(() => {\n if (!invokerRef.current) return;\n context?.setInvoker?.(invokerRef.current);\n }, [context, invokerRef]);\n\n useLayoutEffect(() => {\n if (!popoverRef.current) return;\n context?.setPopover?.(popoverRef.current);\n context?.setRootNode?.(popoverRef.current.getRootNode());\n if (!arrowRef.current) return;\n context?.setArrowElement?.(arrowRef.current);\n }, [context, popoverRef]);\n\n useEffect(() => {\n if (!context?.openOnHover) return;\n // If the popover was previously opened by hover, and is now unhovered, close the popover after 100ms\n if (!triggerHovered && !contentHovered) {\n const closeTimeout: NodeJS.Timeout = setTimeout(() => {\n context?.closePopover();\n }, 100);\n return () => {\n clearTimeout(closeTimeout);\n };\n }\n // If the popover was unopened by hover, and is now hovered, open the popover after the defined delay\n if (triggerHovered && !contentHovered) {\n if (context?.delay) {\n const openTimeout = setTimeout(() => {\n context?.openPopover();\n }, context.delay);\n return () => {\n clearTimeout(openTimeout);\n };\n } else {\n context?.openPopover();\n }\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [context?.delay, context?.openOnHover, triggerHovered, contentHovered]);\n\n const onMouseEnterHandler = () => {\n if (!context?.openOnHover) return;\n setTriggerHovered?.(true);\n };\n const onMouseLeaveHandler = () => {\n if (!context?.openOnHover) return;\n setTriggerHovered?.(false);\n };\n\n const onFocusHandler = (_e: React.FocusEvent) => {\n if (context?.openOnHover) {\n context?.openPopover();\n }\n };\n\n const onBlurHandler = (e: React.FocusEvent) => {\n if (context?.popover?.contains(e.relatedTarget as Node)) return; // If the focus is within the popover, don't close it\n if (context?.modal && context.openState) {\n e.preventDefault();\n requestAnimationFrame(() => {\n context?.invoker?.focus();\n const focusables = tabbable(context?.popover as Element);\n if (focusables.length > 0) {\n focusables[focusables.length - 1].focus();\n }\n });\n return;\n }\n if (!context?.disableCloseOnClickOutside) {\n context?.closePopover();\n }\n };\n\n const onKeyDownHandler = (e: KeyboardEvent) => {\n if (!context?.openState) return;\n if (\n e.code === \"Escape\" &&\n !context?.disableCloseOnEscape &&\n !context?.controlled\n ) {\n context?.closePopover();\n return;\n }\n };\n\n const onClickHandler = () => {\n context?.invoker?.focus();\n if (context?.openOnHover) return;\n if (context?.controlled === false) {\n if (context?.openState) {\n context?.closePopover();\n } else {\n context?.openPopover();\n }\n return;\n }\n };\n\n if (!context || !invokerRef || !popoverRef) return;\n return {\n invoker: {\n ref: invokerRef,\n element: context.invoker,\n onMouseEnter: onMouseEnterHandler,\n onMouseLeave: onMouseLeaveHandler,\n onKeyDown: onKeyDownHandler,\n onClick: onClickHandler,\n onFocus: onFocusHandler,\n onBlur: onBlurHandler,\n \"aria-haspopup\": true,\n \"aria-expanded\": context.openState,\n \"aria-details\": context.popoverId,\n \"data-state\": context.openState ? \"open\" : (\"closed\" as dataStateType),\n },\n popover: {\n ref: popoverRef,\n element: context.popover,\n id: context.popoverId,\n onClose: context.onClose,\n show: context.openPopover,\n close: context.closePopover,\n noPadding: context.noPadding,\n style: context.popoverStyle,\n arrowRef: arrowRef,\n },\n rootNode: context.rootNode,\n onClose: context.onClose,\n open: context.openState,\n openOnHover: context.openOnHover,\n controlled: context.controlled,\n disableCloseOnClickOutside: context.disableCloseOnClickOutside,\n disableCloseOnEscape: context.disableCloseOnEscape,\n modal: context.modal,\n placement: context.placement,\n actualPlacement: context.actualPlacement,\n disableCaret: context.disableCaret,\n noPadding: context.noPadding,\n fillAvailableHeight: context.fillAvailableHeight,\n maxHeight: context.maxHeight,\n matchReferenceWidth: context.matchReferenceWidth,\n fixedWidth: context.fixedWidth,\n disableFlipFallback: context.disableFlipFallback,\n disableTriggerFocus: context.disableTriggerFocus,\n triggerHovered: context.triggerHovered,\n setTriggerHovered: context.setTriggerHovered,\n contentHovered: context.contentHovered,\n setContentHovered: context.setContentHovered,\n };\n}\n","import { forwardRef } from \"react\";\n\nimport { Button, ButtonProps } from \"../Button\";\nimport { usePopoverContext } from \"./internal/usePopoverContext\";\nimport { childrenToString } from \"../../internal/functions\";\nimport { DataTrackingId } from \"../../types\";\nimport { useTrackingId } from \"../../hooks\";\n\n/**\n * Props for the PopoverClose component\n * @extends ButtonProps\n */\nexport type PopoverCloseProps = ButtonProps & DataTrackingId;\n\n/**\n * PopoverClose component for closing the popover.\n *\n * Features:\n * - Automatic popover closing on click\n * - Supports all Button component props and styling\n * - Controlled and uncontrolled mode support\n * - Context integration with parent popover\n * - Accessibility support with proper button semantics\n * - Delayed closing for controlled mode\n *\n * @example\n * <Popover.Close>Close</Popover.Close>\n *\n * @example\n * <Popover.Close appearance=\"secondary\" size=\"small\">\n * Cancel\n * </Popover.Close>\n *\n * @example\n * <Popover.Close onClick={() => console.log('Custom close handler')}>\n * Close with custom handler\n * </Popover.Close>\n */\nexport const PopoverClose = forwardRef<HTMLButtonElement, PopoverCloseProps>(\n function PopoverClose(props, ref) {\n const { onClick, ...rest } = props;\n const context = usePopoverContext();\n\n const data = {\n children: childrenToString(props.children),\n };\n\n const trackingId = useTrackingId({\n name: \"PopoverClose\",\n data,\n hasOverride: !!props[\"data-tracking-id\"],\n });\n\n return (\n <Button\n ref={ref}\n data-tracking-id={trackingId}\n data-anv=\"popover-close\"\n {...rest}\n onClick={(event) => {\n context?.popover.close();\n context?.onClose?.();\n onClick?.(event);\n }}\n />\n );\n },\n);\n\nPopoverClose.displayName = \"PopoverClose\";\n","import { forwardRef, MouseEvent, FocusEvent, KeyboardEvent } from \"react\";\nimport { Button, ButtonProps } from \"../Button\";\nimport { useMergeRefs, useTrackingId } from \"../../hooks\";\nimport { usePopoverContext } from \"./internal/usePopoverContext\";\nimport { childrenToString } from \"../../internal/functions\";\nimport { DataTrackingId } from \"../../types\";\n\n/**\n * Props for the PopoverButton component\n * @extends ButtonProps\n */\nexport type PopoverButtonProps = ButtonProps & DataTrackingId;\n\n/**\n * PopoverButton component for creating button-style triggers.\n *\n * Features:\n * - Button styling and behavior with all Button props\n * - Automatic popover opening on click\n * - Hover interaction support for tooltip mode\n * - Focus management and keyboard navigation\n * - Accessibility attributes (aria-haspopup, aria-expanded, aria-details)\n * - Context integration with parent popover\n * - Event handling for mouse, keyboard, and focus events\n *\n * @example\n * <Popover.Button>Click to open</Popover.Button>\n *\n * @example\n * <Popover.Button appearance=\"primary\" size=\"large\" icon={InfoIcon}>\n * Information\n * </Popover.Button>\n *\n * @example\n * <Popover.Button onClick={() => console.log('Custom click handler')}>\n * Custom handler\n * </Popover.Button>\n */\nexport const PopoverButton = forwardRef<HTMLButtonElement, PopoverButtonProps>(\n function PopoverButton(props, ref) {\n const {\n children,\n size,\n onMouseEnter,\n onMouseLeave,\n onClick,\n onKeyDown,\n onFocus,\n onBlur,\n ...rest\n } = props;\n const context = usePopoverContext();\n\n const data = {\n children: childrenToString(props.children),\n appearance: props.appearance,\n icon: props.icon,\n size: props.size,\n type: props.type,\n };\n\n const trackingId = useTrackingId({\n name: \"PopoverButton\",\n data,\n hasOverride: !!props[\"data-tracking-id\"],\n });\n\n const onMouseEnterHandler = (e: MouseEvent<HTMLButtonElement>) => {\n onMouseEnter?.(e);\n context?.invoker.onMouseEnter();\n };\n const onMouseLeaveHandler = (e: MouseEvent<HTMLButtonElement>) => {\n onMouseLeave?.(e);\n context?.invoker.onMouseLeave();\n };\n const onFocusHandler = (e: FocusEvent<HTMLButtonElement>) => {\n onFocus?.(e);\n context?.invoker.onFocus(e);\n };\n const onBlurHandler = (e: FocusEvent<HTMLButtonElement>) => {\n onBlur?.(e);\n context?.invoker.onBlur(e);\n };\n const onKeyDownHandler = (e: KeyboardEvent<HTMLButtonElement>) => {\n onKeyDown?.(e);\n context?.invoker.onKeyDown(e);\n };\n\n const onClickHandler = (e: MouseEvent<HTMLButtonElement>) => {\n onClick?.(e);\n context?.invoker.onClick();\n };\n\n const buttonRef = useMergeRefs([context?.invoker.ref, ref]);\n\n return (\n <Button\n ref={buttonRef}\n size={size}\n onClick={onClickHandler}\n onKeyDown={onKeyDownHandler}\n onMouseEnter={onMouseEnterHandler}\n onMouseLeave={onMouseLeaveHandler}\n onFocus={onFocusHandler}\n onBlur={onBlurHandler}\n data-anv=\"popover-button\"\n data-tracking-id={trackingId}\n aria-haspopup={context?.invoker[\"aria-haspopup\"]}\n aria-expanded={context?.invoker[\"aria-expanded\"]}\n aria-details={context?.invoker[\"aria-details\"]}\n data-state={context?.invoker[\"data-state\"]}\n {...rest}\n >\n {children}\n </Button>\n );\n },\n);\n\nPopoverButton.displayName = \"PopoverButton\";\n","import {\n ComponentPropsWithoutRef,\n forwardRef,\n MouseEvent,\n useRef,\n FocusEvent,\n RefObject,\n useLayoutEffect,\n} from \"react\";\nimport styles from \"./Popover.module.scss\";\nimport cx from \"classnames\";\nimport { useMergeRefs } from \"../../hooks\";\nimport { usePopoverContext } from \"./internal/usePopoverContext\";\nimport { useFocusWithin } from \"../../internal/hooks\";\n\n/**\n * Props for the PopoverContent component\n * @extends ComponentPropsWithoutRef<\"div\">\n */\nexport type PopoverContentProps = Omit<\n ComponentPropsWithoutRef<\"div\">,\n \"popover\"\n> & {\n /**\n * Reference to the scrollable content area\n */\n scrollerRef?: RefObject<HTMLDivElement>;\n /**\n * Whether to remove the content from the DOM while the popover is closed\n */\n hideWhileClosed?: boolean;\n};\n\n/**\n * PopoverContent component for the main popover content area.\n *\n * Features:\n * - Automatic positioning and sizing based on trigger\n * - Screen boundary detection and fitting\n * - Scroll handling with custom scroller reference\n * - Focus management and keyboard navigation\n * - Hover interaction support for tooltip mode\n * - Escape key handling for closing\n * - Tab key trapping for modal popovers\n * - Arrow/caret indicator with automatic positioning\n * - Context integration with parent popover\n * - Accessibility support with proper ARIA roles\n *\n * @example\n * <Popover.Content>\n * <p>This is the popover content</p>\n * <Popover.Close>Close</Popover.Close>\n * </Popover.Content>\n *\n * @example\n * <Popover.Content scrollerRef={scrollRef}>\n * <div style={{ height: '200px', overflow: 'auto' }}>\n * {longContent}\n * </div>\n * </Popover.Content>\n */\nexport const PopoverContent = forwardRef<HTMLDivElement, PopoverContentProps>(\n function PopoverContent(props, ref) {\n const {\n children,\n className,\n style,\n onMouseEnter,\n onMouseLeave,\n onKeyDown,\n onFocus,\n onBlur,\n onScroll,\n onScrollCapture,\n scrollerRef,\n hideWhileClosed = false,\n ...rest\n } = props;\n const context = usePopoverContext();\n const popoverClassNames = cx(className, styles[\"content\"], {\n [styles[\"no-padding\"]]: context?.noPadding,\n });\n const childrenRef = useRef<HTMLDivElement>(null);\n const combinedStyles = {\n ...style,\n ...context?.popover.style,\n };\n\n const { props: wrapperProps } = useFocusWithin({\n otherRelatedElements: context?.invoker.element\n ? [context?.invoker.element]\n : [],\n onBlur: (e) => {\n if (context?.modal) {\n e.preventDefault();\n requestAnimationFrame(() => {\n context?.invoker.element?.focus();\n });\n return;\n }\n onBlur?.(e as FocusEvent<HTMLDivElement>);\n context?.popover.close();\n },\n onFocus: (e) => {\n onFocus?.(e as FocusEvent<HTMLDivElement>);\n context?.popover.show();\n },\n });\n\n const onMouseEnterHandler = (e: MouseEvent<HTMLDivElement>) => {\n onMouseEnter?.(e);\n if (!context?.openOnHover) return;\n if (!context?.open) return; // Don't set hover state if popover is closed\n context.setContentHovered(true);\n };\n const onMouseLeaveHandler = (e: MouseEvent<HTMLDivElement>) => {\n onMouseLeave?.(e);\n if (!context?.openOnHover) return;\n context.setContentHovered(false);\n };\n\n const onKeyDownHandler = (e: React.KeyboardEvent<HTMLDivElement>) => {\n onKeyDown?.(e);\n if (e.code === \"Escape\" && !context?.disableCloseOnEscape) {\n context?.popover.close();\n }\n };\n\n const popoverContentRef = useMergeRefs([context?.popover.ref, ref]);\n const popoverScrollerRef = useMergeRefs([childrenRef, scrollerRef]);\n\n // Reset scroll position when popover opens\n useLayoutEffect(() => {\n if (context?.open && childrenRef.current) {\n childrenRef.current.scrollTop = 0;\n childrenRef.current.scrollLeft = 0;\n }\n }, [context?.open]);\n\n // Extract base side from actual placement for hover bridge positioning\n const bridgeSide =\n context?.openOnHover && context?.actualPlacement\n ? (context.actualPlacement.split(\"-\")[0] as\n | \"top\"\n | \"bottom\"\n | \"left\"\n | \"right\")\n : undefined;\n\n return (\n <div\n popover={\"manual\"}\n id={context?.popover.id}\n data-anv=\"popover-content\"\n data-position={bridgeSide}\n className={popoverClassNames}\n ref={popoverContentRef}\n style={combinedStyles}\n onMouseEnter={onMouseEnterHandler}\n onMouseLeave={onMouseLeaveHandler}\n role=\"region\"\n {...rest}\n onFocus={wrapperProps.onFocus}\n onBlur={wrapperProps.onBlur}\n >\n <div\n className={styles.scroller}\n role=\"presentation\"\n tabIndex={-1}\n ref={popoverScrollerRef}\n onKeyDown={onKeyDownHandler}\n onScroll={onScroll}\n onScrollCapture={onScrollCapture}\n >\n {hideWhileClosed ? (context?.open ? children : null) : children}\n </div>\n {!context?.disableCaret && (\n <span className={styles[\"arrow\"]} ref={context?.popover.arrowRef}>\n <svg aria-hidden=\"true\" width=\"14\" height=\"14\" viewBox=\"0 0 14 14\">\n <path stroke=\"none\" d=\"M0,0 H14 L7,7 Q7,7 7,7 Z\"></path>\n <clipPath id=\":r9:\">\n <rect x=\"0\" y=\"0\" width=\"14\" height=\"14\"></rect>\n </clipPath>\n </svg>\n </span>\n )}\n </div>\n );\n },\n);\n\nPopoverContent.displayName = \"PopoverContent\";\n","import {\n ReactElement,\n MouseEvent,\n KeyboardEvent,\n FocusEvent,\n RefObject,\n} from \"react\";\nimport { usePopoverContext } from \"./internal/usePopoverContext\";\n\ntype PopoverTriggerChildrenReturnType = {\n ref: RefObject<HTMLButtonElement>;\n onMouseEnter: (e: MouseEvent) => void;\n onMouseLeave: (e: MouseEvent) => void;\n onClick: (e: MouseEvent) => void;\n onKeyDown: (e: KeyboardEvent) => void;\n onBlur: (e: FocusEvent) => void;\n onFocus: (e: FocusEvent) => void;\n \"aria-haspopup\": boolean;\n \"aria-expanded\": boolean;\n \"aria-details\": HTMLElement[\"id\"];\n};\n\n/**\n * Props for the PopoverTrigger component\n */\nexport type PopoverTriggerProps = {\n /**\n * Render function that receives trigger props and returns a React element\n */\n children: (data: PopoverTriggerChildrenReturnType) => ReactElement;\n};\n\n/**\n * PopoverTrigger component for creating custom trigger elements.\n *\n * Features:\n * - Supports custom trigger elements via render prop pattern\n * - Automatic focus management and keyboard interaction\n * - Hover and click event handling\n * - Accessibility attributes (aria-haspopup, aria-expanded, aria-details)\n * - Context integration with parent popover\n *\n * @example\n * <Popover.Trigger>\n * {(props) => (\n * <button {...props}>\n * Click to open popover\n * </button>\n * )}\n * </Popover.Trigger>\n *\n * @example\n * <Popover.Trigger>\n * {(props) => (\n * <div {...props} role=\"button\" tabIndex={0}>\n * Custom trigger element\n * </div>\n * )}\n * </Popover.Trigger>\n */\nexport function PopoverTrigger(props: PopoverTriggerProps) {\n const { children } = props;\n const context = usePopoverContext();\n\n if (!context) return;\n const { element, ...rest } = context.invoker;\n\n return children(rest);\n}\n\nPopoverTrigger.displayName = \"PopoverTrigger\";\n","import { PopoverClose } from \"./PopoverClose\";\nimport { PopoverButton } from \"./PopoverButton\";\nimport { PopoverContent } from \"./PopoverContent\";\nimport { PopoverTrigger } from \"./PopoverTrigger\";\nimport {\n ComponentPropsWithoutRef,\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useId,\n useImperativeHandle,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { PopoverContext, PopoverContextProps } from \"./internal/PopoverContext\";\nimport {\n arrow,\n autoUpdate,\n computePosition,\n flip,\n limitShift,\n offset,\n Placement,\n shift,\n size,\n} from \"@floating-ui/react\";\nimport { safeHidePopover, safeShowPopover } from \"../../internal/functions\";\nimport { DisableCloseOnEscapeOrClickProps } from \"../../types\";\nimport {\n OpenCloseTransitionStateEffects,\n useOnClickOutside,\n useOptionallyControlledState,\n usePopoverTransitionStates,\n} from \"../../internal/hooks\";\nimport { DialogContext } from \"../Dialog/internal/DialogContext\";\n\n/**\n * Props for the Popover component\n * @property {ReactNode} [children] - The content to be rendered inside the popover\n * @property {string} [id] - Unique identifier for the popover\n * @property {boolean} [modal] - Whether the popover should be modal (traps focus)\n * @property {boolean} [openOnHover] - Changes interaction to use hover instead of click\n * @property {boolean} [fillAvailableHeight] - Changes height and positioning for select/combobox\n * @property {number | string} [maxHeight] - Maximum height of the popover content\n * @property {boolean} [fitScreen] - Whether the popover should fit within the screen bounds\n * @property {number | string} [minHeight] - Minimum height of the popover content\n * @property {boolean} [matchReferenceWidth] - Whether the popover width should match the trigger element\n * @property {boolean} [fixedWidth] - Whether the popover should have a fixed width\n * @property {string} [placement] - Placement of the popover relative to the trigger\n * @property {boolean} [open] - Controlled open state\n * @property {boolean} [defaultOpen] - Default open state for uncontrolled mode\n * @property {Function} [onOpenChange] - Callback when open state changes\n * @property {Function} [onClickOutside] - Callback when clicking outside the popover\n * @property {Function} [onClose] - Fires when the floating element is requested to be closed\n * @property {boolean} [disableCaret] - Whether to disable the caret/arrow indicator\n * @property {boolean} [noPadding] - Whether to remove default padding from content\n * @property {boolean} [disableAutoUpdate] - Whether to disable automatic position updates\n * @property {boolean} [disableTriggerFocus] - Whether to disable focus on the trigger element\n * @property {number} [delay] - Delay before opening the popover (for hover mode)\n * @property {boolean} [disableCloseOnClickOutside] - Whether to disable closing on outside click\n * @property {boolean} [disableCloseOnEscape] - Whether to disable closing on escape key\n */\n\n/**\n * Props for the Popover component\n * @extends ComponentPropsWithoutRef<\"div\">\n * @extends DisableCloseOnEscapeOrClickProps\n */\nexport type PopoverProps = {\n /**\n * The content to be rendered inside the popover\n */\n children?: ComponentPropsWithoutRef<\"div\">[\"children\"];\n /**\n * Unique identifier for the popover\n */\n id?: ComponentPropsWithoutRef<\"div\">[\"id\"];\n /**\n * Whether the popover should be modal (traps focus)\n * @default false\n */\n modal?: boolean;\n /**\n * Disables the shift of floating element\n * @internal\n */\n disableShift?: boolean;\n /**\n * Disables the flip of floating element\n * @internal\n */\n disableFlip?: boolean;\n /**\n * Disables the flip cross-axis fallback of floating element\n * @internal\n */\n disableFlipFallback?: boolean;\n /**\n * Changes interaction to use hover instead of click\n * @default false\n */\n openOnHover?: boolean;\n /**\n * Changes height and positioning for select/combobox\n * @default false\n */\n fillAvailableHeight?: boolean;\n /**\n * Maximum height of the popover content\n */\n maxHeight?: number | string;\n /**\n * Whether the popover should fit within the screen bounds\n * @default false\n */\n fitScreen?: boolean;\n /**\n * Minimum height of the popover content\n * @default \"2.875rem\"\n */\n minHeight?: number | string;\n /**\n * Whether the popover width should match the trigger element\n * @default false\n */\n matchReferenceWidth?: boolean;\n /**\n * Whether the popover should have a fixed width\n * @default false\n */\n fixedWidth?: boolean;\n /**\n * Placement of the popover relative to the trigger\n * @default \"bottom\"\n */\n placement?: Placement;\n /**\n * Controlled open state\n */\n open?: boolean;\n /**\n * Default open state for uncontrolled mode\n * @default false\n */\n defaultOpen?: boolean;\n /**\n * Callback when clicking outside the popover\n */\n onClickOutside?: (e: globalThis.MouseEvent) => void;\n /**\n * Fires when the floating element is requested to be closed\n * Note: this does not fire when openOnHover is true and mouse leaves to close\n * eg. on click outside, [esc] to close, or by <Popover.Close>\n */\n onClose?: () => void;\n /**\n * Whether to disable the caret/arrow indicator\n * @default false\n */\n disableCaret?: boolean;\n /**\n * Whether to remove default padding from content\n * @default false\n */\n noPadding?: boolean;\n /**\n * Whether to disable automatic position updates\n * @default false\n */\n disableAutoUpdate?: boolean;\n /**\n * Whether to disable focus on the trigger element\n * @default false\n */\n disableTriggerFocus?: boolean;\n /**\n * Delay before opening the popover (for hover mode)\n * @default 100\n */\n delay?: number;\n} & DisableCloseOnEscapeOrClickProps &\n OpenCloseTransitionStateEffects;\n\nconst PopoverElement = forwardRef((props: PopoverProps, ref) => {\n const {\n children,\n openOnHover = false,\n delay = 100,\n placement = \"bottom\",\n minHeight = \"2.875rem\",\n open,\n defaultOpen = false,\n disableShift,\n disableFlip,\n disableFlipFallback,\n matchReferenceWidth,\n id,\n disableCaret,\n fixedWidth,\n fillAvailableHeight,\n maxHeight,\n disableCloseOnClickOutside,\n disableCloseOnEscape,\n fitScreen,\n disableTriggerFocus,\n modal,\n noPadding,\n onClickOutside,\n onClose,\n onOpenAnimationStart,\n onOpenAnimationComplete,\n onCloseAnimationStart,\n onCloseAnimationComplete,\n } = props;\n const uid = useId();\n const [invoker, setInvoker] =\n useState<PopoverContextProps[\"invoker\"]>(undefined);\n const [popover, setPopover] =\n useState<PopoverContextProps[\"popover\"]>(undefined);\n const [rootNode, setRootNode] = useState<PopoverContextProps[\"rootNode\"]>();\n const [arrowElement, setArrowElement] =\n useState<PopoverContextProps[\"arrowElement\"]>(undefined);\n const [openState, setOpenState] = useOptionallyControlledState<\n PopoverContextProps[\"openState\"]\n >({\n controlledValue: open,\n defaultValue: defaultOpen,\n });\n const arrowRef = useRef<HTMLSpanElement>(null);\n const dialogContext = useContext(DialogContext);\n const [triggerHovered, setTriggerHovered] = useState(false);\n const [contentHovered, setContentHovered] = useState(false);\n // Track the actual computed placement after flip/shift middleware runs\n // (may differ from the placement prop if Floating UI adjusts it)\n const [actualPlacement, setActualPlacement] = useState<Placement | undefined>(\n placement,\n );\n\n // TODO: Find a way to test these properly!\n // Stryker disable all : Currently relying on Chromatic test for all visuals\n const processMinHeight =\n typeof minHeight === \"string\" ? minHeight : `${minHeight}px`;\n\n usePopoverTransitionStates(popover, openState, {\n onOpenAnimationStart: useCallback(() => {\n onOpenAnimationStart?.();\n }, [onOpenAnimationStart]),\n onOpenAnimationComplete: useCallback(() => {\n onOpenAnimationComplete?.();\n }, [onOpenAnimationComplete]),\n onCloseAnimationStart: useCallback(() => {\n onCloseAnimationStart?.();\n }, [onCloseAnimationStart]),\n onCloseAnimationComplete: useCallback(() => {\n onCloseAnimationComplete?.();\n }, [onCloseAnimationComplete]),\n });\n\n /* istanbul ignore next */\n const updatePosition = useCallback(() => {\n if (!invoker || !popover) return;\n // disable position update when closing\n if (!openState) return;\n computePosition(invoker, popover, {\n placement: placement,\n middleware: [\n offset(8),\n size({\n padding: 5,\n apply({ rects, availableHeight, elements }) {\n Object.assign(elements.floating.style, {\n ...(matchReferenceWidth\n ? { width: `${rects.reference.width}px` }\n : fixedWidth\n ? { width: \"40dvw\" }\n : {}),\n ...(fillAvailableHeight\n ? {\n height: `${availableHeight - 20}px`,\n minHeight: processMinHeight,\n }\n : {}),\n ...(maxHeight\n ? {\n minHeight: processMinHeight,\n height: fitScreen\n ? typeof maxHeight === \"string\"\n ? maxHeight\n : `${maxHeight}px`\n : undefined,\n maxHeight: fitScreen\n ? `${availableHeight - 20}px`\n : typeof maxHeight === \"string\"\n ? maxHeight\n : `${maxHeight}px`,\n }\n : {}),\n ...(fitScreen && !maxHeight\n ? {\n minHeight: processMinHeight,\n maxHeight: `${availableHeight - 20}px`,\n }\n : {}),\n zIndex: 1,\n });\n },\n }),\n flip({\n mainAxis: !disableFlip,\n crossAxis: false,\n fallbackAxisSideDirection: disableFlipFallback ? \"none\" : \"end\",\n padding: 5,\n }),\n shift({\n padding: 5,\n mainAxis: !disableShift,\n crossAxis: false,\n limiter: limitShift({\n mainAxis: !disableShift,\n }),\n }),\n arrow({\n element: !disableCaret && arrowElement ? arrowElement : null,\n padding: 5,\n }),\n ],\n }).then(({ x, y, placement, middlewareData }) => {\n setActualPlacement(placement);\n const side = placement.split(\"-\")[0];\n\n const staticSide = {\n top: \"bottom\",\n right: \"left\",\n bottom: \"top\",\n left: \"right\",\n }[side as \"top\" | \"right\" | \"bottom\" | \"left\"];\n\n const arrowDeg = () => {\n if (staticSide === \"top\") return 180;\n if (staticSide === \"bottom\") return 0;\n if (staticSide === \"left\") return 90;\n return 270;\n };\n\n Object.assign(popover.style, {\n left: `${x}px`,\n top: `${y}px`,\n });\n if (middlewareData.arrow && arrowElement) {\n const { x, y } = middlewareData.arrow;\n Object.assign(arrowElement.style, {\n left: x != null ? `${x}px` : \"\",\n top: y != null ? `${y}px` : \"\",\n right: \"\",\n bottom: \"\",\n [staticSide as string]: `${-arrowElement.offsetWidth + 2}px`,\n transform: `rotate(${arrowDeg()}deg)`,\n });\n }\n });\n }, [\n arrowElement,\n disableCaret,\n disableFlip,\n disableFlipFallback,\n disableShift,\n fillAvailableHeight,\n fitScreen,\n fixedWidth,\n invoker,\n matchReferenceWidth,\n maxHeight,\n openState,\n placement,\n popover,\n processMinHeight,\n ]);\n\n // Effect to add autoUpdate to eventListener\n // while the popover is opened\n useLayoutEffect(() => {\n if (!popover || !invoker) return;\n if (!openState) {\n return;\n }\n\n let requestID: number | null = null;\n const cleanup = autoUpdate(invoker, popover, () => {\n requestID = requestAnimationFrame(updatePosition);\n });\n\n return () => {\n if (requestID) cancelAnimationFrame(requestID);\n cleanup();\n };\n }, [invoker, popover, updatePosition, openState]);\n // Stryker restore all\n\n popover?.getRootNode();\n\n const popoverId = id ?? `popover-${uid.replace(/:/g, \"\")}`;\n const isControlled = typeof open !== \"undefined\";\n\n // Main function to open popover\n const openPopover = useCallback(() => {\n if (\n !popover ||\n !(rootNode as ShadowRoot | Document)?.querySelector(`#${popoverId}`)\n )\n return;\n setOpenState(true);\n }, [popover, rootNode, popoverId, setOpenState]);\n\n // Main function to close popover\n const closePopover = useCallback(\n (fn?: () => void) => {\n if (!popover || !openState) return;\n if (!openOnHover) onClose?.();\n setOpenState(false);\n\n // Reset hover states to prevent stuck state when closed programmatically\n // while mouse is still inside the popover content\n setTriggerHovered(false);\n setContentHovered(false);\n\n fn?.();\n },\n [\n popover,\n openState,\n openOnHover,\n onClose,\n setOpenState,\n setTriggerHovered,\n setContentHovered,\n ],\n );\n\n useImperativeHandle(\n ref,\n () => ({\n openPopover,\n closePopover,\n }),\n [openPopover, closePopover],\n );\n\n // Updating openness for controlled\n useEffect(() => {\n if (typeof openState === \"undefined\") return;\n if (openState) {\n if (dialogContext) {\n if (dialogContext?.ref?.current?.open) {\n safeShowPopover(popover);\n dialogContext?.setHasOpenPopover?.(true);\n }\n return;\n }\n safeShowPopover(popover);\n } else {\n safeHidePopover(popover);\n dialogContext?.setHasOpenPopover?.(false);\n }\n }, [openState, openPopover, closePopover, dialogContext, popover]);\n\n useOnClickOutside({\n disable: disableCloseOnClickOutside || !openState,\n onClickOutsideBegin: (e) => {\n if (!openState) return;\n onClickOutside?.(e);\n },\n targets: [invoker, popover],\n onClickOutside: () => {\n if (openOnHover || isControlled) return;\n closePopover();\n },\n });\n\n const value = useMemo(() => {\n return {\n popoverId,\n invoker,\n setInvoker,\n popover,\n setPopover,\n arrowElement,\n setArrowElement,\n openPopover,\n closePopover,\n placement,\n actualPlacement,\n onClose,\n openOnHover,\n openState,\n setOpenState,\n disableCloseOnClickOutside,\n fillAvailableHeight,\n maxHeight,\n matchReferenceWidth,\n fixedWidth,\n disableCaret,\n disableFlipFallback,\n disableTriggerFocus,\n disableCloseOnEscape,\n noPadding,\n controlled: isControlled,\n modal: modal,\n arrowRef,\n rootNode,\n setRootNode,\n delay,\n triggerHovered,\n setTriggerHovered,\n contentHovered,\n setContentHovered,\n };\n }, [\n popoverId,\n invoker,\n popover,\n arrowElement,\n openPopover,\n closePopover,\n placement,\n actualPlacement,\n onClose,\n openOnHover,\n openState,\n setOpenState,\n disableCloseOnClickOutside,\n fillAvailableHeight,\n maxHeight,\n matchReferenceWidth,\n fixedWidth,\n disableCaret,\n disableFlipFallback,\n disableTriggerFocus,\n disableCloseOnEscape,\n noPadding,\n isControlled,\n modal,\n rootNode,\n delay,\n triggerHovered,\n setTriggerHovered,\n contentHovered,\n setContentHovered,\n ]);\n\n return (\n <PopoverContext.Provider value={value}>{children}</PopoverContext.Provider>\n );\n});\n\nPopoverElement.displayName = \"Popover\";\n\n/**\n * Popover component for displaying floating content relative to a trigger element.\n *\n * Features:\n * - Supports both controlled and uncontrolled modes\n * - Automatic positioning with fallback strategies\n * - Hover and click interaction modes\n * - Modal and non-modal variants\n * - Custom trigger elements\n * - Automatic height and width management\n * - Screen boundary detection and fitting\n * - Keyboard navigation and accessibility\n * - Outside click detection and handling\n * - Focus management and trapping\n * - Arrow/caret indicators\n * - Delay support for hover interactions\n * - Automatic tracking ID generation for analytics\n *\n * @example\n * <Popover>\n * <Popover.Button>Click to open</Popover.Button>\n * <Popover.Content>\n * <p>This is the popover content</p>\n * <Popover.Close>Close</Popover.Close>\n * </Popover.Content>\n * </Popover>\n *\n * @example\n * <Popover openOnHover delay={1000}>\n * <Popover.Button>Hover to open</Popover.Button>\n * <Popover.Content>Tooltip content</Popover.Content>\n * </Popover>\n *\n * @example\n * <Popover modal>\n * <Popover.Trigger>\n * {(props) => <button {...props}>Custom trigger</button>}\n * </Popover.Trigger>\n * <Popover.Content>\n * <TextField label=\"Form field\" />\n * <Popover.Close>Done</Popover.Close>\n * </Popover.Content>\n * </Popover>\n */\nexport const Popover = Object.assign(PopoverElement, {\n /**\n * PopoverTrigger component for creating custom trigger elements.\n *\n * Features:\n * - Supports custom trigger elements via render prop pattern\n * - Automatic focus management and keyboard interaction\n * - Hover and click event handling\n * - Accessibility attributes (aria-haspopup, aria-expanded, aria-details)\n * - Context integration with parent popover\n * - Automatic tracking ID generation for analytics\n *\n * @example\n * <Popover.Trigger>\n * {(props) => (\n * <button {...props}>\n * Click to open popover\n * </button>\n * )}\n * </Popover.Trigger>\n */\n Trigger: PopoverTrigger,\n /**\n * PopoverContent component for the main popover content area.\n *\n * Features:\n * - Automatic positioning and sizing based on trigger\n * - Screen boundary detection and fitting\n * - Scroll handling with custom scroller reference\n * - Focus management and keyboard navigation\n * - Hover interaction support for tooltip mode\n * - Escape key handling for closing\n * - Tab key trapping for modal popovers\n * - Arrow/caret indicator with automatic positioning\n * - Context integration with parent popover\n * - Accessibility support with proper ARIA roles\n *\n * @example\n * <Popover.Content>\n * <p>This is the popover content</p>\n * <Popover.Close>Close</Popover.Close>\n * </Popover.Content>\n */\n Content: PopoverContent,\n /**\n * PopoverClose component for closing the popover.\n *\n * Features:\n * - Automatic popover closing on click\n * - Supports all Button component props and styling\n * - Controlled and uncontrolled mode support\n * - Context integration with parent popover\n * - Accessibility support with proper button semantics\n * - Delayed closing for controlled mode\n * - Automatic tracking ID generation for analytics\n *\n * @example\n * <Popover.Close>Close</Popover.Close>\n */\n Close: PopoverClose,\n /**\n * PopoverButton component for creating button-style triggers.\n *\n * Features:\n * - Button styling and behavior with all Button props\n * - Automatic popover opening on click\n * - Hover interaction support for tooltip mode\n * - Focus management and keyboard navigation\n * - Accessibility attributes (aria-haspopup, aria-expanded, aria-details)\n * - Context integration with parent popover\n * - Event handling for mouse, keyboard, and focus events\n * - Automatic tracking ID generation for analytics\n *\n * @example\n * <Popover.Button>Click to open</Popover.Button>\n */\n Button: PopoverButton,\n});\n"],"names":["PopoverClose","PopoverButton","PopoverContent","arrow","placement","x","y"],"mappings":";;;;;;;;;;;;;;;;AAgDO,MAAM,cAAA,GAAiB,cAA0C,IAAI,CAAA;;ACpCrE,SAAS,iBAAA,GAAoB;AAClC,EAAA,MAAM,OAAA,GAAU,WAAW,cAAc,CAAA;AACzC,EAAA,MAAM,UAAA,GAAa,OAA0B,IAAI,CAAA;AACjD,EAAA,MAAM,UAAA,GAAa,OAAuB,IAAI,CAAA;AAC9C,EAAA,MAAM,QAAA,GAAW,OAAwB,IAAI,CAAA;AAC7C,EAAA,MAAM,EAAE,cAAA,EAAgB,iBAAA,EAAmB,cAAA,EAAe,GAAI,WAAW,EAAC;AAE1E,EAAA,eAAA,CAAgB,MAAM;AACpB,IAAA,IAAI,CAAC,WAAW,OAAA,EAAS;AACzB,IAAA,OAAA,EAAS,UAAA,GAAa,WAAW,OAAO,CAAA;AAAA,EAC1C,CAAA,EAAG,CAAC,OAAA,EAAS,UAAU,CAAC,CAAA;AAExB,EAAA,eAAA,CAAgB,MAAM;AACpB,IAAA,IAAI,CAAC,WAAW,OAAA,EAAS;AACzB,IAAA,OAAA,EAAS,UAAA,GAAa,WAAW,OAAO,CAAA;AACxC,IAAA,OAAA,EAAS,WAAA,GAAc,UAAA,CAAW,OAAA,CAAQ,WAAA,EAAa,CAAA;AACvD,IAAA,IAAI,CAAC,SAAS,OAAA,EAAS;AACvB,IAAA,OAAA,EAAS,eAAA,GAAkB,SAAS,OAAO,CAAA;AAAA,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A;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAiBP,MAAA,EAAQ;AACV,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"Popover-D0qSKZ1J.js","sources":["../src/components/Popover/internal/PopoverContext.ts","../src/components/Popover/internal/usePopoverContext.tsx","../src/components/Popover/PopoverClose.tsx","../src/components/Popover/PopoverButton.tsx","../src/components/Popover/PopoverContent.tsx","../src/components/Popover/PopoverTrigger.tsx","../src/components/Popover/Popover.tsx"],"sourcesContent":["import {\n createContext,\n CSSProperties,\n Dispatch,\n RefObject,\n SetStateAction,\n} from \"react\";\nimport { PopoverProps } from \"../Popover\";\nimport { Placement } from \"@floating-ui/react-dom\";\n\nexport type PopoverContextProps = {\n popoverId: string;\n invoker?: HTMLElement;\n setInvoker?: Dispatch<SetStateAction<HTMLElement | undefined>>;\n popover?: HTMLElement;\n setPopover?: Dispatch<SetStateAction<HTMLElement | undefined>>;\n rootNode?: Node;\n setRootNode?: Dispatch<SetStateAction<Node | undefined>>;\n arrowElement?: HTMLSpanElement;\n setArrowElement?: Dispatch<SetStateAction<HTMLSpanElement | undefined>>;\n openState: boolean;\n popoverStyle?: CSSProperties;\n placement?: Placement;\n actualPlacement?: Placement;\n openPopover: () => void;\n closePopover: (replacementFn?: () => void) => void;\n onClose?: PopoverProps[\"onClose\"];\n openOnHover: PopoverProps[\"openOnHover\"];\n controlled: boolean;\n disableCloseOnClickOutside?: PopoverProps[\"disableCloseOnClickOutside\"];\n disableCloseOnEscape?: PopoverProps[\"disableCloseOnEscape\"];\n modal?: PopoverProps[\"modal\"];\n noPadding?: PopoverProps[\"noPadding\"];\n fillAvailableHeight: PopoverProps[\"fillAvailableHeight\"];\n maxHeight: PopoverProps[\"maxHeight\"];\n matchReferenceWidth: PopoverProps[\"matchReferenceWidth\"];\n fixedWidth: PopoverProps[\"fixedWidth\"];\n disableCaret: PopoverProps[\"disableCaret\"];\n disableFlipFallback: PopoverProps[\"disableFlipFallback\"];\n disableTriggerFocus: PopoverProps[\"disableTriggerFocus\"];\n arrowRef: RefObject<HTMLSpanElement>;\n delay: PopoverProps[\"delay\"];\n triggerHovered: boolean;\n setTriggerHovered: Dispatch<SetStateAction<boolean>>;\n contentHovered: boolean;\n setContentHovered: Dispatch<SetStateAction<boolean>>;\n};\n\nexport const PopoverContext = createContext<PopoverContextProps | null>(null);\n","import {\n useRef,\n useContext,\n useLayoutEffect,\n KeyboardEvent,\n useEffect,\n} from \"react\";\nimport { PopoverContext } from \"./PopoverContext\";\nimport { tabbable } from \"tabbable\";\n\nexport type dataStateType = \"open\" | \"closed\";\n\nexport function usePopoverContext() {\n const context = useContext(PopoverContext);\n const invokerRef = useRef<HTMLButtonElement>(null);\n const popoverRef = useRef<HTMLDivElement>(null);\n const arrowRef = useRef<HTMLSpanElement>(null);\n const { triggerHovered, setTriggerHovered, contentHovered } = context || {};\n\n useLayoutEffect(() => {\n if (!invokerRef.current) return;\n context?.setInvoker?.(invokerRef.current);\n }, [context, invokerRef]);\n\n useLayoutEffect(() => {\n if (!popoverRef.current) return;\n context?.setPopover?.(popoverRef.current);\n context?.setRootNode?.(popoverRef.current.getRootNode());\n if (!arrowRef.current) return;\n context?.setArrowElement?.(arrowRef.current);\n }, [context, popoverRef]);\n\n useEffect(() => {\n if (!context?.openOnHover) return;\n // If the popover was previously opened by hover, and is now unhovered, close the popover after 100ms\n if (!triggerHovered && !contentHovered) {\n const closeTimeout: NodeJS.Timeout = setTimeout(() => {\n context?.closePopover();\n }, 100);\n return () => {\n clearTimeout(closeTimeout);\n };\n }\n // If the popover was unopened by hover, and is now hovered, open the popover after the defined delay\n if (triggerHovered && !contentHovered) {\n if (context?.delay) {\n const openTimeout = setTimeout(() => {\n context?.openPopover();\n }, context.delay);\n return () => {\n clearTimeout(openTimeout);\n };\n } else {\n context?.openPopover();\n }\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [context?.delay, context?.openOnHover, triggerHovered, contentHovered]);\n\n const onMouseEnterHandler = () => {\n if (!context?.openOnHover) return;\n setTriggerHovered?.(true);\n };\n const onMouseLeaveHandler = () => {\n if (!context?.openOnHover) return;\n setTriggerHovered?.(false);\n };\n\n const onFocusHandler = (_e: React.FocusEvent) => {\n if (context?.openOnHover) {\n context?.openPopover();\n }\n };\n\n const onBlurHandler = (e: React.FocusEvent) => {\n if (context?.popover?.contains(e.relatedTarget as Node)) return; // If the focus is within the popover, don't close it\n if (context?.modal && context.openState) {\n e.preventDefault();\n requestAnimationFrame(() => {\n context?.invoker?.focus();\n const focusables = tabbable(context?.popover as Element);\n if (focusables.length > 0) {\n focusables[focusables.length - 1].focus();\n }\n });\n return;\n }\n if (!context?.disableCloseOnClickOutside) {\n context?.closePopover();\n }\n };\n\n const onKeyDownHandler = (e: KeyboardEvent) => {\n if (!context?.openState) return;\n if (\n e.code === \"Escape\" &&\n !context?.disableCloseOnEscape &&\n !context?.controlled\n ) {\n context?.closePopover();\n return;\n }\n };\n\n const onClickHandler = () => {\n context?.invoker?.focus();\n if (context?.openOnHover) return;\n if (context?.controlled === false) {\n if (context?.openState) {\n context?.closePopover();\n } else {\n context?.openPopover();\n }\n return;\n }\n };\n\n if (!context || !invokerRef || !popoverRef) return;\n return {\n invoker: {\n ref: invokerRef,\n element: context.invoker,\n onMouseEnter: onMouseEnterHandler,\n onMouseLeave: onMouseLeaveHandler,\n onKeyDown: onKeyDownHandler,\n onClick: onClickHandler,\n onFocus: onFocusHandler,\n onBlur: onBlurHandler,\n \"aria-haspopup\": true,\n \"aria-expanded\": context.openState,\n \"aria-details\": context.popoverId,\n \"data-state\": context.openState ? \"open\" : (\"closed\" as dataStateType),\n },\n popover: {\n ref: popoverRef,\n element: context.popover,\n id: context.popoverId,\n onClose: context.onClose,\n show: context.openPopover,\n close: context.closePopover,\n noPadding: context.noPadding,\n style: context.popoverStyle,\n arrowRef: arrowRef,\n },\n rootNode: context.rootNode,\n onClose: context.onClose,\n open: context.openState,\n openOnHover: context.openOnHover,\n controlled: context.controlled,\n disableCloseOnClickOutside: context.disableCloseOnClickOutside,\n disableCloseOnEscape: context.disableCloseOnEscape,\n modal: context.modal,\n placement: context.placement,\n actualPlacement: context.actualPlacement,\n disableCaret: context.disableCaret,\n noPadding: context.noPadding,\n fillAvailableHeight: context.fillAvailableHeight,\n maxHeight: context.maxHeight,\n matchReferenceWidth: context.matchReferenceWidth,\n fixedWidth: context.fixedWidth,\n disableFlipFallback: context.disableFlipFallback,\n disableTriggerFocus: context.disableTriggerFocus,\n triggerHovered: context.triggerHovered,\n setTriggerHovered: context.setTriggerHovered,\n contentHovered: context.contentHovered,\n setContentHovered: context.setContentHovered,\n };\n}\n","import { forwardRef } from \"react\";\n\nimport { Button, ButtonProps } from \"../Button\";\nimport { usePopoverContext } from \"./internal/usePopoverContext\";\nimport { childrenToString } from \"../../internal/functions\";\nimport { DataTrackingId } from \"../../types\";\nimport { useTrackingId } from \"../../hooks\";\n\n/**\n * Props for the PopoverClose component\n * @extends ButtonProps\n */\nexport type PopoverCloseProps = ButtonProps & DataTrackingId;\n\n/**\n * PopoverClose component for closing the popover.\n *\n * Features:\n * - Automatic popover closing on click\n * - Supports all Button component props and styling\n * - Controlled and uncontrolled mode support\n * - Context integration with parent popover\n * - Accessibility support with proper button semantics\n * - Delayed closing for controlled mode\n *\n * @example\n * <Popover.Close>Close</Popover.Close>\n *\n * @example\n * <Popover.Close appearance=\"secondary\" size=\"small\">\n * Cancel\n * </Popover.Close>\n *\n * @example\n * <Popover.Close onClick={() => console.log('Custom close handler')}>\n * Close with custom handler\n * </Popover.Close>\n */\nexport const PopoverClose = forwardRef<HTMLButtonElement, PopoverCloseProps>(\n function PopoverClose(props, ref) {\n const { onClick, ...rest } = props;\n const context = usePopoverContext();\n\n const data = {\n children: childrenToString(props.children),\n };\n\n const trackingId = useTrackingId({\n name: \"PopoverClose\",\n data,\n hasOverride: !!props[\"data-tracking-id\"],\n });\n\n return (\n <Button\n ref={ref}\n data-tracking-id={trackingId}\n data-anv=\"popover-close\"\n {...rest}\n onClick={(event) => {\n context?.popover.close();\n context?.onClose?.();\n onClick?.(event);\n }}\n />\n );\n },\n);\n\nPopoverClose.displayName = \"PopoverClose\";\n","import { forwardRef, MouseEvent, FocusEvent, KeyboardEvent } from \"react\";\nimport { Button, ButtonProps } from \"../Button\";\nimport { useMergeRefs, useTrackingId } from \"../../hooks\";\nimport { usePopoverContext } from \"./internal/usePopoverContext\";\nimport { childrenToString } from \"../../internal/functions\";\nimport { DataTrackingId } from \"../../types\";\n\n/**\n * Props for the PopoverButton component\n * @extends ButtonProps\n */\nexport type PopoverButtonProps = ButtonProps & DataTrackingId;\n\n/**\n * PopoverButton component for creating button-style triggers.\n *\n * Features:\n * - Button styling and behavior with all Button props\n * - Automatic popover opening on click\n * - Hover interaction support for tooltip mode\n * - Focus management and keyboard navigation\n * - Accessibility attributes (aria-haspopup, aria-expanded, aria-details)\n * - Context integration with parent popover\n * - Event handling for mouse, keyboard, and focus events\n *\n * @example\n * <Popover.Button>Click to open</Popover.Button>\n *\n * @example\n * <Popover.Button appearance=\"primary\" size=\"large\" icon={InfoIcon}>\n * Information\n * </Popover.Button>\n *\n * @example\n * <Popover.Button onClick={() => console.log('Custom click handler')}>\n * Custom handler\n * </Popover.Button>\n */\nexport const PopoverButton = forwardRef<HTMLButtonElement, PopoverButtonProps>(\n function PopoverButton(props, ref) {\n const {\n children,\n size,\n onMouseEnter,\n onMouseLeave,\n onClick,\n onKeyDown,\n onFocus,\n onBlur,\n ...rest\n } = props;\n const context = usePopoverContext();\n\n const data = {\n children: childrenToString(props.children),\n appearance: props.appearance,\n icon: props.icon,\n size: props.size,\n type: props.type,\n };\n\n const trackingId = useTrackingId({\n name: \"PopoverButton\",\n data,\n hasOverride: !!props[\"data-tracking-id\"],\n });\n\n const onMouseEnterHandler = (e: MouseEvent<HTMLButtonElement>) => {\n onMouseEnter?.(e);\n context?.invoker.onMouseEnter();\n };\n const onMouseLeaveHandler = (e: MouseEvent<HTMLButtonElement>) => {\n onMouseLeave?.(e);\n context?.invoker.onMouseLeave();\n };\n const onFocusHandler = (e: FocusEvent<HTMLButtonElement>) => {\n onFocus?.(e);\n context?.invoker.onFocus(e);\n };\n const onBlurHandler = (e: FocusEvent<HTMLButtonElement>) => {\n onBlur?.(e);\n context?.invoker.onBlur(e);\n };\n const onKeyDownHandler = (e: KeyboardEvent<HTMLButtonElement>) => {\n onKeyDown?.(e);\n context?.invoker.onKeyDown(e);\n };\n\n const onClickHandler = (e: MouseEvent<HTMLButtonElement>) => {\n onClick?.(e);\n context?.invoker.onClick();\n };\n\n const buttonRef = useMergeRefs([context?.invoker.ref, ref]);\n\n return (\n <Button\n ref={buttonRef}\n size={size}\n onClick={onClickHandler}\n onKeyDown={onKeyDownHandler}\n onMouseEnter={onMouseEnterHandler}\n onMouseLeave={onMouseLeaveHandler}\n onFocus={onFocusHandler}\n onBlur={onBlurHandler}\n data-anv=\"popover-button\"\n data-tracking-id={trackingId}\n aria-haspopup={context?.invoker[\"aria-haspopup\"]}\n aria-expanded={context?.invoker[\"aria-expanded\"]}\n aria-details={context?.invoker[\"aria-details\"]}\n data-state={context?.invoker[\"data-state\"]}\n {...rest}\n >\n {children}\n </Button>\n );\n },\n);\n\nPopoverButton.displayName = \"PopoverButton\";\n","import {\n ComponentPropsWithoutRef,\n forwardRef,\n MouseEvent,\n useRef,\n FocusEvent,\n RefObject,\n useLayoutEffect,\n} from \"react\";\nimport styles from \"./Popover.module.scss\";\nimport cx from \"classnames\";\nimport { useMergeRefs } from \"../../hooks\";\nimport { usePopoverContext } from \"./internal/usePopoverContext\";\nimport { useFocusWithin } from \"../../internal/hooks\";\n\n/**\n * Props for the PopoverContent component\n * @extends ComponentPropsWithoutRef<\"div\">\n */\nexport type PopoverContentProps = Omit<\n ComponentPropsWithoutRef<\"div\">,\n \"popover\"\n> & {\n /**\n * Reference to the scrollable content area\n */\n scrollerRef?: RefObject<HTMLDivElement>;\n /**\n * Whether to remove the content from the DOM while the popover is closed\n */\n hideWhileClosed?: boolean;\n};\n\n/**\n * PopoverContent component for the main popover content area.\n *\n * Features:\n * - Automatic positioning and sizing based on trigger\n * - Screen boundary detection and fitting\n * - Scroll handling with custom scroller reference\n * - Focus management and keyboard navigation\n * - Hover interaction support for tooltip mode\n * - Escape key handling for closing\n * - Tab key trapping for modal popovers\n * - Arrow/caret indicator with automatic positioning\n * - Context integration with parent popover\n * - Accessibility support with proper ARIA roles\n *\n * @example\n * <Popover.Content>\n * <p>This is the popover content</p>\n * <Popover.Close>Close</Popover.Close>\n * </Popover.Content>\n *\n * @example\n * <Popover.Content scrollerRef={scrollRef}>\n * <div style={{ height: '200px', overflow: 'auto' }}>\n * {longContent}\n * </div>\n * </Popover.Content>\n */\nexport const PopoverContent = forwardRef<HTMLDivElement, PopoverContentProps>(\n function PopoverContent(props, ref) {\n const {\n children,\n className,\n style,\n onMouseEnter,\n onMouseLeave,\n onKeyDown,\n onFocus,\n onBlur,\n onScroll,\n onScrollCapture,\n scrollerRef,\n hideWhileClosed = false,\n ...rest\n } = props;\n const context = usePopoverContext();\n const popoverClassNames = cx(className, styles[\"content\"], {\n [styles[\"no-padding\"]]: context?.noPadding,\n });\n const childrenRef = useRef<HTMLDivElement>(null);\n const combinedStyles = {\n ...style,\n ...context?.popover.style,\n };\n\n const { props: wrapperProps } = useFocusWithin({\n otherRelatedElements: context?.invoker.element\n ? [context?.invoker.element]\n : [],\n onBlur: (e) => {\n if (context?.modal) {\n e.preventDefault();\n requestAnimationFrame(() => {\n context?.invoker.element?.focus();\n });\n return;\n }\n onBlur?.(e as FocusEvent<HTMLDivElement>);\n context?.popover.close();\n },\n onFocus: (e) => {\n onFocus?.(e as FocusEvent<HTMLDivElement>);\n context?.popover.show();\n },\n });\n\n const onMouseEnterHandler = (e: MouseEvent<HTMLDivElement>) => {\n onMouseEnter?.(e);\n if (!context?.openOnHover) return;\n if (!context?.open) return; // Don't set hover state if popover is closed\n context.setContentHovered(true);\n };\n const onMouseLeaveHandler = (e: MouseEvent<HTMLDivElement>) => {\n onMouseLeave?.(e);\n if (!context?.openOnHover) return;\n context.setContentHovered(false);\n };\n\n const onKeyDownHandler = (e: React.KeyboardEvent<HTMLDivElement>) => {\n onKeyDown?.(e);\n if (e.code === \"Escape\" && !context?.disableCloseOnEscape) {\n context?.popover.close();\n }\n };\n\n const popoverContentRef = useMergeRefs([context?.popover.ref, ref]);\n const popoverScrollerRef = useMergeRefs([childrenRef, scrollerRef]);\n\n // Reset scroll position when popover opens\n useLayoutEffect(() => {\n if (context?.open && childrenRef.current) {\n childrenRef.current.scrollTop = 0;\n childrenRef.current.scrollLeft = 0;\n }\n }, [context?.open]);\n\n // Extract base side from actual placement for hover bridge positioning\n const bridgeSide =\n context?.openOnHover && context?.actualPlacement\n ? (context.actualPlacement.split(\"-\")[0] as\n | \"top\"\n | \"bottom\"\n | \"left\"\n | \"right\")\n : undefined;\n\n return (\n <div\n popover={\"manual\"}\n id={context?.popover.id}\n data-anv=\"popover-content\"\n data-position={bridgeSide}\n className={popoverClassNames}\n ref={popoverContentRef}\n style={combinedStyles}\n onMouseEnter={onMouseEnterHandler}\n onMouseLeave={onMouseLeaveHandler}\n role=\"region\"\n {...rest}\n onFocus={wrapperProps.onFocus}\n onBlur={wrapperProps.onBlur}\n >\n <div\n className={styles.scroller}\n role=\"presentation\"\n tabIndex={-1}\n ref={popoverScrollerRef}\n onKeyDown={onKeyDownHandler}\n onScroll={onScroll}\n onScrollCapture={onScrollCapture}\n >\n {hideWhileClosed ? (context?.open ? children : null) : children}\n </div>\n {!context?.disableCaret && (\n <span className={styles[\"arrow\"]} ref={context?.popover.arrowRef}>\n <svg aria-hidden=\"true\" width=\"14\" height=\"14\" viewBox=\"0 0 14 14\">\n <path stroke=\"none\" d=\"M0,0 H14 L7,7 Q7,7 7,7 Z\"></path>\n <clipPath id=\":r9:\">\n <rect x=\"0\" y=\"0\" width=\"14\" height=\"14\"></rect>\n </clipPath>\n </svg>\n </span>\n )}\n </div>\n );\n },\n);\n\nPopoverContent.displayName = \"PopoverContent\";\n","import {\n ReactElement,\n MouseEvent,\n KeyboardEvent,\n FocusEvent,\n RefObject,\n} from \"react\";\nimport { usePopoverContext } from \"./internal/usePopoverContext\";\n\ntype PopoverTriggerChildrenReturnType = {\n ref: RefObject<HTMLButtonElement>;\n onMouseEnter: (e: MouseEvent) => void;\n onMouseLeave: (e: MouseEvent) => void;\n onClick: (e: MouseEvent) => void;\n onKeyDown: (e: KeyboardEvent) => void;\n onBlur: (e: FocusEvent) => void;\n onFocus: (e: FocusEvent) => void;\n \"aria-haspopup\": boolean;\n \"aria-expanded\": boolean;\n \"aria-details\": HTMLElement[\"id\"];\n};\n\n/**\n * Props for the PopoverTrigger component\n */\nexport type PopoverTriggerProps = {\n /**\n * Render function that receives trigger props and returns a React element\n */\n children: (data: PopoverTriggerChildrenReturnType) => ReactElement;\n};\n\n/**\n * PopoverTrigger component for creating custom trigger elements.\n *\n * Features:\n * - Supports custom trigger elements via render prop pattern\n * - Automatic focus management and keyboard interaction\n * - Hover and click event handling\n * - Accessibility attributes (aria-haspopup, aria-expanded, aria-details)\n * - Context integration with parent popover\n *\n * @example\n * <Popover.Trigger>\n * {(props) => (\n * <button {...props}>\n * Click to open popover\n * </button>\n * )}\n * </Popover.Trigger>\n *\n * @example\n * <Popover.Trigger>\n * {(props) => (\n * <div {...props} role=\"button\" tabIndex={0}>\n * Custom trigger element\n * </div>\n * )}\n * </Popover.Trigger>\n */\nexport function PopoverTrigger(props: PopoverTriggerProps) {\n const { children } = props;\n const context = usePopoverContext();\n\n if (!context) return;\n const { element, ...rest } = context.invoker;\n\n return children(rest);\n}\n\nPopoverTrigger.displayName = \"PopoverTrigger\";\n","import { PopoverClose } from \"./PopoverClose\";\nimport { PopoverButton } from \"./PopoverButton\";\nimport { PopoverContent } from \"./PopoverContent\";\nimport { PopoverTrigger } from \"./PopoverTrigger\";\nimport {\n ComponentPropsWithoutRef,\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useId,\n useImperativeHandle,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { PopoverContext, PopoverContextProps } from \"./internal/PopoverContext\";\nimport {\n arrow,\n autoUpdate,\n computePosition,\n flip,\n limitShift,\n offset,\n Placement,\n shift,\n size,\n} from \"@floating-ui/react\";\nimport { safeHidePopover, safeShowPopover } from \"../../internal/functions\";\nimport { DisableCloseOnEscapeOrClickProps } from \"../../types\";\nimport {\n OpenCloseTransitionStateEffects,\n useOnClickOutside,\n useOptionallyControlledState,\n usePopoverTransitionStates,\n} from \"../../internal/hooks\";\nimport { DialogContext } from \"../Dialog/internal/DialogContext\";\n\n/**\n * Props for the Popover component\n * @property {ReactNode} [children] - The content to be rendered inside the popover\n * @property {string} [id] - Unique identifier for the popover\n * @property {boolean} [modal] - Whether the popover should be modal (traps focus)\n * @property {boolean} [openOnHover] - Changes interaction to use hover instead of click\n * @property {boolean} [fillAvailableHeight] - Changes height and positioning for select/combobox\n * @property {number | string} [maxHeight] - Maximum height of the popover content\n * @property {boolean} [fitScreen] - Whether the popover should fit within the screen bounds\n * @property {number | string} [minHeight] - Minimum height of the popover content\n * @property {boolean} [matchReferenceWidth] - Whether the popover width should match the trigger element\n * @property {boolean} [fixedWidth] - Whether the popover should have a fixed width\n * @property {string} [placement] - Placement of the popover relative to the trigger\n * @property {boolean} [open] - Controlled open state\n * @property {boolean} [defaultOpen] - Default open state for uncontrolled mode\n * @property {Function} [onOpenChange] - Callback when open state changes\n * @property {Function} [onClickOutside] - Callback when clicking outside the popover\n * @property {Function} [onClose] - Fires when the floating element is requested to be closed\n * @property {boolean} [disableCaret] - Whether to disable the caret/arrow indicator\n * @property {boolean} [noPadding] - Whether to remove default padding from content\n * @property {boolean} [disableAutoUpdate] - Whether to disable automatic position updates\n * @property {boolean} [disableTriggerFocus] - Whether to disable focus on the trigger element\n * @property {number} [delay] - Delay before opening the popover (for hover mode)\n * @property {boolean} [disableCloseOnClickOutside] - Whether to disable closing on outside click\n * @property {boolean} [disableCloseOnEscape] - Whether to disable closing on escape key\n */\n\n/**\n * Props for the Popover component\n * @extends ComponentPropsWithoutRef<\"div\">\n * @extends DisableCloseOnEscapeOrClickProps\n */\nexport type PopoverProps = {\n /**\n * The content to be rendered inside the popover\n */\n children?: ComponentPropsWithoutRef<\"div\">[\"children\"];\n /**\n * Unique identifier for the popover\n */\n id?: ComponentPropsWithoutRef<\"div\">[\"id\"];\n /**\n * Whether the popover should be modal (traps focus)\n * @default false\n */\n modal?: boolean;\n /**\n * Disables the shift of floating element\n * @internal\n */\n disableShift?: boolean;\n /**\n * Disables the flip of floating element\n * @internal\n */\n disableFlip?: boolean;\n /**\n * Disables the flip cross-axis fallback of floating element\n * @internal\n */\n disableFlipFallback?: boolean;\n /**\n * Changes interaction to use hover instead of click\n * @default false\n */\n openOnHover?: boolean;\n /**\n * Changes height and positioning for select/combobox\n * @default false\n */\n fillAvailableHeight?: boolean;\n /**\n * Maximum height of the popover content\n */\n maxHeight?: number | string;\n /**\n * Whether the popover should fit within the screen bounds\n * @default false\n */\n fitScreen?: boolean;\n /**\n * Minimum height of the popover content\n * @default \"2.875rem\"\n */\n minHeight?: number | string;\n /**\n * Whether the popover width should match the trigger element\n * @default false\n */\n matchReferenceWidth?: boolean;\n /**\n * Whether the popover should have a fixed width\n * @default false\n */\n fixedWidth?: boolean;\n /**\n * Placement of the popover relative to the trigger\n * @default \"bottom\"\n */\n placement?: Placement;\n /**\n * Controlled open state\n */\n open?: boolean;\n /**\n * Default open state for uncontrolled mode\n * @default false\n */\n defaultOpen?: boolean;\n /**\n * Callback when clicking outside the popover\n */\n onClickOutside?: (e: globalThis.MouseEvent) => void;\n /**\n * Fires when the floating element is requested to be closed\n * Note: this does not fire when openOnHover is true and mouse leaves to close\n * eg. on click outside, [esc] to close, or by <Popover.Close>\n */\n onClose?: () => void;\n /**\n * Whether to disable the caret/arrow indicator\n * @default false\n */\n disableCaret?: boolean;\n /**\n * Whether to remove default padding from content\n * @default false\n */\n noPadding?: boolean;\n /**\n * Whether to disable automatic position updates\n * @default false\n */\n disableAutoUpdate?: boolean;\n /**\n * Whether to disable focus on the trigger element\n * @default false\n */\n disableTriggerFocus?: boolean;\n /**\n * Delay before opening the popover (for hover mode)\n * @default 100\n */\n delay?: number;\n} & DisableCloseOnEscapeOrClickProps &\n OpenCloseTransitionStateEffects;\n\nconst PopoverElement = forwardRef((props: PopoverProps, ref) => {\n const {\n children,\n openOnHover = false,\n delay = 100,\n placement = \"bottom\",\n minHeight = \"2.875rem\",\n open,\n defaultOpen = false,\n disableShift,\n disableFlip,\n disableFlipFallback,\n matchReferenceWidth,\n id,\n disableCaret,\n fixedWidth,\n fillAvailableHeight,\n maxHeight,\n disableCloseOnClickOutside,\n disableCloseOnEscape,\n fitScreen,\n disableTriggerFocus,\n modal,\n noPadding,\n onClickOutside,\n onClose,\n onOpenAnimationStart,\n onOpenAnimationComplete,\n onCloseAnimationStart,\n onCloseAnimationComplete,\n } = props;\n const uid = useId();\n const [invoker, setInvoker] =\n useState<PopoverContextProps[\"invoker\"]>(undefined);\n const [popover, setPopover] =\n useState<PopoverContextProps[\"popover\"]>(undefined);\n const [rootNode, setRootNode] = useState<PopoverContextProps[\"rootNode\"]>();\n const [arrowElement, setArrowElement] =\n useState<PopoverContextProps[\"arrowElement\"]>(undefined);\n const [openState, setOpenState] = useOptionallyControlledState<\n PopoverContextProps[\"openState\"]\n >({\n controlledValue: open,\n defaultValue: defaultOpen,\n });\n const arrowRef = useRef<HTMLSpanElement>(null);\n const dialogContext = useContext(DialogContext);\n const [triggerHovered, setTriggerHovered] = useState(false);\n const [contentHovered, setContentHovered] = useState(false);\n // Track the actual computed placement after flip/shift middleware runs\n // (may differ from the placement prop if Floating UI adjusts it)\n const [actualPlacement, setActualPlacement] = useState<Placement | undefined>(\n placement,\n );\n\n // TODO: Find a way to test these properly!\n // Stryker disable all : Currently relying on Chromatic test for all visuals\n const processMinHeight =\n typeof minHeight === \"string\" ? minHeight : `${minHeight}px`;\n\n usePopoverTransitionStates(popover, openState, {\n onOpenAnimationStart: useCallback(() => {\n onOpenAnimationStart?.();\n }, [onOpenAnimationStart]),\n onOpenAnimationComplete: useCallback(() => {\n onOpenAnimationComplete?.();\n }, [onOpenAnimationComplete]),\n onCloseAnimationStart: useCallback(() => {\n onCloseAnimationStart?.();\n }, [onCloseAnimationStart]),\n onCloseAnimationComplete: useCallback(() => {\n onCloseAnimationComplete?.();\n }, [onCloseAnimationComplete]),\n });\n\n /* istanbul ignore next */\n const updatePosition = useCallback(() => {\n if (!invoker || !popover) return;\n // disable position update when closing\n if (!openState) return;\n computePosition(invoker, popover, {\n placement: placement,\n middleware: [\n offset(8),\n size({\n padding: 5,\n apply({ rects, availableHeight, elements }) {\n Object.assign(elements.floating.style, {\n ...(matchReferenceWidth\n ? { width: `${rects.reference.width}px` }\n : fixedWidth\n ? { width: \"40dvw\" }\n : {}),\n ...(fillAvailableHeight\n ? {\n height: `${availableHeight - 20}px`,\n minHeight: processMinHeight,\n }\n : {}),\n ...(maxHeight\n ? {\n minHeight: processMinHeight,\n height: fitScreen\n ? typeof maxHeight === \"string\"\n ? maxHeight\n : `${maxHeight}px`\n : undefined,\n maxHeight: fitScreen\n ? `${availableHeight - 20}px`\n : typeof maxHeight === \"string\"\n ? maxHeight\n : `${maxHeight}px`,\n }\n : {}),\n ...(fitScreen && !maxHeight\n ? {\n minHeight: processMinHeight,\n maxHeight: `${availableHeight - 20}px`,\n }\n : {}),\n zIndex: 1,\n });\n },\n }),\n flip({\n mainAxis: !disableFlip,\n crossAxis: false,\n fallbackAxisSideDirection: disableFlipFallback ? \"none\" : \"end\",\n padding: 5,\n }),\n shift({\n padding: 5,\n mainAxis: !disableShift,\n crossAxis: false,\n limiter: limitShift({\n mainAxis: !disableShift,\n }),\n }),\n arrow({\n element: !disableCaret && arrowElement ? arrowElement : null,\n padding: 5,\n }),\n ],\n }).then(({ x, y, placement, middlewareData }) => {\n setActualPlacement(placement);\n const side = placement.split(\"-\")[0];\n\n const staticSide = {\n top: \"bottom\",\n right: \"left\",\n bottom: \"top\",\n left: \"right\",\n }[side as \"top\" | \"right\" | \"bottom\" | \"left\"];\n\n const arrowDeg = () => {\n if (staticSide === \"top\") return 180;\n if (staticSide === \"bottom\") return 0;\n if (staticSide === \"left\") return 90;\n return 270;\n };\n\n Object.assign(popover.style, {\n left: `${x}px`,\n top: `${y}px`,\n });\n if (middlewareData.arrow && arrowElement) {\n const { x, y } = middlewareData.arrow;\n Object.assign(arrowElement.style, {\n left: x != null ? `${x}px` : \"\",\n top: y != null ? `${y}px` : \"\",\n right: \"\",\n bottom: \"\",\n [staticSide as string]: `${-arrowElement.offsetWidth + 2}px`,\n transform: `rotate(${arrowDeg()}deg)`,\n });\n }\n });\n }, [\n arrowElement,\n disableCaret,\n disableFlip,\n disableFlipFallback,\n disableShift,\n fillAvailableHeight,\n fitScreen,\n fixedWidth,\n invoker,\n matchReferenceWidth,\n maxHeight,\n openState,\n placement,\n popover,\n processMinHeight,\n ]);\n\n // Effect to add autoUpdate to eventListener\n // while the popover is opened\n useLayoutEffect(() => {\n if (!popover || !invoker) return;\n if (!openState) {\n return;\n }\n\n let requestID: number | null = null;\n const cleanup = autoUpdate(invoker, popover, () => {\n requestID = requestAnimationFrame(updatePosition);\n });\n\n return () => {\n if (requestID) cancelAnimationFrame(requestID);\n cleanup();\n };\n }, [invoker, popover, updatePosition, openState]);\n // Stryker restore all\n\n popover?.getRootNode();\n\n const popoverId = id ?? `popover-${uid.replace(/:/g, \"\")}`;\n const isControlled = typeof open !== \"undefined\";\n\n // Main function to open popover\n const openPopover = useCallback(() => {\n if (\n !popover ||\n !(rootNode as ShadowRoot | Document)?.querySelector(`#${popoverId}`)\n )\n return;\n setOpenState(true);\n }, [popover, rootNode, popoverId, setOpenState]);\n\n // Main function to close popover\n const closePopover = useCallback(\n (fn?: () => void) => {\n if (!popover || !openState) return;\n if (!openOnHover) onClose?.();\n setOpenState(false);\n\n // Reset hover states to prevent stuck state when closed programmatically\n // while mouse is still inside the popover content\n setTriggerHovered(false);\n setContentHovered(false);\n\n fn?.();\n },\n [\n popover,\n openState,\n openOnHover,\n onClose,\n setOpenState,\n setTriggerHovered,\n setContentHovered,\n ],\n );\n\n useImperativeHandle(\n ref,\n () => ({\n openPopover,\n closePopover,\n }),\n [openPopover, closePopover],\n );\n\n // Updating openness for controlled\n useEffect(() => {\n if (typeof openState === \"undefined\") return;\n if (openState) {\n if (dialogContext) {\n if (dialogContext?.ref?.current?.open) {\n safeShowPopover(popover);\n dialogContext?.setHasOpenPopover?.(true);\n }\n return;\n }\n safeShowPopover(popover);\n } else {\n safeHidePopover(popover);\n dialogContext?.setHasOpenPopover?.(false);\n }\n }, [openState, openPopover, closePopover, dialogContext, popover]);\n\n useOnClickOutside({\n disable: disableCloseOnClickOutside || !openState,\n onClickOutsideBegin: (e) => {\n if (!openState) return;\n onClickOutside?.(e);\n },\n targets: [invoker, popover],\n onClickOutside: () => {\n if (openOnHover || isControlled) return;\n closePopover();\n },\n });\n\n const value = useMemo(() => {\n return {\n popoverId,\n invoker,\n setInvoker,\n popover,\n setPopover,\n arrowElement,\n setArrowElement,\n openPopover,\n closePopover,\n placement,\n actualPlacement,\n onClose,\n openOnHover,\n openState,\n setOpenState,\n disableCloseOnClickOutside,\n fillAvailableHeight,\n maxHeight,\n matchReferenceWidth,\n fixedWidth,\n disableCaret,\n disableFlipFallback,\n disableTriggerFocus,\n disableCloseOnEscape,\n noPadding,\n controlled: isControlled,\n modal: modal,\n arrowRef,\n rootNode,\n setRootNode,\n delay,\n triggerHovered,\n setTriggerHovered,\n contentHovered,\n setContentHovered,\n };\n }, [\n popoverId,\n invoker,\n popover,\n arrowElement,\n openPopover,\n closePopover,\n placement,\n actualPlacement,\n onClose,\n openOnHover,\n openState,\n setOpenState,\n disableCloseOnClickOutside,\n fillAvailableHeight,\n maxHeight,\n matchReferenceWidth,\n fixedWidth,\n disableCaret,\n disableFlipFallback,\n disableTriggerFocus,\n disableCloseOnEscape,\n noPadding,\n isControlled,\n modal,\n rootNode,\n delay,\n triggerHovered,\n setTriggerHovered,\n contentHovered,\n setContentHovered,\n ]);\n\n return (\n <PopoverContext.Provider value={value}>{children}</PopoverContext.Provider>\n );\n});\n\nPopoverElement.displayName = \"Popover\";\n\n/**\n * Popover component for displaying floating content relative to a trigger element.\n *\n * Features:\n * - Supports both controlled and uncontrolled modes\n * - Automatic positioning with fallback strategies\n * - Hover and click interaction modes\n * - Modal and non-modal variants\n * - Custom trigger elements\n * - Automatic height and width management\n * - Screen boundary detection and fitting\n * - Keyboard navigation and accessibility\n * - Outside click detection and handling\n * - Focus management and trapping\n * - Arrow/caret indicators\n * - Delay support for hover interactions\n * - Automatic tracking ID generation for analytics\n *\n * @example\n * <Popover>\n * <Popover.Button>Click to open</Popover.Button>\n * <Popover.Content>\n * <p>This is the popover content</p>\n * <Popover.Close>Close</Popover.Close>\n * </Popover.Content>\n * </Popover>\n *\n * @example\n * <Popover openOnHover delay={1000}>\n * <Popover.Button>Hover to open</Popover.Button>\n * <Popover.Content>Tooltip content</Popover.Content>\n * </Popover>\n *\n * @example\n * <Popover modal>\n * <Popover.Trigger>\n * {(props) => <button {...props}>Custom trigger</button>}\n * </Popover.Trigger>\n * <Popover.Content>\n * <TextField label=\"Form field\" />\n * <Popover.Close>Done</Popover.Close>\n * </Popover.Content>\n * </Popover>\n */\nexport const Popover = Object.assign(PopoverElement, {\n /**\n * PopoverTrigger component for creating custom trigger elements.\n *\n * Features:\n * - Supports custom trigger elements via render prop pattern\n * - Automatic focus management and keyboard interaction\n * - Hover and click event handling\n * - Accessibility attributes (aria-haspopup, aria-expanded, aria-details)\n * - Context integration with parent popover\n * - Automatic tracking ID generation for analytics\n *\n * @example\n * <Popover.Trigger>\n * {(props) => (\n * <button {...props}>\n * Click to open popover\n * </button>\n * )}\n * </Popover.Trigger>\n */\n Trigger: PopoverTrigger,\n /**\n * PopoverContent component for the main popover content area.\n *\n * Features:\n * - Automatic positioning and sizing based on trigger\n * - Screen boundary detection and fitting\n * - Scroll handling with custom scroller reference\n * - Focus management and keyboard navigation\n * - Hover interaction support for tooltip mode\n * - Escape key handling for closing\n * - Tab key trapping for modal popovers\n * - Arrow/caret indicator with automatic positioning\n * - Context integration with parent popover\n * - Accessibility support with proper ARIA roles\n *\n * @example\n * <Popover.Content>\n * <p>This is the popover content</p>\n * <Popover.Close>Close</Popover.Close>\n * </Popover.Content>\n */\n Content: PopoverContent,\n /**\n * PopoverClose component for closing the popover.\n *\n * Features:\n * - Automatic popover closing on click\n * - Supports all Button component props and styling\n * - Controlled and uncontrolled mode support\n * - Context integration with parent popover\n * - Accessibility support with proper button semantics\n * - Delayed closing for controlled mode\n * - Automatic tracking ID generation for analytics\n *\n * @example\n * <Popover.Close>Close</Popover.Close>\n */\n Close: PopoverClose,\n /**\n * PopoverButton component for creating button-style triggers.\n *\n * Features:\n * - Button styling and behavior with all Button props\n * - Automatic popover opening on click\n * - Hover interaction support for tooltip mode\n * - Focus management and keyboard navigation\n * - Accessibility attributes (aria-haspopup, aria-expanded, aria-details)\n * - Context integration with parent popover\n * - Event handling for mouse, keyboard, and focus events\n * - Automatic tracking ID generation for analytics\n *\n * @example\n * <Popover.Button>Click to open</Popover.Button>\n */\n Button: PopoverButton,\n});\n"],"names":["PopoverClose","PopoverButton","PopoverContent","arrow","placement","x","y"],"mappings":";;;;;;;;;;;;;;;;AAgDO,MAAM,cAAA,GAAiB,cAA0C,IAAI,CAAA;;ACpCrE,SAAS,iBAAA,GAAoB;AAClC,EAAA,MAAM,OAAA,GAAU,WAAW,cAAc,CAAA;AACzC,EAAA,MAAM,UAAA,GAAa,OAA0B,IAAI,CAAA;AACjD,EAAA,MAAM,UAAA,GAAa,OAAuB,IAAI,CAAA;AAC9C,EAAA,MAAM,QAAA,GAAW,OAAwB,IAAI,CAAA;AAC7C,EAAA,MAAM,EAAE,cAAA,EAAgB,iBAAA,EAAmB,cAAA,EAAe,GAAI,WAAW,EAAC;AAE1E,EAAA,eAAA,CAAgB,M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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAqBnD,OAAA,EAAS,cAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAsBT,OAAA,EAAS,cAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAgBT,KAAA,EAAO,YAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAiBP,MAAA,EAAQ;AACV,CAAC;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { createContext, useContext, forwardRef, useCallback, useRef, useEffect, useLayoutEffect, useId, useImperativeHandle, useMemo } from 'react';
|
|
3
|
-
import { F as FloatingFocusManager, a as useFloating, b as useRole, c as useHover, s as safePolygon, d as useFocus, e as useClick, f as useDismiss, g as useInteractions } from './floating-ui.react-
|
|
3
|
+
import { F as FloatingFocusManager, a as useFloating, b as useRole, c as useHover, s as safePolygon, d as useFocus, e as useClick, f as useDismiss, g as useInteractions } from './floating-ui.react-C_s3_nEb.js';
|
|
4
4
|
import { B as Button } from './Button-CVsGhVJz.js';
|
|
5
5
|
import { useTrackingId } from './useTrackingId.js';
|
|
6
6
|
import { c as childrenToString } from './childrenToString-Bz9MqbHb.js';
|
|
@@ -120,7 +120,7 @@ const PopoverContent = forwardRef(
|
|
|
120
120
|
modal,
|
|
121
121
|
openOnHover,
|
|
122
122
|
noPadding,
|
|
123
|
-
|
|
123
|
+
enableCaret,
|
|
124
124
|
triggerId,
|
|
125
125
|
role
|
|
126
126
|
} = usePopoverContext();
|
|
@@ -197,7 +197,7 @@ const PopoverContent = forwardRef(
|
|
|
197
197
|
children: hideWhileClosed ? openState ? children : null : children
|
|
198
198
|
}
|
|
199
199
|
),
|
|
200
|
-
|
|
200
|
+
enableCaret && /* @__PURE__ */ jsx("span", { className: styles["arrow"], ref: arrowRef, style: arrowStyle, children: /* @__PURE__ */ jsx("svg", { "aria-hidden": "true", width: "14", height: "14", viewBox: "0 0 14 14", children: /* @__PURE__ */ jsx("path", { stroke: "none", d: "M0,0 H14 L7,7 Q7,7 7,7 Z" }) }) })
|
|
201
201
|
]
|
|
202
202
|
}
|
|
203
203
|
);
|
|
@@ -241,7 +241,7 @@ const PopoverElement = forwardRef((props, ref) => {
|
|
|
241
241
|
onClickOutside,
|
|
242
242
|
openOnHover = false,
|
|
243
243
|
delay = 100,
|
|
244
|
-
|
|
244
|
+
enableCaret,
|
|
245
245
|
noPadding,
|
|
246
246
|
matchReferenceWidth,
|
|
247
247
|
fixedWidth,
|
|
@@ -345,7 +345,7 @@ const PopoverElement = forwardRef((props, ref) => {
|
|
|
345
345
|
}),
|
|
346
346
|
isAuto ? autoPlacement({ allowedPlacements, padding: 5 }) : flip({
|
|
347
347
|
crossAxis: false,
|
|
348
|
-
fallbackAxisSideDirection: "
|
|
348
|
+
fallbackAxisSideDirection: "none",
|
|
349
349
|
fallbackPlacements,
|
|
350
350
|
padding: 5
|
|
351
351
|
}),
|
|
@@ -430,7 +430,7 @@ const PopoverElement = forwardRef((props, ref) => {
|
|
|
430
430
|
modal,
|
|
431
431
|
openOnHover,
|
|
432
432
|
noPadding,
|
|
433
|
-
|
|
433
|
+
enableCaret,
|
|
434
434
|
role: roleProp
|
|
435
435
|
}),
|
|
436
436
|
[
|
|
@@ -452,7 +452,7 @@ const PopoverElement = forwardRef((props, ref) => {
|
|
|
452
452
|
modal,
|
|
453
453
|
openOnHover,
|
|
454
454
|
noPadding,
|
|
455
|
-
|
|
455
|
+
enableCaret,
|
|
456
456
|
roleProp
|
|
457
457
|
]
|
|
458
458
|
);
|
|
@@ -532,4 +532,4 @@ const Popover = Object.assign(PopoverElement, {
|
|
|
532
532
|
});
|
|
533
533
|
|
|
534
534
|
export { Popover as P };
|
|
535
|
-
//# sourceMappingURL=Popover-
|
|
535
|
+
//# sourceMappingURL=Popover-DxZF6lbJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Popover-DxZF6lbJ.js","sources":["../src/internal/components/Popover/internal/PopoverContext.ts","../src/internal/components/Popover/internal/usePopoverContext.tsx","../src/internal/components/Popover/PopoverClose.tsx","../src/internal/components/Popover/PopoverButton.tsx","../src/internal/components/Popover/PopoverContent.tsx","../src/internal/components/Popover/PopoverTrigger.tsx","../src/internal/components/Popover/Popover.tsx"],"sourcesContent":["import { createContext, CSSProperties, RefObject, HTMLProps } from \"react\";\nimport { FloatingContext, MiddlewareData, Placement } from \"@floating-ui/react\";\nimport type { PopoverRole } from \"../Popover\";\n\nexport type PopoverContextProps = {\n /** Context object from useFloating; required by FloatingFocusManager and interaction hooks. */\n floatingContext: FloatingContext;\n /** Callback refs from useFloating; setReference for the trigger, setFloating for the content. */\n refs: {\n setReference: (node: Element | null) => void;\n setFloating: (node: HTMLElement | null) => void;\n };\n /** Inline positioning styles from useFloating; applied to the content element. */\n floatingStyles: CSSProperties;\n /** Middleware output from useFloating; used for arrow positioning via middlewareData.arrow. */\n middlewareData: MiddlewareData;\n /** Merged prop getter for the trigger; spreads ARIA attributes and event handlers. */\n getReferenceProps: (\n userProps?: HTMLProps<Element>,\n ) => Record<string, unknown>;\n /** Merged prop getter for the content; spreads ARIA attributes and event handlers. */\n getFloatingProps: (\n userProps?: HTMLProps<HTMLElement>,\n ) => Record<string, unknown>;\n /** Auto-generated id for the trigger element; used as the default aria-labelledby on content. */\n triggerId: string;\n /** Current open/closed state. */\n openState: boolean;\n /** Opens the popover. */\n openPopover: () => void;\n /** Closes the popover. Fires onClose unless opened via hover. */\n closePopover: () => void;\n /** Whether the open state is externally controlled. */\n controlled: boolean;\n /** Resolved placement after flip/shift middleware; may differ from the placement prop. */\n actualPlacement: Placement;\n /** Ref attached to the arrow span element inside PopoverContent. */\n arrowRef: RefObject<HTMLSpanElement>;\n /** Whether the popover traps focus (modal) or closes on Tab-out (non-modal). Only applies when role is \"dialog\". */\n modal?: boolean;\n /** Whether the popover opens on hover/focus instead of click. Only applies when role is \"dialog\". */\n openOnHover: boolean;\n /** Whether to remove default padding from the content area. */\n noPadding?: boolean;\n /** Whether to show the arrow/caret indicator. */\n enableCaret?: boolean;\n /** The ARIA role of the popup. Drives FloatingFocusManager and ARIA attribute behavior. */\n role: PopoverRole;\n};\n\nexport const PopoverContext = createContext<PopoverContextProps | null>(null);\n","import { useContext } from \"react\";\nimport { PopoverContext } from \"./PopoverContext\";\n\n/**\n * Returns the PopoverContext for use within Popover compound components.\n * @returns The current PopoverContextProps value.\n * @throws Error if called outside a Popover component.\n */\nexport function usePopoverContext() {\n const context = useContext(PopoverContext);\n if (!context) {\n throw new Error(\n \"Popover compound components must be used within a <Popover> component.\",\n );\n }\n return context;\n}\n","import { forwardRef, useCallback, type MouseEvent } from \"react\";\nimport { Button, ButtonProps } from \"../../../components/Button\";\nimport { usePopoverContext } from \"./internal/usePopoverContext\";\nimport { childrenToString } from \"../../../internal/functions\";\nimport { DataTrackingId } from \"../../../types\";\nimport { useTrackingId } from \"../../../hooks\";\n\n/**\n * Props for the PopoverClose component.\n * @extends ButtonProps\n */\nexport type PopoverCloseProps = ButtonProps & DataTrackingId;\n\n/**\n * PopoverClose component for closing the popover.\n *\n * Features:\n * - Supports all Button component props and styling\n * - Closes the popover on click via closePopover\n * - Automatic tracking ID generation for analytics\n *\n * @example\n * <Popover.Close>Close</Popover.Close>\n *\n * @example\n * <Popover.Close appearance=\"secondary\" size=\"small\">\n * Cancel\n * </Popover.Close>\n */\nexport const PopoverClose = forwardRef<HTMLButtonElement, PopoverCloseProps>(\n function PopoverClose(props, ref) {\n const { onClick, ...rest } = props;\n const { closePopover } = usePopoverContext();\n\n const trackingId = useTrackingId({\n name: \"PopoverClose\",\n data: { children: childrenToString(props.children) },\n hasOverride: !!props[\"data-tracking-id\"],\n });\n\n const handleClick = useCallback(\n (event: MouseEvent<HTMLButtonElement>) => {\n closePopover();\n onClick?.(event);\n },\n [closePopover, onClick],\n );\n\n return (\n <Button\n ref={ref}\n data-tracking-id={trackingId}\n data-anv=\"popover-close\"\n {...rest}\n onClick={handleClick}\n />\n );\n },\n);\n\nPopoverClose.displayName = \"PopoverClose\";\n","import { forwardRef, type HTMLProps } from \"react\";\nimport { Button, ButtonProps } from \"../../../components/Button\";\nimport { useMergeRefs, useTrackingId } from \"../../../hooks\";\nimport { usePopoverContext } from \"./internal/usePopoverContext\";\nimport { childrenToString } from \"../../../internal/functions\";\nimport { DataTrackingId } from \"../../../types\";\n\n/**\n * Props for the PopoverButton component.\n * @extends ButtonProps\n */\nexport type PopoverButtonProps = ButtonProps & DataTrackingId;\n\n/**\n * PopoverButton component for creating button-style triggers.\n *\n * Features:\n * - Button styling and behavior with all Button props\n * - ARIA attributes and event handlers injected via getReferenceProps\n * - Automatic tracking ID generation for analytics\n *\n * @example\n * <Popover.Button>Click to open</Popover.Button>\n *\n * @example\n * <Popover.Button appearance=\"primary\" size=\"large\" icon={InfoIcon}>\n * Information\n * </Popover.Button>\n */\nexport const PopoverButton = forwardRef<HTMLButtonElement, PopoverButtonProps>(\n function PopoverButton(props, ref) {\n const { children, ...rest } = props;\n const { refs, getReferenceProps, openState, triggerId } =\n usePopoverContext();\n\n const trackingId = useTrackingId({\n name: \"PopoverButton\",\n data: {\n children: childrenToString(props.children),\n appearance: props.appearance,\n icon: props.icon,\n size: props.size,\n type: props.type,\n },\n hasOverride: !!props[\"data-tracking-id\"],\n });\n\n const buttonRef = useMergeRefs([refs.setReference, ref]);\n\n return (\n <Button\n id={triggerId}\n ref={buttonRef}\n data-anv=\"popover-button\"\n data-tracking-id={trackingId}\n data-state={openState ? \"open\" : \"closed\"}\n {...(getReferenceProps(rest as HTMLProps<Element>) as ButtonProps)}\n >\n {children}\n </Button>\n );\n },\n);\n\nPopoverButton.displayName = \"PopoverButton\";\n","import {\n ComponentPropsWithoutRef,\n CSSProperties,\n forwardRef,\n HTMLAttributes,\n RefObject,\n useEffect,\n useLayoutEffect,\n useRef,\n} from \"react\";\nimport { FloatingFocusManager } from \"@floating-ui/react\";\nimport styles from \"./Popover.module.scss\";\nimport cx from \"classnames\";\nimport { useMergeRefs } from \"../../../hooks\";\nimport { usePopoverContext } from \"./internal/usePopoverContext\";\n\n/**\n * Props for the PopoverContent component.\n * @extends ComponentPropsWithoutRef<\"div\">\n */\nexport type PopoverContentProps = Omit<\n ComponentPropsWithoutRef<\"div\">,\n \"popover\"\n> & {\n /** Reference to the scrollable content area. */\n scrollerRef?: RefObject<HTMLDivElement>;\n /** Whether to unmount children from the DOM while the popover is closed. Useful for performance when the content is expensive to render. */\n hideWhileClosed?: boolean;\n};\n\n/**\n * PopoverContent component for the main popover content area.\n *\n * Features:\n * - HTML Popover API top-layer rendering (popover=\"manual\")\n * - Floating UI positioning via refs.setFloating and floatingStyles\n * - FloatingFocusManager for focus trapping (modal) or Tab-out closing (non-modal)\n * - Arrow/caret indicator with position computed from middlewareData.arrow\n * - Scroll position reset when the popover opens\n * - Optional scrollerRef for external scroll access\n *\n * @example\n * <Popover.Content>\n * <p>Popover content</p>\n * <Popover.Close>Close</Popover.Close>\n * </Popover.Content>\n */\nexport const PopoverContent = forwardRef<HTMLDivElement, PopoverContentProps>(\n function PopoverContent(props, ref) {\n const {\n children,\n className,\n style,\n onScroll,\n onScrollCapture,\n scrollerRef,\n hideWhileClosed = false,\n ...rest\n } = props;\n\n const {\n floatingContext,\n refs,\n floatingStyles,\n middlewareData,\n getFloatingProps,\n openState,\n actualPlacement,\n arrowRef,\n modal,\n openOnHover,\n noPadding,\n enableCaret,\n triggerId,\n role,\n } = usePopoverContext();\n\n const scrollContainerRef = useRef<HTMLDivElement>(null);\n const mergedFloatingRef = useMergeRefs([refs.setFloating, ref]);\n const mergedScrollerRef = useMergeRefs([scrollContainerRef, scrollerRef]);\n\n // FloatingFocusManager's built-in returnFocus never fires since the element\n // stays mounted (popover=\"manual\"). Manually return focus to the trigger on\n // close; skip on initial render and for hover popovers (would re-trigger useFocus).\n // Applies to all roles — non-dialog keyboard navigation (e.g. Listbox arrow keys)\n // can move DOM focus into the content, so we must always return focus on close.\n const hasBeenOpenRef = useRef(false);\n useEffect(() => {\n if (openState) {\n hasBeenOpenRef.current = true;\n } else if (hasBeenOpenRef.current && !openOnHover) {\n // Only return focus to the reference if focus hasn't already moved to another\n // interactive element (e.g. Tab-out on combobox popovers like DateField).\n // If focus is still inside the floating content or on document.body (no meaningful\n // target), return focus to the reference as normal.\n const activeEl = document.activeElement;\n const floating = floatingContext.elements.floating;\n // For dialog role: return focus if stranded (null, body, or inside floating).\n // For non-dialog (combobox) roles: only return focus if it's still inside the\n // floating — hidePopover() already restores focus on close, so the body check\n // is not needed and would incorrectly return focus on Tab-out.\n const shouldReturnFocus =\n role === \"dialog\"\n ? !activeEl ||\n activeEl === document.body ||\n floating?.contains(activeEl)\n : floating?.contains(activeEl);\n if (shouldReturnFocus) {\n (floatingContext.elements.reference as HTMLElement | null)?.focus();\n }\n }\n }, [\n openState,\n openOnHover,\n floatingContext.elements.reference,\n floatingContext.elements.floating,\n role,\n ]);\n\n // Reset scroll position when popover opens.\n useLayoutEffect(() => {\n if (openState && scrollContainerRef.current) {\n scrollContainerRef.current.scrollTop = 0;\n scrollContainerRef.current.scrollLeft = 0;\n }\n }, [openState]);\n\n // Arrow x/y offset along the floating edge; static side is opposite the placement.\n const arrowX = middlewareData.arrow?.x ?? null;\n const arrowY = middlewareData.arrow?.y ?? null;\n const baseSide = actualPlacement.split(\"-\")[0] as\n | \"top\"\n | \"bottom\"\n | \"left\"\n | \"right\";\n const staticSide = (\n { top: \"bottom\", right: \"left\", bottom: \"top\", left: \"right\" } as const\n )[baseSide];\n\n // SVG path is a downward triangle by default; rotate to match placement direction.\n const arrowDeg =\n staticSide === \"top\"\n ? 180\n : staticSide === \"bottom\"\n ? 0\n : staticSide === \"left\"\n ? 90\n : 270;\n\n // Pull the arrow past the content edge by its width minus 2px border overlap.\n const arrowWidth = arrowRef.current?.offsetWidth ?? 14;\n const arrowStyle: CSSProperties = {};\n if (arrowX != null) arrowStyle.left = `${arrowX}px`;\n if (arrowY != null) arrowStyle.top = `${arrowY}px`;\n (arrowStyle as Record<string, string>)[staticSide] = `${-arrowWidth + 2}px`;\n arrowStyle.transform = `rotate(${arrowDeg}deg)`;\n\n // For dialog role: default aria-labelledby → trigger for unique accessible names.\n // Use the reference element's actual id (which may differ from triggerId if an external\n // id was passed to Popover.Button — e.g. ToolbarOverflowMenu passes its own menuTriggerId).\n // Fall back to triggerId if the reference element is not yet mounted.\n // For non-dialog roles: omitted — the inner component (e.g. Listbox) owns its own label.\n const referenceId =\n (floatingContext.elements.reference as HTMLElement | null)?.id ??\n triggerId;\n const defaultLabelProps =\n role === \"dialog\" &&\n !(\"aria-label\" in rest) &&\n !(\"aria-labelledby\" in rest)\n ? { \"aria-labelledby\": referenceId }\n : {};\n\n // Remove hover content from the tab order — hover popovers contain read-only text.\n const tabIndexOverride = openOnHover ? { tabIndex: -1 } : {};\n\n // For non-dialog roles, strip the role attribute from getFloatingProps — useRole sets\n // role=\"listbox\" (etc.) on the content div, but the inner component owns that role.\n // The content div is a neutral positioning wrapper in the combobox pattern.\n const rawFloatingProps = getFloatingProps({\n ...defaultLabelProps,\n ...tabIndexOverride,\n ...rest,\n }) as HTMLAttributes<HTMLDivElement>;\n const { role: _suppressedRole, ...floatingPropsWithoutRole } =\n rawFloatingProps as Record<string, unknown>;\n const floatingProps =\n role === \"dialog\"\n ? rawFloatingProps\n : (floatingPropsWithoutRole as HTMLAttributes<HTMLDivElement>);\n\n const contentDiv = (\n <div\n popover=\"manual\"\n data-anv=\"popover-content\"\n className={cx(className, styles[\"content\"], {\n [styles[\"no-padding\"]]: noPadding,\n })}\n ref={mergedFloatingRef}\n style={{ ...floatingStyles, ...style }}\n {...floatingProps}\n >\n <div\n className={styles.scroller}\n role=\"presentation\"\n tabIndex={-1}\n ref={mergedScrollerRef}\n onScroll={onScroll}\n onScrollCapture={onScrollCapture}\n >\n {hideWhileClosed ? (openState ? children : null) : children}\n </div>\n {enableCaret && (\n <span className={styles[\"arrow\"]} ref={arrowRef} style={arrowStyle}>\n <svg aria-hidden=\"true\" width=\"14\" height=\"14\" viewBox=\"0 0 14 14\">\n <path stroke=\"none\" d=\"M0,0 H14 L7,7 Q7,7 7,7 Z\" />\n </svg>\n </span>\n )}\n </div>\n );\n\n if (role !== \"dialog\") {\n return contentDiv;\n }\n\n return (\n <FloatingFocusManager\n context={floatingContext}\n modal={modal ?? false}\n disabled={!openState || openOnHover}\n >\n {contentDiv}\n </FloatingFocusManager>\n );\n },\n);\n\nPopoverContent.displayName = \"PopoverContent\";\n","import {\n type AriaAttributes,\n ReactElement,\n MouseEvent,\n KeyboardEvent,\n FocusEvent,\n} from \"react\";\nimport { usePopoverContext } from \"./internal/usePopoverContext\";\n\n/** Props passed to the PopoverTrigger render function. */\ntype PopoverTriggerChildrenProps = {\n ref: (node: Element | null) => void;\n id: string;\n \"aria-controls\"?: string;\n \"aria-haspopup\"?: AriaAttributes[\"aria-haspopup\"];\n \"aria-expanded\"?: boolean;\n \"data-state\": \"open\" | \"closed\";\n onClick?: (e: MouseEvent) => void;\n onKeyDown?: (e: KeyboardEvent) => void;\n onMouseEnter?: (e: MouseEvent) => void;\n onMouseLeave?: (e: MouseEvent) => void;\n onFocus?: (e: FocusEvent) => void;\n onBlur?: (e: FocusEvent) => void;\n};\n\n/**\n * Props for the PopoverTrigger component.\n */\nexport type PopoverTriggerProps = {\n /**\n * Render function that receives trigger props and returns a React element.\n */\n children: (props: PopoverTriggerChildrenProps) => ReactElement;\n};\n\n/**\n * PopoverTrigger component for creating custom trigger elements.\n *\n * Features:\n * - Render prop pattern for full control over the trigger element\n * - ARIA attributes and event handlers injected via getReferenceProps\n *\n * @example\n * <Popover.Trigger>\n * {(props) => (\n * <Button {...props}>\n * Click to open popover\n * </Button>\n * )}\n * </Popover.Trigger>\n */\nexport function PopoverTrigger(props: PopoverTriggerProps) {\n const { children } = props;\n const { refs, getReferenceProps, openState, triggerId } = usePopoverContext();\n\n return children({\n ...(getReferenceProps({\n ref: refs.setReference,\n }) as PopoverTriggerChildrenProps),\n id: triggerId,\n \"data-state\": openState ? \"open\" : \"closed\",\n });\n}\n\nPopoverTrigger.displayName = \"PopoverTrigger\";\n","import {\n forwardRef,\n ReactNode,\n useCallback,\n useContext,\n useEffect,\n useId,\n useImperativeHandle,\n useMemo,\n useRef,\n} from \"react\";\nimport {\n arrow,\n autoPlacement,\n autoUpdate,\n flip,\n limitShift,\n offset,\n Placement,\n safePolygon,\n shift,\n size,\n useClick,\n useDismiss,\n useFloating,\n useFocus,\n useHover,\n useInteractions,\n useRole,\n} from \"@floating-ui/react\";\nimport { PopoverClose } from \"./PopoverClose\";\nimport { PopoverButton } from \"./PopoverButton\";\nimport { PopoverContent } from \"./PopoverContent\";\nimport { PopoverTrigger } from \"./PopoverTrigger\";\nimport { PopoverContext, PopoverContextProps } from \"./internal/PopoverContext\";\nimport { safeHidePopover, safeShowPopover } from \"../../../internal/functions\";\nimport { DisableCloseOnEscapeOrClickProps } from \"../../../types\";\nimport {\n OpenCloseTransitionStateEffects,\n useOptionallyControlledState,\n usePopoverTransitionStates,\n} from \"../../../internal/hooks\";\nimport { DialogContext } from \"../../../components/Dialog/internal/DialogContext\";\n\n/** ARIA role of the beta Popover popup. */\nexport type PopoverRole = \"dialog\" | \"listbox\" | \"tree\" | \"grid\";\n\n/**\n * Sub-options for `placement=\"auto\"`. Constrains which sides `autoPlacement()`\n * may choose from. Ignored when a specific placement is set.\n */\nexport type PopoverAutoPlacementConfig = {\n /** Limits which sides autoPlacement() considers. Defaults to all sides. */\n allowedPlacements?: Placement[];\n};\n\n/**\n * Sub-options for a specific placement (e.g. `\"bottom\"`). Overrides the default\n * opposite-side fallback sequence used by `flip()`. Ignored when `placement=\"auto\"`.\n */\nexport type PopoverFlipPlacementConfig = {\n /** Explicit fallback sequence for flip(). Overrides the default opposite-side fallback. */\n fallbackPlacements?: Placement[];\n};\n\ntype PopoverPropsBase = {\n /** Content to render inside the popover tree. */\n children?: ReactNode;\n /** Controlled open state. */\n open?: boolean;\n /** Initial open state for uncontrolled mode. @default false */\n defaultOpen?: boolean;\n /** Fires when the popover closes for any non-hover reason. */\n onClose?: () => void;\n /** Fires when the user clicks outside the popover. Not fired when disableCloseOnClickOutside is set. */\n onClickOutside?: (e: globalThis.MouseEvent) => void;\n /** Whether to show the arrow/caret indicator. @default false */\n enableCaret?: boolean;\n /** Whether to remove default padding from the content area. @default false */\n noPadding?: boolean;\n /** Whether the popover width should match the trigger element width. @default false */\n matchReferenceWidth?: boolean;\n /** Whether the popover should have a fixed width of 40dvw. @default false */\n fixedWidth?: boolean;\n /** Fills available viewport height between the trigger and viewport edge. @default false */\n fillAvailableHeight?: boolean;\n /** Maximum height of the popover content. */\n maxHeight?: number | string;\n /** Constrains the popover to available viewport height. @default false */\n fitScreen?: boolean;\n /** Minimum height of the popover content. @default \"2.875rem\" */\n minHeight?: number | string;\n} & DisableCloseOnEscapeOrClickProps &\n OpenCloseTransitionStateEffects;\n\n/**\n * Role-specific props for `role=\"dialog\"` (default).\n *\n * Only dialog popovers use `FloatingFocusManager` — focus moves into the content\n * on open. The `modal`, `openOnHover`, and `delay` props are only meaningful\n * in this context.\n */\ntype DialogRoleProps = {\n /**\n * The ARIA role of the popup. Drives `aria-haspopup` on the trigger and\n * `role` on the content via Floating UI's `useRole`.\n *\n * @default \"dialog\"\n */\n role?: \"dialog\";\n /** Traps focus until closed (modal) or closes on Tab-out (non-modal). @default false */\n modal?: boolean;\n /**\n * Whether the popover opens on hover instead of click. @default false\n *\n * @remarks\n * Hover-triggered popovers should contain only readable text — no interactive\n * elements (buttons, links, inputs). The content is intentionally removed from\n * the tab order so Tab moves cleanly between page elements. Interactive content\n * inside a hover-triggered popover is unreachable by keyboard users. Use a\n * click-triggered popover (default) when the content includes interactive elements.\n */\n openOnHover?: boolean;\n /** Delay in ms before opening on hover. @default 100 */\n delay?: number;\n};\n\n/**\n * Role-specific props for combobox popup roles (`listbox`, `tree`, `grid`).\n *\n * These roles follow the ARIA combobox pattern — focus stays on the trigger and\n * the inner component (e.g. `Listbox`) owns the role and keyboard navigation.\n * `FloatingFocusManager` is disabled. `modal`, `openOnHover`, and `delay` are\n * not applicable and are excluded at the type level.\n *\n * @remarks\n * Floating UI adds `role=\"combobox\"` to the trigger element for these roles.\n * The `combobox` ARIA role only accepts names from `aria-label` or\n * `aria-labelledby` — visible text content is not used. Always provide an\n * explicit `aria-label` on `Popover.Button` or your custom trigger.\n *\n * @example\n * // ✅ Correct — explicit aria-label required for non-dialog roles\n * <Popover role=\"listbox\">\n * <Popover.Button aria-label=\"Select an option\">Open</Popover.Button>\n * <Popover.Content>\n * <Listbox>...</Listbox>\n * </Popover.Content>\n * </Popover>\n */\ntype NonDialogRoleProps = {\n /** The ARIA role of the popup. */\n role: Exclude<PopoverRole, \"dialog\">;\n modal?: never;\n openOnHover?: never;\n delay?: never;\n};\n\ntype WithAutoPlacement = {\n /**\n * Uses `autoPlacement()` — picks the side with the most space. Pass\n * a specific placement (e.g. `\"bottom\"`) to express a preferred side\n * with `flip()` fallback instead.\n */\n placement?: \"auto\";\n /** Sub-options for `autoPlacement()`. */\n placementConfig?: PopoverAutoPlacementConfig;\n};\n\ntype WithSpecificPlacement = {\n /**\n * Preferred placement relative to the trigger. Floating UI's `flip()`\n * middleware will adapt to the opposite side if there is not enough space.\n * Pass `\"auto\"` to let Floating UI pick the best side automatically.\n *\n * @default \"bottom\"\n */\n placement: Placement;\n /** Sub-options for `flip()`. */\n placementConfig?: PopoverFlipPlacementConfig;\n};\n\n/**\n * Props for the beta Popover component.\n *\n * Two independent discriminated unions are combined:\n * - **Role**: `role=\"dialog\"` (default) enables `FloatingFocusManager` and accepts `modal`,\n * `openOnHover`, and `delay`. Non-dialog roles (`listbox`, `tree`, `grid`) disable\n * focus management — the inner component owns focus and keyboard navigation.\n * - **Placement**: `placement=\"auto\"` uses `autoPlacement()` and accepts\n * `placementConfig.allowedPlacements`. Specific placements use `flip()` and accept\n * `placementConfig.fallbackPlacements`.\n *\n * @extends DisableCloseOnEscapeOrClickProps\n * @extends OpenCloseTransitionStateEffects\n */\nexport type PopoverProps =\n | (PopoverPropsBase & DialogRoleProps & WithAutoPlacement)\n | (PopoverPropsBase & DialogRoleProps & WithSpecificPlacement)\n | (PopoverPropsBase & NonDialogRoleProps & WithAutoPlacement)\n | (PopoverPropsBase & NonDialogRoleProps & WithSpecificPlacement);\n\nconst PopoverElement = forwardRef((props: PopoverProps, ref) => {\n const {\n children,\n role: roleProp = \"dialog\",\n modal,\n open,\n defaultOpen = false,\n onClose,\n onClickOutside,\n openOnHover = false,\n delay = 100,\n enableCaret,\n noPadding,\n matchReferenceWidth,\n fixedWidth,\n fillAvailableHeight,\n maxHeight,\n fitScreen,\n minHeight = \"2.875rem\",\n disableCloseOnClickOutside,\n disableCloseOnEscape,\n onOpenAnimationStart,\n onOpenAnimationComplete,\n onCloseAnimationStart,\n onCloseAnimationComplete,\n } = props;\n\n const isAuto = props.placement === \"auto\";\n const floatingPlacement: Placement = isAuto\n ? \"bottom\"\n : ((props.placement ?? \"bottom\") as Placement);\n const allowedPlacements = isAuto\n ? (props.placementConfig as PopoverAutoPlacementConfig | undefined)\n ?.allowedPlacements\n : undefined;\n const fallbackPlacements = !isAuto\n ? (props.placementConfig as PopoverFlipPlacementConfig | undefined)\n ?.fallbackPlacements\n : undefined;\n\n const uid = useId();\n const cleanUid = uid.replace(/:/g, \"\");\n const triggerId = `popover-trigger-${cleanUid}`;\n const isControlled = typeof open !== \"undefined\";\n const arrowRef = useRef<HTMLSpanElement>(null);\n // Tracks pointer events to distinguish click-outside focus-loss from Tab-out,\n // so disableCloseOnClickOutside blocks the former without blocking the latter.\n const isPointerEventRef = useRef(false);\n\n const processMinHeight =\n typeof minHeight === \"string\" ? minHeight : `${minHeight}px`;\n\n const dialogContext = useContext(DialogContext);\n\n const [openState, setOpenState] = useOptionallyControlledState<boolean>({\n controlledValue: open,\n defaultValue: defaultOpen,\n });\n\n // Stable ref so closePopover doesn't need openState as a dep.\n const openStateRef = useRef(openState);\n openStateRef.current = openState;\n\n // Track pointer events so handleOpenChange can block click-outside focus-loss\n // when disableCloseOnClickOutside is set. Only needed for dialog role —\n // FloatingFocusManager (which causes the false close) is disabled for other roles.\n useEffect(() => {\n if (!disableCloseOnClickOutside) return;\n if (roleProp !== \"dialog\") return;\n const setTrue = () => {\n isPointerEventRef.current = true;\n };\n const setFalse = () => {\n setTimeout(() => {\n isPointerEventRef.current = false;\n }, 0);\n };\n document.addEventListener(\"pointerdown\", setTrue);\n document.addEventListener(\"pointerup\", setFalse);\n return () => {\n document.removeEventListener(\"pointerdown\", setTrue);\n document.removeEventListener(\"pointerup\", setFalse);\n };\n }, [disableCloseOnClickOutside, roleProp]);\n\n // Fires onClose for non-hover closes; blocks click-outside when disableCloseOnClickOutside is set.\n const handleOpenChange = useCallback(\n (nextOpen: boolean) => {\n // FloatingFocusManager fires onOpenChange(false) on both Tab-out and click-outside; block the latter.\n if (!nextOpen && disableCloseOnClickOutside && isPointerEventRef.current)\n return;\n if (!nextOpen && !openOnHover) onClose?.();\n setOpenState(nextOpen);\n },\n [openOnHover, onClose, setOpenState, disableCloseOnClickOutside],\n );\n\n const openPopover = useCallback(() => {\n setOpenState(true);\n }, [setOpenState]);\n\n const closePopover = useCallback(() => {\n if (!openStateRef.current) return;\n if (!openOnHover) onClose?.();\n setOpenState(false);\n }, [openOnHover, onClose, setOpenState]);\n\n const {\n refs,\n floatingStyles,\n context: floatingContext,\n placement: actualPlacement,\n middlewareData,\n } = useFloating({\n open: openState,\n onOpenChange: handleOpenChange,\n placement: floatingPlacement,\n strategy: \"absolute\",\n middleware: [\n offset(8),\n size({\n padding: 5,\n apply({ rects, availableHeight, elements }) {\n // Applied as inline styles — size middleware runs at positioning time with live measurements.\n Object.assign(elements.floating.style, {\n ...(matchReferenceWidth\n ? { width: `${rects.reference.width}px` }\n : fixedWidth\n ? { width: \"40dvw\" }\n : {}),\n ...(fillAvailableHeight\n ? {\n height: `${availableHeight - 20}px`,\n minHeight: processMinHeight,\n }\n : {}),\n ...(maxHeight\n ? {\n minHeight: processMinHeight,\n height: fitScreen\n ? typeof maxHeight === \"string\"\n ? maxHeight\n : `${maxHeight}px`\n : undefined,\n maxHeight: fitScreen\n ? `${availableHeight - 20}px`\n : typeof maxHeight === \"string\"\n ? maxHeight\n : `${maxHeight}px`,\n }\n : {}),\n ...(fitScreen && !maxHeight\n ? {\n minHeight: processMinHeight,\n maxHeight: `${availableHeight - 20}px`,\n }\n : {}),\n });\n },\n }),\n isAuto\n ? autoPlacement({ allowedPlacements, padding: 5 })\n : flip({\n crossAxis: false,\n fallbackAxisSideDirection: \"none\",\n fallbackPlacements,\n padding: 5,\n }),\n shift({\n padding: 5,\n crossAxis: false,\n limiter: limitShift(),\n }),\n arrow({ element: arrowRef, padding: 5 }),\n ],\n whileElementsMounted: autoUpdate,\n });\n\n const role = useRole(floatingContext, { role: roleProp });\n\n const hover = useHover(floatingContext, {\n enabled: openOnHover,\n delay: { open: delay, close: 100 },\n handleClose: safePolygon(),\n });\n\n // WCAG 1.4.13 — keyboard focus is equivalent to hover.\n const focus = useFocus(floatingContext, { enabled: openOnHover });\n\n const click = useClick(floatingContext, {\n enabled: !openOnHover,\n });\n\n const dismiss = useDismiss(floatingContext, {\n escapeKey: !disableCloseOnEscape,\n outsidePress: !disableCloseOnClickOutside\n ? (event) => {\n onClickOutside?.(event as globalThis.MouseEvent);\n return true;\n }\n : false,\n });\n\n const { getReferenceProps, getFloatingProps } = useInteractions([\n role,\n hover,\n focus,\n click,\n dismiss,\n ]);\n\n // Sync Popover API show/hide with open state; notify DialogContext when nested.\n useEffect(() => {\n const floatingEl = refs.floating.current;\n if (!floatingEl) return;\n if (openState) {\n if (dialogContext) {\n if (dialogContext.ref?.current?.open) {\n safeShowPopover(floatingEl);\n dialogContext.setHasOpenPopover?.(true);\n }\n return;\n }\n safeShowPopover(floatingEl);\n } else {\n safeHidePopover(floatingEl);\n dialogContext?.setHasOpenPopover?.(false);\n }\n }, [openState, refs.floating, dialogContext]);\n\n usePopoverTransitionStates(refs.floating.current ?? undefined, openState, {\n onOpenAnimationStart,\n onOpenAnimationComplete,\n onCloseAnimationStart,\n onCloseAnimationComplete,\n });\n\n useImperativeHandle(ref, () => ({ openPopover, closePopover }), [\n openPopover,\n closePopover,\n ]);\n\n const value = useMemo<PopoverContextProps>(\n () => ({\n floatingContext,\n refs: {\n setReference: refs.setReference,\n setFloating: refs.setFloating,\n },\n floatingStyles,\n middlewareData,\n getReferenceProps,\n getFloatingProps,\n triggerId,\n openState,\n openPopover,\n closePopover,\n controlled: isControlled,\n actualPlacement,\n arrowRef,\n modal,\n openOnHover,\n noPadding,\n enableCaret,\n role: roleProp,\n }),\n [\n floatingContext,\n refs.setReference,\n refs.setFloating,\n floatingStyles,\n middlewareData,\n getReferenceProps,\n getFloatingProps,\n triggerId,\n openState,\n openPopover,\n closePopover, // stable — does not depend on openState (uses openStateRef)\n isControlled,\n actualPlacement,\n arrowRef,\n modal,\n openOnHover,\n noPadding,\n enableCaret,\n roleProp,\n ],\n );\n\n return (\n <PopoverContext.Provider value={value}>{children}</PopoverContext.Provider>\n );\n});\n\nPopoverElement.displayName = \"Popover\";\n\n/**\n * Beta Popover component for displaying floating content relative to a trigger element.\n *\n * Built on three layers:\n * - HTML Popover API (`popover=\"manual\"`) for top-layer rendering without z-index management\n * - Floating UI (`@floating-ui/react`) for JavaScript-based positioning\n * - Floating UI interaction hooks for correct ARIA attributes and keyboard behavior\n *\n * Features:\n * - Correct ARIA linkage: `aria-controls`, `aria-haspopup` with role string, `aria-expanded`\n * - `FloatingFocusManager` for both modal (focus trapped) and non-modal (Tab-out closes)\n * - `safePolygon()` hover zone replaces CSS `::before` hover bridge\n * - `role` prop drives both `aria-haspopup` on trigger and `role` on content\n * - Controlled and uncontrolled modes via `open` / `defaultOpen`\n * - Imperative handle exposing `openPopover` and `closePopover`\n * - Animation lifecycle callbacks via `onOpenAnimationStart` etc.\n *\n * @example\n * <Popover>\n * <Popover.Button>Open</Popover.Button>\n * <Popover.Content>\n * <p>Popover content</p>\n * <Popover.Close>Close</Popover.Close>\n * </Popover.Content>\n * </Popover>\n *\n * @example\n * <Popover modal>\n * <Popover.Trigger>\n * {(props) => <Button {...props}>Open form</Button>}\n * </Popover.Trigger>\n * <Popover.Content>\n * <TextField label=\"Name\" />\n * <Popover.Close>Done</Popover.Close>\n * </Popover.Content>\n * </Popover>\n *\n * @example\n * <Popover openOnHover role=\"dialog\">\n * <Popover.Button>Hover me</Popover.Button>\n * <Popover.Content>Hover content</Popover.Content>\n * </Popover>\n */\nexport const Popover = Object.assign(PopoverElement, {\n /**\n * PopoverTrigger component for creating custom trigger elements.\n *\n * Features:\n * - Render prop pattern for full control over the trigger element\n * - ARIA attributes and event handlers injected via getReferenceProps\n *\n * @example\n * <Popover.Trigger>\n * {(props) => (\n * <Button {...props}>\n * Click to open popover\n * </Button>\n * )}\n * </Popover.Trigger>\n */\n Trigger: PopoverTrigger,\n /**\n * PopoverContent component for the main popover content area.\n *\n * Features:\n * - HTML Popover API top-layer rendering (popover=\"manual\")\n * - Floating UI positioning via refs.setFloating and floatingStyles\n * - FloatingFocusManager for focus trapping (modal) or Tab-out closing (non-modal)\n * - Arrow/caret indicator with position computed from middlewareData.arrow\n * - Scroll position reset when the popover opens\n * - Optional scrollerRef for external scroll access\n *\n * @example\n * <Popover.Content>\n * <p>Popover content</p>\n * <Popover.Close>Close</Popover.Close>\n * </Popover.Content>\n */\n Content: PopoverContent,\n /**\n * PopoverClose component for closing the popover.\n *\n * Features:\n * - Supports all Button component props and styling\n * - Closes the popover on click via closePopover\n * - Automatic tracking ID generation for analytics\n *\n * @example\n * <Popover.Close>Close</Popover.Close>\n *\n * @example\n * <Popover.Close appearance=\"secondary\" size=\"small\">\n * Cancel\n * </Popover.Close>\n */\n Close: PopoverClose,\n /**\n * PopoverButton component for creating button-style triggers.\n *\n * Features:\n * - Button styling and behavior with all Button props\n * - ARIA attributes and event handlers injected via getReferenceProps\n * - Automatic tracking ID generation for analytics\n *\n * @example\n * <Popover.Button>Click to open</Popover.Button>\n *\n * @example\n * <Popover.Button appearance=\"primary\" size=\"large\" icon={InfoIcon}>\n * Information\n * </Popover.Button>\n */\n Button: PopoverButton,\n});\n"],"names":["PopoverClose","PopoverButton","PopoverContent","arrow"],"mappings":";;;;;;;;;;;;;;AAkDO,MAAM,cAAA,GAAiB,cAA0C,IAAI,CAAA;;AC1CrE,SAAS,iBAAA,GAAoB;AAClC,EAAA,MAAM,OAAA,GAAU,WAAW,cAAc,CAAA;AACzC,EAAA,IAAI,CAAC,OAAA,EAAS;AACZ,IAAA,MAAM,IAAI,KAAA;AAAA,MACR;AAAA,KACF;AAAA,EACF;AACA,EAAA,OAAO,OAAA;AACT;;ACaO,MAAM,YAAA,GAAe,UAAA;AAAA,EAC1B,SAASA,aAAAA,CAAa,KAAA,EAAO,GAAA,EAAK;AAChC,IAAA,MAAM,EAAE,OAAA,EAAS,GAAG,IAAA,EAAK,GAAI,KAAA;AAC7B,IAAA,MAAM,EAAE,YAAA,EAAa,GAAI,iBAAA,EAAkB;AAE3C,IAAA,MAAM,aAAa,aAAA,CAAc;AAAA,MAC/B,IAAA,EAAM,cAAA;AAAA,MACN,MAAM,EAAE,QAAA,EAAU,gBAAA,CAAiB,KAAA,CAAM,QAAQ,CAAA,EAAE;AAAA,MACnD,WAAA,EAAa,CAAC,CAAC,KAAA,CAAM,kBAAkB;AAAA,KACxC,CAAA;AAED,IAAA,MAAM,WAAA,GAAc,WAAA;AAAA,MAClB,C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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAiBP,MAAA,EAAQ;AACV,CAAC;;;;"}
|
package/dist/Popover.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { P as Popover, P as default } from './Popover-
|
|
1
|
+
export { P as Popover, P as default } from './Popover-D0qSKZ1J.js';
|
|
2
2
|
//# sourceMappingURL=Popover.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
|
-
import { R as RadioGroup, a as Radio$1 } from './Radio-
|
|
3
|
+
import { R as RadioGroup, a as Radio$1 } from './Radio-BQg7exDG.js';
|
|
4
4
|
import { c as childrenToString } from './childrenToString-Bz9MqbHb.js';
|
|
5
5
|
import { useTrackingId } from './useTrackingId.js';
|
|
6
6
|
|
|
@@ -57,4 +57,4 @@ const Radio = Object.assign(RadioElement, {
|
|
|
57
57
|
});
|
|
58
58
|
|
|
59
59
|
export { Radio as R };
|
|
60
|
-
//# sourceMappingURL=Radio-
|
|
60
|
+
//# sourceMappingURL=Radio-BOq9UkpC.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Radio-
|
|
1
|
+
{"version":3,"file":"Radio-BOq9UkpC.js","sources":["../src/components/Radio/Radio.tsx"],"sourcesContent":["import { Ref, forwardRef } from \"react\";\nimport {\n RadioProps as CoreRadioProps,\n Radio as CoreRadio,\n} from \"./internal/Radio\";\nimport { RadioGroup } from \"./RadioGroup\";\nimport { useTrackingId } from \"../../hooks\";\nimport { DataTrackingId } from \"../../types\";\nimport { childrenToString } from \"../../internal/functions\";\n\n/**\n * Props for the Radio component\n * @property {boolean} [checked] - Controlled state\n * @property {boolean} [defaultChecked] - Uncontrolled state\n * @property {Function} [onChange] - Callback when radio is changed\n * @property {ReactElement | string} [label] - Label for Radio\n * @property {boolean} [error] - Error state for the radio\n * @property {object} [icons] - Icon overrides for checked and unchecked states\n * @property {string} [description] - Description text to display below the radio\n * @property {string} [aria-label] - Accessible label for the radio\n * @property {string} [aria-labelledby] - ID of element that labels the radio\n * @property {string} [name] - Name attribute for the radio\n * @property {string} [data-tracking-id] - Custom tracking ID for analytics\n * @extends DataTrackingId\n */\nexport type RadioProps = Omit<CoreRadioProps, \"hideRadio\"> & DataTrackingId;\n\nconst RadioElement = forwardRef(\n (props: RadioProps, ref: Ref<HTMLInputElement>) => {\n const data = {\n label: childrenToString(props.label),\n ariaLabel: props[\"aria-label\"],\n ariaLabelledBy: props[\"aria-labelledby\"],\n name: props.name,\n value: props.value,\n };\n\n const trackingId = useTrackingId({\n name: \"Radio\",\n data,\n hasOverride: !!props[\"data-tracking-id\"],\n });\n return <CoreRadio ref={ref} data-tracking-id={trackingId} {...props} />;\n },\n);\n\nRadioElement.displayName = CoreRadio?.displayName ?? \"RadioElement\";\n\n/**\n * Radio component for single selection from a group of options.\n *\n * Features:\n * - Supports both controlled and uncontrolled modes\n * - Customizable icons for checked and unchecked states\n * - Error state with visual indicators\n * - Description text support\n * - Accessibility support with proper ARIA attributes\n * - Layout utility props for positioning and spacing\n * - Flexible labeling options\n * - Group support via Radio.Group\n * - Automatic tracking ID generation for analytics\n *\n * @example\n * <Radio\n * label=\"Option 1\"\n * value=\"option1\"\n * checked={selectedValue === \"option1\"}\n * onChange={(e, state) => setSelectedValue(state?.value)}\n * />\n *\n * @example\n * <Radio\n * label=\"Custom styled option\"\n * value=\"custom\"\n * icons={{\n * checked: CustomCheckedIcon,\n * unchecked: CustomUncheckedIcon\n * }}\n * description=\"This option has custom styling\"\n * />\n *\n * @example\n * <Radio.Group legend=\"Choose your preference\" required>\n * <Radio label=\"Option A\" value=\"a\" />\n * <Radio label=\"Option B\" value=\"b\" />\n * <Radio label=\"Option C\" value=\"c\" />\n * </Radio.Group>\n */\nexport const Radio = Object.assign(RadioElement, {\n /**\n * RadioGroup component for grouping related radio options.\n *\n * Features:\n * - Groups multiple radio options together\n * - Legend support for group labeling\n * - Required field indication\n * - Accessibility support with proper fieldset semantics\n * - Layout utility props for positioning and spacing\n * - Focus and blur event handling\n * - More info support for additional context\n * - Automatic alignment based on flex direction\n *\n * @example\n * <RadioGroup legend=\"Choose your preference\" required>\n * <Radio label=\"Option A\" value=\"a\" />\n * <Radio label=\"Option B\" value=\"b\" />\n * <Radio label=\"Option C\" value=\"c\" />\n * </RadioGroup>\n *\n * @example\n * <RadioGroup\n * legend=\"Horizontal layout\"\n * flexDirection=\"row\"\n * gap=\"4\"\n * >\n * <Radio label=\"Yes\" value=\"yes\" />\n * <Radio label=\"No\" value=\"no\" />\n * </RadioGroup>\n */\n Group: RadioGroup,\n});\n"],"names":["CoreRadio"],"mappings":";;;;;;AA2BA,MAAM,YAAA,GAAe,UAAA;AAAA,EACnB,CAAC,OAAmB,GAAA,KAA+B;AACjD,IAAA,MAAM,IAAA,GAAO;AAAA,MACX,KAAA,EAAO,gBAAA,CAAiB,KAAA,CAAM,KAAK,CAAA;AAAA,MACnC,SAAA,EAAW,MAAM,YAAY,CAAA;AAAA,MAC7B,cAAA,EAAgB,MAAM,iBAAiB,CAAA;AAAA,MACvC,MAAM,KAAA,CAAM,IAAA;AAAA,MACZ,OAAO,KAAA,CAAM;AAAA,KACf;AAEA,IAAA,MAAM,aAAa,aAAA,CAAc;AAAA,MAC/B,IAAA,EAAM,OAAA;AAAA,MACN,IAAA;AAAA,MACA,WAAA,EAAa,CAAC,CAAC,KAAA,CAAM,kBAAkB;AAAA,KACxC,CAAA;AACD,IAAA,2BAAQA,OAAA,EAAA,EAAU,GAAA,EAAU,kBAAA,EAAkB,UAAA,EAAa,GAAG,KAAA,EAAO,CAAA;AAAA,EACvE;AACF,CAAA;AAEA,YAAA,CAAa,WAAA,GAAcA,SAAW,WAAA,IAAe,cAAA;AA0C9C,MAAM,KAAA,GAAQ,MAAA,CAAO,MAAA,CAAO,YAAA,EAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA+B/C,KAAA,EAAO;AACT,CAAC;;;;"}
|
|
@@ -146,6 +146,7 @@ const RadioElement = forwardRef((props, ref) => {
|
|
|
146
146
|
style,
|
|
147
147
|
description,
|
|
148
148
|
hideRadio = false,
|
|
149
|
+
labelWrapperClassName,
|
|
149
150
|
...rest
|
|
150
151
|
} = componentProps;
|
|
151
152
|
const groupContext = useRadioGroupContext();
|
|
@@ -212,7 +213,15 @@ const RadioElement = forwardRef((props, ref) => {
|
|
|
212
213
|
]
|
|
213
214
|
}
|
|
214
215
|
),
|
|
215
|
-
/* @__PURE__ */ jsx(
|
|
216
|
+
/* @__PURE__ */ jsx(
|
|
217
|
+
"span",
|
|
218
|
+
{
|
|
219
|
+
className: cx(labelWrapperClassName, {
|
|
220
|
+
[styles["focus-label"]]: hideRadio
|
|
221
|
+
}),
|
|
222
|
+
children: label
|
|
223
|
+
}
|
|
224
|
+
)
|
|
216
225
|
] }),
|
|
217
226
|
description ? /* @__PURE__ */ jsx("div", { className: styles["helper-wrapper"], children: /* @__PURE__ */ jsx(Helper, { id: helperUid, description }) }) : null
|
|
218
227
|
] });
|
|
@@ -221,4 +230,4 @@ RadioElement.displayName = "RadioElement";
|
|
|
221
230
|
const Radio = RadioElement;
|
|
222
231
|
|
|
223
232
|
export { RadioGroup as R, SvgRadioButtonUnchecked as S, Radio as a, SvgRadioButtonChecked as b };
|
|
224
|
-
//# sourceMappingURL=Radio-
|
|
233
|
+
//# sourceMappingURL=Radio-BQg7exDG.js.map
|