@cloudscape-design/components 3.0.28 → 3.0.29

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 (135) hide show
  1. package/breadcrumb-group/internal.d.ts.map +1 -1
  2. package/breadcrumb-group/internal.js +4 -4
  3. package/breadcrumb-group/internal.js.map +1 -1
  4. package/button-dropdown/interfaces.d.ts +1 -1
  5. package/button-dropdown/interfaces.d.ts.map +1 -1
  6. package/button-dropdown/interfaces.js.map +1 -1
  7. package/button-dropdown/internal.js +1 -1
  8. package/button-dropdown/internal.js.map +1 -1
  9. package/date-picker/calendar/index.d.ts.map +1 -1
  10. package/date-picker/calendar/index.js +2 -1
  11. package/date-picker/calendar/index.js.map +1 -1
  12. package/date-picker/calendar/utils/memoized-date.d.ts +2 -0
  13. package/date-picker/calendar/utils/memoized-date.d.ts.map +1 -0
  14. package/date-picker/calendar/utils/memoized-date.js +13 -0
  15. package/date-picker/calendar/utils/memoized-date.js.map +1 -0
  16. package/date-picker/embedded.js +1 -1
  17. package/date-picker/embedded.js.map +1 -1
  18. package/date-picker/index.js +1 -1
  19. package/date-picker/index.js.map +1 -1
  20. package/date-picker/use-date-picker.d.ts.map +1 -1
  21. package/date-picker/use-date-picker.js +1 -1
  22. package/date-picker/use-date-picker.js.map +1 -1
  23. package/date-range-picker/calendar/grids/day/index.js +1 -1
  24. package/date-range-picker/calendar/grids/day/index.js.map +1 -1
  25. package/date-range-picker/calendar/index.d.ts.map +1 -1
  26. package/date-range-picker/calendar/index.js +3 -3
  27. package/date-range-picker/calendar/index.js.map +1 -1
  28. package/date-range-picker/index.d.ts.map +1 -1
  29. package/date-range-picker/index.js +4 -4
  30. package/date-range-picker/index.js.map +1 -1
  31. package/date-range-picker/time-offset.d.ts +0 -7
  32. package/date-range-picker/time-offset.d.ts.map +1 -1
  33. package/date-range-picker/time-offset.js +4 -60
  34. package/date-range-picker/time-offset.js.map +1 -1
  35. package/icon/icons.js +1 -1
  36. package/icon/interfaces.d.ts +1 -1
  37. package/icon/interfaces.d.ts.map +1 -1
  38. package/icon/interfaces.js.map +1 -1
  39. package/input/styles.css.js +13 -13
  40. package/input/styles.scoped.css +35 -37
  41. package/input/styles.selectors.js +13 -13
  42. package/internal/components/date-input/index.d.ts.map +1 -1
  43. package/internal/components/date-input/index.js +3 -2
  44. package/internal/components/date-input/index.js.map +1 -1
  45. package/internal/components/masked-input/utils/mask-format.d.ts.map +1 -1
  46. package/internal/components/masked-input/utils/mask-format.js +2 -1
  47. package/internal/components/masked-input/utils/mask-format.js.map +1 -1
  48. package/internal/components/masked-input/utils/strings.d.ts +0 -1
  49. package/internal/components/masked-input/utils/strings.d.ts.map +1 -1
  50. package/internal/components/masked-input/utils/strings.js +0 -6
  51. package/internal/components/masked-input/utils/strings.js.map +1 -1
  52. package/internal/environment.js +1 -1
  53. package/internal/utils/date-time/display-format.d.ts +9 -0
  54. package/internal/utils/date-time/display-format.d.ts.map +1 -0
  55. package/internal/utils/date-time/display-format.js +15 -0
  56. package/internal/utils/date-time/display-format.js.map +1 -0
  57. package/internal/utils/date-time/format-date.d.ts +7 -0
  58. package/internal/utils/date-time/format-date.d.ts.map +1 -0
  59. package/internal/utils/date-time/format-date.js +15 -0
  60. package/internal/utils/date-time/format-date.js.map +1 -0
  61. package/internal/utils/date-time/format-time.d.ts +5 -0
  62. package/internal/utils/date-time/format-time.d.ts.map +1 -0
  63. package/internal/utils/date-time/format-time.js +13 -0
  64. package/internal/utils/date-time/format-time.js.map +1 -0
  65. package/internal/utils/date-time/format-timezone-offset.d.ts +2 -0
  66. package/internal/utils/date-time/format-timezone-offset.d.ts.map +1 -0
  67. package/internal/utils/date-time/format-timezone-offset.js +11 -0
  68. package/internal/utils/date-time/format-timezone-offset.js.map +1 -0
  69. package/internal/utils/date-time/get-browser-timezone-offset.d.ts +7 -0
  70. package/internal/utils/date-time/get-browser-timezone-offset.d.ts.map +1 -0
  71. package/internal/utils/date-time/get-browser-timezone-offset.js +11 -0
  72. package/internal/utils/date-time/get-browser-timezone-offset.js.map +1 -0
  73. package/internal/utils/date-time/index.d.ts +11 -0
  74. package/internal/utils/date-time/index.d.ts.map +1 -0
  75. package/internal/utils/date-time/index.js +13 -0
  76. package/internal/utils/date-time/index.js.map +1 -0
  77. package/internal/utils/date-time/is-iso-date-only.d.ts +5 -0
  78. package/internal/utils/date-time/is-iso-date-only.d.ts.map +1 -0
  79. package/internal/utils/date-time/is-iso-date-only.js +10 -0
  80. package/internal/utils/date-time/is-iso-date-only.js.map +1 -0
  81. package/internal/utils/date-time/join-date-time.d.ts +2 -0
  82. package/internal/utils/date-time/join-date-time.d.ts.map +1 -0
  83. package/internal/utils/date-time/join-date-time.js +6 -0
  84. package/internal/utils/date-time/join-date-time.js.map +1 -0
  85. package/internal/utils/date-time/parse-date.d.ts +8 -0
  86. package/internal/utils/date-time/parse-date.d.ts.map +1 -0
  87. package/internal/utils/date-time/parse-date.js +16 -0
  88. package/internal/utils/date-time/parse-date.js.map +1 -0
  89. package/internal/utils/date-time/parse-timezone-offset.d.ts +5 -0
  90. package/internal/utils/date-time/parse-timezone-offset.d.ts.map +1 -0
  91. package/internal/utils/date-time/parse-timezone-offset.js +20 -0
  92. package/internal/utils/date-time/parse-timezone-offset.js.map +1 -0
  93. package/internal/utils/date-time/shift-timezone-offset.d.ts +12 -0
  94. package/internal/utils/date-time/shift-timezone-offset.d.ts.map +1 -0
  95. package/internal/utils/date-time/shift-timezone-offset.js +27 -0
  96. package/internal/utils/date-time/shift-timezone-offset.js.map +1 -0
  97. package/internal/utils/strings/index.d.ts +3 -0
  98. package/internal/utils/strings/index.d.ts.map +1 -0
  99. package/internal/utils/strings/index.js +5 -0
  100. package/internal/utils/strings/index.js.map +1 -0
  101. package/internal/utils/strings/join-strings.d.ts +5 -0
  102. package/internal/utils/strings/join-strings.d.ts.map +1 -0
  103. package/internal/utils/{strings.js → strings/join-strings.js} +7 -6
  104. package/internal/utils/strings/join-strings.js.map +1 -0
  105. package/internal/utils/strings/pad-left-zeros.d.ts +5 -0
  106. package/internal/utils/strings/pad-left-zeros.d.ts.map +1 -0
  107. package/internal/utils/strings/pad-left-zeros.js +12 -0
  108. package/internal/utils/strings/pad-left-zeros.js.map +1 -0
  109. package/package.json +1 -1
  110. package/popover/styles.css.js +48 -48
  111. package/popover/styles.scoped.css +65 -60
  112. package/popover/styles.selectors.js +48 -48
  113. package/split-panel/index.d.ts.map +1 -1
  114. package/split-panel/index.js +2 -2
  115. package/split-panel/index.js.map +1 -1
  116. package/table/styles.css.js +32 -32
  117. package/table/styles.scoped.css +40 -43
  118. package/table/styles.selectors.js +32 -32
  119. package/tabs/styles.css.js +21 -21
  120. package/tabs/styles.scoped.css +40 -43
  121. package/tabs/styles.selectors.js +21 -21
  122. package/textarea/styles.css.js +4 -4
  123. package/textarea/styles.scoped.css +13 -14
  124. package/textarea/styles.selectors.js +4 -4
  125. package/date-picker/calendar/utils/date.d.ts +0 -10
  126. package/date-picker/calendar/utils/date.d.ts.map +0 -1
  127. package/date-picker/calendar/utils/date.js +0 -50
  128. package/date-picker/calendar/utils/date.js.map +0 -1
  129. package/internal/components/date-input/utils/date.d.ts +0 -5
  130. package/internal/components/date-input/utils/date.d.ts.map +0 -1
  131. package/internal/components/date-input/utils/date.js +0 -11
  132. package/internal/components/date-input/utils/date.js.map +0 -1
  133. package/internal/utils/strings.d.ts +0 -2
  134. package/internal/utils/strings.d.ts.map +0 -1
  135. package/internal/utils/strings.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/date-range-picker/calendar/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5F,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,YAAY,EAAE,OA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AI;gCAC/D,oBAAC,iBAAiB,IAChB,KAAK,EAAE,aAAa,EACpB,QAAQ,EAAE,UAAA,CAAC,IAAI,OAAA,gBAAgB,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAhC,CAAgC,EAC/C,MAAM,EAAE,eAAe,EACvB,WAAW,EAAE,eAAe,EAC5B,SAAS,EAAE,MAAM,CAAC,gBAAgB,CAAC,EACnC,eAAe,EAAE,gBAAgB,GACjC,CACgB,CAChB,CACP,CACG,CACe;gBACtB,WAAW,CAAC,sBAAsB,IAAI,CACrC,6BAAK,SAAS,EAAE,MAAM,CAAC,8BAA8B,CAAC,EAAE,EAAE,EAAE,gBAAgB,IACzE,WAAW,CAAC,sBAAsB,CAC/B,CACP,CACoB,CACF;QACvB,oBAAC,UAAU;YACT,8BAAM,SAAS,EAAE,MAAM,CAAC,oBAAoB,CAAC,IAAG,YAAY,CAAQ,CACzD,CACZ,CACJ,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { forwardRef, useEffect, useImperativeHandle, useRef, useState } from 'react';\nimport { addMonths, endOfDay, isBefore, startOfDay, startOfMonth, isAfter, isSameMonth } from 'date-fns';\nimport styles from '../styles.css.js';\nimport { BaseComponentProps } from '../../internal/base-component';\nimport { DateRangePickerProps, Focusable } from '../interfaces';\nimport CalendarHeader from './header';\nimport { Grids, selectFocusedDate } from './grids';\nimport moveFocusHandler from '../../date-picker/calendar/utils/move-focus-handler';\nimport {\n formatDate,\n formatTime,\n formatISOStringWithoutTimezone,\n parseDate,\n} from '../../date-picker/calendar/utils/date';\nimport InternalSpaceBetween from '../../space-between/internal';\nimport InternalFormField from '../../form-field/internal';\nimport { InputProps } from '../../input/interfaces';\nimport DateInput from '../../internal/components/date-input';\nimport { TimeInputProps } from '../../time-input/interfaces';\nimport InternalTimeInput from '../../time-input/internal';\nimport clsx from 'clsx';\nimport { getBaseDate } from './get-base-date.js';\nimport { useUniqueId } from '../../internal/hooks/use-unique-id';\nimport { getDateLabel, renderTimeLabel } from '../../date-picker/calendar/utils/intl';\nimport LiveRegion from '../../internal/components/live-region';\nimport { normalizeStartOfWeek } from '../../date-picker/calendar/utils/locales';\n\nexport interface DateChangeHandler {\n (detail: Date): void;\n}\n\nexport interface MonthChangeHandler {\n (newMonth: Date): void;\n}\n\nexport type DayIndex = 0 | 1 | 2 | 3 | 4 | 5 | 6;\n\ninterface HeaderChangeMonthHandler {\n (isPreviousButtonClick?: boolean): void;\n}\n\nexport interface CalendarProps extends BaseComponentProps {\n locale: string;\n startOfWeek: number | undefined;\n isDateEnabled: DateRangePickerProps.IsDateEnabledFunction;\n onSelectDateRange: (value: DateRangePickerProps.AbsoluteValue) => void;\n initialStartDate: string | undefined;\n initialEndDate: string | undefined;\n i18nStrings: DateRangePickerProps.I18nStrings;\n dateOnly: boolean;\n timeInputFormat: TimeInputProps.Format;\n isSingleGrid: boolean;\n}\n\nexport default forwardRef(Calendar);\n\nfunction Calendar(\n {\n locale,\n startOfWeek,\n isDateEnabled,\n onSelectDateRange,\n initialEndDate = '',\n initialStartDate = '',\n i18nStrings,\n dateOnly,\n isSingleGrid,\n timeInputFormat,\n }: CalendarProps,\n ref: React.Ref<Focusable>\n) {\n const elementRef = useRef<HTMLDivElement>(null);\n\n const normalizedStartOfWeek = normalizeStartOfWeek(startOfWeek, locale);\n\n useImperativeHandle(ref, () => ({\n focus() {\n if (elementRef.current) {\n const prevButton = elementRef.current.getElementsByClassName(styles['calendar-prev-month-btn'])[0];\n (prevButton as undefined | HTMLButtonElement)?.focus();\n }\n },\n }));\n\n const [initialStartDateString = '', initialStartTimeString = ''] = initialStartDate.split('T');\n const [initialEndDateString = '', initialEndTimeString = ''] = initialEndDate.split('T');\n\n const [startDateString, setStartDateString] = useState(initialStartDateString);\n const [startTimeString, setStartTimeString] = useState(initialStartTimeString);\n\n const [endDateString, setEndDateString] = useState(initialEndDateString);\n const [endTimeString, setEndTimeString] = useState(initialEndTimeString);\n\n const selectedStartDate = parseDate(startDateString, true);\n const selectedEndDate = parseDate(endDateString, true);\n\n const [announcement, setAnnouncement] = useState('');\n\n const [currentMonth, setCurrentMonth] = useState(() => {\n if (startDateString) {\n const startDate = parseDate(startDateString);\n if (isSingleGrid) {\n return startOfMonth(startDate);\n }\n return startOfMonth(addMonths(startDate, 1));\n }\n if (endDateString) {\n return startOfMonth(parseDate(endDateString));\n }\n return startOfMonth(Date.now());\n });\n\n const [focusedDate, setFocusedDate] = useState<Date | null>(() => {\n if (selectedStartDate) {\n if (isSameMonth(selectedStartDate, currentMonth)) {\n return selectedStartDate;\n }\n if (!isSingleGrid && isSameMonth(selectedStartDate, addMonths(currentMonth, -1))) {\n return selectedStartDate;\n }\n }\n return selectFocusedDate(selectedStartDate, currentMonth, isDateEnabled);\n });\n\n useEffect(() => {\n // This effect \"synchronizes\" the local state update back up to the overall DateRangePicker component\n\n const startDate = formatISOStringWithoutTimezone(startDateString, startTimeString);\n const endDate = formatISOStringWithoutTimezone(endDateString, endTimeString);\n\n if (startDate !== initialStartDate || endDate !== initialEndDate) {\n onSelectDateRange({\n startDate,\n endDate,\n type: 'absolute',\n });\n }\n }, [\n startDateString,\n startTimeString,\n endDateString,\n endTimeString,\n onSelectDateRange,\n initialStartDate,\n initialEndDate,\n ]);\n\n const onSelectDateHandler = (selectedDate: Date) => {\n // recommended to include the start/end time announced with the selection\n // because the user is not aware of the fact that a start/end time is also set as soon as they select a date\n const announceStart = (startDate: Date) => {\n return (\n i18nStrings.startDateLabel +\n ', ' +\n getDateLabel(locale, startDate) +\n ', ' +\n i18nStrings.startTimeLabel +\n ', ' +\n renderTimeLabel(locale, startDate, timeInputFormat) +\n '. '\n );\n };\n\n const announceEnd = (endDate: Date) => {\n return (\n i18nStrings.endDateLabel +\n ', ' +\n getDateLabel(locale, endDate) +\n ', ' +\n i18nStrings.endTimeLabel +\n ', ' +\n renderTimeLabel(locale, endDate, timeInputFormat) +\n '. '\n );\n };\n\n const announceRange = (startDate: Date, endDate: Date) => {\n if (!i18nStrings.renderSelectedAbsoluteRangeAriaLive) {\n return `${getDateLabel(locale, startDate)} – ${getDateLabel(locale, endDate)}`;\n }\n return i18nStrings.renderSelectedAbsoluteRangeAriaLive(\n getDateLabel(locale, startDate),\n getDateLabel(locale, endDate)\n );\n };\n\n // If both fields are empty, we set the start date\n if (!startDateString && !endDateString) {\n const startDate = startOfDay(selectedDate);\n setStartDateString(formatDate(startDate));\n setStartTimeString(formatTime(startDate));\n setAnnouncement(announceStart(startDate));\n return;\n }\n\n // If both fields are set, we start new\n if (startDateString && endDateString) {\n const startDate = startOfDay(selectedDate);\n setStartDateString(formatDate(startDate));\n setStartTimeString(formatTime(startDate));\n\n setEndDateString('');\n setEndTimeString('');\n setAnnouncement(announceStart(startDate));\n return;\n }\n\n // If only the END date is empty, we fill it (and swap dates if needed)\n if (startDateString && !endDateString) {\n const parsedStartDate = parseDate(startDateString);\n\n if (isBefore(selectedDate, parsedStartDate)) {\n // The user has selected the range backwards, so we swap start and end\n\n const startDate = startOfDay(selectedDate);\n const endDate = endOfDay(parsedStartDate);\n\n setStartDateString(formatDate(startDate));\n setStartTimeString(formatTime(startDate));\n\n setEndDateString(formatDate(endDate));\n setEndTimeString(formatTime(endDate));\n setAnnouncement(announceStart(startDate) + announceRange(startDate, endDate));\n } else {\n const endDate = endOfDay(selectedDate);\n setEndDateString(formatDate(endDate));\n setEndTimeString(formatTime(endDate));\n setAnnouncement(announceEnd(endDate) + announceRange(parsedStartDate, endDate));\n }\n return;\n }\n\n // If only the START date is empty, we fill it (and swap dates if needed)\n if (!startDateString && endDateString) {\n const existingEndDate = parseDate(endDateString);\n\n if (isAfter(selectedDate, existingEndDate)) {\n // The user has selected the range backwards, so we swap start and end\n\n const startDate = startOfDay(existingEndDate);\n const endDate = endOfDay(selectedDate);\n\n setStartDateString(formatDate(startDate));\n setStartTimeString(formatTime(startDate));\n\n setEndDateString(formatDate(endDate));\n setEndTimeString(formatTime(endDate));\n setAnnouncement(announceEnd(endDate) + announceRange(startDate, endDate));\n } else {\n const startDate = startOfDay(selectedDate);\n setStartDateString(formatDate(startDate));\n setStartTimeString(formatTime(startDate));\n setAnnouncement(announceStart(startDate) + announceRange(startDate, existingEndDate));\n }\n return;\n }\n // All possible conditions are covered above\n };\n\n const onHeaderChangeMonthHandler: HeaderChangeMonthHandler = isPrevious => {\n const newCurrentMonth = addMonths(currentMonth, isPrevious ? -1 : 1);\n setCurrentMonth(newCurrentMonth);\n\n const newBaseDateMonth = isSingleGrid ? newCurrentMonth : addMonths(newCurrentMonth, -1);\n const newBaseDate = getBaseDate(newBaseDateMonth, 1, isDateEnabled);\n setFocusedDate(newBaseDate);\n };\n\n const onChangeStartDate: InputProps['onChange'] = e => {\n setStartDateString(e.detail.value);\n\n if (e.detail.value.length >= 8) {\n const newCurrentMonth = startOfMonth(parseDate(e.detail.value));\n setCurrentMonth(isSingleGrid ? newCurrentMonth : addMonths(newCurrentMonth, 1));\n }\n };\n\n const onChangeEndDate: InputProps['onChange'] = e => {\n setEndDateString(e.detail.value);\n };\n\n let constrainttextId = useUniqueId('awsui-area-date-range-picker');\n constrainttextId = i18nStrings.dateTimeConstraintText ? constrainttextId : '';\n\n return (\n <>\n <InternalSpaceBetween size=\"m\">\n <div\n className={clsx(styles.calendar, {\n [styles['one-grid']]: isSingleGrid,\n })}\n role=\"application\"\n ref={elementRef}\n >\n <CalendarHeader\n baseDate={currentMonth}\n locale={locale}\n onChangeMonth={onHeaderChangeMonthHandler}\n previousMonthLabel={i18nStrings.previousMonthAriaLabel}\n nextMonthLabel={i18nStrings.nextMonthAriaLabel}\n isSingleGrid={isSingleGrid}\n />\n\n <Grids\n isSingleGrid={isSingleGrid}\n locale={locale}\n baseDate={currentMonth}\n focusedDate={focusedDate}\n onFocusedDateChange={setFocusedDate}\n isDateEnabled={isDateEnabled}\n onSelectDate={onSelectDateHandler}\n onChangeMonth={setCurrentMonth}\n startOfWeek={normalizedStartOfWeek}\n todayAriaLabel={i18nStrings.todayAriaLabel}\n selectedStartDate={selectedStartDate}\n selectedEndDate={selectedEndDate}\n handleFocusMove={moveFocusHandler}\n />\n </div>\n <InternalSpaceBetween direction=\"vertical\" size=\"xxs\">\n <InternalSpaceBetween size=\"xs\" direction={isSingleGrid ? 'vertical' : 'horizontal'}>\n <div className={styles['date-and-time-wrapper']}>\n <div className={styles['date-and-time-wrapper__date']}>\n <InternalFormField label={i18nStrings.startDateLabel} stretch={true}>\n <DateInput\n value={startDateString}\n autoComplete={false}\n disableBrowserAutocorrect={true}\n disableAutocompleteOnBlur={false}\n className={styles['start-date-input']}\n onChange={onChangeStartDate}\n placeholder=\"YYYY/MM/DD\"\n ariaDescribedby={constrainttextId}\n />\n </InternalFormField>\n </div>\n {!dateOnly && (\n <div className={styles['date-and-time-wrapper__time']}>\n <InternalFormField label={i18nStrings.startTimeLabel} stretch={true}>\n <InternalTimeInput\n value={startTimeString}\n onChange={e => setStartTimeString(e.detail.value)}\n format={timeInputFormat}\n placeholder={timeInputFormat}\n className={styles['start-time-input']}\n ariaDescribedby={constrainttextId}\n />\n </InternalFormField>\n </div>\n )}\n </div>\n\n <div className={styles['date-and-time-wrapper']}>\n <div className={styles['date-and-time-wrapper__date']}>\n <InternalFormField label={i18nStrings.endDateLabel} stretch={true}>\n <DateInput\n value={endDateString}\n autoComplete={false}\n disableBrowserAutocorrect={true}\n disableAutocompleteOnBlur={false}\n className={styles['end-date-input']}\n onChange={onChangeEndDate}\n placeholder=\"YYYY/MM/DD\"\n ariaDescribedby={constrainttextId}\n />\n </InternalFormField>\n </div>\n {!dateOnly && (\n <div className={styles['date-and-time-wrapper__time']}>\n <InternalFormField label={i18nStrings.endTimeLabel} stretch={true}>\n <InternalTimeInput\n value={endTimeString}\n onChange={e => setEndTimeString(e.detail.value)}\n format={timeInputFormat}\n placeholder={timeInputFormat}\n className={styles['end-time-input']}\n ariaDescribedby={constrainttextId}\n />\n </InternalFormField>\n </div>\n )}\n </div>\n </InternalSpaceBetween>\n {i18nStrings.dateTimeConstraintText && (\n <div className={styles['date-and-time-constrainttext']} id={constrainttextId}>\n {i18nStrings.dateTimeConstraintText}\n </div>\n )}\n </InternalSpaceBetween>\n </InternalSpaceBetween>\n <LiveRegion>\n <span className={styles['calendar-aria-live']}>{announcement}</span>\n </LiveRegion>\n </>\n );\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/date-range-picker/calendar/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5F,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,YAAY,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACzG,OAAO,MAAM,MAAM,kBAAkB,CAAC;AAGtC,OAAO,cAAc,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,gBAAgB,MAAM,qDAAqD,CAAC;AACnF,OAAO,oBAAoB,MAAM,8BAA8B,CAAC;AAChE,OAAO,iBAAiB,MAAM,2BAA2B,CAAC;AAE1D,OAAO,SAAS,MAAM,sCAAsC,CAAC;AAE7D,OAAO,iBAAiB,MAAM,2BAA2B,CAAC;AAC1D,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACtF,OAAO,UAAU,MAAM,uCAAuC,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAChF,OAAO,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SAAS,EAAE,MAAM,CAAC,6BAA6B,CAAC;4BACnD,oBAAC,iBAAiB,IAAC,KAAK,EAAE,WAAW,CAAC,YAAY,EAAE,OAAO,EAAE,IAAI;gCAC/D,oBAAC,SAAS,IACR,KAAK,EAAE,aAAa,EACpB,YAAY,EAAE,KAAK,EACnB,yBAAyB,EAAE,IAAI,EAC/B,yBAAyB,EAAE,KAAK,EAChC,SAAS,EAAE,MAAM,CAAC,gBAAgB,CAAC,EACnC,QAAQ,EAAE,eAAe,EACzB,WAAW,EAAC,YAAY,EACxB,eAAe,EAAE,gBAAgB,GACjC,CACgB,CAChB;wBACL,CAAC,QAAQ,IAAI,CACZ,6BAAK,SAAS,EAAE,MAAM,CAAC,6BAA6B,CAAC;4BACnD,oBAAC,iBAAiB,IAAC,KAAK,EAAE,WAAW,CAAC,YAAY,EAAE,OAAO,EAAE,IAAI;gCAC/D,oBAAC,iBAAiB,IAChB,KAAK,EAAE,aAAa,EACpB,QAAQ,EAAE,UAAA,CAAC,IAAI,OAAA,gBAAgB,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAhC,CAAgC,EAC/C,MAAM,EAAE,eAAe,EACvB,WAAW,EAAE,eAAe,EAC5B,SAAS,EAAE,MAAM,CAAC,gBAAgB,CAAC,EACnC,eAAe,EAAE,gBAAgB,GACjC,CACgB,CAChB,CACP,CACG,CACe;gBACtB,WAAW,CAAC,sBAAsB,IAAI,CACrC,6BAAK,SAAS,EAAE,MAAM,CAAC,8BAA8B,CAAC,EAAE,EAAE,EAAE,gBAAgB,IACzE,WAAW,CAAC,sBAAsB,CAC/B,CACP,CACoB,CACF;QACvB,oBAAC,UAAU;YACT,8BAAM,SAAS,EAAE,MAAM,CAAC,oBAAoB,CAAC,IAAG,YAAY,CAAQ,CACzD,CACZ,CACJ,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { forwardRef, useEffect, useImperativeHandle, useRef, useState } from 'react';\nimport { addMonths, endOfDay, isBefore, startOfDay, startOfMonth, isAfter, isSameMonth } from 'date-fns';\nimport styles from '../styles.css.js';\nimport { BaseComponentProps } from '../../internal/base-component';\nimport { DateRangePickerProps, Focusable } from '../interfaces';\nimport CalendarHeader from './header';\nimport { Grids, selectFocusedDate } from './grids';\nimport moveFocusHandler from '../../date-picker/calendar/utils/move-focus-handler';\nimport InternalSpaceBetween from '../../space-between/internal';\nimport InternalFormField from '../../form-field/internal';\nimport { InputProps } from '../../input/interfaces';\nimport DateInput from '../../internal/components/date-input';\nimport { TimeInputProps } from '../../time-input/interfaces';\nimport InternalTimeInput from '../../time-input/internal';\nimport clsx from 'clsx';\nimport { getBaseDate } from './get-base-date.js';\nimport { useUniqueId } from '../../internal/hooks/use-unique-id';\nimport { getDateLabel, renderTimeLabel } from '../../date-picker/calendar/utils/intl';\nimport LiveRegion from '../../internal/components/live-region';\nimport { normalizeStartOfWeek } from '../../date-picker/calendar/utils/locales';\nimport { formatDate, formatTime, joinDateTime, parseDate } from '../../internal/utils/date-time';\n\nexport interface DateChangeHandler {\n (detail: Date): void;\n}\n\nexport interface MonthChangeHandler {\n (newMonth: Date): void;\n}\n\nexport type DayIndex = 0 | 1 | 2 | 3 | 4 | 5 | 6;\n\ninterface HeaderChangeMonthHandler {\n (isPreviousButtonClick?: boolean): void;\n}\n\nexport interface CalendarProps extends BaseComponentProps {\n locale: string;\n startOfWeek: number | undefined;\n isDateEnabled: DateRangePickerProps.IsDateEnabledFunction;\n onSelectDateRange: (value: DateRangePickerProps.AbsoluteValue) => void;\n initialStartDate: string | undefined;\n initialEndDate: string | undefined;\n i18nStrings: DateRangePickerProps.I18nStrings;\n dateOnly: boolean;\n timeInputFormat: TimeInputProps.Format;\n isSingleGrid: boolean;\n}\n\nexport default forwardRef(Calendar);\n\nfunction Calendar(\n {\n locale,\n startOfWeek,\n isDateEnabled,\n onSelectDateRange,\n initialEndDate = '',\n initialStartDate = '',\n i18nStrings,\n dateOnly,\n isSingleGrid,\n timeInputFormat,\n }: CalendarProps,\n ref: React.Ref<Focusable>\n) {\n const elementRef = useRef<HTMLDivElement>(null);\n\n const normalizedStartOfWeek = normalizeStartOfWeek(startOfWeek, locale);\n\n useImperativeHandle(ref, () => ({\n focus() {\n if (elementRef.current) {\n const prevButton = elementRef.current.getElementsByClassName(styles['calendar-prev-month-btn'])[0];\n (prevButton as undefined | HTMLButtonElement)?.focus();\n }\n },\n }));\n\n const [initialStartDateString = '', initialStartTimeString = ''] = initialStartDate.split('T');\n const [initialEndDateString = '', initialEndTimeString = ''] = initialEndDate.split('T');\n\n const [startDateString, setStartDateString] = useState(initialStartDateString);\n const [startTimeString, setStartTimeString] = useState(initialStartTimeString);\n\n const [endDateString, setEndDateString] = useState(initialEndDateString);\n const [endTimeString, setEndTimeString] = useState(initialEndTimeString);\n\n const selectedStartDate = parseDate(startDateString, true);\n const selectedEndDate = parseDate(endDateString, true);\n\n const [announcement, setAnnouncement] = useState('');\n\n const [currentMonth, setCurrentMonth] = useState(() => {\n if (startDateString) {\n const startDate = parseDate(startDateString);\n if (isSingleGrid) {\n return startOfMonth(startDate);\n }\n return startOfMonth(addMonths(startDate, 1));\n }\n if (endDateString) {\n return startOfMonth(parseDate(endDateString));\n }\n return startOfMonth(Date.now());\n });\n\n const [focusedDate, setFocusedDate] = useState<Date | null>(() => {\n if (selectedStartDate) {\n if (isSameMonth(selectedStartDate, currentMonth)) {\n return selectedStartDate;\n }\n if (!isSingleGrid && isSameMonth(selectedStartDate, addMonths(currentMonth, -1))) {\n return selectedStartDate;\n }\n }\n return selectFocusedDate(selectedStartDate, currentMonth, isDateEnabled);\n });\n\n useEffect(() => {\n // This effect \"synchronizes\" the local state update back up to the overall DateRangePicker component\n\n const startDate = joinDateTime(startDateString, startTimeString);\n const endDate = joinDateTime(endDateString, endTimeString);\n\n if (startDate !== initialStartDate || endDate !== initialEndDate) {\n onSelectDateRange({\n startDate,\n endDate,\n type: 'absolute',\n });\n }\n }, [\n startDateString,\n startTimeString,\n endDateString,\n endTimeString,\n onSelectDateRange,\n initialStartDate,\n initialEndDate,\n ]);\n\n const onSelectDateHandler = (selectedDate: Date) => {\n // recommended to include the start/end time announced with the selection\n // because the user is not aware of the fact that a start/end time is also set as soon as they select a date\n const announceStart = (startDate: Date) => {\n return (\n i18nStrings.startDateLabel +\n ', ' +\n getDateLabel(locale, startDate) +\n ', ' +\n i18nStrings.startTimeLabel +\n ', ' +\n renderTimeLabel(locale, startDate, timeInputFormat) +\n '. '\n );\n };\n\n const announceEnd = (endDate: Date) => {\n return (\n i18nStrings.endDateLabel +\n ', ' +\n getDateLabel(locale, endDate) +\n ', ' +\n i18nStrings.endTimeLabel +\n ', ' +\n renderTimeLabel(locale, endDate, timeInputFormat) +\n '. '\n );\n };\n\n const announceRange = (startDate: Date, endDate: Date) => {\n if (!i18nStrings.renderSelectedAbsoluteRangeAriaLive) {\n return `${getDateLabel(locale, startDate)} – ${getDateLabel(locale, endDate)}`;\n }\n return i18nStrings.renderSelectedAbsoluteRangeAriaLive(\n getDateLabel(locale, startDate),\n getDateLabel(locale, endDate)\n );\n };\n\n // If both fields are empty, we set the start date\n if (!startDateString && !endDateString) {\n const startDate = startOfDay(selectedDate);\n setStartDateString(formatDate(startDate));\n setStartTimeString(formatTime(startDate));\n setAnnouncement(announceStart(startDate));\n return;\n }\n\n // If both fields are set, we start new\n if (startDateString && endDateString) {\n const startDate = startOfDay(selectedDate);\n setStartDateString(formatDate(startDate));\n setStartTimeString(formatTime(startDate));\n\n setEndDateString('');\n setEndTimeString('');\n setAnnouncement(announceStart(startDate));\n return;\n }\n\n // If only the END date is empty, we fill it (and swap dates if needed)\n if (startDateString && !endDateString) {\n const parsedStartDate = parseDate(startDateString);\n\n if (isBefore(selectedDate, parsedStartDate)) {\n // The user has selected the range backwards, so we swap start and end\n\n const startDate = startOfDay(selectedDate);\n const endDate = endOfDay(parsedStartDate);\n\n setStartDateString(formatDate(startDate));\n setStartTimeString(formatTime(startDate));\n\n setEndDateString(formatDate(endDate));\n setEndTimeString(formatTime(endDate));\n setAnnouncement(announceStart(startDate) + announceRange(startDate, endDate));\n } else {\n const endDate = endOfDay(selectedDate);\n setEndDateString(formatDate(endDate));\n setEndTimeString(formatTime(endDate));\n setAnnouncement(announceEnd(endDate) + announceRange(parsedStartDate, endDate));\n }\n return;\n }\n\n // If only the START date is empty, we fill it (and swap dates if needed)\n if (!startDateString && endDateString) {\n const existingEndDate = parseDate(endDateString);\n\n if (isAfter(selectedDate, existingEndDate)) {\n // The user has selected the range backwards, so we swap start and end\n\n const startDate = startOfDay(existingEndDate);\n const endDate = endOfDay(selectedDate);\n\n setStartDateString(formatDate(startDate));\n setStartTimeString(formatTime(startDate));\n\n setEndDateString(formatDate(endDate));\n setEndTimeString(formatTime(endDate));\n setAnnouncement(announceEnd(endDate) + announceRange(startDate, endDate));\n } else {\n const startDate = startOfDay(selectedDate);\n setStartDateString(formatDate(startDate));\n setStartTimeString(formatTime(startDate));\n setAnnouncement(announceStart(startDate) + announceRange(startDate, existingEndDate));\n }\n return;\n }\n // All possible conditions are covered above\n };\n\n const onHeaderChangeMonthHandler: HeaderChangeMonthHandler = isPrevious => {\n const newCurrentMonth = addMonths(currentMonth, isPrevious ? -1 : 1);\n setCurrentMonth(newCurrentMonth);\n\n const newBaseDateMonth = isSingleGrid ? newCurrentMonth : addMonths(newCurrentMonth, -1);\n const newBaseDate = getBaseDate(newBaseDateMonth, 1, isDateEnabled);\n setFocusedDate(newBaseDate);\n };\n\n const onChangeStartDate: InputProps['onChange'] = e => {\n setStartDateString(e.detail.value);\n\n if (e.detail.value.length >= 8) {\n const newCurrentMonth = startOfMonth(parseDate(e.detail.value));\n setCurrentMonth(isSingleGrid ? newCurrentMonth : addMonths(newCurrentMonth, 1));\n }\n };\n\n const onChangeEndDate: InputProps['onChange'] = e => {\n setEndDateString(e.detail.value);\n };\n\n let constrainttextId = useUniqueId('awsui-area-date-range-picker');\n constrainttextId = i18nStrings.dateTimeConstraintText ? constrainttextId : '';\n\n return (\n <>\n <InternalSpaceBetween size=\"m\">\n <div\n className={clsx(styles.calendar, {\n [styles['one-grid']]: isSingleGrid,\n })}\n role=\"application\"\n ref={elementRef}\n >\n <CalendarHeader\n baseDate={currentMonth}\n locale={locale}\n onChangeMonth={onHeaderChangeMonthHandler}\n previousMonthLabel={i18nStrings.previousMonthAriaLabel}\n nextMonthLabel={i18nStrings.nextMonthAriaLabel}\n isSingleGrid={isSingleGrid}\n />\n\n <Grids\n isSingleGrid={isSingleGrid}\n locale={locale}\n baseDate={currentMonth}\n focusedDate={focusedDate}\n onFocusedDateChange={setFocusedDate}\n isDateEnabled={isDateEnabled}\n onSelectDate={onSelectDateHandler}\n onChangeMonth={setCurrentMonth}\n startOfWeek={normalizedStartOfWeek}\n todayAriaLabel={i18nStrings.todayAriaLabel}\n selectedStartDate={selectedStartDate}\n selectedEndDate={selectedEndDate}\n handleFocusMove={moveFocusHandler}\n />\n </div>\n <InternalSpaceBetween direction=\"vertical\" size=\"xxs\">\n <InternalSpaceBetween size=\"xs\" direction={isSingleGrid ? 'vertical' : 'horizontal'}>\n <div className={styles['date-and-time-wrapper']}>\n <div className={styles['date-and-time-wrapper__date']}>\n <InternalFormField label={i18nStrings.startDateLabel} stretch={true}>\n <DateInput\n value={startDateString}\n autoComplete={false}\n disableBrowserAutocorrect={true}\n disableAutocompleteOnBlur={false}\n className={styles['start-date-input']}\n onChange={onChangeStartDate}\n placeholder=\"YYYY/MM/DD\"\n ariaDescribedby={constrainttextId}\n />\n </InternalFormField>\n </div>\n {!dateOnly && (\n <div className={styles['date-and-time-wrapper__time']}>\n <InternalFormField label={i18nStrings.startTimeLabel} stretch={true}>\n <InternalTimeInput\n value={startTimeString}\n onChange={e => setStartTimeString(e.detail.value)}\n format={timeInputFormat}\n placeholder={timeInputFormat}\n className={styles['start-time-input']}\n ariaDescribedby={constrainttextId}\n />\n </InternalFormField>\n </div>\n )}\n </div>\n\n <div className={styles['date-and-time-wrapper']}>\n <div className={styles['date-and-time-wrapper__date']}>\n <InternalFormField label={i18nStrings.endDateLabel} stretch={true}>\n <DateInput\n value={endDateString}\n autoComplete={false}\n disableBrowserAutocorrect={true}\n disableAutocompleteOnBlur={false}\n className={styles['end-date-input']}\n onChange={onChangeEndDate}\n placeholder=\"YYYY/MM/DD\"\n ariaDescribedby={constrainttextId}\n />\n </InternalFormField>\n </div>\n {!dateOnly && (\n <div className={styles['date-and-time-wrapper__time']}>\n <InternalFormField label={i18nStrings.endTimeLabel} stretch={true}>\n <InternalTimeInput\n value={endTimeString}\n onChange={e => setEndTimeString(e.detail.value)}\n format={timeInputFormat}\n placeholder={timeInputFormat}\n className={styles['end-time-input']}\n ariaDescribedby={constrainttextId}\n />\n </InternalFormField>\n </div>\n )}\n </div>\n </InternalSpaceBetween>\n {i18nStrings.dateTimeConstraintText && (\n <div className={styles['date-and-time-constrainttext']} id={constrainttextId}>\n {i18nStrings.dateTimeConstraintText}\n </div>\n )}\n </InternalSpaceBetween>\n </InternalSpaceBetween>\n <LiveRegion>\n <span className={styles['calendar-aria-live']}>{announcement}</span>\n </LiveRegion>\n </>\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/date-range-picker/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAEhE,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAyBpD,OAAO,EAAE,oBAAoB,EAAE,CAAC;AA0EhC,QAAA,MAAM,eAAe,uGAgMpB,CAAC;AAGF,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/date-range-picker/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAEhE,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AA0BpD,OAAO,EAAE,oBAAoB,EAAE,CAAC;AAyEhC,QAAA,MAAM,eAAe,uGAgMpB,CAAC;AAGF,eAAe,eAAe,CAAC"}
@@ -18,7 +18,7 @@ import { useMobile } from '../internal/hooks/use-mobile';
18
18
  import ButtonTrigger from '../internal/components/button-trigger';
19
19
  import { useFormFieldContext } from '../internal/context/form-field-context';
20
20
  import InternalIcon from '../icon/internal';
21
- import { getBrowserTimezoneOffset, shiftTimeOffset, formatOffset, setTimeOffset } from './time-offset';
21
+ import { shiftTimeOffset, setTimeOffset } from './time-offset';
22
22
  import useBaseComponent from '../internal/hooks/use-base-component';
23
23
  import { useMergeRefs } from '../internal/hooks/use-merge-refs';
24
24
  import { fireNonCancelableEvent } from '../internal/events/index.js';
@@ -26,6 +26,7 @@ import { isDevelopment } from '../internal/is-development.js';
26
26
  import { warnOnce } from '../internal/logging.js';
27
27
  import { usePrevious } from '../internal/hooks/use-previous/index.js';
28
28
  import { useUniqueId } from '../internal/hooks/use-unique-id';
29
+ import { formatTimezoneOffset, getBrowserTimezoneOffset, isIsoDateOnly } from '../internal/utils/date-time';
29
30
  function formatDateRange(range, placeholder, formatRelativeRange, timeOffset) {
30
31
  if (!range) {
31
32
  return (React.createElement("span", { className: styles['label-text'], "aria-disabled": true }, placeholder));
@@ -41,15 +42,14 @@ function BreakSpaces(_a) {
41
42
  token === ' ' && React.createElement("wbr", null))); })));
42
43
  }
43
44
  function formatAbsoluteRange(value, timeOffset) {
44
- var formattedOffset = isDateOnly(value) ? '' : formatOffset(timeOffset);
45
+ var formattedOffset = isDateOnly(value) ? '' : formatTimezoneOffset(timeOffset);
45
46
  return value.startDate + formattedOffset + ' ' + '—' + ' ' + value.endDate + formattedOffset;
46
47
  }
47
48
  function isDateOnly(value) {
48
49
  if (!value || value.type !== 'absolute') {
49
50
  return false;
50
51
  }
51
- var dateRegex = /^\d{4}-\d{2}-\d{2}$/;
52
- return dateRegex.test(value.startDate) && dateRegex.test(value.endDate);
52
+ return isIsoDateOnly(value.startDate) && isIsoDateOnly(value.endDate);
53
53
  }
54
54
  function formatValue(value, _a) {
55
55
  var timeOffset = _a.timeOffset, dateOnly = _a.dateOnly;
@@ -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,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,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,wBAAwB,EAAE,eAAe,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACvG,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OA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,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 '../date-picker/calendar/utils/locales';\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 { getBrowserTimezoneOffset, shiftTimeOffset, formatOffset, setTimeOffset } from './time-offset';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { fireNonCancelableEvent } from '../internal/events/index.js';\nimport { isDevelopment } from '../internal/is-development.js';\nimport { warnOnce } from '../internal/logging.js';\nimport { usePrevious } from '../internal/hooks/use-previous/index.js';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\n\nexport { DateRangePickerProps };\n\nfunction formatDateRange(\n range: null | DateRangePickerProps.Value,\n placeholder: string,\n formatRelativeRange: DateRangePickerProps.I18nStrings['formatRelativeRange'],\n timeOffset: 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 text={formatAbsoluteRange(range, timeOffset)} />\n );\n\n return (\n <InternalBox fontWeight=\"normal\" display=\"inline\" color=\"inherit\">\n {formatted}\n </InternalBox>\n );\n}\n\nfunction BreakSpaces({ text }: { text: string }) {\n const tokens = text.split(/( )/);\n return (\n <div style={{ whiteSpace: 'nowrap' }}>\n {tokens.map((token, index) => (\n <React.Fragment key={index}>\n {token}\n {token === ' ' && <wbr />}\n </React.Fragment>\n ))}\n </div>\n );\n}\n\nfunction formatAbsoluteRange(value: DateRangePickerProps.AbsoluteValue, timeOffset: number): string {\n const formattedOffset = isDateOnly(value) ? '' : formatOffset(timeOffset);\n return value.startDate + formattedOffset + ' ' + '—' + ' ' + value.endDate + formattedOffset;\n}\n\nfunction isDateOnly(value: null | DateRangePickerProps.Value) {\n if (!value || value.type !== 'absolute') {\n return false;\n }\n const dateRegex = /^\\d{4}-\\d{2}-\\d{2}$/;\n return dateRegex.test(value.startDate) && dateRegex.test(value.endDate);\n}\n\nfunction formatValue(\n value: null | DateRangePickerProps.Value,\n { timeOffset, dateOnly }: { timeOffset: number; dateOnly: boolean }\n): null | DateRangePickerProps.Value {\n if (!value || value.type === 'relative') {\n return value;\n }\n if (dateOnly) {\n return {\n type: 'absolute',\n startDate: value.startDate.split('T')[0],\n endDate: value.endDate.split('T')[0],\n };\n }\n return setTimeOffset(value, timeOffset);\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 = getBrowserTimezoneOffset(),\n timeInputFormat = 'hh:mm:ss',\n expandToViewport = false,\n rangeSelectorMode = 'default',\n ...rest\n }: DateRangePickerProps,\n ref: Ref<DateRangePickerProps.Ref>\n ) => {\n const { __internalRootRef } = useBaseComponent('DateRangePicker');\n checkControlled('DateRangePicker', 'value', value, 'onChange', onChange);\n\n value = isDateOnly(value) ? value : shiftTimeOffset(value, timeOffset);\n\n const baseProps = getBaseProps(rest);\n const { invalid, 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\n useFocusTracker({ rootRef, onBlur, onFocus, viewportId: expandToViewport ? dropdownId : '' });\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 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, { value: formatValue(newValue, { dateOnly, timeOffset }) });\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 trigger = (\n <div className={styles['trigger-wrapper']}>\n <ButtonTrigger\n ref={triggerRef}\n id={controlId}\n invalid={invalid}\n ariaLabel={i18nStrings.ariaLabel}\n ariaDescribedby={ariaDescribedby}\n ariaLabelledby={ariaLabelledby}\n className={clsx(styles.label, {\n [styles['label-enabled']]: !readOnly && !disabled,\n })}\n hideCaret={true}\n onClick={() => {\n if (!readOnly && !disabled) {\n setIsDropDownOpen(true);\n }\n }}\n disabled={disabled}\n readOnly={readOnly}\n ariaHasPopup=\"true\"\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 {formatDateRange(value, placeholder ?? '', i18nStrings.formatRelativeRange, timeOffset)}\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(baseProps.className, styles.root)}\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 {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 />\n )}\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,uCAAuC,CAAC;AACxE,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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,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,GAChC,CACH,CACQ,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 '../date-picker/calendar/utils/locales';\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 { shiftTimeOffset, setTimeOffset } from './time-offset';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { fireNonCancelableEvent } from '../internal/events/index.js';\nimport { isDevelopment } from '../internal/is-development.js';\nimport { warnOnce } from '../internal/logging.js';\nimport { usePrevious } from '../internal/hooks/use-previous/index.js';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { formatTimezoneOffset, getBrowserTimezoneOffset, isIsoDateOnly } from '../internal/utils/date-time';\n\nexport { DateRangePickerProps };\n\nfunction formatDateRange(\n range: null | DateRangePickerProps.Value,\n placeholder: string,\n formatRelativeRange: DateRangePickerProps.I18nStrings['formatRelativeRange'],\n timeOffset: 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 text={formatAbsoluteRange(range, timeOffset)} />\n );\n\n return (\n <InternalBox fontWeight=\"normal\" display=\"inline\" color=\"inherit\">\n {formatted}\n </InternalBox>\n );\n}\n\nfunction BreakSpaces({ text }: { text: string }) {\n const tokens = text.split(/( )/);\n return (\n <div style={{ whiteSpace: 'nowrap' }}>\n {tokens.map((token, index) => (\n <React.Fragment key={index}>\n {token}\n {token === ' ' && <wbr />}\n </React.Fragment>\n ))}\n </div>\n );\n}\n\nfunction formatAbsoluteRange(value: DateRangePickerProps.AbsoluteValue, timeOffset: number): string {\n const formattedOffset = isDateOnly(value) ? '' : formatTimezoneOffset(timeOffset);\n return value.startDate + formattedOffset + ' ' + '—' + ' ' + value.endDate + formattedOffset;\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\nfunction formatValue(\n value: null | DateRangePickerProps.Value,\n { timeOffset, dateOnly }: { timeOffset: number; dateOnly: boolean }\n): null | DateRangePickerProps.Value {\n if (!value || value.type === 'relative') {\n return value;\n }\n if (dateOnly) {\n return {\n type: 'absolute',\n startDate: value.startDate.split('T')[0],\n endDate: value.endDate.split('T')[0],\n };\n }\n return setTimeOffset(value, timeOffset);\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 = getBrowserTimezoneOffset(),\n timeInputFormat = 'hh:mm:ss',\n expandToViewport = false,\n rangeSelectorMode = 'default',\n ...rest\n }: DateRangePickerProps,\n ref: Ref<DateRangePickerProps.Ref>\n ) => {\n const { __internalRootRef } = useBaseComponent('DateRangePicker');\n checkControlled('DateRangePicker', 'value', value, 'onChange', onChange);\n\n value = isDateOnly(value) ? value : shiftTimeOffset(value, timeOffset);\n\n const baseProps = getBaseProps(rest);\n const { invalid, 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\n useFocusTracker({ rootRef, onBlur, onFocus, viewportId: expandToViewport ? dropdownId : '' });\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 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, { value: formatValue(newValue, { dateOnly, timeOffset }) });\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 trigger = (\n <div className={styles['trigger-wrapper']}>\n <ButtonTrigger\n ref={triggerRef}\n id={controlId}\n invalid={invalid}\n ariaLabel={i18nStrings.ariaLabel}\n ariaDescribedby={ariaDescribedby}\n ariaLabelledby={ariaLabelledby}\n className={clsx(styles.label, {\n [styles['label-enabled']]: !readOnly && !disabled,\n })}\n hideCaret={true}\n onClick={() => {\n if (!readOnly && !disabled) {\n setIsDropDownOpen(true);\n }\n }}\n disabled={disabled}\n readOnly={readOnly}\n ariaHasPopup=\"true\"\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 {formatDateRange(value, placeholder ?? '', i18nStrings.formatRelativeRange, timeOffset)}\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(baseProps.className, styles.root)}\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 {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 />\n )}\n </Dropdown>\n </div>\n );\n }\n);\n\napplyDisplayName(DateRangePicker, 'DateRangePicker');\nexport default DateRangePicker;\n"]}
@@ -1,15 +1,8 @@
1
1
  import { DateRangePickerProps } from './interfaces';
2
- /**
3
- * Returns the time offset of the browser.
4
- *
5
- * I.e. determines the `x` in `current offset = UTC + x`
6
- */
7
- export declare function getBrowserTimezoneOffset(): number;
8
2
  /**
9
3
  * Appends a time zone offset to an offset-less date string.
10
4
  */
11
5
  export declare function setTimeOffset(value: DateRangePickerProps.Value | null, timeOffsetInMinutes: number): DateRangePickerProps.Value | null;
12
- export declare function formatOffset(offsetInMinutes: number): string;
13
6
  /**
14
7
  * Re-formats an absolute date range so that it is expressed using the
15
8
  * target time offset. The returned value still represents the same range
@@ -1 +1 @@
1
- {"version":3,"file":"time-offset.d.ts","sourceRoot":"","sources":["../../../src/date-range-picker/time-offset.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAMpD;;;;GAIG;AACH,wBAAgB,wBAAwB,WAEvC;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,oBAAoB,CAAC,KAAK,GAAG,IAAI,EACxC,mBAAmB,EAAE,MAAM,GAC1B,oBAAoB,CAAC,KAAK,GAAG,IAAI,CAcnC;AAED,wBAAgB,YAAY,CAAC,eAAe,EAAE,MAAM,UAQnD;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,IAAI,GAAG,oBAAoB,CAAC,KAAK,EACxC,mBAAmB,EAAE,MAAM,GAC1B,oBAAoB,CAAC,KAAK,GAAG,IAAI,CA2BnC"}
1
+ {"version":3,"file":"time-offset.d.ts","sourceRoot":"","sources":["../../../src/date-range-picker/time-offset.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAIpD;;GAEG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,oBAAoB,CAAC,KAAK,GAAG,IAAI,EACxC,mBAAmB,EAAE,MAAM,GAC1B,oBAAoB,CAAC,KAAK,GAAG,IAAI,CAcnC;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,IAAI,GAAG,oBAAoB,CAAC,KAAK,EACxC,mBAAmB,EAAE,MAAM,GAC1B,oBAAoB,CAAC,KAAK,GAAG,IAAI,CA2BnC"}
@@ -1,15 +1,5 @@
1
- import { padLeftZeros } from '../internal/components/masked-input/utils/strings';
2
- import { addMinutes } from 'date-fns';
3
- import { formatTime, formatDate } from '../date-picker/calendar/utils/date';
4
1
  import { warnOnce } from '../internal/logging';
5
- /**
6
- * Returns the time offset of the browser.
7
- *
8
- * I.e. determines the `x` in `current offset = UTC + x`
9
- */
10
- export function getBrowserTimezoneOffset() {
11
- return 0 - new Date().getTimezoneOffset();
12
- }
2
+ import { formatTimezoneOffset, shiftTimezoneOffset } from '../internal/utils/date-time';
13
3
  /**
14
4
  * Appends a time zone offset to an offset-less date string.
15
5
  */
@@ -17,7 +7,7 @@ export function setTimeOffset(value, timeOffsetInMinutes) {
17
7
  if (!((value === null || value === void 0 ? void 0 : value.type) === 'absolute')) {
18
8
  return value;
19
9
  }
20
- var offsetSuffix = formatOffset(timeOffsetInMinutes);
10
+ var offsetSuffix = formatTimezoneOffset(timeOffsetInMinutes);
21
11
  var startDate = value.startDate, endDate = value.endDate;
22
12
  return {
23
13
  type: 'absolute',
@@ -25,13 +15,6 @@ export function setTimeOffset(value, timeOffsetInMinutes) {
25
15
  endDate: endDate + offsetSuffix
26
16
  };
27
17
  }
28
- export function formatOffset(offsetInMinutes) {
29
- var hoursOffset = padLeftZeros(Math.floor(Math.abs(offsetInMinutes) / 60).toFixed(0), 2);
30
- var minuteOffset = padLeftZeros(Math.abs(offsetInMinutes % 60).toFixed(0), 2);
31
- var sign = offsetInMinutes < 0 ? '-' : '+';
32
- var offsetSuffix = "".concat(sign).concat(hoursOffset, ":").concat(minuteOffset);
33
- return offsetSuffix;
34
- }
35
18
  /**
36
19
  * Re-formats an absolute date range so that it is expressed using the
37
20
  * target time offset. The returned value still represents the same range
@@ -55,47 +38,8 @@ export function shiftTimeOffset(value, timeOffsetInMinutes) {
55
38
  }
56
39
  return {
57
40
  type: 'absolute',
58
- startDate: doShiftTimeOffset(value.startDate, timeOffsetInMinutes),
59
- endDate: doShiftTimeOffset(value.endDate, timeOffsetInMinutes)
41
+ startDate: shiftTimezoneOffset(value.startDate, timeOffsetInMinutes),
42
+ endDate: shiftTimezoneOffset(value.endDate, timeOffsetInMinutes)
60
43
  };
61
44
  }
62
- /**
63
- * Re-formats an ISO8601 date string so that it is expressed using the
64
- * target time offset. The returned date string still represents the
65
- * same instant in time, but contains no visible offset.
66
- *
67
- * Example:
68
- * ```
69
- * doShiftTimeOffset("2020-01-01T09:00:00+03:00", 2 * 60)
70
- * = "2020-01-01T08:00:00"
71
- * ```
72
- */
73
- function doShiftTimeOffset(value, targetOffsetInMinutes) {
74
- var _a = splitOffset(value), valueWithoutOffset = _a[0], offsetInMinutes = _a[1];
75
- var differenceBetweenValueAndTarget = targetOffsetInMinutes - offsetInMinutes;
76
- var date = new Date(valueWithoutOffset);
77
- var adjustedDate = addMinutes(date, differenceBetweenValueAndTarget);
78
- var formattedDate = formatDate(adjustedDate);
79
- var formattedTime = formatTime(adjustedDate);
80
- return "".concat(formattedDate, "T").concat(formattedTime);
81
- }
82
- /**
83
- * Splits an ISO8601 date string into its timezone-independent part
84
- * and its time offset in minutes.
85
- */
86
- function splitOffset(value) {
87
- var _a = value.split('T'), datePart = _a[0], timePart = _a[1];
88
- var _b = timePart.split(/(-|\+)/), time = _b[0], signCharacter = _b[1], offsetPart = _b[2];
89
- if (signCharacter && offsetPart) {
90
- var _c = offsetPart.split(':'), offsetHours = _c[0], offsetMinutes = _c[1];
91
- var offset = Number(offsetHours) * 60 + Number(offsetMinutes);
92
- var sign = signCharacter === '-' ? -1 : 1;
93
- return ["".concat(datePart, "T").concat(time), offset * sign];
94
- }
95
- var utcTimezoneIndicator = value.indexOf('Z');
96
- if (utcTimezoneIndicator !== -1) {
97
- return [value.substring(0, utcTimezoneIndicator), 0];
98
- }
99
- return [value, getBrowserTimezoneOffset()];
100
- }
101
45
  //# sourceMappingURL=time-offset.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"time-offset.js","sourceRoot":"","sources":["../../../src/date-range-picker/time-offset.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,mDAAmD,CAAC;AACjF,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C;;;;GAIG;AACH,MAAM,UAAU,wBAAwB;IACtC,OAAO,CAAC,GAAG,IAAI,IAAI,EAAE,CAAC,iBAAiB,EAAE,CAAC;AAC5C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa,CAC3B,KAAwC,EACxC,mBAA2B;IAE3B,IA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AAW,QAAA,EAAE,aAAa,QAAyB,CAAC;QAE3D,IAAM,MAAM,GAAG,MAAM,CAAC,WAAW,CAAC,GAAG,EAAE,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC;QAEhE,IAAM,IAAI,GAAG,aAAa,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAE5C,OAAO,CAAC,UAAG,QAAQ,cAAI,IAAI,CAAE,EAAE,MAAM,GAAG,IAAI,CAAU,CAAC;KACxD;IAED,IAAM,oBAAoB,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAChD,IAAI,oBAAoB,KAAK,CAAC,CAAC,EAAE;QAC/B,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,EAAE,oBAAoB,CAAC,EAAE,CAAC,CAAU,CAAC;KAC/D;IAED,OAAO,CAAC,KAAK,EAAE,wBAAwB,EAAE,CAAU,CAAC;AACtD,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { DateRangePickerProps } from './interfaces';\nimport { padLeftZeros } from '../internal/components/masked-input/utils/strings';\nimport { addMinutes } from 'date-fns';\nimport { formatTime, formatDate } from '../date-picker/calendar/utils/date';\nimport { warnOnce } from '../internal/logging';\n\n/**\n * Returns the time offset of the browser.\n *\n * I.e. determines the `x` in `current offset = UTC + x`\n */\nexport function getBrowserTimezoneOffset() {\n return 0 - new Date().getTimezoneOffset();\n}\n\n/**\n * Appends a time zone offset to an offset-less date string.\n */\nexport function setTimeOffset(\n value: DateRangePickerProps.Value | null,\n timeOffsetInMinutes: number\n): DateRangePickerProps.Value | null {\n if (!(value?.type === 'absolute')) {\n return value;\n }\n\n const offsetSuffix = formatOffset(timeOffsetInMinutes);\n\n const { startDate, endDate } = value;\n\n return {\n type: 'absolute',\n startDate: startDate + offsetSuffix,\n endDate: endDate + offsetSuffix,\n };\n}\n\nexport function formatOffset(offsetInMinutes: number) {\n const hoursOffset = padLeftZeros(Math.floor(Math.abs(offsetInMinutes) / 60).toFixed(0), 2);\n const minuteOffset = padLeftZeros(Math.abs(offsetInMinutes % 60).toFixed(0), 2);\n\n const sign = offsetInMinutes < 0 ? '-' : '+';\n const offsetSuffix = `${sign}${hoursOffset}:${minuteOffset}`;\n\n return offsetSuffix;\n}\n\n/**\n * Re-formats an absolute date range so that it is expressed using the\n * target time offset. The returned value still represents the same range\n * in time, but contains no visible offset.\n */\nexport function shiftTimeOffset(\n value: null | DateRangePickerProps.Value,\n timeOffsetInMinutes: number\n): DateRangePickerProps.Value | null {\n if (!value || value.type !== 'absolute') {\n return value;\n }\n\n /*\n This regex matches an ISO date-time with\n - optional seconds;\n - optional milliseconds;\n - optional time offset or 'Z'.\n */\n const dateTimeRegex = /^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2})?(\\.\\d{1,3})?(((\\+|-)\\d{2}(:\\d{2})?)|Z)?$/;\n\n if (!dateTimeRegex.test(value.startDate) || !dateTimeRegex.test(value.endDate)) {\n warnOnce(\n 'DateRangePicker',\n 'You have provided a misformatted start or end date. The component will fall back to an empty value. ' +\n 'Dates have to be ISO8601-formatted with an optional time zone offset.'\n );\n return null;\n }\n\n return {\n type: 'absolute',\n startDate: doShiftTimeOffset(value.startDate, timeOffsetInMinutes),\n endDate: doShiftTimeOffset(value.endDate, timeOffsetInMinutes),\n };\n}\n\n/**\n * Re-formats an ISO8601 date string so that it is expressed using the\n * target time offset. The returned date string still represents the\n * same instant in time, but contains no visible offset.\n *\n * Example:\n * ```\n * doShiftTimeOffset(\"2020-01-01T09:00:00+03:00\", 2 * 60)\n * = \"2020-01-01T08:00:00\"\n * ```\n */\nfunction doShiftTimeOffset(value: string, targetOffsetInMinutes: number) {\n const [valueWithoutOffset, offsetInMinutes] = splitOffset(value);\n\n const differenceBetweenValueAndTarget = targetOffsetInMinutes - offsetInMinutes;\n\n const date = new Date(valueWithoutOffset);\n const adjustedDate = addMinutes(date, differenceBetweenValueAndTarget);\n\n const formattedDate = formatDate(adjustedDate);\n const formattedTime = formatTime(adjustedDate);\n\n return `${formattedDate}T${formattedTime}`;\n}\n\n/**\n * Splits an ISO8601 date string into its timezone-independent part\n * and its time offset in minutes.\n */\nfunction splitOffset(value: string) {\n const [datePart, timePart] = value.split('T');\n const [time, signCharacter, offsetPart] = timePart.split(/(-|\\+)/);\n\n if (signCharacter && offsetPart) {\n const [offsetHours, offsetMinutes] = offsetPart.split(':');\n\n const offset = Number(offsetHours) * 60 + Number(offsetMinutes);\n\n const sign = signCharacter === '-' ? -1 : 1;\n\n return [`${datePart}T${time}`, offset * sign] as const;\n }\n\n const utcTimezoneIndicator = value.indexOf('Z');\n if (utcTimezoneIndicator !== -1) {\n return [value.substring(0, utcTimezoneIndicator), 0] as const;\n }\n\n return [value, getBrowserTimezoneOffset()] as const;\n}\n"]}
1
+ {"version":3,"file":"time-offset.js","sourceRoot":"","sources":["../../../src/date-range-picker/time-offset.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAExF;;GAEG;AACH,MAAM,UAAU,aAAa,CAC3B,KAAwC,EACxC,mBAA2B;IAE3B,IAAI,CAAC,CAAC,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,IAAI,MAAK,UAAU,CAAC,EAAE;QACjC,OAAO,KAAK,CAAC;KACd;IAED,IAAM,YAAY,GAAG,oBAAoB,CAAC,mBAAmB,CAAC,CAAC;IAEvD,IAAA,SAAS,GAAc,KAAK,UAAnB,EAAE,OAAO,GAAK,KAAK,QAAV,CAAW;IAErC,OAAO;QACL,IAAI,EAAE,UAAU;QAChB,SAAS,EAAE,SAAS,GAAG,YAAY;QACnC,OAAO,EAAE,OAAO,GAAG,YAAY;KAChC,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAC7B,KAAwC,EACxC,mBAA2B;IAE3B,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,UAAU,EAAE;QACvC,OAAO,KAAK,CAAC;KACd;IAED;;;;;MAKE;IACF,IAAM,aAAa,GAAG,iFAAiF,CAAC;IAExG,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE;QAC9E,QAAQ,CACN,iBAAiB,EACjB,sGAAsG;YACpG,uEAAuE,CAC1E,CAAC;QACF,OAAO,IAAI,CAAC;KACb;IAED,OAAO;QACL,IAAI,EAAE,UAAU;QAChB,SAAS,EAAE,mBAAmB,CAAC,KAAK,CAAC,SAAS,EAAE,mBAAmB,CAAC;QACpE,OAAO,EAAE,mBAAmB,CAAC,KAAK,CAAC,OAAO,EAAE,mBAAmB,CAAC;KACjE,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { DateRangePickerProps } from './interfaces';\nimport { warnOnce } from '../internal/logging';\nimport { formatTimezoneOffset, shiftTimezoneOffset } from '../internal/utils/date-time';\n\n/**\n * Appends a time zone offset to an offset-less date string.\n */\nexport function setTimeOffset(\n value: DateRangePickerProps.Value | null,\n timeOffsetInMinutes: number\n): DateRangePickerProps.Value | null {\n if (!(value?.type === 'absolute')) {\n return value;\n }\n\n const offsetSuffix = formatTimezoneOffset(timeOffsetInMinutes);\n\n const { startDate, endDate } = value;\n\n return {\n type: 'absolute',\n startDate: startDate + offsetSuffix,\n endDate: endDate + offsetSuffix,\n };\n}\n\n/**\n * Re-formats an absolute date range so that it is expressed using the\n * target time offset. The returned value still represents the same range\n * in time, but contains no visible offset.\n */\nexport function shiftTimeOffset(\n value: null | DateRangePickerProps.Value,\n timeOffsetInMinutes: number\n): DateRangePickerProps.Value | null {\n if (!value || value.type !== 'absolute') {\n return value;\n }\n\n /*\n This regex matches an ISO date-time with\n - optional seconds;\n - optional milliseconds;\n - optional time offset or 'Z'.\n */\n const dateTimeRegex = /^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2})?(\\.\\d{1,3})?(((\\+|-)\\d{2}(:\\d{2})?)|Z)?$/;\n\n if (!dateTimeRegex.test(value.startDate) || !dateTimeRegex.test(value.endDate)) {\n warnOnce(\n 'DateRangePicker',\n 'You have provided a misformatted start or end date. The component will fall back to an empty value. ' +\n 'Dates have to be ISO8601-formatted with an optional time zone offset.'\n );\n return null;\n }\n\n return {\n type: 'absolute',\n startDate: shiftTimezoneOffset(value.startDate, timeOffsetInMinutes),\n endDate: shiftTimezoneOffset(value.endDate, timeOffsetInMinutes),\n };\n}\n"]}
package/icon/icons.js CHANGED
@@ -1,3 +1,3 @@
1
1
  export default {
2
- "add-plus": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path d=\"M8 1v14M15 8H1\"/></svg>","angle-down": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path d=\"m1 4 7 7 7-7\"/></svg>","angle-left-double": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path d=\"M14 1 7 8l7 7\"/><path d=\"M9 1 2 8l7 7\"/></svg>","angle-left": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path d=\"M12 1 5 8l7 7\"/></svg>","angle-right-double": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path d=\"m2 1 7 7-7 7\"/><path d=\"m7 1 7 7-7 7\"/></svg>","angle-right": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path d=\"m4 1 7 7-7 7\"/></svg>","angle-up": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path d=\"m1 12 7-7 7 7\"/></svg>","arrow-left": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path d=\"M9 1 2 8l7 7M2 8h13\"/></svg>","bug": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path class=\"stroke-linejoin-round\" d=\"M5 5h6a1 1 0 0 1 1 1v5.5A3.5 3.5 0 0 1 8.5 15h-1A3.5 3.5 0 0 1 4 11.5V6a1 1 0 0 1 1-1ZM5 5a3 3 0 0 1 6 0\"/><path d=\"M12 9h3M1 9h3M12 12h2l1 2M4 12H2l-1 2M12 6h2l1-2M4 6H2L1 4\"/></svg>","calendar": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path class=\"stroke-linejoin-round\" d=\"M2 2h12v12H2z\"/><path d=\"M4.99 8H5v.01h-.01zM7.99 8H8v.01h-.01zM10.99 8H11v.01h-.01zM4.99 5H5v.01h-.01zM7.99 5H8v.01h-.01zM10.99 5H11v.01h-.01zM4.99 11H5v.01h-.01zM7.99 11H8v.01h-.01z\"/></svg>","call": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path d=\"M9 2c2.8 0 5 2.2 5 5M7.9 13c1.3 1.3 3.5 1.3 4.8 0l1-1c.4-.4.4-1 0-1.4l-1.5-1.5c-.3-.3-1-.2-1.3.1l-.1.1c-.5.5-1.4.5-2 0L6.6 7.2c-.5-.5-.5-1.4 0-2l.1-.1c.3-.3.4-1 .1-1.3L5.3 2.3c-.3-.4-1-.4-1.3 0l-1 1C1.7 4.6 1.7 6.7 3 8.1L7.9 13z\"/></svg>","caret-down-filled": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path class=\"filled stroke-linejoin-round\" d=\"M4 5h8l-4 6-4-6z\"/></svg>","caret-down": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path class=\"stroke-linejoin-round\" d=\"M4 5h8l-4 6-4-6z\"/></svg>","caret-left-filled": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path class=\"filled stroke-linejoin-round\" d=\"M11 4v8L5 8l6-4z\"/></svg>","caret-right-filled": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path class=\"filled stroke-linejoin-round\" d=\"M5 4v8l6-4-6-4z\"/></svg>","caret-up-filled": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path class=\"filled stroke-linejoin-round\" d=\"M4 11h8L8 5l-4 6z\"/></svg>","caret-up": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path class=\"stroke-linejoin-round\" d=\"M4 11h8L8 5l-4 6z\"/></svg>","close": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path d=\"m2 2 12 12M14 2 2 14\"/></svg>","contact": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path class=\"stroke-linejoin-round stroke-linecap-round\" d=\"M2 12.286h5.143L8.857 14l1.714-1.714H14V2H2v10.286z\"/><path class=\"stroke-linecap-round\" d=\"M4.99 7H5v.01h-.01zM7.99 7H8v.01h-.01zM10.99 7H11v.01h-.01z\"/></svg>","copy": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path class=\"stroke-linejoin-round\" d=\"M2 5h9v9H2z\"/><path class=\"stroke-linejoin-round\" d=\"M5 5V2h9v9h-3\"/></svg>","download": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path class=\"stroke-linejoin-round\" d=\"M11 2h3v12H2V2h3\"/><path d=\"m4 6 4 4 4-4M8 1v9\"/></svg>","edit": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path class=\"stroke-linejoin-round\" d=\"M13 8v6H3V2h6.5M6 10l8-8\"/></svg>","ellipsis": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><circle class=\"filled\" cx=\"8\" cy=\"2.5\" r=\".5\"/><circle class=\"filled\" cx=\"8\" cy=\"8\" r=\".5\"/><circle class=\"filled\" cx=\"8\" cy=\"13.5\" r=\".5\"/></svg>","envelope": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path class=\"stroke-linejoin-round\" d=\"M1 2h14v12H1z\"/><path class=\"stroke-linejoin-round\" d=\"m1 4 7 6 7-6\"/></svg>","expand": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path d=\"M9 2h5v5M7 2H2v5M7 14H2V9M9 14h5V9M2 2l12 12M14 2 2 14\"/></svg>","external": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path class=\"stroke-linecap-square\" d=\"M10 2h4v4\"/><path d=\"m6 10 8-8\"/><path class=\"stroke-linejoin-round\" d=\"M14 9.048V14H2V2h5\"/></svg>","file-open": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path d=\"M8 1v4a1 1 0 0 0 1 1h4\"/><path class=\"stroke-linejoin-round\" d=\"M3 15h10V5L9 1H3v14z\"/><path d=\"m3 8 7 7\"/></svg>","file": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path class=\"stroke-linejoin-round\" d=\"M8 1v5h5\"/><path class=\"stroke-linejoin-round\" d=\"M3 15V1h6l4 4v10H3z\"/></svg>","filter": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path class=\"stroke-linejoin-round\" d=\"M15 2H1l5 6v7h4V8l5-6z\"/></svg>","folder-open": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path class=\"stroke-linejoin-round\" d=\"M2 7V2h7l1 2h5v9a1 1 0 0 1-1 1H3L1 7h10l2.006 7\"/></svg>","folder": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path class=\"stroke-linejoin-round\" d=\"M14 14H2V2h5.143L9 5h5v9z\"/></svg>","heart": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path d=\"M13.92 3.061a3.729 3.729 0 0 0-5.21 0L8 3.76l-.71-.699a3.729 3.729 0 0 0-5.21 0 3.58 3.58 0 0 0 0 5.123l5.21 5.124.003-.004L8 14l.707-.696.004.004 5.21-5.124a3.58 3.58 0 0 0 0-5.123Z\"/></svg>","key": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path class=\"stroke-linejoin-round\" d=\"M9 10a5.023 5.023 0 0 1 0 1 3.996 3.996 0 1 1-3-3.874L13 1h2v5h-2v2h-2l.016 1.983Z\"/><path d=\"M4.99 11H5v.01h-.01z\"/></svg>","lock-private": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path class=\"stroke-linejoin-round\" d=\"M2 7h12v7H2z\"/><path d=\"M4 7V5a4 4 0 0 1 8 0v2\"/></svg>","menu": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path d=\"M15 8H1M15 3H1M15 13H1\"/></svg>","microphone": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><rect class=\"stroke-linejoin-round\" x=\"6\" y=\"1\" width=\"4\" height=\"8\" rx=\"2\"/><path class=\"stroke-linejoin-round\" d=\"M3 6v1a5 5 0 0 0 10 0V6M8 12v3M3 15h10\"/></svg>","notification": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path class=\"stroke-linejoin-round\" d=\"M8 2.167c-3.5 0-3.5 4.666-3.5 4.666L1 11.5h14l-3.5-4.667s0-4.666-3.5-4.666ZM5.667 11.5v1.167a2.333 2.333 0 0 0 4.666 0V11.5\"/><path class=\"stroke-linecap-round\" d=\"M8 1v1.167\"/></svg>","redo": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path class=\"stroke-linejoin-round\" d=\"M12 5H6.38c-4.5 0-4.5 8 0 8H13\"/><path class=\"stroke-linejoin-round\" d=\"m10 8 3-3-3-3\"/></svg>","refresh": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path d=\"M10 5h5V0\"/><path d=\"M15 8a6.957 6.957 0 0 1-7 7 6.957 6.957 0 0 1-7-7 6.957 6.957 0 0 1 7-7 6.87 6.87 0 0 1 6.3 4\"/></svg>","search": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><circle cx=\"7\" cy=\"7\" r=\"5\"/><path d=\"m15 15-4.5-4.5\"/></svg>","settings": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path d=\"M13.33 5.792a1.942 1.942 0 0 1 .287-1.97 6.984 6.984 0 0 0-1.44-1.439 1.943 1.943 0 0 1-3.159-1.308 6.965 6.965 0 0 0-2.037 0 1.943 1.943 0 0 1-3.158 1.308 6.962 6.962 0 0 0-1.44 1.44 1.943 1.943 0 0 1-1.308 3.158 6.972 6.972 0 0 0 0 2.037 1.943 1.943 0 0 1 1.308 3.159 6.952 6.952 0 0 0 1.44 1.44 1.942 1.942 0 0 1 3.159 1.308 6.962 6.962 0 0 0 2.036 0 1.942 1.942 0 0 1 3.159-1.308 6.974 6.974 0 0 0 1.44-1.44 1.943 1.943 0 0 1 1.308-3.159 6.974 6.974 0 0 0 0-2.037 1.942 1.942 0 0 1-1.596-1.189Z\"/><circle cx=\"8\" cy=\"8\" r=\"2\"/></svg>","share": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><circle cx=\"11\" cy=\"4\" r=\"2\"/><circle cx=\"4\" cy=\"8\" r=\"2\"/><circle cx=\"11\" cy=\"12\" r=\"2\"/><path d=\"M9.2 4.9 5.8 7.1M9.2 11.1 5.8 8.9\"/></svg>","status-in-progress": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><circle class=\"stroke-linejoin-round\" cx=\"8\" cy=\"8\" r=\"7\"/><path class=\"stroke-linecap-round\" d=\"M4.99 7.995H5v.01h-.01zM7.99 7.995H8v.01h-.01zM10.99 7.995H11v.01h-.01z\"/></svg>","status-info": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><circle class=\"stroke-linejoin-round\" cx=\"8\" cy=\"8\" r=\"7\"/><path d=\"M8 11V8H6\"/><path class=\"stroke-linejoin-round\" d=\"M10 11H6\"/><path d=\"M7.99 5H8v.01h-.01z\"/></svg>","status-negative": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><circle class=\"stroke-linejoin-round\" cx=\"8\" cy=\"8\" r=\"7\"/><path d=\"m10.828 5.172-5.656 5.656M10.828 10.828 5.172 5.172\"/></svg>","status-pending": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><circle class=\"stroke-linejoin-round\" cx=\"8\" cy=\"8\" r=\"7\"/><path class=\"stroke-linecap-square\" d=\"M8 5v4H5\"/></svg>","status-positive": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><circle class=\"stroke-linejoin-round\" cx=\"8\" cy=\"8\" r=\"7\"/><path class=\"stroke-linecap-square\" d=\"m5 8 2 2 3.521-3.521\"/></svg>","status-stopped": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><circle class=\"stroke-linejoin-round\" cx=\"8\" cy=\"8\" r=\"7\"/><path class=\"stroke-linecap-square\" d=\"M11 8H5\"/></svg>","status-warning": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path class=\"stroke-linejoin-round\" d=\"m8 1 7 14H1L8 1z\"/><path d=\"M7.99 12H8v.01h-.01zM8 6v4\"/></svg>","treeview-collapse": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path class=\"stroke-linejoin-round\" d=\"M5 8h6M2 2h12v12H2z\"/></svg>","treeview-expand": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path class=\"stroke-linejoin-round\" d=\"M5 8h6M8 11V5M2 2h12v12H2z\"/></svg>","undo": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path class=\"stroke-linejoin-round\" d=\"M4 13h5.625c4.5 0 4.5-8 0-8H3\"/><path class=\"stroke-linejoin-round\" d=\"M6 2 3 5l3 3\"/></svg>","unlocked": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path class=\"stroke-linejoin-round\" d=\"M2 7h12v7H2z\"/><path d=\"M11.874 4A4 4 0 0 0 4 5v2\"/></svg>","upload": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path class=\"stroke-linejoin-round\" d=\"M5 14H2V2h12v12h-3\"/><path d=\"M12 10 8 6l-4 4M8 6v9\"/></svg>","user-profile": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path class=\"stroke-linejoin-round\" d=\"M4.61 4.39C4.61 2.52 6.13 1 8 1s3.39 1.52 3.39 3.39S9.87 7.78 8 7.78 4.61 6.26 4.61 4.39M2.05 14.08h11.91c0-2.25-1.17-4.23-2.9-5.3A5.77 5.77 0 0 0 8 7.91c-3.29 0-5.95 2.76-5.95 6.17z\"/></svg>","view-full": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path class=\"filled\" d=\"M5 5h6v6H5z\"/><path class=\"stroke-linejoin-round\" d=\"M2 2h12v12H2z\"/></svg>","view-horizontal": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path class=\"filled\" d=\"M5 9h6v2H5z\"/><path class=\"stroke-linejoin-round\" d=\"M2 2h12v12H2z\"/></svg>","view-vertical": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path class=\"filled\" d=\"M11 5v6H9V5z\"/><path class=\"stroke-linejoin-round\" d=\"M2 2h12v12H2z\"/></svg>","zoom-in": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><circle cx=\"6.885\" cy=\"6.885\" r=\"5.385\"/><path d=\"m14.5 14.5-3.846-3.846M7 4v6M10 7H4\"/></svg>","zoom-out": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><circle cx=\"6.885\" cy=\"6.885\" r=\"5.385\"/><path d=\"m14.5 14.5-3.846-3.846M10 7H4\"/></svg>"
2
+ "add-plus": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path d=\"M8 1v14M15 8H1\"/></svg>","angle-down": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path d=\"m1 4 7 7 7-7\"/></svg>","angle-left-double": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path d=\"M14 1 7 8l7 7\"/><path d=\"M9 1 2 8l7 7\"/></svg>","angle-left": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path d=\"M12 1 5 8l7 7\"/></svg>","angle-right-double": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path d=\"m2 1 7 7-7 7\"/><path d=\"m7 1 7 7-7 7\"/></svg>","angle-right": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path d=\"m4 1 7 7-7 7\"/></svg>","angle-up": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path d=\"m1 12 7-7 7 7\"/></svg>","arrow-left": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path d=\"M9 1 2 8l7 7M2 8h13\"/></svg>","bug": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path class=\"stroke-linejoin-round\" d=\"M5 5h6a1 1 0 0 1 1 1v5.5A3.5 3.5 0 0 1 8.5 15h-1A3.5 3.5 0 0 1 4 11.5V6a1 1 0 0 1 1-1ZM5 5a3 3 0 0 1 6 0\"/><path d=\"M12 9h3M1 9h3M12 12h2l1 2M4 12H2l-1 2M12 6h2l1-2M4 6H2L1 4\"/></svg>","calendar": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path class=\"stroke-linejoin-round\" d=\"M2 2h12v12H2z\"/><path d=\"M4.99 8H5v.01h-.01zM7.99 8H8v.01h-.01zM10.99 8H11v.01h-.01zM4.99 5H5v.01h-.01zM7.99 5H8v.01h-.01zM10.99 5H11v.01h-.01zM4.99 11H5v.01h-.01zM7.99 11H8v.01h-.01z\"/></svg>","call": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path d=\"M9 2c2.8 0 5 2.2 5 5M7.9 13c1.3 1.3 3.5 1.3 4.8 0l1-1c.4-.4.4-1 0-1.4l-1.5-1.5c-.3-.3-1-.2-1.3.1l-.1.1c-.5.5-1.4.5-2 0L6.6 7.2c-.5-.5-.5-1.4 0-2l.1-.1c.3-.3.4-1 .1-1.3L5.3 2.3c-.3-.4-1-.4-1.3 0l-1 1C1.7 4.6 1.7 6.7 3 8.1L7.9 13z\"/></svg>","caret-down-filled": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path class=\"filled stroke-linejoin-round\" d=\"M4 5h8l-4 6-4-6z\"/></svg>","caret-down": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path class=\"stroke-linejoin-round\" d=\"M4 5h8l-4 6-4-6z\"/></svg>","caret-left-filled": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path class=\"filled stroke-linejoin-round\" d=\"M11 4v8L5 8l6-4z\"/></svg>","caret-right-filled": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path class=\"filled stroke-linejoin-round\" d=\"M5 4v8l6-4-6-4z\"/></svg>","caret-up-filled": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path class=\"filled stroke-linejoin-round\" d=\"M4 11h8L8 5l-4 6z\"/></svg>","caret-up": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path class=\"stroke-linejoin-round\" d=\"M4 11h8L8 5l-4 6z\"/></svg>","check": "<svg viewBox=\"0 0 16 16\" xmlns=\"http://www.w3.org/2000/svg\" focusable=\"false\" aria-hidden=\"true\"><path d=\"m14.254 4.254-8.25 8.25L6 12.5l-.004.004-4.25-4.25.008-.008L6 12.493l8.246-8.247.008.008Z\"/></svg>","close": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path d=\"m2 2 12 12M14 2 2 14\"/></svg>","contact": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path class=\"stroke-linejoin-round stroke-linecap-round\" d=\"M2 12.286h5.143L8.857 14l1.714-1.714H14V2H2v10.286z\"/><path class=\"stroke-linecap-round\" d=\"M4.99 7H5v.01h-.01zM7.99 7H8v.01h-.01zM10.99 7H11v.01h-.01z\"/></svg>","copy": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path class=\"stroke-linejoin-round\" d=\"M2 5h9v9H2z\"/><path class=\"stroke-linejoin-round\" d=\"M5 5V2h9v9h-3\"/></svg>","download": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path class=\"stroke-linejoin-round\" d=\"M11 2h3v12H2V2h3\"/><path d=\"m4 6 4 4 4-4M8 1v9\"/></svg>","edit": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path class=\"stroke-linejoin-round\" d=\"M13 8v6H3V2h6.5M6 10l8-8\"/></svg>","ellipsis": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><circle class=\"filled\" cx=\"8\" cy=\"2.5\" r=\".5\"/><circle class=\"filled\" cx=\"8\" cy=\"8\" r=\".5\"/><circle class=\"filled\" cx=\"8\" cy=\"13.5\" r=\".5\"/></svg>","envelope": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path class=\"stroke-linejoin-round\" d=\"M1 2h14v12H1z\"/><path class=\"stroke-linejoin-round\" d=\"m1 4 7 6 7-6\"/></svg>","expand": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path d=\"M9 2h5v5M7 2H2v5M7 14H2V9M9 14h5V9M2 2l12 12M14 2 2 14\"/></svg>","external": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path class=\"stroke-linecap-square\" d=\"M10 2h4v4\"/><path d=\"m6 10 8-8\"/><path class=\"stroke-linejoin-round\" d=\"M14 9.048V14H2V2h5\"/></svg>","file-open": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path d=\"M8 1v4a1 1 0 0 0 1 1h4\"/><path class=\"stroke-linejoin-round\" d=\"M3 15h10V5L9 1H3v14z\"/><path d=\"m3 8 7 7\"/></svg>","file": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path class=\"stroke-linejoin-round\" d=\"M8 1v5h5\"/><path class=\"stroke-linejoin-round\" d=\"M3 15V1h6l4 4v10H3z\"/></svg>","filter": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path class=\"stroke-linejoin-round\" d=\"M15 2H1l5 6v7h4V8l5-6z\"/></svg>","folder-open": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path class=\"stroke-linejoin-round\" d=\"M2 7V2h7l1 2h5v9a1 1 0 0 1-1 1H3L1 7h10l2.006 7\"/></svg>","folder": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path class=\"stroke-linejoin-round\" d=\"M14 14H2V2h5.143L9 5h5v9z\"/></svg>","heart": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path d=\"M13.92 3.061a3.729 3.729 0 0 0-5.21 0L8 3.76l-.71-.699a3.729 3.729 0 0 0-5.21 0 3.58 3.58 0 0 0 0 5.123l5.21 5.124.003-.004L8 14l.707-.696.004.004 5.21-5.124a3.58 3.58 0 0 0 0-5.123Z\"/></svg>","key": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path class=\"stroke-linejoin-round\" d=\"M9 10a5.023 5.023 0 0 1 0 1 3.996 3.996 0 1 1-3-3.874L13 1h2v5h-2v2h-2l.016 1.983Z\"/><path d=\"M4.99 11H5v.01h-.01z\"/></svg>","lock-private": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path class=\"stroke-linejoin-round\" d=\"M2 7h12v7H2z\"/><path d=\"M4 7V5a4 4 0 0 1 8 0v2\"/></svg>","menu": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path d=\"M15 8H1M15 3H1M15 13H1\"/></svg>","microphone": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><rect class=\"stroke-linejoin-round\" x=\"6\" y=\"1\" width=\"4\" height=\"8\" rx=\"2\"/><path class=\"stroke-linejoin-round\" d=\"M3 6v1a5 5 0 0 0 10 0V6M8 12v3M3 15h10\"/></svg>","notification": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path class=\"stroke-linejoin-round\" d=\"M8 2.167c-3.5 0-3.5 4.666-3.5 4.666L1 11.5h14l-3.5-4.667s0-4.666-3.5-4.666ZM5.667 11.5v1.167a2.333 2.333 0 0 0 4.666 0V11.5\"/><path class=\"stroke-linecap-round\" d=\"M8 1v1.167\"/></svg>","redo": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path class=\"stroke-linejoin-round\" d=\"M12 5H6.38c-4.5 0-4.5 8 0 8H13\"/><path class=\"stroke-linejoin-round\" d=\"m10 8 3-3-3-3\"/></svg>","refresh": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path d=\"M10 5h5V0\"/><path d=\"M15 8a6.957 6.957 0 0 1-7 7 6.957 6.957 0 0 1-7-7 6.957 6.957 0 0 1 7-7 6.87 6.87 0 0 1 6.3 4\"/></svg>","search": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><circle cx=\"7\" cy=\"7\" r=\"5\"/><path d=\"m15 15-4.5-4.5\"/></svg>","settings": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path d=\"M13.33 5.792a1.942 1.942 0 0 1 .287-1.97 6.984 6.984 0 0 0-1.44-1.439 1.943 1.943 0 0 1-3.159-1.308 6.965 6.965 0 0 0-2.037 0 1.943 1.943 0 0 1-3.158 1.308 6.962 6.962 0 0 0-1.44 1.44 1.943 1.943 0 0 1-1.308 3.158 6.972 6.972 0 0 0 0 2.037 1.943 1.943 0 0 1 1.308 3.159 6.952 6.952 0 0 0 1.44 1.44 1.942 1.942 0 0 1 3.159 1.308 6.962 6.962 0 0 0 2.036 0 1.942 1.942 0 0 1 3.159-1.308 6.974 6.974 0 0 0 1.44-1.44 1.943 1.943 0 0 1 1.308-3.159 6.974 6.974 0 0 0 0-2.037 1.942 1.942 0 0 1-1.596-1.189Z\"/><circle cx=\"8\" cy=\"8\" r=\"2\"/></svg>","share": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><circle cx=\"11\" cy=\"4\" r=\"2\"/><circle cx=\"4\" cy=\"8\" r=\"2\"/><circle cx=\"11\" cy=\"12\" r=\"2\"/><path d=\"M9.2 4.9 5.8 7.1M9.2 11.1 5.8 8.9\"/></svg>","status-in-progress": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><circle class=\"stroke-linejoin-round\" cx=\"8\" cy=\"8\" r=\"7\"/><path class=\"stroke-linecap-round\" d=\"M4.99 7.995H5v.01h-.01zM7.99 7.995H8v.01h-.01zM10.99 7.995H11v.01h-.01z\"/></svg>","status-info": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><circle class=\"stroke-linejoin-round\" cx=\"8\" cy=\"8\" r=\"7\"/><path d=\"M8 11V8H6\"/><path class=\"stroke-linejoin-round\" d=\"M10 11H6\"/><path d=\"M7.99 5H8v.01h-.01z\"/></svg>","status-negative": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><circle class=\"stroke-linejoin-round\" cx=\"8\" cy=\"8\" r=\"7\"/><path d=\"m10.828 5.172-5.656 5.656M10.828 10.828 5.172 5.172\"/></svg>","status-pending": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><circle class=\"stroke-linejoin-round\" cx=\"8\" cy=\"8\" r=\"7\"/><path class=\"stroke-linecap-square\" d=\"M8 5v4H5\"/></svg>","status-positive": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><circle class=\"stroke-linejoin-round\" cx=\"8\" cy=\"8\" r=\"7\"/><path class=\"stroke-linecap-square\" d=\"m5 8 2 2 3.521-3.521\"/></svg>","status-stopped": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><circle class=\"stroke-linejoin-round\" cx=\"8\" cy=\"8\" r=\"7\"/><path class=\"stroke-linecap-square\" d=\"M11 8H5\"/></svg>","status-warning": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path class=\"stroke-linejoin-round\" d=\"m8 1 7 14H1L8 1z\"/><path d=\"M7.99 12H8v.01h-.01zM8 6v4\"/></svg>","treeview-collapse": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path class=\"stroke-linejoin-round\" d=\"M5 8h6M2 2h12v12H2z\"/></svg>","treeview-expand": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path class=\"stroke-linejoin-round\" d=\"M5 8h6M8 11V5M2 2h12v12H2z\"/></svg>","undo": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path class=\"stroke-linejoin-round\" d=\"M4 13h5.625c4.5 0 4.5-8 0-8H3\"/><path class=\"stroke-linejoin-round\" d=\"M6 2 3 5l3 3\"/></svg>","unlocked": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path class=\"stroke-linejoin-round\" d=\"M2 7h12v7H2z\"/><path d=\"M11.874 4A4 4 0 0 0 4 5v2\"/></svg>","upload": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path class=\"stroke-linejoin-round\" d=\"M5 14H2V2h12v12h-3\"/><path d=\"M12 10 8 6l-4 4M8 6v9\"/></svg>","user-profile": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path class=\"stroke-linejoin-round\" d=\"M4.61 4.39C4.61 2.52 6.13 1 8 1s3.39 1.52 3.39 3.39S9.87 7.78 8 7.78 4.61 6.26 4.61 4.39M2.05 14.08h11.91c0-2.25-1.17-4.23-2.9-5.3A5.77 5.77 0 0 0 8 7.91c-3.29 0-5.95 2.76-5.95 6.17z\"/></svg>","view-full": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path class=\"filled\" d=\"M5 5h6v6H5z\"/><path class=\"stroke-linejoin-round\" d=\"M2 2h12v12H2z\"/></svg>","view-horizontal": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path class=\"filled\" d=\"M5 9h6v2H5z\"/><path class=\"stroke-linejoin-round\" d=\"M2 2h12v12H2z\"/></svg>","view-vertical": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><path class=\"filled\" d=\"M11 5v6H9V5z\"/><path class=\"stroke-linejoin-round\" d=\"M2 2h12v12H2z\"/></svg>","zoom-in": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><circle cx=\"6.885\" cy=\"6.885\" r=\"5.385\"/><path d=\"m14.5 14.5-3.846-3.846M7 4v6M10 7H4\"/></svg>","zoom-out": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" focusable=\"false\" aria-hidden=\"true\"><circle cx=\"6.885\" cy=\"6.885\" r=\"5.385\"/><path d=\"m14.5 14.5-3.846-3.846M10 7H4\"/></svg>"
3
3
  }
@@ -55,7 +55,7 @@ export interface IconProps extends BaseComponentProps {
55
55
  svg?: React.ReactNode;
56
56
  }
57
57
  export declare namespace IconProps {
58
- type Name = 'add-plus' | 'angle-left-double' | 'angle-left' | 'angle-right-double' | 'angle-right' | 'angle-up' | 'angle-down' | 'arrow-left' | 'bug' | 'call' | 'calendar' | 'caret-down-filled' | 'caret-down' | 'caret-left-filled' | 'caret-right-filled' | 'caret-up-filled' | 'caret-up' | 'contact' | 'close' | 'copy' | 'download' | 'edit' | 'ellipsis' | 'envelope' | 'expand' | 'external' | 'file-open' | 'file' | 'filter' | 'folder-open' | 'folder' | 'heart' | 'key' | 'lock-private' | 'menu' | 'microphone' | 'notification' | 'redo' | 'refresh' | 'search' | 'settings' | 'share' | 'status-in-progress' | 'status-info' | 'status-negative' | 'status-pending' | 'status-positive' | 'status-stopped' | 'status-warning' | 'treeview-collapse' | 'treeview-expand' | 'undo' | 'unlocked' | 'upload' | 'user-profile' | 'view-full' | 'view-horizontal' | 'view-vertical' | 'zoom-in' | 'zoom-out';
58
+ type Name = 'add-plus' | 'angle-left-double' | 'angle-left' | 'angle-right-double' | 'angle-right' | 'angle-up' | 'angle-down' | 'arrow-left' | 'bug' | 'call' | 'calendar' | 'caret-down-filled' | 'caret-down' | 'caret-left-filled' | 'caret-right-filled' | 'caret-up-filled' | 'caret-up' | 'check' | 'contact' | 'close' | 'copy' | 'download' | 'edit' | 'ellipsis' | 'envelope' | 'expand' | 'external' | 'file-open' | 'file' | 'filter' | 'folder-open' | 'folder' | 'heart' | 'key' | 'lock-private' | 'menu' | 'microphone' | 'notification' | 'redo' | 'refresh' | 'search' | 'settings' | 'share' | 'status-in-progress' | 'status-info' | 'status-negative' | 'status-pending' | 'status-positive' | 'status-stopped' | 'status-warning' | 'treeview-collapse' | 'treeview-expand' | 'undo' | 'unlocked' | 'upload' | 'user-profile' | 'view-full' | 'view-horizontal' | 'view-vertical' | 'zoom-in' | 'zoom-out';
59
59
  type Variant = 'normal' | 'disabled' | 'error' | 'inverted' | 'link' | 'subtle' | 'success' | 'warning';
60
60
  type Size = 'small' | 'normal' | 'medium' | 'big' | 'large' | 'inherit';
61
61
  }
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/icon/interfaces.ts"],"names":[],"mappings":"AAEA,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AW,GACX,MAAM,GACN,QAAQ,GACR,aAAa,GACb,QAAQ,GACR,OAAO,GACP,KAAK,GACL,cAAc,GACd,MAAM,GACN,YAAY,GACZ,cAAc,GACd,MAAM,GACN,SAAS,GACT,QAAQ,GACR,UAAU,GACV,OAAO,GACP,oBAAoB,GACpB,aAAa,GACb,iBAAiB,GACjB,gBAAgB,GAChB,iBAAiB,GACjB,gBAAgB,GAChB,gBAAgB,GAChB,mBAAmB,GACnB,iBAAiB,GACjB,MAAM,GACN,UAAU,GACV,QAAQ,GACR,cAAc,GACd,WAAW,GACX,iBAAiB,GACjB,eAAe,GACf,SAAS,GACT,UAAU,CAAC;IAEf,KAAY,OAAO,GAAG,QAAQ,GAAG,UAAU,GAAG,OAAO,GAAG,UAAU,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC;IAE/G,KAAY,IAAI,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,KAAK,GAAG,OAAO,GAAG,SAAS,CAAC;CAChF"}
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/icon/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 { BaseComponentProps } from '../internal/base-component';\n\nexport interface IconProps extends BaseComponentProps {\n /**\n * Specifies the icon to be displayed.\n */\n name?: IconProps.Name;\n /**\n * Specifies the size of the icon.\n *\n * If you set size to `inherit`, an icon size will be assigned based on the icon's inherited line height.\n * For icons used alongside text, ensure the icon is placed inside the acompanying text tag.\n * The icon will be vertically centered based on the height.\n *\n * @visualrefresh `medium` size\n */\n size?: IconProps.Size;\n\n /**\n * Specifies the color variant of the icon. The `normal` variant picks up the current color of its context.\n */\n variant?: IconProps.Variant;\n\n /**\n * Specifies the URL of a custom icon. Use this property if the icon you want isn't available, and your custom icon cannot be an SVG.\n * For SVG icons, use the `svg` slot instead.\n *\n * If you set both `url` and `svg`, `svg` will take precedence.\n */\n url?: string;\n /**\n * Specifies alternate text for a custom icon. We recommend that you provide this for accessibility.\n * This property is ignored if you use a predefined icon or if you set your custom icon using the `svg` slot.\n */\n alt?: string;\n\n /**\n * Specifies the SVG of a custom icon.\n *\n * Use this property if the icon you want isn't available, and you want your custom icon to inherit colors dictated by variant or hover states.\n * When this property is set, the component will be decorated with `aria-hidden=\"true\"`. Ensure that the `svg` element:\n * - has attribute `focusable=\"false\"`.\n * - has `viewBox=\"0 0 16 16\"`.\n *\n * If you set the `svg` element as the root node of the slot, the component will automatically\n * - set `stroke=\"currentColor\"`, `fill=\"none\"`, and `vertical-align=\"top\"`.\n * - set the stroke width based on the size of the icon.\n * - set the width and height of the SVG element based on the size of the icon.\n *\n * If you don't want these styles to be automatically set, wrap the `svg` element into a `span` and ensure icon `size` is not set to `inherit`.\n * You can still set the stroke to `currentColor` to inherit the color of the surrounding elements.\n *\n * If you set both `url` and `svg`, `svg` will take precedence.\n *\n * *Note:* Remember to remove any additional elements (for example: `defs`) and related CSS classes from SVG files exported from design software.\n * In most cases, they aren't needed, as the `svg` element inherits styles from the icon component.\n */\n svg?: React.ReactNode;\n}\n\nexport namespace IconProps {\n // Why not enums? Explained there\n // https://stackoverflow.com/questions/52393730/typescript-string-literal-union-type-from-enum\n export type Name =\n | 'add-plus'\n | 'angle-left-double'\n | 'angle-left'\n | 'angle-right-double'\n | 'angle-right'\n | 'angle-up'\n | 'angle-down'\n | 'arrow-left'\n | 'bug'\n | 'call'\n | 'calendar'\n | 'caret-down-filled'\n | 'caret-down'\n | 'caret-left-filled'\n | 'caret-right-filled'\n | 'caret-up-filled'\n | 'caret-up'\n | 'contact'\n | 'close'\n | 'copy'\n | 'download'\n | 'edit'\n | 'ellipsis'\n | 'envelope'\n | 'expand'\n | 'external'\n | 'file-open'\n | 'file'\n | 'filter'\n | 'folder-open'\n | 'folder'\n | 'heart'\n | 'key'\n | 'lock-private'\n | 'menu'\n | 'microphone'\n | 'notification'\n | 'redo'\n | 'refresh'\n | 'search'\n | 'settings'\n | 'share'\n | 'status-in-progress'\n | 'status-info'\n | 'status-negative'\n | 'status-pending'\n | 'status-positive'\n | 'status-stopped'\n | 'status-warning'\n | 'treeview-collapse'\n | 'treeview-expand'\n | 'undo'\n | 'unlocked'\n | 'upload'\n | 'user-profile'\n | 'view-full'\n | 'view-horizontal'\n | 'view-vertical'\n | 'zoom-in'\n | 'zoom-out';\n\n export type Variant = 'normal' | 'disabled' | 'error' | 'inverted' | 'link' | 'subtle' | 'success' | 'warning';\n\n export type Size = 'small' | 'normal' | 'medium' | 'big' | 'large' | 'inherit';\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/icon/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 { BaseComponentProps } from '../internal/base-component';\n\nexport interface IconProps extends BaseComponentProps {\n /**\n * Specifies the icon to be displayed.\n */\n name?: IconProps.Name;\n /**\n * Specifies the size of the icon.\n *\n * If you set size to `inherit`, an icon size will be assigned based on the icon's inherited line height.\n * For icons used alongside text, ensure the icon is placed inside the acompanying text tag.\n * The icon will be vertically centered based on the height.\n *\n * @visualrefresh `medium` size\n */\n size?: IconProps.Size;\n\n /**\n * Specifies the color variant of the icon. The `normal` variant picks up the current color of its context.\n */\n variant?: IconProps.Variant;\n\n /**\n * Specifies the URL of a custom icon. Use this property if the icon you want isn't available, and your custom icon cannot be an SVG.\n * For SVG icons, use the `svg` slot instead.\n *\n * If you set both `url` and `svg`, `svg` will take precedence.\n */\n url?: string;\n /**\n * Specifies alternate text for a custom icon. We recommend that you provide this for accessibility.\n * This property is ignored if you use a predefined icon or if you set your custom icon using the `svg` slot.\n */\n alt?: string;\n\n /**\n * Specifies the SVG of a custom icon.\n *\n * Use this property if the icon you want isn't available, and you want your custom icon to inherit colors dictated by variant or hover states.\n * When this property is set, the component will be decorated with `aria-hidden=\"true\"`. Ensure that the `svg` element:\n * - has attribute `focusable=\"false\"`.\n * - has `viewBox=\"0 0 16 16\"`.\n *\n * If you set the `svg` element as the root node of the slot, the component will automatically\n * - set `stroke=\"currentColor\"`, `fill=\"none\"`, and `vertical-align=\"top\"`.\n * - set the stroke width based on the size of the icon.\n * - set the width and height of the SVG element based on the size of the icon.\n *\n * If you don't want these styles to be automatically set, wrap the `svg` element into a `span` and ensure icon `size` is not set to `inherit`.\n * You can still set the stroke to `currentColor` to inherit the color of the surrounding elements.\n *\n * If you set both `url` and `svg`, `svg` will take precedence.\n *\n * *Note:* Remember to remove any additional elements (for example: `defs`) and related CSS classes from SVG files exported from design software.\n * In most cases, they aren't needed, as the `svg` element inherits styles from the icon component.\n */\n svg?: React.ReactNode;\n}\n\nexport namespace IconProps {\n // Why not enums? Explained there\n // https://stackoverflow.com/questions/52393730/typescript-string-literal-union-type-from-enum\n export type Name =\n | 'add-plus'\n | 'angle-left-double'\n | 'angle-left'\n | 'angle-right-double'\n | 'angle-right'\n | 'angle-up'\n | 'angle-down'\n | 'arrow-left'\n | 'bug'\n | 'call'\n | 'calendar'\n | 'caret-down-filled'\n | 'caret-down'\n | 'caret-left-filled'\n | 'caret-right-filled'\n | 'caret-up-filled'\n | 'caret-up'\n | 'check'\n | 'contact'\n | 'close'\n | 'copy'\n | 'download'\n | 'edit'\n | 'ellipsis'\n | 'envelope'\n | 'expand'\n | 'external'\n | 'file-open'\n | 'file'\n | 'filter'\n | 'folder-open'\n | 'folder'\n | 'heart'\n | 'key'\n | 'lock-private'\n | 'menu'\n | 'microphone'\n | 'notification'\n | 'redo'\n | 'refresh'\n | 'search'\n | 'settings'\n | 'share'\n | 'status-in-progress'\n | 'status-info'\n | 'status-negative'\n | 'status-pending'\n | 'status-positive'\n | 'status-stopped'\n | 'status-warning'\n | 'treeview-collapse'\n | 'treeview-expand'\n | 'undo'\n | 'unlocked'\n | 'upload'\n | 'user-profile'\n | 'view-full'\n | 'view-horizontal'\n | 'view-vertical'\n | 'zoom-in'\n | 'zoom-out';\n\n export type Variant = 'normal' | 'disabled' | 'error' | 'inverted' | 'link' | 'subtle' | 'success' | 'warning';\n\n export type Size = 'small' | 'normal' | 'medium' | 'big' | 'large' | 'inherit';\n}\n"]}