@protonradio/proton-ui 0.11.16 → 0.11.18-beta.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 (230) hide show
  1. package/dist/assets/svg/icons.svg.cjs.js.map +1 -1
  2. package/dist/assets/svg/icons.svg.es.js.map +1 -1
  3. package/dist/components/ActionMenu/ActionMenu.cjs.js.map +1 -1
  4. package/dist/components/ActionMenu/ActionMenu.es.js.map +1 -1
  5. package/dist/components/Badge/Badge.cjs.js.map +1 -1
  6. package/dist/components/Badge/Badge.es.js.map +1 -1
  7. package/dist/components/Banner/Banner.cjs.js.map +1 -1
  8. package/dist/components/Banner/Banner.es.js.map +1 -1
  9. package/dist/components/Button/Button.cjs.js.map +1 -1
  10. package/dist/components/Button/Button.es.js.map +1 -1
  11. package/dist/components/ButtonGroup/ButtonGroup.cjs.js.map +1 -1
  12. package/dist/components/ButtonGroup/ButtonGroup.es.js.map +1 -1
  13. package/dist/components/ButtonWithSelect/ButtonWithSelect.cjs.js +1 -1
  14. package/dist/components/ButtonWithSelect/ButtonWithSelect.cjs.js.map +1 -1
  15. package/dist/components/ButtonWithSelect/ButtonWithSelect.es.js +26 -26
  16. package/dist/components/ButtonWithSelect/ButtonWithSelect.es.js.map +1 -1
  17. package/dist/components/DataTable/DataTable.cjs.js.map +1 -1
  18. package/dist/components/DataTable/DataTable.es.js.map +1 -1
  19. package/dist/components/Dialog/Dialog.cjs.js.map +1 -1
  20. package/dist/components/Dialog/Dialog.es.js.map +1 -1
  21. package/dist/components/Elevation/Elevation.cjs.js.map +1 -1
  22. package/dist/components/Elevation/Elevation.es.js.map +1 -1
  23. package/dist/components/Icon/Icon.cjs.js.map +1 -1
  24. package/dist/components/Icon/Icon.es.js.map +1 -1
  25. package/dist/components/ImageBackground/ImageBackground.cjs.js.map +1 -1
  26. package/dist/components/ImageBackground/ImageBackground.es.js.map +1 -1
  27. package/dist/components/Input/BaseInput/Input.cjs.js.map +1 -1
  28. package/dist/components/Input/BaseInput/Input.es.js.map +1 -1
  29. package/dist/components/Input/CopyInput/CopyInput.cjs.js +1 -1
  30. package/dist/components/Input/CopyInput/CopyInput.cjs.js.map +1 -1
  31. package/dist/components/Input/CopyInput/CopyInput.es.js +9 -9
  32. package/dist/components/Input/CopyInput/CopyInput.es.js.map +1 -1
  33. package/dist/components/Input/SearchInput/SearchInput.cjs.js.map +1 -1
  34. package/dist/components/Input/SearchInput/SearchInput.es.js.map +1 -1
  35. package/dist/components/Menu/MenuTrigger.cjs.js.map +1 -1
  36. package/dist/components/Menu/MenuTrigger.es.js.map +1 -1
  37. package/dist/components/Menu/PopoverMenu.cjs.js +1 -1
  38. package/dist/components/Menu/PopoverMenu.cjs.js.map +1 -1
  39. package/dist/components/Menu/PopoverMenu.es.js +32 -28
  40. package/dist/components/Menu/PopoverMenu.es.js.map +1 -1
  41. package/dist/components/Modal/Modal.cjs.js.map +1 -1
  42. package/dist/components/Modal/Modal.es.js.map +1 -1
  43. package/dist/components/Popover/Popover.cjs.js.map +1 -1
  44. package/dist/components/Popover/Popover.es.js.map +1 -1
  45. package/dist/components/ScreenOverlay/ScreenOverlay.cjs.js.map +1 -1
  46. package/dist/components/ScreenOverlay/ScreenOverlay.es.js.map +1 -1
  47. package/dist/components/Select/Select.cjs.js.map +1 -1
  48. package/dist/components/Select/Select.es.js +3 -3
  49. package/dist/components/Select/Select.es.js.map +1 -1
  50. package/dist/components/Switch/Switch.cjs.js.map +1 -1
  51. package/dist/components/Switch/Switch.es.js.map +1 -1
  52. package/dist/components/Table/Collection/collectionParser.cjs.js.map +1 -1
  53. package/dist/components/Table/Collection/collectionParser.es.js.map +1 -1
  54. package/dist/components/Table/Collection/useTableCollection.cjs.js.map +1 -1
  55. package/dist/components/Table/Collection/useTableCollection.es.js.map +1 -1
  56. package/dist/components/Table/Table.cjs.js.map +1 -1
  57. package/dist/components/Table/Table.es.js +5 -5
  58. package/dist/components/Table/Table.es.js.map +1 -1
  59. package/dist/components/Text/TextEllipsis/TextEllipsis.cjs.js.map +1 -1
  60. package/dist/components/Text/TextEllipsis/TextEllipsis.es.js.map +1 -1
  61. package/dist/components/Text/TextEmphasis/TextEmphasis.cjs.js.map +1 -1
  62. package/dist/components/Text/TextEmphasis/TextEmphasis.es.js.map +1 -1
  63. package/dist/components/ThemeProvider.cjs.js.map +1 -1
  64. package/dist/components/ThemeProvider.es.js +4 -4
  65. package/dist/components/ThemeProvider.es.js.map +1 -1
  66. package/dist/components/Tombstone/Tombstone.cjs.js.map +1 -1
  67. package/dist/components/Tombstone/Tombstone.es.js.map +1 -1
  68. package/dist/components/Tooltip/Tooltip.cjs.js.map +1 -1
  69. package/dist/components/Tooltip/Tooltip.es.js.map +1 -1
  70. package/dist/components/Waveform/Waveform.cjs.js.map +1 -1
  71. package/dist/components/Waveform/Waveform.es.js.map +1 -1
  72. package/dist/components/Waveform/WaveformBar.cjs.js.map +1 -1
  73. package/dist/components/Waveform/WaveformBar.es.js.map +1 -1
  74. package/dist/design/darkTheme/colors.cjs.js.map +1 -1
  75. package/dist/design/darkTheme/colors.es.js +3 -3
  76. package/dist/design/darkTheme/stylesheet.cjs.js.map +1 -1
  77. package/dist/design/darkTheme/stylesheet.es.js +12 -12
  78. package/dist/design/darkTheme/stylesheet.es.js.map +1 -1
  79. package/dist/design/generateStylesheet.cjs.js.map +1 -1
  80. package/dist/design/generateStylesheet.es.js.map +1 -1
  81. package/dist/design/lightTheme/colors.cjs.js.map +1 -1
  82. package/dist/design/lightTheme/colors.es.js +3 -3
  83. package/dist/design/lightTheme/stylesheet.cjs.js.map +1 -1
  84. package/dist/design/lightTheme/stylesheet.es.js +12 -12
  85. package/dist/design/lightTheme/stylesheet.es.js.map +1 -1
  86. package/dist/hooks/useBreakpoint.cjs.js.map +1 -1
  87. package/dist/hooks/useBreakpoint.es.js.map +1 -1
  88. package/dist/hooks/useIsClosing.cjs.js.map +1 -1
  89. package/dist/hooks/useIsClosing.es.js.map +1 -1
  90. package/dist/hooks/useLockBodyScroll.cjs.js.map +1 -1
  91. package/dist/hooks/useLockBodyScroll.es.js.map +1 -1
  92. package/dist/hooks/usePalette.cjs.js.map +1 -1
  93. package/dist/hooks/usePalette.es.js.map +1 -1
  94. package/dist/index.d.ts +38 -38
  95. package/dist/node_modules/@react-aria/button/dist/useButton.cjs.js +1 -1
  96. package/dist/node_modules/@react-aria/button/dist/useButton.cjs.js.map +1 -1
  97. package/dist/node_modules/@react-aria/button/dist/useButton.es.js +12 -13
  98. package/dist/node_modules/@react-aria/button/dist/useButton.es.js.map +1 -1
  99. package/dist/node_modules/@react-aria/dialog/dist/useDialog.cjs.js.map +1 -1
  100. package/dist/node_modules/@react-aria/dialog/dist/useDialog.es.js.map +1 -1
  101. package/dist/node_modules/@react-aria/focus/dist/FocusScope.cjs.js.map +1 -1
  102. package/dist/node_modules/@react-aria/focus/dist/FocusScope.es.js +3 -3
  103. package/dist/node_modules/@react-aria/focus/dist/FocusScope.es.js.map +1 -1
  104. package/dist/node_modules/@react-aria/form/dist/useFormValidation.cjs.js.map +1 -1
  105. package/dist/node_modules/@react-aria/form/dist/useFormValidation.es.js.map +1 -1
  106. package/dist/node_modules/@react-aria/i18n/dist/context.cjs.js.map +1 -1
  107. package/dist/node_modules/@react-aria/i18n/dist/context.es.js.map +1 -1
  108. package/dist/node_modules/@react-aria/i18n/dist/useDefaultLocale.cjs.js.map +1 -1
  109. package/dist/node_modules/@react-aria/i18n/dist/useDefaultLocale.es.js.map +1 -1
  110. package/dist/node_modules/@react-aria/i18n/dist/utils.cjs.js.map +1 -1
  111. package/dist/node_modules/@react-aria/i18n/dist/utils.es.js.map +1 -1
  112. package/dist/node_modules/@react-aria/interactions/dist/context.cjs.js.map +1 -1
  113. package/dist/node_modules/@react-aria/interactions/dist/context.es.js.map +1 -1
  114. package/dist/node_modules/@react-aria/interactions/dist/createEventHandler.cjs.js.map +1 -1
  115. package/dist/node_modules/@react-aria/interactions/dist/createEventHandler.es.js.map +1 -1
  116. package/dist/node_modules/@react-aria/interactions/dist/focusSafely.cjs.js.map +1 -1
  117. package/dist/node_modules/@react-aria/interactions/dist/focusSafely.es.js.map +1 -1
  118. package/dist/node_modules/@react-aria/interactions/dist/textSelection.cjs.js.map +1 -1
  119. package/dist/node_modules/@react-aria/interactions/dist/textSelection.es.js.map +1 -1
  120. package/dist/node_modules/@react-aria/interactions/dist/useFocus.cjs.js.map +1 -1
  121. package/dist/node_modules/@react-aria/interactions/dist/useFocus.es.js.map +1 -1
  122. package/dist/node_modules/@react-aria/interactions/dist/useFocusVisible.cjs.js.map +1 -1
  123. package/dist/node_modules/@react-aria/interactions/dist/useFocusVisible.es.js.map +1 -1
  124. package/dist/node_modules/@react-aria/interactions/dist/useFocusWithin.cjs.js.map +1 -1
  125. package/dist/node_modules/@react-aria/interactions/dist/useFocusWithin.es.js.map +1 -1
  126. package/dist/node_modules/@react-aria/interactions/dist/useFocusable.cjs.js.map +1 -1
  127. package/dist/node_modules/@react-aria/interactions/dist/useFocusable.es.js.map +1 -1
  128. package/dist/node_modules/@react-aria/interactions/dist/useInteractOutside.cjs.js.map +1 -1
  129. package/dist/node_modules/@react-aria/interactions/dist/useInteractOutside.es.js.map +1 -1
  130. package/dist/node_modules/@react-aria/interactions/dist/useKeyboard.cjs.js.map +1 -1
  131. package/dist/node_modules/@react-aria/interactions/dist/useKeyboard.es.js.map +1 -1
  132. package/dist/node_modules/@react-aria/interactions/dist/usePress.cjs.js +2 -2
  133. package/dist/node_modules/@react-aria/interactions/dist/usePress.cjs.js.map +1 -1
  134. package/dist/node_modules/@react-aria/interactions/dist/usePress.es.js +23 -23
  135. package/dist/node_modules/@react-aria/interactions/dist/usePress.es.js.map +1 -1
  136. package/dist/node_modules/@react-aria/interactions/dist/utils.cjs.js.map +1 -1
  137. package/dist/node_modules/@react-aria/interactions/dist/utils.es.js.map +1 -1
  138. package/dist/node_modules/@react-aria/label/dist/useField.cjs.js.map +1 -1
  139. package/dist/node_modules/@react-aria/label/dist/useField.es.js.map +1 -1
  140. package/dist/node_modules/@react-aria/label/dist/useLabel.cjs.js.map +1 -1
  141. package/dist/node_modules/@react-aria/label/dist/useLabel.es.js.map +1 -1
  142. package/dist/node_modules/@react-aria/overlays/dist/Overlay.cjs.js.map +1 -1
  143. package/dist/node_modules/@react-aria/overlays/dist/Overlay.es.js.map +1 -1
  144. package/dist/node_modules/@react-aria/overlays/dist/ariaHideOutside.cjs.js +1 -1
  145. package/dist/node_modules/@react-aria/overlays/dist/ariaHideOutside.cjs.js.map +1 -1
  146. package/dist/node_modules/@react-aria/overlays/dist/ariaHideOutside.es.js +18 -18
  147. package/dist/node_modules/@react-aria/overlays/dist/ariaHideOutside.es.js.map +1 -1
  148. package/dist/node_modules/@react-aria/overlays/dist/useModalOverlay.cjs.js.map +1 -1
  149. package/dist/node_modules/@react-aria/overlays/dist/useModalOverlay.es.js.map +1 -1
  150. package/dist/node_modules/@react-aria/overlays/dist/useOverlay.cjs.js.map +1 -1
  151. package/dist/node_modules/@react-aria/overlays/dist/useOverlay.es.js.map +1 -1
  152. package/dist/node_modules/@react-aria/overlays/dist/usePreventScroll.cjs.js.map +1 -1
  153. package/dist/node_modules/@react-aria/overlays/dist/usePreventScroll.es.js.map +1 -1
  154. package/dist/node_modules/@react-aria/radio/dist/useRadio.cjs.js.map +1 -1
  155. package/dist/node_modules/@react-aria/radio/dist/useRadio.es.js.map +1 -1
  156. package/dist/node_modules/@react-aria/radio/dist/useRadioGroup.cjs.js.map +1 -1
  157. package/dist/node_modules/@react-aria/radio/dist/useRadioGroup.es.js.map +1 -1
  158. package/dist/node_modules/@react-aria/ssr/dist/SSRProvider.cjs.js.map +1 -1
  159. package/dist/node_modules/@react-aria/ssr/dist/SSRProvider.es.js.map +1 -1
  160. package/dist/node_modules/@react-aria/switch/dist/useSwitch.cjs.js.map +1 -1
  161. package/dist/node_modules/@react-aria/switch/dist/useSwitch.es.js.map +1 -1
  162. package/dist/node_modules/@react-aria/toggle/dist/useToggle.cjs.js.map +1 -1
  163. package/dist/node_modules/@react-aria/toggle/dist/useToggle.es.js.map +1 -1
  164. package/dist/node_modules/@react-aria/visually-hidden/dist/VisuallyHidden.cjs.js.map +1 -1
  165. package/dist/node_modules/@react-aria/visually-hidden/dist/VisuallyHidden.es.js.map +1 -1
  166. package/dist/node_modules/@react-stately/form/dist/useFormValidationState.cjs.js.map +1 -1
  167. package/dist/node_modules/@react-stately/form/dist/useFormValidationState.es.js +3 -3
  168. package/dist/node_modules/@react-stately/form/dist/useFormValidationState.es.js.map +1 -1
  169. package/dist/node_modules/@react-stately/overlays/dist/useOverlayTriggerState.cjs.js.map +1 -1
  170. package/dist/node_modules/@react-stately/overlays/dist/useOverlayTriggerState.es.js.map +1 -1
  171. package/dist/node_modules/@react-stately/radio/dist/useRadioGroupState.cjs.js.map +1 -1
  172. package/dist/node_modules/@react-stately/radio/dist/useRadioGroupState.es.js.map +1 -1
  173. package/dist/node_modules/@react-stately/toggle/dist/useToggleState.cjs.js.map +1 -1
  174. package/dist/node_modules/@react-stately/toggle/dist/useToggleState.es.js.map +1 -1
  175. package/dist/node_modules/@react-stately/utils/dist/useControlledState.cjs.js.map +1 -1
  176. package/dist/node_modules/@react-stately/utils/dist/useControlledState.es.js.map +1 -1
  177. package/dist/node_modules/@swc/helpers/esm/_check_private_redeclaration.cjs.js +1 -1
  178. package/dist/node_modules/@swc/helpers/esm/_check_private_redeclaration.cjs.js.map +1 -1
  179. package/dist/node_modules/@swc/helpers/esm/_check_private_redeclaration.es.js +2 -1
  180. package/dist/node_modules/@swc/helpers/esm/_check_private_redeclaration.es.js.map +1 -1
  181. package/dist/node_modules/@swc/helpers/esm/_class_apply_descriptor_get.cjs.js +1 -1
  182. package/dist/node_modules/@swc/helpers/esm/_class_apply_descriptor_get.cjs.js.map +1 -1
  183. package/dist/node_modules/@swc/helpers/esm/_class_apply_descriptor_get.es.js +2 -1
  184. package/dist/node_modules/@swc/helpers/esm/_class_apply_descriptor_get.es.js.map +1 -1
  185. package/dist/node_modules/@swc/helpers/esm/_class_apply_descriptor_set.cjs.js +1 -1
  186. package/dist/node_modules/@swc/helpers/esm/_class_apply_descriptor_set.cjs.js.map +1 -1
  187. package/dist/node_modules/@swc/helpers/esm/_class_apply_descriptor_set.es.js +2 -1
  188. package/dist/node_modules/@swc/helpers/esm/_class_apply_descriptor_set.es.js.map +1 -1
  189. package/dist/node_modules/@swc/helpers/esm/_class_extract_field_descriptor.cjs.js +1 -1
  190. package/dist/node_modules/@swc/helpers/esm/_class_extract_field_descriptor.cjs.js.map +1 -1
  191. package/dist/node_modules/@swc/helpers/esm/_class_extract_field_descriptor.es.js +2 -1
  192. package/dist/node_modules/@swc/helpers/esm/_class_extract_field_descriptor.es.js.map +1 -1
  193. package/dist/node_modules/@swc/helpers/esm/_class_private_field_get.cjs.js +1 -1
  194. package/dist/node_modules/@swc/helpers/esm/_class_private_field_get.cjs.js.map +1 -1
  195. package/dist/node_modules/@swc/helpers/esm/_class_private_field_get.es.js +7 -6
  196. package/dist/node_modules/@swc/helpers/esm/_class_private_field_get.es.js.map +1 -1
  197. package/dist/node_modules/@swc/helpers/esm/_class_private_field_init.cjs.js +1 -1
  198. package/dist/node_modules/@swc/helpers/esm/_class_private_field_init.cjs.js.map +1 -1
  199. package/dist/node_modules/@swc/helpers/esm/_class_private_field_init.es.js +4 -3
  200. package/dist/node_modules/@swc/helpers/esm/_class_private_field_init.es.js.map +1 -1
  201. package/dist/node_modules/@swc/helpers/esm/_class_private_field_set.cjs.js +1 -1
  202. package/dist/node_modules/@swc/helpers/esm/_class_private_field_set.cjs.js.map +1 -1
  203. package/dist/node_modules/@swc/helpers/esm/_class_private_field_set.es.js +7 -6
  204. package/dist/node_modules/@swc/helpers/esm/_class_private_field_set.es.js.map +1 -1
  205. package/dist/node_modules/color2k/dist/index.exports.import.es.cjs.js.map +1 -1
  206. package/dist/node_modules/color2k/dist/index.exports.import.es.es.js.map +1 -1
  207. package/dist/node_modules/react/cjs/react-jsx-runtime.development.cjs.js +7 -7
  208. package/dist/node_modules/react/cjs/react-jsx-runtime.development.cjs.js.map +1 -1
  209. package/dist/node_modules/react/cjs/react-jsx-runtime.development.es.js +174 -167
  210. package/dist/node_modules/react/cjs/react-jsx-runtime.development.es.js.map +1 -1
  211. package/dist/node_modules/react/cjs/react-jsx-runtime.production.min.cjs.js +1 -1
  212. package/dist/node_modules/react/cjs/react-jsx-runtime.production.min.cjs.js.map +1 -1
  213. package/dist/node_modules/react/cjs/react-jsx-runtime.production.min.es.js +3 -3
  214. package/dist/node_modules/react/cjs/react-jsx-runtime.production.min.es.js.map +1 -1
  215. package/dist/node_modules/react/jsx-runtime.cjs.js.map +1 -1
  216. package/dist/node_modules/react/jsx-runtime.es.js.map +1 -1
  217. package/dist/utils/color2k.cjs.js.map +1 -1
  218. package/dist/utils/color2k.es.js.map +1 -1
  219. package/dist/utils/copy.cjs.js +1 -1
  220. package/dist/utils/copy.cjs.js.map +1 -1
  221. package/dist/utils/copy.es.js +20 -19
  222. package/dist/utils/copy.es.js.map +1 -1
  223. package/dist/utils/image.cjs.js.map +1 -1
  224. package/dist/utils/image.es.js.map +1 -1
  225. package/dist/utils/navigation.cjs.js.map +1 -1
  226. package/dist/utils/navigation.es.js.map +1 -1
  227. package/dist/utils/palette.cjs.js.map +1 -1
  228. package/dist/utils/palette.es.js +1 -1
  229. package/dist/utils/palette.es.js.map +1 -1
  230. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Input.es.js","sources":["../../../../src/components/Input/BaseInput/Input.tsx"],"sourcesContent":["\"use client\";\n\nimport React, { forwardRef, useEffect, useRef } from \"react\";\n\nimport { useTheme } from \"../../ThemeProvider\";\nimport { csx } from \"../../../utils\";\nimport \"./Input.css\";\nimport { copyTextToClipboard } from \"../../../utils/copy\";\n\nexport interface BaseInputProps {\n /**\n * onChange handler for the input\n */\n onChange?: (value: string) => void;\n\n /** Whether the input is disabled. */\n isDisabled?: boolean;\n\n /** Description text shown above the input. */\n description?: React.ReactNode | string;\n\n /**\n * The position of the description text.\n * @default \"top\"\n */\n descriptionPosition?: \"top\" | \"bottom\";\n\n /** Error state that changes the input's visual style and displays an error message. */\n error?: React.ReactNode | string;\n\n /**\n * Label for the input element.\n * @note When a label is provided, the input will have extra padding, and the label will float above the text input when focused or filled.\n */\n label?: string;\n\n /** Test ID for the component. */\n \"data-testid\"?: string;\n\n /** Content to display before the input. Typically used for icons. */\n prefix?: React.ReactNode;\n\n /** Content to display after the input. Typically used for icons. */\n suffix?: React.ReactNode;\n\n /**\n * Should the browser's autocomplete be enabled?\n * @external https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete\n */\n autoComplete?: boolean;\n\n /**\n * Should the input be autofocused?\n * @external https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autofocus\n */\n autoFocus?: boolean;\n\n /**\n * The name attribute of the input element.\n * @external https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/name\n */\n name: string;\n\n /**\n * The placeholder text to display when the input is empty.\n * @note label takes precedence over placeholder, if both are provided.\n * @external https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/placeholder\n */\n placeholder?: string;\n\n /**\n * The type attribute of the input element.\n * @external https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/type\n * @default \"text\"\n */\n type?: string;\n\n /**\n * The value of the input.\n * @external https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#value\n */\n value?: string;\n\n /**\n * Whether the input is required.\n * @default false\n */\n isRequired?: boolean;\n\n /**\n * Whether the input is read-only.\n * @default false\n */\n isReadOnly?: boolean;\n\n /**\n * Called when the input is submitted (e.g. by pressing Enter).\n */\n onSubmit?: React.FormEventHandler<HTMLInputElement>;\n\n /**\n * Called when the input is cleared (e.g. by pressing Escape).\n */\n onClear?: () => void;\n}\n\n/**\n * A controlled and customizable input component with support for labels, prefixes, suffixes, and error states.\n *\n * API:\n * - {@link BaseInputProps}\n */\nexport const Input = forwardRef<HTMLInputElement, BaseInputProps>(\n (\n {\n prefix,\n suffix,\n description,\n descriptionPosition = \"top\",\n isDisabled,\n error,\n onChange,\n label,\n name,\n placeholder,\n type = \"text\",\n value,\n autoFocus,\n autoComplete,\n isRequired = false,\n isReadOnly = false,\n onSubmit,\n onClear,\n \"data-testid\": testId,\n },\n forwardedRef: React.RefObject<HTMLInputElement>\n ) => {\n const inputRef = useRef<HTMLInputElement>(null);\n const prefixRef = useRef<HTMLDivElement>(null);\n const suffixRef = useRef<HTMLDivElement>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n const { className } = useTheme();\n const ref = forwardedRef || inputRef;\n\n // Control dynamic prefix and suffix widths using ResizeObserver\n useEffect(() => {\n if (!containerRef.current) return;\n\n const updateSizes = () => {\n if (containerRef.current) {\n const containerWidth = containerRef.current.offsetWidth || 200;\n containerRef.current.style.setProperty(\n \"--container-width\",\n `${containerWidth}px`\n );\n }\n\n if (prefixRef.current) {\n const prefixWidth = prefixRef.current.offsetWidth || 32;\n containerRef.current?.style.setProperty(\n \"--prefix-width\",\n `${prefixWidth}px`\n );\n }\n\n if (suffixRef.current) {\n const suffixWidth = suffixRef.current.offsetWidth || 32;\n containerRef.current?.style.setProperty(\n \"--suffix-width\",\n `${suffixWidth}px`\n );\n }\n };\n\n updateSizes();\n\n const resizeObserver = new ResizeObserver(updateSizes);\n\n if (containerRef.current) {\n resizeObserver.observe(containerRef.current);\n }\n if (prefixRef.current) {\n resizeObserver.observe(prefixRef.current);\n }\n if (suffixRef.current) {\n resizeObserver.observe(suffixRef.current);\n }\n\n return () => {\n resizeObserver.disconnect();\n };\n }, [prefix, suffix]);\n\n const inputId = `${name}-input`;\n const errorId = `${name}-error`;\n const descriptionId = `${name}-description`;\n\n return (\n <div ref={containerRef}>\n {description && descriptionPosition === \"top\" && (\n <div\n id={descriptionId}\n className=\"proton-Input__text\"\n aria-live=\"polite\"\n >\n {description}\n </div>\n )}\n <div className={csx(\n \"proton-Input__container-inner\",\n prefix && \"proton-Input__has-prefix\",\n suffix && \"proton-Input__has-suffix\"\n )}>\n {prefix && (\n <div\n ref={prefixRef}\n className={csx(\n \"proton-Input__descriptor\",\n \"proton-Input__prefix\"\n )}\n >\n {prefix}\n </div>\n )}\n\n <input\n id={inputId}\n name={name}\n type={type}\n value={value}\n onChange={(e: React.ChangeEvent<HTMLInputElement>) => {\n onChange?.(e.target.value);\n }}\n onKeyDown={(e: React.KeyboardEvent<HTMLInputElement>) => {\n switch (e.key) {\n case \"Enter\":\n if (onSubmit) {\n e.preventDefault();\n onSubmit(e);\n }\n break;\n case \"Escape\":\n if (onClear) {\n e.preventDefault();\n onClear();\n }\n break;\n }\n }}\n onCopy={async () =>\n await copyTextToClipboard(inputRef.current?.value)\n }\n disabled={isDisabled}\n readOnly={isReadOnly}\n required={isRequired}\n autoFocus={autoFocus}\n autoComplete={autoComplete ? \"on\" : \"off\"}\n placeholder={label ? undefined : placeholder}\n aria-label={label || name}\n aria-invalid={Boolean(error)}\n aria-errormessage={typeof error === \"string\" ? error : errorId}\n aria-required={isRequired}\n aria-readonly={isReadOnly}\n aria-describedby={\n error ? errorId : description ? descriptionId : undefined\n }\n aria-disabled={isDisabled}\n data-testid={testId}\n ref={ref}\n className={csx(\n \"proton-Input\",\n error && \"proton-Input--error\",\n label && \"proton-Input__label-top\",\n className\n )}\n />\n\n <label\n htmlFor={inputId}\n className={csx(\n \"proton-Input__label\",\n value && \"proton-Input__label--filled\"\n )}\n >\n {label}\n {isRequired && <span aria-hidden=\"true\"> *</span>}\n </label>\n\n {suffix && (\n <div\n ref={suffixRef}\n className={csx(\n \"proton-Input__descriptor\",\n \"proton-Input__suffix\"\n )}\n >\n {suffix}\n </div>\n )}\n </div>\n\n {error ? (\n <div\n role=\"alert\"\n className={csx(\"proton-Input__error\", \"proton-Input__text\")}\n id={errorId}\n >\n {error}\n </div>\n ) : description && descriptionPosition === \"bottom\" ? (\n <div\n id={descriptionId}\n className=\"proton-Input__text\"\n aria-live=\"polite\"\n >\n {description}\n </div>\n ) : null}\n </div>\n );\n }\n);\n\nInput.displayName = \"ProtonUIInput\";\n"],"names":["Input","forwardRef","prefix","suffix","description","descriptionPosition","isDisabled","error","onChange","label","name","placeholder","type","value","autoFocus","autoComplete","isRequired","isReadOnly","onSubmit","onClear","testId","forwardedRef","inputRef","useRef","prefixRef","suffixRef","containerRef","className","useTheme","ref","useEffect","updateSizes","containerWidth","prefixWidth","_a","suffixWidth","_b","resizeObserver","inputId","errorId","descriptionId","jsxs","jsx","csx","e","copyTextToClipboard"],"mappings":";;;;;;AAgHO,MAAMA,IAAQC;AAAA,EACnB,CACE;AAAA,IACE,QAAAC;AAAA,IACA,QAAAC;AAAA,IACA,aAAAC;AAAA,IACA,qBAAAC,IAAsB;AAAA,IACtB,YAAAC;AAAA,IACA,OAAAC;AAAA,IACA,UAAAC;AAAA,IACA,OAAAC;AAAA,IACA,MAAAC;AAAA,IACA,aAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,OAAAC;AAAA,IACA,WAAAC;AAAA,IACA,cAAAC;AAAA,IACA,YAAAC,IAAa;AAAA,IACb,YAAAC,IAAa;AAAA,IACb,UAAAC;AAAA,IACA,SAAAC;AAAA,IACA,eAAeC;AAAA,EAAA,GAEjBC,MACG;AACH,UAAMC,IAAWC,EAAyB,IAAI,GACxCC,IAAYD,EAAuB,IAAI,GACvCE,IAAYF,EAAuB,IAAI,GACvCG,IAAeH,EAAuB,IAAI,GAC1C,EAAE,WAAAI,EAAA,IAAcC,EAAA,GAChBC,IAAMR,KAAgBC;AAG5B,IAAAQ,EAAU,MAAM;AACd,UAAI,CAACJ,EAAa,QAAS;AAE3B,YAAMK,IAAc,MAAM;;AACxB,YAAIL,EAAa,SAAS;AACxB,gBAAMM,IAAiBN,EAAa,QAAQ,eAAe;AAC3D,UAAAA,EAAa,QAAQ,MAAM;AAAA,YACzB;AAAA,YACA,GAAGM,CAAc;AAAA,UAAA;AAAA,QAErB;AAEA,YAAIR,EAAU,SAAS;AACrB,gBAAMS,IAAcT,EAAU,QAAQ,eAAe;AACrD,WA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AAA,EAAK,eAAY,QAAO,UAAA,KAAA,CAAE;AAAA,YAAA;AAAA,UAAA;AAAA,QAAA;AAAA,QAG3CvC,KACCuC,gBAAAA,EAAAA;AAAAA,UAAC;AAAA,UAAA;AAAA,YACC,KAAKjB;AAAA,YACL,WAAWkB;AAAA,cACT;AAAA,cACA;AAAA,YAAA;AAAA,YAGD,UAAAxC;AAAA,UAAA;AAAA,QAAA;AAAA,MACH,GAEJ;AAAA,MAECI,IACCmC,gBAAAA,EAAAA;AAAAA,QAAC;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,WAAWC,EAAI,uBAAuB,oBAAoB;AAAA,UAC1D,IAAIJ;AAAA,UAEH,UAAAhC;AAAA,QAAA;AAAA,MAAA,IAEDH,KAAeC,MAAwB,WACzCqC,gBAAAA,EAAAA;AAAAA,QAAC;AAAA,QAAA;AAAA,UACC,IAAIF;AAAA,UACJ,WAAU;AAAA,UACV,aAAU;AAAA,UAET,UAAApC;AAAA,QAAA;AAAA,MAAA,IAED;AAAA,IAAA,GACN;AAAA,EAEJ;AACF;AAEAJ,EAAM,cAAc;"}
1
+ {"version":3,"file":"Input.es.js","sources":["../../../../src/components/Input/BaseInput/Input.tsx"],"sourcesContent":["\"use client\";\n\nimport React, { forwardRef, useEffect, useRef } from \"react\";\n\nimport { useTheme } from \"../../ThemeProvider\";\nimport { csx } from \"../../../utils\";\nimport \"./Input.css\";\nimport { copyTextToClipboard } from \"../../../utils/copy\";\n\nexport interface BaseInputProps {\n /**\n * onChange handler for the input\n */\n onChange?: (value: string) => void;\n\n /** Whether the input is disabled. */\n isDisabled?: boolean;\n\n /** Description text shown above the input. */\n description?: React.ReactNode | string;\n\n /**\n * The position of the description text.\n * @default \"top\"\n */\n descriptionPosition?: \"top\" | \"bottom\";\n\n /** Error state that changes the input's visual style and displays an error message. */\n error?: React.ReactNode | string;\n\n /**\n * Label for the input element.\n * @note When a label is provided, the input will have extra padding, and the label will float above the text input when focused or filled.\n */\n label?: string;\n\n /** Test ID for the component. */\n \"data-testid\"?: string;\n\n /** Content to display before the input. Typically used for icons. */\n prefix?: React.ReactNode;\n\n /** Content to display after the input. Typically used for icons. */\n suffix?: React.ReactNode;\n\n /**\n * Should the browser's autocomplete be enabled?\n * @external https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete\n */\n autoComplete?: boolean;\n\n /**\n * Should the input be autofocused?\n * @external https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autofocus\n */\n autoFocus?: boolean;\n\n /**\n * The name attribute of the input element.\n * @external https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/name\n */\n name: string;\n\n /**\n * The placeholder text to display when the input is empty.\n * @note label takes precedence over placeholder, if both are provided.\n * @external https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/placeholder\n */\n placeholder?: string;\n\n /**\n * The type attribute of the input element.\n * @external https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/type\n * @default \"text\"\n */\n type?: string;\n\n /**\n * The value of the input.\n * @external https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#value\n */\n value?: string;\n\n /**\n * Whether the input is required.\n * @default false\n */\n isRequired?: boolean;\n\n /**\n * Whether the input is read-only.\n * @default false\n */\n isReadOnly?: boolean;\n\n /**\n * Called when the input is submitted (e.g. by pressing Enter).\n */\n onSubmit?: React.FormEventHandler<HTMLInputElement>;\n\n /**\n * Called when the input is cleared (e.g. by pressing Escape).\n */\n onClear?: () => void;\n}\n\n/**\n * A controlled and customizable input component with support for labels, prefixes, suffixes, and error states.\n *\n * API:\n * - {@link BaseInputProps}\n */\nexport const Input = forwardRef<HTMLInputElement, BaseInputProps>(\n (\n {\n prefix,\n suffix,\n description,\n descriptionPosition = \"top\",\n isDisabled,\n error,\n onChange,\n label,\n name,\n placeholder,\n type = \"text\",\n value,\n autoFocus,\n autoComplete,\n isRequired = false,\n isReadOnly = false,\n onSubmit,\n onClear,\n \"data-testid\": testId,\n },\n forwardedRef: React.RefObject<HTMLInputElement>\n ) => {\n const inputRef = useRef<HTMLInputElement>(null);\n const prefixRef = useRef<HTMLDivElement>(null);\n const suffixRef = useRef<HTMLDivElement>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n const { className } = useTheme();\n const ref = forwardedRef || inputRef;\n\n // Control dynamic prefix and suffix widths using ResizeObserver\n useEffect(() => {\n if (!containerRef.current) return;\n\n const updateSizes = () => {\n if (containerRef.current) {\n const containerWidth = containerRef.current.offsetWidth || 200;\n containerRef.current.style.setProperty(\n \"--container-width\",\n `${containerWidth}px`\n );\n }\n\n if (prefixRef.current) {\n const prefixWidth = prefixRef.current.offsetWidth || 32;\n containerRef.current?.style.setProperty(\n \"--prefix-width\",\n `${prefixWidth}px`\n );\n }\n\n if (suffixRef.current) {\n const suffixWidth = suffixRef.current.offsetWidth || 32;\n containerRef.current?.style.setProperty(\n \"--suffix-width\",\n `${suffixWidth}px`\n );\n }\n };\n\n updateSizes();\n\n const resizeObserver = new ResizeObserver(updateSizes);\n\n if (containerRef.current) {\n resizeObserver.observe(containerRef.current);\n }\n if (prefixRef.current) {\n resizeObserver.observe(prefixRef.current);\n }\n if (suffixRef.current) {\n resizeObserver.observe(suffixRef.current);\n }\n\n return () => {\n resizeObserver.disconnect();\n };\n }, [prefix, suffix]);\n\n const inputId = `${name}-input`;\n const errorId = `${name}-error`;\n const descriptionId = `${name}-description`;\n\n return (\n <div ref={containerRef}>\n {description && descriptionPosition === \"top\" && (\n <div\n id={descriptionId}\n className=\"proton-Input__text\"\n aria-live=\"polite\"\n >\n {description}\n </div>\n )}\n <div className={csx(\n \"proton-Input__container-inner\",\n prefix && \"proton-Input__has-prefix\",\n suffix && \"proton-Input__has-suffix\"\n )}>\n {prefix && (\n <div\n ref={prefixRef}\n className={csx(\n \"proton-Input__descriptor\",\n \"proton-Input__prefix\"\n )}\n >\n {prefix}\n </div>\n )}\n\n <input\n id={inputId}\n name={name}\n type={type}\n value={value}\n onChange={(e: React.ChangeEvent<HTMLInputElement>) => {\n onChange?.(e.target.value);\n }}\n onKeyDown={(e: React.KeyboardEvent<HTMLInputElement>) => {\n switch (e.key) {\n case \"Enter\":\n if (onSubmit) {\n e.preventDefault();\n onSubmit(e);\n }\n break;\n case \"Escape\":\n if (onClear) {\n e.preventDefault();\n onClear();\n }\n break;\n }\n }}\n onCopy={async () =>\n await copyTextToClipboard(inputRef.current?.value)\n }\n disabled={isDisabled}\n readOnly={isReadOnly}\n required={isRequired}\n autoFocus={autoFocus}\n autoComplete={autoComplete ? \"on\" : \"off\"}\n placeholder={label ? undefined : placeholder}\n aria-label={label || name}\n aria-invalid={Boolean(error)}\n aria-errormessage={typeof error === \"string\" ? error : errorId}\n aria-required={isRequired}\n aria-readonly={isReadOnly}\n aria-describedby={\n error ? errorId : description ? descriptionId : undefined\n }\n aria-disabled={isDisabled}\n data-testid={testId}\n ref={ref}\n className={csx(\n \"proton-Input\",\n error && \"proton-Input--error\",\n label && \"proton-Input__label-top\",\n className\n )}\n />\n\n <label\n htmlFor={inputId}\n className={csx(\n \"proton-Input__label\",\n value && \"proton-Input__label--filled\"\n )}\n >\n {label}\n {isRequired && <span aria-hidden=\"true\"> *</span>}\n </label>\n\n {suffix && (\n <div\n ref={suffixRef}\n className={csx(\n \"proton-Input__descriptor\",\n \"proton-Input__suffix\"\n )}\n >\n {suffix}\n </div>\n )}\n </div>\n\n {error ? (\n <div\n role=\"alert\"\n className={csx(\"proton-Input__error\", \"proton-Input__text\")}\n id={errorId}\n >\n {error}\n </div>\n ) : description && descriptionPosition === \"bottom\" ? (\n <div\n id={descriptionId}\n className=\"proton-Input__text\"\n aria-live=\"polite\"\n >\n {description}\n </div>\n ) : null}\n </div>\n );\n }\n);\n\nInput.displayName = \"ProtonUIInput\";\n"],"names":["Input","forwardRef","prefix","suffix","description","descriptionPosition","isDisabled","error","onChange","label","name","placeholder","type","value","autoFocus","autoComplete","isRequired","isReadOnly","onSubmit","onClear","testId","forwardedRef","inputRef","useRef","prefixRef","suffixRef","containerRef","className","useTheme","ref","useEffect","updateSizes","containerWidth","prefixWidth","_a","suffixWidth","_b","resizeObserver","inputId","errorId","descriptionId","jsxs","jsx","csx","e","copyTextToClipboard"],"mappings":";;;;;;AAgHO,MAAMA,IAAQC;AAAA,EACnB,CACE;AAAA,IACE,QAAAC;AAAA,IACA,QAAAC;AAAA,IACA,aAAAC;AAAA,IACA,qBAAAC,IAAsB;AAAA,IACtB,YAAAC;AAAA,IACA,OAAAC;AAAA,IACA,UAAAC;AAAA,IACA,OAAAC;AAAA,IACA,MAAAC;AAAA,IACA,aAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,OAAAC;AAAA,IACA,WAAAC;AAAA,IACA,cAAAC;AAAA,IACA,YAAAC,IAAa;AAAA,IACb,YAAAC,IAAa;AAAA,IACb,UAAAC;AAAA,IACA,SAAAC;AAAA,IACA,eAAeC;AAAA,KAEjBC,MACG;AACG,UAAAC,IAAWC,EAAyB,IAAI,GACxCC,IAAYD,EAAuB,IAAI,GACvCE,IAAYF,EAAuB,IAAI,GACvCG,IAAeH,EAAuB,IAAI,GAC1C,EAAE,WAAAI,MAAcC,KAChBC,IAAMR,KAAgBC;AAG5B,IAAAQ,EAAU,MAAM;AACV,UAAA,CAACJ,EAAa,QAAS;AAE3B,YAAMK,IAAc,MAAM;;AACxB,YAAIL,EAAa,SAAS;AAClB,gBAAAM,IAAiBN,EAAa,QAAQ,eAAe;AAC3D,UAAAA,EAAa,QAAQ,MAAM;AAAA,YACzB;AAAA,YACA,GAAGM,CAAc;AAAA,UAAA;AAAA,QAErB;AAEA,YAAIR,EAAU,SAAS;AACf,gBAAAS,IAAcT,EAAU,QAAQ,eAAe;AACrD,WAAAU,IAAAR,EAAa,YAAb,QAAAQ,EAAsB,MAAM;AAAA,YAC1B;AAAA,YACA,GAAGD,CAAW;AAAA;AAAA,QAElB;AAEA,YAAIR,EAAU,SAAS;AACf,gBAAAU,IAAcV,EAAU,QAAQ,eAAe;AACrD,WAAAW,IAAAV,EAAa,YAAb,QAAAU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A;AAAA,QACH;AAAA,MAAA,GAEJ;AAAA,MAECI,IACCmC,gBAAAA,EAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,WAAWC,EAAI,uBAAuB,oBAAoB;AAAA,UAC1D,IAAIJ;AAAA,UAEH,UAAAhC;AAAA,QAAA;AAAA,MAAA,IAEDH,KAAeC,MAAwB,WACzCqC,gBAAAA,EAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,IAAIF;AAAA,UACJ,WAAU;AAAA,UACV,aAAU;AAAA,UAET,UAAApC;AAAA,QAAA;AAAA,MAAA,IAED;AAAA,IACN,EAAA,CAAA;AAAA,EAEJ;AACF;AAEAJ,EAAM,cAAc;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../../node_modules/react/jsx-runtime.cjs.js"),x=require("react"),a=require("../../../utils/copy.cjs.js"),c=require("../BaseInput/Input.cjs.js");;/* empty css */const r=require("../../../utils/string.cjs.js");function l({name:o,value:e,isDisabled:p,onError:u,onSuccess:n}){const[i,s]=x.useState(!1);return t.jsxRuntimeExports.jsx(c.Input,{name:o,value:e,isDisabled:p,suffix:t.jsxRuntimeExports.jsx(j,{isCopied:i,onClick:async()=>{await a.copyTextToClipboard(e,u)&&(s(!0),n==null||n(),setTimeout(()=>s(!1),5e3))}})})}const j=({isCopied:o,onClick:e})=>t.jsxRuntimeExports.jsx("div",{className:"proton-CopyInput-button-container",onClick:e,children:t.jsxRuntimeExports.jsxs("button",{"data-testid":"COPY_BUTTON",className:r.csx("proton-CopyInput-button",o&&"proton-CopyInput-button--copied"),children:[t.jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 512 512",children:[t.jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M408 480H184a72 72 0 0 1-72-72V184a72 72 0 0 1 72-72h224a72 72 0 0 1 72 72v224a72 72 0 0 1-72 72"}),t.jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M160 80h235.88A72.12 72.12 0 0 0 328 32H104a72 72 0 0 0-72 72v224a72.12 72.12 0 0 0 48 67.88V160a80 80 0 0 1 80-80"})]}),t.jsxRuntimeExports.jsx("span",{className:r.csx("proton-CopyInput-button-text",o&&"proton-CopyInput-button-text--copied"),children:o?"Copied!":"Copy"})]})});exports.CopyInput=l;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../../node_modules/react/jsx-runtime.cjs.js"),x=require("react"),c=require("../../../utils/copy.cjs.js"),a=require("../BaseInput/Input.cjs.js");;/* empty css */const r=require("../../../utils/string.cjs.js");function l({name:o,value:e,isDisabled:p,onError:i,onSuccess:n}){const[u,s]=x.useState(!1);return t.jsxRuntimeExports.jsx(a.Input,{name:o,value:e,isDisabled:p,suffix:t.jsxRuntimeExports.jsx(j,{isCopied:u,onClick:async()=>{console.log("copy button clicked",{value:e}),await c.copyTextToClipboard(e,i)&&(s(!0),n==null||n(),setTimeout(()=>s(!1),5e3))}})})}const j=({isCopied:o,onClick:e})=>t.jsxRuntimeExports.jsx("div",{className:"proton-CopyInput-button-container",onClick:e,children:t.jsxRuntimeExports.jsxs("button",{"data-testid":"COPY_BUTTON",className:r.csx("proton-CopyInput-button",o&&"proton-CopyInput-button--copied"),children:[t.jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 512 512",children:[t.jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M408 480H184a72 72 0 0 1-72-72V184a72 72 0 0 1 72-72h224a72 72 0 0 1 72 72v224a72 72 0 0 1-72 72"}),t.jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M160 80h235.88A72.12 72.12 0 0 0 328 32H104a72 72 0 0 0-72 72v224a72.12 72.12 0 0 0 48 67.88V160a80 80 0 0 1 80-80"})]}),t.jsxRuntimeExports.jsx("span",{className:r.csx("proton-CopyInput-button-text",o&&"proton-CopyInput-button-text--copied"),children:o?"Copied!":"Copy"})]})});exports.CopyInput=l;
2
2
  //# sourceMappingURL=CopyInput.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CopyInput.cjs.js","sources":["../../../../src/components/Input/CopyInput/CopyInput.tsx"],"sourcesContent":["import { useState } from \"react\";\nimport { csx } from \"../../../utils\";\nimport { copyTextToClipboard } from \"../../../utils/copy\";\nimport { Input } from \"../BaseInput/Input\";\nimport \"./CopyInput.css\";\n\nexport interface CopyInputProps {\n /** The name of the input field */\n name: string;\n\n /** The value to display in the input and copy to clipboard */\n value: string;\n\n /** Whether the input is disabled */\n isDisabled?: boolean;\n\n /** Optional callback when copy fails, receives the error object */\n onError?: (error: Error) => void;\n\n /** Optional callback when copy succeeds */\n onSuccess?: () => void;\n}\n\n/**\n * Input with a button to copy value to the clipboard.\n *\n * API:\n * - {@link CopyInputProps}\n */\nexport function CopyInput({\n name,\n value,\n isDisabled,\n onError,\n onSuccess,\n}: CopyInputProps) {\n const [isCopied, setCopied] = useState(false);\n\n return (\n <Input\n name={name}\n value={value}\n isDisabled={isDisabled}\n suffix={\n <CopyButton\n isCopied={isCopied}\n onClick={async () => {\n const copySuccess = await copyTextToClipboard(value, onError);\n if (!copySuccess) return;\n\n setCopied(true);\n onSuccess?.();\n setTimeout(() => setCopied(false), 5000);\n }}\n />\n }\n />\n );\n}\n\nconst CopyButton = ({ isCopied, onClick }) => {\n return (\n <div className=\"proton-CopyInput-button-container\" onClick={onClick}>\n <button\n data-testid=\"COPY_BUTTON\"\n className={csx(\n \"proton-CopyInput-button\",\n isCopied && \"proton-CopyInput-button--copied\"\n )}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 512 512\"\n >\n <path\n fill=\"currentColor\"\n d=\"M408 480H184a72 72 0 0 1-72-72V184a72 72 0 0 1 72-72h224a72 72 0 0 1 72 72v224a72 72 0 0 1-72 72\"\n />\n <path\n fill=\"currentColor\"\n d=\"M160 80h235.88A72.12 72.12 0 0 0 328 32H104a72 72 0 0 0-72 72v224a72.12 72.12 0 0 0 48 67.88V160a80 80 0 0 1 80-80\"\n />\n </svg>\n <span\n className={csx(\n \"proton-CopyInput-button-text\",\n isCopied && \"proton-CopyInput-button-text--copied\"\n )}\n >\n {isCopied ? \"Copied!\" : \"Copy\"}\n </span>\n </button>\n </div>\n );\n};\n"],"names":["CopyInput","name","value","isDisabled","onError","onSuccess","isCopied","setCopied","useState","jsx","Input","CopyButton","copyTextToClipboard","onClick","jsxs","csx"],"mappings":"sUA6BO,SAASA,EAAU,CACxB,KAAAC,EACA,MAAAC,EACA,WAAAC,EACA,QAAAC,EACA,UAAAC,CACF,EAAmB,CACjB,KAAM,CAACC,EAAUC,CAAS,EAAIC,EAAAA,SAAS,EAAK,EAE5C,OACEC,EAAAA,kBAAAA,IAACC,EAAAA,MAAA,CACC,KAAAT,EACA,MAAAC,EACA,WAAAC,EACA,OACEM,EAAAA,kBAAAA,IAACE,EAAA,CACC,SAAAL,EACA,QAAS,SAAY,CACC,MAAMM,sBAAoBV,EAAOE,CAAO,IAG5DG,EAAU,EAAI,EACdF,GAAA,MAAAA,IACA,WAAW,IAAME,EAAU,EAAK,EAAG,GAAI,EACzC,CAAA,CAAA,CACF,CAAA,CAIR,CAEA,MAAMI,EAAa,CAAC,CAAE,SAAAL,EAAU,QAAAO,KAE5BJ,EAAAA,kBAAAA,IAAC,MAAA,CAAI,UAAU,oCAAoC,QAAAI,EACjD,SAAAC,EAAAA,kBAAAA,KAAC,SAAA,CACC,cAAY,cACZ,UAAWC,EAAAA,IACT,0BACAT,GAAY,iCAAA,EAGd,SAAA,CAAAQ,EAAAA,kBAAAA,KAAC,MAAA,CACC,MAAM,6BACN,MAAM,KACN,OAAO,KACP,QAAQ,cAER,SAAA,CAAAL,EAAAA,kBAAAA,IAAC,OAAA,CACC,KAAK,eACL,EAAE,kGAAA,CAAA,EAEJA,EAAAA,kBAAAA,IAAC,OAAA,CACC,KAAK,eACL,EAAE,oHAAA,CAAA,CACJ,CAAA,CAAA,EAEFA,EAAAA,kBAAAA,IAAC,OAAA,CACC,UAAWM,EAAAA,IACT,+BACAT,GAAY,sCAAA,EAGb,WAAW,UAAY,MAAA,CAAA,CAC1B,CAAA,CAAA,EAEJ"}
1
+ {"version":3,"file":"CopyInput.cjs.js","sources":["../../../../src/components/Input/CopyInput/CopyInput.tsx"],"sourcesContent":["import { useState } from \"react\";\nimport { csx } from \"../../../utils\";\nimport { copyTextToClipboard } from \"../../../utils/copy\";\nimport { Input } from \"../BaseInput/Input\";\nimport \"./CopyInput.css\";\n\nexport interface CopyInputProps {\n /** The name of the input field */\n name: string;\n\n /** The value to display in the input and copy to clipboard */\n value: string;\n\n /** Whether the input is disabled */\n isDisabled?: boolean;\n\n /** Optional callback when copy fails, receives the error object */\n onError?: (error: Error) => void;\n\n /** Optional callback when copy succeeds */\n onSuccess?: () => void;\n}\n\n/**\n * Input with a button to copy value to the clipboard.\n *\n * API:\n * - {@link CopyInputProps}\n */\nexport function CopyInput({\n name,\n value,\n isDisabled,\n onError,\n onSuccess,\n}: CopyInputProps) {\n const [isCopied, setCopied] = useState(false);\n\n return (\n <Input\n name={name}\n value={value}\n isDisabled={isDisabled}\n suffix={\n <CopyButton\n isCopied={isCopied}\n onClick={async () => {\n console.log(\"copy button clicked\", { value})\n\n const copySuccess = await copyTextToClipboard(value, onError);\n if (!copySuccess) return;\n\n setCopied(true);\n onSuccess?.();\n setTimeout(() => setCopied(false), 5000);\n }}\n />\n }\n />\n );\n}\n\nconst CopyButton = ({ isCopied, onClick }) => {\n return (\n <div className=\"proton-CopyInput-button-container\" onClick={onClick}>\n <button\n data-testid=\"COPY_BUTTON\"\n className={csx(\n \"proton-CopyInput-button\",\n isCopied && \"proton-CopyInput-button--copied\"\n )}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 512 512\"\n >\n <path\n fill=\"currentColor\"\n d=\"M408 480H184a72 72 0 0 1-72-72V184a72 72 0 0 1 72-72h224a72 72 0 0 1 72 72v224a72 72 0 0 1-72 72\"\n />\n <path\n fill=\"currentColor\"\n d=\"M160 80h235.88A72.12 72.12 0 0 0 328 32H104a72 72 0 0 0-72 72v224a72.12 72.12 0 0 0 48 67.88V160a80 80 0 0 1 80-80\"\n />\n </svg>\n <span\n className={csx(\n \"proton-CopyInput-button-text\",\n isCopied && \"proton-CopyInput-button-text--copied\"\n )}\n >\n {isCopied ? \"Copied!\" : \"Copy\"}\n </span>\n </button>\n </div>\n );\n};\n"],"names":["CopyInput","name","value","isDisabled","onError","onSuccess","isCopied","setCopied","useState","jsx","Input","CopyButton","copyTextToClipboard","onClick","jsxs","csx"],"mappings":"sUA6BO,SAASA,EAAU,CACxB,KAAAC,EACA,MAAAC,EACA,WAAAC,EACA,QAAAC,EACA,UAAAC,CACF,EAAmB,CACjB,KAAM,CAACC,EAAUC,CAAS,EAAIC,WAAS,EAAK,EAG1C,OAAAC,EAAA,kBAAA,IAACC,EAAA,MAAA,CACC,KAAAT,EACA,MAAAC,EACA,WAAAC,EACA,OACEM,EAAA,kBAAA,IAACE,EAAA,CACC,SAAAL,EACA,QAAS,SAAY,CACnB,QAAQ,IAAI,sBAAuB,CAAE,MAAAJ,CAAM,CAAA,EAEvB,MAAMU,EAAAA,oBAAoBV,EAAOE,CAAO,IAG5DG,EAAU,EAAI,EACFF,GAAA,MAAAA,IACZ,WAAW,IAAME,EAAU,EAAK,EAAG,GAAI,EACzC,CAAA,CACF,CAAA,CAAA,CAIR,CAEA,MAAMI,EAAa,CAAC,CAAE,SAAAL,EAAU,QAAAO,KAE3BJ,EAAAA,kBAAAA,IAAA,MAAA,CAAI,UAAU,oCAAoC,QAAAI,EACjD,SAAAC,EAAA,kBAAA,KAAC,SAAA,CACC,cAAY,cACZ,UAAWC,EAAA,IACT,0BACAT,GAAY,iCACd,EAEA,SAAA,CAAAQ,EAAA,kBAAA,KAAC,MAAA,CACC,MAAM,6BACN,MAAM,KACN,OAAO,KACP,QAAQ,cAER,SAAA,CAAAL,EAAA,kBAAA,IAAC,OAAA,CACC,KAAK,eACL,EAAE,kGAAA,CACJ,EACAA,EAAA,kBAAA,IAAC,OAAA,CACC,KAAK,eACL,EAAE,oHAAA,CACJ,CAAA,CAAA,CACF,EACAA,EAAA,kBAAA,IAAC,OAAA,CACC,UAAWM,EAAA,IACT,+BACAT,GAAY,sCACd,EAEC,WAAW,UAAY,MAAA,CAC1B,CAAA,CAAA,CAEJ,CAAA,CAAA"}
@@ -1,7 +1,7 @@
1
1
  import { j as t } from "../../../node_modules/react/jsx-runtime.es.js";
2
- import { useState as u } from "react";
3
- import { copyTextToClipboard as c } from "../../../utils/copy.es.js";
4
- import { Input as x } from "../BaseInput/Input.es.js";
2
+ import { useState as c } from "react";
3
+ import { copyTextToClipboard as u } from "../../../utils/copy.es.js";
4
+ import { Input as l } from "../BaseInput/Input.es.js";
5
5
  /* empty css */
6
6
  import { csx as e } from "../../../utils/string.es.js";
7
7
  function b({
@@ -9,28 +9,28 @@ function b({
9
9
  value: p,
10
10
  isDisabled: s,
11
11
  onError: i,
12
- onSuccess: r
12
+ onSuccess: n
13
13
  }) {
14
- const [a, n] = u(!1);
14
+ const [a, r] = c(!1);
15
15
  return /* @__PURE__ */ t.jsx(
16
- x,
16
+ l,
17
17
  {
18
18
  name: o,
19
19
  value: p,
20
20
  isDisabled: s,
21
21
  suffix: /* @__PURE__ */ t.jsx(
22
- l,
22
+ x,
23
23
  {
24
24
  isCopied: a,
25
25
  onClick: async () => {
26
- await c(p, i) && (n(!0), r == null || r(), setTimeout(() => n(!1), 5e3));
26
+ console.log("copy button clicked", { value: p }), await u(p, i) && (r(!0), n == null || n(), setTimeout(() => r(!1), 5e3));
27
27
  }
28
28
  }
29
29
  )
30
30
  }
31
31
  );
32
32
  }
33
- const l = ({ isCopied: o, onClick: p }) => /* @__PURE__ */ t.jsx("div", { className: "proton-CopyInput-button-container", onClick: p, children: /* @__PURE__ */ t.jsxs(
33
+ const x = ({ isCopied: o, onClick: p }) => /* @__PURE__ */ t.jsx("div", { className: "proton-CopyInput-button-container", onClick: p, children: /* @__PURE__ */ t.jsxs(
34
34
  "button",
35
35
  {
36
36
  "data-testid": "COPY_BUTTON",
@@ -1 +1 @@
1
- {"version":3,"file":"CopyInput.es.js","sources":["../../../../src/components/Input/CopyInput/CopyInput.tsx"],"sourcesContent":["import { useState } from \"react\";\nimport { csx } from \"../../../utils\";\nimport { copyTextToClipboard } from \"../../../utils/copy\";\nimport { Input } from \"../BaseInput/Input\";\nimport \"./CopyInput.css\";\n\nexport interface CopyInputProps {\n /** The name of the input field */\n name: string;\n\n /** The value to display in the input and copy to clipboard */\n value: string;\n\n /** Whether the input is disabled */\n isDisabled?: boolean;\n\n /** Optional callback when copy fails, receives the error object */\n onError?: (error: Error) => void;\n\n /** Optional callback when copy succeeds */\n onSuccess?: () => void;\n}\n\n/**\n * Input with a button to copy value to the clipboard.\n *\n * API:\n * - {@link CopyInputProps}\n */\nexport function CopyInput({\n name,\n value,\n isDisabled,\n onError,\n onSuccess,\n}: CopyInputProps) {\n const [isCopied, setCopied] = useState(false);\n\n return (\n <Input\n name={name}\n value={value}\n isDisabled={isDisabled}\n suffix={\n <CopyButton\n isCopied={isCopied}\n onClick={async () => {\n const copySuccess = await copyTextToClipboard(value, onError);\n if (!copySuccess) return;\n\n setCopied(true);\n onSuccess?.();\n setTimeout(() => setCopied(false), 5000);\n }}\n />\n }\n />\n );\n}\n\nconst CopyButton = ({ isCopied, onClick }) => {\n return (\n <div className=\"proton-CopyInput-button-container\" onClick={onClick}>\n <button\n data-testid=\"COPY_BUTTON\"\n className={csx(\n \"proton-CopyInput-button\",\n isCopied && \"proton-CopyInput-button--copied\"\n )}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 512 512\"\n >\n <path\n fill=\"currentColor\"\n d=\"M408 480H184a72 72 0 0 1-72-72V184a72 72 0 0 1 72-72h224a72 72 0 0 1 72 72v224a72 72 0 0 1-72 72\"\n />\n <path\n fill=\"currentColor\"\n d=\"M160 80h235.88A72.12 72.12 0 0 0 328 32H104a72 72 0 0 0-72 72v224a72.12 72.12 0 0 0 48 67.88V160a80 80 0 0 1 80-80\"\n />\n </svg>\n <span\n className={csx(\n \"proton-CopyInput-button-text\",\n isCopied && \"proton-CopyInput-button-text--copied\"\n )}\n >\n {isCopied ? \"Copied!\" : \"Copy\"}\n </span>\n </button>\n </div>\n );\n};\n"],"names":["CopyInput","name","value","isDisabled","onError","onSuccess","isCopied","setCopied","useState","jsx","Input","CopyButton","copyTextToClipboard","onClick","jsxs","csx"],"mappings":";;;;;;AA6BO,SAASA,EAAU;AAAA,EACxB,MAAAC;AAAA,EACA,OAAAC;AAAA,EACA,YAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC;AACF,GAAmB;AACjB,QAAM,CAACC,GAAUC,CAAS,IAAIC,EAAS,EAAK;AAE5C,SACEC,gBAAAA,EAAAA;AAAAA,IAACC;AAAA,IAAA;AAAA,MACC,MAAAT;AAAA,MACA,OAAAC;AAAA,MACA,YAAAC;AAAA,MACA,QACEM,gBAAAA,EAAAA;AAAAA,QAACE;AAAA,QAAA;AAAA,UACC,UAAAL;AAAA,UACA,SAAS,YAAY;AAEnB,YADoB,MAAMM,EAAoBV,GAAOE,CAAO,MAG5DG,EAAU,EAAI,GACdF,KAAA,QAAAA,KACA,WAAW,MAAME,EAAU,EAAK,GAAG,GAAI;AAAA,UACzC;AAAA,QAAA;AAAA,MAAA;AAAA,IACF;AAAA,EAAA;AAIR;AAEA,MAAMI,IAAa,CAAC,EAAE,UAAAL,GAAU,SAAAO,QAE5BJ,gBAAAA,EAAAA,IAAC,OAAA,EAAI,WAAU,qCAAoC,SAAAI,GACjD,UAAAC,gBAAAA,EAAAA;AAAAA,EAAC;AAAA,EAAA;AAAA,IACC,eAAY;AAAA,IACZ,WAAWC;AAAA,MACT;AAAA,MACAT,KAAY;AAAA,IAAA;AAAA,IAGd,UAAA;AAAA,MAAAQ,gBAAAA,EAAAA;AAAAA,QAAC;AAAA,QAAA;AAAA,UACC,OAAM;AAAA,UACN,OAAM;AAAA,UACN,QAAO;AAAA,UACP,SAAQ;AAAA,UAER,UAAA;AAAA,YAAAL,gBAAAA,EAAAA;AAAAA,cAAC;AAAA,cAAA;AAAA,gBACC,MAAK;AAAA,gBACL,GAAE;AAAA,cAAA;AAAA,YAAA;AAAA,YAEJA,gBAAAA,EAAAA;AAAAA,cAAC;AAAA,cAAA;AAAA,gBACC,MAAK;AAAA,gBACL,GAAE;AAAA,cAAA;AAAA,YAAA;AAAA,UACJ;AAAA,QAAA;AAAA,MAAA;AAAA,MAEFA,gBAAAA,EAAAA;AAAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAWM;AAAA,YACT;AAAA,YACAT,KAAY;AAAA,UAAA;AAAA,UAGb,cAAW,YAAY;AAAA,QAAA;AAAA,MAAA;AAAA,IAC1B;AAAA,EAAA;AAAA,GAEJ;"}
1
+ {"version":3,"file":"CopyInput.es.js","sources":["../../../../src/components/Input/CopyInput/CopyInput.tsx"],"sourcesContent":["import { useState } from \"react\";\nimport { csx } from \"../../../utils\";\nimport { copyTextToClipboard } from \"../../../utils/copy\";\nimport { Input } from \"../BaseInput/Input\";\nimport \"./CopyInput.css\";\n\nexport interface CopyInputProps {\n /** The name of the input field */\n name: string;\n\n /** The value to display in the input and copy to clipboard */\n value: string;\n\n /** Whether the input is disabled */\n isDisabled?: boolean;\n\n /** Optional callback when copy fails, receives the error object */\n onError?: (error: Error) => void;\n\n /** Optional callback when copy succeeds */\n onSuccess?: () => void;\n}\n\n/**\n * Input with a button to copy value to the clipboard.\n *\n * API:\n * - {@link CopyInputProps}\n */\nexport function CopyInput({\n name,\n value,\n isDisabled,\n onError,\n onSuccess,\n}: CopyInputProps) {\n const [isCopied, setCopied] = useState(false);\n\n return (\n <Input\n name={name}\n value={value}\n isDisabled={isDisabled}\n suffix={\n <CopyButton\n isCopied={isCopied}\n onClick={async () => {\n console.log(\"copy button clicked\", { value})\n\n const copySuccess = await copyTextToClipboard(value, onError);\n if (!copySuccess) return;\n\n setCopied(true);\n onSuccess?.();\n setTimeout(() => setCopied(false), 5000);\n }}\n />\n }\n />\n );\n}\n\nconst CopyButton = ({ isCopied, onClick }) => {\n return (\n <div className=\"proton-CopyInput-button-container\" onClick={onClick}>\n <button\n data-testid=\"COPY_BUTTON\"\n className={csx(\n \"proton-CopyInput-button\",\n isCopied && \"proton-CopyInput-button--copied\"\n )}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 512 512\"\n >\n <path\n fill=\"currentColor\"\n d=\"M408 480H184a72 72 0 0 1-72-72V184a72 72 0 0 1 72-72h224a72 72 0 0 1 72 72v224a72 72 0 0 1-72 72\"\n />\n <path\n fill=\"currentColor\"\n d=\"M160 80h235.88A72.12 72.12 0 0 0 328 32H104a72 72 0 0 0-72 72v224a72.12 72.12 0 0 0 48 67.88V160a80 80 0 0 1 80-80\"\n />\n </svg>\n <span\n className={csx(\n \"proton-CopyInput-button-text\",\n isCopied && \"proton-CopyInput-button-text--copied\"\n )}\n >\n {isCopied ? \"Copied!\" : \"Copy\"}\n </span>\n </button>\n </div>\n );\n};\n"],"names":["CopyInput","name","value","isDisabled","onError","onSuccess","isCopied","setCopied","useState","jsx","Input","CopyButton","copyTextToClipboard","onClick","jsxs","csx"],"mappings":";;;;;;AA6BO,SAASA,EAAU;AAAA,EACxB,MAAAC;AAAA,EACA,OAAAC;AAAA,EACA,YAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC;AACF,GAAmB;AACjB,QAAM,CAACC,GAAUC,CAAS,IAAIC,EAAS,EAAK;AAG1C,SAAAC,gBAAAA,EAAA;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,MAAAT;AAAA,MACA,OAAAC;AAAA,M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"version":3,"file":"SearchInput.cjs.js","sources":["../../../../src/components/Input/SearchInput/SearchInput.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useRef, useState } from \"react\";\nimport \"./SearchInput.css\";\nimport { csx } from \"../../../utils\";\nimport { Input, type BaseInputProps } from \"../BaseInput/Input\";\n\nexport interface SearchInputProps\n extends Omit<\n BaseInputProps,\n | \"prefix\"\n | \"suffix\"\n | \"value\"\n | \"onChange\"\n | \"description\"\n | \"descriptionPosition\"\n | \"label\"\n > {\n /** The initial value of the input. */\n defaultValue?: string;\n\n /** Should the clear button be shown when there is text? */\n isClearable?: boolean;\n\n /** Called when the input value changes. */\n onChange?: (value: string) => void;\n\n /** Called when the clear button is clicked. */\n onClear?: () => void;\n\n /** The current value of the input (for controlled usage) */\n value?: string;\n}\n\n/**\n * A search input component with optional clear functionality and URL parameter sync.\n *\n * API:\n * - {@link SearchInputProps}\n * - extends {@link BaseInputProps}\n */\nexport const SearchInput = ({\n name = \"search\",\n placeholder = \"Search...\",\n autoComplete,\n isClearable = true,\n isDisabled = false,\n error,\n defaultValue,\n value: controlledValue,\n \"data-testid\": testId = \"proton-SearchInput\",\n onChange,\n onClear,\n}: SearchInputProps) => {\n const inputRef = useRef<HTMLInputElement>(null);\n const [value, setValue] = useState(controlledValue ?? defaultValue ?? \"\");\n\n // Sync with controlled value if provided\n useEffect(() => {\n if (controlledValue !== undefined) {\n setValue(controlledValue);\n }\n }, [controlledValue]);\n\n const handleChange = (newValue: string) => {\n setValue(newValue);\n onChange?.(newValue);\n };\n\n const handleClear = () => {\n setValue(\"\");\n onChange?.(\"\");\n onClear?.();\n inputRef.current?.focus();\n };\n\n return (\n <div\n className=\"proton-SearchInput__wrapper\"\n data-testid={testId}\n role=\"search\"\n >\n <Input\n type=\"search\"\n onChange={handleChange}\n value={value}\n name={name}\n placeholder={placeholder}\n autoComplete={autoComplete}\n error={error}\n ref={inputRef}\n isDisabled={isDisabled}\n prefix={\n <svg\n aria-hidden=\"true\"\n width=\"2.8em\"\n height=\"1.6em\"\n viewBox=\"0 0 24 24\"\n onClick={() => inputRef.current?.focus()}\n >\n <title>Magnifying Glass</title>\n <path\n fill=\"currentColor\"\n d=\"M10.5 18.5a8 8 0 1 1 0-16 8 8 0 0 1 0 16Zm0-1a7 7 0 1 0 0-14 7 7 0 0 0 0 14Zm5.25-.75 4.5 4.5-1.25 1.25-4.5-4.5 1.25-1.25Z\"\n />\n </svg>\n }\n suffix={\n isClearable && value.length > 0 ? (\n <button\n type=\"button\"\n className={csx(\n \"proton-SearchInput__button\",\n \"proton-Input__descriptor\",\n \"proton-Input__suffix\"\n )}\n data-testid={`${testId}-clear`}\n onClick={handleClear}\n aria-label=\"Clear search\"\n >\n <svg\n aria-hidden=\"true\"\n viewBox=\"0 0 50 50\"\n width=\"2.2em\"\n height=\"1.2em\"\n >\n <title>Clear</title>\n <path\n fill=\"currentColor\"\n d=\"m37.304 11.282l1.414 1.414l-26.022 26.02l-1.414-1.413z\"\n />\n <path\n fill=\"currentColor\"\n d=\"m12.696 11.282l26.022 26.02l-1.414 1.415l-26.022-26.02z\"\n />\n </svg>\n </button>\n ) : null\n }\n />\n </div>\n );\n};\n"],"names":["SearchInput","name","placeholder","autoComplete","isClearable","isDisabled","error","defaultValue","controlledValue","testId","onChange","onClear","inputRef","useRef","value","setValue","useState","useEffect","handleChange","newValue","handleClear","_a","jsx","Input","jsxs","csx"],"mappings":"gSAyCaA,EAAc,CAAC,CAC1B,KAAAC,EAAO,SACP,YAAAC,EAAc,YACd,aAAAC,EACA,YAAAC,EAAc,GACd,WAAAC,EAAa,GACb,MAAAC,EACA,aAAAC,EACA,MAAOC,EACP,cAAeC,EAAS,qBACxB,SAAAC,EACA,QAAAC,CACF,IAAwB,CACtB,MAAMC,EAAWC,EAAAA,OAAyB,IAAI,EACxC,CAACC,EAAOC,CAAQ,EAAIC,EAAAA,SAASR,GAAmBD,GAAgB,EAAE,EAGxEU,EAAAA,UAAU,IAAM,CACVT,IAAoB,QACt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K,eACL,EAAE,yDAAA,CAAA,CACJ,CAAA,CAAA,CACF,CAAA,EAEA,IAAA,CAAA,CAER,CAAA,CAGN"}
1
+ {"version":3,"file":"SearchInput.cjs.js","sources":["../../../../src/components/Input/SearchInput/SearchInput.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useRef, useState } from \"react\";\nimport \"./SearchInput.css\";\nimport { csx } from \"../../../utils\";\nimport { Input, type BaseInputProps } from \"../BaseInput/Input\";\n\nexport interface SearchInputProps\n extends Omit<\n BaseInputProps,\n | \"prefix\"\n | \"suffix\"\n | \"value\"\n | \"onChange\"\n | \"description\"\n | \"descriptionPosition\"\n | \"label\"\n > {\n /** The initial value of the input. */\n defaultValue?: string;\n\n /** Should the clear button be shown when there is text? */\n isClearable?: boolean;\n\n /** Called when the input value changes. */\n onChange?: (value: string) => void;\n\n /** Called when the clear button is clicked. */\n onClear?: () => void;\n\n /** The current value of the input (for controlled usage) */\n value?: string;\n}\n\n/**\n * A search input component with optional clear functionality and URL parameter sync.\n *\n * API:\n * - {@link SearchInputProps}\n * - extends {@link BaseInputProps}\n */\nexport const SearchInput = ({\n name = \"search\",\n placeholder = \"Search...\",\n autoComplete,\n isClearable = true,\n isDisabled = false,\n error,\n defaultValue,\n value: controlledValue,\n \"data-testid\": testId = \"proton-SearchInput\",\n onChange,\n onClear,\n}: SearchInputProps) => {\n const inputRef = useRef<HTMLInputElement>(null);\n const [value, setValue] = useState(controlledValue ?? defaultValue ?? \"\");\n\n // Sync with controlled value if provided\n useEffect(() => {\n if (controlledValue !== undefined) {\n setValue(controlledValue);\n }\n }, [controlledValue]);\n\n const handleChange = (newValue: string) => {\n setValue(newValue);\n onChange?.(newValue);\n };\n\n const handleClear = () => {\n setValue(\"\");\n onChange?.(\"\");\n onClear?.();\n inputRef.current?.focus();\n };\n\n return (\n <div\n className=\"proton-SearchInput__wrapper\"\n data-testid={testId}\n role=\"search\"\n >\n <Input\n type=\"search\"\n onChange={handleChange}\n value={value}\n name={name}\n placeholder={placeholder}\n autoComplete={autoComplete}\n error={error}\n ref={inputRef}\n isDisabled={isDisabled}\n prefix={\n <svg\n aria-hidden=\"true\"\n width=\"2.8em\"\n height=\"1.6em\"\n viewBox=\"0 0 24 24\"\n onClick={() => inputRef.current?.focus()}\n >\n <title>Magnifying Glass</title>\n <path\n fill=\"currentColor\"\n d=\"M10.5 18.5a8 8 0 1 1 0-16 8 8 0 0 1 0 16Zm0-1a7 7 0 1 0 0-14 7 7 0 0 0 0 14Zm5.25-.75 4.5 4.5-1.25 1.25-4.5-4.5 1.25-1.25Z\"\n />\n </svg>\n }\n suffix={\n isClearable && value.length > 0 ? (\n <button\n type=\"button\"\n className={csx(\n \"proton-SearchInput__button\",\n \"proton-Input__descriptor\",\n \"proton-Input__suffix\"\n )}\n data-testid={`${testId}-clear`}\n onClick={handleClear}\n aria-label=\"Clear search\"\n >\n <svg\n aria-hidden=\"true\"\n viewBox=\"0 0 50 50\"\n width=\"2.2em\"\n height=\"1.2em\"\n >\n <title>Clear</title>\n <path\n fill=\"currentColor\"\n d=\"m37.304 11.282l1.414 1.414l-26.022 26.02l-1.414-1.413z\"\n />\n <path\n fill=\"currentColor\"\n d=\"m12.696 11.282l26.022 26.02l-1.414 1.415l-26.022-26.02z\"\n />\n </svg>\n </button>\n ) : null\n }\n />\n </div>\n );\n};\n"],"names":["SearchInput","name","placeholder","autoComplete","isClearable","isDisabled","error","defaultValue","controlledValue","testId","onChange","onClear","inputRef","useRef","value","setValue","useState","useEffect","handleChange","newValue","handleClear","_a","jsx","Input","jsxs","csx"],"mappings":"gSAyCaA,EAAc,CAAC,CAC1B,KAAAC,EAAO,SACP,YAAAC,EAAc,YACd,aAAAC,EACA,YAAAC,EAAc,GACd,WAAAC,EAAa,GACb,MAAAC,EACA,aAAAC,EACA,MAAOC,EACP,cAAeC,EAAS,qBACxB,SAAAC,EACA,QAAAC,CACF,IAAwB,CAChB,MAAAC,EAAWC,SAAyB,IAAI,EACxC,CAACC,EAAOC,CA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K,eACL,EAAE,wDAAA,CACJ,EACAA,EAAA,kBAAA,IAAC,OAAA,CACC,KAAK,eACL,EAAE,yDAAA,CACJ,CAAA,CAAA,CACF,CAAA,CAAA,EAEA,IAAA,CAER,CAAA,CAAA,CAGN"}
@@ -1 +1 @@
1
- {"version":3,"file":"SearchInput.es.js","sources":["../../../../src/components/Input/SearchInput/SearchInput.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useRef, useState } from \"react\";\nimport \"./SearchInput.css\";\nimport { csx } from \"../../../utils\";\nimport { Input, type BaseInputProps } from \"../BaseInput/Input\";\n\nexport interface SearchInputProps\n extends Omit<\n BaseInputProps,\n | \"prefix\"\n | \"suffix\"\n | \"value\"\n | \"onChange\"\n | \"description\"\n | \"descriptionPosition\"\n | \"label\"\n > {\n /** The initial value of the input. */\n defaultValue?: string;\n\n /** Should the clear button be shown when there is text? */\n isClearable?: boolean;\n\n /** Called when the input value changes. */\n onChange?: (value: string) => void;\n\n /** Called when the clear button is clicked. */\n onClear?: () => void;\n\n /** The current value of the input (for controlled usage) */\n value?: string;\n}\n\n/**\n * A search input component with optional clear functionality and URL parameter sync.\n *\n * API:\n * - {@link SearchInputProps}\n * - extends {@link BaseInputProps}\n */\nexport const SearchInput = ({\n name = \"search\",\n placeholder = \"Search...\",\n autoComplete,\n isClearable = true,\n isDisabled = false,\n error,\n defaultValue,\n value: controlledValue,\n \"data-testid\": testId = \"proton-SearchInput\",\n onChange,\n onClear,\n}: SearchInputProps) => {\n const inputRef = useRef<HTMLInputElement>(null);\n const [value, setValue] = useState(controlledValue ?? defaultValue ?? \"\");\n\n // Sync with controlled value if provided\n useEffect(() => {\n if (controlledValue !== undefined) {\n setValue(controlledValue);\n }\n }, [controlledValue]);\n\n const handleChange = (newValue: string) => {\n setValue(newValue);\n onChange?.(newValue);\n };\n\n const handleClear = () => {\n setValue(\"\");\n onChange?.(\"\");\n onClear?.();\n inputRef.current?.focus();\n };\n\n return (\n <div\n className=\"proton-SearchInput__wrapper\"\n data-testid={testId}\n role=\"search\"\n >\n <Input\n type=\"search\"\n onChange={handleChange}\n value={value}\n name={name}\n placeholder={placeholder}\n autoComplete={autoComplete}\n error={error}\n ref={inputRef}\n isDisabled={isDisabled}\n prefix={\n <svg\n aria-hidden=\"true\"\n width=\"2.8em\"\n height=\"1.6em\"\n viewBox=\"0 0 24 24\"\n onClick={() => inputRef.current?.focus()}\n >\n <title>Magnifying Glass</title>\n <path\n fill=\"currentColor\"\n d=\"M10.5 18.5a8 8 0 1 1 0-16 8 8 0 0 1 0 16Zm0-1a7 7 0 1 0 0-14 7 7 0 0 0 0 14Zm5.25-.75 4.5 4.5-1.25 1.25-4.5-4.5 1.25-1.25Z\"\n />\n </svg>\n }\n suffix={\n isClearable && value.length > 0 ? (\n <button\n type=\"button\"\n className={csx(\n \"proton-SearchInput__button\",\n \"proton-Input__descriptor\",\n \"proton-Input__suffix\"\n )}\n data-testid={`${testId}-clear`}\n onClick={handleClear}\n aria-label=\"Clear search\"\n >\n <svg\n aria-hidden=\"true\"\n viewBox=\"0 0 50 50\"\n width=\"2.2em\"\n height=\"1.2em\"\n >\n <title>Clear</title>\n <path\n fill=\"currentColor\"\n d=\"m37.304 11.282l1.414 1.414l-26.022 26.02l-1.414-1.413z\"\n />\n <path\n fill=\"currentColor\"\n d=\"m12.696 11.282l26.022 26.02l-1.414 1.415l-26.022-26.02z\"\n />\n </svg>\n </button>\n ) : null\n }\n />\n </div>\n );\n};\n"],"names":["SearchInput","name","placeholder","autoComplete","isClearable","isDisabled","error","defaultValue","controlledValue","testId","onChange","onClear","inputRef","useRef","value","setValue","useState","useEffect","handleChange","newValue","handleClear","_a","jsx","Input","jsxs","csx"],"mappings":";;;;;AAyCO,MAAMA,IAAc,CAAC;AAAA,EAC1B,MAAAC,IAAO;AAAA,EACP,aAAAC,IAAc;AAAA,EACd,cAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,YAAAC,IAAa;AAAA,EACb,OAAAC;AAAA,EACA,cA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,oBACL,GAAE;AAAA,kBAAA;AAAA,gBAAA;AAAA,cACJ;AAAA,YAAA;AAAA,UAAA;AAAA,UAGJ,QACElB,KAAeU,EAAM,SAAS,IAC5BQ,gBAAAA,EAAAA;AAAAA,YAAC;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,WAAWG;AAAA,gBACT;AAAA,gBACA;AAAA,gBACA;AAAA,cAAA;AAAA,cAEF,eAAa,GAAGhB,CAAM;AAAA,cACtB,SAASW;AAAA,cACT,cAAW;AAAA,cAEX,UAAAI,gBAAAA,EAAAA;AAAAA,gBAAC;AAAA,gBAAA;AAAA,kBACC,eAAY;AAAA,kBACZ,SAAQ;AAAA,kBACR,OAAM;AAAA,kBACN,QAAO;AAAA,kBAEP,UAAA;AAAA,oBAAAF,gBAAAA,EAAAA,IAAC,WAAM,UAAA,QAAA,CAAK;AAAA,oBACZA,gBAAAA,EAAAA;AAAAA,sBAAC;AAAA,sBAAA;AAAA,wBACC,MAAK;AAAA,wBACL,GAAE;AAAA,sBAAA;AAAA,oBAAA;AAAA,oBAEJA,gBAAAA,EAAAA;AAAAA,sBAAC;AAAA,sBAAA;AAAA,wBACC,MAAK;AAAA,wBACL,GAAE;AAAA,sBAAA;AAAA,oBAAA;AAAA,kBACJ;AAAA,gBAAA;AAAA,cAAA;AAAA,YACF;AAAA,UAAA,IAEA;AAAA,QAAA;AAAA,MAAA;AAAA,IAER;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"SearchInput.es.js","sources":["../../../../src/components/Input/SearchInput/SearchInput.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useRef, useState } from \"react\";\nimport \"./SearchInput.css\";\nimport { csx } from \"../../../utils\";\nimport { Input, type BaseInputProps } from \"../BaseInput/Input\";\n\nexport interface SearchInputProps\n extends Omit<\n BaseInputProps,\n | \"prefix\"\n | \"suffix\"\n | \"value\"\n | \"onChange\"\n | \"description\"\n | \"descriptionPosition\"\n | \"label\"\n > {\n /** The initial value of the input. */\n defaultValue?: string;\n\n /** Should the clear button be shown when there is text? */\n isClearable?: boolean;\n\n /** Called when the input value changes. */\n onChange?: (value: string) => void;\n\n /** Called when the clear button is clicked. */\n onClear?: () => void;\n\n /** The current value of the input (for controlled usage) */\n value?: string;\n}\n\n/**\n * A search input component with optional clear functionality and URL parameter sync.\n *\n * API:\n * - {@link SearchInputProps}\n * - extends {@link BaseInputProps}\n */\nexport const SearchInput = ({\n name = \"search\",\n placeholder = \"Search...\",\n autoComplete,\n isClearable = true,\n isDisabled = false,\n error,\n defaultValue,\n value: controlledValue,\n \"data-testid\": testId = \"proton-SearchInput\",\n onChange,\n onClear,\n}: SearchInputProps) => {\n const inputRef = useRef<HTMLInputElement>(null);\n const [value, setValue] = useState(controlledValue ?? defaultValue ?? \"\");\n\n // Sync with controlled value if provided\n useEffect(() => {\n if (controlledValue !== undefined) {\n setValue(controlledValue);\n }\n }, [controlledValue]);\n\n const handleChange = (newValue: string) => {\n setValue(newValue);\n onChange?.(newValue);\n };\n\n const handleClear = () => {\n setValue(\"\");\n onChange?.(\"\");\n onClear?.();\n inputRef.current?.focus();\n };\n\n return (\n <div\n className=\"proton-SearchInput__wrapper\"\n data-testid={testId}\n role=\"search\"\n >\n <Input\n type=\"search\"\n onChange={handleChange}\n value={value}\n name={name}\n placeholder={placeholder}\n autoComplete={autoComplete}\n error={error}\n ref={inputRef}\n isDisabled={isDisabled}\n prefix={\n <svg\n aria-hidden=\"true\"\n width=\"2.8em\"\n height=\"1.6em\"\n viewBox=\"0 0 24 24\"\n onClick={() => inputRef.current?.focus()}\n >\n <title>Magnifying Glass</title>\n <path\n fill=\"currentColor\"\n d=\"M10.5 18.5a8 8 0 1 1 0-16 8 8 0 0 1 0 16Zm0-1a7 7 0 1 0 0-14 7 7 0 0 0 0 14Zm5.25-.75 4.5 4.5-1.25 1.25-4.5-4.5 1.25-1.25Z\"\n />\n </svg>\n }\n suffix={\n isClearable && value.length > 0 ? (\n <button\n type=\"button\"\n className={csx(\n \"proton-SearchInput__button\",\n \"proton-Input__descriptor\",\n \"proton-Input__suffix\"\n )}\n data-testid={`${testId}-clear`}\n onClick={handleClear}\n aria-label=\"Clear search\"\n >\n <svg\n aria-hidden=\"true\"\n viewBox=\"0 0 50 50\"\n width=\"2.2em\"\n height=\"1.2em\"\n >\n <title>Clear</title>\n <path\n fill=\"currentColor\"\n d=\"m37.304 11.282l1.414 1.414l-26.022 26.02l-1.414-1.413z\"\n />\n <path\n fill=\"currentColor\"\n d=\"m12.696 11.282l26.022 26.02l-1.414 1.415l-26.022-26.02z\"\n />\n </svg>\n </button>\n ) : null\n }\n />\n </div>\n );\n};\n"],"names":["SearchInput","name","placeholder","autoComplete","isClearable","isDisabled","error","defaultValue","controlledValue","testId","onChange","onClear","inputRef","useRef","value","setValue","useState","useEffect","handleChange","newValue","handleClear","_a","jsx","Input","jsxs","csx"],"mappings":";;;;;AAyCO,MAAMA,IAAc,CAAC;AAAA,EAC1B,MAAAC,IAAO;AAAA,EACP,aAAAC,IAAc;AAAA,EACd,cAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,YAAAC,IAAa;AAAA,EACb,OAAAC;AAAA,EACA,cAAAC;AAAA,EACA,OAAOC;AAAA,EACP,eAAeC,IAAS;AAAA,EACxB,UAAAC;AAAA,EACA,SAAAC;AACF,MAAwB;AAChB,QAAAC,IAAWC,EAAyB,IAAI,GACxC,CAACC,GAAOC,CAAQ,IAAIC,EAASR,KAAmBD,KAAgB,EAAE;AAGxE,EAAAU,EAAU,MAAM;AACd,IAAIT,MAAoB,UACtBO,EAASP,CAAe;AAAA,EAC1B,GACC,CAACA,CAAe,CAAC;AAEd,QAAAU,IAAe,CAACC,MAAqB;AACzC,IAAAJ,EAASI,CAAQ,GACjBT,KAAA,QAAAA,EAAWS;AAAA,EAAQ,GAGfC,IAAc,MAAM;;AACxB,IAAAL,EAAS,EAAE,GACXL,KAAA,QAAAA,EAAW,KACDC,KAAA,QAAAA,MACVU,IAAAT,EAAS,YAAT,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CAAA;AAAA,oBACZA,gBAAAA,EAAA;AAAA,sBAAC;AAAA,sBAAA;AAAA,wBACC,MAAK;AAAA,wBACL,GAAE;AAAA,sBAAA;AAAA,oBACJ;AAAA,oBACAA,gBAAAA,EAAA;AAAA,sBAAC;AAAA,sBAAA;AAAA,wBACC,MAAK;AAAA,wBACL,GAAE;AAAA,sBAAA;AAAA,oBACJ;AAAA,kBAAA;AAAA,gBAAA;AAAA,cACF;AAAA,YAAA;AAAA,UAAA,IAEA;AAAA,QAAA;AAAA,MAER;AAAA,IAAA;AAAA,EAAA;AAGN;"}
@@ -1 +1 @@
1
- {"version":3,"file":"MenuTrigger.cjs.js","sources":["../../../src/components/Menu/MenuTrigger.tsx"],"sourcesContent":["\"use client\";\n\nimport { ReactNode, useMemo, useRef, useState } from \"react\";\n\nimport { BREAKPOINTS } from \"../../constants\";\nimport { useBreakpoint } from \"../../hooks/useBreakpoint\";\nimport { ActionMenu, ActionMenuAction } from \"../ActionMenu/ActionMenu\";\nimport { PopoverMenu } from \"./PopoverMenu\";\n\nimport \"./MenuTrigger.css\";\nimport \"./Menu.css\";\n\nexport interface MenuTriggerProps {\n disabled?: boolean;\n isOpen?: boolean;\n setIsOpen: (isOpen: boolean) => void;\n}\n\nexport interface MenuProps {\n /** Custom trigger component. If not provided, defaults to ellipsis icon.\n * - @prop triggerProps {@link TriggerProps}\n */\n renderTrigger?: (triggerProps: MenuTriggerProps) => ReactNode;\n\n /** Size of the trigger icon\n * @default 24\n */\n size?: number;\n\n /** Title of the parent menu */\n title?: string;\n\n /** Array of menu actions/items to display\n * - type {@link ActionMenuAction}[]\n */\n items: ActionMenuAction[];\n\n /** Whether the menu is disabled\n * @default false\n */\n disabled?: boolean;\n\n /** Callback when the menu closes */\n onClose?: () => void;\n\n /** Test ID for the trigger button */\n triggerTestId?: string;\n\n /** Test ID for the menu */\n menuTestId?: string;\n\n /** Callback when the selection changes */\n onSelectionChange?: (key: string) => void;\n\n /** The key of the selected item */\n selectedKey?: string;\n\n /** The keys of the disabled items */\n disabledKeys?: string[];\n}\n\n/**\n * An uncontrolled component that displays either a popover menu or an action menu\n * depending on the screen size when the menu trigger is pressed.\n *\n * API:\n * - {@link MenuProps}\n */\nexport function MenuTrigger({\n renderTrigger,\n size = 24,\n title,\n items,\n disabled,\n onClose,\n triggerTestId = \"MenuTrigger-Trigger\",\n menuTestId,\n onSelectionChange,\n selectedKey,\n disabledKeys,\n}: MenuProps) {\n const isMobile = useBreakpoint(BREAKPOINTS.SMALL);\n const [isOpen, setIsOpen] = useState(false);\n const triggerRef = useRef<HTMLButtonElement>(null);\n\n const menuItems = useMemo(\n () => items.map((item) => ({ ...item, id: item.key })),\n [items]\n );\n\n const handleSelectionChange = (key: string) => {\n onSelectionChange?.(key);\n setIsOpen(false);\n };\n\n const triggerButton = renderTrigger ? (\n renderTrigger({\n isOpen,\n disabled,\n setIsOpen,\n })\n ) : (\n <button\n data-testid={triggerTestId}\n disabled={disabled}\n className=\"proton-MenuTrigger__button\"\n ref={triggerRef}\n onClick={() => setIsOpen(!isOpen)}\n type=\"button\"\n >\n <EllipsisIcon size={size} />\n </button>\n );\n\n if (isMobile) {\n return (\n <>\n {triggerButton}\n {isOpen && (\n <ActionMenu\n actions={menuItems}\n title={title}\n isOpen={isOpen}\n onClose={() => {\n setIsOpen(false);\n onClose?.();\n }}\n showCancel\n data-testid={menuTestId}\n selectionMode=\"single\"\n onSelectionChange={(keys) => {\n const nextKey = Array.from(keys)[0];\n if (nextKey) handleSelectionChange(nextKey as string);\n }}\n selectedKeys={selectedKey ? [selectedKey] : undefined}\n disabledKeys={disabledKeys}\n />\n )}\n </>\n );\n }\n\n return (\n <PopoverMenu\n trigger={triggerButton}\n items={menuItems}\n isOpen={isOpen}\n onOpenChange={setIsOpen}\n selectedKey={selectedKey}\n onSelectionChange={handleSelectionChange}\n disabledKeys={disabledKeys}\n title={title}\n />\n );\n}\n\nconst EllipsisIcon = ({ size }: { size: number }) => (\n <svg viewBox=\"0 0 24 24\" width={size} height={size}>\n <path\n fill=\"currentColor\"\n d=\"M4 14c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm8 0c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm8 0c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z\"\n />\n </svg>\n);\n"],"names":["MenuTrigger","renderTrigger","size","title","items","disabled","onClose","triggerTestId","menuTestId","onSelectionChange","selectedKey","disabledKeys","isMobile","useBreakpoint","BREAKPOINTS","isOpen","setIsOpen","useState","triggerRef","useRef","menuItems","useMemo","item","handleSelectionChange","key","triggerButton","jsx","EllipsisIcon","jsxs","Fragment","ActionMenu","keys","nextKey","PopoverMenu"],"mappings":"qZAoEO,SAASA,EAAY,CAC1B,cAAAC,EACA,KAAAC,EAAO,GACP,MAAAC,EACA,MAAAC,EACA,SAAAC,EACA,QAAAC,EACA,cAAAC,EAAgB,sBAChB,WAAAC,EACA,kBAAAC,EACA,YAAAC,EACA,aAAAC,CACF,EAAc,CACZ,MAAMC,EAAWC,EAAAA,cAAcC,EAAAA,YAAY,KAAK,EAC1C,CAACC,EAAQC,CAAS,EAAIC,EAAAA,SAAS,EAAK,EACpCC,EAAaC,EAAAA,OAA0B,IAAI,EAE3CC,EAAYC,EAAAA,QAChB,IAAMjB,EAAM,IAAKkB,IAAU,CAAE,GAAGA,EAAM,GAAIA,EAAK,GAAA,EAAM,EACrD,CAAClB,CAAK,CAAA,EAGFmB,EAAyBC,GAAgB,CAC7Cf,GAAA,MAAAA,EAAoBe,GACpBR,EAAU,EAAK,CACjB,EAEMS,EAAgBxB,EACpBA,EAAc,CACZ,OAAAc,EACA,SAAAV,EACA,UAAAW,CAAA,CACD,EAEDU,EAAAA,kBAAAA,IAAC,SAAA,CACC,cAAanB,EACb,SAAAF,EACA,UAAU,6BACV,IAAKa,EACL,QAAS,IAAMF,EAAU,CAACD,CAAM,EAChC,KAAK,SAEL,SAAAW,EAAAA,kBAAAA,IAACC,GAAa,KAAAzB,CAAA,CAAY,CAAA,CAAA,EAI9B,OAAIU,EAEAgB,EAAAA,kBAAAA,KAAAC,6BAAA,CACG,SAAA,CAAAJ,EACAV,GACCW,EAAAA,kBAAAA,IAACI,EAAAA,WAAA,CACC,QAASV,EACT,MAAAjB,EACA,OAAAY,EACA,QAAS,IAAM,CACbC,EAAU,EAAK,EACfV,GAAA,MAAAA,GACF,EACA,WAAU,GACV,cAAaE,EACb,cAAc,SACd,kBAAoBuB,GAAS,CAC3B,MAAMC,EAAU,MAAM,KAAKD,CAAI,EAAE,CAAC,EAC9BC,KAA+BA,CAAiB,CACtD,EACA,aAActB,EAAc,CAACA,CAAW,EAAI,OAC5C,aAAAC,CAAA,CAAA,CACF,EAEJ,EAKFe,EAAAA,kBAAAA,IAACO,EAAAA,YAAA,CACC,QAASR,EACT,MAAOL,EACP,OAAAL,EACA,aAAcC,EACd,YAAAN,EACA,kBAAmBa,EACnB,aAAAZ,EACA,MAAAR,CAAA,CAAA,CAGN,CAEA,MAAMwB,EAAe,CAAC,CAAE,KAAAzB,CAAA,IACtBwB,EAAAA,kBAAAA,IAAC,MAAA,CAAI,QAAQ,YAAY,MAAOxB,EAAM,OAAQA,EAC5C,SAAAwB,EAAAA,kBAAAA,IAAC,OAAA,CACC,KAAK,eACL,EAAE,mJAAA,CACJ,EACF"}
1
+ {"version":3,"file":"MenuTrigger.cjs.js","sources":["../../../src/components/Menu/MenuTrigger.tsx"],"sourcesContent":["\"use client\";\n\nimport { ReactNode, useMemo, useRef, useState } from \"react\";\n\nimport { BREAKPOINTS } from \"../../constants\";\nimport { useBreakpoint } from \"../../hooks/useBreakpoint\";\nimport { ActionMenu, ActionMenuAction } from \"../ActionMenu/ActionMenu\";\nimport { PopoverMenu } from \"./PopoverMenu\";\n\nimport \"./MenuTrigger.css\";\nimport \"./Menu.css\";\n\nexport interface MenuTriggerProps {\n disabled?: boolean;\n isOpen?: boolean;\n setIsOpen: (isOpen: boolean) => void;\n}\n\nexport interface MenuProps {\n /** Custom trigger component. If not provided, defaults to ellipsis icon.\n * - @prop triggerProps {@link TriggerProps}\n */\n renderTrigger?: (triggerProps: MenuTriggerProps) => ReactNode;\n\n /** Size of the trigger icon\n * @default 24\n */\n size?: number;\n\n /** Title of the parent menu */\n title?: string;\n\n /** Array of menu actions/items to display\n * - type {@link ActionMenuAction}[]\n */\n items: ActionMenuAction[];\n\n /** Whether the menu is disabled\n * @default false\n */\n disabled?: boolean;\n\n /** Callback when the menu closes */\n onClose?: () => void;\n\n /** Test ID for the trigger button */\n triggerTestId?: string;\n\n /** Test ID for the menu */\n menuTestId?: string;\n\n /** Callback when the selection changes */\n onSelectionChange?: (key: string) => void;\n\n /** The key of the selected item */\n selectedKey?: string;\n\n /** The keys of the disabled items */\n disabledKeys?: string[];\n}\n\n/**\n * An uncontrolled component that displays either a popover menu or an action menu\n * depending on the screen size when the menu trigger is pressed.\n *\n * API:\n * - {@link MenuProps}\n */\nexport function MenuTrigger({\n renderTrigger,\n size = 24,\n title,\n items,\n disabled,\n onClose,\n triggerTestId = \"MenuTrigger-Trigger\",\n menuTestId,\n onSelectionChange,\n selectedKey,\n disabledKeys,\n}: MenuProps) {\n const isMobile = useBreakpoint(BREAKPOINTS.SMALL);\n const [isOpen, setIsOpen] = useState(false);\n const triggerRef = useRef<HTMLButtonElement>(null);\n\n const menuItems = useMemo(\n () => items.map((item) => ({ ...item, id: item.key })),\n [items]\n );\n\n const handleSelectionChange = (key: string) => {\n onSelectionChange?.(key);\n setIsOpen(false);\n };\n\n const triggerButton = renderTrigger ? (\n renderTrigger({\n isOpen,\n disabled,\n setIsOpen,\n })\n ) : (\n <button\n data-testid={triggerTestId}\n disabled={disabled}\n className=\"proton-MenuTrigger__button\"\n ref={triggerRef}\n onClick={() => setIsOpen(!isOpen)}\n type=\"button\"\n >\n <EllipsisIcon size={size} />\n </button>\n );\n\n if (isMobile) {\n return (\n <>\n {triggerButton}\n {isOpen && (\n <ActionMenu\n actions={menuItems}\n title={title}\n isOpen={isOpen}\n onClose={() => {\n setIsOpen(false);\n onClose?.();\n }}\n showCancel\n data-testid={menuTestId}\n selectionMode=\"single\"\n onSelectionChange={(keys) => {\n const nextKey = Array.from(keys)[0];\n if (nextKey) handleSelectionChange(nextKey as string);\n }}\n selectedKeys={selectedKey ? [selectedKey] : undefined}\n disabledKeys={disabledKeys}\n />\n )}\n </>\n );\n }\n\n return (\n <PopoverMenu\n trigger={triggerButton}\n items={menuItems}\n isOpen={isOpen}\n onOpenChange={setIsOpen}\n selectedKey={selectedKey}\n onSelectionChange={handleSelectionChange}\n disabledKeys={disabledKeys}\n title={title}\n />\n );\n}\n\nconst EllipsisIcon = ({ size }: { size: number }) => (\n <svg viewBox=\"0 0 24 24\" width={size} height={size}>\n <path\n fill=\"currentColor\"\n d=\"M4 14c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm8 0c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm8 0c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z\"\n />\n </svg>\n);\n"],"names":["MenuTrigger","renderTrigger","size","title","items","disabled","onClose","triggerTestId","menuTestId","onSelectionChange","selectedKey","disabledKeys","isMobile","useBreakpoint","BREAKPOINTS","isOpen","setIsOpen","useState","triggerRef","useRef","menuItems","useMemo","item","handleSelectionChange","key","triggerButton","jsx","EllipsisIcon","jsxs","Fragment","ActionMenu","keys","nextKey","PopoverMenu"],"mappings":"qZAoEO,SAASA,EAAY,CAC1B,cAAAC,EACA,KAAAC,EAAO,GACP,MAAAC,EACA,MAAAC,EACA,SAAAC,EACA,QAAAC,EACA,cAAAC,EAAgB,sBAChB,WAAAC,EACA,kBAAAC,EACA,YAAAC,EACA,aAAAC,CACF,EAAc,CACN,MAAAC,EAAWC,EAAAA,cAAcC,EAAA,YAAY,KAAK,EAC1C,CAACC,EAAQC,CAAS,EAAIC,WAAS,EAAK,EACpC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A,kBAAA,IAAC,OAAA,CACC,KAAK,eACL,EAAE,mJAAA,CACJ,EACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"MenuTrigger.es.js","sources":["../../../src/components/Menu/MenuTrigger.tsx"],"sourcesContent":["\"use client\";\n\nimport { ReactNode, useMemo, useRef, useState } from \"react\";\n\nimport { BREAKPOINTS } from \"../../constants\";\nimport { useBreakpoint } from \"../../hooks/useBreakpoint\";\nimport { ActionMenu, ActionMenuAction } from \"../ActionMenu/ActionMenu\";\nimport { PopoverMenu } from \"./PopoverMenu\";\n\nimport \"./MenuTrigger.css\";\nimport \"./Menu.css\";\n\nexport interface MenuTriggerProps {\n disabled?: boolean;\n isOpen?: boolean;\n setIsOpen: (isOpen: boolean) => void;\n}\n\nexport interface MenuProps {\n /** Custom trigger component. If not provided, defaults to ellipsis icon.\n * - @prop triggerProps {@link TriggerProps}\n */\n renderTrigger?: (triggerProps: MenuTriggerProps) => ReactNode;\n\n /** Size of the trigger icon\n * @default 24\n */\n size?: number;\n\n /** Title of the parent menu */\n title?: string;\n\n /** Array of menu actions/items to display\n * - type {@link ActionMenuAction}[]\n */\n items: ActionMenuAction[];\n\n /** Whether the menu is disabled\n * @default false\n */\n disabled?: boolean;\n\n /** Callback when the menu closes */\n onClose?: () => void;\n\n /** Test ID for the trigger button */\n triggerTestId?: string;\n\n /** Test ID for the menu */\n menuTestId?: string;\n\n /** Callback when the selection changes */\n onSelectionChange?: (key: string) => void;\n\n /** The key of the selected item */\n selectedKey?: string;\n\n /** The keys of the disabled items */\n disabledKeys?: string[];\n}\n\n/**\n * An uncontrolled component that displays either a popover menu or an action menu\n * depending on the screen size when the menu trigger is pressed.\n *\n * API:\n * - {@link MenuProps}\n */\nexport function MenuTrigger({\n renderTrigger,\n size = 24,\n title,\n items,\n disabled,\n onClose,\n triggerTestId = \"MenuTrigger-Trigger\",\n menuTestId,\n onSelectionChange,\n selectedKey,\n disabledKeys,\n}: MenuProps) {\n const isMobile = useBreakpoint(BREAKPOINTS.SMALL);\n const [isOpen, setIsOpen] = useState(false);\n const triggerRef = useRef<HTMLButtonElement>(null);\n\n const menuItems = useMemo(\n () => items.map((item) => ({ ...item, id: item.key })),\n [items]\n );\n\n const handleSelectionChange = (key: string) => {\n onSelectionChange?.(key);\n setIsOpen(false);\n };\n\n const triggerButton = renderTrigger ? (\n renderTrigger({\n isOpen,\n disabled,\n setIsOpen,\n })\n ) : (\n <button\n data-testid={triggerTestId}\n disabled={disabled}\n className=\"proton-MenuTrigger__button\"\n ref={triggerRef}\n onClick={() => setIsOpen(!isOpen)}\n type=\"button\"\n >\n <EllipsisIcon size={size} />\n </button>\n );\n\n if (isMobile) {\n return (\n <>\n {triggerButton}\n {isOpen && (\n <ActionMenu\n actions={menuItems}\n title={title}\n isOpen={isOpen}\n onClose={() => {\n setIsOpen(false);\n onClose?.();\n }}\n showCancel\n data-testid={menuTestId}\n selectionMode=\"single\"\n onSelectionChange={(keys) => {\n const nextKey = Array.from(keys)[0];\n if (nextKey) handleSelectionChange(nextKey as string);\n }}\n selectedKeys={selectedKey ? [selectedKey] : undefined}\n disabledKeys={disabledKeys}\n />\n )}\n </>\n );\n }\n\n return (\n <PopoverMenu\n trigger={triggerButton}\n items={menuItems}\n isOpen={isOpen}\n onOpenChange={setIsOpen}\n selectedKey={selectedKey}\n onSelectionChange={handleSelectionChange}\n disabledKeys={disabledKeys}\n title={title}\n />\n );\n}\n\nconst EllipsisIcon = ({ size }: { size: number }) => (\n <svg viewBox=\"0 0 24 24\" width={size} height={size}>\n <path\n fill=\"currentColor\"\n d=\"M4 14c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm8 0c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm8 0c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z\"\n />\n </svg>\n);\n"],"names":["MenuTrigger","renderTrigger","size","title","items","disabled","onClose","triggerTestId","menuTestId","onSelectionChange","selectedKey","disabledKeys","isMobile","useBreakpoint","BREAKPOINTS","isOpen","setIsOpen","useState","triggerRef","useRef","menuItems","useMemo","item","handleSelectionChange","key","triggerButton","jsx","EllipsisIcon","jsxs","Fragment","ActionMenu","keys","nextKey","PopoverMenu"],"mappings":";;;;;;;;AAoEO,SAASA,EAAY;AAAA,EAC1B,eAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,OAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,SAAAC;AAAA,EACA,eAAAC,IAAgB;AAAA,EAChB,YAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,aAAAC;AAAA,EACA,cAAAC;AACF,GAAc;AACZ,QAAMC,IAAWC,EAAcC,EAAY,KAAK,GAC1C,CAACC,GAAQC,CAAS,IAAIC,EAAS,EAAK,GACpCC,IAAaC,EAA0B,IAAI,GAE3CC,IAAYC;AAAA,IAChB,MAAMjB,EAAM,IAAI,CAACkB,OAAU,EAAE,GAAGA,GAAM,IAAIA,EAAK,IAAA,EAAM;AAAA,IACrD,CAAClB,CAAK;AAAA,EAAA,GAGFmB,IAAwB,CAACC,MAAgB;AAC7C,IAAAf,KAAA,QAAAA,EAAoBe,IACpBR,EAAU,EAAK;AAAA,EACjB,GAEMS,IAAgBxB,IACpBA,EAAc;AAAA,IACZ,QAAAc;AAAA,IACA,UAAAV;AAAA,IACA,WAAAW;AAAA,EAAA,CACD,IAEDU,gBAAAA,EAAAA;AAAAA,IAAC;AAAA,IAAA;AAAA,MACC,eAAanB;AAAA,MACb,UAAAF;AAAA,MACA,WAAU;AAAA,MACV,KAAKa;AAAA,MACL,SAAS,MAAMF,EAAU,CAACD,CAAM;AAAA,MAChC,MAAK;AAAA,MAEL,UAAAW,gBAAAA,EAAAA,IAACC,KAAa,MAAAzB,EAAA,CAAY;AAAA,IAAA;AAAA,EAAA;AAI9B,SAAIU,IAEAgB,gBAAAA,EAAAA,KAAAC,YAAA,EACG,UAAA;AAAA,IAAAJ;AAAA,IACAV,KACCW,gBAAAA,EAAAA;AAAAA,MAACI;AAAA,MAAA;AAAA,QACC,SAASV;AAAA,QACT,OAAAjB;AAAA,QACA,QAAAY;AAAA,QACA,SAAS,MAAM;AACb,UAAAC,EAAU,EAAK,GACfV,KAAA,QAAAA;AAAA,QACF;AAAA,QACA,YAAU;AAAA,QACV,eAAaE;AAAA,QACb,eAAc;AAAA,QACd,mBAAmB,CAACuB,MAAS;AAC3B,gBAAMC,IAAU,MAAM,KAAKD,CAAI,EAAE,CAAC;AAClC,UAAIC,OAA+BA,CAAiB;AAAA,QACtD;AAAA,QACA,cAActB,IAAc,CAACA,CAAW,IAAI;AAAA,QAC5C,cAAAC;AAAA,MAAA;AAAA,IAAA;AAAA,EACF,GAEJ,IAKFe,gBAAAA,EAAAA;AAAAA,IAACO;AAAA,IAAA;AAAA,MACC,SAASR;AAAA,MACT,OAAOL;AAAA,MACP,QAAAL;AAAA,MACA,cAAcC;AAAA,MACd,aAAAN;AAAA,MACA,mBAAmBa;AAAA,MACnB,cAAAZ;AAAA,MACA,OAAAR;AAAA,IAAA;AAAA,EAAA;AAGN;AAEA,MAAMwB,IAAe,CAAC,EAAE,MAAAzB,EAAA,MACtBwB,gBAAAA,EAAAA,IAAC,OAAA,EAAI,SAAQ,aAAY,OAAOxB,GAAM,QAAQA,GAC5C,UAAAwB,gBAAAA,EAAAA;AAAAA,EAAC;AAAA,EAAA;AAAA,IACC,MAAK;AAAA,IACL,GAAE;AAAA,EAAA;AACJ,GACF;"}
1
+ {"version":3,"file":"MenuTrigger.es.js","sources":["../../../src/components/Menu/MenuTrigger.tsx"],"sourcesContent":["\"use client\";\n\nimport { ReactNode, useMemo, useRef, useState } from \"react\";\n\nimport { BREAKPOINTS } from \"../../constants\";\nimport { useBreakpoint } from \"../../hooks/useBreakpoint\";\nimport { ActionMenu, ActionMenuAction } from \"../ActionMenu/ActionMenu\";\nimport { PopoverMenu } from \"./PopoverMenu\";\n\nimport \"./MenuTrigger.css\";\nimport \"./Menu.css\";\n\nexport interface MenuTriggerProps {\n disabled?: boolean;\n isOpen?: boolean;\n setIsOpen: (isOpen: boolean) => void;\n}\n\nexport interface MenuProps {\n /** Custom trigger component. If not provided, defaults to ellipsis icon.\n * - @prop triggerProps {@link TriggerProps}\n */\n renderTrigger?: (triggerProps: MenuTriggerProps) => ReactNode;\n\n /** Size of the trigger icon\n * @default 24\n */\n size?: number;\n\n /** Title of the parent menu */\n title?: string;\n\n /** Array of menu actions/items to display\n * - type {@link ActionMenuAction}[]\n */\n items: ActionMenuAction[];\n\n /** Whether the menu is disabled\n * @default false\n */\n disabled?: boolean;\n\n /** Callback when the menu closes */\n onClose?: () => void;\n\n /** Test ID for the trigger button */\n triggerTestId?: string;\n\n /** Test ID for the menu */\n menuTestId?: string;\n\n /** Callback when the selection changes */\n onSelectionChange?: (key: string) => void;\n\n /** The key of the selected item */\n selectedKey?: string;\n\n /** The keys of the disabled items */\n disabledKeys?: string[];\n}\n\n/**\n * An uncontrolled component that displays either a popover menu or an action menu\n * depending on the screen size when the menu trigger is pressed.\n *\n * API:\n * - {@link MenuProps}\n */\nexport function MenuTrigger({\n renderTrigger,\n size = 24,\n title,\n items,\n disabled,\n onClose,\n triggerTestId = \"MenuTrigger-Trigger\",\n menuTestId,\n onSelectionChange,\n selectedKey,\n disabledKeys,\n}: MenuProps) {\n const isMobile = useBreakpoint(BREAKPOINTS.SMALL);\n const [isOpen, setIsOpen] = useState(false);\n const triggerRef = useRef<HTMLButtonElement>(null);\n\n const menuItems = useMemo(\n () => items.map((item) => ({ ...item, id: item.key })),\n [items]\n );\n\n const handleSelectionChange = (key: string) => {\n onSelectionChange?.(key);\n setIsOpen(false);\n };\n\n const triggerButton = renderTrigger ? (\n renderTrigger({\n isOpen,\n disabled,\n setIsOpen,\n })\n ) : (\n <button\n data-testid={triggerTestId}\n disabled={disabled}\n className=\"proton-MenuTrigger__button\"\n ref={triggerRef}\n onClick={() => setIsOpen(!isOpen)}\n type=\"button\"\n >\n <EllipsisIcon size={size} />\n </button>\n );\n\n if (isMobile) {\n return (\n <>\n {triggerButton}\n {isOpen && (\n <ActionMenu\n actions={menuItems}\n title={title}\n isOpen={isOpen}\n onClose={() => {\n setIsOpen(false);\n onClose?.();\n }}\n showCancel\n data-testid={menuTestId}\n selectionMode=\"single\"\n onSelectionChange={(keys) => {\n const nextKey = Array.from(keys)[0];\n if (nextKey) handleSelectionChange(nextKey as string);\n }}\n selectedKeys={selectedKey ? [selectedKey] : undefined}\n disabledKeys={disabledKeys}\n />\n )}\n </>\n );\n }\n\n return (\n <PopoverMenu\n trigger={triggerButton}\n items={menuItems}\n isOpen={isOpen}\n onOpenChange={setIsOpen}\n selectedKey={selectedKey}\n onSelectionChange={handleSelectionChange}\n disabledKeys={disabledKeys}\n title={title}\n />\n );\n}\n\nconst EllipsisIcon = ({ size }: { size: number }) => (\n <svg viewBox=\"0 0 24 24\" width={size} height={size}>\n <path\n fill=\"currentColor\"\n d=\"M4 14c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm8 0c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm8 0c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z\"\n />\n </svg>\n);\n"],"names":["MenuTrigger","renderTrigger","size","title","items","disabled","onClose","triggerTestId","menuTestId","onSelectionChange","selectedKey","disabledKeys","isMobile","useBreakpoint","BREAKPOINTS","isOpen","setIsOpen","useState","triggerRef","useRef","menuItems","useMemo","item","handleSelectionChange","key","triggerButton","jsx","EllipsisIcon","jsxs","Fragment","ActionMenu","keys","nextKey","PopoverMenu"],"mappings":";;;;;;;;AAoEO,SAASA,EAAY;AAAA,EAC1B,eAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,OAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,SAAAC;AAAA,EACA,eAAAC,IAAgB;AAAA,EAChB,YAAAC;AAAA,EACA,mBA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B,IAAc,CAACA,CAAW,IAAI;AAAA,QAC5C,cAAAC;AAAA,MAAA;AAAA,IACF;AAAA,EAEJ,EAAA,CAAA,IAKFe,gBAAAA,EAAA;AAAA,IAACO;AAAA,IAAA;AAAA,MACC,SAASR;AAAA,MACT,OAAOL;AAAA,MACP,QAAAL;AAAA,MACA,cAAcC;AAAA,MACd,aAAAN;AAAA,MACA,mBAAmBa;AAAA,MACnB,cAAAZ;AAAA,MACA,OAAAR;AAAA,IAAA;AAAA,EAAA;AAGN;AAEA,MAAMwB,IAAe,CAAC,EAAE,MAAAzB,EACtB,MAAAwB,gBAAAA,EAAA,IAAC,OAAI,EAAA,SAAQ,aAAY,OAAOxB,GAAM,QAAQA,GAC5C,UAAAwB,gBAAAA,EAAA;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,MAAK;AAAA,IACL,GAAE;AAAA,EAAA;AACJ,GACF;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../node_modules/react/jsx-runtime.cjs.js"),s=require("radix-ui"),h=require("../ThemeProvider.cjs.js"),u=require("../../utils/string.cjs.js");function R({trigger:m,items:p,isOpen:a,onOpenChange:n,selectedKey:j,onSelectionChange:l,disabledKeys:M,title:x}){const{className:_,style:g}=h.useTheme();function c(d){const{item:e,disabledKeys:t,onClose:o}=d;return e.children&&e.children.length>0?r.jsxRuntimeExports.jsxs(s.DropdownMenu.Sub,{children:[r.jsxRuntimeExports.jsxs(s.DropdownMenu.SubTrigger,{className:u.csx("proton-Menu__item","proton-MenuTrigger__menu-item"),children:[e.label,r.jsxRuntimeExports.jsx("svg",{className:"proton-MenuTrigger__chevron",viewBox:"0 0 256 256",width:16,height:12,children:r.jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"m184.49 136.49l-80 80a12 12 0 0 1-17-17L159 128L87.51 56.49a12 12 0 1 1 17-17l80 80a12 12 0 0 1-.02 17"})})]}),r.jsxRuntimeExports.jsx(s.DropdownMenu.SubContent,{sideOffset:8,"data-has-submenu":"true",className:u.csx("proton-Menu","proton-MenuTrigger__menu"),children:e.children.map(i=>c({item:i,disabledKeys:t,onClose:o}))})]},e.key):r.jsxRuntimeExports.jsxs(s.DropdownMenu.Item,{className:u.csx("proton-Menu__item","proton-MenuTrigger__menu-item"),"aria-selected":j===e.key,disabled:t==null?void 0:t.includes(e.key),onSelect:()=>{var i;(i=e.onAction)==null||i.call(e,e.key),l==null||l(e.key),o==null||o()},children:[r.jsxRuntimeExports.jsx("span",{className:"proton-MenuTrigger__label",style:{gridArea:"label"},children:e.label}),e.description&&r.jsxRuntimeExports.jsx("span",{className:"proton-MenuTrigger__description",style:{gridArea:"desc"},children:e.description})]},e.key)}return r.jsxRuntimeExports.jsxs(s.DropdownMenu.Root,{open:a,onOpenChange:n,children:[r.jsxRuntimeExports.jsx(s.DropdownMenu.Trigger,{asChild:!0,children:m}),r.jsxRuntimeExports.jsx(s.DropdownMenu.Portal,{children:r.jsxRuntimeExports.jsxs(s.DropdownMenu.Content,{className:u.csx("proton-Menu","proton-MenuTrigger__menu",_),style:g,children:[x&&r.jsxRuntimeExports.jsx(s.DropdownMenu.Label,{className:"proton-MenuTrigger__menu-header",children:x}),p.map(d=>c({item:d,disabledKeys:M,onClose:()=>n==null?void 0:n(!1)}))]})})]})}exports.PopoverMenu=R;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../node_modules/react/jsx-runtime.cjs.js"),s=require("radix-ui"),R=require("../ThemeProvider.cjs.js"),u=require("../../utils/string.cjs.js");function b({trigger:p,items:j,isOpen:M,onOpenChange:n,selectedKey:_,onSelectionChange:l,disabledKeys:g,title:c}){const{className:x,style:m}=R.useTheme();function a(d){const{item:e,className:h,style:y,disabledKeys:t,onClose:o}=d;return e.children&&e.children.length>0?r.jsxRuntimeExports.jsxs(s.DropdownMenu.Sub,{children:[r.jsxRuntimeExports.jsxs(s.DropdownMenu.SubTrigger,{className:u.csx("proton-Menu__item","proton-MenuTrigger__menu-item"),children:[e.label,r.jsxRuntimeExports.jsx("svg",{className:"proton-MenuTrigger__chevron",viewBox:"0 0 256 256",width:16,height:12,children:r.jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"m184.49 136.49l-80 80a12 12 0 0 1-17-17L159 128L87.51 56.49a12 12 0 1 1 17-17l80 80a12 12 0 0 1-.02 17"})})]}),r.jsxRuntimeExports.jsx(s.DropdownMenu.SubContent,{sideOffset:8,"data-has-submenu":"true",className:u.csx("proton-Menu","proton-MenuTrigger__menu"),children:e.children.map(i=>a({item:i,className:h,style:y,disabledKeys:t,onClose:o}))})]},e.key):r.jsxRuntimeExports.jsxs(s.DropdownMenu.Item,{className:u.csx("proton-Menu__item","proton-MenuTrigger__menu-item"),"aria-selected":_===e.key,disabled:t==null?void 0:t.includes(e.key),onSelect:()=>{var i;(i=e.onAction)==null||i.call(e,e.key),l==null||l(e.key),o==null||o()},children:[r.jsxRuntimeExports.jsx("span",{className:"proton-MenuTrigger__label",style:{gridArea:"label"},children:e.label}),e.description&&r.jsxRuntimeExports.jsx("span",{className:"proton-MenuTrigger__description",style:{gridArea:"desc"},children:e.description})]},e.key)}return r.jsxRuntimeExports.jsxs(s.DropdownMenu.Root,{open:M,onOpenChange:n,children:[r.jsxRuntimeExports.jsx(s.DropdownMenu.Trigger,{asChild:!0,children:p}),r.jsxRuntimeExports.jsx(s.DropdownMenu.Portal,{children:r.jsxRuntimeExports.jsxs(s.DropdownMenu.Content,{className:u.csx("proton-Menu","proton-MenuTrigger__menu",x),style:m,children:[c&&r.jsxRuntimeExports.jsx(s.DropdownMenu.Label,{className:"proton-MenuTrigger__menu-header",children:c}),j.map(d=>a({item:d,className:x,style:m,disabledKeys:g,onClose:()=>n==null?void 0:n(!1)}))]})})]})}exports.PopoverMenu=b;
2
2
  //# sourceMappingURL=PopoverMenu.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PopoverMenu.cjs.js","sources":["../../../src/components/Menu/PopoverMenu.tsx"],"sourcesContent":["import { DropdownMenu as RadixDropdownMenu } from \"radix-ui\";\nimport { useTheme } from \"../ThemeProvider\";\nimport { csx } from \"../../utils/string\";\nimport { ActionMenuAction } from \"../ActionMenu/ActionMenu\";\n\nexport interface PopoverMenuProps {\n /** The trigger component */\n trigger: React.ReactNode;\n\n /** Array of menu actions/items to display\n * - type {@link ActionMenuAction}[]\n */\n items: ActionMenuAction[];\n\n /** Whether the menu is open */\n isOpen: boolean;\n\n /** Callback when the menu is opened or closed */\n onOpenChange: (open: boolean) => void;\n\n /** The key of the selected item */\n selectedKey: string;\n\n /** Callback when the selection changes */\n onSelectionChange: (key: string) => void;\n\n /** The keys of the disabled items */\n disabledKeys: string[];\n\n /** The title of the menu */\n title: string;\n}\n\n/**\n * A component that displays a popover menu.\n *\n * API:\n * - {@link PopoverMenuProps}\n */\nexport function PopoverMenu({\n trigger,\n items,\n isOpen,\n onOpenChange,\n selectedKey,\n onSelectionChange,\n disabledKeys,\n title,\n}: PopoverMenuProps) {\n const { className: themeClass, style: themeStyle } = useTheme();\n\n function renderMenuItem(props) {\n const { item, className, style, disabledKeys, onClose } = props;\n\n if (item.children && item.children.length > 0) {\n return (\n <RadixDropdownMenu.Sub key={item.key}>\n <RadixDropdownMenu.SubTrigger\n className={csx(\n \"proton-Menu__item\",\n \"proton-MenuTrigger__menu-item\"\n )}\n >\n {item.label}\n <svg\n className=\"proton-MenuTrigger__chevron\"\n viewBox=\"0 0 256 256\"\n width={16}\n height={12}\n >\n <path\n fill=\"currentColor\"\n d=\"m184.49 136.49l-80 80a12 12 0 0 1-17-17L159 128L87.51 56.49a12 12 0 1 1 17-17l80 80a12 12 0 0 1-.02 17\"\n />\n </svg>\n </RadixDropdownMenu.SubTrigger>\n\n <RadixDropdownMenu.SubContent\n sideOffset={8}\n data-has-submenu=\"true\"\n className={csx(\"proton-Menu\", \"proton-MenuTrigger__menu\")}\n >\n {item.children.map((child) =>\n renderMenuItem({\n item: child,\n className,\n style,\n disabledKeys,\n onClose,\n })\n )}\n </RadixDropdownMenu.SubContent>\n </RadixDropdownMenu.Sub>\n );\n } else {\n return (\n <RadixDropdownMenu.Item\n className={csx(\"proton-Menu__item\", \"proton-MenuTrigger__menu-item\")}\n key={item.key}\n aria-selected={selectedKey === item.key}\n disabled={disabledKeys?.includes(item.key)}\n onSelect={() => {\n item.onAction?.(item.key);\n onSelectionChange?.(item.key);\n onClose?.();\n }}\n >\n <span\n className=\"proton-MenuTrigger__label\"\n style={{ gridArea: \"label\" }}\n >\n {item.label}\n </span>\n {item.description && (\n <span\n className=\"proton-MenuTrigger__description\"\n style={{ gridArea: \"desc\" }}\n >\n {item.description}\n </span>\n )}\n </RadixDropdownMenu.Item>\n );\n }\n }\n\n return (\n <RadixDropdownMenu.Root open={isOpen} onOpenChange={onOpenChange}>\n <RadixDropdownMenu.Trigger asChild>{trigger}</RadixDropdownMenu.Trigger>\n <RadixDropdownMenu.Portal>\n <RadixDropdownMenu.Content\n className={csx(\"proton-Menu\", \"proton-MenuTrigger__menu\", themeClass)}\n style={themeStyle as React.CSSProperties}\n >\n {title && (\n <RadixDropdownMenu.Label className=\"proton-MenuTrigger__menu-header\">\n {title}\n </RadixDropdownMenu.Label>\n )}\n {items.map((item) =>\n renderMenuItem({\n item,\n className: themeClass,\n style: themeStyle as React.CSSProperties,\n disabledKeys,\n onClose: () => onOpenChange?.(false),\n })\n )}\n </RadixDropdownMenu.Content>\n </RadixDropdownMenu.Portal>\n </RadixDropdownMenu.Root>\n );\n}\n"],"names":["PopoverMenu","trigger","items","isOpen","onOpenChange","selectedKey","onSelectionChange","disabledKeys","title","themeClass","themeStyle","useTheme","renderMenuItem","props","item","onClose","jsxs","RadixDropdownMenu","csx","jsx","child","_a"],"mappings":"iPAuCO,SAASA,EAAY,CAC1B,QAAAC,EACA,MAAAC,EACA,OAAAC,EACA,aAAAC,EACA,YAAAC,EACA,kBAAAC,EACA,aAAAC,EACA,MAAAC,CACF,EAAqB,CACnB,KAAM,CAA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,EAAAA,kBAAAA,IAAC,OAAA,CACC,UAAU,kCACV,MAAO,CAAE,SAAU,MAAA,EAElB,SAAAL,EAAK,WAAA,CAAA,CACR,CAAA,EArBGA,EAAK,GAAA,CA0BlB,CAEA,gCACGG,EAAAA,aAAkB,KAAlB,CAAuB,KAAMd,EAAQ,aAAAC,EACpC,SAAA,CAAAe,EAAAA,kBAAAA,IAACF,EAAAA,aAAkB,QAAlB,CAA0B,QAAO,GAAE,SAAAhB,EAAQ,EAC5CkB,EAAAA,kBAAAA,IAACF,EAAAA,aAAkB,OAAlB,CACC,SAAAD,EAAAA,kBAAAA,KAACC,EAAAA,aAAkB,QAAlB,CACC,UAAWC,EAAAA,IAAI,cAAe,2BAA4BT,CAAU,EACpE,MAAOC,EAEN,SAAA,CAAAF,2BACES,EAAAA,aAAkB,MAAlB,CAAwB,UAAU,kCAChC,SAAAT,EACH,EAEDN,EAAM,IAAKY,GACVF,EAAe,CACb,KAAAE,EAGA,aAAAP,EACA,QAAS,IAAMH,GAAA,YAAAA,EAAe,GAAK,CACpC,CAAA,CACH,CAAA,CAAA,CACF,CACF,CAAA,EACF,CAEJ"}
1
+ {"version":3,"file":"PopoverMenu.cjs.js","sources":["../../../src/components/Menu/PopoverMenu.tsx"],"sourcesContent":["import { DropdownMenu as RadixDropdownMenu } from \"radix-ui\";\nimport { useTheme } from \"../ThemeProvider\";\nimport { csx } from \"../../utils/string\";\nimport { ActionMenuAction } from \"../ActionMenu/ActionMenu\";\n\nexport interface PopoverMenuProps {\n /** The trigger component */\n trigger: React.ReactNode;\n\n /** Array of menu actions/items to display\n * - type {@link ActionMenuAction}[]\n */\n items: ActionMenuAction[];\n\n /** Whether the menu is open */\n isOpen: boolean;\n\n /** Callback when the menu is opened or closed */\n onOpenChange: (open: boolean) => void;\n\n /** The key of the selected item */\n selectedKey: string;\n\n /** Callback when the selection changes */\n onSelectionChange: (key: string) => void;\n\n /** The keys of the disabled items */\n disabledKeys: string[];\n\n /** The title of the menu */\n title: string;\n}\n\n/**\n * A component that displays a popover menu.\n *\n * API:\n * - {@link PopoverMenuProps}\n */\nexport function PopoverMenu({\n trigger,\n items,\n isOpen,\n onOpenChange,\n selectedKey,\n onSelectionChange,\n disabledKeys,\n title,\n}: PopoverMenuProps) {\n const { className: themeClass, style: themeStyle } = useTheme();\n\n function renderMenuItem(props) {\n const { item, className, style, disabledKeys, onClose } = props;\n\n if (item.children && item.children.length > 0) {\n return (\n <RadixDropdownMenu.Sub key={item.key}>\n <RadixDropdownMenu.SubTrigger\n className={csx(\n \"proton-Menu__item\",\n \"proton-MenuTrigger__menu-item\"\n )}\n >\n {item.label}\n <svg\n className=\"proton-MenuTrigger__chevron\"\n viewBox=\"0 0 256 256\"\n width={16}\n height={12}\n >\n <path\n fill=\"currentColor\"\n d=\"m184.49 136.49l-80 80a12 12 0 0 1-17-17L159 128L87.51 56.49a12 12 0 1 1 17-17l80 80a12 12 0 0 1-.02 17\"\n />\n </svg>\n </RadixDropdownMenu.SubTrigger>\n\n <RadixDropdownMenu.SubContent\n sideOffset={8}\n data-has-submenu=\"true\"\n className={csx(\"proton-Menu\", \"proton-MenuTrigger__menu\")}\n >\n {item.children.map((child) =>\n renderMenuItem({\n item: child,\n className,\n style,\n disabledKeys,\n onClose,\n })\n )}\n </RadixDropdownMenu.SubContent>\n </RadixDropdownMenu.Sub>\n );\n } else {\n return (\n <RadixDropdownMenu.Item\n className={csx(\"proton-Menu__item\", \"proton-MenuTrigger__menu-item\")}\n key={item.key}\n aria-selected={selectedKey === item.key}\n disabled={disabledKeys?.includes(item.key)}\n onSelect={() => {\n item.onAction?.(item.key);\n onSelectionChange?.(item.key);\n onClose?.();\n }}\n >\n <span\n className=\"proton-MenuTrigger__label\"\n style={{ gridArea: \"label\" }}\n >\n {item.label}\n </span>\n {item.description && (\n <span\n className=\"proton-MenuTrigger__description\"\n style={{ gridArea: \"desc\" }}\n >\n {item.description}\n </span>\n )}\n </RadixDropdownMenu.Item>\n );\n }\n }\n\n return (\n <RadixDropdownMenu.Root open={isOpen} onOpenChange={onOpenChange}>\n <RadixDropdownMenu.Trigger asChild>{trigger}</RadixDropdownMenu.Trigger>\n <RadixDropdownMenu.Portal>\n <RadixDropdownMenu.Content\n className={csx(\"proton-Menu\", \"proton-MenuTrigger__menu\", themeClass)}\n style={themeStyle as React.CSSProperties}\n >\n {title && (\n <RadixDropdownMenu.Label className=\"proton-MenuTrigger__menu-header\">\n {title}\n </RadixDropdownMenu.Label>\n )}\n {items.map((item) =>\n renderMenuItem({\n item,\n className: themeClass,\n style: themeStyle as React.CSSProperties,\n disabledKeys,\n onClose: () => onOpenChange?.(false),\n })\n )}\n </RadixDropdownMenu.Content>\n </RadixDropdownMenu.Portal>\n </RadixDropdownMenu.Root>\n );\n}\n"],"names":["PopoverMenu","trigger","items","isOpen","onOpenChange","selectedKey","onSelectionChange","disabledKeys","title","themeClass","themeStyle","useTheme","renderMenuItem","props","item","className","style","onClose","jsxs","RadixDropdownMenu","csx","jsx","child","_a"],"mappings":"iPAuCO,SAASA,EAAY,CAC1B,QAAAC,EACA,MAAAC,EACA,OAAAC,EACA,aAAAC,EACA,YAAAC,EACA,kBAAAC,EACA,aAAAC,EACA,MAAAC,CACF,EAAqB,CACnB,KAAM,CAAE,UAAWC,EAAY,MAAOC,CAAA,EAAeC,EAAAA,WAErD,SAASC,EAAeC,EAAO,CAC7B,KAAM,CAAE,KAAAC,EAAM,UAAAC,EAAW,MAAAC,EAAO,aAAAT,EAAc,QAAAU,CAAY,EAAAJ,EAE1D,OAAIC,EAAK,UAAYA,EAAK,SAAS,OAAS,EAExCI,yBAACC,EAAAA,aAAkB,IAAlB,CACC,SAAA,CAAAD,EAAA,kBAAA,KAACC,EAAAA,aAAkB,WAAlB,CACC,UAAWC,EAAA,IACT,oBACA,+BACF,EAEC,SAAA,CAAKN,EAAA,MACNO,EAAA,kBAAA,IAAC,MAAA,CACC,UAAU,8BACV,QAAQ,cACR,MAAO,GACP,OAAQ,GAER,SAAAA,EAAA,k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AAU,EACpE,MAAOC,EAEN,SAAA,CAAAF,2BACEW,EAAAA,aAAkB,MAAlB,CAAwB,UAAU,kCAChC,SACHX,EAAA,EAEDN,EAAM,IAAKY,GACVF,EAAe,CACb,KAAAE,EACA,UAAWL,EACX,MAAOC,EACP,aAAAH,EACA,QAAS,IAAMH,GAAA,YAAAA,EAAe,GAAK,CACpC,CACH,CAAA,CAAA,CAAA,EAEJ,CACF,CAAA,CAAA,CAEJ"}
@@ -1,20 +1,20 @@
1
1
  import { j as r } from "../../node_modules/react/jsx-runtime.es.js";
2
2
  import { DropdownMenu as s } from "radix-ui";
3
- import { useTheme as M } from "../ThemeProvider.es.js";
3
+ import { useTheme as b } from "../ThemeProvider.es.js";
4
4
  import { csx as o } from "../../utils/string.es.js";
5
- function N({
6
- trigger: d,
7
- items: p,
8
- isOpen: _,
5
+ function v({
6
+ trigger: _,
7
+ items: h,
8
+ isOpen: x,
9
9
  onOpenChange: t,
10
- selectedKey: h,
10
+ selectedKey: g,
11
11
  onSelectionChange: a,
12
- disabledKeys: x,
13
- title: u
12
+ disabledKeys: j,
13
+ title: c
14
14
  }) {
15
- const { className: g, style: j } = M();
16
- function c(m) {
17
- const { item: e, disabledKeys: i, onClose: n } = m;
15
+ const { className: u, style: d } = b();
16
+ function p(m) {
17
+ const { item: e, className: M, style: y, disabledKeys: l, onClose: i } = m;
18
18
  return e.children && e.children.length > 0 ? /* @__PURE__ */ r.jsxs(s.Sub, { children: [
19
19
  /* @__PURE__ */ r.jsxs(
20
20
  s.SubTrigger,
@@ -51,10 +51,12 @@ function N({
51
51
  "data-has-submenu": "true",
52
52
  className: o("proton-Menu", "proton-MenuTrigger__menu"),
53
53
  children: e.children.map(
54
- (l) => c({
55
- item: l,
56
- disabledKeys: i,
57
- onClose: n
54
+ (n) => p({
55
+ item: n,
56
+ className: M,
57
+ style: y,
58
+ disabledKeys: l,
59
+ onClose: i
58
60
  })
59
61
  )
60
62
  }
@@ -63,11 +65,11 @@ function N({
63
65
  s.Item,
64
66
  {
65
67
  className: o("proton-Menu__item", "proton-MenuTrigger__menu-item"),
66
- "aria-selected": h === e.key,
67
- disabled: i == null ? void 0 : i.includes(e.key),
68
+ "aria-selected": g === e.key,
69
+ disabled: l == null ? void 0 : l.includes(e.key),
68
70
  onSelect: () => {
69
- var l;
70
- (l = e.onAction) == null || l.call(e, e.key), a == null || a(e.key), n == null || n();
71
+ var n;
72
+ (n = e.onAction) == null || n.call(e, e.key), a == null || a(e.key), i == null || i();
71
73
  },
72
74
  children: [
73
75
  /* @__PURE__ */ r.jsx(
@@ -91,19 +93,21 @@ function N({
91
93
  e.key
92
94
  );
93
95
  }
94
- return /* @__PURE__ */ r.jsxs(s.Root, { open: _, onOpenChange: t, children: [
95
- /* @__PURE__ */ r.jsx(s.Trigger, { asChild: !0, children: d }),
96
+ return /* @__PURE__ */ r.jsxs(s.Root, { open: x, onOpenChange: t, children: [
97
+ /* @__PURE__ */ r.jsx(s.Trigger, { asChild: !0, children: _ }),
96
98
  /* @__PURE__ */ r.jsx(s.Portal, { children: /* @__PURE__ */ r.jsxs(
97
99
  s.Content,
98
100
  {
99
- className: o("proton-Menu", "proton-MenuTrigger__menu", g),
100
- style: j,
101
+ className: o("proton-Menu", "proton-MenuTrigger__menu", u),
102
+ style: d,
101
103
  children: [
102
- u && /* @__PURE__ */ r.jsx(s.Label, { className: "proton-MenuTrigger__menu-header", children: u }),
103
- p.map(
104
- (m) => c({
104
+ c && /* @__PURE__ */ r.jsx(s.Label, { className: "proton-MenuTrigger__menu-header", children: c }),
105
+ h.map(
106
+ (m) => p({
105
107
  item: m,
106
- disabledKeys: x,
108
+ className: u,
109
+ style: d,
110
+ disabledKeys: j,
107
111
  onClose: () => t == null ? void 0 : t(!1)
108
112
  })
109
113
  )
@@ -113,6 +117,6 @@ function N({
113
117
  ] });
114
118
  }
115
119
  export {
116
- N as PopoverMenu
120
+ v as PopoverMenu
117
121
  };
118
122
  //# sourceMappingURL=PopoverMenu.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PopoverMenu.es.js","sources":["../../../src/components/Menu/PopoverMenu.tsx"],"sourcesContent":["import { DropdownMenu as RadixDropdownMenu } from \"radix-ui\";\nimport { useTheme } from \"../ThemeProvider\";\nimport { csx } from \"../../utils/string\";\nimport { ActionMenuAction } from \"../ActionMenu/ActionMenu\";\n\nexport interface PopoverMenuProps {\n /** The trigger component */\n trigger: React.ReactNode;\n\n /** Array of menu actions/items to display\n * - type {@link ActionMenuAction}[]\n */\n items: ActionMenuAction[];\n\n /** Whether the menu is open */\n isOpen: boolean;\n\n /** Callback when the menu is opened or closed */\n onOpenChange: (open: boolean) => void;\n\n /** The key of the selected item */\n selectedKey: string;\n\n /** Callback when the selection changes */\n onSelectionChange: (key: string) => void;\n\n /** The keys of the disabled items */\n disabledKeys: string[];\n\n /** The title of the menu */\n title: string;\n}\n\n/**\n * A component that displays a popover menu.\n *\n * API:\n * - {@link PopoverMenuProps}\n */\nexport function PopoverMenu({\n trigger,\n items,\n isOpen,\n onOpenChange,\n selectedKey,\n onSelectionChange,\n disabledKeys,\n title,\n}: PopoverMenuProps) {\n const { className: themeClass, style: themeStyle } = useTheme();\n\n function renderMenuItem(props) {\n const { item, className, style, disabledKeys, onClose } = props;\n\n if (item.children && item.children.length > 0) {\n return (\n <RadixDropdownMenu.Sub key={item.key}>\n <RadixDropdownMenu.SubTrigger\n className={csx(\n \"proton-Menu__item\",\n \"proton-MenuTrigger__menu-item\"\n )}\n >\n {item.label}\n <svg\n className=\"proton-MenuTrigger__chevron\"\n viewBox=\"0 0 256 256\"\n width={16}\n height={12}\n >\n <path\n fill=\"currentColor\"\n d=\"m184.49 136.49l-80 80a12 12 0 0 1-17-17L159 128L87.51 56.49a12 12 0 1 1 17-17l80 80a12 12 0 0 1-.02 17\"\n />\n </svg>\n </RadixDropdownMenu.SubTrigger>\n\n <RadixDropdownMenu.SubContent\n sideOffset={8}\n data-has-submenu=\"true\"\n className={csx(\"proton-Menu\", \"proton-MenuTrigger__menu\")}\n >\n {item.children.map((child) =>\n renderMenuItem({\n item: child,\n className,\n style,\n disabledKeys,\n onClose,\n })\n )}\n </RadixDropdownMenu.SubContent>\n </RadixDropdownMenu.Sub>\n );\n } else {\n return (\n <RadixDropdownMenu.Item\n className={csx(\"proton-Menu__item\", \"proton-MenuTrigger__menu-item\")}\n key={item.key}\n aria-selected={selectedKey === item.key}\n disabled={disabledKeys?.includes(item.key)}\n onSelect={() => {\n item.onAction?.(item.key);\n onSelectionChange?.(item.key);\n onClose?.();\n }}\n >\n <span\n className=\"proton-MenuTrigger__label\"\n style={{ gridArea: \"label\" }}\n >\n {item.label}\n </span>\n {item.description && (\n <span\n className=\"proton-MenuTrigger__description\"\n style={{ gridArea: \"desc\" }}\n >\n {item.description}\n </span>\n )}\n </RadixDropdownMenu.Item>\n );\n }\n }\n\n return (\n <RadixDropdownMenu.Root open={isOpen} onOpenChange={onOpenChange}>\n <RadixDropdownMenu.Trigger asChild>{trigger}</RadixDropdownMenu.Trigger>\n <RadixDropdownMenu.Portal>\n <RadixDropdownMenu.Content\n className={csx(\"proton-Menu\", \"proton-MenuTrigger__menu\", themeClass)}\n style={themeStyle as React.CSSProperties}\n >\n {title && (\n <RadixDropdownMenu.Label className=\"proton-MenuTrigger__menu-header\">\n {title}\n </RadixDropdownMenu.Label>\n )}\n {items.map((item) =>\n renderMenuItem({\n item,\n className: themeClass,\n style: themeStyle as React.CSSProperties,\n disabledKeys,\n onClose: () => onOpenChange?.(false),\n })\n )}\n </RadixDropdownMenu.Content>\n </RadixDropdownMenu.Portal>\n </RadixDropdownMenu.Root>\n );\n}\n"],"names":["PopoverMenu","trigger","items","isOpen","onOpenChange","selectedKey","onSelectionChange","disabledKeys","title","themeClass","themeStyle","useTheme","renderMenuItem","props","item","onClose","jsxs","RadixDropdownMenu","csx","jsx","child","_a"],"mappings":";;;;AAuCO,SAASA,EAAY;AAAA,EAC1B,SAAAC;AAAA,EACA,OAAAC;AAAA,EACA,QAAAC;AAAA,E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;AAAA,UAAA;AAAA,QACH;AAAA,MAAA;AAAA,IAAA,EACF,CACF;AAAA,EAAA,GACF;AAEJ;"}
1
+ {"version":3,"file":"PopoverMenu.es.js","sources":["../../../src/components/Menu/PopoverMenu.tsx"],"sourcesContent":["import { DropdownMenu as RadixDropdownMenu } from \"radix-ui\";\nimport { useTheme } from \"../ThemeProvider\";\nimport { csx } from \"../../utils/string\";\nimport { ActionMenuAction } from \"../ActionMenu/ActionMenu\";\n\nexport interface PopoverMenuProps {\n /** The trigger component */\n trigger: React.ReactNode;\n\n /** Array of menu actions/items to display\n * - type {@link ActionMenuAction}[]\n */\n items: ActionMenuAction[];\n\n /** Whether the menu is open */\n isOpen: boolean;\n\n /** Callback when the menu is opened or closed */\n onOpenChange: (open: boolean) => void;\n\n /** The key of the selected item */\n selectedKey: string;\n\n /** Callback when the selection changes */\n onSelectionChange: (key: string) => void;\n\n /** The keys of the disabled items */\n disabledKeys: string[];\n\n /** The title of the menu */\n title: string;\n}\n\n/**\n * A component that displays a popover menu.\n *\n * API:\n * - {@link PopoverMenuProps}\n */\nexport function PopoverMenu({\n trigger,\n items,\n isOpen,\n onOpenChange,\n selectedKey,\n onSelectionChange,\n disabledKeys,\n title,\n}: PopoverMenuProps) {\n const { className: themeClass, style: themeStyle } = useTheme();\n\n function renderMenuItem(props) {\n const { item, className, style, disabledKeys, onClose } = props;\n\n if (item.children && item.children.length > 0) {\n return (\n <RadixDropdownMenu.Sub key={item.key}>\n <RadixDropdownMenu.SubTrigger\n className={csx(\n \"proton-Menu__item\",\n \"proton-MenuTrigger__menu-item\"\n )}\n >\n {item.label}\n <svg\n className=\"proton-MenuTrigger__chevron\"\n viewBox=\"0 0 256 256\"\n width={16}\n height={12}\n >\n <path\n fill=\"currentColor\"\n d=\"m184.49 136.49l-80 80a12 12 0 0 1-17-17L159 128L87.51 56.49a12 12 0 1 1 17-17l80 80a12 12 0 0 1-.02 17\"\n />\n </svg>\n </RadixDropdownMenu.SubTrigger>\n\n <RadixDropdownMenu.SubContent\n sideOffset={8}\n data-has-submenu=\"true\"\n className={csx(\"proton-Menu\", \"proton-MenuTrigger__menu\")}\n >\n {item.children.map((child) =>\n renderMenuItem({\n item: child,\n className,\n style,\n disabledKeys,\n onClose,\n })\n )}\n </RadixDropdownMenu.SubContent>\n </RadixDropdownMenu.Sub>\n );\n } else {\n return (\n <RadixDropdownMenu.Item\n className={csx(\"proton-Menu__item\", \"proton-MenuTrigger__menu-item\")}\n key={item.key}\n aria-selected={selectedKey === item.key}\n disabled={disabledKeys?.includes(item.key)}\n onSelect={() => {\n item.onAction?.(item.key);\n onSelectionChange?.(item.key);\n onClose?.();\n }}\n >\n <span\n className=\"proton-MenuTrigger__label\"\n style={{ gridArea: \"label\" }}\n >\n {item.label}\n </span>\n {item.description && (\n <span\n className=\"proton-MenuTrigger__description\"\n style={{ gridArea: \"desc\" }}\n >\n {item.description}\n </span>\n )}\n </RadixDropdownMenu.Item>\n );\n }\n }\n\n return (\n <RadixDropdownMenu.Root open={isOpen} onOpenChange={onOpenChange}>\n <RadixDropdownMenu.Trigger asChild>{trigger}</RadixDropdownMenu.Trigger>\n <RadixDropdownMenu.Portal>\n <RadixDropdownMenu.Content\n className={csx(\"proton-Menu\", \"proton-MenuTrigger__menu\", themeClass)}\n style={themeStyle as React.CSSProperties}\n >\n {title && (\n <RadixDropdownMenu.Label className=\"proton-MenuTrigger__menu-header\">\n {title}\n </RadixDropdownMenu.Label>\n )}\n {items.map((item) =>\n renderMenuItem({\n item,\n className: themeClass,\n style: themeStyle as React.CSSProperties,\n disabledKeys,\n onClose: () => onOpenChange?.(false),\n })\n )}\n </RadixDropdownMenu.Content>\n </RadixDropdownMenu.Portal>\n </RadixDropdownMenu.Root>\n );\n}\n"],"names":["PopoverMenu","trigger","items","isOpen","onOpenChange","selectedKey","onSelectionChange","disabledKeys","title","themeClass","themeStyle","useTheme","renderMenuItem","props","item","className","style","onClose","jsxs","RadixDropdownMenu","csx","jsx","child","_a"],"mappings":";;;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Y,MACVF,EAAe;AAAA,cACb,MAAAE;AAAA,cACA,WAAWL;AAAA,cACX,OAAOC;AAAA,cACP,cAAAH;AAAA,cACA,SAAS,MAAMH,KAAA,gBAAAA,EAAe;AAAA,YAAK,CACpC;AAAA,UACH;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA,GAEJ;AAAA,EACF,EAAA,CAAA;AAEJ;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Modal.cjs.js","sources":["../../../src/components/Modal/Modal.tsx"],"sourcesContent":["\"use client\";\n\nimport { useButton } from \"@react-aria/button\";\nimport { useDialog } from \"@react-aria/dialog\";\nimport { FocusScope } from \"@react-aria/focus\";\nimport { useModalOverlay, usePreventScroll } from \"@react-aria/overlays\";\nimport { mergeProps } from \"@react-aria/utils\";\nimport { useRef } from \"react\";\nimport { useOverlayTriggerState } from \"@react-stately/overlays\";\nimport { BREAKPOINTS } from \"../../constants\";\nimport { useBreakpoint } from \"../../hooks\";\nimport { useIsClosing } from \"../../hooks/useIsClosing\";\nimport { csx } from \"../../utils\";\nimport { Button, ButtonProps } from \"../Button/Button\";\nimport \"./Modal.css\";\nimport { ScreenOverlay } from \"../ScreenOverlay/ScreenOverlay\";\n\nconst ModalTitle = ({ children }: { children: React.ReactNode }) => {\n return <h2 className=\"proton-Modal__title\">{children}</h2>;\n};\n\nconst ModalSubtitle = ({ children }: { children: React.ReactNode }) => {\n return <h3 className=\"proton-Modal__subtitle\">{children}</h3>;\n};\n\nconst ModalBody = ({ children }: { children: React.ReactNode }) => {\n return <div className=\"proton-Modal__body\">{children}</div>;\n};\n\nconst ModalAction = (buttonProps: ButtonProps) => {\n return (\n <div className=\"proton-Modal__action\">\n <Button {...buttonProps} />\n </div>\n );\n};\n\nconst ModalActions = ({ children }: { children: React.ReactNode }) => {\n return (\n <FocusScope autoFocus>\n <div className=\"proton-Modal__actions\">{children}</div>\n </FocusScope>\n );\n};\n\nconst ModalContent = ({\n title,\n subtitle,\n body,\n onClose,\n children,\n isClosing,\n \"data-testid\": dataTestId,\n}: ModalProps & {\n isClosing: boolean;\n}) => {\n const ref = useRef<HTMLDivElement>(null);\n const state = useOverlayTriggerState({ isOpen: true, onOpenChange: onClose });\n const { modalProps } = useModalOverlay(\n {\n isDismissable: false, //handle dismiss behavior in useIsClosing\n },\n state,\n ref\n );\n\n const { dialogProps } = useDialog({ role: \"dialog\" }, ref);\n usePreventScroll();\n\n const closeButtonRef = useRef<HTMLButtonElement>(null);\n const { buttonProps: closeButtonProps } = useButton(\n {\n onPress: onClose,\n \"aria-label\": \"Close\",\n },\n closeButtonRef\n );\n\n return (\n <FocusScope contain restoreFocus autoFocus>\n <div\n data-testid={dataTestId}\n className={csx(\"proton-Modal\", isClosing && \"proton-Modal--closing\")}\n {...mergeProps(modalProps, dialogProps)}\n ref={ref}\n >\n <button\n name=\"Close\"\n className=\"proton-Modal__close-button\"\n {...closeButtonProps}\n ref={closeButtonRef}\n >\n ×\n </button>\n {title && <ModalTitle>{title}</ModalTitle>}\n {subtitle && <ModalSubtitle>{subtitle}</ModalSubtitle>}\n {body && <ModalBody>{body}</ModalBody>}\n <div className=\"proton-Modal__content\">{children}</div>\n </div>\n </FocusScope>\n );\n};\n\nexport interface ModalProps {\n /**\n * Optional body text content for the modal\n * */\n body?: string;\n /**\n * Content to render inside the modal\n * */\n children: React.ReactNode;\n /**\n * data-testid for the modal\n * */\n \"data-testid\"?: string;\n /**\n * Controls the visibility of the modal\n * */\n isOpen: boolean;\n /**\n * Whether to show the modal with an overlay background.\n * @default true\n * */\n isOverlay?: boolean;\n /**\n * Callback function when modal is closed\n * */\n onClose?: () => void;\n /**\n * Optional subtitle text below the modal title\n * */\n subtitle?: string;\n /**\n * Optional title text for the modal header\n * */\n title?: string;\n}\n\n/**\n * Modal component with overlay support and responsive behavior.\n *\n * API:\n * - {@link ModalProps}\n */\nconst ModalWrapper = ({\n isOpen,\n onClose,\n title,\n subtitle,\n body,\n children,\n isOverlay = true,\n \"data-testid\": dataTestId,\n}: ModalProps) => {\n const overlayRef = useRef<HTMLDivElement>(null);\n const { isClosing, handleClose } = useIsClosing({\n onClose,\n overlayRef,\n });\n const isMobile = useBreakpoint(BREAKPOINTS.MEDIUM);\n\n if (!isOpen) return null;\n\n const modalContent = (\n <ModalContent\n isOpen={isOpen}\n title={title}\n subtitle={subtitle}\n body={body}\n onClose={handleClose}\n isClosing={isClosing}\n data-testid={dataTestId}\n >\n {children}\n </ModalContent>\n );\n\n return isOverlay || isMobile ? (\n <ScreenOverlay fadeIn ref={overlayRef} onClose={handleClose}>\n {modalContent}\n </ScreenOverlay>\n ) : (\n modalContent\n );\n};\n\nexport const Modal = Object.assign(ModalWrapper, {\n /**\n * Renders a h2 styled title\n * */\n Title: ModalTitle,\n /**\n * Renders a h3 styled subtitle\n * */\n Subtitle: ModalSubtitle,\n /**\n * Renders a div styled body\n * */\n Body: ModalBody,\n /**\n * Renders a Proton Button action\n * - @prop buttonProps {@link ButtonProps}\n * */\n Action: ModalAction,\n /**\n * Renders a group of Proton Buttons\n * */\n Actions: ModalActions,\n});\n"],"names":["ModalTitle","children","jsx","ModalSubtitle","ModalBody","ModalAction","buttonProps","Button","ModalActions","FocusScope","ModalContent","title","subtitle","body","onClose","isClosing","dataTestId","ref","useRef","state","useOverlayTriggerState","modalProps","useModalOverlay","dialogProps","useDialog","usePreventScroll","closeButtonRef","closeButtonProps","useButton","jsxs","csx","mergeProps","ModalWrapper","isOpen","isOverlay","overlayRef","handleClose","useIsClosing","isMobile","useBreakpoint","BREAKPOINTS","modalContent","ScreenOverlay","Modal"],"mappings":"u8BAiBMA,EAAa,CAAC,CAAE,SAAAC,KACbC,EAAAA,kBAAAA,IAAC,KAAA,CAAG,UAAU,sBAAuB,SAAAD,CAAA,CAAS,EAGjDE,EAAgB,CAAC,CAAE,SAAAF,KAChBC,EAAAA,kBAAAA,IAAC,KAAA,CAAG,UAAU,yBAA0B,SAAAD,CAAA,CAAS,EAGpDG,EAAY,CAAC,CAAE,SAAAH,KACZC,EAAA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AM,EAC5BC,GAAYV,EAAAA,kBAAAA,IAACC,EAAA,CAAe,SAAAS,CAAA,CAAS,EACrCC,GAAQX,EAAAA,kBAAAA,IAACE,EAAA,CAAW,SAAAS,CAAA,CAAK,EAC1BX,EAAAA,kBAAAA,IAAC,MAAA,CAAI,UAAU,wBAAyB,SAAAD,CAAA,CAAS,CAAA,CAAA,CAAA,EAErD,CAEJ,EA4CM+B,EAAe,CAAC,CACpB,OAAAC,EACA,QAAAnB,EACA,MAAAH,EACA,SAAAC,EACA,KAAAC,EACA,SAAAZ,EACA,UAAAiC,EAAY,GACZ,cAAelB,CACjB,IAAkB,CAChB,MAAMmB,EAAajB,EAAAA,OAAuB,IAAI,EACxC,CAAE,UAAAH,EAAW,YAAAqB,CAAA,EAAgBC,eAAa,CAC9C,QAAAvB,EACA,WAAAqB,CAAA,CACD,EACKG,EAAWC,EAAAA,cAAcC,EAAAA,YAAY,MAAM,EAEjD,GAAI,CAACP,EAAQ,OAAO,KAEpB,MAAMQ,EACJvC,EAAAA,kBAAAA,IAACQ,EAAA,CACC,OAAAuB,EACA,MAAAtB,EACA,SAAAC,EACA,KAAAC,EACA,QAASuB,EACT,UAAArB,EACA,cAAaC,EAEZ,SAAAf,CAAA,CAAA,EAIL,OAAOiC,GAAaI,EAClBpC,EAAAA,kBAAAA,IAACwC,EAAAA,cAAA,CAAc,OAAM,GAAC,IAAKP,EAAY,QAASC,EAC7C,SAAAK,CAAA,CACH,EAEAA,CAEJ,EAEaE,EAAQ,OAAO,OAAOX,EAAc,CAI/C,MAAOhC,EAIP,SAAUG,EAIV,KAAMC,EAKN,OAAQC,EAIR,QAASG,CACX,CAAC"}
1
+ {"version":3,"file":"Modal.cjs.js","sources":["../../../src/components/Modal/Modal.tsx"],"sourcesContent":["\"use client\";\n\nimport { useButton } from \"@react-aria/button\";\nimport { useDialog } from \"@react-aria/dialog\";\nimport { FocusScope } from \"@react-aria/focus\";\nimport { useModalOverlay, usePreventScroll } from \"@react-aria/overlays\";\nimport { mergeProps } from \"@react-aria/utils\";\nimport { useRef } from \"react\";\nimport { useOverlayTriggerState } from \"@react-stately/overlays\";\nimport { BREAKPOINTS } from \"../../constants\";\nimport { useBreakpoint } from \"../../hooks\";\nimport { useIsClosing } from \"../../hooks/useIsClosing\";\nimport { csx } from \"../../utils\";\nimport { Button, ButtonProps } from \"../Button/Button\";\nimport \"./Modal.css\";\nimport { ScreenOverlay } from \"../ScreenOverlay/ScreenOverlay\";\n\nconst ModalTitle = ({ children }: { children: React.ReactNode }) => {\n return <h2 className=\"proton-Modal__title\">{children}</h2>;\n};\n\nconst ModalSubtitle = ({ children }: { children: React.ReactNode }) => {\n return <h3 className=\"proton-Modal__subtitle\">{children}</h3>;\n};\n\nconst ModalBody = ({ children }: { children: React.ReactNode }) => {\n return <div className=\"proton-Modal__body\">{children}</div>;\n};\n\nconst ModalAction = (buttonProps: ButtonProps) => {\n return (\n <div className=\"proton-Modal__action\">\n <Button {...buttonProps} />\n </div>\n );\n};\n\nconst ModalActions = ({ children }: { children: React.ReactNode }) => {\n return (\n <FocusScope autoFocus>\n <div className=\"proton-Modal__actions\">{children}</div>\n </FocusScope>\n );\n};\n\nconst ModalContent = ({\n title,\n subtitle,\n body,\n onClose,\n children,\n isClosing,\n \"data-testid\": dataTestId,\n}: ModalProps & {\n isClosing: boolean;\n}) => {\n const ref = useRef<HTMLDivElement>(null);\n const state = useOverlayTriggerState({ isOpen: true, onOpenChange: onClose });\n const { modalProps } = useModalOverlay(\n {\n isDismissable: false, //handle dismiss behavior in useIsClosing\n },\n state,\n ref\n );\n\n const { dialogProps } = useDialog({ role: \"dialog\" }, ref);\n usePreventScroll();\n\n const closeButtonRef = useRef<HTMLButtonElement>(null);\n const { buttonProps: closeButtonProps } = useButton(\n {\n onPress: onClose,\n \"aria-label\": \"Close\",\n },\n closeButtonRef\n );\n\n return (\n <FocusScope contain restoreFocus autoFocus>\n <div\n data-testid={dataTestId}\n className={csx(\"proton-Modal\", isClosing && \"proton-Modal--closing\")}\n {...mergeProps(modalProps, dialogProps)}\n ref={ref}\n >\n <button\n name=\"Close\"\n className=\"proton-Modal__close-button\"\n {...closeButtonProps}\n ref={closeButtonRef}\n >\n ×\n </button>\n {title && <ModalTitle>{title}</ModalTitle>}\n {subtitle && <ModalSubtitle>{subtitle}</ModalSubtitle>}\n {body && <ModalBody>{body}</ModalBody>}\n <div className=\"proton-Modal__content\">{children}</div>\n </div>\n </FocusScope>\n );\n};\n\nexport interface ModalProps {\n /**\n * Optional body text content for the modal\n * */\n body?: string;\n /**\n * Content to render inside the modal\n * */\n children: React.ReactNode;\n /**\n * data-testid for the modal\n * */\n \"data-testid\"?: string;\n /**\n * Controls the visibility of the modal\n * */\n isOpen: boolean;\n /**\n * Whether to show the modal with an overlay background.\n * @default true\n * */\n isOverlay?: boolean;\n /**\n * Callback function when modal is closed\n * */\n onClose?: () => void;\n /**\n * Optional subtitle text below the modal title\n * */\n subtitle?: string;\n /**\n * Optional title text for the modal header\n * */\n title?: string;\n}\n\n/**\n * Modal component with overlay support and responsive behavior.\n *\n * API:\n * - {@link ModalProps}\n */\nconst ModalWrapper = ({\n isOpen,\n onClose,\n title,\n subtitle,\n body,\n children,\n isOverlay = true,\n \"data-testid\": dataTestId,\n}: ModalProps) => {\n const overlayRef = useRef<HTMLDivElement>(null);\n const { isClosing, handleClose } = useIsClosing({\n onClose,\n overlayRef,\n });\n const isMobile = useBreakpoint(BREAKPOINTS.MEDIUM);\n\n if (!isOpen) return null;\n\n const modalContent = (\n <ModalContent\n isOpen={isOpen}\n title={title}\n subtitle={subtitle}\n body={body}\n onClose={handleClose}\n isClosing={isClosing}\n data-testid={dataTestId}\n >\n {children}\n </ModalContent>\n );\n\n return isOverlay || isMobile ? (\n <ScreenOverlay fadeIn ref={overlayRef} onClose={handleClose}>\n {modalContent}\n </ScreenOverlay>\n ) : (\n modalContent\n );\n};\n\nexport const Modal = Object.assign(ModalWrapper, {\n /**\n * Renders a h2 styled title\n * */\n Title: ModalTitle,\n /**\n * Renders a h3 styled subtitle\n * */\n Subtitle: ModalSubtitle,\n /**\n * Renders a div styled body\n * */\n Body: ModalBody,\n /**\n * Renders a Proton Button action\n * - @prop buttonProps {@link ButtonProps}\n * */\n Action: ModalAction,\n /**\n * Renders a group of Proton Buttons\n * */\n Actions: ModalActions,\n});\n"],"names":["ModalTitle","children","jsx","ModalSubtitle","ModalBody","ModalAction","buttonProps","Button","ModalActions","FocusScope","ModalContent","title","subtitle","body","onClose","isClosing","dataTestId","ref","useRef","state","useOverlayTriggerState","modalProps","useModalOverlay","dialogProps","useDialog","usePreventScroll","closeButtonRef","closeButtonProps","useButton","jsxs","csx","mergeProps","ModalWrapper","isOpen","isOverlay","overlayRef","handleClose","useIsClosing","isMobile","useBreakpoint","BREAKPOINTS","modalContent","ScreenOverlay","Modal"],"mappings":"u8BAiBMA,EAAa,CAAC,CAAE,SAAAC,KACZC,EAAAA,kBAAAA,IAAA,KAAA,CAAG,UAAU,sBAAuB,SAAAD,CAAS,CAAA,EAGjDE,EAAgB,CAAC,CAAE,SAAAF,KACfC,EAAAA,kBAAAA,IAAA,KAAA,CAAG,UAAU,yBAA0B,SAAAD,CAAS,CAAA,EAGpDG,EAAY,CAAC,CAAE,SAAAH,KACXC,EAAAA,kBAAAA,IAAA,MAAA,CAAI,UAAU,qBAAsB,SAAAD,CAAS,CAAA,EAGjDI,EAAeC,GAEjBJ,wBAAC,OAAI,UAAU,uBACb,iCAACK,EAAQ,OAAA,CAAA,GAAGD,CAAa,CAAA,CAC3B,CAAA,EAIEE,EAAe,CAAC,CAAE,SAAAP,KAEpBC,EAAA,kBAAA,IAACO,cAAW,UAAS,GACnB,iCAAC,MAAI,CAAA,UAAU,wBAAyB,SAAAR,CAAS,CAAA,CACnD,CAAA,EAIES,EAAe,CAAC,CACpB,MAAAC,EACA,SAAAC,EACA,KAAAC,EACA,QAAAC,EACA,SAAAb,EACA,UAAAc,EACA,cAAeC,CACjB,IAEM,CACE,MAAAC,EAAMC,SAAuB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