@coinbase/cds-web 8.62.1 → 8.66.1
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 +56 -0
- package/dts/alpha/combobox/DefaultComboboxControl.d.ts.map +1 -1
- package/dts/alpha/select/DefaultSelectControl.d.ts.map +1 -1
- package/dts/alpha/select/DefaultSelectDropdown.d.ts.map +1 -1
- package/dts/alpha/select/Select.d.ts.map +1 -1
- package/dts/core/componentConfig.d.ts +2 -2
- package/dts/core/componentConfig.d.ts.map +1 -1
- package/dts/dropdown/Dropdown.d.ts +4 -0
- package/dts/dropdown/Dropdown.d.ts.map +1 -1
- package/dts/dropdown/DropdownContent.d.ts +12 -5
- package/dts/dropdown/DropdownContent.d.ts.map +1 -1
- package/dts/dropdown/DropdownProps.d.ts +20 -0
- package/dts/dropdown/DropdownProps.d.ts.map +1 -1
- package/dts/dropdown/useResponsiveHeight.d.ts +4 -0
- package/dts/dropdown/useResponsiveHeight.d.ts.map +1 -1
- package/dts/overlays/Toast.d.ts.map +1 -1
- package/dts/overlays/index.d.ts +1 -0
- package/dts/overlays/index.d.ts.map +1 -1
- package/dts/overlays/modal/ModalHeader.d.ts +3 -3
- package/dts/overlays/modal/ModalHeader.d.ts.map +1 -1
- package/dts/overlays/modal/ModalWrapper.d.ts.map +1 -1
- package/dts/overlays/popover/Popover.d.ts +48 -31
- package/dts/overlays/popover/Popover.d.ts.map +1 -1
- package/dts/overlays/popover/PopoverPanel.d.ts +164 -0
- package/dts/overlays/popover/PopoverPanel.d.ts.map +1 -0
- package/dts/overlays/popover/PopoverPanelContent.d.ts +43 -0
- package/dts/overlays/popover/PopoverPanelContent.d.ts.map +1 -0
- package/dts/overlays/popover/PopoverProps.d.ts +13 -4
- package/dts/overlays/popover/PopoverProps.d.ts.map +1 -1
- package/dts/overlays/tooltip/TooltipContent.d.ts.map +1 -1
- package/dts/stepper/Stepper.d.ts.map +1 -1
- package/dts/tabs/DefaultTab.d.ts +42 -0
- package/dts/tabs/DefaultTab.d.ts.map +1 -0
- package/dts/tabs/DefaultTabsActiveIndicator.d.ts +16 -0
- package/dts/tabs/DefaultTabsActiveIndicator.d.ts.map +1 -0
- package/dts/tabs/TabIndicator.d.ts +2 -0
- package/dts/tabs/TabIndicator.d.ts.map +1 -1
- package/dts/tabs/TabLabel.d.ts +2 -0
- package/dts/tabs/TabLabel.d.ts.map +1 -1
- package/dts/tabs/TabNavigation.d.ts +16 -0
- package/dts/tabs/TabNavigation.d.ts.map +1 -1
- package/dts/tabs/Tabs.d.ts +25 -11
- package/dts/tabs/Tabs.d.ts.map +1 -1
- package/dts/tabs/index.d.ts +2 -0
- package/dts/tabs/index.d.ts.map +1 -1
- package/dts/tour/DefaultTourMask.d.ts +1 -2
- package/dts/tour/DefaultTourMask.d.ts.map +1 -1
- package/dts/tour/DefaultTourStepArrow.d.ts +1 -1
- package/dts/tour/DefaultTourStepArrow.d.ts.map +1 -1
- package/dts/tour/Tour.d.ts +35 -7
- package/dts/tour/Tour.d.ts.map +1 -1
- package/dts/tour/TourStep.d.ts +4 -1
- package/dts/tour/TourStep.d.ts.map +1 -1
- package/esm/alpha/combobox/DefaultComboboxControl.js +1 -2
- package/esm/alpha/select/DefaultSelectControl.js +4 -2
- package/esm/alpha/select/DefaultSelectDropdown.js +1 -0
- package/esm/alpha/select/Select.js +30 -1
- package/esm/dropdown/Dropdown.js +5 -0
- package/esm/dropdown/DropdownContent.js +12 -1
- package/esm/dropdown/useResponsiveHeight.js +5 -0
- package/esm/icons/__figma__/Icon.figma.js +1771 -869
- package/esm/overlays/Toast.js +20 -12
- package/esm/overlays/index.js +1 -0
- package/esm/overlays/modal/ModalHeader.js +6 -4
- package/esm/overlays/modal/ModalWrapper.js +7 -1
- package/esm/overlays/popover/Popover.js +71 -28
- package/esm/overlays/popover/PopoverPanel.css +2 -0
- package/esm/overlays/popover/PopoverPanel.js +220 -0
- package/esm/overlays/popover/PopoverPanelContent.js +57 -0
- package/esm/overlays/tooltip/TooltipContent.js +3 -5
- package/esm/stepper/Stepper.js +4 -3
- package/esm/tabs/DefaultTab.css +3 -0
- package/esm/tabs/DefaultTab.js +77 -0
- package/esm/tabs/DefaultTabsActiveIndicator.js +58 -0
- package/esm/tabs/TabIndicator.js +2 -0
- package/esm/tabs/TabLabel.js +3 -0
- package/esm/tabs/TabNavigation.js +21 -0
- package/esm/tabs/Tabs.js +32 -34
- package/esm/tabs/index.js +2 -0
- package/esm/tour/DefaultTourMask.js +1 -1
- package/esm/tour/DefaultTourStepArrow.js +3 -1
- package/esm/tour/Tour.js +38 -7
- package/esm/tour/TourStep.js +16 -6
- package/package.json +4 -4
|
@@ -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 { forwardRef, memo, useImperativeHandle, useMemo, useRef, useState } from 'react';
|
|
6
|
+
import { forwardRef, memo, useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
|
|
7
7
|
import { autoUpdate, flip, useFloating } from '@floating-ui/react-dom';
|
|
8
8
|
import { cx } from '../../cx';
|
|
9
9
|
import { useClickOutside } from '../../hooks/useClickOutside';
|
|
@@ -93,6 +93,34 @@ const SelectBase = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_props, ref) => {
|
|
|
93
93
|
ref: refs.floating,
|
|
94
94
|
excludeRefs: [refs.reference]
|
|
95
95
|
});
|
|
96
|
+
const pendingTypeAheadKeyRef = useRef(null);
|
|
97
|
+
const handleControlKeyDown = useCallback(event => {
|
|
98
|
+
if (disabled || open) return;
|
|
99
|
+
if (event.ctrlKey || event.metaKey || event.altKey) return;
|
|
100
|
+
const key = event.key;
|
|
101
|
+
if (/^[a-z]$/.test(key)) {
|
|
102
|
+
pendingTypeAheadKeyRef.current = key;
|
|
103
|
+
setOpen(true);
|
|
104
|
+
}
|
|
105
|
+
}, [disabled, open, setOpen]);
|
|
106
|
+
useEffect(() => {
|
|
107
|
+
var _accessibilityRoles$o;
|
|
108
|
+
if (!open || !pendingTypeAheadKeyRef.current) return;
|
|
109
|
+
const key = pendingTypeAheadKeyRef.current;
|
|
110
|
+
pendingTypeAheadKeyRef.current = null;
|
|
111
|
+
const floatingEl = refs.floating.current;
|
|
112
|
+
if (!floatingEl) return;
|
|
113
|
+
const optionRole = (_accessibilityRoles$o = accessibilityRoles === null || accessibilityRoles === void 0 ? void 0 : accessibilityRoles.option) !== null && _accessibilityRoles$o !== void 0 ? _accessibilityRoles$o : 'option';
|
|
114
|
+
const options = floatingEl.querySelectorAll("[role=\"".concat(optionRole, "\"]"));
|
|
115
|
+
const matchingOption = Array.from(options).find(option => {
|
|
116
|
+
var _option$textContent, _firstLetterMatch$;
|
|
117
|
+
const firstLetterMatch = (_option$textContent = option.textContent) === null || _option$textContent === void 0 ? void 0 : _option$textContent.match(/[a-z]/i);
|
|
118
|
+
return (firstLetterMatch === null || firstLetterMatch === void 0 || (_firstLetterMatch$ = firstLetterMatch[0]) === null || _firstLetterMatch$ === void 0 ? void 0 : _firstLetterMatch$.toLowerCase()) === key;
|
|
119
|
+
});
|
|
120
|
+
if (matchingOption) {
|
|
121
|
+
matchingOption.focus();
|
|
122
|
+
}
|
|
123
|
+
}, [open, refs.floating, accessibilityRoles === null || accessibilityRoles === void 0 ? void 0 : accessibilityRoles.option]);
|
|
96
124
|
const rootStyles = useMemo(() => _objectSpread(_objectSpread({}, style), styles === null || styles === void 0 ? void 0 : styles.root), [style, styles === null || styles === void 0 ? void 0 : styles.root]);
|
|
97
125
|
const controlStyles = useMemo(() => ({
|
|
98
126
|
controlStartNode: styles === null || styles === void 0 ? void 0 : styles.controlStartNode,
|
|
@@ -165,6 +193,7 @@ const SelectBase = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_props, ref) => {
|
|
|
165
193
|
labelVariant: labelVariant,
|
|
166
194
|
maxSelectedOptionsToShow: maxSelectedOptionsToShow,
|
|
167
195
|
onChange: onChange,
|
|
196
|
+
onKeyDown: handleControlKeyDown,
|
|
168
197
|
open: open,
|
|
169
198
|
options: options,
|
|
170
199
|
placeholder: placeholder,
|
package/esm/dropdown/Dropdown.js
CHANGED
|
@@ -170,6 +170,11 @@ const PopoverDropdown = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref2, ref) =
|
|
|
170
170
|
}))
|
|
171
171
|
});
|
|
172
172
|
}));
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* @deprecated Use PopoverPanel for interactive overlays with arbitrary content, or Select / SelectChip when presenting a list of selectable options. This will be removed in a future major release.
|
|
176
|
+
* @deprecationExpectedRemoval v10
|
|
177
|
+
*/
|
|
173
178
|
export const Dropdown = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_props, ref) => {
|
|
174
179
|
const mergedProps = useComponentConfig('Dropdown', _props);
|
|
175
180
|
const {
|
|
@@ -6,7 +6,7 @@ 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
|
|
9
|
+
import { forwardRef, memo } from 'react';
|
|
10
10
|
import { animateDropdownOpacityInConfig, animateDropdownOpacityOutConfig, animateDropdownTransformInConfig, animateDropdownTransformOutConfig } from '@coinbase/cds-common/animation/dropdown';
|
|
11
11
|
import { zIndex } from '@coinbase/cds-common/tokens/zIndex';
|
|
12
12
|
import { m as motion } from 'framer-motion';
|
|
@@ -14,7 +14,18 @@ import { VStack } from '../layout/VStack';
|
|
|
14
14
|
import { useMotionProps } from '../motion/useMotionProps';
|
|
15
15
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
16
|
const dropdownStaticClassName = 'cds-dropdown';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @deprecated Use PopoverPanelContent within a PopoverPanel for interactive overlay content, or Select / SelectChip when presenting a list of selectable options. This will be removed in a future major release.
|
|
20
|
+
* @deprecationExpectedRemoval v10
|
|
21
|
+
*/
|
|
22
|
+
|
|
17
23
|
const MotionVStack = motion(VStack);
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* @deprecated Use PopoverPanelContent within a PopoverPanel for interactive overlay content, or Select / SelectChip when presenting a list of selectable options. This will be removed in a future major release.
|
|
27
|
+
* @deprecationExpectedRemoval v10
|
|
28
|
+
*/
|
|
18
29
|
export const DropdownContent = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, ref) => {
|
|
19
30
|
let {
|
|
20
31
|
children,
|
|
@@ -3,6 +3,11 @@ import { useIsoEffect } from '../hooks/useIsoEffect';
|
|
|
3
3
|
import { useTheme } from '../hooks/useTheme';
|
|
4
4
|
import { getBrowserGlobals, isSSR } from '../utils/browser';
|
|
5
5
|
const BOTTOM_GUTTER_SPACE = 2;
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated Import `useResponsivePanelMaxHeight` from `@coinbase/cds-web/popover` instead. This will be removed in a future major release.
|
|
9
|
+
* @deprecationExpectedRemoval v10
|
|
10
|
+
*/
|
|
6
11
|
export function useResponsiveHeight(_ref) {
|
|
7
12
|
var _getBrowserGlobals;
|
|
8
13
|
let {
|