@doist/reactist 11.5.0 → 12.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (284) hide show
  1. package/dist/reactist.cjs.development.js +1344 -1499
  2. package/dist/reactist.cjs.development.js.map +1 -1
  3. package/dist/reactist.cjs.production.min.js +1 -1
  4. package/dist/reactist.cjs.production.min.js.map +1 -1
  5. package/es/_virtual/_rollupPluginBabelHelpers.js +18 -21
  6. package/es/_virtual/_rollupPluginBabelHelpers.js.map +1 -1
  7. package/es/components/checkbox/checkbox.js +7 -9
  8. package/es/components/checkbox/checkbox.js.map +1 -1
  9. package/es/components/color-picker/color-picker.js +24 -28
  10. package/es/components/color-picker/color-picker.js.map +1 -1
  11. package/es/components/deprecated-button/deprecated-button.js +16 -18
  12. package/es/components/deprecated-button/deprecated-button.js.map +1 -1
  13. package/es/components/deprecated-loading/deprecated-loading.js +7 -10
  14. package/es/components/deprecated-loading/deprecated-loading.js.map +1 -1
  15. package/es/components/deprecated-modal/deprecated-modal.js +69 -101
  16. package/es/components/deprecated-modal/deprecated-modal.js.map +1 -1
  17. package/es/components/deprecated-modal/index.js +4 -4
  18. package/es/components/deprecated-modal/index.js.map +1 -1
  19. package/es/components/dropdown/dropdown.js +86 -85
  20. package/es/components/dropdown/dropdown.js.map +1 -1
  21. package/es/components/icons/CloseIcon.svg.js +9 -11
  22. package/es/components/icons/CloseIcon.svg.js.map +1 -1
  23. package/es/components/input/input.js +4 -3
  24. package/es/components/input/input.js.map +1 -1
  25. package/es/components/key-capturer/key-capturer.js +22 -19
  26. package/es/components/key-capturer/key-capturer.js.map +1 -1
  27. package/es/components/keyboard-shortcut/keyboard-shortcut.js +20 -26
  28. package/es/components/keyboard-shortcut/keyboard-shortcut.js.map +1 -1
  29. package/es/components/menu/menu.js +112 -142
  30. package/es/components/menu/menu.js.map +1 -1
  31. package/es/components/notification/notification.js +32 -32
  32. package/es/components/notification/notification.js.map +1 -1
  33. package/es/components/popover/popover.js +85 -91
  34. package/es/components/popover/popover.js.map +1 -1
  35. package/es/components/popover/positioning-utils.js +49 -65
  36. package/es/components/popover/positioning-utils.js.map +1 -1
  37. package/es/components/progress-bar/progress-bar.js +8 -8
  38. package/es/components/progress-bar/progress-bar.js.map +1 -1
  39. package/es/components/select/select.js +20 -25
  40. package/es/components/select/select.js.map +1 -1
  41. package/es/components/time/time-utils.js +30 -47
  42. package/es/components/time/time-utils.js.map +1 -1
  43. package/es/components/time/time.js +43 -56
  44. package/es/components/time/time.js.map +1 -1
  45. package/es/components/tooltip/tooltip.js +43 -46
  46. package/es/components/tooltip/tooltip.js.map +1 -1
  47. package/es/hooks/use-previous/use-previous.js +2 -2
  48. package/es/hooks/use-previous/use-previous.js.map +1 -1
  49. package/es/new-components/alert/alert.js +7 -6
  50. package/es/new-components/alert/alert.js.map +1 -1
  51. package/es/new-components/avatar/avatar.js +19 -18
  52. package/es/new-components/avatar/avatar.js.map +1 -1
  53. package/es/new-components/avatar/utils.js +12 -9
  54. package/es/new-components/avatar/utils.js.map +1 -1
  55. package/es/new-components/base-button/base-button.js +25 -29
  56. package/es/new-components/base-button/base-button.js.map +1 -1
  57. package/es/new-components/base-field/base-field.js +20 -18
  58. package/es/new-components/base-field/base-field.js.map +1 -1
  59. package/es/new-components/box/box.js +51 -52
  60. package/es/new-components/box/box.js.map +1 -1
  61. package/es/new-components/button/button.js +13 -15
  62. package/es/new-components/button/button.js.map +1 -1
  63. package/es/new-components/button-link/button-link.js +13 -15
  64. package/es/new-components/button-link/button-link.js.map +1 -1
  65. package/es/new-components/checkbox-field/checkbox-field.js +25 -33
  66. package/es/new-components/checkbox-field/checkbox-field.js.map +1 -1
  67. package/es/new-components/checkbox-field/checkbox-icon.js +21 -19
  68. package/es/new-components/checkbox-field/checkbox-icon.js.map +1 -1
  69. package/es/new-components/columns/columns.js +24 -27
  70. package/es/new-components/columns/columns.js.map +1 -1
  71. package/es/new-components/common-helpers.js +3 -3
  72. package/es/new-components/common-helpers.js.map +1 -1
  73. package/es/new-components/divider/divider.js +7 -6
  74. package/es/new-components/divider/divider.js.map +1 -1
  75. package/es/new-components/heading/heading.js +17 -17
  76. package/es/new-components/heading/heading.js.map +1 -1
  77. package/es/new-components/hidden/hidden.js +14 -13
  78. package/es/new-components/hidden/hidden.js.map +1 -1
  79. package/es/new-components/hidden-visually/hidden-visually.js +3 -2
  80. package/es/new-components/hidden-visually/hidden-visually.js.map +1 -1
  81. package/es/new-components/icons/alert-icon.js +13 -11
  82. package/es/new-components/icons/alert-icon.js.map +1 -1
  83. package/es/new-components/icons/close-icon.js +2 -1
  84. package/es/new-components/icons/close-icon.js.map +1 -1
  85. package/es/new-components/icons/password-hidden-icon.js +2 -1
  86. package/es/new-components/icons/password-hidden-icon.js.map +1 -1
  87. package/es/new-components/icons/password-visible-icon.js +2 -1
  88. package/es/new-components/icons/password-visible-icon.js.map +1 -1
  89. package/es/new-components/inline/inline.js +15 -19
  90. package/es/new-components/inline/inline.js.map +1 -1
  91. package/es/new-components/loading/loading.js +12 -10
  92. package/es/new-components/loading/loading.js.map +1 -1
  93. package/es/new-components/modal/modal.js +64 -66
  94. package/es/new-components/modal/modal.js.map +1 -1
  95. package/es/new-components/modal/modal.module.css.js +1 -1
  96. package/es/new-components/notice/notice.js +5 -4
  97. package/es/new-components/notice/notice.js.map +1 -1
  98. package/es/new-components/password-field/password-field.js +40 -46
  99. package/es/new-components/password-field/password-field.js.map +1 -1
  100. package/es/new-components/responsive-props.js +5 -5
  101. package/es/new-components/responsive-props.js.map +1 -1
  102. package/es/new-components/select-field/select-field.js +23 -23
  103. package/es/new-components/select-field/select-field.js.map +1 -1
  104. package/es/new-components/spinner/spinner.js +3 -3
  105. package/es/new-components/spinner/spinner.js.map +1 -1
  106. package/es/new-components/stack/stack.js +18 -22
  107. package/es/new-components/stack/stack.js.map +1 -1
  108. package/es/new-components/switch-field/switch-field.js +31 -41
  109. package/es/new-components/switch-field/switch-field.js.map +1 -1
  110. package/es/new-components/tabs/tabs.js +92 -78
  111. package/es/new-components/tabs/tabs.js.map +1 -1
  112. package/es/new-components/tabs/tabs.module.css.js +1 -1
  113. package/es/new-components/text/text.js +16 -17
  114. package/es/new-components/text/text.js.map +1 -1
  115. package/es/new-components/text/text.module.css.js +1 -1
  116. package/es/new-components/text-area/text-area.js +14 -14
  117. package/es/new-components/text-area/text-area.js.map +1 -1
  118. package/es/new-components/text-field/text-field.js +21 -22
  119. package/es/new-components/text-field/text-field.js.map +1 -1
  120. package/es/new-components/text-link/text-link.js +10 -10
  121. package/es/new-components/text-link/text-link.js.map +1 -1
  122. package/es/new-components/text-link/text-link.module.css.js +1 -1
  123. package/es/utils/polymorphism.js.map +1 -1
  124. package/lib/_virtual/_rollupPluginBabelHelpers.js +1 -1
  125. package/lib/components/checkbox/checkbox.js +1 -1
  126. package/lib/components/checkbox/checkbox.js.map +1 -1
  127. package/lib/components/color-picker/color-picker.js +1 -1
  128. package/lib/components/color-picker/color-picker.js.map +1 -1
  129. package/lib/components/deprecated-button/deprecated-button.d.ts +3 -3
  130. package/lib/components/deprecated-button/deprecated-button.js +1 -1
  131. package/lib/components/deprecated-button/deprecated-button.js.map +1 -1
  132. package/lib/components/deprecated-loading/deprecated-loading.js +1 -1
  133. package/lib/components/deprecated-loading/deprecated-loading.js.map +1 -1
  134. package/lib/components/deprecated-modal/deprecated-modal.d.ts +2 -2
  135. package/lib/components/deprecated-modal/deprecated-modal.js +1 -1
  136. package/lib/components/deprecated-modal/deprecated-modal.js.map +1 -1
  137. package/lib/components/deprecated-modal/index.js.map +1 -1
  138. package/lib/components/dropdown/dropdown.d.ts +5 -2
  139. package/lib/components/dropdown/dropdown.js +1 -1
  140. package/lib/components/dropdown/dropdown.js.map +1 -1
  141. package/lib/components/icons/CloseIcon.svg.js +1 -1
  142. package/lib/components/icons/CloseIcon.svg.js.map +1 -1
  143. package/lib/components/input/input.js +1 -1
  144. package/lib/components/input/input.js.map +1 -1
  145. package/lib/components/key-capturer/key-capturer.d.ts +1 -1
  146. package/lib/components/key-capturer/key-capturer.js +1 -1
  147. package/lib/components/key-capturer/key-capturer.js.map +1 -1
  148. package/lib/components/keyboard-shortcut/keyboard-shortcut.js +1 -1
  149. package/lib/components/keyboard-shortcut/keyboard-shortcut.js.map +1 -1
  150. package/lib/components/menu/menu.d.ts +7 -7
  151. package/lib/components/menu/menu.js +1 -1
  152. package/lib/components/menu/menu.js.map +1 -1
  153. package/lib/components/notification/notification.js +1 -1
  154. package/lib/components/notification/notification.js.map +1 -1
  155. package/lib/components/popover/popover.d.ts +1 -1
  156. package/lib/components/popover/popover.js +1 -1
  157. package/lib/components/popover/popover.js.map +1 -1
  158. package/lib/components/popover/positioning-utils.js +1 -1
  159. package/lib/components/popover/positioning-utils.js.map +1 -1
  160. package/lib/components/progress-bar/progress-bar.js +1 -1
  161. package/lib/components/progress-bar/progress-bar.js.map +1 -1
  162. package/lib/components/select/select.js +1 -1
  163. package/lib/components/select/select.js.map +1 -1
  164. package/lib/components/time/time-utils.js +1 -1
  165. package/lib/components/time/time-utils.js.map +1 -1
  166. package/lib/components/time/time.js +1 -1
  167. package/lib/components/time/time.js.map +1 -1
  168. package/lib/components/tooltip/index.d.ts +1 -2
  169. package/lib/components/tooltip/tooltip.d.ts +3 -3
  170. package/lib/components/tooltip/tooltip.js +1 -1
  171. package/lib/components/tooltip/tooltip.js.map +1 -1
  172. package/lib/hooks/use-previous/use-previous.js +1 -1
  173. package/lib/hooks/use-previous/use-previous.js.map +1 -1
  174. package/lib/index.d.ts +2 -1
  175. package/lib/new-components/alert/alert.d.ts +1 -1
  176. package/lib/new-components/alert/alert.js +1 -1
  177. package/lib/new-components/alert/alert.js.map +1 -1
  178. package/lib/new-components/avatar/avatar.js +1 -1
  179. package/lib/new-components/avatar/avatar.js.map +1 -1
  180. package/lib/new-components/avatar/utils.d.ts +1 -1
  181. package/lib/new-components/avatar/utils.js +1 -1
  182. package/lib/new-components/avatar/utils.js.map +1 -1
  183. package/lib/new-components/base-button/base-button.js +1 -1
  184. package/lib/new-components/base-button/base-button.js.map +1 -1
  185. package/lib/new-components/base-field/base-field.d.ts +1 -1
  186. package/lib/new-components/base-field/base-field.js +1 -1
  187. package/lib/new-components/base-field/base-field.js.map +1 -1
  188. package/lib/new-components/box/box.js +1 -1
  189. package/lib/new-components/box/box.js.map +1 -1
  190. package/lib/new-components/button/button.d.ts +1 -58
  191. package/lib/new-components/button/button.js +1 -1
  192. package/lib/new-components/button/button.js.map +1 -1
  193. package/lib/new-components/button-link/button-link.js +1 -1
  194. package/lib/new-components/button-link/button-link.js.map +1 -1
  195. package/lib/new-components/checkbox-field/checkbox-field.d.ts +1 -1
  196. package/lib/new-components/checkbox-field/checkbox-field.js +1 -1
  197. package/lib/new-components/checkbox-field/checkbox-field.js.map +1 -1
  198. package/lib/new-components/checkbox-field/checkbox-icon.js +1 -1
  199. package/lib/new-components/checkbox-field/checkbox-icon.js.map +1 -1
  200. package/lib/new-components/columns/columns.js +1 -1
  201. package/lib/new-components/columns/columns.js.map +1 -1
  202. package/lib/new-components/common-helpers.js +1 -1
  203. package/lib/new-components/common-helpers.js.map +1 -1
  204. package/lib/new-components/common-types.d.ts +2 -2
  205. package/lib/new-components/divider/divider.js +1 -1
  206. package/lib/new-components/divider/divider.js.map +1 -1
  207. package/lib/new-components/heading/heading.d.ts +2 -2
  208. package/lib/new-components/heading/heading.js +1 -1
  209. package/lib/new-components/heading/heading.js.map +1 -1
  210. package/lib/new-components/hidden/hidden.js +1 -1
  211. package/lib/new-components/hidden/hidden.js.map +1 -1
  212. package/lib/new-components/hidden-visually/hidden-visually.js +1 -1
  213. package/lib/new-components/hidden-visually/hidden-visually.js.map +1 -1
  214. package/lib/new-components/icons/alert-icon.d.ts +1 -1
  215. package/lib/new-components/icons/alert-icon.js +1 -1
  216. package/lib/new-components/icons/alert-icon.js.map +1 -1
  217. package/lib/new-components/icons/close-icon.js +1 -1
  218. package/lib/new-components/icons/close-icon.js.map +1 -1
  219. package/lib/new-components/icons/password-hidden-icon.js +1 -1
  220. package/lib/new-components/icons/password-hidden-icon.js.map +1 -1
  221. package/lib/new-components/icons/password-visible-icon.js +1 -1
  222. package/lib/new-components/icons/password-visible-icon.js.map +1 -1
  223. package/lib/new-components/inline/inline.js +1 -1
  224. package/lib/new-components/inline/inline.js.map +1 -1
  225. package/lib/new-components/loading/loading.d.ts +1 -1
  226. package/lib/new-components/loading/loading.js +1 -1
  227. package/lib/new-components/loading/loading.js.map +1 -1
  228. package/lib/new-components/modal/modal.js +1 -1
  229. package/lib/new-components/modal/modal.js.map +1 -1
  230. package/lib/new-components/modal/modal.module.css.js +1 -1
  231. package/lib/new-components/notice/notice.d.ts +1 -1
  232. package/lib/new-components/notice/notice.js +1 -1
  233. package/lib/new-components/notice/notice.js.map +1 -1
  234. package/lib/new-components/password-field/password-field.d.ts +1 -1
  235. package/lib/new-components/password-field/password-field.js +1 -1
  236. package/lib/new-components/password-field/password-field.js.map +1 -1
  237. package/lib/new-components/responsive-props.d.ts +1 -1
  238. package/lib/new-components/responsive-props.js +1 -1
  239. package/lib/new-components/responsive-props.js.map +1 -1
  240. package/lib/new-components/select-field/select-field.d.ts +1 -1
  241. package/lib/new-components/select-field/select-field.js +1 -1
  242. package/lib/new-components/select-field/select-field.js.map +1 -1
  243. package/lib/new-components/spinner/spinner.js +1 -1
  244. package/lib/new-components/spinner/spinner.js.map +1 -1
  245. package/lib/new-components/stack/stack.js +1 -1
  246. package/lib/new-components/stack/stack.js.map +1 -1
  247. package/lib/new-components/switch-field/switch-field.d.ts +1 -1
  248. package/lib/new-components/switch-field/switch-field.js +1 -1
  249. package/lib/new-components/switch-field/switch-field.js.map +1 -1
  250. package/lib/new-components/tabs/tabs.d.ts +13 -3
  251. package/lib/new-components/tabs/tabs.js +1 -1
  252. package/lib/new-components/tabs/tabs.js.map +1 -1
  253. package/lib/new-components/tabs/tabs.module.css.js +1 -1
  254. package/lib/new-components/test-helpers.d.ts +4 -3
  255. package/lib/new-components/text/text.js +1 -1
  256. package/lib/new-components/text/text.js.map +1 -1
  257. package/lib/new-components/text/text.module.css.js +1 -1
  258. package/lib/new-components/text-area/text-area.js +1 -1
  259. package/lib/new-components/text-area/text-area.js.map +1 -1
  260. package/lib/new-components/text-field/text-field.d.ts +1 -1
  261. package/lib/new-components/text-field/text-field.js +1 -1
  262. package/lib/new-components/text-field/text-field.js.map +1 -1
  263. package/lib/new-components/text-link/text-link.js +1 -1
  264. package/lib/new-components/text-link/text-link.js.map +1 -1
  265. package/lib/new-components/text-link/text-link.module.css.js +1 -1
  266. package/lib/utils/polymorphism.js.map +1 -1
  267. package/package.json +45 -38
  268. package/styles/base-field.css +1 -1
  269. package/styles/checkbox-field.css +1 -1
  270. package/styles/menu.css +1 -1
  271. package/styles/modal.css +1 -1
  272. package/styles/modal.module.css.css +1 -1
  273. package/styles/password-field.css +1 -1
  274. package/styles/reactist.css +6 -6
  275. package/styles/select-field.css +1 -1
  276. package/styles/switch-field.css +1 -1
  277. package/styles/tabs.css +1 -1
  278. package/styles/tabs.module.css.css +1 -1
  279. package/styles/text-area.css +1 -1
  280. package/styles/text-field.css +1 -1
  281. package/styles/text-link.css +1 -1
  282. package/styles/text-link.module.css.css +1 -1
  283. package/styles/text.css +1 -1
  284. package/styles/text.module.css.css +1 -1
@@ -1,8 +1,8 @@
1
- import { objectWithoutPropertiesLoose as _objectWithoutPropertiesLoose } from '../../_virtual/_rollupPluginBabelHelpers.js';
1
+ import { objectWithoutProperties as _objectWithoutProperties, objectSpread2 as _objectSpread2 } from '../../_virtual/_rollupPluginBabelHelpers.js';
2
2
  import { createElement } from 'react';
3
3
 
4
- var _excluded = ["tone"];
5
- var alertIconForTone = {
4
+ const _excluded = ["tone"];
5
+ const alertIconForTone = {
6
6
  info: AlertInfoIcon,
7
7
  positive: AlertPositiveIcon,
8
8
  caution: AlertCautionIcon,
@@ -10,15 +10,17 @@ var alertIconForTone = {
10
10
  };
11
11
 
12
12
  function AlertIcon(_ref) {
13
- var tone = _ref.tone,
14
- props = _objectWithoutPropertiesLoose(_ref, _excluded);
13
+ let {
14
+ tone
15
+ } = _ref,
16
+ props = _objectWithoutProperties(_ref, _excluded);
15
17
 
16
- var Icon = alertIconForTone[tone];
17
- return Icon ? /*#__PURE__*/createElement(Icon, Object.assign({}, props)) : null;
18
+ const Icon = alertIconForTone[tone];
19
+ return Icon ? /*#__PURE__*/createElement(Icon, _objectSpread2({}, props)) : null;
18
20
  }
19
21
 
20
22
  function AlertInfoIcon(props) {
21
- return /*#__PURE__*/createElement("svg", Object.assign({
23
+ return /*#__PURE__*/createElement("svg", _objectSpread2({
22
24
  width: "24",
23
25
  height: "24",
24
26
  fill: "none",
@@ -32,7 +34,7 @@ function AlertInfoIcon(props) {
32
34
  }
33
35
 
34
36
  function AlertPositiveIcon(props) {
35
- return /*#__PURE__*/createElement("svg", Object.assign({
37
+ return /*#__PURE__*/createElement("svg", _objectSpread2({
36
38
  width: "24",
37
39
  height: "24",
38
40
  fill: "none",
@@ -46,7 +48,7 @@ function AlertPositiveIcon(props) {
46
48
  }
47
49
 
48
50
  function AlertCautionIcon(props) {
49
- return /*#__PURE__*/createElement("svg", Object.assign({
51
+ return /*#__PURE__*/createElement("svg", _objectSpread2({
50
52
  width: "24",
51
53
  height: "24",
52
54
  fill: "none",
@@ -60,7 +62,7 @@ function AlertCautionIcon(props) {
60
62
  }
61
63
 
62
64
  function AlertCriticalIcon(props) {
63
- return /*#__PURE__*/createElement("svg", Object.assign({
65
+ return /*#__PURE__*/createElement("svg", _objectSpread2({
64
66
  width: "24",
65
67
  height: "24",
66
68
  fill: "none",
@@ -1 +1 @@
1
- {"version":3,"file":"alert-icon.js","sources":["../../../src/new-components/icons/alert-icon.tsx"],"sourcesContent":["import * as React from 'react'\nimport { AlertTone } from '../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 width=\"24\" height=\"24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18zm0-1a8 8 0 1 1 0-16 8 8 0 0 1 0 16zm1.18-11.84a.84.84 0 1 1-1.68 0 .84.84 0 0 1 1.68 0zM12.5 10a.5.5 0 0 1 .5.5V15h1a.5.5 0 0 1 0 1h-3a.5.5 0 0 1 0-1h1v-4h-1a.5.5 0 0 1 0-1h1.5z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n}\n\nfunction AlertPositiveIcon(props: JSX.IntrinsicElements['svg']) {\n return (\n <svg width=\"24\" height=\"24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18zm0-1a8 8 0 1 1 0-16 8 8 0 0 1 0 16zm-4.354-8.104a.5.5 0 0 1 .708 0l2.146 2.147 5.146-5.147a.5.5 0 0 1 .708.708l-5.5 5.5a.5.5 0 0 1-.708 0l-2.5-2.5a.5.5 0 0 1 0-.708z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n}\n\nfunction AlertCautionIcon(props: JSX.IntrinsicElements['svg']) {\n return (\n <svg width=\"24\" height=\"24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"m3.254 16.992 7.018-12.03a2 2 0 0 1 3.455 0l7.018 12.03A2 2 0 0 1 19.018 20H4.982a2 2 0 0 1-1.728-3.008zm8.242-11.887a1 1 0 0 0-.36.36l-7.018 12.03A1 1 0 0 0 4.982 19h14.036a1 1 0 0 0 .864-1.504l-7.018-12.03a1 1 0 0 0-1.368-.36zM13 16.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm-.014-7.014a.987.987 0 1 0-1.971.055l.236 4.25c.053.945 1.445.945 1.498 0l.236-4.25.001-.027v-.028z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n}\n\nfunction AlertCriticalIcon(props: JSX.IntrinsicElements['svg']) {\n return (\n <svg width=\"24\" height=\"24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M12 3.5a8.5 8.5 0 1 0 0 17 8.5 8.5 0 0 0 0-17zM2.5 12a9.5 9.5 0 1 1 19 0 9.5 9.5 0 0 1-19 0zM13 15.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm-.014-7.014A.987.987 0 0 0 12 7.5h-.027l-.028.002a.987.987 0 0 0-.93 1.04l.236 4.25c.053.944 1.445.944 1.498 0l.236-4.25.001-.028v-.027z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n}\n\nexport { AlertIcon }\n"],"names":["alertIconForTone","info","AlertInfoIcon","positive","AlertPositiveIcon","caution","AlertCautionIcon","critical","AlertCriticalIcon","AlertIcon","tone","props","Icon","React","width","height","fill","xmlns","fillRule","clipRule","d"],"mappings":";;;;AAGA,IAAMA,gBAAgB,GAA4C;AAC9DC,EAAAA,IAAI,EAAEC,aADwD;AAE9DC,EAAAA,QAAQ,EAAEC,iBAFoD;AAG9DC,EAAAA,OAAO,EAAEC,gBAHqD;AAI9DC,EAAAA,QAAQ,EAAEC;AAJoD,CAAlE;;AAOA,SAASC,SAAT;MAAqBC,YAAAA;MAASC;;AAC1B,MAAMC,IAAI,GAAGZ,gBAAgB,CAACU,IAAD,CAA7B;AACA,SAAOE,IAAI,gBAAGC,aAAA,CAACD,IAAD,oBAAUD,MAAV,CAAH,GAAyB,IAApC;A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AAC;AACTC,IAAAA,CAAC,EAAC;AACFJ,IAAAA,IAAI,EAAC;GAJT,CADJ,CADJ;AAUH;;;;"}
1
+ {"version":3,"file":"alert-icon.js","sources":["../../../src/new-components/icons/alert-icon.tsx"],"sourcesContent":["import * as React from 'react'\nimport type { AlertTone } from '../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 width=\"24\" height=\"24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18zm0-1a8 8 0 1 1 0-16 8 8 0 0 1 0 16zm1.18-11.84a.84.84 0 1 1-1.68 0 .84.84 0 0 1 1.68 0zM12.5 10a.5.5 0 0 1 .5.5V15h1a.5.5 0 0 1 0 1h-3a.5.5 0 0 1 0-1h1v-4h-1a.5.5 0 0 1 0-1h1.5z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n}\n\nfunction AlertPositiveIcon(props: JSX.IntrinsicElements['svg']) {\n return (\n <svg width=\"24\" height=\"24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18zm0-1a8 8 0 1 1 0-16 8 8 0 0 1 0 16zm-4.354-8.104a.5.5 0 0 1 .708 0l2.146 2.147 5.146-5.147a.5.5 0 0 1 .708.708l-5.5 5.5a.5.5 0 0 1-.708 0l-2.5-2.5a.5.5 0 0 1 0-.708z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n}\n\nfunction AlertCautionIcon(props: JSX.IntrinsicElements['svg']) {\n return (\n <svg width=\"24\" height=\"24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"m3.254 16.992 7.018-12.03a2 2 0 0 1 3.455 0l7.018 12.03A2 2 0 0 1 19.018 20H4.982a2 2 0 0 1-1.728-3.008zm8.242-11.887a1 1 0 0 0-.36.36l-7.018 12.03A1 1 0 0 0 4.982 19h14.036a1 1 0 0 0 .864-1.504l-7.018-12.03a1 1 0 0 0-1.368-.36zM13 16.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm-.014-7.014a.987.987 0 1 0-1.971.055l.236 4.25c.053.945 1.445.945 1.498 0l.236-4.25.001-.027v-.028z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n}\n\nfunction AlertCriticalIcon(props: JSX.IntrinsicElements['svg']) {\n return (\n <svg width=\"24\" height=\"24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M12 3.5a8.5 8.5 0 1 0 0 17 8.5 8.5 0 0 0 0-17zM2.5 12a9.5 9.5 0 1 1 19 0 9.5 9.5 0 0 1-19 0zM13 15.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm-.014-7.014A.987.987 0 0 0 12 7.5h-.027l-.028.002a.987.987 0 0 0-.93 1.04l.236 4.25c.053.944 1.445.944 1.498 0l.236-4.25.001-.028v-.027z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n}\n\nexport { AlertIcon }\n"],"names":["alertIconForTone","info","AlertInfoIcon","positive","AlertPositiveIcon","caution","AlertCautionIcon","critical","AlertCriticalIcon","AlertIcon","tone","props","Icon","React","width","height","fill","xmlns","fillRule","clipRule","d"],"mappings":";;;;AAGA,MAAMA,gBAAgB,GAA4C;EAC9DC,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AAA,MAAA;IAAKC,KAAK,EAAC,IAAX;IAAgBC,MAAM,EAAC,IAAvB;IAA4BC,IAAI,EAAC,MAAjC;IAAwCC,KAAK,EAAC;KAAiCN,KAA/E,gBACIE,aAAA,OAAA;IACIK,QAAQ,EAAC;IACTC,QAAQ,EAAC;IACTC,CAAC,EAAC;IACFJ,IAAI,EAAC;GAJT,CADJ,CADJ;AAUH;;;;"}
@@ -1,7 +1,8 @@
1
+ import { objectSpread2 as _objectSpread2 } from '../../_virtual/_rollupPluginBabelHelpers.js';
1
2
  import { createElement } from 'react';
2
3
 
3
4
  function CloseIcon(props) {
4
- return /*#__PURE__*/createElement("svg", Object.assign({
5
+ return /*#__PURE__*/createElement("svg", _objectSpread2({
5
6
  xmlns: "http://www.w3.org/2000/svg",
6
7
  width: "24",
7
8
  height: "24"
@@ -1 +1 @@
1
- {"version":3,"file":"close-icon.js","sources":["../../../src/new-components/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":["CloseIcon","props","React","xmlns","width","height","fill","d"],"mappings":";;AAEA,SAASA,SAAT,CAAmBC,KAAnB;AACI,sBACIC,aAAA,MAAA;AAAKC,IAAAA,KAAK,EAAC;AAA6BC,IAAAA,KAAK,EAAC;AAAKC,IAAAA,MAAM,EAAC;KAASJ,MAAnE,eACIC,aAAA,OAAA;AACII,IAAAA,IAAI,EAAC;AACLC,IAAAA,CAAC,EAAC;GAFN,CADJ,CADJ;AAQH;;;;"}
1
+ {"version":3,"file":"close-icon.js","sources":["../../../src/new-components/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":["CloseIcon","props","React","xmlns","width","height","fill","d"],"mappings":";;;AAEA,SAASA,SAAT,CAAmBC,KAAnB;EACI,oBACIC,aAAA,MAAA;IAAKC,KAAK,EAAC,4BAAX;IAAwCC,KAAK,EAAC,IAA9C;IAAmDC,MAAM,EAAC;KAASJ,KAAnE,gBACIC,aAAA,OAAA;IACII,IAAI,EAAC;IACLC,CAAC,EAAC;GAFN,CADJ,CADJ;AAQH;;;;"}
@@ -1,7 +1,8 @@
1
+ import { objectSpread2 as _objectSpread2 } from '../../_virtual/_rollupPluginBabelHelpers.js';
1
2
  import { createElement } from 'react';
2
3
 
3
4
  function PasswordHiddenIcon(props) {
4
- return /*#__PURE__*/createElement("svg", Object.assign({
5
+ return /*#__PURE__*/createElement("svg", _objectSpread2({
5
6
  xmlns: "http://www.w3.org/2000/svg",
6
7
  width: "24",
7
8
  height: "24"
@@ -1 +1 @@
1
- {"version":3,"file":"password-hidden-icon.js","sources":["../../../src/new-components/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":["PasswordHiddenIcon","props","React","xmlns","width","height","fill","fillRule","transform","d","x","y","rx"],"mappings":";;AAEA,SAASA,kBAAT,CAA4BC,KAA5B;AACI,sBACIC,aAAA,MAAA;AAAKC,IAAAA,KAAK,EAAC;AAA6BC,IAAAA,KAAK,EAAC;AAAKC,IAAAA,MAAM,EAAC;KAASJ,MAAnE,eACIC,aAAA,IAAA;AAAGI,IAAAA,IAAI,EAAC;AAAOC,IAAAA,QAAQ,EAAC;AAAUC,IAAAA,SAAS,EAAC;GAA5C,eACIN,aAAA,OAAA;AACIK,IAAAA,QAAQ,EAAC;AACTE,IAAAA,CAAC,EAAC;GAFN,CADJ,eAKIP,aAAA,OAAA;AACIK,IAAAA,QAAQ,EAAC;AACTE,IAAAA,CAAC,EAAC;GAFN,CALJ,eASIP,aAAA,OAAA;AACIE,IAAAA,KAAK,EAAC;AACNC,IAAAA,MAAM,EAAC;AACPK,IAAAA,CAAC,EAAC;AACFC,IAAAA,CAAC,EAAC;AACFC,IAAAA,EAAE,EAAC;AACHJ,IAAAA,SAAS,EAAC;GANd,CATJ,CADJ,CADJ;AAsBH;;;;"}
1
+ {"version":3,"file":"password-hidden-icon.js","sources":["../../../src/new-components/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":["PasswordHiddenIcon","props","React","xmlns","width","height","fill","fillRule","transform","d","x","y","rx"],"mappings":";;;AAEA,SAASA,kBAAT,CAA4BC,KAA5B;EACI,oBACIC,aAAA,MAAA;IAAKC,KAAK,EAAC,4BAAX;IAAwCC,KAAK,EAAC,IAA9C;IAAmDC,MAAM,EAAC;KAASJ,KAAnE,gBACIC,aAAA,IAAA;IAAGI,IAAI,EAAC;IAAOC,QAAQ,EAAC;IAAUC,SAAS,EAAC;GAA5C,eACIN,aAAA,OAAA;IACIK,QAAQ,EAAC;IACTE,CAAC,EAAC;GAFN,CADJ,eAKIP,aAAA,OAAA;IACIK,QAAQ,EAAC;IACTE,CAAC,EAAC;GAFN,CALJ,eASIP,aAAA,OAAA;IACIE,KAAK,EAAC;IACNC,MAAM,EAAC;IACPK,CAAC,EAAC;IACFC,CAAC,EAAC;IACFC,EAAE,EAAC;IACHJ,SAAS,EAAC;GANd,CATJ,CADJ,CADJ;AAsBH;;;;"}
@@ -1,7 +1,8 @@
1
+ import { objectSpread2 as _objectSpread2 } from '../../_virtual/_rollupPluginBabelHelpers.js';
1
2
  import { createElement } from 'react';
2
3
 
3
4
  function PasswordVisibleIcon(props) {
4
- return /*#__PURE__*/createElement("svg", Object.assign({
5
+ return /*#__PURE__*/createElement("svg", _objectSpread2({
5
6
  xmlns: "http://www.w3.org/2000/svg",
6
7
  width: "24",
7
8
  height: "24"
@@ -1 +1 @@
1
- {"version":3,"file":"password-visible-icon.js","sources":["../../../src/new-components/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":["PasswordVisibleIcon","props","React","xmlns","width","height","fill","fillRule","stroke","d","cx","cy","r"],"mappings":";;AAEA,SAASA,mBAAT,CAA6BC,KAA7B;AACI,sBACIC,aAAA,MAAA;AAAKC,IAAAA,KAAK,EAAC;AAA6BC,IAAAA,KAAK,EAAC;AAAKC,IAAAA,MAAM,EAAC;KAASJ,MAAnE,eACIC,aAAA,IAAA;AAAGI,IAAAA,IAAI,EAAC;AAAOC,IAAAA,QAAQ,EAAC;AAAUC,IAAAA,MAAM,EAAC;GAAzC,eACIN,aAAA,OAAA;AAAMO,IAAAA,CAAC,EAAC;GAAR,CADJ,eAEIP,aAAA,SAAA;AAAQQ,IAAAA,EAAE,EAAC;AAAKC,IAAAA,EAAE,EAAC;AAAKC,IAAAA,CAAC,EAAC;GAA1B,CAFJ,CADJ,CADJ;AAQH;;;;"}
1
+ {"version":3,"file":"password-visible-icon.js","sources":["../../../src/new-components/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":["PasswordVisibleIcon","props","React","xmlns","width","height","fill","fillRule","stroke","d","cx","cy","r"],"mappings":";;;AAEA,SAASA,mBAAT,CAA6BC,KAA7B;EACI,oBACIC,aAAA,MAAA;IAAKC,KAAK,EAAC,4BAAX;IAAwCC,KAAK,EAAC,IAA9C;IAAmDC,MAAM,EAAC;KAASJ,KAAnE,gBACIC,aAAA,IAAA;IAAGI,IAAI,EAAC;IAAOC,QAAQ,EAAC;IAAUC,MAAM,EAAC;GAAzC,eACIN,aAAA,OAAA;IAAMO,CAAC,EAAC;GAAR,CADJ,eAEIP,aAAA,SAAA;IAAQQ,EAAE,EAAC;IAAKC,EAAE,EAAC;IAAKC,CAAC,EAAC;GAA1B,CAFJ,CADJ,CADJ;AAQH;;;;"}
@@ -1,34 +1,30 @@
1
- import { objectWithoutPropertiesLoose as _objectWithoutPropertiesLoose } from '../../_virtual/_rollupPluginBabelHelpers.js';
1
+ import { objectWithoutProperties as _objectWithoutProperties, objectSpread2 as _objectSpread2 } from '../../_virtual/_rollupPluginBabelHelpers.js';
2
2
  import { createElement } from 'react';
3
3
  import { polymorphicComponent } from '../../utils/polymorphism.js';
4
4
  import { getClassNames, mapResponsiveProp } from '../responsive-props.js';
5
5
  import { Box } from '../box/box.js';
6
6
  import styles from './inline.module.css.js';
7
7
 
8
- var _excluded = ["as", "space", "align", "alignY", "children", "exceptionallySetClassName"];
9
- var Inline = /*#__PURE__*/polymorphicComponent(function Inline(_ref, ref) {
10
- var as = _ref.as,
11
- space = _ref.space,
12
- _ref$align = _ref.align,
13
- align = _ref$align === void 0 ? 'left' : _ref$align,
14
- _ref$alignY = _ref.alignY,
15
- alignY = _ref$alignY === void 0 ? 'center' : _ref$alignY,
16
- children = _ref.children,
17
- exceptionallySetClassName = _ref.exceptionallySetClassName,
18
- props = _objectWithoutPropertiesLoose(_ref, _excluded);
8
+ const _excluded = ["as", "space", "align", "alignY", "children", "exceptionallySetClassName"];
9
+ const Inline = /*#__PURE__*/polymorphicComponent(function Inline(_ref, ref) {
10
+ let {
11
+ as,
12
+ space,
13
+ align = 'left',
14
+ alignY = 'center',
15
+ children,
16
+ exceptionallySetClassName
17
+ } = _ref,
18
+ props = _objectWithoutProperties(_ref, _excluded);
19
19
 
20
- return /*#__PURE__*/createElement(Box, Object.assign({}, props, {
20
+ return /*#__PURE__*/createElement(Box, _objectSpread2(_objectSpread2({}, props), {}, {
21
21
  as: as,
22
22
  display: "flex",
23
23
  flexWrap: "wrap",
24
24
  className: [exceptionallySetClassName, getClassNames(styles, 'space', space)],
25
25
  ref: ref,
26
- alignItems: mapResponsiveProp(alignY, function (alignY) {
27
- return alignY === 'top' ? 'flexStart' : alignY === 'bottom' ? 'flexEnd' : 'center';
28
- }),
29
- justifyContent: mapResponsiveProp(align, function (align) {
30
- return align === 'left' ? 'flexStart' : align === 'right' ? 'flexEnd' : 'center';
31
- })
26
+ alignItems: mapResponsiveProp(alignY, alignY => alignY === 'top' ? 'flexStart' : alignY === 'bottom' ? 'flexEnd' : 'center'),
27
+ justifyContent: mapResponsiveProp(align, align => align === 'left' ? 'flexStart' : align === 'right' ? 'flexEnd' : 'center')
32
28
  }), children);
33
29
  });
34
30
 
@@ -1 +1 @@
1
- {"version":3,"file":"inline.js","sources":["../../../src/new-components/inline/inline.tsx"],"sourcesContent":["import * as React from 'react'\nimport { polymorphicComponent } from '../../utils/polymorphism'\nimport { getClassNames, mapResponsiveProp } from '../responsive-props'\nimport { Box } from '../box'\n\nimport type { ResponsiveProp } from '../responsive-props'\nimport type { Space } from '../common-types'\nimport type { ReusableBoxProps } from '../box'\n\nimport styles from './inline.module.css'\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 className={[exceptionallySetClassName, getClassNames(styles, 'space', space)]}\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":["Inline","polymorphicComponent","ref","as","space","align","alignY","children","exceptionallySetClassName","props","React","Box","display","flexWrap","className","getClassNames","styles","alignItems","mapResponsiveProp","justifyContent"],"mappings":";;;;;;;;IAmBMA,MAAM,gBAAGC,oBAAoB,CAAqB,SAASD,MAAT,OAEpDE,GAFoD;MAClDC,UAAAA;MAAIC,aAAAA;wBAAOC;MAAAA,gCAAQ;yBAAQC;MAAAA,kCAAS;MAAUC,gBAAAA;MAAUC,iCAAAA;MAA8BC;;AAGxF,sBACIC,aAAA,CAACC,GAAD,oBACQF;AACJN,IAAAA,EAAE,EAAEA;AACJS,IAAAA,OAAO,EAAC;AACRC,IAAAA,QAAQ,EAAC;AACTC,IAAAA,SAAS,EAAE,CAACN,yBAAD,EAA4BO,aAAa,CAACC,MAAD,EAAS,OAAT,EAAkBZ,KAAlB,CAAzC;AACXF,IAAAA,GAAG,EAAEA;AACLe,IAAAA,UAAU,EAAEC,iBAAiB,CAACZ,MAAD,EAAS,UAACA,MAAD;AAAA,aAClCA,MAAM,KAAK,KAAX,GAAmB,WAAnB,GAAiCA,MAAM,KAAK,QAAX,GAAsB,SAAtB,GAAkC,QADjC;AAAA,KAAT;AAG7Ba,IAAAA,cAAc,EAAED,iBAAiB,CAACb,KAAD,EAAQ,UAACA,KAAD;AAAA,aACrCA,KAAK,KAAK,MAAV,GAAmB,WAAnB,GAAiCA,KAAK,KAAK,OAAV,GAAoB,SAApB,GAAgC,QAD5B;AAAA,KAAR;IAVrC,EAcKE,QAdL,CADJ;AAkBH,CAtBkC;;;;"}
1
+ {"version":3,"file":"inline.js","sources":["../../../src/new-components/inline/inline.tsx"],"sourcesContent":["import * as React from 'react'\nimport { polymorphicComponent } from '../../utils/polymorphism'\nimport { getClassNames, mapResponsiveProp } from '../responsive-props'\nimport { Box } from '../box'\n\nimport type { ResponsiveProp } from '../responsive-props'\nimport type { Space } from '../common-types'\nimport type { ReusableBoxProps } from '../box'\n\nimport styles from './inline.module.css'\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 className={[exceptionallySetClassName, getClassNames(styles, 'space', space)]}\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":["Inline","polymorphicComponent","ref","as","space","align","alignY","children","exceptionallySetClassName","props","React","Box","display","flexWrap","className","getClassNames","styles","alignItems","mapResponsiveProp","justifyContent"],"mappings":";;;;;;;;MAmBMA,MAAM,gBAAGC,oBAAoB,CAAqB,SAASD,MAAT,OAEpDE,GAFoD;MACpD;IAAEC,EAAF;IAAMC,KAAN;IAAaC,KAAK,GAAG,MAArB;IAA6BC,MAAM,GAAG,QAAtC;IAAgDC,QAAhD;IAA0DC;;MAA8BC;;EAGxF,oBACIC,aAAA,CAACC,GAAD,oCACQF,KADR;IAEIN,EAAE,EAAEA,EAFR;IAGIS,OAAO,EAAC,MAHZ;IAIIC,QAAQ,EAAC,MAJb;IAKIC,SAAS,EAAE,CAACN,yBAAD,EAA4BO,aAAa,CAACC,MAAD,EAAS,OAAT,EAAkBZ,KAAlB,CAAzC,CALf;IAMIF,GAAG,EAAEA,GANT;IAOIe,UAAU,EAAEC,iBAAiB,CAACZ,MAAD,EAAUA,MAAD,IAClCA,MAAM,KAAK,KAAX,GAAmB,WAAnB,GAAiCA,MAAM,KAAK,QAAX,GAAsB,SAAtB,GAAkC,QAD1C,CAPjC;IAUIa,cAAc,EAAED,iBAAiB,CAACb,KAAD,EAASA,KAAD,IACrCA,KAAK,KAAK,MAAV,GAAmB,WAAnB,GAAiCA,KAAK,KAAK,OAAV,GAAoB,SAApB,GAAgC,QADpC;MAIhCE,QAdL,CADJ;AAkBH,CAtBkC;;;;"}
@@ -1,10 +1,11 @@
1
- import { objectWithoutPropertiesLoose as _objectWithoutPropertiesLoose } from '../../_virtual/_rollupPluginBabelHelpers.js';
1
+ import { objectWithoutProperties as _objectWithoutProperties, objectSpread2 as _objectSpread2 } from '../../_virtual/_rollupPluginBabelHelpers.js';
2
2
  import React__default from 'react';
3
3
  import { Box } from '../box/box.js';
4
4
  import { Spinner } from '../spinner/spinner.js';
5
5
 
6
- var _excluded = ["size", "exceptionallySetClassName"];
7
- var sizeMapping = {
6
+ const _excluded = ["size", "exceptionallySetClassName"];
7
+ const sizeMapping = {
8
+ xsmall: 16,
8
9
  small: 24,
9
10
  medium: 36,
10
11
  large: 48
@@ -13,14 +14,15 @@ var sizeMapping = {
13
14
  function Loading(_ref) {
14
15
  var _sizeMapping$size;
15
16
 
16
- var _ref$size = _ref.size,
17
- size = _ref$size === void 0 ? 'small' : _ref$size,
18
- exceptionallySetClassName = _ref.exceptionallySetClassName,
19
- props = _objectWithoutPropertiesLoose(_ref, _excluded);
17
+ let {
18
+ size = 'small',
19
+ exceptionallySetClassName
20
+ } = _ref,
21
+ props = _objectWithoutProperties(_ref, _excluded);
20
22
 
21
- var numericSize = (_sizeMapping$size = sizeMapping[size]) !== null && _sizeMapping$size !== void 0 ? _sizeMapping$size : sizeMapping.small;
22
- var ariaLabel = props['aria-label'] ? props['aria-label'] : !props['aria-labelledby'] ? 'Loading…' : undefined;
23
- return /*#__PURE__*/React__default.createElement(Box, Object.assign({}, props, {
23
+ const numericSize = (_sizeMapping$size = sizeMapping[size]) != null ? _sizeMapping$size : sizeMapping.small;
24
+ const ariaLabel = props['aria-label'] ? props['aria-label'] : !props['aria-labelledby'] ? 'Loading…' : undefined;
25
+ return /*#__PURE__*/React__default.createElement(Box, _objectSpread2(_objectSpread2({}, props), {}, {
24
26
  "aria-label": ariaLabel,
25
27
  className: exceptionallySetClassName,
26
28
  display: "flex",
@@ -1 +1 @@
1
- {"version":3,"file":"loading.js","sources":["../../../src/new-components/loading/loading.tsx"],"sourcesContent":["import React from 'react'\nimport { Box } from '../box'\nimport { Spinner } from '../spinner'\n\ntype Size = 'small' | 'medium' | 'large'\n\ntype NativeProps = Omit<\n JSX.IntrinsicElements['div'],\n 'className' | 'aria-describedby' | 'aria-label' | 'aria-labelledby' | 'role' | 'size'\n>\n\ntype LoadingProps = NativeProps & {\n /**\n * The size of the loading spinner.\n * @default 'small'\n */\n size?: Size\n /**\n * A escape hatch in case you need to provide a custom class name to the container element.\n */\n exceptionallySetClassName?: string\n /** Identifies the element (or elements) that describes the loading component for assistive technologies. */\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 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","small","medium","large","Loading","size","exceptionallySetClassName","props","numericSize","ariaLabel","undefined","React","Box","className","display","alignItems","justifyContent","role","Spinner"],"mappings":";;;;;;AAoCA,IAAMA,WAAW,GAAyB;AACtCC,EAAAA,KAAK,EAAE,EAD+B;AAEtCC,EAAAA,MAAM,EAAE,EAF8B;AAGtCC,EAAAA,KAAK,EAAE;AAH+B,CAA1C;;AAMA,SAASC,OAAT;;;uBAAmBC;MAAAA,8BAAO;MAASC,iCAAAA;MAA8BC;;AAC7D,MAAMC,WAAW,wBAAGR,WAAW,CAACK,IAAD,CAAd,iEAAwBL,WAAW,CAACC,KAArD;AACA,MAAMQ,SAAS,GAAGF,KAAK,CAAC,YAAD,CAAL,GACZA,KAAK,CAAC,YAAD,CADO,GAEZ,CAACA,KAAK,CAAC,iBAAD,CAAN,GACA,UADA,GAEAG,SAJN;AAMA,sBACIC,4BAAA,CAACC,GAAD,oBACQL;kBACQE;AACZI,IAAAA,SAAS,EAAEP;AACXQ,IAAAA,OAAO,EAAC;AACRC,IAAAA,UAAU,EAAC;AACXC,IAAAA,cAAc,EAAC;AACfC,IAAAA,IAAI,EAAC;IAPT,eASIN,4BAAA,CAACO,OAAD;AAASb,IAAAA,IAAI,EAAEG;;GAAf,CATJ,CADJ;AAaH;;;;"}
1
+ {"version":3,"file":"loading.js","sources":["../../../src/new-components/loading/loading.tsx"],"sourcesContent":["import React from 'react'\nimport { Box } from '../box'\nimport { Spinner } from '../spinner'\n\ntype Size = 'xsmall' | 'small' | 'medium' | 'large'\n\ntype NativeProps = Omit<\n JSX.IntrinsicElements['div'],\n 'className' | 'aria-describedby' | 'aria-label' | 'aria-labelledby' | 'role' | 'size'\n>\n\ntype LoadingProps = NativeProps & {\n /**\n * The size of the loading spinner.\n * @default 'small'\n */\n size?: Size\n /**\n * A escape hatch in case you need to provide a custom class name to the container element.\n */\n exceptionallySetClassName?: string\n /** Identifies the element (or elements) that describes the loading component for assistive technologies. */\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","Loading","size","exceptionallySetClassName","props","numericSize","ariaLabel","undefined","React","Box","className","display","alignItems","justifyContent","role","Spinner"],"mappings":";;;;;;AAoCA,MAAMA,WAAW,GAAyB;EACtCC,MAAM,EAAE,EAD8B;EAEtCC,KAAK,EAAE,EAF+B;EAGtCC,MAAM,EAAE,EAH8B;EAItCC,KAAK,EAAE;AAJ+B,CAA1C;;AAOA,SAASC,OAAT;;;MAAiB;IAAEC,IAAI,GAAG,OAAT;IAAkBC;;MAA8BC;;EAC7D,MAAMC,WAAW,wBAAGT,WAAW,CAACM,IAAD,CAAd,gCAAwBN,WAAW,CAACE,KAArD;EACA,MAAMQ,SAAS,GAAGF,KAAK,CAAC,YAAD,CAAL,GACZA,KAAK,CAAC,YAAD,CADO,GAEZ,CAACA,KAAK,CAAC,iBAAD,CAAN,GACA,UADA,GAEAG,SAJN;EAMA,oBACIC,4BAAA,CAACC,GAAD,oCACQL,KADR;kBAEgBE,SAFhB;IAGII,SAAS,EAAEP,yBAHf;IAIIQ,OAAO,EAAC,MAJZ;IAKIC,UAAU,EAAC,QALf;IAMIC,cAAc,EAAC,QANnB;IAOIC,IAAI,EAAC;mBAELN,4BAAA,CAACO,OAAD;IAASb,IAAI,EAAEG;;GAAf,CATJ,CADJ;AAaH;;;;"}
@@ -1,4 +1,4 @@
1
- import { objectWithoutPropertiesLoose as _objectWithoutPropertiesLoose } from '../../_virtual/_rollupPluginBabelHelpers.js';
1
+ import { objectWithoutProperties as _objectWithoutProperties, objectSpread2 as _objectSpread2 } from '../../_virtual/_rollupPluginBabelHelpers.js';
2
2
  import { useMemo, createElement, useContext, useState, useEffect, Fragment, createContext } from 'react';
3
3
  import classNames from 'classnames';
4
4
  import { Box } from '../box/box.js';
@@ -11,12 +11,12 @@ import { DialogOverlay, DialogContent } from '@reach/dialog';
11
11
  import FocusLock from 'react-focus-lock';
12
12
  import styles from './modal.module.css.js';
13
13
 
14
- var _excluded = ["isOpen", "onDismiss", "height", "width", "exceptionallySetClassName", "autoFocus", "children"],
15
- _excluded2 = ["children", "button", "withDivider", "exceptionallySetClassName"],
16
- _excluded3 = ["exceptionallySetClassName", "children"],
17
- _excluded4 = ["exceptionallySetClassName", "withDivider"],
18
- _excluded5 = ["children"];
19
- var ModalContext = /*#__PURE__*/createContext({
14
+ const _excluded = ["isOpen", "onDismiss", "height", "width", "exceptionallySetClassName", "autoFocus", "children"],
15
+ _excluded2 = ["children", "button", "withDivider", "exceptionallySetClassName"],
16
+ _excluded3 = ["exceptionallySetClassName", "children"],
17
+ _excluded4 = ["exceptionallySetClassName", "withDivider"],
18
+ _excluded5 = ["children"];
19
+ const ModalContext = /*#__PURE__*/createContext({
20
20
  onDismiss: undefined,
21
21
  height: 'fitContent'
22
22
  });
@@ -36,24 +36,21 @@ function isNotInternalFrame(element) {
36
36
 
37
37
 
38
38
  function Modal(_ref) {
39
- var isOpen = _ref.isOpen,
40
- onDismiss = _ref.onDismiss,
41
- _ref$height = _ref.height,
42
- height = _ref$height === void 0 ? 'fitContent' : _ref$height,
43
- _ref$width = _ref.width,
44
- width = _ref$width === void 0 ? 'medium' : _ref$width,
45
- exceptionallySetClassName = _ref.exceptionallySetClassName,
46
- _ref$autoFocus = _ref.autoFocus,
47
- autoFocus = _ref$autoFocus === void 0 ? true : _ref$autoFocus,
48
- children = _ref.children,
49
- props = _objectWithoutPropertiesLoose(_ref, _excluded);
50
-
51
- var contextValue = useMemo(function () {
52
- return {
53
- onDismiss: onDismiss,
54
- height: height
55
- };
56
- }, [onDismiss, height]);
39
+ let {
40
+ isOpen,
41
+ onDismiss,
42
+ height = 'fitContent',
43
+ width = 'medium',
44
+ exceptionallySetClassName,
45
+ autoFocus = true,
46
+ children
47
+ } = _ref,
48
+ props = _objectWithoutProperties(_ref, _excluded);
49
+
50
+ const contextValue = useMemo(() => ({
51
+ onDismiss,
52
+ height
53
+ }), [onDismiss, height]);
57
54
  return /*#__PURE__*/createElement(DialogOverlay, {
58
55
  isOpen: isOpen,
59
56
  onDismiss: onDismiss,
@@ -65,7 +62,7 @@ function Modal(_ref) {
65
62
  autoFocus: autoFocus,
66
63
  whiteList: isNotInternalFrame,
67
64
  returnFocus: true
68
- }, /*#__PURE__*/createElement(DialogContent, Object.assign({}, props, {
65
+ }, /*#__PURE__*/createElement(DialogContent, _objectSpread2(_objectSpread2({}, props), {}, {
69
66
  as: Box,
70
67
  borderRadius: "full",
71
68
  background: "default",
@@ -87,17 +84,11 @@ function Modal(_ref) {
87
84
  */
88
85
 
89
86
  function ModalCloseButton(props) {
90
- var _React$useContext = useContext(ModalContext),
91
- onDismiss = _React$useContext.onDismiss;
92
-
93
- var _React$useState = useState(false),
94
- includeInTabOrder = _React$useState[0],
95
- setIncludeInTabOrder = _React$useState[1];
96
-
97
- var _React$useState2 = useState(false),
98
- isMounted = _React$useState2[0],
99
- setIsMounted = _React$useState2[1];
100
-
87
+ const {
88
+ onDismiss
89
+ } = useContext(ModalContext);
90
+ const [includeInTabOrder, setIncludeInTabOrder] = useState(false);
91
+ const [isMounted, setIsMounted] = useState(false);
101
92
  useEffect(function skipAutoFocus() {
102
93
  if (isMounted) {
103
94
  setIncludeInTabOrder(true);
@@ -105,7 +96,7 @@ function ModalCloseButton(props) {
105
96
  setIsMounted(true);
106
97
  }
107
98
  }, [isMounted]);
108
- return /*#__PURE__*/createElement(Button, Object.assign({}, props, {
99
+ return /*#__PURE__*/createElement(Button, _objectSpread2(_objectSpread2({}, props), {}, {
109
100
  variant: "quaternary",
110
101
  onClick: onDismiss,
111
102
  icon: /*#__PURE__*/createElement(CloseIcon, null),
@@ -121,18 +112,18 @@ function ModalCloseButton(props) {
121
112
  */
122
113
 
123
114
  function ModalHeader(_ref2) {
124
- var children = _ref2.children,
125
- _ref2$button = _ref2.button,
126
- button = _ref2$button === void 0 ? true : _ref2$button,
127
- _ref2$withDivider = _ref2.withDivider,
128
- withDivider = _ref2$withDivider === void 0 ? false : _ref2$withDivider,
129
- exceptionallySetClassName = _ref2.exceptionallySetClassName,
130
- props = _objectWithoutPropertiesLoose(_ref2, _excluded2);
131
-
132
- return /*#__PURE__*/createElement(Fragment, null, /*#__PURE__*/createElement(Box, Object.assign({}, props, {
115
+ let {
116
+ children,
117
+ button = true,
118
+ withDivider = false,
119
+ exceptionallySetClassName
120
+ } = _ref2,
121
+ props = _objectWithoutProperties(_ref2, _excluded2);
122
+
123
+ return /*#__PURE__*/createElement(Fragment, null, /*#__PURE__*/createElement(Box, _objectSpread2(_objectSpread2({}, props), {}, {
133
124
  as: "header",
134
125
  paddingLeft: "large",
135
- paddingRight: "small",
126
+ paddingRight: button === false || button === null ? 'large' : 'small',
136
127
  paddingY: "small",
137
128
  className: exceptionallySetClassName
138
129
  }), /*#__PURE__*/createElement(Columns, {
@@ -140,7 +131,9 @@ function ModalHeader(_ref2) {
140
131
  alignY: "center"
141
132
  }, /*#__PURE__*/createElement(Column, {
142
133
  width: "auto"
143
- }, children), button === false || button === null ? null : /*#__PURE__*/createElement(Column, {
134
+ }, children), button === false || button === null ? /*#__PURE__*/createElement("div", {
135
+ className: styles.headerContent
136
+ }) : /*#__PURE__*/createElement(Column, {
144
137
  width: "content",
145
138
  exceptionallySetClassName: styles.buttonContainer,
146
139
  "data-testid": "button-container"
@@ -163,14 +156,16 @@ function ModalHeader(_ref2) {
163
156
  */
164
157
 
165
158
  function ModalBody(_ref3) {
166
- var exceptionallySetClassName = _ref3.exceptionallySetClassName,
167
- children = _ref3.children,
168
- props = _objectWithoutPropertiesLoose(_ref3, _excluded3);
169
-
170
- var _React$useContext2 = useContext(ModalContext),
171
- height = _React$useContext2.height;
172
-
173
- return /*#__PURE__*/createElement(Box, Object.assign({}, props, {
159
+ let {
160
+ exceptionallySetClassName,
161
+ children
162
+ } = _ref3,
163
+ props = _objectWithoutProperties(_ref3, _excluded3);
164
+
165
+ const {
166
+ height
167
+ } = useContext(ModalContext);
168
+ return /*#__PURE__*/createElement(Box, _objectSpread2(_objectSpread2({}, props), {}, {
174
169
  className: exceptionallySetClassName,
175
170
  flexGrow: height === 'expand' ? 1 : 0,
176
171
  height: height === 'expand' ? 'full' : undefined,
@@ -189,14 +184,15 @@ function ModalBody(_ref3) {
189
184
  */
190
185
 
191
186
  function ModalFooter(_ref4) {
192
- var exceptionallySetClassName = _ref4.exceptionallySetClassName,
193
- _ref4$withDivider = _ref4.withDivider,
194
- withDivider = _ref4$withDivider === void 0 ? false : _ref4$withDivider,
195
- props = _objectWithoutPropertiesLoose(_ref4, _excluded4);
187
+ let {
188
+ exceptionallySetClassName,
189
+ withDivider = false
190
+ } = _ref4,
191
+ props = _objectWithoutProperties(_ref4, _excluded4);
196
192
 
197
- return /*#__PURE__*/createElement(Fragment, null, withDivider ? /*#__PURE__*/createElement(Divider, null) : null, /*#__PURE__*/createElement(Box, Object.assign({
193
+ return /*#__PURE__*/createElement(Fragment, null, withDivider ? /*#__PURE__*/createElement(Divider, null) : null, /*#__PURE__*/createElement(Box, _objectSpread2(_objectSpread2({
198
194
  as: "footer"
199
- }, props, {
195
+ }, props), {}, {
200
196
  className: exceptionallySetClassName,
201
197
  padding: "large"
202
198
  })));
@@ -207,10 +203,12 @@ function ModalFooter(_ref4) {
207
203
  */
208
204
 
209
205
  function ModalActions(_ref5) {
210
- var children = _ref5.children,
211
- props = _objectWithoutPropertiesLoose(_ref5, _excluded5);
206
+ let {
207
+ children
208
+ } = _ref5,
209
+ props = _objectWithoutProperties(_ref5, _excluded5);
212
210
 
213
- return /*#__PURE__*/createElement(ModalFooter, Object.assign({}, props), /*#__PURE__*/createElement(Inline, {
211
+ return /*#__PURE__*/createElement(ModalFooter, _objectSpread2({}, props), /*#__PURE__*/createElement(Inline, {
214
212
  align: "right",
215
213
  space: "large"
216
214
  }, children));
@@ -1 +1 @@
1
- {"version":3,"file":"modal.js","sources":["../../../src/new-components/modal/modal.tsx"],"sourcesContent":["import * as React from 'react'\nimport classNames from 'classnames'\nimport { DialogOverlay, DialogContent } from '@reach/dialog'\nimport FocusLock from 'react-focus-lock'\n\nimport { CloseIcon } from '../icons/close-icon'\nimport { Column, Columns } from '../columns'\nimport { Inline } from '../inline'\nimport { Divider } from '../divider'\nimport { Box } from '../box'\nimport { Button, ButtonProps } from '../button'\n\nimport styles from './modal.module.css'\n\ntype ModalWidth = 'small' | 'medium' | 'large' | 'xlarge' | 'full'\ntype ModalHeightMode = 'expand' | 'fitContent'\n\n//\n// ModalContext\n//\n\ntype ModalContextValue = {\n onDismiss?(this: void): void\n height: ModalHeightMode\n}\n\nconst ModalContext = React.createContext<ModalContextValue>({\n onDismiss: undefined,\n height: 'fitContent',\n})\n\n//\n// Modal container\n//\n\ntype DivProps = Omit<\n React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLDivElement>, HTMLDivElement>,\n 'className' | 'children' | `aria-label` | `aria-labelledby`\n>\n\nexport type ModalProps = DivProps & {\n /**\n * The content of the modal.\n */\n children: React.ReactNode\n /**\n * Whether the modal is open and visible or not.\n */\n isOpen: boolean\n /**\n * Called when the user triggers closing the modal.\n */\n onDismiss?(): void\n /**\n * A descriptive setting for how wide the modal should aim to be, depending on how much space\n * it has on screen.\n * @default 'medium'\n */\n width?: ModalWidth\n /**\n * A descriptive setting for how tall the modal should aim to be.\n *\n * - 'expand': the modal aims to fill most of the available screen height, leaving only a small\n * padding above and below.\n * - 'fitContent': the modal shrinks to the smallest size that allow it to fit its content.\n *\n * In either case, if content does not fit, the content of the main body is set to scroll\n * (provided you use `ModalBody`) so that the modal never has to strech vertically beyond the\n * viewport boundaries.\n *\n * If you do not use `ModalBody`, the modal still prevents overflow, and you are in charge of\n * the inner layout to ensure scroll, or whatever other strategy you may want.\n */\n height?: ModalHeightMode\n /**\n * Whether to set or not the focus initially to the first focusable element inside the modal.\n */\n autoFocus?: boolean\n /**\n * A escape hatch in case you need to provide a custom class name to the container element.\n */\n exceptionallySetClassName?: string\n /** Defines a string value that labels the current modal for assistive technologies. */\n 'aria-label'?: string\n /** Identifies the element (or elements) that labels the current modal for assistive technologies. */\n 'aria-labelledby'?: string\n}\n\nfunction isNotInternalFrame(element: HTMLElement) {\n return !(element.ownerDocument === document && element.tagName.toLowerCase() === 'iframe')\n}\n\n/**\n * Renders a modal that sits on top of the rest of the content in the entire page.\n *\n * Follows the WAI-ARIA Dialog (Modal) Pattern.\n *\n * @see ModalHeader\n * @see ModalFooter\n * @see ModalBody\n */\nexport function Modal({\n isOpen,\n onDismiss,\n height = 'fitContent',\n width = 'medium',\n exceptionallySetClassName,\n autoFocus = true,\n children,\n ...props\n}: ModalProps) {\n const contextValue: ModalContextValue = React.useMemo(() => ({ onDismiss, height }), [\n onDismiss,\n height,\n ])\n\n return (\n <DialogOverlay\n isOpen={isOpen}\n onDismiss={onDismiss}\n dangerouslyBypassFocusLock // We're setting up our own focus lock below\n className={classNames(styles.overlay, styles[height], styles[width])}\n data-testid=\"modal-overlay\"\n >\n <FocusLock autoFocus={autoFocus} whiteList={isNotInternalFrame} returnFocus={true}>\n <DialogContent\n {...props}\n as={Box}\n borderRadius=\"full\"\n background=\"default\"\n display=\"flex\"\n flexDirection=\"column\"\n overflow=\"hidden\"\n height={height === 'expand' ? 'full' : undefined}\n flexGrow={height === 'expand' ? 1 : 0}\n className={[exceptionallySetClassName, styles.container]}\n >\n <ModalContext.Provider value={contextValue}>{children}</ModalContext.Provider>\n </DialogContent>\n </FocusLock>\n </DialogOverlay>\n )\n}\n\n//\n// ModalCloseButton\n//\n\nexport type ModalCloseButtonProps = Omit<\n ButtonProps,\n | 'type'\n | 'children'\n | 'variant'\n | 'icon'\n | 'startIcon'\n | 'endIcon'\n | 'disabled'\n | 'loading'\n | 'tabIndex'\n | 'width'\n | 'align'\n> & {\n /**\n * The descriptive label of the button.\n */\n 'aria-label': string\n}\n\n/**\n * The close button rendered by ModalHeader. Provided independently so that consumers can customize\n * the button's label.\n *\n * @see ModalHeader\n */\nexport function ModalCloseButton(props: ModalCloseButtonProps) {\n const { onDismiss } = React.useContext(ModalContext)\n const [includeInTabOrder, setIncludeInTabOrder] = React.useState(false)\n const [isMounted, setIsMounted] = React.useState(false)\n\n React.useEffect(\n function skipAutoFocus() {\n if (isMounted) {\n setIncludeInTabOrder(true)\n } else {\n setIsMounted(true)\n }\n },\n [isMounted],\n )\n\n return (\n <Button\n {...props}\n variant=\"quaternary\"\n onClick={onDismiss}\n icon={<CloseIcon />}\n tabIndex={includeInTabOrder ? 0 : -1}\n />\n )\n}\n\n//\n// ModalHeader\n//\n\nexport type ModalHeaderProps = DivProps & {\n /**\n * The content of the header.\n */\n children: React.ReactNode\n /**\n * Allows to provide a custom button element, or to omit the close button if set to false.\n * @see ModalCloseButton\n */\n button?: React.ReactNode | boolean\n /**\n * Whether to render a divider line below the header.\n * @default false\n */\n withDivider?: boolean\n /**\n * A escape hatch in case you need to provide a custom class name to the container element.\n */\n exceptionallySetClassName?: string\n}\n\n/**\n * Renders a standard modal header area with an optional close button.\n *\n * @see Modal\n * @see ModalFooter\n * @see ModalBody\n */\nexport function ModalHeader({\n children,\n button = true,\n withDivider = false,\n exceptionallySetClassName,\n ...props\n}: ModalHeaderProps) {\n return (\n <>\n <Box\n {...props}\n as=\"header\"\n paddingLeft=\"large\"\n paddingRight=\"small\"\n paddingY=\"small\"\n className={exceptionallySetClassName}\n >\n <Columns space=\"large\" alignY=\"center\">\n <Column width=\"auto\">{children}</Column>\n {button === false || button === null ? null : (\n <Column\n width=\"content\"\n exceptionallySetClassName={styles.buttonContainer}\n data-testid=\"button-container\"\n >\n {typeof button === 'boolean' ? (\n <ModalCloseButton aria-label=\"Close modal\" autoFocus={false} />\n ) : (\n button\n )}\n </Column>\n )}\n </Columns>\n </Box>\n {withDivider ? <Divider /> : null}\n </>\n )\n}\n\n//\n// ModalBody\n//\n\nexport type ModalBodyProps = DivProps & {\n /**\n * The content of the modal body.\n */\n children: React.ReactNode\n /**\n * A escape hatch in case you need to provide a custom class name to the container element.\n */\n exceptionallySetClassName?: string\n}\n\n/**\n * Renders the body of a modal.\n *\n * Convenient to use alongside ModalHeader and/or ModalFooter as needed. It ensures, among other\n * things, that the contet of the modal body expands or contracts depending on the modal height\n * setting or the size of the content. The body content also automatically scrolls when it's too\n * large to fit the available space.\n *\n * @see Modal\n * @see ModalHeader\n * @see ModalFooter\n */\nexport function ModalBody({ exceptionallySetClassName, children, ...props }: ModalBodyProps) {\n const { height } = React.useContext(ModalContext)\n return (\n <Box\n {...props}\n className={exceptionallySetClassName}\n flexGrow={height === 'expand' ? 1 : 0}\n height={height === 'expand' ? 'full' : undefined}\n overflow=\"auto\"\n >\n <Box padding=\"large\" paddingBottom=\"xxlarge\">\n {children}\n </Box>\n </Box>\n )\n}\n\n//\n// ModalFooter\n//\n\nexport type ModalFooterProps = DivProps & {\n /**\n * The contant of the modal footer.\n */\n children: React.ReactNode\n /**\n * Whether to render a divider line below the footer.\n * @default false\n */\n withDivider?: boolean\n /**\n * A escape hatch in case you need to provide a custom class name to the container element.\n */\n exceptionallySetClassName?: string\n}\n\n/**\n * Renders a standard modal footer area.\n *\n * @see Modal\n * @see ModalHeader\n * @see ModalBody\n */\nexport function ModalFooter({\n exceptionallySetClassName,\n withDivider = false,\n ...props\n}: ModalFooterProps) {\n return (\n <>\n {withDivider ? <Divider /> : null}\n <Box as=\"footer\" {...props} className={exceptionallySetClassName} padding=\"large\" />\n </>\n )\n}\n\n//\n// ModalActions\n//\n\nexport type ModalActionsProps = ModalFooterProps\n\n/**\n * A specific version of the ModalFooter, tailored to showing an inline list of actions (buttons).\n * @see ModalFooter\n */\nexport function ModalActions({ children, ...props }: ModalActionsProps) {\n return (\n <ModalFooter {...props}>\n <Inline align=\"right\" space=\"large\">\n {children}\n </Inline>\n </ModalFooter>\n )\n}\n"],"names":["ModalContext","React","onDismiss","undefined","height","isNotInternalFrame","element","ownerDocument","document","tagName","toLowerCase","Modal","isOpen","width","exceptionallySetClassName","autoFocus","children","props","contextValue","DialogOverlay","dangerouslyBypassFocusLock","className","classNames","styles","overlay","FocusLock","whiteList","returnFocus","DialogContent","as","Box","borderRadius","background","display","flexDirection","overflow","flexGrow","container","Provider","value","ModalCloseButton","includeInTabOrder","setIncludeInTabOrder","isMounted","setIsMounted","skipAutoFocus","Button","variant","onClick","icon","CloseIcon","tabIndex","ModalHeader","button","withDivider","paddingLeft","paddingRight","paddingY","Columns","space","alignY","Column","buttonContainer","Divider","ModalBody","padding","paddingBottom","ModalFooter","ModalActions","Inline","align"],"mappings":";;;;;;;;;;;;;;;;;;AA0BA,IAAMA,YAAY,gBAAGC,aAAA,CAAuC;AACxDC,EAAAA,SAAS,EAAEC,SAD6C;AAExDC,EAAAA,MAAM,EAAE;AAFgD,CAAvC,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EI9D,aAAA,CAAC6B,GAAD;AAAKD,IAAAA,EAAE,EAAC;KAAaZ;AAAOI,IAAAA,SAAS,EAAEP;AAA2BmD,IAAAA,OAAO,EAAC;IAA1E,CAFJ,CADJ;AAMH;AAQD;;;;;SAIgBG;MAAepD,iBAAAA;MAAaC;;AACxC,sBACIhB,aAAA,CAACkE,WAAD,oBAAiBlD,MAAjB,eACIhB,aAAA,CAACoE,MAAD;AAAQC,IAAAA,KAAK,EAAC;AAAQX,IAAAA,KAAK,EAAC;GAA5B,EACK3C,QADL,CADJ,CADJ;AAOH;;;;"}
1
+ {"version":3,"file":"modal.js","sources":["../../../src/new-components/modal/modal.tsx"],"sourcesContent":["import * as React from 'react'\nimport classNames from 'classnames'\nimport { DialogOverlay, DialogContent } from '@reach/dialog'\nimport FocusLock from 'react-focus-lock'\n\nimport { CloseIcon } from '../icons/close-icon'\nimport { Column, Columns } from '../columns'\nimport { Inline } from '../inline'\nimport { Divider } from '../divider'\nimport { Box } from '../box'\nimport { Button, ButtonProps } from '../button'\n\nimport styles from './modal.module.css'\n\ntype ModalWidth = 'small' | 'medium' | 'large' | 'xlarge' | 'full'\ntype ModalHeightMode = 'expand' | 'fitContent'\n\n//\n// ModalContext\n//\n\ntype ModalContextValue = {\n onDismiss?(this: void): void\n height: ModalHeightMode\n}\n\nconst ModalContext = React.createContext<ModalContextValue>({\n onDismiss: undefined,\n height: 'fitContent',\n})\n\n//\n// Modal container\n//\n\ntype DivProps = Omit<\n React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLDivElement>, HTMLDivElement>,\n 'className' | 'children' | `aria-label` | `aria-labelledby`\n>\n\nexport type ModalProps = DivProps & {\n /**\n * The content of the modal.\n */\n children: React.ReactNode\n /**\n * Whether the modal is open and visible or not.\n */\n isOpen: boolean\n /**\n * Called when the user triggers closing the modal.\n */\n onDismiss?(): void\n /**\n * A descriptive setting for how wide the modal should aim to be, depending on how much space\n * it has on screen.\n * @default 'medium'\n */\n width?: ModalWidth\n /**\n * A descriptive setting for how tall the modal should aim to be.\n *\n * - 'expand': the modal aims to fill most of the available screen height, leaving only a small\n * padding above and below.\n * - 'fitContent': the modal shrinks to the smallest size that allow it to fit its content.\n *\n * In either case, if content does not fit, the content of the main body is set to scroll\n * (provided you use `ModalBody`) so that the modal never has to strech vertically beyond the\n * viewport boundaries.\n *\n * If you do not use `ModalBody`, the modal still prevents overflow, and you are in charge of\n * the inner layout to ensure scroll, or whatever other strategy you may want.\n */\n height?: ModalHeightMode\n /**\n * Whether to set or not the focus initially to the first focusable element inside the modal.\n */\n autoFocus?: boolean\n /**\n * A escape hatch in case you need to provide a custom class name to the container element.\n */\n exceptionallySetClassName?: string\n /** Defines a string value that labels the current modal for assistive technologies. */\n 'aria-label'?: string\n /** Identifies the element (or elements) that labels the current modal for assistive technologies. */\n 'aria-labelledby'?: string\n}\n\nfunction isNotInternalFrame(element: HTMLElement) {\n return !(element.ownerDocument === document && element.tagName.toLowerCase() === 'iframe')\n}\n\n/**\n * Renders a modal that sits on top of the rest of the content in the entire page.\n *\n * Follows the WAI-ARIA Dialog (Modal) Pattern.\n *\n * @see ModalHeader\n * @see ModalFooter\n * @see ModalBody\n */\nexport function Modal({\n isOpen,\n onDismiss,\n height = 'fitContent',\n width = 'medium',\n exceptionallySetClassName,\n autoFocus = true,\n children,\n ...props\n}: ModalProps) {\n const contextValue: ModalContextValue = React.useMemo(() => ({ onDismiss, height }), [\n onDismiss,\n height,\n ])\n\n return (\n <DialogOverlay\n isOpen={isOpen}\n onDismiss={onDismiss}\n dangerouslyBypassFocusLock // We're setting up our own focus lock below\n className={classNames(styles.overlay, styles[height], styles[width])}\n data-testid=\"modal-overlay\"\n >\n <FocusLock autoFocus={autoFocus} whiteList={isNotInternalFrame} returnFocus={true}>\n <DialogContent\n {...props}\n as={Box}\n borderRadius=\"full\"\n background=\"default\"\n display=\"flex\"\n flexDirection=\"column\"\n overflow=\"hidden\"\n height={height === 'expand' ? 'full' : undefined}\n flexGrow={height === 'expand' ? 1 : 0}\n className={[exceptionallySetClassName, styles.container]}\n >\n <ModalContext.Provider value={contextValue}>{children}</ModalContext.Provider>\n </DialogContent>\n </FocusLock>\n </DialogOverlay>\n )\n}\n\n//\n// ModalCloseButton\n//\n\nexport type ModalCloseButtonProps = Omit<\n ButtonProps,\n | 'type'\n | 'children'\n | 'variant'\n | 'icon'\n | 'startIcon'\n | 'endIcon'\n | 'disabled'\n | 'loading'\n | 'tabIndex'\n | 'width'\n | 'align'\n> & {\n /**\n * The descriptive label of the button.\n */\n 'aria-label': string\n}\n\n/**\n * The close button rendered by ModalHeader. Provided independently so that consumers can customize\n * the button's label.\n *\n * @see ModalHeader\n */\nexport function ModalCloseButton(props: ModalCloseButtonProps) {\n const { onDismiss } = React.useContext(ModalContext)\n const [includeInTabOrder, setIncludeInTabOrder] = React.useState(false)\n const [isMounted, setIsMounted] = React.useState(false)\n\n React.useEffect(\n function skipAutoFocus() {\n if (isMounted) {\n setIncludeInTabOrder(true)\n } else {\n setIsMounted(true)\n }\n },\n [isMounted],\n )\n\n return (\n <Button\n {...props}\n variant=\"quaternary\"\n onClick={onDismiss}\n icon={<CloseIcon />}\n tabIndex={includeInTabOrder ? 0 : -1}\n />\n )\n}\n\n//\n// ModalHeader\n//\n\nexport type ModalHeaderProps = DivProps & {\n /**\n * The content of the header.\n */\n children: React.ReactNode\n /**\n * Allows to provide a custom button element, or to omit the close button if set to false.\n * @see ModalCloseButton\n */\n button?: React.ReactNode | boolean\n /**\n * Whether to render a divider line below the header.\n * @default false\n */\n withDivider?: boolean\n /**\n * A escape hatch in case you need to provide a custom class name to the container element.\n */\n exceptionallySetClassName?: string\n}\n\n/**\n * Renders a standard modal header area with an optional close button.\n *\n * @see Modal\n * @see ModalFooter\n * @see ModalBody\n */\nexport function ModalHeader({\n children,\n button = true,\n withDivider = false,\n exceptionallySetClassName,\n ...props\n}: ModalHeaderProps) {\n return (\n <>\n <Box\n {...props}\n as=\"header\"\n paddingLeft=\"large\"\n paddingRight={button === false || button === null ? 'large' : 'small'}\n paddingY=\"small\"\n className={exceptionallySetClassName}\n >\n <Columns space=\"large\" alignY=\"center\">\n <Column width=\"auto\">{children}</Column>\n {button === false || button === null ? (\n <div className={styles.headerContent} />\n ) : (\n <Column\n width=\"content\"\n exceptionallySetClassName={styles.buttonContainer}\n data-testid=\"button-container\"\n >\n {typeof button === 'boolean' ? (\n <ModalCloseButton aria-label=\"Close modal\" autoFocus={false} />\n ) : (\n button\n )}\n </Column>\n )}\n </Columns>\n </Box>\n {withDivider ? <Divider /> : null}\n </>\n )\n}\n\n//\n// ModalBody\n//\n\nexport type ModalBodyProps = DivProps & {\n /**\n * The content of the modal body.\n */\n children: React.ReactNode\n /**\n * A escape hatch in case you need to provide a custom class name to the container element.\n */\n exceptionallySetClassName?: string\n}\n\n/**\n * Renders the body of a modal.\n *\n * Convenient to use alongside ModalHeader and/or ModalFooter as needed. It ensures, among other\n * things, that the contet of the modal body expands or contracts depending on the modal height\n * setting or the size of the content. The body content also automatically scrolls when it's too\n * large to fit the available space.\n *\n * @see Modal\n * @see ModalHeader\n * @see ModalFooter\n */\nexport function ModalBody({ exceptionallySetClassName, children, ...props }: ModalBodyProps) {\n const { height } = React.useContext(ModalContext)\n return (\n <Box\n {...props}\n className={exceptionallySetClassName}\n flexGrow={height === 'expand' ? 1 : 0}\n height={height === 'expand' ? 'full' : undefined}\n overflow=\"auto\"\n >\n <Box padding=\"large\" paddingBottom=\"xxlarge\">\n {children}\n </Box>\n </Box>\n )\n}\n\n//\n// ModalFooter\n//\n\nexport type ModalFooterProps = DivProps & {\n /**\n * The contant of the modal footer.\n */\n children: React.ReactNode\n /**\n * Whether to render a divider line below the footer.\n * @default false\n */\n withDivider?: boolean\n /**\n * A escape hatch in case you need to provide a custom class name to the container element.\n */\n exceptionallySetClassName?: string\n}\n\n/**\n * Renders a standard modal footer area.\n *\n * @see Modal\n * @see ModalHeader\n * @see ModalBody\n */\nexport function ModalFooter({\n exceptionallySetClassName,\n withDivider = false,\n ...props\n}: ModalFooterProps) {\n return (\n <>\n {withDivider ? <Divider /> : null}\n <Box as=\"footer\" {...props} className={exceptionallySetClassName} padding=\"large\" />\n </>\n )\n}\n\n//\n// ModalActions\n//\n\nexport type ModalActionsProps = ModalFooterProps\n\n/**\n * A specific version of the ModalFooter, tailored to showing an inline list of actions (buttons).\n * @see ModalFooter\n */\nexport function ModalActions({ children, ...props }: ModalActionsProps) {\n return (\n <ModalFooter {...props}>\n <Inline align=\"right\" space=\"large\">\n {children}\n </Inline>\n </ModalFooter>\n )\n}\n"],"names":["ModalContext","React","onDismiss","undefined","height","isNotInternalFrame","element","ownerDocument","document","tagName","toLowerCase","Modal","isOpen","width","exceptionallySetClassName","autoFocus","children","props","contextValue","DialogOverlay","dangerouslyBypassFocusLock","className","classNames","styles","overlay","FocusLock","whiteList","returnFocus","DialogContent","as","Box","borderRadius","background","display","flexDirection","overflow","flexGrow","container","Provider","value","ModalCloseButton","includeInTabOrder","setIncludeInTabOrder","isMounted","setIsMounted","skipAutoFocus","Button","variant","onClick","icon","CloseIcon","tabIndex","ModalHeader","button","withDivider","paddingLeft","paddingRight","paddingY","Columns","space","alignY","Column","headerContent","buttonContainer","Divider","ModalBody","padding","paddingBottom","ModalFooter","ModalActions","Inline","align"],"mappings":";;;;;;;;;;;;;;;;;;AA0BA,MAAMA,YAAY,gBAAGC,aAAA,CAAuC;EACxDC,SAAS,EAAEC,SAD6C;EAExDC,MAAM,EAAE;AAFgD,CAAvC,CAArB;;AA8DA,SAASC,kBAAT,CAA4BC,OAA5B;EACI,OAAO,EAAEA,OAAO,CAACC,aAAR,KAA0BC,QAA1B,IAAsCF,OAAO,CAACG,OAAR,CAAgBC,WAAhB,OAAkC,QAA1E,CAAP;AACH;AAED;;;;;;;;;;;SASgBC;MAAM;IAClBC,MADkB;IAElBV,SAFkB;IAGlBE,MAAM,GAAG,YAHS;IAIlBS,KAAK,GAAG,QAJU;IAKlBC,yBALkB;IAMlBC,SAAS,GAAG,IANM;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sC,MARR,CALR,CARJ,CADJ,EA4BKC,WAAW,gBAAGrD,aAAA,CAAC+D,OAAD,MAAA,CAAH,GAAiB,IA5BjC,CADJ;AAgCH;AAiBD;;;;;;;;;;;;;SAYgBC;MAAU;IAAEnD,yBAAF;IAA6BE;;MAAaC;;EAChE,MAAM;IAAEb;MAAWH,UAAA,CAAiBD,YAAjB,CAAnB;EACA,oBACIC,aAAA,CAAC6B,GAAD,oCACQb,KADR;IAEII,SAAS,EAAEP,yBAFf;IAGIsB,QAAQ,EAAEhC,MAAM,KAAK,QAAX,GAAsB,CAAtB,GAA0B,CAHxC;IAIIA,MAAM,EAAEA,MAAM,KAAK,QAAX,GAAsB,MAAtB,GAA+BD,SAJ3C;IAKIgC,QAAQ,EAAC;mBAETlC,aAAA,CAAC6B,GAAD;IAAKoC,OAAO,EAAC;IAAQC,aAAa,EAAC;GAAnC,EACKnD,QADL,CAPJ,CADJ;AAaH;AAsBD;;;;;;;;SAOgBoD;MAAY;IACxBtD,yBADwB;IAExBwC,WAAW,GAAG;;MACXrC;;EAEH,oBACIhB,aAAA,SAAA,MAAA,EACKqD,WAAW,gBAAGrD,aAAA,CAAC+D,OAAD,MAAA,CAAH,GAAiB,IADjC,eAEI/D,aAAA,CAAC6B,GAAD;IAAKD,EAAE,EAAC;KAAaZ,KAArB;IAA4BI,SAAS,EAAEP,yBAAvC;IAAkEoD,OAAO,EAAC;KAF9E,CADJ;AAMH;AAQD;;;;;SAIgBG;MAAa;IAAErD;;MAAaC;;EACxC,oBACIhB,aAAA,CAACmE,WAAD,qBAAiBnD,KAAjB,gBACIhB,aAAA,CAACqE,MAAD;IAAQC,KAAK,EAAC;IAAQZ,KAAK,EAAC;GAA5B,EACK3C,QADL,CADJ,CADJ;AAOH;;;;"}
@@ -1,4 +1,4 @@
1
- var modules_8f59d13b = {"reach-portal":"dddb40c3","fadein":"_955f2d73","fitContent":"_95c7550e","container":"_88079712","full":"_4779d078","large":"_5fd86231","medium":"bdfb5931","small":"_4e848a11","xlarge":"d673fba2","overlay":"ea9ae0cc","expand":"a8bf8a4f","buttonContainer":"_44d6850e"};
1
+ var modules_8f59d13b = {"reach-portal":"_37bef8d8","fadein":"_77f9687f","fitContent":"bcc4e0a5","container":"d4832c2d","full":"b0c3b021","large":"_573d6aa5","medium":"_8550d996","small":"_43bb18f5","xlarge":"_57b4159d","overlay":"cb63f300","expand":"e741893e","buttonContainer":"bb1ce281","headerContent":"c5ef989c"};
2
2
 
3
3
  export default modules_8f59d13b;
4
4
  //# sourceMappingURL=modal.module.css.js.map
@@ -5,10 +5,11 @@ import { Columns, Column } from '../columns/columns.js';
5
5
  import { AlertIcon } from '../icons/alert-icon.js';
6
6
  import styles from './notice.module.css.js';
7
7
 
8
- function Notice(_ref) {
9
- var id = _ref.id,
10
- children = _ref.children,
11
- tone = _ref.tone;
8
+ function Notice({
9
+ id,
10
+ children,
11
+ tone
12
+ }) {
12
13
  return /*#__PURE__*/createElement(Box, {
13
14
  id: id,
14
15
  role: "alert",