@preply/ds-web-lib 10.0.0 → 11.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (303) hide show
  1. package/dist/Accordion-B0hR-tcI.js +96 -0
  2. package/dist/AlertBannerProvider-Cf7w9AOq.js +76 -0
  3. package/dist/AlertDialog-BG-diKBi.js +475 -0
  4. package/dist/Avatar-B-JdqVyg.js +66 -0
  5. package/dist/AvatarWithStatus-CD9jEqEB.js +36 -0
  6. package/dist/Badge-Dd-CLBoW.js +50 -0
  7. package/dist/Box-BJBE9KNm.js +91 -0
  8. package/dist/BubbleCounter.module-BU2S0euA.js +16 -0
  9. package/dist/Button-C35BZJZT.js +91 -0
  10. package/dist/ButtonBase-8eUyTWxX.js +215 -0
  11. package/dist/Checkbox-CtolNbxI.js +108 -0
  12. package/dist/Chips-BRGw7Uup.js +99 -0
  13. package/dist/ChipsPrimitive-Bezq7ptE.js +1179 -0
  14. package/dist/CountryFlag-DVDKHmQH.js +43 -0
  15. package/dist/Dialog.module-Db2BJAn4.js +21 -0
  16. package/dist/DialogCloseButton-DjDd9Mid.js +98 -0
  17. package/dist/DialogDescription-8zw9t6pm.js +44 -0
  18. package/dist/DialogRoot-B67oJduC.js +335 -0
  19. package/dist/DialogRootContext-Bz8RW-Mq.js +12 -0
  20. package/dist/DialogTitle-C2Nn2ys-.js +43 -0
  21. package/dist/Divider-DvwDWB9_.js +17 -0
  22. package/dist/DropdownMenu.primitives-BrsTBvMk.js +4007 -0
  23. package/dist/FieldButton-B2slox8P.js +32 -0
  24. package/dist/FormControl-qnbQL1iF.js +128 -0
  25. package/dist/Heading-DA9gHfsx.js +71 -0
  26. package/dist/Icon-CixAeOSd.js +48 -0
  27. package/dist/IconButton-BPKpgfep.js +31 -0
  28. package/dist/InputContainer-CzzuOe_p.js +38 -0
  29. package/dist/LayoutFlex-e9auDvWD.js +86 -0
  30. package/dist/LayoutFlexItem-D9ziMmHe.js +48 -0
  31. package/dist/LayoutGridItem-Q8Lnvrri.js +34 -0
  32. package/dist/Link-CdoJVeER.js +66 -0
  33. package/dist/Loader-BMOxdJce.js +26 -0
  34. package/dist/OnboardingTooltip-B47_Yrsj.js +165 -0
  35. package/dist/OnboardingTour-DUUoI5WE.js +131 -0
  36. package/dist/PasswordField-Bx5YG62t.js +93 -0
  37. package/dist/PreplyLogo-abgOre30.js +112 -0
  38. package/dist/ProgressBar-CEU4GyHn.js +31 -0
  39. package/dist/ProgressSteps-BSqopxqv.js +45 -0
  40. package/dist/Select-Bo7PX_8V.js +124 -0
  41. package/dist/Slider-Crg4DEn_.js +64 -0
  42. package/dist/Spinner-Ck8KQA22.js +86 -0
  43. package/dist/Stars-D5QspUBE.js +72 -0
  44. package/dist/Steps-DbN5vFrP.js +173 -0
  45. package/dist/Switch-Ck_xB0ID.js +49 -0
  46. package/dist/Text-CaOF75Z-.js +121 -0
  47. package/dist/TextHighlighted-Dwq9Clgn.js +34 -0
  48. package/dist/TextInline-BcA4H2Tk.js +34 -0
  49. package/dist/Toast-wJAjSLfo.js +1019 -0
  50. package/dist/TokyoUIChevronDown-DGcVqR1z.js +14 -0
  51. package/dist/Tooltip-grvKQxTN.js +84 -0
  52. package/dist/VisuallyHidden-CtcHcZCK.js +29 -0
  53. package/dist/align-self-VrZUceie.js +42 -0
  54. package/dist/assets/Accordion.css +2 -2
  55. package/dist/assets/AlertBannerProvider.css +2 -2
  56. package/dist/assets/AlertDialog.css +2 -2
  57. package/dist/assets/Avatar.css +3 -3
  58. package/dist/assets/AvatarWithStatus.css +2 -2
  59. package/dist/assets/Badge.css +1 -1
  60. package/dist/assets/Box.css +3 -3
  61. package/dist/assets/BubbleCounter.css +1 -1
  62. package/dist/assets/Button.css +4 -4
  63. package/dist/assets/ButtonBase.css +40 -46
  64. package/dist/assets/Checkbox.css +1 -1
  65. package/dist/assets/Chips.css +2 -2
  66. package/dist/assets/ChipsPrimitive.css +2 -2
  67. package/dist/assets/CountryFlag.css +1 -1
  68. package/dist/assets/Dialog.css +13 -4
  69. package/dist/assets/Divider.css +1 -1
  70. package/dist/assets/DropdownMenu.css +2 -2
  71. package/dist/assets/FieldButton.css +3 -3
  72. package/dist/assets/FormControl.css +1 -1
  73. package/dist/assets/Heading.css +3 -3
  74. package/dist/assets/Icon.css +3 -3
  75. package/dist/assets/InputContainer.css +2 -2
  76. package/dist/assets/LayoutFlex.css +1 -1
  77. package/dist/assets/LayoutFlexItem.css +1 -1
  78. package/dist/assets/Link.css +3 -3
  79. package/dist/assets/Loader.css +1 -1
  80. package/dist/assets/OnboardingTooltip.css +6 -4
  81. package/dist/assets/OnboardingTour.css +3 -2
  82. package/dist/assets/PreplyLogo.css +1 -1
  83. package/dist/assets/ProgressBar.css +1 -1
  84. package/dist/assets/ProgressSteps.css +1 -1
  85. package/dist/assets/Select.css +2 -2
  86. package/dist/assets/Slider.css +1 -1
  87. package/dist/assets/Spinner.css +3 -3
  88. package/dist/assets/Stars.css +3 -3
  89. package/dist/assets/Steps.css +2 -2
  90. package/dist/assets/Switch.css +1 -1
  91. package/dist/assets/Text.css +3 -3
  92. package/dist/assets/TextHighlighted.css +3 -3
  93. package/dist/assets/TextInline.css +3 -3
  94. package/dist/assets/Toast.css +2 -2
  95. package/dist/assets/Tooltip.css +1 -1
  96. package/dist/assets/align-self.css +1 -1
  97. package/dist/assets/{IconTile.css → components.css} +9 -1
  98. package/dist/assets/exp-color.css +2 -2
  99. package/dist/assets/index.css +1 -1
  100. package/dist/assets/layout-gap.css +3 -3
  101. package/dist/assets/layout-grid.css +3 -3
  102. package/dist/assets/layout-hide.css +1 -1
  103. package/dist/assets/layout-padding.css +3 -3
  104. package/dist/assets/layout-relative.css +1 -1
  105. package/dist/assets/text-accent.css +2 -2
  106. package/dist/assets/text-centered.css +1 -1
  107. package/dist/assets/text-weight.css +2 -2
  108. package/dist/chunk-BVTlhY3a.js +24 -0
  109. package/dist/components/Accordion/Accordion.js +4 -60
  110. package/dist/components/Accordion/hooks/useOnOpenChange.js +19 -28
  111. package/dist/components/AlertBanner/AlertBanner.js +11 -26
  112. package/dist/components/AlertBanner/AlertBannerProvider.js +3 -8
  113. package/dist/components/AlertBanner/primitives/AlertBannerAction.js +11 -69
  114. package/dist/components/AlertBanner/primitives/AlertBannerIcon.js +77 -39
  115. package/dist/components/AlertBanner/primitives/AlertBannerRoot.js +26 -22
  116. package/dist/components/AlertBanner/primitives/AlertBannerText.js +11 -70
  117. package/dist/components/AlertDialog/AlertDialog.d.ts +3 -3
  118. package/dist/components/AlertDialog/AlertDialog.d.ts.map +1 -1
  119. package/dist/components/AlertDialog/AlertDialog.js +5 -94
  120. package/dist/components/Avatar/Avatar.js +3 -71
  121. package/dist/components/AvatarWithStatus/AvatarWithStatus.js +3 -43
  122. package/dist/components/Badge/Badge.js +4 -62
  123. package/dist/components/Box/Box.js +3 -95
  124. package/dist/components/BubbleCounter/BubbleCounter.js +23 -28
  125. package/dist/components/Button/Button.js +4 -80
  126. package/dist/components/CalloutBanner/CalloutBanner.js +61 -12
  127. package/dist/components/CalloutBanner/primitives/CalloutBannerDismissButton.js +50 -22
  128. package/dist/components/CalloutBanner/primitives/CalloutBannerIcon.js +86 -45
  129. package/dist/components/CalloutBanner/primitives/CalloutBannerRoot.js +50 -24
  130. package/dist/components/CalloutBanner/primitives/CalloutBannerText.js +41 -11
  131. package/dist/components/Checkbox/Checkbox.js +4 -78
  132. package/dist/components/Checkbox/hooks/useIndeterminate.js +24 -30
  133. package/dist/components/Chips/Chips.types.js +0 -1
  134. package/dist/components/Chips/DismissibleChips.js +117 -86
  135. package/dist/components/Chips/MultiSelectChips.js +98 -64
  136. package/dist/components/Chips/SingleSelectChips.js +94 -57
  137. package/dist/components/Chips/private/ChipsPrimitive.js +4 -17
  138. package/dist/components/CountryFlag/CountryFlag.js +3 -44
  139. package/dist/components/Dialog/Dialog.js +56 -31
  140. package/dist/components/Dialog/DialogSteps.js +40 -29
  141. package/dist/components/Dialog/primitives/DialogActions.js +26 -19
  142. package/dist/components/Dialog/primitives/DialogButtonStack.d.ts.map +1 -1
  143. package/dist/components/Dialog/primitives/DialogButtonStack.js +22 -15
  144. package/dist/components/Dialog/primitives/DialogCloseButton.d.ts +1 -1
  145. package/dist/components/Dialog/primitives/DialogCloseButton.d.ts.map +1 -1
  146. package/dist/components/Dialog/primitives/DialogCloseButton.js +4 -93
  147. package/dist/components/Dialog/primitives/DialogDescription.js +3 -43
  148. package/dist/components/Dialog/primitives/DialogFooter.js +37 -34
  149. package/dist/components/Dialog/primitives/DialogRoot.js +4 -1459
  150. package/dist/components/Dialog/primitives/DialogTitle.js +3 -42
  151. package/dist/components/Divider/Divider.js +3 -14
  152. package/dist/components/DropdownMenu/DropdownMenu.js +253 -188
  153. package/dist/components/DropdownMenu/primitives/DropdownMenu.primitives.js +5 -34
  154. package/dist/components/DropdownMenu/primitives/DropdownMenuSelectItem.primitives.js +121 -71
  155. package/dist/components/FieldButton/FieldButton.js +3 -37
  156. package/dist/components/FormControl/FormControl.js +3 -105
  157. package/dist/components/Heading/Heading.js +3 -78
  158. package/dist/components/Icon/Icon.js +4 -49
  159. package/dist/components/IconButton/IconButton.d.ts +5 -1
  160. package/dist/components/IconButton/IconButton.d.ts.map +1 -1
  161. package/dist/components/IconButton/IconButton.js +4 -28
  162. package/dist/components/IconTile/IconTile.js +11 -69
  163. package/dist/components/IntlFormatted/IntlFormattedAggregatedDateTime.js +16 -32
  164. package/dist/components/IntlFormatted/IntlFormattedCurrency.js +20 -42
  165. package/dist/components/IntlFormatted/IntlFormattedDate.js +73 -195
  166. package/dist/components/IntlFormatted/IntlFormattedTime.js +14 -24
  167. package/dist/components/IntlFormatted/Wrapper.js +14 -8
  168. package/dist/components/LayoutFlex/LayoutFlex.js +3 -100
  169. package/dist/components/LayoutFlex/style/getStyleAttrs.js +71 -143
  170. package/dist/components/LayoutFlex/tests/AlignItems.js +67 -97
  171. package/dist/components/LayoutFlex/tests/ColumnReverse.js +63 -100
  172. package/dist/components/LayoutFlex/tests/DataOverride.js +1498 -1093
  173. package/dist/components/LayoutFlex/tests/Default.js +19 -20
  174. package/dist/components/LayoutFlex/tests/Direction.js +65 -88
  175. package/dist/components/LayoutFlex/tests/Gap.js +115 -197
  176. package/dist/components/LayoutFlex/tests/HideInline.js +95 -136
  177. package/dist/components/LayoutFlex/tests/JustifyContent.js +75 -108
  178. package/dist/components/LayoutFlex/tests/Nowrap.js +35 -42
  179. package/dist/components/LayoutFlex/tests/Padding.js +207 -263
  180. package/dist/components/LayoutFlex/tests/Relative.js +49 -64
  181. package/dist/components/LayoutFlexItem/LayoutFlexItem.js +3 -54
  182. package/dist/components/LayoutGrid/LayoutGrid.js +26 -34
  183. package/dist/components/LayoutGridItem/LayoutGridItem.js +3 -41
  184. package/dist/components/Link/Link.js +3 -72
  185. package/dist/components/Loader/Loader.js +3 -32
  186. package/dist/components/NumberField/NumberField.js +33 -35
  187. package/dist/components/ObserveIntersection/ObserveIntersection.js +41 -42
  188. package/dist/components/OnboardingTooltip/OnboardingTooltip.js +4 -115
  189. package/dist/components/OnboardingTour/OnboardingTour.js +4 -114
  190. package/dist/components/PasswordField/PasswordField.js +3 -78
  191. package/dist/components/PreplyLogo/PreplyLogo.js +3 -81
  192. package/dist/components/ProgressBar/ProgressBar.js +3 -27
  193. package/dist/components/ProgressSteps/ProgressSteps.js +3 -48
  194. package/dist/components/Rating/Rating.js +29 -20
  195. package/dist/components/Rating/RatingInput.js +57 -59
  196. package/dist/components/Rating/Stars.js +4 -8
  197. package/dist/components/Rating/hooks/useHasError.js +11 -15
  198. package/dist/components/Rating/hooks/useHoverPercentage.js +37 -45
  199. package/dist/components/Rating/hooks/useInputState.js +18 -24
  200. package/dist/components/Rating/hooks/useLocalizations.js +12 -24
  201. package/dist/components/Rating/utils/roundToHalfDecimal.js +4 -4
  202. package/dist/components/SelectField/Select.js +5 -112
  203. package/dist/components/SelectField/SelectField.js +29 -24
  204. package/dist/components/SelectField/hooks/useBreakpointMatch.js +18 -19
  205. package/dist/components/ShowOnIntersection/ShowOnIntersection.js +32 -21
  206. package/dist/components/Slider/RangeSlider.js +62 -52
  207. package/dist/components/Slider/Slider.js +3 -10
  208. package/dist/components/Steps/Steps.js +4 -210
  209. package/dist/components/Switch/Switch.js +3 -51
  210. package/dist/components/Text/Text.js +3 -128
  211. package/dist/components/TextField/TextField.js +27 -29
  212. package/dist/components/TextHighlighted/TextHighlighted.js +3 -41
  213. package/dist/components/TextInline/TextInline.js +3 -40
  214. package/dist/components/TextareaField/TextareaField.js +26 -28
  215. package/dist/components/Toast/Toast.js +4 -1168
  216. package/dist/components/Tooltip/Tooltip.js +3 -66
  217. package/dist/components/deprecated/Chips/Chips.js +4 -76
  218. package/dist/components/deprecated/NativeSelectField/NativeSelect.js +40 -32
  219. package/dist/components/deprecated/NativeSelectField/NativeSelectField.js +34 -33
  220. package/dist/components/deprecated/index.js +5 -6
  221. package/dist/components/index.js +50 -150
  222. package/dist/components/private/ButtonBase/ButtonBase.d.ts +7 -11
  223. package/dist/components/private/ButtonBase/ButtonBase.d.ts.map +1 -1
  224. package/dist/components/private/ButtonBase/ButtonBase.js +3 -247
  225. package/dist/components/private/Input/Input.js +27 -19
  226. package/dist/components/private/Input/InputContainer.js +3 -5
  227. package/dist/components/private/Input/Textarea.js +24 -20
  228. package/dist/components/private/Input/index.js +2 -4
  229. package/dist/components/private/Spinner/Spinner.js +3 -52
  230. package/dist/components/private/VisuallyHidden/VisuallyHidden.js +3 -15
  231. package/dist/components-BIYP8wHJ.js +200 -0
  232. package/dist/exp-color-C5mKAN91.js +74 -0
  233. package/dist/floating-ui.utils.dom-CoeTbDZx.js +215 -0
  234. package/dist/index.js +50 -150
  235. package/dist/index.module-1c7ENvxc.js +7 -0
  236. package/dist/jsx-runtime-i4KUlhDu.js +743 -0
  237. package/dist/layout-gap.module-DLD8bcR4.js +95 -0
  238. package/dist/layout-grid.module-CZfhrKrB.js +101 -0
  239. package/dist/layout-hide.module-B1P0N4i3.js +53 -0
  240. package/dist/layout-padding-ugY-yd2q.js +389 -0
  241. package/dist/layout-relative.module-B5xrFD9j.js +6 -0
  242. package/dist/render-icon-Ch3b2dE0.js +290 -0
  243. package/dist/shared-styles/align-self/align-self.js +2 -36
  244. package/dist/shared-styles/exp-color/exp-color.js +2 -68
  245. package/dist/shared-styles/layout-gap/layout-gap.js +13 -7
  246. package/dist/shared-styles/layout-grid/layout-grid.js +28 -28
  247. package/dist/shared-styles/layout-grid-responsive-columns/layout-grid-responsive-columns.js +29 -43
  248. package/dist/shared-styles/layout-hide/layout-hide.js +8 -8
  249. package/dist/shared-styles/layout-padding/layout-padding.js +2 -5
  250. package/dist/shared-styles/layout-relative/layout-relative.js +14 -8
  251. package/dist/shared-styles/text-accent/text-accent.js +2 -25
  252. package/dist/shared-styles/text-centered/text-centered.js +2 -24
  253. package/dist/shared-styles/text-weight/text-weight.js +2 -15
  254. package/dist/store-sN_eYeZT.js +1064 -0
  255. package/dist/storybook-utils/consts.js +6 -8
  256. package/dist/storybook-utils/index.js +1 -5
  257. package/dist/text-accent-CfUFx-1K.js +30 -0
  258. package/dist/text-centered-Dwp2_-Yp.js +30 -0
  259. package/dist/text-weight-CwoqmM4o.js +21 -0
  260. package/dist/useBaseUiId-CWAD_PSs.js +13 -0
  261. package/dist/useBreakpointMatch-D9a3CTNK.js +338 -0
  262. package/dist/useButton-DHTh3Hm7.js +148 -0
  263. package/dist/useDialogClose-BzFIyWco.js +22 -0
  264. package/dist/useId-CJsH-2wV.js +34 -0
  265. package/dist/useOpenInteractionType-D8vA_ZKI.js +4104 -0
  266. package/dist/useRenderElement-ZBds6eRN.js +341 -0
  267. package/dist/utils/Orientation/OrientationProvider.js +54 -23
  268. package/dist/utils/Orientation/index.js +2 -4
  269. package/dist/utils/RovingTabIndex/RovingTabIndexProvider.js +70 -44
  270. package/dist/utils/RovingTabIndex/index.js +2 -4
  271. package/dist/utils/createRequiredContext.js +23 -13
  272. package/dist/utils/filterAttributesPassedByRadixUIAtRuntime.js +28 -25
  273. package/dist/utils/render-icon.js +3 -320
  274. package/dist/utils/shared-strings.js +24 -32
  275. package/dist/utils/useBreakpointMatch.d.ts.map +1 -1
  276. package/dist/utils/useBreakpointMatch.js +2 -183
  277. package/dist/utils/useControllableState/useControllableState.js +31 -25
  278. package/dist/utils/useMergeRefs.js +29 -14
  279. package/dist/utils/useStableCallback/useStableCallback.js +28 -13
  280. package/package.json +17 -22
  281. package/dist/AlertBannerProvider-DTx2Xp3V.js +0 -50
  282. package/dist/BubbleCounter.module-QMwXWFIS.js +0 -16
  283. package/dist/ChipsPrimitive-DzsaOWgY.js +0 -1244
  284. package/dist/Dialog.module-Ba1X7b3N.js +0 -29
  285. package/dist/DialogRootContext-BCXmmJAw.js +0 -15
  286. package/dist/DropdownMenu.primitives-CqJE9k4D.js +0 -5871
  287. package/dist/IconTile-D1G7MljH.js +0 -172
  288. package/dist/InputContainer-oHJlLWIi.js +0 -30
  289. package/dist/Slider-DB4Maswa.js +0 -55
  290. package/dist/Stars-C_mHop2H.js +0 -67
  291. package/dist/TokyoUIChevronDown-D_tD1yU8.js +0 -11
  292. package/dist/floating-ui.utils.dom-BvMNldxo.js +0 -234
  293. package/dist/index.module-Q9TzIR6B.js +0 -11
  294. package/dist/layout-gap.module-MKn_un_k.js +0 -97
  295. package/dist/layout-grid.module-P4B4WVUy.js +0 -103
  296. package/dist/layout-hide.module-Bpl3Pl-a.js +0 -55
  297. package/dist/layout-padding-D5I6rRlL.js +0 -373
  298. package/dist/layout-relative.module-1z75aSwo.js +0 -8
  299. package/dist/useBaseUiId-DavsGYu9.js +0 -8
  300. package/dist/useButton-fjQ0ak8m.js +0 -193
  301. package/dist/useId-BhIOp2JG.js +0 -28
  302. package/dist/useOpenInteractionType-DNYFqf-a.js +0 -2880
  303. package/dist/useRenderElement-BSthtPOr.js +0 -350
@@ -1,8 +1,6 @@
1
- const SUPPORTS_RESPONSIVE_VALUES = "Supports [responsive values](/?path=/docs/guides-responsive-props--docs)";
2
- const SUPPORTS_SHORTHAND_VALUES = "Supports [shorthand values](/?path=/docs/guides-shorthand-props--docs)";
3
- const SUPPORTS_RESPONSIVE_AND_SHORTHAND_VALUES = "Supports [responsive](/?path=/docs/guides-responsive-props--docs) and [shorthand](/?path=/docs/guides-shorthand-props--docs) values";
4
- export {
5
- SUPPORTS_RESPONSIVE_AND_SHORTHAND_VALUES,
6
- SUPPORTS_RESPONSIVE_VALUES,
7
- SUPPORTS_SHORTHAND_VALUES
8
- };
1
+ //#region src/storybook-utils/consts.ts
2
+ var SUPPORTS_RESPONSIVE_VALUES = "Supports [responsive values](/?path=/docs/guides-responsive-props--docs)";
3
+ var SUPPORTS_SHORTHAND_VALUES = "Supports [shorthand values](/?path=/docs/guides-shorthand-props--docs)";
4
+ var SUPPORTS_RESPONSIVE_AND_SHORTHAND_VALUES = "Supports [responsive](/?path=/docs/guides-responsive-props--docs) and [shorthand](/?path=/docs/guides-shorthand-props--docs) values";
5
+ //#endregion
6
+ export { SUPPORTS_RESPONSIVE_AND_SHORTHAND_VALUES, SUPPORTS_RESPONSIVE_VALUES, SUPPORTS_SHORTHAND_VALUES };
@@ -1,6 +1,2 @@
1
1
  import { SUPPORTS_RESPONSIVE_AND_SHORTHAND_VALUES, SUPPORTS_RESPONSIVE_VALUES, SUPPORTS_SHORTHAND_VALUES } from "./consts.js";
2
- export {
3
- SUPPORTS_RESPONSIVE_AND_SHORTHAND_VALUES,
4
- SUPPORTS_RESPONSIVE_VALUES,
5
- SUPPORTS_SHORTHAND_VALUES
6
- };
2
+ export { SUPPORTS_RESPONSIVE_AND_SHORTHAND_VALUES, SUPPORTS_RESPONSIVE_VALUES, SUPPORTS_SHORTHAND_VALUES };
@@ -0,0 +1,30 @@
1
+ import { moduleClassNames, stringClassNames } from "@preply/ds-web-core";
2
+ import './assets/text-accent.css';var text_accent_module_default = {
3
+ TextAccent: "TextAccent__AfPNQ",
4
+ "TextAccent--accent-default": "TextAccent--accent-default__rjbSO",
5
+ "TextAccent--accent-primary": "TextAccent--accent-primary__y2VJp",
6
+ "TextAccent--accent-secondary": "TextAccent--accent-secondary__EN2MG",
7
+ "TextAccent--accent-tertiary": "TextAccent--accent-tertiary__Di2P9",
8
+ "TextAccent--accent-accentDark": "TextAccent--accent-accentDark__k9Bg2",
9
+ "TextAccent--accent-placeholder": "TextAccent--accent-placeholder__s77sy",
10
+ "TextAccent--accent-inverted": "TextAccent--accent-inverted__pOSYS",
11
+ "TextAccent--accent-positive": "TextAccent--accent-positive__znwvO",
12
+ "TextAccent--accent-info": "TextAccent--accent-info__rneu6",
13
+ "TextAccent--accent-warning": "TextAccent--accent-warning__cNFBg",
14
+ "TextAccent--accent-critical": "TextAccent--accent-critical__-RJ-l",
15
+ "TextAccent--accent-disabled": "TextAccent--accent-disabled__HZyzf"
16
+ };
17
+ //#endregion
18
+ //#region src/shared-styles/text-accent/text-accent.ts
19
+ var TEXT_ACCENT = "TextAccent";
20
+ /**
21
+ * Note: be careful with styles specificity.
22
+ * It's possible that some of the styles will be overridden
23
+ * by other components/hooks, that were rendered after this one.
24
+ * See #incident-918 (https://preply.slack.com/archives/C05R913FCNR/p1694510587143179) for details
25
+ */
26
+ var getTextAccentClassnames = (fallbackToDefault, accent) => {
27
+ return moduleClassNames(text_accent_module_default, TEXT_ACCENT, [stringClassNames("accent", accent !== null && accent !== void 0 ? accent : fallbackToDefault ? "default" : void 0)]);
28
+ };
29
+ //#endregion
30
+ export { getTextAccentClassnames as t };
@@ -0,0 +1,30 @@
1
+ import { booleanClassNames, moduleClassNames } from "@preply/ds-web-core";
2
+ import './assets/text-centered.css';var text_centered_module_default = {
3
+ TextCentered: "TextCentered__7KaTF",
4
+ "TextCentered--centered": "TextCentered--centered__4f-qW",
5
+ "TextCentered--initial": "TextCentered--initial__zx7nV",
6
+ "TextCentered--narrow-l--centered": "TextCentered--narrow-l--centered__9h4So",
7
+ "TextCentered--narrow-l--initial": "TextCentered--narrow-l--initial__45Rim",
8
+ "TextCentered--medium-s--centered": "TextCentered--medium-s--centered__-x8lC",
9
+ "TextCentered--medium-s--initial": "TextCentered--medium-s--initial__gI0a7",
10
+ "TextCentered--medium-l--centered": "TextCentered--medium-l--centered__OBRt2",
11
+ "TextCentered--medium-l--initial": "TextCentered--medium-l--initial__WN00-",
12
+ "TextCentered--wide-s--centered": "TextCentered--wide-s--centered__UwUjF",
13
+ "TextCentered--wide-s--initial": "TextCentered--wide-s--initial__tWQv7",
14
+ "TextCentered--wide-l--centered": "TextCentered--wide-l--centered__XvD5D",
15
+ "TextCentered--wide-l--initial": "TextCentered--wide-l--initial__80dUb"
16
+ };
17
+ //#endregion
18
+ //#region src/shared-styles/text-centered/text-centered.ts
19
+ var TEXT_CENTERED = "TextCentered";
20
+ /**
21
+ * Note: be careful with styles specificity.
22
+ * It's possible that some of the styles will be overridden
23
+ * by other components/hooks, that were rendered after this one.
24
+ * See #incident-918 (https://preply.slack.com/archives/C05R913FCNR/p1694510587143179) for details
25
+ */
26
+ var getTextCenteredClassnames = (centered) => {
27
+ return moduleClassNames(text_centered_module_default, TEXT_CENTERED, [booleanClassNames("centered", "initial", centered)]);
28
+ };
29
+ //#endregion
30
+ export { getTextCenteredClassnames as t };
@@ -0,0 +1,21 @@
1
+ import { moduleClassNames, stringClassNames } from "@preply/ds-web-core";
2
+ import './assets/text-weight.css';var text_weight_module_default = {
3
+ TextWeight: "TextWeight__nr38y",
4
+ "TextWeight--weight-normal": "TextWeight--weight-normal__WoBtA",
5
+ "TextWeight--weight-medium": "TextWeight--weight-medium__73G59",
6
+ "TextWeight--weight-bold": "TextWeight--weight-bold__1P7zX"
7
+ };
8
+ //#endregion
9
+ //#region src/shared-styles/text-weight/text-weight.ts
10
+ var TEXT_WEIGHT = "TextWeight";
11
+ /**
12
+ * Note: be careful with styles specificity.
13
+ * It's possible that some of the styles will be overridden
14
+ * by other components/hooks, that were rendered after this one.
15
+ * See #incident-918 (https://preply.slack.com/archives/C05R913FCNR/p1694510587143179) for details
16
+ */
17
+ var getTextWeightClassNames = (weight) => {
18
+ return moduleClassNames(text_weight_module_default, TEXT_WEIGHT, [stringClassNames("weight", weight)]);
19
+ };
20
+ //#endregion
21
+ export { getTextWeightClassNames as t };
@@ -0,0 +1,13 @@
1
+ "use client";
2
+ import { t as useId } from "./useId-CJsH-2wV.js";
3
+ //#region ../../node_modules/@base-ui-components/react/esm/utils/useBaseUiId.js
4
+ /**
5
+ * Wraps `useId` and prefixes generated `id`s with `base-ui-`
6
+ * @param {string | undefined} idOverride overrides the generated id when provided
7
+ * @returns {string | undefined}
8
+ */
9
+ function useBaseUiId(idOverride) {
10
+ return useId(idOverride, "base-ui");
11
+ }
12
+ //#endregion
13
+ export { useBaseUiId as t };
@@ -0,0 +1,338 @@
1
+ "use client";
2
+ import { t as __commonJSMin } from "./chunk-BVTlhY3a.js";
3
+ import { useEffect, useLayoutEffect, useState } from "react";
4
+ import { BREAKPOINT } from "@preply/ds-core";
5
+ (/* @__PURE__ */ __commonJSMin(((exports, module) => {
6
+ /**
7
+ * lodash (Custom Build) <https://lodash.com/>
8
+ * Build: `lodash modularize exports="npm" -o ./`
9
+ * Copyright jQuery Foundation and other contributors <https://jquery.org/>
10
+ * Released under MIT license <https://lodash.com/license>
11
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
12
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
13
+ */
14
+ /** Used as the `TypeError` message for "Functions" methods. */
15
+ var FUNC_ERROR_TEXT = "Expected a function";
16
+ /** Used as references for various `Number` constants. */
17
+ var NAN = NaN;
18
+ /** `Object#toString` result references. */
19
+ var symbolTag = "[object Symbol]";
20
+ /** Used to match leading and trailing whitespace. */
21
+ var reTrim = /^\s+|\s+$/g;
22
+ /** Used to detect bad signed hexadecimal string values. */
23
+ var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
24
+ /** Used to detect binary string values. */
25
+ var reIsBinary = /^0b[01]+$/i;
26
+ /** Used to detect octal string values. */
27
+ var reIsOctal = /^0o[0-7]+$/i;
28
+ /** Built-in method references without a dependency on `root`. */
29
+ var freeParseInt = parseInt;
30
+ /** Detect free variable `global` from Node.js. */
31
+ var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
32
+ /** Detect free variable `self`. */
33
+ var freeSelf = typeof self == "object" && self && self.Object === Object && self;
34
+ /** Used as a reference to the global object. */
35
+ var root = freeGlobal || freeSelf || Function("return this")();
36
+ /**
37
+ * Used to resolve the
38
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
39
+ * of values.
40
+ */
41
+ var objectToString = Object.prototype.toString;
42
+ var nativeMax = Math.max, nativeMin = Math.min;
43
+ /**
44
+ * Gets the timestamp of the number of milliseconds that have elapsed since
45
+ * the Unix epoch (1 January 1970 00:00:00 UTC).
46
+ *
47
+ * @static
48
+ * @memberOf _
49
+ * @since 2.4.0
50
+ * @category Date
51
+ * @returns {number} Returns the timestamp.
52
+ * @example
53
+ *
54
+ * _.defer(function(stamp) {
55
+ * console.log(_.now() - stamp);
56
+ * }, _.now());
57
+ * // => Logs the number of milliseconds it took for the deferred invocation.
58
+ */
59
+ var now = function() {
60
+ return root.Date.now();
61
+ };
62
+ /**
63
+ * Creates a debounced function that delays invoking `func` until after `wait`
64
+ * milliseconds have elapsed since the last time the debounced function was
65
+ * invoked. The debounced function comes with a `cancel` method to cancel
66
+ * delayed `func` invocations and a `flush` method to immediately invoke them.
67
+ * Provide `options` to indicate whether `func` should be invoked on the
68
+ * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
69
+ * with the last arguments provided to the debounced function. Subsequent
70
+ * calls to the debounced function return the result of the last `func`
71
+ * invocation.
72
+ *
73
+ * **Note:** If `leading` and `trailing` options are `true`, `func` is
74
+ * invoked on the trailing edge of the timeout only if the debounced function
75
+ * is invoked more than once during the `wait` timeout.
76
+ *
77
+ * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
78
+ * until to the next tick, similar to `setTimeout` with a timeout of `0`.
79
+ *
80
+ * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
81
+ * for details over the differences between `_.debounce` and `_.throttle`.
82
+ *
83
+ * @static
84
+ * @memberOf _
85
+ * @since 0.1.0
86
+ * @category Function
87
+ * @param {Function} func The function to debounce.
88
+ * @param {number} [wait=0] The number of milliseconds to delay.
89
+ * @param {Object} [options={}] The options object.
90
+ * @param {boolean} [options.leading=false]
91
+ * Specify invoking on the leading edge of the timeout.
92
+ * @param {number} [options.maxWait]
93
+ * The maximum time `func` is allowed to be delayed before it's invoked.
94
+ * @param {boolean} [options.trailing=true]
95
+ * Specify invoking on the trailing edge of the timeout.
96
+ * @returns {Function} Returns the new debounced function.
97
+ * @example
98
+ *
99
+ * // Avoid costly calculations while the window size is in flux.
100
+ * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
101
+ *
102
+ * // Invoke `sendMail` when clicked, debouncing subsequent calls.
103
+ * jQuery(element).on('click', _.debounce(sendMail, 300, {
104
+ * 'leading': true,
105
+ * 'trailing': false
106
+ * }));
107
+ *
108
+ * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
109
+ * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
110
+ * var source = new EventSource('/stream');
111
+ * jQuery(source).on('message', debounced);
112
+ *
113
+ * // Cancel the trailing debounced invocation.
114
+ * jQuery(window).on('popstate', debounced.cancel);
115
+ */
116
+ function debounce(func, wait, options) {
117
+ var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
118
+ if (typeof func != "function") throw new TypeError(FUNC_ERROR_TEXT);
119
+ wait = toNumber(wait) || 0;
120
+ if (isObject(options)) {
121
+ leading = !!options.leading;
122
+ maxing = "maxWait" in options;
123
+ maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
124
+ trailing = "trailing" in options ? !!options.trailing : trailing;
125
+ }
126
+ function invokeFunc(time) {
127
+ var args = lastArgs, thisArg = lastThis;
128
+ lastArgs = lastThis = void 0;
129
+ lastInvokeTime = time;
130
+ result = func.apply(thisArg, args);
131
+ return result;
132
+ }
133
+ function leadingEdge(time) {
134
+ lastInvokeTime = time;
135
+ timerId = setTimeout(timerExpired, wait);
136
+ return leading ? invokeFunc(time) : result;
137
+ }
138
+ function remainingWait(time) {
139
+ var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, result = wait - timeSinceLastCall;
140
+ return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;
141
+ }
142
+ function shouldInvoke(time) {
143
+ var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime;
144
+ return lastCallTime === void 0 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
145
+ }
146
+ function timerExpired() {
147
+ var time = now();
148
+ if (shouldInvoke(time)) return trailingEdge(time);
149
+ timerId = setTimeout(timerExpired, remainingWait(time));
150
+ }
151
+ function trailingEdge(time) {
152
+ timerId = void 0;
153
+ if (trailing && lastArgs) return invokeFunc(time);
154
+ lastArgs = lastThis = void 0;
155
+ return result;
156
+ }
157
+ function cancel() {
158
+ if (timerId !== void 0) clearTimeout(timerId);
159
+ lastInvokeTime = 0;
160
+ lastArgs = lastCallTime = lastThis = timerId = void 0;
161
+ }
162
+ function flush() {
163
+ return timerId === void 0 ? result : trailingEdge(now());
164
+ }
165
+ function debounced() {
166
+ var time = now(), isInvoking = shouldInvoke(time);
167
+ lastArgs = arguments;
168
+ lastThis = this;
169
+ lastCallTime = time;
170
+ if (isInvoking) {
171
+ if (timerId === void 0) return leadingEdge(lastCallTime);
172
+ if (maxing) {
173
+ timerId = setTimeout(timerExpired, wait);
174
+ return invokeFunc(lastCallTime);
175
+ }
176
+ }
177
+ if (timerId === void 0) timerId = setTimeout(timerExpired, wait);
178
+ return result;
179
+ }
180
+ debounced.cancel = cancel;
181
+ debounced.flush = flush;
182
+ return debounced;
183
+ }
184
+ /**
185
+ * Checks if `value` is the
186
+ * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
187
+ * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
188
+ *
189
+ * @static
190
+ * @memberOf _
191
+ * @since 0.1.0
192
+ * @category Lang
193
+ * @param {*} value The value to check.
194
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
195
+ * @example
196
+ *
197
+ * _.isObject({});
198
+ * // => true
199
+ *
200
+ * _.isObject([1, 2, 3]);
201
+ * // => true
202
+ *
203
+ * _.isObject(_.noop);
204
+ * // => true
205
+ *
206
+ * _.isObject(null);
207
+ * // => false
208
+ */
209
+ function isObject(value) {
210
+ var type = typeof value;
211
+ return !!value && (type == "object" || type == "function");
212
+ }
213
+ /**
214
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
215
+ * and has a `typeof` result of "object".
216
+ *
217
+ * @static
218
+ * @memberOf _
219
+ * @since 4.0.0
220
+ * @category Lang
221
+ * @param {*} value The value to check.
222
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
223
+ * @example
224
+ *
225
+ * _.isObjectLike({});
226
+ * // => true
227
+ *
228
+ * _.isObjectLike([1, 2, 3]);
229
+ * // => true
230
+ *
231
+ * _.isObjectLike(_.noop);
232
+ * // => false
233
+ *
234
+ * _.isObjectLike(null);
235
+ * // => false
236
+ */
237
+ function isObjectLike(value) {
238
+ return !!value && typeof value == "object";
239
+ }
240
+ /**
241
+ * Checks if `value` is classified as a `Symbol` primitive or object.
242
+ *
243
+ * @static
244
+ * @memberOf _
245
+ * @since 4.0.0
246
+ * @category Lang
247
+ * @param {*} value The value to check.
248
+ * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
249
+ * @example
250
+ *
251
+ * _.isSymbol(Symbol.iterator);
252
+ * // => true
253
+ *
254
+ * _.isSymbol('abc');
255
+ * // => false
256
+ */
257
+ function isSymbol(value) {
258
+ return typeof value == "symbol" || isObjectLike(value) && objectToString.call(value) == symbolTag;
259
+ }
260
+ /**
261
+ * Converts `value` to a number.
262
+ *
263
+ * @static
264
+ * @memberOf _
265
+ * @since 4.0.0
266
+ * @category Lang
267
+ * @param {*} value The value to process.
268
+ * @returns {number} Returns the number.
269
+ * @example
270
+ *
271
+ * _.toNumber(3.2);
272
+ * // => 3.2
273
+ *
274
+ * _.toNumber(Number.MIN_VALUE);
275
+ * // => 5e-324
276
+ *
277
+ * _.toNumber(Infinity);
278
+ * // => Infinity
279
+ *
280
+ * _.toNumber('3.2');
281
+ * // => 3.2
282
+ */
283
+ function toNumber(value) {
284
+ if (typeof value == "number") return value;
285
+ if (isSymbol(value)) return NAN;
286
+ if (isObject(value)) {
287
+ var other = typeof value.valueOf == "function" ? value.valueOf() : value;
288
+ value = isObject(other) ? other + "" : other;
289
+ }
290
+ if (typeof value != "string") return value === 0 ? value : +value;
291
+ value = value.replace(reTrim, "");
292
+ var isBinary = reIsBinary.test(value);
293
+ return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
294
+ }
295
+ module.exports = debounce;
296
+ })))();
297
+ var useIsomorphicLayoutEffect = typeof window !== "undefined" ? useLayoutEffect : useEffect;
298
+ var IS_SERVER2 = typeof window === "undefined";
299
+ function useMediaQuery(query, { defaultValue = false, initializeWithValue = true } = {}) {
300
+ const getMatches = (query2) => {
301
+ if (IS_SERVER2) return defaultValue;
302
+ return window.matchMedia(query2).matches;
303
+ };
304
+ const [matches, setMatches] = useState(() => {
305
+ if (initializeWithValue) return getMatches(query);
306
+ return defaultValue;
307
+ });
308
+ function handleChange() {
309
+ setMatches(getMatches(query));
310
+ }
311
+ useIsomorphicLayoutEffect(() => {
312
+ const matchMedia = window.matchMedia(query);
313
+ handleChange();
314
+ if (matchMedia.addListener) matchMedia.addListener(handleChange);
315
+ else matchMedia.addEventListener("change", handleChange);
316
+ return () => {
317
+ if (matchMedia.removeListener) matchMedia.removeListener(handleChange);
318
+ else matchMedia.removeEventListener("change", handleChange);
319
+ };
320
+ }, [query]);
321
+ return matches;
322
+ }
323
+ //#endregion
324
+ //#region src/utils/useBreakpointMatch.ts
325
+ /**
326
+ * A hook that matches DS breakpoint.
327
+ *
328
+ * @example
329
+ * ```tsx
330
+ * const isMediumS = useBreakpointMatch('medium-s');
331
+ * ```
332
+ */
333
+ function useBreakpointMatch(breakpoint) {
334
+ const size = BREAKPOINT[breakpoint];
335
+ return useMediaQuery(`(min-width: ${size}px)`);
336
+ }
337
+ //#endregion
338
+ export { useBreakpointMatch as t };
@@ -0,0 +1,148 @@
1
+ "use client";
2
+ import { n as makeEventPreventable, r as mergeProps } from "./useRenderElement-ZBds6eRN.js";
3
+ import { S as useEventCallback, f as isHTMLElement, x as useIsoLayoutEffect } from "./floating-ui.utils.dom-CoeTbDZx.js";
4
+ import * as React$1 from "react";
5
+ //#region ../../node_modules/@base-ui-components/utils/esm/error.js
6
+ var set;
7
+ if (process.env.NODE_ENV !== "production") set = /* @__PURE__ */ new Set();
8
+ function error(...messages) {
9
+ if (process.env.NODE_ENV !== "production") {
10
+ const messageKey = messages.join(" ");
11
+ if (!set.has(messageKey)) {
12
+ set.add(messageKey);
13
+ console.error(`Base UI: ${messageKey}`);
14
+ }
15
+ }
16
+ }
17
+ //#endregion
18
+ //#region ../../node_modules/@base-ui-components/react/esm/composite/root/CompositeRootContext.js
19
+ var CompositeRootContext = /* @__PURE__ */ React$1.createContext(void 0);
20
+ if (process.env.NODE_ENV !== "production") CompositeRootContext.displayName = "CompositeRootContext";
21
+ function useCompositeRootContext(optional = false) {
22
+ const context = React$1.useContext(CompositeRootContext);
23
+ if (context === void 0 && !optional) throw new Error("Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>.");
24
+ return context;
25
+ }
26
+ //#endregion
27
+ //#region ../../node_modules/@base-ui-components/react/esm/utils/useFocusableWhenDisabled.js
28
+ function useFocusableWhenDisabled(parameters) {
29
+ const { focusableWhenDisabled, disabled, composite = false, tabIndex: tabIndexProp = 0, isNativeButton } = parameters;
30
+ const isFocusableComposite = composite && focusableWhenDisabled !== false;
31
+ const isNonFocusableComposite = composite && focusableWhenDisabled === false;
32
+ return { props: React$1.useMemo(() => {
33
+ const additionalProps = { onKeyDown(event) {
34
+ if (disabled && focusableWhenDisabled && event.key !== "Tab") event.preventDefault();
35
+ } };
36
+ if (!composite) {
37
+ additionalProps.tabIndex = tabIndexProp;
38
+ if (!isNativeButton && disabled) additionalProps.tabIndex = focusableWhenDisabled ? tabIndexProp : -1;
39
+ }
40
+ if (isNativeButton && (focusableWhenDisabled || isFocusableComposite) || !isNativeButton && disabled) additionalProps["aria-disabled"] = disabled;
41
+ if (isNativeButton && (!focusableWhenDisabled || isNonFocusableComposite)) additionalProps.disabled = disabled;
42
+ return additionalProps;
43
+ }, [
44
+ composite,
45
+ disabled,
46
+ focusableWhenDisabled,
47
+ isFocusableComposite,
48
+ isNonFocusableComposite,
49
+ isNativeButton,
50
+ tabIndexProp
51
+ ]) };
52
+ }
53
+ //#endregion
54
+ //#region ../../node_modules/@base-ui-components/react/esm/use-button/useButton.js
55
+ function useButton(parameters = {}) {
56
+ const { disabled = false, focusableWhenDisabled, tabIndex = 0, native: isNativeButton = true } = parameters;
57
+ const elementRef = React$1.useRef(null);
58
+ const isCompositeItem = useCompositeRootContext(true) !== void 0;
59
+ const isValidLink = useEventCallback(() => {
60
+ const element = elementRef.current;
61
+ return Boolean((element === null || element === void 0 ? void 0 : element.tagName) === "A" && (element === null || element === void 0 ? void 0 : element.href));
62
+ });
63
+ const { props: focusableWhenDisabledProps } = useFocusableWhenDisabled({
64
+ focusableWhenDisabled,
65
+ disabled,
66
+ composite: isCompositeItem,
67
+ tabIndex,
68
+ isNativeButton
69
+ });
70
+ if (process.env.NODE_ENV !== "production") React$1.useEffect(() => {
71
+ if (!elementRef.current) return;
72
+ const isButtonTag = elementRef.current.tagName === "BUTTON";
73
+ if (isNativeButton) {
74
+ if (!isButtonTag) error("A component that acts as a button was not rendered as a native <button>, which does not match the default. Ensure that the element passed to the `render` prop of the component is a real <button>, or set the `nativeButton` prop on the component to `false`.");
75
+ } else if (isButtonTag) error("A component that acts as a button was rendered as a native <button>, which does not match the default. Ensure that the element passed to the `render` prop of the component is not a real <button>, or set the `nativeButton` prop on the component to `true`.");
76
+ }, [isNativeButton]);
77
+ const updateDisabled = React$1.useCallback(() => {
78
+ const element = elementRef.current;
79
+ if (!isButtonElement(element)) return;
80
+ if (isCompositeItem && disabled && focusableWhenDisabledProps.disabled === void 0 && element.disabled) element.disabled = false;
81
+ }, [
82
+ disabled,
83
+ focusableWhenDisabledProps.disabled,
84
+ isCompositeItem
85
+ ]);
86
+ useIsoLayoutEffect(updateDisabled, [updateDisabled]);
87
+ return {
88
+ getButtonProps: React$1.useCallback((externalProps = {}) => {
89
+ const { onClick: externalOnClick, onMouseDown: externalOnMouseDown, onKeyUp: externalOnKeyUp, onKeyDown: externalOnKeyDown, onPointerDown: externalOnPointerDown, ...otherExternalProps } = externalProps;
90
+ return mergeProps({
91
+ type: isNativeButton ? "button" : void 0,
92
+ onClick(event) {
93
+ if (disabled) {
94
+ event.preventDefault();
95
+ return;
96
+ }
97
+ externalOnClick === null || externalOnClick === void 0 || externalOnClick(event);
98
+ },
99
+ onMouseDown(event) {
100
+ if (!disabled) externalOnMouseDown === null || externalOnMouseDown === void 0 || externalOnMouseDown(event);
101
+ },
102
+ onKeyDown(event) {
103
+ if (!disabled) {
104
+ makeEventPreventable(event);
105
+ externalOnKeyDown === null || externalOnKeyDown === void 0 || externalOnKeyDown(event);
106
+ }
107
+ if (event.baseUIHandlerPrevented) return;
108
+ const shouldClick = event.target === event.currentTarget && !isNativeButton && !isValidLink() && !disabled;
109
+ const isEnterKey = event.key === "Enter";
110
+ const isSpaceKey = event.key === " ";
111
+ if (shouldClick) {
112
+ if (isSpaceKey || isEnterKey) event.preventDefault();
113
+ if (isEnterKey) externalOnClick === null || externalOnClick === void 0 || externalOnClick(event);
114
+ }
115
+ },
116
+ onKeyUp(event) {
117
+ if (!disabled) {
118
+ makeEventPreventable(event);
119
+ externalOnKeyUp === null || externalOnKeyUp === void 0 || externalOnKeyUp(event);
120
+ }
121
+ if (event.baseUIHandlerPrevented) return;
122
+ if (event.target === event.currentTarget && !isNativeButton && !disabled && event.key === " ") externalOnClick === null || externalOnClick === void 0 || externalOnClick(event);
123
+ },
124
+ onPointerDown(event) {
125
+ if (disabled) {
126
+ event.preventDefault();
127
+ return;
128
+ }
129
+ externalOnPointerDown === null || externalOnPointerDown === void 0 || externalOnPointerDown(event);
130
+ }
131
+ }, !isNativeButton ? { role: "button" } : void 0, focusableWhenDisabledProps, otherExternalProps);
132
+ }, [
133
+ disabled,
134
+ focusableWhenDisabledProps,
135
+ isNativeButton,
136
+ isValidLink
137
+ ]),
138
+ buttonRef: useEventCallback((element) => {
139
+ elementRef.current = element;
140
+ updateDisabled();
141
+ })
142
+ };
143
+ }
144
+ function isButtonElement(elem) {
145
+ return isHTMLElement(elem) && elem.tagName === "BUTTON";
146
+ }
147
+ //#endregion
148
+ export { useCompositeRootContext as n, useButton as t };
@@ -0,0 +1,22 @@
1
+ "use client";
2
+ import { r as mergeProps } from "./useRenderElement-ZBds6eRN.js";
3
+ import { S as useEventCallback, b as createChangeEventDetails } from "./floating-ui.utils.dom-CoeTbDZx.js";
4
+ import { t as useButton } from "./useButton-DHTh3Hm7.js";
5
+ //#region ../../node_modules/@base-ui-components/react/esm/dialog/close/useDialogClose.js
6
+ function useDialogClose(params) {
7
+ const { open, setOpen, disabled, nativeButton } = params;
8
+ const handleClick = useEventCallback((event) => {
9
+ if (open) setOpen(false, createChangeEventDetails("close-press", event.nativeEvent));
10
+ });
11
+ const { getButtonProps, buttonRef } = useButton({
12
+ disabled,
13
+ native: nativeButton
14
+ });
15
+ const getRootProps = (externalProps) => mergeProps({ onClick: handleClick }, externalProps, getButtonProps);
16
+ return {
17
+ getRootProps,
18
+ ref: buttonRef
19
+ };
20
+ }
21
+ //#endregion
22
+ export { useDialogClose as t };
@@ -0,0 +1,34 @@
1
+ "use client";
2
+ import * as React$1 from "react";
3
+ //#region ../../node_modules/@base-ui-components/utils/esm/safeReact.js
4
+ var SafeReact = { ...React$1 };
5
+ //#endregion
6
+ //#region ../../node_modules/@base-ui-components/utils/esm/useId.js
7
+ var globalId = 0;
8
+ function useGlobalId(idOverride, prefix = "mui") {
9
+ const [defaultId, setDefaultId] = React$1.useState(idOverride);
10
+ const id = idOverride || defaultId;
11
+ React$1.useEffect(() => {
12
+ if (defaultId == null) {
13
+ globalId += 1;
14
+ setDefaultId(`${prefix}-${globalId}`);
15
+ }
16
+ }, [defaultId, prefix]);
17
+ return id;
18
+ }
19
+ var maybeReactUseId = SafeReact.useId;
20
+ /**
21
+ *
22
+ * @example <div id={useId()} />
23
+ * @param idOverride
24
+ * @returns {string}
25
+ */
26
+ function useId$1(idOverride, prefix) {
27
+ if (maybeReactUseId !== void 0) {
28
+ const reactId = maybeReactUseId();
29
+ return idOverride !== null && idOverride !== void 0 ? idOverride : prefix ? `${prefix}-${reactId}` : reactId;
30
+ }
31
+ return useGlobalId(idOverride, prefix);
32
+ }
33
+ //#endregion
34
+ export { useId$1 as t };