@cloudscape-design/components-themeable 3.0.696 → 3.0.697

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 (201) hide show
  1. package/lib/internal/manifest.json +1 -1
  2. package/lib/internal/scss/button/constants.scss +2 -2
  3. package/lib/internal/scss/button/styles.scss +4 -1
  4. package/lib/internal/scss/button/test-classes/styles.scss +8 -0
  5. package/lib/internal/scss/calendar/styles.scss +4 -0
  6. package/lib/internal/scss/date-range-picker/calendar/grids/styles.scss +4 -0
  7. package/lib/internal/scss/segmented-control/styles.scss +4 -0
  8. package/lib/internal/scss/select/parts/styles.scss +4 -0
  9. package/lib/internal/scss/tabs/styles.scss +8 -0
  10. package/lib/internal/scss/tabs/tab-header-bar.scss +4 -1
  11. package/lib/internal/template/button/index.d.ts.map +1 -1
  12. package/lib/internal/template/button/index.js +2 -2
  13. package/lib/internal/template/button/index.js.map +1 -1
  14. package/lib/internal/template/button/interfaces.d.ts +6 -0
  15. package/lib/internal/template/button/interfaces.d.ts.map +1 -1
  16. package/lib/internal/template/button/interfaces.js.map +1 -1
  17. package/lib/internal/template/button/internal.d.ts.map +1 -1
  18. package/lib/internal/template/button/internal.js +15 -4
  19. package/lib/internal/template/button/internal.js.map +1 -1
  20. package/lib/internal/template/button/styles.css.js +20 -19
  21. package/lib/internal/template/button/styles.scoped.css +161 -167
  22. package/lib/internal/template/button/styles.selectors.js +20 -19
  23. package/lib/internal/template/button/test-classes/styles.css.js +6 -0
  24. package/lib/internal/template/button/test-classes/styles.scoped.css +7 -0
  25. package/lib/internal/template/button/test-classes/styles.selectors.js +7 -0
  26. package/lib/internal/template/button-dropdown/category-elements/expandable-category-element.js +1 -1
  27. package/lib/internal/template/button-dropdown/category-elements/expandable-category-element.js.map +1 -1
  28. package/lib/internal/template/button-dropdown/category-elements/mobile-expandable-category-element.js +1 -1
  29. package/lib/internal/template/button-dropdown/category-elements/mobile-expandable-category-element.js.map +1 -1
  30. package/lib/internal/template/button-dropdown/index.d.ts.map +1 -1
  31. package/lib/internal/template/button-dropdown/index.js +2 -2
  32. package/lib/internal/template/button-dropdown/index.js.map +1 -1
  33. package/lib/internal/template/button-dropdown/interfaces.d.ts +7 -0
  34. package/lib/internal/template/button-dropdown/interfaces.d.ts.map +1 -1
  35. package/lib/internal/template/button-dropdown/interfaces.js.map +1 -1
  36. package/lib/internal/template/button-dropdown/internal.d.ts.map +1 -1
  37. package/lib/internal/template/button-dropdown/internal.js +4 -2
  38. package/lib/internal/template/button-dropdown/internal.js.map +1 -1
  39. package/lib/internal/template/button-dropdown/item-element/index.js +1 -1
  40. package/lib/internal/template/button-dropdown/item-element/index.js.map +1 -1
  41. package/lib/internal/template/calendar/grid/index.d.ts +3 -1
  42. package/lib/internal/template/calendar/grid/index.d.ts.map +1 -1
  43. package/lib/internal/template/calendar/grid/index.js +26 -6
  44. package/lib/internal/template/calendar/grid/index.js.map +1 -1
  45. package/lib/internal/template/calendar/grid/use-calendar-grid-keyboard-navigation.d.ts +2 -1
  46. package/lib/internal/template/calendar/grid/use-calendar-grid-keyboard-navigation.d.ts.map +1 -1
  47. package/lib/internal/template/calendar/grid/use-calendar-grid-keyboard-navigation.js +8 -5
  48. package/lib/internal/template/calendar/grid/use-calendar-grid-keyboard-navigation.js.map +1 -1
  49. package/lib/internal/template/calendar/interfaces.d.ts +9 -0
  50. package/lib/internal/template/calendar/interfaces.d.ts.map +1 -1
  51. package/lib/internal/template/calendar/interfaces.js.map +1 -1
  52. package/lib/internal/template/calendar/internal.d.ts +1 -1
  53. package/lib/internal/template/calendar/internal.d.ts.map +1 -1
  54. package/lib/internal/template/calendar/internal.js +7 -5
  55. package/lib/internal/template/calendar/internal.js.map +1 -1
  56. package/lib/internal/template/calendar/styles.css.js +21 -20
  57. package/lib/internal/template/calendar/styles.scoped.css +46 -42
  58. package/lib/internal/template/calendar/styles.selectors.js +21 -20
  59. package/lib/internal/template/calendar/utils/navigation.d.ts +10 -10
  60. package/lib/internal/template/calendar/utils/navigation.d.ts.map +1 -1
  61. package/lib/internal/template/calendar/utils/navigation.js +29 -29
  62. package/lib/internal/template/calendar/utils/navigation.js.map +1 -1
  63. package/lib/internal/template/date-picker/index.d.ts.map +1 -1
  64. package/lib/internal/template/date-picker/index.js +2 -2
  65. package/lib/internal/template/date-picker/index.js.map +1 -1
  66. package/lib/internal/template/date-range-picker/calendar/grids/grid.d.ts +2 -1
  67. package/lib/internal/template/date-range-picker/calendar/grids/grid.d.ts.map +1 -1
  68. package/lib/internal/template/date-range-picker/calendar/grids/grid.js +55 -7
  69. package/lib/internal/template/date-range-picker/calendar/grids/grid.js.map +1 -1
  70. package/lib/internal/template/date-range-picker/calendar/grids/index.d.ts +2 -1
  71. package/lib/internal/template/date-range-picker/calendar/grids/index.d.ts.map +1 -1
  72. package/lib/internal/template/date-range-picker/calendar/grids/index.js +20 -12
  73. package/lib/internal/template/date-range-picker/calendar/grids/index.js.map +1 -1
  74. package/lib/internal/template/date-range-picker/calendar/grids/styles.css.js +28 -27
  75. package/lib/internal/template/date-range-picker/calendar/grids/styles.scoped.css +46 -42
  76. package/lib/internal/template/date-range-picker/calendar/grids/styles.selectors.js +28 -27
  77. package/lib/internal/template/date-range-picker/calendar/index.d.ts +2 -1
  78. package/lib/internal/template/date-range-picker/calendar/index.d.ts.map +1 -1
  79. package/lib/internal/template/date-range-picker/calendar/index.js +2 -2
  80. package/lib/internal/template/date-range-picker/calendar/index.js.map +1 -1
  81. package/lib/internal/template/date-range-picker/dropdown.d.ts +2 -2
  82. package/lib/internal/template/date-range-picker/dropdown.d.ts.map +1 -1
  83. package/lib/internal/template/date-range-picker/dropdown.js +2 -2
  84. package/lib/internal/template/date-range-picker/dropdown.js.map +1 -1
  85. package/lib/internal/template/date-range-picker/index.d.ts.map +1 -1
  86. package/lib/internal/template/date-range-picker/index.js +2 -2
  87. package/lib/internal/template/date-range-picker/index.js.map +1 -1
  88. package/lib/internal/template/date-range-picker/interfaces.d.ts +9 -0
  89. package/lib/internal/template/date-range-picker/interfaces.d.ts.map +1 -1
  90. package/lib/internal/template/date-range-picker/interfaces.js.map +1 -1
  91. package/lib/internal/template/internal/base-component/styles.scoped.css +26 -22
  92. package/lib/internal/template/internal/components/option/interfaces.d.ts +2 -0
  93. package/lib/internal/template/internal/components/option/interfaces.d.ts.map +1 -1
  94. package/lib/internal/template/internal/components/option/interfaces.js.map +1 -1
  95. package/lib/internal/template/internal/components/selectable-item/index.d.ts +1 -0
  96. package/lib/internal/template/internal/components/selectable-item/index.d.ts.map +1 -1
  97. package/lib/internal/template/internal/components/selectable-item/index.js +3 -0
  98. package/lib/internal/template/internal/components/selectable-item/index.js.map +1 -1
  99. package/lib/internal/template/internal/components/tooltip/index.d.ts +3 -1
  100. package/lib/internal/template/internal/components/tooltip/index.d.ts.map +1 -1
  101. package/lib/internal/template/internal/components/tooltip/index.js +3 -3
  102. package/lib/internal/template/internal/components/tooltip/index.js.map +1 -1
  103. package/lib/internal/template/internal/environment.js +1 -1
  104. package/lib/internal/template/internal/environment.json +1 -1
  105. package/lib/internal/template/internal/generated/styles/tokens.d.ts +2 -0
  106. package/lib/internal/template/internal/generated/styles/tokens.js +4 -2
  107. package/lib/internal/template/internal/generated/theming/index.cjs +78 -12
  108. package/lib/internal/template/internal/generated/theming/index.cjs.d.ts +16 -0
  109. package/lib/internal/template/internal/generated/theming/index.d.ts +16 -0
  110. package/lib/internal/template/internal/generated/theming/index.js +78 -12
  111. package/lib/internal/template/{button-dropdown/utils/use-hidden-description.d.ts → internal/hooks/use-hidden-description/index.d.ts} +2 -1
  112. package/lib/internal/template/internal/hooks/use-hidden-description/index.d.ts.map +1 -0
  113. package/lib/internal/template/{button-dropdown/utils/use-hidden-description.js → internal/hooks/use-hidden-description/index.js} +3 -2
  114. package/lib/internal/template/internal/hooks/use-hidden-description/index.js.map +1 -0
  115. package/lib/internal/template/segmented-control/interfaces.d.ts +2 -0
  116. package/lib/internal/template/segmented-control/interfaces.d.ts.map +1 -1
  117. package/lib/internal/template/segmented-control/interfaces.js.map +1 -1
  118. package/lib/internal/template/segmented-control/internal-segmented-control.d.ts.map +1 -1
  119. package/lib/internal/template/segmented-control/internal-segmented-control.js +11 -8
  120. package/lib/internal/template/segmented-control/internal-segmented-control.js.map +1 -1
  121. package/lib/internal/template/segmented-control/segment.d.ts.map +1 -1
  122. package/lib/internal/template/segmented-control/segment.js +14 -4
  123. package/lib/internal/template/segmented-control/segment.js.map +1 -1
  124. package/lib/internal/template/segmented-control/styles.css.js +15 -14
  125. package/lib/internal/template/segmented-control/styles.scoped.css +37 -33
  126. package/lib/internal/template/segmented-control/styles.selectors.js +15 -14
  127. package/lib/internal/template/select/interfaces.d.ts +1 -0
  128. package/lib/internal/template/select/interfaces.d.ts.map +1 -1
  129. package/lib/internal/template/select/interfaces.js.map +1 -1
  130. package/lib/internal/template/select/parts/filter.d.ts +1 -1
  131. package/lib/internal/template/select/parts/item.d.ts.map +1 -1
  132. package/lib/internal/template/select/parts/item.js +13 -3
  133. package/lib/internal/template/select/parts/item.js.map +1 -1
  134. package/lib/internal/template/select/parts/multiselect-item.d.ts.map +1 -1
  135. package/lib/internal/template/select/parts/multiselect-item.js +15 -3
  136. package/lib/internal/template/select/parts/multiselect-item.js.map +1 -1
  137. package/lib/internal/template/select/parts/styles.css.js +17 -16
  138. package/lib/internal/template/select/parts/styles.scoped.css +21 -17
  139. package/lib/internal/template/select/parts/styles.selectors.js +17 -16
  140. package/lib/internal/template/split-panel/icons/styles.css.js +22 -22
  141. package/lib/internal/template/split-panel/icons/styles.scoped.css +25 -25
  142. package/lib/internal/template/split-panel/icons/styles.selectors.js +22 -22
  143. package/lib/internal/template/table/body-cell/disabled-inline-editor.js +1 -1
  144. package/lib/internal/template/table/body-cell/disabled-inline-editor.js.map +1 -1
  145. package/lib/internal/template/tabs/interfaces.d.ts +5 -0
  146. package/lib/internal/template/tabs/interfaces.d.ts.map +1 -1
  147. package/lib/internal/template/tabs/interfaces.js.map +1 -1
  148. package/lib/internal/template/tabs/styles.css.js +28 -25
  149. package/lib/internal/template/tabs/styles.scoped.css +60 -49
  150. package/lib/internal/template/tabs/styles.selectors.js +28 -25
  151. package/lib/internal/template/tabs/tab-header-bar.d.ts.map +1 -1
  152. package/lib/internal/template/tabs/tab-header-bar.js +38 -14
  153. package/lib/internal/template/tabs/tab-header-bar.js.map +1 -1
  154. package/lib/internal/template/test-utils/dom/button/index.d.ts +1 -0
  155. package/lib/internal/template/test-utils/dom/button/index.js +6 -2
  156. package/lib/internal/template/test-utils/dom/button/index.js.map +1 -1
  157. package/lib/internal/template/test-utils/dom/button-dropdown/index.d.ts +2 -1
  158. package/lib/internal/template/test-utils/dom/button-dropdown/index.js +5 -1
  159. package/lib/internal/template/test-utils/dom/button-dropdown/index.js.map +1 -1
  160. package/lib/internal/template/test-utils/dom/calendar/index.d.ts +4 -1
  161. package/lib/internal/template/test-utils/dom/calendar/index.js +8 -1
  162. package/lib/internal/template/test-utils/dom/calendar/index.js.map +1 -1
  163. package/lib/internal/template/test-utils/dom/date-range-picker/index.d.ts +4 -1
  164. package/lib/internal/template/test-utils/dom/date-range-picker/index.js +8 -2
  165. package/lib/internal/template/test-utils/dom/date-range-picker/index.js.map +1 -1
  166. package/lib/internal/template/test-utils/dom/internal/dropdown-host.js.map +1 -1
  167. package/lib/internal/template/test-utils/dom/internal/option.d.ts +1 -0
  168. package/lib/internal/template/test-utils/dom/internal/option.js +4 -0
  169. package/lib/internal/template/test-utils/dom/internal/option.js.map +1 -1
  170. package/lib/internal/template/test-utils/dom/segmented-control/index.d.ts +9 -0
  171. package/lib/internal/template/test-utils/dom/segmented-control/index.js +15 -0
  172. package/lib/internal/template/test-utils/dom/segmented-control/index.js.map +1 -1
  173. package/lib/internal/template/test-utils/dom/tabs/index.d.ts +9 -2
  174. package/lib/internal/template/test-utils/dom/tabs/index.js +15 -2
  175. package/lib/internal/template/test-utils/dom/tabs/index.js.map +1 -1
  176. package/lib/internal/template/test-utils/selectors/button/index.d.ts +1 -0
  177. package/lib/internal/template/test-utils/selectors/button/index.js +6 -2
  178. package/lib/internal/template/test-utils/selectors/button/index.js.map +1 -1
  179. package/lib/internal/template/test-utils/selectors/button-dropdown/index.d.ts +2 -1
  180. package/lib/internal/template/test-utils/selectors/button-dropdown/index.js +5 -1
  181. package/lib/internal/template/test-utils/selectors/button-dropdown/index.js.map +1 -1
  182. package/lib/internal/template/test-utils/selectors/calendar/index.d.ts +4 -1
  183. package/lib/internal/template/test-utils/selectors/calendar/index.js +8 -1
  184. package/lib/internal/template/test-utils/selectors/calendar/index.js.map +1 -1
  185. package/lib/internal/template/test-utils/selectors/date-range-picker/index.d.ts +4 -1
  186. package/lib/internal/template/test-utils/selectors/date-range-picker/index.js +8 -2
  187. package/lib/internal/template/test-utils/selectors/date-range-picker/index.js.map +1 -1
  188. package/lib/internal/template/test-utils/selectors/internal/dropdown-host.js.map +1 -1
  189. package/lib/internal/template/test-utils/selectors/internal/option.d.ts +1 -0
  190. package/lib/internal/template/test-utils/selectors/internal/option.js +4 -0
  191. package/lib/internal/template/test-utils/selectors/internal/option.js.map +1 -1
  192. package/lib/internal/template/test-utils/selectors/segmented-control/index.d.ts +9 -0
  193. package/lib/internal/template/test-utils/selectors/segmented-control/index.js +15 -0
  194. package/lib/internal/template/test-utils/selectors/segmented-control/index.js.map +1 -1
  195. package/lib/internal/template/test-utils/selectors/tabs/index.d.ts +9 -2
  196. package/lib/internal/template/test-utils/selectors/tabs/index.js +15 -2
  197. package/lib/internal/template/test-utils/selectors/tabs/index.js.map +1 -1
  198. package/lib/internal/template/test-utils/tsconfig.tsbuildinfo +1 -1
  199. package/package.json +1 -1
  200. package/lib/internal/template/button-dropdown/utils/use-hidden-description.d.ts.map +0 -1
  201. package/lib/internal/template/button-dropdown/utils/use-hidden-description.js.map +0 -1
@@ -60,7 +60,7 @@ function isDateOnly(value) {
60
60
  }
61
61
  const DateRangePicker = React.forwardRef((_a, ref) => {
62
62
  var _b, _c;
63
- var { locale = '', startOfWeek, isDateEnabled = () => true, value, placeholder, readOnly = false, disabled = false, onChange, onBlur, onFocus, relativeOptions = [], i18nStrings, isValidRange = () => ({ valid: true }), showClearButton = true, dateOnly = false, timeOffset, getTimeOffset, timeInputFormat = 'hh:mm:ss', expandToViewport = false, rangeSelectorMode = 'default', customAbsoluteRangeControl, absoluteFormat = 'iso', hideTimeOffset } = _a, rest = __rest(_a, ["locale", "startOfWeek", "isDateEnabled", "value", "placeholder", "readOnly", "disabled", "onChange", "onBlur", "onFocus", "relativeOptions", "i18nStrings", "isValidRange", "showClearButton", "dateOnly", "timeOffset", "getTimeOffset", "timeInputFormat", "expandToViewport", "rangeSelectorMode", "customAbsoluteRangeControl", "absoluteFormat", "hideTimeOffset"]);
63
+ var { 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', expandToViewport = false, rangeSelectorMode = 'default', customAbsoluteRangeControl, absoluteFormat = 'iso', hideTimeOffset } = _a, rest = __rest(_a, ["locale", "startOfWeek", "isDateEnabled", "dateDisabledReason", "value", "placeholder", "readOnly", "disabled", "onChange", "onBlur", "onFocus", "relativeOptions", "i18nStrings", "isValidRange", "showClearButton", "dateOnly", "timeOffset", "getTimeOffset", "timeInputFormat", "expandToViewport", "rangeSelectorMode", "customAbsoluteRangeControl", "absoluteFormat", "hideTimeOffset"]);
64
64
  const { __internalRootRef } = useBaseComponent('DateRangePicker', {
65
65
  props: {
66
66
  absoluteFormat,
@@ -171,7 +171,7 @@ const DateRangePicker = React.forwardRef((_a, ref) => {
171
171
  const mergedRef = useMergeRefs(rootRef, __internalRootRef);
172
172
  return (React.createElement("div", Object.assign({}, baseProps, { ref: mergedRef, className: clsx(baseProps.className, styles.root, absoluteFormat === 'long-localized' && !dateOnly && styles.wide), onKeyDown: onWrapperKeyDownHandler }),
173
173
  React.createElement(Dropdown, { stretchWidth: true, stretchHeight: true, open: isDropDownOpen, onDropdownClose: () => closeDropdown(), trigger: trigger, stretchToTriggerWidth: false, expandToViewport: expandToViewport, dropdownId: dropdownId },
174
- React.createElement(ResetContextsForModal, null, isDropDownOpen && (React.createElement(DateRangePickerDropdown, { startOfWeek: startOfWeek, locale: normalizedLocale, isSingleGrid: isSingleGrid, onDropdownClose: () => closeDropdown(true), value: value, showClearButton: showClearButton, isDateEnabled: isDateEnabled, i18nStrings: i18nStrings, onClear: onClear, onApply: onApply, relativeOptions: relativeOptions, isValidRange: isValidRange, dateOnly: dateOnly, timeInputFormat: timeInputFormat, rangeSelectorMode: rangeSelectorMode, ariaLabelledby: ariaLabelledby, ariaDescribedby: ariaDescribedby, customAbsoluteRangeControl: customAbsoluteRangeControl }))))));
174
+ React.createElement(ResetContextsForModal, null, isDropDownOpen && (React.createElement(DateRangePickerDropdown, { startOfWeek: startOfWeek, locale: normalizedLocale, isSingleGrid: isSingleGrid, onDropdownClose: () => closeDropdown(true), value: value, showClearButton: showClearButton, isDateEnabled: isDateEnabled, dateDisabledReason: dateDisabledReason, i18nStrings: i18nStrings, onClear: onClear, onApply: onApply, relativeOptions: relativeOptions, isValidRange: isValidRange, dateOnly: dateOnly, timeInputFormat: timeInputFormat, rangeSelectorMode: rangeSelectorMode, ariaLabelledby: ariaLabelledby, ariaDescribedby: ariaDescribedby, customAbsoluteRangeControl: customAbsoluteRangeControl }))))));
175
175
  });
176
176
  applyDisplayName(DateRangePicker, 'DateRangePicker');
177
177
  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,OAAO,KAAK,EAAE,EAAO,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,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B,eAAe,EAAE,eAAe,EAChC,0BAA0B,EAAE,0BAA0B,GACtD,CACH,CACqB,CACf,CACP,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\nimport React, { Ref, useEffect, useRef, useState } from 'react';\nimport styles from './styles.css.js';\nimport { DateRangePickerProps } from './interfaces';\nimport { normalizeLocale } from '../internal/utils/locale';\nimport useForwardFocus from '../internal/hooks/forward-focus';\nimport { KeyCode } from '../internal/keycode';\nimport clsx from 'clsx';\nimport { getBaseProps } from '../internal/base-component';\nimport checkControlled from '../internal/hooks/check-controlled';\nimport InternalBox from '../box/internal';\nimport { DateRangePickerDropdown } from './dropdown';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport Dropdown from '../internal/components/dropdown';\nimport { useFocusTracker } from '../internal/hooks/use-focus-tracker';\nimport { useMobile } from '../internal/hooks/use-mobile';\nimport ButtonTrigger from '../internal/components/button-trigger';\nimport { useFormFieldContext } from '../internal/context/form-field-context';\nimport InternalIcon from '../icon/internal';\nimport { normalizeTimeOffset, shiftTimeOffset } from './time-offset';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport { isDevelopment } from '../internal/is-development.js';\nimport { warnOnce } from '@cloudscape-design/component-toolkit/internal';\nimport { usePrevious } from '../internal/hooks/use-previous';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { joinStrings } from '../internal/utils/strings/join-strings';\nimport { formatDateRange, isIsoDateOnly } from '../internal/utils/date-time';\nimport { useInternalI18n } from '../i18n/context';\nimport { formatValue } from './utils';\nimport ResetContextsForModal from '../internal/context/reset-contexts-for-modal.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 if (!range) {\n return (\n <span className={styles['label-text']} aria-disabled={true}>\n {placeholder}\n </span>\n );\n }\n\n const formatted =\n range.type === 'relative' ? (\n formatRelativeRange?.(range) ?? ''\n ) : (\n <BreakSpaces\n text={formatDateRange({\n startDate: range.startDate,\n endDate: range.endDate,\n timeOffset,\n hideTimeOffset,\n format: absoluteFormat,\n locale,\n })}\n />\n );\n\n return (\n <InternalBox fontWeight=\"normal\" display=\"inline\" color=\"inherit\" variant=\"span\">\n {formatted}\n </InternalBox>\n );\n}\n\nfunction BreakSpaces({ text }: { text: string }) {\n const tokens = text.split(/( )/);\n return (\n <>\n {tokens.map((token, index) => (\n <React.Fragment key={index}>\n {token.length > 1 ? <span className={styles['label-token-nowrap']}>{token}</span> : token}\n {token === ' ' && <wbr />}\n </React.Fragment>\n ))}\n </>\n );\n}\n\nfunction isDateOnly(value: null | DateRangePickerProps.Value) {\n if (!value || value.type !== 'absolute') {\n return false;\n }\n return isIsoDateOnly(value.startDate) && isIsoDateOnly(value.endDate);\n}\n\nconst DateRangePicker = React.forwardRef(\n (\n {\n locale = '',\n startOfWeek,\n isDateEnabled = () => true,\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 expandToViewport = false,\n rangeSelectorMode = 'default',\n customAbsoluteRangeControl,\n absoluteFormat = 'iso',\n hideTimeOffset,\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 hideTimeOffset,\n },\n });\n checkControlled('DateRangePicker', 'value', value, 'onChange', onChange);\n\n const normalizedTimeOffset = normalizeTimeOffset(value, getTimeOffset, timeOffset);\n value = isDateOnly(value) ? value : shiftTimeOffset(value, normalizedTimeOffset);\n\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 validationResult = isValidRange(newValue);\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, {\n value: formatValue(newValue, {\n dateOnly,\n timeOffset: normalizeTimeOffset(newValue, getTimeOffset, timeOffset),\n }),\n });\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,\n timeOffset: normalizedTimeOffset,\n });\n\n const trigger = (\n <div className={styles['trigger-wrapper']}>\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(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 </div>\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 absoluteFormat === 'long-localized' && !dateOnly && styles.wide\n )}\n onKeyDown={onWrapperKeyDownHandler}\n >\n <Dropdown\n stretchWidth={true}\n stretchHeight={true}\n open={isDropDownOpen}\n onDropdownClose={() => closeDropdown()}\n trigger={trigger}\n stretchToTriggerWidth={false}\n expandToViewport={expandToViewport}\n dropdownId={dropdownId}\n >\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 onDropdownClose={() => closeDropdown(true)}\n value={value}\n showClearButton={showClearButton}\n isDateEnabled={isDateEnabled}\n i18nStrings={i18nStrings}\n onClear={onClear}\n onApply={onApply}\n relativeOptions={relativeOptions}\n isValidRange={isValidRange}\n dateOnly={dateOnly}\n timeInputFormat={timeInputFormat}\n rangeSelectorMode={rangeSelectorMode}\n ariaLabelledby={ariaLabelledby}\n ariaDescribedby={ariaDescribedby}\n customAbsoluteRangeControl={customAbsoluteRangeControl}\n />\n )}\n </ResetContextsForModal>\n </Dropdown>\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,OAAO,KAAK,EAAE,EAAO,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,eAAe,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,eAAe,MAAM,oCAAoC,CAAC;AACjE,OAAO,WAAW,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,QAAQ,MAAM,iCAAiC,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,aAAa,MAAM,uCAAuC,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,YAAY,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACrE,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OA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AY,EAAE,YAAY,EAC1B,eAAe,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,EAC1C,KAAK,EAAE,KAAK,EACZ,eAAe,EAAE,eAAe,EAChC,aAAa,EAAE,aAAa,EAC5B,kBAAkB,EAAE,kBAAkB,EACtC,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,eAAe,EAAE,eAAe,EAChC,YAAY,EAAE,YAAY,EAC1B,QAAQ,EAAE,QAAQ,EAClB,eAAe,EAAE,eAAe,EAChC,iBAAiB,EAAE,iBAAiB,EACpC,cAAc,EAAE,cAAc,EAC9B,eAAe,EAAE,eAAe,EAChC,0BAA0B,EAAE,0BAA0B,GACtD,CACH,CACqB,CACf,CACP,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\nimport React, { Ref, useEffect, useRef, useState } from 'react';\nimport styles from './styles.css.js';\nimport { DateRangePickerProps } from './interfaces';\nimport { normalizeLocale } from '../internal/utils/locale';\nimport useForwardFocus from '../internal/hooks/forward-focus';\nimport { KeyCode } from '../internal/keycode';\nimport clsx from 'clsx';\nimport { getBaseProps } from '../internal/base-component';\nimport checkControlled from '../internal/hooks/check-controlled';\nimport InternalBox from '../box/internal';\nimport { DateRangePickerDropdown } from './dropdown';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport Dropdown from '../internal/components/dropdown';\nimport { useFocusTracker } from '../internal/hooks/use-focus-tracker';\nimport { useMobile } from '../internal/hooks/use-mobile';\nimport ButtonTrigger from '../internal/components/button-trigger';\nimport { useFormFieldContext } from '../internal/context/form-field-context';\nimport InternalIcon from '../icon/internal';\nimport { normalizeTimeOffset, shiftTimeOffset } from './time-offset';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport { isDevelopment } from '../internal/is-development.js';\nimport { warnOnce } from '@cloudscape-design/component-toolkit/internal';\nimport { usePrevious } from '../internal/hooks/use-previous';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { joinStrings } from '../internal/utils/strings/join-strings';\nimport { formatDateRange, isIsoDateOnly } from '../internal/utils/date-time';\nimport { useInternalI18n } from '../i18n/context';\nimport { formatValue } from './utils';\nimport ResetContextsForModal from '../internal/context/reset-contexts-for-modal.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 if (!range) {\n return (\n <span className={styles['label-text']} aria-disabled={true}>\n {placeholder}\n </span>\n );\n }\n\n const formatted =\n range.type === 'relative' ? (\n formatRelativeRange?.(range) ?? ''\n ) : (\n <BreakSpaces\n text={formatDateRange({\n startDate: range.startDate,\n endDate: range.endDate,\n timeOffset,\n hideTimeOffset,\n format: absoluteFormat,\n locale,\n })}\n />\n );\n\n return (\n <InternalBox fontWeight=\"normal\" display=\"inline\" color=\"inherit\" variant=\"span\">\n {formatted}\n </InternalBox>\n );\n}\n\nfunction BreakSpaces({ text }: { text: string }) {\n const tokens = text.split(/( )/);\n return (\n <>\n {tokens.map((token, index) => (\n <React.Fragment key={index}>\n {token.length > 1 ? <span className={styles['label-token-nowrap']}>{token}</span> : token}\n {token === ' ' && <wbr />}\n </React.Fragment>\n ))}\n </>\n );\n}\n\nfunction isDateOnly(value: null | DateRangePickerProps.Value) {\n if (!value || value.type !== 'absolute') {\n return false;\n }\n return isIsoDateOnly(value.startDate) && isIsoDateOnly(value.endDate);\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 expandToViewport = false,\n rangeSelectorMode = 'default',\n customAbsoluteRangeControl,\n absoluteFormat = 'iso',\n hideTimeOffset,\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 hideTimeOffset,\n },\n });\n checkControlled('DateRangePicker', 'value', value, 'onChange', onChange);\n\n const normalizedTimeOffset = normalizeTimeOffset(value, getTimeOffset, timeOffset);\n value = isDateOnly(value) ? value : shiftTimeOffset(value, normalizedTimeOffset);\n\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 validationResult = isValidRange(newValue);\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, {\n value: formatValue(newValue, {\n dateOnly,\n timeOffset: normalizeTimeOffset(newValue, getTimeOffset, timeOffset),\n }),\n });\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,\n timeOffset: normalizedTimeOffset,\n });\n\n const trigger = (\n <div className={styles['trigger-wrapper']}>\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(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 </div>\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 absoluteFormat === 'long-localized' && !dateOnly && styles.wide\n )}\n onKeyDown={onWrapperKeyDownHandler}\n >\n <Dropdown\n stretchWidth={true}\n stretchHeight={true}\n open={isDropDownOpen}\n onDropdownClose={() => closeDropdown()}\n trigger={trigger}\n stretchToTriggerWidth={false}\n expandToViewport={expandToViewport}\n dropdownId={dropdownId}\n >\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 onDropdownClose={() => closeDropdown(true)}\n value={value}\n showClearButton={showClearButton}\n isDateEnabled={isDateEnabled}\n dateDisabledReason={dateDisabledReason}\n i18nStrings={i18nStrings}\n onClear={onClear}\n onApply={onApply}\n relativeOptions={relativeOptions}\n isValidRange={isValidRange}\n dateOnly={dateOnly}\n timeInputFormat={timeInputFormat}\n rangeSelectorMode={rangeSelectorMode}\n ariaLabelledby={ariaLabelledby}\n ariaDescribedby={ariaDescribedby}\n customAbsoluteRangeControl={customAbsoluteRangeControl}\n />\n )}\n </ResetContextsForModal>\n </Dropdown>\n </div>\n );\n }\n);\n\napplyDisplayName(DateRangePicker, 'DateRangePicker');\nexport default DateRangePicker;\n"]}
@@ -22,6 +22,12 @@ export interface DateRangePickerBaseProps {
22
22
  * server-side, in the same way as for other form elements.
23
23
  */
24
24
  isDateEnabled?: DateRangePickerProps.IsDateEnabledFunction;
25
+ /**
26
+ * Provides a reason why a particular date in the calendar is not enabled (only when `isDateEnabled` returns `false`).
27
+ * If provided, the date becomes focusable.
28
+ * @param date
29
+ */
30
+ dateDisabledReason?: DateRangePickerProps.DateDisabledReasonFunction;
25
31
  /**
26
32
  * The locale to be used for rendering month names and defining the
27
33
  * starting date of the week. If not provided, it will be determined
@@ -201,6 +207,9 @@ export declare namespace DateRangePickerProps {
201
207
  interface IsDateEnabledFunction {
202
208
  (date: Date): boolean;
203
209
  }
210
+ interface DateDisabledReasonFunction {
211
+ (date: Date): string;
212
+ }
204
213
  interface GetTimeOffsetFunction {
205
214
  (date: Date): number;
206
215
  }
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/date-range-picker/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AACh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AAM,CAAC;QAC1C;;;WAGG;QACH,sCAAsC,CAAC,EAAE,MAAM,CAAC;QAChD;;;WAGG;QACH,4BAA4B,CAAC,EAAE,MAAM,CAAC;QAEtC;;WAEG;QACH,cAAc,CAAC,EAAE,MAAM,CAAC;QAExB;;WAEG;QACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;QAE5B;;WAEG;QACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;QAEhC;;;WAGG;QACH,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB;;;WAGG;QACH,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB;;;WAGG;QACH,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB;;;WAGG;QACH,YAAY,CAAC,EAAE,MAAM,CAAC;QAEtB;;;WAGG;QACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;QAEhC;;WAEG;QACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;QAE5B;;WAEG;QACH,mCAAmC,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,MAAM,CAAC;KACtF;IAED,KAAY,cAAc,GAAG,KAAK,GAAG,gBAAgB,CAAC;CACvD;AAED,MAAM,MAAM,QAAQ,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAEjD,MAAM,MAAM,wBAAwB,GAAG,IAAI,CACzC,oBAAoB,CAAC,WAAW,EAC9B,gBAAgB,GAChB,oBAAoB,GACpB,wBAAwB,GACxB,gBAAgB,GAChB,gBAAgB,GAChB,cAAc,GACd,cAAc,GACd,wBAAwB,GACxB,qCAAqC,CACxC,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 { BaseComponentProps } from '../internal/base-component';\nimport { FormFieldValidationControlProps } from '../internal/context/form-field-context';\nimport { NonCancelableEventHandler } from '../internal/events';\nimport { TimeInputProps } from '../time-input/interfaces';\nimport { ExpandToViewport } from '../internal/components/dropdown/interfaces';\nimport React from 'react';\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 * 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 * 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 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.\n */\n timeInputFormat?: TimeInputProps.Format;\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 /**\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 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 *\n * Defaults to `iso`.\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 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 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 */\n modeSelectionLabel?: string;\n\n /**\n * Segment title of the relative range selection mode\n */\n relativeModeTitle?: string;\n\n /**\n * Segment title of the absolute range selection mode\n */\n absoluteModeTitle?: string;\n\n /**\n * Heading for the relative range selection area\n */\n relativeRangeSelectionHeading?: string;\n\n /**\n * Visible label of the Cancel button\n */\n cancelButtonLabel?: string;\n /**\n * Visible label of the Clear and dismiss button\n */\n clearButtonLabel?: string;\n /**\n * Visible label of the Apply button\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 */\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 */\n formatUnit?: (unit: TimeUnit, value: number) => string;\n\n /**\n * Visible label for the option for selecting\n * a custom relative range.\n */\n customRelativeRangeOptionLabel?: string;\n\n /**\n * Visible description for the option for selecting\n * a custom relative range.\n */\n customRelativeRangeOptionDescription?: string;\n\n /**\n * Visible label for the duration selector for\n * the custom relative range.\n */\n customRelativeRangeDurationLabel?: string;\n /**\n * Placeholder for the duration selector for\n * the custom relative range.\n */\n customRelativeRangeDurationPlaceholder?: string;\n /**\n * Visible label for the unit selector for the\n * custom relative range.\n */\n customRelativeRangeUnitLabel?: string;\n\n /**\n * Used as part of the aria label for today's date in the calendar.\n */\n todayAriaLabel?: string;\n\n /**\n * An aria label for the 'next month' button.\n */\n nextMonthAriaLabel?: string;\n\n /**\n * An aria label for the 'previous month' button.\n */\n previousMonthAriaLabel?: string;\n\n /**\n * Visible label for the Start Date input for the\n * absolute range.\n */\n startDateLabel?: string;\n /**\n * Visible label for the Start Time input for the\n * absolute range.\n */\n startTimeLabel?: string;\n /**\n * Visible label for the End Date input for the\n * absolute range.\n */\n endDateLabel?: string;\n /**\n * Visible label for the End Time input for the\n * absolute range.\n */\n endTimeLabel?: string;\n\n /**\n * Constraint text for the input fields for the\n * absolute range.\n */\n dateTimeConstraintText?: string;\n\n /**\n * Provides a text alternative for the error icon in the error alert.\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 export type AbsoluteFormat = 'iso' | 'long-localized';\n}\n\nexport type DayIndex = 0 | 1 | 2 | 3 | 4 | 5 | 6;\n\nexport type RangeCalendarI18nStrings = Pick<\n DateRangePickerProps.I18nStrings,\n | 'todayAriaLabel'\n | 'nextMonthAriaLabel'\n | 'previousMonthAriaLabel'\n | 'startDateLabel'\n | 'startTimeLabel'\n | 'endDateLabel'\n | 'endTimeLabel'\n | 'dateTimeConstraintText'\n | 'renderSelectedAbsoluteRangeAriaLive'\n>;\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 { BaseComponentProps } from '../internal/base-component';\nimport { FormFieldValidationControlProps } from '../internal/context/form-field-context';\nimport { NonCancelableEventHandler } from '../internal/events';\nimport { TimeInputProps } from '../time-input/interfaces';\nimport { ExpandToViewport } from '../internal/components/dropdown/interfaces';\nimport React from 'react';\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 * 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 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.\n */\n timeInputFormat?: TimeInputProps.Format;\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 /**\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 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 *\n * Defaults to `iso`.\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 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 */\n modeSelectionLabel?: string;\n\n /**\n * Segment title of the relative range selection mode\n */\n relativeModeTitle?: string;\n\n /**\n * Segment title of the absolute range selection mode\n */\n absoluteModeTitle?: string;\n\n /**\n * Heading for the relative range selection area\n */\n relativeRangeSelectionHeading?: string;\n\n /**\n * Visible label of the Cancel button\n */\n cancelButtonLabel?: string;\n /**\n * Visible label of the Clear and dismiss button\n */\n clearButtonLabel?: string;\n /**\n * Visible label of the Apply button\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 */\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 */\n formatUnit?: (unit: TimeUnit, value: number) => string;\n\n /**\n * Visible label for the option for selecting\n * a custom relative range.\n */\n customRelativeRangeOptionLabel?: string;\n\n /**\n * Visible description for the option for selecting\n * a custom relative range.\n */\n customRelativeRangeOptionDescription?: string;\n\n /**\n * Visible label for the duration selector for\n * the custom relative range.\n */\n customRelativeRangeDurationLabel?: string;\n /**\n * Placeholder for the duration selector for\n * the custom relative range.\n */\n customRelativeRangeDurationPlaceholder?: string;\n /**\n * Visible label for the unit selector for the\n * custom relative range.\n */\n customRelativeRangeUnitLabel?: string;\n\n /**\n * Used as part of the aria label for today's date in the calendar.\n */\n todayAriaLabel?: string;\n\n /**\n * An aria label for the 'next month' button.\n */\n nextMonthAriaLabel?: string;\n\n /**\n * An aria label for the 'previous month' button.\n */\n previousMonthAriaLabel?: string;\n\n /**\n * Visible label for the Start Date input for the\n * absolute range.\n */\n startDateLabel?: string;\n /**\n * Visible label for the Start Time input for the\n * absolute range.\n */\n startTimeLabel?: string;\n /**\n * Visible label for the End Date input for the\n * absolute range.\n */\n endDateLabel?: string;\n /**\n * Visible label for the End Time input for the\n * absolute range.\n */\n endTimeLabel?: string;\n\n /**\n * Constraint text for the input fields for the\n * absolute range.\n */\n dateTimeConstraintText?: string;\n\n /**\n * Provides a text alternative for the error icon in the error alert.\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 export type AbsoluteFormat = 'iso' | 'long-localized';\n}\n\nexport type DayIndex = 0 | 1 | 2 | 3 | 4 | 5 | 6;\n\nexport type RangeCalendarI18nStrings = Pick<\n DateRangePickerProps.I18nStrings,\n | 'todayAriaLabel'\n | 'nextMonthAriaLabel'\n | 'previousMonthAriaLabel'\n | 'startDateLabel'\n | 'startTimeLabel'\n | 'endDateLabel'\n | 'endTimeLabel'\n | 'dateTimeConstraintText'\n | 'renderSelectedAbsoluteRangeAriaLive'\n>;\n"]}
@@ -163,7 +163,7 @@
163
163
  --color-background-button-normal-hover-yqjern:#fafafa;
164
164
  --color-background-button-primary-active-rz38q7:#12293b;
165
165
  --color-background-button-primary-default-f3veih:#0073bb;
166
- --color-background-button-primary-disabled-lba03m:#ffffff;
166
+ --color-background-button-primary-disabled-ynfxdn:#ffffff;
167
167
  --color-background-button-primary-hover-79i9hj:#0a4a74;
168
168
  --color-background-calendar-current-date-wm9kva:#f2f3f3;
169
169
  --color-background-cell-shaded-zw6xp4:#f2f3f3;
@@ -236,8 +236,10 @@
236
236
  --color-border-button-normal-active-mn8z2y:#545b64;
237
237
  --color-border-button-normal-default-bqhrgd:#545b64;
238
238
  --color-border-button-normal-disabled-vj6u6p:#d5dbdb;
239
+ --color-text-button-normal-disabled-1yxabk:#879596;
239
240
  --color-border-button-normal-hover-9bq1t6:#16191f;
240
- --color-border-button-primary-disabled-2pi6u1:#d5dbdb;
241
+ --color-border-button-primary-disabled-rqdj0t:#d5dbdb;
242
+ --color-text-button-primary-disabled-1wlp74:#879596;
241
243
  --color-border-calendar-grid-2ab4m1:#eaeded;
242
244
  --color-border-calendar-grid-selected-focus-ring-hhlvy8:#0073bb;
243
245
  --color-border-code-editor-ace-active-line-light-theme-b3qkmf:#d5dbdb;
@@ -793,7 +795,7 @@
793
795
  --color-background-button-normal-hover-yqjern:#21252c;
794
796
  --color-background-button-primary-active-rz38q7:#44b9d6;
795
797
  --color-background-button-primary-default-f3veih:#44b9d6;
796
- --color-background-button-primary-disabled-lba03m:#2a2e33;
798
+ --color-background-button-primary-disabled-ynfxdn:#2a2e33;
797
799
  --color-background-button-primary-hover-79i9hj:#00a1c9;
798
800
  --color-background-calendar-current-date-wm9kva:#16191f;
799
801
  --color-background-cell-shaded-zw6xp4:#16191f;
@@ -850,7 +852,7 @@
850
852
  --color-border-button-normal-default-bqhrgd:#879596;
851
853
  --color-border-button-normal-disabled-vj6u6p:#414750;
852
854
  --color-border-button-normal-hover-9bq1t6:#aab7b8;
853
- --color-border-button-primary-disabled-2pi6u1:#414750;
855
+ --color-border-button-primary-disabled-rqdj0t:#414750;
854
856
  --color-border-calendar-grid-2ab4m1:#414750;
855
857
  --color-border-calendar-grid-selected-focus-ring-hhlvy8:#00a1c9;
856
858
  --color-border-code-editor-default-mu8x7p:#687078;
@@ -1096,7 +1098,7 @@
1096
1098
  --color-background-button-normal-hover-yqjern:#21252c;
1097
1099
  --color-background-button-primary-active-rz38q7:#44b9d6;
1098
1100
  --color-background-button-primary-default-f3veih:#44b9d6;
1099
- --color-background-button-primary-disabled-lba03m:#2a2e33;
1101
+ --color-background-button-primary-disabled-ynfxdn:#2a2e33;
1100
1102
  --color-background-button-primary-hover-79i9hj:#00a1c9;
1101
1103
  --color-background-calendar-current-date-wm9kva:#16191f;
1102
1104
  --color-background-cell-shaded-zw6xp4:#16191f;
@@ -1153,7 +1155,7 @@
1153
1155
  --color-border-button-normal-default-bqhrgd:#879596;
1154
1156
  --color-border-button-normal-disabled-vj6u6p:#414750;
1155
1157
  --color-border-button-normal-hover-9bq1t6:#aab7b8;
1156
- --color-border-button-primary-disabled-2pi6u1:#414750;
1158
+ --color-border-button-primary-disabled-rqdj0t:#414750;
1157
1159
  --color-border-calendar-grid-2ab4m1:#414750;
1158
1160
  --color-border-calendar-grid-selected-focus-ring-hhlvy8:#00a1c9;
1159
1161
  --color-border-code-editor-default-mu8x7p:#687078;
@@ -1398,7 +1400,7 @@
1398
1400
  --color-background-button-normal-hover-yqjern:#f2f8fd;
1399
1401
  --color-background-button-primary-active-rz38q7:#033160;
1400
1402
  --color-background-button-primary-default-f3veih:#0972d3;
1401
- --color-background-button-primary-disabled-lba03m:#e9ebed;
1403
+ --color-background-button-primary-disabled-ynfxdn:#e9ebed;
1402
1404
  --color-background-button-primary-hover-79i9hj:#033160;
1403
1405
  --color-background-calendar-current-date-wm9kva:#f4f4f4;
1404
1406
  --color-background-cell-shaded-zw6xp4:#f8f8f8;
@@ -1453,8 +1455,10 @@
1453
1455
  --color-border-button-normal-active-mn8z2y:#033160;
1454
1456
  --color-border-button-normal-default-bqhrgd:#0972d3;
1455
1457
  --color-border-button-normal-disabled-vj6u6p:#9ba7b6;
1458
+ --color-text-button-normal-disabled-1yxabk:#7d8998;
1456
1459
  --color-border-button-normal-hover-9bq1t6:#033160;
1457
- --color-border-button-primary-disabled-2pi6u1:#e9ebed;
1460
+ --color-border-button-primary-disabled-rqdj0t:#e9ebed;
1461
+ --color-text-button-primary-disabled-1wlp74:#7d8998;
1458
1462
  --color-border-calendar-grid-2ab4m1:transparent;
1459
1463
  --color-border-calendar-grid-selected-focus-ring-hhlvy8:#fbfbfb;
1460
1464
  --color-border-code-editor-ace-active-line-light-theme-b3qkmf:#d1d5db;
@@ -1750,7 +1754,7 @@
1750
1754
  --color-background-button-normal-hover-yqjern:#192534;
1751
1755
  --color-background-button-primary-active-rz38q7:#539fe5;
1752
1756
  --color-background-button-primary-default-f3veih:#539fe5;
1753
- --color-background-button-primary-disabled-lba03m:#354150;
1757
+ --color-background-button-primary-disabled-ynfxdn:#232f3e;
1754
1758
  --color-background-button-primary-hover-79i9hj:#89bdee;
1755
1759
  --color-background-calendar-current-date-wm9kva:#354150;
1756
1760
  --color-background-cell-shaded-zw6xp4:#192534;
@@ -1804,7 +1808,7 @@
1804
1808
  --color-border-button-normal-default-bqhrgd:#539fe5;
1805
1809
  --color-border-button-normal-disabled-vj6u6p:#5f6b7a;
1806
1810
  --color-border-button-normal-hover-9bq1t6:#89bdee;
1807
- --color-border-button-primary-disabled-2pi6u1:#354150;
1811
+ --color-border-button-primary-disabled-rqdj0t:#232f3e;
1808
1812
  --color-border-calendar-grid-selected-focus-ring-hhlvy8:#0f1b2a;
1809
1813
  --color-border-code-editor-default-mu8x7p:#5f6b7a;
1810
1814
  --color-border-code-editor-pane-item-hover-c2ber2:#5f6b7a;
@@ -2013,7 +2017,7 @@
2013
2017
  --color-background-button-normal-hover-yqjern:#192534;
2014
2018
  --color-background-button-primary-active-rz38q7:#539fe5;
2015
2019
  --color-background-button-primary-default-f3veih:#539fe5;
2016
- --color-background-button-primary-disabled-lba03m:#354150;
2020
+ --color-background-button-primary-disabled-ynfxdn:#232f3e;
2017
2021
  --color-background-button-primary-hover-79i9hj:#89bdee;
2018
2022
  --color-background-calendar-current-date-wm9kva:#354150;
2019
2023
  --color-background-cell-shaded-zw6xp4:#192534;
@@ -2068,7 +2072,7 @@
2068
2072
  --color-border-button-normal-default-bqhrgd:#539fe5;
2069
2073
  --color-border-button-normal-disabled-vj6u6p:#5f6b7a;
2070
2074
  --color-border-button-normal-hover-9bq1t6:#89bdee;
2071
- --color-border-button-primary-disabled-2pi6u1:#354150;
2075
+ --color-border-button-primary-disabled-rqdj0t:#232f3e;
2072
2076
  --color-border-calendar-grid-2ab4m1:transparent;
2073
2077
  --color-border-calendar-grid-selected-focus-ring-hhlvy8:#0f1b2a;
2074
2078
  --color-border-code-editor-default-mu8x7p:#5f6b7a;
@@ -2212,7 +2216,7 @@
2212
2216
  --color-background-button-normal-hover-yqjern:#192534;
2213
2217
  --color-background-button-primary-active-rz38q7:#539fe5;
2214
2218
  --color-background-button-primary-default-f3veih:#539fe5;
2215
- --color-background-button-primary-disabled-lba03m:#354150;
2219
+ --color-background-button-primary-disabled-ynfxdn:#232f3e;
2216
2220
  --color-background-button-primary-hover-79i9hj:#89bdee;
2217
2221
  --color-background-calendar-current-date-wm9kva:#354150;
2218
2222
  --color-background-cell-shaded-zw6xp4:#192534;
@@ -2266,7 +2270,7 @@
2266
2270
  --color-border-button-normal-default-bqhrgd:#539fe5;
2267
2271
  --color-border-button-normal-disabled-vj6u6p:#5f6b7a;
2268
2272
  --color-border-button-normal-hover-9bq1t6:#89bdee;
2269
- --color-border-button-primary-disabled-2pi6u1:#354150;
2273
+ --color-border-button-primary-disabled-rqdj0t:#232f3e;
2270
2274
  --color-border-calendar-grid-selected-focus-ring-hhlvy8:#0f1b2a;
2271
2275
  --color-border-code-editor-default-mu8x7p:#5f6b7a;
2272
2276
  --color-border-code-editor-pane-item-hover-c2ber2:#5f6b7a;
@@ -2406,7 +2410,7 @@
2406
2410
  --color-background-button-normal-hover-yqjern:#192534;
2407
2411
  --color-background-button-primary-active-rz38q7:#539fe5;
2408
2412
  --color-background-button-primary-default-f3veih:#539fe5;
2409
- --color-background-button-primary-disabled-lba03m:#354150;
2413
+ --color-background-button-primary-disabled-ynfxdn:#232f3e;
2410
2414
  --color-background-button-primary-hover-79i9hj:#89bdee;
2411
2415
  --color-background-calendar-current-date-wm9kva:#354150;
2412
2416
  --color-background-cell-shaded-zw6xp4:#192534;
@@ -2461,7 +2465,7 @@
2461
2465
  --color-border-button-normal-default-bqhrgd:#539fe5;
2462
2466
  --color-border-button-normal-disabled-vj6u6p:#5f6b7a;
2463
2467
  --color-border-button-normal-hover-9bq1t6:#89bdee;
2464
- --color-border-button-primary-disabled-2pi6u1:#354150;
2468
+ --color-border-button-primary-disabled-rqdj0t:#232f3e;
2465
2469
  --color-border-calendar-grid-selected-focus-ring-hhlvy8:#0f1b2a;
2466
2470
  --color-border-code-editor-default-mu8x7p:#5f6b7a;
2467
2471
  --color-border-code-editor-pane-item-hover-c2ber2:#5f6b7a;
@@ -2614,7 +2618,7 @@
2614
2618
  --color-background-button-normal-hover-yqjern:#192534;
2615
2619
  --color-background-button-primary-active-rz38q7:#539fe5;
2616
2620
  --color-background-button-primary-default-f3veih:#539fe5;
2617
- --color-background-button-primary-disabled-lba03m:#354150;
2621
+ --color-background-button-primary-disabled-ynfxdn:#232f3e;
2618
2622
  --color-background-button-primary-hover-79i9hj:#89bdee;
2619
2623
  --color-background-calendar-current-date-wm9kva:#354150;
2620
2624
  --color-background-cell-shaded-zw6xp4:#192534;
@@ -2669,7 +2673,7 @@
2669
2673
  --color-border-button-normal-default-bqhrgd:#539fe5;
2670
2674
  --color-border-button-normal-disabled-vj6u6p:#5f6b7a;
2671
2675
  --color-border-button-normal-hover-9bq1t6:#89bdee;
2672
- --color-border-button-primary-disabled-2pi6u1:#354150;
2676
+ --color-border-button-primary-disabled-rqdj0t:#232f3e;
2673
2677
  --color-border-calendar-grid-selected-focus-ring-hhlvy8:#0f1b2a;
2674
2678
  --color-border-code-editor-default-mu8x7p:#5f6b7a;
2675
2679
  --color-border-code-editor-pane-item-hover-c2ber2:#5f6b7a;
@@ -3014,7 +3018,7 @@
3014
3018
  --color-background-button-normal-hover-yqjern:rgba(255, 255, 255, 0.1);
3015
3019
  --color-background-button-primary-active-rz38q7:#539fe5;
3016
3020
  --color-background-button-primary-default-f3veih:#d1d5db;
3017
- --color-background-button-primary-disabled-lba03m:#354150;
3021
+ --color-background-button-primary-disabled-ynfxdn:#232f3e;
3018
3022
  --color-background-button-primary-hover-79i9hj:#ffffff;
3019
3023
  --color-background-calendar-current-date-wm9kva:#354150;
3020
3024
  --color-background-cell-shaded-zw6xp4:#192534;
@@ -3069,7 +3073,7 @@
3069
3073
  --color-border-button-normal-default-bqhrgd:#d1d5db;
3070
3074
  --color-border-button-normal-disabled-vj6u6p:#5f6b7a;
3071
3075
  --color-border-button-normal-hover-9bq1t6:#ffffff;
3072
- --color-border-button-primary-disabled-2pi6u1:#354150;
3076
+ --color-border-button-primary-disabled-rqdj0t:#232f3e;
3073
3077
  --color-border-calendar-grid-selected-focus-ring-hhlvy8:#0f1b2a;
3074
3078
  --color-border-code-editor-default-mu8x7p:#5f6b7a;
3075
3079
  --color-border-code-editor-pane-item-hover-c2ber2:#5f6b7a;
@@ -3210,7 +3214,7 @@
3210
3214
  --color-background-button-normal-hover-yqjern:rgba(255, 255, 255, 0.1);
3211
3215
  --color-background-button-primary-active-rz38q7:#539fe5;
3212
3216
  --color-background-button-primary-default-f3veih:#d1d5db;
3213
- --color-background-button-primary-disabled-lba03m:#354150;
3217
+ --color-background-button-primary-disabled-ynfxdn:#232f3e;
3214
3218
  --color-background-button-primary-hover-79i9hj:#ffffff;
3215
3219
  --color-background-calendar-current-date-wm9kva:#354150;
3216
3220
  --color-background-cell-shaded-zw6xp4:#192534;
@@ -3265,7 +3269,7 @@
3265
3269
  --color-border-button-normal-default-bqhrgd:#d1d5db;
3266
3270
  --color-border-button-normal-disabled-vj6u6p:#5f6b7a;
3267
3271
  --color-border-button-normal-hover-9bq1t6:#ffffff;
3268
- --color-border-button-primary-disabled-2pi6u1:#354150;
3272
+ --color-border-button-primary-disabled-rqdj0t:#232f3e;
3269
3273
  --color-border-calendar-grid-selected-focus-ring-hhlvy8:#0f1b2a;
3270
3274
  --color-border-code-editor-default-mu8x7p:#5f6b7a;
3271
3275
  --color-border-code-editor-pane-item-hover-c2ber2:#5f6b7a;
@@ -4,6 +4,7 @@ import { BaseComponentProps } from '../../base-component';
4
4
  export interface BaseOption {
5
5
  label?: string;
6
6
  disabled?: boolean;
7
+ disabledReason?: string;
7
8
  }
8
9
  export interface OptionDefinition extends BaseOption {
9
10
  value?: string;
@@ -27,6 +28,7 @@ export interface OptionGroup extends BaseOption {
27
28
  export interface DropdownOption {
28
29
  type?: string;
29
30
  disabled?: boolean;
31
+ disabledReason?: string;
30
32
  option: OptionDefinition | OptionGroup;
31
33
  }
32
34
  export interface OptionProps extends BaseComponentProps {
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/option/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,MAAM,WAAW,UAAU;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,gBAAiB,SAAQ,UAAU;IAClD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,SAAS,CAAC,IAAI,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,IAAI,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAC7B,aAAa,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IACtC,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,w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E,SAAS,CAAC,IAAI,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,IAAI,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAC7B,aAAa,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IACtC,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,wBAAyB,SAAQ,gBAAgB;IAChE,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAChC;AAED,MAAM,WAAW,WAAY,SAAQ,UAAU;IAC7C,OAAO,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC;CAC1C;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,gBAAgB,GAAG,WAAW,CAAC;CACxC;AAED,MAAM,WAAW,WAAY,SAAQ,kBAAkB;IACrD,MAAM,CAAC,EAAE,wBAAwB,CAAC;IAClC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B"}
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../../src/internal/components/option/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';\nimport { IconProps } from '../../../icon/interfaces';\nimport { BaseComponentProps } from '../../base-component';\n\nexport interface BaseOption {\n label?: string;\n disabled?: boolean;\n}\n\nexport interface OptionDefinition extends BaseOption {\n value?: string;\n lang?: string;\n labelTag?: string;\n description?: string;\n iconAlt?: string;\n iconName?: IconProps.Name;\n iconUrl?: string;\n iconSvg?: React.ReactNode;\n tags?: ReadonlyArray<string>;\n filteringTags?: ReadonlyArray<string>;\n __labelPrefix?: string;\n}\n\nexport interface InternalOptionDefinition extends OptionDefinition {\n __customIcon?: React.ReactNode;\n}\n\nexport interface OptionGroup extends BaseOption {\n options: ReadonlyArray<OptionDefinition>;\n}\n\nexport interface DropdownOption {\n type?: string;\n disabled?: boolean;\n option: OptionDefinition | OptionGroup;\n}\n\nexport interface OptionProps extends BaseComponentProps {\n option?: InternalOptionDefinition;\n triggerVariant?: boolean;\n highlightText?: string;\n highlightedOption?: boolean;\n selectedOption?: boolean;\n isGroupOption?: boolean;\n isGenericGroup?: boolean;\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../../src/internal/components/option/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';\nimport { IconProps } from '../../../icon/interfaces';\nimport { BaseComponentProps } from '../../base-component';\n\nexport interface BaseOption {\n label?: string;\n disabled?: boolean;\n disabledReason?: string;\n}\n\nexport interface OptionDefinition extends BaseOption {\n value?: string;\n lang?: string;\n labelTag?: string;\n description?: string;\n iconAlt?: string;\n iconName?: IconProps.Name;\n iconUrl?: string;\n iconSvg?: React.ReactNode;\n tags?: ReadonlyArray<string>;\n filteringTags?: ReadonlyArray<string>;\n __labelPrefix?: string;\n}\n\nexport interface InternalOptionDefinition extends OptionDefinition {\n __customIcon?: React.ReactNode;\n}\n\nexport interface OptionGroup extends BaseOption {\n options: ReadonlyArray<OptionDefinition>;\n}\n\nexport interface DropdownOption {\n type?: string;\n disabled?: boolean;\n disabledReason?: string;\n option: OptionDefinition | OptionGroup;\n}\n\nexport interface OptionProps extends BaseComponentProps {\n option?: InternalOptionDefinition;\n triggerVariant?: boolean;\n highlightText?: string;\n highlightedOption?: boolean;\n selectedOption?: boolean;\n isGroupOption?: boolean;\n isGenericGroup?: boolean;\n}\n"]}
@@ -17,6 +17,7 @@ export type SelectableItemProps = BaseComponentProps & {
17
17
  ariaPosinset?: number;
18
18
  ariaSetsize?: number;
19
19
  highlightType?: HighlightType['type'];
20
+ ariaDescribedby?: string;
20
21
  } & ({
21
22
  ariaSelected?: boolean;
22
23
  ariaChecked?: never;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/selectable-item/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAkC,MAAM,OAAO,CAAC;AAGvD,OAAO,EAAE,kBAAkB,EAAgB,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,+CAA+C,CAAC;AAE9E,MAAM,MAAM,mBAAmB,GAAG,kBAAkB,GAAG;IACrD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CACvC,GAAG,CAAC;IAAE,YAAY,CAAC,EAAE,OAAO,CAAC;IAAC,W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AO,CAAA;CAAE,CAAC,CAAC;;AAuGlH,wBAAgD"}
@@ -60,6 +60,9 @@ const SelectableItem = (_a, ref) => {
60
60
  a11yProperties['aria-posinset'] = ariaPosinset;
61
61
  a11yProperties['aria-setsize'] = ariaSetsize;
62
62
  }
63
+ if (restProps.ariaDescribedby) {
64
+ a11yProperties['aria-describedby'] = restProps.ariaDescribedby;
65
+ }
63
66
  return (React.createElement("li", Object.assign({ role: "option", className: classNames, style: style }, a11yProperties, rest),
64
67
  React.createElement("div", { className: styles['option-content'], ref: contentRef }, content),
65
68
  React.createElement("div", { className: styles['measure-strut'], ref: ref }),
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/components/selectable-item/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAsB,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAqBxE,MAAM,cAAc,GAAG,CACrB,EAmBsB,EACtB,GAA8B,EAC9B,EAAE;QArBF,EACE,QAAQ,EAAE,OAAO,EACjB,YAAY,EACZ,WAAW,EACX,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,aAAa,EACb,QAAQ,EACR,OAAO,EACP,eAAe,EACf,SAAS,EACT,cAAc,EACd,oBAAoB,EACpB,mBAAmB,EACnB,YAAY,EACZ,WAAW,EACX,aAAa,OAEO,EADjB,SAAS,cAlBd,2QAmBC,CADa;IAId,MAAM,KAAyB,YAAY,CAAC,SAAS,CAAC,EAAhD,EAAE,SAAS,OAAqC,EAAhC,IAAI,cAApB,aAAsB,CAA0B,CAAC;IACvD,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,iBAAiB,CAAC,EAAE;QAC5D,CAAC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C;YACE,SAAS,EAAE,cAAc,eAAe,KAAK;SAC9C;QACH,CAAC,CAAC,SAAS,CAAC;IAEhB,MAAM,cAAc,GAA0D;QAC5E,eAAe,EAAE,QAAQ;KAC1B,CAAC;IAEF,IAAI,QAAQ,IAAI,CAAC,oBAAoB,EAAE;QACrC,cAAc,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC;KACtC;IAED,IAAI,YAAY,KAAK,SAAS,EAAE;QAC9B,cAAc,CAAC,eAAe,CAAC,GAAG,YAAY,CAAC;KAChD;IAED,2IAA2I;IAC3I,IAAI,WAAW,KAAK,SAAS,EAAE;QAC7B,cAAc,CAAC,cAAc,CAAC,GAAG,WAAW,CAAC;KAC9C;IAED,IAAI,YAAY,IAAI,WAAW,EAAE;QAC/B,cAAc,CAAC,eAAe,CAAC,GAAG,YAAY,CAAC;QAC/C,cAAc,CAAC,cAAc,CAAC,GAAG,WAAW,CAAC;KAC9C;IAED,OAAO,CACL,0CAAI,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,IAAM,cAAc,EAAM,IAAI;QACjF,6BAAK,SAAS,EAAE,MAAM,CAAC,gBAAgB,CAAC,EAAE,GAAG,EAAE,UAAU,IACtD,OAAO,CACJ;QACN,6BAAK,SAAS,EAAE,MAAM,CAAC,eAAe,CAAC,EAAE,GAAG,EAAE,GAAG,GAAI;QACrD,6BAAK,SAAS,EAAE,MAAM,CAAC,sBAAsB,CAAC,EAAE,GAAG,EAAE,sBAAsB,GAAQ,CAChF,CACN,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef, useLayoutEffect } from 'react';\nimport clsx from 'clsx';\nimport styles from './styles.css.js';\nimport { BaseComponentProps, getBaseProps } from '../../base-component';\nimport { HighlightType } from '../options-list/utils/use-highlight-option.js';\n\nexport type SelectableItemProps = BaseComponentProps & {\n children: React.ReactNode;\n selected?: boolean;\n highlighted?: boolean;\n disabled?: boolean;\n hasBackground?: boolean;\n isParent?: boolean;\n isChild?: boolean;\n virtualPosition?: number;\n padBottom?: boolean;\n isNextSelected?: boolean;\n useInteractiveGroups?: boolean;\n screenReaderContent?: string;\n ariaPosinset?: number;\n ariaSetsize?: number;\n highlightType?: HighlightType['type'];\n} & ({ ariaSelected?: boolean; ariaChecked?: never } | { ariaSelected?: never; ariaChecked?: boolean | 'mixed' });\n\nconst SelectableItem = (\n {\n children: content,\n ariaSelected,\n ariaChecked,\n selected,\n highlighted,\n disabled,\n hasBackground,\n isParent,\n isChild,\n virtualPosition,\n padBottom,\n isNextSelected,\n useInteractiveGroups,\n screenReaderContent,\n ariaPosinset,\n ariaSetsize,\n highlightType,\n ...restProps\n }: SelectableItemProps,\n ref: React.Ref<HTMLDivElement>\n) => {\n const { className, ...rest } = getBaseProps(restProps);\n const classNames = clsx(className, styles['selectable-item'], {\n [styles.selected]: selected,\n [styles.highlighted]: highlighted,\n [styles['has-background']]: hasBackground,\n [styles.parent]: isParent,\n [styles.child]: isChild,\n [styles['is-keyboard']]: highlightType === 'keyboard',\n [styles.disabled]: disabled,\n [styles.virtual]: virtualPosition !== undefined,\n [styles['pad-bottom']]: padBottom,\n [styles['next-item-selected']]: isNextSelected,\n [styles.interactiveGroups]: useInteractiveGroups,\n });\n\n const contentRef = useRef<HTMLDivElement>(null);\n const screenReaderContentRef = useRef<HTMLDivElement>(null);\n\n useLayoutEffect(() => {\n // the state of aria-hidden and announcement is not set back because NVDA+Firefox would announce\n // the item which lost highlight\n // set aria-hidden true when there is announcement content, so that screen reader still announce\n // meaningful content when navigate with screen reader cursor\n // imperatively update to avoid announcement made multiple times when content updates\n if (highlighted && screenReaderContent) {\n if (contentRef.current) {\n contentRef.current.setAttribute('aria-hidden', 'true');\n }\n if (screenReaderContentRef.current) {\n screenReaderContentRef.current.textContent = screenReaderContent;\n }\n }\n }, [highlighted, screenReaderContent, contentRef, screenReaderContentRef]);\n\n const style =\n virtualPosition !== undefined\n ? {\n transform: `translateY(${virtualPosition}px)`,\n }\n : undefined;\n\n const a11yProperties: Record<string, string | number | boolean | undefined> = {\n 'aria-disabled': disabled,\n };\n\n if (isParent && !useInteractiveGroups) {\n a11yProperties['aria-hidden'] = true;\n }\n\n if (ariaSelected !== undefined) {\n a11yProperties['aria-selected'] = ariaSelected;\n }\n\n // Safari+VO needs aria-checked for multi-selection. Otherwise it only announces selected option even though another option is highlighted.\n if (ariaChecked !== undefined) {\n a11yProperties['aria-checked'] = ariaChecked;\n }\n\n if (ariaPosinset && ariaSetsize) {\n a11yProperties['aria-posinset'] = ariaPosinset;\n a11yProperties['aria-setsize'] = ariaSetsize;\n }\n\n return (\n <li role=\"option\" className={classNames} style={style} {...a11yProperties} {...rest}>\n <div className={styles['option-content']} ref={contentRef}>\n {content}\n </div>\n <div className={styles['measure-strut']} ref={ref} />\n <div className={styles['screenreader-content']} ref={screenReaderContentRef}></div>\n </li>\n );\n};\n\nexport default React.forwardRef(SelectableItem);\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/components/selectable-item/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAsB,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAsBxE,MAAM,cAAc,GAAG,CACrB,EAmBsB,EACtB,GAA8B,EAC9B,EAAE;QArBF,EACE,QAAQ,EAAE,OAAO,EACjB,YAAY,EACZ,WAAW,EACX,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,aAAa,EACb,QAAQ,EACR,OAAO,EACP,eAAe,EACf,SAAS,EACT,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C,eAAe,CAAC,EAAE,GAAG,EAAE,GAAG,GAAI;QACrD,6BAAK,SAAS,EAAE,MAAM,CAAC,sBAAsB,CAAC,EAAE,GAAG,EAAE,sBAAsB,GAAQ,CAChF,CACN,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef, useLayoutEffect } from 'react';\nimport clsx from 'clsx';\nimport styles from './styles.css.js';\nimport { BaseComponentProps, getBaseProps } from '../../base-component';\nimport { HighlightType } from '../options-list/utils/use-highlight-option.js';\n\nexport type SelectableItemProps = BaseComponentProps & {\n children: React.ReactNode;\n selected?: boolean;\n highlighted?: boolean;\n disabled?: boolean;\n hasBackground?: boolean;\n isParent?: boolean;\n isChild?: boolean;\n virtualPosition?: number;\n padBottom?: boolean;\n isNextSelected?: boolean;\n useInteractiveGroups?: boolean;\n screenReaderContent?: string;\n ariaPosinset?: number;\n ariaSetsize?: number;\n highlightType?: HighlightType['type'];\n ariaDescribedby?: string;\n} & ({ ariaSelected?: boolean; ariaChecked?: never } | { ariaSelected?: never; ariaChecked?: boolean | 'mixed' });\n\nconst SelectableItem = (\n {\n children: content,\n ariaSelected,\n ariaChecked,\n selected,\n highlighted,\n disabled,\n hasBackground,\n isParent,\n isChild,\n virtualPosition,\n padBottom,\n isNextSelected,\n useInteractiveGroups,\n screenReaderContent,\n ariaPosinset,\n ariaSetsize,\n highlightType,\n ...restProps\n }: SelectableItemProps,\n ref: React.Ref<HTMLDivElement>\n) => {\n const { className, ...rest } = getBaseProps(restProps);\n const classNames = clsx(className, styles['selectable-item'], {\n [styles.selected]: selected,\n [styles.highlighted]: highlighted,\n [styles['has-background']]: hasBackground,\n [styles.parent]: isParent,\n [styles.child]: isChild,\n [styles['is-keyboard']]: highlightType === 'keyboard',\n [styles.disabled]: disabled,\n [styles.virtual]: virtualPosition !== undefined,\n [styles['pad-bottom']]: padBottom,\n [styles['next-item-selected']]: isNextSelected,\n [styles.interactiveGroups]: useInteractiveGroups,\n });\n\n const contentRef = useRef<HTMLDivElement>(null);\n const screenReaderContentRef = useRef<HTMLDivElement>(null);\n\n useLayoutEffect(() => {\n // the state of aria-hidden and announcement is not set back because NVDA+Firefox would announce\n // the item which lost highlight\n // set aria-hidden true when there is announcement content, so that screen reader still announce\n // meaningful content when navigate with screen reader cursor\n // imperatively update to avoid announcement made multiple times when content updates\n if (highlighted && screenReaderContent) {\n if (contentRef.current) {\n contentRef.current.setAttribute('aria-hidden', 'true');\n }\n if (screenReaderContentRef.current) {\n screenReaderContentRef.current.textContent = screenReaderContent;\n }\n }\n }, [highlighted, screenReaderContent, contentRef, screenReaderContentRef]);\n\n const style =\n virtualPosition !== undefined\n ? {\n transform: `translateY(${virtualPosition}px)`,\n }\n : undefined;\n\n const a11yProperties: Record<string, string | number | boolean | undefined> = {\n 'aria-disabled': disabled,\n };\n\n if (isParent && !useInteractiveGroups) {\n a11yProperties['aria-hidden'] = true;\n }\n\n if (ariaSelected !== undefined) {\n a11yProperties['aria-selected'] = ariaSelected;\n }\n\n // Safari+VO needs aria-checked for multi-selection. Otherwise it only announces selected option even though another option is highlighted.\n if (ariaChecked !== undefined) {\n a11yProperties['aria-checked'] = ariaChecked;\n }\n\n if (ariaPosinset && ariaSetsize) {\n a11yProperties['aria-posinset'] = ariaPosinset;\n a11yProperties['aria-setsize'] = ariaSetsize;\n }\n\n if (restProps.ariaDescribedby) {\n a11yProperties['aria-describedby'] = restProps.ariaDescribedby;\n }\n\n return (\n <li role=\"option\" className={classNames} style={style} {...a11yProperties} {...rest}>\n <div className={styles['option-content']} ref={contentRef}>\n {content}\n </div>\n <div className={styles['measure-strut']} ref={ref} />\n <div className={styles['screenreader-content']} ref={screenReaderContentRef}></div>\n </li>\n );\n};\n\nexport default React.forwardRef(SelectableItem);\n"]}
@@ -2,7 +2,9 @@ import React from 'react';
2
2
  export interface TooltipProps {
3
3
  value: number | string;
4
4
  trackRef: React.RefObject<HTMLElement | SVGElement>;
5
+ position?: 'top' | 'right' | 'bottom' | 'left';
6
+ className?: string;
5
7
  contentAttributes?: React.HTMLAttributes<HTMLDivElement>;
6
8
  }
7
- export default function Tooltip({ value, trackRef, contentAttributes }: TooltipProps): JSX.Element;
9
+ export default function Tooltip({ value, trackRef, className, contentAttributes, position, }: TooltipProps): JSX.Element;
8
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/tooltip/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAU1B,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,UAAU,CAAC,CAAC;IACpD,iBAAiB,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;CAC1D;AAED,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,iBAAsB,EAAE,EAAE,YAAY,eA4BxF"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/tooltip/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAU1B,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,UAAU,CAAC,CAAC;IACpD,QAAQ,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iBAAiB,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;CAC1D;AAED,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,EAC9B,KAAK,EACL,QAAQ,EACR,SAAS,EACT,iBAAsB,EACtB,QAAgB,GACjB,EAAE,YAAY,eA4Bd"}
@@ -8,10 +8,10 @@ import PopoverBody from '../../../popover/body';
8
8
  import Portal from '../portal';
9
9
  import popoverStyles from '../../../popover/styles.css.js';
10
10
  import styles from './styles.css.js';
11
- export default function Tooltip({ value, trackRef, contentAttributes = {} }) {
11
+ export default function Tooltip({ value, trackRef, className, contentAttributes = {}, position = 'top', }) {
12
12
  return (React.createElement(Portal, null,
13
- React.createElement("div", Object.assign({ className: styles.root }, contentAttributes),
14
- React.createElement(Transition, { in: true }, () => (React.createElement(PopoverContainer, { trackRef: trackRef, trackKey: value, size: "small", fixedWidth: false, position: "top", arrow: position => (React.createElement("div", { className: clsx(popoverStyles.arrow, popoverStyles[`arrow-position-${position}`]) },
13
+ React.createElement("div", Object.assign({ className: clsx(styles.root, className) }, contentAttributes),
14
+ React.createElement(Transition, { in: true }, () => (React.createElement(PopoverContainer, { trackRef: trackRef, trackKey: value, size: "small", fixedWidth: false, position: position, arrow: position => (React.createElement("div", { className: clsx(popoverStyles.arrow, popoverStyles[`arrow-position-${position}`]) },
15
15
  React.createElement("div", { className: popoverStyles['arrow-outer'] }),
16
16
  React.createElement("div", { className: popoverStyles['arrow-inner'] }))) },
17
17
  React.createElement(PopoverBody, { dismissButton: false, dismissAriaLabel: undefined, onDismiss: undefined, header: undefined }, value)))))));
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/components/tooltip/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,gBAAgB,MAAM,4BAA4B,CAAC;AAC1D,OAAO,WAAW,MAAM,uBAAuB,CAAC;AAChD,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,aAAa,MAAM,gCAAgC,CAAC;AAC3D,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAQrC,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,iBAAiB,GAAG,EAAE,EAAgB;IACvF,OAAO,CACL,oBAAC,MAAM;QACL,2CAAK,SAAS,EAAE,MAAM,CAAC,IAAI,IAAM,iBAAiB;YAChD,oBAAC,UAAU,IAAC,EAAE,EAAE,IAAI,IACjB,GAAG,EAAE,CAAC,CACL,oBAAC,gBAAgB,IACf,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,KAAK,EACf,IAAI,EAAC,OAAO,EACZ,UAAU,EAAE,KAAK,EACjB,QAAQ,EAAC,KAAK,EACd,KAAK,EAAE,QAAQ,CAAC,EAAE,CAAC,CACjB,6BAAK,SAAS,EAAE,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,aAAa,CAAC,kBAAkB,QAAQ,EAAE,CAAC,CAAC;oBACpF,6BAAK,SAAS,EAAE,aAAa,CAAC,aAAa,CAAC,GAAI;oBAChD,6BAAK,SAAS,EAAE,aAAa,CAAC,aAAa,CAAC,GAAI,CAC5C,CACP;gBAED,oBAAC,WAAW,IAAC,aAAa,EAAE,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,IACpG,KAAK,CACM,CACG,CACpB,CACU,CACT,CACC,CACV,CAAC;AACJ,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 { Transition } from '../transition';\nimport PopoverContainer from '../../../popover/container';\nimport PopoverBody from '../../../popover/body';\nimport Portal from '../portal';\nimport popoverStyles from '../../../popover/styles.css.js';\nimport styles from './styles.css.js';\n\nexport interface TooltipProps {\n value: number | string;\n trackRef: React.RefObject<HTMLElement | SVGElement>;\n contentAttributes?: React.HTMLAttributes<HTMLDivElement>;\n}\n\nexport default function Tooltip({ value, trackRef, contentAttributes = {} }: TooltipProps) {\n return (\n <Portal>\n <div className={styles.root} {...contentAttributes}>\n <Transition in={true}>\n {() => (\n <PopoverContainer\n trackRef={trackRef}\n trackKey={value}\n size=\"small\"\n fixedWidth={false}\n position=\"top\"\n arrow={position => (\n <div className={clsx(popoverStyles.arrow, popoverStyles[`arrow-position-${position}`])}>\n <div className={popoverStyles['arrow-outer']} />\n <div className={popoverStyles['arrow-inner']} />\n </div>\n )}\n >\n <PopoverBody dismissButton={false} dismissAriaLabel={undefined} onDismiss={undefined} header={undefined}>\n {value}\n </PopoverBody>\n </PopoverContainer>\n )}\n </Transition>\n </div>\n </Portal>\n );\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/components/tooltip/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,gBAAgB,MAAM,4BAA4B,CAAC;AAC1D,OAAO,WAAW,MAAM,uBAAuB,CAAC;AAChD,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,aAAa,MAAM,gCAAgC,CAAC;AAC3D,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAUrC,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,EAC9B,KAAK,EACL,QAAQ,EACR,SAAS,EACT,iBAAiB,GAAG,EAAE,EACtB,QAAQ,GAAG,KAAK,GACH;IACb,OAAO,CACL,oBAAC,MAAM;QACL,2CAAK,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,IAAM,iBAAiB;YACjE,oBAAC,UAAU,IAAC,EAAE,EAAE,IAAI,IACjB,GAAG,EAAE,CAAC,CACL,oBAAC,gBAAgB,IACf,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,KAAK,EACf,IAAI,EAAC,OAAO,EACZ,UAAU,EAAE,KAAK,EACjB,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,QAAQ,CAAC,EAAE,CAAC,CACjB,6BAAK,SAAS,EAAE,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,aAAa,CAAC,kBAAkB,QAAQ,EAAE,CAAC,CAAC;oBACpF,6BAAK,SAAS,EAAE,aAAa,CAAC,aAAa,CAAC,GAAI;oBAChD,6BAAK,SAAS,EAAE,aAAa,CAAC,aAAa,CAAC,GAAI,CAC5C,CACP;gBAED,oBAAC,WAAW,IAAC,aAAa,EAAE,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,IACpG,KAAK,CACM,CACG,CACpB,CACU,CACT,CACC,CACV,CAAC;AACJ,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 { Transition } from '../transition';\nimport PopoverContainer from '../../../popover/container';\nimport PopoverBody from '../../../popover/body';\nimport Portal from '../portal';\nimport popoverStyles from '../../../popover/styles.css.js';\nimport styles from './styles.css.js';\n\nexport interface TooltipProps {\n value: number | string;\n trackRef: React.RefObject<HTMLElement | SVGElement>;\n position?: 'top' | 'right' | 'bottom' | 'left';\n className?: string;\n contentAttributes?: React.HTMLAttributes<HTMLDivElement>;\n}\n\nexport default function Tooltip({\n value,\n trackRef,\n className,\n contentAttributes = {},\n position = 'top',\n}: TooltipProps) {\n return (\n <Portal>\n <div className={clsx(styles.root, className)} {...contentAttributes}>\n <Transition in={true}>\n {() => (\n <PopoverContainer\n trackRef={trackRef}\n trackKey={value}\n size=\"small\"\n fixedWidth={false}\n position={position}\n arrow={position => (\n <div className={clsx(popoverStyles.arrow, popoverStyles[`arrow-position-${position}`])}>\n <div className={popoverStyles['arrow-outer']} />\n <div className={popoverStyles['arrow-inner']} />\n </div>\n )}\n >\n <PopoverBody dismissButton={false} dismissAriaLabel={undefined} onDismiss={undefined} header={undefined}>\n {value}\n </PopoverBody>\n </PopoverContainer>\n )}\n </Transition>\n </div>\n </Portal>\n );\n}\n"]}