@arc-ui/components 12.0.0-beta.18 → 12.0.0-beta.20
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 +1 -1
- package/lib/Alert/Alert.mjs +1 -1
- package/lib/Alert/styles.css +1 -1
- package/lib/Align/styles.css +1 -1
- package/lib/AppButton/styles.css +1 -1
- package/lib/Avatar/Avatar.cjs +2 -1
- package/lib/Avatar/Avatar.mjs +2 -1
- package/lib/Avatar/styles.css +1 -1
- package/lib/AvatarGroup/AvatarGroup.cjs +2 -1
- package/lib/AvatarGroup/AvatarGroup.mjs +2 -1
- package/lib/AvatarGroup/styles.css +1 -1
- package/lib/Badge/styles.css +1 -1
- package/lib/Banner/Banner.cjs +2 -3
- package/lib/Banner/Banner.mjs +2 -3
- package/lib/Box/styles.css +1 -1
- package/lib/BrandLogo/styles.css +1 -1
- package/lib/Breadcrumbs/Breadcrumbs.cjs +2 -1
- package/lib/Breadcrumbs/Breadcrumbs.mjs +2 -1
- package/lib/Breadcrumbs/styles.css +1 -1
- package/lib/Button/Button.cjs +2 -2
- package/lib/Button/Button.mjs +2 -2
- package/lib/Button/styles.css +1 -1
- package/lib/ButtonGroup/ButtonGroup.cjs +3 -3
- package/lib/ButtonGroup/ButtonGroup.mjs +3 -3
- package/lib/ButtonGroup/styles.css +1 -1
- package/lib/ButtonV2/ButtonV2.cjs +2 -2
- package/lib/ButtonV2/ButtonV2.mjs +2 -2
- package/lib/ButtonV2/styles.css +1 -1
- package/lib/Calendar/Calendar.cjs +3 -3
- package/lib/Calendar/Calendar.mjs +3 -3
- package/lib/Calendar/styles.css +1 -1
- package/lib/CardFooter/CardFooter.cjs +2 -2
- package/lib/CardFooter/CardFooter.mjs +2 -2
- package/lib/CardFooter/styles.css +1 -1
- package/lib/CardHeading/styles.css +1 -1
- package/lib/Carousel/Carousel.cjs +1 -1
- package/lib/Carousel/Carousel.mjs +1 -1
- package/lib/Carousel/styles.css +1 -1
- package/lib/Checkbox/Checkbox.cjs +2 -2
- package/lib/Checkbox/Checkbox.mjs +2 -2
- package/lib/Checkbox/styles.css +1 -1
- package/lib/Columns/styles.css +1 -1
- package/lib/ComboBox/ComboBox.cjs +3 -3
- package/lib/ComboBox/ComboBox.mjs +3 -3
- package/lib/ComboBox/styles.css +1 -1
- package/lib/ContentSwitcher/ContentSwitcher.cjs +1 -1
- package/lib/ContentSwitcher/ContentSwitcher.mjs +1 -1
- package/lib/ContentSwitcher/styles.css +1 -1
- package/lib/ContentSwitcherDropdown/ContentSwitcherDropdown.cjs +1 -1
- package/lib/ContentSwitcherDropdown/ContentSwitcherDropdown.mjs +1 -1
- package/lib/ContentSwitcherDropdown/styles.css +1 -1
- package/lib/DatePicker/DatePicker.cjs +196 -17
- package/lib/DatePicker/DatePicker.mjs +200 -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/Drawer.cjs +46 -323
- package/lib/Drawer/Drawer.mjs +44 -306
- package/lib/Drawer/styles.css +1 -1
- package/lib/Elevation/styles.css +1 -1
- package/lib/Filter/styles.css +1 -1
- package/lib/FormControl/FormControl.cjs +1 -1
- package/lib/FormControl/FormControl.mjs +1 -1
- package/lib/FormControl/styles.css +1 -1
- package/lib/GhostedHeroBanner/GhostedHeroBanner.cjs +1 -1
- package/lib/GhostedHeroBanner/GhostedHeroBanner.mjs +1 -1
- package/lib/GhostedHeroBanner/styles.css +1 -1
- package/lib/GradientPageBackground/GradientPageBackground.cjs +257 -0
- package/lib/GradientPageBackground/GradientPageBackground.mjs +237 -0
- package/lib/GradientPageBackground/styles.css +1 -0
- 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 +2 -3
- package/lib/HeroBanner/HeroBanner.mjs +2 -3
- package/lib/HeroBanner/styles.css +1 -1
- package/lib/HeroButton/HeroButton.cjs +2 -2
- package/lib/HeroButton/HeroButton.mjs +2 -2
- package/lib/HeroButton/styles.css +1 -1
- package/lib/Hidden/styles.css +1 -1
- package/lib/HorizontalCard/HorizontalCard.cjs +3 -2
- package/lib/HorizontalCard/HorizontalCard.mjs +3 -2
- package/lib/HorizontalCard/styles.css +1 -1
- package/lib/Icon/Icon.cjs +1 -1
- package/lib/Icon/Icon.mjs +1 -1
- package/lib/Icon/styles.css +1 -1
- package/lib/Image/styles.css +1 -1
- package/lib/ImpactCard/ImpactCard.cjs +7 -4
- package/lib/ImpactCard/ImpactCard.mjs +7 -4
- package/lib/ImpactCard/styles.css +1 -1
- package/lib/InformationCard/InformationCard.cjs +7 -5
- package/lib/InformationCard/InformationCard.mjs +7 -5
- 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 +3 -5
- package/lib/MediaCard/MediaCard.mjs +3 -5
- package/lib/MediaCard/styles.css +1 -1
- package/lib/Menu/Menu.cjs +35 -48
- package/lib/Menu/Menu.mjs +21 -34
- package/lib/Menu/styles.css +1 -1
- package/lib/Modal/Modal.cjs +2 -2
- package/lib/Modal/Modal.mjs +2 -2
- package/lib/Modal/styles.css +1 -1
- package/lib/Pagination/styles.css +1 -1
- package/lib/PaginationSimple/PaginationSimple.cjs +1 -1
- package/lib/PaginationSimple/PaginationSimple.mjs +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/ProgressStepper.cjs +10 -72
- package/lib/ProgressStepper/ProgressStepper.mjs +8 -74
- package/lib/ProgressStepper/styles.css +1 -1
- package/lib/ProgressStepperOverflow/ProgressStepperOverflow.cjs +20 -0
- package/lib/ProgressStepperOverflow/ProgressStepperOverflow.mjs +14 -0
- package/lib/ProgressStepperOverflow/styles.css +1 -0
- package/lib/RadioCardGroup/RadioCardGroup.cjs +3 -3
- package/lib/RadioCardGroup/RadioCardGroup.mjs +4 -4
- package/lib/RadioCardGroup/styles.css +1 -1
- package/lib/RadioGroup/RadioGroup.cjs +4 -5
- package/lib/RadioGroup/RadioGroup.mjs +5 -6
- package/lib/RadioGroup/styles.css +1 -1
- package/lib/Rule/styles.css +1 -1
- package/lib/ScrollToTop/ScrollToTop.cjs +5 -2
- package/lib/ScrollToTop/ScrollToTop.mjs +5 -2
- package/lib/ScrollToTop/styles.css +1 -1
- package/lib/Section/styles.css +1 -1
- package/lib/Select/Select.cjs +11 -15
- package/lib/Select/Select.mjs +12 -16
- package/lib/Select/styles.css +1 -1
- package/lib/SiteFooter/SiteFooter.cjs +10 -7
- package/lib/SiteFooter/SiteFooter.mjs +10 -7
- package/lib/SiteFooter/styles.css +1 -1
- package/lib/SiteFooterV2/SiteFooterV2.cjs +19 -22
- package/lib/SiteFooterV2/SiteFooterV2.mjs +19 -22
- package/lib/SiteFooterV2/styles.css +1 -1
- package/lib/SiteHeaderV2/SiteHeaderV2.cjs +4 -4
- package/lib/SiteHeaderV2/SiteHeaderV2.mjs +5 -5
- 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/Switch.cjs +17 -14
- package/lib/Switch/Switch.mjs +17 -14
- package/lib/Switch/styles.css +1 -1
- package/lib/TabbedBanner/TabbedBanner.cjs +9 -6
- package/lib/TabbedBanner/TabbedBanner.mjs +9 -6
- package/lib/TabbedBanner/styles.css +1 -1
- package/lib/Tabs/Tabs.cjs +1 -1
- package/lib/Tabs/Tabs.mjs +1 -1
- package/lib/Tabs/styles.css +1 -1
- package/lib/Tag/Tag.cjs +1 -1
- package/lib/Tag/Tag.mjs +1 -1
- package/lib/Tag/styles.css +1 -1
- package/lib/TemplateBanner/TemplateBanner.cjs +2 -3
- package/lib/TemplateBanner/TemplateBanner.mjs +2 -3
- package/lib/TemplateBanner/styles.css +1 -1
- package/lib/Text/styles.css +1 -1
- package/lib/TextArea/TextArea.cjs +19 -17
- package/lib/TextArea/TextArea.mjs +19 -17
- package/lib/TextArea/styles.css +1 -1
- package/lib/TextInput/TextInput.cjs +2 -2
- package/lib/TextInput/TextInput.mjs +2 -2
- 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/ThumbnailSignpost.cjs +5 -8
- package/lib/ThumbnailSignpost/ThumbnailSignpost.mjs +5 -8
- package/lib/ThumbnailSignpost/styles.css +1 -1
- package/lib/Toast/styles.css +1 -1
- package/lib/Tooltip/Tooltip.cjs +1 -1
- package/lib/Tooltip/Tooltip.mjs +1 -1
- package/lib/Tooltip/styles.css +1 -1
- package/lib/Truncate/styles.css +1 -1
- package/lib/TypographyCard/TypographyCard.cjs +7 -4
- package/lib/TypographyCard/TypographyCard.mjs +7 -4
- package/lib/TypographyCard/styles.css +1 -1
- package/lib/UniversalHeader/styles.css +1 -1
- package/lib/VerticalSpace/styles.css +1 -1
- package/lib/VideoPlayer/VideoPlayer.cjs +1 -1
- package/lib/VideoPlayer/VideoPlayer.mjs +1 -1
- package/lib/VideoPlayer/styles.css +1 -1
- package/lib/Visible/Visible.cjs +6 -14
- package/lib/Visible/Visible.mjs +4 -16
- package/lib/Visible/styles.css +1 -1
- package/lib/VisuallyHidden/styles.css +1 -1
- package/lib/_shared/cjs/{Avatar-CxbjOB_b.cjs → Avatar-CrUioj_6.cjs} +4 -1
- package/lib/_shared/cjs/{Button-CKTa6bQL.cjs → Button-uD9mR8w-.cjs} +1 -1
- package/lib/_shared/cjs/{ButtonV2-CRNNZ_nd.cjs → ButtonV2-Bta5SVVY.cjs} +2 -2
- package/lib/_shared/cjs/{Calendar-C5C0evEy.cjs → Calendar-D4ZSaHHU.cjs} +3 -3
- package/lib/_shared/cjs/{CardFooter-DwE-u0Om.cjs → CardFooter-ChphRFHe.cjs} +1 -1
- package/lib/_shared/cjs/{Checkbox-D2UQsmiB.cjs → Checkbox-DfZMjO1Y.cjs} +1 -1
- package/lib/_shared/cjs/{ComboBox-BIMxZhJp.cjs → ComboBox-BGUhlqx1.cjs} +2 -2
- package/lib/_shared/cjs/{ContentSwitcherDropdown-CAWaAMZN.cjs → ContentSwitcherDropdown-U5ZTbJTe.cjs} +1 -1
- package/lib/_shared/cjs/{ContentSwitcherList-I7jCZn8C.cjs → ContentSwitcherList-nlxMHXs-.cjs} +3 -2
- package/lib/_shared/cjs/{DatePicker-BgU6iidG.cjs → DatePicker-DS6fAvxD.cjs} +48 -30
- package/lib/_shared/cjs/{FormControl-D3-JbAVb.cjs → FormControl-BPnKQrCm.cjs} +19 -13
- package/lib/_shared/cjs/{HeroButton-CiIygZ16.cjs → HeroButton-CrzkTUwP.cjs} +1 -1
- package/lib/_shared/cjs/{Icon-KMACQ1i3.cjs → Icon-CzhyKqMd.cjs} +1 -1
- package/lib/_shared/cjs/{MediaCard-kcqfmeue.cjs → MediaCard-BEZFbiYO.cjs} +5 -9
- package/lib/_shared/cjs/{MenuSubContent-Bs2_ebS3.cjs → MenuItemMultiLevelContent-vLr6hSBm.cjs} +7 -9
- package/lib/_shared/cjs/ProgressStepper-BL9Y5c4X.cjs +77 -0
- package/lib/_shared/cjs/ProgressStepperOverflow-v-TyS5Sp.cjs +142 -0
- package/lib/_shared/cjs/{RadioCardGroupInput-BmntgyWB.cjs → RadioCardGroupInput-CeUM3yPS.cjs} +1 -1
- package/lib/_shared/cjs/{RadioGroupInput-D3trTxB5.cjs → RadioGroupInput-w2qkfsnG.cjs} +2 -2
- package/lib/_shared/cjs/{SiteHeaderV2NavItemWithSubNav-DgoCW2W3.cjs → SiteHeaderV2NavItemWithSubNav-fQPk0gZU.cjs} +3 -3
- package/lib/_shared/cjs/{TemplateBanner-BMi77IGK.cjs → TemplateBanner-CGtTUy81.cjs} +13 -6
- package/lib/_shared/cjs/{TextInput-DT4hi02U.cjs → TextInput-ByySubi5.cjs} +7 -7
- package/lib/_shared/cjs/Visible-Dx__9oZG.cjs +18 -0
- package/lib/_shared/cjs/{index.es-sqSQUWYg.cjs → index.es-DBEGtWPg.cjs} +1 -1
- package/lib/_shared/esm/{Avatar-B8aoUhmE.mjs → Avatar-Fb1E5MA9.mjs} +4 -1
- package/lib/_shared/esm/{Button-9L4AksQP.mjs → Button-BxuM3_gz.mjs} +1 -1
- package/lib/_shared/esm/{ButtonV2-2U4PvnpS.mjs → ButtonV2-DwYBAojW.mjs} +2 -2
- package/lib/_shared/esm/{Calendar-L6u3D8xb.mjs → Calendar-CjqPM7ta.mjs} +3 -3
- package/lib/_shared/esm/{CardFooter-CgDDDI7Z.mjs → CardFooter-fsAY4cc6.mjs} +1 -1
- package/lib/_shared/esm/{Checkbox-NxnK40uZ.mjs → Checkbox-CwOHzlQF.mjs} +1 -1
- package/lib/_shared/esm/{ComboBox-DUTrEu0N.mjs → ComboBox-CRlJjeev.mjs} +2 -2
- package/lib/_shared/esm/{ContentSwitcherDropdown-dktkyAjY.mjs → ContentSwitcherDropdown-BCkuAfwC.mjs} +1 -1
- package/lib/_shared/esm/{ContentSwitcherList-OnZoE86O.mjs → ContentSwitcherList-DKPD9GfN.mjs} +3 -2
- package/lib/_shared/esm/{DatePicker-CccSfg17.mjs → DatePicker-3sYJ3wGn.mjs} +46 -31
- package/lib/_shared/esm/{FormControl-B9fp1ilz.mjs → FormControl-CWyrVi1u.mjs} +19 -13
- package/lib/_shared/esm/{HeroButton-HYskwyvn.mjs → HeroButton-jdjjV_Gf.mjs} +1 -1
- package/lib/_shared/esm/{Icon-MZfaoOo9.mjs → Icon-CcPOJcQm.mjs} +1 -1
- package/lib/_shared/esm/{MediaCard-CjTDOvmx.mjs → MediaCard-DqMaNWsE.mjs} +5 -9
- package/lib/_shared/esm/{MenuSubContent-Cv9mSn58.mjs → MenuItemMultiLevelContent-JTOHqpzg.mjs} +7 -8
- package/lib/_shared/esm/ProgressStepper-CLBtBNy2.mjs +74 -0
- package/lib/_shared/esm/ProgressStepperOverflow-B9ba8ljs.mjs +140 -0
- package/lib/_shared/esm/{RadioCardGroupInput-Cy1r7M8l.mjs → RadioCardGroupInput-D7W28geB.mjs} +1 -1
- package/lib/_shared/esm/{RadioGroupInput-DiRS2jwQ.mjs → RadioGroupInput-zAWSV29m.mjs} +2 -2
- package/lib/_shared/esm/{SiteHeaderV2NavItemWithSubNav-BLqiSeEC.mjs → SiteHeaderV2NavItemWithSubNav-BMoBdUxK.mjs} +3 -3
- package/lib/_shared/esm/{TemplateBanner-zc4VmeeW.mjs → TemplateBanner-Up6cR-3_.mjs} +14 -7
- package/lib/_shared/esm/{TextInput-Vp_cBbpQ.mjs → TextInput-Dk7qNGoh.mjs} +7 -7
- package/lib/_shared/esm/Visible-C-jVXUWp.mjs +16 -0
- package/lib/_shared/esm/{index.es-C3WGtwrW.mjs → index.es-DCvYtQfu.mjs} +2 -2
- package/lib/index.cjs +1177 -877
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +193 -63
- package/lib/index.d.mts +193 -63
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +1167 -872
- package/lib/index.mjs.map +1 -1
- package/lib/styles.css +8 -22
- package/package.json +8 -8
- package/lib/GradientBackground/GradientBackground.cjs +0 -19
- package/lib/GradientBackground/GradientBackground.mjs +0 -17
- package/lib/GradientBackground/styles.css +0 -1
package/lib/Drawer/Drawer.cjs
CHANGED
|
@@ -5,10 +5,9 @@ var filterAttrs = require('../_shared/cjs/filter-attrs-eK6E_34o.cjs');
|
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var index$2 = require('../_shared/cjs/index-CTlXMLug.cjs');
|
|
7
7
|
var index$1 = require('../_shared/cjs/index-DAr_oO4-.cjs');
|
|
8
|
-
var ThemeIcon = require('../_shared/cjs/ThemeIcon-BoxbjTaQ.cjs');
|
|
9
8
|
var index = require('../_shared/cjs/index-DXNM3D1d.cjs');
|
|
10
|
-
var
|
|
11
|
-
var
|
|
9
|
+
var ThemeIcon = require('../_shared/cjs/ThemeIcon-BoxbjTaQ.cjs');
|
|
10
|
+
var Rule = require('../_shared/cjs/Rule-DMQsi2L6.cjs');
|
|
12
11
|
require('../_shared/cjs/Combination-B-rSVLfT.cjs');
|
|
13
12
|
require('react/jsx-runtime');
|
|
14
13
|
require('react-dom');
|
|
@@ -17,314 +16,11 @@ require('../_shared/cjs/suffix-modifier-DLUGR-yG.cjs');
|
|
|
17
16
|
require('../_shared/cjs/index-DR8Rkav9.cjs');
|
|
18
17
|
require('../_shared/cjs/Surface-BFx1yNsq.cjs');
|
|
19
18
|
|
|
20
|
-
function _interopNamespaceDefault(e) {
|
|
21
|
-
var n = Object.create(null);
|
|
22
|
-
if (e) {
|
|
23
|
-
Object.keys(e).forEach(function (k) {
|
|
24
|
-
if (k !== 'default') {
|
|
25
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
26
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
27
|
-
enumerable: true,
|
|
28
|
-
get: function () { return e[k]; }
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
n.default = e;
|
|
34
|
-
return Object.freeze(n);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
38
|
-
|
|
39
|
-
const LEFT = "Left";
|
|
40
|
-
const RIGHT = "Right";
|
|
41
|
-
const UP = "Up";
|
|
42
|
-
const DOWN = "Down";
|
|
43
|
-
|
|
44
|
-
/* global document */
|
|
45
|
-
const defaultProps = {
|
|
46
|
-
delta: 10,
|
|
47
|
-
preventScrollOnSwipe: false,
|
|
48
|
-
rotationAngle: 0,
|
|
49
|
-
trackMouse: false,
|
|
50
|
-
trackTouch: true,
|
|
51
|
-
swipeDuration: Infinity,
|
|
52
|
-
touchEventOptions: { passive: true },
|
|
53
|
-
};
|
|
54
|
-
const initialState = {
|
|
55
|
-
first: true,
|
|
56
|
-
initial: [0, 0],
|
|
57
|
-
start: 0,
|
|
58
|
-
swiping: false,
|
|
59
|
-
xy: [0, 0],
|
|
60
|
-
};
|
|
61
|
-
const mouseMove = "mousemove";
|
|
62
|
-
const mouseUp = "mouseup";
|
|
63
|
-
const touchEnd = "touchend";
|
|
64
|
-
const touchMove = "touchmove";
|
|
65
|
-
const touchStart = "touchstart";
|
|
66
|
-
function getDirection(absX, absY, deltaX, deltaY) {
|
|
67
|
-
if (absX > absY) {
|
|
68
|
-
if (deltaX > 0) {
|
|
69
|
-
return RIGHT;
|
|
70
|
-
}
|
|
71
|
-
return LEFT;
|
|
72
|
-
}
|
|
73
|
-
else if (deltaY > 0) {
|
|
74
|
-
return DOWN;
|
|
75
|
-
}
|
|
76
|
-
return UP;
|
|
77
|
-
}
|
|
78
|
-
function rotateXYByAngle(pos, angle) {
|
|
79
|
-
if (angle === 0)
|
|
80
|
-
return pos;
|
|
81
|
-
const angleInRadians = (Math.PI / 180) * angle;
|
|
82
|
-
const x = pos[0] * Math.cos(angleInRadians) + pos[1] * Math.sin(angleInRadians);
|
|
83
|
-
const y = pos[1] * Math.cos(angleInRadians) - pos[0] * Math.sin(angleInRadians);
|
|
84
|
-
return [x, y];
|
|
85
|
-
}
|
|
86
|
-
function getHandlers(set, handlerProps) {
|
|
87
|
-
const onStart = (event) => {
|
|
88
|
-
const isTouch = "touches" in event;
|
|
89
|
-
// if more than a single touch don't track, for now...
|
|
90
|
-
if (isTouch && event.touches.length > 1)
|
|
91
|
-
return;
|
|
92
|
-
set((state, props) => {
|
|
93
|
-
// setup mouse listeners on document to track swipe since swipe can leave container
|
|
94
|
-
if (props.trackMouse && !isTouch) {
|
|
95
|
-
document.addEventListener(mouseMove, onMove);
|
|
96
|
-
document.addEventListener(mouseUp, onUp);
|
|
97
|
-
}
|
|
98
|
-
const { clientX, clientY } = isTouch ? event.touches[0] : event;
|
|
99
|
-
const xy = rotateXYByAngle([clientX, clientY], props.rotationAngle);
|
|
100
|
-
props.onTouchStartOrOnMouseDown &&
|
|
101
|
-
props.onTouchStartOrOnMouseDown({ event });
|
|
102
|
-
return Object.assign(Object.assign(Object.assign({}, state), initialState), { initial: xy.slice(), xy, start: event.timeStamp || 0 });
|
|
103
|
-
});
|
|
104
|
-
};
|
|
105
|
-
const onMove = (event) => {
|
|
106
|
-
set((state, props) => {
|
|
107
|
-
const isTouch = "touches" in event;
|
|
108
|
-
// Discount a swipe if additional touches are present after
|
|
109
|
-
// a swipe has started.
|
|
110
|
-
if (isTouch && event.touches.length > 1) {
|
|
111
|
-
return state;
|
|
112
|
-
}
|
|
113
|
-
// if swipe has exceeded duration stop tracking
|
|
114
|
-
if (event.timeStamp - state.start > props.swipeDuration) {
|
|
115
|
-
return state.swiping ? Object.assign(Object.assign({}, state), { swiping: false }) : state;
|
|
116
|
-
}
|
|
117
|
-
const { clientX, clientY } = isTouch ? event.touches[0] : event;
|
|
118
|
-
const [x, y] = rotateXYByAngle([clientX, clientY], props.rotationAngle);
|
|
119
|
-
const deltaX = x - state.xy[0];
|
|
120
|
-
const deltaY = y - state.xy[1];
|
|
121
|
-
const absX = Math.abs(deltaX);
|
|
122
|
-
const absY = Math.abs(deltaY);
|
|
123
|
-
const time = (event.timeStamp || 0) - state.start;
|
|
124
|
-
const velocity = Math.sqrt(absX * absX + absY * absY) / (time || 1);
|
|
125
|
-
const vxvy = [deltaX / (time || 1), deltaY / (time || 1)];
|
|
126
|
-
const dir = getDirection(absX, absY, deltaX, deltaY);
|
|
127
|
-
// if swipe is under delta and we have not started to track a swipe: skip update
|
|
128
|
-
const delta = typeof props.delta === "number"
|
|
129
|
-
? props.delta
|
|
130
|
-
: props.delta[dir.toLowerCase()] ||
|
|
131
|
-
defaultProps.delta;
|
|
132
|
-
if (absX < delta && absY < delta && !state.swiping)
|
|
133
|
-
return state;
|
|
134
|
-
const eventData = {
|
|
135
|
-
absX,
|
|
136
|
-
absY,
|
|
137
|
-
deltaX,
|
|
138
|
-
deltaY,
|
|
139
|
-
dir,
|
|
140
|
-
event,
|
|
141
|
-
first: state.first,
|
|
142
|
-
initial: state.initial,
|
|
143
|
-
velocity,
|
|
144
|
-
vxvy,
|
|
145
|
-
};
|
|
146
|
-
// call onSwipeStart if present and is first swipe event
|
|
147
|
-
eventData.first && props.onSwipeStart && props.onSwipeStart(eventData);
|
|
148
|
-
// call onSwiping if present
|
|
149
|
-
props.onSwiping && props.onSwiping(eventData);
|
|
150
|
-
// track if a swipe is cancelable (handler for swiping or swiped(dir) exists)
|
|
151
|
-
// so we can call preventDefault if needed
|
|
152
|
-
let cancelablePageSwipe = false;
|
|
153
|
-
if (props.onSwiping ||
|
|
154
|
-
props.onSwiped ||
|
|
155
|
-
props[`onSwiped${dir}`]) {
|
|
156
|
-
cancelablePageSwipe = true;
|
|
157
|
-
}
|
|
158
|
-
if (cancelablePageSwipe &&
|
|
159
|
-
props.preventScrollOnSwipe &&
|
|
160
|
-
props.trackTouch &&
|
|
161
|
-
event.cancelable) {
|
|
162
|
-
event.preventDefault();
|
|
163
|
-
}
|
|
164
|
-
return Object.assign(Object.assign({}, state), {
|
|
165
|
-
// first is now always false
|
|
166
|
-
first: false, eventData, swiping: true });
|
|
167
|
-
});
|
|
168
|
-
};
|
|
169
|
-
const onEnd = (event) => {
|
|
170
|
-
set((state, props) => {
|
|
171
|
-
let eventData;
|
|
172
|
-
if (state.swiping && state.eventData) {
|
|
173
|
-
// if swipe is less than duration fire swiped callbacks
|
|
174
|
-
if (event.timeStamp - state.start < props.swipeDuration) {
|
|
175
|
-
eventData = Object.assign(Object.assign({}, state.eventData), { event });
|
|
176
|
-
props.onSwiped && props.onSwiped(eventData);
|
|
177
|
-
const onSwipedDir = props[`onSwiped${eventData.dir}`];
|
|
178
|
-
onSwipedDir && onSwipedDir(eventData);
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
else {
|
|
182
|
-
props.onTap && props.onTap({ event });
|
|
183
|
-
}
|
|
184
|
-
props.onTouchEndOrOnMouseUp && props.onTouchEndOrOnMouseUp({ event });
|
|
185
|
-
return Object.assign(Object.assign(Object.assign({}, state), initialState), { eventData });
|
|
186
|
-
});
|
|
187
|
-
};
|
|
188
|
-
const cleanUpMouse = () => {
|
|
189
|
-
// safe to just call removeEventListener
|
|
190
|
-
document.removeEventListener(mouseMove, onMove);
|
|
191
|
-
document.removeEventListener(mouseUp, onUp);
|
|
192
|
-
};
|
|
193
|
-
const onUp = (e) => {
|
|
194
|
-
cleanUpMouse();
|
|
195
|
-
onEnd(e);
|
|
196
|
-
};
|
|
197
|
-
/**
|
|
198
|
-
* The value of passive on touchMove depends on `preventScrollOnSwipe`:
|
|
199
|
-
* - true => { passive: false }
|
|
200
|
-
* - false => { passive: true } // Default
|
|
201
|
-
*
|
|
202
|
-
* NOTE: When preventScrollOnSwipe is true, we attempt to call preventDefault to prevent scroll.
|
|
203
|
-
*
|
|
204
|
-
* props.touchEventOptions can also be set for all touch event listeners,
|
|
205
|
-
* but for `touchmove` specifically when `preventScrollOnSwipe` it will
|
|
206
|
-
* supersede and force passive to false.
|
|
207
|
-
*
|
|
208
|
-
*/
|
|
209
|
-
const attachTouch = (el, props) => {
|
|
210
|
-
let cleanup = () => { };
|
|
211
|
-
if (el && el.addEventListener) {
|
|
212
|
-
const baseOptions = Object.assign(Object.assign({}, defaultProps.touchEventOptions), props.touchEventOptions);
|
|
213
|
-
// attach touch event listeners and handlers
|
|
214
|
-
const tls = [
|
|
215
|
-
[touchStart, onStart, baseOptions],
|
|
216
|
-
// preventScrollOnSwipe option supersedes touchEventOptions.passive
|
|
217
|
-
[
|
|
218
|
-
touchMove,
|
|
219
|
-
onMove,
|
|
220
|
-
Object.assign(Object.assign({}, baseOptions), (props.preventScrollOnSwipe ? { passive: false } : {})),
|
|
221
|
-
],
|
|
222
|
-
[touchEnd, onEnd, baseOptions],
|
|
223
|
-
];
|
|
224
|
-
tls.forEach(([e, h, o]) => el.addEventListener(e, h, o));
|
|
225
|
-
// return properly scoped cleanup method for removing listeners, options not required
|
|
226
|
-
cleanup = () => tls.forEach(([e, h]) => el.removeEventListener(e, h));
|
|
227
|
-
}
|
|
228
|
-
return cleanup;
|
|
229
|
-
};
|
|
230
|
-
const onRef = (el) => {
|
|
231
|
-
// "inline" ref functions are called twice on render, once with null then again with DOM element
|
|
232
|
-
// ignore null here
|
|
233
|
-
if (el === null)
|
|
234
|
-
return;
|
|
235
|
-
set((state, props) => {
|
|
236
|
-
// if the same DOM el as previous just return state
|
|
237
|
-
if (state.el === el)
|
|
238
|
-
return state;
|
|
239
|
-
const addState = {};
|
|
240
|
-
// if new DOM el clean up old DOM and reset cleanUpTouch
|
|
241
|
-
if (state.el && state.el !== el && state.cleanUpTouch) {
|
|
242
|
-
state.cleanUpTouch();
|
|
243
|
-
addState.cleanUpTouch = void 0;
|
|
244
|
-
}
|
|
245
|
-
// only attach if we want to track touch
|
|
246
|
-
if (props.trackTouch && el) {
|
|
247
|
-
addState.cleanUpTouch = attachTouch(el, props);
|
|
248
|
-
}
|
|
249
|
-
// store event attached DOM el for comparison, clean up, and re-attachment
|
|
250
|
-
return Object.assign(Object.assign(Object.assign({}, state), { el }), addState);
|
|
251
|
-
});
|
|
252
|
-
};
|
|
253
|
-
// set ref callback to attach touch event listeners
|
|
254
|
-
const output = {
|
|
255
|
-
ref: onRef,
|
|
256
|
-
};
|
|
257
|
-
// if track mouse attach mouse down listener
|
|
258
|
-
if (handlerProps.trackMouse) {
|
|
259
|
-
output.onMouseDown = onStart;
|
|
260
|
-
}
|
|
261
|
-
return [output, attachTouch];
|
|
262
|
-
}
|
|
263
|
-
function updateTransientState(state, props, previousProps, attachTouch) {
|
|
264
|
-
// if trackTouch is off or there is no el, then remove handlers if necessary and exit
|
|
265
|
-
if (!props.trackTouch || !state.el) {
|
|
266
|
-
if (state.cleanUpTouch) {
|
|
267
|
-
state.cleanUpTouch();
|
|
268
|
-
}
|
|
269
|
-
return Object.assign(Object.assign({}, state), { cleanUpTouch: undefined });
|
|
270
|
-
}
|
|
271
|
-
// trackTouch is on, so if there are no handlers attached, attach them and exit
|
|
272
|
-
if (!state.cleanUpTouch) {
|
|
273
|
-
return Object.assign(Object.assign({}, state), { cleanUpTouch: attachTouch(state.el, props) });
|
|
274
|
-
}
|
|
275
|
-
// trackTouch is on and handlers are already attached, so if preventScrollOnSwipe changes value,
|
|
276
|
-
// remove and reattach handlers (this is required to update the passive option when attaching
|
|
277
|
-
// the handlers)
|
|
278
|
-
if (props.preventScrollOnSwipe !== previousProps.preventScrollOnSwipe ||
|
|
279
|
-
props.touchEventOptions.passive !== previousProps.touchEventOptions.passive) {
|
|
280
|
-
state.cleanUpTouch();
|
|
281
|
-
return Object.assign(Object.assign({}, state), { cleanUpTouch: attachTouch(state.el, props) });
|
|
282
|
-
}
|
|
283
|
-
return state;
|
|
284
|
-
}
|
|
285
|
-
function useSwipeable(options) {
|
|
286
|
-
const { trackMouse } = options;
|
|
287
|
-
const transientState = React__namespace.useRef(Object.assign({}, initialState));
|
|
288
|
-
const transientProps = React__namespace.useRef(Object.assign({}, defaultProps));
|
|
289
|
-
// track previous rendered props
|
|
290
|
-
const previousProps = React__namespace.useRef(Object.assign({}, transientProps.current));
|
|
291
|
-
previousProps.current = Object.assign({}, transientProps.current);
|
|
292
|
-
// update current render props & defaults
|
|
293
|
-
transientProps.current = Object.assign(Object.assign({}, defaultProps), options);
|
|
294
|
-
// Force defaults for config properties
|
|
295
|
-
let defaultKey;
|
|
296
|
-
for (defaultKey in defaultProps) {
|
|
297
|
-
if (transientProps.current[defaultKey] === void 0) {
|
|
298
|
-
transientProps.current[defaultKey] = defaultProps[defaultKey];
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
const [handlers, attachTouch] = React__namespace.useMemo(() => getHandlers((stateSetter) => (transientState.current = stateSetter(transientState.current, transientProps.current)), { trackMouse }), [trackMouse]);
|
|
302
|
-
transientState.current = updateTransientState(transientState.current, transientProps.current, previousProps.current, attachTouch);
|
|
303
|
-
return handlers;
|
|
304
|
-
}
|
|
305
|
-
|
|
306
19
|
var Drawer = function (_a) {
|
|
307
|
-
var isOpen = _a.isOpen,
|
|
20
|
+
var isOpen = _a.isOpen, children = _a.children, onRequestClose = _a.onRequestClose, _b = _a.noOverlay, noOverlay = _b === void 0 ? false : _b, _c = _a.shouldReturnFocus, shouldReturnFocus = _c === void 0 ? true : _c, _d = _a.size, size = _d === void 0 ? "m" : _d, height = _a.height, width = _a.width, _e = _a.position, position = _e === void 0 ? "right" : _e, props = filterAttrs.__rest(_a, ["isOpen", "children", "onRequestClose", "noOverlay", "shouldReturnFocus", "size", "height", "width", "position"]);
|
|
308
21
|
var _f = index.useThemeElement(), themeElement = _f[0], setThemeElement = _f[1];
|
|
309
22
|
var triggerRef = React.useRef(null);
|
|
310
23
|
var _g = React.useState(null), exitTranslateValue = _g[0], setExitTranslateValue = _g[1];
|
|
311
|
-
var handlers = useSwipeable({
|
|
312
|
-
onSwiped: function (_a) {
|
|
313
|
-
var dir = _a.dir;
|
|
314
|
-
if (position === "left" && dir === "Left") {
|
|
315
|
-
setExitTranslateValue([-100, 0]);
|
|
316
|
-
}
|
|
317
|
-
if (position === "right" && dir === "Right") {
|
|
318
|
-
setExitTranslateValue([100, 0]);
|
|
319
|
-
}
|
|
320
|
-
if (position === "top" && dir === "Up") {
|
|
321
|
-
setExitTranslateValue([0, -100]);
|
|
322
|
-
}
|
|
323
|
-
if (position === "bottom" && dir === "Down") {
|
|
324
|
-
setExitTranslateValue([0, 100]);
|
|
325
|
-
}
|
|
326
|
-
},
|
|
327
|
-
});
|
|
328
24
|
var setTriggerElement = function () {
|
|
329
25
|
return shouldReturnFocus &&
|
|
330
26
|
(triggerRef.current = document.activeElement);
|
|
@@ -346,30 +42,57 @@ var Drawer = function (_a) {
|
|
|
346
42
|
},
|
|
347
43
|
}
|
|
348
44
|
: {};
|
|
45
|
+
var sizingProperties = filterAttrs.__assign(filterAttrs.__assign({}, (position !== "bottom" && { width: width })), (position === "bottom" && { height: height }));
|
|
349
46
|
return (React.createElement("div", { ref: setThemeElement },
|
|
350
47
|
React.createElement(index$1.Root, { open: isOpen },
|
|
351
48
|
React.createElement(index$1.Portal, { container: themeElement },
|
|
352
49
|
React.createElement(index$1.Overlay, { style: exitTransitionStyle.overlay, className: index$2.classNames("arc-Drawer-overlay", {
|
|
353
|
-
"arc-Drawer-overlay--visible":
|
|
50
|
+
"arc-Drawer-overlay--visible": !noOverlay,
|
|
354
51
|
}) },
|
|
355
52
|
React.createElement(index$1.Content, filterAttrs.__assign({ onTransitionEnd: function () {
|
|
356
53
|
setExitTranslateValue(null);
|
|
357
54
|
onRequestClose();
|
|
358
|
-
}, className: index$2.classNames("arc-Drawer-slider", "arc-Drawer-slider--".concat(size), "arc-Drawer-slider--".concat(position)), style:
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
55
|
+
}, className: index$2.classNames("arc-Drawer-slider", "arc-Drawer-slider--".concat(size), "arc-Drawer-slider--".concat(position)), style: (filterAttrs.__assign({}, sizingProperties)), onOpenAutoFocus: setTriggerElement, onCloseAutoFocus: focusTriggerElement, onEscapeKeyDown: onRequestClose, onInteractOutside: onRequestClose, "aria-modal": "true" }, filterAttrs.filterAttrs(props)),
|
|
56
|
+
children,
|
|
57
|
+
React.createElement("div", { className: "arc-Drawer-closeButtonContainer" },
|
|
58
|
+
React.createElement("button", { "aria-label": "close", onClick: onRequestClose, className: "arc-Drawer-closeButton" },
|
|
59
|
+
React.createElement(ThemeIcon.ThemeIcon, { size: 32, icon: "drawerClose" })))))))));
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
var DrawerHeader = function (_a) {
|
|
63
|
+
var title = _a.title, _b = _a.isFixed, isFixed = _b === void 0 ? false : _b, props = filterAttrs.__rest(_a, ["title", "isFixed"]);
|
|
64
|
+
return (React.createElement(React.Fragment, null,
|
|
65
|
+
React.createElement("div", filterAttrs.__assign({ className: index$2.classNames("arc-DrawerHeader", {
|
|
66
|
+
"arc-DrawerHeader--isFixed": isFixed,
|
|
67
|
+
}) }, filterAttrs.filterAttrs(props)),
|
|
68
|
+
React.createElement("div", { className: "arc-DrawerHeader-content" },
|
|
69
|
+
React.createElement("div", { className: "arc-DrawerHeader-titleContainer" },
|
|
70
|
+
React.createElement(index$1.Title, { asChild: true },
|
|
71
|
+
React.createElement("h1", { className: "arc-DrawerHeader-title" }, title)))),
|
|
72
|
+
isFixed && (React.createElement("div", { className: "arc-DrawerHeader-divider" },
|
|
73
|
+
React.createElement(Rule.Rule, null))))));
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
var DrawerFooter = function (_a) {
|
|
77
|
+
var isFixed = _a.isFixed, children = _a.children;
|
|
78
|
+
return (React.createElement(React.Fragment, null,
|
|
79
|
+
React.createElement("div", { className: index$2.classNames("arc-DrawerFooter", {
|
|
80
|
+
"arc-DrawerFooter--isFixed": isFixed,
|
|
81
|
+
}) },
|
|
82
|
+
isFixed && (React.createElement("div", { className: "arc-DrawerFooter-divider" },
|
|
83
|
+
React.createElement(Rule.Rule, null))),
|
|
84
|
+
children)));
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
var DrawerContent = function (_a) {
|
|
88
|
+
var isFullBleed = _a.isFullBleed, children = _a.children;
|
|
89
|
+
return (React.createElement("div", { className: index$2.classNames("arc-DrawerContent", {
|
|
90
|
+
"arc-DrawerContent--isFullBleed": isFullBleed,
|
|
91
|
+
}) },
|
|
92
|
+
React.createElement("div", { className: "arc-Drawer-section" }, children)));
|
|
373
93
|
};
|
|
374
94
|
|
|
375
95
|
exports.Drawer = Drawer;
|
|
96
|
+
exports.DrawerContent = DrawerContent;
|
|
97
|
+
exports.DrawerFooter = DrawerFooter;
|
|
98
|
+
exports.DrawerHeader = DrawerHeader;
|