@redis-ui/components 42.8.0 → 43.2.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/dist/AutoCompleteSelect/AutoCompleteSelect.cjs +7 -1
- package/dist/AutoCompleteSelect/AutoCompleteSelect.js +7 -1
- package/dist/AutoCompleteSelect/hooks/useAutoCompleteSelect.cjs +7 -1
- package/dist/AutoCompleteSelect/hooks/useAutoCompleteSelect.d.ts +8 -1
- package/dist/AutoCompleteSelect/hooks/useAutoCompleteSelect.js +7 -1
- package/dist/BoxSelectionGroup/components/Item/components/BoxStateIndicator/BoxStateIndicator.cjs +8 -4
- package/dist/BoxSelectionGroup/components/Item/components/BoxStateIndicator/BoxStateIndicator.js +8 -4
- package/dist/BoxSelectionGroup/components/Item/components/Compose/Compose.style.cjs +18 -4
- package/dist/BoxSelectionGroup/components/Item/components/Compose/Compose.style.js +18 -4
- package/dist/BoxSelectionGroup/hooks/useBoxSelectionGroup.cjs +3 -1
- package/dist/BoxSelectionGroup/hooks/useBoxSelectionGroup.js +3 -1
- package/dist/Button/Button.style.cjs +4 -1
- package/dist/Button/Button.style.js +4 -1
- package/dist/Button/Button.style.utils.cjs +16 -1
- package/dist/Button/Button.style.utils.js +16 -1
- package/dist/Button/Button.types.cjs +1 -1
- package/dist/Button/Button.types.d.ts +1 -1
- package/dist/Button/Button.types.js +1 -1
- package/dist/Button/CopyToClipboardButton/CopyToClipboardButton.cjs +59 -0
- package/dist/Button/CopyToClipboardButton/CopyToClipboardButton.d.ts +4 -0
- package/dist/Button/CopyToClipboardButton/CopyToClipboardButton.js +57 -0
- package/dist/Button/CopyToClipboardButton/CopyToClipboardButton.style.cjs +40 -0
- package/dist/Button/CopyToClipboardButton/CopyToClipboardButton.style.d.ts +8 -0
- package/dist/Button/CopyToClipboardButton/CopyToClipboardButton.style.js +38 -0
- package/dist/Button/CopyToClipboardButton/CopyToClipboardButton.types.d.ts +5 -0
- package/dist/Button/TextButton/TextButton.style.cjs +4 -1
- package/dist/Button/TextButton/TextButton.style.js +4 -1
- package/dist/Button/TextButton/TextButton.types.cjs +1 -1
- package/dist/Button/TextButton/TextButton.types.d.ts +1 -1
- package/dist/Button/TextButton/TextButton.types.js +1 -1
- package/dist/Button/index.d.ts +2 -0
- package/dist/Checkbox/components/Label/Label.style.cjs +15 -3
- package/dist/Checkbox/components/Label/Label.style.js +15 -3
- package/dist/Chip/components/CloseButton/CloseButton.cjs +3 -1
- package/dist/Chip/components/CloseButton/CloseButton.js +3 -1
- package/dist/Chip/components/Compose/Compose.style.cjs +4 -1
- package/dist/Chip/components/Compose/Compose.style.js +4 -1
- package/dist/Drawer/components/Description/Description.cjs +3 -1
- package/dist/Drawer/components/Description/Description.js +3 -1
- package/dist/Helpers/contexts/Popper/PopperCollisionBoundaryManager.cjs +3 -1
- package/dist/Helpers/contexts/Popper/PopperCollisionBoundaryManager.js +3 -1
- package/dist/Helpers/contexts/PrimitiveContextState.cjs +28 -16
- package/dist/Helpers/contexts/PrimitiveContextState.js +28 -16
- package/dist/Helpers/contexts/SharedId.context.cjs +9 -5
- package/dist/Helpers/contexts/SharedId.context.js +9 -5
- package/dist/Helpers/css.utils.cjs +18 -4
- package/dist/Helpers/css.utils.d.ts +15 -3
- package/dist/Helpers/css.utils.js +18 -4
- package/dist/Helpers/hooks/useScrollable.cjs +3 -1
- package/dist/Helpers/hooks/useScrollable.js +3 -1
- package/dist/Helpers/react.utils.cjs +6 -2
- package/dist/Helpers/react.utils.js +6 -2
- package/dist/HighlightedIcon/HighlightedIcon.cjs +26 -0
- package/dist/HighlightedIcon/HighlightedIcon.d.ts +3 -0
- package/dist/HighlightedIcon/HighlightedIcon.js +26 -0
- package/dist/HighlightedIcon/HighlightedIcon.style.cjs +49 -0
- package/dist/HighlightedIcon/HighlightedIcon.style.d.ts +5 -0
- package/dist/HighlightedIcon/HighlightedIcon.style.js +47 -0
- package/dist/HighlightedIcon/HighlightedIcon.types.d.ts +8 -0
- package/dist/HighlightedIcon/index.d.ts +3 -0
- package/dist/Inputs/QuantityCounter/components/InputGroup/components/ValueLabel/ValueLabel.cjs +9 -5
- package/dist/Inputs/QuantityCounter/components/InputGroup/components/ValueLabel/ValueLabel.js +9 -5
- package/dist/Inputs/components/Compose/Compose.style.cjs +29 -6
- package/dist/Inputs/components/Compose/Compose.style.js +29 -6
- package/dist/Inputs/hooks/numericInput/numericInput.utils.cjs +12 -4
- package/dist/Inputs/hooks/numericInput/numericInput.utils.js +12 -4
- package/dist/Inputs/hooks/numericInput/useNumericInput.cjs +15 -3
- package/dist/Inputs/hooks/numericInput/useNumericInput.js +15 -3
- package/dist/Loader/Loader.cjs +1 -0
- package/dist/Loader/Loader.js +1 -0
- package/dist/Menu/components/Content/components/Item/Components/Compose/Compose.style.cjs +19 -4
- package/dist/Menu/components/Content/components/Item/Components/Compose/Compose.style.js +19 -4
- package/dist/Menu/components/Content/components/Label/components/Compose/Compose.style.cjs +4 -1
- package/dist/Menu/components/Content/components/Label/components/Compose/Compose.style.js +4 -1
- package/dist/Modal/components/Content/components/Compose/Compose.cjs +3 -1
- package/dist/Modal/components/Content/components/Compose/Compose.js +3 -1
- package/dist/Modal/components/Content/components/Description/Description.cjs +3 -1
- package/dist/Modal/components/Content/components/Description/Description.js +3 -1
- package/dist/MultiSelect/components/Compose/hooks/useMultiSelectContextApi.cjs +3 -1
- package/dist/MultiSelect/components/Compose/hooks/useMultiSelectContextApi.js +3 -1
- package/dist/MultiSelect/components/Trigger/components/MultiValue/MultiValue.cjs +3 -1
- package/dist/MultiSelect/components/Trigger/components/MultiValue/MultiValue.js +3 -1
- package/dist/Overflow/Overflow.cjs +3 -1
- package/dist/Overflow/Overflow.js +3 -1
- package/dist/Overflow/Overflow.utils.cjs +15 -6
- package/dist/Overflow/Overflow.utils.js +15 -6
- package/dist/Overflow/components/OverflowContainer/OverflowContainer.cjs +3 -1
- package/dist/Overflow/components/OverflowContainer/OverflowContainer.js +3 -1
- package/dist/Pagination/components/PageSizeSelect.cjs +3 -1
- package/dist/Pagination/components/PageSizeSelect.js +3 -1
- package/dist/Popover/components/Content/Content.cjs +3 -1
- package/dist/Popover/components/Content/Content.js +3 -1
- package/dist/Popover/components/Content/components/Footer/Footer.cjs +3 -1
- package/dist/Popover/components/Content/components/Footer/Footer.js +3 -1
- package/dist/RadioGroup/components/Item/components/Label/Label.style.cjs +15 -3
- package/dist/RadioGroup/components/Item/components/Label/Label.style.js +15 -3
- package/dist/ScreenReaderAnnounce/ScreenReaderAnnounce.cjs +3 -1
- package/dist/ScreenReaderAnnounce/ScreenReaderAnnounce.js +3 -1
- package/dist/Section/components/Header/components/CollapseButton/CollapseButton.cjs +3 -1
- package/dist/Section/components/Header/components/CollapseButton/CollapseButton.js +3 -1
- package/dist/Select/components/Content/components/Option/components/Compose/Compose.style.cjs +16 -4
- package/dist/Select/components/Content/components/Option/components/Compose/Compose.style.js +16 -4
- package/dist/Select/components/Content/components/OptionList/OptionList.cjs +6 -4
- package/dist/Select/components/Content/components/OptionList/OptionList.js +6 -4
- package/dist/Select/components/Content/components/OptionList/Virtual.cjs +9 -5
- package/dist/Select/components/Content/components/OptionList/Virtual.js +9 -5
- package/dist/Select/components/Context/hooks/useSearch.cjs +3 -1
- package/dist/Select/components/Context/hooks/useSearch.js +3 -1
- package/dist/Select/components/Trigger/components/Compose/Compose.style.cjs +33 -7
- package/dist/Select/components/Trigger/components/Compose/Compose.style.js +33 -7
- package/dist/SideBar/components/Item/Item.style.cjs +14 -3
- package/dist/SideBar/components/Item/Item.style.js +14 -3
- package/dist/Skeleton/components/Circle/Circle.cjs +1 -1
- package/dist/Skeleton/components/Circle/Circle.js +1 -1
- package/dist/Skeleton/components/Square/Square.cjs +1 -1
- package/dist/Skeleton/components/Square/Square.js +1 -1
- package/dist/Slider/components/Label/Compose/Compose.cjs +3 -1
- package/dist/Slider/components/Label/Compose/Compose.js +3 -1
- package/dist/Slider/components/Mark/Compose/Compose.cjs +3 -1
- package/dist/Slider/components/Mark/Compose/Compose.js +3 -1
- package/dist/Slider/hooks/useOffset.cjs +3 -1
- package/dist/Slider/hooks/useOffset.js +3 -1
- package/dist/Stepper/Stepper.cjs +14 -5
- package/dist/Stepper/Stepper.d.ts +2 -0
- package/dist/Stepper/Stepper.js +14 -5
- package/dist/Stepper/Stepper.utils.cjs +12 -0
- package/dist/Stepper/Stepper.utils.d.ts +2 -0
- package/dist/Stepper/Stepper.utils.js +12 -0
- package/dist/Stepper/components/Compose/Compose.d.ts +1 -0
- package/dist/Stepper/components/Step/Step.cjs +2 -0
- package/dist/Stepper/components/Step/Step.d.ts +1 -0
- package/dist/Stepper/components/Step/Step.js +2 -0
- package/dist/Stepper/components/Step/components/Compose/Compose.cjs +5 -10
- package/dist/Stepper/components/Step/components/Compose/Compose.js +5 -10
- package/dist/Stepper/components/Step/components/Separator/Separator.cjs +15 -0
- package/dist/Stepper/components/Step/components/Separator/Separator.d.ts +3 -0
- package/dist/Stepper/components/Step/components/Separator/Separator.js +15 -0
- package/dist/Stepper/components/Step/components/Separator/Separator.style.cjs +24 -0
- package/dist/Stepper/components/Step/components/Separator/Separator.style.d.ts +1 -0
- package/dist/Stepper/components/Step/components/Separator/Separator.style.js +22 -0
- package/dist/Stepper/components/Step/components/Separator/Separator.types.d.ts +5 -0
- package/dist/Stepper/hooks/useStepperInteractive.cjs +12 -4
- package/dist/Stepper/hooks/useStepperInteractive.js +12 -4
- package/dist/Switch/components/Switcher/Switcher.cjs +3 -1
- package/dist/Switch/components/Switcher/Switcher.js +3 -1
- package/dist/Switch/components/Switcher/Switcher.style.cjs +31 -8
- package/dist/Switch/components/Switcher/Switcher.style.js +31 -8
- package/dist/Tabs/components/TabBar/components/Trigger/components/Marker/Marker.style.cjs +24 -5
- package/dist/Tabs/components/TabBar/components/Trigger/components/Marker/Marker.style.js +24 -5
- package/dist/Tabs/components/TabBar/components/Trigger/components/Tab/Tab.style.cjs +24 -5
- package/dist/Tabs/components/TabBar/components/Trigger/components/Tab/Tab.style.js +24 -5
- package/dist/ThemeModeSwitch/useThemeModeSwitch.cjs +6 -2
- package/dist/ThemeModeSwitch/useThemeModeSwitch.js +6 -2
- package/dist/Toast/core/content.helper.cjs +8 -4
- package/dist/Toast/core/content.helper.js +8 -4
- package/dist/Tooltip/components/Content/Content.cjs +3 -1
- package/dist/Tooltip/components/Content/Content.js +3 -1
- package/dist/TreeView/TreeView.cjs +3 -1
- package/dist/TreeView/TreeView.js +3 -1
- package/dist/TreeView/components/TreeItem/components/Compose/Compose.cjs +6 -4
- package/dist/TreeView/components/TreeItem/components/Compose/Compose.js +6 -4
- package/dist/Typography/Typography.types.cjs +4 -0
- package/dist/Typography/Typography.types.d.ts +2 -1
- package/dist/Typography/Typography.types.js +4 -0
- package/dist/index.cjs +8 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +98 -90
- package/package.json +10 -9
- package/skills/redis-ui-components/SKILL.md +126 -0
- package/skills/redis-ui-components/references/ActionIconButton.md +96 -0
- package/skills/redis-ui-components/references/AppBar.md +161 -0
- package/skills/redis-ui-components/references/AppSelectionMenu.md +184 -0
- package/skills/redis-ui-components/references/AutoCompleteSelect.md +193 -0
- package/skills/redis-ui-components/references/Badge.md +77 -0
- package/skills/redis-ui-components/references/Banner.md +563 -0
- package/skills/redis-ui-components/references/BoxSelectionGroup.md +487 -0
- package/skills/redis-ui-components/references/Breadcrumbs.md +214 -0
- package/skills/redis-ui-components/references/Button.md +169 -0
- package/skills/redis-ui-components/references/ButtonGroup.md +126 -0
- package/skills/redis-ui-components/references/Card.md +56 -0
- package/skills/redis-ui-components/references/Checkbox.md +171 -0
- package/skills/redis-ui-components/references/Chip.md +154 -0
- package/skills/redis-ui-components/references/ChipList.md +307 -0
- package/skills/redis-ui-components/references/CopyToClipboardButton.md +47 -0
- package/skills/redis-ui-components/references/CountryFlag.md +57 -0
- package/skills/redis-ui-components/references/Drawer.md +298 -0
- package/skills/redis-ui-components/references/Filters.md +162 -0
- package/skills/redis-ui-components/references/FlexDivider.md +152 -0
- package/skills/redis-ui-components/references/FlexGroup.md +149 -0
- package/skills/redis-ui-components/references/FlexItem.md +58 -0
- package/skills/redis-ui-components/references/FlexSplit.md +37 -0
- package/skills/redis-ui-components/references/FormField.md +678 -0
- package/skills/redis-ui-components/references/IconButton.md +63 -0
- package/skills/redis-ui-components/references/Input.md +295 -0
- package/skills/redis-ui-components/references/KeyValueList.md +501 -0
- package/skills/redis-ui-components/references/Label.md +238 -0
- package/skills/redis-ui-components/references/Link.md +402 -0
- package/skills/redis-ui-components/references/Loader.md +100 -0
- package/skills/redis-ui-components/references/Menu.md +988 -0
- package/skills/redis-ui-components/references/MidBar.md +358 -0
- package/skills/redis-ui-components/references/Modal.md +525 -0
- package/skills/redis-ui-components/references/MoreInfoIcon.md +119 -0
- package/skills/redis-ui-components/references/MultiSelect.md +558 -0
- package/skills/redis-ui-components/references/NumericInput.md +322 -0
- package/skills/redis-ui-components/references/Overflow.md +127 -0
- package/skills/redis-ui-components/references/Pagination.md +151 -0
- package/skills/redis-ui-components/references/PasswordInput.md +262 -0
- package/skills/redis-ui-components/references/Popover.md +868 -0
- package/skills/redis-ui-components/references/ProfileIcon.md +65 -0
- package/skills/redis-ui-components/references/ProgressBar.md +103 -0
- package/skills/redis-ui-components/references/QuantityCounter.md +555 -0
- package/skills/redis-ui-components/references/RadioGroup.md +265 -0
- package/skills/redis-ui-components/references/ScreenReaderAnnounce.md +147 -0
- package/skills/redis-ui-components/references/SearchBar.md +242 -0
- package/skills/redis-ui-components/references/SearchInput.md +213 -0
- package/skills/redis-ui-components/references/Section.md +349 -0
- package/skills/redis-ui-components/references/Select.md +517 -0
- package/skills/redis-ui-components/references/SideBar.md +468 -0
- package/skills/redis-ui-components/references/Slider.md +398 -0
- package/skills/redis-ui-components/references/Stepper.md +288 -0
- package/skills/redis-ui-components/references/Switch.md +193 -0
- package/skills/redis-ui-components/references/Tabs.md +383 -0
- package/skills/redis-ui-components/references/TextArea.md +139 -0
- package/skills/redis-ui-components/references/TextButton.md +217 -0
- package/skills/redis-ui-components/references/Toast.md +399 -0
- package/skills/redis-ui-components/references/ToggleButton.md +163 -0
- package/skills/redis-ui-components/references/Tooltip.md +636 -0
- package/skills/redis-ui-components/references/Typography.md +323 -0
|
@@ -32,7 +32,13 @@ const AutoCompleteSelect = React__default.default.forwardRef(({
|
|
|
32
32
|
highlightedIndex,
|
|
33
33
|
onClickOutside,
|
|
34
34
|
onInputFocus
|
|
35
|
-
} = useAutoCompleteSelect.default(
|
|
35
|
+
} = useAutoCompleteSelect.default({
|
|
36
|
+
options,
|
|
37
|
+
open,
|
|
38
|
+
value,
|
|
39
|
+
setOpen,
|
|
40
|
+
onChange
|
|
41
|
+
});
|
|
36
42
|
React.useImperativeHandle(ref, () => inputElRef.current, [inputElRef]);
|
|
37
43
|
const onInputClick = () => {
|
|
38
44
|
if (options.length || value) {
|
|
@@ -28,7 +28,13 @@ const AutoCompleteSelect = React__default.forwardRef(({
|
|
|
28
28
|
highlightedIndex,
|
|
29
29
|
onClickOutside,
|
|
30
30
|
onInputFocus
|
|
31
|
-
} = useAutoCompleteSelect(
|
|
31
|
+
} = useAutoCompleteSelect({
|
|
32
|
+
options,
|
|
33
|
+
open,
|
|
34
|
+
value,
|
|
35
|
+
setOpen,
|
|
36
|
+
onChange
|
|
37
|
+
});
|
|
32
38
|
useImperativeHandle(ref, () => inputElRef.current, [inputElRef]);
|
|
33
39
|
const onInputClick = () => {
|
|
34
40
|
if (options.length || value) {
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
3
|
const React = require("react");
|
|
4
|
-
const useAutoCompleteSelect = (
|
|
4
|
+
const useAutoCompleteSelect = ({
|
|
5
|
+
options,
|
|
6
|
+
open,
|
|
7
|
+
value,
|
|
8
|
+
setOpen,
|
|
9
|
+
onChange
|
|
10
|
+
}) => {
|
|
5
11
|
const inputElRef = React.useRef(null);
|
|
6
12
|
const [highlightedIndex, setHighlightedIndex] = React.useState(-1);
|
|
7
13
|
const suggestedOptions = React.useMemo(() => {
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { AutoCompleteOnChange, AutoCompleteOption } from '../AutoCompleteSelect.types';
|
|
3
|
-
|
|
3
|
+
interface UseAutoCompleteSelectParams {
|
|
4
|
+
options: AutoCompleteOption[];
|
|
5
|
+
open: boolean;
|
|
6
|
+
value: string;
|
|
7
|
+
setOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
8
|
+
onChange: AutoCompleteOnChange;
|
|
9
|
+
}
|
|
10
|
+
declare const useAutoCompleteSelect: ({ options, open, value, setOpen, onChange }: UseAutoCompleteSelectParams) => {
|
|
4
11
|
handleKeyDown: (e: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
5
12
|
inputElRef: React.RefObject<HTMLInputElement>;
|
|
6
13
|
onItemClick: (val: string) => void;
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { useRef, useState, useMemo, useEffect, useCallback } from "react";
|
|
2
|
-
const useAutoCompleteSelect = (
|
|
2
|
+
const useAutoCompleteSelect = ({
|
|
3
|
+
options,
|
|
4
|
+
open,
|
|
5
|
+
value,
|
|
6
|
+
setOpen,
|
|
7
|
+
onChange
|
|
8
|
+
}) => {
|
|
3
9
|
const inputElRef = useRef(null);
|
|
4
10
|
const [highlightedIndex, setHighlightedIndex] = useState(-1);
|
|
5
11
|
const suggestedOptions = useMemo(() => {
|
package/dist/BoxSelectionGroup/components/Item/components/BoxStateIndicator/BoxStateIndicator.cjs
CHANGED
|
@@ -15,10 +15,14 @@ const BoxStateIndicator = ({
|
|
|
15
15
|
tabIndex: -1,
|
|
16
16
|
disabled: isDisabled
|
|
17
17
|
});
|
|
18
|
-
if (!indicator)
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
if (!indicator) {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
if (noninteractive) {
|
|
22
|
+
return jsxRuntime.jsxRuntimeExports.jsx(jsxRuntime.jsxRuntimeExports.Fragment, {
|
|
23
|
+
children: indicator
|
|
24
|
+
});
|
|
25
|
+
}
|
|
22
26
|
return (
|
|
23
27
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
|
|
24
28
|
jsxRuntime.jsxRuntimeExports.jsx("div", {
|
package/dist/BoxSelectionGroup/components/Item/components/BoxStateIndicator/BoxStateIndicator.js
CHANGED
|
@@ -13,10 +13,14 @@ const BoxStateIndicator = ({
|
|
|
13
13
|
tabIndex: -1,
|
|
14
14
|
disabled: isDisabled
|
|
15
15
|
});
|
|
16
|
-
if (!indicator)
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
if (!indicator) {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
if (noninteractive) {
|
|
20
|
+
return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {
|
|
21
|
+
children: indicator
|
|
22
|
+
});
|
|
23
|
+
}
|
|
20
24
|
return (
|
|
21
25
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
|
|
22
26
|
jsxRuntimeExports.jsx("div", {
|
|
@@ -23,20 +23,34 @@ const getStateStyle = (theme, isChecked = false) => {
|
|
|
23
23
|
${Button_style_utils.getButtonStatesStyle(stateColors, maps)};
|
|
24
24
|
|
|
25
25
|
& ${BottomActiveBorder} {
|
|
26
|
-
${css_utils.styleFromTokens(
|
|
26
|
+
${css_utils.styleFromTokens({
|
|
27
|
+
tokenMaps: markerMaps,
|
|
28
|
+
tokens: stateColors.normal
|
|
29
|
+
})}
|
|
27
30
|
}
|
|
28
31
|
|
|
29
32
|
&:hover ${BottomActiveBorder} {
|
|
30
|
-
${css_utils.styleFromTokens(
|
|
33
|
+
${css_utils.styleFromTokens({
|
|
34
|
+
tokenMaps: markerMaps,
|
|
35
|
+
tokens: stateColors.hover,
|
|
36
|
+
fallbackTokens: stateColors.normal
|
|
37
|
+
})}
|
|
31
38
|
}
|
|
32
39
|
|
|
33
40
|
&:disabled {
|
|
34
41
|
> * {
|
|
35
|
-
${css_utils.styleFromTokens(
|
|
42
|
+
${css_utils.styleFromTokens({
|
|
43
|
+
tokenMaps: [css_utils.tokenMaps.opacity],
|
|
44
|
+
tokens: stateColors.disabled
|
|
45
|
+
})}
|
|
36
46
|
}
|
|
37
47
|
|
|
38
48
|
${BottomActiveBorder} {
|
|
39
|
-
${css_utils.styleFromTokens(
|
|
49
|
+
${css_utils.styleFromTokens({
|
|
50
|
+
tokenMaps: markerMaps,
|
|
51
|
+
tokens: stateColors.disabled,
|
|
52
|
+
fallbackTokens: stateColors.normal
|
|
53
|
+
})}
|
|
40
54
|
opacity: 1;
|
|
41
55
|
}
|
|
42
56
|
}
|
|
@@ -19,20 +19,34 @@ const getStateStyle = (theme, isChecked = false) => {
|
|
|
19
19
|
${getButtonStatesStyle(stateColors, maps)};
|
|
20
20
|
|
|
21
21
|
& ${BottomActiveBorder} {
|
|
22
|
-
${styleFromTokens(
|
|
22
|
+
${styleFromTokens({
|
|
23
|
+
tokenMaps: markerMaps,
|
|
24
|
+
tokens: stateColors.normal
|
|
25
|
+
})}
|
|
23
26
|
}
|
|
24
27
|
|
|
25
28
|
&:hover ${BottomActiveBorder} {
|
|
26
|
-
${styleFromTokens(
|
|
29
|
+
${styleFromTokens({
|
|
30
|
+
tokenMaps: markerMaps,
|
|
31
|
+
tokens: stateColors.hover,
|
|
32
|
+
fallbackTokens: stateColors.normal
|
|
33
|
+
})}
|
|
27
34
|
}
|
|
28
35
|
|
|
29
36
|
&:disabled {
|
|
30
37
|
> * {
|
|
31
|
-
${styleFromTokens(
|
|
38
|
+
${styleFromTokens({
|
|
39
|
+
tokenMaps: [tokenMaps.opacity],
|
|
40
|
+
tokens: stateColors.disabled
|
|
41
|
+
})}
|
|
32
42
|
}
|
|
33
43
|
|
|
34
44
|
${BottomActiveBorder} {
|
|
35
|
-
${styleFromTokens(
|
|
45
|
+
${styleFromTokens({
|
|
46
|
+
tokenMaps: markerMaps,
|
|
47
|
+
tokens: stateColors.disabled,
|
|
48
|
+
fallbackTokens: stateColors.normal
|
|
49
|
+
})}
|
|
36
50
|
opacity: 1;
|
|
37
51
|
}
|
|
38
52
|
}
|
|
@@ -24,7 +24,9 @@ const useBoxSelectionGroup = ({
|
|
|
24
24
|
newValue: newBox.value,
|
|
25
25
|
singleSelect
|
|
26
26
|
});
|
|
27
|
-
if (newSelection !== selection)
|
|
27
|
+
if (newSelection !== selection) {
|
|
28
|
+
setSelection(newSelection);
|
|
29
|
+
}
|
|
28
30
|
}, [selection, setSelection, singleSelect]);
|
|
29
31
|
const isSelected = React.useCallback((val) => (selection == null ? void 0 : selection.some((sel) => sel === val)) || false, [selection]);
|
|
30
32
|
return React.useMemo(() => ({
|
|
@@ -22,7 +22,9 @@ const useBoxSelectionGroup = ({
|
|
|
22
22
|
newValue: newBox.value,
|
|
23
23
|
singleSelect
|
|
24
24
|
});
|
|
25
|
-
if (newSelection !== selection)
|
|
25
|
+
if (newSelection !== selection) {
|
|
26
|
+
setSelection(newSelection);
|
|
27
|
+
}
|
|
26
28
|
}, [selection, setSelection, singleSelect]);
|
|
27
29
|
const isSelected = useCallback((val) => (selection == null ? void 0 : selection.some((sel) => sel === val)) || false, [selection]);
|
|
28
30
|
return useMemo(() => ({
|
|
@@ -31,7 +31,10 @@ const Button = _styled__default.default.button.withConfig({
|
|
|
31
31
|
componentId: "RedisUI__sc-6zckac-0"
|
|
32
32
|
})(["", ";gap:", ";", ";", ";", ";"], baseButtonStyle, () => redisUiStyles.useTheme().components.button.gap, ({
|
|
33
33
|
size
|
|
34
|
-
}) => css_utils.styleFromTokens(
|
|
34
|
+
}) => css_utils.styleFromTokens({
|
|
35
|
+
tokenMaps: sizeTokenMaps,
|
|
36
|
+
tokens: redisUiStyles.useTheme().components.button.sizes[size]
|
|
37
|
+
}), ({
|
|
35
38
|
size
|
|
36
39
|
}) => Body_style.useBodyStyles(size === "small" ? {
|
|
37
40
|
$size: "S"
|
|
@@ -27,7 +27,10 @@ const Button = _styled.button.withConfig({
|
|
|
27
27
|
componentId: "RedisUI__sc-6zckac-0"
|
|
28
28
|
})(["", ";gap:", ";", ";", ";", ";"], baseButtonStyle, () => useTheme().components.button.gap, ({
|
|
29
29
|
size
|
|
30
|
-
}) => styleFromTokens(
|
|
30
|
+
}) => styleFromTokens({
|
|
31
|
+
tokenMaps: sizeTokenMaps,
|
|
32
|
+
tokens: useTheme().components.button.sizes[size]
|
|
33
|
+
}), ({
|
|
31
34
|
size
|
|
32
35
|
}) => useBodyStyles(size === "small" ? {
|
|
33
36
|
$size: "S"
|
|
@@ -6,7 +6,22 @@ const bgColorMap = css_utils.tokenMaps.bgColor;
|
|
|
6
6
|
const textColorMap = css_utils.tokenMaps.textColor;
|
|
7
7
|
const shadowBorderMap = css_utils.tokenMaps.shadowBorder;
|
|
8
8
|
const borderColorMap = css_utils.tokenMaps.borderColor;
|
|
9
|
-
const getButtonStatesStyle = (theme, maps) => theme ? _styled.css(["&{", "}&:hover{", "}&:active{", "}&[disabled],&:disabled{", "}"], css_utils.styleFromTokens(
|
|
9
|
+
const getButtonStatesStyle = (theme, maps) => theme ? _styled.css(["&{", "}&:hover{", "}&:active{", "}&[disabled],&:disabled{", "}"], css_utils.styleFromTokens({
|
|
10
|
+
tokenMaps: maps,
|
|
11
|
+
tokens: theme.normal
|
|
12
|
+
}), css_utils.styleFromTokens({
|
|
13
|
+
tokenMaps: maps,
|
|
14
|
+
tokens: theme.hover,
|
|
15
|
+
fallbackTokens: theme.normal
|
|
16
|
+
}), css_utils.styleFromTokens({
|
|
17
|
+
tokenMaps: maps,
|
|
18
|
+
tokens: theme.active,
|
|
19
|
+
fallbackTokens: theme.normal
|
|
20
|
+
}), css_utils.styleFromTokens({
|
|
21
|
+
tokenMaps: maps,
|
|
22
|
+
tokens: theme.disabled,
|
|
23
|
+
fallbackTokens: theme.normal
|
|
24
|
+
})) : null;
|
|
10
25
|
exports.bgColorMap = bgColorMap;
|
|
11
26
|
exports.borderColorMap = borderColorMap;
|
|
12
27
|
exports.getButtonStatesStyle = getButtonStatesStyle;
|
|
@@ -4,7 +4,22 @@ const bgColorMap = tokenMaps.bgColor;
|
|
|
4
4
|
const textColorMap = tokenMaps.textColor;
|
|
5
5
|
const shadowBorderMap = tokenMaps.shadowBorder;
|
|
6
6
|
const borderColorMap = tokenMaps.borderColor;
|
|
7
|
-
const getButtonStatesStyle = (theme, maps) => theme ? css(["&{", "}&:hover{", "}&:active{", "}&[disabled],&:disabled{", "}"], styleFromTokens(
|
|
7
|
+
const getButtonStatesStyle = (theme, maps) => theme ? css(["&{", "}&:hover{", "}&:active{", "}&[disabled],&:disabled{", "}"], styleFromTokens({
|
|
8
|
+
tokenMaps: maps,
|
|
9
|
+
tokens: theme.normal
|
|
10
|
+
}), styleFromTokens({
|
|
11
|
+
tokenMaps: maps,
|
|
12
|
+
tokens: theme.hover,
|
|
13
|
+
fallbackTokens: theme.normal
|
|
14
|
+
}), styleFromTokens({
|
|
15
|
+
tokenMaps: maps,
|
|
16
|
+
tokens: theme.active,
|
|
17
|
+
fallbackTokens: theme.normal
|
|
18
|
+
}), styleFromTokens({
|
|
19
|
+
tokenMaps: maps,
|
|
20
|
+
tokens: theme.disabled,
|
|
21
|
+
fallbackTokens: theme.normal
|
|
22
|
+
})) : null;
|
|
8
23
|
export {
|
|
9
24
|
bgColorMap,
|
|
10
25
|
borderColorMap,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const buttonSizes = ["large", "medium", "small"];
|
|
4
|
-
const buttonVariants = ["primary", "destructive", "secondary-fill", "secondary-invert", "secondary-ghost", "upsell"];
|
|
4
|
+
const buttonVariants = ["primary", "destructive", "secondary-fill", "secondary-invert", "secondary-ghost", "upsell", "upsell-invert", "upsell-ghost"];
|
|
5
5
|
exports.buttonSizes = buttonSizes;
|
|
6
6
|
exports.buttonVariants = buttonVariants;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { ButtonHTMLAttributes } from 'react';
|
|
2
2
|
import { Theme } from '@redislabsdev/redis-ui-styles';
|
|
3
3
|
export declare const buttonSizes: readonly ["large", "medium", "small"];
|
|
4
|
-
export declare const buttonVariants: readonly ["primary", "destructive", "secondary-fill", "secondary-invert", "secondary-ghost", "upsell"];
|
|
4
|
+
export declare const buttonVariants: readonly ["primary", "destructive", "secondary-fill", "secondary-invert", "secondary-ghost", "upsell", "upsell-invert", "upsell-ghost"];
|
|
5
5
|
export type ButtonSizes = (typeof buttonSizes)[number];
|
|
6
6
|
export type ButtonVariants = (typeof buttonVariants)[number];
|
|
7
7
|
export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const buttonSizes = ["large", "medium", "small"];
|
|
2
|
-
const buttonVariants = ["primary", "destructive", "secondary-fill", "secondary-invert", "secondary-ghost", "upsell"];
|
|
2
|
+
const buttonVariants = ["primary", "destructive", "secondary-fill", "secondary-invert", "secondary-ghost", "upsell", "upsell-invert", "upsell-ghost"];
|
|
3
3
|
export {
|
|
4
4
|
buttonSizes,
|
|
5
5
|
buttonVariants
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
+
const jsxRuntime = require("../../node_modules/react/jsx-runtime.cjs");
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const redisUiIcons = require("@redislabsdev/redis-ui-icons");
|
|
6
|
+
const CopyToClipboardButton_style = require("./CopyToClipboardButton.style.cjs");
|
|
7
|
+
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
8
|
+
const React__default = /* @__PURE__ */ _interopDefault(React);
|
|
9
|
+
const COPIED_STATE_DURATION = 1500;
|
|
10
|
+
const CopyToClipboardButton = React__default.default.forwardRef(({
|
|
11
|
+
textToCopy,
|
|
12
|
+
copiedLabel,
|
|
13
|
+
...restProps
|
|
14
|
+
}, ref) => {
|
|
15
|
+
const [isCopied, setIsCopied] = React.useState(false);
|
|
16
|
+
const timeoutRef = React.useRef();
|
|
17
|
+
React.useEffect(() => {
|
|
18
|
+
return () => {
|
|
19
|
+
if (timeoutRef.current) {
|
|
20
|
+
clearTimeout(timeoutRef.current);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
}, []);
|
|
24
|
+
const handleClick = React.useCallback(async () => {
|
|
25
|
+
try {
|
|
26
|
+
await navigator.clipboard.writeText(textToCopy);
|
|
27
|
+
setIsCopied(true);
|
|
28
|
+
if (timeoutRef.current) {
|
|
29
|
+
clearTimeout(timeoutRef.current);
|
|
30
|
+
}
|
|
31
|
+
timeoutRef.current = setTimeout(() => {
|
|
32
|
+
setIsCopied(false);
|
|
33
|
+
}, COPIED_STATE_DURATION);
|
|
34
|
+
} catch {
|
|
35
|
+
}
|
|
36
|
+
}, [textToCopy]);
|
|
37
|
+
const ariaLabel = isCopied && copiedLabel ? copiedLabel : restProps["aria-label"] || "Copy";
|
|
38
|
+
return jsxRuntime.jsxRuntimeExports.jsxs(CopyToClipboardButton_style.CopyToClipboardWrapper, {
|
|
39
|
+
children: [jsxRuntime.jsxRuntimeExports.jsx(CopyToClipboardButton_style.CopyToClipboardButton, {
|
|
40
|
+
type: "button",
|
|
41
|
+
ref,
|
|
42
|
+
onClick: handleClick,
|
|
43
|
+
"$isCopied": isCopied,
|
|
44
|
+
...restProps,
|
|
45
|
+
"aria-label": ariaLabel,
|
|
46
|
+
children: isCopied ? jsxRuntime.jsxRuntimeExports.jsx(redisUiIcons.ToastCheckIcon, {
|
|
47
|
+
size: "L",
|
|
48
|
+
"aria-hidden": true
|
|
49
|
+
}) : jsxRuntime.jsxRuntimeExports.jsx(redisUiIcons.CopyIcon, {
|
|
50
|
+
size: "L",
|
|
51
|
+
"aria-hidden": true
|
|
52
|
+
})
|
|
53
|
+
}), isCopied && copiedLabel && jsxRuntime.jsxRuntimeExports.jsx(CopyToClipboardButton_style.CopiedLabel, {
|
|
54
|
+
children: copiedLabel
|
|
55
|
+
})]
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
const CopyToClipboardButton$1 = CopyToClipboardButton;
|
|
59
|
+
exports.default = CopyToClipboardButton$1;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CopyToClipboardButtonProps } from './CopyToClipboardButton.types';
|
|
3
|
+
declare const CopyToClipboardButton: React.ForwardRefExoticComponent<CopyToClipboardButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
4
|
+
export default CopyToClipboardButton;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { j as jsxRuntimeExports } from "../../node_modules/react/jsx-runtime.js";
|
|
2
|
+
import React__default, { useState, useRef, useEffect, useCallback } from "react";
|
|
3
|
+
import { ToastCheckIcon, CopyIcon } from "@redislabsdev/redis-ui-icons";
|
|
4
|
+
import { CopyToClipboardWrapper, CopyToClipboardButton as CopyToClipboardButton$2, CopiedLabel } from "./CopyToClipboardButton.style.js";
|
|
5
|
+
const COPIED_STATE_DURATION = 1500;
|
|
6
|
+
const CopyToClipboardButton = React__default.forwardRef(({
|
|
7
|
+
textToCopy,
|
|
8
|
+
copiedLabel,
|
|
9
|
+
...restProps
|
|
10
|
+
}, ref) => {
|
|
11
|
+
const [isCopied, setIsCopied] = useState(false);
|
|
12
|
+
const timeoutRef = useRef();
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
return () => {
|
|
15
|
+
if (timeoutRef.current) {
|
|
16
|
+
clearTimeout(timeoutRef.current);
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
}, []);
|
|
20
|
+
const handleClick = useCallback(async () => {
|
|
21
|
+
try {
|
|
22
|
+
await navigator.clipboard.writeText(textToCopy);
|
|
23
|
+
setIsCopied(true);
|
|
24
|
+
if (timeoutRef.current) {
|
|
25
|
+
clearTimeout(timeoutRef.current);
|
|
26
|
+
}
|
|
27
|
+
timeoutRef.current = setTimeout(() => {
|
|
28
|
+
setIsCopied(false);
|
|
29
|
+
}, COPIED_STATE_DURATION);
|
|
30
|
+
} catch {
|
|
31
|
+
}
|
|
32
|
+
}, [textToCopy]);
|
|
33
|
+
const ariaLabel = isCopied && copiedLabel ? copiedLabel : restProps["aria-label"] || "Copy";
|
|
34
|
+
return jsxRuntimeExports.jsxs(CopyToClipboardWrapper, {
|
|
35
|
+
children: [jsxRuntimeExports.jsx(CopyToClipboardButton$2, {
|
|
36
|
+
type: "button",
|
|
37
|
+
ref,
|
|
38
|
+
onClick: handleClick,
|
|
39
|
+
"$isCopied": isCopied,
|
|
40
|
+
...restProps,
|
|
41
|
+
"aria-label": ariaLabel,
|
|
42
|
+
children: isCopied ? jsxRuntimeExports.jsx(ToastCheckIcon, {
|
|
43
|
+
size: "L",
|
|
44
|
+
"aria-hidden": true
|
|
45
|
+
}) : jsxRuntimeExports.jsx(CopyIcon, {
|
|
46
|
+
size: "L",
|
|
47
|
+
"aria-hidden": true
|
|
48
|
+
})
|
|
49
|
+
}), isCopied && copiedLabel && jsxRuntimeExports.jsx(CopiedLabel, {
|
|
50
|
+
children: copiedLabel
|
|
51
|
+
})]
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
const CopyToClipboardButton$1 = CopyToClipboardButton;
|
|
55
|
+
export {
|
|
56
|
+
CopyToClipboardButton$1 as default
|
|
57
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const _styled = require("styled-components");
|
|
4
|
+
const redisUiStyles = require("@redislabsdev/redis-ui-styles");
|
|
5
|
+
const Typography = require("../../Typography/Typography.cjs");
|
|
6
|
+
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
7
|
+
const _styled__default = /* @__PURE__ */ _interopDefault(_styled);
|
|
8
|
+
const CopyToClipboardWrapper = _styled__default.default.div.withConfig({
|
|
9
|
+
displayName: "CopyToClipboardButtonstyle__CopyToClipboardWrapper",
|
|
10
|
+
componentId: "RedisUI__sc-1qz6i4k-0"
|
|
11
|
+
})(["display:inline-flex;align-items:center;gap:", ";"], () => redisUiStyles.useTheme().core.space.space050);
|
|
12
|
+
const CopyToClipboardButton = _styled__default.default.button.withConfig({
|
|
13
|
+
displayName: "CopyToClipboardButtonstyle__CopyToClipboardButton",
|
|
14
|
+
componentId: "RedisUI__sc-1qz6i4k-1"
|
|
15
|
+
})(["display:inline-flex;align-items:center;justify-content:center;padding:0;border:none;background:transparent;cursor:pointer;border-radius:", ";color:", ";&:hover:not(:disabled){background-color:", ";}&:active:not(:disabled){background-color:", ";}&:disabled{cursor:not-allowed;color:", ";}", ""], () => redisUiStyles.useTheme().components.iconButton.borderRadius, ({
|
|
16
|
+
$isCopied
|
|
17
|
+
}) => {
|
|
18
|
+
var _a, _b;
|
|
19
|
+
const theme = redisUiStyles.useTheme();
|
|
20
|
+
return $isCopied ? theme.semantic.color.icon.success500 : (_b = (_a = theme.components.iconButton.states) == null ? void 0 : _a.normal) == null ? void 0 : _b.textColor;
|
|
21
|
+
}, () => {
|
|
22
|
+
var _a, _b;
|
|
23
|
+
return (_b = (_a = redisUiStyles.useTheme().components.iconButton.states) == null ? void 0 : _a.hover) == null ? void 0 : _b.bgColor;
|
|
24
|
+
}, () => {
|
|
25
|
+
var _a, _b;
|
|
26
|
+
return (_b = (_a = redisUiStyles.useTheme().components.iconButton.states) == null ? void 0 : _a.active) == null ? void 0 : _b.bgColor;
|
|
27
|
+
}, () => {
|
|
28
|
+
var _a, _b;
|
|
29
|
+
return (_b = (_a = redisUiStyles.useTheme().components.iconButton.states) == null ? void 0 : _a.disabled) == null ? void 0 : _b.textColor;
|
|
30
|
+
}, redisUiStyles.getFocusStyle());
|
|
31
|
+
const CopiedLabel = _styled__default.default(Typography.default.Body).attrs({
|
|
32
|
+
component: "span",
|
|
33
|
+
size: "S"
|
|
34
|
+
}).withConfig({
|
|
35
|
+
displayName: "CopyToClipboardButtonstyle__CopiedLabel",
|
|
36
|
+
componentId: "RedisUI__sc-1qz6i4k-2"
|
|
37
|
+
})(["color:", ";"], () => redisUiStyles.useTheme().semantic.color.text.success500);
|
|
38
|
+
exports.CopiedLabel = CopiedLabel;
|
|
39
|
+
exports.CopyToClipboardButton = CopyToClipboardButton;
|
|
40
|
+
exports.CopyToClipboardWrapper = CopyToClipboardWrapper;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const CopyToClipboardWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
|
+
export declare const CopyToClipboardButton: import("styled-components").StyledComponent<"button", any, {
|
|
3
|
+
$isCopied?: boolean;
|
|
4
|
+
}, never>;
|
|
5
|
+
export declare const CopiedLabel: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../../Typography").TypographyBodyProps & import("react").RefAttributes<HTMLElement>>, any, {
|
|
6
|
+
component: "span";
|
|
7
|
+
size: "S";
|
|
8
|
+
}, "size" | "component">;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import _styled from "styled-components";
|
|
2
|
+
import { useTheme, getFocusStyle } from "@redislabsdev/redis-ui-styles";
|
|
3
|
+
import Typography from "../../Typography/Typography.js";
|
|
4
|
+
const CopyToClipboardWrapper = _styled.div.withConfig({
|
|
5
|
+
displayName: "CopyToClipboardButtonstyle__CopyToClipboardWrapper",
|
|
6
|
+
componentId: "RedisUI__sc-1qz6i4k-0"
|
|
7
|
+
})(["display:inline-flex;align-items:center;gap:", ";"], () => useTheme().core.space.space050);
|
|
8
|
+
const CopyToClipboardButton = _styled.button.withConfig({
|
|
9
|
+
displayName: "CopyToClipboardButtonstyle__CopyToClipboardButton",
|
|
10
|
+
componentId: "RedisUI__sc-1qz6i4k-1"
|
|
11
|
+
})(["display:inline-flex;align-items:center;justify-content:center;padding:0;border:none;background:transparent;cursor:pointer;border-radius:", ";color:", ";&:hover:not(:disabled){background-color:", ";}&:active:not(:disabled){background-color:", ";}&:disabled{cursor:not-allowed;color:", ";}", ""], () => useTheme().components.iconButton.borderRadius, ({
|
|
12
|
+
$isCopied
|
|
13
|
+
}) => {
|
|
14
|
+
var _a, _b;
|
|
15
|
+
const theme = useTheme();
|
|
16
|
+
return $isCopied ? theme.semantic.color.icon.success500 : (_b = (_a = theme.components.iconButton.states) == null ? void 0 : _a.normal) == null ? void 0 : _b.textColor;
|
|
17
|
+
}, () => {
|
|
18
|
+
var _a, _b;
|
|
19
|
+
return (_b = (_a = useTheme().components.iconButton.states) == null ? void 0 : _a.hover) == null ? void 0 : _b.bgColor;
|
|
20
|
+
}, () => {
|
|
21
|
+
var _a, _b;
|
|
22
|
+
return (_b = (_a = useTheme().components.iconButton.states) == null ? void 0 : _a.active) == null ? void 0 : _b.bgColor;
|
|
23
|
+
}, () => {
|
|
24
|
+
var _a, _b;
|
|
25
|
+
return (_b = (_a = useTheme().components.iconButton.states) == null ? void 0 : _a.disabled) == null ? void 0 : _b.textColor;
|
|
26
|
+
}, getFocusStyle());
|
|
27
|
+
const CopiedLabel = _styled(Typography.Body).attrs({
|
|
28
|
+
component: "span",
|
|
29
|
+
size: "S"
|
|
30
|
+
}).withConfig({
|
|
31
|
+
displayName: "CopyToClipboardButtonstyle__CopiedLabel",
|
|
32
|
+
componentId: "RedisUI__sc-1qz6i4k-2"
|
|
33
|
+
})(["color:", ";"], () => useTheme().semantic.color.text.success500);
|
|
34
|
+
export {
|
|
35
|
+
CopiedLabel,
|
|
36
|
+
CopyToClipboardButton,
|
|
37
|
+
CopyToClipboardWrapper
|
|
38
|
+
};
|
|
@@ -25,7 +25,10 @@ const TextButton = _styled__default.default.button.withConfig({
|
|
|
25
25
|
variant
|
|
26
26
|
}) => {
|
|
27
27
|
const layout = variant.includes("inline") ? "inline" : "block";
|
|
28
|
-
return css_utils.styleFromTokens(
|
|
28
|
+
return css_utils.styleFromTokens({
|
|
29
|
+
tokenMaps: sizeTokenMaps,
|
|
30
|
+
tokens: redisUiStyles.useTheme().components.textButton.layouts[layout].sizes[size]
|
|
31
|
+
});
|
|
29
32
|
}, ({
|
|
30
33
|
size
|
|
31
34
|
}) => Body_style.useBodyStyles({
|
|
@@ -21,7 +21,10 @@ const TextButton = _styled.button.withConfig({
|
|
|
21
21
|
variant
|
|
22
22
|
}) => {
|
|
23
23
|
const layout = variant.includes("inline") ? "inline" : "block";
|
|
24
|
-
return styleFromTokens(
|
|
24
|
+
return styleFromTokens({
|
|
25
|
+
tokenMaps: sizeTokenMaps,
|
|
26
|
+
tokens: useTheme().components.textButton.layouts[layout].sizes[size]
|
|
27
|
+
});
|
|
25
28
|
}, ({
|
|
26
29
|
size
|
|
27
30
|
}) => useBodyStyles({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const textButtonVariants = ["primary", "destructive", "primary-inline", "destructive-inline"];
|
|
3
|
+
const textButtonVariants = ["primary", "destructive", "secondary", "upsell", "primary-inline", "destructive-inline", "secondary-inline", "upsell-inline"];
|
|
4
4
|
exports.textButtonVariants = textButtonVariants;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ButtonHTMLAttributes } from 'react';
|
|
2
2
|
export type TextButtonSizes = 'medium' | 'small';
|
|
3
|
-
export declare const textButtonVariants: readonly ["primary", "destructive", "primary-inline", "destructive-inline"];
|
|
3
|
+
export declare const textButtonVariants: readonly ["primary", "destructive", "secondary", "upsell", "primary-inline", "destructive-inline", "secondary-inline", "upsell-inline"];
|
|
4
4
|
export type TextButtonVariants = (typeof textButtonVariants)[number];
|
|
5
5
|
export interface TextButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
6
6
|
size?: TextButtonSizes;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const textButtonVariants = ["primary", "destructive", "primary-inline", "destructive-inline"];
|
|
1
|
+
const textButtonVariants = ["primary", "destructive", "secondary", "upsell", "primary-inline", "destructive-inline", "secondary-inline", "upsell-inline"];
|
|
2
2
|
export {
|
|
3
3
|
textButtonVariants
|
|
4
4
|
};
|
package/dist/Button/index.d.ts
CHANGED
|
@@ -13,3 +13,5 @@ export * as ActionButtonWithIconStyles from './ActionIconButton/ActionIconButton
|
|
|
13
13
|
export { default as ToggleButton } from './ToggleButton/ToggleButton';
|
|
14
14
|
export * from './ToggleButton/ToggleButton.types';
|
|
15
15
|
export * as ToggleButtonStyles from './ToggleButton/ToggleButton.style';
|
|
16
|
+
export { default as CopyToClipboardButton } from './CopyToClipboardButton/CopyToClipboardButton';
|
|
17
|
+
export * from './CopyToClipboardButton/CopyToClipboardButton.types';
|
|
@@ -11,8 +11,16 @@ const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
|
11
11
|
const _styled__default = /* @__PURE__ */ _interopDefault(_styled);
|
|
12
12
|
const maps = [Button_style_utils.textColorMap];
|
|
13
13
|
const getStateStyles = (tokens) => {
|
|
14
|
-
const getLabelStateSelector = (state, stateTokens, fallbackTokens) => `${css_utils.getRelatedStateSelector(
|
|
15
|
-
|
|
14
|
+
const getLabelStateSelector = (state, stateTokens, fallbackTokens) => `${css_utils.getRelatedStateSelector({
|
|
15
|
+
inputSelector: Indicator_style.CheckboxIndicator,
|
|
16
|
+
inputStateSelector: state,
|
|
17
|
+
commonContainer: Compose_style.CheckboxCompose
|
|
18
|
+
})} {
|
|
19
|
+
${css_utils.styleFromTokens({
|
|
20
|
+
tokenMaps: maps,
|
|
21
|
+
tokens: stateTokens,
|
|
22
|
+
fallbackTokens
|
|
23
|
+
})};
|
|
16
24
|
}`;
|
|
17
25
|
return _styled.css`
|
|
18
26
|
${getLabelStateSelector("", tokens.normal)};
|
|
@@ -20,7 +28,11 @@ const getStateStyles = (tokens) => {
|
|
|
20
28
|
${getLabelStateSelector(":active", tokens.active, tokens.normal)};
|
|
21
29
|
${getLabelStateSelector(":disabled", tokens.disabled)};
|
|
22
30
|
|
|
23
|
-
${css_utils.getRelatedStateSelector(
|
|
31
|
+
${css_utils.getRelatedStateSelector({
|
|
32
|
+
inputSelector: Indicator_style.CheckboxIndicator,
|
|
33
|
+
inputStateSelector: ":disabled",
|
|
34
|
+
commonContainer: Compose_style.CheckboxCompose
|
|
35
|
+
})} {
|
|
24
36
|
pointer-events: none;
|
|
25
37
|
}
|
|
26
38
|
`;
|