@cloudscape-design/components-themeable 3.0.1228 → 3.0.1230

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 (67) hide show
  1. package/lib/internal/manifest.json +1 -1
  2. package/lib/internal/scss/error-boundary/styles.scss +2 -1
  3. package/lib/internal/scss/internal/generated/custom-css-properties/index.scss +1 -1
  4. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-ai-drawer.d.ts.map +1 -1
  5. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-ai-drawer.js +52 -46
  6. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-ai-drawer.js.map +1 -1
  7. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-bottom-drawer.d.ts.map +1 -1
  8. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-bottom-drawer.js +66 -64
  9. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-bottom-drawer.js.map +1 -1
  10. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-drawer.d.ts.map +1 -1
  11. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-drawer.js +56 -54
  12. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-drawer.js.map +1 -1
  13. package/lib/internal/template/app-layout/visual-refresh-toolbar/index.d.ts.map +1 -1
  14. package/lib/internal/template/app-layout/visual-refresh-toolbar/index.js +3 -1
  15. package/lib/internal/template/app-layout/visual-refresh-toolbar/index.js.map +1 -1
  16. package/lib/internal/template/app-layout/visual-refresh-toolbar/internal.d.ts +5 -5
  17. package/lib/internal/template/app-layout/visual-refresh-toolbar/internal.d.ts.map +1 -1
  18. package/lib/internal/template/app-layout/visual-refresh-toolbar/state/index.d.ts +3 -2
  19. package/lib/internal/template/app-layout/visual-refresh-toolbar/state/index.d.ts.map +1 -1
  20. package/lib/internal/template/app-layout/visual-refresh-toolbar/state/index.js +6 -1
  21. package/lib/internal/template/app-layout/visual-refresh-toolbar/state/index.js.map +1 -1
  22. package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/drawer-triggers.d.ts.map +1 -1
  23. package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/drawer-triggers.js +54 -49
  24. package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/drawer-triggers.js.map +1 -1
  25. package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/index.d.ts.map +1 -1
  26. package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/index.js +31 -26
  27. package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/index.js.map +1 -1
  28. package/lib/internal/template/app-layout/visual-refresh-toolbar/widget-areas/after-main-slot.d.ts +3 -2
  29. package/lib/internal/template/app-layout/visual-refresh-toolbar/widget-areas/after-main-slot.d.ts.map +1 -1
  30. package/lib/internal/template/app-layout/visual-refresh-toolbar/widget-areas/after-main-slot.js +6 -2
  31. package/lib/internal/template/app-layout/visual-refresh-toolbar/widget-areas/after-main-slot.js.map +1 -1
  32. package/lib/internal/template/app-layout/visual-refresh-toolbar/widget-areas/before-main-slot.d.ts +3 -2
  33. package/lib/internal/template/app-layout/visual-refresh-toolbar/widget-areas/before-main-slot.d.ts.map +1 -1
  34. package/lib/internal/template/app-layout/visual-refresh-toolbar/widget-areas/before-main-slot.js +6 -2
  35. package/lib/internal/template/app-layout/visual-refresh-toolbar/widget-areas/before-main-slot.js.map +1 -1
  36. package/lib/internal/template/app-layout/visual-refresh-toolbar/widget-areas/bottom-content-slot.d.ts +3 -2
  37. package/lib/internal/template/app-layout/visual-refresh-toolbar/widget-areas/bottom-content-slot.d.ts.map +1 -1
  38. package/lib/internal/template/app-layout/visual-refresh-toolbar/widget-areas/bottom-content-slot.js +6 -1
  39. package/lib/internal/template/app-layout/visual-refresh-toolbar/widget-areas/bottom-content-slot.js.map +1 -1
  40. package/lib/internal/template/app-layout/visual-refresh-toolbar/widget-areas/top-content-slot.d.ts +3 -2
  41. package/lib/internal/template/app-layout/visual-refresh-toolbar/widget-areas/top-content-slot.d.ts.map +1 -1
  42. package/lib/internal/template/app-layout/visual-refresh-toolbar/widget-areas/top-content-slot.js +4 -1
  43. package/lib/internal/template/app-layout/visual-refresh-toolbar/widget-areas/top-content-slot.js.map +1 -1
  44. package/lib/internal/template/date-range-picker/index.d.ts.map +1 -1
  45. package/lib/internal/template/date-range-picker/index.js +7 -4
  46. package/lib/internal/template/date-range-picker/index.js.map +1 -1
  47. package/lib/internal/template/date-range-picker/interfaces.d.ts +7 -0
  48. package/lib/internal/template/date-range-picker/interfaces.d.ts.map +1 -1
  49. package/lib/internal/template/date-range-picker/interfaces.js.map +1 -1
  50. package/lib/internal/template/error-boundary/interfaces.d.ts +3 -0
  51. package/lib/internal/template/error-boundary/interfaces.d.ts.map +1 -1
  52. package/lib/internal/template/error-boundary/interfaces.js.map +1 -1
  53. package/lib/internal/template/error-boundary/internal.d.ts +2 -1
  54. package/lib/internal/template/error-boundary/internal.d.ts.map +1 -1
  55. package/lib/internal/template/error-boundary/internal.js +11 -0
  56. package/lib/internal/template/error-boundary/internal.js.map +1 -1
  57. package/lib/internal/template/error-boundary/styles.css.js +5 -4
  58. package/lib/internal/template/error-boundary/styles.scoped.css +5 -4
  59. package/lib/internal/template/error-boundary/styles.selectors.js +5 -4
  60. package/lib/internal/template/internal/base-component/styles.scoped.css +1 -1
  61. package/lib/internal/template/internal/components/button-trigger/index.d.ts +0 -1
  62. package/lib/internal/template/internal/components/button-trigger/index.d.ts.map +1 -1
  63. package/lib/internal/template/internal/components/button-trigger/index.js +1 -2
  64. package/lib/internal/template/internal/components/button-trigger/index.js.map +1 -1
  65. package/lib/internal/template/internal/environment.js +2 -2
  66. package/lib/internal/template/internal/environment.json +2 -2
  67. package/package.json +1 -1
@@ -2,12 +2,13 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import React from 'react';
4
4
  import clsx from 'clsx';
5
+ import { AppLayoutBuiltInErrorBoundary } from '../../../error-boundary/internal';
5
6
  import { highContrastHeaderClassName } from '../../../internal/utils/content-header-utils';
6
7
  import { createWidgetizedComponent } from '../../../internal/widgets';
7
8
  import { AppLayoutNotificationsImplementation as AppLayoutNotifications } from '../notifications';
8
9
  import { isWidgetReady } from '../state/invariants';
9
10
  import styles from '../skeleton/styles.css.js';
10
- export const TopContentSlotImplementation = ({ appLayoutProps, appLayoutState }) => {
11
+ export const TopContentSlotImplementationInternal = ({ appLayoutProps, appLayoutState }) => {
11
12
  if (!isWidgetReady(appLayoutState)) {
12
13
  return null;
13
14
  }
@@ -15,5 +16,7 @@ export const TopContentSlotImplementation = ({ appLayoutProps, appLayoutState })
15
16
  appLayoutProps.notifications && (React.createElement("div", { className: clsx(styles['notifications-background'], appLayoutProps.headerVariant === 'high-contrast' && highContrastHeaderClassName) })),
16
17
  appLayoutProps.notifications && (React.createElement(AppLayoutNotifications, { appLayoutInternals: appLayoutState.appLayoutInternals }, appLayoutProps.notifications))));
17
18
  };
19
+ export const TopContentSlotImplementation = (props) => (React.createElement(AppLayoutBuiltInErrorBoundary, null,
20
+ React.createElement(TopContentSlotImplementationInternal, { ...props })));
18
21
  export const createWidgetizedAppLayoutTopContentSlot = createWidgetizedComponent(TopContentSlotImplementation);
19
22
  //# sourceMappingURL=top-content-slot.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"top-content-slot.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/widget-areas/top-content-slot.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,2BAA2B,EAAE,MAAM,8CAA8C,CAAC;AAC3F,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,oCAAoC,IAAI,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAElG,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,MAAM,MAAM,2BAA2B,CAAC;AAE/C,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,EAAE,cAAc,EAAE,cAAc,EAAqB,EAAE,EAAE;IACpG,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,EAAE,CAAC;QACnC,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,CACL;QACG,cAAc,CAAC,aAAa,IAAI,CAC/B,6BACE,SAAS,EAAE,IAAI,CACb,MAAM,CAAC,0BAA0B,CAAC,EAClC,cAAc,CAAC,aAAa,KAAK,eAAe,IAAI,2BAA2B,CAChF,GACI,CACR;QACA,cAAc,CAAC,aAAa,IAAI,CAC/B,oBAAC,sBAAsB,IAAC,kBAAkB,EAAE,cAAc,CAAC,kBAAkB,IAC1E,cAAc,CAAC,aAAa,CACN,CAC1B,CACA,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,uCAAuC,GAAG,yBAAyB,CAAC,4BAA4B,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport { highContrastHeaderClassName } from '../../../internal/utils/content-header-utils';\nimport { createWidgetizedComponent } from '../../../internal/widgets';\nimport { AppLayoutNotificationsImplementation as AppLayoutNotifications } from '../notifications';\nimport { SkeletonPartProps } from '../skeleton/interfaces';\nimport { isWidgetReady } from '../state/invariants';\n\nimport styles from '../skeleton/styles.css.js';\n\nexport const TopContentSlotImplementation = ({ appLayoutProps, appLayoutState }: SkeletonPartProps) => {\n if (!isWidgetReady(appLayoutState)) {\n return null;\n }\n return (\n <>\n {appLayoutProps.notifications && (\n <div\n className={clsx(\n styles['notifications-background'],\n appLayoutProps.headerVariant === 'high-contrast' && highContrastHeaderClassName\n )}\n ></div>\n )}\n {appLayoutProps.notifications && (\n <AppLayoutNotifications appLayoutInternals={appLayoutState.appLayoutInternals}>\n {appLayoutProps.notifications}\n </AppLayoutNotifications>\n )}\n </>\n );\n};\n\nexport const createWidgetizedAppLayoutTopContentSlot = createWidgetizedComponent(TopContentSlotImplementation);\n"]}
1
+ {"version":3,"file":"top-content-slot.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/widget-areas/top-content-slot.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,EAAE,2BAA2B,EAAE,MAAM,8CAA8C,CAAC;AAC3F,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,oCAAoC,IAAI,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAElG,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,MAAM,MAAM,2BAA2B,CAAC;AAE/C,MAAM,CAAC,MAAM,oCAAoC,GAAG,CAAC,EAAE,cAAc,EAAE,cAAc,EAAqB,EAAE,EAAE;IAC5G,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,EAAE,CAAC;QACnC,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,CACL;QACG,cAAc,CAAC,aAAa,IAAI,CAC/B,6BACE,SAAS,EAAE,IAAI,CACb,MAAM,CAAC,0BAA0B,CAAC,EAClC,cAAc,CAAC,aAAa,KAAK,eAAe,IAAI,2BAA2B,CAChF,GACI,CACR;QACA,cAAc,CAAC,aAAa,IAAI,CAC/B,oBAAC,sBAAsB,IAAC,kBAAkB,EAAE,cAAc,CAAC,kBAAkB,IAC1E,cAAc,CAAC,aAAa,CACN,CAC1B,CACA,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,KAAwB,EAAE,EAAE,CAAC,CACxE,oBAAC,6BAA6B;IAC5B,oBAAC,oCAAoC,OAAK,KAAK,GAAI,CACrB,CACjC,CAAC;AAEF,MAAM,CAAC,MAAM,uCAAuC,GAAG,yBAAyB,CAAC,4BAA4B,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport { AppLayoutBuiltInErrorBoundary } from '../../../error-boundary/internal';\nimport { highContrastHeaderClassName } from '../../../internal/utils/content-header-utils';\nimport { createWidgetizedComponent } from '../../../internal/widgets';\nimport { AppLayoutNotificationsImplementation as AppLayoutNotifications } from '../notifications';\nimport { SkeletonPartProps } from '../skeleton/interfaces';\nimport { isWidgetReady } from '../state/invariants';\n\nimport styles from '../skeleton/styles.css.js';\n\nexport const TopContentSlotImplementationInternal = ({ appLayoutProps, appLayoutState }: SkeletonPartProps) => {\n if (!isWidgetReady(appLayoutState)) {\n return null;\n }\n return (\n <>\n {appLayoutProps.notifications && (\n <div\n className={clsx(\n styles['notifications-background'],\n appLayoutProps.headerVariant === 'high-contrast' && highContrastHeaderClassName\n )}\n ></div>\n )}\n {appLayoutProps.notifications && (\n <AppLayoutNotifications appLayoutInternals={appLayoutState.appLayoutInternals}>\n {appLayoutProps.notifications}\n </AppLayoutNotifications>\n )}\n </>\n );\n};\n\nexport const TopContentSlotImplementation = (props: SkeletonPartProps) => (\n <AppLayoutBuiltInErrorBoundary>\n <TopContentSlotImplementationInternal {...props} />\n </AppLayoutBuiltInErrorBoundary>\n);\n\nexport const createWidgetizedAppLayoutTopContentSlot = createWidgetizedComponent(TopContentSlotImplementation);\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/date-range-picker/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAA2C,MAAM,OAAO,CAAC;AA0BhE,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAOpD,OAAO,EAAE,oBAAoB,EAAE,CAAC;AAmDhC,QAAA,MAAM,eAAe,uGAgRpB,CAAC;AAGF,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/date-range-picker/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAA2C,MAAM,OAAO,CAAC;AA0BhE,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAOpD,OAAO,EAAE,oBAAoB,EAAE,CAAC;AAmDhC,QAAA,MAAM,eAAe,uGA6RpB,CAAC;AAGF,eAAe,eAAe,CAAC"}
@@ -56,7 +56,7 @@ function renderDateRange({ locale, range, placeholder = '', formatRelativeRange,
56
56
  React.createElement("span", null, secondPart && ' — '),
57
57
  React.createElement("span", { className: styles['label-token-nowrap'] }, secondPart)));
58
58
  }
59
- const DateRangePicker = React.forwardRef(({ locale = '', startOfWeek, isDateEnabled = () => true, dateDisabledReason, value, placeholder, readOnly = false, disabled = false, onChange, onBlur, onFocus, relativeOptions = [], i18nStrings, isValidRange = () => ({ valid: true }), showClearButton = true, dateOnly = false, timeOffset, getTimeOffset, timeInputFormat = 'hh:mm:ss', dateInputFormat = 'slashed', expandToViewport = false, rangeSelectorMode = 'default', customAbsoluteRangeControl, absoluteFormat = 'iso', hideTimeOffset, customRelativeRangeUnits, renderRelativeRangeContent, granularity = 'day', ...rest }, ref) => {
59
+ const DateRangePicker = React.forwardRef(({ locale = '', startOfWeek, isDateEnabled = () => true, dateDisabledReason, value, placeholder, readOnly = false, disabled = false, onChange, onBlur, onFocus, relativeOptions = [], i18nStrings, isValidRange = () => ({ valid: true }), showClearButton = true, dateOnly = false, ariaLabel, timeOffset, getTimeOffset, timeInputFormat = 'hh:mm:ss', dateInputFormat = 'slashed', expandToViewport = false, rangeSelectorMode = 'default', customAbsoluteRangeControl, absoluteFormat = 'iso', hideTimeOffset, customRelativeRangeUnits, renderRelativeRangeContent, granularity = 'day', ...rest }, ref) => {
60
60
  var _a, _b;
61
61
  const { __internalRootRef } = useBaseComponent('DateRangePicker', {
62
62
  props: {
@@ -81,11 +81,13 @@ const DateRangePicker = React.forwardRef(({ locale = '', startOfWeek, isDateEnab
81
81
  : normalizeTimeOffset(value, getTimeOffset, timeOffset);
82
82
  value = formatInitialValue(value, dateOnly, isMonthOnly, normalizedTimeOffset);
83
83
  const baseProps = getBaseProps(rest);
84
- const { invalid, warning, controlId, ariaDescribedby, ariaLabelledby } = useFormFieldContext({
84
+ const ariaLabelId = useUniqueId('date-range-picker-arialabel-');
85
+ const { invalid, warning, controlId, ariaDescribedby, ariaLabelledby: contextAriaLabelledby, } = useFormFieldContext({
85
86
  ariaLabelledby: (_a = rest.ariaLabelledby) !== null && _a !== void 0 ? _a : i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.ariaLabelledby,
86
87
  ariaDescribedby: (_b = rest.ariaDescribedby) !== null && _b !== void 0 ? _b : i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.ariaDescribedby,
87
88
  ...rest,
88
89
  });
90
+ const ariaLabelledby = joinStrings(contextAriaLabelledby, ariaLabelId);
89
91
  const isSingleGrid = useMobile();
90
92
  const triggerRef = useRef(null);
91
93
  useForwardFocus(ref, triggerRef);
@@ -168,7 +170,7 @@ const DateRangePicker = React.forwardRef(({ locale = '', startOfWeek, isDateEnab
168
170
  hideTimeOffset: hideTime || hideTimeOffset,
169
171
  timeOffset: normalizedTimeOffset,
170
172
  });
171
- const trigger = (React.createElement(ButtonTrigger, { ref: triggerRef, id: controlId, invalid: invalid, warning: warning, ariaLabelledby: joinStrings(ariaLabelledby, triggerContentId), ariaLabel: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.ariaLabel, ariaDescribedby: ariaDescribedby, className: clsx(testutilStyles.label, styles.label, {
173
+ const trigger = (React.createElement(ButtonTrigger, { ref: triggerRef, id: controlId, invalid: invalid, warning: warning, ariaLabelledby: joinStrings(ariaLabelledby, triggerContentId), ariaDescribedby: ariaDescribedby, className: clsx(testutilStyles.label, styles.label, {
172
174
  [styles['label-enabled']]: !readOnly && !disabled,
173
175
  }), hideCaret: true, onClick: () => {
174
176
  setIsDropDownOpen(true);
@@ -181,7 +183,8 @@ const DateRangePicker = React.forwardRef(({ locale = '', startOfWeek, isDateEnab
181
183
  return (React.createElement("div", { ...baseProps, ref: mergedRef, className: clsx(baseProps.className, styles.root, testutilStyles.root, absoluteFormat === 'long-localized' && !dateOnly && !isMonthOnly && styles.wide), onKeyDown: onWrapperKeyDownHandler },
182
184
  React.createElement(Dropdown, { stretchHeight: true, open: isDropDownOpen, onOutsideClick: () => closeDropdown(), trigger: trigger, expandToViewport: expandToViewport, dropdownId: dropdownId, content:
183
185
  /* Reset form field context to prevent a wrapper form field from labelling all inputs inside the dropdown. */
184
- React.createElement(ResetContextsForModal, null, isDropDownOpen && (React.createElement(DateRangePickerDropdown, { startOfWeek: startOfWeek, locale: normalizedLocale, isSingleGrid: isSingleGrid, onOutsideClick: () => closeDropdown(true), value: value, showClearButton: showClearButton, isDateEnabled: isDateEnabled, dateDisabledReason: dateDisabledReason, i18nStrings: i18nStrings, onClear: onClear, onApply: onApply, getTimeOffset: getTimeOffset, timeOffset: timeOffset, relativeOptions: relativeOptions, isValidRange: isValidRange, dateOnly: dateOnly, absoluteFormat: absoluteFormat, timeInputFormat: timeInputFormat, dateInputFormat: dateInputFormat, rangeSelectorMode: rangeSelectorMode, ariaLabelledby: ariaLabelledby, ariaDescribedby: ariaDescribedby, customAbsoluteRangeControl: customAbsoluteRangeControl, customRelativeRangeUnits: customRelativeRangeUnits, renderRelativeRangeContent: renderRelativeRangeContent, granularity: granularity }))) })));
186
+ React.createElement(ResetContextsForModal, null, isDropDownOpen && (React.createElement(DateRangePickerDropdown, { startOfWeek: startOfWeek, locale: normalizedLocale, isSingleGrid: isSingleGrid, onOutsideClick: () => closeDropdown(true), value: value, showClearButton: showClearButton, isDateEnabled: isDateEnabled, dateDisabledReason: dateDisabledReason, i18nStrings: i18nStrings, onClear: onClear, onApply: onApply, getTimeOffset: getTimeOffset, timeOffset: timeOffset, relativeOptions: relativeOptions, isValidRange: isValidRange, dateOnly: dateOnly, absoluteFormat: absoluteFormat, timeInputFormat: timeInputFormat, dateInputFormat: dateInputFormat, rangeSelectorMode: rangeSelectorMode, ariaLabelledby: ariaLabelledby, ariaDescribedby: ariaDescribedby, customAbsoluteRangeControl: customAbsoluteRangeControl, customRelativeRangeUnits: customRelativeRangeUnits, renderRelativeRangeContent: renderRelativeRangeContent, granularity: granularity }))) }),
187
+ React.createElement("div", { id: ariaLabelId, hidden: true }, ariaLabel || (i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.ariaLabel))));
185
188
  });
186
189
  applyDisplayName(DateRangePicker, 'DateRangePicker');
187
190
  export default DateRangePicker;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/date-range-picker/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,YAAY,CAAC;AACb,OAAO,KAAK,EAAE,EAAO,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AAEpG,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,YAAY,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,aAAa,MAAM,uCAAuC,CAAC;AAClE,OAAO,QAAQ,MAAM,iCAAiC,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,qBAAqB,MAAM,iDAAiD,CAAC;AACpF,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,eAAe,MAAM,oC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ClD,0BAA0B,EAAE,0BAA0B,EACtD,WAAW,EAAE,WAAW,GACxB,CACH,CACqB,GAE1B,CACE,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,gBAAgB,CAAC,eAAe,EAAE,iBAAiB,CAAC,CAAC;AACrD,eAAe,eAAe,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n'use client';\nimport React, { Ref, useEffect, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { useMergeRefs, useUniqueId, warnOnce } from '@cloudscape-design/component-toolkit/internal';\n\nimport { useInternalI18n } from '../i18n/context';\nimport InternalIcon from '../icon/internal';\nimport { getBaseProps } from '../internal/base-component';\nimport ButtonTrigger from '../internal/components/button-trigger';\nimport Dropdown from '../internal/components/dropdown';\nimport { useFormFieldContext } from '../internal/context/form-field-context';\nimport ResetContextsForModal from '../internal/context/reset-contexts-for-modal.js';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport checkControlled from '../internal/hooks/check-controlled';\nimport useForwardFocus from '../internal/hooks/forward-focus';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { useFocusTracker } from '../internal/hooks/use-focus-tracker';\nimport { useMobile } from '../internal/hooks/use-mobile';\nimport { usePrevious } from '../internal/hooks/use-previous';\nimport { isDevelopment } from '../internal/is-development.js';\nimport { KeyCode } from '../internal/keycode';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { formatDateTimeWithOffset } from '../internal/utils/date-time/format-date-time-with-offset';\nimport { normalizeLocale } from '../internal/utils/locale';\nimport { joinStrings } from '../internal/utils/strings/join-strings';\nimport { DateRangePickerDropdown } from './dropdown';\nimport { DateRangePickerProps } from './interfaces';\nimport { normalizeTimeOffset } from './time-offset';\nimport { formatInitialValue, formatValue } from './utils';\n\nimport styles from './styles.css.js';\nimport testutilStyles from './test-classes/styles.css.js';\n\nexport { DateRangePickerProps };\n\nfunction renderDateRange({\n locale,\n range,\n placeholder = '',\n formatRelativeRange,\n absoluteFormat,\n hideTimeOffset,\n timeOffset,\n}: {\n locale?: string;\n range: null | DateRangePickerProps.Value;\n placeholder?: string;\n formatRelativeRange: DateRangePickerProps.I18nStrings['formatRelativeRange'];\n absoluteFormat: DateRangePickerProps.AbsoluteFormat;\n hideTimeOffset?: boolean;\n timeOffset: { startDate?: number; endDate?: number };\n}) {\n const firstPart = range\n ? range.type === 'relative'\n ? (formatRelativeRange?.(range) ?? '')\n : formatDateTimeWithOffset({\n date: range.startDate,\n timeOffset: timeOffset.startDate,\n hideTimeOffset,\n format: absoluteFormat,\n locale,\n })\n : placeholder;\n\n const secondPart =\n range?.type === 'absolute'\n ? formatDateTimeWithOffset({\n date: range.endDate,\n timeOffset: timeOffset.endDate,\n hideTimeOffset,\n format: absoluteFormat,\n locale,\n })\n : '';\n\n return (\n <span className={(!range && styles['label-text']) || undefined} aria-disabled={!range}>\n <span className={range?.type === 'absolute' ? styles['label-token-nowrap'] : undefined}>{firstPart}</span>\n <span>{secondPart && ' — '}</span>\n <span className={styles['label-token-nowrap']}>{secondPart}</span>\n </span>\n );\n}\n\nconst DateRangePicker = React.forwardRef(\n (\n {\n locale = '',\n startOfWeek,\n isDateEnabled = () => true,\n dateDisabledReason,\n value,\n placeholder,\n readOnly = false,\n disabled = false,\n onChange,\n onBlur,\n onFocus,\n relativeOptions = [],\n i18nStrings,\n isValidRange = () => ({ valid: true }),\n showClearButton = true,\n dateOnly = false,\n timeOffset,\n getTimeOffset,\n timeInputFormat = 'hh:mm:ss',\n dateInputFormat = 'slashed',\n expandToViewport = false,\n rangeSelectorMode = 'default',\n customAbsoluteRangeControl,\n absoluteFormat = 'iso',\n hideTimeOffset,\n customRelativeRangeUnits,\n renderRelativeRangeContent,\n granularity = 'day',\n ...rest\n }: DateRangePickerProps,\n ref: Ref<DateRangePickerProps.Ref>\n ) => {\n const { __internalRootRef } = useBaseComponent('DateRangePicker', {\n props: {\n absoluteFormat,\n dateOnly,\n expandToViewport,\n rangeSelectorMode,\n readOnly,\n showClearButton,\n timeInputFormat,\n dateInputFormat,\n hideTimeOffset,\n granularity,\n },\n metadata: { hasDisabledReasons: Boolean(dateDisabledReason) },\n });\n const isMonthOnly = granularity === 'month';\n const hideTime = dateOnly || isMonthOnly;\n checkControlled('DateRangePicker', 'value', value, 'onChange', onChange);\n\n const normalizedTimeOffset = hideTime\n ? { startDate: undefined, endDate: undefined }\n : normalizeTimeOffset(value, getTimeOffset, timeOffset);\n value = formatInitialValue(value, dateOnly, isMonthOnly, normalizedTimeOffset);\n const baseProps = getBaseProps(rest);\n const { invalid, warning, controlId, ariaDescribedby, ariaLabelledby } = useFormFieldContext({\n ariaLabelledby: rest.ariaLabelledby ?? i18nStrings?.ariaLabelledby,\n ariaDescribedby: rest.ariaDescribedby ?? i18nStrings?.ariaDescribedby,\n ...rest,\n });\n const isSingleGrid = useMobile();\n\n const triggerRef = useRef<HTMLButtonElement | null>(null);\n useForwardFocus(ref, triggerRef);\n\n const rootRef = useRef<HTMLDivElement>(null);\n const dropdownId = useUniqueId('date-range-picker-dropdown');\n const triggerContentId = useUniqueId('date-range-picker-trigger');\n\n useFocusTracker({ rootRef, onBlur, onFocus });\n\n const [isDropDownOpen, setIsDropDownOpen] = useState<boolean>(false);\n\n const normalizedLocale = normalizeLocale('DateRangePicker', locale);\n\n const closeDropdown = (focusTrigger = false) => {\n setIsDropDownOpen(false);\n if (focusTrigger) {\n triggerRef.current?.focus();\n }\n };\n\n const onWrapperKeyDownHandler = (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.keyCode === KeyCode.escape) {\n if (isDropDownOpen) {\n event.stopPropagation();\n }\n closeDropdown(true);\n }\n };\n\n const onClear = () => {\n fireNonCancelableEvent(onChange, { value: null });\n };\n\n const onApply = (newValue: null | DateRangePickerProps.Value): DateRangePickerProps.ValidationResult => {\n const formattedValue = formatValue(newValue, {\n dateOnly,\n monthOnly: isMonthOnly,\n timeOffset: hideTime\n ? { startDate: undefined, endDate: undefined }\n : normalizeTimeOffset(newValue, getTimeOffset, timeOffset),\n });\n\n const validationResult = isValidRange(formattedValue);\n if (validationResult?.valid === false) {\n return validationResult;\n }\n\n if (isDevelopment) {\n if (newValue?.type === 'absolute') {\n const [startDateWithoutTime] = newValue.startDate.split('T');\n const [endDateWithoutTime] = newValue.endDate.split('T');\n if (!startDateWithoutTime || !endDateWithoutTime) {\n warnOnce(\n 'DateRangePicker',\n 'You have provided an `isValidRange` prop that did not catch a missing start or end date.'\n );\n }\n }\n }\n fireNonCancelableEvent(onChange, { value: formattedValue });\n return validationResult || { valid: true };\n };\n\n const prevDateOnly = usePrevious(dateOnly);\n useEffect(() => {\n if (prevDateOnly !== undefined && prevDateOnly !== dateOnly) {\n warnOnce(\n 'DateRangePicker',\n `The provided \\`dateOnly\\` flag has been changed from \"${prevDateOnly}\" to \"${dateOnly}\" which can lead to unexpected value format. Consider using separate components.`\n );\n }\n }, [prevDateOnly, dateOnly]);\n\n if (value && value.type !== 'absolute' && value.type !== 'relative') {\n warnOnce('DateRangePicker', 'You provided an invalid value. Reverting back to default.');\n value = null;\n }\n\n if (\n (value?.type === 'absolute' && rangeSelectorMode === 'relative-only') ||\n (value?.type === 'relative' && rangeSelectorMode === 'absolute-only')\n ) {\n warnOnce(\n 'DateRangePicker',\n 'The provided value does not correspond to the current range selector mode. Reverting back to default.'\n );\n value = null;\n }\n\n const i18n = useInternalI18n('date-range-picker');\n const formatRelativeRange = i18n(\n 'i18nStrings.formatRelativeRange',\n i18nStrings?.formatRelativeRange,\n format =>\n ({ amount, unit }) =>\n format({ amount, unit })\n );\n\n if (isDevelopment) {\n if (!formatRelativeRange && rangeSelectorMode !== 'absolute-only') {\n warnOnce(\n 'DateRangePicker',\n 'A function for i18nStrings.formatRelativeRange was not provided. Relative ranges will not be correctly rendered.'\n );\n }\n }\n\n const formattedDate: string | JSX.Element = renderDateRange({\n locale: normalizedLocale,\n range: value,\n placeholder,\n formatRelativeRange,\n absoluteFormat,\n hideTimeOffset: hideTime || hideTimeOffset,\n timeOffset: normalizedTimeOffset,\n });\n\n const trigger = (\n <ButtonTrigger\n ref={triggerRef}\n id={controlId}\n invalid={invalid}\n warning={warning}\n ariaLabelledby={joinStrings(ariaLabelledby, triggerContentId)}\n ariaLabel={i18nStrings?.ariaLabel}\n ariaDescribedby={ariaDescribedby}\n className={clsx(testutilStyles.label, styles.label, {\n [styles['label-enabled']]: !readOnly && !disabled,\n })}\n hideCaret={true}\n onClick={() => {\n setIsDropDownOpen(true);\n }}\n disabled={disabled}\n readOnly={readOnly}\n ariaHasPopup=\"dialog\"\n >\n <span className={styles['trigger-flexbox']}>\n <span className={styles['icon-wrapper']}>\n <InternalIcon name=\"calendar\" variant={disabled || readOnly ? 'disabled' : 'normal'} />\n </span>\n <span id={triggerContentId}>{formattedDate}</span>\n </span>\n </ButtonTrigger>\n );\n\n const mergedRef = useMergeRefs(rootRef, __internalRootRef);\n\n return (\n <div\n {...baseProps}\n ref={mergedRef}\n className={clsx(\n baseProps.className,\n styles.root,\n testutilStyles.root,\n absoluteFormat === 'long-localized' && !dateOnly && !isMonthOnly && styles.wide\n )}\n onKeyDown={onWrapperKeyDownHandler}\n >\n <Dropdown\n stretchHeight={true}\n open={isDropDownOpen}\n onOutsideClick={() => closeDropdown()}\n trigger={trigger}\n expandToViewport={expandToViewport}\n dropdownId={dropdownId}\n content={\n /* Reset form field context to prevent a wrapper form field from labelling all inputs inside the dropdown. */\n <ResetContextsForModal>\n {isDropDownOpen && (\n <DateRangePickerDropdown\n startOfWeek={startOfWeek}\n locale={normalizedLocale}\n isSingleGrid={isSingleGrid}\n onOutsideClick={() => closeDropdown(true)}\n value={value}\n showClearButton={showClearButton}\n isDateEnabled={isDateEnabled}\n dateDisabledReason={dateDisabledReason}\n i18nStrings={i18nStrings}\n onClear={onClear}\n onApply={onApply}\n getTimeOffset={getTimeOffset}\n timeOffset={timeOffset}\n relativeOptions={relativeOptions}\n isValidRange={isValidRange}\n dateOnly={dateOnly}\n absoluteFormat={absoluteFormat}\n timeInputFormat={timeInputFormat}\n dateInputFormat={dateInputFormat}\n rangeSelectorMode={rangeSelectorMode}\n ariaLabelledby={ariaLabelledby}\n ariaDescribedby={ariaDescribedby}\n customAbsoluteRangeControl={customAbsoluteRangeControl}\n customRelativeRangeUnits={customRelativeRangeUnits}\n renderRelativeRangeContent={renderRelativeRangeContent}\n granularity={granularity}\n />\n )}\n </ResetContextsForModal>\n }\n />\n </div>\n );\n }\n);\n\napplyDisplayName(DateRangePicker, 'DateRangePicker');\nexport default DateRangePicker;\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/date-range-picker/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,YAAY,CAAC;AACb,OAAO,KAAK,EAAE,EAAO,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AAEpG,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,YAAY,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,aAAa,MAAM,uCAAuC,CAAC;AAClE,OAAO,QAAQ,MAAM,iCAAiC,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,qBAAqB,MAAM,iDAAiD,CAAC;AACpF,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,eAAe,MAAM,oCAAoC,CAAC;AACjE,OAAO,eAAe,MAAM,iCAAiC,CAAC;AAC9D,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AACtE,OAAO,EAAE,SAA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BAAK,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,IAC/B,SAAS,KAAI,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,SAAS,CAAA,CAChC,CACF,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,gBAAgB,CAAC,eAAe,EAAE,iBAAiB,CAAC,CAAC;AACrD,eAAe,eAAe,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n'use client';\nimport React, { Ref, useEffect, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { useMergeRefs, useUniqueId, warnOnce } from '@cloudscape-design/component-toolkit/internal';\n\nimport { useInternalI18n } from '../i18n/context';\nimport InternalIcon from '../icon/internal';\nimport { getBaseProps } from '../internal/base-component';\nimport ButtonTrigger from '../internal/components/button-trigger';\nimport Dropdown from '../internal/components/dropdown';\nimport { useFormFieldContext } from '../internal/context/form-field-context';\nimport ResetContextsForModal from '../internal/context/reset-contexts-for-modal.js';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport checkControlled from '../internal/hooks/check-controlled';\nimport useForwardFocus from '../internal/hooks/forward-focus';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { useFocusTracker } from '../internal/hooks/use-focus-tracker';\nimport { useMobile } from '../internal/hooks/use-mobile';\nimport { usePrevious } from '../internal/hooks/use-previous';\nimport { isDevelopment } from '../internal/is-development.js';\nimport { KeyCode } from '../internal/keycode';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { formatDateTimeWithOffset } from '../internal/utils/date-time/format-date-time-with-offset';\nimport { normalizeLocale } from '../internal/utils/locale';\nimport { joinStrings } from '../internal/utils/strings/join-strings';\nimport { DateRangePickerDropdown } from './dropdown';\nimport { DateRangePickerProps } from './interfaces';\nimport { normalizeTimeOffset } from './time-offset';\nimport { formatInitialValue, formatValue } from './utils';\n\nimport styles from './styles.css.js';\nimport testutilStyles from './test-classes/styles.css.js';\n\nexport { DateRangePickerProps };\n\nfunction renderDateRange({\n locale,\n range,\n placeholder = '',\n formatRelativeRange,\n absoluteFormat,\n hideTimeOffset,\n timeOffset,\n}: {\n locale?: string;\n range: null | DateRangePickerProps.Value;\n placeholder?: string;\n formatRelativeRange: DateRangePickerProps.I18nStrings['formatRelativeRange'];\n absoluteFormat: DateRangePickerProps.AbsoluteFormat;\n hideTimeOffset?: boolean;\n timeOffset: { startDate?: number; endDate?: number };\n}) {\n const firstPart = range\n ? range.type === 'relative'\n ? (formatRelativeRange?.(range) ?? '')\n : formatDateTimeWithOffset({\n date: range.startDate,\n timeOffset: timeOffset.startDate,\n hideTimeOffset,\n format: absoluteFormat,\n locale,\n })\n : placeholder;\n\n const secondPart =\n range?.type === 'absolute'\n ? formatDateTimeWithOffset({\n date: range.endDate,\n timeOffset: timeOffset.endDate,\n hideTimeOffset,\n format: absoluteFormat,\n locale,\n })\n : '';\n\n return (\n <span className={(!range && styles['label-text']) || undefined} aria-disabled={!range}>\n <span className={range?.type === 'absolute' ? styles['label-token-nowrap'] : undefined}>{firstPart}</span>\n <span>{secondPart && ' — '}</span>\n <span className={styles['label-token-nowrap']}>{secondPart}</span>\n </span>\n );\n}\n\nconst DateRangePicker = React.forwardRef(\n (\n {\n locale = '',\n startOfWeek,\n isDateEnabled = () => true,\n dateDisabledReason,\n value,\n placeholder,\n readOnly = false,\n disabled = false,\n onChange,\n onBlur,\n onFocus,\n relativeOptions = [],\n i18nStrings,\n isValidRange = () => ({ valid: true }),\n showClearButton = true,\n dateOnly = false,\n ariaLabel,\n timeOffset,\n getTimeOffset,\n timeInputFormat = 'hh:mm:ss',\n dateInputFormat = 'slashed',\n expandToViewport = false,\n rangeSelectorMode = 'default',\n customAbsoluteRangeControl,\n absoluteFormat = 'iso',\n hideTimeOffset,\n customRelativeRangeUnits,\n renderRelativeRangeContent,\n granularity = 'day',\n ...rest\n }: DateRangePickerProps,\n ref: Ref<DateRangePickerProps.Ref>\n ) => {\n const { __internalRootRef } = useBaseComponent('DateRangePicker', {\n props: {\n absoluteFormat,\n dateOnly,\n expandToViewport,\n rangeSelectorMode,\n readOnly,\n showClearButton,\n timeInputFormat,\n dateInputFormat,\n hideTimeOffset,\n granularity,\n },\n metadata: { hasDisabledReasons: Boolean(dateDisabledReason) },\n });\n const isMonthOnly = granularity === 'month';\n const hideTime = dateOnly || isMonthOnly;\n checkControlled('DateRangePicker', 'value', value, 'onChange', onChange);\n\n const normalizedTimeOffset = hideTime\n ? { startDate: undefined, endDate: undefined }\n : normalizeTimeOffset(value, getTimeOffset, timeOffset);\n value = formatInitialValue(value, dateOnly, isMonthOnly, normalizedTimeOffset);\n\n const baseProps = getBaseProps(rest);\n const ariaLabelId = useUniqueId('date-range-picker-arialabel-');\n const {\n invalid,\n warning,\n controlId,\n ariaDescribedby,\n ariaLabelledby: contextAriaLabelledby,\n } = useFormFieldContext({\n ariaLabelledby: rest.ariaLabelledby ?? i18nStrings?.ariaLabelledby,\n ariaDescribedby: rest.ariaDescribedby ?? i18nStrings?.ariaDescribedby,\n ...rest,\n });\n const ariaLabelledby = joinStrings(contextAriaLabelledby, ariaLabelId);\n\n const isSingleGrid = useMobile();\n\n const triggerRef = useRef<HTMLButtonElement | null>(null);\n useForwardFocus(ref, triggerRef);\n\n const rootRef = useRef<HTMLDivElement>(null);\n const dropdownId = useUniqueId('date-range-picker-dropdown');\n const triggerContentId = useUniqueId('date-range-picker-trigger');\n\n useFocusTracker({ rootRef, onBlur, onFocus });\n\n const [isDropDownOpen, setIsDropDownOpen] = useState<boolean>(false);\n\n const normalizedLocale = normalizeLocale('DateRangePicker', locale);\n\n const closeDropdown = (focusTrigger = false) => {\n setIsDropDownOpen(false);\n if (focusTrigger) {\n triggerRef.current?.focus();\n }\n };\n\n const onWrapperKeyDownHandler = (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.keyCode === KeyCode.escape) {\n if (isDropDownOpen) {\n event.stopPropagation();\n }\n closeDropdown(true);\n }\n };\n\n const onClear = () => {\n fireNonCancelableEvent(onChange, { value: null });\n };\n\n const onApply = (newValue: null | DateRangePickerProps.Value): DateRangePickerProps.ValidationResult => {\n const formattedValue = formatValue(newValue, {\n dateOnly,\n monthOnly: isMonthOnly,\n timeOffset: hideTime\n ? { startDate: undefined, endDate: undefined }\n : normalizeTimeOffset(newValue, getTimeOffset, timeOffset),\n });\n\n const validationResult = isValidRange(formattedValue);\n if (validationResult?.valid === false) {\n return validationResult;\n }\n\n if (isDevelopment) {\n if (newValue?.type === 'absolute') {\n const [startDateWithoutTime] = newValue.startDate.split('T');\n const [endDateWithoutTime] = newValue.endDate.split('T');\n if (!startDateWithoutTime || !endDateWithoutTime) {\n warnOnce(\n 'DateRangePicker',\n 'You have provided an `isValidRange` prop that did not catch a missing start or end date.'\n );\n }\n }\n }\n fireNonCancelableEvent(onChange, { value: formattedValue });\n return validationResult || { valid: true };\n };\n\n const prevDateOnly = usePrevious(dateOnly);\n useEffect(() => {\n if (prevDateOnly !== undefined && prevDateOnly !== dateOnly) {\n warnOnce(\n 'DateRangePicker',\n `The provided \\`dateOnly\\` flag has been changed from \"${prevDateOnly}\" to \"${dateOnly}\" which can lead to unexpected value format. Consider using separate components.`\n );\n }\n }, [prevDateOnly, dateOnly]);\n\n if (value && value.type !== 'absolute' && value.type !== 'relative') {\n warnOnce('DateRangePicker', 'You provided an invalid value. Reverting back to default.');\n value = null;\n }\n\n if (\n (value?.type === 'absolute' && rangeSelectorMode === 'relative-only') ||\n (value?.type === 'relative' && rangeSelectorMode === 'absolute-only')\n ) {\n warnOnce(\n 'DateRangePicker',\n 'The provided value does not correspond to the current range selector mode. Reverting back to default.'\n );\n value = null;\n }\n\n const i18n = useInternalI18n('date-range-picker');\n const formatRelativeRange = i18n(\n 'i18nStrings.formatRelativeRange',\n i18nStrings?.formatRelativeRange,\n format =>\n ({ amount, unit }) =>\n format({ amount, unit })\n );\n\n if (isDevelopment) {\n if (!formatRelativeRange && rangeSelectorMode !== 'absolute-only') {\n warnOnce(\n 'DateRangePicker',\n 'A function for i18nStrings.formatRelativeRange was not provided. Relative ranges will not be correctly rendered.'\n );\n }\n }\n\n const formattedDate: string | JSX.Element = renderDateRange({\n locale: normalizedLocale,\n range: value,\n placeholder,\n formatRelativeRange,\n absoluteFormat,\n hideTimeOffset: hideTime || hideTimeOffset,\n timeOffset: normalizedTimeOffset,\n });\n\n const trigger = (\n <ButtonTrigger\n ref={triggerRef}\n id={controlId}\n invalid={invalid}\n warning={warning}\n ariaLabelledby={joinStrings(ariaLabelledby, triggerContentId)}\n ariaDescribedby={ariaDescribedby}\n className={clsx(testutilStyles.label, styles.label, {\n [styles['label-enabled']]: !readOnly && !disabled,\n })}\n hideCaret={true}\n onClick={() => {\n setIsDropDownOpen(true);\n }}\n disabled={disabled}\n readOnly={readOnly}\n ariaHasPopup=\"dialog\"\n >\n <span className={styles['trigger-flexbox']}>\n <span className={styles['icon-wrapper']}>\n <InternalIcon name=\"calendar\" variant={disabled || readOnly ? 'disabled' : 'normal'} />\n </span>\n <span id={triggerContentId}>{formattedDate}</span>\n </span>\n </ButtonTrigger>\n );\n\n const mergedRef = useMergeRefs(rootRef, __internalRootRef);\n\n return (\n <div\n {...baseProps}\n ref={mergedRef}\n className={clsx(\n baseProps.className,\n styles.root,\n testutilStyles.root,\n absoluteFormat === 'long-localized' && !dateOnly && !isMonthOnly && styles.wide\n )}\n onKeyDown={onWrapperKeyDownHandler}\n >\n <Dropdown\n stretchHeight={true}\n open={isDropDownOpen}\n onOutsideClick={() => closeDropdown()}\n trigger={trigger}\n expandToViewport={expandToViewport}\n dropdownId={dropdownId}\n content={\n /* Reset form field context to prevent a wrapper form field from labelling all inputs inside the dropdown. */\n <ResetContextsForModal>\n {isDropDownOpen && (\n <DateRangePickerDropdown\n startOfWeek={startOfWeek}\n locale={normalizedLocale}\n isSingleGrid={isSingleGrid}\n onOutsideClick={() => closeDropdown(true)}\n value={value}\n showClearButton={showClearButton}\n isDateEnabled={isDateEnabled}\n dateDisabledReason={dateDisabledReason}\n i18nStrings={i18nStrings}\n onClear={onClear}\n onApply={onApply}\n getTimeOffset={getTimeOffset}\n timeOffset={timeOffset}\n relativeOptions={relativeOptions}\n isValidRange={isValidRange}\n dateOnly={dateOnly}\n absoluteFormat={absoluteFormat}\n timeInputFormat={timeInputFormat}\n dateInputFormat={dateInputFormat}\n rangeSelectorMode={rangeSelectorMode}\n ariaLabelledby={ariaLabelledby}\n ariaDescribedby={ariaDescribedby}\n customAbsoluteRangeControl={customAbsoluteRangeControl}\n customRelativeRangeUnits={customRelativeRangeUnits}\n renderRelativeRangeContent={renderRelativeRangeContent}\n granularity={granularity}\n />\n )}\n </ResetContextsForModal>\n }\n />\n <div id={ariaLabelId} hidden={true}>\n {ariaLabel || i18nStrings?.ariaLabel}\n </div>\n </div>\n );\n }\n);\n\napplyDisplayName(DateRangePicker, 'DateRangePicker');\nexport default DateRangePicker;\n"]}
@@ -175,6 +175,10 @@ export interface DateRangePickerProps extends BaseComponentProps, FormFieldValid
175
175
  * Defaults to `false`.
176
176
  */
177
177
  hideTimeOffset?: boolean;
178
+ /**
179
+ * Adds `aria-label` to the trigger and dropdown.
180
+ */
181
+ ariaLabel?: string;
178
182
  }
179
183
  export declare namespace DateRangePickerProps {
180
184
  type Value = AbsoluteValue | RelativeValue;
@@ -253,14 +257,17 @@ export declare namespace DateRangePickerProps {
253
257
  interface I18nStrings {
254
258
  /**
255
259
  * Adds `aria-label` to the trigger and dropdown.
260
+ * @deprecated Use `ariaLabel` on the component instead.
256
261
  */
257
262
  ariaLabel?: string;
258
263
  /**
259
264
  * Adds `aria-labelledby` to the trigger and dropdown.
265
+ * @deprecated Use `ariaLabelledby` on the component instead.
260
266
  */
261
267
  ariaLabelledby?: string;
262
268
  /**
263
269
  * Adds `aria-describedby` to the trigger and dropdown.
270
+ * @deprecated Use `ariaDescribedby` on the component instead.
264
271
  */
265
272
  ariaDescribedby?: string;
266
273
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","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;;;WAKG;QACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;QAE5B;;;;;WAKG;QACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;QAEhC;;;;;WAKG;QACH,eAAe,CAAC,EAAE,MAAM,CAAC;KAC1B;IAED,KAAY,cAAc,GAAG,UAAU,CAAC;IAExC,KAAY,eAAe,GAAG,kBAAkB,GAAG,SAAS,CAAC;IAE7D,KAAY,eAAe,GAAG,cAAc,CAAC,MAAM,CAAC;CACrD;AAED,MAAM,MAAM,QAAQ,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAEjD,MAAM,MAAM,YAAY,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/date-range-picker/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { CalendarProps } from '../calendar/interfaces';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { ExpandToViewport } from '../internal/components/dropdown/interfaces';\nimport { FormFieldValidationControlProps } from '../internal/context/form-field-context';\nimport { NonCancelableEventHandler } from '../internal/events';\nimport { DateFormat, EditableDateFormat } from '../internal/utils/date-time/interfaces';\nimport { TimeInputProps } from '../time-input/interfaces';\n\nexport interface DateRangePickerBaseProps {\n /**\n * The current date range value. Can be either an absolute time range\n * or a relative time range.\n */\n value: null | DateRangePickerProps.Value;\n\n /**\n * A list of relative time ranges that are shown as suggestions.\n */\n relativeOptions: ReadonlyArray<DateRangePickerProps.RelativeOption>;\n\n /**\n * A function that defines whether a particular date should be enabled\n * in the calendar or not. Note that disabling a date in the calendar\n * still allows users to enter this date via keyboard. We therefore\n * recommend that you also validate these constraints client- and\n * server-side, in the same way as for other form elements.\n */\n isDateEnabled?: DateRangePickerProps.IsDateEnabledFunction;\n\n /**\n * Provides a reason why a particular date in the calendar is not enabled (only when `isDateEnabled` returns `false`).\n * If provided, the date becomes focusable.\n * @param date\n */\n dateDisabledReason?: DateRangePickerProps.DateDisabledReasonFunction;\n\n /**\n * The locale to be used for rendering month names and defining the\n * starting date of the week. If not provided, it will be determined\n * from the page and browser locales. Supported values and formats\n * are as-per the [JavaScript Intl API specification](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_identification_and_negotiation).\n */\n locale?: string;\n\n /**\n * Starting day of the week. [0-6] maps to [Sunday-Saturday].\n * By default the starting day of the week is defined by the locale,\n * but you can override it using this property.\n */\n startOfWeek?: number;\n\n /**\n * An object containing all the necessary localized strings required by the component.\n * @i18n\n */\n i18nStrings?: DateRangePickerProps.I18nStrings;\n\n /**\n * Hides time inputs and changes the input format to date-only, e.g. 2021-04-06.\n *\n * Do not use `dateOnly` flag conditionally. The component does not trigger the value update\n * when the flag changes which means the value format can become inconsistent.\n *\n * This does not apply when the 'granularity' is set to 'month'\n *\n * Default: `false`.\n */\n dateOnly?: boolean;\n\n /**\n * Determines the range selector mode as follows:\n *\n * * `default` for combined absolute/relative range selector.\n * * `absolute-only` for absolute-only range selector.\n * * `relative-only` for relative-only range selector.\n *\n * By default, the range selector mode is `default`.\n */\n rangeSelectorMode?: DateRangePickerProps.RangeSelectorMode;\n\n /**\n * Specifies the date format to use on the date inputs in the absolute dropdown.\n *\n * The format of the input as it is being interacted with. It can take the following values:\n * * `iso`: ISO 8601 format without time, e.g.: 2024-01-30 (or 2024-01)\n * * `slashed`: similar to ISO 8601 but with '/' in place of '-'. e.g.: 2024/01/30 (or 2024/01)\n */\n dateInputFormat?: DateRangePickerProps.DateInputFormat;\n\n /**\n * Specifies the format of the time input for absolute ranges.\n *\n * Use to restrict the granularity of time that the user can enter.\n *\n * Has no effect when `dateOnly` is true or `granularity` is set to 'month'.\n */\n timeInputFormat?: DateRangePickerProps.TimeInputFormat;\n\n /**\n * Fired whenever a user changes the component's value.\n * The event `detail` contains the current value of the field.\n */\n onChange?: NonCancelableEventHandler<DateRangePickerProps.ChangeDetail>;\n\n /**\n * The time offset from UTC in minutes that should be used to\n * display and produce values.\n *\n * Has no effect when `dateOnly` is true.\n *\n * Default: the user's current time offset as provided by the browser.\n *\n * @deprecated Use `getTimeOffset` instead.\n */\n timeOffset?: number;\n\n /**\n * A function that defines timezone offset from UTC in minutes for selected dates.\n * Use it to define time relative to the desired timezone.\n *\n * The function is called for the start date and the end date and takes a UTC date\n * corresponding the selected value as an argument.\n *\n * Has no effect when `dateOnly` is true.\n *\n * Default: the user's current time offset as provided by the browser.\n */\n getTimeOffset?: DateRangePickerProps.GetTimeOffsetFunction;\n}\nexport interface DateRangePickerProps\n extends BaseComponentProps,\n FormFieldValidationControlProps,\n ExpandToViewport,\n DateRangePickerBaseProps,\n Pick<CalendarProps, 'granularity'> {\n /**\n * Specifies the placeholder text that is rendered when the value is empty.\n */\n placeholder?: string;\n\n /**\n * Specifies that the component is disabled, preventing the user from\n * modifying the value. A disabled component cannot receive focus.\n */\n disabled?: boolean;\n\n /**\n * Specifies that the component is read-only, preventing the user from\n * modifying the value. A read-only component can receive focus.\n */\n readOnly?: boolean;\n\n /**\n * Fired when keyboard focus is set onto the UI control.\n */\n onFocus?: NonCancelableEventHandler<null>;\n\n /**\n * Fired when keyboard focus is removed from the UI control.\n */\n onBlur?: NonCancelableEventHandler<null>;\n\n /**\n * A function that defines whether a particular range is valid or not.\n *\n * Ensure that your function checks for missing fields in the value.\n */\n isValidRange: DateRangePickerProps.ValidationFunction;\n\n /**\n * Specifies whether the component should show a button that\n * allows the user to clear the selected value.\n */\n showClearButton?: boolean;\n\n /**\n * Specifies an additional control displayed in the dropdown, located below the range calendar.\n */\n customAbsoluteRangeControl?: DateRangePickerProps.AbsoluteRangeControl;\n\n /**\n * Specifies which time units to allow in the custom relative range control.\n */\n customRelativeRangeUnits?: DateRangePickerProps.TimeUnit[];\n\n /**\n * Specifies custom content to fully override the relative range tab.\n * When provided, all default relative range functionality is replaced.\n */\n renderRelativeRangeContent?: DateRangePickerProps.RelativeRangeControl;\n\n /**\n * Specifies the time format to use for displaying the absolute time range.\n *\n * It can take the following values:\n * * `iso`: ISO 8601 format, e.g.: 2024-01-30T13:32:32+01:00 (or 2024-01-30 when `dateOnly` is true)\n * * `long-localized`: a more human-readable, localized format, e.g.: January 30, 2024, 13:32:32 (UTC+1) (or January 30, 2024 when `dateOnly` is true)\n * * `slashed`: similar to ISO 8601 but with '/' in place of '-'. e.g.: 2024/01/30 (or 2024/01)\n */\n absoluteFormat?: DateRangePickerProps.AbsoluteFormat;\n\n /**\n * Specifies whether to hide the time offset in the displayed absolute time range.\n * Defaults to `false`.\n */\n hideTimeOffset?: boolean;\n}\n\nexport namespace DateRangePickerProps {\n export type Value = AbsoluteValue | RelativeValue;\n export interface AbsoluteValue {\n /**\n * In ISO8601 format, e.g.: 2021-04-06T17:23:50+02:00 (or 2021-04-06 when `dateOnly` is true)\n */\n startDate: string;\n /**\n * In ISO8601 format, e.g.: 2021-04-06T17:23:50+02:00 (or 2021-04-06 when `dateOnly` is true)\n */\n endDate: string;\n type: 'absolute';\n }\n\n export interface RelativeValue {\n /**\n * If provided, used to match this value\n * to a provided relative option.\n */\n key?: string;\n amount: number;\n unit: TimeUnit;\n type: 'relative';\n }\n export interface RelativeOption {\n /**\n * Used to uniquely identify this relative option.\n */\n key: string;\n amount: number;\n unit: TimeUnit;\n type: 'relative';\n }\n\n export type TimeUnit = 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year';\n\n export type ValidationFunction = (value: Value | null) => ValidationResult;\n\n export type ValidationResult = ValidRangeResult | InvalidRangeResult;\n\n export interface ValidRangeResult {\n valid: true;\n }\n\n export interface InvalidRangeResult {\n valid: false;\n errorMessage: string;\n }\n\n export interface ChangeDetail {\n /**\n * The newly selected range of this date range picker.\n */\n value: null | Value;\n }\n\n export interface IsDateEnabledFunction {\n (date: Date): boolean;\n }\n\n export interface DateDisabledReasonFunction {\n (date: Date): string;\n }\n\n export interface GetTimeOffsetFunction {\n (date: Date): number;\n }\n\n export interface DateTimeStrings {\n date: string;\n time: string;\n }\n\n export interface PendingAbsoluteValue {\n start: DateTimeStrings;\n end: DateTimeStrings;\n }\n\n export type AbsoluteRangeControl = (\n selectedRange: PendingAbsoluteValue,\n setSelectedRange: React.Dispatch<React.SetStateAction<PendingAbsoluteValue>>\n ) => React.ReactNode;\n\n export type RelativeRangeControl = (\n selectedRange: RelativeValue | null,\n setSelectedRange: (value: RelativeValue) => void\n ) => React.ReactNode;\n\n export type RangeSelectorMode = 'default' | 'absolute-only' | 'relative-only';\n\n export interface Ref {\n /**\n * Sets the browser focus on the UI control\n */\n focus(): void;\n }\n\n export interface I18nStrings {\n /**\n * Adds `aria-label` to the trigger and dropdown.\n */\n ariaLabel?: string;\n\n /**\n * Adds `aria-labelledby` to the trigger and dropdown.\n */\n ariaLabelledby?: string;\n\n /**\n * Adds `aria-describedby` to the trigger and dropdown.\n */\n ariaDescribedby?: string;\n\n /**\n * Label of the mode selection group. In the standard view, it adds 'aria-label' to the group of segments.\n * In a narrow container the label is visible and attached to the select component.\n * @i18n\n */\n modeSelectionLabel?: string;\n\n /**\n * Segment title of the relative range selection mode\n * @i18n\n */\n relativeModeTitle?: string;\n\n /**\n * Segment title of the absolute range selection mode\n * @i18n\n */\n absoluteModeTitle?: string;\n\n /**\n * Heading for the relative range selection area\n * @i18n\n */\n relativeRangeSelectionHeading?: string;\n\n /**\n * Description for the relative range selection area\n * @i18n\n */\n relativeRangeSelectionMonthlyDescription?: string;\n\n /**\n * Visible label of the Cancel button\n * @i18n\n */\n cancelButtonLabel?: string;\n\n /**\n * Visible label of the Clear and dismiss button\n * @i18n\n */\n clearButtonLabel?: string;\n\n /**\n * Visible label of the Apply button\n * @i18n\n */\n applyButtonLabel?: string;\n\n /**\n * Formatting function for relative ranges.\n * This function must convert a relative range to a human-readable string.\n * @i18n\n */\n formatRelativeRange?: (value: RelativeValue) => string;\n\n /**\n * Formatting function for time units.\n *\n * This function must return a localized form of the unit that fits the provided time value.\n * @i18n\n */\n formatUnit?: (unit: TimeUnit, value: number) => string;\n\n /**\n * Visible label for the option for selecting\n * a custom relative range.\n * @i18n\n */\n customRelativeRangeOptionLabel?: string;\n\n /**\n * Visible description for the option for selecting\n * a custom relative range.\n * @i18n\n */\n customRelativeRangeOptionDescription?: string;\n\n /**\n * Visible label for the duration selector for\n * the custom relative range.\n * @i18n\n */\n customRelativeRangeDurationLabel?: string;\n\n /**\n * Placeholder for the duration selector for\n * the custom relative range.\n * @i18n\n */\n customRelativeRangeDurationPlaceholder?: string;\n\n /**\n * Visible label for the unit selector for the\n * custom relative range.\n * @i18n\n */\n customRelativeRangeUnitLabel?: string;\n\n /**\n * Visible label for the Start Month input for the\n * absolute range.\n * @i18n\n */\n startMonthLabel?: string;\n\n /**\n * Visible label for the Start Date input for the\n * absolute range.\n * @i18n\n */\n startDateLabel?: string;\n\n /**\n * Visible label for the Start Time input for the\n * absolute range.\n * @i18n\n */\n startTimeLabel?: string;\n\n /**\n * Visible label for the End Month input for the\n * absolute range.\n * @i18n\n */\n endMonthLabel?: string;\n\n /**\n * Visible label for the End Date input for the\n * absolute range.\n * @i18n\n */\n endDateLabel?: string;\n\n /**\n * Visible label for the End Time input for the absolute range.\n * This serves as a fallback if no format specific date constraint test is provided\n *\n * @i18n\n */\n endTimeLabel?: string;\n\n /**\n * Constraint text for the date input field for the\n * absolute range with no time option.\n * @i18n\n */\n dateConstraintText?: string;\n\n /**\n * Constraint text for the input fields for the absolute range in 'slashed' format with no time option.\n * @i18n\n */\n slashedDateConstraintText?: string;\n\n /**\n * Constraint text for the input fields for the absolute range in 'iso' format with no time option.\n * @i18n\n */\n isoDateConstraintText?: string;\n\n /**\n * Constraint text for the input fields for the absolute range.\n * This serves as a fallback if no format specific datetime constraint test is provided\n *\n * @i18n\n */\n dateTimeConstraintText?: string;\n\n /**\n * Constraint text for the date input fields for the absolute range in 'slashed' format.\n * @i18n\n */\n slashedDateTimeConstraintText?: string;\n\n /**\n * Constraint text for the date input fields for the absolute range in 'iso' format with.\n * @i18n\n */\n isoDateTimeConstraintText?: string;\n\n /**\n * Constraint text for the month input fields for the absolute range.\n * This serves as a fallback if no format specific month constraint test is provided.\n *\n * @i18n\n */\n monthConstraintText?: string;\n\n /**\n * Constraint text for the month input fields for the absolute range in 'slashed' format.\n * @i18n\n */\n slashedMonthConstraintText?: string;\n\n /**\n * Constraint text for the month input fields for the absolute range in 'iso' format.\n * @i18n\n */\n isoMonthConstraintText?: string;\n\n /**\n * Provides a text alternative for the error icon in the error alert.\n * @i18n\n */\n errorIconAriaLabel?: string;\n\n /**\n * When the property is set, screen readers announce the selected range when the absolute range gets selected.\n */\n renderSelectedAbsoluteRangeAriaLive?: (startDate: string, endDate: string) => string;\n\n /**\n * Used as part of the `aria-label` for today's date in the calendar.\n * @i18n\n */\n todayAriaLabel?: string;\n\n /**\n * Specifies an `aria-label` for the 'next month' button.\n * @i18n\n */\n nextMonthAriaLabel?: string;\n\n /**\n * Specifies an `aria-label` for the 'previous month' button.\n * @i18n\n */\n previousMonthAriaLabel?: string;\n\n /**\n * Used as part of the `aria-label` for the current month in the calendar.\n * @i18n\n */\n currentMonthAriaLabel?: string;\n\n /**\n * Specifies an `aria-label` for the 'next year' button.\n * @i18n\n */\n nextYearAriaLabel?: string;\n\n /**\n * Specifies an `aria-label` for the 'previous year' button.\n * @i18n\n */\n previousYearAriaLabel?: string;\n\n /**\n * Placeholder text for date inputs in absolute mode with 'iso' format (dashes).\n * Should match the expected date format (for example \"YYYY-MM-DD\", \"JJJJ-MM-TT\" for German).\n * Used for both start and end date inputs.\n * @i18n\n */\n isoDatePlaceholder?: string;\n\n /**\n * Placeholder text for date inputs in absolute mode with 'slashed' format (slashes).\n * Should match the expected date format (for example \"YYYY/MM/DD\", \"JJJJ/MM/TT\" for German).\n * Used for both start and end date inputs.\n * @i18n\n */\n slashedDatePlaceholder?: string;\n\n /**\n * Placeholder text for time inputs in absolute mode.\n * Should match the expected time format (for example \"hh:mm:ss\", \"HH:MM:SS\").\n * Used for both start and end time inputs.\n * @i18n\n */\n timePlaceholder?: string;\n }\n\n export type AbsoluteFormat = DateFormat;\n\n export type DateInputFormat = EditableDateFormat | undefined;\n\n export type TimeInputFormat = TimeInputProps.Format;\n}\n\nexport type DayIndex = 0 | 1 | 2 | 3 | 4 | 5 | 6;\n\nexport type QuarterIndex = 0 | 1 | 2;\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/date-range-picker/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { CalendarProps } from '../calendar/interfaces';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { ExpandToViewport } from '../internal/components/dropdown/interfaces';\nimport { FormFieldValidationControlProps } from '../internal/context/form-field-context';\nimport { NonCancelableEventHandler } from '../internal/events';\nimport { DateFormat, EditableDateFormat } from '../internal/utils/date-time/interfaces';\nimport { TimeInputProps } from '../time-input/interfaces';\n\nexport interface DateRangePickerBaseProps {\n /**\n * The current date range value. Can be either an absolute time range\n * or a relative time range.\n */\n value: null | DateRangePickerProps.Value;\n\n /**\n * A list of relative time ranges that are shown as suggestions.\n */\n relativeOptions: ReadonlyArray<DateRangePickerProps.RelativeOption>;\n\n /**\n * A function that defines whether a particular date should be enabled\n * in the calendar or not. Note that disabling a date in the calendar\n * still allows users to enter this date via keyboard. We therefore\n * recommend that you also validate these constraints client- and\n * server-side, in the same way as for other form elements.\n */\n isDateEnabled?: DateRangePickerProps.IsDateEnabledFunction;\n\n /**\n * Provides a reason why a particular date in the calendar is not enabled (only when `isDateEnabled` returns `false`).\n * If provided, the date becomes focusable.\n * @param date\n */\n dateDisabledReason?: DateRangePickerProps.DateDisabledReasonFunction;\n\n /**\n * The locale to be used for rendering month names and defining the\n * starting date of the week. If not provided, it will be determined\n * from the page and browser locales. Supported values and formats\n * are as-per the [JavaScript Intl API specification](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_identification_and_negotiation).\n */\n locale?: string;\n\n /**\n * Starting day of the week. [0-6] maps to [Sunday-Saturday].\n * By default the starting day of the week is defined by the locale,\n * but you can override it using this property.\n */\n startOfWeek?: number;\n\n /**\n * An object containing all the necessary localized strings required by the component.\n * @i18n\n */\n i18nStrings?: DateRangePickerProps.I18nStrings;\n\n /**\n * Hides time inputs and changes the input format to date-only, e.g. 2021-04-06.\n *\n * Do not use `dateOnly` flag conditionally. The component does not trigger the value update\n * when the flag changes which means the value format can become inconsistent.\n *\n * This does not apply when the 'granularity' is set to 'month'\n *\n * Default: `false`.\n */\n dateOnly?: boolean;\n\n /**\n * Determines the range selector mode as follows:\n *\n * * `default` for combined absolute/relative range selector.\n * * `absolute-only` for absolute-only range selector.\n * * `relative-only` for relative-only range selector.\n *\n * By default, the range selector mode is `default`.\n */\n rangeSelectorMode?: DateRangePickerProps.RangeSelectorMode;\n\n /**\n * Specifies the date format to use on the date inputs in the absolute dropdown.\n *\n * The format of the input as it is being interacted with. It can take the following values:\n * * `iso`: ISO 8601 format without time, e.g.: 2024-01-30 (or 2024-01)\n * * `slashed`: similar to ISO 8601 but with '/' in place of '-'. e.g.: 2024/01/30 (or 2024/01)\n */\n dateInputFormat?: DateRangePickerProps.DateInputFormat;\n\n /**\n * Specifies the format of the time input for absolute ranges.\n *\n * Use to restrict the granularity of time that the user can enter.\n *\n * Has no effect when `dateOnly` is true or `granularity` is set to 'month'.\n */\n timeInputFormat?: DateRangePickerProps.TimeInputFormat;\n\n /**\n * Fired whenever a user changes the component's value.\n * The event `detail` contains the current value of the field.\n */\n onChange?: NonCancelableEventHandler<DateRangePickerProps.ChangeDetail>;\n\n /**\n * The time offset from UTC in minutes that should be used to\n * display and produce values.\n *\n * Has no effect when `dateOnly` is true.\n *\n * Default: the user's current time offset as provided by the browser.\n *\n * @deprecated Use `getTimeOffset` instead.\n */\n timeOffset?: number;\n\n /**\n * A function that defines timezone offset from UTC in minutes for selected dates.\n * Use it to define time relative to the desired timezone.\n *\n * The function is called for the start date and the end date and takes a UTC date\n * corresponding the selected value as an argument.\n *\n * Has no effect when `dateOnly` is true.\n *\n * Default: the user's current time offset as provided by the browser.\n */\n getTimeOffset?: DateRangePickerProps.GetTimeOffsetFunction;\n}\nexport interface DateRangePickerProps\n extends BaseComponentProps,\n FormFieldValidationControlProps,\n ExpandToViewport,\n DateRangePickerBaseProps,\n Pick<CalendarProps, 'granularity'> {\n /**\n * Specifies the placeholder text that is rendered when the value is empty.\n */\n placeholder?: string;\n\n /**\n * Specifies that the component is disabled, preventing the user from\n * modifying the value. A disabled component cannot receive focus.\n */\n disabled?: boolean;\n\n /**\n * Specifies that the component is read-only, preventing the user from\n * modifying the value. A read-only component can receive focus.\n */\n readOnly?: boolean;\n\n /**\n * Fired when keyboard focus is set onto the UI control.\n */\n onFocus?: NonCancelableEventHandler<null>;\n\n /**\n * Fired when keyboard focus is removed from the UI control.\n */\n onBlur?: NonCancelableEventHandler<null>;\n\n /**\n * A function that defines whether a particular range is valid or not.\n *\n * Ensure that your function checks for missing fields in the value.\n */\n isValidRange: DateRangePickerProps.ValidationFunction;\n\n /**\n * Specifies whether the component should show a button that\n * allows the user to clear the selected value.\n */\n showClearButton?: boolean;\n\n /**\n * Specifies an additional control displayed in the dropdown, located below the range calendar.\n */\n customAbsoluteRangeControl?: DateRangePickerProps.AbsoluteRangeControl;\n\n /**\n * Specifies which time units to allow in the custom relative range control.\n */\n customRelativeRangeUnits?: DateRangePickerProps.TimeUnit[];\n\n /**\n * Specifies custom content to fully override the relative range tab.\n * When provided, all default relative range functionality is replaced.\n */\n renderRelativeRangeContent?: DateRangePickerProps.RelativeRangeControl;\n\n /**\n * Specifies the time format to use for displaying the absolute time range.\n *\n * It can take the following values:\n * * `iso`: ISO 8601 format, e.g.: 2024-01-30T13:32:32+01:00 (or 2024-01-30 when `dateOnly` is true)\n * * `long-localized`: a more human-readable, localized format, e.g.: January 30, 2024, 13:32:32 (UTC+1) (or January 30, 2024 when `dateOnly` is true)\n * * `slashed`: similar to ISO 8601 but with '/' in place of '-'. e.g.: 2024/01/30 (or 2024/01)\n */\n absoluteFormat?: DateRangePickerProps.AbsoluteFormat;\n\n /**\n * Specifies whether to hide the time offset in the displayed absolute time range.\n * Defaults to `false`.\n */\n hideTimeOffset?: boolean;\n\n /**\n * Adds `aria-label` to the trigger and dropdown.\n */\n ariaLabel?: string;\n}\n\nexport namespace DateRangePickerProps {\n export type Value = AbsoluteValue | RelativeValue;\n export interface AbsoluteValue {\n /**\n * In ISO8601 format, e.g.: 2021-04-06T17:23:50+02:00 (or 2021-04-06 when `dateOnly` is true)\n */\n startDate: string;\n /**\n * In ISO8601 format, e.g.: 2021-04-06T17:23:50+02:00 (or 2021-04-06 when `dateOnly` is true)\n */\n endDate: string;\n type: 'absolute';\n }\n\n export interface RelativeValue {\n /**\n * If provided, used to match this value\n * to a provided relative option.\n */\n key?: string;\n amount: number;\n unit: TimeUnit;\n type: 'relative';\n }\n export interface RelativeOption {\n /**\n * Used to uniquely identify this relative option.\n */\n key: string;\n amount: number;\n unit: TimeUnit;\n type: 'relative';\n }\n\n export type TimeUnit = 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year';\n\n export type ValidationFunction = (value: Value | null) => ValidationResult;\n\n export type ValidationResult = ValidRangeResult | InvalidRangeResult;\n\n export interface ValidRangeResult {\n valid: true;\n }\n\n export interface InvalidRangeResult {\n valid: false;\n errorMessage: string;\n }\n\n export interface ChangeDetail {\n /**\n * The newly selected range of this date range picker.\n */\n value: null | Value;\n }\n\n export interface IsDateEnabledFunction {\n (date: Date): boolean;\n }\n\n export interface DateDisabledReasonFunction {\n (date: Date): string;\n }\n\n export interface GetTimeOffsetFunction {\n (date: Date): number;\n }\n\n export interface DateTimeStrings {\n date: string;\n time: string;\n }\n\n export interface PendingAbsoluteValue {\n start: DateTimeStrings;\n end: DateTimeStrings;\n }\n\n export type AbsoluteRangeControl = (\n selectedRange: PendingAbsoluteValue,\n setSelectedRange: React.Dispatch<React.SetStateAction<PendingAbsoluteValue>>\n ) => React.ReactNode;\n\n export type RelativeRangeControl = (\n selectedRange: RelativeValue | null,\n setSelectedRange: (value: RelativeValue) => void\n ) => React.ReactNode;\n\n export type RangeSelectorMode = 'default' | 'absolute-only' | 'relative-only';\n\n export interface Ref {\n /**\n * Sets the browser focus on the UI control\n */\n focus(): void;\n }\n\n export interface I18nStrings {\n /**\n * Adds `aria-label` to the trigger and dropdown.\n * @deprecated Use `ariaLabel` on the component instead.\n */\n ariaLabel?: string;\n\n /**\n * Adds `aria-labelledby` to the trigger and dropdown.\n * @deprecated Use `ariaLabelledby` on the component instead.\n */\n ariaLabelledby?: string;\n\n /**\n * Adds `aria-describedby` to the trigger and dropdown.\n * @deprecated Use `ariaDescribedby` on the component instead.\n */\n ariaDescribedby?: string;\n\n /**\n * Label of the mode selection group. In the standard view, it adds 'aria-label' to the group of segments.\n * In a narrow container the label is visible and attached to the select component.\n * @i18n\n */\n modeSelectionLabel?: string;\n\n /**\n * Segment title of the relative range selection mode\n * @i18n\n */\n relativeModeTitle?: string;\n\n /**\n * Segment title of the absolute range selection mode\n * @i18n\n */\n absoluteModeTitle?: string;\n\n /**\n * Heading for the relative range selection area\n * @i18n\n */\n relativeRangeSelectionHeading?: string;\n\n /**\n * Description for the relative range selection area\n * @i18n\n */\n relativeRangeSelectionMonthlyDescription?: string;\n\n /**\n * Visible label of the Cancel button\n * @i18n\n */\n cancelButtonLabel?: string;\n\n /**\n * Visible label of the Clear and dismiss button\n * @i18n\n */\n clearButtonLabel?: string;\n\n /**\n * Visible label of the Apply button\n * @i18n\n */\n applyButtonLabel?: string;\n\n /**\n * Formatting function for relative ranges.\n * This function must convert a relative range to a human-readable string.\n * @i18n\n */\n formatRelativeRange?: (value: RelativeValue) => string;\n\n /**\n * Formatting function for time units.\n *\n * This function must return a localized form of the unit that fits the provided time value.\n * @i18n\n */\n formatUnit?: (unit: TimeUnit, value: number) => string;\n\n /**\n * Visible label for the option for selecting\n * a custom relative range.\n * @i18n\n */\n customRelativeRangeOptionLabel?: string;\n\n /**\n * Visible description for the option for selecting\n * a custom relative range.\n * @i18n\n */\n customRelativeRangeOptionDescription?: string;\n\n /**\n * Visible label for the duration selector for\n * the custom relative range.\n * @i18n\n */\n customRelativeRangeDurationLabel?: string;\n\n /**\n * Placeholder for the duration selector for\n * the custom relative range.\n * @i18n\n */\n customRelativeRangeDurationPlaceholder?: string;\n\n /**\n * Visible label for the unit selector for the\n * custom relative range.\n * @i18n\n */\n customRelativeRangeUnitLabel?: string;\n\n /**\n * Visible label for the Start Month input for the\n * absolute range.\n * @i18n\n */\n startMonthLabel?: string;\n\n /**\n * Visible label for the Start Date input for the\n * absolute range.\n * @i18n\n */\n startDateLabel?: string;\n\n /**\n * Visible label for the Start Time input for the\n * absolute range.\n * @i18n\n */\n startTimeLabel?: string;\n\n /**\n * Visible label for the End Month input for the\n * absolute range.\n * @i18n\n */\n endMonthLabel?: string;\n\n /**\n * Visible label for the End Date input for the\n * absolute range.\n * @i18n\n */\n endDateLabel?: string;\n\n /**\n * Visible label for the End Time input for the absolute range.\n * This serves as a fallback if no format specific date constraint test is provided\n *\n * @i18n\n */\n endTimeLabel?: string;\n\n /**\n * Constraint text for the date input field for the\n * absolute range with no time option.\n * @i18n\n */\n dateConstraintText?: string;\n\n /**\n * Constraint text for the input fields for the absolute range in 'slashed' format with no time option.\n * @i18n\n */\n slashedDateConstraintText?: string;\n\n /**\n * Constraint text for the input fields for the absolute range in 'iso' format with no time option.\n * @i18n\n */\n isoDateConstraintText?: string;\n\n /**\n * Constraint text for the input fields for the absolute range.\n * This serves as a fallback if no format specific datetime constraint test is provided\n *\n * @i18n\n */\n dateTimeConstraintText?: string;\n\n /**\n * Constraint text for the date input fields for the absolute range in 'slashed' format.\n * @i18n\n */\n slashedDateTimeConstraintText?: string;\n\n /**\n * Constraint text for the date input fields for the absolute range in 'iso' format with.\n * @i18n\n */\n isoDateTimeConstraintText?: string;\n\n /**\n * Constraint text for the month input fields for the absolute range.\n * This serves as a fallback if no format specific month constraint test is provided.\n *\n * @i18n\n */\n monthConstraintText?: string;\n\n /**\n * Constraint text for the month input fields for the absolute range in 'slashed' format.\n * @i18n\n */\n slashedMonthConstraintText?: string;\n\n /**\n * Constraint text for the month input fields for the absolute range in 'iso' format.\n * @i18n\n */\n isoMonthConstraintText?: string;\n\n /**\n * Provides a text alternative for the error icon in the error alert.\n * @i18n\n */\n errorIconAriaLabel?: string;\n\n /**\n * When the property is set, screen readers announce the selected range when the absolute range gets selected.\n */\n renderSelectedAbsoluteRangeAriaLive?: (startDate: string, endDate: string) => string;\n\n /**\n * Used as part of the `aria-label` for today's date in the calendar.\n * @i18n\n */\n todayAriaLabel?: string;\n\n /**\n * Specifies an `aria-label` for the 'next month' button.\n * @i18n\n */\n nextMonthAriaLabel?: string;\n\n /**\n * Specifies an `aria-label` for the 'previous month' button.\n * @i18n\n */\n previousMonthAriaLabel?: string;\n\n /**\n * Used as part of the `aria-label` for the current month in the calendar.\n * @i18n\n */\n currentMonthAriaLabel?: string;\n\n /**\n * Specifies an `aria-label` for the 'next year' button.\n * @i18n\n */\n nextYearAriaLabel?: string;\n\n /**\n * Specifies an `aria-label` for the 'previous year' button.\n * @i18n\n */\n previousYearAriaLabel?: string;\n\n /**\n * Placeholder text for date inputs in absolute mode with 'iso' format (dashes).\n * Should match the expected date format (for example \"YYYY-MM-DD\", \"JJJJ-MM-TT\" for German).\n * Used for both start and end date inputs.\n * @i18n\n */\n isoDatePlaceholder?: string;\n\n /**\n * Placeholder text for date inputs in absolute mode with 'slashed' format (slashes).\n * Should match the expected date format (for example \"YYYY/MM/DD\", \"JJJJ/MM/TT\" for German).\n * Used for both start and end date inputs.\n * @i18n\n */\n slashedDatePlaceholder?: string;\n\n /**\n * Placeholder text for time inputs in absolute mode.\n * Should match the expected time format (for example \"hh:mm:ss\", \"HH:MM:SS\").\n * Used for both start and end time inputs.\n * @i18n\n */\n timePlaceholder?: string;\n }\n\n export type AbsoluteFormat = DateFormat;\n\n export type DateInputFormat = EditableDateFormat | undefined;\n\n export type TimeInputFormat = TimeInputProps.Format;\n}\n\nexport type DayIndex = 0 | 1 | 2 | 3 | 4 | 5 | 6;\n\nexport type QuarterIndex = 0 | 1 | 2;\n"]}
@@ -93,4 +93,7 @@ export interface BuiltInErrorBoundaryProps {
93
93
  wrapper?: (content: React.ReactNode) => React.ReactNode;
94
94
  suppressNested?: boolean;
95
95
  }
96
+ export interface AppLayoutBuiltInErrorBoundaryProps extends BuiltInErrorBoundaryProps {
97
+ renderFallback?: ErrorBoundaryProps['renderFallback'];
98
+ }
96
99
  //# sourceMappingURL=interfaces.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/error-boundary/interfaces.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE,MAAM,WAAW,kBAAmB,SAAQ,kBAAkB;IAC5D;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;;;;;;OAQG;IACH,OAAO,EAAE,CAAC,MAAM,EAAE,kBAAkB,CAAC,aAAa,KAAK,IAAI,CAAC;IAE5D;;;;;;;;;;OAUG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;;;;;;;;OASG;IACH,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,kBAAkB,CAAC,aAAa,KAAK,KAAK,CAAC,SAAS,CAAC;IAE9E;;;;;;;;;;;OAWG;IACH,WAAW,CAAC,EAAE,kBAAkB,CAAC,WAAW,CAAC;IAE7C;;OAEG;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;CAC1B;AAED,MAAM,WAAW,kCAAmC,SAAQ,yBAAyB;IACnF,cAAc,CAAC,EAAE,kBAAkB,CAAC,gBAAgB,CAAC,CAAC;CACvD"}
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/error-boundary/interfaces.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { ErrorInfo } from 'react';\n\nimport { BaseComponentProps } from '../internal/base-component';\n\nexport interface ErrorBoundaryProps extends BaseComponentProps {\n /**\n * Optional identifier for the error boundary instance.\n *\n * When provided, the identifier is included in the `onError` callback payload.\n * In the rendered output, the boundary wraps its content in a `<div>` with the\n * attribute `data-awsui-boundary-id={errorBoundaryId}` to support debugging.\n */\n errorBoundaryId?: string;\n\n /**\n * Callback invoked when an error is intercepted by the boundary.\n * Use this function to record, log, or report errors (for example, to telemetry or monitoring systems).\n *\n * The callback receives a `detail` object containing:\n * * `error` (Error): The thrown error instance.\n * * `errorInfo` (React.ErrorInfo): Additional metadata captured by React.\n * * `errorBoundaryId` (optional, string): The boundary identifier, if defined.\n */\n onError: (detail: ErrorBoundaryProps.OnErrorDetail) => void;\n\n /**\n * Controls how nested error boundaries behave.\n *\n * Several components—such as app layout, container, and modal include built-in\n * error boundaries. These boundaries activate automatically when they detect\n * an ancestor boundary, inheriting configuration from the closest one.\n *\n * When `suppressNested` is set to `true`, nested built-in error boundaries\n * and nested standalone error boundaries with `suppressible=true` are disabled,\n * so the errors propagate further up and are captured by this error boundary.\n */\n suppressNested?: boolean;\n\n /**\n * When set to `true`, this error boundary can be suppressed by another error\n * boundary with `suppressNested=true`, rendered above in the components tree.\n */\n suppressible?: boolean;\n\n /**\n * Optional custom renderer for the fallback UI displayed when an error occurs.\n *\n * The function receives the default slots derived from i18n configuration:\n * * `header` (ReactNode): The fallback header text.\n * * `description` (ReactNode): The fallback description text.\n * * `action` (ReactNode): The fallback action element (a refresh button by default).\n *\n * Return a React node to fully override the default fallback presentation.\n */\n renderFallback?: (props: ErrorBoundaryProps.FallbackProps) => React.ReactNode;\n\n /**\n * Localized strings and components used in the fallback UI.\n *\n * * `headerText` (string): Header text displayed in the fallback view.\n * * `descriptionText` (string): Description text displayed in the fallback view. Supports embedding inline\n * feedback actions by including `<Feedback>` pseudo-tags when `components.Feedback` is provided.\n * * `refreshActionText` (string): Text for the default refresh action button.\n * * `components.Feedback` (React.ComponentType<I18nFeedbackProps>): A component used to render\n * inline feedback actions within the description text.\n *\n * @i18n\n */\n i18nStrings?: ErrorBoundaryProps.I18nStrings;\n\n /**\n * Child content rendered when no error has been captured.\n */\n children: React.ReactNode;\n}\n\nexport namespace ErrorBoundaryProps {\n export interface FallbackProps {\n header?: React.ReactNode;\n description?: React.ReactNode;\n action?: React.ReactNode;\n }\n\n export interface I18nStrings {\n headerText?: string;\n descriptionText?: string;\n refreshActionText?: string;\n components?: {\n Feedback?: React.ComponentType<I18nFeedbackProps>;\n };\n }\n\n export interface I18nFeedbackProps {\n children: React.ReactNode;\n }\n\n export interface OnErrorDetail {\n error: Error;\n errorInfo: ErrorInfo;\n errorBoundaryId?: string;\n }\n}\n\nexport interface BuiltInErrorBoundaryProps {\n children: React.ReactNode;\n wrapper?: (content: React.ReactNode) => React.ReactNode;\n suppressNested?: boolean;\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/error-boundary/interfaces.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { ErrorInfo } from 'react';\n\nimport { BaseComponentProps } from '../internal/base-component';\n\nexport interface ErrorBoundaryProps extends BaseComponentProps {\n /**\n * Optional identifier for the error boundary instance.\n *\n * When provided, the identifier is included in the `onError` callback payload.\n * In the rendered output, the boundary wraps its content in a `<div>` with the\n * attribute `data-awsui-boundary-id={errorBoundaryId}` to support debugging.\n */\n errorBoundaryId?: string;\n\n /**\n * Callback invoked when an error is intercepted by the boundary.\n * Use this function to record, log, or report errors (for example, to telemetry or monitoring systems).\n *\n * The callback receives a `detail` object containing:\n * * `error` (Error): The thrown error instance.\n * * `errorInfo` (React.ErrorInfo): Additional metadata captured by React.\n * * `errorBoundaryId` (optional, string): The boundary identifier, if defined.\n */\n onError: (detail: ErrorBoundaryProps.OnErrorDetail) => void;\n\n /**\n * Controls how nested error boundaries behave.\n *\n * Several components—such as app layout, container, and modal include built-in\n * error boundaries. These boundaries activate automatically when they detect\n * an ancestor boundary, inheriting configuration from the closest one.\n *\n * When `suppressNested` is set to `true`, nested built-in error boundaries\n * and nested standalone error boundaries with `suppressible=true` are disabled,\n * so the errors propagate further up and are captured by this error boundary.\n */\n suppressNested?: boolean;\n\n /**\n * When set to `true`, this error boundary can be suppressed by another error\n * boundary with `suppressNested=true`, rendered above in the components tree.\n */\n suppressible?: boolean;\n\n /**\n * Optional custom renderer for the fallback UI displayed when an error occurs.\n *\n * The function receives the default slots derived from i18n configuration:\n * * `header` (ReactNode): The fallback header text.\n * * `description` (ReactNode): The fallback description text.\n * * `action` (ReactNode): The fallback action element (a refresh button by default).\n *\n * Return a React node to fully override the default fallback presentation.\n */\n renderFallback?: (props: ErrorBoundaryProps.FallbackProps) => React.ReactNode;\n\n /**\n * Localized strings and components used in the fallback UI.\n *\n * * `headerText` (string): Header text displayed in the fallback view.\n * * `descriptionText` (string): Description text displayed in the fallback view. Supports embedding inline\n * feedback actions by including `<Feedback>` pseudo-tags when `components.Feedback` is provided.\n * * `refreshActionText` (string): Text for the default refresh action button.\n * * `components.Feedback` (React.ComponentType<I18nFeedbackProps>): A component used to render\n * inline feedback actions within the description text.\n *\n * @i18n\n */\n i18nStrings?: ErrorBoundaryProps.I18nStrings;\n\n /**\n * Child content rendered when no error has been captured.\n */\n children: React.ReactNode;\n}\n\nexport namespace ErrorBoundaryProps {\n export interface FallbackProps {\n header?: React.ReactNode;\n description?: React.ReactNode;\n action?: React.ReactNode;\n }\n\n export interface I18nStrings {\n headerText?: string;\n descriptionText?: string;\n refreshActionText?: string;\n components?: {\n Feedback?: React.ComponentType<I18nFeedbackProps>;\n };\n }\n\n export interface I18nFeedbackProps {\n children: React.ReactNode;\n }\n\n export interface OnErrorDetail {\n error: Error;\n errorInfo: ErrorInfo;\n errorBoundaryId?: string;\n }\n}\n\nexport interface BuiltInErrorBoundaryProps {\n children: React.ReactNode;\n wrapper?: (content: React.ReactNode) => React.ReactNode;\n suppressNested?: boolean;\n}\n\nexport interface AppLayoutBuiltInErrorBoundaryProps extends BuiltInErrorBoundaryProps {\n renderFallback?: ErrorBoundaryProps['renderFallback'];\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  import { InternalBaseComponentProps } from '../internal/hooks/use-base-component';
2
2
  import { SomeRequired } from '../internal/types';
3
- import { BuiltInErrorBoundaryProps, ErrorBoundaryProps } from './interfaces';
3
+ import { AppLayoutBuiltInErrorBoundaryProps, BuiltInErrorBoundaryProps, ErrorBoundaryProps } from './interfaces';
4
4
  declare global {
5
5
  interface HTMLElement {
6
6
  __awsui__?: {
@@ -13,5 +13,6 @@ interface InternalErrorBoundaryProps extends SomeRequired<ErrorBoundaryProps, 's
13
13
  }
14
14
  export declare function InternalErrorBoundary({ children, suppressNested, suppressible, __internalRootRef, ...props }: InternalErrorBoundaryProps): JSX.Element;
15
15
  export declare function BuiltInErrorBoundary({ wrapper, suppressNested, children }: BuiltInErrorBoundaryProps): JSX.Element;
16
+ export declare function AppLayoutBuiltInErrorBoundary({ wrapper, suppressNested, children, renderFallback, }: AppLayoutBuiltInErrorBoundaryProps): JSX.Element;
16
17
  export {};
17
18
  //# sourceMappingURL=internal.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/error-boundary/internal.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,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AAY,EACZ,iBAAiB,EACjB,GAAG,KAAK,EACT,EAAE,0BAA0B,eA8B5B;AAED,wBAAgB,oBAAoB,CAAC,EAAE,OAAO,EAAE,cAAsB,EAAE,QAAQ,EAAE,EAAE,yBAAyB,eAa5G;AAED,wBAAgB,6BAA6B,CAAC,EAC5C,OAAO,EACP,cAAsB,EACtB,QAAQ,EACR,cAA4B,GAC7B,EAAE,kCAAkC,eAoBpC"}
@@ -34,6 +34,17 @@ export function BuiltInErrorBoundary({ wrapper, suppressNested = false, children
34
34
  return !thisSuppressed ? (React.createElement(ErrorBoundaryImpl, { ...context, wrapper: wrapper },
35
35
  React.createElement(ErrorBoundariesContext.Provider, { value: { ...context, suppressed: nextSuppressed } }, children))) : (React.createElement(React.Fragment, null, children));
36
36
  }
37
+ export function AppLayoutBuiltInErrorBoundary({ wrapper, suppressNested = false, children, renderFallback = () => React.createElement(React.Fragment, null), }) {
38
+ const context = useContext(ErrorBoundariesContext);
39
+ const thisSuppressed = context.suppressed === true || context.suppressed === RootSuppressed;
40
+ const nextSuppressed = suppressNested || thisSuppressed;
41
+ return (React.createElement(ErrorBoundaryImpl, { ...context, wrapper: wrapper, renderFallback: renderFallback, className: styles['app-layout-part-fallback'], onError: error => {
42
+ var _a;
43
+ (_a = context === null || context === void 0 ? void 0 : context.onError) === null || _a === void 0 ? void 0 : _a.call(context, error);
44
+ // TODO Implement cloudscape error reporting
45
+ } },
46
+ React.createElement(ErrorBoundariesContext.Provider, { value: { ...context, suppressed: nextSuppressed, renderFallback } }, children)));
47
+ }
37
48
  class ErrorBoundaryImpl extends Component {
38
49
  constructor(props) {
39
50
  super(props);
@@ -1 +1 @@
1
- {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/error-boundary/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AA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CAAC,KAAK,EAAC,OAAO,mDAAG,EAAE,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,IAAI,CAAC,KAAK,CAAC,eAAe,EAAE,CAAC,CAAC;IAC1F,CAAC;IAED,MAAM;;QACJ,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;YAClD,MAAM,QAAQ,GAAG,oBAAC,qBAAqB,OAAK,IAAI,CAAC,KAAK,GAAI,CAAC;YAC3D,OAAO,MAAA,MAAA,MAAA,IAAI,CAAC,KAAK,EAAC,OAAO,mDAAG,QAAQ,CAAC,mCAAI,QAAQ,CAAC;QACpD,CAAC;QACD,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;IAC7B,CAAC;CACF","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, { Component, createContext, useContext, useState } from 'react';\n\nimport { useMergeRefs } from '@cloudscape-design/component-toolkit/internal';\n\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { SomeRequired } from '../internal/types';\nimport { ErrorBoundaryFallback } from './fallback';\nimport { BuiltInErrorBoundaryProps, ErrorBoundaryProps } from './interfaces';\n\nimport styles from './styles.css.js';\n\n// Helper methods attached to the component's root node for e2e testing.\ndeclare global {\n interface HTMLElement {\n __awsui__?: { forceError?(): void; clearForcedError?(): void };\n }\n}\n\nconst RootSuppressed = Symbol();\n\nconst ErrorBoundariesContext = createContext<\n Pick<ErrorBoundaryProps, 'renderFallback' | 'i18nStrings' | 'onError' | 'errorBoundaryId'> & {\n suppressed: boolean | typeof RootSuppressed;\n }\n>({\n onError: () => {},\n suppressed: RootSuppressed,\n});\n\ninterface InternalErrorBoundaryProps\n extends SomeRequired<ErrorBoundaryProps, 'suppressNested' | 'suppressible'>,\n InternalBaseComponentProps {}\n\nexport function InternalErrorBoundary({\n children,\n suppressNested,\n suppressible,\n __internalRootRef,\n ...props\n}: InternalErrorBoundaryProps) {\n const context = useContext(ErrorBoundariesContext);\n const thisSuppressed = context.suppressed === true && suppressible;\n const nextSuppressed = suppressNested || thisSuppressed;\n\n const [forcedError, setForcedError] = useState(false);\n const setElement = (node: null | HTMLDivElement) => {\n if (node) {\n if (!node.__awsui__) {\n node.__awsui__ = {};\n }\n node.__awsui__.forceError = () => setForcedError(true);\n node.__awsui__.clearForcedError = () => setForcedError(false);\n }\n };\n const mergedRef = useMergeRefs(setElement, __internalRootRef);\n\n return (\n <div ref={mergedRef} className={styles['error-boundary']} data-awsui-boundary-id={props.errorBoundaryId}>\n {!thisSuppressed ? (\n <ErrorBoundaryImpl {...props} forcedError={forcedError}>\n <ErrorBoundariesContext.Provider value={{ ...props, suppressed: nextSuppressed }}>\n {children}\n </ErrorBoundariesContext.Provider>\n </ErrorBoundaryImpl>\n ) : (\n <>{children}</>\n )}\n </div>\n );\n}\n\nexport function BuiltInErrorBoundary({ wrapper, suppressNested = false, children }: BuiltInErrorBoundaryProps) {\n const context = useContext(ErrorBoundariesContext);\n const thisSuppressed = context.suppressed === true || context.suppressed === RootSuppressed;\n const nextSuppressed = suppressNested || thisSuppressed;\n return !thisSuppressed ? (\n <ErrorBoundaryImpl {...context} wrapper={wrapper}>\n <ErrorBoundariesContext.Provider value={{ ...context, suppressed: nextSuppressed }}>\n {children}\n </ErrorBoundariesContext.Provider>\n </ErrorBoundaryImpl>\n ) : (\n <>{children}</>\n );\n}\n\ninterface ErrorBoundaryState {\n hasError: boolean;\n}\n\ninterface ErrorBoundaryImplProps extends ErrorBoundaryProps {\n wrapper?: (content: React.ReactNode) => React.ReactNode;\n forcedError?: boolean;\n}\n\nclass ErrorBoundaryImpl extends Component<ErrorBoundaryImplProps, ErrorBoundaryState> {\n constructor(props: ErrorBoundaryImplProps) {\n super(props);\n this.state = { hasError: false };\n }\n\n static getDerivedStateFromError() {\n return { hasError: true };\n }\n\n componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void {\n this.props.onError?.({ error, errorInfo, errorBoundaryId: this.props.errorBoundaryId });\n }\n\n render() {\n if (this.state.hasError || this.props.forcedError) {\n const fallback = <ErrorBoundaryFallback {...this.props} />;\n return this.props.wrapper?.(fallback) ?? fallback;\n }\n return this.props.children;\n }\n}\n"]}
1
+ {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/error-boundary/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE9E,OAAO,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAI7E,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAGnD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AASrC,MAAM,cAAc,GAAG,MAAM,EAAE,CAAC;AAEhC,MAAM,sBAAsB,GAAG,aAAa,CAI1C;IACA,OAAO,EAAE,GAAG,EAAE,GAAE,CAAC;IACjB,UAAU,EAAE,cAAc;CAC3B,CAAC,CAAC;AAMH,MAAM,UAAU,qBAAqB,CAAC,EACpC,QAAQ,EACR,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,GAAG,KAAK,EACmB;IAC3B,MAAM,OAAO,GAAG,UAAU,CAAC,sBAAsB,CAAC,CAAC;IACnD,MAAM,cAAc,GAAG,OAAO,CAAC,UAAU,KAAK,IAAI,IAAI,YAAY,CAAC;IACnE,MAAM,cAAc,GAAG,cAAc,IAAI,cAAc,CAAC;IAExD,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACtD,MAAM,UAAU,GAAG,CAAC,IAA2B,EAAE,EAAE;QACjD,IAAI,IAAI,EAAE,CAAC;YACT,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;gBACpB,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;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e,EAAE,IAAI,CAAC,KAAK,CAAC,eAAe,EAAE,CAAC,CAAC;IAC1F,CAAC;IAED,MAAM;;QACJ,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;YAClD,MAAM,QAAQ,GAAG,oBAAC,qBAAqB,OAAK,IAAI,CAAC,KAAK,GAAI,CAAC;YAC3D,OAAO,MAAA,MAAA,MAAA,IAAI,CAAC,KAAK,EAAC,OAAO,mDAAG,QAAQ,CAAC,mCAAI,QAAQ,CAAC;QACpD,CAAC;QACD,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;IAC7B,CAAC;CACF","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, { Component, createContext, useContext, useState } from 'react';\n\nimport { useMergeRefs } from '@cloudscape-design/component-toolkit/internal';\n\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { SomeRequired } from '../internal/types';\nimport { ErrorBoundaryFallback } from './fallback';\nimport { AppLayoutBuiltInErrorBoundaryProps, BuiltInErrorBoundaryProps, ErrorBoundaryProps } from './interfaces';\n\nimport styles from './styles.css.js';\n\n// Helper methods attached to the component's root node for e2e testing.\ndeclare global {\n interface HTMLElement {\n __awsui__?: { forceError?(): void; clearForcedError?(): void };\n }\n}\n\nconst RootSuppressed = Symbol();\n\nconst ErrorBoundariesContext = createContext<\n Pick<ErrorBoundaryProps, 'renderFallback' | 'i18nStrings' | 'onError' | 'errorBoundaryId'> & {\n suppressed: boolean | typeof RootSuppressed;\n }\n>({\n onError: () => {},\n suppressed: RootSuppressed,\n});\n\ninterface InternalErrorBoundaryProps\n extends SomeRequired<ErrorBoundaryProps, 'suppressNested' | 'suppressible'>,\n InternalBaseComponentProps {}\n\nexport function InternalErrorBoundary({\n children,\n suppressNested,\n suppressible,\n __internalRootRef,\n ...props\n}: InternalErrorBoundaryProps) {\n const context = useContext(ErrorBoundariesContext);\n const thisSuppressed = context.suppressed === true && suppressible;\n const nextSuppressed = suppressNested || thisSuppressed;\n\n const [forcedError, setForcedError] = useState(false);\n const setElement = (node: null | HTMLDivElement) => {\n if (node) {\n if (!node.__awsui__) {\n node.__awsui__ = {};\n }\n node.__awsui__.forceError = () => setForcedError(true);\n node.__awsui__.clearForcedError = () => setForcedError(false);\n }\n };\n const mergedRef = useMergeRefs(setElement, __internalRootRef);\n\n return (\n <div ref={mergedRef} className={styles['error-boundary']} data-awsui-boundary-id={props.errorBoundaryId}>\n {!thisSuppressed ? (\n <ErrorBoundaryImpl {...props} forcedError={forcedError}>\n <ErrorBoundariesContext.Provider value={{ ...props, suppressed: nextSuppressed }}>\n {children}\n </ErrorBoundariesContext.Provider>\n </ErrorBoundaryImpl>\n ) : (\n <>{children}</>\n )}\n </div>\n );\n}\n\nexport function BuiltInErrorBoundary({ wrapper, suppressNested = false, children }: BuiltInErrorBoundaryProps) {\n const context = useContext(ErrorBoundariesContext);\n const thisSuppressed = context.suppressed === true || context.suppressed === RootSuppressed;\n const nextSuppressed = suppressNested || thisSuppressed;\n return !thisSuppressed ? (\n <ErrorBoundaryImpl {...context} wrapper={wrapper}>\n <ErrorBoundariesContext.Provider value={{ ...context, suppressed: nextSuppressed }}>\n {children}\n </ErrorBoundariesContext.Provider>\n </ErrorBoundaryImpl>\n ) : (\n <>{children}</>\n );\n}\n\nexport function AppLayoutBuiltInErrorBoundary({\n wrapper,\n suppressNested = false,\n children,\n renderFallback = () => <></>,\n}: AppLayoutBuiltInErrorBoundaryProps) {\n const context = useContext(ErrorBoundariesContext);\n const thisSuppressed = context.suppressed === true || context.suppressed === RootSuppressed;\n const nextSuppressed = suppressNested || thisSuppressed;\n return (\n <ErrorBoundaryImpl\n {...context}\n wrapper={wrapper}\n renderFallback={renderFallback}\n className={styles['app-layout-part-fallback']}\n onError={error => {\n context?.onError?.(error);\n // TODO Implement cloudscape error reporting\n }}\n >\n <ErrorBoundariesContext.Provider value={{ ...context, suppressed: nextSuppressed, renderFallback }}>\n {children}\n </ErrorBoundariesContext.Provider>\n </ErrorBoundaryImpl>\n );\n}\n\ninterface ErrorBoundaryState {\n hasError: boolean;\n}\n\ninterface ErrorBoundaryImplProps extends ErrorBoundaryProps {\n wrapper?: (content: React.ReactNode) => React.ReactNode;\n forcedError?: boolean;\n}\n\nclass ErrorBoundaryImpl extends Component<ErrorBoundaryImplProps, ErrorBoundaryState> {\n constructor(props: ErrorBoundaryImplProps) {\n super(props);\n this.state = { hasError: false };\n }\n\n static getDerivedStateFromError() {\n return { hasError: true };\n }\n\n componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void {\n this.props.onError?.({ error, errorInfo, errorBoundaryId: this.props.errorBoundaryId });\n }\n\n render() {\n if (this.state.hasError || this.props.forcedError) {\n const fallback = <ErrorBoundaryFallback {...this.props} />;\n return this.props.wrapper?.(fallback) ?? fallback;\n }\n return this.props.children;\n }\n}\n"]}
@@ -1,9 +1,10 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "error-boundary": "awsui_error-boundary_9pwoq_r5exj_5",
5
- "header": "awsui_header_9pwoq_r5exj_6",
6
- "description": "awsui_description_9pwoq_r5exj_7",
7
- "action": "awsui_action_9pwoq_r5exj_8"
4
+ "error-boundary": "awsui_error-boundary_9pwoq_e6u2g_5",
5
+ "header": "awsui_header_9pwoq_e6u2g_6",
6
+ "description": "awsui_description_9pwoq_e6u2g_7",
7
+ "action": "awsui_action_9pwoq_e6u2g_8",
8
+ "app-layout-part-fallback": "awsui_app-layout-part-fallback_9pwoq_e6u2g_9"
8
9
  };
9
10
 
@@ -2,9 +2,10 @@
2
2
  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  SPDX-License-Identifier: Apache-2.0
4
4
  */
5
- .awsui_error-boundary_9pwoq_r5exj_5:not(#\9),
6
- .awsui_header_9pwoq_r5exj_6:not(#\9),
7
- .awsui_description_9pwoq_r5exj_7:not(#\9),
8
- .awsui_action_9pwoq_r5exj_8:not(#\9) {
5
+ .awsui_error-boundary_9pwoq_e6u2g_5:not(#\9),
6
+ .awsui_header_9pwoq_e6u2g_6:not(#\9),
7
+ .awsui_description_9pwoq_e6u2g_7:not(#\9),
8
+ .awsui_action_9pwoq_e6u2g_8:not(#\9),
9
+ .awsui_app-layout-part-fallback_9pwoq_e6u2g_9:not(#\9) {
9
10
  display: contents;
10
11
  }
@@ -2,9 +2,10 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "error-boundary": "awsui_error-boundary_9pwoq_r5exj_5",
6
- "header": "awsui_header_9pwoq_r5exj_6",
7
- "description": "awsui_description_9pwoq_r5exj_7",
8
- "action": "awsui_action_9pwoq_r5exj_8"
5
+ "error-boundary": "awsui_error-boundary_9pwoq_e6u2g_5",
6
+ "header": "awsui_header_9pwoq_e6u2g_6",
7
+ "description": "awsui_description_9pwoq_e6u2g_7",
8
+ "action": "awsui_action_9pwoq_e6u2g_8",
9
+ "app-layout-part-fallback": "awsui_app-layout-part-fallback_9pwoq_e6u2g_9"
9
10
  };
10
11
 
@@ -3816,5 +3816,5 @@ body {
3816
3816
  }
3817
3817
  }
3818
3818
  :root {
3819
- --awsui-version-info-b8108b42: true;
3819
+ --awsui-version-info-d579b631: true;
3820
3820
  }
@@ -13,7 +13,6 @@ export interface ButtonTriggerProps extends BaseComponentProps {
13
13
  inlineTokens?: boolean;
14
14
  ariaHasPopup?: 'true' | 'listbox' | 'dialog';
15
15
  ariaControls?: string;
16
- ariaLabel?: string;
17
16
  ariaLabelledby?: string;
18
17
  ariaDescribedby?: string;
19
18
  onKeyDown?: CancelableEventHandler<BaseKeyDetail>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/button-trigger/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAMpD,OAAO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AiB,kBAAkB,CAAC;IAClC,UAAiB,GAAG;QAClB,KAAK,IAAI,IAAI,CAAC;KACf;CACF;;AAED,wBAA+C"}
@@ -8,7 +8,7 @@ import { getBaseProps } from '../../base-component';
8
8
  import { fireCancelableEvent, fireKeyboardEvent } from '../../events';
9
9
  import analyticsSelectors from './analytics-metadata/styles.css.js';
10
10
  import styles from './styles.css.js';
11
- const ButtonTrigger = ({ children, pressed, hideCaret = false, disabled = false, readOnly = false, invalid = false, warning = false, inlineTokens, inFilteringToken, ariaHasPopup, ariaLabel, ariaLabelledby, ariaDescribedby, ariaControls, onKeyDown, onKeyUp, onMouseDown, onClick, onFocus, onBlur, hasCustomContent = false, autoFocus, ...restProps }, ref) => {
11
+ const ButtonTrigger = ({ children, pressed, hideCaret = false, disabled = false, readOnly = false, invalid = false, warning = false, inlineTokens, inFilteringToken, ariaHasPopup, ariaLabelledby, ariaDescribedby, ariaControls, onKeyDown, onKeyUp, onMouseDown, onClick, onFocus, onBlur, hasCustomContent = false, autoFocus, ...restProps }, ref) => {
12
12
  const baseProps = getBaseProps(restProps);
13
13
  let attributes = {
14
14
  ...baseProps,
@@ -16,7 +16,6 @@ const ButtonTrigger = ({ children, pressed, hideCaret = false, disabled = false,
16
16
  className: clsx(styles['button-trigger'], analyticsSelectors['button-trigger'], baseProps.className, pressed && styles.pressed, disabled && styles.disabled, invalid && styles.invalid, warning && !invalid && styles.warning, !hideCaret && styles['has-caret'], readOnly && styles.readonly, inFilteringToken && styles['in-filtering-token'], inFilteringToken && styles[`in-filtering-token-${inFilteringToken}`], inlineTokens && styles['inline-tokens'], !!hasCustomContent && styles['custom-option']),
17
17
  disabled: disabled,
18
18
  'aria-expanded': pressed,
19
- 'aria-label': ariaLabel,
20
19
  'aria-labelledby': ariaLabelledby,
21
20
  'aria-describedby': ariaDescribedby,
22
21
  'aria-haspopup': ariaHasPopup !== null && ariaHasPopup !== void 0 ? ariaHasPopup : 'listbox',