@arc-ui/components 11.0.0 → 11.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/dist/Align/Align.esm.js +4 -4
  2. package/dist/Badge/Badge.cjs.d.ts +26 -0
  3. package/dist/Badge/Badge.cjs.js +37 -0
  4. package/dist/Badge/Badge.esm.d.ts +26 -0
  5. package/dist/Badge/Badge.esm.js +29 -0
  6. package/dist/Badge/package.json +7 -0
  7. package/dist/Base/Base.cjs.d.ts +1 -16
  8. package/dist/Base/Base.cjs.js +4 -16
  9. package/dist/Base/Base.esm.d.ts +1 -16
  10. package/dist/Base/Base.esm.js +3 -15
  11. package/dist/BrandLogo/BrandLogo.esm.d.ts +1 -1
  12. package/dist/BrandLogo/BrandLogo.esm.js +2 -2
  13. package/dist/Breadcrumbs/Breadcrumbs.esm.js +27 -27
  14. package/dist/Button/Button.esm.d.ts +1 -1
  15. package/dist/Button/Button.esm.js +4 -4
  16. package/dist/Card/Card.esm.js +27 -27
  17. package/dist/Checkbox/Checkbox.cjs.js +4 -1
  18. package/dist/Checkbox/Checkbox.esm.js +18 -15
  19. package/dist/Clock/Clock.esm.js +3 -3
  20. package/dist/Columns/Columns.esm.js +5 -5
  21. package/dist/Curve/Curve.esm.d.ts +1 -1
  22. package/dist/Curve/Curve.esm.js +1 -1
  23. package/dist/Disclosure/Disclosure.esm.d.ts +1 -1
  24. package/dist/Disclosure/Disclosure.esm.js +10 -10
  25. package/dist/Elevation/Elevation.esm.js +2 -2
  26. package/dist/FormControl/FormControl.cjs.d.ts +1 -1
  27. package/dist/FormControl/FormControl.cjs.js +4 -1
  28. package/dist/FormControl/FormControl.esm.d.ts +1 -1
  29. package/dist/FormControl/FormControl.esm.js +5 -2
  30. package/dist/Group/Group.esm.js +6 -6
  31. package/dist/Heading/Heading.esm.d.ts +1 -1
  32. package/dist/Heading/Heading.esm.js +2 -2
  33. package/dist/Icon/Icon.esm.d.ts +1 -1
  34. package/dist/Icon/Icon.esm.js +2 -2
  35. package/dist/Image/Image.esm.d.ts +1 -1
  36. package/dist/Image/Image.esm.js +1 -1
  37. package/dist/Markup/Markup.esm.js +3 -3
  38. package/dist/Poster/Poster.esm.d.ts +1 -1
  39. package/dist/Poster/Poster.esm.js +9 -9
  40. package/dist/RadioGroup/RadioGroup.cjs.d.ts +1 -1
  41. package/dist/RadioGroup/RadioGroup.cjs.js +4 -1
  42. package/dist/RadioGroup/RadioGroup.esm.d.ts +1 -1
  43. package/dist/RadioGroup/RadioGroup.esm.js +15 -12
  44. package/dist/Rule/Rule.esm.js +3 -3
  45. package/dist/Section/Section.esm.d.ts +1 -1
  46. package/dist/Section/Section.esm.js +1 -1
  47. package/dist/Select/Select.cjs.d.ts +25 -0
  48. package/dist/Select/Select.cjs.js +3010 -0
  49. package/dist/Select/Select.esm.d.ts +25 -0
  50. package/dist/Select/Select.esm.js +2983 -0
  51. package/dist/Select/package.json +7 -0
  52. package/dist/SiteFooter/SiteFooter.esm.js +33 -33
  53. package/dist/SiteHeader/SiteHeader.esm.d.ts +1 -1
  54. package/dist/SiteHeader/SiteHeader.esm.js +98 -98
  55. package/dist/Surface/Surface.esm.d.ts +1 -1
  56. package/dist/Surface/Surface.esm.js +1 -1
  57. package/dist/Text/Text.esm.d.ts +1 -1
  58. package/dist/Text/Text.esm.js +2 -2
  59. package/dist/TextInput/TextInput.cjs.d.ts +5 -1
  60. package/dist/TextInput/TextInput.cjs.js +25 -6
  61. package/dist/TextInput/TextInput.esm.d.ts +5 -1
  62. package/dist/TextInput/TextInput.esm.js +28 -9
  63. package/dist/Truncate/Truncate.cjs.d.ts +18 -0
  64. package/dist/Truncate/Truncate.cjs.js +17 -0
  65. package/dist/Truncate/Truncate.esm.d.ts +18 -0
  66. package/dist/Truncate/Truncate.esm.js +9 -0
  67. package/dist/Truncate/package.json +7 -0
  68. package/dist/UniversalHeader/UniversalHeader.esm.js +8 -8
  69. package/dist/VerticalSpace/VerticalSpace.esm.js +2 -2
  70. package/dist/VisuallyHidden/VisuallyHidden.cjs.d.ts +1 -12
  71. package/dist/VisuallyHidden/VisuallyHidden.cjs.js +3 -12
  72. package/dist/VisuallyHidden/VisuallyHidden.esm.d.ts +1 -12
  73. package/dist/VisuallyHidden/VisuallyHidden.esm.js +2 -11
  74. package/dist/_shared/cjs/Base-e2b846fe.d.ts +19 -0
  75. package/dist/_shared/cjs/Base-e2b846fe.js +22 -0
  76. package/dist/_shared/cjs/{FormControl-a1b7421b.d.ts → FormControl-e6b7d7c5.d.ts} +51 -3
  77. package/dist/_shared/cjs/{FormControl-a1b7421b.js → FormControl-e6b7d7c5.js} +40 -8
  78. package/dist/_shared/cjs/VisuallyHidden-e2c8b291.d.ts +12 -0
  79. package/dist/_shared/cjs/VisuallyHidden-e2c8b291.js +17 -0
  80. package/dist/_shared/cjs/index-c81c9401.d.ts +1 -1
  81. package/dist/_shared/esm/Base-c235dc45.d.ts +19 -0
  82. package/dist/_shared/esm/Base-c235dc45.js +15 -0
  83. package/dist/_shared/esm/{BrandLogo-ea3dd0e6.js → BrandLogo-4f13fe85.js} +4 -4
  84. package/dist/_shared/esm/{BtIconChevronDown2Px-4abd079b.js → BtIconChevronDown2Px-782876e2.js} +2 -2
  85. package/dist/_shared/esm/{BtIconChevronRight2Px-a5cc1d05.js → BtIconChevronRight2Px-b8e7b4ad.js} +3 -3
  86. package/dist/_shared/esm/{BtIconChevronRightMid-386cf272.js → BtIconChevronRightMid-d9b11761.js} +2 -2
  87. package/dist/_shared/esm/{Button-5ff56a7b.js → Button-69439f8f.js} +15 -15
  88. package/dist/_shared/esm/{Curve-cfdca379.js → Curve-50697f7e.js} +2 -2
  89. package/dist/_shared/esm/{FormControl-feedc495.d.ts → FormControl-84c9ace6.d.ts} +51 -3
  90. package/dist/_shared/esm/FormControl-84c9ace6.js +138 -0
  91. package/dist/_shared/esm/{Heading-183be76c.js → Heading-eb1e42db.js} +4 -4
  92. package/dist/_shared/esm/{Icon-76d0d8c0.js → Icon-61f7237a.js} +5 -5
  93. package/dist/_shared/esm/{Image-7e4948f6.js → Image-c0f3d42f.js} +7 -7
  94. package/dist/_shared/esm/{Section-f1256c87.js → Section-7bc71e26.js} +2 -2
  95. package/dist/_shared/esm/{Surface-d515d212.js → Surface-bf201530.js} +3 -3
  96. package/dist/_shared/esm/{Text-d8988620.js → Text-6b958ad8.js} +3 -3
  97. package/dist/_shared/esm/VisuallyHidden-b9eebf71.d.ts +12 -0
  98. package/dist/_shared/esm/VisuallyHidden-b9eebf71.js +11 -0
  99. package/dist/_shared/esm/index-c81c9401.d.ts +1 -1
  100. package/dist/index.es.js +34424 -522
  101. package/dist/index.es.js.map +1 -1
  102. package/dist/index.js +34329 -406
  103. package/dist/index.js.map +1 -1
  104. package/dist/styles.css +1 -1
  105. package/dist/types/components/Badge/Badge.d.ts +25 -0
  106. package/dist/types/components/Badge/index.d.ts +1 -0
  107. package/dist/types/components/FormControl/FormControl.d.ts +17 -0
  108. package/dist/types/components/FormControl/FormControlDisclosure/FormControlDisclosure.d.ts +28 -0
  109. package/dist/types/components/FormControl/FormControlDisclosure/index.d.ts +1 -0
  110. package/dist/types/components/Select/Select.d.ts +2 -1
  111. package/dist/types/components/TextInput/TextInput.d.ts +4 -0
  112. package/dist/types/components/Truncate/Truncate.d.ts +17 -0
  113. package/dist/types/components/Truncate/index.d.ts +1 -0
  114. package/dist/types/components/index.d.ts +3 -0
  115. package/dist/types/hooks/use-aria-describedby.d.ts +5 -1
  116. package/dist/types/styles.d.ts +4 -0
  117. package/package.json +4 -4
  118. package/dist/_shared/esm/FormControl-feedc495.js +0 -106
  119. /package/dist/_shared/esm/{BrandLogo-ea3dd0e6.d.ts → BrandLogo-4f13fe85.d.ts} +0 -0
  120. /package/dist/_shared/esm/{Button-5ff56a7b.d.ts → Button-69439f8f.d.ts} +0 -0
  121. /package/dist/_shared/esm/{Curve-cfdca379.d.ts → Curve-50697f7e.d.ts} +0 -0
  122. /package/dist/_shared/esm/{Heading-183be76c.d.ts → Heading-eb1e42db.d.ts} +0 -0
  123. /package/dist/_shared/esm/{Icon-76d0d8c0.d.ts → Icon-61f7237a.d.ts} +0 -0
  124. /package/dist/_shared/esm/{Image-7e4948f6.d.ts → Image-c0f3d42f.d.ts} +0 -0
  125. /package/dist/_shared/esm/{Section-f1256c87.d.ts → Section-7bc71e26.d.ts} +0 -0
  126. /package/dist/_shared/esm/{Surface-d515d212.d.ts → Surface-bf201530.d.ts} +0 -0
  127. /package/dist/_shared/esm/{Text-d8988620.d.ts → Text-6b958ad8.d.ts} +0 -0
@@ -0,0 +1,19 @@
1
+ /// <reference types="react" />
2
+ import React from "react";
3
+ import { FC } from "react";
4
+ declare const ArcRootElementContext: React.Context<HTMLElement | null>;
5
+ /**
6
+ * Use `Base` as the root component of the arc system.
7
+ */
8
+ declare const Base: FC<BaseProps>;
9
+ interface BaseProps {
10
+ /**
11
+ * Brand theme to apply to Base.
12
+ */
13
+ brand?: "bt" | null;
14
+ /**
15
+ * Content to display inside Base.
16
+ */
17
+ children: any;
18
+ }
19
+ export { ArcRootElementContext, Base, BaseProps };
@@ -0,0 +1,15 @@
1
+ import { _ as __rest, a as __assign, f as filterDataAttrs } from './index-229fc864.js';
2
+ import React__default, { createContext } from 'react';
3
+
4
+ var ArcRootElementContext = createContext(null);
5
+ /**
6
+ * Use `Base` as the root component of the arc system.
7
+ */
8
+ var Base = function (_a) {
9
+ var _b = _a.brand, brand = _b === void 0 ? "bt" : _b, children = _a.children, props = __rest(_a, ["brand", "children"]);
10
+ var _c = React__default.useState(null), arcRoot = _c[0], setArcRoot = _c[1];
11
+ return (React__default.createElement("div", __assign({ id: "arc-root", ref: setArcRoot, className: "arc".concat(brand ? " arc-".concat(brand) : "") }, filterDataAttrs(props)),
12
+ React__default.createElement(ArcRootElementContext.Provider, { value: arcRoot }, children)));
13
+ };
14
+
15
+ export { ArcRootElementContext as A, Base as B };
@@ -1,8 +1,8 @@
1
1
  import { _ as __rest, a as __assign, f as filterDataAttrs } from './index-229fc864.js';
2
2
  import { c as classNames } from './index-2ae58626.js';
3
- import React, { useContext } from 'react';
3
+ import React__default, { useContext } from 'react';
4
4
  import { s as suffixModifier } from './suffix-modifier-f5e28822.js';
5
- import { C as Context } from './Surface-d515d212.js';
5
+ import { C as Context } from './Surface-bf201530.js';
6
6
 
7
7
  /**
8
8
  * Use `BrandLogo` to display the brand logo.
@@ -11,7 +11,7 @@ var BrandLogo = function (_a) {
11
11
  var _b;
12
12
  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 = __rest(_a, ["color", "label", "size", "subBrand"]);
13
13
  var surface = useContext(Context).surface;
14
- return (React.createElement("div", __assign({ className: classNames((_b = {
14
+ return (React__default.createElement("div", __assign({ className: classNames((_b = {
15
15
  "arc-BrandLogo": true,
16
16
  "arc-BrandLogo--colorBrand": color === "brand",
17
17
  "arc-BrandLogo--onDarkSurface": surface === "dark"
@@ -19,7 +19,7 @@ var BrandLogo = function (_a) {
19
19
  _b[suffixModifier("arc-BrandLogo--subBrand", subBrand || "")] = subBrand,
20
20
  _b)), style: {
21
21
  width: size !== 34 ? size : undefined
22
- } }, filterDataAttrs(props)), label ? React.createElement("span", { className: "arc-BrandLogo-text" }, label) : null));
22
+ } }, filterDataAttrs(props)), label ? React__default.createElement("span", { className: "arc-BrandLogo-text" }, label) : null));
23
23
  };
24
24
 
25
25
  export { BrandLogo as B };
@@ -1,6 +1,6 @@
1
- import React$1 from 'react';
1
+ import React__default from 'react';
2
2
 
3
- const React = React$1;
3
+ const React = React__default;
4
4
  const BtIconChevronDown2Px = props =>
5
5
  /*#__PURE__*/ React.createElement(
6
6
  "svg",
@@ -1,6 +1,6 @@
1
- import React$2 from 'react';
1
+ import React__default from 'react';
2
2
 
3
- const React$1 = React$2;
3
+ const React$1 = React__default;
4
4
  const BtIconChevronLeft2Px = props =>
5
5
  /*#__PURE__*/ React$1.createElement(
6
6
  "svg",
@@ -20,7 +20,7 @@ const BtIconChevronLeft2Px = props =>
20
20
  );
21
21
  var BtIconChevronLeft2Px_2 = BtIconChevronLeft2Px;
22
22
 
23
- const React = React$2;
23
+ const React = React__default;
24
24
  const BtIconChevronRight2Px = props =>
25
25
  /*#__PURE__*/ React.createElement(
26
26
  "svg",
@@ -1,6 +1,6 @@
1
- import React$1 from 'react';
1
+ import React__default from 'react';
2
2
 
3
- const React = React$1;
3
+ const React = React__default;
4
4
  const BtIconChevronRightMid = props =>
5
5
  /*#__PURE__*/ React.createElement(
6
6
  "svg",
@@ -1,12 +1,12 @@
1
1
  import { _ as __rest, a as __assign, f as filterDataAttrs } from './index-229fc864.js';
2
- import React$1, { forwardRef, useContext } from 'react';
3
- import { B as BtIconChevronRightMid_2 } from './BtIconChevronRightMid-386cf272.js';
2
+ import React__default, { forwardRef, useContext } from 'react';
3
+ import { B as BtIconChevronRightMid_2 } from './BtIconChevronRightMid-d9b11761.js';
4
4
  import { c as classNames } from './index-2ae58626.js';
5
5
  import { s as suffixModifier } from './suffix-modifier-f5e28822.js';
6
- import { I as Icon } from './Icon-76d0d8c0.js';
7
- import { C as Context } from './Surface-d515d212.js';
6
+ import { I as Icon } from './Icon-61f7237a.js';
7
+ import { C as Context } from './Surface-bf201530.js';
8
8
 
9
- const React = React$1;
9
+ const React = React__default;
10
10
  const BtIconChevronLeftMid = props =>
11
11
  /*#__PURE__*/ React.createElement(
12
12
  "svg",
@@ -48,27 +48,27 @@ var Button = forwardRef(function (_a, ref) {
48
48
  _b["arc-Button--onDarkSurface"] = surface === "dark",
49
49
  _b));
50
50
  var commonProps = __assign({ id: id, onClick: onClick, ref: ref }, filterDataAttrs(props));
51
- var buttonText = supportingText ? (React$1.createElement("span", null,
52
- React$1.createElement("span", { className: "arc-Button-text" }, label),
53
- React$1.createElement("span", { className: "arc-Button-supportingText" }, supportingText))) : (React$1.createElement("span", { className: "arc-Button-text" }, label));
54
- var buttonIcon = icon || fill === "flat" ? (React$1.createElement(ButtonIcon, { icon: icon, isChevron: !icon && fill === "flat", isBeforeText: iconPosition === "beforeText" })) : null;
51
+ var buttonText = supportingText ? (React__default.createElement("span", null,
52
+ React__default.createElement("span", { className: "arc-Button-text" }, label),
53
+ React__default.createElement("span", { className: "arc-Button-supportingText" }, supportingText))) : (React__default.createElement("span", { className: "arc-Button-text" }, label));
54
+ var buttonIcon = icon || fill === "flat" ? (React__default.createElement(ButtonIcon, { icon: icon, isChevron: !icon && fill === "flat", isBeforeText: iconPosition === "beforeText" })) : null;
55
55
  if (href && !isDisabled) {
56
- return (React$1.createElement("a", __assign({}, commonProps, { "aria-label": ariaLabel, className: buttonClasses, href: href, rel: rel, target: target }),
57
- React$1.createElement("span", { className: "arc-Button-inner" },
56
+ return (React__default.createElement("a", __assign({}, commonProps, { "aria-label": ariaLabel, className: buttonClasses, href: href, rel: rel, target: target }),
57
+ React__default.createElement("span", { className: "arc-Button-inner" },
58
58
  buttonText,
59
59
  buttonIcon)));
60
60
  }
61
- return (React$1.createElement("button", __assign({}, commonProps, { "aria-label": ariaLabel, className: buttonClasses, disabled: isDisabled, type: type }),
62
- React$1.createElement("span", { className: "arc-Button-inner" },
61
+ return (React__default.createElement("button", __assign({}, commonProps, { "aria-label": ariaLabel, className: buttonClasses, disabled: isDisabled, type: type }),
62
+ React__default.createElement("span", { className: "arc-Button-inner" },
63
63
  buttonText,
64
64
  buttonIcon)));
65
65
  });
66
66
  var ButtonIcon = function (_a) {
67
67
  var icon = _a.icon, isChevron = _a.isChevron, isBeforeText = _a.isBeforeText;
68
- return (React$1.createElement("span", { className: classNames({
68
+ return (React__default.createElement("span", { className: classNames({
69
69
  "arc-Button-icon": true,
70
70
  "arc-Button-icon--chevron": isChevron
71
- }) }, isChevron ? (React$1.createElement(Icon, { icon: isBeforeText ? BtIconChevronLeftMid_2 : BtIconChevronRightMid_2 })) : (React$1.createElement(Icon, { icon: icon }))));
71
+ }) }, isChevron ? (React__default.createElement(Icon, { icon: isBeforeText ? BtIconChevronLeftMid_2 : BtIconChevronRightMid_2 })) : (React__default.createElement(Icon, { icon: icon }))));
72
72
  };
73
73
 
74
74
  export { Button as B };
@@ -1,6 +1,6 @@
1
1
  import { _ as __rest, a as __assign, f as filterDataAttrs } from './index-229fc864.js';
2
2
  import { c as classNames } from './index-2ae58626.js';
3
- import React from 'react';
3
+ import React__default from 'react';
4
4
  import { s as suffixModifier } from './suffix-modifier-f5e28822.js';
5
5
 
6
6
  /**
@@ -10,7 +10,7 @@ import { s as suffixModifier } from './suffix-modifier-f5e28822.js';
10
10
  var Curve = function (_a) {
11
11
  var _b;
12
12
  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 = __rest(_a, ["bottomColor", "from", "isInverted", "size", "topColor"]);
13
- return (React.createElement("div", __assign({ className: classNames((_b = {
13
+ return (React__default.createElement("div", __assign({ className: classNames((_b = {
14
14
  "arc-Curve": true
15
15
  },
16
16
  _b[suffixModifier("arc-Curve--from", from)] = from && from !== "top",
@@ -1,23 +1,54 @@
1
1
  /// <reference types="react" />
2
2
  import React from "react";
3
- import { FC } from "react";
3
+ import { FC, ReactNode } from "react";
4
+ /**
5
+ * Use `FormControlDisclosure` to display content that is only visible when toggled into
6
+ * an "open" state.
7
+ */
8
+ declare const FormControlDisclosure: FC<FormControlDisclosureProps>;
9
+ interface FormControlDisclosureProps {
10
+ /**
11
+ * Content to display in the FormControlDisclosure.
12
+ */
13
+ children: ReactNode;
14
+ /**
15
+ * FormControlDisclosure ID.
16
+ */
17
+ id?: string;
18
+ /**
19
+ * The FormControlDisclosure summary text.
20
+ */
21
+ summary: string;
22
+ /**
23
+ * On Click handler for FormControlDisclosure summary disclosure.
24
+ */
25
+ onClick?: () => void;
26
+ /**
27
+ * Disclosure size.
28
+ */
29
+ size?: "s" | "l";
30
+ }
4
31
  /**
5
32
  * Optionally define ariaDescribedBy if errorMessage or helper exist.
6
33
  */
7
- declare const useAriaDescribedby: ({ id, idError, idHelper, errorMessage, helper }: {
34
+ declare const useAriaDescribedby: ({ id, idError, idHelper, idDisclosure, errorMessage, helper, disclosureText }: {
8
35
  id?: string | undefined;
9
36
  idError?: string | undefined;
37
+ idDisclosure?: string | undefined;
10
38
  idHelper?: string | undefined;
11
39
  errorMessage?: any;
12
40
  helper?: any;
41
+ disclosureText?: string | undefined;
13
42
  }) => {
14
43
  ariaDescribedby: undefined;
15
44
  idHelper: undefined;
16
45
  idError: undefined;
46
+ idDisclosure: undefined;
17
47
  } | {
18
48
  ariaDescribedby: string | undefined;
19
49
  idError: string;
20
50
  idHelper: string;
51
+ idDisclosure: string;
21
52
  };
22
53
  type RequirementStatus = "required" | "optional" | "not-applicable";
23
54
  declare const Context: React.Context<{
@@ -62,9 +93,26 @@ interface FormControlProps {
62
93
  * Label for the FormControl.
63
94
  */
64
95
  label: string;
96
+ /**
97
+ * Determins if the Label should be in a disabled state
98
+ */
99
+ isDisabled?: boolean;
65
100
  /**
66
101
  * Label size.
67
102
  */
68
103
  labelSize?: "s" | "l";
104
+ /**
105
+ * Use `DisclosureTitle` to display content that is only visible when toggled into
106
+ * an "open" state. This overrides helper text.
107
+ */
108
+ disclosureTitle?: string;
109
+ /**
110
+ * Text to display within the disclosure
111
+ */
112
+ disclosureText?: string;
113
+ /**
114
+ * onClick handler for FormControlDisclosure
115
+ */
116
+ onClickDisclosure?: () => void;
69
117
  }
70
- export { useAriaDescribedby, FormControl, FormControlProps, Context as FormControlContext };
118
+ export { FormControlDisclosure, FormControlDisclosureProps, useAriaDescribedby, FormControl, FormControlProps, Context as FormControlContext };
@@ -0,0 +1,138 @@
1
+ import { _ as __rest, a as __assign, f as filterDataAttrs } from './index-229fc864.js';
2
+ import { c as classNames } from './index-2ae58626.js';
3
+ import React__default, { useContext, useState, createContext } from 'react';
4
+ import { C as Context$1 } from './Surface-bf201530.js';
5
+ import { T as Text } from './Text-6b958ad8.js';
6
+ import { B as BtIconChevronRightMid_2 } from './BtIconChevronRightMid-d9b11761.js';
7
+
8
+ /**
9
+ * Optionally define ariaDescribedBy if errorMessage or helper exist.
10
+ */
11
+ var useAriaDescribedby = function (_a) {
12
+ 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, _d = _a.idDisclosure, idDisclosure = _d === void 0 ? "".concat(id, "-disclosure") : _d, errorMessage = _a.errorMessage, helper = _a.helper, disclosureText = _a.disclosureText;
13
+ if (!id) {
14
+ return {
15
+ ariaDescribedby: undefined,
16
+ idHelper: undefined,
17
+ idError: undefined,
18
+ idDisclosure: undefined
19
+ };
20
+ }
21
+ var ariaDescribedbyArr = [];
22
+ if (errorMessage) {
23
+ ariaDescribedbyArr.push(idError);
24
+ }
25
+ if (helper) {
26
+ ariaDescribedbyArr.push(idHelper);
27
+ }
28
+ if (disclosureText) {
29
+ ariaDescribedbyArr.push(idDisclosure);
30
+ }
31
+ var ariaDescribedby = ariaDescribedbyArr.length > 0 ? ariaDescribedbyArr.join(" ") : undefined;
32
+ return { ariaDescribedby: ariaDescribedby, idError: idError, idHelper: idHelper, idDisclosure: idDisclosure };
33
+ };
34
+
35
+ const React = React__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
+ /**
65
+ * Use `FormControlDisclosure` to display content that is only visible when toggled into
66
+ * an "open" state.
67
+ */
68
+ var FormControlDisclosure = function (_a) {
69
+ var children = _a.children, summary = _a.summary, onClick = _a.onClick, _b = _a.size, size = _b === void 0 ? "l" : _b, id = _a.id, props = __rest(_a, ["children", "summary", "onClick", "size", "id"]);
70
+ var surface = useContext(Context$1).surface;
71
+ var _c = useState(false), disclousreState = _c[0], setDisclosureState = _c[1];
72
+ var handleOnClick = function () {
73
+ onClick && onClick();
74
+ setDisclosureState(function (prevState) { return !prevState; });
75
+ };
76
+ return (React__default.createElement("details", __assign({ className: classNames({
77
+ "arc-FormControlDisclosure": true,
78
+ "arc-FormControlDisclosure--onDarkSurface": surface === "dark"
79
+ }) }, filterDataAttrs(props), { "data-testid": "FormControlDisclosure" }),
80
+ React__default.createElement("summary", { className: "arc-FormControlDisclosure-summary", onClick: handleOnClick, "aria-expanded": disclousreState },
81
+ React__default.createElement("span", { className: "arc-FormControlDisclosure-summary-icon" },
82
+ React__default.createElement(BtIconChevronRightMid_2, null)),
83
+ React__default.createElement(Text, { size: size === "l" ? "m" : "s" }, summary)),
84
+ React__default.createElement("div", { className: "arc-FormControlDisclosure-details" },
85
+ React__default.createElement(Text, { size: size === "l" ? "m" : "s" },
86
+ React__default.createElement("span", { id: id }, children)))));
87
+ };
88
+
89
+ var defaultContext = {
90
+ requirementStatus: null
91
+ };
92
+ var Context = createContext(defaultContext);
93
+ var Provider = Context.Provider;
94
+ /**
95
+ * Use `FormControl` to provide inputs with labels, helper text and error messages
96
+ */
97
+ var FormControl = function (_a) {
98
+ 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, isDisabled = _a.isDisabled, disclosureTitle = _a.disclosureTitle, disclosureText = _a.disclosureText, onClickDisclosure = _a.onClickDisclosure, props = __rest(_a, ["children", "elementType", "errorMessage", "helper", "htmlFor", "id", "label", "labelSize", "requirementStatus", "isDisabled", "disclosureTitle", "disclosureText", "onClickDisclosure"]);
99
+ var surface = useContext(Context$1).surface;
100
+ var _e = useAriaDescribedby({
101
+ disclosureText: disclosureText,
102
+ errorMessage: errorMessage,
103
+ helper: helper,
104
+ id: htmlFor || id // `htmlFor` is preference to keep this deterministic with TextInput
105
+ }), ariaDescribedby = _e.ariaDescribedby, idError = _e.idError, idHelper = _e.idHelper, idDisclosure = _e.idDisclosure;
106
+ var LabelType = ElementType === "div" ? "label" : "legend";
107
+ var elementProps = {};
108
+ var labelProps = {};
109
+ if (LabelType === "label") {
110
+ labelProps["htmlFor"] = htmlFor;
111
+ if (htmlFor) {
112
+ labelProps["id"] = "".concat(htmlFor, "-label");
113
+ }
114
+ else if (id) {
115
+ labelProps["id"] = "".concat(id, "-label");
116
+ }
117
+ }
118
+ else {
119
+ elementProps["aria-describedby"] = ariaDescribedby;
120
+ }
121
+ return (React__default.createElement(Provider, { value: { requirementStatus: requirementStatus } },
122
+ React__default.createElement(ElementType, __assign({ className: classNames({
123
+ "arc-FormControl": true,
124
+ "arc-FormControl--isDisabled": isDisabled,
125
+ "arc-FormControl--smallLabel": labelSize === "s",
126
+ "arc-FormControl--onDarkSurface": surface === "dark"
127
+ }), id: id }, elementProps, filterDataAttrs(props)),
128
+ React__default.createElement(LabelType, __assign({ className: "arc-FormControl-label" }, labelProps),
129
+ label,
130
+ requirementStatus === "optional" && (React__default.createElement("span", { className: "arc-FormControl-labelOptional" }, "(optional)"))),
131
+ children,
132
+ errorMessage ? (React__default.createElement("div", { className: "arc-FormControl-error", id: idError },
133
+ React__default.createElement("span", { className: "arc-FormControl-error--icon" },
134
+ React__default.createElement(BtIconAlert_2, null)),
135
+ errorMessage)) : disclosureTitle ? (React__default.createElement(FormControlDisclosure, { onClick: onClickDisclosure, summary: disclosureTitle, size: labelSize, id: idDisclosure }, disclosureText)) : (helper && (React__default.createElement("div", { className: "arc-FormControl-helper", id: idHelper }, helper))))));
136
+ };
137
+
138
+ export { BtIconAlert_2 as B, Context as C, FormControl as F, useAriaDescribedby as u };
@@ -1,8 +1,8 @@
1
1
  import { _ as __rest, a as __assign, f as filterDataAttrs } from './index-229fc864.js';
2
2
  import { c as classNames } from './index-2ae58626.js';
3
- import React, { useContext } from 'react';
3
+ import React__default, { useContext } from 'react';
4
4
  import { s as suffixModifier } from './suffix-modifier-f5e28822.js';
5
- import { C as Context } from './Surface-d515d212.js';
5
+ import { C as Context } from './Surface-bf201530.js';
6
6
 
7
7
  /**
8
8
  * Use `Heading` to display heading text.
@@ -15,7 +15,7 @@ var Heading = function (_a) {
15
15
  if (level) {
16
16
  Element = "h".concat(level);
17
17
  }
18
- return (React.createElement(Element, __assign({ className: classNames((_b = {
18
+ return (React__default.createElement(Element, __assign({ className: classNames((_b = {
19
19
  "arc-Heading": true
20
20
  },
21
21
  _b[suffixModifier("arc-Heading--align", align)] = align && align !== "left",
@@ -27,7 +27,7 @@ var Heading = function (_a) {
27
27
  };
28
28
  var HeadingProposition = function (_a) {
29
29
  var children = _a.children;
30
- return React.createElement("span", { className: "arc-Heading-proposition" }, children);
30
+ return React__default.createElement("span", { className: "arc-Heading-proposition" }, children);
31
31
  };
32
32
  HeadingProposition.displayName = "Heading.Proposition";
33
33
  Heading.Proposition = HeadingProposition;
@@ -1,10 +1,10 @@
1
1
  import { _ as __rest, a as __assign, f as filterDataAttrs } from './index-229fc864.js';
2
- import React$1, { useContext } from 'react';
2
+ import React__default, { useContext } from 'react';
3
3
  import { c as classNames } from './index-2ae58626.js';
4
4
  import { s as suffixModifier } from './suffix-modifier-f5e28822.js';
5
- import { C as Context } from './Surface-d515d212.js';
5
+ import { C as Context } from './Surface-bf201530.js';
6
6
 
7
- const React = React$1;
7
+ const React = React__default;
8
8
  const ArcIconArc = props =>
9
9
  /*#__PURE__*/ React.createElement(
10
10
  "svg",
@@ -31,7 +31,7 @@ var Icon = function (_a) {
31
31
  var testId = _a.testId, _c = _a.color, color = _c === void 0 ? "auto" : _c, _d = _a.icon, icon = _d === void 0 ? ArcIconArc_2 : _d, _e = _a.isInline, isInline = _e === void 0 ? false : _e, label = _a.label, size = _a.size, props = __rest(_a, ["testId", "color", "icon", "isInline", "label", "size"]);
32
32
  var surface = useContext(Context).surface;
33
33
  var Icon = icon;
34
- return (React$1.createElement("span", __assign({ "data-testid": testId, "aria-label": label, className: classNames((_b = {},
34
+ return (React__default.createElement("span", __assign({ "data-testid": testId, "aria-label": label, className: classNames((_b = {},
35
35
  _b["arc-Icon"] = true,
36
36
  _b[suffixModifier("arc-Icon--color", color)] = color !== "auto",
37
37
  _b["arc-Icon--inline"] = isInline,
@@ -40,7 +40,7 @@ var Icon = function (_a) {
40
40
  height: size,
41
41
  width: size
42
42
  } }, filterDataAttrs(props)),
43
- React$1.createElement(Icon, null)));
43
+ React__default.createElement(Icon, null)));
44
44
  };
45
45
 
46
46
  export { Icon as I };
@@ -1,6 +1,6 @@
1
1
  import { _ as __rest, a as __assign, f as filterDataAttrs } from './index-229fc864.js';
2
2
  import { c as classNames } from './index-2ae58626.js';
3
- import React, { useEffect } from 'react';
3
+ import React__default, { useEffect } from 'react';
4
4
  import { s as suffixModifier } from './suffix-modifier-f5e28822.js';
5
5
 
6
6
  /**
@@ -11,27 +11,27 @@ var Image = function (_a) {
11
11
  var _b;
12
12
  var alt = _a.alt, _c = _a.anchor, anchor = _c === void 0 ? "C" : _c, children = _a.children, fillColor = _a.fillColor, fit = _a.fit, height = _a.height, loading = _a.loading, overlay = _a.overlay, sizes = _a.sizes, src = _a.src, srcSet = _a.srcSet, width = _a.width, props = __rest(_a, ["alt", "anchor", "children", "fillColor", "fit", "height", "loading", "overlay", "sizes", "src", "srcSet", "width"]);
13
13
  useEffect(function () {
14
- React.Children.map(children, function (item) {
14
+ React__default.Children.map(children, function (item) {
15
15
  if (item && item.type !== ImageSource) {
16
16
  throw new Error("Illegal child passed to <Image />. Ensure to only use <Image.Source />.");
17
17
  }
18
18
  });
19
19
  }, [children]);
20
- var img = (React.createElement("img", { className: "arc-Image-img", alt: alt, height: fit === "cover" ? undefined : height, loading: loading, sizes: children ? undefined : sizes, src: src, srcSet: children ? undefined : srcSet, width: fit === "cover" ? undefined : width }));
21
- return (React.createElement("div", __assign({ className: classNames((_b = {
20
+ var img = (React__default.createElement("img", { className: "arc-Image-img", alt: alt, height: fit === "cover" ? undefined : height, loading: loading, sizes: children ? undefined : sizes, src: src, srcSet: children ? undefined : srcSet, width: fit === "cover" ? undefined : width }));
21
+ return (React__default.createElement("div", __assign({ className: classNames((_b = {
22
22
  "arc-Image": true,
23
23
  "arc-Image--cover": fit === "cover"
24
24
  },
25
25
  _b["arc-Image--anchor".concat(anchor)] = fit === "cover",
26
26
  _b[suffixModifier("arc-Image--overlay", overlay || "")] = overlay,
27
- _b)), style: __assign(__assign(__assign({}, (fillColor && { backgroundColor: fillColor })), (fit === "cover" && height ? { height: "".concat(height, "px") } : null)), (fit === "cover" && width ? { width: "".concat(width, "px") } : null)) }, filterDataAttrs(props)), children ? (React.createElement("picture", null,
27
+ _b)), style: __assign(__assign(__assign({}, (fillColor && { backgroundColor: fillColor })), (fit === "cover" && height ? { height: "".concat(height, "px") } : null)), (fit === "cover" && width ? { width: "".concat(width, "px") } : null)) }, filterDataAttrs(props)), children ? (React__default.createElement("picture", null,
28
28
  children,
29
29
  " ",
30
- img)) : (React.createElement(React.Fragment, null, img))));
30
+ img)) : (React__default.createElement(React__default.Fragment, null, img))));
31
31
  };
32
32
  var ImageSource = function (_a) {
33
33
  var height = _a.height, media = _a.media, srcSet = _a.srcSet, sizes = _a.sizes, type = _a.type; _a.width; var props = __rest(_a, ["height", "media", "srcSet", "sizes", "type", "width"]);
34
- return (React.createElement("source", __assign({ height: height, media: media, sizes: sizes, srcSet: srcSet, type: type }, filterDataAttrs(props))));
34
+ return (React__default.createElement("source", __assign({ height: height, media: media, sizes: sizes, srcSet: srcSet, type: type }, filterDataAttrs(props))));
35
35
  };
36
36
  ImageSource.displayName = "Image.Source";
37
37
  Image.Source = ImageSource;
@@ -1,13 +1,13 @@
1
1
  import { _ as __rest, a as __assign, f as filterDataAttrs } from './index-229fc864.js';
2
2
  import { c as classNames } from './index-2ae58626.js';
3
- import React from 'react';
3
+ import React__default from 'react';
4
4
 
5
5
  /**
6
6
  * Use `Section` to compose content into vertical page layouts.
7
7
  */
8
8
  var Section = function (_a) {
9
9
  var children = _a.children, _b = _a.isFullWidth, isFullWidth = _b === void 0 ? false : _b, _c = _a.isDebugVisible, isDebugVisible = _c === void 0 ? false : _c, props = __rest(_a, ["children", "isFullWidth", "isDebugVisible"]);
10
- return (React.createElement("div", __assign({ className: classNames({
10
+ return (React__default.createElement("div", __assign({ className: classNames({
11
11
  "arc-Section": true,
12
12
  "arc-Section--fullWidth": isFullWidth,
13
13
  "arc-Section--debugVisible": isDebugVisible
@@ -1,6 +1,6 @@
1
1
  import { b as __spreadArray, _ as __rest, a as __assign, c as camelCase, f as filterDataAttrs } from './index-229fc864.js';
2
2
  import { c as classNames } from './index-2ae58626.js';
3
- import React, { createContext } from 'react';
3
+ import React__default, { createContext } from 'react';
4
4
 
5
5
  var defaultContext = { surface: "light" };
6
6
  var Context = createContext(defaultContext);
@@ -19,8 +19,8 @@ var Surface = function (_a) {
19
19
  background === "darker") {
20
20
  surface = "dark";
21
21
  }
22
- return (React.createElement(Provider, { value: { surface: surface } },
23
- React.createElement("div", __assign({ className: classNames((_b = {
22
+ return (React__default.createElement(Provider, { value: { surface: surface } },
23
+ React__default.createElement("div", __assign({ className: classNames((_b = {
24
24
  "arc-Surface": true
25
25
  },
26
26
  _b["arc-Surface--".concat(background &&
@@ -1,8 +1,8 @@
1
1
  import { _ as __rest, a as __assign, f as filterDataAttrs } from './index-229fc864.js';
2
2
  import { c as classNames } from './index-2ae58626.js';
3
- import React, { useContext } from 'react';
3
+ import React__default, { useContext } from 'react';
4
4
  import { s as suffixModifier } from './suffix-modifier-f5e28822.js';
5
- import { C as Context } from './Surface-d515d212.js';
5
+ import { C as Context } from './Surface-bf201530.js';
6
6
 
7
7
  /**
8
8
  * Use `Text` to display text.
@@ -11,7 +11,7 @@ var Text = function (_a) {
11
11
  var _b;
12
12
  var _c = _a.align, align = _c === void 0 ? "left" : _c, children = _a.children, _d = _a.isInline, isInline = _d === void 0 ? false : _d, _e = _a.isMeasured, isMeasured = _e === void 0 ? false : _e, _f = _a.size, size = _f === void 0 ? "m" : _f, _g = _a.tone, tone = _g === void 0 ? "default" : _g, props = __rest(_a, ["align", "children", "isInline", "isMeasured", "size", "tone"]);
13
13
  var surface = useContext(Context).surface;
14
- return (React.createElement("span", __assign({ className: classNames((_b = {
14
+ return (React__default.createElement("span", __assign({ className: classNames((_b = {
15
15
  "arc-Text": true
16
16
  },
17
17
  _b[suffixModifier("arc-Text--align", align)] = align !== "left",
@@ -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, VisuallyHiddenProps };
@@ -0,0 +1,11 @@
1
+ import React__default from 'react';
2
+
3
+ /**
4
+ * Provides text for screen readers that is visually hidden.
5
+ */
6
+ var VisuallyHidden = function (_a) {
7
+ var children = _a.children;
8
+ return (React__default.createElement("span", { "data-testid": "visually-hidden", className: "arc-VisuallyHidden" }, children));
9
+ };
10
+
11
+ export { VisuallyHidden as V };
@@ -1,4 +1,4 @@
1
- export * from "./FormControl-feedc495";
1
+ export * from "./FormControl-84c9ace6";
2
2
  export * from "../../Card/Card.esm";
3
3
  export * from "./index.es-00cb3bcb";
4
4
  export * from "../../TextInput/TextInput.esm";