@doist/reactist 25.0.0-beta.2 → 25.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (345) hide show
  1. package/README.md +35 -16
  2. package/dist/reactist.cjs.development.js +448 -422
  3. package/dist/reactist.cjs.development.js.map +1 -1
  4. package/dist/reactist.cjs.production.min.js +1 -1
  5. package/dist/reactist.cjs.production.min.js.map +1 -1
  6. package/es/alert/alert.js +13 -13
  7. package/es/alert/alert.js.map +1 -1
  8. package/es/alert/alert.module.css.js +1 -1
  9. package/es/avatar/avatar.js +6 -6
  10. package/es/avatar/avatar.js.map +1 -1
  11. package/es/avatar/avatar.module.css.js +1 -1
  12. package/es/avatar/utils.js.map +1 -1
  13. package/es/badge/badge.js +4 -4
  14. package/es/badge/badge.js.map +1 -1
  15. package/es/badge/badge.module.css.js +1 -1
  16. package/es/banner/banner.js +16 -16
  17. package/es/banner/banner.js.map +1 -1
  18. package/es/banner/banner.module.css.js +1 -1
  19. package/es/base-field/base-field.js +25 -25
  20. package/es/base-field/base-field.js.map +1 -1
  21. package/es/base-field/base-field.module.css.js +1 -1
  22. package/es/box/box.js +12 -12
  23. package/es/box/box.js.map +1 -1
  24. package/es/box/box.module.css.js +1 -1
  25. package/es/box/gap.module.css.js +1 -1
  26. package/es/box/margin.module.css.js +1 -1
  27. package/es/box/padding.module.css.js +1 -1
  28. package/es/box/width.module.css.js +1 -1
  29. package/es/button/button.js +19 -19
  30. package/es/button/button.js.map +1 -1
  31. package/es/button/button.module.css.js +1 -1
  32. package/es/checkbox-field/checkbox-field.js +16 -16
  33. package/es/checkbox-field/checkbox-field.js.map +1 -1
  34. package/es/checkbox-field/checkbox-field.module.css.js +1 -1
  35. package/es/checkbox-field/checkbox-icon.js +3 -3
  36. package/es/checkbox-field/checkbox-icon.js.map +1 -1
  37. package/es/checkbox-field/use-fork-ref.js.map +1 -1
  38. package/es/columns/columns.js +6 -6
  39. package/es/columns/columns.js.map +1 -1
  40. package/es/columns/columns.module.css.js +1 -1
  41. package/es/components/color-picker/color-picker.js +11 -11
  42. package/es/components/color-picker/color-picker.js.map +1 -1
  43. package/es/components/color-picker/index.js +1 -5
  44. package/es/components/color-picker/index.js.map +1 -1
  45. package/es/components/deprecated-button/deprecated-button.js +4 -4
  46. package/es/components/deprecated-button/deprecated-button.js.map +1 -1
  47. package/es/components/deprecated-button/index.js +1 -4
  48. package/es/components/deprecated-button/index.js.map +1 -1
  49. package/es/components/deprecated-dropdown/dropdown.js +11 -11
  50. package/es/components/deprecated-dropdown/dropdown.js.map +1 -1
  51. package/es/components/deprecated-dropdown/index.js +1 -4
  52. package/es/components/deprecated-dropdown/index.js.map +1 -1
  53. package/es/components/deprecated-input/index.js +1 -4
  54. package/es/components/deprecated-input/index.js.map +1 -1
  55. package/es/components/deprecated-input/input.js +3 -3
  56. package/es/components/deprecated-input/input.js.map +1 -1
  57. package/es/components/deprecated-select/index.js +1 -4
  58. package/es/components/deprecated-select/index.js.map +1 -1
  59. package/es/components/deprecated-select/select.js +3 -3
  60. package/es/components/deprecated-select/select.js.map +1 -1
  61. package/es/components/key-capturer/index.js +1 -5
  62. package/es/components/key-capturer/index.js.map +1 -1
  63. package/es/components/key-capturer/key-capturer.js +3 -3
  64. package/es/components/key-capturer/key-capturer.js.map +1 -1
  65. package/es/components/keyboard-shortcut/index.js +1 -4
  66. package/es/components/keyboard-shortcut/index.js.map +1 -1
  67. package/es/components/keyboard-shortcut/keyboard-shortcut.js +4 -4
  68. package/es/components/keyboard-shortcut/keyboard-shortcut.js.map +1 -1
  69. package/es/components/progress-bar/index.js +1 -4
  70. package/es/components/progress-bar/index.js.map +1 -1
  71. package/es/components/progress-bar/progress-bar.js +5 -5
  72. package/es/components/progress-bar/progress-bar.js.map +1 -1
  73. package/es/components/time/index.js +1 -4
  74. package/es/components/time/index.js.map +1 -1
  75. package/es/components/time/time-utils.js.map +1 -1
  76. package/es/components/time/time.js +5 -5
  77. package/es/components/time/time.js.map +1 -1
  78. package/es/divider/divider.js +4 -4
  79. package/es/divider/divider.js.map +1 -1
  80. package/es/divider/divider.module.css.js +1 -1
  81. package/es/heading/heading.js +5 -5
  82. package/es/heading/heading.js.map +1 -1
  83. package/es/heading/heading.module.css.js +1 -1
  84. package/es/hidden/hidden.js +5 -5
  85. package/es/hidden/hidden.js.map +1 -1
  86. package/es/hidden/hidden.module.css.js +1 -1
  87. package/es/hidden-visually/hidden-visually.js +4 -4
  88. package/es/hidden-visually/hidden-visually.js.map +1 -1
  89. package/es/hidden-visually/hidden-visually.module.css.js +1 -1
  90. package/es/icons/alert-icon.js +10 -10
  91. package/es/icons/alert-icon.js.map +1 -1
  92. package/es/icons/close-icon.js +3 -3
  93. package/es/icons/close-icon.js.map +1 -1
  94. package/es/icons/password-hidden-icon.js +6 -6
  95. package/es/icons/password-hidden-icon.js.map +1 -1
  96. package/es/icons/password-visible-icon.js +5 -5
  97. package/es/icons/password-visible-icon.js.map +1 -1
  98. package/es/index.js +13 -15
  99. package/es/index.js.map +1 -1
  100. package/es/inline/inline.js +2 -2
  101. package/es/inline/inline.js.map +1 -1
  102. package/es/loading/loading.js +3 -3
  103. package/es/loading/loading.js.map +1 -1
  104. package/es/menu/menu.js +32 -32
  105. package/es/menu/menu.js.map +1 -1
  106. package/es/modal/modal.js +45 -45
  107. package/es/modal/modal.js.map +1 -1
  108. package/es/modal/modal.module.css.js +1 -1
  109. package/es/notice/notice.js +8 -8
  110. package/es/notice/notice.js.map +1 -1
  111. package/es/notice/notice.module.css.js +1 -1
  112. package/es/password-field/password-field.js +7 -7
  113. package/es/password-field/password-field.js.map +1 -1
  114. package/es/prose/prose.js +4 -4
  115. package/es/prose/prose.js.map +1 -1
  116. package/es/prose/prose.module.css.js +1 -1
  117. package/es/select-field/select-field.js +11 -11
  118. package/es/select-field/select-field.js.map +1 -1
  119. package/es/select-field/select-field.module.css.js +1 -1
  120. package/es/spinner/spinner.js +9 -9
  121. package/es/spinner/spinner.js.map +1 -1
  122. package/es/spinner/spinner.module.css.js +1 -1
  123. package/es/stack/stack.js +4 -4
  124. package/es/stack/stack.js.map +1 -1
  125. package/es/switch-field/switch-field.js +18 -18
  126. package/es/switch-field/switch-field.js.map +1 -1
  127. package/es/switch-field/switch-field.module.css.js +1 -1
  128. package/es/tabs/tabs.js +23 -23
  129. package/es/tabs/tabs.js.map +1 -1
  130. package/es/tabs/tabs.module.css.js +1 -1
  131. package/es/text/text.js +5 -5
  132. package/es/text/text.js.map +1 -1
  133. package/es/text/text.module.css.js +1 -1
  134. package/es/text-area/text-area.js +14 -14
  135. package/es/text-area/text-area.js.map +1 -1
  136. package/es/text-area/text-area.module.css.js +1 -1
  137. package/es/text-field/text-field.js +13 -13
  138. package/es/text-field/text-field.js.map +1 -1
  139. package/es/text-field/text-field.module.css.js +1 -1
  140. package/es/text-link/text-link.js +5 -5
  141. package/es/text-link/text-link.js.map +1 -1
  142. package/es/text-link/text-link.module.css.js +1 -1
  143. package/es/toast/static-toast.js +5 -5
  144. package/es/toast/static-toast.js.map +1 -1
  145. package/es/toast/toast-animation.js.map +1 -1
  146. package/es/toast/toast.module.css.js +1 -1
  147. package/es/toast/use-toasts.js +4 -4
  148. package/es/toast/use-toasts.js.map +1 -1
  149. package/es/tooltip/tooltip.js +9 -9
  150. package/es/tooltip/tooltip.js.map +1 -1
  151. package/es/tooltip/tooltip.module.css.js +1 -1
  152. package/es/utils/common-helpers.js +2 -2
  153. package/es/utils/common-helpers.js.map +1 -1
  154. package/es/utils/polymorphism.js +2 -2
  155. package/es/utils/polymorphism.js.map +1 -1
  156. package/es/utils/responsive-props.js.map +1 -1
  157. package/lib/alert/alert.d.ts +3 -3
  158. package/lib/alert/alert.js +1 -1
  159. package/lib/alert/alert.js.map +1 -1
  160. package/lib/avatar/avatar.d.ts +2 -2
  161. package/lib/avatar/avatar.js +1 -1
  162. package/lib/avatar/avatar.js.map +1 -1
  163. package/lib/avatar/utils.js.map +1 -1
  164. package/lib/badge/badge.d.ts +2 -2
  165. package/lib/badge/badge.js +1 -1
  166. package/lib/badge/badge.js.map +1 -1
  167. package/lib/banner/banner.d.ts +2 -2
  168. package/lib/banner/banner.js +1 -1
  169. package/lib/banner/banner.js.map +1 -1
  170. package/lib/base-field/base-field.d.ts +9 -9
  171. package/lib/base-field/base-field.js +1 -1
  172. package/lib/base-field/base-field.js.map +1 -1
  173. package/lib/box/box.d.ts +15 -15
  174. package/lib/box/box.js +1 -1
  175. package/lib/box/box.js.map +1 -1
  176. package/lib/button/button.d.ts +4 -4
  177. package/lib/button/button.js +1 -1
  178. package/lib/button/button.js.map +1 -1
  179. package/lib/checkbox-field/checkbox-field.js +1 -1
  180. package/lib/checkbox-field/checkbox-field.js.map +1 -1
  181. package/lib/checkbox-field/checkbox-icon.d.ts +1 -1
  182. package/lib/checkbox-field/checkbox-icon.js +1 -1
  183. package/lib/checkbox-field/checkbox-icon.js.map +1 -1
  184. package/lib/checkbox-field/use-fork-ref.js.map +1 -1
  185. package/lib/columns/columns.d.ts +4 -4
  186. package/lib/columns/columns.js +1 -1
  187. package/lib/columns/columns.js.map +1 -1
  188. package/lib/components/color-picker/color-picker.d.ts +3 -3
  189. package/lib/components/color-picker/color-picker.js +1 -1
  190. package/lib/components/color-picker/color-picker.js.map +1 -1
  191. package/lib/components/deprecated-button/deprecated-button.d.ts +4 -4
  192. package/lib/components/deprecated-button/deprecated-button.js +1 -1
  193. package/lib/components/deprecated-button/deprecated-button.js.map +1 -1
  194. package/lib/components/deprecated-dropdown/dropdown.d.ts +5 -5
  195. package/lib/components/deprecated-dropdown/dropdown.js +1 -1
  196. package/lib/components/deprecated-dropdown/dropdown.js.map +1 -1
  197. package/lib/components/deprecated-input/input.js +1 -1
  198. package/lib/components/deprecated-input/input.js.map +1 -1
  199. package/lib/components/deprecated-select/select.d.ts +2 -2
  200. package/lib/components/deprecated-select/select.js +1 -1
  201. package/lib/components/deprecated-select/select.js.map +1 -1
  202. package/lib/components/key-capturer/key-capturer.d.ts +5 -5
  203. package/lib/components/key-capturer/key-capturer.js +1 -1
  204. package/lib/components/key-capturer/key-capturer.js.map +1 -1
  205. package/lib/components/keyboard-shortcut/keyboard-shortcut.d.ts +3 -3
  206. package/lib/components/keyboard-shortcut/keyboard-shortcut.js +1 -1
  207. package/lib/components/keyboard-shortcut/keyboard-shortcut.js.map +1 -1
  208. package/lib/components/progress-bar/progress-bar.d.ts +1 -1
  209. package/lib/components/progress-bar/progress-bar.js +1 -1
  210. package/lib/components/progress-bar/progress-bar.js.map +1 -1
  211. package/lib/components/time/time-utils.d.ts +1 -1
  212. package/lib/components/time/time-utils.js +1 -1
  213. package/lib/components/time/time-utils.js.map +1 -1
  214. package/lib/components/time/time.d.ts +2 -2
  215. package/lib/components/time/time.js +1 -1
  216. package/lib/components/time/time.js.map +1 -1
  217. package/lib/divider/divider.js +1 -1
  218. package/lib/divider/divider.js.map +1 -1
  219. package/lib/heading/heading.d.ts +2 -2
  220. package/lib/heading/heading.js +1 -1
  221. package/lib/heading/heading.js.map +1 -1
  222. package/lib/hidden/hidden.d.ts +4 -4
  223. package/lib/hidden/hidden.js +1 -1
  224. package/lib/hidden/hidden.js.map +1 -1
  225. package/lib/hidden-visually/hidden-visually.d.ts +1 -1
  226. package/lib/hidden-visually/hidden-visually.js +1 -1
  227. package/lib/hidden-visually/hidden-visually.js.map +1 -1
  228. package/lib/icons/alert-icon.js +1 -1
  229. package/lib/icons/alert-icon.js.map +1 -1
  230. package/lib/icons/close-icon.js +1 -1
  231. package/lib/icons/close-icon.js.map +1 -1
  232. package/lib/icons/password-hidden-icon.js +1 -1
  233. package/lib/icons/password-hidden-icon.js.map +1 -1
  234. package/lib/icons/password-visible-icon.js +1 -1
  235. package/lib/icons/password-visible-icon.js.map +1 -1
  236. package/lib/index.js +1 -1
  237. package/lib/inline/inline.d.ts +1 -1
  238. package/lib/inline/inline.js +1 -1
  239. package/lib/inline/inline.js.map +1 -1
  240. package/lib/loading/loading.d.ts +3 -3
  241. package/lib/loading/loading.js +1 -1
  242. package/lib/loading/loading.js.map +1 -1
  243. package/lib/menu/menu.d.ts +1 -1
  244. package/lib/menu/menu.js +1 -1
  245. package/lib/menu/menu.js.map +1 -1
  246. package/lib/modal/modal-stories-components.d.ts +2 -2
  247. package/lib/modal/modal.d.ts +4 -4
  248. package/lib/modal/modal.js +1 -1
  249. package/lib/modal/modal.js.map +1 -1
  250. package/lib/notice/notice.d.ts +1 -1
  251. package/lib/notice/notice.js +1 -1
  252. package/lib/notice/notice.js.map +1 -1
  253. package/lib/password-field/password-field.js +1 -1
  254. package/lib/password-field/password-field.js.map +1 -1
  255. package/lib/prose/prose.js +1 -1
  256. package/lib/prose/prose.js.map +1 -1
  257. package/lib/select-field/select-field.js +1 -1
  258. package/lib/select-field/select-field.js.map +1 -1
  259. package/lib/spinner/spinner.js +1 -1
  260. package/lib/spinner/spinner.js.map +1 -1
  261. package/lib/stack/stack.d.ts +1 -1
  262. package/lib/stack/stack.js +1 -1
  263. package/lib/stack/stack.js.map +1 -1
  264. package/lib/switch-field/switch-field.js +1 -1
  265. package/lib/switch-field/switch-field.js.map +1 -1
  266. package/lib/tabs/tabs.d.ts +5 -6
  267. package/lib/tabs/tabs.js +1 -1
  268. package/lib/tabs/tabs.js.map +1 -1
  269. package/lib/text/text.d.ts +1 -1
  270. package/lib/text/text.js +1 -1
  271. package/lib/text/text.js.map +1 -1
  272. package/lib/text-area/text-area.js +1 -1
  273. package/lib/text-area/text-area.js.map +1 -1
  274. package/lib/text-field/text-field.d.ts +1 -1
  275. package/lib/text-field/text-field.js +1 -1
  276. package/lib/text-field/text-field.js.map +1 -1
  277. package/lib/text-link/text-link.d.ts +1 -1
  278. package/lib/text-link/text-link.js +1 -1
  279. package/lib/text-link/text-link.js.map +1 -1
  280. package/lib/toast/static-toast.d.ts +2 -2
  281. package/lib/toast/static-toast.js +1 -1
  282. package/lib/toast/static-toast.js.map +1 -1
  283. package/lib/toast/toast-animation.d.ts +1 -1
  284. package/lib/toast/toast-animation.js.map +1 -1
  285. package/lib/toast/use-toasts.d.ts +3 -3
  286. package/lib/toast/use-toasts.js +1 -1
  287. package/lib/toast/use-toasts.js.map +1 -1
  288. package/lib/tooltip/tooltip.js +1 -1
  289. package/lib/tooltip/tooltip.js.map +1 -1
  290. package/lib/utils/common-helpers.js +1 -1
  291. package/lib/utils/common-helpers.js.map +1 -1
  292. package/lib/utils/common-types.d.ts +8 -8
  293. package/lib/utils/polymorphism.d.ts +9 -9
  294. package/lib/utils/polymorphism.js +1 -1
  295. package/lib/utils/polymorphism.js.map +1 -1
  296. package/lib/utils/responsive-props.d.ts +3 -3
  297. package/lib/utils/responsive-props.js.map +1 -1
  298. package/lib/utils/test-helpers.d.ts +1 -1
  299. package/package.json +13 -7
  300. package/lib/alert/alert.test.d.ts +0 -1
  301. package/lib/avatar/avatar.test.d.ts +0 -1
  302. package/lib/avatar/utils.test.d.ts +0 -1
  303. package/lib/badge/badge.test.d.ts +0 -1
  304. package/lib/banner/banner.test.d.ts +0 -1
  305. package/lib/box/box.test.d.ts +0 -1
  306. package/lib/button/button.test.d.ts +0 -1
  307. package/lib/checkbox-field/checkbox-field.test.d.ts +0 -1
  308. package/lib/columns/columns.test.d.ts +0 -1
  309. package/lib/components/color-picker/color-picker.test.d.ts +0 -1
  310. package/lib/components/deprecated-button/deprecated-button.test.d.ts +0 -1
  311. package/lib/components/deprecated-dropdown/dropdown.test.d.ts +0 -1
  312. package/lib/components/deprecated-input/input.test.d.ts +0 -1
  313. package/lib/components/deprecated-select/select.test.d.ts +0 -1
  314. package/lib/components/key-capturer/key-capturer.test.d.ts +0 -1
  315. package/lib/components/keyboard-shortcut/keyboard-shortcut.test.d.ts +0 -1
  316. package/lib/components/progress-bar/progress-bar.test.d.ts +0 -1
  317. package/lib/components/time/time-utils.test.d.ts +0 -1
  318. package/lib/components/time/time.test.d.ts +0 -1
  319. package/lib/heading/heading.test.d.ts +0 -1
  320. package/lib/hidden/hidden.test.d.ts +0 -1
  321. package/lib/hidden-visually/hidden-visually.test.d.ts +0 -1
  322. package/lib/inline/inline.test.d.ts +0 -1
  323. package/lib/loading/loading.test.d.ts +0 -1
  324. package/lib/menu/menu.test.d.ts +0 -1
  325. package/lib/modal/modal.test.d.ts +0 -1
  326. package/lib/notice/notice.test.d.ts +0 -1
  327. package/lib/password-field/password-field.test.d.ts +0 -1
  328. package/lib/prose/prose.test.d.ts +0 -1
  329. package/lib/select-field/select-field.test.d.ts +0 -1
  330. package/lib/stack/stack.test.d.ts +0 -1
  331. package/lib/switch-field/switch-field.test.d.ts +0 -1
  332. package/lib/tabs/tabs.test.d.ts +0 -1
  333. package/lib/text/text.test.d.ts +0 -1
  334. package/lib/text-area/text-area.test.d.ts +0 -1
  335. package/lib/text-field/text-field.test.d.ts +0 -1
  336. package/lib/toast/toast.test.d.ts +0 -1
  337. package/lib/tooltip/tooltip.test.d.ts +0 -1
  338. package/styles/color-picker.css +0 -9
  339. package/styles/deprecated-button.css +0 -7
  340. package/styles/dropdown.css +0 -8
  341. package/styles/progress-bar.css +0 -7
  342. package/styles/select.css +0 -1
  343. package/styles/time.css +0 -7
  344. /package/styles/{input.css → index.css} +0 -0
  345. /package/styles/{spinner.module.css.css → spinner.css} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"hidden.js","sources":["../../src/hidden/hidden.tsx"],"sourcesContent":["import * as React from 'react'\nimport { Box } from '../box'\nimport styles from './hidden.module.css'\nimport type { ResponsiveBreakpoints } from '../utils/responsive-props'\nimport { polymorphicComponent } from '../utils/polymorphism'\n\ntype AboveProp = {\n /**\n * Hides the element on viewport sizes equal or larger to the one given.\n *\n * It is not supported to pass it alongside `below`, and the resulting behavior is undefined\n * (most likely itʼll hide the element all the time to make it apparent that there's a problem).\n *\n * @see below\n */\n above: Exclude<ResponsiveBreakpoints, 'desktop'>\n below?: never\n}\n\ntype BelowProp = {\n /**\n * Hides the element on viewport sizes equal or smaller to the one given.\n *\n * It is not supported to pass it alongside `above`, and the resulting behavior is undefined\n * (most likely itʼll hide the element all the time to make it apparent that there's a problem).\n *\n * @see above\n */\n below: Exclude<ResponsiveBreakpoints, 'mobile'>\n above?: never\n}\n\ntype CommonProps = {\n children: React.ReactNode\n /**\n * hides the element when on print media.\n */\n print?: boolean\n /**\n * Useful if you want the element to be an inline element when it is visible.\n */\n display?: 'inline' | 'block'\n}\n\ntype HiddenProps = CommonProps & (AboveProp | BelowProp | Required<Pick<CommonProps, 'print'>>)\n\n/**\n * A component that allows to specify how to hide itself on certain responsive screen sizes, or on\n * print media.\n *\n * @see HiddenProps\n * @see HiddenVisually for hiding content only visually, while keeping it available for assistive\n * technologies.\n */\nconst Hidden = polymorphicComponent<'div', HiddenProps>(function Hidden(\n { display = 'block', children, exceptionallySetClassName, ...props },\n ref,\n) {\n const hiddenOnPrint = 'print' in props && props.print\n\n const hiddenOnDesktop = 'above' in props\n const hiddenOnMobile = 'below' in props\n const hiddenOnTablet =\n ('below' in props && props.below === 'desktop') ||\n ('above' in props && props.above === 'mobile')\n\n if (hiddenOnDesktop && hiddenOnMobile) {\n // eslint-disable-next-line no-console\n console.warn('<Hidden /> should receive either above=\"…\" or below=\"…\" but not both')\n }\n\n if (!hiddenOnDesktop && !hiddenOnMobile && !hiddenOnPrint) {\n // eslint-disable-next-line no-console\n console.warn('<Hidden /> did not receive any criteria to hide itself')\n }\n\n // We need to delete these so they do not get forwarded to the Box\n if ('above' in props) delete props['above']\n if ('below' in props) delete props['below']\n if ('print' in props) delete props['print']\n\n return (\n <Box\n {...props}\n ref={ref}\n className={[exceptionallySetClassName, hiddenOnPrint ? styles.hiddenOnPrint : null]}\n display={\n hiddenOnDesktop && hiddenOnMobile\n ? 'none'\n : {\n mobile: hiddenOnMobile ? 'none' : display,\n tablet: hiddenOnTablet ? 'none' : display,\n desktop: hiddenOnDesktop ? 'none' : display,\n }\n }\n >\n {children}\n </Box>\n )\n})\n\nexport { Hidden }\nexport type { HiddenProps }\n"],"names":["polymorphicComponent","ref","display","children","exceptionallySetClassName","props","hiddenOnPrint","print","hiddenOnDesktop","hiddenOnMobile","hiddenOnTablet","below","above","console","warn","React","Box","className","styles","mobile","tablet","desktop"],"mappings":"gUAsDeA,wBAAyC,WAEpDC,OADAC,QAAEA,EAAU,QAAZC,SAAqBA,EAArBC,0BAA+BA,KAA8BC,iCAG7D,MAAMC,EAAgB,UAAWD,GAASA,EAAME,MAE1CC,EAAkB,UAAWH,EAC7BI,EAAiB,UAAWJ,EAC5BK,EACD,UAAWL,GAAyB,YAAhBA,EAAMM,OAC1B,UAAWN,GAAyB,WAAhBA,EAAMO,MAiB/B,OAfIJ,GAAmBC,GAEnBI,QAAQC,KAAK,wEAGZN,GAAoBC,GAAmBH,GAExCO,QAAQC,KAAK,0DAIb,UAAWT,UAAcA,EAAK,MAC9B,UAAWA,UAAcA,EAAK,MAC9B,UAAWA,UAAcA,EAAK,MAG9BU,gBAACC,yCACOX,OACJJ,IAAKA,EACLgB,UAAW,CAACb,EAA2BE,EAAgBY,UAAOZ,cAAgB,MAC9EJ,QACIM,GAAmBC,EACb,OACA,CACIU,OAAQV,EAAiB,OAASP,EAClCkB,OAAQV,EAAiB,OAASR,EAClCmB,QAASb,EAAkB,OAASN,KAIjDC"}
1
+ {"version":3,"file":"hidden.js","sources":["../../src/hidden/hidden.tsx"],"sourcesContent":["import * as React from 'react'\nimport { Box } from '../box'\nimport styles from './hidden.module.css'\nimport type { ResponsiveBreakpoints } from '../utils/responsive-props'\nimport { polymorphicComponent } from '../utils/polymorphism'\n\ntype AboveProp = {\n /**\n * Hides the element on viewport sizes equal or larger to the one given.\n *\n * It is not supported to pass it alongside `below`, and the resulting behavior is undefined\n * (most likely itʼll hide the element all the time to make it apparent that there's a problem).\n *\n * @see below\n */\n above: Exclude<ResponsiveBreakpoints, 'desktop'>\n below?: never\n}\n\ntype BelowProp = {\n /**\n * Hides the element on viewport sizes equal or smaller to the one given.\n *\n * It is not supported to pass it alongside `above`, and the resulting behavior is undefined\n * (most likely itʼll hide the element all the time to make it apparent that there's a problem).\n *\n * @see above\n */\n below: Exclude<ResponsiveBreakpoints, 'mobile'>\n above?: never\n}\n\ntype CommonProps = {\n children: React.ReactNode\n /**\n * hides the element when on print media.\n */\n print?: boolean\n /**\n * Useful if you want the element to be an inline element when it is visible.\n */\n display?: 'inline' | 'block'\n}\n\ntype HiddenProps = CommonProps & (AboveProp | BelowProp | Required<Pick<CommonProps, 'print'>>)\n\n/**\n * A component that allows to specify how to hide itself on certain responsive screen sizes, or on\n * print media.\n *\n * @see HiddenProps\n * @see HiddenVisually for hiding content only visually, while keeping it available for assistive\n * technologies.\n */\nconst Hidden = polymorphicComponent<'div', HiddenProps>(function Hidden(\n { display = 'block', children, exceptionallySetClassName, ...props },\n ref,\n) {\n const hiddenOnPrint = 'print' in props && props.print\n\n const hiddenOnDesktop = 'above' in props\n const hiddenOnMobile = 'below' in props\n const hiddenOnTablet =\n ('below' in props && props.below === 'desktop') ||\n ('above' in props && props.above === 'mobile')\n\n if (hiddenOnDesktop && hiddenOnMobile) {\n // eslint-disable-next-line no-console\n console.warn('<Hidden /> should receive either above=\"…\" or below=\"…\" but not both')\n }\n\n if (!hiddenOnDesktop && !hiddenOnMobile && !hiddenOnPrint) {\n // eslint-disable-next-line no-console\n console.warn('<Hidden /> did not receive any criteria to hide itself')\n }\n\n // We need to delete these so they do not get forwarded to the Box\n if ('above' in props) delete props['above']\n if ('below' in props) delete props['below']\n if ('print' in props) delete props['print']\n\n return (\n <Box\n {...props}\n ref={ref}\n className={[exceptionallySetClassName, hiddenOnPrint ? styles.hiddenOnPrint : null]}\n display={\n hiddenOnDesktop && hiddenOnMobile\n ? 'none'\n : {\n mobile: hiddenOnMobile ? 'none' : display,\n tablet: hiddenOnTablet ? 'none' : display,\n desktop: hiddenOnDesktop ? 'none' : display,\n }\n }\n >\n {children}\n </Box>\n )\n})\n\nexport { Hidden }\nexport type { HiddenProps }\n"],"names":["polymorphicComponent","_ref","ref","display","children","exceptionallySetClassName","props","_objectWithoutProperties","objectWithoutProperties","_excluded","hiddenOnPrint","print","hiddenOnDesktop","hiddenOnMobile","hiddenOnTablet","below","above","console","warn","React","createElement","Box","className","styles","mobile","tablet","desktop"],"mappings":"2lBAsDeA,EAAAA,sBAAyC,SAAAC,EAEpDC,GAAG,IADHC,QAAEA,EAAU,QAAZC,SAAqBA,EAArBC,0BAA+BA,GAC5BJ,EAD0DK,EAC1DC,EAAAC,wBAAAP,EAAAQ,GAEH,MAAMC,EAAgB,UAAWJ,GAASA,EAAMK,MAE1CC,EAAkB,UAAWN,EAC7BO,EAAiB,UAAWP,EAC5BQ,EACD,UAAWR,GAAyB,YAAhBA,EAAMS,OAC1B,UAAWT,GAAyB,WAAhBA,EAAMU,MAiB/B,OAfIJ,GAAmBC,GAEnBI,QAAQC,KAAK,wEAGZN,GAAoBC,GAAmBH,GAExCO,QAAQC,KAAK,0DAIb,UAAWZ,UAAcA,EAAK,MAC9B,UAAWA,UAAcA,EAAK,MAC9B,UAAWA,UAAcA,EAAK,MAG9Ba,EAAAC,cAACC,yCACOf,GADR,GAAA,CAEIJ,IAAKA,EACLoB,UAAW,CAACjB,EAA2BK,EAAgBa,EAAAA,QAAOb,cAAgB,MAC9EP,QACIS,GAAmBC,EACb,OACA,CACIW,OAAQX,EAAiB,OAASV,EAClCsB,OAAQX,EAAiB,OAASX,EAClCuB,QAASd,EAAkB,OAAST,KAIjDC"}
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- declare type Props = {
2
+ type Props = {
3
3
  children: React.ReactNode;
4
4
  };
5
5
  /**
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../_virtual/_rollupPluginBabelHelpers.js"),r=require("react"),l=require("../utils/polymorphism.js"),o=require("../box/box.js"),i=require("./hidden-visually.module.css.js");exports.HiddenVisually=l.polymorphicComponent((function(l,s){return r.createElement(o.Box,e.objectSpread2(e.objectSpread2({},l),{},{ref:s,position:"absolute",overflow:"hidden",className:i.default.hiddenVisually}))}));
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../_virtual/_rollupPluginBabelHelpers.js"),r=require("react"),t=require("../utils/polymorphism.js"),o=require("../box/box.js"),u=require("./hidden-visually.module.css.js");function i(e){if(e&&e.__esModule)return e;var r=Object.create(null);return e&&Object.keys(e).forEach((function(t){if("default"!==t){var o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,o.get?o:{enumerable:!0,get:function(){return e[t]}})}})),r.default=e,r}var l=i(r);exports.HiddenVisually=t.polymorphicComponent((function(r,t){return l.createElement(o.Box,e.objectSpread2(e.objectSpread2({},r),{},{ref:t,position:"absolute",overflow:"hidden",className:u.default.hiddenVisually}))}));
2
2
  //# sourceMappingURL=hidden-visually.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"hidden-visually.js","sources":["../../src/hidden-visually/hidden-visually.tsx"],"sourcesContent":["import * as React from 'react'\nimport { polymorphicComponent } from '../utils/polymorphism'\nimport { Box } from '../box'\nimport styles from './hidden-visually.module.css'\n\ntype Props = {\n children: React.ReactNode\n}\n\n/**\n * Provides content to assistive technologies while hiding it from the screen.\n *\n * @see Hidden for fully hiding content, and only under certain conditions.\n */\nconst HiddenVisually = polymorphicComponent<'div', Props, 'omitClassName'>(function HiddenVisually(\n props,\n ref,\n) {\n return (\n <Box\n {...props}\n ref={ref}\n position=\"absolute\"\n overflow=\"hidden\"\n className={styles.hiddenVisually}\n />\n )\n})\n\nexport { HiddenVisually }\n"],"names":["polymorphicComponent","props","ref","React","Box","position","overflow","className","styles","hiddenVisually"],"mappings":"sRAcuBA,wBAAoD,SACvEC,EACAC,GAEA,OACIC,gBAACC,yCACOH,OACJC,IAAKA,EACLG,SAAS,WACTC,SAAS,SACTC,UAAWC,UAAOC"}
1
+ {"version":3,"file":"hidden-visually.js","sources":["../../src/hidden-visually/hidden-visually.tsx"],"sourcesContent":["import * as React from 'react'\nimport { polymorphicComponent } from '../utils/polymorphism'\nimport { Box } from '../box'\nimport styles from './hidden-visually.module.css'\n\ntype Props = {\n children: React.ReactNode\n}\n\n/**\n * Provides content to assistive technologies while hiding it from the screen.\n *\n * @see Hidden for fully hiding content, and only under certain conditions.\n */\nconst HiddenVisually = polymorphicComponent<'div', Props, 'omitClassName'>(function HiddenVisually(\n props,\n ref,\n) {\n return (\n <Box\n {...props}\n ref={ref}\n position=\"absolute\"\n overflow=\"hidden\"\n className={styles.hiddenVisually}\n />\n )\n})\n\nexport { HiddenVisually }\n"],"names":["polymorphicComponent","props","ref","React","createElement","Box","position","overflow","className","styles","hiddenVisually"],"mappings":"ijBAcuBA,EAAAA,sBAAoD,SACvEC,EACAC,GAEA,OACIC,EAACC,cAAAC,yCACOJ,GADR,GAAA,CAEIC,IAAKA,EACLI,SAAS,WACTC,SAAS,SACTC,UAAWC,EAAM,QAACC"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../_virtual/_rollupPluginBabelHelpers.js"),t=require("react");const l=["tone"],r={info:function(l){return t.createElement("svg",e.objectSpread2({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},l),t.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-8-3.94a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM10.25 10a.75.75 0 0 0 0 1.5h1.25V15h-1.25a.75.75 0 0 0 0 1.5h3.5a.75.75 0 0 0 0-1.5H13v-4.25a.75.75 0 0 0-.75-.75h-2Z",fill:"currentColor"}))},positive:function(l){return t.createElement("svg",e.objectSpread2({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},l),t.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-5.555-2.99a.75.75 0 0 1 1.06 1.06l-5.303 5.304a.748.748 0 0 1-1.061 0l-2.475-2.475a.75.75 0 0 1 1.06-1.06l1.945 1.944 4.774-4.773Z",fill:"currentColor"}))},caution:function(l){return t.createElement("svg",e.objectSpread2({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},l),t.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m10.272 4.962-7.018 12.03A2 2 0 0 0 4.982 20h14.036a2 2 0 0 0 1.727-3.008l-7.018-12.03a2 2 0 0 0-3.455 0ZM13 16.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm-.014-7.013A.987.987 0 0 0 12 8.5h-.028l-.027.002a.987.987 0 0 0-.93 1.04l.236 4.25c.052.944 1.445.944 1.498 0l.236-4.25a1.925 1.925 0 0 0 .001-.055Z",fill:"currentColor"}))},critical:function(l){return t.createElement("svg",e.objectSpread2({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},l),t.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.9866 2.25049C12.3729 1.91683 11.6271 1.91683 11.0134 2.25049L4.04793 6.03744C3.40122 6.38904 2.99999 7.05702 2.99999 7.78208V15.2184C2.99999 15.9435 3.40122 16.6115 4.04793 16.963L11.0134 20.75C11.6271 21.0837 12.3729 21.0837 12.9866 20.75L19.9521 16.963C20.5988 16.6114 21 15.9435 21 15.2184V7.78208C21 7.05701 20.5988 6.38904 19.9521 6.03744L12.9866 2.25049ZM12 7.00024C12.5448 7.00024 12.9865 7.44191 12.9865 7.98674C12.9864 8.00043 12.9863 8.00727 12.9861 8.01411C12.9859 8.02095 12.9856 8.02779 12.985 8.04146L12.7489 12.2918C12.6964 13.2364 11.3036 13.2364 11.2512 12.2918L11.015 8.04146C10.9848 7.49747 11.4013 7.03198 11.9453 7.00176L11.9726 7.00062L12 7.00024ZM13 15.0002C13 15.5525 12.5523 16.0002 12 16.0002C11.4477 16.0002 11 15.5525 11 15.0002C11 14.448 11.4477 14.0002 12 14.0002C12.5523 14.0002 13 14.448 13 15.0002Z",fill:"currentColor"}))}};exports.AlertIcon=function(n){let{tone:o}=n,i=e.objectWithoutProperties(n,l);const a=r[o];return a?t.createElement(a,e.objectSpread2({},i)):null};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../_virtual/_rollupPluginBabelHelpers.js");function t(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var l=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,l.get?l:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,t}var r=t(require("react"));const l=["tone"],n={info:function(t){return r.createElement("svg",e.objectSpread2({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},t),r.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-8-3.94a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM10.25 10a.75.75 0 0 0 0 1.5h1.25V15h-1.25a.75.75 0 0 0 0 1.5h3.5a.75.75 0 0 0 0-1.5H13v-4.25a.75.75 0 0 0-.75-.75h-2Z",fill:"currentColor"}))},positive:function(t){return r.createElement("svg",e.objectSpread2({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},t),r.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-5.555-2.99a.75.75 0 0 1 1.06 1.06l-5.303 5.304a.748.748 0 0 1-1.061 0l-2.475-2.475a.75.75 0 0 1 1.06-1.06l1.945 1.944 4.774-4.773Z",fill:"currentColor"}))},caution:function(t){return r.createElement("svg",e.objectSpread2({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},t),r.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m10.272 4.962-7.018 12.03A2 2 0 0 0 4.982 20h14.036a2 2 0 0 0 1.727-3.008l-7.018-12.03a2 2 0 0 0-3.455 0ZM13 16.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm-.014-7.013A.987.987 0 0 0 12 8.5h-.028l-.027.002a.987.987 0 0 0-.93 1.04l.236 4.25c.052.944 1.445.944 1.498 0l.236-4.25a1.925 1.925 0 0 0 .001-.055Z",fill:"currentColor"}))},critical:function(t){return r.createElement("svg",e.objectSpread2({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},t),r.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.9866 2.25049C12.3729 1.91683 11.6271 1.91683 11.0134 2.25049L4.04793 6.03744C3.40122 6.38904 2.99999 7.05702 2.99999 7.78208V15.2184C2.99999 15.9435 3.40122 16.6115 4.04793 16.963L11.0134 20.75C11.6271 21.0837 12.3729 21.0837 12.9866 20.75L19.9521 16.963C20.5988 16.6114 21 15.9435 21 15.2184V7.78208C21 7.05701 20.5988 6.38904 19.9521 6.03744L12.9866 2.25049ZM12 7.00024C12.5448 7.00024 12.9865 7.44191 12.9865 7.98674C12.9864 8.00043 12.9863 8.00727 12.9861 8.01411C12.9859 8.02095 12.9856 8.02779 12.985 8.04146L12.7489 12.2918C12.6964 13.2364 11.3036 13.2364 11.2512 12.2918L11.015 8.04146C10.9848 7.49747 11.4013 7.03198 11.9453 7.00176L11.9726 7.00062L12 7.00024ZM13 15.0002C13 15.5525 12.5523 16.0002 12 16.0002C11.4477 16.0002 11 15.5525 11 15.0002C11 14.448 11.4477 14.0002 12 14.0002C12.5523 14.0002 13 14.448 13 15.0002Z",fill:"currentColor"}))}};exports.AlertIcon=function(t){let{tone:o}=t,i=e.objectWithoutProperties(t,l);const a=n[o];return a?r.createElement(a,e.objectSpread2({},i)):null};
2
2
  //# sourceMappingURL=alert-icon.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"alert-icon.js","sources":["../../src/icons/alert-icon.tsx"],"sourcesContent":["import * as React from 'react'\nimport type { AlertTone } from '../utils/common-types'\n\nconst alertIconForTone: Record<AlertTone, typeof AlertInfoIcon> = {\n info: AlertInfoIcon,\n positive: AlertPositiveIcon,\n caution: AlertCautionIcon,\n critical: AlertCriticalIcon,\n}\n\nfunction AlertIcon({ tone, ...props }: JSX.IntrinsicElements['svg'] & { tone: AlertTone }) {\n const Icon = alertIconForTone[tone]\n return Icon ? <Icon {...props} /> : null\n}\n\nfunction AlertInfoIcon(props: JSX.IntrinsicElements['svg']) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n {...props}\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-8-3.94a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM10.25 10a.75.75 0 0 0 0 1.5h1.25V15h-1.25a.75.75 0 0 0 0 1.5h3.5a.75.75 0 0 0 0-1.5H13v-4.25a.75.75 0 0 0-.75-.75h-2Z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n}\n\nfunction AlertPositiveIcon(props: JSX.IntrinsicElements['svg']) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n {...props}\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-5.555-2.99a.75.75 0 0 1 1.06 1.06l-5.303 5.304a.748.748 0 0 1-1.061 0l-2.475-2.475a.75.75 0 0 1 1.06-1.06l1.945 1.944 4.774-4.773Z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n}\n\nfunction AlertCautionIcon(props: JSX.IntrinsicElements['svg']) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n {...props}\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"m10.272 4.962-7.018 12.03A2 2 0 0 0 4.982 20h14.036a2 2 0 0 0 1.727-3.008l-7.018-12.03a2 2 0 0 0-3.455 0ZM13 16.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm-.014-7.013A.987.987 0 0 0 12 8.5h-.028l-.027.002a.987.987 0 0 0-.93 1.04l.236 4.25c.052.944 1.445.944 1.498 0l.236-4.25a1.925 1.925 0 0 0 .001-.055Z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n}\n\nfunction AlertCriticalIcon(props: JSX.IntrinsicElements['svg']) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n {...props}\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M12.9866 2.25049C12.3729 1.91683 11.6271 1.91683 11.0134 2.25049L4.04793 6.03744C3.40122 6.38904 2.99999 7.05702 2.99999 7.78208V15.2184C2.99999 15.9435 3.40122 16.6115 4.04793 16.963L11.0134 20.75C11.6271 21.0837 12.3729 21.0837 12.9866 20.75L19.9521 16.963C20.5988 16.6114 21 15.9435 21 15.2184V7.78208C21 7.05701 20.5988 6.38904 19.9521 6.03744L12.9866 2.25049ZM12 7.00024C12.5448 7.00024 12.9865 7.44191 12.9865 7.98674C12.9864 8.00043 12.9863 8.00727 12.9861 8.01411C12.9859 8.02095 12.9856 8.02779 12.985 8.04146L12.7489 12.2918C12.6964 13.2364 11.3036 13.2364 11.2512 12.2918L11.015 8.04146C10.9848 7.49747 11.4013 7.03198 11.9453 7.00176L11.9726 7.00062L12 7.00024ZM13 15.0002C13 15.5525 12.5523 16.0002 12 16.0002C11.4477 16.0002 11 15.5525 11 15.0002C11 14.448 11.4477 14.0002 12 14.0002C12.5523 14.0002 13 14.448 13 15.0002Z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n}\n\nexport { AlertIcon }\n"],"names":["alertIconForTone","info","props","React","xmlns","width","height","viewBox","fillRule","clipRule","d","fill","positive","caution","critical","tone","Icon"],"mappings":"kKAGMA,EAA4D,CAC9DC,KAWJ,SAAuBC,GACnB,OACIC,uCACIC,MAAM,6BACNC,MAAM,KACNC,OAAO,KACPC,QAAQ,aACJL,GAEJC,wBACIK,SAAS,UACTC,SAAS,UACTC,EAAE,mMACFC,KAAK,mBAvBjBC,SA6BJ,SAA2BV,GACvB,OACIC,uCACIC,MAAM,6BACNC,MAAM,KACNC,OAAO,KACPC,QAAQ,aACJL,GAEJC,wBACIK,SAAS,UACTC,SAAS,UACTC,EAAE,4KACFC,KAAK,mBAzCjBE,QA+CJ,SAA0BX,GACtB,OACIC,uCACIC,MAAM,6BACNC,MAAM,KACNC,OAAO,KACPC,QAAQ,aACJL,GAEJC,wBACIK,SAAS,UACTC,SAAS,UACTC,EAAE,uSACFC,KAAK,mBA3DjBG,SAiEJ,SAA2BZ,GACvB,OACIC,uCACIC,MAAM,6BACNC,MAAM,KACNC,OAAO,KACPC,QAAQ,aACJL,GAEJC,wBACIK,SAAS,UACTC,SAAS,UACTC,EAAE,s0BACFC,KAAK,sCA3ErB,gBAAmBI,KAAEA,KAASb,iCAC1B,MAAMc,EAAOhB,EAAiBe,GAC9B,OAAOC,EAAOb,gBAACa,qBAASd,IAAY"}
1
+ {"version":3,"file":"alert-icon.js","sources":["../../src/icons/alert-icon.tsx"],"sourcesContent":["import * as React from 'react'\nimport type { AlertTone } from '../utils/common-types'\n\nconst alertIconForTone: Record<AlertTone, typeof AlertInfoIcon> = {\n info: AlertInfoIcon,\n positive: AlertPositiveIcon,\n caution: AlertCautionIcon,\n critical: AlertCriticalIcon,\n}\n\nfunction AlertIcon({ tone, ...props }: JSX.IntrinsicElements['svg'] & { tone: AlertTone }) {\n const Icon = alertIconForTone[tone]\n return Icon ? <Icon {...props} /> : null\n}\n\nfunction AlertInfoIcon(props: JSX.IntrinsicElements['svg']) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n {...props}\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-8-3.94a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM10.25 10a.75.75 0 0 0 0 1.5h1.25V15h-1.25a.75.75 0 0 0 0 1.5h3.5a.75.75 0 0 0 0-1.5H13v-4.25a.75.75 0 0 0-.75-.75h-2Z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n}\n\nfunction AlertPositiveIcon(props: JSX.IntrinsicElements['svg']) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n {...props}\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-5.555-2.99a.75.75 0 0 1 1.06 1.06l-5.303 5.304a.748.748 0 0 1-1.061 0l-2.475-2.475a.75.75 0 0 1 1.06-1.06l1.945 1.944 4.774-4.773Z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n}\n\nfunction AlertCautionIcon(props: JSX.IntrinsicElements['svg']) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n {...props}\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"m10.272 4.962-7.018 12.03A2 2 0 0 0 4.982 20h14.036a2 2 0 0 0 1.727-3.008l-7.018-12.03a2 2 0 0 0-3.455 0ZM13 16.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm-.014-7.013A.987.987 0 0 0 12 8.5h-.028l-.027.002a.987.987 0 0 0-.93 1.04l.236 4.25c.052.944 1.445.944 1.498 0l.236-4.25a1.925 1.925 0 0 0 .001-.055Z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n}\n\nfunction AlertCriticalIcon(props: JSX.IntrinsicElements['svg']) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n {...props}\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M12.9866 2.25049C12.3729 1.91683 11.6271 1.91683 11.0134 2.25049L4.04793 6.03744C3.40122 6.38904 2.99999 7.05702 2.99999 7.78208V15.2184C2.99999 15.9435 3.40122 16.6115 4.04793 16.963L11.0134 20.75C11.6271 21.0837 12.3729 21.0837 12.9866 20.75L19.9521 16.963C20.5988 16.6114 21 15.9435 21 15.2184V7.78208C21 7.05701 20.5988 6.38904 19.9521 6.03744L12.9866 2.25049ZM12 7.00024C12.5448 7.00024 12.9865 7.44191 12.9865 7.98674C12.9864 8.00043 12.9863 8.00727 12.9861 8.01411C12.9859 8.02095 12.9856 8.02779 12.985 8.04146L12.7489 12.2918C12.6964 13.2364 11.3036 13.2364 11.2512 12.2918L11.015 8.04146C10.9848 7.49747 11.4013 7.03198 11.9453 7.00176L11.9726 7.00062L12 7.00024ZM13 15.0002C13 15.5525 12.5523 16.0002 12 16.0002C11.4477 16.0002 11 15.5525 11 15.0002C11 14.448 11.4477 14.0002 12 14.0002C12.5523 14.0002 13 14.448 13 15.0002Z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n}\n\nexport { AlertIcon }\n"],"names":["alertIconForTone","info","props","React","createElement","_objectSpread","xmlns","width","height","viewBox","fillRule","clipRule","d","fill","positive","caution","critical","_ref","tone","_objectWithoutProperties","objectWithoutProperties","_excluded","Icon"],"mappings":"ybAGMA,EAA4D,CAC9DC,KAWJ,SAAuBC,GACnB,OACIC,EACIC,cAAA,MADJC,gBAAA,CACIC,MAAM,6BACNC,MAAM,KACNC,OAAO,KACPC,QAAQ,aACJP,GAEJC,EAAAC,cAAA,OAAA,CACIM,SAAS,UACTC,SAAS,UACTC,EAAE,mMACFC,KAAK,mBAvBjBC,SA6BJ,SAA2BZ,GACvB,OACIC,EACIC,cAAA,MADJC,gBAAA,CACIC,MAAM,6BACNC,MAAM,KACNC,OAAO,KACPC,QAAQ,aACJP,GAEJC,EAAAC,cAAA,OAAA,CACIM,SAAS,UACTC,SAAS,UACTC,EAAE,4KACFC,KAAK,mBAzCjBE,QA+CJ,SAA0Bb,GACtB,OACIC,EACIC,cAAA,MADJC,gBAAA,CACIC,MAAM,6BACNC,MAAM,KACNC,OAAO,KACPC,QAAQ,aACJP,GAEJC,EAAAC,cAAA,OAAA,CACIM,SAAS,UACTC,SAAS,UACTC,EAAE,uSACFC,KAAK,mBA3DjBG,SAiEJ,SAA2Bd,GACvB,OACIC,EACIC,cAAA,MADJC,gBAAA,CACIC,MAAM,6BACNC,MAAM,KACNC,OAAO,KACPC,QAAQ,aACJP,GAEJC,EAAAC,cAAA,OAAA,CACIM,SAAS,UACTC,SAAS,UACTC,EAAE,s0BACFC,KAAK,sCA3ErB,SAAyFI,GAAA,IAAtEC,KAAEA,GAAoED,EAA3Df,EAA2DiB,EAAAC,wBAAAH,EAAAI,GACrF,MAAMC,EAAOtB,EAAiBkB,GAC9B,OAAOI,EAAOnB,EAACC,cAAAkB,EAASpB,EAAAA,cAAAA,GAAAA,IAAY"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../_virtual/_rollupPluginBabelHelpers.js"),r=require("react");exports.CloseIcon=function(l){return r.createElement("svg",e.objectSpread2({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24"},l),r.createElement("path",{fill:"currentColor",d:"M5.146 5.146a.5.5 0 0 1 .708 0L12 11.293l6.146-6.147a.5.5 0 0 1 .638-.057l.07.057a.5.5 0 0 1 0 .708L12.707 12l6.147 6.146a.5.5 0 0 1 .057.638l-.057.07a.5.5 0 0 1-.708 0L12 12.707l-6.146 6.147a.5.5 0 0 1-.638.057l-.07-.057a.5.5 0 0 1 0-.708L11.293 12 5.146 5.854a.5.5 0 0 1-.057-.638z"}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../_virtual/_rollupPluginBabelHelpers.js");function r(e){if(e&&e.__esModule)return e;var r=Object.create(null);return e&&Object.keys(e).forEach((function(t){if("default"!==t){var l=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,l.get?l:{enumerable:!0,get:function(){return e[t]}})}})),r.default=e,r}var t=r(require("react"));exports.CloseIcon=function(r){return t.createElement("svg",e.objectSpread2({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24"},r),t.createElement("path",{fill:"currentColor",d:"M5.146 5.146a.5.5 0 0 1 .708 0L12 11.293l6.146-6.147a.5.5 0 0 1 .638-.057l.07.057a.5.5 0 0 1 0 .708L12.707 12l6.147 6.146a.5.5 0 0 1 .057.638l-.057.07a.5.5 0 0 1-.708 0L12 12.707l-6.146 6.147a.5.5 0 0 1-.638.057l-.07-.057a.5.5 0 0 1 0-.708L11.293 12 5.146 5.854a.5.5 0 0 1-.057-.638z"}))};
2
2
  //# sourceMappingURL=close-icon.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"close-icon.js","sources":["../../src/icons/close-icon.tsx"],"sourcesContent":["import * as React from 'react'\n\nfunction CloseIcon(props: JSX.IntrinsicElements['svg']) {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" {...props}>\n <path\n fill=\"currentColor\"\n d=\"M5.146 5.146a.5.5 0 0 1 .708 0L12 11.293l6.146-6.147a.5.5 0 0 1 .638-.057l.07.057a.5.5 0 0 1 0 .708L12.707 12l6.147 6.146a.5.5 0 0 1 .057.638l-.057.07a.5.5 0 0 1-.708 0L12 12.707l-6.146 6.147a.5.5 0 0 1-.638.057l-.07-.057a.5.5 0 0 1 0-.708L11.293 12 5.146 5.854a.5.5 0 0 1-.057-.638z\"\n />\n </svg>\n )\n}\n\nexport { CloseIcon }\n"],"names":["props","React","xmlns","width","height","fill","d"],"mappings":"mKAEA,SAAmBA,GACf,OACIC,uCAAKC,MAAM,6BAA6BC,MAAM,KAAKC,OAAO,MAASJ,GAC/DC,wBACII,KAAK,eACLC,EAAE"}
1
+ {"version":3,"file":"close-icon.js","sources":["../../src/icons/close-icon.tsx"],"sourcesContent":["import * as React from 'react'\n\nfunction CloseIcon(props: JSX.IntrinsicElements['svg']) {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" {...props}>\n <path\n fill=\"currentColor\"\n d=\"M5.146 5.146a.5.5 0 0 1 .708 0L12 11.293l6.146-6.147a.5.5 0 0 1 .638-.057l.07.057a.5.5 0 0 1 0 .708L12.707 12l6.147 6.146a.5.5 0 0 1 .057.638l-.057.07a.5.5 0 0 1-.708 0L12 12.707l-6.146 6.147a.5.5 0 0 1-.638.057l-.07-.057a.5.5 0 0 1 0-.708L11.293 12 5.146 5.854a.5.5 0 0 1-.057-.638z\"\n />\n </svg>\n )\n}\n\nexport { CloseIcon }\n"],"names":["props","React","createElement","_objectSpread","xmlns","width","height","fill","d"],"mappings":"0bAEA,SAAmBA,GACf,OACIC,EAAAC,cAAA,MAAAC,gBAAA,CAAKC,MAAM,6BAA6BC,MAAM,KAAKC,OAAO,MAASN,GAC/DC,EACIC,cAAA,OAAA,CAAAK,KAAK,eACLC,EAAE"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../_virtual/_rollupPluginBabelHelpers.js"),t=require("react");exports.PasswordHiddenIcon=function(r){return t.createElement("svg",e.objectSpread2({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24"},r),t.createElement("g",{fill:"gray",fillRule:"evenodd",transform:"translate(2 4)"},t.createElement("path",{fillRule:"nonzero",d:"M13.047 2.888C11.962 2.294 10.944 2 10 2 7.56 2 4.63 3.966 1.288 8c1.133 1.368 2.218 2.497 3.253 3.394l-.708.708c-1.068-.93-2.173-2.085-3.315-3.464a1 1 0 0 1 0-1.276C4.031 3.121 7.192 1 10 1c1.196 0 2.456.385 3.78 1.154l-.733.734zm-6.02 10.263C8.084 13.72 9.076 14 10 14c2.443 0 5.373-1.969 8.712-6-1.11-1.34-2.176-2.453-3.193-3.341l.708-.709C17.437 5.013 18.695 6.363 20 8c-3.721 4.667-7.054 7-10 7-1.175 0-2.411-.371-3.709-1.113l.735-.736z"}),t.createElement("path",{fillRule:"nonzero",d:"M8.478 11.7l.79-.79a3 3 0 0 0 3.642-3.642l.79-.79A4 4 0 0 1 8.477 11.7zM6.334 9.602a4 4 0 0 1 5.268-5.268l-.78.78A3.002 3.002 0 0 0 7.113 8.82l-.78.78z"}),t.createElement("rect",{width:"21",height:"1",x:"-.722",y:"7.778",rx:".5",transform:"rotate(-45 9.778 8.278)"})))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../_virtual/_rollupPluginBabelHelpers.js");function t(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var l=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,l.get?l:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,t}var r=t(require("react"));exports.PasswordHiddenIcon=function(t){return r.createElement("svg",e.objectSpread2({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24"},t),r.createElement("g",{fill:"gray",fillRule:"evenodd",transform:"translate(2 4)"},r.createElement("path",{fillRule:"nonzero",d:"M13.047 2.888C11.962 2.294 10.944 2 10 2 7.56 2 4.63 3.966 1.288 8c1.133 1.368 2.218 2.497 3.253 3.394l-.708.708c-1.068-.93-2.173-2.085-3.315-3.464a1 1 0 0 1 0-1.276C4.031 3.121 7.192 1 10 1c1.196 0 2.456.385 3.78 1.154l-.733.734zm-6.02 10.263C8.084 13.72 9.076 14 10 14c2.443 0 5.373-1.969 8.712-6-1.11-1.34-2.176-2.453-3.193-3.341l.708-.709C17.437 5.013 18.695 6.363 20 8c-3.721 4.667-7.054 7-10 7-1.175 0-2.411-.371-3.709-1.113l.735-.736z"}),r.createElement("path",{fillRule:"nonzero",d:"M8.478 11.7l.79-.79a3 3 0 0 0 3.642-3.642l.79-.79A4 4 0 0 1 8.477 11.7zM6.334 9.602a4 4 0 0 1 5.268-5.268l-.78.78A3.002 3.002 0 0 0 7.113 8.82l-.78.78z"}),r.createElement("rect",{width:"21",height:"1",x:"-.722",y:"7.778",rx:".5",transform:"rotate(-45 9.778 8.278)"})))};
2
2
  //# sourceMappingURL=password-hidden-icon.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"password-hidden-icon.js","sources":["../../src/icons/password-hidden-icon.tsx"],"sourcesContent":["import * as React from 'react'\n\nfunction PasswordHiddenIcon(props: JSX.IntrinsicElements['svg']) {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" {...props}>\n <g fill=\"gray\" fillRule=\"evenodd\" transform=\"translate(2 4)\">\n <path\n fillRule=\"nonzero\"\n d=\"M13.047 2.888C11.962 2.294 10.944 2 10 2 7.56 2 4.63 3.966 1.288 8c1.133 1.368 2.218 2.497 3.253 3.394l-.708.708c-1.068-.93-2.173-2.085-3.315-3.464a1 1 0 0 1 0-1.276C4.031 3.121 7.192 1 10 1c1.196 0 2.456.385 3.78 1.154l-.733.734zm-6.02 10.263C8.084 13.72 9.076 14 10 14c2.443 0 5.373-1.969 8.712-6-1.11-1.34-2.176-2.453-3.193-3.341l.708-.709C17.437 5.013 18.695 6.363 20 8c-3.721 4.667-7.054 7-10 7-1.175 0-2.411-.371-3.709-1.113l.735-.736z\"\n />\n <path\n fillRule=\"nonzero\"\n d=\"M8.478 11.7l.79-.79a3 3 0 0 0 3.642-3.642l.79-.79A4 4 0 0 1 8.477 11.7zM6.334 9.602a4 4 0 0 1 5.268-5.268l-.78.78A3.002 3.002 0 0 0 7.113 8.82l-.78.78z\"\n />\n <rect\n width=\"21\"\n height=\"1\"\n x=\"-.722\"\n y=\"7.778\"\n rx=\".5\"\n transform=\"rotate(-45 9.778 8.278)\"\n />\n </g>\n </svg>\n )\n}\n\nexport { PasswordHiddenIcon }\n"],"names":["props","React","xmlns","width","height","fill","fillRule","transform","d","x","y","rx"],"mappings":"4KAEA,SAA4BA,GACxB,OACIC,uCAAKC,MAAM,6BAA6BC,MAAM,KAAKC,OAAO,MAASJ,GAC/DC,qBAAGI,KAAK,OAAOC,SAAS,UAAUC,UAAU,kBACxCN,wBACIK,SAAS,UACTE,EAAE,8bAENP,wBACIK,SAAS,UACTE,EAAE,4JAENP,wBACIE,MAAM,KACNC,OAAO,IACPK,EAAE,QACFC,EAAE,QACFC,GAAG,KACHJ,UAAU"}
1
+ {"version":3,"file":"password-hidden-icon.js","sources":["../../src/icons/password-hidden-icon.tsx"],"sourcesContent":["import * as React from 'react'\n\nfunction PasswordHiddenIcon(props: JSX.IntrinsicElements['svg']) {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" {...props}>\n <g fill=\"gray\" fillRule=\"evenodd\" transform=\"translate(2 4)\">\n <path\n fillRule=\"nonzero\"\n d=\"M13.047 2.888C11.962 2.294 10.944 2 10 2 7.56 2 4.63 3.966 1.288 8c1.133 1.368 2.218 2.497 3.253 3.394l-.708.708c-1.068-.93-2.173-2.085-3.315-3.464a1 1 0 0 1 0-1.276C4.031 3.121 7.192 1 10 1c1.196 0 2.456.385 3.78 1.154l-.733.734zm-6.02 10.263C8.084 13.72 9.076 14 10 14c2.443 0 5.373-1.969 8.712-6-1.11-1.34-2.176-2.453-3.193-3.341l.708-.709C17.437 5.013 18.695 6.363 20 8c-3.721 4.667-7.054 7-10 7-1.175 0-2.411-.371-3.709-1.113l.735-.736z\"\n />\n <path\n fillRule=\"nonzero\"\n d=\"M8.478 11.7l.79-.79a3 3 0 0 0 3.642-3.642l.79-.79A4 4 0 0 1 8.477 11.7zM6.334 9.602a4 4 0 0 1 5.268-5.268l-.78.78A3.002 3.002 0 0 0 7.113 8.82l-.78.78z\"\n />\n <rect\n width=\"21\"\n height=\"1\"\n x=\"-.722\"\n y=\"7.778\"\n rx=\".5\"\n transform=\"rotate(-45 9.778 8.278)\"\n />\n </g>\n </svg>\n )\n}\n\nexport { PasswordHiddenIcon }\n"],"names":["props","React","createElement","_objectSpread","xmlns","width","height","fill","fillRule","transform","d","x","y","rx"],"mappings":"mcAEA,SAA4BA,GACxB,OACIC,EAAAC,cAAA,MAAAC,gBAAA,CAAKC,MAAM,6BAA6BC,MAAM,KAAKC,OAAO,MAASN,GAC/DC,EAAGC,cAAA,IAAA,CAAAK,KAAK,OAAOC,SAAS,UAAUC,UAAU,kBACxCR,EAAAC,cAAA,OAAA,CACIM,SAAS,UACTE,EAAE,8bAENT,EAAAC,cAAA,OAAA,CACIM,SAAS,UACTE,EAAE,4JAENT,EACIC,cAAA,OAAA,CAAAG,MAAM,KACNC,OAAO,IACPK,EAAE,QACFC,EAAE,QACFC,GAAG,KACHJ,UAAU"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../_virtual/_rollupPluginBabelHelpers.js"),r=require("react");exports.PasswordVisibleIcon=function(t){return r.createElement("svg",e.objectSpread2({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24"},t),r.createElement("g",{fill:"none",fillRule:"evenodd",stroke:"gray"},r.createElement("path",{d:"M21.358 12C17.825 7.65 14.692 5.5 12 5.5c-2.624 0-5.67 2.043-9.097 6.181a.5.5 0 0 0 0 .638C6.331 16.457 9.376 18.5 12 18.5c2.692 0 5.825-2.15 9.358-6.5z"}),r.createElement("circle",{cx:"12",cy:"12",r:"3.5"})))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../_virtual/_rollupPluginBabelHelpers.js");function r(e){if(e&&e.__esModule)return e;var r=Object.create(null);return e&&Object.keys(e).forEach((function(t){if("default"!==t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}})),r.default=e,r}var t=r(require("react"));exports.PasswordVisibleIcon=function(r){return t.createElement("svg",e.objectSpread2({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24"},r),t.createElement("g",{fill:"none",fillRule:"evenodd",stroke:"gray"},t.createElement("path",{d:"M21.358 12C17.825 7.65 14.692 5.5 12 5.5c-2.624 0-5.67 2.043-9.097 6.181a.5.5 0 0 0 0 .638C6.331 16.457 9.376 18.5 12 18.5c2.692 0 5.825-2.15 9.358-6.5z"}),t.createElement("circle",{cx:"12",cy:"12",r:"3.5"})))};
2
2
  //# sourceMappingURL=password-visible-icon.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"password-visible-icon.js","sources":["../../src/icons/password-visible-icon.tsx"],"sourcesContent":["import * as React from 'react'\n\nfunction PasswordVisibleIcon(props: JSX.IntrinsicElements['svg']) {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" {...props}>\n <g fill=\"none\" fillRule=\"evenodd\" stroke=\"gray\">\n <path d=\"M21.358 12C17.825 7.65 14.692 5.5 12 5.5c-2.624 0-5.67 2.043-9.097 6.181a.5.5 0 0 0 0 .638C6.331 16.457 9.376 18.5 12 18.5c2.692 0 5.825-2.15 9.358-6.5z\" />\n <circle cx=\"12\" cy=\"12\" r=\"3.5\" />\n </g>\n </svg>\n )\n}\n\nexport { PasswordVisibleIcon }\n"],"names":["props","React","xmlns","width","height","fill","fillRule","stroke","d","cx","cy","r"],"mappings":"6KAEA,SAA6BA,GACzB,OACIC,uCAAKC,MAAM,6BAA6BC,MAAM,KAAKC,OAAO,MAASJ,GAC/DC,qBAAGI,KAAK,OAAOC,SAAS,UAAUC,OAAO,QACrCN,wBAAMO,EAAE,6JACRP,0BAAQQ,GAAG,KAAKC,GAAG,KAAKC,EAAE"}
1
+ {"version":3,"file":"password-visible-icon.js","sources":["../../src/icons/password-visible-icon.tsx"],"sourcesContent":["import * as React from 'react'\n\nfunction PasswordVisibleIcon(props: JSX.IntrinsicElements['svg']) {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" {...props}>\n <g fill=\"none\" fillRule=\"evenodd\" stroke=\"gray\">\n <path d=\"M21.358 12C17.825 7.65 14.692 5.5 12 5.5c-2.624 0-5.67 2.043-9.097 6.181a.5.5 0 0 0 0 .638C6.331 16.457 9.376 18.5 12 18.5c2.692 0 5.825-2.15 9.358-6.5z\" />\n <circle cx=\"12\" cy=\"12\" r=\"3.5\" />\n </g>\n </svg>\n )\n}\n\nexport { PasswordVisibleIcon }\n"],"names":["props","React","createElement","_objectSpread","xmlns","width","height","fill","fillRule","stroke","d","cx","cy","r"],"mappings":"ocAEA,SAA6BA,GACzB,OACIC,EAAAC,cAAA,MAAAC,gBAAA,CAAKC,MAAM,6BAA6BC,MAAM,KAAKC,OAAO,MAASN,GAC/DC,EAAGC,cAAA,IAAA,CAAAK,KAAK,OAAOC,SAAS,UAAUC,OAAO,QACrCR,EAAMC,cAAA,OAAA,CAAAQ,EAAE,6JACRT,EAAAC,cAAA,SAAA,CAAQS,GAAG,KAAKC,GAAG,KAAKC,EAAE"}
package/lib/index.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./box/box.js"),r=require("./columns/columns.js"),t=require("./divider/divider.js"),o=require("./inline/inline.js"),s=require("./stack/stack.js"),i=require("./hidden/hidden.js"),a=require("./hidden-visually/hidden-visually.js"),n=require("./tooltip/tooltip.js"),d=require("./button/button.js"),u=require("./alert/alert.js"),p=require("./banner/banner.js"),x=require("./loading/loading.js"),l=require("./notice/notice.js"),c=require("./text/text.js"),j=require("./toast/static-toast.js"),q=require("./toast/use-toasts.js"),T=require("./heading/heading.js"),b=require("./prose/prose.js"),m=require("./text-link/text-link.js"),M=require("./checkbox-field/checkbox-field.js"),f=require("./text-field/text-field.js"),g=require("./password-field/password-field.js"),k=require("./select-field/select-field.js"),B=require("./switch-field/switch-field.js"),S=require("./text-area/text-area.js"),h=require("./avatar/avatar.js"),C=require("./badge/badge.js"),P=require("./modal/modal.js"),v=require("./tabs/tabs.js"),y=require("./menu/menu.js"),w=require("./components/deprecated-button/index.js"),F=require("./components/deprecated-dropdown/index.js"),A=require("./components/color-picker/color-picker.js"),L=require("./components/color-picker/index.js"),D=require("./components/keyboard-shortcut/index.js"),H=require("./components/key-capturer/key-capturer.js"),I=require("./components/key-capturer/index.js"),O=require("./components/progress-bar/index.js"),E=require("./components/time/index.js"),K=require("./components/deprecated-input/index.js"),N=require("./components/deprecated-select/index.js");exports.Box=e.Box,exports.getBoxClassNames=e.getBoxClassNames,exports.Column=r.Column,exports.Columns=r.Columns,exports.Divider=t.Divider,exports.Inline=o.Inline,exports.Stack=s.Stack,exports.Hidden=i.Hidden,exports.HiddenVisually=a.HiddenVisually,exports.Tooltip=n.Tooltip,exports.Button=d.Button,exports.IconButton=d.IconButton,exports.Alert=u.Alert,exports.Banner=p.Banner,exports.Loading=x.Loading,exports.Notice=l.Notice,exports.Text=c.Text,exports.StaticToast=j.StaticToast,exports.Toast=q.Toast,exports.ToastsProvider=q.ToastsProvider,exports.useToasts=q.useToasts,exports.Heading=T.Heading,exports.Prose=b.Prose,exports.TextLink=m.TextLink,exports.CheckboxField=M.CheckboxField,exports.TextField=f.TextField,exports.PasswordField=g.PasswordField,exports.SelectField=k.SelectField,exports.SwitchField=B.SwitchField,exports.TextArea=S.TextArea,exports.Avatar=h.Avatar,exports.Badge=C.Badge,exports.Modal=P.Modal,exports.ModalActions=P.ModalActions,exports.ModalBody=P.ModalBody,exports.ModalCloseButton=P.ModalCloseButton,exports.ModalFooter=P.ModalFooter,exports.ModalHeader=P.ModalHeader,exports.Tab=v.Tab,exports.TabAwareSlot=v.TabAwareSlot,exports.TabList=v.TabList,exports.TabPanel=v.TabPanel,exports.Tabs=v.Tabs,exports.ContextMenuTrigger=y.ContextMenuTrigger,exports.Menu=y.Menu,exports.MenuButton=y.MenuButton,exports.MenuGroup=y.MenuGroup,exports.MenuItem=y.MenuItem,exports.MenuList=y.MenuList,exports.SubMenu=y.SubMenu,exports.DeprecatedButton=w.default,exports.DeprecatedDropdown=F.default,exports.COLORS=A.COLORS,exports.ColorPicker=L.default,exports.KeyboardShortcut=D.default,exports.SUPPORTED_KEYS=H.SUPPORTED_KEYS,exports.KeyCapturer=I.default,exports.ProgressBar=O.default,exports.Time=E.default,exports.DeprecatedInput=K.default,exports.DeprecatedSelect=N.default;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./box/box.js"),r=require("./columns/columns.js"),t=require("./divider/divider.js"),o=require("./inline/inline.js"),s=require("./stack/stack.js"),i=require("./hidden/hidden.js"),a=require("./hidden-visually/hidden-visually.js"),n=require("./alert/alert.js"),p=require("./banner/banner.js"),d=require("./loading/loading.js"),u=require("./notice/notice.js"),x=require("./toast/static-toast.js"),l=require("./toast/use-toasts.js"),c=require("./heading/heading.js"),j=require("./text/text.js"),q=require("./prose/prose.js"),b=require("./button/button.js"),T=require("./text-link/text-link.js"),m=require("./checkbox-field/checkbox-field.js"),M=require("./password-field/password-field.js"),g=require("./select-field/select-field.js"),B=require("./switch-field/switch-field.js"),S=require("./text-area/text-area.js"),k=require("./text-field/text-field.js"),h=require("./avatar/avatar.js"),C=require("./badge/badge.js"),P=require("./modal/modal.js"),y=require("./tabs/tabs.js"),v=require("./tooltip/tooltip.js"),w=require("./menu/menu.js"),F=require("./components/color-picker/color-picker.js"),f=require("./components/keyboard-shortcut/keyboard-shortcut.js"),A=require("./components/key-capturer/key-capturer.js"),D=require("./components/progress-bar/progress-bar.js"),L=require("./components/time/time.js"),H=require("./components/deprecated-button/deprecated-button.js"),I=require("./components/deprecated-dropdown/dropdown.js"),O=require("./components/deprecated-input/input.js"),K=require("./components/deprecated-select/select.js");exports.Box=e.Box,exports.getBoxClassNames=e.getBoxClassNames,exports.Column=r.Column,exports.Columns=r.Columns,exports.Divider=t.Divider,exports.Inline=o.Inline,exports.Stack=s.Stack,exports.Hidden=i.Hidden,exports.HiddenVisually=a.HiddenVisually,exports.Alert=n.Alert,exports.Banner=p.Banner,exports.Loading=d.Loading,exports.Notice=u.Notice,exports.StaticToast=x.StaticToast,exports.Toast=l.Toast,exports.ToastsProvider=l.ToastsProvider,exports.useToasts=l.useToasts,exports.Heading=c.Heading,exports.Text=j.Text,exports.Prose=q.Prose,exports.Button=b.Button,exports.IconButton=b.IconButton,exports.TextLink=T.TextLink,exports.CheckboxField=m.CheckboxField,exports.PasswordField=M.PasswordField,exports.SelectField=g.SelectField,exports.SwitchField=B.SwitchField,exports.TextArea=S.TextArea,exports.TextField=k.TextField,exports.Avatar=h.Avatar,exports.Badge=C.Badge,exports.Modal=P.Modal,exports.ModalActions=P.ModalActions,exports.ModalBody=P.ModalBody,exports.ModalCloseButton=P.ModalCloseButton,exports.ModalFooter=P.ModalFooter,exports.ModalHeader=P.ModalHeader,exports.Tab=y.Tab,exports.TabAwareSlot=y.TabAwareSlot,exports.TabList=y.TabList,exports.TabPanel=y.TabPanel,exports.Tabs=y.Tabs,exports.Tooltip=v.Tooltip,exports.ContextMenuTrigger=w.ContextMenuTrigger,exports.Menu=w.Menu,exports.MenuButton=w.MenuButton,exports.MenuGroup=w.MenuGroup,exports.MenuItem=w.MenuItem,exports.MenuList=w.MenuList,exports.SubMenu=w.SubMenu,exports.COLORS=F.COLORS,exports.ColorPicker=F.ColorPicker,exports.KeyboardShortcut=f.KeyboardShortcut,exports.KeyCapturer=A.KeyCapturer,exports.SUPPORTED_KEYS=A.SUPPORTED_KEYS,exports.ProgressBar=D.ProgressBar,exports.Time=L.Time,exports.DeprecatedButton=H.Button,exports.DeprecatedDropdown=I.Dropdown,exports.DeprecatedInput=O.Input,exports.DeprecatedSelect=K.Select;
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  import type { ResponsiveProp } from '../utils/responsive-props';
2
2
  import type { Space } from '../utils/common-types';
3
3
  import type { ReusableBoxProps } from '../box';
4
- declare type InlineAlign = 'left' | 'center' | 'right';
4
+ type InlineAlign = 'left' | 'center' | 'right';
5
5
  interface InlineProps extends ReusableBoxProps {
6
6
  space?: ResponsiveProp<Space>;
7
7
  align?: ResponsiveProp<InlineAlign>;
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../_virtual/_rollupPluginBabelHelpers.js"),r=require("react"),t=require("../utils/polymorphism.js"),l=require("../utils/responsive-props.js"),s=require("../box/box.js");const a=["as","space","align","alignY","children","exceptionallySetClassName"];exports.Inline=t.polymorphicComponent((function(t,o){let{as:i,space:p,align:n="left",alignY:c="center",children:u,exceptionallySetClassName:x}=t,f=e.objectWithoutProperties(t,a);return r.createElement(s.Box,e.objectSpread2(e.objectSpread2({},f),{},{as:i,display:"flex",flexWrap:"wrap",gap:p,className:x,ref:o,alignItems:l.mapResponsiveProp(c,e=>"top"===e?"flexStart":"bottom"===e?"flexEnd":"center"),justifyContent:l.mapResponsiveProp(n,e=>"left"===e?"flexStart":"right"===e?"flexEnd":"center")}),u)}));
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../_virtual/_rollupPluginBabelHelpers.js"),t=require("react"),r=require("../utils/polymorphism.js"),l=require("../utils/responsive-props.js"),n=require("../box/box.js");function a(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var l=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,l.get?l:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,t}var o=a(t);const i=["as","space","align","alignY","children","exceptionallySetClassName"];exports.Inline=r.polymorphicComponent((function(t,r){let{as:a,space:s,align:p="left",alignY:c="center",children:u,exceptionallySetClassName:f}=t,b=e.objectWithoutProperties(t,i);return o.createElement(n.Box,e.objectSpread2(e.objectSpread2({},b),{},{as:a,display:"flex",flexWrap:"wrap",gap:s,className:f,ref:r,alignItems:l.mapResponsiveProp(c,e=>"top"===e?"flexStart":"bottom"===e?"flexEnd":"center"),justifyContent:l.mapResponsiveProp(p,e=>"left"===e?"flexStart":"right"===e?"flexEnd":"center")}),u)}));
2
2
  //# sourceMappingURL=inline.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"inline.js","sources":["../../src/inline/inline.tsx"],"sourcesContent":["import * as React from 'react'\nimport { polymorphicComponent } from '../utils/polymorphism'\nimport { mapResponsiveProp } from '../utils/responsive-props'\nimport { Box } from '../box'\n\nimport type { ResponsiveProp } from '../utils/responsive-props'\nimport type { Space } from '../utils/common-types'\nimport type { ReusableBoxProps } from '../box'\n\ntype InlineAlign = 'left' | 'center' | 'right'\n\ninterface InlineProps extends ReusableBoxProps {\n space?: ResponsiveProp<Space>\n align?: ResponsiveProp<InlineAlign>\n alignY?: ResponsiveProp<'top' | 'center' | 'bottom'>\n}\n\nconst Inline = polymorphicComponent<'div', InlineProps>(function Inline(\n { as, space, align = 'left', alignY = 'center', children, exceptionallySetClassName, ...props },\n ref,\n) {\n return (\n <Box\n {...props}\n as={as}\n display=\"flex\"\n flexWrap=\"wrap\"\n gap={space}\n className={exceptionallySetClassName}\n ref={ref}\n alignItems={mapResponsiveProp(alignY, (alignY) =>\n alignY === 'top' ? 'flexStart' : alignY === 'bottom' ? 'flexEnd' : 'center',\n )}\n justifyContent={mapResponsiveProp(align, (align) =>\n align === 'left' ? 'flexStart' : align === 'right' ? 'flexEnd' : 'center',\n )}\n >\n {children}\n </Box>\n )\n})\n\nexport type { InlineProps, InlineAlign }\nexport { Inline }\n"],"names":["polymorphicComponent","ref","as","space","align","alignY","children","exceptionallySetClassName","props","React","Box","display","flexWrap","gap","className","alignItems","mapResponsiveProp","justifyContent"],"mappings":"0VAiBeA,wBAAyC,WAEpDC,OADAC,GAAEA,EAAFC,MAAMA,EAANC,MAAaA,EAAQ,OAArBC,OAA6BA,EAAS,SAAtCC,SAAgDA,EAAhDC,0BAA0DA,KAA8BC,iCAGxF,OACIC,gBAACC,yCACOF,OACJN,GAAIA,EACJS,QAAQ,OACRC,SAAS,OACTC,IAAKV,EACLW,UAAWP,EACXN,IAAKA,EACLc,WAAYC,oBAAkBX,EAASA,GACxB,QAAXA,EAAmB,YAAyB,WAAXA,EAAsB,UAAY,UAEvEY,eAAgBD,oBAAkBZ,EAAQA,GAC5B,SAAVA,EAAmB,YAAwB,UAAVA,EAAoB,UAAY,YAGpEE"}
1
+ {"version":3,"file":"inline.js","sources":["../../src/inline/inline.tsx"],"sourcesContent":["import * as React from 'react'\nimport { polymorphicComponent } from '../utils/polymorphism'\nimport { mapResponsiveProp } from '../utils/responsive-props'\nimport { Box } from '../box'\n\nimport type { ResponsiveProp } from '../utils/responsive-props'\nimport type { Space } from '../utils/common-types'\nimport type { ReusableBoxProps } from '../box'\n\ntype InlineAlign = 'left' | 'center' | 'right'\n\ninterface InlineProps extends ReusableBoxProps {\n space?: ResponsiveProp<Space>\n align?: ResponsiveProp<InlineAlign>\n alignY?: ResponsiveProp<'top' | 'center' | 'bottom'>\n}\n\nconst Inline = polymorphicComponent<'div', InlineProps>(function Inline(\n { as, space, align = 'left', alignY = 'center', children, exceptionallySetClassName, ...props },\n ref,\n) {\n return (\n <Box\n {...props}\n as={as}\n display=\"flex\"\n flexWrap=\"wrap\"\n gap={space}\n className={exceptionallySetClassName}\n ref={ref}\n alignItems={mapResponsiveProp(alignY, (alignY) =>\n alignY === 'top' ? 'flexStart' : alignY === 'bottom' ? 'flexEnd' : 'center',\n )}\n justifyContent={mapResponsiveProp(align, (align) =>\n align === 'left' ? 'flexStart' : align === 'right' ? 'flexEnd' : 'center',\n )}\n >\n {children}\n </Box>\n )\n})\n\nexport type { InlineProps, InlineAlign }\nexport { Inline }\n"],"names":["polymorphicComponent","_ref","ref","as","space","align","alignY","children","exceptionallySetClassName","props","_objectWithoutProperties","objectWithoutProperties","_excluded","React","Box","display","flexWrap","gap","className","alignItems","mapResponsiveProp","justifyContent"],"mappings":"qnBAiBeA,EAAAA,sBAAyC,SAAAC,EAEpDC,GAAG,IADHC,GAAEA,EAAFC,MAAMA,EAANC,MAAaA,EAAQ,OAArBC,OAA6BA,EAAS,SAAtCC,SAAgDA,EAAhDC,0BAA0DA,GACvDP,EADqFQ,EACrFC,EAAAC,wBAAAV,EAAAW,GAEH,OACIC,gBAACC,yCACOL,GADR,GAAA,CAEIN,GAAIA,EACJY,QAAQ,OACRC,SAAS,OACTC,IAAKb,EACLc,UAAWV,EACXN,IAAKA,EACLiB,WAAYC,EAAiBA,kBAACd,EAASA,GACxB,QAAXA,EAAmB,YAAyB,WAAXA,EAAsB,UAAY,UAEvEe,eAAgBD,EAAiBA,kBAACf,EAAQA,GAC5B,SAAVA,EAAmB,YAAwB,UAAVA,EAAoB,UAAY,YAGpEE"}
@@ -1,8 +1,8 @@
1
1
  import * as React from 'react';
2
2
  import type { ObfuscatedClassName } from '../utils/common-types';
3
- declare type Size = 'xsmall' | 'small' | 'medium' | 'large';
4
- declare type NativeProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'className' | 'aria-describedby' | 'aria-label' | 'aria-labelledby' | 'role' | 'size'>;
5
- declare type LoadingProps = NativeProps & ObfuscatedClassName & {
3
+ type Size = 'xsmall' | 'small' | 'medium' | 'large';
4
+ type NativeProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'className' | 'aria-describedby' | 'aria-label' | 'aria-labelledby' | 'role' | 'size'>;
5
+ type LoadingProps = NativeProps & ObfuscatedClassName & {
6
6
  /**
7
7
  * The size of the loading spinner.
8
8
  * @default 'small'
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../_virtual/_rollupPluginBabelHelpers.js"),a=require("react"),l=require("../box/box.js"),r=require("../spinner/spinner.js");const t=["size","exceptionallySetClassName"],i={xsmall:16,small:24,medium:36,large:48};exports.Loading=function(s){var n;let{size:o="small",exceptionallySetClassName:c}=s,u=e.objectWithoutProperties(s,t);const p=null!=(n=i[o])?n:i.small,b=u["aria-label"]?u["aria-label"]:u["aria-labelledby"]?void 0:"Loading…";return a.createElement(l.Box,e.objectSpread2(e.objectSpread2({},u),{},{"aria-label":b,className:c,display:"flex",alignItems:"center",justifyContent:"center",role:"progressbar"}),a.createElement(r.Spinner,{size:p,"aria-hidden":!0}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../_virtual/_rollupPluginBabelHelpers.js"),r=require("react"),t=require("../box/box.js"),a=require("../spinner/spinner.js");function l(e){if(e&&e.__esModule)return e;var r=Object.create(null);return e&&Object.keys(e).forEach((function(t){if("default"!==t){var a=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,a.get?a:{enumerable:!0,get:function(){return e[t]}})}})),r.default=e,r}var i=l(r);const n=["size","exceptionallySetClassName"],s={xsmall:16,small:24,medium:36,large:48};exports.Loading=function(r){var l;let{size:o="small",exceptionallySetClassName:u}=r,c=e.objectWithoutProperties(r,n);const b=null!=(l=s[o])?l:s.small,p=c["aria-label"]?c["aria-label"]:c["aria-labelledby"]?void 0:"Loading…";return i.createElement(t.Box,e.objectSpread2(e.objectSpread2({},c),{},{"aria-label":p,className:u,display:"flex",alignItems:"center",justifyContent:"center",role:"progressbar"}),i.createElement(a.Spinner,{size:b,"aria-hidden":!0}))};
2
2
  //# sourceMappingURL=loading.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"loading.js","sources":["../../src/loading/loading.tsx"],"sourcesContent":["import * as React from 'react'\nimport { Box } from '../box'\nimport { Spinner } from '../spinner'\nimport type { ObfuscatedClassName } from '../utils/common-types'\n\ntype Size = 'xsmall' | 'small' | 'medium' | 'large'\n\ntype NativeProps = Omit<\n React.HTMLAttributes<HTMLDivElement>,\n 'className' | 'aria-describedby' | 'aria-label' | 'aria-labelledby' | 'role' | 'size'\n>\n\ntype LoadingProps = NativeProps &\n ObfuscatedClassName & {\n /**\n * The size of the loading spinner.\n * @default 'small'\n */\n size?: Size\n\n /**\n * Identifies the element (or elements) that describes the loading component for assistive technologies.\n */\n 'aria-describedby'?: string\n } & (\n | {\n /** Defines a string value that labels the current loading component for assistive technologies. */\n 'aria-label': string\n 'aria-labelledby'?: never\n }\n | {\n /** Identifies the element (or elements) that labels the current loading component for assistive technologies. */\n 'aria-labelledby': string\n 'aria-label'?: never\n }\n )\n\nconst sizeMapping: Record<Size, number> = {\n xsmall: 16,\n small: 24,\n medium: 36,\n large: 48,\n}\n\nfunction Loading({ size = 'small', exceptionallySetClassName, ...props }: LoadingProps) {\n const numericSize = sizeMapping[size] ?? sizeMapping.small\n const ariaLabel = props['aria-label']\n ? props['aria-label']\n : !props['aria-labelledby']\n ? 'Loading…'\n : undefined\n\n return (\n <Box\n {...props}\n aria-label={ariaLabel}\n className={exceptionallySetClassName}\n display=\"flex\"\n alignItems=\"center\"\n justifyContent=\"center\"\n role=\"progressbar\"\n >\n <Spinner size={numericSize} aria-hidden />\n </Box>\n )\n}\n\nexport { Loading }\nexport type { LoadingProps }\n"],"names":["sizeMapping","xsmall","small","medium","large","size","exceptionallySetClassName","props","numericSize","ariaLabel","undefined","React","Box","className","display","alignItems","justifyContent","role","Spinner"],"mappings":"4PAqCMA,EAAoC,CACtCC,OAAQ,GACRC,MAAO,GACPC,OAAQ,GACRC,MAAO,oBAGX,sBAAiBC,KAAEA,EAAO,QAATC,0BAAkBA,KAA8BC,iCAC7D,MAAMC,WAAcR,EAAYK,MAASL,EAAYE,MAC/CO,EAAYF,EAAM,cAClBA,EAAM,cACLA,EAAM,wBAEPG,EADA,WAGN,OACIC,gBAACC,yCACOL,oBACQE,EACZI,UAAWP,EACXQ,QAAQ,OACRC,WAAW,SACXC,eAAe,SACfC,KAAK,gBAELN,gBAACO,WAAQb,KAAMG"}
1
+ {"version":3,"file":"loading.js","sources":["../../src/loading/loading.tsx"],"sourcesContent":["import * as React from 'react'\nimport { Box } from '../box'\nimport { Spinner } from '../spinner'\nimport type { ObfuscatedClassName } from '../utils/common-types'\n\ntype Size = 'xsmall' | 'small' | 'medium' | 'large'\n\ntype NativeProps = Omit<\n React.HTMLAttributes<HTMLDivElement>,\n 'className' | 'aria-describedby' | 'aria-label' | 'aria-labelledby' | 'role' | 'size'\n>\n\ntype LoadingProps = NativeProps &\n ObfuscatedClassName & {\n /**\n * The size of the loading spinner.\n * @default 'small'\n */\n size?: Size\n\n /**\n * Identifies the element (or elements) that describes the loading component for assistive technologies.\n */\n 'aria-describedby'?: string\n } & (\n | {\n /** Defines a string value that labels the current loading component for assistive technologies. */\n 'aria-label': string\n 'aria-labelledby'?: never\n }\n | {\n /** Identifies the element (or elements) that labels the current loading component for assistive technologies. */\n 'aria-labelledby': string\n 'aria-label'?: never\n }\n )\n\nconst sizeMapping: Record<Size, number> = {\n xsmall: 16,\n small: 24,\n medium: 36,\n large: 48,\n}\n\nfunction Loading({ size = 'small', exceptionallySetClassName, ...props }: LoadingProps) {\n const numericSize = sizeMapping[size] ?? sizeMapping.small\n const ariaLabel = props['aria-label']\n ? props['aria-label']\n : !props['aria-labelledby']\n ? 'Loading…'\n : undefined\n\n return (\n <Box\n {...props}\n aria-label={ariaLabel}\n className={exceptionallySetClassName}\n display=\"flex\"\n alignItems=\"center\"\n justifyContent=\"center\"\n role=\"progressbar\"\n >\n <Spinner size={numericSize} aria-hidden />\n </Box>\n )\n}\n\nexport { Loading }\nexport type { LoadingProps }\n"],"names":["sizeMapping","xsmall","small","medium","large","_ref","_sizeMapping$size","size","exceptionallySetClassName","props","_objectWithoutProperties","objectWithoutProperties","_excluded","numericSize","ariaLabel","undefined","React","createElement","Box","aria-label","className","display","alignItems","justifyContent","role","Spinner","aria-hidden"],"mappings":"uhBAqCMA,EAAoC,CACtCC,OAAQ,GACRC,MAAO,GACPC,OAAQ,GACRC,MAAO,oBAGX,SAAsFC,GAAA,IAAAC,EAAA,IAArEC,KAAEA,EAAO,QAATC,0BAAkBA,GAAmDH,EAArBI,EAAqBC,EAAAC,wBAAAN,EAAAO,GAClF,MAAMC,EAAW,SAAGb,EAAYO,IAAfD,EAAwBN,EAAYE,MAC/CY,EAAYL,EAAM,cAClBA,EAAM,cACLA,EAAM,wBAEPM,EADA,WAGN,OACIC,EAACC,cAAAC,yCACOT,GADR,GAAA,CAEgBU,aAAAL,EACZM,UAAWZ,EACXa,QAAQ,OACRC,WAAW,SACXC,eAAe,SACfC,KAAK,gBAELR,EAACC,cAAAQ,WAAQlB,KAAMM,EAA2Ba,eAAA"}
@@ -88,7 +88,7 @@ interface MenuItemProps extends AriakitMenuItemProps, ObfuscatedClassName {
88
88
  * callback.
89
89
  */
90
90
  declare const MenuItem: React.ForwardRefExoticComponent<Omit<MenuItemProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
91
- declare type SubMenuProps = Pick<MenuProps, 'children' | 'onItemSelect'>;
91
+ type SubMenuProps = Pick<MenuProps, 'children' | 'onItemSelect'>;
92
92
  /**
93
93
  * This component can be rendered alongside other `MenuItem` inside a `MenuList` in order to have
94
94
  * a sub-menu.
package/lib/menu/menu.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=require("../_virtual/_rollupPluginBabelHelpers.js"),r=require("react"),n=(e(r),e(require("classnames"))),o=require("@ariakit/react");const l=["children","onItemSelect"],u=["exceptionallySetClassName"],c=["render"],a=["exceptionallySetClassName","modal"],s=["value","children","onSelect","hideOnSelect","onClick","exceptionallySetClassName"],i=["label","children","exceptionallySetClassName"],d=r.createContext({menuStore:null,handleItemSelect:()=>{},getAnchorRect:null,setAnchorRect:()=>{}});function p(e){let{children:n,onItemSelect:u}=e,c=t.objectWithoutProperties(e,l);const[a,s]=r.useState(null),i=r.useMemo(()=>a?()=>a:null,[a]),p=o.useMenuStore(t.objectSpread2({focusLoop:!0},c)),m=r.useMemo(()=>({menuStore:p,handleItemSelect:u,getAnchorRect:i,setAnchorRect:s}),[p,u,i,s]);return r.createElement(d.Provider,{value:m},n)}const m=r.forwardRef((function(e,l){let{exceptionallySetClassName:c}=e,a=t.objectWithoutProperties(e,u);const{menuStore:s}=r.useContext(d);if(!s)throw new Error("MenuButton must be wrapped in <Menu/>");return r.createElement(o.MenuButton,t.objectSpread2(t.objectSpread2({},a),{},{store:s,ref:l,className:n("reactist_menubutton",c)}))})),f=r.forwardRef((function(e,n){let{render:l}=e,u=t.objectWithoutProperties(e,c);const{setAnchorRect:a,menuStore:s}=r.useContext(d);if(!s)throw new Error("ContextMenuTrigger must be wrapped in <Menu/>");const i=r.useCallback((function(e){e.preventDefault(),a({x:e.clientX,y:e.clientY}),s.show()}),[a,s]),p=s.useState("open");return r.useEffect(()=>{p||a(null)},[p,a]),r.createElement(o.Role.div,t.objectSpread2(t.objectSpread2({},u),{},{onContextMenu:i,ref:n,render:l}))})),S=r.forwardRef((function(e,l){let{exceptionallySetClassName:u,modal:c=!0}=e,s=t.objectWithoutProperties(e,a);const{menuStore:i,getAnchorRect:p}=r.useContext(d);if(!i)throw new Error("MenuList must be wrapped in <Menu/>");return i.useState("open")?r.createElement(o.Portal,{preserveTabOrder:!0},r.createElement(o.Menu,t.objectSpread2(t.objectSpread2({},s),{},{store:i,gutter:8,shift:4,ref:l,className:n("reactist_menulist",u),getAnchorRect:null!=p?p:void 0,modal:c}))):null})),h=r.forwardRef((function(e,n){let{value:l,children:u,onSelect:c,hideOnSelect:a=!0,onClick:i,exceptionallySetClassName:p}=e,m=t.objectWithoutProperties(e,s);const{handleItemSelect:f,menuStore:S}=r.useContext(d);if(!S)throw new Error("MenuItem must be wrapped in <Menu/>");const{hide:h}=S,b=r.useCallback((function(e){null==i||i(e);const t=!1!==(c&&!e.defaultPrevented?c():void 0)&&a;null==f||f(l),t&&h()}),[c,i,f,a,h,l]);return r.createElement(o.MenuItem,t.objectSpread2(t.objectSpread2({},m),{},{store:S,ref:n,onClick:b,className:p,hideOnClick:!1}),u)})),b=r.forwardRef((function({children:e,onItemSelect:t},n){const{handleItemSelect:l,menuStore:u}=r.useContext(d);if(!u)throw new Error("SubMenu must be wrapped in <Menu/>");const{hide:c}=u,a=r.useCallback((function(e){null==t||t(e),null==l||l(e),c()}),[c,l,t]),[s,i]=r.Children.toArray(e);return r.createElement(p,{onItemSelect:a},r.createElement(o.MenuItem,{store:u,ref:n,hideOnClick:!1,render:s},s.props.children),i)})),M=r.forwardRef((function(e,n){let{label:l,children:u,exceptionallySetClassName:c}=e,a=t.objectWithoutProperties(e,i);const{menuStore:s}=r.useContext(d);if(!s)throw new Error("MenuGroup must be wrapped in <Menu/>");return r.createElement(o.MenuGroup,t.objectSpread2(t.objectSpread2({},a),{},{ref:n,store:s,className:c}),l?r.createElement("div",{role:"presentation",className:"reactist_menugroup__label"},l):null,u)}));exports.ContextMenuTrigger=f,exports.Menu=p,exports.MenuButton=m,exports.MenuGroup=M,exports.MenuItem=h,exports.MenuList=S,exports.SubMenu=b;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../_virtual/_rollupPluginBabelHelpers.js"),t=require("react"),r=require("classnames"),n=require("@ariakit/react");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function l(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,t}var u=l(t),c=o(r);const a=["children","onItemSelect"],s=["exceptionallySetClassName"],i=["render"],d=["exceptionallySetClassName","modal"],p=["value","children","onSelect","hideOnSelect","onClick","exceptionallySetClassName"],m=["label","children","exceptionallySetClassName"],f=u.createContext({menuStore:null,handleItemSelect:()=>{},getAnchorRect:null,setAnchorRect:()=>{}});function S(t){let{children:r,onItemSelect:o}=t,l=e.objectWithoutProperties(t,a);const[c,s]=u.useState(null),i=u.useMemo(()=>c?()=>c:null,[c]),d=n.useMenuStore(e.objectSpread2({focusLoop:!0},l)),p=u.useMemo(()=>({menuStore:d,handleItemSelect:o,getAnchorRect:i,setAnchorRect:s}),[d,o,i,s]);return u.createElement(f.Provider,{value:p},r)}const b=u.forwardRef((function(t,r){let{exceptionallySetClassName:o}=t,l=e.objectWithoutProperties(t,s);const{menuStore:a}=u.useContext(f);if(!a)throw new Error("MenuButton must be wrapped in <Menu/>");return u.createElement(n.MenuButton,e.objectSpread2(e.objectSpread2({},l),{},{store:a,ref:r,className:c.default("reactist_menubutton",o)}))})),h=u.forwardRef((function(t,r){let{render:o}=t,l=e.objectWithoutProperties(t,i);const{setAnchorRect:c,menuStore:a}=u.useContext(f);if(!a)throw new Error("ContextMenuTrigger must be wrapped in <Menu/>");const s=u.useCallback((function(e){e.preventDefault(),c({x:e.clientX,y:e.clientY}),a.show()}),[c,a]),d=a.useState("open");return u.useEffect(()=>{d||c(null)},[d,c]),u.createElement(n.Role.div,e.objectSpread2(e.objectSpread2({},l),{},{onContextMenu:s,ref:r,render:o}))})),M=u.forwardRef((function(t,r){let{exceptionallySetClassName:o,modal:l=!0}=t,a=e.objectWithoutProperties(t,d);const{menuStore:s,getAnchorRect:i}=u.useContext(f);if(!s)throw new Error("MenuList must be wrapped in <Menu/>");return s.useState("open")?u.createElement(n.Portal,{preserveTabOrder:!0},u.createElement(n.Menu,e.objectSpread2(e.objectSpread2({},a),{},{store:s,gutter:8,shift:4,ref:r,className:c.default("reactist_menulist",o),getAnchorRect:null!=i?i:void 0,modal:l}))):null})),x=u.forwardRef((function(t,r){let{value:o,children:l,onSelect:c,hideOnSelect:a=!0,onClick:s,exceptionallySetClassName:i}=t,d=e.objectWithoutProperties(t,p);const{handleItemSelect:m,menuStore:S}=u.useContext(f);if(!S)throw new Error("MenuItem must be wrapped in <Menu/>");const{hide:b}=S,h=u.useCallback((function(e){null==s||s(e);const t=!1!==(c&&!e.defaultPrevented?c():void 0)&&a;null==m||m(o),t&&b()}),[c,s,m,a,b,o]);return u.createElement(n.MenuItem,e.objectSpread2(e.objectSpread2({},d),{},{store:S,ref:r,onClick:h,className:i,hideOnClick:!1}),l)})),C=u.forwardRef((function({children:e,onItemSelect:t},r){const{handleItemSelect:o,menuStore:l}=u.useContext(f);if(!l)throw new Error("SubMenu must be wrapped in <Menu/>");const{hide:c}=l,a=u.useCallback((function(e){null==t||t(e),null==o||o(e),c()}),[c,o,t]),[s,i]=u.Children.toArray(e);return u.createElement(S,{onItemSelect:a},u.createElement(n.MenuItem,{store:l,ref:r,hideOnClick:!1,render:s},s.props.children),i)})),w=u.forwardRef((function(t,r){let{label:o,children:l,exceptionallySetClassName:c}=t,a=e.objectWithoutProperties(t,m);const{menuStore:s}=u.useContext(f);if(!s)throw new Error("MenuGroup must be wrapped in <Menu/>");return u.createElement(n.MenuGroup,e.objectSpread2(e.objectSpread2({},a),{},{ref:r,store:s,className:c}),o?u.createElement("div",{role:"presentation",className:"reactist_menugroup__label"},o):null,l)}));exports.ContextMenuTrigger=h,exports.Menu=S,exports.MenuButton=b,exports.MenuGroup=w,exports.MenuItem=x,exports.MenuList=M,exports.SubMenu=C;
2
2
  //# sourceMappingURL=menu.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"menu.js","sources":["../../src/menu/menu.tsx"],"sourcesContent":["import * as React from 'react'\nimport classNames from 'classnames'\n\nimport {\n Portal,\n MenuStore,\n MenuStoreProps,\n useMenuStore,\n MenuProps as AriakitMenuProps,\n Menu as AriakitMenu,\n MenuGroup as AriakitMenuGroup,\n MenuItem as AriakitMenuItem,\n MenuItemProps as AriakitMenuItemProps,\n MenuButton as AriakitMenuButton,\n MenuButtonProps as AriakitMenuButtonProps,\n Role,\n RoleProps,\n} from '@ariakit/react'\n\nimport './menu.less'\nimport type { ObfuscatedClassName } from '../utils/common-types'\n\ntype MenuContextState = {\n menuStore: MenuStore | null\n handleItemSelect?: (value: string | null | undefined) => void\n getAnchorRect: (() => { x: number; y: number }) | null\n setAnchorRect: (rect: { x: number; y: number } | null) => void\n}\n\nconst MenuContext = React.createContext<MenuContextState>({\n menuStore: null,\n handleItemSelect: () => undefined,\n getAnchorRect: null,\n setAnchorRect: () => undefined,\n})\n\n//\n// Menu\n//\n\ninterface MenuProps extends Omit<MenuStoreProps, 'visible'> {\n /**\n * The `Menu` must contain a `MenuList` that defines the menu options. It must also contain a\n * `MenuButton` that triggers the menu to be opened or closed.\n */\n children: React.ReactNode\n\n /**\n * An optional callback that will be called back whenever a menu item is selected. It receives\n * the `value` of the selected `MenuItem`.\n *\n * If you pass down this callback, it is recommended that you properly memoize it so it does not\n * change on every render.\n */\n onItemSelect?: (value: string | null | undefined) => void\n}\n\n/**\n * Wrapper component to control a menu. It does not render anything, only providing the state\n * management for the menu components inside it.\n */\nfunction Menu({ children, onItemSelect, ...props }: MenuProps) {\n const [anchorRect, setAnchorRect] = React.useState<{ x: number; y: number } | null>(null)\n const getAnchorRect = React.useMemo(() => (anchorRect ? () => anchorRect : null), [anchorRect])\n const menuStore = useMenuStore({ focusLoop: true, ...props })\n\n const value: MenuContextState = React.useMemo(\n () => ({ menuStore, handleItemSelect: onItemSelect, getAnchorRect, setAnchorRect }),\n [menuStore, onItemSelect, getAnchorRect, setAnchorRect],\n )\n\n return <MenuContext.Provider value={value}>{children}</MenuContext.Provider>\n}\n\n//\n// MenuButton\n//\n\ninterface MenuButtonProps\n extends Omit<AriakitMenuButtonProps, 'store' | 'className' | 'as'>,\n ObfuscatedClassName {}\n\n/**\n * A button to toggle a dropdown menu open or closed.\n */\nconst MenuButton = React.forwardRef<HTMLButtonElement, MenuButtonProps>(function MenuButton(\n { exceptionallySetClassName, ...props },\n ref,\n) {\n const { menuStore } = React.useContext(MenuContext)\n if (!menuStore) {\n throw new Error('MenuButton must be wrapped in <Menu/>')\n }\n return (\n <AriakitMenuButton\n {...props}\n store={menuStore}\n ref={ref}\n className={classNames('reactist_menubutton', exceptionallySetClassName)}\n />\n )\n})\n\n//\n// ContextMenuTrigger\n//\n\ninterface ContextMenuTriggerProps\n extends ObfuscatedClassName,\n React.HTMLAttributes<HTMLDivElement>,\n Pick<RoleProps, 'render'> {}\n\nconst ContextMenuTrigger = React.forwardRef<HTMLDivElement, ContextMenuTriggerProps>(\n function ContextMenuTrigger({ render, ...props }, ref) {\n const { setAnchorRect, menuStore } = React.useContext(MenuContext)\n if (!menuStore) {\n throw new Error('ContextMenuTrigger must be wrapped in <Menu/>')\n }\n\n const handleContextMenu = React.useCallback(\n function handleContextMenu(event: React.MouseEvent) {\n event.preventDefault()\n setAnchorRect({ x: event.clientX, y: event.clientY })\n menuStore.show()\n },\n [setAnchorRect, menuStore],\n )\n\n const isOpen = menuStore.useState('open')\n React.useEffect(() => {\n if (!isOpen) setAnchorRect(null)\n }, [isOpen, setAnchorRect])\n\n return <Role.div {...props} onContextMenu={handleContextMenu} ref={ref} render={render} />\n },\n)\n\n//\n// MenuList\n//\n\ninterface MenuListProps\n extends Omit<AriakitMenuProps, 'store' | 'className'>,\n ObfuscatedClassName {}\n\n/**\n * The dropdown menu itself, containing a list of menu items.\n */\nconst MenuList = React.forwardRef<HTMLDivElement, MenuListProps>(function MenuList(\n { exceptionallySetClassName, modal = true, ...props },\n ref,\n) {\n const { menuStore, getAnchorRect } = React.useContext(MenuContext)\n if (!menuStore) {\n throw new Error('MenuList must be wrapped in <Menu/>')\n }\n\n const isOpen = menuStore.useState('open')\n\n return isOpen ? (\n <Portal preserveTabOrder>\n <AriakitMenu\n {...props}\n store={menuStore}\n gutter={8}\n shift={4}\n ref={ref}\n className={classNames('reactist_menulist', exceptionallySetClassName)}\n getAnchorRect={getAnchorRect ?? undefined}\n modal={modal}\n />\n </Portal>\n ) : null\n})\n\n//\n// MenuItem\n//\n\ninterface MenuItemProps extends AriakitMenuItemProps, ObfuscatedClassName {\n /**\n * An optional value given to this menu item. It is passed on to the parent `Menu`'s\n * `onItemSelect` when you provide that instead of (or alongside) providing individual\n * `onSelect` callbacks to each menu item.\n */\n value?: string\n\n /**\n * When `true` the menu item is disabled and won't be selectable or be part of the keyboard\n * navigation across the menu options.\n *\n * @default true\n */\n disabled?: boolean\n\n /**\n * When `true` the menu will close when the menu item is selected, in addition to performing the\n * action that the menu item is set out to do.\n *\n * Set this to `false` to make sure that a given menu item does not auto-closes the menu when\n * selected. This should be the exception and not the norm, as the default is to auto-close.\n *\n * @default true\n */\n hideOnSelect?: boolean\n\n /**\n * The action to perform when the menu item is selected.\n *\n * If you return `false` from this function, the menu will not auto-close when this menu item\n * is selected. Though you should use `hideOnSelect` for this purpose, this allows you to\n * achieve the same effect conditionally and dynamically deciding at run time.\n */\n onSelect?: () => unknown\n\n /**\n * The event handler called when the menu item is clicked.\n *\n * This is similar to `onSelect`, but a bit different. You can certainly use it to trigger the\n * action that the menu item represents. But in general you should prefer `onSelect` for that.\n *\n * The main use for this handler is to get access to the click event. This can be used, for\n * example, to call `event.preventDefault()`, which will effectively prevent the rest of the\n * consequences of the click, including preventing `onSelect` from being called. In particular,\n * this is useful in menu items that are links, and you want the click to not trigger navigation\n * under some circumstances.\n */\n onClick?: (event: React.MouseEvent) => void\n}\n\n/**\n * A menu item inside a menu list. It can be selected by the user, triggering the `onSelect`\n * callback.\n */\nconst MenuItem = React.forwardRef<HTMLDivElement, MenuItemProps>(function MenuItem(\n {\n value,\n children,\n onSelect,\n hideOnSelect = true,\n onClick,\n exceptionallySetClassName,\n ...props\n },\n ref,\n) {\n const { handleItemSelect, menuStore } = React.useContext(MenuContext)\n if (!menuStore) {\n throw new Error('MenuItem must be wrapped in <Menu/>')\n }\n\n const { hide } = menuStore\n const handleClick = React.useCallback(\n function handleClick(event: React.MouseEvent) {\n onClick?.(event)\n const onSelectResult: unknown =\n onSelect && !event.defaultPrevented ? onSelect() : undefined\n const shouldClose = onSelectResult !== false && hideOnSelect\n handleItemSelect?.(value)\n if (shouldClose) hide()\n },\n [onSelect, onClick, handleItemSelect, hideOnSelect, hide, value],\n )\n\n return (\n <AriakitMenuItem\n {...props}\n store={menuStore}\n ref={ref}\n onClick={handleClick}\n className={exceptionallySetClassName}\n hideOnClick={false}\n >\n {children}\n </AriakitMenuItem>\n )\n})\n\n//\n// SubMenu\n//\n\ntype SubMenuProps = Pick<MenuProps, 'children' | 'onItemSelect'>\n\n/**\n * This component can be rendered alongside other `MenuItem` inside a `MenuList` in order to have\n * a sub-menu.\n *\n * Its children are expected to have the structure of a first level menu (a `MenuButton` and a\n * `MenuList`).\n *\n * ```jsx\n * <MenuItem label=\"Edit profile\" />\n * <SubMenu>\n * <MenuButton>More options</MenuButton>\n * <MenuList>\n * <MenuItem label=\"Preferences\" />\n * <MenuItem label=\"Sign out\" />\n * </MenuList>\n * </SubMenu>\n * ```\n *\n * The `MenuButton` will become a menu item in the current menu items list, and it will lead to\n * opening a sub-menu with the menu items list below it.\n */\nconst SubMenu = React.forwardRef<HTMLDivElement, SubMenuProps>(function SubMenu(\n { children, onItemSelect },\n ref,\n) {\n const { handleItemSelect: parentMenuItemSelect, menuStore } = React.useContext(MenuContext)\n if (!menuStore) {\n throw new Error('SubMenu must be wrapped in <Menu/>')\n }\n\n const { hide: parentMenuHide } = menuStore\n const handleSubItemSelect = React.useCallback(\n function handleSubItemSelect(value: string | null | undefined) {\n onItemSelect?.(value)\n parentMenuItemSelect?.(value)\n parentMenuHide()\n },\n [parentMenuHide, parentMenuItemSelect, onItemSelect],\n )\n\n const [button, list] = React.Children.toArray(children)\n const buttonElement = button as React.ReactElement<MenuButtonProps>\n\n return (\n <Menu onItemSelect={handleSubItemSelect}>\n <AriakitMenuItem store={menuStore} ref={ref} hideOnClick={false} render={buttonElement}>\n {buttonElement.props.children}\n </AriakitMenuItem>\n {list}\n </Menu>\n )\n})\n\n//\n// MenuGroup\n//\n\ninterface MenuGroupProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, 'className'>,\n ObfuscatedClassName {\n /**\n * A label to be shown visually and also used to semantically label the group.\n */\n label: string\n}\n\n/**\n * A way to semantically group some menu items.\n *\n * This group does not add any visual separator. You can do that yourself adding `<hr />` elements\n * before and/or after the group if you so wish.\n */\nconst MenuGroup = React.forwardRef<HTMLDivElement, MenuGroupProps>(function MenuGroup(\n { label, children, exceptionallySetClassName, ...props },\n ref,\n) {\n const { menuStore } = React.useContext(MenuContext)\n if (!menuStore) {\n throw new Error('MenuGroup must be wrapped in <Menu/>')\n }\n\n return (\n <AriakitMenuGroup\n {...props}\n ref={ref}\n store={menuStore}\n className={exceptionallySetClassName}\n >\n {label ? (\n <div role=\"presentation\" className=\"reactist_menugroup__label\">\n {label}\n </div>\n ) : null}\n {children}\n </AriakitMenuGroup>\n )\n})\n\nexport { ContextMenuTrigger, Menu, MenuButton, MenuList, MenuItem, SubMenu, MenuGroup }\nexport type { MenuButtonProps, MenuListProps, MenuItemProps, MenuGroupProps }\n"],"names":["MenuContext","React","menuStore","handleItemSelect","getAnchorRect","setAnchorRect","Menu","children","onItemSelect","props","anchorRect","useMenuStore","focusLoop","value","Provider","MenuButton","ref","exceptionallySetClassName","Error","AriakitMenuButton","store","className","classNames","ContextMenuTrigger","render","handleContextMenu","event","preventDefault","x","clientX","y","clientY","show","isOpen","useState","Role","div","onContextMenu","MenuList","modal","Portal","preserveTabOrder","AriakitMenu","gutter","shift","undefined","MenuItem","onSelect","hideOnSelect","onClick","hide","handleClick","shouldClose","defaultPrevented","AriakitMenuItem","hideOnClick","SubMenu","parentMenuItemSelect","parentMenuHide","handleSubItemSelect","button","list","toArray","MenuGroup","label","AriakitMenuGroup","role"],"mappings":"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"}
1
+ {"version":3,"file":"menu.js","sources":["../../src/menu/menu.tsx"],"sourcesContent":["import * as React from 'react'\nimport classNames from 'classnames'\n\nimport {\n Portal,\n MenuStore,\n MenuStoreProps,\n useMenuStore,\n MenuProps as AriakitMenuProps,\n Menu as AriakitMenu,\n MenuGroup as AriakitMenuGroup,\n MenuItem as AriakitMenuItem,\n MenuItemProps as AriakitMenuItemProps,\n MenuButton as AriakitMenuButton,\n MenuButtonProps as AriakitMenuButtonProps,\n Role,\n RoleProps,\n} from '@ariakit/react'\n\nimport './menu.less'\nimport type { ObfuscatedClassName } from '../utils/common-types'\n\ntype MenuContextState = {\n menuStore: MenuStore | null\n handleItemSelect?: (value: string | null | undefined) => void\n getAnchorRect: (() => { x: number; y: number }) | null\n setAnchorRect: (rect: { x: number; y: number } | null) => void\n}\n\nconst MenuContext = React.createContext<MenuContextState>({\n menuStore: null,\n handleItemSelect: () => undefined,\n getAnchorRect: null,\n setAnchorRect: () => undefined,\n})\n\n//\n// Menu\n//\n\ninterface MenuProps extends Omit<MenuStoreProps, 'visible'> {\n /**\n * The `Menu` must contain a `MenuList` that defines the menu options. It must also contain a\n * `MenuButton` that triggers the menu to be opened or closed.\n */\n children: React.ReactNode\n\n /**\n * An optional callback that will be called back whenever a menu item is selected. It receives\n * the `value` of the selected `MenuItem`.\n *\n * If you pass down this callback, it is recommended that you properly memoize it so it does not\n * change on every render.\n */\n onItemSelect?: (value: string | null | undefined) => void\n}\n\n/**\n * Wrapper component to control a menu. It does not render anything, only providing the state\n * management for the menu components inside it.\n */\nfunction Menu({ children, onItemSelect, ...props }: MenuProps) {\n const [anchorRect, setAnchorRect] = React.useState<{ x: number; y: number } | null>(null)\n const getAnchorRect = React.useMemo(() => (anchorRect ? () => anchorRect : null), [anchorRect])\n const menuStore = useMenuStore({ focusLoop: true, ...props })\n\n const value: MenuContextState = React.useMemo(\n () => ({ menuStore, handleItemSelect: onItemSelect, getAnchorRect, setAnchorRect }),\n [menuStore, onItemSelect, getAnchorRect, setAnchorRect],\n )\n\n return <MenuContext.Provider value={value}>{children}</MenuContext.Provider>\n}\n\n//\n// MenuButton\n//\n\ninterface MenuButtonProps\n extends Omit<AriakitMenuButtonProps, 'store' | 'className' | 'as'>,\n ObfuscatedClassName {}\n\n/**\n * A button to toggle a dropdown menu open or closed.\n */\nconst MenuButton = React.forwardRef<HTMLButtonElement, MenuButtonProps>(function MenuButton(\n { exceptionallySetClassName, ...props },\n ref,\n) {\n const { menuStore } = React.useContext(MenuContext)\n if (!menuStore) {\n throw new Error('MenuButton must be wrapped in <Menu/>')\n }\n return (\n <AriakitMenuButton\n {...props}\n store={menuStore}\n ref={ref}\n className={classNames('reactist_menubutton', exceptionallySetClassName)}\n />\n )\n})\n\n//\n// ContextMenuTrigger\n//\n\ninterface ContextMenuTriggerProps\n extends ObfuscatedClassName,\n React.HTMLAttributes<HTMLDivElement>,\n Pick<RoleProps, 'render'> {}\n\nconst ContextMenuTrigger = React.forwardRef<HTMLDivElement, ContextMenuTriggerProps>(\n function ContextMenuTrigger({ render, ...props }, ref) {\n const { setAnchorRect, menuStore } = React.useContext(MenuContext)\n if (!menuStore) {\n throw new Error('ContextMenuTrigger must be wrapped in <Menu/>')\n }\n\n const handleContextMenu = React.useCallback(\n function handleContextMenu(event: React.MouseEvent) {\n event.preventDefault()\n setAnchorRect({ x: event.clientX, y: event.clientY })\n menuStore.show()\n },\n [setAnchorRect, menuStore],\n )\n\n const isOpen = menuStore.useState('open')\n React.useEffect(() => {\n if (!isOpen) setAnchorRect(null)\n }, [isOpen, setAnchorRect])\n\n return <Role.div {...props} onContextMenu={handleContextMenu} ref={ref} render={render} />\n },\n)\n\n//\n// MenuList\n//\n\ninterface MenuListProps\n extends Omit<AriakitMenuProps, 'store' | 'className'>,\n ObfuscatedClassName {}\n\n/**\n * The dropdown menu itself, containing a list of menu items.\n */\nconst MenuList = React.forwardRef<HTMLDivElement, MenuListProps>(function MenuList(\n { exceptionallySetClassName, modal = true, ...props },\n ref,\n) {\n const { menuStore, getAnchorRect } = React.useContext(MenuContext)\n if (!menuStore) {\n throw new Error('MenuList must be wrapped in <Menu/>')\n }\n\n const isOpen = menuStore.useState('open')\n\n return isOpen ? (\n <Portal preserveTabOrder>\n <AriakitMenu\n {...props}\n store={menuStore}\n gutter={8}\n shift={4}\n ref={ref}\n className={classNames('reactist_menulist', exceptionallySetClassName)}\n getAnchorRect={getAnchorRect ?? undefined}\n modal={modal}\n />\n </Portal>\n ) : null\n})\n\n//\n// MenuItem\n//\n\ninterface MenuItemProps extends AriakitMenuItemProps, ObfuscatedClassName {\n /**\n * An optional value given to this menu item. It is passed on to the parent `Menu`'s\n * `onItemSelect` when you provide that instead of (or alongside) providing individual\n * `onSelect` callbacks to each menu item.\n */\n value?: string\n\n /**\n * When `true` the menu item is disabled and won't be selectable or be part of the keyboard\n * navigation across the menu options.\n *\n * @default true\n */\n disabled?: boolean\n\n /**\n * When `true` the menu will close when the menu item is selected, in addition to performing the\n * action that the menu item is set out to do.\n *\n * Set this to `false` to make sure that a given menu item does not auto-closes the menu when\n * selected. This should be the exception and not the norm, as the default is to auto-close.\n *\n * @default true\n */\n hideOnSelect?: boolean\n\n /**\n * The action to perform when the menu item is selected.\n *\n * If you return `false` from this function, the menu will not auto-close when this menu item\n * is selected. Though you should use `hideOnSelect` for this purpose, this allows you to\n * achieve the same effect conditionally and dynamically deciding at run time.\n */\n onSelect?: () => unknown\n\n /**\n * The event handler called when the menu item is clicked.\n *\n * This is similar to `onSelect`, but a bit different. You can certainly use it to trigger the\n * action that the menu item represents. But in general you should prefer `onSelect` for that.\n *\n * The main use for this handler is to get access to the click event. This can be used, for\n * example, to call `event.preventDefault()`, which will effectively prevent the rest of the\n * consequences of the click, including preventing `onSelect` from being called. In particular,\n * this is useful in menu items that are links, and you want the click to not trigger navigation\n * under some circumstances.\n */\n onClick?: (event: React.MouseEvent) => void\n}\n\n/**\n * A menu item inside a menu list. It can be selected by the user, triggering the `onSelect`\n * callback.\n */\nconst MenuItem = React.forwardRef<HTMLDivElement, MenuItemProps>(function MenuItem(\n {\n value,\n children,\n onSelect,\n hideOnSelect = true,\n onClick,\n exceptionallySetClassName,\n ...props\n },\n ref,\n) {\n const { handleItemSelect, menuStore } = React.useContext(MenuContext)\n if (!menuStore) {\n throw new Error('MenuItem must be wrapped in <Menu/>')\n }\n\n const { hide } = menuStore\n const handleClick = React.useCallback(\n function handleClick(event: React.MouseEvent) {\n onClick?.(event)\n const onSelectResult: unknown =\n onSelect && !event.defaultPrevented ? onSelect() : undefined\n const shouldClose = onSelectResult !== false && hideOnSelect\n handleItemSelect?.(value)\n if (shouldClose) hide()\n },\n [onSelect, onClick, handleItemSelect, hideOnSelect, hide, value],\n )\n\n return (\n <AriakitMenuItem\n {...props}\n store={menuStore}\n ref={ref}\n onClick={handleClick}\n className={exceptionallySetClassName}\n hideOnClick={false}\n >\n {children}\n </AriakitMenuItem>\n )\n})\n\n//\n// SubMenu\n//\n\ntype SubMenuProps = Pick<MenuProps, 'children' | 'onItemSelect'>\n\n/**\n * This component can be rendered alongside other `MenuItem` inside a `MenuList` in order to have\n * a sub-menu.\n *\n * Its children are expected to have the structure of a first level menu (a `MenuButton` and a\n * `MenuList`).\n *\n * ```jsx\n * <MenuItem label=\"Edit profile\" />\n * <SubMenu>\n * <MenuButton>More options</MenuButton>\n * <MenuList>\n * <MenuItem label=\"Preferences\" />\n * <MenuItem label=\"Sign out\" />\n * </MenuList>\n * </SubMenu>\n * ```\n *\n * The `MenuButton` will become a menu item in the current menu items list, and it will lead to\n * opening a sub-menu with the menu items list below it.\n */\nconst SubMenu = React.forwardRef<HTMLDivElement, SubMenuProps>(function SubMenu(\n { children, onItemSelect },\n ref,\n) {\n const { handleItemSelect: parentMenuItemSelect, menuStore } = React.useContext(MenuContext)\n if (!menuStore) {\n throw new Error('SubMenu must be wrapped in <Menu/>')\n }\n\n const { hide: parentMenuHide } = menuStore\n const handleSubItemSelect = React.useCallback(\n function handleSubItemSelect(value: string | null | undefined) {\n onItemSelect?.(value)\n parentMenuItemSelect?.(value)\n parentMenuHide()\n },\n [parentMenuHide, parentMenuItemSelect, onItemSelect],\n )\n\n const [button, list] = React.Children.toArray(children)\n const buttonElement = button as React.ReactElement<MenuButtonProps>\n\n return (\n <Menu onItemSelect={handleSubItemSelect}>\n <AriakitMenuItem store={menuStore} ref={ref} hideOnClick={false} render={buttonElement}>\n {buttonElement.props.children}\n </AriakitMenuItem>\n {list}\n </Menu>\n )\n})\n\n//\n// MenuGroup\n//\n\ninterface MenuGroupProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, 'className'>,\n ObfuscatedClassName {\n /**\n * A label to be shown visually and also used to semantically label the group.\n */\n label: string\n}\n\n/**\n * A way to semantically group some menu items.\n *\n * This group does not add any visual separator. You can do that yourself adding `<hr />` elements\n * before and/or after the group if you so wish.\n */\nconst MenuGroup = React.forwardRef<HTMLDivElement, MenuGroupProps>(function MenuGroup(\n { label, children, exceptionallySetClassName, ...props },\n ref,\n) {\n const { menuStore } = React.useContext(MenuContext)\n if (!menuStore) {\n throw new Error('MenuGroup must be wrapped in <Menu/>')\n }\n\n return (\n <AriakitMenuGroup\n {...props}\n ref={ref}\n store={menuStore}\n className={exceptionallySetClassName}\n >\n {label ? (\n <div role=\"presentation\" className=\"reactist_menugroup__label\">\n {label}\n </div>\n ) : null}\n {children}\n </AriakitMenuGroup>\n )\n})\n\nexport { ContextMenuTrigger, Menu, MenuButton, MenuList, MenuItem, SubMenu, MenuGroup }\nexport type { MenuButtonProps, MenuListProps, MenuItemProps, MenuGroupProps }\n"],"names":["MenuContext","React","createContext","menuStore","handleItemSelect","getAnchorRect","setAnchorRect","Menu","_ref","children","onItemSelect","props","_objectWithoutProperties","objectWithoutProperties","_excluded","anchorRect","useState","useMemo","useMenuStore","_objectSpread","focusLoop","value","createElement","Provider","MenuButton","forwardRef","ref","exceptionallySetClassName","_ref2","_excluded2","useContext","Error","AriakitMenuButton","store","className","classNames","ContextMenuTrigger","render","_ref3","_excluded3","handleContextMenu","useCallback","event","preventDefault","x","clientX","y","clientY","show","isOpen","useEffect","Role","div","onContextMenu","MenuList","modal","_ref4","_excluded4","Portal","preserveTabOrder","AriakitMenu","gutter","shift","undefined","MenuItem","onSelect","hideOnSelect","onClick","_ref5","_excluded5","hide","handleClick","shouldClose","defaultPrevented","AriakitMenuItem","hideOnClick","SubMenu","parentMenuItemSelect","parentMenuHide","handleSubItemSelect","button","list","Children","toArray","MenuGroup","label","_ref6","_excluded6","AriakitMenuGroup","role"],"mappings":"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"}
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import * as ModalComponents from './modal';
3
3
  import type { ModalProps, ModalHeaderProps, ModalFooterProps } from './modal';
4
4
  declare function Link({ children, ...props }: JSX.IntrinsicElements['a']): React.JSX.Element;
5
- declare type ModalStoryState = Pick<ModalProps, 'width' | 'height'> & {
5
+ type ModalStoryState = Pick<ModalProps, 'width' | 'height'> & {
6
6
  button: 'true' | 'false' | 'custom';
7
7
  hideOn: 'escapeAndOverlay' | 'escape' | 'overlay';
8
8
  withScrollableContent: boolean;
@@ -27,7 +27,7 @@ declare function ModalButton({ variant, size, children, action, }: {
27
27
  declare namespace ModalButton {
28
28
  var displayName: string;
29
29
  }
30
- declare type WithOptionals<Props, Keys extends keyof Props> = Omit<Props, Keys> & Partial<Pick<Props, Keys>>;
30
+ type WithOptionals<Props, Keys extends keyof Props> = Omit<Props, Keys> & Partial<Pick<Props, Keys>>;
31
31
  declare function Modal(props: WithOptionals<ModalProps, 'isOpen' | 'onDismiss' | 'width' | 'height'>): React.JSX.Element;
32
32
  declare function ModalHeader(props: WithOptionals<ModalHeaderProps, 'withDivider' | 'button'>): React.JSX.Element;
33
33
  declare const ModalBody: typeof ModalComponents.ModalBody;
@@ -2,9 +2,9 @@ import * as React from 'react';
2
2
  import { DialogOptions, PortalOptions } from '@ariakit/react';
3
3
  import { IconButtonProps } from '../button';
4
4
  import type { ObfuscatedClassName } from '../utils/common-types';
5
- declare type ModalWidth = 'small' | 'medium' | 'large' | 'xlarge' | 'full';
6
- declare type ModalHeightMode = 'expand' | 'fitContent';
7
- declare type DivProps = Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLDivElement>, HTMLDivElement>, 'className' | 'children' | `aria-label` | `aria-labelledby`>;
5
+ type ModalWidth = 'small' | 'medium' | 'large' | 'xlarge' | 'full';
6
+ type ModalHeightMode = 'expand' | 'fitContent';
7
+ type DivProps = Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLDivElement>, HTMLDivElement>, 'className' | 'children' | `aria-label` | `aria-labelledby`>;
8
8
  export interface ModalProps extends DivProps, ObfuscatedClassName {
9
9
  /**
10
10
  * The content of the modal.
@@ -171,7 +171,7 @@ export interface ModalFooterProps extends DivProps, ObfuscatedClassName {
171
171
  * @see ModalBody
172
172
  */
173
173
  export declare function ModalFooter({ exceptionallySetClassName, withDivider, ...props }: ModalFooterProps): React.JSX.Element;
174
- export declare type ModalActionsProps = ModalFooterProps;
174
+ export type ModalActionsProps = ModalFooterProps;
175
175
  /**
176
176
  * A specific version of the ModalFooter, tailored to showing an inline list of actions (buttons).
177
177
  * @see ModalFooter
@@ -1,2 +1,2 @@
1
- "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=require("../_virtual/_rollupPluginBabelHelpers.js"),a=require("react"),n=(e(a),e(require("classnames"))),l=require("../box/box.js"),o=require("../columns/columns.js"),r=require("../divider/divider.js"),i=require("../inline/inline.js"),s=require("@ariakit/react"),c=require("../button/button.js"),u=require("../icons/close-icon.js"),d=e(require("react-focus-lock")),m=require("aria-hidden"),p=require("./modal.module.css.js");const h=["isOpen","onDismiss","height","width","exceptionallySetClassName","exceptionallySetOverlayClassName","autoFocus","hideOnEscape","hideOnInteractOutside","children","portalElement","onKeyDown","className"],f=["children","button","withDivider","exceptionallySetClassName"],x=["exceptionallySetClassName","children"],b=["exceptionallySetClassName","withDivider"],g=["children"],E=a.createContext({onDismiss:void 0,height:"fitContent"});function v(e){return!(e.ownerDocument===document&&"iframe"===e.tagName.toLowerCase())}function C(e){const{onDismiss:n}=a.useContext(E),[l,o]=a.useState(!1),[r,i]=a.useState(!1);return a.useEffect((function(){r?o(!0):i(!0)}),[r]),a.createElement(c.IconButton,t.objectSpread2(t.objectSpread2({},e),{},{variant:"quaternary",onClick:n,icon:a.createElement(u.CloseIcon,null),tabIndex:l?0:-1}))}function y(e){let{exceptionallySetClassName:n,withDivider:o=!1}=e,i=t.objectWithoutProperties(e,b);return a.createElement(a.Fragment,null,o?a.createElement(r.Divider,null):null,a.createElement(l.Box,t.objectSpread2(t.objectSpread2({as:"footer"},i),{},{className:n,padding:"large"})))}exports.Modal=function(e){let{isOpen:o,onDismiss:r,height:i="fitContent",width:c="medium",exceptionallySetClassName:u,exceptionallySetOverlayClassName:f,autoFocus:x=!0,hideOnEscape:b=!0,hideOnInteractOutside:g=!0,children:C,portalElement:y,onKeyDown:S}=e,j=t.objectWithoutProperties(e,h);const w=a.useCallback(e=>{e||null==r||r()},[r]),D=s.useDialogStore({open:o,setOpen:w}),N=a.useMemo(()=>({onDismiss:r,height:i}),[r,i]),O=a.useRef(null),q=a.useRef(null),P=a.useRef(null),B=a.useCallback(e=>{var t,a;null!=(t=q.current)&&t.contains(e.target)||null==(a=P.current)||!a.contains(e.target)||(e.stopPropagation(),null==r||r())},[r]);a.useLayoutEffect((function(){if(o&&O.current)return m.hideOthers(O.current)}),[o]);const F=a.useCallback((function(e){b&&null!=r&&"Escape"===e.key&&!e.defaultPrevented&&(e.stopPropagation(),r()),null==S||S(e)}),[r,b,S]);return o?a.createElement(s.Portal,{portalRef:O,portalElement:y},a.createElement(l.Box,{"data-testid":"modal-overlay","data-overlay":!0,className:n(p.default.overlay,p.default[i],p.default[c],f),onPointerDown:g?B:void 0,ref:P},a.createElement(d,{autoFocus:x,whiteList:v,returnFocus:!0},a.createElement(s.Dialog,t.objectSpread2(t.objectSpread2({},j),{},{ref:q,render:a.createElement(l.Box,{borderRadius:"full",background:"default",display:"flex",flexDirection:"column",overflow:"hidden",height:"expand"===i?"full":void 0,flexGrow:"expand"===i?1:0}),className:n(u,p.default.container),store:D,preventBodyScroll:!0,modal:!1,autoFocus:!1,autoFocusOnShow:!1,autoFocusOnHide:!1,portal:!1,backdrop:!1,hideOnInteractOutside:!1,hideOnEscape:!1,onKeyDown:F}),a.createElement(E.Provider,{value:N},C))))):null},exports.ModalActions=function(e){let{children:n}=e,l=t.objectWithoutProperties(e,g);return a.createElement(y,t.objectSpread2({},l),a.createElement(i.Inline,{align:"right",space:"large"},n))},exports.ModalBody=function(e){let{exceptionallySetClassName:n,children:o}=e,r=t.objectWithoutProperties(e,x);const{height:i}=a.useContext(E);return a.createElement(l.Box,t.objectSpread2(t.objectSpread2({},r),{},{className:n,flexGrow:"expand"===i?1:0,height:"expand"===i?"full":void 0,overflow:"auto"}),a.createElement(l.Box,{padding:"large",paddingBottom:"xxlarge"},o))},exports.ModalCloseButton=C,exports.ModalFooter=y,exports.ModalHeader=function(e){let{children:n,button:i=!0,withDivider:s=!1,exceptionallySetClassName:c}=e,u=t.objectWithoutProperties(e,f);return a.createElement(a.Fragment,null,a.createElement(l.Box,t.objectSpread2(t.objectSpread2({},u),{},{as:"header",paddingLeft:"large",paddingRight:!1===i||null===i?"large":"small",paddingY:"small",className:c}),a.createElement(o.Columns,{space:"large",alignY:"center"},a.createElement(o.Column,{width:"auto"},n),!1===i||null===i?a.createElement("div",{className:p.default.headerContent}):a.createElement(o.Column,{width:"content",exceptionallySetClassName:p.default.buttonContainer,"data-testid":"button-container"},"boolean"==typeof i?a.createElement(C,{"aria-label":"Close modal",autoFocus:!1}):i))),s?a.createElement(r.Divider,null):null)};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../_virtual/_rollupPluginBabelHelpers.js"),t=require("react"),a=require("classnames"),n=require("react-focus-lock"),l=require("aria-hidden"),r=require("@ariakit/react"),o=require("../icons/close-icon.js"),i=require("../columns/columns.js"),u=require("../inline/inline.js"),c=require("../divider/divider.js"),s=require("../box/box.js"),d=require("../button/button.js"),m=require("./modal.module.css.js");function p(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function f(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(a){if("default"!==a){var n=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,n.get?n:{enumerable:!0,get:function(){return e[a]}})}})),t.default=e,t}var h=f(t),b=p(a),x=p(n);const g=["isOpen","onDismiss","height","width","exceptionallySetClassName","exceptionallySetOverlayClassName","autoFocus","hideOnEscape","hideOnInteractOutside","children","portalElement","onKeyDown","className"],E=["children","button","withDivider","exceptionallySetClassName"],v=["exceptionallySetClassName","children"],y=["exceptionallySetClassName","withDivider"],j=["children"],C=h.createContext({onDismiss:void 0,height:"fitContent"});function S(e){return!(e.ownerDocument===document&&"iframe"===e.tagName.toLowerCase())}function O(t){const{onDismiss:a}=h.useContext(C),[n,l]=h.useState(!1),[r,i]=h.useState(!1);return h.useEffect((function(){r?l(!0):i(!0)}),[r]),h.createElement(d.IconButton,e.objectSpread2(e.objectSpread2({},t),{},{variant:"quaternary",onClick:a,icon:h.createElement(o.CloseIcon,null),tabIndex:n?0:-1}))}function w(t){let{exceptionallySetClassName:a,withDivider:n=!1}=t,l=e.objectWithoutProperties(t,y);return h.createElement(h.Fragment,null,n?h.createElement(c.Divider,null):null,h.createElement(s.Box,e.objectSpread2(e.objectSpread2({as:"footer"},l),{},{className:a,padding:"large"})))}exports.Modal=function(t){let{isOpen:a,onDismiss:n,height:o="fitContent",width:i="medium",exceptionallySetClassName:u,exceptionallySetOverlayClassName:c,autoFocus:d=!0,hideOnEscape:p=!0,hideOnInteractOutside:f=!0,children:E,portalElement:v,onKeyDown:y}=t,j=e.objectWithoutProperties(t,g);const O=h.useCallback(e=>{e||null==n||n()},[n]),w=r.useDialogStore({open:a,setOpen:O}),D=h.useMemo(()=>({onDismiss:n,height:o}),[n,o]),N=h.useRef(null),P=h.useRef(null),q=h.useRef(null),B=h.useCallback(e=>{var t,a;null!=(t=P.current)&&t.contains(e.target)||null==(a=q.current)||!a.contains(e.target)||(e.stopPropagation(),null==n||n())},[n]);h.useLayoutEffect((function(){if(a&&N.current)return l.hideOthers(N.current)}),[a]);const F=h.useCallback((function(e){p&&null!=n&&"Escape"===e.key&&!e.defaultPrevented&&(e.stopPropagation(),n()),null==y||y(e)}),[n,p,y]);return a?h.createElement(r.Portal,{portalRef:N,portalElement:v},h.createElement(s.Box,{"data-testid":"modal-overlay","data-overlay":!0,className:b.default(m.default.overlay,m.default[o],m.default[i],c),onPointerDown:f?B:void 0,ref:q},h.createElement(x.default,{autoFocus:d,whiteList:S,returnFocus:!0},h.createElement(r.Dialog,e.objectSpread2(e.objectSpread2({},j),{},{ref:P,render:h.createElement(s.Box,{borderRadius:"full",background:"default",display:"flex",flexDirection:"column",overflow:"hidden",height:"expand"===o?"full":void 0,flexGrow:"expand"===o?1:0}),className:b.default(u,m.default.container),store:w,preventBodyScroll:!0,modal:!1,autoFocus:!1,autoFocusOnShow:!1,autoFocusOnHide:!1,portal:!1,backdrop:!1,hideOnInteractOutside:!1,hideOnEscape:!1,onKeyDown:F}),h.createElement(C.Provider,{value:D},E))))):null},exports.ModalActions=function(t){let{children:a}=t,n=e.objectWithoutProperties(t,j);return h.createElement(w,e.objectSpread2({},n),h.createElement(u.Inline,{align:"right",space:"large"},a))},exports.ModalBody=function(t){let{exceptionallySetClassName:a,children:n}=t,l=e.objectWithoutProperties(t,v);const{height:r}=h.useContext(C);return h.createElement(s.Box,e.objectSpread2(e.objectSpread2({},l),{},{className:a,flexGrow:"expand"===r?1:0,height:"expand"===r?"full":void 0,overflow:"auto"}),h.createElement(s.Box,{padding:"large",paddingBottom:"xxlarge"},n))},exports.ModalCloseButton=O,exports.ModalFooter=w,exports.ModalHeader=function(t){let{children:a,button:n=!0,withDivider:l=!1,exceptionallySetClassName:r}=t,o=e.objectWithoutProperties(t,E);return h.createElement(h.Fragment,null,h.createElement(s.Box,e.objectSpread2(e.objectSpread2({},o),{},{as:"header",paddingLeft:"large",paddingRight:!1===n||null===n?"large":"small",paddingY:"small",className:r}),h.createElement(i.Columns,{space:"large",alignY:"center"},h.createElement(i.Column,{width:"auto"},a),!1===n||null===n?h.createElement("div",{className:m.default.headerContent}):h.createElement(i.Column,{width:"content",exceptionallySetClassName:m.default.buttonContainer,"data-testid":"button-container"},"boolean"==typeof n?h.createElement(O,{"aria-label":"Close modal",autoFocus:!1}):n))),l?h.createElement(c.Divider,null):null)};
2
2
  //# sourceMappingURL=modal.js.map