@helsenorge/designsystem-react 15.5.0 → 15.5.1

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 (194) hide show
  1. package/lib/AnchorLink.js.map +1 -1
  2. package/lib/Avatar.js.map +1 -1
  3. package/lib/Button.js.map +1 -1
  4. package/lib/CHANGELOG.md +8 -0
  5. package/lib/Checkbox.js +6 -4
  6. package/lib/Checkbox.js.map +1 -1
  7. package/lib/Checkbox2.js.map +1 -1
  8. package/lib/CheckboxMarker.js.map +1 -1
  9. package/lib/Chip.js.map +1 -1
  10. package/lib/Close.js.map +1 -1
  11. package/lib/Drawer.js.map +1 -1
  12. package/lib/DrawerNavigation.js.map +1 -1
  13. package/lib/Duolist.js.map +1 -1
  14. package/lib/ElementHeader.js.map +1 -1
  15. package/lib/ElementHeaderText.js.map +1 -1
  16. package/lib/ErrorWrapper.js +2 -1
  17. package/lib/ErrorWrapper.js.map +1 -1
  18. package/lib/Expander.js +2 -1
  19. package/lib/Expander.js.map +1 -1
  20. package/lib/FilterButton.js.map +1 -1
  21. package/lib/FilterButtonAndChipsWrapper.js.map +1 -1
  22. package/lib/FilterDrawer.js.map +1 -1
  23. package/lib/FilterLinkList.js +2 -1
  24. package/lib/FilterLinkList.js.map +1 -1
  25. package/lib/FilterOverviewSearch.js.map +1 -1
  26. package/lib/FilterResultCountAndSortWrapper.js.map +1 -1
  27. package/lib/FilterSearch.js.map +1 -1
  28. package/lib/FormFieldTag.js.map +1 -1
  29. package/lib/FormGroup.js.map +1 -1
  30. package/lib/FormLayout.js.map +1 -1
  31. package/lib/HelpDetails.js.map +1 -1
  32. package/lib/HelpTriggerIcon.js.map +1 -1
  33. package/lib/HelpTriggerStandalone.js.map +1 -1
  34. package/lib/HighlightPanel.js.map +1 -1
  35. package/lib/Highlighter.js.map +1 -1
  36. package/lib/HorizontalScroll.js.map +1 -1
  37. package/lib/Icon.js.map +1 -1
  38. package/lib/Illustration.js.map +1 -1
  39. package/lib/InfoTeaser.js.map +1 -1
  40. package/lib/Input.js.map +1 -1
  41. package/lib/LazyIcon.js.map +1 -1
  42. package/lib/LazyIllustration.js.map +1 -1
  43. package/lib/LinkList.js +31 -28
  44. package/lib/LinkList.js.map +1 -1
  45. package/lib/List.js +4 -2
  46. package/lib/List.js.map +1 -1
  47. package/lib/ListEditMode.js +5 -4
  48. package/lib/ListEditMode.js.map +1 -1
  49. package/lib/LoaderSpinner.js.map +1 -1
  50. package/lib/MaxCharacters.js.map +1 -1
  51. package/lib/PanelTitle.js.map +1 -1
  52. package/lib/PopOver.js +5 -2
  53. package/lib/PopOver.js.map +1 -1
  54. package/lib/Radio.js.map +1 -1
  55. package/lib/RadioButton.js.map +1 -1
  56. package/lib/RadioMarker.js +11 -10
  57. package/lib/RadioMarker.js.map +1 -1
  58. package/lib/Select.js.map +1 -1
  59. package/lib/SingleSelectItem.js.map +1 -1
  60. package/lib/Slider.js +0 -2
  61. package/lib/Slider.js.map +1 -1
  62. package/lib/Spacer.js +16 -15
  63. package/lib/Spacer.js.map +1 -1
  64. package/lib/StatusDot.js.map +1 -1
  65. package/lib/StatusDotList.js.map +1 -1
  66. package/lib/StepButtons.js.map +1 -1
  67. package/lib/TabList.js.map +1 -1
  68. package/lib/TabPanel.js +2 -1
  69. package/lib/TabPanel.js.map +1 -1
  70. package/lib/TableBody.js +2 -1
  71. package/lib/TableBody.js.map +1 -1
  72. package/lib/TableCell.js +2 -1
  73. package/lib/TableCell.js.map +1 -1
  74. package/lib/TableExpandedRow.js +6 -3
  75. package/lib/TableExpandedRow.js.map +1 -1
  76. package/lib/TableExpanderCell.js +2 -1
  77. package/lib/TableExpanderCell.js.map +1 -1
  78. package/lib/TableHead.js +7 -6
  79. package/lib/TableHead.js.map +1 -1
  80. package/lib/TableHeadCell.js.map +1 -1
  81. package/lib/TableRow.js +7 -5
  82. package/lib/TableRow.js.map +1 -1
  83. package/lib/Textarea.js.map +1 -1
  84. package/lib/Title.js +20 -17
  85. package/lib/Title.js.map +1 -1
  86. package/lib/Toast.js.map +1 -1
  87. package/lib/VisualCheckbox.js.map +1 -1
  88. package/lib/VisualRadio.js.map +1 -1
  89. package/lib/components/ArticleTeaser/index.js.map +1 -1
  90. package/lib/components/Dropdown/index.js.map +1 -1
  91. package/lib/components/DropdownOld/index.js.map +1 -1
  92. package/lib/components/EmptyState/index.js +1 -3
  93. package/lib/components/EmptyState/index.js.map +1 -1
  94. package/lib/components/ExpanderHierarchy/index.js +2 -1
  95. package/lib/components/ExpanderHierarchy/index.js.map +1 -1
  96. package/lib/components/ExpanderList/index.js +7 -6
  97. package/lib/components/ExpanderList/index.js.map +1 -1
  98. package/lib/components/EyebrowHeader/index.js.map +1 -1
  99. package/lib/components/FavoriteButton/index.js +9 -7
  100. package/lib/components/FavoriteButton/index.js.map +1 -1
  101. package/lib/components/HelpBubble/index.js.map +1 -1
  102. package/lib/components/HelpExpanderInline/index.js.map +1 -1
  103. package/lib/components/HelpExpanderStandalone/index.js.map +1 -1
  104. package/lib/components/HelpTooltip/index.js +6 -3
  105. package/lib/components/HelpTooltip/index.js.map +1 -1
  106. package/lib/components/HelpTriggerInline/index.js.map +1 -1
  107. package/lib/components/Icons/AlarmClock.js.map +1 -1
  108. package/lib/components/Icons/Bus.js.map +1 -1
  109. package/lib/components/Illustrations/BabyMobile.js +5 -4
  110. package/lib/components/Illustrations/BabyMobile.js.map +1 -1
  111. package/lib/components/Illustrations/BabyMobileMedium.js.map +1 -1
  112. package/lib/components/Illustrations/Child.js +5 -4
  113. package/lib/components/Illustrations/Child.js.map +1 -1
  114. package/lib/components/Illustrations/ChildMedium.js.map +1 -1
  115. package/lib/components/Illustrations/Doctor.js +10 -8
  116. package/lib/components/Illustrations/Doctor.js.map +1 -1
  117. package/lib/components/Illustrations/DoctorMedium.js.map +1 -1
  118. package/lib/components/Illustrations/DoctorSmall.js.map +1 -1
  119. package/lib/components/Illustrations/EyeContact.js +5 -4
  120. package/lib/components/Illustrations/EyeContact.js.map +1 -1
  121. package/lib/components/Illustrations/EyeContactMedium.js.map +1 -1
  122. package/lib/components/Illustrations/FacialRecognitionFingerprint.js +5 -4
  123. package/lib/components/Illustrations/FacialRecognitionFingerprint.js.map +1 -1
  124. package/lib/components/Illustrations/FacialRecognitionFingerprintMedium.js.map +1 -1
  125. package/lib/components/Illustrations/GiveBabyFood.js +5 -4
  126. package/lib/components/Illustrations/GiveBabyFood.js.map +1 -1
  127. package/lib/components/Illustrations/GiveBabyFoodMedium.js.map +1 -1
  128. package/lib/components/Illustrations/HealthcarePersonnel.js +10 -8
  129. package/lib/components/Illustrations/HealthcarePersonnel.js.map +1 -1
  130. package/lib/components/Illustrations/HealthcarePersonnelMedium.js.map +1 -1
  131. package/lib/components/Illustrations/HealthcarePersonnelSmall.js.map +1 -1
  132. package/lib/components/Illustrations/ReadLetters.js +5 -4
  133. package/lib/components/Illustrations/ReadLetters.js.map +1 -1
  134. package/lib/components/Illustrations/ReadLettersMedium.js.map +1 -1
  135. package/lib/components/Illustrations/SkinToSkin.js +5 -4
  136. package/lib/components/Illustrations/SkinToSkin.js.map +1 -1
  137. package/lib/components/Illustrations/SkinToSkinMedium.js.map +1 -1
  138. package/lib/components/Illustrations/Stork.js +5 -4
  139. package/lib/components/Illustrations/Stork.js.map +1 -1
  140. package/lib/components/Illustrations/StorkMedium.js.map +1 -1
  141. package/lib/components/Illustrations/Stroller.js +5 -4
  142. package/lib/components/Illustrations/Stroller.js.map +1 -1
  143. package/lib/components/Illustrations/StrollerMedium.js.map +1 -1
  144. package/lib/components/Illustrations/Support2.js +5 -4
  145. package/lib/components/Illustrations/Support2.js.map +1 -1
  146. package/lib/components/Illustrations/Support2Medium.js.map +1 -1
  147. package/lib/components/Illustrations/Thinking.js +5 -4
  148. package/lib/components/Illustrations/Thinking.js.map +1 -1
  149. package/lib/components/Illustrations/ThinkingMedium.js.map +1 -1
  150. package/lib/components/Loader/index.js +14 -13
  151. package/lib/components/Loader/index.js.map +1 -1
  152. package/lib/components/Logo/index.js.map +1 -1
  153. package/lib/components/Modal/index.js.map +1 -1
  154. package/lib/components/NotificationPanel/index.js +7 -4
  155. package/lib/components/NotificationPanel/index.js.map +1 -1
  156. package/lib/components/Panel/index.js +17 -16
  157. package/lib/components/Panel/index.js.map +1 -1
  158. package/lib/components/PanelList/index.js.map +1 -1
  159. package/lib/components/PopMenu/index.js.map +1 -1
  160. package/lib/components/Progressbar/index.js +6 -5
  161. package/lib/components/Progressbar/index.js.map +1 -1
  162. package/lib/components/PromoPanel/index.js.map +1 -1
  163. package/lib/components/ServiceMessage/index.js +2 -1
  164. package/lib/components/ServiceMessage/index.js.map +1 -1
  165. package/lib/components/SharingStatus/index.js.map +1 -1
  166. package/lib/components/Step/index.js.map +1 -1
  167. package/lib/components/Stepper/index.js +4 -2
  168. package/lib/components/Stepper/index.js.map +1 -1
  169. package/lib/components/StickyNote/index.js.map +1 -1
  170. package/lib/components/Table/index.js +2 -5
  171. package/lib/components/Table/index.js.map +1 -1
  172. package/lib/components/Tabs/index.js.map +1 -1
  173. package/lib/components/Tag/index.js +2 -1
  174. package/lib/components/Tag/index.js.map +1 -1
  175. package/lib/components/TagList/index.js.map +1 -1
  176. package/lib/components/Tile/index.js +5 -4
  177. package/lib/components/Tile/index.js.map +1 -1
  178. package/lib/components/ToastList/index.js +2 -1
  179. package/lib/components/ToastList/index.js.map +1 -1
  180. package/lib/components/Toggle/index.js +7 -4
  181. package/lib/components/Toggle/index.js.map +1 -1
  182. package/lib/components/Validation/index.js.map +1 -1
  183. package/lib/components/VisualCheckboxCloud/index.js.map +1 -1
  184. package/lib/components/VisualCheckboxGroup/index.js.map +1 -1
  185. package/lib/components/VisualContentgroupWithImage/index.js.map +1 -1
  186. package/lib/components/VisualRadioCloud/index.js.map +1 -1
  187. package/lib/components/VisualRadioGroup/index.js.map +1 -1
  188. package/lib/floating-ui.react.js +91 -111
  189. package/lib/floating-ui.react.js.map +1 -1
  190. package/lib/getFilterChips.js.map +1 -1
  191. package/lib/theme/spacers.js +2 -2
  192. package/lib/theme/spacers.js.map +1 -1
  193. package/lib/utils2.js.map +1 -1
  194. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../src/components/VisualRadioGroup/VisualRadioGroup.tsx","../../../src/components/VisualRadioGroup/index.ts"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport type { VisualRadioProps, VisualRadioVariant } from './VisualRadio/VisualRadio';\n\nimport VisualRadio from './VisualRadio/VisualRadio';\nimport { useIdWithFallback } from '../../hooks/useIdWithFallback';\nimport { useIsMobileBreakpoint } from '../../hooks/useIsMobileBreakpoint';\nimport { isComponent } from '../../utils/component';\nimport ErrorWrapper from '../ErrorWrapper';\n\nimport styles from './styles.module.scss';\n\nexport interface VisualRadioGroupProps {\n /** Items in the group. Should be VisualRadioGroup.VisualRadio elements. */\n children?: React.ReactNode;\n /** Name shared by all child VisualRadio elements (overridable per child). Auto-generated if omitted. */\n name?: string;\n /** Selected value (controlled). */\n value?: string;\n /** Initial selected value (uncontrolled). */\n defaultValue?: string;\n /** Called when the selected value changes. */\n onChange?: (event: React.ChangeEvent<HTMLInputElement>, value: string) => void;\n /** Variant applied to all child VisualRadio elements (overridable per child). */\n variant?: VisualRadioVariant;\n /** When set and the number of VisualRadio children exceeds this limit on the mobile breakpoint, the variant is forced to `line`. */\n mobileLineVariantLimit?: number;\n /** Error message shown above the group */\n error?: string;\n /** Error text id (auto-generated if omitted) */\n errorTextId?: string;\n /** Renders the error component (Default: true) */\n renderError?: boolean;\n /** Ref passed to the error message element */\n errorMessageRef?: React.Ref<HTMLDivElement | null>;\n /** Adds custom classes to the root element. */\n className?: string;\n /** Adds custom classes to the errorWrapper */\n errorWrapperClassName?: string;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Sets the data-testid attribute for the error wrapper */\n errorWrapperTestId?: string;\n}\n\ninterface VisualRadioGroupComponent extends React.FC<VisualRadioGroupProps> {\n VisualRadio: typeof VisualRadio;\n}\n\nexport const VisualRadioGroup: VisualRadioGroupComponent = props => {\n const {\n children,\n name: nameProp,\n value,\n defaultValue,\n onChange,\n variant = 'rectangle',\n mobileLineVariantLimit,\n error,\n errorTextId: errorTextIdProp,\n renderError = true,\n errorMessageRef,\n className,\n errorWrapperClassName,\n testId,\n errorWrapperTestId,\n } = props;\n\n const errorTextId = useIdWithFallback(errorTextIdProp);\n const name = useIdWithFallback(nameProp);\n const isMobile = useIsMobileBreakpoint();\n\n const childArray = React.Children.toArray(children);\n const radioChildren = childArray.filter((child): child is React.ReactElement<VisualRadioProps> =>\n isComponent<VisualRadioProps>(child, VisualRadio)\n );\n\n const initialSelected =\n value ?? defaultValue ?? radioChildren.find(child => child.props.defaultChecked || child.props.checked)?.props.value?.toString();\n\n const [selectedValue, setSelectedValue] = React.useState<string | undefined>(initialSelected);\n const [prevValue, setPrevValue] = React.useState<string | undefined>(value);\n if (prevValue !== value) {\n setPrevValue(value);\n if (value !== undefined && value !== selectedValue) {\n setSelectedValue(value);\n }\n }\n\n const effectiveVariant: VisualRadioVariant | undefined =\n isMobile && mobileLineVariantLimit !== undefined && radioChildren.length > mobileLineVariantLimit ? 'line' : variant;\n\n const mapChild = (child: React.ReactNode): React.ReactNode => {\n if (isComponent<VisualRadioProps>(child, VisualRadio)) {\n const childValue = child.props.value?.toString();\n const isSelected = selectedValue !== undefined && childValue !== undefined && childValue === selectedValue;\n const childOnChange = child.props.onChange;\n\n return React.cloneElement(child, {\n name: child.props.name ?? name,\n variant: child.props.variant ?? effectiveVariant,\n error: !!error || child.props.error,\n errorTextId: child.props.errorTextId ?? errorTextId,\n checked: isSelected,\n onChange: (e: React.ChangeEvent<HTMLInputElement>): void => {\n if (childValue !== undefined) {\n setSelectedValue(childValue);\n }\n childOnChange?.(e);\n if (childValue !== undefined) {\n onChange?.(e, childValue);\n }\n },\n });\n }\n return child;\n };\n\n return (\n <ErrorWrapper\n className={classNames(errorWrapperClassName, className)}\n errorText={error}\n errorTextId={errorTextId}\n renderError={renderError}\n errorMessageRef={errorMessageRef}\n testId={errorWrapperTestId}\n >\n <div\n className={classNames(styles['visual-radio-group'], {\n [styles['visual-radio-group--variant-line']]: effectiveVariant === 'line',\n })}\n data-testid={testId}\n role={'radiogroup'}\n >\n {React.Children.map(children, mapChild)}\n </div>\n </ErrorWrapper>\n );\n};\n\nVisualRadioGroup.VisualRadio = VisualRadio;\n\nexport default VisualRadioGroup;\n","import VisualRadioGroup from './VisualRadioGroup';\nexport * from './VisualRadioGroup';\nexport default VisualRadioGroup;\n"],"mappings":";;;;;;;;;;AAmDA,IAAa,oBAA8C,UAAS;CAClE,MAAM,EACJ,UACA,MAAM,UACN,OACA,cACA,UACA,UAAU,aACV,wBACA,OACA,aAAa,iBACb,cAAc,MACd,iBACA,WACA,uBACA,QACA,uBACE;CAEJ,MAAM,cAAc,kBAAkB,eAAe;CACrD,MAAM,OAAO,kBAAkB,QAAQ;CACvC,MAAM,WAAW,sBAAsB;CAGvC,MAAM,gBADa,MAAM,SAAS,QAAQ,QACpB,CAAA,CAAW,QAAQ,UACvC,YAA8B,OAAO,WAAW,CAClD;CAEA,MAAM,kBACJ,SAAS,gBAAgB,cAAc,MAAK,UAAS,MAAM,MAAM,kBAAkB,MAAM,MAAM,OAAO,CAAC,EAAE,MAAM,OAAO,SAAS;CAEjI,MAAM,CAAC,eAAe,oBAAoB,MAAM,SAA6B,eAAe;CAC5F,MAAM,CAAC,WAAW,gBAAgB,MAAM,SAA6B,KAAK;CAC1E,IAAI,cAAc,OAAO;EACvB,aAAa,KAAK;EAClB,IAAI,UAAU,KAAA,KAAa,UAAU,eACnC,iBAAiB,KAAK;CAE1B;CAEA,MAAM,mBACJ,YAAY,2BAA2B,KAAA,KAAa,cAAc,SAAS,yBAAyB,SAAS;CAE/G,MAAM,YAAY,UAA4C;EAC5D,IAAI,YAA8B,OAAO,WAAW,GAAG;GACrD,MAAM,aAAa,MAAM,MAAM,OAAO,SAAS;GAC/C,MAAM,aAAa,kBAAkB,KAAA,KAAa,eAAe,KAAA,KAAa,eAAe;GAC7F,MAAM,gBAAgB,MAAM,MAAM;GAElC,OAAO,MAAM,aAAa,OAAO;IAC/B,MAAM,MAAM,MAAM,QAAQ;IAC1B,SAAS,MAAM,MAAM,WAAW;IAChC,OAAO,CAAC,CAAC,SAAS,MAAM,MAAM;IAC9B,aAAa,MAAM,MAAM,eAAe;IACxC,SAAS;IACT,WAAW,MAAiD;KAC1D,IAAI,eAAe,KAAA,GACjB,iBAAiB,UAAU;KAE7B,gBAAgB,CAAC;KACjB,IAAI,eAAe,KAAA,GACjB,WAAW,GAAG,UAAU;IAE5B;GACF,CAAC;EACH;EACA,OAAO;CACT;CAEA,OACE,oBAAC,sBAAD;EACE,WAAW,WAAW,uBAAuB,SAAS;EACtD,WAAW;EACE;EACA;EACI;EACjB,QAAQ;YAER,oBAAC,OAAD;GACE,WAAW,WAAW,OAAO,uBAAuB,GACjD,OAAO,sCAAsC,qBAAqB,OACrE,CAAC;GACD,eAAa;GACb,MAAM;aAEL,MAAM,SAAS,IAAI,UAAU,QAAQ;EACnC,CAAA;CACO,CAAA;AAElB;AAEA,iBAAiB,cAAc;;;AC5I/B,IAAA,2BAAe"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/components/VisualRadioGroup/VisualRadioGroup.tsx","../../../src/components/VisualRadioGroup/index.ts"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport type { VisualRadioProps, VisualRadioVariant } from './VisualRadio/VisualRadio';\n\nimport VisualRadio from './VisualRadio/VisualRadio';\nimport { useIdWithFallback } from '../../hooks/useIdWithFallback';\nimport { useIsMobileBreakpoint } from '../../hooks/useIsMobileBreakpoint';\nimport { isComponent } from '../../utils/component';\nimport ErrorWrapper from '../ErrorWrapper';\n\nimport styles from './styles.module.scss';\n\nexport interface VisualRadioGroupProps {\n /** Items in the group. Should be VisualRadioGroup.VisualRadio elements. */\n children?: React.ReactNode;\n /** Name shared by all child VisualRadio elements (overridable per child). Auto-generated if omitted. */\n name?: string;\n /** Selected value (controlled). */\n value?: string;\n /** Initial selected value (uncontrolled). */\n defaultValue?: string;\n /** Called when the selected value changes. */\n onChange?: (event: React.ChangeEvent<HTMLInputElement>, value: string) => void;\n /** Variant applied to all child VisualRadio elements (overridable per child). */\n variant?: VisualRadioVariant;\n /** When set and the number of VisualRadio children exceeds this limit on the mobile breakpoint, the variant is forced to `line`. */\n mobileLineVariantLimit?: number;\n /** Error message shown above the group */\n error?: string;\n /** Error text id (auto-generated if omitted) */\n errorTextId?: string;\n /** Renders the error component (Default: true) */\n renderError?: boolean;\n /** Ref passed to the error message element */\n errorMessageRef?: React.Ref<HTMLDivElement | null>;\n /** Adds custom classes to the root element. */\n className?: string;\n /** Adds custom classes to the errorWrapper */\n errorWrapperClassName?: string;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Sets the data-testid attribute for the error wrapper */\n errorWrapperTestId?: string;\n}\n\ninterface VisualRadioGroupComponent extends React.FC<VisualRadioGroupProps> {\n VisualRadio: typeof VisualRadio;\n}\n\nexport const VisualRadioGroup: VisualRadioGroupComponent = props => {\n const {\n children,\n name: nameProp,\n value,\n defaultValue,\n onChange,\n variant = 'rectangle',\n mobileLineVariantLimit,\n error,\n errorTextId: errorTextIdProp,\n renderError = true,\n errorMessageRef,\n className,\n errorWrapperClassName,\n testId,\n errorWrapperTestId,\n } = props;\n\n const errorTextId = useIdWithFallback(errorTextIdProp);\n const name = useIdWithFallback(nameProp);\n const isMobile = useIsMobileBreakpoint();\n\n const childArray = React.Children.toArray(children);\n const radioChildren = childArray.filter((child): child is React.ReactElement<VisualRadioProps> =>\n isComponent<VisualRadioProps>(child, VisualRadio)\n );\n\n const initialSelected =\n value ?? defaultValue ?? radioChildren.find(child => child.props.defaultChecked || child.props.checked)?.props.value?.toString();\n\n const [selectedValue, setSelectedValue] = React.useState<string | undefined>(initialSelected);\n const [prevValue, setPrevValue] = React.useState<string | undefined>(value);\n if (prevValue !== value) {\n setPrevValue(value);\n if (value !== undefined && value !== selectedValue) {\n setSelectedValue(value);\n }\n }\n\n const effectiveVariant: VisualRadioVariant | undefined =\n isMobile && mobileLineVariantLimit !== undefined && radioChildren.length > mobileLineVariantLimit ? 'line' : variant;\n\n const mapChild = (child: React.ReactNode): React.ReactNode => {\n if (isComponent<VisualRadioProps>(child, VisualRadio)) {\n const childValue = child.props.value?.toString();\n const isSelected = selectedValue !== undefined && childValue !== undefined && childValue === selectedValue;\n const childOnChange = child.props.onChange;\n\n return React.cloneElement(child, {\n name: child.props.name ?? name,\n variant: child.props.variant ?? effectiveVariant,\n error: !!error || child.props.error,\n errorTextId: child.props.errorTextId ?? errorTextId,\n checked: isSelected,\n onChange: (e: React.ChangeEvent<HTMLInputElement>): void => {\n if (childValue !== undefined) {\n setSelectedValue(childValue);\n }\n childOnChange?.(e);\n if (childValue !== undefined) {\n onChange?.(e, childValue);\n }\n },\n });\n }\n return child;\n };\n\n return (\n <ErrorWrapper\n className={classNames(errorWrapperClassName, className)}\n errorText={error}\n errorTextId={errorTextId}\n renderError={renderError}\n errorMessageRef={errorMessageRef}\n testId={errorWrapperTestId}\n >\n <div\n className={classNames(styles['visual-radio-group'], {\n [styles['visual-radio-group--variant-line']]: effectiveVariant === 'line',\n })}\n data-testid={testId}\n role={'radiogroup'}\n >\n {React.Children.map(children, mapChild)}\n </div>\n </ErrorWrapper>\n );\n};\n\nVisualRadioGroup.VisualRadio = VisualRadio;\n\nexport default VisualRadioGroup;\n","import VisualRadioGroup from './VisualRadioGroup';\nexport * from './VisualRadioGroup';\nexport default VisualRadioGroup;\n"],"mappings":";;;;;;;;;;AAmDA,IAAa,oBAA8C,UAAS;CAClE,MAAM,EACJ,UACA,MAAM,UACN,OACA,cACA,UACA,UAAU,aACV,wBACA,OACA,aAAa,iBACb,cAAc,MACd,iBACA,WACA,uBACA,QACA,uBACE;CAEJ,MAAM,cAAc,kBAAkB,eAAe;CACrD,MAAM,OAAO,kBAAkB,QAAQ;CACvC,MAAM,WAAW,sBAAsB;CAGvC,MAAM,gBADa,MAAM,SAAS,QAAQ,QACpB,CAAA,CAAW,QAAQ,UACvC,YAA8B,OAAO,WAAW,CAClD;CAEA,MAAM,kBACJ,SAAS,gBAAgB,cAAc,MAAK,UAAS,MAAM,MAAM,kBAAkB,MAAM,MAAM,OAAO,CAAC,EAAE,MAAM,OAAO,SAAS;CAEjI,MAAM,CAAC,eAAe,oBAAoB,MAAM,SAA6B,eAAe;CAC5F,MAAM,CAAC,WAAW,gBAAgB,MAAM,SAA6B,KAAK;CAC1E,IAAI,cAAc,OAAO;EACvB,aAAa,KAAK;EAClB,IAAI,UAAU,KAAA,KAAa,UAAU,eACnC,iBAAiB,KAAK;CAE1B;CAEA,MAAM,mBACJ,YAAY,2BAA2B,KAAA,KAAa,cAAc,SAAS,yBAAyB,SAAS;CAE/G,MAAM,YAAY,UAA4C;EAC5D,IAAI,YAA8B,OAAO,WAAW,GAAG;GACrD,MAAM,aAAa,MAAM,MAAM,OAAO,SAAS;GAC/C,MAAM,aAAa,kBAAkB,KAAA,KAAa,eAAe,KAAA,KAAa,eAAe;GAC7F,MAAM,gBAAgB,MAAM,MAAM;GAElC,OAAO,MAAM,aAAa,OAAO;IAC/B,MAAM,MAAM,MAAM,QAAQ;IAC1B,SAAS,MAAM,MAAM,WAAW;IAChC,OAAO,CAAC,CAAC,SAAS,MAAM,MAAM;IAC9B,aAAa,MAAM,MAAM,eAAe;IACxC,SAAS;IACT,WAAW,MAAiD;KAC1D,IAAI,eAAe,KAAA,GACjB,iBAAiB,UAAU;KAE7B,gBAAgB,CAAC;KACjB,IAAI,eAAe,KAAA,GACjB,WAAW,GAAG,UAAU;IAE5B;GACF,CAAC;EACH;EACA,OAAO;CACT;CAEA,OACE,oBAAC,sBAAD;EACE,WAAW,WAAW,uBAAuB,SAAS;EACtD,WAAW;EACE;EACA;EACI;EACjB,QAAQ;EAER,UAAA,oBAAC,OAAD;GACE,WAAW,WAAW,OAAO,uBAAuB,GACjD,OAAO,sCAAsC,qBAAqB,OACrE,CAAC;GACD,eAAa;GACb,MAAM;GAEL,UAAA,MAAM,SAAS,IAAI,UAAU,QAAQ;EACnC,CAAA;CACO,CAAA;AAElB;AAEA,iBAAiB,cAAc;;;AC5I/B,IAAA,2BAAe"}
@@ -95,7 +95,7 @@ function getParentNode(node) {
95
95
  }
96
96
  function getNearestOverflowAncestor(node) {
97
97
  const parentNode = getParentNode(node);
98
- if (isLastTraversableNode(parentNode)) return node.ownerDocument ? node.ownerDocument.body : node.body;
98
+ if (isLastTraversableNode(parentNode)) return (node.ownerDocument || node).body;
99
99
  if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) return parentNode;
100
100
  return getNearestOverflowAncestor(parentNode);
101
101
  }
@@ -214,12 +214,12 @@ function getOppositePlacement(placement) {
214
214
  return oppositeSideMap[side] + placement.slice(side.length);
215
215
  }
216
216
  function expandPaddingObject(padding) {
217
+ var _padding$top, _padding$right, _padding$bottom, _padding$left;
217
218
  return {
218
- top: 0,
219
- right: 0,
220
- bottom: 0,
221
- left: 0,
222
- ...padding
219
+ top: (_padding$top = padding.top) != null ? _padding$top : 0,
220
+ right: (_padding$right = padding.right) != null ? _padding$right : 0,
221
+ bottom: (_padding$bottom = padding.bottom) != null ? _padding$bottom : 0,
222
+ left: (_padding$left = padding.left) != null ? _padding$left : 0
223
223
  };
224
224
  }
225
225
  function getPaddingObject(padding) {
@@ -792,14 +792,8 @@ function computeCoordsFromPlacement(_ref, placement, rtl) {
792
792
  y: reference.y
793
793
  };
794
794
  }
795
- switch (getAlignment(placement)) {
796
- case "start":
797
- coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
798
- break;
799
- case "end":
800
- coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
801
- break;
802
- }
795
+ const alignment = getAlignment(placement);
796
+ if (alignment) coords[alignmentAxis] += commonAlign * (alignment === "end" ? 1 : -1) * (rtl && isVertical ? -1 : 1);
803
797
  return coords;
804
798
  }
805
799
  /**
@@ -830,10 +824,7 @@ async function detectOverflow(state, options) {
830
824
  height: rects.floating.height
831
825
  } : rects.reference;
832
826
  const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
833
- const offsetScale = await (platform.isElement == null ? void 0 : platform.isElement(offsetParent)) ? await (platform.getScale == null ? void 0 : platform.getScale(offsetParent)) || {
834
- x: 1,
835
- y: 1
836
- } : {
827
+ const offsetScale = await (platform.isElement == null ? void 0 : platform.isElement(offsetParent)) && await (platform.getScale == null ? void 0 : platform.getScale(offsetParent)) || {
837
828
  x: 1,
838
829
  y: 1
839
830
  };
@@ -953,12 +944,11 @@ var arrow$3 = (options) => ({
953
944
  const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;
954
945
  const minPadding = min(paddingObject[minProp], largestPossiblePadding);
955
946
  const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);
956
- const min$1 = minPadding;
957
947
  const max = clientSize - arrowDimensions[length] - maxPadding;
958
948
  const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
959
- const offset = clamp(min$1, center, max);
960
- const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
961
- const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0;
949
+ const offset = clamp(minPadding, center, max);
950
+ const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < minPadding ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
951
+ const alignmentOffset = shouldAddOffset ? center < minPadding ? center - minPadding : center - max : 0;
962
952
  return {
963
953
  [axis]: coords[axis] + alignmentOffset,
964
954
  data: {
@@ -1033,9 +1023,7 @@ var flip$2 = function(options) {
1033
1023
  if (placement) resetPlacement = placement;
1034
1024
  break;
1035
1025
  }
1036
- case "initialPlacement":
1037
- resetPlacement = initialPlacement;
1038
- break;
1026
+ case "initialPlacement": resetPlacement = initialPlacement;
1039
1027
  }
1040
1028
  if (placement !== resetPlacement) return { reset: { placement: resetPlacement } };
1041
1029
  }
@@ -1173,24 +1161,13 @@ var shift$2 = function(options) {
1173
1161
  y
1174
1162
  };
1175
1163
  const overflow = await platform.detectOverflow(state, detectOverflowOptions);
1176
- const crossAxis = getSideAxis(getSide(placement));
1164
+ const crossAxis = getSideAxis(placement);
1177
1165
  const mainAxis = getOppositeAxis(crossAxis);
1178
1166
  let mainAxisCoord = coords[mainAxis];
1179
1167
  let crossAxisCoord = coords[crossAxis];
1180
- if (checkMainAxis) {
1181
- const minSide = mainAxis === "y" ? "top" : "left";
1182
- const maxSide = mainAxis === "y" ? "bottom" : "right";
1183
- const min = mainAxisCoord + overflow[minSide];
1184
- const max = mainAxisCoord - overflow[maxSide];
1185
- mainAxisCoord = clamp(min, mainAxisCoord, max);
1186
- }
1187
- if (checkCrossAxis) {
1188
- const minSide = crossAxis === "y" ? "top" : "left";
1189
- const maxSide = crossAxis === "y" ? "bottom" : "right";
1190
- const min = crossAxisCoord + overflow[minSide];
1191
- const max = crossAxisCoord - overflow[maxSide];
1192
- crossAxisCoord = clamp(min, crossAxisCoord, max);
1193
- }
1168
+ const clampCoord = (axis, coord) => clamp(coord + overflow[axis === "y" ? "top" : "left"], coord, coord - overflow[axis === "y" ? "bottom" : "right"]);
1169
+ if (checkMainAxis) mainAxisCoord = clampCoord(mainAxis, mainAxisCoord);
1170
+ if (checkCrossAxis) crossAxisCoord = clampCoord(crossAxis, crossAxisCoord);
1194
1171
  const limitedCoords = limiter.fn({
1195
1172
  ...state,
1196
1173
  [mainAxis]: mainAxisCoord,
@@ -1222,7 +1199,6 @@ var size$2 = function(options) {
1222
1199
  name: "size",
1223
1200
  options,
1224
1201
  async fn(state) {
1225
- var _state$middlewareData, _state$middlewareData2;
1226
1202
  const { placement, rects, platform, elements } = state;
1227
1203
  const { apply = () => {}, ...detectOverflowOptions } = evaluate(options, state);
1228
1204
  const overflow = await platform.detectOverflow(state, detectOverflowOptions);
@@ -1243,18 +1219,15 @@ var size$2 = function(options) {
1243
1219
  const maximumClippingWidth = width - overflow.left - overflow.right;
1244
1220
  const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight);
1245
1221
  const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth);
1246
- const noShift = !state.middlewareData.shift;
1222
+ const shiftData = state.middlewareData.shift;
1223
+ const noShift = !shiftData;
1247
1224
  let availableHeight = overflowAvailableHeight;
1248
1225
  let availableWidth = overflowAvailableWidth;
1249
- if ((_state$middlewareData = state.middlewareData.shift) != null && _state$middlewareData.enabled.x) availableWidth = maximumClippingWidth;
1250
- if ((_state$middlewareData2 = state.middlewareData.shift) != null && _state$middlewareData2.enabled.y) availableHeight = maximumClippingHeight;
1226
+ if (shiftData != null && shiftData.enabled.x) availableWidth = maximumClippingWidth;
1227
+ if (shiftData != null && shiftData.enabled.y) availableHeight = maximumClippingHeight;
1251
1228
  if (noShift && !alignment) {
1252
- const xMin = max(overflow.left, 0);
1253
- const xMax = max(overflow.right, 0);
1254
- const yMin = max(overflow.top, 0);
1255
- const yMax = max(overflow.bottom, 0);
1256
- if (isYAxis) availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right));
1257
- else availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom));
1229
+ if (isYAxis) availableWidth = width - 2 * max(overflow.left, overflow.right);
1230
+ else availableHeight = height - 2 * max(overflow.top, overflow.bottom);
1258
1231
  }
1259
1232
  await apply({
1260
1233
  ...state,
@@ -1315,8 +1288,7 @@ function getVisualOffsets(element) {
1315
1288
  }
1316
1289
  function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
1317
1290
  if (isFixed === void 0) isFixed = false;
1318
- if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) return false;
1319
- return isFixed;
1291
+ return !!floatingOffsetParent && isFixed && floatingOffsetParent === getWindow(element);
1320
1292
  }
1321
1293
  function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
1322
1294
  if (includeScale === void 0) includeScale = false;
@@ -1324,20 +1296,22 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
1324
1296
  const clientRect = element.getBoundingClientRect();
1325
1297
  const domElement = unwrapElement(element);
1326
1298
  let scale = createCoords(1);
1327
- if (includeScale) if (offsetParent) {
1328
- if (isElement(offsetParent)) scale = getScale(offsetParent);
1329
- } else scale = getScale(element);
1299
+ if (includeScale) {
1300
+ if (offsetParent) {
1301
+ if (isElement(offsetParent)) scale = getScale(offsetParent);
1302
+ } else scale = getScale(element);
1303
+ }
1330
1304
  const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
1331
1305
  let x = (clientRect.left + visualOffsets.x) / scale.x;
1332
1306
  let y = (clientRect.top + visualOffsets.y) / scale.y;
1333
1307
  let width = clientRect.width / scale.x;
1334
1308
  let height = clientRect.height / scale.y;
1335
- if (domElement) {
1309
+ if (domElement && offsetParent) {
1336
1310
  const win = getWindow(domElement);
1337
- const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
1311
+ const offsetWin = isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
1338
1312
  let currentWin = win;
1339
1313
  let currentIFrame = getFrameElement(currentWin);
1340
- while (currentIFrame && offsetParent && offsetWin !== currentWin) {
1314
+ while (currentIFrame && offsetWin !== currentWin) {
1341
1315
  const iframeScale = getScale(currentIFrame);
1342
1316
  const iframeRect = currentIFrame.getBoundingClientRect();
1343
1317
  const css = getComputedStyle$1(currentIFrame);
@@ -1385,7 +1359,7 @@ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
1385
1359
  let scale = createCoords(1);
1386
1360
  const offsets = createCoords(0);
1387
1361
  const isOffsetParentAnElement = isHTMLElement(offsetParent);
1388
- if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
1362
+ if (isOffsetParentAnElement || !isFixed) {
1389
1363
  if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) scroll = getNodeScroll(offsetParent);
1390
1364
  if (isOffsetParentAnElement) {
1391
1365
  const offsetRect = getBoundingClientRect(offsetParent);
@@ -1403,15 +1377,14 @@ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
1403
1377
  };
1404
1378
  }
1405
1379
  function getClientRects(element) {
1406
- return Array.from(element.getClientRects());
1380
+ return element.getClientRects ? Array.from(element.getClientRects()) : [];
1407
1381
  }
1408
- function getDocumentRect(element) {
1409
- const html = getDocumentElement(element);
1410
- const scroll = getNodeScroll(element);
1411
- const body = element.ownerDocument.body;
1382
+ function getDocumentRect(html) {
1383
+ const scroll = getNodeScroll(html);
1384
+ const body = html.ownerDocument.body;
1412
1385
  const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
1413
1386
  const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
1414
- let x = -scroll.scrollLeft + getWindowScrollBarX(element);
1387
+ let x = -scroll.scrollLeft + getWindowScrollBarX(html);
1415
1388
  const y = -scroll.scrollTop;
1416
1389
  if (getComputedStyle$1(body).direction === "rtl") x += max(html.clientWidth, body.clientWidth) - width;
1417
1390
  return {
@@ -1422,7 +1395,9 @@ function getDocumentRect(element) {
1422
1395
  };
1423
1396
  }
1424
1397
  var SCROLLBAR_MAX = 25;
1425
- function getViewportRect(element, strategy) {
1398
+ function getViewportRect(element, strategy, rootBoundary) {
1399
+ if (rootBoundary === void 0) rootBoundary = "viewport";
1400
+ const isLayoutViewport = rootBoundary === "layoutViewport";
1426
1401
  const win = getWindow(element);
1427
1402
  const html = getDocumentElement(element);
1428
1403
  const visualViewport = win.visualViewport;
@@ -1431,23 +1406,30 @@ function getViewportRect(element, strategy) {
1431
1406
  let x = 0;
1432
1407
  let y = 0;
1433
1408
  if (visualViewport) {
1434
- width = visualViewport.width;
1435
- height = visualViewport.height;
1436
- const visualViewportBased = isWebKit();
1437
- if (!visualViewportBased || visualViewportBased && strategy === "fixed") {
1438
- x = visualViewport.offsetLeft;
1439
- y = visualViewport.offsetTop;
1409
+ const layoutRelativeClientCoords = !isWebKit() || strategy === "fixed";
1410
+ if (isLayoutViewport) {
1411
+ if (!layoutRelativeClientCoords) {
1412
+ x = -visualViewport.offsetLeft;
1413
+ y = -visualViewport.offsetTop;
1414
+ }
1415
+ } else {
1416
+ width = visualViewport.width;
1417
+ height = visualViewport.height;
1418
+ if (layoutRelativeClientCoords) {
1419
+ x = visualViewport.offsetLeft;
1420
+ y = visualViewport.offsetTop;
1421
+ }
1440
1422
  }
1441
1423
  }
1442
- const windowScrollbarX = getWindowScrollBarX(html);
1443
- if (windowScrollbarX <= 0) {
1424
+ if (getWindowScrollBarX(html) <= 0) {
1444
1425
  const doc = html.ownerDocument;
1445
1426
  const body = doc.body;
1446
1427
  const bodyStyles = getComputedStyle(body);
1447
1428
  const bodyMarginInline = doc.compatMode === "CSS1Compat" ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;
1448
- const clippingStableScrollbarWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);
1449
- if (clippingStableScrollbarWidth <= SCROLLBAR_MAX) width -= clippingStableScrollbarWidth;
1450
- } else if (windowScrollbarX <= SCROLLBAR_MAX) width += windowScrollbarX;
1429
+ const reservedWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);
1430
+ const gutter = getComputedStyle(html).scrollbarGutter === "stable both-edges" ? reservedWidth / 2 : reservedWidth;
1431
+ if (gutter <= SCROLLBAR_MAX) width -= gutter;
1432
+ }
1451
1433
  return {
1452
1434
  width,
1453
1435
  height,
@@ -1459,7 +1441,7 @@ function getInnerBoundingClientRect(element, strategy) {
1459
1441
  const clientRect = getBoundingClientRect(element, true, strategy === "fixed");
1460
1442
  const top = clientRect.top + element.clientTop;
1461
1443
  const left = clientRect.left + element.clientLeft;
1462
- const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);
1444
+ const scale = getScale(element);
1463
1445
  return {
1464
1446
  width: element.clientWidth * scale.x,
1465
1447
  height: element.clientHeight * scale.y,
@@ -1469,7 +1451,7 @@ function getInnerBoundingClientRect(element, strategy) {
1469
1451
  }
1470
1452
  function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
1471
1453
  let rect;
1472
- if (clippingAncestor === "viewport") rect = getViewportRect(element, strategy);
1454
+ if (clippingAncestor === "viewport" || clippingAncestor === "layoutViewport") rect = getViewportRect(element, strategy, clippingAncestor);
1473
1455
  else if (clippingAncestor === "document") rect = getDocumentRect(getDocumentElement(element));
1474
1456
  else if (isElement(clippingAncestor)) rect = getInnerBoundingClientRect(clippingAncestor, strategy);
1475
1457
  else {
@@ -1483,24 +1465,19 @@ function getClientRectFromClippingAncestor(element, clippingAncestor, strategy)
1483
1465
  }
1484
1466
  return rectToClientRect(rect);
1485
1467
  }
1486
- function hasFixedPositionAncestor(element, stopNode) {
1487
- const parentNode = getParentNode(element);
1488
- if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) return false;
1489
- return getComputedStyle$1(parentNode).position === "fixed" || hasFixedPositionAncestor(parentNode, stopNode);
1490
- }
1491
1468
  function getClippingElementAncestors(element, cache) {
1492
1469
  const cachedResult = cache.get(element);
1493
1470
  if (cachedResult) return cachedResult;
1494
1471
  let result = getOverflowAncestors(element, [], false).filter((el) => isElement(el) && getNodeName(el) !== "body");
1495
- let currentContainingBlockComputedStyle = null;
1472
+ let lastKeptComputedStyle = null;
1496
1473
  const elementIsFixed = getComputedStyle$1(element).position === "fixed";
1497
1474
  let currentNode = elementIsFixed ? getParentNode(element) : element;
1498
1475
  while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
1499
1476
  const computedStyle = getComputedStyle$1(currentNode);
1500
1477
  const currentNodeIsContaining = isContainingBlock(currentNode);
1501
- if (!currentNodeIsContaining && computedStyle.position === "fixed") currentContainingBlockComputedStyle = null;
1502
- if (elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === "static" && !!currentContainingBlockComputedStyle && (currentContainingBlockComputedStyle.position === "absolute" || currentContainingBlockComputedStyle.position === "fixed") || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode)) result = result.filter((ancestor) => ancestor !== currentNode);
1503
- else currentContainingBlockComputedStyle = computedStyle;
1478
+ const lastPosition = lastKeptComputedStyle ? lastKeptComputedStyle.position : elementIsFixed ? "fixed" : "";
1479
+ if (!currentNodeIsContaining && (lastPosition === "fixed" || lastPosition === "absolute" && computedStyle.position === "static")) result = result.filter((ancestor) => ancestor !== currentNode);
1480
+ else lastKeptComputedStyle = computedStyle;
1504
1481
  currentNode = getParentNode(currentNode);
1505
1482
  }
1506
1483
  cache.set(element, result);
@@ -1545,18 +1522,15 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
1545
1522
  scrollTop: 0
1546
1523
  };
1547
1524
  const offsets = createCoords(0);
1548
- function setLeftRTLScrollbarOffset() {
1549
- offsets.x = getWindowScrollBarX(documentElement);
1550
- }
1551
- if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
1525
+ if (isOffsetParentAnElement || !isFixed) {
1552
1526
  if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) scroll = getNodeScroll(offsetParent);
1553
1527
  if (isOffsetParentAnElement) {
1554
1528
  const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
1555
1529
  offsets.x = offsetRect.x + offsetParent.clientLeft;
1556
1530
  offsets.y = offsetRect.y + offsetParent.clientTop;
1557
- } else if (documentElement) setLeftRTLScrollbarOffset();
1531
+ }
1558
1532
  }
1559
- if (isFixed && !isOffsetParentAnElement && documentElement) setLeftRTLScrollbarOffset();
1533
+ if (!isOffsetParentAnElement && documentElement) offsets.x = getWindowScrollBarX(documentElement);
1560
1534
  const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
1561
1535
  return {
1562
1536
  x: rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x,
@@ -1623,7 +1597,7 @@ var platform = {
1623
1597
  function rectsAreEqual(a, b) {
1624
1598
  return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;
1625
1599
  }
1626
- function observeMove(element, onMove) {
1600
+ function observeMove(element, onMove, ancestorResize) {
1627
1601
  let io = null;
1628
1602
  let timeoutId;
1629
1603
  const root = getDocumentElement(element);
@@ -1652,6 +1626,7 @@ function observeMove(element, onMove) {
1652
1626
  let isFirstUpdate = true;
1653
1627
  function handleObserve(entries) {
1654
1628
  const ratio = entries[0].intersectionRatio;
1629
+ if (!rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) return refresh();
1655
1630
  if (ratio !== threshold) {
1656
1631
  if (!isFirstUpdate) return refresh();
1657
1632
  if (!ratio) timeoutId = setTimeout(() => {
@@ -1659,7 +1634,6 @@ function observeMove(element, onMove) {
1659
1634
  }, 1e3);
1660
1635
  else refresh(false, ratio);
1661
1636
  }
1662
- if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) refresh();
1663
1637
  isFirstUpdate = false;
1664
1638
  }
1665
1639
  try {
@@ -1672,8 +1646,14 @@ function observeMove(element, onMove) {
1672
1646
  }
1673
1647
  io.observe(element);
1674
1648
  }
1649
+ const win = getWindow(element);
1650
+ const handleResize = () => refresh(ancestorResize);
1651
+ win.addEventListener("resize", handleResize);
1675
1652
  refresh(true);
1676
- return cleanup;
1653
+ return () => {
1654
+ win.removeEventListener("resize", handleResize);
1655
+ cleanup();
1656
+ };
1677
1657
  }
1678
1658
  /**
1679
1659
  * Automatically updates the position of the floating element when necessary.
@@ -1689,10 +1669,10 @@ function autoUpdate(reference, floating, update, options) {
1689
1669
  const referenceEl = unwrapElement(reference);
1690
1670
  const ancestors = ancestorScroll || ancestorResize ? [...referenceEl ? getOverflowAncestors(referenceEl) : [], ...floating ? getOverflowAncestors(floating) : []] : [];
1691
1671
  ancestors.forEach((ancestor) => {
1692
- ancestorScroll && ancestor.addEventListener("scroll", update, { passive: true });
1672
+ ancestorScroll && ancestor.addEventListener("scroll", update);
1693
1673
  ancestorResize && ancestor.addEventListener("resize", update);
1694
1674
  });
1695
- const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;
1675
+ const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update, ancestorResize) : null;
1696
1676
  let reobserveFrame = -1;
1697
1677
  let resizeObserver = null;
1698
1678
  if (elementResize) {
@@ -1779,11 +1759,9 @@ var arrow$2 = arrow$3;
1779
1759
  */
1780
1760
  var computePosition = (reference, floating, options) => {
1781
1761
  const cache = /* @__PURE__ */ new Map();
1782
- const mergedOptions = {
1783
- platform,
1784
- ...options
1785
- };
1762
+ const mergedOptions = options != null ? options : {};
1786
1763
  const platformWithCache = {
1764
+ ...platform,
1787
1765
  ...mergedOptions.platform,
1788
1766
  _c: cache
1789
1767
  };
@@ -3280,8 +3258,10 @@ function useClick(context, props) {
3280
3258
  didKeyDownRef.current = true;
3281
3259
  }
3282
3260
  if (isAnchorTarget(event)) return;
3283
- if (event.key === "Enter") if (open && toggle) onOpenChange(false, event.nativeEvent, "click");
3284
- else onOpenChange(true, event.nativeEvent, "click");
3261
+ if (event.key === "Enter") {
3262
+ if (open && toggle) onOpenChange(false, event.nativeEvent, "click");
3263
+ else onOpenChange(true, event.nativeEvent, "click");
3264
+ }
3285
3265
  },
3286
3266
  onKeyUp(event) {
3287
3267
  if (event.defaultPrevented || !keyboardHandlers || isButtonTarget(event) || isSpaceIgnored(domReference)) return;
@@ -3464,7 +3444,7 @@ function useDismiss(context, props) {
3464
3444
  return ancestor !== ((_doc$defaultView = doc.defaultView) == null ? void 0 : _doc$defaultView.visualViewport);
3465
3445
  });
3466
3446
  ancestors.forEach((ancestor) => {
3467
- ancestor.addEventListener("scroll", onScroll, { passive: true });
3447
+ ancestor.addEventListener("scroll", onScroll);
3468
3448
  });
3469
3449
  return () => {
3470
3450
  if (escapeKey) {
@@ -3599,15 +3579,15 @@ function useFloatingRootContext(options) {
3599
3579
  * Provides data to position a floating element and context to add interactions.
3600
3580
  * @see https://floating-ui.com/docs/useFloating
3601
3581
  */
3602
- function useFloating(options) {
3603
- if (options === void 0) options = {};
3582
+ function useFloating(_temp) {
3583
+ var _elementsOption$refer, _elementsOption$float;
3584
+ let { elements: elementsOption, ...options } = _temp === void 0 ? {} : _temp;
3604
3585
  const { nodeId } = options;
3605
3586
  const internalRootContext = useFloatingRootContext({
3606
3587
  ...options,
3607
3588
  elements: {
3608
- reference: null,
3609
- floating: null,
3610
- ...options.elements
3589
+ reference: (_elementsOption$refer = elementsOption == null ? void 0 : elementsOption.reference) != null ? _elementsOption$refer : null,
3590
+ floating: (_elementsOption$float = elementsOption == null ? void 0 : elementsOption.floating) != null ? _elementsOption$float : null
3611
3591
  }
3612
3592
  });
3613
3593
  const rootContext = options.rootContext || internalRootContext;