@coinbase/cds-web 8.43.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 +11 -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/navigation/NavigationBar.js +78 -45
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,17 @@ All notable changes to this project will be documented in this file.
|
|
|
8
8
|
|
|
9
9
|
<!-- template-start -->
|
|
10
10
|
|
|
11
|
+
## 8.43.2 ((2/9/2026, 09:05 AM PST))
|
|
12
|
+
|
|
13
|
+
This is an artificial version bump with no new change.
|
|
14
|
+
|
|
15
|
+
## 8.43.1 (2/6/2026 PST)
|
|
16
|
+
|
|
17
|
+
#### 🐞 Fixes
|
|
18
|
+
|
|
19
|
+
- Update chpi prop export. [[#328](https://github.com/coinbase/cds/pull/328)]
|
|
20
|
+
- Add NavigationBar classNames. [[#328](https://github.com/coinbase/cds/pull/328)]
|
|
21
|
+
|
|
11
22
|
## 8.43.0 (2/6/2026 PST)
|
|
12
23
|
|
|
13
24
|
#### 🚀 Updates
|
package/dts/chips/Chip.d.ts
CHANGED
package/dts/chips/Chip.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chip.d.ts","sourceRoot":"","sources":["../../src/chips/Chip.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Chip.d.ts","sourceRoot":"","sources":["../../src/chips/Chip.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,YAAY,EAAE,SAAS,EAAE,CAAC;AAM1B;;;;GAIG;AACH,eAAO,MAAM,IAAI,sMAgIhB,CAAC"}
|
|
@@ -1,8 +1,23 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { SharedProps } from '@coinbase/cds-common';
|
|
3
2
|
import type { ThemeVars } from '@coinbase/cds-common/core/theme';
|
|
3
|
+
import { type BoxBaseProps, type BoxProps } from '../layout';
|
|
4
4
|
import type { ResponsiveProp } from '../styles/styleProps';
|
|
5
|
-
|
|
5
|
+
import type { StylesAndClassNames } from '../types';
|
|
6
|
+
export declare const navigationBarDefaultElement = 'nav';
|
|
7
|
+
export type NavigationBarDefaultElement = typeof navigationBarDefaultElement;
|
|
8
|
+
/**
|
|
9
|
+
* Static class names for NavigationBar component parts.
|
|
10
|
+
* Use these selectors to target specific elements with CSS.
|
|
11
|
+
*/
|
|
12
|
+
export declare const navigationBarClassNames: {
|
|
13
|
+
/** Root nav element containing the entire navigation bar */
|
|
14
|
+
readonly root: 'cds-NavigationBar';
|
|
15
|
+
/** Container for the start slot (e.g., back button) */
|
|
16
|
+
readonly start: 'cds-NavigationBar-start';
|
|
17
|
+
/** Container for the main children content (e.g., title) */
|
|
18
|
+
readonly content: 'cds-NavigationBar-content';
|
|
19
|
+
};
|
|
20
|
+
export type NavigationBarBaseProps = BoxBaseProps & {
|
|
6
21
|
/**
|
|
7
22
|
* Node (ie Back button) to display at the start of the nav bar
|
|
8
23
|
*/
|
|
@@ -18,9 +33,10 @@ export type NavigationBarProps = SharedProps & {
|
|
|
18
33
|
/**
|
|
19
34
|
* The middle content. Use the children to render the page title
|
|
20
35
|
*/
|
|
21
|
-
children
|
|
36
|
+
children?: React.ReactNode;
|
|
22
37
|
/**
|
|
23
38
|
* Accessibility label for the nav bar
|
|
39
|
+
* @default 'main navigation'
|
|
24
40
|
*/
|
|
25
41
|
accessibilityLabel?: string;
|
|
26
42
|
/**
|
|
@@ -32,7 +48,7 @@ export type NavigationBarProps = SharedProps & {
|
|
|
32
48
|
*/
|
|
33
49
|
paddingTop?: ThemeVars.Space;
|
|
34
50
|
/**
|
|
35
|
-
* @default 2
|
|
51
|
+
* @default 2 if bottom is not provided
|
|
36
52
|
*/
|
|
37
53
|
paddingBottom?: ThemeVars.Space;
|
|
38
54
|
/**
|
|
@@ -50,6 +66,9 @@ export type NavigationBarProps = SharedProps & {
|
|
|
50
66
|
*/
|
|
51
67
|
dangerouslyDisableOverflowHidden?: boolean;
|
|
52
68
|
};
|
|
69
|
+
export type NavigationBarProps = NavigationBarBaseProps &
|
|
70
|
+
StylesAndClassNames<typeof navigationBarClassNames> &
|
|
71
|
+
Omit<BoxProps<NavigationBarDefaultElement>, 'children'>;
|
|
53
72
|
export declare const NavigationBar: React.MemoExoticComponent<
|
|
54
73
|
({
|
|
55
74
|
start,
|
|
@@ -57,12 +76,24 @@ export declare const NavigationBar: React.MemoExoticComponent<
|
|
|
57
76
|
end,
|
|
58
77
|
bottom,
|
|
59
78
|
accessibilityLabel,
|
|
79
|
+
background,
|
|
60
80
|
paddingX,
|
|
61
81
|
paddingTop,
|
|
62
82
|
paddingBottom,
|
|
83
|
+
position,
|
|
84
|
+
top,
|
|
85
|
+
left,
|
|
86
|
+
right,
|
|
87
|
+
width,
|
|
63
88
|
dangerouslyDisableOverflowHidden,
|
|
64
89
|
columnGap,
|
|
65
90
|
rowGap,
|
|
91
|
+
className,
|
|
92
|
+
classNames,
|
|
93
|
+
style,
|
|
94
|
+
styles,
|
|
95
|
+
testID,
|
|
96
|
+
...props
|
|
66
97
|
}: NavigationBarProps) => import('react/jsx-runtime').JSX.Element
|
|
67
98
|
>;
|
|
68
99
|
//# sourceMappingURL=NavigationBar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationBar.d.ts","sourceRoot":"","sources":["../../src/navigation/NavigationBar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAC7C,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"NavigationBar.d.ts","sourceRoot":"","sources":["../../src/navigation/NavigationBar.ts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AAC;CAC5C,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,sBAAsB,GACrD,mBAAmB,CAAC,OAAO,uBAAuB,CAAC,GACnD,IAAI,CAAC,QAAQ,CAAC,2BAA2B,CAAC,EAAE,UAAU,CAAC,CAAC;AAE1D,eAAO,MAAM,aAAa,oRAyBrB,kBAAkB,6CAsDtB,CAAC"}
|
package/dts/types.d.ts
CHANGED
|
@@ -2,4 +2,12 @@ export type FilteredHTMLAttributes<Type, Properties extends keyof Type = never>
|
|
|
2
2
|
Type,
|
|
3
3
|
'children' | 'className' | 'style' | 'dangerouslySetInnerHTML' | Properties
|
|
4
4
|
>;
|
|
5
|
+
export type StylesAndClassNames<ComponentClassNamesMap extends Record<string, string>> = {
|
|
6
|
+
classNames?: {
|
|
7
|
+
[key in keyof ComponentClassNamesMap]?: string;
|
|
8
|
+
};
|
|
9
|
+
styles?: {
|
|
10
|
+
[key in keyof ComponentClassNamesMap]?: React.CSSProperties;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
5
13
|
//# sourceMappingURL=types.d.ts.map
|
package/dts/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,sBAAsB,CAAC,IAAI,EAAE,UAAU,SAAS,MAAM,IAAI,GAAG,KAAK,IAAI,IAAI,CACpF,IAAI,EACJ,UAAU,GAAG,WAAW,GAAG,OAAO,GAAG,yBAAyB,GAAG,UAAU,CAC5E,CAAC"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,sBAAsB,CAAC,IAAI,EAAE,UAAU,SAAS,MAAM,IAAI,GAAG,KAAK,IAAI,IAAI,CACpF,IAAI,EACJ,UAAU,GAAG,WAAW,GAAG,OAAO,GAAG,yBAAyB,GAAG,UAAU,CAC5E,CAAC;AAEF,MAAM,MAAM,mBAAmB,CAAC,sBAAsB,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI;IACvF,UAAU,CAAC,EAAE;SAAG,GAAG,IAAI,MAAM,sBAAsB,CAAC,CAAC,EAAE,MAAM;KAAE,CAAC;IAChE,MAAM,CAAC,EAAE;SAAG,GAAG,IAAI,MAAM,sBAAsB,CAAC,CAAC,EAAE,KAAK,CAAC,aAAa;KAAE,CAAC;CAC1E,CAAC"}
|
|
@@ -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.43.
|
|
3
|
+
"version": "8.43.2",
|
|
4
4
|
"description": "Coinbase Design System - Web",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -207,7 +207,7 @@
|
|
|
207
207
|
"react-dom": "^18.3.1"
|
|
208
208
|
},
|
|
209
209
|
"dependencies": {
|
|
210
|
-
"@coinbase/cds-common": "^8.43.
|
|
210
|
+
"@coinbase/cds-common": "^8.43.2",
|
|
211
211
|
"@coinbase/cds-icons": "^5.11.0",
|
|
212
212
|
"@coinbase/cds-illustrations": "^4.31.0",
|
|
213
213
|
"@coinbase/cds-lottie-files": "^3.3.4",
|