@wello-dev/core 1.0.5 → 1.0.7

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.
Files changed (63) hide show
  1. package/dist/{chunk-QSFXOVRL.js → chunk-2MVQG2PQ.js} +18 -8
  2. package/dist/chunk-2MVQG2PQ.js.map +1 -0
  3. package/dist/{chunk-FIAJMBSD.js → chunk-2TFJ4SMR.js} +3 -3
  4. package/dist/chunk-2TFJ4SMR.js.map +1 -0
  5. package/dist/{chunk-COAMHU2N.js → chunk-3IKAVFR3.js} +3 -3
  6. package/dist/{chunk-X7WXW6AV.js → chunk-4E45SQMX.js} +2 -2
  7. package/dist/{chunk-F2FJLMJF.js → chunk-652ZEQV7.js} +4 -4
  8. package/dist/{chunk-YQOS23WP.js → chunk-7EINGVGG.js} +2 -2
  9. package/dist/{chunk-ULMVA37U.js → chunk-EME4ROPE.js} +4 -4
  10. package/dist/{chunk-HGYIOR5F.js → chunk-ESMDK5GY.js} +2 -2
  11. package/dist/{chunk-52P4CIAK.js → chunk-HBBXBVK6.js} +2 -2
  12. package/dist/{chunk-DZ7HIMJ5.js → chunk-JXRN4MGT.js} +2 -2
  13. package/dist/{chunk-63PSLIW5.js → chunk-K3B2RENY.js} +2 -2
  14. package/dist/{chunk-SJBYDDDD.js → chunk-LGL6XP6C.js} +25 -9
  15. package/dist/chunk-LGL6XP6C.js.map +1 -0
  16. package/dist/{chunk-KNN75VAT.js → chunk-N76DWAX4.js} +2 -2
  17. package/dist/{chunk-ZTOAB4HM.js → chunk-NGXT7GNE.js} +2 -2
  18. package/dist/{chunk-7GLDYLJ6.js → chunk-O6A7IBIW.js} +2 -2
  19. package/dist/{chunk-5XXK7KQE.js → chunk-OYUQO4ZT.js} +2 -2
  20. package/dist/{chunk-BVGYS3NN.js → chunk-WVYAE5MT.js} +2 -2
  21. package/dist/{chunk-N7T45HQC.js → chunk-XG7ZGCBW.js} +11 -6
  22. package/dist/{chunk-N7T45HQC.js.map → chunk-XG7ZGCBW.js.map} +1 -1
  23. package/dist/components/ColorPicker/ColorInput.js +4 -4
  24. package/dist/components/Combobox/Combobox.js +4 -4
  25. package/dist/components/Combobox/Select.js +5 -5
  26. package/dist/components/Combobox/TagsInput.js +5 -5
  27. package/dist/components/Dialog/Dialog.js +2 -2
  28. package/dist/components/Dropzone/Dropzone.js +4 -4
  29. package/dist/components/Menu/Menu.js +4 -4
  30. package/dist/components/Modal/Drawer.js +3 -3
  31. package/dist/components/Modal/Modal.js +3 -3
  32. package/dist/components/Modal/ModalBase.js +2 -2
  33. package/dist/components/PhoneInput/PhoneInput.js +6 -6
  34. package/dist/components/Popover/Popover.js +3 -3
  35. package/dist/components/Portal/Portal.js +1 -1
  36. package/dist/components/Tooltip/Tooltip.js +3 -3
  37. package/dist/index.cjs +49 -18
  38. package/dist/index.cjs.map +1 -1
  39. package/dist/index.d.cts +2 -2
  40. package/dist/index.d.ts +2 -2
  41. package/dist/index.js +60 -60
  42. package/dist/shadcn/Command.js +6 -6
  43. package/dist/shadcn/Dialog.js +5 -5
  44. package/dist/shadcn/Floating.js +6 -6
  45. package/dist/styles.css +42 -5
  46. package/package.json +1 -1
  47. package/dist/chunk-FIAJMBSD.js.map +0 -1
  48. package/dist/chunk-QSFXOVRL.js.map +0 -1
  49. package/dist/chunk-SJBYDDDD.js.map +0 -1
  50. /package/dist/{chunk-COAMHU2N.js.map → chunk-3IKAVFR3.js.map} +0 -0
  51. /package/dist/{chunk-X7WXW6AV.js.map → chunk-4E45SQMX.js.map} +0 -0
  52. /package/dist/{chunk-F2FJLMJF.js.map → chunk-652ZEQV7.js.map} +0 -0
  53. /package/dist/{chunk-YQOS23WP.js.map → chunk-7EINGVGG.js.map} +0 -0
  54. /package/dist/{chunk-ULMVA37U.js.map → chunk-EME4ROPE.js.map} +0 -0
  55. /package/dist/{chunk-HGYIOR5F.js.map → chunk-ESMDK5GY.js.map} +0 -0
  56. /package/dist/{chunk-52P4CIAK.js.map → chunk-HBBXBVK6.js.map} +0 -0
  57. /package/dist/{chunk-DZ7HIMJ5.js.map → chunk-JXRN4MGT.js.map} +0 -0
  58. /package/dist/{chunk-63PSLIW5.js.map → chunk-K3B2RENY.js.map} +0 -0
  59. /package/dist/{chunk-KNN75VAT.js.map → chunk-N76DWAX4.js.map} +0 -0
  60. /package/dist/{chunk-ZTOAB4HM.js.map → chunk-NGXT7GNE.js.map} +0 -0
  61. /package/dist/{chunk-7GLDYLJ6.js.map → chunk-O6A7IBIW.js.map} +0 -0
  62. /package/dist/{chunk-5XXK7KQE.js.map → chunk-OYUQO4ZT.js.map} +0 -0
  63. /package/dist/{chunk-BVGYS3NN.js.map → chunk-WVYAE5MT.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Popover/Popover.tsx"],"sourcesContent":["import {\n cloneElement,\n createContext,\n isValidElement,\n useContext,\n useEffect,\n useRef,\n useState,\n type CSSProperties,\n type ReactElement,\n type ReactNode,\n} from \"react\";\nimport { Box, type BoxProps } from \"../../core/Box/Box\";\nimport { factory } from \"../../core/factory/factory\";\nimport { useClickOutside, useEscape, useFocusTrap } from \"../../core/overlay/focus\";\nimport { useFloating, type FloatingPosition } from \"../../core/overlay/use-floating\";\nimport { useDirection } from \"../../core/provider/WelloProvider\";\nimport {\n useComponentStyles,\n useProps,\n type GetStyles,\n type StylesApiProps,\n} from \"../../core/styles-api/styles-api\";\nimport type { WelloRadius, WelloShadow } from \"../../core/theme/types\";\nimport { getRadius, getShadow, rem } from \"../../core/theme/units\";\nimport { mergeRefs, useId } from \"../../core/utils\";\nimport { OptionalPortal, type PortalProps } from \"../Portal/Portal\";\nimport { Transition, type TransitionProps } from \"../Transition/Transition\";\n\nexport type PopoverStylesNames = \"dropdown\" | \"arrow\";\nexport type PopoverWidth = \"target\" | \"auto\" | number | (string & {});\n\nexport interface PopoverBaseProps {\n /** Default: 'bottom' */\n position?: FloatingPosition;\n /** Default: 8 */\n offset?: number;\n /** `'target'` = same width as the target. Default: 'max-content' */\n width?: PopoverWidth;\n withArrow?: boolean;\n /** Default: 7 */\n arrowSize?: number;\n /** Default: 5 */\n arrowOffset?: number;\n /** Default: 0 */\n arrowRadius?: number;\n /** Default: 'side' */\n arrowPosition?: \"side\" | \"center\";\n /** Default: true */\n withinPortal?: boolean;\n portalProps?: Omit<PortalProps, \"children\">;\n /** Default: 300 */\n zIndex?: number | string;\n radius?: WelloRadius;\n /** Default: 'md' */\n shadow?: WelloShadow;\n /** Default: { transition: 'fade', duration: 150 } */\n transitionProps?: Omit<TransitionProps, \"mounted\" | \"children\">;\n /** Keep the dropdown in the DOM while closed */\n keepMounted?: boolean;\n /** Flip / shift to stay on screen. Default: both true */\n middlewares?: { flip?: boolean; shift?: boolean };\n onPositionChange?: (position: FloatingPosition) => void;\n /** Hide the dropdown */\n disabled?: boolean;\n /** Hide it while the target is scrolled out of sight. Default: true */\n hideDetached?: boolean;\n /** Stay on the side it opened on, instead of flipping while scrolling. Default: true */\n preventPositionChangeWhenVisible?: boolean;\n /**\n * Floating alignment dir (`start` / `end`). Default: app direction.\n * Pass `\"ltr\"` for controls that stay left-anchored in RTL (e.g. PhoneInput dial code).\n */\n dir?: \"ltr\" | \"rtl\";\n}\n\nexport interface PopoverProps\n extends PopoverBaseProps, StylesApiProps<PopoverStylesNames, PopoverProps> {\n /** Controlled state */\n opened?: boolean;\n defaultOpened?: boolean;\n onChange?: (opened: boolean) => void;\n onOpen?: () => void;\n onClose?: () => void;\n /** Keep Tab inside the dropdown */\n trapFocus?: boolean;\n /** Focus the target back on close. Default: false */\n returnFocus?: boolean;\n /** Default: true */\n closeOnEscape?: boolean;\n /** Default: true */\n closeOnClickOutside?: boolean;\n /** Default: ['mousedown', 'touchstart'] */\n clickOutsideEvents?: string[];\n /** aria roles on target / dropdown. Default: true */\n withRoles?: boolean;\n /** Base id of the dropdown */\n id?: string;\n /** Close on Escape / click outside does nothing; you control it */\n children?: ReactNode;\n /** Set by Menu */\n __staticSelector?: string;\n __role?: string;\n}\n\ninterface PopoverContextValue {\n opened: boolean;\n open: () => void;\n close: () => void;\n toggle: () => void;\n floating: ReturnType<typeof useFloating>;\n targetRef: React.MutableRefObject<HTMLElement | null>;\n dropdownRef: React.MutableRefObject<HTMLElement | null>;\n getStyles: GetStyles<PopoverStylesNames>;\n props: PopoverProps;\n id: string;\n /** Nested popovers register their dropdown so clicks in them don't close this one */\n registerChild: (ref: React.MutableRefObject<HTMLElement | null>) => () => void;\n}\n\nconst PopoverContext = createContext<PopoverContextValue | null>(null);\n\nexport function usePopoverContext() {\n const context = useContext(PopoverContext);\n if (!context) throw new Error(\"Popover.Target / Popover.Dropdown must be inside <Popover>\");\n return context;\n}\n\n/** Root of a popover; use `Popover.Target` and `Popover.Dropdown` inside. */\nexport function Popover(_props: PopoverProps) {\n const props = useProps(\n \"Popover\",\n {\n position: \"bottom\",\n offset: 8,\n width: \"max-content\",\n hideDetached: true,\n preventPositionChangeWhenVisible: true,\n arrowSize: 7,\n arrowOffset: 5,\n arrowRadius: 0,\n arrowPosition: \"side\",\n withinPortal: true,\n zIndex: 300,\n shadow: \"md\",\n closeOnEscape: true,\n closeOnClickOutside: true,\n withRoles: true,\n returnFocus: false,\n },\n _props,\n );\n const name = props.__staticSelector ?? \"Popover\";\n const [getStyles] = useComponentStyles(name, props, {\n rootSelector: \"dropdown\",\n varsResolver: (_theme, p) => ({\n dropdown: {\n \"--popover-radius\": p.radius === undefined ? undefined : getRadius(p.radius),\n \"--popover-shadow\": getShadow(p.shadow),\n },\n }),\n });\n const [internal, setInternal] = useState(!!props.defaultOpened);\n const opened = !props.disabled && (props.opened ?? internal);\n const setOpened = (next: boolean) => {\n if (next === opened) return;\n if (props.opened === undefined) setInternal(next);\n props.onChange?.(next);\n (next ? props.onOpen : props.onClose)?.();\n };\n const { dir: appDir } = useDirection();\n const floating = useFloating({\n opened,\n position: props.position,\n offset: props.offset! + (props.withArrow ? props.arrowSize! / 2 : 0),\n flip: props.middlewares?.flip ?? true,\n shift: props.middlewares?.shift ?? true,\n dir: props.dir ?? appDir,\n arrowSize: props.withArrow ? props.arrowSize : 0,\n arrowOffset: props.arrowOffset,\n arrowPosition: props.arrowPosition,\n onPositionChange: props.onPositionChange,\n preventPositionChangeWhenVisible: props.preventPositionChangeWhenVisible,\n });\n const targetRef = useRef<HTMLElement | null>(null);\n const dropdownRef = useRef<HTMLElement | null>(null);\n const id = useId(props.id);\n const children = useRef(new Set<React.MutableRefObject<HTMLElement | null>>());\n const parent = useContext(PopoverContext);\n useEffect(() => parent?.registerChild(dropdownRef), [parent]);\n\n useClickOutside(\n () => props.closeOnClickOutside && setOpened(false),\n () => [targetRef, dropdownRef, ...children.current],\n opened,\n props.clickOutsideEvents,\n );\n useEscape(() => {\n if (props.closeOnEscape) {\n setOpened(false);\n targetRef.current?.focus();\n }\n }, opened);\n\n return (\n <PopoverContext.Provider\n value={{\n opened,\n open: () => setOpened(true),\n close: () => setOpened(false),\n toggle: () => setOpened(!opened),\n floating,\n targetRef,\n dropdownRef,\n getStyles,\n props,\n id,\n // Ancestors learn about nested dropdowns too, at any depth.\n registerChild: (ref) => {\n children.current.add(ref);\n const up = parent?.registerChild(ref);\n return () => {\n children.current.delete(ref);\n up?.();\n };\n },\n }}\n >\n {props.children}\n </PopoverContext.Provider>\n );\n}\n\nexport interface PopoverTargetProps {\n /** One element; receives ref, onClick and aria attributes */\n children: ReactElement;\n /** Prop the ref goes to. Default: 'ref' */\n refProp?: string;\n /** Set aria-haspopup, aria-expanded and aria-controls on the target. Default: the popover's `withRoles` */\n withRoles?: boolean;\n /** Extra props merged into the child */\n popupType?: string;\n}\n\nexport function PopoverTarget({\n children,\n refProp = \"ref\",\n popupType = \"dialog\",\n withRoles,\n}: PopoverTargetProps) {\n const context = usePopoverContext();\n if (!isValidElement(children)) throw new Error(\"Popover.Target needs one element child\");\n const child = children as ReactElement<Record<string, any>>;\n const roles = (withRoles ?? context.props.withRoles)\n ? {\n \"aria-haspopup\": popupType,\n \"aria-expanded\": context.opened,\n \"aria-controls\": context.opened ? `${context.id}-dropdown` : undefined,\n id: child.props.id ?? `${context.id}-target`,\n }\n : {};\n return cloneElement(child, {\n ...roles,\n \"data-expanded\": context.opened || undefined,\n [refProp]: mergeRefs(context.targetRef, context.floating.setReference, child.props.ref),\n onClick: (event: React.MouseEvent) => {\n child.props.onClick?.(event);\n if (!event.defaultPrevented && !context.props.__role) context.toggle();\n },\n });\n}\n\nexport interface PopoverDropdownProps extends BoxProps {\n children?: ReactNode;\n className?: string;\n}\n\nexport const PopoverDropdown = factory<{\n props: PopoverDropdownProps;\n ref: HTMLDivElement;\n stylesNames: \"dropdown\";\n}>(({ children, className, style, ...others }, ref) => {\n const context = usePopoverContext();\n const { props, floating } = context;\n const dropdownRef = useRef<HTMLDivElement | null>(null);\n useFocusTrap(dropdownRef, context.opened && !!props.trapFocus, props.returnFocus);\n const width =\n props.width === \"target\"\n ? floating.referenceWidth\n : props.width === \"auto\"\n ? undefined\n : rem(props.width as number | string);\n return (\n <OptionalPortal withinPortal={props.withinPortal} {...props.portalProps}>\n <Transition\n mounted={context.opened}\n keepMounted={props.keepMounted}\n transition=\"fade\"\n duration={150}\n {...props.transitionProps}\n >\n {(transitionStyles) => {\n const dropdown = context.getStyles(\"dropdown\", { className });\n return (\n <Box\n ref={mergeRefs(ref, dropdownRef, context.dropdownRef, floating.setFloating)}\n id={`${context.id}-dropdown`}\n role={props.withRoles ? (props.__role ?? \"dialog\") : undefined}\n aria-labelledby={props.withRoles ? `${context.id}-target` : undefined}\n tabIndex={-1}\n {...dropdown}\n data-position={floating.placement}\n style={{\n ...transitionStyles,\n ...dropdown.style,\n position: \"fixed\",\n top: floating.y,\n left: floating.x,\n width,\n zIndex: props.zIndex as CSSProperties[\"zIndex\"],\n // Invisible until measured, so it doesn't flash at 0,0.\n visibility: floating.ready && !(props.hideDetached && floating.referenceHidden)\n ? (transitionStyles.visibility as CSSProperties[\"visibility\"])\n : \"hidden\",\n ...(typeof style === \"object\" ? style : undefined),\n }}\n {...others}\n >\n {children}\n {props.withArrow && (\n <div\n {...context.getStyles(\"arrow\")}\n data-position={floating.placement}\n style={{\n ...context.getStyles(\"arrow\").style,\n [\"--_arrow\" as string]: `${props.arrowSize}px`,\n width: props.arrowSize,\n height: props.arrowSize,\n borderRadius: props.arrowRadius,\n left:\n floating.arrowX !== undefined\n ? floating.arrowX - props.arrowSize! / 2\n : undefined,\n top:\n floating.arrowY !== undefined\n ? floating.arrowY - props.arrowSize! / 2\n : undefined,\n }}\n />\n )}\n </Box>\n );\n }}\n </Transition>\n </OptionalPortal>\n );\n});\nPopoverDropdown.displayName = \"PopoverDropdown\";\n\nPopover.Target = PopoverTarget;\nPopover.Dropdown = PopoverDropdown;\nPopover.displayName = \"Popover\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAIK;AAkMH,cAmGQ,YAnGR;AArFJ,IAAM,iBAAiB,cAA0C,IAAI;AAE9D,SAAS,oBAAoB;AAClC,QAAM,UAAU,WAAW,cAAc;AACzC,MAAI,CAAC,QAAS,OAAM,IAAI,MAAM,4DAA4D;AAC1F,SAAO;AACT;AAGO,SAAS,QAAQ,QAAsB;AAC5C,QAAM,QAAQ;AAAA,IACZ;AAAA,IACA;AAAA,MACE,UAAU;AAAA,MACV,QAAQ;AAAA,MACR,OAAO;AAAA,MACP,cAAc;AAAA,MACd,kCAAkC;AAAA,MAClC,WAAW;AAAA,MACX,aAAa;AAAA,MACb,aAAa;AAAA,MACb,eAAe;AAAA,MACf,cAAc;AAAA,MACd,QAAQ;AAAA,MACR,QAAQ;AAAA,MACR,eAAe;AAAA,MACf,qBAAqB;AAAA,MACrB,WAAW;AAAA,MACX,aAAa;AAAA,IACf;AAAA,IACA;AAAA,EACF;AACA,QAAM,OAAO,MAAM,oBAAoB;AACvC,QAAM,CAAC,SAAS,IAAI,mB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K,SAAS;AAAA,cACd,MAAM,SAAS;AAAA,cACf;AAAA,cACA,QAAQ,MAAM;AAAA;AAAA,cAEd,YAAY,SAAS,SAAS,EAAE,MAAM,gBAAgB,SAAS,mBAC1D,iBAAiB,aAClB;AAAA,cACJ,GAAI,OAAO,UAAU,WAAW,QAAQ;AAAA,YAC1C;AAAA,YACC,GAAG;AAAA,YAEH;AAAA;AAAA,cACA,MAAM,aACL;AAAA,gBAAC;AAAA;AAAA,kBACE,GAAG,QAAQ,UAAU,OAAO;AAAA,kBAC7B,iBAAe,SAAS;AAAA,kBACxB,OAAO;AAAA,oBACL,GAAG,QAAQ,UAAU,OAAO,EAAE;AAAA,oBAC9B,CAAC,UAAoB,GAAG,GAAG,MAAM,SAAS;AAAA,oBAC1C,OAAO,MAAM;AAAA,oBACb,QAAQ,MAAM;AAAA,oBACd,cAAc,MAAM;AAAA,oBACpB,MACE,SAAS,WAAW,SAChB,SAAS,SAAS,MAAM,YAAa,IACrC;AAAA,oBACN,KACE,SAAS,WAAW,SAChB,SAAS,SAAS,MAAM,YAAa,IACrC;AAAA,kBACR;AAAA;AAAA,cACF;AAAA;AAAA;AAAA,QAEJ;AAAA,MAEJ;AAAA;AAAA,EACF,GACF;AAEJ,CAAC;AACD,gBAAgB,cAAc;AAE9B,QAAQ,SAAS;AACjB,QAAQ,WAAW;AACnB,QAAQ,cAAc;","names":[]}
1
+ {"version":3,"sources":["../src/components/Popover/Popover.tsx"],"sourcesContent":["import {\n cloneElement,\n createContext,\n isValidElement,\n useContext,\n useEffect,\n useRef,\n useState,\n type CSSProperties,\n type ReactElement,\n type ReactNode,\n} from \"react\";\nimport { Box, type BoxProps } from \"../../core/Box/Box\";\nimport { factory } from \"../../core/factory/factory\";\nimport { useClickOutside, useEscape, useFocusTrap } from \"../../core/overlay/focus\";\nimport { useFloating, type FloatingPosition } from \"../../core/overlay/use-floating\";\nimport { useDirection } from \"../../core/provider/WelloProvider\";\nimport {\n useComponentStyles,\n useProps,\n type GetStyles,\n type StylesApiProps,\n} from \"../../core/styles-api/styles-api\";\nimport type { WelloRadius, WelloShadow } from \"../../core/theme/types\";\nimport { getRadius, getShadow, rem } from \"../../core/theme/units\";\nimport { mergeRefs, useId } from \"../../core/utils\";\nimport { OptionalPortal, type PortalProps } from \"../Portal/Portal\";\nimport { Transition, type TransitionProps } from \"../Transition/Transition\";\n\nexport type PopoverStylesNames = \"dropdown\" | \"arrow\";\nexport type PopoverWidth = \"target\" | \"auto\" | number | (string & {});\n\nexport interface PopoverBaseProps {\n /** Default: 'bottom' */\n position?: FloatingPosition;\n /** Default: 8 */\n offset?: number;\n /** `'target'` = same width as the target. Default: 'max-content' */\n width?: PopoverWidth;\n withArrow?: boolean;\n /** Default: 7 */\n arrowSize?: number;\n /** Default: 5 */\n arrowOffset?: number;\n /** Default: 0 */\n arrowRadius?: number;\n /** Default: 'side' */\n arrowPosition?: \"side\" | \"center\";\n /** Default: true */\n withinPortal?: boolean;\n portalProps?: Omit<PortalProps, \"children\">;\n /** Default: 300 */\n zIndex?: number | string;\n radius?: WelloRadius;\n /** Default: 'md' */\n shadow?: WelloShadow;\n /** Default: { transition: 'fade', duration: 150 } */\n transitionProps?: Omit<TransitionProps, \"mounted\" | \"children\">;\n /** Keep the dropdown in the DOM while closed */\n keepMounted?: boolean;\n /** Flip / shift to stay on screen. Default: both true */\n middlewares?: { flip?: boolean; shift?: boolean };\n onPositionChange?: (position: FloatingPosition) => void;\n /** Hide the dropdown */\n disabled?: boolean;\n /** Hide it while the target is scrolled out of sight. Default: true */\n hideDetached?: boolean;\n /** Stay on the side it opened on, instead of flipping while scrolling. Default: true */\n preventPositionChangeWhenVisible?: boolean;\n /**\n * Floating alignment dir (`start` / `end`). Default: app direction.\n * Pass `\"ltr\"` for controls that stay left-anchored in RTL (e.g. PhoneInput dial code).\n */\n dir?: \"ltr\" | \"rtl\";\n}\n\nexport interface PopoverProps\n extends PopoverBaseProps, StylesApiProps<PopoverStylesNames, PopoverProps> {\n /** Controlled state */\n opened?: boolean;\n defaultOpened?: boolean;\n onChange?: (opened: boolean) => void;\n onOpen?: () => void;\n onClose?: () => void;\n /** Keep Tab inside the dropdown */\n trapFocus?: boolean;\n /** Focus the target back on close. Default: false */\n returnFocus?: boolean;\n /** Default: true */\n closeOnEscape?: boolean;\n /** Default: true */\n closeOnClickOutside?: boolean;\n /** Default: ['mousedown', 'touchstart'] */\n clickOutsideEvents?: string[];\n /** aria roles on target / dropdown. Default: true */\n withRoles?: boolean;\n /** Base id of the dropdown */\n id?: string;\n /** Close on Escape / click outside does nothing; you control it */\n children?: ReactNode;\n /** Set by Menu */\n __staticSelector?: string;\n __role?: string;\n}\n\ninterface PopoverContextValue {\n opened: boolean;\n open: () => void;\n close: () => void;\n toggle: () => void;\n floating: ReturnType<typeof useFloating>;\n targetRef: React.MutableRefObject<HTMLElement | null>;\n dropdownRef: React.MutableRefObject<HTMLElement | null>;\n getStyles: GetStyles<PopoverStylesNames>;\n props: PopoverProps;\n id: string;\n /** Nested popovers register their dropdown so clicks in them don't close this one */\n registerChild: (ref: React.MutableRefObject<HTMLElement | null>) => () => void;\n}\n\nconst PopoverContext = createContext<PopoverContextValue | null>(null);\n\nexport function usePopoverContext() {\n const context = useContext(PopoverContext);\n if (!context) throw new Error(\"Popover.Target / Popover.Dropdown must be inside <Popover>\");\n return context;\n}\n\n/** Root of a popover; use `Popover.Target` and `Popover.Dropdown` inside. */\nexport function Popover(_props: PopoverProps) {\n const props = useProps(\n \"Popover\",\n {\n position: \"bottom\",\n offset: 8,\n width: \"max-content\",\n hideDetached: true,\n preventPositionChangeWhenVisible: true,\n arrowSize: 7,\n arrowOffset: 5,\n arrowRadius: 0,\n arrowPosition: \"side\",\n withinPortal: true,\n zIndex: 300,\n shadow: \"md\",\n closeOnEscape: true,\n closeOnClickOutside: true,\n withRoles: true,\n returnFocus: false,\n },\n _props,\n );\n const name = props.__staticSelector ?? \"Popover\";\n const [getStyles] = useComponentStyles(name, props, {\n rootSelector: \"dropdown\",\n varsResolver: (_theme, p) => ({\n dropdown: {\n \"--popover-radius\": p.radius === undefined ? undefined : getRadius(p.radius),\n \"--popover-shadow\": getShadow(p.shadow),\n },\n }),\n });\n const [internal, setInternal] = useState(!!props.defaultOpened);\n const opened = !props.disabled && (props.opened ?? internal);\n const setOpened = (next: boolean) => {\n if (next === opened) return;\n if (props.opened === undefined) setInternal(next);\n props.onChange?.(next);\n (next ? props.onOpen : props.onClose)?.();\n };\n const { dir: appDir } = useDirection();\n const floating = useFloating({\n opened,\n position: props.position,\n offset: props.offset! + (props.withArrow ? props.arrowSize! / 2 : 0),\n flip: props.middlewares?.flip ?? true,\n shift: props.middlewares?.shift ?? true,\n dir: props.dir ?? appDir,\n arrowSize: props.withArrow ? props.arrowSize : 0,\n arrowOffset: props.arrowOffset,\n arrowPosition: props.arrowPosition,\n onPositionChange: props.onPositionChange,\n preventPositionChangeWhenVisible: props.preventPositionChangeWhenVisible,\n });\n const targetRef = useRef<HTMLElement | null>(null);\n const dropdownRef = useRef<HTMLElement | null>(null);\n const id = useId(props.id);\n const children = useRef(new Set<React.MutableRefObject<HTMLElement | null>>());\n const parent = useContext(PopoverContext);\n useEffect(() => parent?.registerChild(dropdownRef), [parent]);\n\n useClickOutside(\n () => props.closeOnClickOutside && setOpened(false),\n () => [targetRef, dropdownRef, ...children.current],\n opened,\n props.clickOutsideEvents,\n );\n useEscape(() => {\n if (props.closeOnEscape) {\n setOpened(false);\n targetRef.current?.focus();\n }\n }, opened);\n\n return (\n <PopoverContext.Provider\n value={{\n opened,\n open: () => setOpened(true),\n close: () => setOpened(false),\n toggle: () => setOpened(!opened),\n floating,\n targetRef,\n dropdownRef,\n getStyles,\n props,\n id,\n // Ancestors learn about nested dropdowns too, at any depth.\n registerChild: (ref) => {\n children.current.add(ref);\n const up = parent?.registerChild(ref);\n return () => {\n children.current.delete(ref);\n up?.();\n };\n },\n }}\n >\n {props.children}\n </PopoverContext.Provider>\n );\n}\n\nexport interface PopoverTargetProps {\n /** One element; receives ref, onClick and aria attributes */\n children: ReactElement;\n /** Prop the ref goes to. Default: 'ref' */\n refProp?: string;\n /** Set aria-haspopup, aria-expanded and aria-controls on the target. Default: the popover's `withRoles` */\n withRoles?: boolean;\n /** Extra props merged into the child */\n popupType?: string;\n}\n\nexport function PopoverTarget({\n children,\n refProp = \"ref\",\n popupType = \"dialog\",\n withRoles,\n}: PopoverTargetProps) {\n const context = usePopoverContext();\n if (!isValidElement(children)) throw new Error(\"Popover.Target needs one element child\");\n const child = children as ReactElement<Record<string, any>>;\n const roles = (withRoles ?? context.props.withRoles)\n ? {\n \"aria-haspopup\": popupType,\n \"aria-expanded\": context.opened,\n \"aria-controls\": context.opened ? `${context.id}-dropdown` : undefined,\n id: child.props.id ?? `${context.id}-target`,\n }\n : {};\n return cloneElement(child, {\n ...roles,\n \"data-expanded\": context.opened || undefined,\n [refProp]: mergeRefs(context.targetRef, context.floating.setReference, child.props.ref),\n onClick: (event: React.MouseEvent) => {\n child.props.onClick?.(event);\n if (!event.defaultPrevented && !context.props.__role) context.toggle();\n },\n });\n}\n\nexport interface PopoverDropdownProps extends BoxProps {\n children?: ReactNode;\n className?: string;\n}\n\nexport const PopoverDropdown = factory<{\n props: PopoverDropdownProps;\n ref: HTMLDivElement;\n stylesNames: \"dropdown\";\n}>(({ children, className, style, ...others }, ref) => {\n const context = usePopoverContext();\n const { props, floating } = context;\n const dropdownRef = useRef<HTMLDivElement | null>(null);\n useFocusTrap(dropdownRef, context.opened && !!props.trapFocus, props.returnFocus);\n // Avoid width:0 before the first measure — that collapses offsetWidth and skews place().\n const width =\n props.width === \"target\"\n ? floating.referenceWidth > 0\n ? floating.referenceWidth\n : undefined\n : props.width === \"auto\"\n ? undefined\n : rem(props.width as number | string);\n return (\n <OptionalPortal withinPortal={props.withinPortal} {...props.portalProps}>\n <Transition\n mounted={context.opened}\n keepMounted={props.keepMounted}\n transition=\"fade\"\n duration={150}\n {...props.transitionProps}\n >\n {(transitionStyles) => {\n const dropdown = context.getStyles(\"dropdown\", { className });\n return (\n <Box\n ref={mergeRefs(ref, dropdownRef, context.dropdownRef, floating.setFloating)}\n id={`${context.id}-dropdown`}\n role={props.withRoles ? (props.__role ?? \"dialog\") : undefined}\n aria-labelledby={props.withRoles ? `${context.id}-target` : undefined}\n tabIndex={-1}\n {...dropdown}\n data-position={floating.placement}\n style={{\n ...transitionStyles,\n ...dropdown.style,\n // transform (not top/left) — survives filter/mask containing blocks on ancestors\n // when a portal is briefly missing, and avoids inset shorthand fights.\n position: \"fixed\",\n top: 0,\n left: 0,\n right: \"auto\",\n bottom: \"auto\",\n transform: floating.ready\n ? `translate3d(${Math.round(floating.x)}px, ${Math.round(floating.y)}px, 0)`\n : \"translate3d(-9999px, -9999px, 0)\",\n width,\n zIndex: props.zIndex as CSSProperties[\"zIndex\"],\n // Invisible until measured, so it doesn't flash at 0,0.\n visibility: floating.ready && !(props.hideDetached && floating.referenceHidden)\n ? (transitionStyles.visibility as CSSProperties[\"visibility\"])\n : \"hidden\",\n ...(typeof style === \"object\" ? style : undefined),\n }}\n {...others}\n >\n {children}\n {props.withArrow && (\n <div\n {...context.getStyles(\"arrow\")}\n data-position={floating.placement}\n style={{\n ...context.getStyles(\"arrow\").style,\n [\"--_arrow\" as string]: `${props.arrowSize}px`,\n width: props.arrowSize,\n height: props.arrowSize,\n borderRadius: props.arrowRadius,\n left:\n floating.arrowX !== undefined\n ? floating.arrowX - props.arrowSize! / 2\n : undefined,\n top:\n floating.arrowY !== undefined\n ? floating.arrowY - props.arrowSize! / 2\n : undefined,\n }}\n />\n )}\n </Box>\n );\n }}\n </Transition>\n </OptionalPortal>\n );\n});\nPopoverDropdown.displayName = \"PopoverDropdown\";\n\nPopover.Target = PopoverTarget;\nPopover.Dropdown = PopoverDropdown;\nPopover.displayName = \"Popover\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AA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EAAE;AAAA,oBAC9B,CAAC,UAAoB,GAAG,GAAG,MAAM,SAAS;AAAA,oBAC1C,OAAO,MAAM;AAAA,oBACb,QAAQ,MAAM;AAAA,oBACd,cAAc,MAAM;AAAA,oBACpB,MACE,SAAS,WAAW,SAChB,SAAS,SAAS,MAAM,YAAa,IACrC;AAAA,oBACN,KACE,SAAS,WAAW,SAChB,SAAS,SAAS,MAAM,YAAa,IACrC;AAAA,kBACR;AAAA;AAAA,cACF;AAAA;AAAA;AAAA,QAEJ;AAAA,MAEJ;AAAA;AAAA,EACF,GACF;AAEJ,CAAC;AACD,gBAAgB,cAAc;AAE9B,QAAQ,SAAS;AACjB,QAAQ,WAAW;AACnB,QAAQ,cAAc;","names":[]}
@@ -1,17 +1,17 @@
1
1
  "use client";
2
2
  import {
3
3
  ColorInput
4
- } from "../../chunk-X7WXW6AV.js";
4
+ } from "../../chunk-4E45SQMX.js";
5
5
  import "../../chunk-VIO22OUP.js";
6
6
  import "../../chunk-MWYGXAJQ.js";
7
7
  import "../../chunk-JJXJXOZ7.js";
8
8
  import "../../chunk-57ZKN6G3.js";
9
9
  import "../../chunk-YFBYWNYF.js";
10
10
  import "../../chunk-ZJZUNSCO.js";
11
- import "../../chunk-N7T45HQC.js";
12
- import "../../chunk-QSFXOVRL.js";
11
+ import "../../chunk-XG7ZGCBW.js";
12
+ import "../../chunk-2MVQG2PQ.js";
13
13
  import "../../chunk-AZ4WBNXD.js";
14
- import "../../chunk-FIAJMBSD.js";
14
+ import "../../chunk-2TFJ4SMR.js";
15
15
  import "../../chunk-H4D7LXZL.js";
16
16
  import "../../chunk-CTBTEAD6.js";
17
17
  import "../../chunk-5SQC5LKY.js";
@@ -15,14 +15,14 @@ import {
15
15
  ComboboxTarget,
16
16
  useCombobox,
17
17
  useComboboxContext
18
- } from "../../chunk-BVGYS3NN.js";
18
+ } from "../../chunk-WVYAE5MT.js";
19
19
  import "../../chunk-57ZKN6G3.js";
20
20
  import "../../chunk-YFBYWNYF.js";
21
21
  import "../../chunk-ZJZUNSCO.js";
22
- import "../../chunk-N7T45HQC.js";
23
- import "../../chunk-QSFXOVRL.js";
22
+ import "../../chunk-XG7ZGCBW.js";
23
+ import "../../chunk-2MVQG2PQ.js";
24
24
  import "../../chunk-AZ4WBNXD.js";
25
- import "../../chunk-FIAJMBSD.js";
25
+ import "../../chunk-2TFJ4SMR.js";
26
26
  import "../../chunk-H4D7LXZL.js";
27
27
  import "../../chunk-CTBTEAD6.js";
28
28
  import "../../chunk-5SQC5LKY.js";
@@ -1,18 +1,18 @@
1
1
  "use client";
2
2
  import {
3
3
  Select
4
- } from "../../chunk-DZ7HIMJ5.js";
4
+ } from "../../chunk-JXRN4MGT.js";
5
5
  import "../../chunk-DHAMBKCR.js";
6
- import "../../chunk-BVGYS3NN.js";
6
+ import "../../chunk-WVYAE5MT.js";
7
7
  import "../../chunk-JJXJXOZ7.js";
8
8
  import "../../chunk-DCC7EE67.js";
9
9
  import "../../chunk-57ZKN6G3.js";
10
10
  import "../../chunk-YFBYWNYF.js";
11
11
  import "../../chunk-ZJZUNSCO.js";
12
- import "../../chunk-N7T45HQC.js";
13
- import "../../chunk-QSFXOVRL.js";
12
+ import "../../chunk-XG7ZGCBW.js";
13
+ import "../../chunk-2MVQG2PQ.js";
14
14
  import "../../chunk-AZ4WBNXD.js";
15
- import "../../chunk-FIAJMBSD.js";
15
+ import "../../chunk-2TFJ4SMR.js";
16
16
  import "../../chunk-H4D7LXZL.js";
17
17
  import "../../chunk-CTBTEAD6.js";
18
18
  import "../../chunk-5SQC5LKY.js";
@@ -1,18 +1,18 @@
1
1
  "use client";
2
2
  import {
3
3
  TagsInput
4
- } from "../../chunk-KNN75VAT.js";
4
+ } from "../../chunk-N76DWAX4.js";
5
5
  import "../../chunk-CGR72YL6.js";
6
6
  import "../../chunk-UYKK6PVB.js";
7
- import "../../chunk-BVGYS3NN.js";
7
+ import "../../chunk-WVYAE5MT.js";
8
8
  import "../../chunk-JJXJXOZ7.js";
9
9
  import "../../chunk-57ZKN6G3.js";
10
10
  import "../../chunk-YFBYWNYF.js";
11
11
  import "../../chunk-ZJZUNSCO.js";
12
- import "../../chunk-N7T45HQC.js";
13
- import "../../chunk-QSFXOVRL.js";
12
+ import "../../chunk-XG7ZGCBW.js";
13
+ import "../../chunk-2MVQG2PQ.js";
14
14
  import "../../chunk-AZ4WBNXD.js";
15
- import "../../chunk-FIAJMBSD.js";
15
+ import "../../chunk-2TFJ4SMR.js";
16
16
  import "../../chunk-H4D7LXZL.js";
17
17
  import "../../chunk-CTBTEAD6.js";
18
18
  import "../../chunk-5SQC5LKY.js";
@@ -1,11 +1,11 @@
1
1
  "use client";
2
2
  import {
3
3
  Dialog
4
- } from "../../chunk-63PSLIW5.js";
4
+ } from "../../chunk-K3B2RENY.js";
5
5
  import "../../chunk-57ZKN6G3.js";
6
6
  import "../../chunk-YFBYWNYF.js";
7
7
  import "../../chunk-ZJZUNSCO.js";
8
- import "../../chunk-FIAJMBSD.js";
8
+ import "../../chunk-2TFJ4SMR.js";
9
9
  import "../../chunk-H4D7LXZL.js";
10
10
  import "../../chunk-CTBTEAD6.js";
11
11
  import "../../chunk-5SQC5LKY.js";
@@ -2,16 +2,16 @@
2
2
  import {
3
3
  Dropzone,
4
4
  formatFileSize
5
- } from "../../chunk-ZTOAB4HM.js";
6
- import "../../chunk-YQOS23WP.js";
7
- import "../../chunk-HGYIOR5F.js";
5
+ } from "../../chunk-NGXT7GNE.js";
6
+ import "../../chunk-7EINGVGG.js";
7
+ import "../../chunk-ESMDK5GY.js";
8
8
  import "../../chunk-NZQI4WL5.js";
9
9
  import "../../chunk-7KIXQ2XG.js";
10
10
  import "../../chunk-57ZKN6G3.js";
11
11
  import "../../chunk-YFBYWNYF.js";
12
12
  import "../../chunk-ZJZUNSCO.js";
13
13
  import "../../chunk-AZ4WBNXD.js";
14
- import "../../chunk-FIAJMBSD.js";
14
+ import "../../chunk-2TFJ4SMR.js";
15
15
  import "../../chunk-H4D7LXZL.js";
16
16
  import "../../chunk-CTBTEAD6.js";
17
17
  import "../../chunk-MYHAWRIV.js";
@@ -6,11 +6,11 @@ import {
6
6
  MenuItem,
7
7
  MenuLabel,
8
8
  MenuTarget
9
- } from "../../chunk-5XXK7KQE.js";
10
- import "../../chunk-N7T45HQC.js";
11
- import "../../chunk-QSFXOVRL.js";
9
+ } from "../../chunk-OYUQO4ZT.js";
10
+ import "../../chunk-XG7ZGCBW.js";
11
+ import "../../chunk-2MVQG2PQ.js";
12
12
  import "../../chunk-AZ4WBNXD.js";
13
- import "../../chunk-FIAJMBSD.js";
13
+ import "../../chunk-2TFJ4SMR.js";
14
14
  import "../../chunk-H4D7LXZL.js";
15
15
  import "../../chunk-CTBTEAD6.js";
16
16
  import "../../chunk-5SQC5LKY.js";
@@ -2,14 +2,14 @@
2
2
  import {
3
3
  Drawer,
4
4
  DrawerRoot
5
- } from "../../chunk-7GLDYLJ6.js";
6
- import "../../chunk-HGYIOR5F.js";
5
+ } from "../../chunk-O6A7IBIW.js";
6
+ import "../../chunk-ESMDK5GY.js";
7
7
  import "../../chunk-NZQI4WL5.js";
8
8
  import "../../chunk-57ZKN6G3.js";
9
9
  import "../../chunk-YFBYWNYF.js";
10
10
  import "../../chunk-ZJZUNSCO.js";
11
11
  import "../../chunk-AZ4WBNXD.js";
12
- import "../../chunk-FIAJMBSD.js";
12
+ import "../../chunk-2TFJ4SMR.js";
13
13
  import "../../chunk-H4D7LXZL.js";
14
14
  import "../../chunk-CTBTEAD6.js";
15
15
  import "../../chunk-5SQC5LKY.js";
@@ -2,14 +2,14 @@
2
2
  import {
3
3
  Modal,
4
4
  ModalRoot
5
- } from "../../chunk-YQOS23WP.js";
6
- import "../../chunk-HGYIOR5F.js";
5
+ } from "../../chunk-7EINGVGG.js";
6
+ import "../../chunk-ESMDK5GY.js";
7
7
  import "../../chunk-NZQI4WL5.js";
8
8
  import "../../chunk-57ZKN6G3.js";
9
9
  import "../../chunk-YFBYWNYF.js";
10
10
  import "../../chunk-ZJZUNSCO.js";
11
11
  import "../../chunk-AZ4WBNXD.js";
12
- import "../../chunk-FIAJMBSD.js";
12
+ import "../../chunk-2TFJ4SMR.js";
13
13
  import "../../chunk-H4D7LXZL.js";
14
14
  import "../../chunk-CTBTEAD6.js";
15
15
  import "../../chunk-5SQC5LKY.js";
@@ -9,13 +9,13 @@ import {
9
9
  ModalBaseTitle,
10
10
  sizeValue,
11
11
  useModalContext
12
- } from "../../chunk-HGYIOR5F.js";
12
+ } from "../../chunk-ESMDK5GY.js";
13
13
  import "../../chunk-NZQI4WL5.js";
14
14
  import "../../chunk-57ZKN6G3.js";
15
15
  import "../../chunk-YFBYWNYF.js";
16
16
  import "../../chunk-ZJZUNSCO.js";
17
17
  import "../../chunk-AZ4WBNXD.js";
18
- import "../../chunk-FIAJMBSD.js";
18
+ import "../../chunk-2TFJ4SMR.js";
19
19
  import {
20
20
  Transition
21
21
  } from "../../chunk-H4D7LXZL.js";
@@ -5,20 +5,20 @@ import {
5
5
  matchesPhoneStartingNumber,
6
6
  normalizeStartingNumber,
7
7
  resolvePhoneCountry
8
- } from "../../chunk-SJBYDDDD.js";
8
+ } from "../../chunk-LGL6XP6C.js";
9
9
  import "../../chunk-TVOR2RGE.js";
10
- import "../../chunk-DZ7HIMJ5.js";
10
+ import "../../chunk-JXRN4MGT.js";
11
11
  import "../../chunk-DHAMBKCR.js";
12
- import "../../chunk-BVGYS3NN.js";
12
+ import "../../chunk-WVYAE5MT.js";
13
13
  import "../../chunk-JJXJXOZ7.js";
14
14
  import "../../chunk-DCC7EE67.js";
15
15
  import "../../chunk-57ZKN6G3.js";
16
16
  import "../../chunk-YFBYWNYF.js";
17
17
  import "../../chunk-ZJZUNSCO.js";
18
- import "../../chunk-N7T45HQC.js";
19
- import "../../chunk-QSFXOVRL.js";
18
+ import "../../chunk-XG7ZGCBW.js";
19
+ import "../../chunk-2MVQG2PQ.js";
20
20
  import "../../chunk-AZ4WBNXD.js";
21
- import "../../chunk-FIAJMBSD.js";
21
+ import "../../chunk-2TFJ4SMR.js";
22
22
  import "../../chunk-H4D7LXZL.js";
23
23
  import "../../chunk-CTBTEAD6.js";
24
24
  import "../../chunk-5SQC5LKY.js";
@@ -4,10 +4,10 @@ import {
4
4
  PopoverDropdown,
5
5
  PopoverTarget,
6
6
  usePopoverContext
7
- } from "../../chunk-N7T45HQC.js";
8
- import "../../chunk-QSFXOVRL.js";
7
+ } from "../../chunk-XG7ZGCBW.js";
8
+ import "../../chunk-2MVQG2PQ.js";
9
9
  import "../../chunk-AZ4WBNXD.js";
10
- import "../../chunk-FIAJMBSD.js";
10
+ import "../../chunk-2TFJ4SMR.js";
11
11
  import "../../chunk-H4D7LXZL.js";
12
12
  import "../../chunk-CTBTEAD6.js";
13
13
  import "../../chunk-CJ7I6UM7.js";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  OptionalPortal,
4
4
  Portal
5
- } from "../../chunk-FIAJMBSD.js";
5
+ } from "../../chunk-2TFJ4SMR.js";
6
6
  import "../../chunk-4QBFXTYH.js";
7
7
  import "../../chunk-IK562BNJ.js";
8
8
  import "../../chunk-ORHFHJKL.js";
@@ -2,9 +2,9 @@
2
2
  import {
3
3
  Tooltip,
4
4
  TooltipFloating
5
- } from "../../chunk-COAMHU2N.js";
6
- import "../../chunk-QSFXOVRL.js";
7
- import "../../chunk-FIAJMBSD.js";
5
+ } from "../../chunk-3IKAVFR3.js";
6
+ import "../../chunk-2MVQG2PQ.js";
7
+ import "../../chunk-2TFJ4SMR.js";
8
8
  import "../../chunk-H4D7LXZL.js";
9
9
  import "../../chunk-CTBTEAD6.js";
10
10
  import "../../chunk-TWM6DSH4.js";
package/dist/index.cjs CHANGED
@@ -3403,7 +3403,7 @@ function Portal(_props) {
3403
3403
  const { target, reuseTargetNode, className, id, children } = useProps("Portal", { reuseTargetNode: true }, _props);
3404
3404
  const [node, setNode] = (0, import_react16.useState)(null);
3405
3405
  const created = (0, import_react16.useRef)(null);
3406
- (0, import_react16.useEffect)(() => {
3406
+ (0, import_react16.useLayoutEffect)(() => {
3407
3407
  if (target) {
3408
3408
  const el = typeof target === "string" ? document.querySelector(target) : target;
3409
3409
  if (el) syncPortalDir(el);
@@ -5597,6 +5597,15 @@ function split(position) {
5597
5597
  const [side, align] = position.split("-");
5598
5598
  return [side, align ?? "center"];
5599
5599
  }
5600
+ function toPlaceAlign(align, dir, side) {
5601
+ if (align === "center") return "center";
5602
+ if (align === "left") return "start";
5603
+ if (align === "right") return "end";
5604
+ if (dir === "rtl" && (side === "top" || side === "bottom")) {
5605
+ return align === "start" ? "end" : "start";
5606
+ }
5607
+ return align;
5608
+ }
5600
5609
  function place(ref, width, height, side, align, offset) {
5601
5610
  let x = 0;
5602
5611
  let y = 0;
@@ -5640,10 +5649,8 @@ function useFloating(options) {
5640
5649
  const height = el.offsetHeight;
5641
5650
  const vw = document.documentElement.clientWidth;
5642
5651
  const vh = document.documentElement.clientHeight;
5643
- let [side, align] = split(position);
5644
- if (dir === "rtl" && (side === "top" || side === "bottom") && align !== "center") {
5645
- align = align === "start" ? "end" : "start";
5646
- }
5652
+ let [side, rawAlign] = split(position);
5653
+ const align = toPlaceAlign(rawAlign, dir, side);
5647
5654
  const locked = preventPositionChangeWhenVisible ? lockedSide.current : null;
5648
5655
  if (locked) side = locked;
5649
5656
  let { x, y } = place(rect, width, height, side, align, offset);
@@ -5683,7 +5690,7 @@ function useFloating(options) {
5683
5690
  arrowY = Math.min(Math.max(target, min), height - min);
5684
5691
  }
5685
5692
  }
5686
- const placement = align === "center" ? side : `${side}-${align}`;
5693
+ const placement = rawAlign === "center" ? side : `${side}-${rawAlign}`;
5687
5694
  if (placement !== lastPlacement.current) {
5688
5695
  lastPlacement.current = placement;
5689
5696
  changed.current?.(placement);
@@ -5699,11 +5706,14 @@ function useFloating(options) {
5699
5706
  }, [opened, update2]);
5700
5707
  (0, import_react32.useEffect)(() => {
5701
5708
  if (!opened) return;
5702
- let frame = requestAnimationFrame(update2);
5709
+ let frame = 0;
5703
5710
  const onChange = () => {
5704
5711
  cancelAnimationFrame(frame);
5705
- frame = requestAnimationFrame(update2);
5712
+ frame = requestAnimationFrame(() => {
5713
+ frame = requestAnimationFrame(update2);
5714
+ });
5706
5715
  };
5716
+ onChange();
5707
5717
  window.addEventListener("scroll", onChange, true);
5708
5718
  window.addEventListener("resize", onChange);
5709
5719
  const observer = typeof ResizeObserver !== "undefined" ? new ResizeObserver(onChange) : null;
@@ -5874,7 +5884,7 @@ var PopoverDropdown = factory(({ children, className, style, ...others }, ref) =
5874
5884
  const { props, floating } = context;
5875
5885
  const dropdownRef = (0, import_react33.useRef)(null);
5876
5886
  useFocusTrap(dropdownRef, context.opened && !!props.trapFocus, props.returnFocus);
5877
- const width = props.width === "target" ? floating.referenceWidth : props.width === "auto" ? void 0 : rem(props.width);
5887
+ const width = props.width === "target" ? floating.referenceWidth > 0 ? floating.referenceWidth : void 0 : props.width === "auto" ? void 0 : rem(props.width);
5878
5888
  return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(OptionalPortal, { withinPortal: props.withinPortal, ...props.portalProps, children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
5879
5889
  Transition,
5880
5890
  {
@@ -5898,9 +5908,14 @@ var PopoverDropdown = factory(({ children, className, style, ...others }, ref) =
5898
5908
  style: {
5899
5909
  ...transitionStyles2,
5900
5910
  ...dropdown.style,
5911
+ // transform (not top/left) — survives filter/mask containing blocks on ancestors
5912
+ // when a portal is briefly missing, and avoids inset shorthand fights.
5901
5913
  position: "fixed",
5902
- top: floating.y,
5903
- left: floating.x,
5914
+ top: 0,
5915
+ left: 0,
5916
+ right: "auto",
5917
+ bottom: "auto",
5918
+ transform: floating.ready ? `translate3d(${Math.round(floating.x)}px, ${Math.round(floating.y)}px, 0)` : "translate3d(-9999px, -9999px, 0)",
5904
5919
  width,
5905
5920
  zIndex: props.zIndex,
5906
5921
  // Invisible until measured, so it doesn't flash at 0,0.
@@ -9536,7 +9551,7 @@ var DEFAULT_PHONE_CODE = "20";
9536
9551
 
9537
9552
  // src/components/PhoneInput/PhoneInput.tsx
9538
9553
  var import_jsx_runtime68 = (
9539
- // Always LTR: flag then dial code (RTL pages were flipping to "966 | flag").
9554
+ // Match classic PhoneInput: dial code then flag (trigger + list). Isolated LTR so RTL pages don't reorder.
9540
9555
  require("react/jsx-runtime")
9541
9556
  );
9542
9557
  var DEFAULT_COUNTRIES = ALL_PHONE_COUNTRIES;
@@ -9672,8 +9687,8 @@ var PhoneInput = factory((_props, ref) => {
9672
9687
  if (fitted !== latest.current.phone) latest.current.setPhone(fitted);
9673
9688
  }, [countryCode]);
9674
9689
  const showCountry = (item) => renderCountry ? renderCountry(item) : /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("span", { ...getStyles("codeValue"), dir: "ltr", children: [
9675
- typeof item.flag === "string" ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("img", { ...getStyles("flag"), src: item.flag, alt: item.name ?? "", onError: (event) => event.currentTarget.style.display = "none" }) : item.flag,
9676
- /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { ...getStyles("dialCode"), children: item.code })
9690
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { ...getStyles("dialCode"), children: item.code }),
9691
+ typeof item.flag === "string" ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("img", { ...getStyles("flag"), src: item.flag, alt: item.name ?? "", onError: (event) => event.currentTarget.style.display = "none" }) : item.flag
9677
9692
  ] });
9678
9693
  const toOption = (item) => ({ value: item.code, label: showCountry(item), searchText: `${item.name ?? ""} ${item.code}`, resolved: item });
9679
9694
  const hasMessage = (message) => message !== void 0 && message !== null && message !== false && message !== true && message !== "";
@@ -9698,19 +9713,35 @@ var PhoneInput = factory((_props, ref) => {
9698
9713
  "aria-label": codePlaceholder,
9699
9714
  ...selectProps,
9700
9715
  // PhoneInput wins these after selectProps — dial codes stay LTR and compact.
9701
- searchable: false,
9716
+ searchable: true,
9702
9717
  checkIconPosition: "right",
9718
+ // LTR trigger; chevron sits on the physical left like the old Mantine control.
9719
+ dir: "ltr",
9720
+ rightSectionWidth: "1.5rem",
9721
+ // Search box + ~5 country rows; still short enough that flip-to-top stays near the trigger.
9722
+ maxDropdownHeight: selectProps?.maxDropdownHeight ?? 280,
9703
9723
  classNames: {
9704
9724
  ...selectPropClassNames,
9705
9725
  dropdown: ["wello-PhoneInput-dropdown", selectPropClassNames.dropdown].filter(Boolean).join(" ")
9706
9726
  },
9727
+ attributes: {
9728
+ ...typeof selectProps?.attributes === "object" ? selectProps.attributes : {},
9729
+ // Physical LTR on the portaled node — portal root may still be dir=rtl from <html>.
9730
+ dropdown: {
9731
+ ...typeof selectProps?.attributes === "object" && selectProps.attributes?.dropdown || {},
9732
+ dir: "ltr"
9733
+ }
9734
+ },
9707
9735
  comboboxProps: {
9708
- width: "target",
9709
9736
  middlewares: { flip: true, shift: true },
9710
9737
  ...selectProps?.comboboxProps,
9711
- position: "bottom-start",
9738
+ // Physical left — never mirrors in RTL (start/end would).
9739
+ position: "bottom-left",
9740
+ // Shrink-wrap to flag+code; `target` was the narrow trigger and fought min-width.
9741
+ width: "auto",
9712
9742
  withinPortal: true,
9713
- // Don't RTL-flip start/end — dial code stays left-anchored like a phone number.
9743
+ // overflow:hidden on the phone field must not hide the menu as "detached".
9744
+ hideDetached: false,
9714
9745
  dir: "ltr"
9715
9746
  },
9716
9747
  onChange: (next, option) => {