@arc-ui/components 10.8.0 → 11.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 (253) hide show
  1. package/dist/Align/{index.d.ts → Align.cjs.d.ts} +0 -0
  2. package/dist/Align/Align.cjs.js +33 -0
  3. package/dist/Align/Align.esm.d.ts +25 -0
  4. package/dist/Align/{index.js → Align.esm.js} +3 -3
  5. package/dist/Align/package.json +7 -0
  6. package/dist/Base/{index.d.ts → Base.cjs.d.ts} +0 -0
  7. package/dist/Base/Base.cjs.js +23 -0
  8. package/dist/Base/Base.esm.d.ts +16 -0
  9. package/dist/Base/{index.js → Base.esm.js} +1 -1
  10. package/dist/Base/package.json +7 -0
  11. package/dist/BrandLogo/BrandLogo.cjs.d.ts +1 -0
  12. package/dist/BrandLogo/BrandLogo.cjs.js +14 -0
  13. package/dist/BrandLogo/BrandLogo.esm.d.ts +1 -0
  14. package/dist/BrandLogo/BrandLogo.esm.js +6 -0
  15. package/dist/BrandLogo/package.json +7 -0
  16. package/dist/Breadcrumbs/{index.d.ts → Breadcrumbs.cjs.d.ts} +0 -0
  17. package/dist/Breadcrumbs/Breadcrumbs.cjs.js +650 -0
  18. package/dist/Breadcrumbs/Breadcrumbs.esm.d.ts +61 -0
  19. package/dist/Breadcrumbs/{index.js → Breadcrumbs.esm.js} +9 -9
  20. package/dist/Breadcrumbs/package.json +7 -0
  21. package/dist/Button/Button.cjs.d.ts +1 -0
  22. package/dist/Button/Button.cjs.js +16 -0
  23. package/dist/Button/Button.esm.d.ts +1 -0
  24. package/dist/Button/Button.esm.js +8 -0
  25. package/dist/Button/package.json +7 -0
  26. package/dist/Card/{index.d.ts → Card.cjs.d.ts} +0 -0
  27. package/dist/Card/Card.cjs.js +126 -0
  28. package/dist/Card/Card.esm.d.ts +130 -0
  29. package/dist/Card/{index.js → Card.esm.js} +10 -10
  30. package/dist/Card/package.json +7 -0
  31. package/dist/Checkbox/{index.d.ts → Checkbox.cjs.d.ts} +0 -0
  32. package/dist/Checkbox/Checkbox.cjs.js +78 -0
  33. package/dist/Checkbox/Checkbox.esm.d.ts +59 -0
  34. package/dist/Checkbox/Checkbox.esm.js +70 -0
  35. package/dist/Checkbox/package.json +7 -0
  36. package/dist/Clock/{index.d.ts → Clock.cjs.d.ts} +0 -0
  37. package/dist/Clock/Clock.cjs.js +43 -0
  38. package/dist/Clock/Clock.esm.d.ts +15 -0
  39. package/dist/Clock/{index.js → Clock.esm.js} +1 -1
  40. package/dist/Clock/package.json +7 -0
  41. package/dist/Columns/{index.d.ts → Columns.cjs.d.ts} +0 -0
  42. package/dist/Columns/Columns.cjs.js +59 -0
  43. package/dist/Columns/Columns.esm.d.ts +76 -0
  44. package/dist/Columns/{index.js → Columns.esm.js} +3 -3
  45. package/dist/Columns/package.json +7 -0
  46. package/dist/Curve/Curve.cjs.d.ts +1 -0
  47. package/dist/Curve/Curve.cjs.js +13 -0
  48. package/dist/Curve/Curve.esm.d.ts +1 -0
  49. package/dist/Curve/Curve.esm.js +5 -0
  50. package/dist/Curve/package.json +7 -0
  51. package/dist/Disclosure/{index.d.ts → Disclosure.cjs.d.ts} +1 -1
  52. package/dist/Disclosure/Disclosure.cjs.js +36 -0
  53. package/dist/Disclosure/Disclosure.esm.d.ts +31 -0
  54. package/dist/Disclosure/{index.js → Disclosure.esm.js} +8 -5
  55. package/dist/Disclosure/package.json +7 -0
  56. package/dist/Elevation/{index.d.ts → Elevation.cjs.d.ts} +0 -0
  57. package/dist/Elevation/Elevation.cjs.js +25 -0
  58. package/dist/Elevation/Elevation.esm.d.ts +16 -0
  59. package/dist/Elevation/{index.js → Elevation.esm.js} +2 -2
  60. package/dist/Elevation/package.json +7 -0
  61. package/dist/FormControl/FormControl.cjs.d.ts +1 -0
  62. package/dist/FormControl/FormControl.cjs.js +14 -0
  63. package/dist/FormControl/FormControl.esm.d.ts +1 -0
  64. package/dist/FormControl/FormControl.esm.js +5 -0
  65. package/dist/FormControl/package.json +7 -0
  66. package/dist/Group/{index.d.ts → Group.cjs.d.ts} +0 -0
  67. package/dist/Group/Group.cjs.js +50 -0
  68. package/dist/Group/Group.esm.d.ts +46 -0
  69. package/dist/Group/{index.js → Group.esm.js} +3 -3
  70. package/dist/Group/package.json +7 -0
  71. package/dist/Heading/Heading.cjs.d.ts +1 -0
  72. package/dist/Heading/Heading.cjs.js +14 -0
  73. package/dist/Heading/Heading.esm.d.ts +1 -0
  74. package/dist/Heading/Heading.esm.js +6 -0
  75. package/dist/Heading/package.json +7 -0
  76. package/dist/Icon/Icon.cjs.d.ts +1 -0
  77. package/dist/Icon/Icon.cjs.js +14 -0
  78. package/dist/Icon/Icon.esm.d.ts +1 -0
  79. package/dist/Icon/Icon.esm.js +6 -0
  80. package/dist/Icon/package.json +7 -0
  81. package/dist/Image/Image.cjs.d.ts +1 -0
  82. package/dist/Image/Image.cjs.js +13 -0
  83. package/dist/Image/Image.esm.d.ts +1 -0
  84. package/dist/Image/Image.esm.js +5 -0
  85. package/dist/Image/package.json +7 -0
  86. package/dist/Markup/{index.d.ts → Markup.cjs.d.ts} +0 -0
  87. package/dist/Markup/Markup.cjs.js +27 -0
  88. package/dist/Markup/Markup.esm.d.ts +16 -0
  89. package/dist/Markup/{index.js → Markup.esm.js} +3 -3
  90. package/dist/Markup/package.json +7 -0
  91. package/dist/Poster/{index.d.ts → Poster.cjs.d.ts} +2 -2
  92. package/dist/Poster/Poster.cjs.js +52 -0
  93. package/dist/Poster/Poster.esm.d.ts +81 -0
  94. package/dist/Poster/{index.js → Poster.esm.js} +5 -5
  95. package/dist/Poster/package.json +7 -0
  96. package/dist/RadioGroup/{index.d.ts → RadioGroup.cjs.d.ts} +1 -1
  97. package/dist/RadioGroup/RadioGroup.cjs.js +72 -0
  98. package/dist/RadioGroup/RadioGroup.esm.d.ts +85 -0
  99. package/dist/RadioGroup/{index.js → RadioGroup.esm.js} +4 -4
  100. package/dist/RadioGroup/package.json +7 -0
  101. package/dist/Rule/{index.d.ts → Rule.cjs.d.ts} +0 -0
  102. package/dist/Rule/Rule.cjs.js +25 -0
  103. package/dist/Rule/Rule.esm.d.ts +8 -0
  104. package/dist/Rule/{index.js → Rule.esm.js} +3 -3
  105. package/dist/Rule/package.json +7 -0
  106. package/dist/Section/Section.cjs.d.ts +1 -0
  107. package/dist/Section/Section.cjs.js +12 -0
  108. package/dist/Section/Section.esm.d.ts +1 -0
  109. package/dist/Section/Section.esm.js +4 -0
  110. package/dist/Section/package.json +7 -0
  111. package/dist/SiteFooter/{index.d.ts → SiteFooter.cjs.d.ts} +0 -0
  112. package/dist/SiteFooter/SiteFooter.cjs.js +99 -0
  113. package/dist/SiteFooter/SiteFooter.esm.d.ts +64 -0
  114. package/dist/SiteFooter/{index.js → SiteFooter.esm.js} +12 -10
  115. package/dist/SiteFooter/package.json +7 -0
  116. package/dist/SiteHeader/{index.d.ts → SiteHeader.cjs.d.ts} +1 -1
  117. package/dist/SiteHeader/SiteHeader.cjs.js +669 -0
  118. package/dist/SiteHeader/SiteHeader.esm.d.ts +252 -0
  119. package/dist/SiteHeader/{index.js → SiteHeader.esm.js} +39 -17
  120. package/dist/SiteHeader/package.json +7 -0
  121. package/dist/Surface/{index.d.ts → Surface.cjs.d.ts} +1 -1
  122. package/dist/Surface/Surface.cjs.js +15 -0
  123. package/dist/Surface/Surface.esm.d.ts +1 -0
  124. package/dist/Surface/Surface.esm.js +4 -0
  125. package/dist/Surface/package.json +7 -0
  126. package/dist/Text/Text.cjs.d.ts +1 -0
  127. package/dist/Text/Text.cjs.js +14 -0
  128. package/dist/Text/Text.esm.d.ts +1 -0
  129. package/dist/Text/Text.esm.js +6 -0
  130. package/dist/Text/package.json +7 -0
  131. package/dist/TextInput/{index.d.ts → TextInput.cjs.d.ts} +1 -1
  132. package/dist/TextInput/TextInput.cjs.js +64 -0
  133. package/dist/TextInput/TextInput.esm.d.ts +71 -0
  134. package/dist/TextInput/{index.js → TextInput.esm.js} +4 -4
  135. package/dist/TextInput/package.json +7 -0
  136. package/dist/UniversalHeader/{index.d.ts → UniversalHeader.cjs.d.ts} +0 -0
  137. package/dist/UniversalHeader/UniversalHeader.cjs.js +38 -0
  138. package/dist/UniversalHeader/UniversalHeader.esm.d.ts +26 -0
  139. package/dist/UniversalHeader/{index.js → UniversalHeader.esm.js} +3 -3
  140. package/dist/UniversalHeader/package.json +7 -0
  141. package/dist/VerticalSpace/{index.d.ts → VerticalSpace.cjs.d.ts} +0 -0
  142. package/dist/VerticalSpace/VerticalSpace.cjs.js +27 -0
  143. package/dist/VerticalSpace/VerticalSpace.esm.d.ts +18 -0
  144. package/dist/VerticalSpace/{index.js → VerticalSpace.esm.js} +2 -2
  145. package/dist/VerticalSpace/package.json +7 -0
  146. package/dist/VisuallyHidden/{index.d.ts → VisuallyHidden.cjs.d.ts} +0 -0
  147. package/dist/VisuallyHidden/VisuallyHidden.cjs.js +19 -0
  148. package/dist/VisuallyHidden/VisuallyHidden.esm.d.ts +12 -0
  149. package/dist/VisuallyHidden/{index.js → VisuallyHidden.esm.js} +0 -0
  150. package/dist/VisuallyHidden/package.json +7 -0
  151. package/dist/_shared/{BrandLogo-6cc8202e.d.ts → cjs/BrandLogo-3c6102ef.d.ts} +0 -0
  152. package/dist/_shared/cjs/BrandLogo-3c6102ef.js +31 -0
  153. package/dist/_shared/cjs/BtIconChevronDown2Px-8fb4e2eb.js +29 -0
  154. package/dist/_shared/cjs/BtIconChevronRight2Px-a8e40136.js +50 -0
  155. package/dist/_shared/cjs/BtIconChevronRightMid-5a38d855.js +31 -0
  156. package/dist/_shared/{Button-2fcbd4ed.d.ts → cjs/Button-b3a69953.d.ts} +3 -3
  157. package/dist/_shared/cjs/Button-b3a69953.js +80 -0
  158. package/dist/_shared/{Curve-5f476d0b.d.ts → cjs/Curve-e72ce25b.d.ts} +1 -1
  159. package/dist/_shared/cjs/Curve-e72ce25b.js +30 -0
  160. package/dist/_shared/{FormControl-9dc9ecc3.d.ts → cjs/FormControl-a1b7421b.d.ts} +0 -0
  161. package/dist/_shared/cjs/FormControl-a1b7421b.js +115 -0
  162. package/dist/_shared/{Heading-8c640dd1.d.ts → cjs/Heading-cc38c3ec.d.ts} +0 -0
  163. package/dist/_shared/cjs/Heading-cc38c3ec.js +41 -0
  164. package/dist/_shared/{Icon-b053f03d.d.ts → cjs/Icon-719d13d4.d.ts} +6 -6
  165. package/dist/_shared/cjs/Icon-719d13d4.js +52 -0
  166. package/dist/_shared/{Image-a3225049.d.ts → cjs/Image-fe760a06.d.ts} +0 -0
  167. package/dist/_shared/cjs/Image-fe760a06.js +45 -0
  168. package/dist/_shared/{Section-927988cb.d.ts → cjs/Section-780f2377.d.ts} +0 -0
  169. package/dist/_shared/cjs/Section-780f2377.js +23 -0
  170. package/dist/_shared/{Surface-3fe44a2a.d.ts → cjs/Surface-d6b8010e.d.ts} +0 -0
  171. package/dist/_shared/cjs/Surface-d6b8010e.js +58 -0
  172. package/dist/_shared/{Text-1c43d82b.d.ts → cjs/Text-1d3844be.d.ts} +0 -0
  173. package/dist/_shared/cjs/Text-1d3844be.js +32 -0
  174. package/dist/_shared/cjs/arc-icon-17594b2f.d.ts +4 -0
  175. package/dist/_shared/{handle-link-click-35e09d0c.d.ts → cjs/handle-link-click-17a44cf4.d.ts} +0 -0
  176. package/dist/_shared/cjs/handle-link-click-17a44cf4.js +15 -0
  177. package/dist/_shared/cjs/index-45bfb67b.js +63 -0
  178. package/dist/_shared/{index-e3c83626.d.ts → cjs/index-78b35bc1.d.ts} +0 -0
  179. package/dist/_shared/cjs/index-78b35bc1.js +215 -0
  180. package/dist/_shared/{index-9483ad5f.d.ts → cjs/index-9483ad5f.d.ts} +2 -2
  181. package/dist/_shared/cjs/index-c81c9401.d.ts +4 -0
  182. package/dist/_shared/{use-media-query-f11805d4.d.ts → cjs/index.es-77def0c9.d.ts} +0 -0
  183. package/dist/_shared/cjs/index.es-77def0c9.js +50 -0
  184. package/dist/_shared/{suffix-modifier-2a93822c.d.ts → cjs/suffix-modifier-edf7851e.d.ts} +0 -0
  185. package/dist/_shared/cjs/suffix-modifier-edf7851e.js +19 -0
  186. package/dist/_shared/esm/BrandLogo-ea3dd0e6.d.ts +26 -0
  187. package/dist/_shared/{BrandLogo-6cc8202e.js → esm/BrandLogo-ea3dd0e6.js} +4 -4
  188. package/dist/_shared/esm/BtIconChevronDown2Px-4abd079b.js +23 -0
  189. package/dist/_shared/esm/BtIconChevronRight2Px-a5cc1d05.js +43 -0
  190. package/dist/_shared/esm/BtIconChevronRightMid-386cf272.js +25 -0
  191. package/dist/_shared/esm/Button-5ff56a7b.d.ts +98 -0
  192. package/dist/_shared/esm/Button-5ff56a7b.js +74 -0
  193. package/dist/_shared/esm/Curve-cfdca379.d.ts +32 -0
  194. package/dist/_shared/{Curve-5f476d0b.js → esm/Curve-cfdca379.js} +3 -3
  195. package/dist/_shared/esm/FormControl-feedc495.d.ts +70 -0
  196. package/dist/_shared/{FormControl-9dc9ecc3.js → esm/FormControl-feedc495.js} +43 -11
  197. package/dist/_shared/esm/Heading-183be76c.d.ts +46 -0
  198. package/dist/_shared/{Heading-8c640dd1.js → esm/Heading-183be76c.js} +4 -4
  199. package/dist/_shared/esm/Icon-76d0d8c0.d.ts +34 -0
  200. package/dist/_shared/esm/Icon-76d0d8c0.js +46 -0
  201. package/dist/_shared/esm/Image-7e4948f6.d.ts +94 -0
  202. package/dist/_shared/{Image-a3225049.js → esm/Image-7e4948f6.js} +3 -3
  203. package/dist/_shared/esm/Section-f1256c87.d.ts +21 -0
  204. package/dist/_shared/{Section-927988cb.js → esm/Section-f1256c87.js} +2 -2
  205. package/dist/_shared/esm/Surface-d515d212.d.ts +50 -0
  206. package/dist/_shared/{Surface-3fe44a2a.js → esm/Surface-d515d212.js} +2 -2
  207. package/dist/_shared/esm/Text-d8988620.d.ts +34 -0
  208. package/dist/_shared/{Text-1c43d82b.js → esm/Text-d8988620.js} +4 -4
  209. package/dist/_shared/esm/arc-icon-17594b2f.d.ts +4 -0
  210. package/dist/_shared/esm/handle-link-click-f64f55a2.d.ts +7 -0
  211. package/dist/_shared/{handle-link-click-35e09d0c.js → esm/handle-link-click-f64f55a2.js} +0 -0
  212. package/dist/_shared/esm/index-229fc864.d.ts +2 -0
  213. package/dist/_shared/{index-e3c83626.js → esm/index-229fc864.js} +0 -0
  214. package/dist/_shared/{index-56d9df62.js → esm/index-2ae58626.js} +0 -0
  215. package/dist/_shared/esm/index-9483ad5f.d.ts +14 -0
  216. package/dist/_shared/esm/index-c81c9401.d.ts +4 -0
  217. package/dist/_shared/esm/index.es-00cb3bcb.d.ts +19 -0
  218. package/dist/_shared/{use-media-query-f11805d4.js → esm/index.es-00cb3bcb.js} +8 -1
  219. package/dist/_shared/esm/suffix-modifier-f5e28822.d.ts +10 -0
  220. package/dist/_shared/{suffix-modifier-2a93822c.js → esm/suffix-modifier-f5e28822.js} +1 -1
  221. package/dist/index.es.js +454 -528
  222. package/dist/index.es.js.map +1 -1
  223. package/dist/index.js +311 -385
  224. package/dist/index.js.map +1 -1
  225. package/dist/styles.css +1 -1
  226. package/dist/types/components/Button/Button.d.ts +3 -3
  227. package/dist/types/components/Icon/Icon.d.ts +6 -6
  228. package/dist/types/types/arc-icon.d.ts +2 -0
  229. package/package.json +4 -3
  230. package/dist/BrandLogo/index.d.ts +0 -1
  231. package/dist/BrandLogo/index.js +0 -6
  232. package/dist/Button/index.d.ts +0 -1
  233. package/dist/Button/index.js +0 -8
  234. package/dist/Checkbox/index.js +0 -46
  235. package/dist/Curve/index.d.ts +0 -1
  236. package/dist/Curve/index.js +0 -5
  237. package/dist/FormControl/index.d.ts +0 -1
  238. package/dist/FormControl/index.js +0 -5
  239. package/dist/Heading/index.d.ts +0 -1
  240. package/dist/Heading/index.js +0 -6
  241. package/dist/Icon/index.d.ts +0 -1
  242. package/dist/Icon/index.js +0 -7
  243. package/dist/Image/index.d.ts +0 -1
  244. package/dist/Image/index.js +0 -5
  245. package/dist/Section/index.d.ts +0 -1
  246. package/dist/Section/index.js +0 -4
  247. package/dist/Surface/index.js +0 -4
  248. package/dist/Text/index.d.ts +0 -1
  249. package/dist/Text/index.js +0 -6
  250. package/dist/_shared/Button-2fcbd4ed.js +0 -51
  251. package/dist/_shared/Icon-b053f03d.js +0 -27
  252. package/dist/_shared/index-c81c9401.d.ts +0 -4
  253. package/dist/_shared/index.es-ff960629.js +0 -286
@@ -0,0 +1,38 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var index = require('../_shared/cjs/index-78b35bc1.js');
6
+ var React = require('react');
7
+ var Surface = require('../_shared/cjs/Surface-d6b8010e.js');
8
+ require('../_shared/cjs/index-45bfb67b.js');
9
+
10
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
11
+
12
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
13
+
14
+ /**
15
+ * Use `UniversalHeader` to display a group-level page header.
16
+ */
17
+ var UniversalHeader = function (_a) {
18
+ var children = _a.children, props = index.__rest(_a, ["children"]);
19
+ React.useEffect(function () {
20
+ React__default["default"].Children.map(children, function (item) {
21
+ if (item && item.type !== UniversalHeaderItem) {
22
+ throw new Error("Illegal child passed to <UniversalHeader />. Ensure to only use <UniversalHeader.Item />.");
23
+ }
24
+ });
25
+ }, [children]);
26
+ return (React__default["default"].createElement("nav", index.__assign({ className: "arc-UniversalHeader" }, index.filterDataAttrs(props)),
27
+ React__default["default"].createElement(Surface.Surface, { background: "light" },
28
+ React__default["default"].createElement("ul", { className: "arc-UniversalHeader-items" }, children))));
29
+ };
30
+ var UniversalHeaderItem = function (_a) {
31
+ var children = _a.children, href = _a.href, props = index.__rest(_a, ["children", "href"]);
32
+ return (React__default["default"].createElement("li", index.__assign({}, index.filterDataAttrs(props)),
33
+ React__default["default"].createElement("a", { className: "arc-UniversalHeader-link", href: href }, children)));
34
+ };
35
+ UniversalHeaderItem.displayName = "UniversalHeader.Item";
36
+ UniversalHeader.Item = UniversalHeaderItem;
37
+
38
+ exports.UniversalHeader = UniversalHeader;
@@ -0,0 +1,26 @@
1
+ import { FC, ReactNode } from "react";
2
+ /**
3
+ * Use `UniversalHeader` to display a group-level page header.
4
+ */
5
+ declare const UniversalHeader: FC<UniversalHeaderProps> & {
6
+ Item: typeof UniversalHeaderItem;
7
+ };
8
+ declare const UniversalHeaderItem: FC<UniversalHeaderItemProps>;
9
+ interface UniversalHeaderItemProps {
10
+ /**
11
+ * Contents of the UniversalHeaderItem.
12
+ */
13
+ children: ReactNode;
14
+ /**
15
+ * A URL to link to when the Item is clicked or touched.
16
+ */
17
+ href: string;
18
+ }
19
+ interface UniversalHeaderProps {
20
+ /**
21
+ * Contents of the UniversalHeader. Must be
22
+ * UniversalHeader.Item components.
23
+ */
24
+ children: ReactNode;
25
+ }
26
+ export { UniversalHeader };
@@ -1,7 +1,7 @@
1
- import { _ as __rest, a as __assign, f as filterDataAttrs } from '../_shared/index-e3c83626.js';
1
+ import { _ as __rest, a as __assign, f as filterDataAttrs } from '../_shared/esm/index-229fc864.js';
2
2
  import React, { useEffect } from 'react';
3
- import { S as Surface } from '../_shared/Surface-3fe44a2a.js';
4
- import '../_shared/index-56d9df62.js';
3
+ import { S as Surface } from '../_shared/esm/Surface-d515d212.js';
4
+ import '../_shared/esm/index-2ae58626.js';
5
5
 
6
6
  /**
7
7
  * Use `UniversalHeader` to display a group-level page header.
@@ -0,0 +1,7 @@
1
+ {
2
+ "name": "@arc-ui/universalheader",
3
+ "types": "./UniversalHeader.esm.d.ts",
4
+ "main": "./UniversalHeader.cjs.js",
5
+ "module": "./UniversalHeader.esm.js",
6
+ "private": true
7
+ }
@@ -0,0 +1,27 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var index = require('../_shared/cjs/index-78b35bc1.js');
6
+ var index$1 = require('../_shared/cjs/index-45bfb67b.js');
7
+ var React = require('react');
8
+
9
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
10
+
11
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
12
+
13
+ /**
14
+ * Use `VerticalSpace` to create vertical space between components.
15
+ */
16
+ var VerticalSpace = function (_a) {
17
+ var _b;
18
+ var _c = _a.isDebugVisible, isDebugVisible = _c === void 0 ? false : _c, _d = _a.size, size = _d === void 0 ? "24" : _d, props = index.__rest(_a, ["isDebugVisible", "size"]);
19
+ return (React__default["default"].createElement("div", index.__assign({ className: index$1.classNames((_b = {
20
+ "arc-VerticalSpace": true
21
+ },
22
+ _b["arc-VerticalSpace--size".concat(size)] = size && size !== "24",
23
+ _b["arc-VerticalSpace--debugVisible"] = isDebugVisible,
24
+ _b)) }, index.filterDataAttrs(props))));
25
+ };
26
+
27
+ exports.VerticalSpace = VerticalSpace;
@@ -0,0 +1,18 @@
1
+ import { FC } from "react";
2
+ /**
3
+ * Use `VerticalSpace` to create vertical space between components.
4
+ */
5
+ declare const VerticalSpace: FC<VerticalSpaceProps>;
6
+ type VerticalSpaceSize = "4" | "8" | "12" | "16" | "24" | "32" | "48" | "64" | "96" | "128";
7
+ interface VerticalSpaceProps {
8
+ /**
9
+ * Should the VerticalSpace be visible for debugging and documentation
10
+ * purposes?
11
+ */
12
+ isDebugVisible?: boolean;
13
+ /**
14
+ * Size of the VerticalSpace.
15
+ */
16
+ size?: VerticalSpaceSize;
17
+ }
18
+ export { VerticalSpace };
@@ -1,5 +1,5 @@
1
- import { _ as __rest, a as __assign, f as filterDataAttrs } from '../_shared/index-e3c83626.js';
2
- import { c as classNames } from '../_shared/index-56d9df62.js';
1
+ import { _ as __rest, a as __assign, f as filterDataAttrs } from '../_shared/esm/index-229fc864.js';
2
+ import { c as classNames } from '../_shared/esm/index-2ae58626.js';
3
3
  import React from 'react';
4
4
 
5
5
  /**
@@ -0,0 +1,7 @@
1
+ {
2
+ "name": "@arc-ui/verticalspace",
3
+ "types": "./VerticalSpace.esm.d.ts",
4
+ "main": "./VerticalSpace.cjs.js",
5
+ "module": "./VerticalSpace.esm.js",
6
+ "private": true
7
+ }
@@ -0,0 +1,19 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var React = require('react');
6
+
7
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
+
9
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
10
+
11
+ /**
12
+ * Provides text for screen readers that is visually hidden.
13
+ */
14
+ var VisuallyHidden = function (_a) {
15
+ var children = _a.children;
16
+ return (React__default["default"].createElement("div", { "data-testid": "visually-hidden", className: "arc-VisuallyHidden" }, children));
17
+ };
18
+
19
+ exports.VisuallyHidden = VisuallyHidden;
@@ -0,0 +1,12 @@
1
+ import { FC, ReactNode } from "react";
2
+ /**
3
+ * Provides text for screen readers that is visually hidden.
4
+ */
5
+ declare const VisuallyHidden: FC<VisuallyHiddenProps>;
6
+ interface VisuallyHiddenProps {
7
+ /**
8
+ * Content to be Visually Hidden.
9
+ */
10
+ children?: ReactNode;
11
+ }
12
+ export { VisuallyHidden };
@@ -0,0 +1,7 @@
1
+ {
2
+ "name": "@arc-ui/visuallyhidden",
3
+ "types": "./VisuallyHidden.esm.d.ts",
4
+ "main": "./VisuallyHidden.cjs.js",
5
+ "module": "./VisuallyHidden.esm.js",
6
+ "private": true
7
+ }
@@ -0,0 +1,31 @@
1
+ 'use strict';
2
+
3
+ var index = require('./index-78b35bc1.js');
4
+ var index$1 = require('./index-45bfb67b.js');
5
+ var React = require('react');
6
+ var suffixModifier = require('./suffix-modifier-edf7851e.js');
7
+ var Surface = require('./Surface-d6b8010e.js');
8
+
9
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
10
+
11
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
12
+
13
+ /**
14
+ * Use `BrandLogo` to display the brand logo.
15
+ */
16
+ var BrandLogo = function (_a) {
17
+ var _b;
18
+ var _c = _a.color, color = _c === void 0 ? "auto" : _c, label = _a.label, _d = _a.size, size = _d === void 0 ? 34 : _d, subBrand = _a.subBrand, props = index.__rest(_a, ["color", "label", "size", "subBrand"]);
19
+ var surface = React.useContext(Surface.Context).surface;
20
+ return (React__default["default"].createElement("div", index.__assign({ className: index$1.classNames((_b = {
21
+ "arc-BrandLogo": true,
22
+ "arc-BrandLogo--colorBrand": color === "brand",
23
+ "arc-BrandLogo--onDarkSurface": surface === "dark"
24
+ },
25
+ _b[suffixModifier.suffixModifier("arc-BrandLogo--subBrand", subBrand || "")] = subBrand,
26
+ _b)), style: {
27
+ width: size !== 34 ? size : undefined
28
+ } }, index.filterDataAttrs(props)), label ? React__default["default"].createElement("span", { className: "arc-BrandLogo-text" }, label) : null));
29
+ };
30
+
31
+ exports.BrandLogo = BrandLogo;
@@ -0,0 +1,29 @@
1
+ 'use strict';
2
+
3
+ var React$1 = require('react');
4
+
5
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
6
+
7
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React$1);
8
+
9
+ const React = React__default["default"];
10
+ const BtIconChevronDown2Px = props =>
11
+ /*#__PURE__*/ React.createElement(
12
+ "svg",
13
+ Object.assign(
14
+ {
15
+ xmlns: "http://www.w3.org/2000/svg",
16
+ viewBox: "0 0 32 32"
17
+ },
18
+ props
19
+ ),
20
+ /*#__PURE__*/ React.createElement("defs", null),
21
+ /*#__PURE__*/ React.createElement("path", {
22
+ d:
23
+ "M15.99316,23.91406,2.294,10.207A.99989.99989,0,1,1,3.708,8.793l12.28515,12.293L28.292,8.793A.99989.99989,0,1,1,29.70605,10.207Z",
24
+ fill: "currentColor"
25
+ })
26
+ );
27
+ var BtIconChevronDown2Px_2 = BtIconChevronDown2Px;
28
+
29
+ exports.BtIconChevronDown2Px_2 = BtIconChevronDown2Px_2;
@@ -0,0 +1,50 @@
1
+ 'use strict';
2
+
3
+ var React$2 = require('react');
4
+
5
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
6
+
7
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React$2);
8
+
9
+ const React$1 = React__default["default"];
10
+ const BtIconChevronLeft2Px = props =>
11
+ /*#__PURE__*/ React$1.createElement(
12
+ "svg",
13
+ Object.assign(
14
+ {
15
+ xmlns: "http://www.w3.org/2000/svg",
16
+ viewBox: "0 0 32 32"
17
+ },
18
+ props
19
+ ),
20
+ /*#__PURE__*/ React$1.createElement("defs", null),
21
+ /*#__PURE__*/ React$1.createElement("path", {
22
+ d:
23
+ "M22.5,29.99854a.99676.99676,0,0,1-.707-.293L8.08594,15.99268,21.793,2.294A1.00023,1.00023,0,0,1,23.207,3.709l-12.293,12.28467L23.207,28.2915a1,1,0,0,1-.707,1.707Z",
24
+ fill: "currentColor"
25
+ })
26
+ );
27
+ var BtIconChevronLeft2Px_2 = BtIconChevronLeft2Px;
28
+
29
+ const React = React__default["default"];
30
+ const BtIconChevronRight2Px = props =>
31
+ /*#__PURE__*/ React.createElement(
32
+ "svg",
33
+ Object.assign(
34
+ {
35
+ xmlns: "http://www.w3.org/2000/svg",
36
+ viewBox: "0 0 32 32"
37
+ },
38
+ props
39
+ ),
40
+ /*#__PURE__*/ React.createElement("defs", null),
41
+ /*#__PURE__*/ React.createElement("path", {
42
+ d:
43
+ "M9.5,29.99854A1.00025,1.00025,0,0,1,8.793,28.291l12.293-12.28467L8.793,3.7085A.99989.99989,0,0,1,10.207,2.29443l13.707,13.71289L10.207,29.70605A.99827.99827,0,0,1,9.5,29.99854Z",
44
+ fill: "currentColor"
45
+ })
46
+ );
47
+ var BtIconChevronRight2Px_2 = BtIconChevronRight2Px;
48
+
49
+ exports.BtIconChevronLeft2Px_2 = BtIconChevronLeft2Px_2;
50
+ exports.BtIconChevronRight2Px_2 = BtIconChevronRight2Px_2;
@@ -0,0 +1,31 @@
1
+ 'use strict';
2
+
3
+ var React$1 = require('react');
4
+
5
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
6
+
7
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React$1);
8
+
9
+ const React = React__default["default"];
10
+ const BtIconChevronRightMid = props =>
11
+ /*#__PURE__*/ React.createElement(
12
+ "svg",
13
+ Object.assign(
14
+ {
15
+ viewBox: "0 0 16 16",
16
+ fill: "none",
17
+ xmlns: "http://www.w3.org/2000/svg"
18
+ },
19
+ props
20
+ ),
21
+ /*#__PURE__*/ React.createElement("path", {
22
+ fillRule: "evenodd",
23
+ clipRule: "evenodd",
24
+ d:
25
+ "M9.04543 8.0002L6.19676 5.1482C6.07077 5.02196 6 4.85089 6 4.67253C6 4.49418 6.07077 4.32311 6.19676 4.19687C6.25906 4.13446 6.33304 4.08495 6.41449 4.05117C6.49594 4.01739 6.58325 4 6.67143 4C6.75961 4 6.84692 4.01739 6.92837 4.05117C7.00982 4.08495 7.0838 4.13446 7.1461 4.19687L10.4701 7.52487C10.5959 7.65108 10.6665 7.82201 10.6665 8.0002C10.6665 8.1784 10.5959 8.34932 10.4701 8.47553L7.1461 11.8035C7.0838 11.8659 7.00982 11.9155 6.92837 11.9492C6.84692 11.983 6.75961 12.0004 6.67143 12.0004C6.58325 12.0004 6.49594 11.983 6.41449 11.9492C6.33304 11.9155 6.25906 11.8659 6.19676 11.8035C6.07077 11.6773 6 11.5062 6 11.3279C6 11.1495 6.07077 10.9784 6.19676 10.8522L9.04543 8.0002Z",
26
+ fill: "currentColor"
27
+ })
28
+ );
29
+ var BtIconChevronRightMid_2 = BtIconChevronRightMid;
30
+
31
+ exports.BtIconChevronRightMid_2 = BtIconChevronRightMid_2;
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
- import { icons } from "@arc-ui/tokens";
3
2
  import React from "react";
4
3
  import { FC } from "react";
4
+ import { ArcIcon } from "./arc-icon-17594b2f";
5
5
  type ElementUnion = HTMLButtonElement | HTMLAnchorElement;
6
6
  type Ref = React.Ref<ElementUnion> | null;
7
7
  /**
@@ -12,7 +12,7 @@ interface ButtonIconProps {
12
12
  /**
13
13
  * Icon variant.
14
14
  */
15
- icon?: typeof icons[number];
15
+ icon?: ArcIcon;
16
16
  /**
17
17
  * Should the icon be a default chevron?
18
18
  */
@@ -57,7 +57,7 @@ interface ButtonProps extends ButtonElementProps, LinkElementProps {
57
57
  /**
58
58
  * Button icon variant.
59
59
  */
60
- icon?: typeof icons[number];
60
+ icon?: ArcIcon;
61
61
  /**
62
62
  * How should a Button icon be displayed?
63
63
  */
@@ -0,0 +1,80 @@
1
+ 'use strict';
2
+
3
+ var index = require('./index-78b35bc1.js');
4
+ var React$1 = require('react');
5
+ var BtIconChevronRightMid = require('./BtIconChevronRightMid-5a38d855.js');
6
+ var index$1 = require('./index-45bfb67b.js');
7
+ var suffixModifier = require('./suffix-modifier-edf7851e.js');
8
+ var Icon = require('./Icon-719d13d4.js');
9
+ var Surface = require('./Surface-d6b8010e.js');
10
+
11
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
12
+
13
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React$1);
14
+
15
+ const React = React__default["default"];
16
+ const BtIconChevronLeftMid = props =>
17
+ /*#__PURE__*/ React.createElement(
18
+ "svg",
19
+ Object.assign(
20
+ {
21
+ viewBox: "0 0 16 16",
22
+ fill: "none",
23
+ xmlns: "http://www.w3.org/2000/svg"
24
+ },
25
+ props
26
+ ),
27
+ /*#__PURE__*/ React.createElement("path", {
28
+ fillRule: "evenodd",
29
+ clipRule: "evenodd",
30
+ d:
31
+ "M7.62107 8.00023L10.4697 10.8522C10.5957 10.9785 10.6665 11.1495 10.6665 11.3279C10.6665 11.5063 10.5957 11.6773 10.4697 11.8036C10.4074 11.866 10.3335 11.9155 10.252 11.9493C10.1706 11.983 10.0833 12.0004 9.99507 12.0004C9.9069 12.0004 9.81959 11.983 9.73814 11.9493C9.65669 11.9155 9.5827 11.866 9.52041 11.8036L6.19641 8.47556C6.07061 8.34935 5.99998 8.17842 5.99998 8.00023C5.99998 7.82203 6.07061 7.6511 6.19641 7.52489L9.52041 4.19689C9.5827 4.13449 9.65669 4.08498 9.73814 4.0512C9.81959 4.01741 9.9069 4.00003 9.99507 4.00003C10.0832 4.00003 10.1706 4.01741 10.252 4.0512C10.3335 4.08498 10.4074 4.13449 10.4697 4.19689C10.5957 4.32313 10.6665 4.4942 10.6665 4.67256C10.6665 4.85092 10.5957 5.02199 10.4697 5.14823L7.62107 8.00023Z",
32
+ fill: "currentColor"
33
+ })
34
+ );
35
+ var BtIconChevronLeftMid_2 = BtIconChevronLeftMid;
36
+
37
+ /**
38
+ * Use `Button` to allow users to take actions with clicks and taps.
39
+ */
40
+ var Button = React$1.forwardRef(function (_a, ref) {
41
+ var _b;
42
+ var ariaLabel = _a.ariaLabel, _c = _a.fill, fill = _c === void 0 ? "solid" : _c, href = _a.href, icon = _a.icon, _d = _a.iconPosition, iconPosition = _d === void 0 ? "afterText" : _d, id = _a.id, _e = _a.isDisabled, isDisabled = _e === void 0 ? false : _e, _f = _a.isDisplayBlock, isDisplayBlock = _f === void 0 ? false : _f, _g = _a.isFullWidth, isFullWidth = _g === void 0 ? false : _g, label = _a.label, onClick = _a.onClick, rel = _a.rel, supportingText = _a.supportingText, target = _a.target, type = _a.type, props = index.__rest(_a, ["ariaLabel", "fill", "href", "icon", "iconPosition", "id", "isDisabled", "isDisplayBlock", "isFullWidth", "label", "onClick", "rel", "supportingText", "target", "type"]);
43
+ var surface = React$1.useContext(Surface.Context).surface;
44
+ var buttonClasses = index$1.classNames((_b = {
45
+ "arc-Button": true,
46
+ "arc-Button--displayBlock": isDisplayBlock
47
+ },
48
+ _b[suffixModifier.suffixModifier("arc-Button--fill", fill)] = fill !== "solid",
49
+ _b["arc-Button--fullWidth"] = isFullWidth,
50
+ _b[suffixModifier.suffixModifier("arc-Button--icon", iconPosition.replace("icon", ""))] = (icon || fill === "flat") &&
51
+ iconPosition &&
52
+ iconPosition !== "afterText",
53
+ _b["arc-Button--hasSupportingText"] = supportingText,
54
+ _b["arc-Button--onDarkSurface"] = surface === "dark",
55
+ _b));
56
+ var commonProps = index.__assign({ id: id, onClick: onClick, ref: ref }, index.filterDataAttrs(props));
57
+ var buttonText = supportingText ? (React__default["default"].createElement("span", null,
58
+ React__default["default"].createElement("span", { className: "arc-Button-text" }, label),
59
+ React__default["default"].createElement("span", { className: "arc-Button-supportingText" }, supportingText))) : (React__default["default"].createElement("span", { className: "arc-Button-text" }, label));
60
+ var buttonIcon = icon || fill === "flat" ? (React__default["default"].createElement(ButtonIcon, { icon: icon, isChevron: !icon && fill === "flat", isBeforeText: iconPosition === "beforeText" })) : null;
61
+ if (href && !isDisabled) {
62
+ return (React__default["default"].createElement("a", index.__assign({}, commonProps, { "aria-label": ariaLabel, className: buttonClasses, href: href, rel: rel, target: target }),
63
+ React__default["default"].createElement("span", { className: "arc-Button-inner" },
64
+ buttonText,
65
+ buttonIcon)));
66
+ }
67
+ return (React__default["default"].createElement("button", index.__assign({}, commonProps, { "aria-label": ariaLabel, className: buttonClasses, disabled: isDisabled, type: type }),
68
+ React__default["default"].createElement("span", { className: "arc-Button-inner" },
69
+ buttonText,
70
+ buttonIcon)));
71
+ });
72
+ var ButtonIcon = function (_a) {
73
+ var icon = _a.icon, isChevron = _a.isChevron, isBeforeText = _a.isBeforeText;
74
+ return (React__default["default"].createElement("span", { className: index$1.classNames({
75
+ "arc-Button-icon": true,
76
+ "arc-Button-icon--chevron": isChevron
77
+ }) }, isChevron ? (React__default["default"].createElement(Icon.Icon, { icon: isBeforeText ? BtIconChevronLeftMid_2 : BtIconChevronRightMid.BtIconChevronRightMid_2 })) : (React__default["default"].createElement(Icon.Icon, { icon: icon }))));
78
+ };
79
+
80
+ exports.Button = Button;
@@ -1,5 +1,5 @@
1
1
  import { FC } from "react";
2
- import { backgroundsBT } from "../Surface/index";
2
+ import { backgroundsBT } from "../../Surface/Surface.cjs";
3
3
  /**
4
4
  * Use `Curve` sparingly to soften edges and create a more natural, less rigid
5
5
  * look and feel.
@@ -0,0 +1,30 @@
1
+ 'use strict';
2
+
3
+ var index = require('./index-78b35bc1.js');
4
+ var index$1 = require('./index-45bfb67b.js');
5
+ var React = require('react');
6
+ var suffixModifier = require('./suffix-modifier-edf7851e.js');
7
+
8
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
9
+
10
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
11
+
12
+ /**
13
+ * Use `Curve` sparingly to soften edges and create a more natural, less rigid
14
+ * look and feel.
15
+ */
16
+ var Curve = function (_a) {
17
+ var _b;
18
+ var bottomColor = _a.bottomColor, _c = _a.from, from = _c === void 0 ? "top" : _c, _d = _a.isInverted, isInverted = _d === void 0 ? false : _d, _e = _a.size, size = _e === void 0 ? "m" : _e, topColor = _a.topColor, props = index.__rest(_a, ["bottomColor", "from", "isInverted", "size", "topColor"]);
19
+ return (React__default["default"].createElement("div", index.__assign({ className: index$1.classNames((_b = {
20
+ "arc-Curve": true
21
+ },
22
+ _b[suffixModifier.suffixModifier("arc-Curve--from", from)] = from && from !== "top",
23
+ _b["arc-Curve--size".concat(size && size.toUpperCase())] = size && size !== "m",
24
+ _b[suffixModifier.suffixModifier("arc-Curve--bottomColor", bottomColor || "")] = bottomColor,
25
+ _b[suffixModifier.suffixModifier("arc-Curve--topColor", topColor || "")] = topColor,
26
+ _b["arc-Curve--inverted"] = isInverted,
27
+ _b)) }, index.filterDataAttrs(props))));
28
+ };
29
+
30
+ exports.Curve = Curve;
@@ -0,0 +1,115 @@
1
+ 'use strict';
2
+
3
+ var index = require('./index-78b35bc1.js');
4
+ var index$1 = require('./index-45bfb67b.js');
5
+ var React$1 = require('react');
6
+ var Surface = require('./Surface-d6b8010e.js');
7
+
8
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
9
+
10
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React$1);
11
+
12
+ /**
13
+ * Optionally define ariaDescribedBy if errorMessage or helper exist.
14
+ */
15
+ var useAriaDescribedby = function (_a) {
16
+ var id = _a.id, _b = _a.idError, idError = _b === void 0 ? "".concat(id, "-error") : _b, _c = _a.idHelper, idHelper = _c === void 0 ? "".concat(id, "-helper") : _c, errorMessage = _a.errorMessage, helper = _a.helper;
17
+ if (!id) {
18
+ return {
19
+ ariaDescribedby: undefined,
20
+ idHelper: undefined,
21
+ idError: undefined
22
+ };
23
+ }
24
+ var ariaDescribedbyArr = [];
25
+ if (errorMessage) {
26
+ ariaDescribedbyArr.push(idError);
27
+ }
28
+ if (helper) {
29
+ ariaDescribedbyArr.push(idHelper);
30
+ }
31
+ var ariaDescribedby = ariaDescribedbyArr.length > 0 ? ariaDescribedbyArr.join(" ") : undefined;
32
+ return { ariaDescribedby: ariaDescribedby, idError: idError, idHelper: idHelper };
33
+ };
34
+
35
+ const React = React__default["default"];
36
+ const BtIconAlert = props =>
37
+ /*#__PURE__*/ React.createElement(
38
+ "svg",
39
+ Object.assign(
40
+ {
41
+ xmlns: "http://www.w3.org/2000/svg",
42
+ viewBox: "0 0 32 32"
43
+ },
44
+ props
45
+ ),
46
+ /*#__PURE__*/ React.createElement("defs", null),
47
+ /*#__PURE__*/ React.createElement("path", {
48
+ d:
49
+ "M16,2A14,14,0,1,0,30,16,14,14,0,0,0,16,2Zm0,27A13,13,0,1,1,29,16,13.01474,13.01474,0,0,1,16,29Z",
50
+ fill: "currentColor"
51
+ }),
52
+ /*#__PURE__*/ React.createElement("path", {
53
+ fill: "currentColor",
54
+ d: "M16 20.99335A1 1 0 1 0 16 22.99335 1 1 0 1 0 16 20.99335z"
55
+ }),
56
+ /*#__PURE__*/ React.createElement("path", {
57
+ d:
58
+ "M16.00488,19.00977a.49972.49972,0,0,0,.5-.5L16.50684,9.5a.5.5,0,0,0-1,0l-.002,9.00977A.5.5,0,0,0,16.00488,19.00977Z",
59
+ fill: "currentColor"
60
+ })
61
+ );
62
+ var BtIconAlert_2 = BtIconAlert;
63
+
64
+ var defaultContext = {
65
+ requirementStatus: null
66
+ };
67
+ var Context = React$1.createContext(defaultContext);
68
+ var Provider = Context.Provider;
69
+ /**
70
+ * Use `FormControl` to provide inputs with labels, helper text and error messages
71
+ */
72
+ var FormControl = function (_a) {
73
+ var children = _a.children, _b = _a.elementType, ElementType = _b === void 0 ? "div" : _b, errorMessage = _a.errorMessage, helper = _a.helper, htmlFor = _a.htmlFor, id = _a.id, label = _a.label, _c = _a.labelSize, labelSize = _c === void 0 ? "l" : _c, _d = _a.requirementStatus, requirementStatus = _d === void 0 ? "optional" : _d, props = index.__rest(_a, ["children", "elementType", "errorMessage", "helper", "htmlFor", "id", "label", "labelSize", "requirementStatus"]);
74
+ var surface = React$1.useContext(Surface.Context).surface;
75
+ var _e = useAriaDescribedby({
76
+ errorMessage: errorMessage,
77
+ helper: helper,
78
+ id: htmlFor || id // `htmlFor` is preference to keep this deterministic with TextInput
79
+ }), ariaDescribedby = _e.ariaDescribedby, idError = _e.idError, idHelper = _e.idHelper;
80
+ var LabelType = ElementType === "div" ? "label" : "legend";
81
+ var elementProps = {};
82
+ var labelProps = {};
83
+ if (LabelType === "label") {
84
+ labelProps["htmlFor"] = htmlFor;
85
+ if (htmlFor) {
86
+ labelProps["id"] = "".concat(htmlFor, "-label");
87
+ }
88
+ else if (id) {
89
+ labelProps["id"] = "".concat(id, "-label");
90
+ }
91
+ }
92
+ else {
93
+ elementProps["aria-describedby"] = ariaDescribedby;
94
+ }
95
+ return (React__default["default"].createElement(Provider, { value: { requirementStatus: requirementStatus } },
96
+ React__default["default"].createElement(ElementType, index.__assign({ className: index$1.classNames({
97
+ "arc-FormControl": true,
98
+ "arc-FormControl--smallLabel": labelSize === "s",
99
+ "arc-FormControl--onDarkSurface": surface === "dark"
100
+ }), id: id }, elementProps, index.filterDataAttrs(props)),
101
+ React__default["default"].createElement(LabelType, index.__assign({ className: "arc-FormControl-label" }, labelProps),
102
+ label,
103
+ requirementStatus === "optional" && (React__default["default"].createElement("span", { className: "arc-FormControl-labelOptional" }, "(optional)"))),
104
+ helper && (React__default["default"].createElement("div", { className: "arc-FormControl-helper", id: idHelper }, helper)),
105
+ children,
106
+ errorMessage && (React__default["default"].createElement("div", { className: "arc-FormControl-error", id: idError },
107
+ React__default["default"].createElement("span", { className: "arc-FormControl-error--icon" },
108
+ React__default["default"].createElement(BtIconAlert_2, null)),
109
+ errorMessage)))));
110
+ };
111
+
112
+ exports.BtIconAlert_2 = BtIconAlert_2;
113
+ exports.Context = Context;
114
+ exports.FormControl = FormControl;
115
+ exports.useAriaDescribedby = useAriaDescribedby;