@coinbase/cds-web 8.61.0 → 8.62.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 +12 -0
- package/dts/accordion/Accordion.d.ts +1 -9
- package/dts/accordion/Accordion.d.ts.map +1 -1
- package/dts/alpha/combobox/Combobox.d.ts.map +1 -1
- package/dts/alpha/select/Select.d.ts.map +1 -1
- package/dts/alpha/select-chip/SelectChip.d.ts.map +1 -1
- package/dts/alpha/tabbed-chips/TabbedChips.d.ts.map +1 -1
- package/dts/banner/Banner.d.ts.map +1 -1
- package/dts/buttons/AvatarButton.d.ts.map +1 -1
- package/dts/buttons/Button.d.ts +2 -4
- package/dts/buttons/Button.d.ts.map +1 -1
- package/dts/buttons/ButtonGroup.d.ts.map +1 -1
- package/dts/buttons/IconButton.d.ts.map +1 -1
- package/dts/buttons/IconCounterButton.d.ts.map +1 -1
- package/dts/buttons/Tile.d.ts +1 -1
- package/dts/buttons/Tile.d.ts.map +1 -1
- package/dts/buttons/TileButton.d.ts.map +1 -1
- package/dts/cards/LikeButton.d.ts.map +1 -1
- package/dts/carousel/Carousel.d.ts.map +1 -1
- package/dts/cells/Cell.d.ts.map +1 -1
- package/dts/cells/CellAccessory.d.ts.map +1 -1
- package/dts/cells/ListCell.d.ts.map +1 -1
- package/dts/cells/ListCellFallback.d.ts.map +1 -1
- package/dts/chips/Chip.d.ts.map +1 -1
- package/dts/chips/ChipProps.d.ts +10 -8
- package/dts/chips/ChipProps.d.ts.map +1 -1
- package/dts/chips/InputChip.d.ts.map +1 -1
- package/dts/chips/MediaChip.d.ts +4 -4
- package/dts/chips/MediaChip.d.ts.map +1 -1
- package/dts/chips/TabbedChips.d.ts.map +1 -1
- package/dts/coachmark/Coachmark.d.ts.map +1 -1
- package/dts/collapsible/Collapsible.d.ts.map +1 -1
- package/dts/collapsible/useCollapsibleMotionProps.d.ts +221 -221
- package/dts/controls/Checkbox.d.ts.map +1 -1
- package/dts/controls/CheckboxCell.d.ts.map +1 -1
- package/dts/controls/Control.d.ts.map +1 -1
- package/dts/controls/ControlGroup.d.ts +13 -4
- package/dts/controls/ControlGroup.d.ts.map +1 -1
- package/dts/controls/InputStack.d.ts.map +1 -1
- package/dts/controls/Radio.d.ts.map +1 -1
- package/dts/controls/RadioCell.d.ts.map +1 -1
- package/dts/controls/SearchInput.d.ts.map +1 -1
- package/dts/controls/SelectOption.d.ts +1 -14
- package/dts/controls/SelectOption.d.ts.map +1 -1
- package/dts/controls/Switch.d.ts +2 -1
- package/dts/controls/Switch.d.ts.map +1 -1
- package/dts/controls/TextInput.d.ts.map +1 -1
- package/dts/core/componentConfig.d.ts +192 -0
- package/dts/core/componentConfig.d.ts.map +1 -0
- package/dts/dates/Calendar.d.ts.map +1 -1
- package/dts/dates/DateInput.d.ts.map +1 -1
- package/dts/dates/DatePicker.d.ts.map +1 -1
- package/dts/dots/DotCount.d.ts +1 -15
- package/dts/dots/DotCount.d.ts.map +1 -1
- package/dts/dots/DotStatusColor.d.ts +1 -10
- package/dts/dots/DotStatusColor.d.ts.map +1 -1
- package/dts/dots/DotSymbol.d.ts +1 -22
- package/dts/dots/DotSymbol.d.ts.map +1 -1
- package/dts/dropdown/Dropdown.d.ts +30 -29
- package/dts/dropdown/Dropdown.d.ts.map +1 -1
- package/dts/dropdown/DropdownProps.d.ts +53 -51
- package/dts/dropdown/DropdownProps.d.ts.map +1 -1
- package/dts/hooks/useComponentConfig.d.ts +22 -0
- package/dts/hooks/useComponentConfig.d.ts.map +1 -0
- package/dts/hooks/useIsoEffect.d.ts +2 -2
- package/dts/hooks/useIsoEffect.d.ts.map +1 -1
- package/dts/icons/Icon.d.ts.map +1 -1
- package/dts/index.d.ts +2 -0
- package/dts/index.d.ts.map +1 -1
- package/dts/layout/Divider.d.ts +1 -6
- package/dts/layout/Divider.d.ts.map +1 -1
- package/dts/layout/Fallback.d.ts.map +1 -1
- package/dts/media/Avatar.d.ts +1 -15
- package/dts/media/Avatar.d.ts.map +1 -1
- package/dts/media/RemoteImage.d.ts +1 -15
- package/dts/media/RemoteImage.d.ts.map +1 -1
- package/dts/media/RemoteImageGroup.d.ts +3 -10
- package/dts/media/RemoteImageGroup.d.ts.map +1 -1
- package/dts/motion/useMotionProps.d.ts +457 -457
- package/dts/motion/utils.d.ts +211 -211
- package/dts/navigation/NavigationBar.d.ts +1 -25
- package/dts/navigation/NavigationBar.d.ts.map +1 -1
- package/dts/navigation/NavigationTitle.d.ts +4 -3
- package/dts/navigation/NavigationTitle.d.ts.map +1 -1
- package/dts/navigation/NavigationTitleSelect.d.ts +5 -12
- package/dts/navigation/NavigationTitleSelect.d.ts.map +1 -1
- package/dts/navigation/Sidebar.d.ts.map +1 -1
- package/dts/navigation/SidebarItem.d.ts +40 -34
- package/dts/navigation/SidebarItem.d.ts.map +1 -1
- package/dts/navigation/SidebarMoreMenu.d.ts +13 -12
- package/dts/navigation/SidebarMoreMenu.d.ts.map +1 -1
- package/dts/numbers/RollingNumber/RollingNumber.d.ts.map +1 -1
- package/dts/overlays/Alert.d.ts.map +1 -1
- package/dts/overlays/FocusTrap.d.ts +9 -12
- package/dts/overlays/FocusTrap.d.ts.map +1 -1
- package/dts/overlays/FullscreenAlert.d.ts +10 -7
- package/dts/overlays/FullscreenAlert.d.ts.map +1 -1
- package/dts/overlays/Toast.d.ts.map +1 -1
- package/dts/overlays/modal/FullscreenModal.d.ts +47 -45
- package/dts/overlays/modal/FullscreenModal.d.ts.map +1 -1
- package/dts/overlays/modal/FullscreenModalHeader.d.ts.map +1 -1
- package/dts/overlays/modal/FullscreenModalLayout.d.ts +2 -2
- package/dts/overlays/modal/Modal.d.ts.map +1 -1
- package/dts/overlays/modal/ModalBody.d.ts +6 -3
- package/dts/overlays/modal/ModalBody.d.ts.map +1 -1
- package/dts/overlays/modal/ModalFooter.d.ts +3 -10
- package/dts/overlays/modal/ModalFooter.d.ts.map +1 -1
- package/dts/overlays/modal/ModalHeader.d.ts +3 -12
- package/dts/overlays/modal/ModalHeader.d.ts.map +1 -1
- package/dts/overlays/modal/ModalWrapper.d.ts.map +1 -1
- package/dts/overlays/overlay/Overlay.d.ts +2 -1
- package/dts/overlays/overlay/Overlay.d.ts.map +1 -1
- package/dts/overlays/overlay/OverlayContent.d.ts +7 -5
- package/dts/overlays/overlay/OverlayContent.d.ts.map +1 -1
- package/dts/overlays/popover/PopoverProps.d.ts +46 -46
- package/dts/overlays/popover/PopoverProps.d.ts.map +1 -1
- package/dts/overlays/tooltip/Tooltip.d.ts +4 -22
- package/dts/overlays/tooltip/Tooltip.d.ts.map +1 -1
- package/dts/overlays/tooltip/TooltipContent.d.ts +7 -1
- package/dts/overlays/tooltip/TooltipContent.d.ts.map +1 -1
- package/dts/overlays/tray/Tray.d.ts.map +1 -1
- package/dts/page/PageFooter.d.ts.map +1 -1
- package/dts/page/PageHeader.d.ts.map +1 -1
- package/dts/pagination/Pagination.d.ts +3 -19
- package/dts/pagination/Pagination.d.ts.map +1 -1
- package/dts/perf/component-config/Button.component-config.perf-test.d.ts +2 -0
- package/dts/perf/component-config/Button.component-config.perf-test.d.ts.map +1 -0
- package/dts/perf/component-config/ComponentConfigProvider.perf-test.d.ts +2 -0
- package/dts/perf/component-config/ComponentConfigProvider.perf-test.d.ts.map +1 -0
- package/dts/perf/component-config/ComponentConfigStickerSheet.perf-test.d.ts +2 -0
- package/dts/perf/component-config/ComponentConfigStickerSheet.perf-test.d.ts.map +1 -0
- package/dts/section-header/SectionHeader.d.ts.map +1 -1
- package/dts/stepper/Stepper.d.ts.map +1 -1
- package/dts/system/ComponentConfigProvider.d.ts +26 -0
- package/dts/system/ComponentConfigProvider.d.ts.map +1 -0
- package/dts/system/index.d.ts +1 -0
- package/dts/system/index.d.ts.map +1 -1
- package/dts/tables/Table.d.ts +7 -5
- package/dts/tables/Table.d.ts.map +1 -1
- package/dts/tables/TableCaption.d.ts +32 -41
- package/dts/tables/TableCaption.d.ts.map +1 -1
- package/dts/tables/TableCell.d.ts +26 -48
- package/dts/tables/TableCell.d.ts.map +1 -1
- package/dts/tables/TableCellFallback.d.ts +10 -17
- package/dts/tables/TableCellFallback.d.ts.map +1 -1
- package/dts/tables/TableRow.d.ts +44 -53
- package/dts/tables/TableRow.d.ts.map +1 -1
- package/dts/tabs/SegmentedTab.d.ts +6 -3
- package/dts/tabs/SegmentedTab.d.ts.map +1 -1
- package/dts/tabs/SegmentedTabs.d.ts +9 -3
- package/dts/tabs/SegmentedTabs.d.ts.map +1 -1
- package/dts/tabs/Tabs.d.ts +16 -15
- package/dts/tabs/Tabs.d.ts.map +1 -1
- package/dts/tabs/hooks/useAnimateTabIndicator.d.ts +457 -457
- package/dts/tag/Tag.d.ts.map +1 -1
- package/dts/tour/Tour.d.ts +54 -53
- package/dts/tour/Tour.d.ts.map +1 -1
- package/dts/typography/Link.d.ts.map +1 -1
- package/dts/utils/mergeComponentProps.d.ts +34 -0
- package/dts/utils/mergeComponentProps.d.ts.map +1 -0
- package/dts/visualizations/ProgressBar.d.ts.map +1 -1
- package/dts/visualizations/ProgressBarWithFixedLabels.d.ts +5 -3
- package/dts/visualizations/ProgressBarWithFixedLabels.d.ts.map +1 -1
- package/dts/visualizations/ProgressBarWithFloatLabel.d.ts +3 -1
- package/dts/visualizations/ProgressBarWithFloatLabel.d.ts.map +1 -1
- package/dts/visualizations/ProgressCircle.d.ts.map +1 -1
- package/esm/accordion/Accordion.js +5 -3
- package/esm/alpha/combobox/Combobox.js +6 -4
- package/esm/alpha/select/Select.js +5 -3
- package/esm/alpha/select-chip/SelectChip.js +6 -4
- package/esm/alpha/tabbed-chips/TabbedChips.js +6 -4
- package/esm/banner/Banner.js +6 -4
- package/esm/buttons/AvatarButton.js +6 -4
- package/esm/buttons/Button.js +6 -4
- package/esm/buttons/ButtonGroup.js +5 -3
- package/esm/buttons/IconButton.js +6 -4
- package/esm/buttons/IconCounterButton.js +6 -4
- package/esm/buttons/Tile.js +5 -3
- package/esm/buttons/TileButton.js +6 -4
- package/esm/cards/LikeButton.js +6 -4
- package/esm/carousel/Carousel.js +8 -6
- package/esm/cells/Cell.js +8 -6
- package/esm/cells/CellAccessory.js +6 -4
- package/esm/cells/ListCell.js +6 -4
- package/esm/cells/ListCellFallback.js +6 -4
- package/esm/chips/Chip.js +6 -4
- package/esm/chips/InputChip.js +6 -4
- package/esm/chips/MediaChip.js +6 -4
- package/esm/chips/TabbedChips.js +6 -4
- package/esm/coachmark/Coachmark.js +6 -4
- package/esm/collapsible/Collapsible.js +5 -3
- package/esm/controls/Checkbox.js +6 -4
- package/esm/controls/CheckboxCell.js +6 -4
- package/esm/controls/Control.js +6 -4
- package/esm/controls/ControlGroup.js +6 -4
- package/esm/controls/InputStack.js +6 -4
- package/esm/controls/Radio.js +6 -4
- package/esm/controls/RadioCell.js +6 -4
- package/esm/controls/SearchInput.js +6 -4
- package/esm/controls/SelectOption.js +6 -4
- package/esm/controls/Switch.js +6 -4
- package/esm/controls/TextInput.js +6 -4
- package/esm/core/componentConfig.js +1 -0
- package/esm/dates/Calendar.js +6 -4
- package/esm/dates/DateInput.js +6 -4
- package/esm/dates/DatePicker.js +6 -4
- package/esm/dots/DotCount.js +6 -4
- package/esm/dots/DotStatusColor.js +6 -4
- package/esm/dots/DotSymbol.js +6 -4
- package/esm/dropdown/Dropdown.js +6 -4
- package/esm/hooks/useComponentConfig.js +27 -0
- package/esm/icons/Icon.js +6 -4
- package/esm/index.js +2 -0
- package/esm/layout/Divider.js +6 -4
- package/esm/layout/Fallback.js +6 -4
- package/esm/media/Avatar.js +8 -6
- package/esm/media/RemoteImage.js +6 -4
- package/esm/media/RemoteImageGroup.js +6 -4
- package/esm/navigation/NavigationBar.js +6 -4
- package/esm/navigation/NavigationTitle.js +6 -4
- package/esm/navigation/NavigationTitleSelect.js +6 -4
- package/esm/navigation/Sidebar.js +6 -4
- package/esm/navigation/SidebarItem.js +6 -4
- package/esm/navigation/SidebarMoreMenu.js +6 -4
- package/esm/numbers/RollingNumber/RollingNumber.js +6 -4
- package/esm/overlays/Alert.js +6 -4
- package/esm/overlays/FocusTrap.js +6 -4
- package/esm/overlays/FullscreenAlert.js +5 -3
- package/esm/overlays/Toast.js +6 -4
- package/esm/overlays/modal/FullscreenModal.js +5 -3
- package/esm/overlays/modal/FullscreenModalHeader.js +6 -4
- package/esm/overlays/modal/Modal.js +6 -4
- package/esm/overlays/modal/ModalBody.js +9 -6
- package/esm/overlays/modal/ModalFooter.js +8 -6
- package/esm/overlays/modal/ModalHeader.js +6 -4
- package/esm/overlays/modal/ModalWrapper.js +6 -4
- package/esm/overlays/overlay/Overlay.js +4 -2
- package/esm/overlays/tooltip/Tooltip.js +9 -7
- package/esm/overlays/tooltip/TooltipContent.js +16 -9
- package/esm/overlays/tray/Tray.js +5 -3
- package/esm/page/PageFooter.js +6 -4
- package/esm/page/PageHeader.js +6 -4
- package/esm/pagination/Pagination.js +6 -4
- package/esm/perf/component-config/Button.component-config.perf-test.js +43 -0
- package/esm/perf/component-config/ComponentConfigProvider.perf-test.js +134 -0
- package/esm/perf/component-config/ComponentConfigStickerSheet.perf-test.js +332 -0
- package/esm/perf/component-config/README.md +8 -0
- package/esm/section-header/SectionHeader.js +6 -4
- package/esm/stepper/Stepper.js +12 -10
- package/esm/system/ComponentConfigProvider.js +41 -0
- package/esm/system/index.js +1 -0
- package/esm/tables/Table.js +6 -4
- package/esm/tables/TableCaption.js +6 -4
- package/esm/tables/TableCell.js +9 -7
- package/esm/tables/TableCellFallback.js +6 -4
- package/esm/tables/TableRow.js +6 -4
- package/esm/tabs/SegmentedTab.js +6 -4
- package/esm/tabs/SegmentedTabs.js +6 -4
- package/esm/tabs/Tabs.js +12 -10
- package/esm/tag/Tag.js +6 -4
- package/esm/tour/Tour.js +5 -3
- package/esm/typography/Link.js +6 -4
- package/esm/utils/mergeComponentProps.js +39 -0
- package/esm/visualizations/ProgressBar.js +5 -3
- package/esm/visualizations/ProgressBarWithFixedLabels.js +5 -3
- package/esm/visualizations/ProgressBarWithFloatLabel.js +5 -3
- package/esm/visualizations/ProgressCircle.js +7 -5
- package/package.json +4 -3
|
@@ -10,13 +10,15 @@ import React, { memo, useCallback, useMemo, useRef, useState } from 'react';
|
|
|
10
10
|
import { SelectOption } from '../controls/SelectOption';
|
|
11
11
|
import { Dropdown } from '../dropdown/Dropdown';
|
|
12
12
|
import { useA11yControlledVisibility } from '../hooks/useA11yControlledVisibility';
|
|
13
|
+
import { useComponentConfig } from '../hooks/useComponentConfig';
|
|
13
14
|
import { Icon } from '../icons';
|
|
14
15
|
import { Pressable } from '../system';
|
|
15
16
|
import { Text } from '../typography/Text';
|
|
16
17
|
import { navigationTitleDefaultElement } from './NavigationTitle';
|
|
17
18
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
|
-
export const NavigationTitleSelect = /*#__PURE__*/memo(
|
|
19
|
-
|
|
19
|
+
export const NavigationTitleSelect = /*#__PURE__*/memo(_props => {
|
|
20
|
+
const mergedProps = useComponentConfig('NavigationTitleSelect', _props);
|
|
21
|
+
const {
|
|
20
22
|
options,
|
|
21
23
|
value,
|
|
22
24
|
onChange,
|
|
@@ -24,8 +26,8 @@ export const NavigationTitleSelect = /*#__PURE__*/memo(_ref => {
|
|
|
24
26
|
color = 'fg',
|
|
25
27
|
font = 'title1',
|
|
26
28
|
as = navigationTitleDefaultElement
|
|
27
|
-
} =
|
|
28
|
-
props = _objectWithoutProperties(
|
|
29
|
+
} = mergedProps,
|
|
30
|
+
props = _objectWithoutProperties(mergedProps, _excluded);
|
|
29
31
|
const [visible, setVisible] = useState(false);
|
|
30
32
|
const dropdownRef = useRef(null);
|
|
31
33
|
const {
|
|
@@ -9,6 +9,7 @@ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t =
|
|
|
9
9
|
import React, { Children, memo, useMemo } from 'react';
|
|
10
10
|
import { zIndex } from '@coinbase/cds-common/tokens/zIndex';
|
|
11
11
|
import { cx } from '../cx';
|
|
12
|
+
import { useComponentConfig } from '../hooks/useComponentConfig';
|
|
12
13
|
import { useDimensions } from '../hooks/useDimensions';
|
|
13
14
|
import { Box, VStack } from '../layout';
|
|
14
15
|
import { breakpoints } from '../styles/media';
|
|
@@ -33,8 +34,9 @@ const breakpointConfig = {
|
|
|
33
34
|
},
|
|
34
35
|
updateOnBreakpointChange: true
|
|
35
36
|
};
|
|
36
|
-
export const Sidebar = /*#__PURE__*/memo(
|
|
37
|
-
|
|
37
|
+
export const Sidebar = /*#__PURE__*/memo(_props => {
|
|
38
|
+
const mergedProps = useComponentConfig('Sidebar', _props);
|
|
39
|
+
const {
|
|
38
40
|
logo,
|
|
39
41
|
children,
|
|
40
42
|
collapsed,
|
|
@@ -48,8 +50,8 @@ export const Sidebar = /*#__PURE__*/memo(_ref => {
|
|
|
48
50
|
classNames,
|
|
49
51
|
style,
|
|
50
52
|
styles
|
|
51
|
-
} =
|
|
52
|
-
props = _objectWithoutProperties(
|
|
53
|
+
} = mergedProps,
|
|
54
|
+
props = _objectWithoutProperties(mergedProps, _excluded);
|
|
53
55
|
const {
|
|
54
56
|
ref,
|
|
55
57
|
currentBreakpoint
|
|
@@ -7,6 +7,7 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
|
|
|
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
9
|
import React, { forwardRef, memo, useMemo } from 'react';
|
|
10
|
+
import { useComponentConfig } from '../hooks/useComponentConfig';
|
|
10
11
|
import { Icon } from '../icons';
|
|
11
12
|
import { Box } from '../layout';
|
|
12
13
|
import { Tooltip } from '../overlays/tooltip/Tooltip';
|
|
@@ -15,8 +16,9 @@ import { Text } from '../typography';
|
|
|
15
16
|
import { useSidebarContext } from './SidebarContext';
|
|
16
17
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
18
|
const pressableCss = "pressableCss-p1t38snu";
|
|
18
|
-
export const SidebarItem = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((
|
|
19
|
-
|
|
19
|
+
export const SidebarItem = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_props, ref) => {
|
|
20
|
+
const mergedProps = useComponentConfig('SidebarItem', _props);
|
|
21
|
+
const {
|
|
20
22
|
icon,
|
|
21
23
|
title,
|
|
22
24
|
collapsed,
|
|
@@ -26,8 +28,8 @@ export const SidebarItem = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, ref)
|
|
|
26
28
|
borderRadius,
|
|
27
29
|
accessibilityLabel = title,
|
|
28
30
|
Component
|
|
29
|
-
} =
|
|
30
|
-
pressableProps = _objectWithoutProperties(
|
|
31
|
+
} = mergedProps,
|
|
32
|
+
pressableProps = _objectWithoutProperties(mergedProps, _excluded);
|
|
31
33
|
const color = active ? 'fgPrimary' : 'fg';
|
|
32
34
|
const {
|
|
33
35
|
collapsed: computedCollapsed,
|
|
@@ -10,6 +10,7 @@ import React, { memo, useCallback, useMemo, useRef, useState } from 'react';
|
|
|
10
10
|
import { sidebarMenuMaxWidth, sidebarMenuMinWidth } from '@coinbase/cds-common/tokens/menu';
|
|
11
11
|
import { Dropdown } from '../dropdown';
|
|
12
12
|
import { useA11yControlledVisibility } from '../hooks/useA11yControlledVisibility';
|
|
13
|
+
import { useComponentConfig } from '../hooks/useComponentConfig';
|
|
13
14
|
import { Tooltip } from '../overlays/tooltip/Tooltip';
|
|
14
15
|
import { useSidebarContext } from './SidebarContext';
|
|
15
16
|
import { SidebarItem } from './SidebarItem';
|
|
@@ -18,8 +19,9 @@ const defaultContentPosition = {
|
|
|
18
19
|
gap: 3,
|
|
19
20
|
placement: 'right-start'
|
|
20
21
|
};
|
|
21
|
-
export const SidebarMoreMenu = /*#__PURE__*/memo(function SidebarMoreMenu(
|
|
22
|
-
|
|
22
|
+
export const SidebarMoreMenu = /*#__PURE__*/memo(function SidebarMoreMenu(_props) {
|
|
23
|
+
const mergedProps = useComponentConfig('SidebarMoreMenu', _props);
|
|
24
|
+
const {
|
|
23
25
|
children,
|
|
24
26
|
active,
|
|
25
27
|
onClick,
|
|
@@ -29,8 +31,8 @@ export const SidebarMoreMenu = /*#__PURE__*/memo(function SidebarMoreMenu(_ref)
|
|
|
29
31
|
triggerTitle = 'More',
|
|
30
32
|
Component,
|
|
31
33
|
borderRadius
|
|
32
|
-
} =
|
|
33
|
-
props = _objectWithoutProperties(
|
|
34
|
+
} = mergedProps,
|
|
35
|
+
props = _objectWithoutProperties(mergedProps, _excluded);
|
|
34
36
|
const [visible, setVisible] = useState(false);
|
|
35
37
|
const {
|
|
36
38
|
collapsed
|
|
@@ -13,6 +13,7 @@ import { useValueChangeDirection } from '@coinbase/cds-common/numbers/useValueCh
|
|
|
13
13
|
import { useLocale } from '@coinbase/cds-common/system/LocaleProvider';
|
|
14
14
|
import { m } from 'framer-motion';
|
|
15
15
|
import { cx } from '../../cx';
|
|
16
|
+
import { useComponentConfig } from '../../hooks/useComponentConfig';
|
|
16
17
|
import { HStack } from '../../layout/HStack';
|
|
17
18
|
import { Text } from '../../typography/Text';
|
|
18
19
|
import { DefaultRollingNumberAffixSection } from './DefaultRollingNumberAffixSection';
|
|
@@ -56,8 +57,9 @@ export const defaultTransitionConfig = {
|
|
|
56
57
|
// Subcomponent prop and component type declarations
|
|
57
58
|
|
|
58
59
|
export const rollingNumberDefaultElement = 'span';
|
|
59
|
-
export const RollingNumber = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((
|
|
60
|
-
|
|
60
|
+
export const RollingNumber = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_props, ref) => {
|
|
61
|
+
const mergedProps = useComponentConfig('RollingNumber', _props);
|
|
62
|
+
const {
|
|
61
63
|
as,
|
|
62
64
|
value,
|
|
63
65
|
transition,
|
|
@@ -91,8 +93,8 @@ export const RollingNumber = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, re
|
|
|
91
93
|
tabularNumbers = true,
|
|
92
94
|
accessibilityLabelPrefix,
|
|
93
95
|
accessibilityLabelSuffix
|
|
94
|
-
} =
|
|
95
|
-
props = _objectWithoutProperties(
|
|
96
|
+
} = mergedProps,
|
|
97
|
+
props = _objectWithoutProperties(mergedProps, _excluded);
|
|
96
98
|
const Component = as !== null && as !== void 0 ? as : rollingNumberDefaultElement;
|
|
97
99
|
const {
|
|
98
100
|
locale: defaultLocale
|
package/esm/overlays/Alert.js
CHANGED
|
@@ -9,6 +9,7 @@ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t =
|
|
|
9
9
|
import { forwardRef, memo, useCallback, useMemo } from 'react';
|
|
10
10
|
import { Button } from '../buttons';
|
|
11
11
|
import { useA11yLabels } from '../hooks/useA11yLabels';
|
|
12
|
+
import { useComponentConfig } from '../hooks/useComponentConfig';
|
|
12
13
|
import { Pictogram } from '../illustrations';
|
|
13
14
|
import { Box } from '../layout/Box';
|
|
14
15
|
import { Text } from '../typography/Text';
|
|
@@ -17,8 +18,9 @@ import { Portal } from './Portal';
|
|
|
17
18
|
import { alertContainerId } from './PortalProvider';
|
|
18
19
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
20
|
export const alertModalWidth = 318;
|
|
20
|
-
export const Alert = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((
|
|
21
|
-
|
|
21
|
+
export const Alert = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_props, ref) => {
|
|
22
|
+
const mergedProps = useComponentConfig('Alert', _props);
|
|
23
|
+
const {
|
|
22
24
|
title,
|
|
23
25
|
body,
|
|
24
26
|
pictogram,
|
|
@@ -35,8 +37,8 @@ export const Alert = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
35
37
|
actionLayout = 'horizontal',
|
|
36
38
|
accessibilityLabelledBy,
|
|
37
39
|
accessibilityLabel
|
|
38
|
-
} =
|
|
39
|
-
props = _objectWithoutProperties(
|
|
40
|
+
} = mergedProps,
|
|
41
|
+
props = _objectWithoutProperties(mergedProps, _excluded);
|
|
40
42
|
const {
|
|
41
43
|
labelledBySource,
|
|
42
44
|
labelledBy,
|
|
@@ -2,15 +2,17 @@ import React, { memo, useCallback, useEffect, useMemo, useRef } from 'react';
|
|
|
2
2
|
import { useMergeRefs } from '@coinbase/cds-common/hooks/useMergeRefs';
|
|
3
3
|
import { FOCUSABLE_ELEMENTS } from '@coinbase/cds-common/tokens/overlays';
|
|
4
4
|
import { debounce } from '@coinbase/cds-common/utils/debounce';
|
|
5
|
+
import { useComponentConfig } from '../hooks/useComponentConfig';
|
|
5
6
|
import { getBrowserGlobals } from '../utils/browser';
|
|
6
7
|
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
7
8
|
const DEBOUNCE_MS = 50;
|
|
8
9
|
export const NAVIGATION_KEYS = ['Tab', 'ArrowDown', 'ArrowUp', 'Home', 'End'];
|
|
9
10
|
const ALPHABET_KEYS = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'];
|
|
10
11
|
const FOCUSABLE_ELEMENTS_INCLUDING_TABINDEX = "".concat(FOCUSABLE_ELEMENTS, ", [tabindex]");
|
|
11
|
-
export const FocusTrap = /*#__PURE__*/memo(
|
|
12
|
+
export const FocusTrap = /*#__PURE__*/memo(_props => {
|
|
12
13
|
var _previouslyFocusedEle, _getBrowserGlobals;
|
|
13
|
-
|
|
14
|
+
const mergedProps = useComponentConfig('FocusTrap', _props);
|
|
15
|
+
const {
|
|
14
16
|
children,
|
|
15
17
|
onEscPress,
|
|
16
18
|
disableTypeFocus,
|
|
@@ -22,7 +24,7 @@ export const FocusTrap = /*#__PURE__*/memo(function FocusTrap(_ref) {
|
|
|
22
24
|
focusTabIndexElements,
|
|
23
25
|
autoFocusDelay,
|
|
24
26
|
restoreFocusOnUnmount
|
|
25
|
-
} =
|
|
27
|
+
} = mergedProps;
|
|
26
28
|
const isFocused = useRef(false);
|
|
27
29
|
const childrenRef = useRef(null);
|
|
28
30
|
const previouslyFocusedElement = useRef(null);
|
|
@@ -139,7 +141,7 @@ export const FocusTrap = /*#__PURE__*/memo(function FocusTrap(_ref) {
|
|
|
139
141
|
event.preventDefault();
|
|
140
142
|
const elementWithMatchingFirstLetter = focusableElements.find(el => {
|
|
141
143
|
var _el$textContent;
|
|
142
|
-
const textContentFirstLetter = (_el$textContent = el.textContent) === null || _el$textContent === void 0 || (_el$textContent = _el$textContent
|
|
144
|
+
const textContentFirstLetter = (_el$textContent = el.textContent) === null || _el$textContent === void 0 || (_el$textContent = _el$textContent[0]) === null || _el$textContent === void 0 ? void 0 : _el$textContent.toLowerCase();
|
|
143
145
|
const eventKeyLowerCase = event.key.toLowerCase();
|
|
144
146
|
return textContentFirstLetter === eventKeyLowerCase;
|
|
145
147
|
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { memo, useMemo } from 'react';
|
|
2
2
|
import { Button } from '../buttons';
|
|
3
3
|
import { useA11yLabels } from '../hooks/useA11yLabels';
|
|
4
|
+
import { useComponentConfig } from '../hooks/useComponentConfig';
|
|
4
5
|
import { HeroSquare } from '../illustrations';
|
|
5
6
|
import { Box } from '../layout/Box';
|
|
6
7
|
import { VStack } from '../layout/VStack';
|
|
@@ -11,8 +12,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
11
12
|
const centerContentCss = "centerContentCss-c1uepcpp";
|
|
12
13
|
const actionsContainerCss = "actionsContainerCss-a13dr4a7";
|
|
13
14
|
const primaryContentCss = "primaryContentCss-p1scz3m2";
|
|
14
|
-
export const FullscreenAlert = /*#__PURE__*/memo(
|
|
15
|
-
|
|
15
|
+
export const FullscreenAlert = /*#__PURE__*/memo(_props => {
|
|
16
|
+
const mergedProps = useComponentConfig('FullscreenAlert', _props);
|
|
17
|
+
const {
|
|
16
18
|
visible,
|
|
17
19
|
onRequestClose,
|
|
18
20
|
title,
|
|
@@ -28,7 +30,7 @@ export const FullscreenAlert = /*#__PURE__*/memo(function FullscreenAlert(_ref)
|
|
|
28
30
|
accessibilityLabelledBy,
|
|
29
31
|
testID,
|
|
30
32
|
closeAccessibilityLabel
|
|
31
|
-
} =
|
|
33
|
+
} = mergedProps;
|
|
32
34
|
const {
|
|
33
35
|
labelledBySource,
|
|
34
36
|
labelledBy,
|
package/esm/overlays/Toast.js
CHANGED
|
@@ -12,6 +12,7 @@ import { ToastContext } from '@coinbase/cds-common/overlays/ToastProvider';
|
|
|
12
12
|
import { m as motion, useAnimation } from 'framer-motion';
|
|
13
13
|
import { Button } from '../buttons/Button';
|
|
14
14
|
import { IconButton } from '../buttons/IconButton';
|
|
15
|
+
import { useComponentConfig } from '../hooks/useComponentConfig';
|
|
15
16
|
import { Box } from '../layout/Box';
|
|
16
17
|
import { HStack } from '../layout/HStack';
|
|
17
18
|
import { ColorSurge } from '../motion/ColorSurge';
|
|
@@ -27,9 +28,10 @@ const closeButtonAccessibilityDefaults = {
|
|
|
27
28
|
const baseCss = "baseCss-b10fl3zt";
|
|
28
29
|
const toastCss = "toastCss-tzee9px";
|
|
29
30
|
export const toastTestId = 'cds-toast';
|
|
30
|
-
export const Toast = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((
|
|
31
|
+
export const Toast = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_props, ref) => {
|
|
31
32
|
var _action$testID;
|
|
32
|
-
|
|
33
|
+
const mergedProps = useComponentConfig('Toast', _props);
|
|
34
|
+
const {
|
|
33
35
|
text,
|
|
34
36
|
action,
|
|
35
37
|
onWillHide,
|
|
@@ -40,8 +42,8 @@ export const Toast = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
40
42
|
bottomOffset = 'var(--space-4)',
|
|
41
43
|
closeButtonAccessibilityProps = closeButtonAccessibilityDefaults,
|
|
42
44
|
variant
|
|
43
|
-
} =
|
|
44
|
-
props = _objectWithoutProperties(
|
|
45
|
+
} = mergedProps,
|
|
46
|
+
props = _objectWithoutProperties(mergedProps, _excluded);
|
|
45
47
|
const {
|
|
46
48
|
pauseTimer,
|
|
47
49
|
resumeTimer
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { memo, useMemo } from 'react';
|
|
2
2
|
import { cx } from '../../cx';
|
|
3
3
|
import { useA11yLabels } from '../../hooks/useA11yLabels';
|
|
4
|
+
import { useComponentConfig } from '../../hooks/useComponentConfig';
|
|
4
5
|
import { VStack } from '../../layout';
|
|
5
6
|
import { breakpoints } from '../../styles/media';
|
|
6
7
|
import { FullscreenModalHeader } from './FullscreenModalHeader';
|
|
@@ -15,8 +16,9 @@ const secondaryContentContainerCss = "secondaryContentContainerCss-sfkv6s4";
|
|
|
15
16
|
const secondaryContentDividerCss = "secondaryContentDividerCss-s9mfox4";
|
|
16
17
|
const contentScrollContainerCss = "contentScrollContainerCss-cb0slex";
|
|
17
18
|
const contentCss = "contentCss-c18pcq89";
|
|
18
|
-
export const FullscreenModal = /*#__PURE__*/memo(
|
|
19
|
-
|
|
19
|
+
export const FullscreenModal = /*#__PURE__*/memo(_props => {
|
|
20
|
+
const mergedProps = useComponentConfig('FullscreenModal', _props);
|
|
21
|
+
const {
|
|
20
22
|
focusTabIndexElements,
|
|
21
23
|
logo,
|
|
22
24
|
visible,
|
|
@@ -41,7 +43,7 @@ export const FullscreenModal = /*#__PURE__*/memo(function FullscreenModal(_ref)
|
|
|
41
43
|
accessibilityLabel,
|
|
42
44
|
closeAccessibilityLabel,
|
|
43
45
|
contentStyle
|
|
44
|
-
} =
|
|
46
|
+
} = mergedProps;
|
|
45
47
|
const {
|
|
46
48
|
labelledBySource,
|
|
47
49
|
labelledBy,
|
|
@@ -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 } from 'react';
|
|
10
10
|
import { IconButton } from '../../buttons';
|
|
11
|
+
import { useComponentConfig } from '../../hooks/useComponentConfig';
|
|
11
12
|
import { LogoMark } from '../../icons/LogoMark';
|
|
12
13
|
import { Box, HStack } from '../../layout';
|
|
13
14
|
import { breakpoints } from '../../styles/media';
|
|
@@ -17,8 +18,9 @@ const paddingStartSmall = 80;
|
|
|
17
18
|
const paddingStartLarge = 240;
|
|
18
19
|
const headerLogoCss = "headerLogoCss-h8v5jkx";
|
|
19
20
|
const headerLogoInnerCss = "headerLogoInnerCss-hazb7kh";
|
|
20
|
-
export const FullscreenModalHeader = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(function FullscreenModalHeader(
|
|
21
|
-
|
|
21
|
+
export const FullscreenModalHeader = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(function FullscreenModalHeader(_props, ref) {
|
|
22
|
+
const mergedProps = useComponentConfig('FullscreenModalHeader', _props);
|
|
23
|
+
const {
|
|
22
24
|
logo,
|
|
23
25
|
title,
|
|
24
26
|
onRequestClose,
|
|
@@ -29,8 +31,8 @@ export const FullscreenModalHeader = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(f
|
|
|
29
31
|
borderedBottom = true,
|
|
30
32
|
paddingX = 4,
|
|
31
33
|
paddingY = 2
|
|
32
|
-
} =
|
|
33
|
-
props = _objectWithoutProperties(
|
|
34
|
+
} = mergedProps,
|
|
35
|
+
props = _objectWithoutProperties(mergedProps, _excluded);
|
|
34
36
|
const actualBorderedBottom = hideDivider === undefined ? borderedBottom : !hideDivider;
|
|
35
37
|
return /*#__PURE__*/_jsxs(HStack, _objectSpread(_objectSpread({
|
|
36
38
|
ref: ref,
|
|
@@ -14,6 +14,7 @@ import { zIndex } from '@coinbase/cds-common/tokens/zIndex';
|
|
|
14
14
|
import { m as motion } from 'framer-motion';
|
|
15
15
|
import { cx } from '../../cx';
|
|
16
16
|
import { useA11yLabels } from '../../hooks/useA11yLabels';
|
|
17
|
+
import { useComponentConfig } from '../../hooks/useComponentConfig';
|
|
17
18
|
import { Box } from '../../layout';
|
|
18
19
|
import { VStack } from '../../layout/VStack';
|
|
19
20
|
import { useMotionProps } from '../../motion/useMotionProps';
|
|
@@ -36,8 +37,9 @@ const MotionBox = motion(Box);
|
|
|
36
37
|
const overlayContentContextValue = {
|
|
37
38
|
isModal: true
|
|
38
39
|
};
|
|
39
|
-
export const Modal = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((
|
|
40
|
-
|
|
40
|
+
export const Modal = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_props, ref) => {
|
|
41
|
+
const mergedProps = useComponentConfig('Modal', _props);
|
|
42
|
+
const {
|
|
41
43
|
children,
|
|
42
44
|
visible = false,
|
|
43
45
|
onRequestClose,
|
|
@@ -56,8 +58,8 @@ export const Modal = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
56
58
|
hideCloseButton,
|
|
57
59
|
hideDividers,
|
|
58
60
|
maxWidth
|
|
59
|
-
} =
|
|
60
|
-
props = _objectWithoutProperties(
|
|
61
|
+
} = mergedProps,
|
|
62
|
+
props = _objectWithoutProperties(mergedProps, _excluded);
|
|
61
63
|
const defaultWidth = dangerouslyDisableResponsiveness ? modalMaxWidth : defaultWidthStyle;
|
|
62
64
|
const defaultMaxWidth = dangerouslyDisableResponsiveness ? undefined : defaultMaxWidthStyle;
|
|
63
65
|
const {
|
|
@@ -6,20 +6,22 @@ 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 } from 'react';
|
|
9
|
+
import React, { forwardRef, memo } from 'react';
|
|
10
10
|
import { useModalContext } from '@coinbase/cds-common/overlays/ModalContext';
|
|
11
|
+
import { useComponentConfig } from '../../hooks/useComponentConfig';
|
|
11
12
|
import { Box } from '../../layout/Box';
|
|
12
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
export const ModalBody = /*#__PURE__*/forwardRef((
|
|
14
|
-
|
|
14
|
+
export const ModalBody = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_props, ref) => {
|
|
15
|
+
const mergedProps = useComponentConfig('ModalBody', _props);
|
|
16
|
+
const {
|
|
15
17
|
children,
|
|
16
18
|
flexDirection = 'column',
|
|
17
19
|
flexGrow = 1,
|
|
18
20
|
overflow = 'auto',
|
|
19
21
|
paddingX = 3,
|
|
20
22
|
tabIndex = 0
|
|
21
|
-
} =
|
|
22
|
-
props = _objectWithoutProperties(
|
|
23
|
+
} = mergedProps,
|
|
24
|
+
props = _objectWithoutProperties(mergedProps, _excluded);
|
|
23
25
|
const {
|
|
24
26
|
hideDividers
|
|
25
27
|
} = useModalContext();
|
|
@@ -35,4 +37,5 @@ export const ModalBody = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
35
37
|
}, props), {}, {
|
|
36
38
|
children: children
|
|
37
39
|
}));
|
|
38
|
-
});
|
|
40
|
+
}));
|
|
41
|
+
ModalBody.displayName = 'ModalBody';
|
|
@@ -6,14 +6,16 @@ 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 from 'react';
|
|
9
|
+
import React, { memo } from 'react';
|
|
10
10
|
import { useModalContext } from '@coinbase/cds-common/overlays/ModalContext';
|
|
11
|
+
import { useComponentConfig } from '../../hooks/useComponentConfig';
|
|
11
12
|
import { HStack } from '../../layout/HStack';
|
|
12
13
|
import { breakpoints } from '../../styles/media';
|
|
13
14
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
15
|
const baseCss = "baseCss-b12mhpgg";
|
|
15
|
-
export const ModalFooter =
|
|
16
|
-
|
|
16
|
+
export const ModalFooter = /*#__PURE__*/memo(_props => {
|
|
17
|
+
const mergedProps = useComponentConfig('ModalFooter', _props);
|
|
18
|
+
const {
|
|
17
19
|
gap = 2,
|
|
18
20
|
justifyContent = 'flex-end',
|
|
19
21
|
paddingX = 3,
|
|
@@ -21,8 +23,8 @@ export const ModalFooter = _ref => {
|
|
|
21
23
|
width = '100%',
|
|
22
24
|
primaryAction,
|
|
23
25
|
secondaryAction
|
|
24
|
-
} =
|
|
25
|
-
props = _objectWithoutProperties(
|
|
26
|
+
} = mergedProps,
|
|
27
|
+
props = _objectWithoutProperties(mergedProps, _excluded);
|
|
26
28
|
const {
|
|
27
29
|
hideDividers
|
|
28
30
|
} = useModalContext();
|
|
@@ -37,5 +39,5 @@ export const ModalFooter = _ref => {
|
|
|
37
39
|
}, props), {}, {
|
|
38
40
|
children: [secondaryAction, primaryAction]
|
|
39
41
|
}));
|
|
40
|
-
};
|
|
42
|
+
});
|
|
41
43
|
import "./ModalFooter.css";
|
|
@@ -10,12 +10,14 @@ import React from 'react';
|
|
|
10
10
|
import { useModalContext } from '@coinbase/cds-common/overlays/ModalContext';
|
|
11
11
|
import { interactableHeight } from '@coinbase/cds-common/tokens/interactableHeight';
|
|
12
12
|
import { IconButton } from '../../buttons/IconButton';
|
|
13
|
+
import { useComponentConfig } from '../../hooks/useComponentConfig';
|
|
13
14
|
import { Box } from '../../layout/Box';
|
|
14
15
|
import { HStack } from '../../layout/HStack';
|
|
15
16
|
import { Text } from '../../typography/Text';
|
|
16
17
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
|
-
export const ModalHeader =
|
|
18
|
-
|
|
18
|
+
export const ModalHeader = _props => {
|
|
19
|
+
const mergedProps = useComponentConfig('ModalHeader', _props);
|
|
20
|
+
const {
|
|
19
21
|
alignItems = 'center',
|
|
20
22
|
paddingX = 3,
|
|
21
23
|
paddingY = 2,
|
|
@@ -25,8 +27,8 @@ export const ModalHeader = _ref => {
|
|
|
25
27
|
backAccessibilityHint,
|
|
26
28
|
closeAccessibilityLabel,
|
|
27
29
|
closeAccessibilityHint
|
|
28
|
-
} =
|
|
29
|
-
props = _objectWithoutProperties(
|
|
30
|
+
} = mergedProps,
|
|
31
|
+
props = _objectWithoutProperties(mergedProps, _excluded);
|
|
30
32
|
const {
|
|
31
33
|
onRequestClose,
|
|
32
34
|
accessibilityLabelledBy,
|
|
@@ -9,6 +9,7 @@ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t =
|
|
|
9
9
|
import React, { forwardRef, memo, useEffect } from 'react';
|
|
10
10
|
import { NewAnimatePresence } from '../../animation/NewAnimatePresence';
|
|
11
11
|
import { cx } from '../../cx';
|
|
12
|
+
import { useComponentConfig } from '../../hooks/useComponentConfig';
|
|
12
13
|
import { useScrollBlocker } from '../../hooks/useScrollBlocker';
|
|
13
14
|
import { Box } from '../../layout/Box';
|
|
14
15
|
import { media } from '../../styles/media';
|
|
@@ -17,8 +18,9 @@ import { Portal } from '../Portal';
|
|
|
17
18
|
import { modalContainerId } from '../PortalProvider';
|
|
18
19
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
20
|
const modalOverlayResponsiveCss = "modalOverlayResponsiveCss-msg6e82";
|
|
20
|
-
export const ModalWrapper = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((
|
|
21
|
-
|
|
21
|
+
export const ModalWrapper = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_props, ref) => {
|
|
22
|
+
const mergedProps = useComponentConfig('ModalWrapper', _props);
|
|
23
|
+
const {
|
|
22
24
|
alignItems = 'center',
|
|
23
25
|
'aria-modal': ariaModal,
|
|
24
26
|
children,
|
|
@@ -35,8 +37,8 @@ export const ModalWrapper = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, ref
|
|
|
35
37
|
hideOverlay = false,
|
|
36
38
|
role = 'dialog',
|
|
37
39
|
width = '100vw'
|
|
38
|
-
} =
|
|
39
|
-
props = _objectWithoutProperties(
|
|
40
|
+
} = mergedProps,
|
|
41
|
+
props = _objectWithoutProperties(mergedProps, _excluded);
|
|
40
42
|
const blockScroll = useScrollBlocker();
|
|
41
43
|
|
|
42
44
|
// prevent body scroll when modal is open
|
|
@@ -5,17 +5,19 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
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
6
|
import React, { forwardRef, memo } from 'react';
|
|
7
7
|
import { OverlayContentContext } from '@coinbase/cds-common/overlays/OverlayContentContext';
|
|
8
|
+
import { useComponentConfig } from '../../hooks/useComponentConfig';
|
|
8
9
|
import { OverlayContent } from './OverlayContent';
|
|
9
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
11
|
const overlayContentContextValue = {
|
|
11
12
|
isOverlay: true
|
|
12
13
|
};
|
|
13
|
-
export const Overlay = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((
|
|
14
|
+
export const Overlay = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_props, forwardedRef) => {
|
|
15
|
+
const mergedProps = useComponentConfig('Overlay', _props);
|
|
14
16
|
return /*#__PURE__*/_jsx(OverlayContentContext.Provider, {
|
|
15
17
|
value: overlayContentContextValue,
|
|
16
18
|
children: /*#__PURE__*/_jsx(OverlayContent, _objectSpread({
|
|
17
19
|
ref: forwardedRef
|
|
18
|
-
},
|
|
20
|
+
}, mergedProps))
|
|
19
21
|
});
|
|
20
22
|
}));
|
|
21
23
|
Overlay.displayName = 'Overlay';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import React, { cloneElement, useCallback, useMemo, useRef } from 'react';
|
|
1
|
+
import React, { cloneElement, memo, useCallback, useMemo, useRef } from 'react';
|
|
2
|
+
import { useComponentConfig } from '../../hooks/useComponentConfig';
|
|
2
3
|
import { Popover } from '../popover/Popover';
|
|
3
4
|
import { TooltipContent } from './TooltipContent';
|
|
4
5
|
import { useTooltipState } from './useTooltipState';
|
|
@@ -7,8 +8,9 @@ const preventMouseDown = event => {
|
|
|
7
8
|
event.preventDefault();
|
|
8
9
|
event.stopPropagation();
|
|
9
10
|
};
|
|
10
|
-
export const Tooltip =
|
|
11
|
-
|
|
11
|
+
export const Tooltip = /*#__PURE__*/memo(_props => {
|
|
12
|
+
const mergedProps = useComponentConfig('Tooltip', _props);
|
|
13
|
+
const {
|
|
12
14
|
children,
|
|
13
15
|
content,
|
|
14
16
|
elevation,
|
|
@@ -29,7 +31,7 @@ export const Tooltip = _ref => {
|
|
|
29
31
|
autoFocusDelay = 20,
|
|
30
32
|
openDelay,
|
|
31
33
|
closeDelay
|
|
32
|
-
} =
|
|
34
|
+
} = mergedProps;
|
|
33
35
|
const {
|
|
34
36
|
isOpen,
|
|
35
37
|
handleOnMouseEnter,
|
|
@@ -39,10 +41,10 @@ export const Tooltip = _ref => {
|
|
|
39
41
|
tooltipId
|
|
40
42
|
} = useTooltipState(tooltipIdDefault, openDelay, closeDelay);
|
|
41
43
|
const tooltipContentRef = useRef(null);
|
|
42
|
-
const handleMouseEnter = useCallback(
|
|
44
|
+
const handleMouseEnter = useCallback(_ref => {
|
|
43
45
|
let {
|
|
44
46
|
target
|
|
45
|
-
} =
|
|
47
|
+
} = _ref;
|
|
46
48
|
const node = tooltipContentRef.current;
|
|
47
49
|
|
|
48
50
|
// to prevent flicker, don't open tooltip if enter event originates from tooltip content
|
|
@@ -98,4 +100,4 @@ export const Tooltip = _ref => {
|
|
|
98
100
|
visible: isVisible,
|
|
99
101
|
children: clonedChild
|
|
100
102
|
});
|
|
101
|
-
};
|
|
103
|
+
});
|
|
@@ -8,21 +8,28 @@ import { animateInOpacityConfig, animateOutOpacityConfig, getTranslateConfigByPl
|
|
|
8
8
|
import { tooltipMaxWidth, tooltipPaddingX, tooltipPaddingY } from '@coinbase/cds-common/tokens/tooltip';
|
|
9
9
|
import { zIndex as zIndexTokens } from '@coinbase/cds-common/tokens/zIndex';
|
|
10
10
|
import { m as motion } from 'framer-motion';
|
|
11
|
+
import { useComponentConfig } from '../../hooks/useComponentConfig';
|
|
11
12
|
import { Box } from '../../layout/Box';
|
|
12
13
|
import { useMotionProps } from '../../motion/useMotionProps';
|
|
13
14
|
import { Text } from '../../typography/Text';
|
|
14
15
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
16
|
const textCss = "textCss-t15dzixe";
|
|
16
|
-
export const TooltipContent = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((
|
|
17
|
-
|
|
17
|
+
export const TooltipContent = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_props, ref) => {
|
|
18
|
+
const mergedProps = useComponentConfig('TooltipContent', _props);
|
|
19
|
+
const {
|
|
18
20
|
content,
|
|
19
21
|
elevation,
|
|
20
22
|
gap,
|
|
21
23
|
testID,
|
|
22
24
|
zIndex,
|
|
23
25
|
tooltipId,
|
|
24
|
-
placement = 'top'
|
|
25
|
-
|
|
26
|
+
placement = 'top',
|
|
27
|
+
background = 'bg',
|
|
28
|
+
borderRadius = 200,
|
|
29
|
+
maxWidth = tooltipMaxWidth,
|
|
30
|
+
paddingX = tooltipPaddingX,
|
|
31
|
+
paddingY = tooltipPaddingY
|
|
32
|
+
} = mergedProps;
|
|
26
33
|
const outerStyle = useMemo(() => ({
|
|
27
34
|
padding: "var(--space-".concat(gap, ")"),
|
|
28
35
|
zIndex: zIndex !== null && zIndex !== void 0 ? zIndex : zIndexTokens.tooltip
|
|
@@ -42,14 +49,14 @@ export const TooltipContent = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, r
|
|
|
42
49
|
"data-testid": "".concat(testID, "-motion"),
|
|
43
50
|
children: /*#__PURE__*/_jsx(Box, {
|
|
44
51
|
ref: ref,
|
|
45
|
-
background:
|
|
46
|
-
borderRadius:
|
|
52
|
+
background: background,
|
|
53
|
+
borderRadius: borderRadius,
|
|
47
54
|
"data-testid": testID,
|
|
48
55
|
elevation: elevation,
|
|
49
56
|
id: tooltipId,
|
|
50
|
-
maxWidth:
|
|
51
|
-
paddingX:
|
|
52
|
-
paddingY:
|
|
57
|
+
maxWidth: maxWidth,
|
|
58
|
+
paddingX: paddingX,
|
|
59
|
+
paddingY: paddingY,
|
|
53
60
|
role: "tooltip",
|
|
54
61
|
children: typeof content === 'string' ? /*#__PURE__*/_jsx(Text, {
|
|
55
62
|
className: textCss,
|