@coinbase/cds-web 9.13.0 → 9.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dts/accordion/Accordion.d.ts +27 -4
- package/dts/accordion/Accordion.d.ts.map +1 -1
- package/dts/accordion/AccordionHeader.d.ts +36 -4
- package/dts/accordion/AccordionHeader.d.ts.map +1 -1
- package/dts/accordion/AccordionItem.d.ts +26 -15
- package/dts/accordion/AccordionItem.d.ts.map +1 -1
- package/dts/accordion/AccordionPanel.d.ts +7 -1
- package/dts/accordion/AccordionPanel.d.ts.map +1 -1
- package/dts/collapsible/Collapsible.d.ts +7 -1
- package/dts/collapsible/Collapsible.d.ts.map +1 -1
- package/dts/controls/Switch.d.ts +14 -0
- package/dts/controls/Switch.d.ts.map +1 -1
- package/dts/core/componentConfig.d.ts +2 -0
- package/dts/core/componentConfig.d.ts.map +1 -1
- package/dts/tabs/SegmentedTabs.d.ts +11 -1
- package/dts/tabs/SegmentedTabs.d.ts.map +1 -1
- package/dts/visualizations/chart/PeriodSelector.d.ts +3 -2
- package/dts/visualizations/chart/PeriodSelector.d.ts.map +1 -1
- package/dts/visualizations/chart/axis/Axis.d.ts +11 -0
- package/dts/visualizations/chart/axis/Axis.d.ts.map +1 -1
- package/dts/visualizations/chart/axis/AxisTickLabelOverflowMask.d.ts +15 -0
- package/dts/visualizations/chart/axis/AxisTickLabelOverflowMask.d.ts.map +1 -0
- package/dts/visualizations/chart/axis/XAxis.d.ts.map +1 -1
- package/dts/visualizations/chart/axis/YAxis.d.ts.map +1 -1
- package/dts/visualizations/chart/axis/index.d.ts +1 -0
- package/dts/visualizations/chart/axis/index.d.ts.map +1 -1
- package/dts/visualizations/chart/line/ReferenceLine.d.ts +1 -0
- package/dts/visualizations/chart/line/ReferenceLine.d.ts.map +1 -1
- package/dts/visualizations/chart/text/ChartText.d.ts +19 -4
- package/dts/visualizations/chart/text/ChartText.d.ts.map +1 -1
- package/esm/accordion/Accordion.js +28 -6
- package/esm/accordion/AccordionHeader.js +51 -14
- package/esm/accordion/AccordionItem.js +64 -6
- package/esm/accordion/AccordionPanel.js +5 -1
- package/esm/collapsible/Collapsible.js +7 -3
- package/esm/controls/Switch.js +14 -2
- package/esm/tabs/SegmentedTabs.css +2 -0
- package/esm/tabs/SegmentedTabs.js +21 -6
- package/esm/visualizations/chart/axis/AxisTickLabelOverflowMask.js +99 -0
- package/esm/visualizations/chart/axis/XAxis.js +20 -7
- package/esm/visualizations/chart/axis/YAxis.js +20 -7
- package/esm/visualizations/chart/axis/index.js +1 -0
- package/esm/visualizations/chart/scrubber/DefaultScrubberBeaconLabel.js +1 -1
- package/esm/visualizations/chart/text/ChartText.js +26 -21
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartText.d.ts","sourceRoot":"","sources":["../../../../src/visualizations/chart/text/ChartText.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqD,MAAM,OAAO,CAAC;AAC1E,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iCAAiC,CAAC;AAC5D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AAI1E,OAAO,EAAO,KAAK,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAGzD,OAAO,EAAE,KAAK,UAAU,EAAiB,MAAM,gBAAgB,CAAC;AAGhE,KAAK,2BAA2B,GAC5B,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC,GAC5D,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,QAAQ,CAAC,kBAAkB,CAAC,EAAE,UAAU,CAAC,CAAC;AAEvE;;GAEG;AACH,MAAM,MAAM,iBAAiB,GACzB,MAAM,GACN,MAAM,GACN,IAAI,GACJ,SAAS,GACT,2BAA2B,GAC3B,2BAA2B,EAAE,CAAC;AAElC;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;AAElE;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEhE,MAAM,MAAM,kBAAkB,GAAG,WAAW,GAAG;IAC7C;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB
|
|
1
|
+
{"version":3,"file":"ChartText.d.ts","sourceRoot":"","sources":["../../../../src/visualizations/chart/text/ChartText.tsx"],"names":[],"mappings":"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"}
|
|
@@ -1,11 +1,25 @@
|
|
|
1
|
-
|
|
1
|
+
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; }
|
|
2
|
+
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; }
|
|
3
|
+
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; }
|
|
4
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
5
|
+
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); }
|
|
6
|
+
import React, { Children, memo } from 'react';
|
|
2
7
|
import { AccordionProvider } from '@coinbase/cds-common/accordion/AccordionProvider';
|
|
3
8
|
import { join } from '@coinbase/cds-common/utils/join';
|
|
9
|
+
import { cx } from '../cx';
|
|
4
10
|
import { useComponentConfig } from '../hooks/useComponentConfig';
|
|
5
11
|
import { Divider } from '../layout/Divider';
|
|
6
12
|
import { VStack } from '../layout/VStack';
|
|
7
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Static class names for Accordion component parts.
|
|
16
|
+
* Use these selectors to target specific elements with CSS.
|
|
17
|
+
*/
|
|
18
|
+
export const accordionClassNames = {
|
|
19
|
+
/** Root element */
|
|
20
|
+
root: 'cds-Accordion'
|
|
21
|
+
};
|
|
22
|
+
export const Accordion = /*#__PURE__*/memo(_props => {
|
|
9
23
|
const mergedProps = useComponentConfig('Accordion', _props);
|
|
10
24
|
const {
|
|
11
25
|
activeKey,
|
|
@@ -14,7 +28,12 @@ export const Accordion = _props => {
|
|
|
14
28
|
onChange,
|
|
15
29
|
setActiveKey,
|
|
16
30
|
testID,
|
|
17
|
-
style
|
|
31
|
+
style,
|
|
32
|
+
styles,
|
|
33
|
+
className,
|
|
34
|
+
classNames,
|
|
35
|
+
borderRadius,
|
|
36
|
+
showItemSeparators = true
|
|
18
37
|
} = mergedProps;
|
|
19
38
|
return /*#__PURE__*/_jsx(AccordionProvider, {
|
|
20
39
|
activeKey: activeKey,
|
|
@@ -22,10 +41,13 @@ export const Accordion = _props => {
|
|
|
22
41
|
onChange: onChange,
|
|
23
42
|
setActiveKey: setActiveKey,
|
|
24
43
|
children: /*#__PURE__*/_jsx(VStack, {
|
|
25
|
-
|
|
44
|
+
borderRadius: borderRadius,
|
|
45
|
+
className: cx(accordionClassNames.root, className, classNames === null || classNames === void 0 ? void 0 : classNames.root),
|
|
46
|
+
overflow: borderRadius !== undefined ? 'hidden' : undefined,
|
|
47
|
+
style: _objectSpread(_objectSpread({}, style), styles === null || styles === void 0 ? void 0 : styles.root),
|
|
26
48
|
testID: testID,
|
|
27
49
|
width: "100%",
|
|
28
|
-
children: join(Children.toArray(children), /*#__PURE__*/_jsx(Divider, {}))
|
|
50
|
+
children: showItemSeparators ? join(Children.toArray(children), /*#__PURE__*/_jsx(Divider, {})) : children
|
|
29
51
|
})
|
|
30
52
|
});
|
|
31
|
-
};
|
|
53
|
+
});
|
|
@@ -3,7 +3,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
3
3
|
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; }
|
|
4
4
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
5
5
|
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); }
|
|
6
|
-
import React, { forwardRef, memo, useCallback } from 'react';
|
|
6
|
+
import React, { forwardRef, memo, useCallback, useMemo } from 'react';
|
|
7
7
|
import { useAccordionContext } from '@coinbase/cds-common/accordion/AccordionProvider';
|
|
8
8
|
import { accordionIconHiddenRotate, accordionIconVisibleRotate } from '@coinbase/cds-common/animation/accordion';
|
|
9
9
|
import { listHeight } from '@coinbase/cds-common/tokens/cell';
|
|
@@ -16,25 +16,33 @@ import { Pressable } from '../system/Pressable';
|
|
|
16
16
|
import { Text } from '../typography/Text';
|
|
17
17
|
import { getAccordionHeaderId, getAccordionPanelId } from './utils';
|
|
18
18
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
|
+
const compactPaddingProps = paddingProps => {
|
|
20
|
+
const entries = Object.entries(paddingProps).filter(_ref => {
|
|
21
|
+
let [, value] = _ref;
|
|
22
|
+
return value !== undefined;
|
|
23
|
+
});
|
|
24
|
+
if (entries.length === 0) return undefined;
|
|
25
|
+
return Object.fromEntries(entries);
|
|
26
|
+
};
|
|
19
27
|
const baseCss = "baseCss-bt1rln1";
|
|
20
28
|
const subtitleCss = "subtitleCss-sve89pn";
|
|
21
29
|
const titleCss = "titleCss-t166a7nm";
|
|
22
|
-
export const AccordionMedia = /*#__PURE__*/memo(
|
|
30
|
+
export const AccordionMedia = /*#__PURE__*/memo(_ref2 => {
|
|
23
31
|
let {
|
|
24
32
|
media
|
|
25
|
-
} =
|
|
33
|
+
} = _ref2;
|
|
26
34
|
return /*#__PURE__*/_jsx(Box, {
|
|
27
35
|
flexGrow: 0,
|
|
28
36
|
flexShrink: 0,
|
|
29
37
|
children: media
|
|
30
38
|
});
|
|
31
39
|
});
|
|
32
|
-
export const AccordionTitle = /*#__PURE__*/memo(
|
|
40
|
+
export const AccordionTitle = /*#__PURE__*/memo(_ref3 => {
|
|
33
41
|
let {
|
|
34
42
|
title,
|
|
35
43
|
subtitle,
|
|
36
44
|
tertiaryTitle
|
|
37
|
-
} =
|
|
45
|
+
} = _ref3;
|
|
38
46
|
return /*#__PURE__*/_jsx(Box, {
|
|
39
47
|
className: titleCss,
|
|
40
48
|
flexGrow: 1,
|
|
@@ -67,22 +75,25 @@ export const AccordionTitle = /*#__PURE__*/memo(_ref2 => {
|
|
|
67
75
|
})
|
|
68
76
|
});
|
|
69
77
|
});
|
|
70
|
-
export const AccordionIcon = /*#__PURE__*/memo(
|
|
78
|
+
export const AccordionIcon = /*#__PURE__*/memo(_ref4 => {
|
|
71
79
|
let {
|
|
72
|
-
collapsed
|
|
73
|
-
|
|
80
|
+
collapsed,
|
|
81
|
+
caretSize = 's'
|
|
82
|
+
} = _ref4;
|
|
74
83
|
return /*#__PURE__*/_jsx(Box, {
|
|
75
84
|
justifyContent: "flex-end",
|
|
76
85
|
children: /*#__PURE__*/_jsx(AnimatedCaret, {
|
|
77
|
-
rotate: collapsed ? accordionIconHiddenRotate : accordionIconVisibleRotate
|
|
86
|
+
rotate: collapsed ? accordionIconHiddenRotate : accordionIconVisibleRotate,
|
|
87
|
+
size: caretSize
|
|
78
88
|
})
|
|
79
89
|
});
|
|
80
90
|
});
|
|
91
|
+
|
|
81
92
|
/**
|
|
82
93
|
* Renders a Pressable element to use as the header to an AccordionItem.
|
|
83
94
|
* Composes an Accordion Media, Title, and Icon.
|
|
84
95
|
*/
|
|
85
|
-
export const AccordionHeader = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((
|
|
96
|
+
export const AccordionHeader = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref5, forwardedRef) => {
|
|
86
97
|
let {
|
|
87
98
|
itemKey,
|
|
88
99
|
title,
|
|
@@ -91,13 +102,36 @@ export const AccordionHeader = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref4,
|
|
|
91
102
|
onClick,
|
|
92
103
|
media,
|
|
93
104
|
collapsed = false,
|
|
94
|
-
testID
|
|
95
|
-
|
|
105
|
+
testID,
|
|
106
|
+
className,
|
|
107
|
+
style,
|
|
108
|
+
background = 'bg',
|
|
109
|
+
caretSize,
|
|
110
|
+
padding,
|
|
111
|
+
paddingX,
|
|
112
|
+
paddingY,
|
|
113
|
+
paddingTop,
|
|
114
|
+
paddingBottom,
|
|
115
|
+
paddingStart,
|
|
116
|
+
paddingEnd
|
|
117
|
+
} = _ref5;
|
|
96
118
|
const {
|
|
97
119
|
setActiveKey,
|
|
98
120
|
activeKey
|
|
99
121
|
} = useAccordionContext();
|
|
100
|
-
const
|
|
122
|
+
const outerSpacing = useMemo(() => compactPaddingProps({
|
|
123
|
+
padding,
|
|
124
|
+
paddingX,
|
|
125
|
+
paddingY,
|
|
126
|
+
paddingTop,
|
|
127
|
+
paddingBottom,
|
|
128
|
+
paddingStart,
|
|
129
|
+
paddingEnd
|
|
130
|
+
}), [padding, paddingX, paddingY, paddingTop, paddingBottom, paddingStart, paddingEnd]);
|
|
131
|
+
// Header padding follows the same outer spacing rules as Cell.
|
|
132
|
+
const spacing = useCellSpacing({
|
|
133
|
+
outerSpacing
|
|
134
|
+
});
|
|
101
135
|
const handleClick = useCallback(() => {
|
|
102
136
|
onClick === null || onClick === void 0 || onClick(itemKey);
|
|
103
137
|
setActiveKey(itemKey === activeKey ? null : itemKey);
|
|
@@ -111,9 +145,11 @@ export const AccordionHeader = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref4,
|
|
|
111
145
|
"aria-controls": getAccordionPanelId(itemKey),
|
|
112
146
|
"aria-expanded": !collapsed // a11y guideline: https://www.w3.org/TR/wai-aria-practices/#accordion
|
|
113
147
|
,
|
|
114
|
-
background:
|
|
148
|
+
background: background,
|
|
149
|
+
className: className,
|
|
115
150
|
id: getAccordionHeaderId(itemKey),
|
|
116
151
|
onClick: handleClick,
|
|
152
|
+
style: style,
|
|
117
153
|
testID: testID,
|
|
118
154
|
width: "100%",
|
|
119
155
|
children: /*#__PURE__*/_jsxs(HStack, _objectSpread(_objectSpread({
|
|
@@ -129,6 +165,7 @@ export const AccordionHeader = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref4,
|
|
|
129
165
|
tertiaryTitle: tertiaryTitle,
|
|
130
166
|
title: title
|
|
131
167
|
}), /*#__PURE__*/_jsx(AccordionIcon, {
|
|
168
|
+
caretSize: caretSize,
|
|
132
169
|
collapsed: collapsed
|
|
133
170
|
})]
|
|
134
171
|
}))
|
|
@@ -1,17 +1,39 @@
|
|
|
1
|
+
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; }
|
|
2
|
+
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; }
|
|
3
|
+
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; }
|
|
4
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
5
|
+
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); }
|
|
1
6
|
import React, { memo } from 'react';
|
|
2
7
|
import { useAccordionContext } from '@coinbase/cds-common/accordion/AccordionProvider';
|
|
3
8
|
import { accordionMinWidth } from '@coinbase/cds-common/tokens/accordion';
|
|
9
|
+
import { cx } from '../cx';
|
|
10
|
+
import { useComponentConfig } from '../hooks/useComponentConfig';
|
|
11
|
+
import { Divider } from '../layout/Divider';
|
|
4
12
|
import { VStack } from '../layout/VStack';
|
|
5
13
|
import { AccordionHeader } from './AccordionHeader';
|
|
6
14
|
import { AccordionPanel } from './AccordionPanel';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Static class names for AccordionItem component parts.
|
|
18
|
+
* Use these selectors to target specific elements with CSS.
|
|
19
|
+
*/
|
|
7
20
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
21
|
+
export const accordionItemClassNames = {
|
|
22
|
+
/** Root element */
|
|
23
|
+
root: 'cds-AccordionItem',
|
|
24
|
+
/** Header pressable element */
|
|
25
|
+
header: 'cds-AccordionItem-header',
|
|
26
|
+
/** Collapsible panel container element */
|
|
27
|
+
panel: 'cds-AccordionItem-panel'
|
|
28
|
+
};
|
|
8
29
|
/**
|
|
9
30
|
* A component that represents a single item within an Accordion.
|
|
10
31
|
* It composes together an AccordionHeader and a collapsible AccordionPanel.
|
|
11
32
|
* Accepts a unique `itemKey` prop to uniquely identify one item from another within the same Accordion.
|
|
12
33
|
*/
|
|
13
|
-
export const AccordionItem = /*#__PURE__*/memo(
|
|
14
|
-
|
|
34
|
+
export const AccordionItem = /*#__PURE__*/memo(_props => {
|
|
35
|
+
const mergedProps = useComponentConfig('AccordionItem', _props);
|
|
36
|
+
const {
|
|
15
37
|
itemKey,
|
|
16
38
|
title,
|
|
17
39
|
subtitle,
|
|
@@ -23,31 +45,67 @@ export const AccordionItem = /*#__PURE__*/memo(_ref => {
|
|
|
23
45
|
headerRef,
|
|
24
46
|
panelRef,
|
|
25
47
|
maxHeight,
|
|
26
|
-
style
|
|
27
|
-
|
|
48
|
+
style,
|
|
49
|
+
styles,
|
|
50
|
+
className,
|
|
51
|
+
classNames,
|
|
52
|
+
showHeaderBorder = false,
|
|
53
|
+
background,
|
|
54
|
+
caretSize,
|
|
55
|
+
borderRadius,
|
|
56
|
+
padding,
|
|
57
|
+
paddingX,
|
|
58
|
+
paddingY,
|
|
59
|
+
paddingTop,
|
|
60
|
+
paddingBottom,
|
|
61
|
+
paddingStart,
|
|
62
|
+
paddingEnd
|
|
63
|
+
} = mergedProps;
|
|
28
64
|
const {
|
|
29
65
|
activeKey
|
|
30
66
|
} = useAccordionContext();
|
|
31
67
|
const collapsed = activeKey !== itemKey;
|
|
32
68
|
return /*#__PURE__*/_jsxs(VStack, {
|
|
69
|
+
borderRadius: borderRadius,
|
|
70
|
+
className: cx(accordionItemClassNames.root, className, classNames === null || classNames === void 0 ? void 0 : classNames.root),
|
|
33
71
|
minWidth: accordionMinWidth,
|
|
34
|
-
|
|
72
|
+
overflow: borderRadius !== undefined ? 'hidden' : undefined,
|
|
73
|
+
style: _objectSpread(_objectSpread({}, style), styles === null || styles === void 0 ? void 0 : styles.root),
|
|
35
74
|
testID: testID,
|
|
75
|
+
width: "100%",
|
|
36
76
|
children: [/*#__PURE__*/_jsx(AccordionHeader, {
|
|
37
77
|
ref: headerRef,
|
|
78
|
+
background: background,
|
|
79
|
+
caretSize: caretSize,
|
|
80
|
+
className: cx(accordionItemClassNames.header, classNames === null || classNames === void 0 ? void 0 : classNames.header),
|
|
38
81
|
collapsed: collapsed,
|
|
39
82
|
itemKey: itemKey,
|
|
40
83
|
media: media,
|
|
41
84
|
onClick: onClick,
|
|
85
|
+
padding: padding,
|
|
86
|
+
paddingBottom: paddingBottom,
|
|
87
|
+
paddingEnd: paddingEnd,
|
|
88
|
+
paddingStart: paddingStart,
|
|
89
|
+
paddingTop: paddingTop,
|
|
90
|
+
paddingX: paddingX,
|
|
91
|
+
paddingY: paddingY,
|
|
92
|
+
style: styles === null || styles === void 0 ? void 0 : styles.header,
|
|
42
93
|
subtitle: subtitle,
|
|
43
94
|
tertiaryTitle: tertiaryTitle,
|
|
44
95
|
testID: testID && "".concat(testID, "-header"),
|
|
45
96
|
title: title
|
|
46
|
-
}), /*#__PURE__*/_jsx(
|
|
97
|
+
}), showHeaderBorder ? /*#__PURE__*/_jsx(Divider, {
|
|
98
|
+
paddingEnd: paddingEnd,
|
|
99
|
+
paddingStart: paddingStart,
|
|
100
|
+
paddingX: paddingX,
|
|
101
|
+
testID: testID && "".concat(testID, "-divider")
|
|
102
|
+
}) : null, /*#__PURE__*/_jsx(AccordionPanel, {
|
|
47
103
|
ref: panelRef,
|
|
104
|
+
className: cx(accordionItemClassNames.panel, classNames === null || classNames === void 0 ? void 0 : classNames.panel),
|
|
48
105
|
collapsed: collapsed,
|
|
49
106
|
itemKey: itemKey,
|
|
50
107
|
maxHeight: maxHeight,
|
|
108
|
+
style: styles === null || styles === void 0 ? void 0 : styles.panel,
|
|
51
109
|
testID: testID && "".concat(testID, "-panel"),
|
|
52
110
|
children: children
|
|
53
111
|
})]
|
|
@@ -19,12 +19,16 @@ export const AccordionPanel = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, f
|
|
|
19
19
|
collapsed = true,
|
|
20
20
|
itemKey,
|
|
21
21
|
testID,
|
|
22
|
-
maxHeight: maxHeightParam
|
|
22
|
+
maxHeight: maxHeightParam,
|
|
23
|
+
className,
|
|
24
|
+
style
|
|
23
25
|
} = _ref;
|
|
24
26
|
return /*#__PURE__*/_jsx(Collapsible, _objectSpread(_objectSpread({
|
|
25
27
|
ref: forwardedRef,
|
|
28
|
+
className: className,
|
|
26
29
|
collapsed: collapsed,
|
|
27
30
|
maxHeight: maxHeightParam !== null && maxHeightParam !== void 0 ? maxHeightParam : accordionVisibleMaxHeight,
|
|
31
|
+
style: style,
|
|
28
32
|
testID: testID
|
|
29
33
|
}, accordionSpacing), {}, {
|
|
30
34
|
// a11y guideline: https://www.w3.org/TR/wai-aria-practices/#accordion
|
|
@@ -8,6 +8,7 @@ function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i
|
|
|
8
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; }
|
|
9
9
|
import React, { forwardRef, memo, useCallback, useMemo, useState } from 'react';
|
|
10
10
|
import { m as motion } from 'framer-motion';
|
|
11
|
+
import { cx } from '../cx';
|
|
11
12
|
import { useComponentConfig } from '../hooks/useComponentConfig';
|
|
12
13
|
import { Box } from '../layout/Box';
|
|
13
14
|
import { useCollapsibleMotionProps } from './useCollapsibleMotionProps';
|
|
@@ -26,6 +27,8 @@ export const Collapsible = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_props, fo
|
|
|
26
27
|
id,
|
|
27
28
|
role = 'region',
|
|
28
29
|
dangerouslyDisableOverflowHidden = false,
|
|
30
|
+
className,
|
|
31
|
+
style: styleProp,
|
|
29
32
|
// Spacing
|
|
30
33
|
padding,
|
|
31
34
|
paddingBottom,
|
|
@@ -67,17 +70,18 @@ export const Collapsible = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_props, fo
|
|
|
67
70
|
}
|
|
68
71
|
}, [collapsed]);
|
|
69
72
|
const style = useMemo(() => {
|
|
70
|
-
|
|
73
|
+
const nextStyle = isDisplayNone ? _objectSpread(_objectSpread({}, motionStyle), {}, {
|
|
71
74
|
display: 'none'
|
|
72
75
|
}) : motionStyle;
|
|
73
|
-
|
|
76
|
+
return styleProp ? _objectSpread(_objectSpread({}, nextStyle), styleProp) : nextStyle;
|
|
77
|
+
}, [motionStyle, isDisplayNone, styleProp]);
|
|
74
78
|
return (
|
|
75
79
|
/*#__PURE__*/
|
|
76
80
|
// TODO: Remove type assertion after upgrading framer-motion to v11+ for React 19 compatibility
|
|
77
81
|
_jsx(motion.div, _objectSpread(_objectSpread({}, _objectSpread(_objectSpread({}, motionProps), {}, {
|
|
78
82
|
ref: forwardedRef,
|
|
79
83
|
'aria-labelledby': accessibilityLabelledBy,
|
|
80
|
-
className: COMPONENT_STATIC_CLASSNAME,
|
|
84
|
+
className: cx(COMPONENT_STATIC_CLASSNAME, className),
|
|
81
85
|
'data-testid': testID,
|
|
82
86
|
id: id,
|
|
83
87
|
onAnimationComplete: handleAnimationComplete,
|
package/esm/controls/Switch.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const _excluded = ["children", "checked", "disabled", "elevation", "controlColor", "background", "borderColor", "borderRadius", "borderWidth", "value", "className", "style", "classNames", "styles"];
|
|
1
|
+
const _excluded = ["children", "checked", "disabled", "elevation", "controlColor", "variant", "background", "borderColor", "borderRadius", "borderWidth", "value", "className", "style", "classNames", "styles"];
|
|
2
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
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
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; }
|
|
@@ -33,6 +33,15 @@ export const switchClassNames = {
|
|
|
33
33
|
};
|
|
34
34
|
const trackCss = "trackCss-t1fng8qd";
|
|
35
35
|
const thumbCss = "thumbCss-t1l9xlcf";
|
|
36
|
+
|
|
37
|
+
/** Semantic color variants for Switch, matching the semantics used by other control components. */
|
|
38
|
+
|
|
39
|
+
/** Track background color applied when Switch is checked, keyed by `variant`. */
|
|
40
|
+
const switchVariantBackground = {
|
|
41
|
+
primary: 'bgPrimary',
|
|
42
|
+
positive: 'bgPositive',
|
|
43
|
+
negative: 'bgNegative'
|
|
44
|
+
};
|
|
36
45
|
const MotionBox = motion(Box);
|
|
37
46
|
const thumbMotionVariants = {
|
|
38
47
|
checked: {
|
|
@@ -52,7 +61,10 @@ const SwitchWithRef = /*#__PURE__*/forwardRef(function SwitchWithRef(_props, ref
|
|
|
52
61
|
disabled,
|
|
53
62
|
elevation,
|
|
54
63
|
controlColor,
|
|
55
|
-
|
|
64
|
+
variant = 'primary',
|
|
65
|
+
// The variant only informs the track color while checked; the background prop is more
|
|
66
|
+
// specific and always wins when provided.
|
|
67
|
+
background = checked ? switchVariantBackground[variant] : 'bgTertiary',
|
|
56
68
|
borderColor,
|
|
57
69
|
borderRadius = 1000,
|
|
58
70
|
borderWidth,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const _excluded = ["TabComponent", "TabsActiveIndicatorComponent", "activeBackground", "background", "borderRadius", "className", "classNames", "style", "styles"];
|
|
1
|
+
const _excluded = ["TabComponent", "TabsActiveIndicatorComponent", "activeBackground", "background", "borderRadius", "equalWidth", "alignSelf", "width", "className", "classNames", "style", "styles"];
|
|
2
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
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
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; }
|
|
@@ -6,13 +6,15 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
6
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
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
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; }
|
|
9
|
-
import React, { forwardRef, memo } from 'react';
|
|
9
|
+
import React, { forwardRef, memo, useMemo } from 'react';
|
|
10
10
|
import { cx } from '../cx';
|
|
11
11
|
import { useComponentConfig } from '../hooks/useComponentConfig';
|
|
12
12
|
import { SegmentedTab } from './SegmentedTab';
|
|
13
13
|
import { SegmentedTabsActiveIndicator } from './SegmentedTabsActiveIndicator';
|
|
14
14
|
import { Tabs } from './Tabs';
|
|
15
15
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
|
+
const equalWidthTabContainerCss = "equalWidthTabContainerCss-eg1j8x0";
|
|
17
|
+
const equalWidthTabCss = "equalWidthTabCss-e1aaasyn";
|
|
16
18
|
const SegmentedTabsComponent = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_props, ref) => {
|
|
17
19
|
const mergedProps = useComponentConfig('SegmentedTabs', _props);
|
|
18
20
|
const {
|
|
@@ -21,23 +23,34 @@ const SegmentedTabsComponent = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_props
|
|
|
21
23
|
activeBackground = 'bgInverse',
|
|
22
24
|
background = 'bgSecondary',
|
|
23
25
|
borderRadius = 700,
|
|
26
|
+
equalWidth,
|
|
27
|
+
alignSelf = equalWidth ? 'stretch' : undefined,
|
|
28
|
+
width = equalWidth ? '100%' : undefined,
|
|
24
29
|
className,
|
|
25
30
|
classNames,
|
|
26
31
|
style,
|
|
27
32
|
styles
|
|
28
33
|
} = mergedProps,
|
|
29
34
|
props = _objectWithoutProperties(mergedProps, _excluded);
|
|
35
|
+
const resolvedClassNames = useMemo(() => {
|
|
36
|
+
if (!equalWidth) return classNames;
|
|
37
|
+
return _objectSpread(_objectSpread({}, classNames), {}, {
|
|
38
|
+
tabContainer: cx(equalWidthTabContainerCss, classNames === null || classNames === void 0 ? void 0 : classNames.tabContainer),
|
|
39
|
+
tab: cx(equalWidthTabCss, classNames === null || classNames === void 0 ? void 0 : classNames.tab)
|
|
40
|
+
});
|
|
41
|
+
}, [equalWidth, classNames]);
|
|
30
42
|
return /*#__PURE__*/_jsx(Tabs, _objectSpread({
|
|
31
43
|
ref: ref,
|
|
32
44
|
TabComponent: TabComponent,
|
|
33
45
|
TabsActiveIndicatorComponent: TabsActiveIndicatorComponent,
|
|
34
46
|
activeBackground: activeBackground,
|
|
47
|
+
alignSelf: alignSelf,
|
|
35
48
|
background: background,
|
|
36
49
|
borderRadius: borderRadius,
|
|
37
50
|
className: cx(className, classNames === null || classNames === void 0 ? void 0 : classNames.root),
|
|
38
51
|
classNames: {
|
|
39
|
-
tabContainer:
|
|
40
|
-
tab:
|
|
52
|
+
tabContainer: resolvedClassNames === null || resolvedClassNames === void 0 ? void 0 : resolvedClassNames.tabContainer,
|
|
53
|
+
tab: resolvedClassNames === null || resolvedClassNames === void 0 ? void 0 : resolvedClassNames.tab,
|
|
41
54
|
activeIndicator: classNames === null || classNames === void 0 ? void 0 : classNames.activeIndicator
|
|
42
55
|
},
|
|
43
56
|
role: "tablist",
|
|
@@ -46,8 +59,10 @@ const SegmentedTabsComponent = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_props
|
|
|
46
59
|
tabContainer: styles === null || styles === void 0 ? void 0 : styles.tabContainer,
|
|
47
60
|
tab: styles === null || styles === void 0 ? void 0 : styles.tab,
|
|
48
61
|
activeIndicator: styles === null || styles === void 0 ? void 0 : styles.activeIndicator
|
|
49
|
-
}
|
|
62
|
+
},
|
|
63
|
+
width: width
|
|
50
64
|
}, props));
|
|
51
65
|
}));
|
|
52
66
|
SegmentedTabsComponent.displayName = 'SegmentedTabs';
|
|
53
|
-
export const SegmentedTabs = SegmentedTabsComponent;
|
|
67
|
+
export const SegmentedTabs = SegmentedTabsComponent;
|
|
68
|
+
import "./SegmentedTabs.css";
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { memo, useId } from 'react';
|
|
2
|
+
import { useCartesianChartContext } from '../ChartProvider';
|
|
3
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
|
+
const axisTickLabelOverflowFadeWidth = 30;
|
|
5
|
+
/**
|
|
6
|
+
* Masks tick-label children so they fade at the chart/SVG outer edges
|
|
7
|
+
* without painting over other axes.
|
|
8
|
+
*/
|
|
9
|
+
export const AxisTickLabelOverflowMask = /*#__PURE__*/memo(_ref => {
|
|
10
|
+
let {
|
|
11
|
+
axis,
|
|
12
|
+
children,
|
|
13
|
+
testID
|
|
14
|
+
} = _ref;
|
|
15
|
+
const {
|
|
16
|
+
width: chartWidth,
|
|
17
|
+
height: chartHeight
|
|
18
|
+
} = useCartesianChartContext();
|
|
19
|
+
const reactId = useId();
|
|
20
|
+
const maskId = "".concat(reactId, "-mask");
|
|
21
|
+
const fadeWidth = axisTickLabelOverflowFadeWidth;
|
|
22
|
+
const isXAxis = axis === 'x';
|
|
23
|
+
if (chartWidth <= 0 || chartHeight <= 0) {
|
|
24
|
+
return children;
|
|
25
|
+
}
|
|
26
|
+
const fadeX = Math.min(fadeWidth, chartWidth / 2) / chartWidth;
|
|
27
|
+
const fadeY = Math.min(fadeWidth, chartHeight / 2) / chartHeight;
|
|
28
|
+
return /*#__PURE__*/_jsxs("g", {
|
|
29
|
+
"data-testid": testID,
|
|
30
|
+
children: [/*#__PURE__*/_jsxs("defs", {
|
|
31
|
+
children: [isXAxis ? /*#__PURE__*/_jsxs("linearGradient", {
|
|
32
|
+
gradientUnits: "userSpaceOnUse",
|
|
33
|
+
id: "".concat(reactId, "-fade"),
|
|
34
|
+
x1: 0,
|
|
35
|
+
x2: chartWidth,
|
|
36
|
+
y1: 0,
|
|
37
|
+
y2: 0,
|
|
38
|
+
children: [/*#__PURE__*/_jsx("stop", {
|
|
39
|
+
offset: 0,
|
|
40
|
+
stopColor: "#fff",
|
|
41
|
+
stopOpacity: 0
|
|
42
|
+
}), /*#__PURE__*/_jsx("stop", {
|
|
43
|
+
offset: fadeX,
|
|
44
|
+
stopColor: "#fff",
|
|
45
|
+
stopOpacity: 1
|
|
46
|
+
}), /*#__PURE__*/_jsx("stop", {
|
|
47
|
+
offset: 1 - fadeX,
|
|
48
|
+
stopColor: "#fff",
|
|
49
|
+
stopOpacity: 1
|
|
50
|
+
}), /*#__PURE__*/_jsx("stop", {
|
|
51
|
+
offset: 1,
|
|
52
|
+
stopColor: "#fff",
|
|
53
|
+
stopOpacity: 0
|
|
54
|
+
})]
|
|
55
|
+
}) : /*#__PURE__*/_jsxs("linearGradient", {
|
|
56
|
+
gradientUnits: "userSpaceOnUse",
|
|
57
|
+
id: "".concat(reactId, "-fade"),
|
|
58
|
+
x1: 0,
|
|
59
|
+
x2: 0,
|
|
60
|
+
y1: 0,
|
|
61
|
+
y2: chartHeight,
|
|
62
|
+
children: [/*#__PURE__*/_jsx("stop", {
|
|
63
|
+
offset: 0,
|
|
64
|
+
stopColor: "#fff",
|
|
65
|
+
stopOpacity: 0
|
|
66
|
+
}), /*#__PURE__*/_jsx("stop", {
|
|
67
|
+
offset: fadeY,
|
|
68
|
+
stopColor: "#fff",
|
|
69
|
+
stopOpacity: 1
|
|
70
|
+
}), /*#__PURE__*/_jsx("stop", {
|
|
71
|
+
offset: 1 - fadeY,
|
|
72
|
+
stopColor: "#fff",
|
|
73
|
+
stopOpacity: 1
|
|
74
|
+
}), /*#__PURE__*/_jsx("stop", {
|
|
75
|
+
offset: 1,
|
|
76
|
+
stopColor: "#fff",
|
|
77
|
+
stopOpacity: 0
|
|
78
|
+
})]
|
|
79
|
+
}), /*#__PURE__*/_jsx("mask", {
|
|
80
|
+
height: chartHeight,
|
|
81
|
+
id: maskId,
|
|
82
|
+
maskUnits: "userSpaceOnUse",
|
|
83
|
+
width: chartWidth,
|
|
84
|
+
x: 0,
|
|
85
|
+
y: 0,
|
|
86
|
+
children: /*#__PURE__*/_jsx("rect", {
|
|
87
|
+
fill: "url(#".concat(reactId, "-fade)"),
|
|
88
|
+
height: chartHeight,
|
|
89
|
+
width: chartWidth,
|
|
90
|
+
x: 0,
|
|
91
|
+
y: 0
|
|
92
|
+
})
|
|
93
|
+
})]
|
|
94
|
+
}), /*#__PURE__*/_jsx("g", {
|
|
95
|
+
mask: "url(#".concat(maskId, ")"),
|
|
96
|
+
children: children
|
|
97
|
+
})]
|
|
98
|
+
});
|
|
99
|
+
});
|