@arc-ui/components 12.0.0-beta.22 → 12.0.0-beta.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/Alert/Alert.cjs +22 -21
- package/lib/Alert/Alert.mjs +22 -21
- package/lib/Alert/styles.css +1 -1
- package/lib/Align/styles.css +1 -1
- package/lib/AppButton/styles.css +1 -1
- package/lib/Avatar/styles.css +1 -1
- package/lib/AvatarGroup/styles.css +1 -1
- package/lib/Badge/styles.css +1 -1
- package/lib/Banner/Banner.cjs +1 -1
- package/lib/Banner/Banner.mjs +1 -1
- package/lib/Box/styles.css +1 -1
- package/lib/BrandLogo/styles.css +1 -1
- package/lib/Breadcrumbs/Breadcrumbs.cjs +12 -3
- package/lib/Breadcrumbs/Breadcrumbs.mjs +12 -3
- package/lib/Breadcrumbs/styles.css +1 -1
- package/lib/Button/styles.css +1 -1
- package/lib/ButtonGroup/styles.css +1 -1
- package/lib/ButtonV2/styles.css +1 -1
- package/lib/Calendar/Calendar.cjs +2 -2
- package/lib/Calendar/Calendar.mjs +2 -2
- package/lib/Calendar/styles.css +1 -1
- package/lib/CardFooter/styles.css +1 -1
- package/lib/CardHeading/styles.css +1 -1
- package/lib/Carousel/Carousel.cjs +11 -5
- package/lib/Carousel/Carousel.mjs +8 -2
- package/lib/Carousel/styles.css +1 -1
- package/lib/Checkbox/Checkbox.cjs +85 -11
- package/lib/Checkbox/Checkbox.mjs +87 -9
- package/lib/Checkbox/styles.css +1 -1
- package/lib/Columns/styles.css +1 -1
- package/lib/ComboBox/ComboBox.cjs +276 -11
- package/lib/ComboBox/ComboBox.mjs +279 -10
- package/lib/ComboBox/styles.css +1 -1
- package/lib/ContentSwitcher/ContentSwitcher.cjs +5 -6
- package/lib/ContentSwitcher/ContentSwitcher.mjs +5 -6
- package/lib/ContentSwitcher/styles.css +1 -1
- package/lib/ContentSwitcherDropdown/styles.css +1 -1
- package/lib/DatePicker/DatePicker.cjs +351 -38
- package/lib/DatePicker/DatePicker.mjs +329 -17
- package/lib/DatePicker/styles.css +1 -1
- package/lib/Disclosure/styles.css +1 -1
- package/lib/DisclosureMini/styles.css +1 -1
- package/lib/Download/styles.css +1 -1
- package/lib/Drawer/styles.css +1 -1
- package/lib/Elevation/styles.css +1 -1
- package/lib/Filter/styles.css +1 -1
- package/lib/FormControl/styles.css +1 -1
- package/lib/GhostedHeroBanner/styles.css +1 -1
- package/lib/GradientPageBackground/GradientPageBackground.cjs +55 -43
- package/lib/GradientPageBackground/GradientPageBackground.mjs +55 -43
- package/lib/GradientPageBackground/styles.css +1 -1
- package/lib/Grid/styles.css +1 -1
- package/lib/Group/styles.css +1 -1
- package/lib/Heading/styles.css +1 -1
- package/lib/HeroBanner/HeroBanner.cjs +1 -1
- package/lib/HeroBanner/HeroBanner.mjs +1 -1
- package/lib/HeroBanner/styles.css +1 -1
- package/lib/HeroButton/HeroButton.cjs +77 -9
- package/lib/HeroButton/HeroButton.mjs +80 -8
- package/lib/HeroButton/styles.css +1 -1
- package/lib/Hidden/styles.css +1 -1
- package/lib/HorizontalCard/styles.css +1 -1
- package/lib/Icon/styles.css +1 -1
- package/lib/Image/styles.css +1 -1
- package/lib/ImpactCard/ImpactCard.cjs +3 -3
- package/lib/ImpactCard/ImpactCard.mjs +3 -3
- package/lib/ImpactCard/styles.css +1 -1
- package/lib/InformationCard/InformationCard.cjs +6 -6
- package/lib/InformationCard/InformationCard.mjs +6 -6
- package/lib/InformationCard/styles.css +1 -1
- package/lib/Link/Link.cjs +1 -1
- package/lib/Link/Link.mjs +1 -1
- package/lib/Link/styles.css +1 -1
- package/lib/Markup/styles.css +1 -1
- package/lib/MediaCard/MediaCard.cjs +53 -14
- package/lib/MediaCard/MediaCard.mjs +55 -12
- package/lib/MediaCard/styles.css +1 -1
- package/lib/Menu/Menu.cjs +1327 -25
- package/lib/Menu/Menu.mjs +1292 -9
- package/lib/Menu/styles.css +1 -1
- package/lib/Modal/styles.css +1 -1
- package/lib/NavigationHeader/NavigationHeader.cjs +743 -16
- package/lib/NavigationHeader/NavigationHeader.mjs +734 -7
- package/lib/NavigationHeader/styles.css +1 -1
- package/lib/Pagination/styles.css +1 -1
- package/lib/PaginationSimple/styles.css +1 -1
- package/lib/Popover/styles.css +1 -1
- package/lib/Poster/styles.css +1 -1
- package/lib/ProgressBar/styles.css +1 -1
- package/lib/ProgressStepper/styles.css +1 -1
- package/lib/ProgressStepperOverflow/ProgressStepperOverflow.cjs +138 -7
- package/lib/ProgressStepperOverflow/ProgressStepperOverflow.mjs +140 -5
- package/lib/ProgressStepperOverflow/styles.css +1 -1
- package/lib/RadioCardGroup/RadioCardGroup.cjs +48 -7
- package/lib/RadioCardGroup/RadioCardGroup.mjs +48 -8
- package/lib/RadioCardGroup/styles.css +1 -1
- package/lib/RadioGroup/RadioGroup.cjs +50 -8
- package/lib/RadioGroup/RadioGroup.mjs +49 -8
- package/lib/RadioGroup/styles.css +1 -1
- package/lib/Rule/styles.css +1 -1
- package/lib/ScrollToTop/styles.css +1 -1
- package/lib/Section/Section.cjs +1 -1
- package/lib/Section/Section.mjs +1 -1
- package/lib/Section/styles.css +1 -1
- package/lib/Select/styles.css +1 -1
- package/lib/SiteFooter/SiteFooter.cjs +1 -1
- package/lib/SiteFooter/SiteFooter.mjs +1 -1
- package/lib/SiteFooter/styles.css +1 -1
- package/lib/SiteFooterV2/SiteFooterV2.cjs +6 -5
- package/lib/SiteFooterV2/SiteFooterV2.mjs +6 -5
- package/lib/SiteFooterV2/styles.css +1 -1
- package/lib/SiteHeaderV2/SiteHeaderV2.cjs +440 -15
- package/lib/SiteHeaderV2/SiteHeaderV2.mjs +435 -11
- package/lib/SiteHeaderV2/styles.css +1 -1
- package/lib/Skeleton/styles.css +1 -1
- package/lib/SkipLink/styles.css +1 -1
- package/lib/Spinner/styles.css +1 -1
- package/lib/Surface/styles.css +1 -1
- package/lib/Switch/styles.css +1 -1
- package/lib/TabbedBanner/TabbedBanner.cjs +4 -5
- package/lib/TabbedBanner/TabbedBanner.mjs +4 -5
- package/lib/TabbedBanner/styles.css +1 -1
- package/lib/Tabs/Tabs.mjs +1 -1
- package/lib/Tabs/styles.css +1 -1
- package/lib/Tag/Tag.cjs +9 -9
- package/lib/Tag/Tag.mjs +9 -9
- package/lib/Tag/styles.css +1 -1
- package/lib/TemplateBanner/TemplateBanner.cjs +1 -1
- package/lib/TemplateBanner/TemplateBanner.mjs +1 -1
- package/lib/TemplateBanner/styles.css +1 -1
- package/lib/Text/styles.css +1 -1
- package/lib/TextArea/TextArea.cjs +2 -53
- package/lib/TextArea/TextArea.mjs +2 -53
- package/lib/TextArea/styles.css +1 -1
- package/lib/TextInput/styles.css +1 -1
- package/lib/Theme/Theme.cjs +1 -1
- package/lib/Theme/Theme.mjs +1 -1
- package/lib/Theme/styles.css +1 -1
- package/lib/ThemeIcon/styles.css +1 -1
- package/lib/ThumbnailSignpost/styles.css +1 -1
- package/lib/Toast/styles.css +1 -1
- package/lib/Tooltip/styles.css +1 -1
- package/lib/Truncate/styles.css +1 -1
- package/lib/TypographyCard/TypographyCard.cjs +3 -3
- package/lib/TypographyCard/TypographyCard.mjs +3 -3
- package/lib/TypographyCard/styles.css +1 -1
- package/lib/UniversalHeader/styles.css +1 -1
- package/lib/VerticalSpace/styles.css +1 -1
- package/lib/VideoPlayer/styles.css +1 -1
- package/lib/Visible/styles.css +1 -1
- package/lib/VisuallyHidden/styles.css +1 -1
- package/lib/_shared/cjs/{Calendar-B-va25n2.cjs → Calendar-Bfdgf5q1.cjs} +1 -1
- package/lib/_shared/cjs/{ContentSwitcherList-bCEzIPN2.cjs → ContentSwitcherList-pcYtuT6L.cjs} +8 -0
- package/lib/_shared/cjs/{Link-7xUgVf1I.cjs → Link-C3OSQIIk.cjs} +3 -1
- package/lib/_shared/cjs/{Section-wUVdzmGA.cjs → Section-Bz2fwj8Z.cjs} +2 -2
- package/lib/_shared/cjs/{TemplateBanner-CImrJ9ON.cjs → TemplateBanner-COymAI91.cjs} +2 -2
- package/lib/_shared/cjs/{arc-breakpoints-DWUgmeLA.cjs → arc-breakpoints-CS8JVk5T.cjs} +1 -1
- package/lib/_shared/cjs/{index.es-DlNskPlN.cjs → index.es-fkulh7qu.cjs} +1 -1
- package/lib/_shared/esm/{Calendar-Bd2_eT1Y.mjs → Calendar-Drh_NJ9I.mjs} +1 -1
- package/lib/_shared/esm/{ContentSwitcherList-bCQz0qkU.mjs → ContentSwitcherList-DwHfU3no.mjs} +10 -3
- package/lib/_shared/esm/{Link-Biyg9qBH.mjs → Link-DxjGH_7f.mjs} +3 -1
- package/lib/_shared/esm/{Section-DDygQ5Az.mjs → Section-7InCvzfh.mjs} +2 -2
- package/lib/_shared/esm/{TemplateBanner-DeHjliNP.mjs → TemplateBanner-Dkgzu3A5.mjs} +2 -2
- package/lib/_shared/esm/{arc-breakpoints-D5hR5m3t.mjs → arc-breakpoints-D7Ie4kBt.mjs} +1 -1
- package/lib/_shared/esm/{index-BDWwJ5x2.mjs → index-BWkI4Dwz.mjs} +1 -1
- package/lib/_shared/esm/{index.es-C3WqfFKH.mjs → index.es-CtRkzfKP.mjs} +2 -2
- package/lib/index.cjs +300 -283
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +28 -3
- package/lib/index.d.mts +28 -3
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +301 -284
- package/lib/index.mjs.map +1 -1
- package/lib/styles.css +10 -10
- package/package.json +8 -8
- package/lib/_shared/cjs/BreadcrumbsLink-CDmk3Y3m.cjs +0 -18
- package/lib/_shared/cjs/Checkbox-DfZMjO1Y.cjs +0 -88
- package/lib/_shared/cjs/ComboBox-BGUhlqx1.cjs +0 -281
- package/lib/_shared/cjs/ContentSwitcherTab-B387Qs3I.cjs +0 -14
- package/lib/_shared/cjs/DatePicker-Dt4faA_N.cjs +0 -334
- package/lib/_shared/cjs/HeroButton-CrzkTUwP.cjs +0 -82
- package/lib/_shared/cjs/MediaCard-BEZFbiYO.cjs +0 -57
- package/lib/_shared/cjs/MenuItemMultiLevelContent-vLr6hSBm.cjs +0 -1328
- package/lib/_shared/cjs/ProgressStepperOverflow-BAGZNC26.cjs +0 -142
- package/lib/_shared/cjs/RadioCardGroupInput-CeUM3yPS.cjs +0 -53
- package/lib/_shared/cjs/RadioGroupInput-w2qkfsnG.cjs +0 -54
- package/lib/_shared/cjs/SiteHeaderV2NavItemWithSubNav-CagFKPEa.cjs +0 -445
- package/lib/_shared/cjs/kebabCase-D5yA6u-V.cjs +0 -743
- package/lib/_shared/cjs/keynames-Cx13-hWr.cjs +0 -8
- package/lib/_shared/esm/BreadcrumbsLink-BxTurGNa.mjs +0 -16
- package/lib/_shared/esm/Checkbox-CwOHzlQF.mjs +0 -86
- package/lib/_shared/esm/ComboBox-CRlJjeev.mjs +0 -279
- package/lib/_shared/esm/ContentSwitcherTab-CfC3PGeZ.mjs +0 -12
- package/lib/_shared/esm/DatePicker-DT4OEzxP.mjs +0 -324
- package/lib/_shared/esm/HeroButton-jdjjV_Gf.mjs +0 -80
- package/lib/_shared/esm/MediaCard-DqMaNWsE.mjs +0 -55
- package/lib/_shared/esm/MenuItemMultiLevelContent-JTOHqpzg.mjs +0 -1296
- package/lib/_shared/esm/ProgressStepperOverflow-fPkLltVO.mjs +0 -140
- package/lib/_shared/esm/RadioCardGroupInput-D7W28geB.mjs +0 -50
- package/lib/_shared/esm/RadioGroupInput-zAWSV29m.mjs +0 -50
- package/lib/_shared/esm/SiteHeaderV2NavItemWithSubNav-CxGwdV6u.mjs +0 -439
- package/lib/_shared/esm/kebabCase-CCEMRBfd.mjs +0 -737
- package/lib/_shared/esm/keynames-B5whqsjh.mjs +0 -8
|
@@ -1,25 +1,24 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var ContentSwitcherList = require('../_shared/cjs/ContentSwitcherList-
|
|
5
|
-
var ContentSwitcherTab = require('../_shared/cjs/ContentSwitcherTab-B387Qs3I.cjs');
|
|
4
|
+
var ContentSwitcherList = require('../_shared/cjs/ContentSwitcherList-pcYtuT6L.cjs');
|
|
6
5
|
require('../_shared/cjs/filter-attrs-eK6E_34o.cjs');
|
|
7
6
|
require('react');
|
|
8
7
|
require('../_shared/cjs/index-BCu-VH8y.cjs');
|
|
9
8
|
require('../_shared/cjs/index-CztwwwKE.cjs');
|
|
10
9
|
require('react-dom');
|
|
11
10
|
require('../_shared/cjs/index-DmvtEa22.cjs');
|
|
12
|
-
require('../_shared/cjs/debounce-uPMetQ6J.cjs');
|
|
13
|
-
require('../_shared/cjs/index-CTlXMLug.cjs');
|
|
14
|
-
require('../_shared/cjs/isSymbol-BGrHFUbV.cjs');
|
|
15
11
|
require('../_shared/cjs/Text-Cr5nmYmx.cjs');
|
|
12
|
+
require('../_shared/cjs/index-CTlXMLug.cjs');
|
|
16
13
|
require('../_shared/cjs/suffix-modifier-DLUGR-yG.cjs');
|
|
17
14
|
require('../_shared/cjs/index-DR8Rkav9.cjs');
|
|
18
15
|
require('../_shared/cjs/Surface-BFx1yNsq.cjs');
|
|
16
|
+
require('../_shared/cjs/debounce-uPMetQ6J.cjs');
|
|
17
|
+
require('../_shared/cjs/isSymbol-BGrHFUbV.cjs');
|
|
19
18
|
|
|
20
19
|
|
|
21
20
|
|
|
22
21
|
exports.ContentSwitcher = ContentSwitcherList.ContentSwitcher;
|
|
23
22
|
exports.ContentSwitcherContent = ContentSwitcherList.ContentSwitcherContent;
|
|
24
23
|
exports.ContentSwitcherList = ContentSwitcherList.ContentSwitcherList;
|
|
25
|
-
exports.ContentSwitcherTab =
|
|
24
|
+
exports.ContentSwitcherTab = ContentSwitcherList.ContentSwitcherTab;
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { C as ContentSwitcher,
|
|
3
|
-
export { C as ContentSwitcherTab } from '../_shared/esm/ContentSwitcherTab-CfC3PGeZ.mjs';
|
|
2
|
+
export { C as ContentSwitcher, b as ContentSwitcherContent, c as ContentSwitcherList, a as ContentSwitcherTab } from '../_shared/esm/ContentSwitcherList-DwHfU3no.mjs';
|
|
4
3
|
import '../_shared/esm/filter-attrs-B6CM-NUr.mjs';
|
|
5
4
|
import 'react';
|
|
6
|
-
import '../_shared/esm/index-
|
|
5
|
+
import '../_shared/esm/index-BWkI4Dwz.mjs';
|
|
7
6
|
import '../_shared/esm/index-DXHprNQ6.mjs';
|
|
8
7
|
import 'react-dom';
|
|
9
8
|
import '../_shared/esm/index-6HtUz28p.mjs';
|
|
10
|
-
import '../_shared/esm/debounce-D_Nx5go6.mjs';
|
|
11
|
-
import '../_shared/esm/index-5C0-U8cc.mjs';
|
|
12
|
-
import '../_shared/esm/isSymbol-DgWNE2Tm.mjs';
|
|
13
9
|
import '../_shared/esm/Text-CBlnm5CT.mjs';
|
|
10
|
+
import '../_shared/esm/index-5C0-U8cc.mjs';
|
|
14
11
|
import '../_shared/esm/suffix-modifier-B_pO0UkF.mjs';
|
|
15
12
|
import '../_shared/esm/index-Spae4j7j.mjs';
|
|
16
13
|
import '../_shared/esm/Surface-Colbp3Zx.mjs';
|
|
14
|
+
import '../_shared/esm/debounce-D_Nx5go6.mjs';
|
|
15
|
+
import '../_shared/esm/isSymbol-DgWNE2Tm.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.arc-v12-0-0-beta-
|
|
1
|
+
.arc-v12-0-0-beta-23 .arc .arc-ContentSwitcherTab{align-items:center;background:var(--content-switcher-colors-light-bg-default);border:none;border-radius:var(--content-switcher-border-radius-pill);display:flex;height:48px;max-width:300px;padding:var(--content-switcher-padding-m) var(--content-switcher-padding-l);transition:background 0.3s ease;white-space:nowrap}.arc-v12-0-0-beta-23 .arc .arc-ContentSwitcherTab>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.arc-v12-0-0-beta-23 .arc .arc-ContentSwitcherTab:hover{background:var(--content-switcher-colors-light-bg-hover);cursor:pointer}.arc-v12-0-0-beta-23 .arc .arc-ContentSwitcherTab:focus-visible{outline:var(--focus-border-weight-s) solid var(--focus-colors-light-border-subtle);outline-offset:2px}.arc-v12-0-0-beta-23 .arc .arc-ContentSwitcherTab[data-state="active"]{background:var(--content-switcher-colors-light-bg-default-alt);color:var(--content-switcher-colors-light-text-default-alt)}:root{--arc-content-switcher-height:48px;--arc-content-switcher-padding-s:10px;--arc-content-switcher-height-plus-padding:calc(var(--arc-content-switcher-height) + (var(--arc-content-switcher-padding-s) * 2))}.arc-v12-0-0-beta-23 .arc .arc-ContentSwitcherList{background:var(--content-switcher-colors-light-bg-default);border-radius:var(--sem-border-radius-xxl);box-shadow:var(--content-switcher-elevations-02,0 0 1px 0 rgba(0,0,0,0.25),0 4px 12px 0 rgba(0,0,0,0.1));margin-bottom:10px;overflow:scroll;-ms-overflow-style:none;position:relative;scrollbar-width:none;text-align:center;z-index:1}.arc-v12-0-0-beta-23 .arc .arc-ContentSwitcherList-wrapper--isInset .arc-ContentSwitcherList{margin-bottom:0}.arc-v12-0-0-beta-23 .arc .arc-ContentSwitcherList::-webkit-scrollbar{display:none}.arc-v12-0-0-beta-23 .arc .arc-ContentSwitcherList-overflowWrapper{height:calc(var(--arc-content-switcher-height) + (var(--content-switcher-padding-s) * 2));left:50%;pointer-events:none;position:absolute;top:0;transform:translateX(-50%);width:100%;z-index:2}.arc-v12-0-0-beta-23 .arc .arc-ContentSwitcherList-wrapper{display:flex;justify-content:center;margin:0 32px;position:relative}.arc-v12-0-0-beta-23 .arc .arc-ContentSwitcherList-inner{display:inline-flex;gap:var(--content-switcher-padding-s);padding:10px}.arc-v12-0-0-beta-23 .arc .arc-ContentSwitcherList--rightOverflow,.arc-v12-0-0-beta-23 .arc .arc-ContentSwitcherList--leftOverflow{content:"";display:block;height:100%;pointer-events:none;position:absolute;top:0;width:96px}.arc-v12-0-0-beta-23 .arc .arc-ContentSwitcherList--rightOverflow{background:linear-gradient(90deg,rgba(255,255,255,0) 0.61%,#ffffff 75.15%);border-radius:0 var(--sem-border-radius-xxl) var(--sem-border-radius-xxl) 0;right:0}.arc-v12-0-0-beta-23 .arc .arc-ContentSwitcherList--leftOverflow{background:linear-gradient(270deg,rgba(255,255,255,0) 0.61%,#ffffff 75.15%);border-radius:var(--sem-border-radius-xxl) 0 0 var(--sem-border-radius-xxl);left:0}.arc-v12-0-0-beta-23 .arc .arc-ContentSwitcherList-wrapper--isInset{margin-bottom:calc((var(--arc-content-switcher-height-plus-padding)/2) * -1)}.arc-v12-0-0-beta-23 .arc .arc-ContentSwitcherContent{animation:0.5s ease fade-in}.arc-v12-0-0-beta-23 .arc .arc-ContentSwitcherContent[data-state="inactive"]{display:none}.arc-v12-0-0-beta-23 .arc .arc-ContentSwitcherContent-wrapper{display:flex;justify-content:center}@keyframes fade-in{from{opacity:0}to{opacity:1}}.arc-v12-0-0-beta-23 .arc .arc-ContentSwitcher{margin:0 auto}.arc-v12-0-0-beta-23 .arc .arc-ContentSwitcher-root{position:relative}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.arc-v12-0-0-beta-
|
|
1
|
+
.arc-v12-0-0-beta-23 .arc .arc-ContentSwitcherDropdown-selectTrigger{align-items:center;background:var(--content-switcher-colors-light-bg-default-alt);border:none;border-radius:var(--content-switcher-border-radius-pill);color:var(--content-switcher-colors-light-text-default-alt);display:flex;font:var(--sem-type-body-reg-m);justify-content:space-between;padding:var(--content-switcher-padding-m) var(--content-switcher-padding-l);width:100%;z-index:1}.arc-v12-0-0-beta-23 .arc .arc-ContentSwitcherDropdown-selectTrigger>span:first-child,.arc-v12-0-0-beta-23 .arc .arc-ContentSwitcherDropdown-selectItem>span:first-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.arc-v12-0-0-beta-23 .arc .arc-ContentSwitcherDropdown-selectTriggerIcon{color:var(--content-switcher-colors-light-text-default-alt);margin-left:var(--content-switcher-gap-l)}.arc-v12-0-0-beta-23 .arc .arc-ContentSwitcherDropdown-selectTrigger:hover{background:var(--content-switcher-colors-light-bg-selected-hover);cursor:pointer}.arc-v12-0-0-beta-23 .arc .arc-ContentSwitcherDropdown-selectTrigger[aria-expanded="true"]{background:var(--content-switcher-colors-light-bg-default);color:var(--content-switcher-colors-light-text-hover);outline:var(--content-switcher-border-weight-s) solid var(--content-switcher-colors-light-border-default);outline-offset:calc(var(--content-switcher-border-weight-s) * -1)}.arc-v12-0-0-beta-23 .arc .arc-ContentSwitcherDropdown-selectTrigger[aria-expanded="true"] .arc-ContentSwitcherDropdown-selectTriggerIcon{color:var(--content-switcher-colors-light-text-hover)}.arc-v12-0-0-beta-23 .arc .arc-ContentSwitcherDropdown-selectTrigger:focus-visible{outline:var(--focus-border-weight-s) solid var(--focus-colors-light-border-subtle);outline-offset:var(--focus-border-weight-s)}.arc-v12-0-0-beta-23 .arc .arc-ContentSwitcherDropdown-selectTriggerWrapper{align-items:center;background:var(--content-switcher-colors-light-bg-default);border-radius:var(--content-switcher-border-radius-pill);box-shadow:var(--elevation-02);display:block;margin-bottom:var(--content-switcher-gap-l);padding:10px;position:relative;width:-moz-fit-content;width:fit-content;z-index:1}.arc-v12-0-0-beta-23 .arc .arc-ContentSwitcherDropdown-selectTriggerWrapper--isFluid{width:100%}@media (min-width:636px){.arc-v12-0-0-beta-23 .arc .arc-ContentSwitcherDropdown-selectTriggerWrapper--isInset{margin:0 32px;width:auto}}.arc-v12-0-0-beta-23 .arc .arc-ContentSwitcherDropdown-selectTriggerWrapper--isInset{margin-bottom:calc((var(--arc-content-switcher-height-plus-padding)/2) * -1)}.arc-v12-0-0-beta-23 .arc .arc-ContentSwitcherDropdown-selectTrigger[data-state="open"] .arc-ContentSwitcherDropdown-selectTriggerIcon{transform:rotate(180deg)}.arc-v12-0-0-beta-23 .arc .arc-ContentSwitcherDropdown-selectContent{background:var(--content-switcher-colors-light-bg-default);border-radius:var(--content-switcher-border-radius-xl);box-shadow:var(--elevation-02);margin:var(--content-switcher-gap-l) 0 var(--content-switcher-gap-l) calc(var(--content-switcher-gap-l) * -1);padding:var(--content-switcher-padding-xs);position:relative;width:calc(var(--radix-select-trigger-width) + (var(--content-switcher-padding-xs) * 2))}.arc-v12-0-0-beta-23 .arc .arc-ContentSwitcherDropdown-selectItem{align-items:center;border-radius:var(--content-switcher-border-radius-pill);display:flex;justify-content:space-between;margin-bottom:var(--content-switcher-gap-l);padding:var(--content-switcher-padding-m) var(--content-switcher-padding-l)}.arc-v12-0-0-beta-23 .arc .arc-ContentSwitcherDropdown-selectItem[data-highlighted]{background:var(--content-switcher-colors-light-bg-hover);cursor:pointer;outline:none}.arc-v12-0-0-beta-23 .arc .arc-ContentSwitcherDropdown-selectItem[data-state="checked"]{background:var(--content-switcher-colors-light-bg-active)}.arc-v12-0-0-beta-23 .arc .arc-ContentSwitcherDropdown-selectItem:last-of-type{margin-bottom:0}.arc-v12-0-0-beta-23 .arc .arc-ContentSwitcherDropdown-content[hidden]{display:none}
|
|
@@ -1,49 +1,362 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var index = require('../_shared/cjs/index-BLRjGROQ.cjs');
|
|
5
5
|
var filterAttrs = require('../_shared/cjs/filter-attrs-eK6E_34o.cjs');
|
|
6
6
|
var React = require('react');
|
|
7
|
-
var index$
|
|
8
|
-
var index$
|
|
7
|
+
var index$2 = require('../_shared/cjs/index-CTlXMLug.cjs');
|
|
8
|
+
var index$3 = require('../_shared/cjs/index-CaO6cOF0.cjs');
|
|
9
|
+
var Calendar = require('../_shared/cjs/Calendar-Bfdgf5q1.cjs');
|
|
10
|
+
var index$1 = require('../_shared/cjs/index-DXNM3D1d.cjs');
|
|
9
11
|
var TextInput = require('../_shared/cjs/TextInput-ByySubi5.cjs');
|
|
10
|
-
var Calendar = require('../_shared/cjs/Calendar-B-va25n2.cjs');
|
|
11
|
-
var index = require('../_shared/cjs/index-DXNM3D1d.cjs');
|
|
12
|
-
require('../_shared/cjs/index-CTlXMLug.cjs');
|
|
13
12
|
require('../_shared/cjs/Combination-B-rSVLfT.cjs');
|
|
14
13
|
require('react/jsx-runtime');
|
|
15
14
|
require('react-dom');
|
|
16
15
|
require('../_shared/cjs/index-Bt7hfZBc.cjs');
|
|
17
16
|
require('../_shared/cjs/index-B11wQrRa.cjs');
|
|
18
17
|
require('../_shared/cjs/index-Dv1xvB_E.cjs');
|
|
19
|
-
require('../_shared/cjs/
|
|
20
|
-
require('../_shared/cjs/
|
|
21
|
-
require('../_shared/cjs/index-DR8Rkav9.cjs');
|
|
22
|
-
require('../_shared/cjs/DisclosureMini-CtvDxVaG.cjs');
|
|
18
|
+
require('../_shared/cjs/index.es-fkulh7qu.cjs');
|
|
19
|
+
require('../_shared/cjs/use-media-query-BsUfHjPZ.cjs');
|
|
23
20
|
require('../_shared/cjs/Text-Cr5nmYmx.cjs');
|
|
24
21
|
require('../_shared/cjs/suffix-modifier-DLUGR-yG.cjs');
|
|
25
|
-
require('../_shared/cjs/
|
|
22
|
+
require('../_shared/cjs/index-DR8Rkav9.cjs');
|
|
23
|
+
require('../_shared/cjs/Surface-BFx1yNsq.cjs');
|
|
26
24
|
require('../_shared/cjs/VisuallyHidden-B4XCvPYP.cjs');
|
|
27
|
-
require('../_shared/cjs/Spinner-bbrOwxv2.cjs');
|
|
28
|
-
require('../_shared/cjs/index.es-DlNskPlN.cjs');
|
|
29
|
-
require('../_shared/cjs/use-media-query-BsUfHjPZ.cjs');
|
|
30
25
|
require('../_shared/cjs/Heading-BEMSkLYR.cjs');
|
|
31
26
|
require('../_shared/cjs/BtIconChevronRightMid-eGxk3ae6.cjs');
|
|
32
27
|
require('../_shared/cjs/Icon-CzhyKqMd.cjs');
|
|
28
|
+
require('../_shared/cjs/FormControl-BPnKQrCm.cjs');
|
|
29
|
+
require('../_shared/cjs/DisclosureMini-CtvDxVaG.cjs');
|
|
30
|
+
require('../_shared/cjs/ThemeIcon-BoxbjTaQ.cjs');
|
|
31
|
+
require('../_shared/cjs/Spinner-bbrOwxv2.cjs');
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* @name startOfDay
|
|
35
|
+
* @category Day Helpers
|
|
36
|
+
* @summary Return the start of a day for the given date.
|
|
37
|
+
*
|
|
38
|
+
* @description
|
|
39
|
+
* Return the start of a day for the given date.
|
|
40
|
+
* The result will be in the local timezone.
|
|
41
|
+
*
|
|
42
|
+
* @param {Date|Number} date - the original date
|
|
43
|
+
* @returns {Date} the start of a day
|
|
44
|
+
* @throws {TypeError} 1 argument required
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* // The start of a day for 2 September 2014 11:55:00:
|
|
48
|
+
* const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))
|
|
49
|
+
* //=> Tue Sep 02 2014 00:00:00
|
|
50
|
+
*/
|
|
51
|
+
function startOfDay(dirtyDate) {
|
|
52
|
+
index.requiredArgs(1, arguments);
|
|
53
|
+
var date = index.toDate(dirtyDate);
|
|
54
|
+
date.setHours(0, 0, 0, 0);
|
|
55
|
+
return date;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* @name isSameDay
|
|
60
|
+
* @category Day Helpers
|
|
61
|
+
* @summary Are the given dates in the same day (and year and month)?
|
|
62
|
+
*
|
|
63
|
+
* @description
|
|
64
|
+
* Are the given dates in the same day (and year and month)?
|
|
65
|
+
*
|
|
66
|
+
* @param {Date|Number} dateLeft - the first date to check
|
|
67
|
+
* @param {Date|Number} dateRight - the second date to check
|
|
68
|
+
* @returns {Boolean} the dates are in the same day (and year and month)
|
|
69
|
+
* @throws {TypeError} 2 arguments required
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* // Are 4 September 06:00:00 and 4 September 18:00:00 in the same day?
|
|
73
|
+
* const result = isSameDay(new Date(2014, 8, 4, 6, 0), new Date(2014, 8, 4, 18, 0))
|
|
74
|
+
* //=> true
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* // Are 4 September and 4 October in the same day?
|
|
78
|
+
* const result = isSameDay(new Date(2014, 8, 4), new Date(2014, 9, 4))
|
|
79
|
+
* //=> false
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* // Are 4 September, 2014 and 4 September, 2015 in the same day?
|
|
83
|
+
* const result = isSameDay(new Date(2014, 8, 4), new Date(2015, 8, 4))
|
|
84
|
+
* //=> false
|
|
85
|
+
*/
|
|
86
|
+
function isSameDay(dirtyDateLeft, dirtyDateRight) {
|
|
87
|
+
index.requiredArgs(2, arguments);
|
|
88
|
+
var dateLeftStartOfDay = startOfDay(dirtyDateLeft);
|
|
89
|
+
var dateRightStartOfDay = startOfDay(dirtyDateRight);
|
|
90
|
+
return dateLeftStartOfDay.getTime() === dateRightStartOfDay.getTime();
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
var parseRangeString = function (value) {
|
|
94
|
+
if (value === void 0) { value = ""; }
|
|
95
|
+
var _a = value.replace(/\s/g, "").split("-"), _b = _a[0], start = _b === void 0 ? "" : _b, _c = _a[1], end = _c === void 0 ? "" : _c;
|
|
96
|
+
var _d = start.split("/"), startDay = _d[0], startMonth = _d[1], startYear = _d[2];
|
|
97
|
+
var _e = end.split("/"), endDay = _e[0], endMonth = _e[1], endYear = _e[2];
|
|
98
|
+
return {
|
|
99
|
+
start: {
|
|
100
|
+
date: start,
|
|
101
|
+
day: startDay,
|
|
102
|
+
month: startMonth,
|
|
103
|
+
year: startYear,
|
|
104
|
+
},
|
|
105
|
+
end: {
|
|
106
|
+
date: end,
|
|
107
|
+
day: endDay,
|
|
108
|
+
month: endMonth,
|
|
109
|
+
year: endYear,
|
|
110
|
+
},
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
var parseDateString = function (value) {
|
|
115
|
+
var _a = value.split("/"), day = _a[0], month = _a[1], year = _a[2];
|
|
116
|
+
return {
|
|
117
|
+
day: day,
|
|
118
|
+
month: month,
|
|
119
|
+
year: year,
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
var isDateValid = function (value) {
|
|
124
|
+
if (value === void 0) { value = ""; }
|
|
125
|
+
var _a = value.split("/"), day = _a[0], month = _a[1], year = _a[2];
|
|
126
|
+
return (/^\d{2}\/\d{2}\/\d{4}$/.test(value) &&
|
|
127
|
+
index.isValid(new Date("".concat(year, "-").concat(month, "-").concat(day))));
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
var isRangeValid = function (value) {
|
|
131
|
+
if (value === void 0) { value = ""; }
|
|
132
|
+
var _a = value.replace(/\s/g, "").split("-"), _b = _a[0], start = _b === void 0 ? "" : _b, _c = _a[1], end = _c === void 0 ? "" : _c;
|
|
133
|
+
return isDateValid(start) && isDateValid(end);
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
var DATE_FORMAT = "dd/MM/yyyy";
|
|
137
|
+
|
|
138
|
+
var formatDate = function (value) {
|
|
139
|
+
return index.format(value, DATE_FORMAT);
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
var isDisabledDate = function (disabledDates, date) {
|
|
143
|
+
return Boolean(disabledDates &&
|
|
144
|
+
disabledDates.find(function (disabledDate) { return isSameDay(date, disabledDate); }));
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
var convertDateStringToDate = function (value) {
|
|
148
|
+
if (value === void 0) { value = ""; }
|
|
149
|
+
var _a = parseDateString(value), day = _a.day, month = _a.month, year = _a.year;
|
|
150
|
+
var isValidDate = isDateValid(value);
|
|
151
|
+
return isValidDate ? new Date("".concat(year, "-").concat(month, "-").concat(day)) : new Date();
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
var convertRangeStringToDates = function (value) {
|
|
155
|
+
if (value === void 0) { value = ""; }
|
|
156
|
+
var _a = parseRangeString(value), start = _a.start, end = _a.end;
|
|
157
|
+
return filterAttrs.__spreadArray(filterAttrs.__spreadArray([], (isDateValid(start.date)
|
|
158
|
+
? [new Date("".concat(start.year, "-").concat(start.month, "-").concat(start.day))]
|
|
159
|
+
: []), true), (isDateValid(end.date)
|
|
160
|
+
? [new Date("".concat(end.year, "-").concat(end.month, "-").concat(end.day))]
|
|
161
|
+
: []), true);
|
|
162
|
+
};
|
|
33
163
|
|
|
34
164
|
var convertRangeStringToDateTuple = function (value) {
|
|
35
165
|
if (value === void 0) { value = ""; }
|
|
36
|
-
var _a =
|
|
37
|
-
var startDate =
|
|
166
|
+
var _a = parseRangeString(value), start = _a.start, end = _a.end;
|
|
167
|
+
var startDate = isDateValid(start.date)
|
|
38
168
|
? new Date("".concat(start.year, "-").concat(start.month, "-").concat(start.day))
|
|
39
169
|
: undefined;
|
|
40
|
-
var endDate =
|
|
170
|
+
var endDate = isDateValid(end.date)
|
|
41
171
|
? new Date("".concat(end.year, "-").concat(end.month, "-").concat(end.day))
|
|
42
172
|
: undefined;
|
|
43
173
|
return [startDate, endDate];
|
|
44
174
|
};
|
|
45
175
|
|
|
46
|
-
|
|
176
|
+
function validateRangeOnBlur(_a) {
|
|
177
|
+
var value = _a.value, minDate = _a.minDate, maxDate = _a.maxDate, disabledDates = _a.disabledDates, previousValidValue = _a.previousValidValue, dispatchChangeEvent = _a.dispatchChangeEvent, blurEvent = _a.blurEvent;
|
|
178
|
+
if (!isRangeValid(value))
|
|
179
|
+
return;
|
|
180
|
+
var _b = convertRangeStringToDates(value), start = _b[0], end = _b[1];
|
|
181
|
+
var isStartBeforeMin = minDate && Calendar.isBefore(start, minDate);
|
|
182
|
+
var isEndAfterMax = maxDate && Calendar.isAfter(end, maxDate);
|
|
183
|
+
var isStartDisabled = isDisabledDate(disabledDates, start);
|
|
184
|
+
var isEndDisabled = isDisabledDate(disabledDates, end);
|
|
185
|
+
if (isStartBeforeMin && isEndAfterMax) {
|
|
186
|
+
return dispatchChangeEvent(blurEvent, "".concat(formatDate(minDate), " - ").concat(formatDate(maxDate)));
|
|
187
|
+
}
|
|
188
|
+
if (isStartBeforeMin) {
|
|
189
|
+
return dispatchChangeEvent(blurEvent, "".concat(formatDate(minDate), " - ").concat(formatDate(end)));
|
|
190
|
+
}
|
|
191
|
+
if (isEndAfterMax) {
|
|
192
|
+
return dispatchChangeEvent(blurEvent, "".concat(formatDate(start), " - ").concat(formatDate(maxDate)));
|
|
193
|
+
}
|
|
194
|
+
if (isStartDisabled || isEndDisabled) {
|
|
195
|
+
var _c = previousValidValue
|
|
196
|
+
? convertRangeStringToDates(previousValidValue)
|
|
197
|
+
: [], prevStart = _c[0], prevEnd = _c[1];
|
|
198
|
+
return dispatchChangeEvent(blurEvent, prevStart && prevEnd
|
|
199
|
+
? "".concat(formatDate(prevStart), " - ").concat(formatDate(prevEnd))
|
|
200
|
+
: "");
|
|
201
|
+
}
|
|
202
|
+
if (Calendar.isAfter(start, end)) {
|
|
203
|
+
var _d = [start, end].sort(Calendar.compareAsc), orderedStart = _d[0], orderedEnd = _d[1];
|
|
204
|
+
return dispatchChangeEvent(blurEvent, "".concat(formatDate(orderedStart), " - ").concat(formatDate(orderedEnd)));
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Use `DatePicker` to clearly present available dates and allow users to choose a way to enter information.
|
|
210
|
+
*/
|
|
211
|
+
var DatePicker = React.forwardRef(function (_a, ref) {
|
|
212
|
+
var errorMessage = _a.errorMessage, helper = _a.helper, id = _a.id, label = _a.label, isDisabled = _a.isDisabled, isReadOnly = _a.isReadOnly, isRequired = _a.isRequired, size = _a.size, _b = _a.value, value = _b === void 0 ? "" : _b, name = _a.name, onBlur = _a.onBlur, onChange = _a.onChange, onDateSelect = _a.onDateSelect, onRangeSelect = _a.onRangeSelect, onClickDisclosure = _a.onClickDisclosure, disclosureTitle = _a.disclosureTitle, disclosureText = _a.disclosureText, type = _a.type, _c = _a.isFluid, isFluid = _c === void 0 ? false : _c, _d = _a.selectionType, selectionType = _d === void 0 ? "single" : _d, disabledDates = _a.disabledDates, minDate = _a.minDate, maxDate = _a.maxDate, props = filterAttrs.__rest(_a, ["errorMessage", "helper", "id", "label", "isDisabled", "isReadOnly", "isRequired", "size", "value", "name", "onBlur", "onChange", "onDateSelect", "onRangeSelect", "onClickDisclosure", "disclosureTitle", "disclosureText", "type", "isFluid", "selectionType", "disabledDates", "minDate", "maxDate"]);
|
|
213
|
+
var _e = index$1.useThemeElement(), themeElement = _e[0], setThemeElement = _e[1];
|
|
214
|
+
var _f = React.useState("Choose date"), ariaLabel = _f[0], setAriaLabel = _f[1];
|
|
215
|
+
var _g = React.useState(false), showCalendar = _g[0], setShowCalendar = _g[1];
|
|
216
|
+
var buttonRef = React.useRef(null);
|
|
217
|
+
var ourRef = React.useRef(null);
|
|
218
|
+
var previousValidValue = React.useRef(value);
|
|
219
|
+
var lowerCaseDateFormat = DATE_FORMAT.toLowerCase();
|
|
220
|
+
var placeHolder = selectionType === "range"
|
|
221
|
+
? "".concat(lowerCaseDateFormat, " - ").concat(lowerCaseDateFormat)
|
|
222
|
+
: lowerCaseDateFormat;
|
|
223
|
+
React.useEffect(function () {
|
|
224
|
+
if (selectionType === "single" &&
|
|
225
|
+
isDateValid(value) &&
|
|
226
|
+
!isDisabledDate(disabledDates, convertDateStringToDate(value))) {
|
|
227
|
+
previousValidValue.current = value;
|
|
228
|
+
}
|
|
229
|
+
if (selectionType === "range" && isRangeValid(value)) {
|
|
230
|
+
var rangeHasDisabledDates = convertRangeStringToDates(value).some(function (rangeValue) { return isDisabledDate(disabledDates, rangeValue); });
|
|
231
|
+
if (!rangeHasDisabledDates) {
|
|
232
|
+
previousValidValue.current = value;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}, [value, disabledDates, selectionType]);
|
|
236
|
+
var getDatePickerRef = function (elementRef) {
|
|
237
|
+
ourRef.current = elementRef;
|
|
238
|
+
if (ref && typeof ref === "object") {
|
|
239
|
+
ref.current = elementRef;
|
|
240
|
+
}
|
|
241
|
+
if (ref && typeof ref === "function") {
|
|
242
|
+
ref(elementRef);
|
|
243
|
+
}
|
|
244
|
+
};
|
|
245
|
+
var dispatchChangeEvent = function (e, value) {
|
|
246
|
+
onChange &&
|
|
247
|
+
onChange(filterAttrs.__assign(filterAttrs.__assign({}, e), { target: filterAttrs.__assign(filterAttrs.__assign({}, e.target), { value: value }) }));
|
|
248
|
+
};
|
|
249
|
+
var handleRangeSelect = function (rangeSelection) {
|
|
250
|
+
var start = formatDate(rangeSelection.start);
|
|
251
|
+
var end = rangeSelection.end ? formatDate(rangeSelection.end) : null;
|
|
252
|
+
onRangeSelect &&
|
|
253
|
+
onRangeSelect(filterAttrs.__assign(filterAttrs.__assign({}, rangeSelection), { formattedRange: "".concat(start).concat(end ? " - ".concat(end) : "") }));
|
|
254
|
+
rangeSelection.isSelectionComplete && setShowCalendar(false);
|
|
255
|
+
};
|
|
256
|
+
var handleDateSelect = function (value) {
|
|
257
|
+
onDateSelect &&
|
|
258
|
+
onDateSelect({
|
|
259
|
+
date: value,
|
|
260
|
+
formattedDate: formatDate(value),
|
|
261
|
+
});
|
|
262
|
+
setShowCalendar(false);
|
|
263
|
+
};
|
|
264
|
+
var handleSingleSelectionBlur = function (e) {
|
|
265
|
+
if (value && isDateValid(value) && selectionType === "single") {
|
|
266
|
+
var _a = parseDateString(value), day = _a.day, month = _a.month, year = _a.year;
|
|
267
|
+
var date = new Date("".concat(year, "-").concat(month, "-").concat(day));
|
|
268
|
+
var isDateBeforeMinDate = minDate && Calendar.isBefore(date, minDate);
|
|
269
|
+
var isDateAfterMaxDate = maxDate && Calendar.isAfter(date, maxDate);
|
|
270
|
+
var isDisabledValue = isDisabledDate(disabledDates, date);
|
|
271
|
+
if (isDateBeforeMinDate) {
|
|
272
|
+
return dispatchChangeEvent(e, "".concat(formatDate(minDate)));
|
|
273
|
+
}
|
|
274
|
+
if (isDateAfterMaxDate) {
|
|
275
|
+
return dispatchChangeEvent(e, "".concat(formatDate(maxDate)));
|
|
276
|
+
}
|
|
277
|
+
if (isDisabledValue) {
|
|
278
|
+
var date_1 = previousValidValue.current
|
|
279
|
+
? convertDateStringToDate(previousValidValue.current)
|
|
280
|
+
: new Date();
|
|
281
|
+
return dispatchChangeEvent(e, "".concat(formatDate(date_1)));
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
};
|
|
285
|
+
var handleRangeSelectionBlur = function (e) {
|
|
286
|
+
validateRangeOnBlur({
|
|
287
|
+
value: value,
|
|
288
|
+
minDate: minDate,
|
|
289
|
+
maxDate: maxDate,
|
|
290
|
+
disabledDates: disabledDates,
|
|
291
|
+
previousValidValue: previousValidValue.current,
|
|
292
|
+
dispatchChangeEvent: dispatchChangeEvent,
|
|
293
|
+
blurEvent: e,
|
|
294
|
+
});
|
|
295
|
+
};
|
|
296
|
+
var handleBlur = function (e) {
|
|
297
|
+
onBlur && onBlur(e);
|
|
298
|
+
if (selectionType === "single") {
|
|
299
|
+
handleSingleSelectionBlur(e);
|
|
300
|
+
}
|
|
301
|
+
if (selectionType === "range") {
|
|
302
|
+
handleRangeSelectionBlur(e);
|
|
303
|
+
}
|
|
304
|
+
};
|
|
305
|
+
var handleChange = function (e) {
|
|
306
|
+
onChange && onChange(e);
|
|
307
|
+
};
|
|
308
|
+
var handleCalendarOpenChange = function (isOpen) {
|
|
309
|
+
if (document.activeElement)
|
|
310
|
+
setShowCalendar(isOpen);
|
|
311
|
+
};
|
|
312
|
+
var handleIconClick = function () {
|
|
313
|
+
var _a;
|
|
314
|
+
!((_a = ourRef.current) === null || _a === void 0 ? void 0 : _a.contains(document.activeElement)) &&
|
|
315
|
+
!isDisabled &&
|
|
316
|
+
!isReadOnly &&
|
|
317
|
+
setShowCalendar(true);
|
|
318
|
+
};
|
|
319
|
+
var handleIconFocus = function () {
|
|
320
|
+
if (selectionType === "range" && isRangeValid(value)) {
|
|
321
|
+
var _a = convertRangeStringToDates(value), start = _a[0], end = _a[1];
|
|
322
|
+
return setAriaLabel("Change dates, currently selected dates are ".concat(index.format(start, "EEEE do MMMM, yyyy"), " to ").concat(index.format(end, "EEEE do MMMM, yyyy")));
|
|
323
|
+
}
|
|
324
|
+
if (selectionType === "single" && isDateValid(value)) {
|
|
325
|
+
var date = convertDateStringToDate(value);
|
|
326
|
+
return setAriaLabel("Change date, currently selected date is ".concat(index.format(date, "EEEE do MMMM, yyyy")));
|
|
327
|
+
}
|
|
328
|
+
setAriaLabel("Choose Date");
|
|
329
|
+
};
|
|
330
|
+
var handleCalendarClose = function () {
|
|
331
|
+
var _a, _b;
|
|
332
|
+
if (((_a = document.activeElement) === null || _a === void 0 ? void 0 : _a.tagName) === "BODY") {
|
|
333
|
+
(_b = buttonRef.current) === null || _b === void 0 ? void 0 : _b.focus();
|
|
334
|
+
}
|
|
335
|
+
};
|
|
336
|
+
var onCancelClick = function () {
|
|
337
|
+
setShowCalendar(false);
|
|
338
|
+
};
|
|
339
|
+
var handleAutoFocus = function (e) {
|
|
340
|
+
e.preventDefault();
|
|
341
|
+
};
|
|
342
|
+
return (React.createElement("div", { ref: setThemeElement, className: index$2.classNames({
|
|
343
|
+
"arc-DatePicker--constrained": !isFluid,
|
|
344
|
+
}) },
|
|
345
|
+
React.createElement(TextInput.TextInputWithPlaceHolder, filterAttrs.__assign({ ref: getDatePickerRef, iconButton: {
|
|
346
|
+
onClick: handleIconClick,
|
|
347
|
+
onFocus: handleIconFocus,
|
|
348
|
+
icon: "datePickerCalendar",
|
|
349
|
+
label: ariaLabel,
|
|
350
|
+
ref: buttonRef,
|
|
351
|
+
}, placeholder: placeHolder, errorMessage: errorMessage, helper: helper, id: id, isDisabled: isDisabled, isReadOnly: isReadOnly, isRequired: isRequired, label: label, maxLength: selectionType === "range" ? 23 : 10, name: name, onBlur: handleBlur, onChange: handleChange, onClickDisclosure: onClickDisclosure, type: "text", value: value, disclosureTitle: disclosureTitle, disclosureText: disclosureText, size: size }, props, filterAttrs.filterAttrs(props))),
|
|
352
|
+
React.createElement(index$3.Root2, filterAttrs.__assign({ open: showCalendar, onOpenChange: handleCalendarOpenChange }, filterAttrs.filterAttrs(props)),
|
|
353
|
+
React.createElement(index$3.Anchor2, null),
|
|
354
|
+
React.createElement(index$3.Portal, { container: themeElement },
|
|
355
|
+
React.createElement(index$3.Content2, { align: "start", "aria-modal": "true", "aria-label": "Choose Date", className: "arc-DatePicker-modal", onOpenAutoFocus: handleAutoFocus, onCloseAutoFocus: handleCalendarClose },
|
|
356
|
+
React.createElement(Calendar.Calendar, { autoFocusOnMount: true, type: type, onCancelClick: onCancelClick, selectionType: selectionType, selectedDate: convertDateStringToDate(value), selectedRange: convertRangeStringToDates(value), disabledDates: disabledDates, minDate: minDate, maxDate: maxDate, onDateSelect: handleDateSelect, onRangeSelect: handleRangeSelect }))))));
|
|
357
|
+
});
|
|
358
|
+
|
|
359
|
+
var lowerCaseDateFormat = DATE_FORMAT.toLowerCase();
|
|
47
360
|
var DatePickerRange = function (_a) {
|
|
48
361
|
var _b, _c;
|
|
49
362
|
var inputStart = _a.inputStart, inputEnd = _a.inputEnd, _d = _a.type, type = _d === void 0 ? "month" : _d, minDate = _a.minDate, maxDate = _a.maxDate, disabledDates = _a.disabledDates, onRangeSelect = _a.onRangeSelect;
|
|
@@ -58,7 +371,7 @@ var DatePickerRange = function (_a) {
|
|
|
58
371
|
var endButtonRef = React.useRef(null);
|
|
59
372
|
var endInputRef = React.useRef(null);
|
|
60
373
|
var previousValidValue = React.useRef("");
|
|
61
|
-
var _j = index.useThemeElement(), themeElement = _j[0], setThemeElement = _j[1];
|
|
374
|
+
var _j = index$1.useThemeElement(), themeElement = _j[0], setThemeElement = _j[1];
|
|
62
375
|
var _k = React.useState(false), showCalendar = _k[0], setShowCalendar = _k[1];
|
|
63
376
|
var _l = React.useState(null), activeInput = _l[0], setActiveInput = _l[1];
|
|
64
377
|
var getIsRequired = function (input) { var _a; return (_a = input.isRequired) !== null && _a !== void 0 ? _a : true; };
|
|
@@ -84,8 +397,8 @@ var DatePickerRange = function (_a) {
|
|
|
84
397
|
};
|
|
85
398
|
var handleRangeSelect = function (rangeSelection) {
|
|
86
399
|
var start = rangeSelection.start, end = rangeSelection.end, isSelectionComplete = rangeSelection.isSelectionComplete;
|
|
87
|
-
var formattedStart = index
|
|
88
|
-
var formattedEnd = end ? index
|
|
400
|
+
var formattedStart = index.format(start, "dd/MM/yyyy");
|
|
401
|
+
var formattedEnd = end ? index.format(end, "dd/MM/yyyy") : "";
|
|
89
402
|
onRangeSelect === null || onRangeSelect === void 0 ? void 0 : onRangeSelect(filterAttrs.__assign(filterAttrs.__assign({}, rangeSelection), { formattedStart: formattedStart, formattedEnd: formattedEnd }));
|
|
90
403
|
if (isSelectionComplete) {
|
|
91
404
|
var fullRange = "".concat(formattedStart, " - ").concat(formattedEnd);
|
|
@@ -102,9 +415,9 @@ var DatePickerRange = function (_a) {
|
|
|
102
415
|
};
|
|
103
416
|
var handleIconFocus = function (_a) {
|
|
104
417
|
var input = _a.input;
|
|
105
|
-
if (
|
|
106
|
-
var _b =
|
|
107
|
-
var label = "Change dates, currently selected dates are ".concat(index
|
|
418
|
+
if (isRangeValid("".concat(startValue, " - ").concat(endValue))) {
|
|
419
|
+
var _b = convertRangeStringToDates("".concat(startValue, " - ").concat(endValue)), start = _b[0], end = _b[1];
|
|
420
|
+
var label = "Change dates, currently selected dates are ".concat(index.format(start, "EEEE do MMMM, yyyy"), " to ").concat(index.format(end, "EEEE do MMMM, yyyy"));
|
|
108
421
|
input === "start" ? setStartAriaLabel(label) : setEndAriaLabel(label);
|
|
109
422
|
return;
|
|
110
423
|
}
|
|
@@ -129,7 +442,7 @@ var DatePickerRange = function (_a) {
|
|
|
129
442
|
if (input === "end") {
|
|
130
443
|
inputEnd.onBlur && inputEnd.onBlur(e);
|
|
131
444
|
}
|
|
132
|
-
|
|
445
|
+
validateRangeOnBlur({
|
|
133
446
|
value: value,
|
|
134
447
|
minDate: minDate,
|
|
135
448
|
maxDate: maxDate,
|
|
@@ -137,9 +450,9 @@ var DatePickerRange = function (_a) {
|
|
|
137
450
|
previousValidValue: previousValidValue.current,
|
|
138
451
|
dispatchChangeEvent: function (e, corrected) {
|
|
139
452
|
var _a, _b;
|
|
140
|
-
var _c =
|
|
141
|
-
(_a = inputStart.onChange) === null || _a === void 0 ? void 0 : _a.call(inputStart, filterAttrs.__assign(filterAttrs.__assign({}, e), { target: filterAttrs.__assign(filterAttrs.__assign({}, e.target), { value:
|
|
142
|
-
(_b = inputEnd.onChange) === null || _b === void 0 ? void 0 : _b.call(inputEnd, filterAttrs.__assign(filterAttrs.__assign({}, e), { target: filterAttrs.__assign(filterAttrs.__assign({}, e.target), { value:
|
|
453
|
+
var _c = convertRangeStringToDates(corrected), start = _c[0], end = _c[1];
|
|
454
|
+
(_a = inputStart.onChange) === null || _a === void 0 ? void 0 : _a.call(inputStart, filterAttrs.__assign(filterAttrs.__assign({}, e), { target: filterAttrs.__assign(filterAttrs.__assign({}, e.target), { value: formatDate(start) }) }));
|
|
455
|
+
(_b = inputEnd.onChange) === null || _b === void 0 ? void 0 : _b.call(inputEnd, filterAttrs.__assign(filterAttrs.__assign({}, e), { target: filterAttrs.__assign(filterAttrs.__assign({}, e.target), { value: formatDate(end) }) }));
|
|
143
456
|
previousValidValue.current = corrected;
|
|
144
457
|
},
|
|
145
458
|
blurEvent: e,
|
|
@@ -204,17 +517,17 @@ var DatePickerRange = function (_a) {
|
|
|
204
517
|
label: endAriaLabel,
|
|
205
518
|
ref: endButtonRef,
|
|
206
519
|
}, maxLength: 23, onBlur: function (e) { return handleBlur(e, "end"); }, errorMessage: inputEnd.errorMessage, helper: inputEnd.helper, id: inputEnd.id, isDisabled: inputEnd.isDisabled, isReadOnly: inputEnd.isReadOnly, isRequired: getIsRequired(inputEnd), label: getLabel(inputEnd, "end"), hideLabel: inputStart.hideLabel, name: inputEnd.name, onClickDisclosure: inputEnd.onClickDisclosure, disclosureTitle: inputEnd.disclosureTitle, disclosureText: inputEnd.disclosureText, placeholder: lowerCaseDateFormat, value: endValue, onChange: function (e) { return handleChange(e, "end"); } }, filterAttrs.filterAttrs(inputEnd))),
|
|
207
|
-
React.createElement(index$
|
|
208
|
-
React.createElement(index$
|
|
209
|
-
React.createElement(index$
|
|
210
|
-
React.createElement(index$
|
|
520
|
+
React.createElement(index$3.Root2, { open: showCalendar, onOpenChange: handleCalendarOpenChange },
|
|
521
|
+
React.createElement(index$3.Anchor2, null),
|
|
522
|
+
React.createElement(index$3.Portal, { container: themeElement },
|
|
523
|
+
React.createElement(index$3.Content2, { align: "end", "aria-modal": "true", "aria-label": "Choose Date", className: "arc-DatePicker-modal", onOpenAutoFocus: handleAutoFocus, onCloseAutoFocus: handleCalendarClose },
|
|
211
524
|
React.createElement(Calendar.Calendar, { autoFocusOnMount: true, type: type, onCancelClick: onCancelClick, selectionType: "range", selectedRange: getCalendarRange(), disabledDates: disabledDates, minDate: minDate, maxDate: maxDate, onRangeSelect: handleRangeSelect }))))));
|
|
212
525
|
};
|
|
213
526
|
|
|
214
|
-
exports.DATE_FORMAT =
|
|
215
|
-
exports.DatePicker = DatePicker
|
|
216
|
-
exports.isDateValid = DatePicker.isDateValid;
|
|
217
|
-
exports.isRangeValid = DatePicker.isRangeValid;
|
|
218
|
-
exports.parseDateString = DatePicker.parseDateString;
|
|
219
|
-
exports.parseRangeString = DatePicker.parseRangeString;
|
|
527
|
+
exports.DATE_FORMAT = DATE_FORMAT;
|
|
528
|
+
exports.DatePicker = DatePicker;
|
|
220
529
|
exports.DatePickerRange = DatePickerRange;
|
|
530
|
+
exports.isDateValid = isDateValid;
|
|
531
|
+
exports.isRangeValid = isRangeValid;
|
|
532
|
+
exports.parseDateString = parseDateString;
|
|
533
|
+
exports.parseRangeString = parseRangeString;
|