@arc-ui/components 11.16.0 → 11.18.0
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.
- package/dist/Calendar/Calendar.cjs.js +21 -0
- package/dist/Calendar/Calendar.esm.js +13 -0
- package/dist/Calendar/package.json +7 -0
- package/dist/Checkbox/Checkbox.cjs.js +3 -2
- package/dist/Checkbox/Checkbox.esm.js +3 -2
- package/dist/DatePicker/DatePicker.cjs.js +565 -0
- package/dist/DatePicker/DatePicker.esm.js +552 -0
- package/dist/DatePicker/package.json +7 -0
- package/dist/FormControl/FormControl.cjs.js +2 -1
- package/dist/FormControl/FormControl.esm.js +2 -1
- package/dist/InformationCard/InformationCard.cjs.js +10 -9
- package/dist/InformationCard/InformationCard.esm.js +8 -7
- package/dist/MediaCard/MediaCard.cjs.js +56 -0
- package/dist/MediaCard/MediaCard.esm.js +48 -0
- package/dist/MediaCard/package.json +7 -0
- package/dist/Modal/Modal.cjs.js +13 -286
- package/dist/Modal/Modal.esm.js +6 -279
- package/dist/RadioGroup/RadioGroup.cjs.js +3 -2
- package/dist/RadioGroup/RadioGroup.esm.js +3 -2
- package/dist/Select/Select.cjs.js +31 -2705
- package/dist/Select/Select.esm.js +13 -2668
- package/dist/SiteFooter/SiteFooter.cjs.js +2 -2
- package/dist/SiteFooter/SiteFooter.esm.js +3 -3
- package/dist/SiteHeader/SiteHeader.cjs.js +2 -2
- package/dist/SiteHeader/SiteHeader.esm.js +2 -2
- package/dist/SiteHeaderV2/SiteHeaderV2.cjs.js +23 -0
- package/dist/SiteHeaderV2/SiteHeaderV2.esm.js +15 -0
- package/dist/SiteHeaderV2/package.json +7 -0
- package/dist/Switch/Switch.cjs.js +4 -3
- package/dist/Switch/Switch.esm.js +4 -3
- package/dist/Tabs/Tabs.cjs.js +5 -5
- package/dist/Tabs/Tabs.esm.js +5 -5
- package/dist/TextArea/TextArea.cjs.js +20 -20
- package/dist/TextArea/TextArea.esm.js +20 -20
- package/dist/TextInput/TextInput.cjs.js +3 -2
- package/dist/TextInput/TextInput.esm.js +3 -2
- package/dist/Toast/Toast.cjs.js +6 -7
- package/dist/Toast/Toast.esm.js +6 -7
- package/dist/TypographyCard/TypographyCard.cjs.js +13 -70
- package/dist/TypographyCard/TypographyCard.esm.js +14 -71
- package/dist/_shared/cjs/Calendar-18e255f8.js +4106 -0
- package/dist/_shared/cjs/CardFooter-43c32239.js +80 -0
- package/dist/_shared/cjs/CardLabel-768abf20.js +54 -0
- package/dist/_shared/cjs/{Checkbox-904ad028.js → Checkbox-4d4b432f.js} +1 -1
- package/dist/_shared/cjs/{index-3d69ea00.js → Combination-9974f2e2.js} +662 -145
- package/dist/_shared/cjs/{FormControl-166e0957.js → FormControl-b26ad353.js} +8 -5
- package/dist/_shared/cjs/{RadioGroup-1eddf86f.js → RadioGroup-23c964ae.js} +1 -1
- package/dist/_shared/cjs/{SiteFooter-97c27b29.js → SiteFooter-65b6360c.js} +2 -2
- package/dist/_shared/cjs/{SiteHeader.rehydrator-af3dddef.js → SiteHeader.rehydrator-df053a52.js} +8 -8
- package/dist/_shared/cjs/SiteHeaderV2-79930632.js +663 -0
- package/dist/_shared/cjs/{Tabs-cc77dabb.js → Tabs-34db6bc1.js} +4 -4
- package/dist/_shared/cjs/{TextInput-fd9c756f.js → TextInput-d0370fa8.js} +19 -6
- package/dist/_shared/cjs/{Toast-91e96744.js → Toast-392b1d60.js} +292 -34
- package/dist/_shared/cjs/{index-84e6a68f.js → index-6eb396a3.js} +1 -1
- package/dist/_shared/cjs/{index-6542b467.js → index-74004a9c.js} +1 -1
- package/dist/_shared/cjs/index-77ab5c6a.js +2180 -0
- package/dist/_shared/cjs/{index-d31f2b65.js → index-9f99d686.js} +1 -1
- package/dist/_shared/cjs/{index-1641d0b4.js → index-a31e64a9.js} +1 -1
- package/dist/_shared/cjs/{index-49c72a87.js → index-d38f1bd0.js} +1 -1
- package/dist/_shared/esm/Calendar-4033fa48.js +4093 -0
- package/dist/_shared/esm/CardFooter-dd8d4000.js +74 -0
- package/dist/_shared/esm/CardLabel-d6d71407.js +46 -0
- package/dist/_shared/esm/{Checkbox-8a5bb9a1.js → Checkbox-720b074d.js} +1 -1
- package/dist/_shared/esm/{index-3e2bc99d.js → Combination-e9f7e64e.js} +643 -132
- package/dist/_shared/esm/{FormControl-9d4ddfec.js → FormControl-f0b8fe91.js} +8 -5
- package/dist/_shared/esm/{RadioGroup-238db88d.js → RadioGroup-37fdb06b.js} +1 -1
- package/dist/_shared/esm/{SiteFooter-94316b8b.js → SiteFooter-38ee1536.js} +1 -1
- package/dist/_shared/esm/{SiteHeader.rehydrator-1b507253.js → SiteHeader.rehydrator-32bdcd88.js} +2 -2
- package/dist/_shared/esm/SiteHeaderV2-9e7e7d3b.js +657 -0
- package/dist/_shared/esm/{Tabs-8719d952.js → Tabs-df9965dd.js} +4 -4
- package/dist/_shared/esm/{TextInput-c1e2a1dd.js → TextInput-abbab56b.js} +19 -6
- package/dist/_shared/esm/{Toast-7cb1e544.js → Toast-5d66e13f.js} +264 -7
- package/dist/_shared/esm/{index-39019a9b.js → index-044da8d0.js} +1 -1
- package/dist/_shared/esm/{index-6b7b075c.js → index-25a5b393.js} +1 -1
- package/dist/_shared/esm/{index-246b4f18.js → index-2cfab9f2.js} +1 -1
- package/dist/_shared/esm/{index-12f3a407.js → index-7b531fa7.js} +68 -68
- package/dist/_shared/esm/index-b84a20c6.js +2155 -0
- package/dist/_shared/esm/{index-db47e95a.js → index-ca72c9d5.js} +1 -1
- package/dist/_shared/esm/{index-936b5179.js → index-efa9be1a.js} +1 -1
- package/dist/_shared/esm/{index.es-c552c0ea.js → use-media-query-4c807227.js} +9 -9
- package/dist/index.es.js +1188 -791
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +1189 -791
- package/dist/index.js.map +1 -1
- package/dist/styles.css +4 -4
- package/dist/types/components/Calendar/Calendar.d.ts +49 -0
- package/dist/types/components/Calendar/Calendar.provider.d.ts +21 -0
- package/dist/types/components/Calendar/components/CalendarDateSelect/CalendarDateSelect.d.ts +15 -0
- package/dist/types/components/Calendar/components/CalendarDateSelect/index.d.ts +1 -0
- package/dist/types/components/Calendar/components/CalendarDayGrid/CalendarDayGrid.d.ts +6 -0
- package/dist/types/components/Calendar/components/CalendarDayGrid/index.d.ts +1 -0
- package/dist/types/components/Calendar/components/CalendarDayNumber/CalendarDayNumber.d.ts +8 -0
- package/dist/types/components/Calendar/components/CalendarDayNumber/index.d.ts +1 -0
- package/dist/types/components/Calendar/components/CalendarDoubleMonthView/CalendarDoubleMonthView.d.ts +9 -0
- package/dist/types/components/Calendar/components/CalendarDoubleMonthView/index.d.ts +1 -0
- package/dist/types/components/Calendar/components/CalendarFooter/CalendarFooter.d.ts +6 -0
- package/dist/types/components/Calendar/components/CalendarFooter/index.d.ts +1 -0
- package/dist/types/components/Calendar/components/CalendarMonthView/CalendarMonthView.d.ts +9 -0
- package/dist/types/components/Calendar/components/CalendarMonthView/index.d.ts +1 -0
- package/dist/types/components/Calendar/components/CalendarMonthYearView/CalendarMonthYearView.d.ts +11 -0
- package/dist/types/components/Calendar/components/CalendarMonthYearView/index.d.ts +1 -0
- package/dist/types/components/Calendar/components/CalendarNavButton/CalendarNavButton.d.ts +10 -0
- package/dist/types/components/Calendar/components/CalendarNavButton/index.d.ts +1 -0
- package/dist/types/components/Calendar/components/CalendarWrapper/CalendarWrapper.d.ts +5 -0
- package/dist/types/components/Calendar/components/CalendarWrapper/index.d.ts +1 -0
- package/dist/types/components/Calendar/components/index.d.ts +6 -0
- package/dist/types/components/Calendar/constants/day-names.d.ts +5 -0
- package/dist/types/components/Calendar/constants/index.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/contains-date.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/contains-date.test.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/date-without-time.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/date-without-time.test.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/get-calendar-type.d.ts +2 -0
- package/dist/types/components/Calendar/helpers/get-calendar-type.test.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/get-dates-in-month.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/get-dates-in-month.test.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/get-double-month-display-range.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/get-double-month-display-range.test.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/get-focus-date.d.ts +5 -0
- package/dist/types/components/Calendar/helpers/get-focus-date.test.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/get-highlighted-range.d.ts +6 -0
- package/dist/types/components/Calendar/helpers/get-highlighted-range.test.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/get-keydown-date.d.ts +6 -0
- package/dist/types/components/Calendar/helpers/get-keydown-date.test.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/index.d.ts +13 -0
- package/dist/types/components/Calendar/helpers/is-day.d.ts +2 -0
- package/dist/types/components/Calendar/helpers/is-day.test.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/is-disabled-date.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/is-disabled-date.test.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/is-month-after-max-date.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/is-month-after-max-date.test.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/is-month-before-min-date.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/is-month-before-min-date.test.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/process-selected-range.d.ts +9 -0
- package/dist/types/components/Calendar/helpers/process-selected-range.test.d.ts +1 -0
- package/dist/types/components/Calendar/index.d.ts +2 -0
- package/dist/types/components/Calendar/state/handlers/calendar-keydown-handler.d.ts +3 -0
- package/dist/types/components/Calendar/state/handlers/day-grid-leave-handler.d.ts +3 -0
- package/dist/types/components/Calendar/state/handlers/day-number-select-handler.d.ts +3 -0
- package/dist/types/components/Calendar/state/handlers/default-handler.d.ts +2 -0
- package/dist/types/components/Calendar/state/handlers/dropdown-change-month-handler.d.ts +3 -0
- package/dist/types/components/Calendar/state/handlers/dropdown-change-year-handler.d.ts +3 -0
- package/dist/types/components/Calendar/state/handlers/highlight-range-handler.d.ts +3 -0
- package/dist/types/components/Calendar/state/handlers/index.d.ts +12 -0
- package/dist/types/components/Calendar/state/handlers/range-select-handler.d.ts +3 -0
- package/dist/types/components/Calendar/state/handlers/show-next-double-month-handler.d.ts +3 -0
- package/dist/types/components/Calendar/state/handlers/show-next-month-handler.d.ts +3 -0
- package/dist/types/components/Calendar/state/handlers/show-previous-double-month-handler.d.ts +3 -0
- package/dist/types/components/Calendar/state/handlers/show-previous-month-handler.d.ts +3 -0
- package/dist/types/components/Calendar/state/index.d.ts +2 -0
- package/dist/types/components/Calendar/state/reducer.d.ts +3 -0
- package/dist/types/components/Calendar/state/reducer.test.d.ts +1 -0
- package/dist/types/components/Calendar/state/types/actions.d.ts +81 -0
- package/dist/types/components/Calendar/state/types/state-handler.d.ts +3 -0
- package/dist/types/components/Calendar/state/types/state.d.ts +5 -0
- package/dist/types/components/Calendar/types/calendar-type.d.ts +1 -0
- package/dist/types/components/Calendar/types/date-select-value.d.ts +2 -0
- package/dist/types/components/Calendar/types/index.d.ts +6 -0
- package/dist/types/components/Calendar/types/key-names.d.ts +13 -0
- package/dist/types/components/Calendar/types/range-selection.d.ts +10 -0
- package/dist/types/components/Calendar/types/selection-type.d.ts +1 -0
- package/dist/types/components/Calendar/types/week-days.d.ts +18 -0
- package/dist/types/components/DatePicker/DatePicker.d.ts +17 -0
- package/dist/types/components/DatePicker/constants/date-format.d.ts +1 -0
- package/dist/types/components/DatePicker/constants/index.d.ts +1 -0
- package/dist/types/components/DatePicker/helpers/convert-date-string-to-date.d.ts +1 -0
- package/dist/types/components/DatePicker/helpers/convert-date-string-to-date.test.d.ts +1 -0
- package/dist/types/components/DatePicker/helpers/convert-range-string-to-dates.d.ts +1 -0
- package/dist/types/components/DatePicker/helpers/convert-range-string-to-dates.test.d.ts +1 -0
- package/dist/types/components/DatePicker/helpers/format-date.d.ts +1 -0
- package/dist/types/components/DatePicker/helpers/format-date.test.d.ts +1 -0
- package/dist/types/components/DatePicker/helpers/index.d.ts +8 -0
- package/dist/types/components/DatePicker/helpers/is-date-valid.d.ts +1 -0
- package/dist/types/components/DatePicker/helpers/is-date-valid.test.d.ts +1 -0
- package/dist/types/components/DatePicker/helpers/is-disabled-date.d.ts +1 -0
- package/dist/types/components/DatePicker/helpers/is-disabled-date.test.d.ts +1 -0
- package/dist/types/components/DatePicker/helpers/is-range-valid.d.ts +1 -0
- package/dist/types/components/DatePicker/helpers/is-range-valid.test.d.ts +1 -0
- package/dist/types/components/DatePicker/helpers/parse-date-string.d.ts +5 -0
- package/dist/types/components/DatePicker/helpers/parse-date-string.test.d.ts +1 -0
- package/dist/types/components/DatePicker/helpers/parse-range-string.d.ts +14 -0
- package/dist/types/components/DatePicker/helpers/parse-range-string.test.d.ts +1 -0
- package/dist/types/components/DatePicker/index.d.ts +6 -0
- package/dist/types/components/FormControl/FormControl.d.ts +4 -0
- package/dist/types/components/RadioGroup/RadioGroup.d.ts +1 -1
- package/dist/types/components/SiteHeaderV2/SiteHeaderV2.d.ts +77 -0
- package/dist/types/components/SiteHeaderV2/components/BackButton/BackButton.d.ts +6 -0
- package/dist/types/components/SiteHeaderV2/components/BackButton/index.d.ts +1 -0
- package/dist/types/components/SiteHeaderV2/components/Column/Column.d.ts +8 -0
- package/dist/types/components/SiteHeaderV2/components/Column/index.d.ts +1 -0
- package/dist/types/components/SiteHeaderV2/components/HorizontalPanel/HorizontalPanel.d.ts +13 -0
- package/dist/types/components/SiteHeaderV2/components/HorizontalPanel/index.d.ts +1 -0
- package/dist/types/components/SiteHeaderV2/components/Item/Item.d.ts +20 -0
- package/dist/types/components/SiteHeaderV2/components/Item/index.d.ts +1 -0
- package/dist/types/components/SiteHeaderV2/components/ItemGroup/ItemGroup.d.ts +27 -0
- package/dist/types/components/SiteHeaderV2/components/ItemGroup/index.d.ts +1 -0
- package/dist/types/components/SiteHeaderV2/components/MenuButton/MenuButton.d.ts +6 -0
- package/dist/types/components/SiteHeaderV2/components/MenuButton/index.d.ts +1 -0
- package/dist/types/components/SiteHeaderV2/components/NavItem/NavItem.d.ts +41 -0
- package/dist/types/components/SiteHeaderV2/components/NavItem/NavItemWithSubNav.d.ts +56 -0
- package/dist/types/components/SiteHeaderV2/components/NavItem/index.d.ts +2 -0
- package/dist/types/components/SiteHeaderV2/components/NodeItem/NodeItem.d.ts +8 -0
- package/dist/types/components/SiteHeaderV2/components/Panel/Panel.d.ts +28 -0
- package/dist/types/components/SiteHeaderV2/components/Panel/index.d.ts +1 -0
- package/dist/types/components/SiteHeaderV2/components/SubNavItem/SubNavItem.d.ts +45 -0
- package/dist/types/components/SiteHeaderV2/components/SubNavItem/index.d.ts +1 -0
- package/dist/types/components/SiteHeaderV2/components/VerticalDivider/VerticalDivider.d.ts +1 -0
- package/dist/types/components/SiteHeaderV2/components/VerticalDivider/index.d.ts +1 -0
- package/dist/types/components/SiteHeaderV2/index.d.ts +1 -0
- package/dist/types/components/TextArea/TextArea.d.ts +4 -0
- package/dist/types/components/TextInput/TextInput.d.ts +22 -3
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/private-components/CardFooter/CardFooter.d.ts +11 -0
- package/dist/types/private-components/CardFooter/index.d.ts +1 -0
- package/dist/types/private-components/CardHeading/CardHeading.d.ts +19 -0
- package/dist/types/private-components/CardHeading/index.d.ts +1 -0
- package/dist/types/private-components/CardLabel/CardLabel.d.ts +10 -0
- package/dist/types/private-components/CardLabel/index.d.ts +1 -0
- package/dist/types/private-components/index.d.ts +4 -0
- package/dist/types/styles.d.ts +6 -0
- package/package.json +13 -4
- package/dist/_shared/cjs/BtIconArrowRight.esm-8e8ac316.js +0 -30
- package/dist/_shared/cjs/index-4ecad2dd.js +0 -273
- package/dist/_shared/esm/BtIconArrowRight.esm-267916a4.js +0 -24
- package/dist/_shared/esm/index-d0307140.js +0 -264
- package/dist/types/internal-components/index.d.ts +0 -1
- package/dist/_shared/cjs/{index-56a040f4.js → index-dd1d18ea.js} +66 -66
- package/dist/_shared/cjs/{index.es-26dd8c5d.js → use-media-query-e61881d8.js} +8 -8
- /package/dist/types/{internal-components → private-components}/ConditionalWrapper/ConditionalWrapper.d.ts +0 -0
- /package/dist/types/{internal-components → private-components}/ConditionalWrapper/index.d.ts +0 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var Calendar = require('../_shared/cjs/Calendar-18e255f8.js');
|
|
6
|
+
require('react');
|
|
7
|
+
require('../_shared/cjs/use-media-query-e61881d8.js');
|
|
8
|
+
require('../_shared/cjs/filter-data-attrs-1c9a530c.js');
|
|
9
|
+
require('../_shared/cjs/index-9947ac13.js');
|
|
10
|
+
require('../_shared/cjs/Text-606ca3a2.js');
|
|
11
|
+
require('../_shared/cjs/suffix-modifier-64dcd338.js');
|
|
12
|
+
require('../_shared/cjs/Surface-038db6e1.js');
|
|
13
|
+
require('../_shared/cjs/VisuallyHidden-e2c8b291.js');
|
|
14
|
+
require('../_shared/cjs/Heading-27cba320.js');
|
|
15
|
+
require('../_shared/cjs/BtIconChevronLeftMid.esm-0aaa6770.js');
|
|
16
|
+
require('../_shared/cjs/BtIconChevronRightMid.esm-d01ebbd4.js');
|
|
17
|
+
require('../_shared/cjs/Icon-a9801f05.js');
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
exports.Calendar = Calendar.Calendar;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { C as Calendar } from '../_shared/esm/Calendar-4033fa48.js';
|
|
2
|
+
import 'react';
|
|
3
|
+
import '../_shared/esm/use-media-query-4c807227.js';
|
|
4
|
+
import '../_shared/esm/filter-data-attrs-ea8f4ed4.js';
|
|
5
|
+
import '../_shared/esm/index-2e73c2e9.js';
|
|
6
|
+
import '../_shared/esm/Text-14f586ac.js';
|
|
7
|
+
import '../_shared/esm/suffix-modifier-3d548e45.js';
|
|
8
|
+
import '../_shared/esm/Surface-0ca6817d.js';
|
|
9
|
+
import '../_shared/esm/VisuallyHidden-b9eebf71.js';
|
|
10
|
+
import '../_shared/esm/Heading-d16e0e53.js';
|
|
11
|
+
import '../_shared/esm/BtIconChevronLeftMid.esm-1ed8330b.js';
|
|
12
|
+
import '../_shared/esm/BtIconChevronRightMid.esm-32268f1a.js';
|
|
13
|
+
import '../_shared/esm/Icon-abd0d990.js';
|
|
@@ -2,18 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var Checkbox = require('../_shared/cjs/Checkbox-
|
|
5
|
+
var Checkbox = require('../_shared/cjs/Checkbox-4d4b432f.js');
|
|
6
6
|
require('../_shared/cjs/filter-data-attrs-1c9a530c.js');
|
|
7
7
|
require('react');
|
|
8
8
|
require('../_shared/cjs/BtIconTickAlt2Px.esm-57c89acc.js');
|
|
9
9
|
require('../_shared/cjs/BtIconAlert.esm-1a0ff9f0.js');
|
|
10
10
|
require('../_shared/cjs/index-9947ac13.js');
|
|
11
|
-
require('../_shared/cjs/FormControl-
|
|
11
|
+
require('../_shared/cjs/FormControl-b26ad353.js');
|
|
12
12
|
require('../_shared/cjs/Surface-038db6e1.js');
|
|
13
13
|
require('../_shared/cjs/DisclosureMini-d0eeb6bb.js');
|
|
14
14
|
require('../_shared/cjs/BtIconChevronDown2Px.esm-39030ee0.js');
|
|
15
15
|
require('../_shared/cjs/Text-606ca3a2.js');
|
|
16
16
|
require('../_shared/cjs/suffix-modifier-64dcd338.js');
|
|
17
|
+
require('../_shared/cjs/VisuallyHidden-e2c8b291.js');
|
|
17
18
|
|
|
18
19
|
|
|
19
20
|
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
export { C as Checkbox } from '../_shared/esm/Checkbox-
|
|
1
|
+
export { C as Checkbox } from '../_shared/esm/Checkbox-720b074d.js';
|
|
2
2
|
import '../_shared/esm/filter-data-attrs-ea8f4ed4.js';
|
|
3
3
|
import 'react';
|
|
4
4
|
import '../_shared/esm/BtIconTickAlt2Px.esm-0bc2ded0.js';
|
|
5
5
|
import '../_shared/esm/BtIconAlert.esm-a4608d47.js';
|
|
6
6
|
import '../_shared/esm/index-2e73c2e9.js';
|
|
7
|
-
import '../_shared/esm/FormControl-
|
|
7
|
+
import '../_shared/esm/FormControl-f0b8fe91.js';
|
|
8
8
|
import '../_shared/esm/Surface-0ca6817d.js';
|
|
9
9
|
import '../_shared/esm/DisclosureMini-ec17b008.js';
|
|
10
10
|
import '../_shared/esm/BtIconChevronDown2Px.esm-217276c2.js';
|
|
11
11
|
import '../_shared/esm/Text-14f586ac.js';
|
|
12
12
|
import '../_shared/esm/suffix-modifier-3d548e45.js';
|
|
13
|
+
import '../_shared/esm/VisuallyHidden-b9eebf71.js';
|
|
@@ -0,0 +1,565 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var Calendar = require('../_shared/cjs/Calendar-18e255f8.js');
|
|
6
|
+
var filterDataAttrs = require('../_shared/cjs/filter-data-attrs-1c9a530c.js');
|
|
7
|
+
var React = require('react');
|
|
8
|
+
var index$4 = require('../_shared/cjs/index-9947ac13.js');
|
|
9
|
+
var _extends = require('../_shared/cjs/extends-8c5e4b48.js');
|
|
10
|
+
var index = require('../_shared/cjs/index-dd1d18ea.js');
|
|
11
|
+
var Combination = require('../_shared/cjs/Combination-9974f2e2.js');
|
|
12
|
+
var index$2 = require('../_shared/cjs/index-6eb396a3.js');
|
|
13
|
+
var index$1 = require('../_shared/cjs/index-77ab5c6a.js');
|
|
14
|
+
var index$3 = require('../_shared/cjs/index-d38f1bd0.js');
|
|
15
|
+
var Base = require('../_shared/cjs/Base-f5a86eed.js');
|
|
16
|
+
var TextInput = require('../_shared/cjs/TextInput-d0370fa8.js');
|
|
17
|
+
require('../_shared/cjs/use-media-query-e61881d8.js');
|
|
18
|
+
require('../_shared/cjs/Text-606ca3a2.js');
|
|
19
|
+
require('../_shared/cjs/suffix-modifier-64dcd338.js');
|
|
20
|
+
require('../_shared/cjs/Surface-038db6e1.js');
|
|
21
|
+
require('../_shared/cjs/VisuallyHidden-e2c8b291.js');
|
|
22
|
+
require('../_shared/cjs/Heading-27cba320.js');
|
|
23
|
+
require('../_shared/cjs/BtIconChevronLeftMid.esm-0aaa6770.js');
|
|
24
|
+
require('../_shared/cjs/BtIconChevronRightMid.esm-d01ebbd4.js');
|
|
25
|
+
require('../_shared/cjs/Icon-a9801f05.js');
|
|
26
|
+
require('react-dom');
|
|
27
|
+
require('../_shared/cjs/index-74004a9c.js');
|
|
28
|
+
require('../_shared/cjs/FormControl-b26ad353.js');
|
|
29
|
+
require('../_shared/cjs/BtIconAlert.esm-1a0ff9f0.js');
|
|
30
|
+
require('../_shared/cjs/DisclosureMini-d0eeb6bb.js');
|
|
31
|
+
require('../_shared/cjs/BtIconChevronDown2Px.esm-39030ee0.js');
|
|
32
|
+
|
|
33
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
34
|
+
|
|
35
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* @name startOfDay
|
|
39
|
+
* @category Day Helpers
|
|
40
|
+
* @summary Return the start of a day for the given date.
|
|
41
|
+
*
|
|
42
|
+
* @description
|
|
43
|
+
* Return the start of a day for the given date.
|
|
44
|
+
* The result will be in the local timezone.
|
|
45
|
+
*
|
|
46
|
+
* @param {Date|Number} date - the original date
|
|
47
|
+
* @returns {Date} the start of a day
|
|
48
|
+
* @throws {TypeError} 1 argument required
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* // The start of a day for 2 September 2014 11:55:00:
|
|
52
|
+
* const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))
|
|
53
|
+
* //=> Tue Sep 02 2014 00:00:00
|
|
54
|
+
*/
|
|
55
|
+
function startOfDay(dirtyDate) {
|
|
56
|
+
Calendar.requiredArgs(1, arguments);
|
|
57
|
+
var date = Calendar.toDate(dirtyDate);
|
|
58
|
+
date.setHours(0, 0, 0, 0);
|
|
59
|
+
return date;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* @name isSameDay
|
|
64
|
+
* @category Day Helpers
|
|
65
|
+
* @summary Are the given dates in the same day (and year and month)?
|
|
66
|
+
*
|
|
67
|
+
* @description
|
|
68
|
+
* Are the given dates in the same day (and year and month)?
|
|
69
|
+
*
|
|
70
|
+
* @param {Date|Number} dateLeft - the first date to check
|
|
71
|
+
* @param {Date|Number} dateRight - the second date to check
|
|
72
|
+
* @returns {Boolean} the dates are in the same day (and year and month)
|
|
73
|
+
* @throws {TypeError} 2 arguments required
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* // Are 4 September 06:00:00 and 4 September 18:00:00 in the same day?
|
|
77
|
+
* const result = isSameDay(new Date(2014, 8, 4, 6, 0), new Date(2014, 8, 4, 18, 0))
|
|
78
|
+
* //=> true
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* // Are 4 September and 4 October in the same day?
|
|
82
|
+
* const result = isSameDay(new Date(2014, 8, 4), new Date(2014, 9, 4))
|
|
83
|
+
* //=> false
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* // Are 4 September, 2014 and 4 September, 2015 in the same day?
|
|
87
|
+
* const result = isSameDay(new Date(2014, 8, 4), new Date(2015, 8, 4))
|
|
88
|
+
* //=> false
|
|
89
|
+
*/
|
|
90
|
+
function isSameDay(dirtyDateLeft, dirtyDateRight) {
|
|
91
|
+
Calendar.requiredArgs(2, arguments);
|
|
92
|
+
var dateLeftStartOfDay = startOfDay(dirtyDateLeft);
|
|
93
|
+
var dateRightStartOfDay = startOfDay(dirtyDateRight);
|
|
94
|
+
return dateLeftStartOfDay.getTime() === dateRightStartOfDay.getTime();
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
var parseRangeString = function (value) {
|
|
98
|
+
if (value === void 0) { value = ""; }
|
|
99
|
+
var _a = value.replace(/\s/g, "").split("-"), _b = _a[0], start = _b === void 0 ? "" : _b, _c = _a[1], end = _c === void 0 ? "" : _c;
|
|
100
|
+
var _d = start.split("/"), startDay = _d[0], startMonth = _d[1], startYear = _d[2];
|
|
101
|
+
var _e = end.split("/"), endDay = _e[0], endMonth = _e[1], endYear = _e[2];
|
|
102
|
+
return {
|
|
103
|
+
start: {
|
|
104
|
+
date: start,
|
|
105
|
+
day: startDay,
|
|
106
|
+
month: startMonth,
|
|
107
|
+
year: startYear
|
|
108
|
+
},
|
|
109
|
+
end: {
|
|
110
|
+
date: end,
|
|
111
|
+
day: endDay,
|
|
112
|
+
month: endMonth,
|
|
113
|
+
year: endYear
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
var parseDateString = function (value) {
|
|
119
|
+
var _a = value.split("/"), day = _a[0], month = _a[1], year = _a[2];
|
|
120
|
+
return {
|
|
121
|
+
day: day,
|
|
122
|
+
month: month,
|
|
123
|
+
year: year
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
var isDateValid = function (value) {
|
|
128
|
+
if (value === void 0) { value = ""; }
|
|
129
|
+
var _a = value.split("/"), day = _a[0], month = _a[1], year = _a[2];
|
|
130
|
+
return (/^\d{2}\/\d{2}\/\d{4}$/.test(value) &&
|
|
131
|
+
Calendar.isValid(new Date("".concat(year, "-").concat(month, "-").concat(day))));
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
var isRangeValid = function (value) {
|
|
135
|
+
if (value === void 0) { value = ""; }
|
|
136
|
+
var _a = value.replace(/\s/g, "").split("-"), _b = _a[0], start = _b === void 0 ? "" : _b, _c = _a[1], end = _c === void 0 ? "" : _c;
|
|
137
|
+
return isDateValid(start) && isDateValid(end);
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
var DATE_FORMAT = "dd/MM/yyyy";
|
|
141
|
+
|
|
142
|
+
/* -------------------------------------------------------------------------------------------------
|
|
143
|
+
* Popover
|
|
144
|
+
* -----------------------------------------------------------------------------------------------*/ const $cb5cc270b50c6fcd$var$POPOVER_NAME = 'Popover';
|
|
145
|
+
const [$cb5cc270b50c6fcd$var$createPopoverContext, $cb5cc270b50c6fcd$export$c8393c9e73286932] = index.$c512c27ab02ef895$export$50c7b4e9d9f19c1($cb5cc270b50c6fcd$var$POPOVER_NAME, [
|
|
146
|
+
index$1.$cf1ac5d9fe0e8206$export$722aac194ae923
|
|
147
|
+
]);
|
|
148
|
+
const $cb5cc270b50c6fcd$var$usePopperScope = index$1.$cf1ac5d9fe0e8206$export$722aac194ae923();
|
|
149
|
+
const [$cb5cc270b50c6fcd$var$PopoverProvider, $cb5cc270b50c6fcd$var$usePopoverContext] = $cb5cc270b50c6fcd$var$createPopoverContext($cb5cc270b50c6fcd$var$POPOVER_NAME);
|
|
150
|
+
const $cb5cc270b50c6fcd$export$5b6b19405a83ff9d = (props)=>{
|
|
151
|
+
const { __scopePopover: __scopePopover , children: children , open: openProp , defaultOpen: defaultOpen , onOpenChange: onOpenChange , modal: modal = false } = props;
|
|
152
|
+
const popperScope = $cb5cc270b50c6fcd$var$usePopperScope(__scopePopover);
|
|
153
|
+
const triggerRef = React.useRef(null);
|
|
154
|
+
const [hasCustomAnchor, setHasCustomAnchor] = React.useState(false);
|
|
155
|
+
const [open = false, setOpen] = index.$71cd76cc60e0454e$export$6f32135080cb4c3({
|
|
156
|
+
prop: openProp,
|
|
157
|
+
defaultProp: defaultOpen,
|
|
158
|
+
onChange: onOpenChange
|
|
159
|
+
});
|
|
160
|
+
return /*#__PURE__*/ React.createElement(index$1.$cf1ac5d9fe0e8206$export$be92b6f5f03c0fe9, popperScope, /*#__PURE__*/ React.createElement($cb5cc270b50c6fcd$var$PopoverProvider, {
|
|
161
|
+
scope: __scopePopover,
|
|
162
|
+
contentId: index$2.$1746a345f3d73bb7$export$f680877a34711e37(),
|
|
163
|
+
triggerRef: triggerRef,
|
|
164
|
+
open: open,
|
|
165
|
+
onOpenChange: setOpen,
|
|
166
|
+
onOpenToggle: React.useCallback(()=>setOpen((prevOpen)=>!prevOpen
|
|
167
|
+
)
|
|
168
|
+
, [
|
|
169
|
+
setOpen
|
|
170
|
+
]),
|
|
171
|
+
hasCustomAnchor: hasCustomAnchor,
|
|
172
|
+
onCustomAnchorAdd: React.useCallback(()=>setHasCustomAnchor(true)
|
|
173
|
+
, []),
|
|
174
|
+
onCustomAnchorRemove: React.useCallback(()=>setHasCustomAnchor(false)
|
|
175
|
+
, []),
|
|
176
|
+
modal: modal
|
|
177
|
+
}, children));
|
|
178
|
+
};
|
|
179
|
+
/* -------------------------------------------------------------------------------------------------
|
|
180
|
+
* PopoverAnchor
|
|
181
|
+
* -----------------------------------------------------------------------------------------------*/ const $cb5cc270b50c6fcd$var$ANCHOR_NAME = 'PopoverAnchor';
|
|
182
|
+
const $cb5cc270b50c6fcd$export$96e5381f42521a79 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
183
|
+
const { __scopePopover: __scopePopover , ...anchorProps } = props;
|
|
184
|
+
const context = $cb5cc270b50c6fcd$var$usePopoverContext($cb5cc270b50c6fcd$var$ANCHOR_NAME, __scopePopover);
|
|
185
|
+
const popperScope = $cb5cc270b50c6fcd$var$usePopperScope(__scopePopover);
|
|
186
|
+
const { onCustomAnchorAdd: onCustomAnchorAdd , onCustomAnchorRemove: onCustomAnchorRemove } = context;
|
|
187
|
+
React.useEffect(()=>{
|
|
188
|
+
onCustomAnchorAdd();
|
|
189
|
+
return ()=>onCustomAnchorRemove()
|
|
190
|
+
;
|
|
191
|
+
}, [
|
|
192
|
+
onCustomAnchorAdd,
|
|
193
|
+
onCustomAnchorRemove
|
|
194
|
+
]);
|
|
195
|
+
return /*#__PURE__*/ React.createElement(index$1.$cf1ac5d9fe0e8206$export$b688253958b8dfe7, _extends._extends({}, popperScope, anchorProps, {
|
|
196
|
+
ref: forwardedRef
|
|
197
|
+
}));
|
|
198
|
+
});
|
|
199
|
+
/* -------------------------------------------------------------------------------------------------
|
|
200
|
+
* PopoverPortal
|
|
201
|
+
* -----------------------------------------------------------------------------------------------*/ const $cb5cc270b50c6fcd$var$PORTAL_NAME = 'PopoverPortal';
|
|
202
|
+
const [$cb5cc270b50c6fcd$var$PortalProvider, $cb5cc270b50c6fcd$var$usePortalContext] = $cb5cc270b50c6fcd$var$createPopoverContext($cb5cc270b50c6fcd$var$PORTAL_NAME, {
|
|
203
|
+
forceMount: undefined
|
|
204
|
+
});
|
|
205
|
+
const $cb5cc270b50c6fcd$export$dd679ffb4362d2d4 = (props)=>{
|
|
206
|
+
const { __scopePopover: __scopePopover , forceMount: forceMount , children: children , container: container } = props;
|
|
207
|
+
const context = $cb5cc270b50c6fcd$var$usePopoverContext($cb5cc270b50c6fcd$var$PORTAL_NAME, __scopePopover);
|
|
208
|
+
return /*#__PURE__*/ React.createElement($cb5cc270b50c6fcd$var$PortalProvider, {
|
|
209
|
+
scope: __scopePopover,
|
|
210
|
+
forceMount: forceMount
|
|
211
|
+
}, /*#__PURE__*/ React.createElement(index$3.$921a889cee6df7e8$export$99c2b779aa4e8b8b, {
|
|
212
|
+
present: forceMount || context.open
|
|
213
|
+
}, /*#__PURE__*/ React.createElement(Combination.$f1701beae083dbae$export$602eac185826482c, {
|
|
214
|
+
asChild: true,
|
|
215
|
+
container: container
|
|
216
|
+
}, children)));
|
|
217
|
+
};
|
|
218
|
+
/* -------------------------------------------------------------------------------------------------
|
|
219
|
+
* PopoverContent
|
|
220
|
+
* -----------------------------------------------------------------------------------------------*/ const $cb5cc270b50c6fcd$var$CONTENT_NAME = 'PopoverContent';
|
|
221
|
+
const $cb5cc270b50c6fcd$export$d7e1f420b25549ff = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
222
|
+
const portalContext = $cb5cc270b50c6fcd$var$usePortalContext($cb5cc270b50c6fcd$var$CONTENT_NAME, props.__scopePopover);
|
|
223
|
+
const { forceMount: forceMount = portalContext.forceMount , ...contentProps } = props;
|
|
224
|
+
const context = $cb5cc270b50c6fcd$var$usePopoverContext($cb5cc270b50c6fcd$var$CONTENT_NAME, props.__scopePopover);
|
|
225
|
+
return /*#__PURE__*/ React.createElement(index$3.$921a889cee6df7e8$export$99c2b779aa4e8b8b, {
|
|
226
|
+
present: forceMount || context.open
|
|
227
|
+
}, context.modal ? /*#__PURE__*/ React.createElement($cb5cc270b50c6fcd$var$PopoverContentModal, _extends._extends({}, contentProps, {
|
|
228
|
+
ref: forwardedRef
|
|
229
|
+
})) : /*#__PURE__*/ React.createElement($cb5cc270b50c6fcd$var$PopoverContentNonModal, _extends._extends({}, contentProps, {
|
|
230
|
+
ref: forwardedRef
|
|
231
|
+
})));
|
|
232
|
+
});
|
|
233
|
+
/* -----------------------------------------------------------------------------------------------*/ const $cb5cc270b50c6fcd$var$PopoverContentModal = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
234
|
+
const context = $cb5cc270b50c6fcd$var$usePopoverContext($cb5cc270b50c6fcd$var$CONTENT_NAME, props.__scopePopover);
|
|
235
|
+
const contentRef = React.useRef(null);
|
|
236
|
+
const composedRefs = index.$6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, contentRef);
|
|
237
|
+
const isRightClickOutsideRef = React.useRef(false); // aria-hide everything except the content (better supported equivalent to setting aria-modal)
|
|
238
|
+
React.useEffect(()=>{
|
|
239
|
+
const content = contentRef.current;
|
|
240
|
+
if (content) return Combination.hideOthers(content);
|
|
241
|
+
}, []);
|
|
242
|
+
return /*#__PURE__*/ React.createElement(Combination.$01b9c$RemoveScroll, {
|
|
243
|
+
as: index.$5e63c961fc1ce211$export$8c6ed5c666ac1360,
|
|
244
|
+
allowPinchZoom: true
|
|
245
|
+
}, /*#__PURE__*/ React.createElement($cb5cc270b50c6fcd$var$PopoverContentImpl, _extends._extends({}, props, {
|
|
246
|
+
ref: composedRefs // we make sure we're not trapping once it's been closed
|
|
247
|
+
,
|
|
248
|
+
trapFocus: context.open,
|
|
249
|
+
disableOutsidePointerEvents: true,
|
|
250
|
+
onCloseAutoFocus: index.$e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onCloseAutoFocus, (event)=>{
|
|
251
|
+
var _context$triggerRef$c;
|
|
252
|
+
event.preventDefault();
|
|
253
|
+
if (!isRightClickOutsideRef.current) (_context$triggerRef$c = context.triggerRef.current) === null || _context$triggerRef$c === void 0 || _context$triggerRef$c.focus();
|
|
254
|
+
}),
|
|
255
|
+
onPointerDownOutside: index.$e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerDownOutside, (event)=>{
|
|
256
|
+
const originalEvent = event.detail.originalEvent;
|
|
257
|
+
const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
|
|
258
|
+
const isRightClick = originalEvent.button === 2 || ctrlLeftClick;
|
|
259
|
+
isRightClickOutsideRef.current = isRightClick;
|
|
260
|
+
}, {
|
|
261
|
+
checkForDefaultPrevented: false
|
|
262
|
+
}) // When focus is trapped, a `focusout` event may still happen.
|
|
263
|
+
,
|
|
264
|
+
onFocusOutside: index.$e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocusOutside, (event)=>event.preventDefault()
|
|
265
|
+
, {
|
|
266
|
+
checkForDefaultPrevented: false
|
|
267
|
+
})
|
|
268
|
+
})));
|
|
269
|
+
});
|
|
270
|
+
const $cb5cc270b50c6fcd$var$PopoverContentNonModal = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
271
|
+
const context = $cb5cc270b50c6fcd$var$usePopoverContext($cb5cc270b50c6fcd$var$CONTENT_NAME, props.__scopePopover);
|
|
272
|
+
const hasInteractedOutsideRef = React.useRef(false);
|
|
273
|
+
const hasPointerDownOutsideRef = React.useRef(false);
|
|
274
|
+
return /*#__PURE__*/ React.createElement($cb5cc270b50c6fcd$var$PopoverContentImpl, _extends._extends({}, props, {
|
|
275
|
+
ref: forwardedRef,
|
|
276
|
+
trapFocus: false,
|
|
277
|
+
disableOutsidePointerEvents: false,
|
|
278
|
+
onCloseAutoFocus: (event)=>{
|
|
279
|
+
var _props$onCloseAutoFoc;
|
|
280
|
+
(_props$onCloseAutoFoc = props.onCloseAutoFocus) === null || _props$onCloseAutoFoc === void 0 || _props$onCloseAutoFoc.call(props, event);
|
|
281
|
+
if (!event.defaultPrevented) {
|
|
282
|
+
var _context$triggerRef$c2;
|
|
283
|
+
if (!hasInteractedOutsideRef.current) (_context$triggerRef$c2 = context.triggerRef.current) === null || _context$triggerRef$c2 === void 0 || _context$triggerRef$c2.focus(); // Always prevent auto focus because we either focus manually or want user agent focus
|
|
284
|
+
event.preventDefault();
|
|
285
|
+
}
|
|
286
|
+
hasInteractedOutsideRef.current = false;
|
|
287
|
+
hasPointerDownOutsideRef.current = false;
|
|
288
|
+
},
|
|
289
|
+
onInteractOutside: (event)=>{
|
|
290
|
+
var _props$onInteractOuts, _context$triggerRef$c3;
|
|
291
|
+
(_props$onInteractOuts = props.onInteractOutside) === null || _props$onInteractOuts === void 0 || _props$onInteractOuts.call(props, event);
|
|
292
|
+
if (!event.defaultPrevented) {
|
|
293
|
+
hasInteractedOutsideRef.current = true;
|
|
294
|
+
if (event.detail.originalEvent.type === 'pointerdown') hasPointerDownOutsideRef.current = true;
|
|
295
|
+
} // Prevent dismissing when clicking the trigger.
|
|
296
|
+
// As the trigger is already setup to close, without doing so would
|
|
297
|
+
// cause it to close and immediately open.
|
|
298
|
+
const target = event.target;
|
|
299
|
+
const targetIsTrigger = (_context$triggerRef$c3 = context.triggerRef.current) === null || _context$triggerRef$c3 === void 0 ? void 0 : _context$triggerRef$c3.contains(target);
|
|
300
|
+
if (targetIsTrigger) event.preventDefault(); // On Safari if the trigger is inside a container with tabIndex={0}, when clicked
|
|
301
|
+
// we will get the pointer down outside event on the trigger, but then a subsequent
|
|
302
|
+
// focus outside event on the container, we ignore any focus outside event when we've
|
|
303
|
+
// already had a pointer down outside event.
|
|
304
|
+
if (event.detail.originalEvent.type === 'focusin' && hasPointerDownOutsideRef.current) event.preventDefault();
|
|
305
|
+
}
|
|
306
|
+
}));
|
|
307
|
+
});
|
|
308
|
+
/* -----------------------------------------------------------------------------------------------*/ const $cb5cc270b50c6fcd$var$PopoverContentImpl = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
309
|
+
const { __scopePopover: __scopePopover , trapFocus: trapFocus , onOpenAutoFocus: onOpenAutoFocus , onCloseAutoFocus: onCloseAutoFocus , disableOutsidePointerEvents: disableOutsidePointerEvents , onEscapeKeyDown: onEscapeKeyDown , onPointerDownOutside: onPointerDownOutside , onFocusOutside: onFocusOutside , onInteractOutside: onInteractOutside , ...contentProps } = props;
|
|
310
|
+
const context = $cb5cc270b50c6fcd$var$usePopoverContext($cb5cc270b50c6fcd$var$CONTENT_NAME, __scopePopover);
|
|
311
|
+
const popperScope = $cb5cc270b50c6fcd$var$usePopperScope(__scopePopover); // Make sure the whole tree has focus guards as our `Popover` may be
|
|
312
|
+
// the last element in the DOM (beacuse of the `Portal`)
|
|
313
|
+
Combination.$3db38b7d1fb3fe6a$export$b7ece24a22aeda8c();
|
|
314
|
+
return /*#__PURE__*/ React.createElement(Combination.$d3863c46a17e8a28$export$20e40289641fbbb6, {
|
|
315
|
+
asChild: true,
|
|
316
|
+
loop: true,
|
|
317
|
+
trapped: trapFocus,
|
|
318
|
+
onMountAutoFocus: onOpenAutoFocus,
|
|
319
|
+
onUnmountAutoFocus: onCloseAutoFocus
|
|
320
|
+
}, /*#__PURE__*/ React.createElement(Combination.$5cb92bef7577960e$export$177fb62ff3ec1f22, {
|
|
321
|
+
asChild: true,
|
|
322
|
+
disableOutsidePointerEvents: disableOutsidePointerEvents,
|
|
323
|
+
onInteractOutside: onInteractOutside,
|
|
324
|
+
onEscapeKeyDown: onEscapeKeyDown,
|
|
325
|
+
onPointerDownOutside: onPointerDownOutside,
|
|
326
|
+
onFocusOutside: onFocusOutside,
|
|
327
|
+
onDismiss: ()=>context.onOpenChange(false)
|
|
328
|
+
}, /*#__PURE__*/ React.createElement(index$1.$cf1ac5d9fe0e8206$export$7c6e2c02157bb7d2, _extends._extends({
|
|
329
|
+
"data-state": $cb5cc270b50c6fcd$var$getState(context.open),
|
|
330
|
+
role: "dialog",
|
|
331
|
+
id: context.contentId
|
|
332
|
+
}, popperScope, contentProps, {
|
|
333
|
+
ref: forwardedRef,
|
|
334
|
+
style: {
|
|
335
|
+
...contentProps.style,
|
|
336
|
+
'--radix-popover-content-transform-origin': 'var(--radix-popper-transform-origin)',
|
|
337
|
+
'--radix-popover-content-available-width': 'var(--radix-popper-available-width)',
|
|
338
|
+
'--radix-popover-content-available-height': 'var(--radix-popper-available-height)',
|
|
339
|
+
'--radix-popover-trigger-width': 'var(--radix-popper-anchor-width)',
|
|
340
|
+
'--radix-popover-trigger-height': 'var(--radix-popper-anchor-height)'
|
|
341
|
+
}
|
|
342
|
+
}))));
|
|
343
|
+
});
|
|
344
|
+
/* -----------------------------------------------------------------------------------------------*/ function $cb5cc270b50c6fcd$var$getState(open) {
|
|
345
|
+
return open ? 'open' : 'closed';
|
|
346
|
+
}
|
|
347
|
+
const $cb5cc270b50c6fcd$export$be92b6f5f03c0fe9 = $cb5cc270b50c6fcd$export$5b6b19405a83ff9d;
|
|
348
|
+
const $cb5cc270b50c6fcd$export$b688253958b8dfe7 = $cb5cc270b50c6fcd$export$96e5381f42521a79;
|
|
349
|
+
const $cb5cc270b50c6fcd$export$602eac185826482c = $cb5cc270b50c6fcd$export$dd679ffb4362d2d4;
|
|
350
|
+
const $cb5cc270b50c6fcd$export$7c6e2c02157bb7d2 = $cb5cc270b50c6fcd$export$d7e1f420b25549ff;
|
|
351
|
+
|
|
352
|
+
const BtIconCalender = (props) =>
|
|
353
|
+
/*#__PURE__*/ React__default["default"].createElement(
|
|
354
|
+
"svg",
|
|
355
|
+
Object.assign(
|
|
356
|
+
{
|
|
357
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
358
|
+
viewBox: "0 0 32 32",
|
|
359
|
+
},
|
|
360
|
+
props,
|
|
361
|
+
),
|
|
362
|
+
/*#__PURE__*/ React__default["default"].createElement("defs", null),
|
|
363
|
+
/*#__PURE__*/ React__default["default"].createElement("path", {
|
|
364
|
+
d: "M27,7H25V4.5a.5.5,0,0,0-1,0V7H8V4.5a.5.5,0,0,0-1,0V7H5A1.003,1.003,0,0,0,4,8V27a1.003,1.003,0,0,0,1,1H27a1.003,1.003,0,0,0,1-1V8A1.003,1.003,0,0,0,27,7ZM7,8v.5a.5.5,0,0,0,1,0V8H24v.5a.5.5,0,0,0,1,0V8h2v4H5V8ZM5,27V13H27V27Z",
|
|
365
|
+
fill: "currentColor",
|
|
366
|
+
}),
|
|
367
|
+
);
|
|
368
|
+
|
|
369
|
+
var formatDate = function (value) {
|
|
370
|
+
return Calendar.format(value, DATE_FORMAT);
|
|
371
|
+
};
|
|
372
|
+
|
|
373
|
+
var isDisabledDate = function (disabledDates, date) {
|
|
374
|
+
return Boolean(disabledDates &&
|
|
375
|
+
disabledDates.find(function (disabledDate) { return isSameDay(date, disabledDate); }));
|
|
376
|
+
};
|
|
377
|
+
|
|
378
|
+
var convertDateStringToDate = function (value) {
|
|
379
|
+
if (value === void 0) { value = ""; }
|
|
380
|
+
var _a = parseDateString(value), day = _a.day, month = _a.month, year = _a.year;
|
|
381
|
+
var isValidDate = isDateValid(value);
|
|
382
|
+
return isValidDate ? new Date("".concat(year, "-").concat(month, "-").concat(day)) : new Date();
|
|
383
|
+
};
|
|
384
|
+
|
|
385
|
+
var convertRangeStringToDates = function (value) {
|
|
386
|
+
if (value === void 0) { value = ""; }
|
|
387
|
+
var _a = parseRangeString(value), start = _a.start, end = _a.end;
|
|
388
|
+
return filterDataAttrs.__spreadArray(filterDataAttrs.__spreadArray([], (isDateValid(start.date)
|
|
389
|
+
? [new Date("".concat(start.year, "-").concat(start.month, "-").concat(start.day))]
|
|
390
|
+
: []), true), (isDateValid(end.date)
|
|
391
|
+
? [new Date("".concat(end.year, "-").concat(end.month, "-").concat(end.day))]
|
|
392
|
+
: []), true);
|
|
393
|
+
};
|
|
394
|
+
|
|
395
|
+
var DatePicker = React.forwardRef(function (_a, ref) {
|
|
396
|
+
var errorMessage = _a.errorMessage, helper = _a.helper, id = _a.id, label = _a.label, isDisabled = _a.isDisabled, isReadOnly = _a.isReadOnly, isRequired = _a.isRequired, labelSize = _a.labelSize, inputSize = _a.inputSize, _b = _a.value, value = _b === void 0 ? "" : _b, name = _a.name, onBlur = _a.onBlur, onChange = _a.onChange, onDateSelect = _a.onDateSelect, onRangeSelect = _a.onRangeSelect, onClickDisclosure = _a.onClickDisclosure, disclosureTitle = _a.disclosureTitle, disclosureText = _a.disclosureText, type = _a.type, _c = _a.isFluid, isFluid = _c === void 0 ? false : _c, _d = _a.selectionType, selectionType = _d === void 0 ? "single" : _d, disabledDates = _a.disabledDates, minDate = _a.minDate, maxDate = _a.maxDate, props = filterDataAttrs.__rest(_a, ["errorMessage", "helper", "id", "label", "isDisabled", "isReadOnly", "isRequired", "labelSize", "inputSize", "value", "name", "onBlur", "onChange", "onDateSelect", "onRangeSelect", "onClickDisclosure", "disclosureTitle", "disclosureText", "type", "isFluid", "selectionType", "disabledDates", "minDate", "maxDate"]);
|
|
397
|
+
var arcRootElement = React.useContext(Base.ArcRootElementContext);
|
|
398
|
+
var _e = React.useState("Choose date"), ariaLabel = _e[0], setAriaLabel = _e[1];
|
|
399
|
+
var _f = React.useState(false), showCalendar = _f[0], setShowCalendar = _f[1];
|
|
400
|
+
var buttonRef = React.useRef(null);
|
|
401
|
+
var ourRef = React.useRef(null);
|
|
402
|
+
var previousValidValue = React.useRef(value);
|
|
403
|
+
var lowerCaseDateFormat = DATE_FORMAT.toLowerCase();
|
|
404
|
+
var placeHolder = selectionType === "range"
|
|
405
|
+
? "".concat(lowerCaseDateFormat, " - ").concat(lowerCaseDateFormat)
|
|
406
|
+
: lowerCaseDateFormat;
|
|
407
|
+
React.useEffect(function () {
|
|
408
|
+
if (selectionType === "single" &&
|
|
409
|
+
isDateValid(value) &&
|
|
410
|
+
!isDisabledDate(disabledDates, convertDateStringToDate(value))) {
|
|
411
|
+
previousValidValue.current = value;
|
|
412
|
+
}
|
|
413
|
+
if (selectionType === "range" && isRangeValid(value)) {
|
|
414
|
+
var rangeHasDisabledDates = convertRangeStringToDates(value).some(function (rangeValue) { return isDisabledDate(disabledDates, rangeValue); });
|
|
415
|
+
if (!rangeHasDisabledDates) {
|
|
416
|
+
previousValidValue.current = value;
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
}, [value, disabledDates, selectionType]);
|
|
420
|
+
var getDatePickerRef = function (elementRef) {
|
|
421
|
+
ourRef.current = elementRef;
|
|
422
|
+
if (ref && typeof ref === "object") {
|
|
423
|
+
ref.current = elementRef;
|
|
424
|
+
}
|
|
425
|
+
if (ref && typeof ref === "function") {
|
|
426
|
+
ref(elementRef);
|
|
427
|
+
}
|
|
428
|
+
};
|
|
429
|
+
var dispatchChangeEvent = function (e, value) {
|
|
430
|
+
onChange &&
|
|
431
|
+
onChange(filterDataAttrs.__assign(filterDataAttrs.__assign({}, e), { target: filterDataAttrs.__assign(filterDataAttrs.__assign({}, e.target), { value: value }) }));
|
|
432
|
+
};
|
|
433
|
+
var handleRangeSelect = function (rangeSelection) {
|
|
434
|
+
var start = formatDate(rangeSelection.start);
|
|
435
|
+
var end = rangeSelection.end ? formatDate(rangeSelection.end) : null;
|
|
436
|
+
onRangeSelect &&
|
|
437
|
+
onRangeSelect(filterDataAttrs.__assign(filterDataAttrs.__assign({}, rangeSelection), { formattedRange: "".concat(start).concat(end ? " - ".concat(end) : "") }));
|
|
438
|
+
rangeSelection.isSelectionComplete && setShowCalendar(false);
|
|
439
|
+
};
|
|
440
|
+
var handleDateSelect = function (value) {
|
|
441
|
+
onDateSelect &&
|
|
442
|
+
onDateSelect({
|
|
443
|
+
date: value,
|
|
444
|
+
formattedDate: formatDate(value)
|
|
445
|
+
});
|
|
446
|
+
setShowCalendar(false);
|
|
447
|
+
};
|
|
448
|
+
var handleSingleSelectionBlur = function (e) {
|
|
449
|
+
if (value && isDateValid(value) && selectionType === "single") {
|
|
450
|
+
var _a = parseDateString(value), day = _a.day, month = _a.month, year = _a.year;
|
|
451
|
+
var date = new Date("".concat(year, "-").concat(month, "-").concat(day));
|
|
452
|
+
var isDateBeforeMinDate = minDate && Calendar.isBefore(date, minDate);
|
|
453
|
+
var isDateAfterMaxDate = maxDate && Calendar.isAfter(date, maxDate);
|
|
454
|
+
var isDisabledValue = isDisabledDate(disabledDates, date);
|
|
455
|
+
if (isDateBeforeMinDate) {
|
|
456
|
+
return dispatchChangeEvent(e, "".concat(formatDate(minDate)));
|
|
457
|
+
}
|
|
458
|
+
if (isDateAfterMaxDate) {
|
|
459
|
+
return dispatchChangeEvent(e, "".concat(formatDate(maxDate)));
|
|
460
|
+
}
|
|
461
|
+
if (isDisabledValue) {
|
|
462
|
+
var date_1 = previousValidValue.current
|
|
463
|
+
? convertDateStringToDate(previousValidValue.current)
|
|
464
|
+
: new Date();
|
|
465
|
+
return dispatchChangeEvent(e, "".concat(formatDate(date_1)));
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
};
|
|
469
|
+
var handleRangeSelectionBlur = function (e) {
|
|
470
|
+
if (isRangeValid(value) && selectionType === "range") {
|
|
471
|
+
var _a = convertRangeStringToDates(value), start = _a[0], end = _a[1];
|
|
472
|
+
var isStartDateBeforeMinDate = minDate && Calendar.isBefore(start, minDate);
|
|
473
|
+
var isEndDateAfterMaxDate = maxDate && Calendar.isAfter(end, maxDate);
|
|
474
|
+
var isStartDateDisabled = isDisabledDate(disabledDates, start);
|
|
475
|
+
var isEndDateDisabled = isDisabledDate(disabledDates, end);
|
|
476
|
+
if (isStartDateBeforeMinDate && isEndDateAfterMaxDate) {
|
|
477
|
+
return dispatchChangeEvent(e, "".concat(formatDate(minDate), " - ").concat(formatDate(maxDate)));
|
|
478
|
+
}
|
|
479
|
+
if (isStartDateBeforeMinDate) {
|
|
480
|
+
return dispatchChangeEvent(e, "".concat(formatDate(minDate), " - ").concat(formatDate(end)));
|
|
481
|
+
}
|
|
482
|
+
if (isEndDateAfterMaxDate) {
|
|
483
|
+
return dispatchChangeEvent(e, "".concat(formatDate(start), " - ").concat(formatDate(maxDate)));
|
|
484
|
+
}
|
|
485
|
+
if (isStartDateDisabled || isEndDateDisabled) {
|
|
486
|
+
var _b = previousValidValue.current
|
|
487
|
+
? convertRangeStringToDates(previousValidValue.current)
|
|
488
|
+
: [], start_1 = _b[0], end_1 = _b[1];
|
|
489
|
+
return dispatchChangeEvent(e, start_1 && end_1 ? "".concat(formatDate(start_1), " - ").concat(formatDate(end_1)) : "");
|
|
490
|
+
}
|
|
491
|
+
if (Calendar.isAfter(start, end)) {
|
|
492
|
+
var _c = [start, end].sort(Calendar.compareAsc), orderedStart = _c[0], orderedEnd = _c[1];
|
|
493
|
+
return dispatchChangeEvent(e, "".concat(formatDate(orderedStart), " - ").concat(formatDate(orderedEnd)));
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
};
|
|
497
|
+
var handleBlur = function (e) {
|
|
498
|
+
onBlur && onBlur(e);
|
|
499
|
+
if (selectionType === "single") {
|
|
500
|
+
handleSingleSelectionBlur(e);
|
|
501
|
+
}
|
|
502
|
+
if (selectionType === "range") {
|
|
503
|
+
handleRangeSelectionBlur(e);
|
|
504
|
+
}
|
|
505
|
+
};
|
|
506
|
+
var handleChange = function (e) {
|
|
507
|
+
onChange && onChange(e);
|
|
508
|
+
};
|
|
509
|
+
var handleCalendarOpenChange = function (isOpen) {
|
|
510
|
+
if (document.activeElement)
|
|
511
|
+
setShowCalendar(isOpen);
|
|
512
|
+
};
|
|
513
|
+
var handleIconClick = function () {
|
|
514
|
+
var _a;
|
|
515
|
+
!((_a = ourRef.current) === null || _a === void 0 ? void 0 : _a.contains(document.activeElement)) &&
|
|
516
|
+
!isDisabled &&
|
|
517
|
+
!isReadOnly &&
|
|
518
|
+
setShowCalendar(true);
|
|
519
|
+
};
|
|
520
|
+
var handleIconFocus = function () {
|
|
521
|
+
if (selectionType === "range" && isRangeValid(value)) {
|
|
522
|
+
var _a = convertRangeStringToDates(value), start = _a[0], end = _a[1];
|
|
523
|
+
return setAriaLabel("Change dates, currently selected dates are ".concat(Calendar.format(start, "EEEE do MMMM, yyyy"), " to ").concat(Calendar.format(end, "EEEE do MMMM, yyyy")));
|
|
524
|
+
}
|
|
525
|
+
if (selectionType === "single" && isDateValid(value)) {
|
|
526
|
+
var date = convertDateStringToDate(value);
|
|
527
|
+
return setAriaLabel("Change date, currently selected date is ".concat(Calendar.format(date, "EEEE do MMMM, yyyy")));
|
|
528
|
+
}
|
|
529
|
+
setAriaLabel("Choose Date");
|
|
530
|
+
};
|
|
531
|
+
var handleCalendarClose = function () {
|
|
532
|
+
var _a, _b;
|
|
533
|
+
if (((_a = document.activeElement) === null || _a === void 0 ? void 0 : _a.tagName) === "BODY") {
|
|
534
|
+
(_b = buttonRef.current) === null || _b === void 0 ? void 0 : _b.focus();
|
|
535
|
+
}
|
|
536
|
+
};
|
|
537
|
+
var onCancelClick = function () {
|
|
538
|
+
setShowCalendar(false);
|
|
539
|
+
};
|
|
540
|
+
var handleAutoFocus = function (e) {
|
|
541
|
+
e.preventDefault();
|
|
542
|
+
};
|
|
543
|
+
return (React__default["default"].createElement("div", { className: index$4.classNames({
|
|
544
|
+
"arc-DatePicker--constrained": !isFluid
|
|
545
|
+
}) },
|
|
546
|
+
React__default["default"].createElement(TextInput.TextInput, filterDataAttrs.__assign({ ref: getDatePickerRef, iconButton: {
|
|
547
|
+
onClick: handleIconClick,
|
|
548
|
+
onFocus: handleIconFocus,
|
|
549
|
+
icon: BtIconCalender,
|
|
550
|
+
label: ariaLabel,
|
|
551
|
+
ref: buttonRef
|
|
552
|
+
}, placeholder: placeHolder, errorMessage: errorMessage, helper: helper, id: id, isDisabled: isDisabled, isReadOnly: isReadOnly, isRequired: isRequired, label: label, labelSize: labelSize, maxLength: selectionType === "range" ? 23 : 10, name: name, onBlur: handleBlur, onChange: handleChange, onClickDisclosure: onClickDisclosure, type: "text", value: value, disclosureTitle: disclosureTitle, disclosureText: disclosureText, inputSize: inputSize }, props)),
|
|
553
|
+
React__default["default"].createElement($cb5cc270b50c6fcd$export$be92b6f5f03c0fe9, { open: showCalendar, onOpenChange: handleCalendarOpenChange },
|
|
554
|
+
React__default["default"].createElement($cb5cc270b50c6fcd$export$b688253958b8dfe7, null),
|
|
555
|
+
React__default["default"].createElement($cb5cc270b50c6fcd$export$602eac185826482c, { container: arcRootElement || undefined },
|
|
556
|
+
React__default["default"].createElement($cb5cc270b50c6fcd$export$7c6e2c02157bb7d2, { align: "start", "aria-modal": "true", "aria-label": "Choose Date", className: "arc-DatePicker-modal", onOpenAutoFocus: handleAutoFocus, onCloseAutoFocus: handleCalendarClose },
|
|
557
|
+
React__default["default"].createElement(Calendar.Calendar, { autoFocusOnMount: true, type: type, onCancelClick: onCancelClick, selectionType: selectionType, selectedDate: convertDateStringToDate(value), selectedRange: convertRangeStringToDates(value), disabledDates: disabledDates, minDate: minDate, maxDate: maxDate, onDateSelect: handleDateSelect, onRangeSelect: handleRangeSelect }))))));
|
|
558
|
+
});
|
|
559
|
+
|
|
560
|
+
exports.DATE_FORMAT = DATE_FORMAT;
|
|
561
|
+
exports.DatePicker = DatePicker;
|
|
562
|
+
exports.isDateValid = isDateValid;
|
|
563
|
+
exports.isRangeValid = isRangeValid;
|
|
564
|
+
exports.parseDateString = parseDateString;
|
|
565
|
+
exports.parseRangeString = parseRangeString;
|