@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
|
@@ -15,7 +15,9 @@ const Compose = ({
|
|
|
15
15
|
setValue,
|
|
16
16
|
disabled
|
|
17
17
|
} = Slider_context.useSliderContext();
|
|
18
|
-
if (offset === void 0)
|
|
18
|
+
if (offset === void 0) {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
19
21
|
const handleClick = () => {
|
|
20
22
|
if (clickable && !disabled) {
|
|
21
23
|
setValue([value]);
|
|
@@ -14,7 +14,9 @@ const Compose = ({
|
|
|
14
14
|
disabled
|
|
15
15
|
} = Slider_context.useSliderContext();
|
|
16
16
|
const offset = useOffset.useOffset(value);
|
|
17
|
-
if (offset === void 0)
|
|
17
|
+
if (offset === void 0) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
18
20
|
const isInRange = sliderValue[0] >= value;
|
|
19
21
|
return jsxRuntime.jsxRuntimeExports.jsx(Compose_style.SliderMarkCompose, {
|
|
20
22
|
"$offset": offset,
|
|
@@ -12,7 +12,9 @@ const Compose = ({
|
|
|
12
12
|
disabled
|
|
13
13
|
} = useSliderContext();
|
|
14
14
|
const offset = useOffset(value);
|
|
15
|
-
if (offset === void 0)
|
|
15
|
+
if (offset === void 0) {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
16
18
|
const isInRange = sliderValue[0] >= value;
|
|
17
19
|
return jsxRuntimeExports.jsx(SliderMarkCompose, {
|
|
18
20
|
"$offset": offset,
|
|
@@ -6,7 +6,9 @@ const useOffset = (value) => {
|
|
|
6
6
|
min,
|
|
7
7
|
max
|
|
8
8
|
} = Slider_context.useSliderContext();
|
|
9
|
-
if (min > value || value > max)
|
|
9
|
+
if (min > value || value > max) {
|
|
10
|
+
return void 0;
|
|
11
|
+
}
|
|
10
12
|
const range = max - min;
|
|
11
13
|
return range > 0 ? (value - min) / range * 100 : 0;
|
|
12
14
|
};
|
|
@@ -4,7 +4,9 @@ const useOffset = (value) => {
|
|
|
4
4
|
min,
|
|
5
5
|
max
|
|
6
6
|
} = useSliderContext();
|
|
7
|
-
if (min > value || value > max)
|
|
7
|
+
if (min > value || value > max) {
|
|
8
|
+
return void 0;
|
|
9
|
+
}
|
|
8
10
|
const range = max - min;
|
|
9
11
|
return range > 0 ? (value - min) / range * 100 : 0;
|
|
10
12
|
};
|
package/dist/Stepper/Stepper.cjs
CHANGED
|
@@ -1,21 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
3
|
const jsxRuntime = require("../node_modules/react/jsx-runtime.cjs");
|
|
4
|
+
const React = require("react");
|
|
4
5
|
const Step = require("./components/Step/Step.cjs");
|
|
5
6
|
const Compose = require("./components/Compose/Compose.cjs");
|
|
7
|
+
const Stepper_utils = require("./Stepper.utils.cjs");
|
|
6
8
|
const Stepper = Object.assign(({
|
|
7
9
|
steps,
|
|
8
10
|
...restProps
|
|
9
11
|
}) => {
|
|
12
|
+
const {
|
|
13
|
+
currentStep = -1
|
|
14
|
+
} = restProps;
|
|
10
15
|
return jsxRuntime.jsxRuntimeExports.jsx(Stepper.Compose, {
|
|
11
16
|
...restProps,
|
|
12
17
|
children: steps.map((step, idx) => (
|
|
13
18
|
// eslint-disable-next-line react/no-array-index-key
|
|
14
|
-
jsxRuntime.jsxRuntimeExports.jsxs(
|
|
15
|
-
children: [jsxRuntime.jsxRuntimeExports.jsx(Step.default.
|
|
16
|
-
|
|
17
|
-
}), jsxRuntime.jsxRuntimeExports.
|
|
18
|
-
children:
|
|
19
|
+
jsxRuntime.jsxRuntimeExports.jsxs(React.Fragment, {
|
|
20
|
+
children: [idx > 0 && jsxRuntime.jsxRuntimeExports.jsx(Step.default.Separator, {
|
|
21
|
+
state: Stepper_utils.getStepState(idx, currentStep)
|
|
22
|
+
}), jsxRuntime.jsxRuntimeExports.jsxs(Step.default.Compose, {
|
|
23
|
+
children: [jsxRuntime.jsxRuntimeExports.jsx(Step.default.Icon, {
|
|
24
|
+
children: step.icon
|
|
25
|
+
}), jsxRuntime.jsxRuntimeExports.jsx(Step.default.Label, {
|
|
26
|
+
children: step.label
|
|
27
|
+
})]
|
|
19
28
|
})]
|
|
20
29
|
}, idx)
|
|
21
30
|
))
|
|
@@ -4,6 +4,7 @@ declare const Stepper: (({ steps, ...restProps }: StepperProps) => import("react
|
|
|
4
4
|
Compose: ({ onClick, ...restProps }: import("./components/Step/components/Compose/Compose.types").ComposeProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
5
5
|
Icon: ({ children, ...restProps }: import("./components/Step/components/Icon/Icon.types").IconProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
Label: ({ children, ...restProps }: import("./components/Step/components/Label/Label.types").LabelProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
7
|
+
Separator: ({ state, ...restProps }: import("./components/Step/components/Separator/Separator.types").SeparatorProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
8
|
useStepContext: () => import(".").StepperStepContextType;
|
|
8
9
|
};
|
|
9
10
|
Compose: (({ currentStep, getIsStepInteractive, onStepChange, onKeyDown, ...restProps }: import("./components/Compose/Compose.types").StepperComposeProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
@@ -11,6 +12,7 @@ declare const Stepper: (({ steps, ...restProps }: StepperProps) => import("react
|
|
|
11
12
|
Compose: ({ onClick, ...restProps }: import("./components/Step/components/Compose/Compose.types").ComposeProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
12
13
|
Icon: ({ children, ...restProps }: import("./components/Step/components/Icon/Icon.types").IconProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
14
|
Label: ({ children, ...restProps }: import("./components/Step/components/Label/Label.types").LabelProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
15
|
+
Separator: ({ state, ...restProps }: import("./components/Step/components/Separator/Separator.types").SeparatorProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
16
|
useStepContext: () => import(".").StepperStepContextType;
|
|
15
17
|
};
|
|
16
18
|
};
|
package/dist/Stepper/Stepper.js
CHANGED
|
@@ -1,19 +1,28 @@
|
|
|
1
1
|
import { j as jsxRuntimeExports } from "../node_modules/react/jsx-runtime.js";
|
|
2
|
+
import { Fragment } from "react";
|
|
2
3
|
import Step from "./components/Step/Step.js";
|
|
3
4
|
import StepperCompose from "./components/Compose/Compose.js";
|
|
5
|
+
import { getStepState } from "./Stepper.utils.js";
|
|
4
6
|
const Stepper = Object.assign(({
|
|
5
7
|
steps,
|
|
6
8
|
...restProps
|
|
7
9
|
}) => {
|
|
10
|
+
const {
|
|
11
|
+
currentStep = -1
|
|
12
|
+
} = restProps;
|
|
8
13
|
return jsxRuntimeExports.jsx(Stepper.Compose, {
|
|
9
14
|
...restProps,
|
|
10
15
|
children: steps.map((step, idx) => (
|
|
11
16
|
// eslint-disable-next-line react/no-array-index-key
|
|
12
|
-
jsxRuntimeExports.jsxs(
|
|
13
|
-
children: [jsxRuntimeExports.jsx(Step.
|
|
14
|
-
|
|
15
|
-
}), jsxRuntimeExports.
|
|
16
|
-
children:
|
|
17
|
+
jsxRuntimeExports.jsxs(Fragment, {
|
|
18
|
+
children: [idx > 0 && jsxRuntimeExports.jsx(Step.Separator, {
|
|
19
|
+
state: getStepState(idx, currentStep)
|
|
20
|
+
}), jsxRuntimeExports.jsxs(Step.Compose, {
|
|
21
|
+
children: [jsxRuntimeExports.jsx(Step.Icon, {
|
|
22
|
+
children: step.icon
|
|
23
|
+
}), jsxRuntimeExports.jsx(Step.Label, {
|
|
24
|
+
children: step.label
|
|
25
|
+
})]
|
|
17
26
|
})]
|
|
18
27
|
}, idx)
|
|
19
28
|
))
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const getStepState = (idx, currentStep) => {
|
|
4
|
+
if (idx < currentStep) {
|
|
5
|
+
return "completed";
|
|
6
|
+
}
|
|
7
|
+
if (idx === currentStep) {
|
|
8
|
+
return "focused";
|
|
9
|
+
}
|
|
10
|
+
return "idle";
|
|
11
|
+
};
|
|
12
|
+
exports.getStepState = getStepState;
|
|
@@ -4,6 +4,7 @@ declare const StepperCompose: (({ currentStep, getIsStepInteractive, onStepChang
|
|
|
4
4
|
Compose: ({ onClick, ...restProps }: import("../Step/components/Compose/Compose.types").ComposeProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
5
5
|
Icon: ({ children, ...restProps }: import("../Step/components/Icon/Icon.types").IconProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
Label: ({ children, ...restProps }: import("../Step/components/Label/Label.types").LabelProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
7
|
+
Separator: ({ state, ...restProps }: import("../Step/components/Separator/Separator.types").SeparatorProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
8
|
useStepContext: () => import("../..").StepperStepContextType;
|
|
8
9
|
};
|
|
9
10
|
};
|
|
@@ -4,6 +4,7 @@ const jsxRuntime = require("../../../node_modules/react/jsx-runtime.cjs");
|
|
|
4
4
|
const Compose = require("./components/Compose/Compose.cjs");
|
|
5
5
|
const Icon = require("./components/Icon/Icon.cjs");
|
|
6
6
|
const Label = require("./components/Label/Label.cjs");
|
|
7
|
+
const Separator = require("./components/Separator/Separator.cjs");
|
|
7
8
|
const Step_context = require("./Step.context.cjs");
|
|
8
9
|
const Step = Object.assign(({
|
|
9
10
|
children,
|
|
@@ -17,6 +18,7 @@ const Step = Object.assign(({
|
|
|
17
18
|
Compose: Compose.default,
|
|
18
19
|
Icon: Icon.default,
|
|
19
20
|
Label: Label.default,
|
|
21
|
+
Separator: Separator.default,
|
|
20
22
|
useStepContext: Step_context.useStepContext
|
|
21
23
|
});
|
|
22
24
|
exports.default = Step;
|
|
@@ -3,6 +3,7 @@ declare const Step: (({ children, ...restProps }: StepperStepProps) => import("r
|
|
|
3
3
|
Compose: ({ onClick, ...restProps }: import("./components/Compose/Compose.types").ComposeProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
4
4
|
Icon: ({ children, ...restProps }: import("./components/Icon/Icon.types").IconProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
Label: ({ children, ...restProps }: import("./components/Label/Label.types").LabelProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
6
|
+
Separator: ({ state, ...restProps }: import("./components/Separator/Separator.types").SeparatorProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
7
|
useStepContext: () => import("./Step.types").StepperStepContextType;
|
|
7
8
|
};
|
|
8
9
|
export default Step;
|
|
@@ -2,6 +2,7 @@ import { j as jsxRuntimeExports } from "../../../node_modules/react/jsx-runtime.
|
|
|
2
2
|
import Compose from "./components/Compose/Compose.js";
|
|
3
3
|
import Icon from "./components/Icon/Icon.js";
|
|
4
4
|
import Label from "./components/Label/Label.js";
|
|
5
|
+
import Separator from "./components/Separator/Separator.js";
|
|
5
6
|
import { useStepContext } from "./Step.context.js";
|
|
6
7
|
const Step = Object.assign(({
|
|
7
8
|
children,
|
|
@@ -15,6 +16,7 @@ const Step = Object.assign(({
|
|
|
15
16
|
Compose,
|
|
16
17
|
Icon,
|
|
17
18
|
Label,
|
|
19
|
+
Separator,
|
|
18
20
|
useStepContext
|
|
19
21
|
});
|
|
20
22
|
export {
|
|
@@ -3,11 +3,11 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
|
|
|
3
3
|
const jsxRuntime = require("../../../../../node_modules/react/jsx-runtime.cjs");
|
|
4
4
|
const React = require("react");
|
|
5
5
|
const Step_context = require("../../Step.context.cjs");
|
|
6
|
-
const Step_types = require("../../Step.types.cjs");
|
|
7
6
|
const useStepRegistration = require("../../../../hooks/useStepRegistration.cjs");
|
|
8
7
|
const Stepper_context = require("../../../../Stepper.context.cjs");
|
|
9
8
|
const Compose_style = require("./Compose.style.cjs");
|
|
10
9
|
const useStepperInteractive = require("../../../../hooks/useStepperInteractive.cjs");
|
|
10
|
+
const Stepper_utils = require("../../../../Stepper.utils.cjs");
|
|
11
11
|
const Compose = ({
|
|
12
12
|
onClick,
|
|
13
13
|
...restProps
|
|
@@ -20,19 +20,14 @@ const Compose = ({
|
|
|
20
20
|
const {
|
|
21
21
|
stepIndex
|
|
22
22
|
} = useStepRegistration.useStepRegistration();
|
|
23
|
-
|
|
24
|
-
if (stepIndex >= 0) {
|
|
25
|
-
if (stepIndex < currentStep) {
|
|
26
|
-
state = Step_types.StepperStepState.COMPLETED;
|
|
27
|
-
} else if (stepIndex === currentStep) {
|
|
28
|
-
state = Step_types.StepperStepState.FOCUSED;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
23
|
+
const state = stepIndex >= 0 ? Stepper_utils.getStepState(stepIndex, currentStep) : "idle";
|
|
31
24
|
const contextValue = React.useMemo(() => ({
|
|
32
25
|
state,
|
|
33
26
|
index: stepIndex
|
|
34
27
|
}), [state, stepIndex]);
|
|
35
|
-
if (stepIndex < 0)
|
|
28
|
+
if (stepIndex < 0) {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
36
31
|
const interactiveProps = useStepperInteractive.getInteractiveStepProps({
|
|
37
32
|
onStepChange,
|
|
38
33
|
getIsStepInteractive,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { j as jsxRuntimeExports } from "../../../../../node_modules/react/jsx-runtime.js";
|
|
2
2
|
import { useMemo } from "react";
|
|
3
3
|
import { StepContextProvider } from "../../Step.context.js";
|
|
4
|
-
import { StepperStepState } from "../../Step.types.js";
|
|
5
4
|
import { useStepRegistration } from "../../../../hooks/useStepRegistration.js";
|
|
6
5
|
import { useStepperContext } from "../../../../Stepper.context.js";
|
|
7
6
|
import { StepCompose } from "./Compose.style.js";
|
|
8
7
|
import { getInteractiveStepProps } from "../../../../hooks/useStepperInteractive.js";
|
|
8
|
+
import { getStepState } from "../../../../Stepper.utils.js";
|
|
9
9
|
const Compose = ({
|
|
10
10
|
onClick,
|
|
11
11
|
...restProps
|
|
@@ -18,19 +18,14 @@ const Compose = ({
|
|
|
18
18
|
const {
|
|
19
19
|
stepIndex
|
|
20
20
|
} = useStepRegistration();
|
|
21
|
-
|
|
22
|
-
if (stepIndex >= 0) {
|
|
23
|
-
if (stepIndex < currentStep) {
|
|
24
|
-
state = StepperStepState.COMPLETED;
|
|
25
|
-
} else if (stepIndex === currentStep) {
|
|
26
|
-
state = StepperStepState.FOCUSED;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
21
|
+
const state = stepIndex >= 0 ? getStepState(stepIndex, currentStep) : "idle";
|
|
29
22
|
const contextValue = useMemo(() => ({
|
|
30
23
|
state,
|
|
31
24
|
index: stepIndex
|
|
32
25
|
}), [state, stepIndex]);
|
|
33
|
-
if (stepIndex < 0)
|
|
26
|
+
if (stepIndex < 0) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
34
29
|
const interactiveProps = getInteractiveStepProps({
|
|
35
30
|
onStepChange,
|
|
36
31
|
getIsStepInteractive,
|
|
@@ -0,0 +1,15 @@
|
|
|
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 Separator_style = require("./Separator.style.cjs");
|
|
5
|
+
const Separator = ({
|
|
6
|
+
state,
|
|
7
|
+
...restProps
|
|
8
|
+
}) => {
|
|
9
|
+
return jsxRuntime.jsxRuntimeExports.jsx(Separator_style.Separator, {
|
|
10
|
+
...restProps,
|
|
11
|
+
"data-state": state,
|
|
12
|
+
"aria-hidden": true
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
exports.default = Separator;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { j as jsxRuntimeExports } from "../../../../../node_modules/react/jsx-runtime.js";
|
|
2
|
+
import { Separator as Separator$1 } from "./Separator.style.js";
|
|
3
|
+
const Separator = ({
|
|
4
|
+
state,
|
|
5
|
+
...restProps
|
|
6
|
+
}) => {
|
|
7
|
+
return jsxRuntimeExports.jsx(Separator$1, {
|
|
8
|
+
...restProps,
|
|
9
|
+
"data-state": state,
|
|
10
|
+
"aria-hidden": true
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
Separator as default
|
|
15
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
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 Step_types = require("../../Step.types.cjs");
|
|
6
|
+
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
7
|
+
const _styled__default = /* @__PURE__ */ _interopDefault(_styled);
|
|
8
|
+
const Separator = _styled__default.default.div.withConfig({
|
|
9
|
+
displayName: "Separatorstyle__Separator",
|
|
10
|
+
componentId: "RedisUI__sc-89iwun-0"
|
|
11
|
+
})(["width:1.6rem;height:", ";transition:background-color 0.3s ease;", ""], () => redisUiStyles.useTheme().components.stepper.step.separator.height, () => {
|
|
12
|
+
const {
|
|
13
|
+
states
|
|
14
|
+
} = redisUiStyles.useTheme().components.stepper.step;
|
|
15
|
+
return Object.values(Step_types.StepperStepState).map((state) => {
|
|
16
|
+
const theme = states[state].separator;
|
|
17
|
+
return _styled.css`
|
|
18
|
+
&[data-state='${state}'] {
|
|
19
|
+
background-color: ${theme.bgColor};
|
|
20
|
+
}
|
|
21
|
+
`;
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
exports.Separator = Separator;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const Separator: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import _styled, { css } from "styled-components";
|
|
2
|
+
import { useTheme } from "@redislabsdev/redis-ui-styles";
|
|
3
|
+
import { StepperStepState } from "../../Step.types.js";
|
|
4
|
+
const Separator = _styled.div.withConfig({
|
|
5
|
+
displayName: "Separatorstyle__Separator",
|
|
6
|
+
componentId: "RedisUI__sc-89iwun-0"
|
|
7
|
+
})(["width:1.6rem;height:", ";transition:background-color 0.3s ease;", ""], () => useTheme().components.stepper.step.separator.height, () => {
|
|
8
|
+
const {
|
|
9
|
+
states
|
|
10
|
+
} = useTheme().components.stepper.step;
|
|
11
|
+
return Object.values(StepperStepState).map((state) => {
|
|
12
|
+
const theme = states[state].separator;
|
|
13
|
+
return css`
|
|
14
|
+
&[data-state='${state}'] {
|
|
15
|
+
background-color: ${theme.bgColor};
|
|
16
|
+
}
|
|
17
|
+
`;
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
export {
|
|
21
|
+
Separator
|
|
22
|
+
};
|
|
@@ -12,7 +12,9 @@ function useStepperInteractive({
|
|
|
12
12
|
}) {
|
|
13
13
|
const isInteractive = !!onStepChange;
|
|
14
14
|
const isStepInteractive = React.useCallback((stepIndex) => {
|
|
15
|
-
if (!isInteractive)
|
|
15
|
+
if (!isInteractive) {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
16
18
|
if (typeof getIsStepInteractive === "function") {
|
|
17
19
|
return getIsStepInteractive(stepIndex);
|
|
18
20
|
}
|
|
@@ -21,19 +23,25 @@ function useStepperInteractive({
|
|
|
21
23
|
const handleKeyDown = isInteractive ? (event) => {
|
|
22
24
|
const findNextInteractive = (from, to = totalSteps || 0) => {
|
|
23
25
|
for (let i = from; i < to; i += 1) {
|
|
24
|
-
if (isStepInteractive(i))
|
|
26
|
+
if (isStepInteractive(i)) {
|
|
27
|
+
return i;
|
|
28
|
+
}
|
|
25
29
|
}
|
|
26
30
|
return void 0;
|
|
27
31
|
};
|
|
28
32
|
const findPrevInteractive = (from, to = 0) => {
|
|
29
33
|
for (let i = from; i >= to; i -= 1) {
|
|
30
|
-
if (isStepInteractive(i))
|
|
34
|
+
if (isStepInteractive(i)) {
|
|
35
|
+
return i;
|
|
36
|
+
}
|
|
31
37
|
}
|
|
32
38
|
return void 0;
|
|
33
39
|
};
|
|
34
40
|
const handleChange = (next) => {
|
|
35
41
|
event.preventDefault();
|
|
36
|
-
if (next !== void 0)
|
|
42
|
+
if (next !== void 0) {
|
|
43
|
+
onStepChange(next);
|
|
44
|
+
}
|
|
37
45
|
};
|
|
38
46
|
const {
|
|
39
47
|
key
|
|
@@ -10,7 +10,9 @@ function useStepperInteractive({
|
|
|
10
10
|
}) {
|
|
11
11
|
const isInteractive = !!onStepChange;
|
|
12
12
|
const isStepInteractive = useCallback((stepIndex) => {
|
|
13
|
-
if (!isInteractive)
|
|
13
|
+
if (!isInteractive) {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
14
16
|
if (typeof getIsStepInteractive === "function") {
|
|
15
17
|
return getIsStepInteractive(stepIndex);
|
|
16
18
|
}
|
|
@@ -19,19 +21,25 @@ function useStepperInteractive({
|
|
|
19
21
|
const handleKeyDown = isInteractive ? (event) => {
|
|
20
22
|
const findNextInteractive = (from, to = totalSteps || 0) => {
|
|
21
23
|
for (let i = from; i < to; i += 1) {
|
|
22
|
-
if (isStepInteractive(i))
|
|
24
|
+
if (isStepInteractive(i)) {
|
|
25
|
+
return i;
|
|
26
|
+
}
|
|
23
27
|
}
|
|
24
28
|
return void 0;
|
|
25
29
|
};
|
|
26
30
|
const findPrevInteractive = (from, to = 0) => {
|
|
27
31
|
for (let i = from; i >= to; i -= 1) {
|
|
28
|
-
if (isStepInteractive(i))
|
|
32
|
+
if (isStepInteractive(i)) {
|
|
33
|
+
return i;
|
|
34
|
+
}
|
|
29
35
|
}
|
|
30
36
|
return void 0;
|
|
31
37
|
};
|
|
32
38
|
const handleChange = (next) => {
|
|
33
39
|
event.preventDefault();
|
|
34
|
-
if (next !== void 0)
|
|
40
|
+
if (next !== void 0) {
|
|
41
|
+
onStepChange(next);
|
|
42
|
+
}
|
|
35
43
|
};
|
|
36
44
|
const {
|
|
37
45
|
key
|
|
@@ -48,7 +48,9 @@ const Switcher = Object.assign(({
|
|
|
48
48
|
userCanChangeRef.current = false;
|
|
49
49
|
};
|
|
50
50
|
handleKeyDown = (e) => {
|
|
51
|
-
if ((e.code === "Space" || e.code === "Enter") && !e.shiftKey && !e.ctrlKey && !e.altKey && !e.metaKey)
|
|
51
|
+
if ((e.code === "Space" || e.code === "Enter") && !e.shiftKey && !e.ctrlKey && !e.altKey && !e.metaKey) {
|
|
52
|
+
userCanChangeRef.current = true;
|
|
53
|
+
}
|
|
52
54
|
};
|
|
53
55
|
}
|
|
54
56
|
return jsxRuntime.jsxRuntimeExports.jsx(Switcher.Compose, {
|
|
@@ -46,7 +46,9 @@ const Switcher = Object.assign(({
|
|
|
46
46
|
userCanChangeRef.current = false;
|
|
47
47
|
};
|
|
48
48
|
handleKeyDown = (e) => {
|
|
49
|
-
if ((e.code === "Space" || e.code === "Enter") && !e.shiftKey && !e.ctrlKey && !e.altKey && !e.metaKey)
|
|
49
|
+
if ((e.code === "Space" || e.code === "Enter") && !e.shiftKey && !e.ctrlKey && !e.altKey && !e.metaKey) {
|
|
50
|
+
userCanChangeRef.current = true;
|
|
51
|
+
}
|
|
50
52
|
};
|
|
51
53
|
}
|
|
52
54
|
return jsxRuntimeExports.jsx(Switcher.Compose, {
|
|
@@ -16,30 +16,53 @@ const getSwitchStatesStyle = (theme, maps, {
|
|
|
16
16
|
withCursor,
|
|
17
17
|
selectorSuffix = ""
|
|
18
18
|
}) => {
|
|
19
|
-
if (!theme)
|
|
20
|
-
|
|
19
|
+
if (!theme) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
if (disabled) {
|
|
23
|
+
return _styled.css`
|
|
21
24
|
&&${selectorSuffix} {
|
|
22
|
-
${css_utils.styleFromTokens(
|
|
25
|
+
${css_utils.styleFromTokens({
|
|
26
|
+
tokenMaps: maps,
|
|
27
|
+
tokens: theme.disabled
|
|
28
|
+
})};
|
|
23
29
|
${withCursor && `cursor: not-allowed`};
|
|
24
30
|
}
|
|
25
31
|
`;
|
|
26
|
-
|
|
32
|
+
}
|
|
33
|
+
if (readOnly) {
|
|
34
|
+
return _styled.css`
|
|
27
35
|
&${selectorSuffix}, &:hover${selectorSuffix}, &:active${selectorSuffix} {
|
|
28
|
-
${css_utils.styleFromTokens(
|
|
36
|
+
${css_utils.styleFromTokens({
|
|
37
|
+
tokenMaps: maps,
|
|
38
|
+
tokens: theme.readonly
|
|
39
|
+
})};
|
|
29
40
|
${withCursor && `cursor: default`};
|
|
30
41
|
}
|
|
31
42
|
`;
|
|
43
|
+
}
|
|
32
44
|
return _styled.css`
|
|
33
45
|
&${selectorSuffix} {
|
|
34
|
-
${css_utils.styleFromTokens(
|
|
46
|
+
${css_utils.styleFromTokens({
|
|
47
|
+
tokenMaps: maps,
|
|
48
|
+
tokens: theme.normal
|
|
49
|
+
})};
|
|
35
50
|
}
|
|
36
51
|
|
|
37
52
|
&:hover${selectorSuffix} {
|
|
38
|
-
${css_utils.styleFromTokens(
|
|
53
|
+
${css_utils.styleFromTokens({
|
|
54
|
+
tokenMaps: maps,
|
|
55
|
+
tokens: theme.hover,
|
|
56
|
+
fallbackTokens: theme.normal
|
|
57
|
+
})};
|
|
39
58
|
}
|
|
40
59
|
|
|
41
60
|
&:active${selectorSuffix} {
|
|
42
|
-
${css_utils.styleFromTokens(
|
|
61
|
+
${css_utils.styleFromTokens({
|
|
62
|
+
tokenMaps: maps,
|
|
63
|
+
tokens: theme.active,
|
|
64
|
+
fallbackTokens: theme.normal
|
|
65
|
+
})};
|
|
43
66
|
}
|
|
44
67
|
`;
|
|
45
68
|
};
|