@arc-ui/components 12.0.0-beta.22 → 12.0.0-beta.23

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 (203) hide show
  1. package/lib/Alert/Alert.cjs +22 -21
  2. package/lib/Alert/Alert.mjs +22 -21
  3. package/lib/Alert/styles.css +1 -1
  4. package/lib/Align/styles.css +1 -1
  5. package/lib/AppButton/styles.css +1 -1
  6. package/lib/Avatar/styles.css +1 -1
  7. package/lib/AvatarGroup/styles.css +1 -1
  8. package/lib/Badge/styles.css +1 -1
  9. package/lib/Banner/Banner.cjs +1 -1
  10. package/lib/Banner/Banner.mjs +1 -1
  11. package/lib/Box/styles.css +1 -1
  12. package/lib/BrandLogo/styles.css +1 -1
  13. package/lib/Breadcrumbs/Breadcrumbs.cjs +12 -3
  14. package/lib/Breadcrumbs/Breadcrumbs.mjs +12 -3
  15. package/lib/Breadcrumbs/styles.css +1 -1
  16. package/lib/Button/styles.css +1 -1
  17. package/lib/ButtonGroup/styles.css +1 -1
  18. package/lib/ButtonV2/styles.css +1 -1
  19. package/lib/Calendar/Calendar.cjs +2 -2
  20. package/lib/Calendar/Calendar.mjs +2 -2
  21. package/lib/Calendar/styles.css +1 -1
  22. package/lib/CardFooter/styles.css +1 -1
  23. package/lib/CardHeading/styles.css +1 -1
  24. package/lib/Carousel/Carousel.cjs +11 -5
  25. package/lib/Carousel/Carousel.mjs +8 -2
  26. package/lib/Carousel/styles.css +1 -1
  27. package/lib/Checkbox/Checkbox.cjs +85 -11
  28. package/lib/Checkbox/Checkbox.mjs +87 -9
  29. package/lib/Checkbox/styles.css +1 -1
  30. package/lib/Columns/styles.css +1 -1
  31. package/lib/ComboBox/ComboBox.cjs +276 -11
  32. package/lib/ComboBox/ComboBox.mjs +279 -10
  33. package/lib/ComboBox/styles.css +1 -1
  34. package/lib/ContentSwitcher/ContentSwitcher.cjs +5 -6
  35. package/lib/ContentSwitcher/ContentSwitcher.mjs +5 -6
  36. package/lib/ContentSwitcher/styles.css +1 -1
  37. package/lib/ContentSwitcherDropdown/styles.css +1 -1
  38. package/lib/DatePicker/DatePicker.cjs +351 -38
  39. package/lib/DatePicker/DatePicker.mjs +329 -17
  40. package/lib/DatePicker/styles.css +1 -1
  41. package/lib/Disclosure/styles.css +1 -1
  42. package/lib/DisclosureMini/styles.css +1 -1
  43. package/lib/Download/styles.css +1 -1
  44. package/lib/Drawer/styles.css +1 -1
  45. package/lib/Elevation/styles.css +1 -1
  46. package/lib/Filter/styles.css +1 -1
  47. package/lib/FormControl/styles.css +1 -1
  48. package/lib/GhostedHeroBanner/styles.css +1 -1
  49. package/lib/GradientPageBackground/GradientPageBackground.cjs +55 -43
  50. package/lib/GradientPageBackground/GradientPageBackground.mjs +55 -43
  51. package/lib/GradientPageBackground/styles.css +1 -1
  52. package/lib/Grid/styles.css +1 -1
  53. package/lib/Group/styles.css +1 -1
  54. package/lib/Heading/styles.css +1 -1
  55. package/lib/HeroBanner/HeroBanner.cjs +1 -1
  56. package/lib/HeroBanner/HeroBanner.mjs +1 -1
  57. package/lib/HeroBanner/styles.css +1 -1
  58. package/lib/HeroButton/HeroButton.cjs +77 -9
  59. package/lib/HeroButton/HeroButton.mjs +80 -8
  60. package/lib/HeroButton/styles.css +1 -1
  61. package/lib/Hidden/styles.css +1 -1
  62. package/lib/HorizontalCard/styles.css +1 -1
  63. package/lib/Icon/styles.css +1 -1
  64. package/lib/Image/styles.css +1 -1
  65. package/lib/ImpactCard/ImpactCard.cjs +3 -3
  66. package/lib/ImpactCard/ImpactCard.mjs +3 -3
  67. package/lib/ImpactCard/styles.css +1 -1
  68. package/lib/InformationCard/InformationCard.cjs +6 -6
  69. package/lib/InformationCard/InformationCard.mjs +6 -6
  70. package/lib/InformationCard/styles.css +1 -1
  71. package/lib/Link/Link.cjs +1 -1
  72. package/lib/Link/Link.mjs +1 -1
  73. package/lib/Link/styles.css +1 -1
  74. package/lib/Markup/styles.css +1 -1
  75. package/lib/MediaCard/MediaCard.cjs +53 -14
  76. package/lib/MediaCard/MediaCard.mjs +55 -12
  77. package/lib/MediaCard/styles.css +1 -1
  78. package/lib/Menu/Menu.cjs +1327 -25
  79. package/lib/Menu/Menu.mjs +1292 -9
  80. package/lib/Menu/styles.css +1 -1
  81. package/lib/Modal/styles.css +1 -1
  82. package/lib/NavigationHeader/NavigationHeader.cjs +743 -16
  83. package/lib/NavigationHeader/NavigationHeader.mjs +734 -7
  84. package/lib/NavigationHeader/styles.css +1 -1
  85. package/lib/Pagination/styles.css +1 -1
  86. package/lib/PaginationSimple/styles.css +1 -1
  87. package/lib/Popover/styles.css +1 -1
  88. package/lib/Poster/styles.css +1 -1
  89. package/lib/ProgressBar/styles.css +1 -1
  90. package/lib/ProgressStepper/styles.css +1 -1
  91. package/lib/ProgressStepperOverflow/ProgressStepperOverflow.cjs +138 -7
  92. package/lib/ProgressStepperOverflow/ProgressStepperOverflow.mjs +140 -5
  93. package/lib/ProgressStepperOverflow/styles.css +1 -1
  94. package/lib/RadioCardGroup/RadioCardGroup.cjs +48 -7
  95. package/lib/RadioCardGroup/RadioCardGroup.mjs +48 -8
  96. package/lib/RadioCardGroup/styles.css +1 -1
  97. package/lib/RadioGroup/RadioGroup.cjs +50 -8
  98. package/lib/RadioGroup/RadioGroup.mjs +49 -8
  99. package/lib/RadioGroup/styles.css +1 -1
  100. package/lib/Rule/styles.css +1 -1
  101. package/lib/ScrollToTop/styles.css +1 -1
  102. package/lib/Section/Section.cjs +1 -1
  103. package/lib/Section/Section.mjs +1 -1
  104. package/lib/Section/styles.css +1 -1
  105. package/lib/Select/styles.css +1 -1
  106. package/lib/SiteFooter/SiteFooter.cjs +1 -1
  107. package/lib/SiteFooter/SiteFooter.mjs +1 -1
  108. package/lib/SiteFooter/styles.css +1 -1
  109. package/lib/SiteFooterV2/SiteFooterV2.cjs +6 -5
  110. package/lib/SiteFooterV2/SiteFooterV2.mjs +6 -5
  111. package/lib/SiteFooterV2/styles.css +1 -1
  112. package/lib/SiteHeaderV2/SiteHeaderV2.cjs +440 -15
  113. package/lib/SiteHeaderV2/SiteHeaderV2.mjs +435 -11
  114. package/lib/SiteHeaderV2/styles.css +1 -1
  115. package/lib/Skeleton/styles.css +1 -1
  116. package/lib/SkipLink/styles.css +1 -1
  117. package/lib/Spinner/styles.css +1 -1
  118. package/lib/Surface/styles.css +1 -1
  119. package/lib/Switch/styles.css +1 -1
  120. package/lib/TabbedBanner/TabbedBanner.cjs +4 -5
  121. package/lib/TabbedBanner/TabbedBanner.mjs +4 -5
  122. package/lib/TabbedBanner/styles.css +1 -1
  123. package/lib/Tabs/Tabs.mjs +1 -1
  124. package/lib/Tabs/styles.css +1 -1
  125. package/lib/Tag/Tag.cjs +9 -9
  126. package/lib/Tag/Tag.mjs +9 -9
  127. package/lib/Tag/styles.css +1 -1
  128. package/lib/TemplateBanner/TemplateBanner.cjs +1 -1
  129. package/lib/TemplateBanner/TemplateBanner.mjs +1 -1
  130. package/lib/TemplateBanner/styles.css +1 -1
  131. package/lib/Text/styles.css +1 -1
  132. package/lib/TextArea/TextArea.cjs +2 -53
  133. package/lib/TextArea/TextArea.mjs +2 -53
  134. package/lib/TextArea/styles.css +1 -1
  135. package/lib/TextInput/styles.css +1 -1
  136. package/lib/Theme/Theme.cjs +1 -1
  137. package/lib/Theme/Theme.mjs +1 -1
  138. package/lib/Theme/styles.css +1 -1
  139. package/lib/ThemeIcon/styles.css +1 -1
  140. package/lib/ThumbnailSignpost/styles.css +1 -1
  141. package/lib/Toast/styles.css +1 -1
  142. package/lib/Tooltip/styles.css +1 -1
  143. package/lib/Truncate/styles.css +1 -1
  144. package/lib/TypographyCard/TypographyCard.cjs +3 -3
  145. package/lib/TypographyCard/TypographyCard.mjs +3 -3
  146. package/lib/TypographyCard/styles.css +1 -1
  147. package/lib/UniversalHeader/styles.css +1 -1
  148. package/lib/VerticalSpace/styles.css +1 -1
  149. package/lib/VideoPlayer/styles.css +1 -1
  150. package/lib/Visible/styles.css +1 -1
  151. package/lib/VisuallyHidden/styles.css +1 -1
  152. package/lib/_shared/cjs/{Calendar-B-va25n2.cjs → Calendar-Bfdgf5q1.cjs} +1 -1
  153. package/lib/_shared/cjs/{ContentSwitcherList-bCEzIPN2.cjs → ContentSwitcherList-pcYtuT6L.cjs} +8 -0
  154. package/lib/_shared/cjs/{Link-7xUgVf1I.cjs → Link-C3OSQIIk.cjs} +3 -1
  155. package/lib/_shared/cjs/{Section-wUVdzmGA.cjs → Section-Bz2fwj8Z.cjs} +2 -2
  156. package/lib/_shared/cjs/{TemplateBanner-CImrJ9ON.cjs → TemplateBanner-COymAI91.cjs} +2 -2
  157. package/lib/_shared/cjs/{arc-breakpoints-DWUgmeLA.cjs → arc-breakpoints-CS8JVk5T.cjs} +1 -1
  158. package/lib/_shared/cjs/{index.es-DlNskPlN.cjs → index.es-fkulh7qu.cjs} +1 -1
  159. package/lib/_shared/esm/{Calendar-Bd2_eT1Y.mjs → Calendar-Drh_NJ9I.mjs} +1 -1
  160. package/lib/_shared/esm/{ContentSwitcherList-bCQz0qkU.mjs → ContentSwitcherList-DwHfU3no.mjs} +10 -3
  161. package/lib/_shared/esm/{Link-Biyg9qBH.mjs → Link-DxjGH_7f.mjs} +3 -1
  162. package/lib/_shared/esm/{Section-DDygQ5Az.mjs → Section-7InCvzfh.mjs} +2 -2
  163. package/lib/_shared/esm/{TemplateBanner-DeHjliNP.mjs → TemplateBanner-Dkgzu3A5.mjs} +2 -2
  164. package/lib/_shared/esm/{arc-breakpoints-D5hR5m3t.mjs → arc-breakpoints-D7Ie4kBt.mjs} +1 -1
  165. package/lib/_shared/esm/{index-BDWwJ5x2.mjs → index-BWkI4Dwz.mjs} +1 -1
  166. package/lib/_shared/esm/{index.es-C3WqfFKH.mjs → index.es-CtRkzfKP.mjs} +2 -2
  167. package/lib/index.cjs +300 -283
  168. package/lib/index.cjs.map +1 -1
  169. package/lib/index.d.cts +28 -3
  170. package/lib/index.d.mts +28 -3
  171. package/lib/index.js.map +1 -1
  172. package/lib/index.mjs +301 -284
  173. package/lib/index.mjs.map +1 -1
  174. package/lib/styles.css +10 -10
  175. package/package.json +8 -8
  176. package/lib/_shared/cjs/BreadcrumbsLink-CDmk3Y3m.cjs +0 -18
  177. package/lib/_shared/cjs/Checkbox-DfZMjO1Y.cjs +0 -88
  178. package/lib/_shared/cjs/ComboBox-BGUhlqx1.cjs +0 -281
  179. package/lib/_shared/cjs/ContentSwitcherTab-B387Qs3I.cjs +0 -14
  180. package/lib/_shared/cjs/DatePicker-Dt4faA_N.cjs +0 -334
  181. package/lib/_shared/cjs/HeroButton-CrzkTUwP.cjs +0 -82
  182. package/lib/_shared/cjs/MediaCard-BEZFbiYO.cjs +0 -57
  183. package/lib/_shared/cjs/MenuItemMultiLevelContent-vLr6hSBm.cjs +0 -1328
  184. package/lib/_shared/cjs/ProgressStepperOverflow-BAGZNC26.cjs +0 -142
  185. package/lib/_shared/cjs/RadioCardGroupInput-CeUM3yPS.cjs +0 -53
  186. package/lib/_shared/cjs/RadioGroupInput-w2qkfsnG.cjs +0 -54
  187. package/lib/_shared/cjs/SiteHeaderV2NavItemWithSubNav-CagFKPEa.cjs +0 -445
  188. package/lib/_shared/cjs/kebabCase-D5yA6u-V.cjs +0 -743
  189. package/lib/_shared/cjs/keynames-Cx13-hWr.cjs +0 -8
  190. package/lib/_shared/esm/BreadcrumbsLink-BxTurGNa.mjs +0 -16
  191. package/lib/_shared/esm/Checkbox-CwOHzlQF.mjs +0 -86
  192. package/lib/_shared/esm/ComboBox-CRlJjeev.mjs +0 -279
  193. package/lib/_shared/esm/ContentSwitcherTab-CfC3PGeZ.mjs +0 -12
  194. package/lib/_shared/esm/DatePicker-DT4OEzxP.mjs +0 -324
  195. package/lib/_shared/esm/HeroButton-jdjjV_Gf.mjs +0 -80
  196. package/lib/_shared/esm/MediaCard-DqMaNWsE.mjs +0 -55
  197. package/lib/_shared/esm/MenuItemMultiLevelContent-JTOHqpzg.mjs +0 -1296
  198. package/lib/_shared/esm/ProgressStepperOverflow-fPkLltVO.mjs +0 -140
  199. package/lib/_shared/esm/RadioCardGroupInput-D7W28geB.mjs +0 -50
  200. package/lib/_shared/esm/RadioGroupInput-zAWSV29m.mjs +0 -50
  201. package/lib/_shared/esm/SiteHeaderV2NavItemWithSubNav-CxGwdV6u.mjs +0 -439
  202. package/lib/_shared/esm/kebabCase-CCEMRBfd.mjs +0 -737
  203. package/lib/_shared/esm/keynames-B5whqsjh.mjs +0 -8
@@ -1,140 +0,0 @@
1
- import { _ as __rest, a as __assign, f as filterAttrs } from './filter-attrs-B6CM-NUr.mjs';
2
- import React__default, { forwardRef, useState, useRef, useImperativeHandle, useEffect } from 'react';
3
- import { d as debounce } from './debounce-D_Nx5go6.mjs';
4
- import { P as ProgressStepper } from './ProgressStepper-CLBtBNy2.mjs';
5
-
6
- /** Use `ProgressStepperOverflow` to wrap `ProgressStepperItem`s and allow overflow behaviour. */
7
- var ProgressStepperOverflow = forwardRef(function (_a, stepperRef) {
8
- var children = _a.children, onIndexChange = _a.onIndexChange, onLoadStep = _a.onLoadStep, size = _a.size, invertLabelPosition = _a.invertLabelPosition, _b = _a.offsetLeft, offsetLeft = _b === void 0 ? 24 : _b, props = __rest(_a, ["children", "onIndexChange", "onLoadStep", "size", "invertLabelPosition", "offsetLeft"]);
9
- var _c = useState(onLoadStep ? onLoadStep : 0), activeIndex = _c[0], setActiveIndex = _c[1];
10
- var _d = useState(0), closestScrolledIndex = _d[0], setClosestScrolledIndex = _d[1];
11
- var _e = useState(true), lastStepVisible = _e[0], setLastStepVisible = _e[1];
12
- var containerRef = useRef(null);
13
- useImperativeHandle(stepperRef, function () { return ({
14
- handleStepScroll: handleStepScroll,
15
- scrollToStep: scrollToStep,
16
- handleViewScroll: handleViewScroll,
17
- isLastChildVisible: isLastChildVisible,
18
- }); });
19
- // Add Horizontal Scroll Event Listener
20
- useEffect(function () {
21
- var _a, _b;
22
- var checkClosest = debounce(function () {
23
- var closestIndex = findClosestIndex();
24
- setClosestScrolledIndex(closestIndex);
25
- }, 100);
26
- var checkLastChild = debounce(function () {
27
- var lastVisible = isLastChildVisible();
28
- if (lastVisible) {
29
- setLastStepVisible(true);
30
- }
31
- else
32
- setLastStepVisible(false);
33
- }, 100);
34
- (_a = containerRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener("scroll", checkLastChild);
35
- (_b = containerRef.current) === null || _b === void 0 ? void 0 : _b.addEventListener("scroll", checkClosest);
36
- return function () {
37
- var _a;
38
- (_a = containerRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener("scroll", checkClosest);
39
- checkLastChild.cancel();
40
- };
41
- }, []);
42
- // Scroll to activeIndex
43
- useEffect(function () {
44
- scrollTo();
45
- }, [activeIndex]);
46
- // Exposing changes in activeIndex outside of component
47
- useEffect(function () {
48
- onIndexChange === null || onIndexChange === void 0 ? void 0 : onIndexChange(closestScrolledIndex);
49
- isLastChildVisible();
50
- }, [closestScrolledIndex, onIndexChange, lastStepVisible]);
51
- // helper functions - start
52
- var getProgressStepper = function () { var _a; return (_a = containerRef.current) === null || _a === void 0 ? void 0 : _a.firstChild; };
53
- var getStepChildren = function () {
54
- var _a;
55
- return Array.from(((_a = getProgressStepper()) === null || _a === void 0 ? void 0 : _a.children) || []);
56
- };
57
- var getLeftRects = function (children) {
58
- var container = getProgressStepper();
59
- if (!container)
60
- return [];
61
- var parentRect = container.getBoundingClientRect();
62
- return children.map(function (child) {
63
- var childRect = child.getBoundingClientRect();
64
- return {
65
- left: childRect.left - parentRect.left,
66
- };
67
- });
68
- };
69
- var indexOfClosest = function (values) {
70
- return values.indexOf(Math.min.apply(Math, values));
71
- };
72
- // helper functions - end
73
- var isLastChildVisible = function () {
74
- var _a;
75
- var steps = getStepChildren();
76
- var lastStep = steps[steps.length - 1];
77
- var rect = lastStep.getBoundingClientRect();
78
- var containerRect = (_a = containerRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
79
- return rect.right <= containerRect.right;
80
- };
81
- // Used for onScroll function of scrolling without buttons
82
- var findClosestIndex = function () {
83
- var _a, _b;
84
- var children = getStepChildren();
85
- var scrolledAmount = (_b = (_a = containerRef.current) === null || _a === void 0 ? void 0 : _a.scrollLeft) !== null && _b !== void 0 ? _b : 0;
86
- // compare the scrolled amount to the intial left edge distance for each step
87
- var getScrollDistances = function (children, scrolledAmount) {
88
- return getLeftRects(children).map(function (rect) {
89
- return Math.abs(scrolledAmount - rect.left);
90
- });
91
- };
92
- var closestIndex = indexOfClosest(getScrollDistances(children, scrolledAmount));
93
- return closestIndex;
94
- };
95
- // Scroll active step to the far left of the page
96
- var scrollTo = function () {
97
- var _a, _b;
98
- var activeStep = (_a = getProgressStepper()) === null || _a === void 0 ? void 0 : _a.children[activeIndex];
99
- if (activeStep) {
100
- (_b = containerRef.current) === null || _b === void 0 ? void 0 : _b.scrollTo({
101
- left: activeStep.offsetLeft - offsetLeft,
102
- behavior: "smooth",
103
- });
104
- }
105
- };
106
- var handleStepScroll = function (increment) {
107
- // Account for any manual scrolling set closest index to active index
108
- setActiveIndex(closestScrolledIndex);
109
- var newIndex = closestScrolledIndex + increment;
110
- setActiveIndex(newIndex);
111
- // If clicking backwards to include half visible step
112
- if (closestScrolledIndex + increment === activeIndex) {
113
- scrollTo();
114
- }
115
- if (closestScrolledIndex + increment < 0) {
116
- setActiveIndex(0);
117
- scrollTo();
118
- }
119
- };
120
- // Used to scroll by Parent width
121
- var handleViewScroll = function (direction) {
122
- var _a;
123
- var clientWidth = ((_a = containerRef.current) === null || _a === void 0 ? void 0 : _a.clientWidth) || 0;
124
- var stepper = containerRef.current;
125
- if (!stepper)
126
- return;
127
- stepper.scrollBy({
128
- left: direction ? clientWidth : -clientWidth,
129
- behavior: "smooth",
130
- });
131
- };
132
- // Used to set a specific step to jump to on a button click
133
- var scrollToStep = function (step) {
134
- setActiveIndex(step);
135
- };
136
- return (React__default.createElement("div", __assign({ ref: containerRef, className: "arc-ProgressStepperOverflow", style: { paddingLeft: offsetLeft } }, filterAttrs(props)),
137
- React__default.createElement(ProgressStepper, { size: size, invertLabelPosition: invertLabelPosition, isFluid: false }, children)));
138
- });
139
-
140
- export { ProgressStepperOverflow as P };
@@ -1,50 +0,0 @@
1
- import { _ as __rest, a as __assign } from './filter-attrs-B6CM-NUr.mjs';
2
- import React__default, { createContext, useContext, forwardRef } from 'react';
3
- import { c as classNames } from './index-5C0-U8cc.mjs';
4
- import { c as capitaliseFirstLetter } from './capitalise-first-letter-Cubg2CS1.mjs';
5
- import { C as Context } from './Surface-Colbp3Zx.mjs';
6
- import { I as Icon } from './Icon-CcPOJcQm.mjs';
7
-
8
- var RadioContext = createContext({});
9
- var Provider = RadioContext.Provider;
10
- var useRadioContext = function () {
11
- var context = useContext(RadioContext);
12
- return context;
13
- };
14
-
15
- var RadioCard = forwardRef(function (_a, ref) {
16
- var id = _a.id, icon = _a.icon, label = _a.label, support = _a.support, isDisabled = _a.isDisabled, checked = _a.checked, defaultChecked = _a.defaultChecked, changeEvent = _a.changeEvent, name = _a.name, blurEvent = _a.blurEvent, value = _a.value, children = _a.children, _b = _a.controlLocation, controlLocation = _b === void 0 ? "right" : _b, _c = _a.hideButton, hideButton = _c === void 0 ? false : _c;
17
- var surface = useContext(Context).surface;
18
- var idLabel = "".concat(id, "-label");
19
- return (React__default.createElement("div", { className: classNames("arc-RadioCard", {
20
- "arc-RadioCard--isDisabled": isDisabled,
21
- "arc-RadioCard--onDarkSurface": surface === "dark",
22
- "arc-RadioCard--isSelected": checked,
23
- }) },
24
- React__default.createElement("label", { id: idLabel, htmlFor: id },
25
- React__default.createElement("input", { className: "arc-RadioCard-input", id: id, checked: checked, defaultChecked: defaultChecked, disabled: isDisabled, onChange: changeEvent, onBlur: blurEvent, name: name, ref: ref, type: "radio", value: value, "aria-checked": checked }),
26
- React__default.createElement("div", { className: "arc-RadioCard-inner arc-RadioCard--control".concat(capitaliseFirstLetter(controlLocation)) },
27
- icon && (React__default.createElement("div", { className: "arc-RadioCard-icon" },
28
- React__default.createElement(Icon, { icon: icon, size: 24 }))),
29
- React__default.createElement("div", { className: "arc-RadioCard-content" },
30
- React__default.createElement("span", { className: "arc-RadioCard-label" }, label),
31
- support && (React__default.createElement("span", { className: "arc-RadioCard-support" }, support))),
32
- children && (React__default.createElement("div", { className: "arc-RadioCard-customContent" }, children)),
33
- !hideButton && (React__default.createElement("div", { className: classNames("arc-RadioCard-radioIcon", {
34
- "arc-RadioCard-radioIcon--isSelected": checked,
35
- }) }))))));
36
- });
37
-
38
- /**
39
- * Radio Card component.
40
- */
41
- var RadioCardGroupInput = forwardRef(function (_a, ref) {
42
- var icon = _a.icon, support = _a.support, id = _a.id, isDisabled = _a.isDisabled, label = _a.label, value = _a.value, children = _a.children, controlLocation = _a.controlLocation, hideButton = _a.hideButton, props = __rest(_a, ["icon", "support", "id", "isDisabled", "label", "value", "children", "controlLocation", "hideButton"]);
43
- var _b = useRadioContext(), name = _b.name, changeEvent = _b.changeEvent, checkedValue = _b.checkedValue, groupDisabled = _b.groupDisabled;
44
- var isChecked = checkedValue === value ? true : false;
45
- var checked = typeof changeEvent !== "function" ? undefined : isChecked;
46
- var defaultChecked = typeof changeEvent !== "function" ? isChecked : undefined;
47
- return (React__default.createElement(RadioCard, __assign({ icon: icon, ref: ref, id: id, support: support, label: label, name: name, defaultChecked: defaultChecked, checked: checked, changeEvent: changeEvent, value: value, isDisabled: isDisabled || groupDisabled, controlLocation: controlLocation, hideButton: hideButton }, props), children));
48
- });
49
-
50
- export { Provider as P, RadioCardGroupInput as R };
@@ -1,50 +0,0 @@
1
- import { _ as __rest, a as __assign } from './filter-attrs-B6CM-NUr.mjs';
2
- import React__default, { createContext, useContext, forwardRef } from 'react';
3
- import { c as classNames } from './index-5C0-U8cc.mjs';
4
- import { C as Context } from './Surface-Colbp3Zx.mjs';
5
- import { V as VisuallyHidden } from './VisuallyHidden-DqAgoqJo.mjs';
6
-
7
- var RadioContext = createContext({});
8
- var Provider = RadioContext.Provider;
9
- var useRadioContext = function () {
10
- var context = useContext(RadioContext);
11
- return context;
12
- };
13
-
14
- var RadioGroupButton = forwardRef(function (_a, ref) {
15
- var id = _a.id, changeEvent = _a.changeEvent, isDisabled = _a.isDisabled, size = _a.size, labelSize = _a.labelSize, checked = _a.checked, defaultChecked = _a.defaultChecked, radioButtonAlignment = _a.radioButtonAlignment, name = _a.name, blurEvent = _a.blurEvent, value = _a.value, label = _a.label, helper = _a.helper, hideLabel = _a.hideLabel, withMargin = _a.withMargin;
16
- var surface = useContext(Context).surface;
17
- var idLabel = "".concat(id, "-label");
18
- return (React__default.createElement("div", { className: classNames({
19
- "arc-RadioGroupButton": true,
20
- "arc-RadioGroupButton--withMargin": withMargin,
21
- "arc-RadioGroupButton--withMarginSmall": withMargin && size === "s",
22
- "arc-RadioGroupButton--disabled": isDisabled,
23
- "arc-RadioGroupButton--small": size === "s",
24
- "arc-RadioGroupButton--smallLabel": labelSize === "s",
25
- "arc-RadioGroupButton--onDarkSurface": surface === "dark",
26
- }) },
27
- React__default.createElement("label", { className: classNames("arc-RadioGroupButton-label", {
28
- "arc-RadioGroupButton-label--alignTop": radioButtonAlignment === "top",
29
- }), htmlFor: id, id: idLabel },
30
- React__default.createElement("input", { className: "arc-RadioGroupButton-input", checked: checked, defaultChecked: defaultChecked, disabled: isDisabled, id: id, name: name, onBlur: blurEvent, onChange: changeEvent, ref: ref, type: "radio", value: value, "aria-checked": checked }),
31
- React__default.createElement("span", { className: classNames({
32
- "arc-RadioGroupButton-label--marginTop": radioButtonAlignment === "top",
33
- }) },
34
- hideLabel ? React__default.createElement(VisuallyHidden, null, label) : label,
35
- helper && (React__default.createElement("span", { className: "arc-RadioGroupButton-helper" }, helper))))));
36
- });
37
-
38
- /**
39
- * Radio Button component.
40
- */
41
- var RadioGroupInput = forwardRef(function (_a, ref) {
42
- var helper = _a.helper, id = _a.id, isDisabled = _a.isDisabled, label = _a.label, _b = _a.radioButtonAlignment, radioButtonAlignment = _b === void 0 ? "center" : _b, value = _a.value, props = __rest(_a, ["helper", "id", "isDisabled", "label", "radioButtonAlignment", "value"]);
43
- var _c = useRadioContext(), blurEvent = _c.blurEvent, changeEvent = _c.changeEvent, groupDisabled = _c.groupDisabled, checkedValue = _c.checkedValue, name = _c.name, size = _c.size;
44
- var isChecked = checkedValue === value ? true : false;
45
- var checked = typeof changeEvent !== "function" ? undefined : isChecked;
46
- var defaultChecked = typeof changeEvent !== "function" ? isChecked : undefined;
47
- return (React__default.createElement(RadioGroupButton, __assign({ withMargin: true, ref: ref, id: id, name: name, helper: helper, isDisabled: isDisabled || groupDisabled, size: size, radioButtonAlignment: radioButtonAlignment, label: label, defaultChecked: defaultChecked, checked: checked, changeEvent: changeEvent, blurEvent: blurEvent, value: value }, props)));
48
- });
49
-
50
- export { Provider as P, RadioGroupButton as R, RadioGroupInput as a };