@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,334 +0,0 @@
1
- 'use strict';
2
-
3
- var filterAttrs = require('./filter-attrs-eK6E_34o.cjs');
4
- var React = require('react');
5
- var index$2 = require('./index-CTlXMLug.cjs');
6
- var index$3 = require('./index-CaO6cOF0.cjs');
7
- var Calendar = require('./Calendar-B-va25n2.cjs');
8
- var index = require('./index-BLRjGROQ.cjs');
9
- var index$1 = require('./index-DXNM3D1d.cjs');
10
- var TextInput = require('./TextInput-ByySubi5.cjs');
11
-
12
- /**
13
- * @name startOfDay
14
- * @category Day Helpers
15
- * @summary Return the start of a day for the given date.
16
- *
17
- * @description
18
- * Return the start of a day for the given date.
19
- * The result will be in the local timezone.
20
- *
21
- * @param {Date|Number} date - the original date
22
- * @returns {Date} the start of a day
23
- * @throws {TypeError} 1 argument required
24
- *
25
- * @example
26
- * // The start of a day for 2 September 2014 11:55:00:
27
- * const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))
28
- * //=> Tue Sep 02 2014 00:00:00
29
- */
30
- function startOfDay(dirtyDate) {
31
- index.requiredArgs(1, arguments);
32
- var date = index.toDate(dirtyDate);
33
- date.setHours(0, 0, 0, 0);
34
- return date;
35
- }
36
-
37
- /**
38
- * @name isSameDay
39
- * @category Day Helpers
40
- * @summary Are the given dates in the same day (and year and month)?
41
- *
42
- * @description
43
- * Are the given dates in the same day (and year and month)?
44
- *
45
- * @param {Date|Number} dateLeft - the first date to check
46
- * @param {Date|Number} dateRight - the second date to check
47
- * @returns {Boolean} the dates are in the same day (and year and month)
48
- * @throws {TypeError} 2 arguments required
49
- *
50
- * @example
51
- * // Are 4 September 06:00:00 and 4 September 18:00:00 in the same day?
52
- * const result = isSameDay(new Date(2014, 8, 4, 6, 0), new Date(2014, 8, 4, 18, 0))
53
- * //=> true
54
- *
55
- * @example
56
- * // Are 4 September and 4 October in the same day?
57
- * const result = isSameDay(new Date(2014, 8, 4), new Date(2014, 9, 4))
58
- * //=> false
59
- *
60
- * @example
61
- * // Are 4 September, 2014 and 4 September, 2015 in the same day?
62
- * const result = isSameDay(new Date(2014, 8, 4), new Date(2015, 8, 4))
63
- * //=> false
64
- */
65
- function isSameDay(dirtyDateLeft, dirtyDateRight) {
66
- index.requiredArgs(2, arguments);
67
- var dateLeftStartOfDay = startOfDay(dirtyDateLeft);
68
- var dateRightStartOfDay = startOfDay(dirtyDateRight);
69
- return dateLeftStartOfDay.getTime() === dateRightStartOfDay.getTime();
70
- }
71
-
72
- var parseRangeString = function (value) {
73
- if (value === void 0) { value = ""; }
74
- var _a = value.replace(/\s/g, "").split("-"), _b = _a[0], start = _b === void 0 ? "" : _b, _c = _a[1], end = _c === void 0 ? "" : _c;
75
- var _d = start.split("/"), startDay = _d[0], startMonth = _d[1], startYear = _d[2];
76
- var _e = end.split("/"), endDay = _e[0], endMonth = _e[1], endYear = _e[2];
77
- return {
78
- start: {
79
- date: start,
80
- day: startDay,
81
- month: startMonth,
82
- year: startYear,
83
- },
84
- end: {
85
- date: end,
86
- day: endDay,
87
- month: endMonth,
88
- year: endYear,
89
- },
90
- };
91
- };
92
-
93
- var parseDateString = function (value) {
94
- var _a = value.split("/"), day = _a[0], month = _a[1], year = _a[2];
95
- return {
96
- day: day,
97
- month: month,
98
- year: year,
99
- };
100
- };
101
-
102
- var isDateValid = function (value) {
103
- if (value === void 0) { value = ""; }
104
- var _a = value.split("/"), day = _a[0], month = _a[1], year = _a[2];
105
- return (/^\d{2}\/\d{2}\/\d{4}$/.test(value) &&
106
- index.isValid(new Date("".concat(year, "-").concat(month, "-").concat(day))));
107
- };
108
-
109
- var isRangeValid = function (value) {
110
- if (value === void 0) { value = ""; }
111
- var _a = value.replace(/\s/g, "").split("-"), _b = _a[0], start = _b === void 0 ? "" : _b, _c = _a[1], end = _c === void 0 ? "" : _c;
112
- return isDateValid(start) && isDateValid(end);
113
- };
114
-
115
- var DATE_FORMAT = "dd/MM/yyyy";
116
-
117
- var formatDate = function (value) {
118
- return index.format(value, DATE_FORMAT);
119
- };
120
-
121
- var isDisabledDate = function (disabledDates, date) {
122
- return Boolean(disabledDates &&
123
- disabledDates.find(function (disabledDate) { return isSameDay(date, disabledDate); }));
124
- };
125
-
126
- var convertDateStringToDate = function (value) {
127
- if (value === void 0) { value = ""; }
128
- var _a = parseDateString(value), day = _a.day, month = _a.month, year = _a.year;
129
- var isValidDate = isDateValid(value);
130
- return isValidDate ? new Date("".concat(year, "-").concat(month, "-").concat(day)) : new Date();
131
- };
132
-
133
- var convertRangeStringToDates = function (value) {
134
- if (value === void 0) { value = ""; }
135
- var _a = parseRangeString(value), start = _a.start, end = _a.end;
136
- return filterAttrs.__spreadArray(filterAttrs.__spreadArray([], (isDateValid(start.date)
137
- ? [new Date("".concat(start.year, "-").concat(start.month, "-").concat(start.day))]
138
- : []), true), (isDateValid(end.date)
139
- ? [new Date("".concat(end.year, "-").concat(end.month, "-").concat(end.day))]
140
- : []), true);
141
- };
142
-
143
- function validateRangeOnBlur(_a) {
144
- var value = _a.value, minDate = _a.minDate, maxDate = _a.maxDate, disabledDates = _a.disabledDates, previousValidValue = _a.previousValidValue, dispatchChangeEvent = _a.dispatchChangeEvent, blurEvent = _a.blurEvent;
145
- if (!isRangeValid(value))
146
- return;
147
- var _b = convertRangeStringToDates(value), start = _b[0], end = _b[1];
148
- var isStartBeforeMin = minDate && Calendar.isBefore(start, minDate);
149
- var isEndAfterMax = maxDate && Calendar.isAfter(end, maxDate);
150
- var isStartDisabled = isDisabledDate(disabledDates, start);
151
- var isEndDisabled = isDisabledDate(disabledDates, end);
152
- if (isStartBeforeMin && isEndAfterMax) {
153
- return dispatchChangeEvent(blurEvent, "".concat(formatDate(minDate), " - ").concat(formatDate(maxDate)));
154
- }
155
- if (isStartBeforeMin) {
156
- return dispatchChangeEvent(blurEvent, "".concat(formatDate(minDate), " - ").concat(formatDate(end)));
157
- }
158
- if (isEndAfterMax) {
159
- return dispatchChangeEvent(blurEvent, "".concat(formatDate(start), " - ").concat(formatDate(maxDate)));
160
- }
161
- if (isStartDisabled || isEndDisabled) {
162
- var _c = previousValidValue
163
- ? convertRangeStringToDates(previousValidValue)
164
- : [], prevStart = _c[0], prevEnd = _c[1];
165
- return dispatchChangeEvent(blurEvent, prevStart && prevEnd
166
- ? "".concat(formatDate(prevStart), " - ").concat(formatDate(prevEnd))
167
- : "");
168
- }
169
- if (Calendar.isAfter(start, end)) {
170
- var _d = [start, end].sort(Calendar.compareAsc), orderedStart = _d[0], orderedEnd = _d[1];
171
- return dispatchChangeEvent(blurEvent, "".concat(formatDate(orderedStart), " - ").concat(formatDate(orderedEnd)));
172
- }
173
- }
174
-
175
- /**
176
- * Use `DatePicker` to clearly present available dates and allow users to choose a way to enter information.
177
- */
178
- var DatePicker = React.forwardRef(function (_a, ref) {
179
- var errorMessage = _a.errorMessage, helper = _a.helper, id = _a.id, label = _a.label, isDisabled = _a.isDisabled, isReadOnly = _a.isReadOnly, isRequired = _a.isRequired, size = _a.size, _b = _a.value, value = _b === void 0 ? "" : _b, name = _a.name, onBlur = _a.onBlur, onChange = _a.onChange, onDateSelect = _a.onDateSelect, onRangeSelect = _a.onRangeSelect, onClickDisclosure = _a.onClickDisclosure, disclosureTitle = _a.disclosureTitle, disclosureText = _a.disclosureText, type = _a.type, _c = _a.isFluid, isFluid = _c === void 0 ? false : _c, _d = _a.selectionType, selectionType = _d === void 0 ? "single" : _d, disabledDates = _a.disabledDates, minDate = _a.minDate, maxDate = _a.maxDate, props = filterAttrs.__rest(_a, ["errorMessage", "helper", "id", "label", "isDisabled", "isReadOnly", "isRequired", "size", "value", "name", "onBlur", "onChange", "onDateSelect", "onRangeSelect", "onClickDisclosure", "disclosureTitle", "disclosureText", "type", "isFluid", "selectionType", "disabledDates", "minDate", "maxDate"]);
180
- var _e = index$1.useThemeElement(), themeElement = _e[0], setThemeElement = _e[1];
181
- var _f = React.useState("Choose date"), ariaLabel = _f[0], setAriaLabel = _f[1];
182
- var _g = React.useState(false), showCalendar = _g[0], setShowCalendar = _g[1];
183
- var buttonRef = React.useRef(null);
184
- var ourRef = React.useRef(null);
185
- var previousValidValue = React.useRef(value);
186
- var lowerCaseDateFormat = DATE_FORMAT.toLowerCase();
187
- var placeHolder = selectionType === "range"
188
- ? "".concat(lowerCaseDateFormat, " - ").concat(lowerCaseDateFormat)
189
- : lowerCaseDateFormat;
190
- React.useEffect(function () {
191
- if (selectionType === "single" &&
192
- isDateValid(value) &&
193
- !isDisabledDate(disabledDates, convertDateStringToDate(value))) {
194
- previousValidValue.current = value;
195
- }
196
- if (selectionType === "range" && isRangeValid(value)) {
197
- var rangeHasDisabledDates = convertRangeStringToDates(value).some(function (rangeValue) { return isDisabledDate(disabledDates, rangeValue); });
198
- if (!rangeHasDisabledDates) {
199
- previousValidValue.current = value;
200
- }
201
- }
202
- }, [value, disabledDates, selectionType]);
203
- var getDatePickerRef = function (elementRef) {
204
- ourRef.current = elementRef;
205
- if (ref && typeof ref === "object") {
206
- ref.current = elementRef;
207
- }
208
- if (ref && typeof ref === "function") {
209
- ref(elementRef);
210
- }
211
- };
212
- var dispatchChangeEvent = function (e, value) {
213
- onChange &&
214
- onChange(filterAttrs.__assign(filterAttrs.__assign({}, e), { target: filterAttrs.__assign(filterAttrs.__assign({}, e.target), { value: value }) }));
215
- };
216
- var handleRangeSelect = function (rangeSelection) {
217
- var start = formatDate(rangeSelection.start);
218
- var end = rangeSelection.end ? formatDate(rangeSelection.end) : null;
219
- onRangeSelect &&
220
- onRangeSelect(filterAttrs.__assign(filterAttrs.__assign({}, rangeSelection), { formattedRange: "".concat(start).concat(end ? " - ".concat(end) : "") }));
221
- rangeSelection.isSelectionComplete && setShowCalendar(false);
222
- };
223
- var handleDateSelect = function (value) {
224
- onDateSelect &&
225
- onDateSelect({
226
- date: value,
227
- formattedDate: formatDate(value),
228
- });
229
- setShowCalendar(false);
230
- };
231
- var handleSingleSelectionBlur = function (e) {
232
- if (value && isDateValid(value) && selectionType === "single") {
233
- var _a = parseDateString(value), day = _a.day, month = _a.month, year = _a.year;
234
- var date = new Date("".concat(year, "-").concat(month, "-").concat(day));
235
- var isDateBeforeMinDate = minDate && Calendar.isBefore(date, minDate);
236
- var isDateAfterMaxDate = maxDate && Calendar.isAfter(date, maxDate);
237
- var isDisabledValue = isDisabledDate(disabledDates, date);
238
- if (isDateBeforeMinDate) {
239
- return dispatchChangeEvent(e, "".concat(formatDate(minDate)));
240
- }
241
- if (isDateAfterMaxDate) {
242
- return dispatchChangeEvent(e, "".concat(formatDate(maxDate)));
243
- }
244
- if (isDisabledValue) {
245
- var date_1 = previousValidValue.current
246
- ? convertDateStringToDate(previousValidValue.current)
247
- : new Date();
248
- return dispatchChangeEvent(e, "".concat(formatDate(date_1)));
249
- }
250
- }
251
- };
252
- var handleRangeSelectionBlur = function (e) {
253
- validateRangeOnBlur({
254
- value: value,
255
- minDate: minDate,
256
- maxDate: maxDate,
257
- disabledDates: disabledDates,
258
- previousValidValue: previousValidValue.current,
259
- dispatchChangeEvent: dispatchChangeEvent,
260
- blurEvent: e,
261
- });
262
- };
263
- var handleBlur = function (e) {
264
- onBlur && onBlur(e);
265
- if (selectionType === "single") {
266
- handleSingleSelectionBlur(e);
267
- }
268
- if (selectionType === "range") {
269
- handleRangeSelectionBlur(e);
270
- }
271
- };
272
- var handleChange = function (e) {
273
- onChange && onChange(e);
274
- };
275
- var handleCalendarOpenChange = function (isOpen) {
276
- if (document.activeElement)
277
- setShowCalendar(isOpen);
278
- };
279
- var handleIconClick = function () {
280
- var _a;
281
- !((_a = ourRef.current) === null || _a === void 0 ? void 0 : _a.contains(document.activeElement)) &&
282
- !isDisabled &&
283
- !isReadOnly &&
284
- setShowCalendar(true);
285
- };
286
- var handleIconFocus = function () {
287
- if (selectionType === "range" && isRangeValid(value)) {
288
- var _a = convertRangeStringToDates(value), start = _a[0], end = _a[1];
289
- return setAriaLabel("Change dates, currently selected dates are ".concat(index.format(start, "EEEE do MMMM, yyyy"), " to ").concat(index.format(end, "EEEE do MMMM, yyyy")));
290
- }
291
- if (selectionType === "single" && isDateValid(value)) {
292
- var date = convertDateStringToDate(value);
293
- return setAriaLabel("Change date, currently selected date is ".concat(index.format(date, "EEEE do MMMM, yyyy")));
294
- }
295
- setAriaLabel("Choose Date");
296
- };
297
- var handleCalendarClose = function () {
298
- var _a, _b;
299
- if (((_a = document.activeElement) === null || _a === void 0 ? void 0 : _a.tagName) === "BODY") {
300
- (_b = buttonRef.current) === null || _b === void 0 ? void 0 : _b.focus();
301
- }
302
- };
303
- var onCancelClick = function () {
304
- setShowCalendar(false);
305
- };
306
- var handleAutoFocus = function (e) {
307
- e.preventDefault();
308
- };
309
- return (React.createElement("div", { ref: setThemeElement, className: index$2.classNames({
310
- "arc-DatePicker--constrained": !isFluid,
311
- }) },
312
- React.createElement(TextInput.TextInputWithPlaceHolder, filterAttrs.__assign({ ref: getDatePickerRef, iconButton: {
313
- onClick: handleIconClick,
314
- onFocus: handleIconFocus,
315
- icon: "datePickerCalendar",
316
- label: ariaLabel,
317
- ref: buttonRef,
318
- }, placeholder: placeHolder, errorMessage: errorMessage, helper: helper, id: id, isDisabled: isDisabled, isReadOnly: isReadOnly, isRequired: isRequired, label: label, maxLength: selectionType === "range" ? 23 : 10, name: name, onBlur: handleBlur, onChange: handleChange, onClickDisclosure: onClickDisclosure, type: "text", value: value, disclosureTitle: disclosureTitle, disclosureText: disclosureText, size: size }, props, filterAttrs.filterAttrs(props))),
319
- React.createElement(index$3.Root2, filterAttrs.__assign({ open: showCalendar, onOpenChange: handleCalendarOpenChange }, filterAttrs.filterAttrs(props)),
320
- React.createElement(index$3.Anchor2, null),
321
- React.createElement(index$3.Portal, { container: themeElement },
322
- React.createElement(index$3.Content2, { align: "start", "aria-modal": "true", "aria-label": "Choose Date", className: "arc-DatePicker-modal", onOpenAutoFocus: handleAutoFocus, onCloseAutoFocus: handleCalendarClose },
323
- React.createElement(Calendar.Calendar, { autoFocusOnMount: true, type: type, onCancelClick: onCancelClick, selectionType: selectionType, selectedDate: convertDateStringToDate(value), selectedRange: convertRangeStringToDates(value), disabledDates: disabledDates, minDate: minDate, maxDate: maxDate, onDateSelect: handleDateSelect, onRangeSelect: handleRangeSelect }))))));
324
- });
325
-
326
- exports.DATE_FORMAT = DATE_FORMAT;
327
- exports.DatePicker = DatePicker;
328
- exports.convertRangeStringToDates = convertRangeStringToDates;
329
- exports.formatDate = formatDate;
330
- exports.isDateValid = isDateValid;
331
- exports.isRangeValid = isRangeValid;
332
- exports.parseDateString = parseDateString;
333
- exports.parseRangeString = parseRangeString;
334
- exports.validateRangeOnBlur = validateRangeOnBlur;
@@ -1,82 +0,0 @@
1
- 'use strict';
2
-
3
- var filterAttrs = require('./filter-attrs-eK6E_34o.cjs');
4
- var React = require('react');
5
- var index = require('./index-CTlXMLug.cjs');
6
- var index$1 = require('./index-DR8Rkav9.cjs');
7
- var Icon = require('./Icon-CzhyKqMd.cjs');
8
- var Surface = require('./Surface-BFx1yNsq.cjs');
9
- var Spinner = require('./Spinner-bbrOwxv2.cjs');
10
-
11
- /**
12
- * Do not edit directly
13
- * Generated file
14
- */
15
-
16
- const BtIconArrowAltRight =
17
- "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3e%3cpath fill='currentColor' d='M18.854 11.646a.5.5 0 0 0-.707.707l3.146 3.147H9.5a.5.5 0 0 0 0 1h11.793l-3.146 3.146a.5.5 0 1 0 .707.707L23.207 16Z'/%3e%3c/svg%3e";
18
-
19
- /**
20
- * Do not edit directly
21
- * Generated file
22
- */
23
-
24
- const BtIconArrowAltDown =
25
- "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3e%3cpath fill='currentColor' d='M20.354 18.146a.5.5 0 0 0-.707 0L16.5 21.293V9.5a.5.5 0 0 0-1 0v11.793l-3.146-3.146a.5.5 0 1 0-.707.707L16 23.207l4.354-4.354a.5.5 0 0 0 0-.707'/%3e%3c/svg%3e";
26
-
27
- /**
28
- * Do not edit directly
29
- * Generated file
30
- */
31
-
32
- const ArcIconPlay =
33
- "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 56 56'%3e%3cpath fill='currentColor' d='M36.468 26.32 23.907 19.07A1.938 1.938 0 0 0 21 20.745V35.25a1.935 1.935 0 0 0 2.907 1.68l12.561-7.254a1.938 1.938 0 0 0 0-3.354m-.875 1.84-12.561 7.254a.18.18 0 0 1-.187 0 .18.18 0 0 1-.095-.165V20.745a.18.18 0 0 1 .095-.16.18.18 0 0 1 .187 0l12.561 7.25a.18.18 0 0 1 .095.164.18.18 0 0 1-.095.16'/%3e%3c/svg%3e";
34
-
35
- /**
36
- * Do not edit directly
37
- * Generated file
38
- */
39
-
40
- const ArcIconWarn =
41
- "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3e%3cpath fill='currentColor' d='M16 20.993a1 1 0 1 0 0 2 1 1 0 1 0 0-2M16.005 19.01a.5.5 0 0 0 .5-.5l.002-9.01a.5.5 0 0 0-1 0l-.002 9.01a.5.5 0 0 0 .5.5'/%3e%3c/svg%3e";
42
-
43
- var HeroButton = React.forwardRef(function (_a, ref) {
44
- var label = _a.label, _b = _a.buttonStyle, buttonStyle = _b === void 0 ? "primary" : _b, icon = _a.icon, ariaLabel = _a.ariaLabel, _c = _a.isLoading, isLoading = _c === void 0 ? false : _c, onClick = _a.onClick, href = _a.href, id = _a.id, rel = _a.rel, target = _a.target, type = _a.type, form = _a.form, props = filterAttrs.__rest(_a, ["label", "buttonStyle", "icon", "ariaLabel", "isLoading", "onClick", "href", "id", "rel", "target", "type", "form"]);
45
- var surface = React.useContext(Surface.Context).surface;
46
- var HeroButtonClasses = index.classNames("arc-HeroButton", ["arc-HeroButton--".concat(index$1.camelcase(buttonStyle))], {
47
- "arc-HeroButton--onDarkSurface": surface === "dark",
48
- "arc-HeroButton--emptyLabel": !label,
49
- "arc-HeroButton--isLoading": isLoading,
50
- "arc-HeroButton--withIcon": icon,
51
- "arc-HeroButton--hasGradient": buttonStyle.includes("-gradient"),
52
- });
53
- var HeroButtonIcons = {
54
- "arrow-right": BtIconArrowAltRight,
55
- "arrow-down": BtIconArrowAltDown,
56
- play: ArcIconPlay,
57
- warning: ArcIconWarn,
58
- };
59
- var commonProps = filterAttrs.__assign({ id: id, onClick: onClick, ref: ref }, filterAttrs.filterAttrs(props));
60
- if (href && !isLoading) {
61
- return (React.createElement("a", filterAttrs.__assign({}, commonProps, { className: HeroButtonClasses, href: href, rel: rel, "aria-label": ariaLabel, target: target }),
62
- React.createElement("span", { className: index.classNames("arc-HeroButton-inner") },
63
- label && React.createElement("span", { className: "arc-HeroButton-label" }, label),
64
- isLoading && (React.createElement("span", { className: "arc-HeroButton-icon" },
65
- React.createElement(Spinner.Spinner, { size: "xxl" }))),
66
- icon && !isLoading && (React.createElement("span", { className: "arc-HeroButton-icon" },
67
- React.createElement(Icon.Icon, { testId: "hero-button-icon", size: 48, icon: buttonStyle === "warning"
68
- ? HeroButtonIcons["warning"]
69
- : HeroButtonIcons[icon] }))))));
70
- }
71
- return (React.createElement("button", filterAttrs.__assign({}, commonProps, { className: HeroButtonClasses, "aria-label": ariaLabel, disabled: isLoading, type: type, form: form }),
72
- React.createElement("span", { className: index.classNames("arc-HeroButton-inner") },
73
- label && React.createElement("span", { className: "arc-HeroButton-label" }, label),
74
- icon && !isLoading && (React.createElement("span", { className: "arc-HeroButton-icon" },
75
- React.createElement(Icon.Icon, { testId: "hero-button-icon", size: 48, icon: buttonStyle === "warning"
76
- ? HeroButtonIcons["warning"]
77
- : HeroButtonIcons[icon] }))),
78
- isLoading && (React.createElement("span", { className: "arc-HeroButton-icon" },
79
- React.createElement(Spinner.Spinner, { size: "xxl" }))))));
80
- });
81
-
82
- exports.HeroButton = HeroButton;
@@ -1,57 +0,0 @@
1
- 'use strict';
2
-
3
- var filterAttrs = require('./filter-attrs-eK6E_34o.cjs');
4
- var React = require('react');
5
- var index = require('./index-CTlXMLug.cjs');
6
- var Image = require('./Image-C1pcrfnN.cjs');
7
- var Heading = require('./Heading-BEMSkLYR.cjs');
8
- var Surface = require('./Surface-BFx1yNsq.cjs');
9
- var Text = require('./Text-Cr5nmYmx.cjs');
10
- var VerticalSpace = require('./VerticalSpace-BJvST6WP.cjs');
11
- var CardHeading = require('./CardHeading-Cl0D1Khp.cjs');
12
- var CardFooter = require('./CardFooter-ChphRFHe.cjs');
13
- var ConditionalWrapper = require('./ConditionalWrapper-C09Kw6EG.cjs');
14
-
15
- var VideoPlayer = React.lazy(function () {
16
- return Promise.resolve().then(function () { return require('../../VideoPlayer/VideoPlayer.cjs'); }).then(function (_a) {
17
- var VideoPlayer = _a.VideoPlayer;
18
- return ({
19
- default: VideoPlayer,
20
- });
21
- });
22
- });
23
- /**
24
- * Use `MediaCard` to contain content and an image about a single subject.
25
- */
26
- var MediaCard = function (_a) {
27
- var media = _a.media, url = _a.url, onClick = _a.onClick, heading = _a.heading, label = _a.label, text = _a.text, metaText = _a.metaText, minHeight = _a.minHeight, _b = _a.buttonIcon, buttonIcon = _b === void 0 ? "arrow" : _b, _c = _a.isContained, isContained = _c === void 0 ? true : _c, _d = _a.headingLevel, headingLevel = _d === void 0 ? "2" : _d, props = filterAttrs.__rest(_a, ["media", "url", "onClick", "heading", "label", "text", "metaText", "minHeight", "buttonIcon", "isContained", "headingLevel"]);
28
- var surface = React.useContext(Surface.Context).surface;
29
- var _e = React.useState(false), isClient = _e[0], setIsClient = _e[1];
30
- var _f = React.useState(false), showHoverState = _f[0], setShowHoverState = _f[1];
31
- var handleShowHoverState = function (show) { return function () { return setShowHoverState(show); }; };
32
- React.useEffect(function () {
33
- setIsClient(true);
34
- }, []);
35
- return (React.createElement("div", filterAttrs.__assign({ style: { minHeight: minHeight }, className: index.classNames("arc-MediaCard", {
36
- "arc-MediaCard--outlined": url && isContained && showHoverState,
37
- "arc-MediaCard--contained": isContained,
38
- "arc-MediaCard--onDarkSurface": surface === "dark",
39
- }) }, filterAttrs.filterAttrs(props)),
40
- React.createElement(ConditionalWrapper.ConditionalWrapper, { condition: isContained, wrapper: function (children) { return (React.createElement(Surface.Surface, { growVertically: true, background: "light-white" }, children)); } },
41
- media.type === "img" && (React.createElement("div", { className: "arc-MediaCard-imgContainer" },
42
- React.createElement(Image.Image, filterAttrs.__assign({}, media)))),
43
- media.type === "video" && isClient && (React.createElement(React.Suspense, { fallback: null },
44
- React.createElement(VideoPlayer, filterAttrs.__assign({ isSupportingTextHidden: true }, media)))),
45
- React.createElement("div", { className: "arc-MediaCard-content" },
46
- label && (React.createElement("div", { className: "arc-MediaCard-label" },
47
- React.createElement(Heading.Heading, { level: "3", fontStyle: "overline" }, label),
48
- React.createElement(VerticalSpace.VerticalSpace, { size: "16" }))),
49
- React.createElement(CardHeading.CardHeading, { heading: heading, headingLevel: headingLevel, href: media.type !== "video" ? url : undefined, onClick: media.type !== "video" ? onClick : undefined, onMouseEnter: handleShowHoverState(true), onMouseLeave: handleShowHoverState(false), onFocus: handleShowHoverState(true), onBlur: handleShowHoverState(false) }),
50
- React.createElement("div", { className: "arc-MediaCard-textContainer" }, text && (React.createElement(React.Fragment, null,
51
- React.createElement(VerticalSpace.VerticalSpace, { size: "16" }),
52
- React.createElement(Text.Text, null, text),
53
- (url || metaText) && React.createElement(VerticalSpace.VerticalSpace, { size: "24" })))),
54
- React.createElement(CardFooter.CardFooter, { buttonIcon: buttonIcon, metaText: metaText, showButton: Boolean(url) && media.type !== "video", isHovered: showHoverState })))));
55
- };
56
-
57
- exports.MediaCard = MediaCard;