@coinbase/cds-web 8.42.0 → 8.43.2
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/CHANGELOG.md +17 -0
- package/dts/carousel/Carousel.d.ts +77 -9
- package/dts/carousel/Carousel.d.ts.map +1 -1
- package/dts/carousel/CarouselContext.d.ts +18 -0
- package/dts/carousel/CarouselContext.d.ts.map +1 -1
- package/dts/carousel/CarouselItem.d.ts +2 -0
- package/dts/carousel/CarouselItem.d.ts.map +1 -1
- package/dts/carousel/DefaultCarouselNavigation.d.ts +20 -0
- package/dts/carousel/DefaultCarouselNavigation.d.ts.map +1 -1
- package/dts/carousel/DefaultCarouselPagination.d.ts.map +1 -1
- package/dts/carousel/__figma__/Carousel.figma.d.ts +2 -0
- package/dts/carousel/__figma__/Carousel.figma.d.ts.map +1 -0
- package/dts/chips/Chip.d.ts +2 -0
- package/dts/chips/Chip.d.ts.map +1 -1
- package/dts/navigation/NavigationBar.d.ts +35 -4
- package/dts/navigation/NavigationBar.d.ts.map +1 -1
- package/dts/types.d.ts +8 -0
- package/dts/types.d.ts.map +1 -1
- package/esm/cards/MediaCard/__figma__/MediaCard.figma.js +20 -16
- package/esm/cards/MessagingCard/__figma__/MessagingCard.figma.js +3 -10
- package/esm/carousel/Carousel.css +2 -1
- package/esm/carousel/Carousel.js +301 -91
- package/esm/carousel/CarouselContext.js +8 -0
- package/esm/carousel/CarouselItem.css +1 -0
- package/esm/carousel/CarouselItem.js +15 -8
- package/esm/carousel/DefaultCarouselNavigation.js +18 -2
- package/esm/carousel/DefaultCarouselPagination.css +3 -2
- package/esm/carousel/DefaultCarouselPagination.js +138 -86
- package/esm/carousel/__figma__/Carousel.figma.js +15 -0
- package/esm/navigation/NavigationBar.js +78 -45
- package/package.json +3 -3
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
const _excluded = ["
|
|
1
|
+
const _excluded = ["isActive"],
|
|
2
|
+
_excluded2 = ["isActive", "className"];
|
|
2
3
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
5
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
@@ -6,113 +7,164 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
6
7
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
8
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
8
9
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
9
|
-
import React, { memo, useCallback } from 'react';
|
|
10
|
-
import {
|
|
11
|
-
import { RefMapContext, useRefMapContext } from '@coinbase/cds-common/system/RefMapContext';
|
|
10
|
+
import React, { memo, useCallback, useEffect, useRef, useState } from 'react';
|
|
11
|
+
import { motion } from 'framer-motion';
|
|
12
12
|
import { cx } from '../cx';
|
|
13
13
|
import { HStack } from '../layout/HStack';
|
|
14
14
|
import { Pressable } from '../system/Pressable';
|
|
15
|
+
import { useCarouselAutoplayContext } from './CarouselContext';
|
|
15
16
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
|
+
const MotionPressable = motion(Pressable);
|
|
18
|
+
const INDICATOR_ACTIVE_WIDTH = 24;
|
|
19
|
+
const INDICATOR_INACTIVE_WIDTH = 4;
|
|
20
|
+
const INDICATOR_HEIGHT = 4;
|
|
21
|
+
const animationConfig = {
|
|
22
|
+
type: 'spring',
|
|
23
|
+
stiffness: 900,
|
|
24
|
+
damping: 120,
|
|
25
|
+
mass: 4,
|
|
26
|
+
clamp: true
|
|
27
|
+
};
|
|
16
28
|
const defaultPaginationCss = "defaultPaginationCss-dyqwmgi";
|
|
17
|
-
const
|
|
18
|
-
const
|
|
29
|
+
const pillCss = "pillCss-pea8kmz";
|
|
30
|
+
const dotCss = "dotCss-d1eoinf6";
|
|
31
|
+
const PaginationPill = /*#__PURE__*/memo(function PaginationPill(_ref) {
|
|
19
32
|
let {
|
|
20
|
-
id,
|
|
21
33
|
isActive
|
|
22
34
|
} = _ref,
|
|
23
35
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
24
|
-
const {
|
|
25
|
-
registerRef
|
|
26
|
-
} = useRefMapContext();
|
|
27
|
-
const refCallback = useCallback(ref => registerRef(id, ref), [registerRef, id]);
|
|
28
36
|
return /*#__PURE__*/_jsx(Pressable, _objectSpread({
|
|
29
|
-
|
|
37
|
+
"aria-current": isActive ? 'true' : undefined,
|
|
30
38
|
background: isActive ? 'bgPrimary' : 'bgLine',
|
|
31
39
|
borderColor: "transparent",
|
|
32
|
-
"data-active": isActive
|
|
33
|
-
tabIndex: isActive ? undefined : -1
|
|
40
|
+
"data-active": isActive
|
|
34
41
|
}, props));
|
|
35
42
|
});
|
|
36
|
-
|
|
43
|
+
const PaginationDot = /*#__PURE__*/memo(function PaginationDot(_ref2) {
|
|
44
|
+
let {
|
|
45
|
+
isActive,
|
|
46
|
+
className
|
|
47
|
+
} = _ref2,
|
|
48
|
+
props = _objectWithoutProperties(_ref2, _excluded2);
|
|
49
|
+
const autoplayContext = useCarouselAutoplayContext();
|
|
50
|
+
const {
|
|
51
|
+
isPlaying,
|
|
52
|
+
isEnabled,
|
|
53
|
+
interval,
|
|
54
|
+
getRemainingTime
|
|
55
|
+
} = autoplayContext;
|
|
56
|
+
const showProgress = isActive && isEnabled;
|
|
57
|
+
|
|
58
|
+
// Track the progress width as a percentage string for animation
|
|
59
|
+
const [progressState, setProgressState] = useState({
|
|
60
|
+
width: '0%',
|
|
61
|
+
duration: 0
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
// Use a ref to track the last paused progress so we can resume from it
|
|
65
|
+
const lastProgressRef = useRef(0);
|
|
66
|
+
useEffect(() => {
|
|
67
|
+
if (!showProgress) {
|
|
68
|
+
setProgressState({
|
|
69
|
+
width: '0%',
|
|
70
|
+
duration: 0
|
|
71
|
+
});
|
|
72
|
+
lastProgressRef.current = 0;
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
const remainingTime = getRemainingTime();
|
|
76
|
+
const currentProgress = 1 - remainingTime / interval;
|
|
77
|
+
if (isPlaying) {
|
|
78
|
+
lastProgressRef.current = currentProgress;
|
|
79
|
+
setProgressState({
|
|
80
|
+
width: '100%',
|
|
81
|
+
duration: remainingTime / 1000
|
|
82
|
+
});
|
|
83
|
+
} else {
|
|
84
|
+
setProgressState({
|
|
85
|
+
width: "".concat(currentProgress * 100, "%"),
|
|
86
|
+
duration: 0
|
|
87
|
+
});
|
|
88
|
+
lastProgressRef.current = currentProgress;
|
|
89
|
+
}
|
|
90
|
+
}, [isPlaying, showProgress, interval, getRemainingTime]);
|
|
91
|
+
return /*#__PURE__*/_jsx(MotionPressable, _objectSpread(_objectSpread({
|
|
92
|
+
animate: {
|
|
93
|
+
width: isActive ? INDICATOR_ACTIVE_WIDTH : INDICATOR_INACTIVE_WIDTH,
|
|
94
|
+
backgroundColor: isActive && !showProgress ? 'var(--color-bgPrimary)' : 'var(--color-bgLine)'
|
|
95
|
+
},
|
|
96
|
+
"aria-current": isActive ? 'true' : undefined,
|
|
97
|
+
borderColor: "transparent",
|
|
98
|
+
borderWidth: 0,
|
|
99
|
+
className: cx(dotCss, className),
|
|
100
|
+
"data-active": isActive,
|
|
101
|
+
initial: false,
|
|
102
|
+
transition: animationConfig
|
|
103
|
+
}, props), {}, {
|
|
104
|
+
children: showProgress && /*#__PURE__*/_jsx(motion.div, {
|
|
105
|
+
animate: {
|
|
106
|
+
width: progressState.width
|
|
107
|
+
},
|
|
108
|
+
initial: false,
|
|
109
|
+
style: {
|
|
110
|
+
height: '100%',
|
|
111
|
+
background: 'var(--color-bgPrimary)',
|
|
112
|
+
borderRadius: 'var(--borderRadius-100)'
|
|
113
|
+
},
|
|
114
|
+
transition: {
|
|
115
|
+
duration: progressState.duration,
|
|
116
|
+
ease: 'linear'
|
|
117
|
+
}
|
|
118
|
+
})
|
|
119
|
+
}));
|
|
120
|
+
});
|
|
121
|
+
const defaultPaginationAccessibilityLabel = pageIndex => "Go to page ".concat(pageIndex + 1);
|
|
122
|
+
export const DefaultCarouselPagination = /*#__PURE__*/memo(function DefaultCarouselPagination(_ref3) {
|
|
37
123
|
let {
|
|
38
124
|
totalPages,
|
|
39
125
|
activePageIndex,
|
|
40
126
|
onClickPage,
|
|
41
|
-
paginationAccessibilityLabel =
|
|
127
|
+
paginationAccessibilityLabel = defaultPaginationAccessibilityLabel,
|
|
42
128
|
className,
|
|
43
129
|
classNames,
|
|
44
130
|
style,
|
|
45
131
|
styles,
|
|
46
|
-
testID = 'carousel-pagination'
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
break;
|
|
83
|
-
default:
|
|
84
|
-
break;
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
}, [paginationRefMap, testID, totalPages, onClickPage]);
|
|
88
|
-
return /*#__PURE__*/_jsx(RefMapContext.Provider, {
|
|
89
|
-
value: paginationRefMap,
|
|
90
|
-
children: /*#__PURE__*/_jsx(HStack, {
|
|
91
|
-
className: cx(defaultPaginationCss, className, classNames === null || classNames === void 0 ? void 0 : classNames.root),
|
|
92
|
-
gap: 0.5,
|
|
93
|
-
justifyContent: "center",
|
|
94
|
-
style: _objectSpread(_objectSpread({}, style), styles === null || styles === void 0 ? void 0 : styles.root),
|
|
95
|
-
children: totalPages > 0 ? Array.from({
|
|
96
|
-
length: totalPages
|
|
97
|
-
}, (_, index) => /*#__PURE__*/_jsx(PaginationDot, {
|
|
98
|
-
accessibilityLabel: typeof paginationAccessibilityLabel === 'function' ? paginationAccessibilityLabel(index) : "".concat(paginationAccessibilityLabel, " ").concat(index + 1),
|
|
99
|
-
className: cx(dotCss, classNames === null || classNames === void 0 ? void 0 : classNames.dot),
|
|
100
|
-
id: "".concat(testID, "-").concat(index),
|
|
101
|
-
isActive: index === activePageIndex,
|
|
102
|
-
onClick: () => onClickPage === null || onClickPage === void 0 ? void 0 : onClickPage(index),
|
|
103
|
-
onKeyDown: getPaginationKeyDownHandler(index),
|
|
104
|
-
style: styles === null || styles === void 0 ? void 0 : styles.dot,
|
|
105
|
-
testID: "".concat(testID, "-").concat(index)
|
|
106
|
-
}, index)) : /*#__PURE__*/_jsx(Pressable, {
|
|
107
|
-
disabled: true,
|
|
108
|
-
"aria-hidden": "true",
|
|
109
|
-
background: "bgLine",
|
|
110
|
-
borderColor: "transparent",
|
|
111
|
-
className: cx(dotCss, classNames === null || classNames === void 0 ? void 0 : classNames.dot),
|
|
112
|
-
style: _objectSpread({
|
|
113
|
-
opacity: 0
|
|
114
|
-
}, styles === null || styles === void 0 ? void 0 : styles.dot)
|
|
115
|
-
})
|
|
132
|
+
testID = 'carousel-pagination',
|
|
133
|
+
variant = 'pill'
|
|
134
|
+
} = _ref3;
|
|
135
|
+
const isDot = variant === 'dot';
|
|
136
|
+
const getAccessibilityLabel = useCallback(index => typeof paginationAccessibilityLabel === 'function' ? paginationAccessibilityLabel(index) : paginationAccessibilityLabel, [paginationAccessibilityLabel]);
|
|
137
|
+
return /*#__PURE__*/_jsx(HStack, {
|
|
138
|
+
className: cx(defaultPaginationCss, className, classNames === null || classNames === void 0 ? void 0 : classNames.root),
|
|
139
|
+
gap: 0.5,
|
|
140
|
+
justifyContent: "center",
|
|
141
|
+
style: _objectSpread(_objectSpread({}, style), styles === null || styles === void 0 ? void 0 : styles.root),
|
|
142
|
+
children: totalPages > 0 ? Array.from({
|
|
143
|
+
length: totalPages
|
|
144
|
+
}, (_, index) => isDot ? /*#__PURE__*/_jsx(PaginationDot, {
|
|
145
|
+
accessibilityLabel: getAccessibilityLabel(index),
|
|
146
|
+
className: classNames === null || classNames === void 0 ? void 0 : classNames.dot,
|
|
147
|
+
isActive: index === activePageIndex,
|
|
148
|
+
onClick: () => onClickPage === null || onClickPage === void 0 ? void 0 : onClickPage(index),
|
|
149
|
+
style: styles === null || styles === void 0 ? void 0 : styles.dot,
|
|
150
|
+
testID: "".concat(testID, "-").concat(index)
|
|
151
|
+
}, index) : /*#__PURE__*/_jsx(PaginationPill, {
|
|
152
|
+
accessibilityLabel: getAccessibilityLabel(index),
|
|
153
|
+
className: cx(pillCss, classNames === null || classNames === void 0 ? void 0 : classNames.dot),
|
|
154
|
+
isActive: index === activePageIndex,
|
|
155
|
+
onClick: () => onClickPage === null || onClickPage === void 0 ? void 0 : onClickPage(index),
|
|
156
|
+
style: styles === null || styles === void 0 ? void 0 : styles.dot,
|
|
157
|
+
testID: "".concat(testID, "-").concat(index)
|
|
158
|
+
}, index)) : /*#__PURE__*/_jsx(Pressable, {
|
|
159
|
+
disabled: true,
|
|
160
|
+
"aria-hidden": "true",
|
|
161
|
+
background: "bgLine",
|
|
162
|
+
borderColor: "transparent",
|
|
163
|
+
className: cx(isDot ? dotCss : pillCss, classNames === null || classNames === void 0 ? void 0 : classNames.dot),
|
|
164
|
+
style: _objectSpread({
|
|
165
|
+
opacity: 0,
|
|
166
|
+
width: isDot ? INDICATOR_INACTIVE_WIDTH : undefined
|
|
167
|
+
}, styles === null || styles === void 0 ? void 0 : styles.dot)
|
|
116
168
|
})
|
|
117
169
|
});
|
|
118
170
|
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import figma from '@figma/code-connect/react';
|
|
2
|
+
import { Carousel, CarouselItem } from '../';
|
|
3
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
|
+
figma.connect(Carousel, 'https://www.figma.com/design/k5CtyJccNQUGMI5bI4lJ2g/%E2%9C%A8-CDS-Components?node-id=48671-10433', {
|
|
5
|
+
imports: ["import { Carousel, CarouselItem } from '@coinbase/cds-web/carousel'"],
|
|
6
|
+
example: () => /*#__PURE__*/_jsxs(Carousel, {
|
|
7
|
+
children: [/*#__PURE__*/_jsx(CarouselItem, {
|
|
8
|
+
id: "1"
|
|
9
|
+
}), /*#__PURE__*/_jsx(CarouselItem, {
|
|
10
|
+
id: "2"
|
|
11
|
+
}), /*#__PURE__*/_jsx(CarouselItem, {
|
|
12
|
+
id: "3"
|
|
13
|
+
})]
|
|
14
|
+
})
|
|
15
|
+
});
|
|
@@ -1,75 +1,108 @@
|
|
|
1
|
+
const _excluded = ["start", "children", "end", "bottom", "accessibilityLabel", "background", "paddingX", "paddingTop", "paddingBottom", "position", "top", "left", "right", "width", "dangerouslyDisableOverflowHidden", "columnGap", "rowGap", "className", "classNames", "style", "styles", "testID"];
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
8
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
1
9
|
import React, { memo, useMemo } from 'react';
|
|
2
10
|
import { usePreviousValue } from '@coinbase/cds-common/hooks/usePreviousValue';
|
|
3
11
|
import { zIndex } from '@coinbase/cds-common/tokens/zIndex';
|
|
4
12
|
import { Collapsible } from '../collapsible/Collapsible';
|
|
13
|
+
import { cx } from '../cx';
|
|
5
14
|
import { HStack, VStack } from '../layout';
|
|
6
15
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
-
const
|
|
16
|
+
export const navigationBarDefaultElement = 'nav';
|
|
17
|
+
/**
|
|
18
|
+
* Static class names for NavigationBar component parts.
|
|
19
|
+
* Use these selectors to target specific elements with CSS.
|
|
20
|
+
*/
|
|
21
|
+
export const navigationBarClassNames = {
|
|
22
|
+
/** Root nav element containing the entire navigation bar */
|
|
23
|
+
root: 'cds-NavigationBar',
|
|
24
|
+
/** Container for the start slot (e.g., back button) */
|
|
25
|
+
start: 'cds-NavigationBar-start',
|
|
26
|
+
/** Container for the main children content (e.g., title) */
|
|
27
|
+
content: 'cds-NavigationBar-content'
|
|
28
|
+
};
|
|
8
29
|
export const NavigationBar = /*#__PURE__*/memo(_ref => {
|
|
9
30
|
let {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
31
|
+
start,
|
|
32
|
+
children,
|
|
33
|
+
end,
|
|
34
|
+
bottom,
|
|
35
|
+
accessibilityLabel = 'main navigation',
|
|
36
|
+
background = 'bg',
|
|
37
|
+
paddingX = 2,
|
|
38
|
+
paddingTop = 2,
|
|
39
|
+
paddingBottom = bottom ? undefined : 2,
|
|
40
|
+
position = 'sticky',
|
|
41
|
+
top = 0,
|
|
42
|
+
left = 0,
|
|
43
|
+
right = 0,
|
|
44
|
+
width = '100%',
|
|
45
|
+
dangerouslyDisableOverflowHidden,
|
|
46
|
+
columnGap,
|
|
47
|
+
rowGap = 1,
|
|
48
|
+
className,
|
|
49
|
+
classNames,
|
|
50
|
+
style,
|
|
51
|
+
styles,
|
|
52
|
+
testID
|
|
53
|
+
} = _ref,
|
|
54
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
22
55
|
const prevStart = usePreviousValue(start);
|
|
23
56
|
const startNode = useMemo(() => start || prevStart, [start, prevStart]);
|
|
24
|
-
return /*#__PURE__*/_jsxs(VStack, {
|
|
57
|
+
return /*#__PURE__*/_jsxs(VStack, _objectSpread(_objectSpread({
|
|
25
58
|
borderedBottom: true,
|
|
26
59
|
accessibilityLabel: accessibilityLabel,
|
|
27
60
|
as: "nav",
|
|
28
|
-
background:
|
|
29
|
-
className:
|
|
61
|
+
background: background,
|
|
62
|
+
className: cx(navigationBarClassNames.root, className, classNames === null || classNames === void 0 ? void 0 : classNames.root),
|
|
30
63
|
gap: rowGap,
|
|
31
|
-
left:
|
|
64
|
+
left: left,
|
|
32
65
|
paddingBottom: paddingBottom,
|
|
33
66
|
paddingTop: paddingTop,
|
|
34
67
|
paddingX: paddingX,
|
|
35
|
-
position:
|
|
36
|
-
right:
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
68
|
+
position: position,
|
|
69
|
+
right: right,
|
|
70
|
+
style: _objectSpread(_objectSpread({}, style), styles === null || styles === void 0 ? void 0 : styles.root),
|
|
71
|
+
testID: testID,
|
|
72
|
+
top: top,
|
|
73
|
+
width: width,
|
|
74
|
+
zIndex: zIndex.navigation
|
|
75
|
+
}, props), {}, {
|
|
40
76
|
children: [/*#__PURE__*/_jsxs(HStack, {
|
|
41
77
|
alignItems: "center",
|
|
42
78
|
gap: columnGap !== null && columnGap !== void 0 ? columnGap : {
|
|
43
79
|
base: 2,
|
|
44
80
|
phone: 1
|
|
45
81
|
},
|
|
46
|
-
justifyContent: "space-between",
|
|
47
82
|
overflow: "auto",
|
|
48
|
-
children: [/*#__PURE__*/
|
|
83
|
+
children: [/*#__PURE__*/_jsx(Collapsible, {
|
|
84
|
+
collapsed: !start,
|
|
85
|
+
dangerouslyDisableOverflowHidden: dangerouslyDisableOverflowHidden,
|
|
86
|
+
direction: "horizontal",
|
|
87
|
+
children: /*#__PURE__*/_jsx(HStack, {
|
|
88
|
+
alignItems: "center",
|
|
89
|
+
className: cx(navigationBarClassNames.start, classNames === null || classNames === void 0 ? void 0 : classNames.start),
|
|
90
|
+
paddingEnd: columnGap !== null && columnGap !== void 0 ? columnGap : {
|
|
91
|
+
base: 2,
|
|
92
|
+
phone: 1
|
|
93
|
+
},
|
|
94
|
+
style: styles === null || styles === void 0 ? void 0 : styles.start,
|
|
95
|
+
children: startNode
|
|
96
|
+
})
|
|
97
|
+
}), /*#__PURE__*/_jsx(HStack, {
|
|
49
98
|
alignItems: "center",
|
|
99
|
+
className: cx(navigationBarClassNames.content, classNames === null || classNames === void 0 ? void 0 : classNames.content),
|
|
50
100
|
flexGrow: 1,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
children:
|
|
54
|
-
collapsed: !start,
|
|
55
|
-
dangerouslyDisableOverflowHidden: dangerouslyDisableOverflowHidden,
|
|
56
|
-
direction: "horizontal",
|
|
57
|
-
children: /*#__PURE__*/_jsx(HStack, {
|
|
58
|
-
alignItems: "center",
|
|
59
|
-
paddingEnd: columnGap !== null && columnGap !== void 0 ? columnGap : {
|
|
60
|
-
base: 2,
|
|
61
|
-
phone: 1
|
|
62
|
-
},
|
|
63
|
-
children: startNode
|
|
64
|
-
})
|
|
65
|
-
}), /*#__PURE__*/_jsx(HStack, {
|
|
66
|
-
alignItems: "center",
|
|
67
|
-
flexGrow: 1,
|
|
68
|
-
gap: 1,
|
|
69
|
-
children: children
|
|
70
|
-
})]
|
|
101
|
+
gap: 1,
|
|
102
|
+
style: styles === null || styles === void 0 ? void 0 : styles.content,
|
|
103
|
+
children: children
|
|
71
104
|
}), end]
|
|
72
105
|
}), bottom]
|
|
73
|
-
});
|
|
106
|
+
}));
|
|
74
107
|
});
|
|
75
108
|
NavigationBar.displayName = 'NavigationBar';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coinbase/cds-web",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.43.2",
|
|
4
4
|
"description": "Coinbase Design System - Web",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -207,8 +207,8 @@
|
|
|
207
207
|
"react-dom": "^18.3.1"
|
|
208
208
|
},
|
|
209
209
|
"dependencies": {
|
|
210
|
-
"@coinbase/cds-common": "^8.
|
|
211
|
-
"@coinbase/cds-icons": "^5.
|
|
210
|
+
"@coinbase/cds-common": "^8.43.2",
|
|
211
|
+
"@coinbase/cds-icons": "^5.11.0",
|
|
212
212
|
"@coinbase/cds-illustrations": "^4.31.0",
|
|
213
213
|
"@coinbase/cds-lottie-files": "^3.3.4",
|
|
214
214
|
"@coinbase/cds-utils": "^2.3.5",
|