@redis-ui/components 43.2.1 → 44.0.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.
Files changed (85) hide show
  1. package/dist/Badge/Badge.types.cjs +1 -1
  2. package/dist/Badge/Badge.types.d.ts +1 -1
  3. package/dist/Badge/Badge.types.js +1 -1
  4. package/dist/Badge/BadgeIcon.cjs +1 -0
  5. package/dist/Badge/BadgeIcon.js +2 -1
  6. package/dist/BoxSelectionGroup/components/Item/components/Compose/Compose.style.cjs +1 -1
  7. package/dist/BoxSelectionGroup/components/Item/components/Compose/Compose.style.js +1 -1
  8. package/dist/Button/Button.style.cjs +4 -0
  9. package/dist/Button/Button.style.js +4 -0
  10. package/dist/ButtonGroup/components/Button/Button.style.cjs +1 -1
  11. package/dist/ButtonGroup/components/Button/Button.style.js +1 -1
  12. package/dist/Drawer/Drawer.cjs +12 -2
  13. package/dist/Drawer/Drawer.js +12 -2
  14. package/dist/Drawer/components/Content/Content.style.cjs +1 -1
  15. package/dist/Drawer/components/Content/Content.style.js +1 -1
  16. package/dist/Drawer/components/Overlay/Overlay.style.cjs +1 -1
  17. package/dist/Drawer/components/Overlay/Overlay.style.js +1 -1
  18. package/dist/Drawer/hooks/useReducedMotionLifecycleSync.cjs +41 -0
  19. package/dist/Drawer/hooks/useReducedMotionLifecycleSync.d.ts +15 -0
  20. package/dist/Drawer/hooks/useReducedMotionLifecycleSync.js +41 -0
  21. package/dist/HighlightedIcon/HighlightedIcon.cjs +2 -2
  22. package/dist/HighlightedIcon/HighlightedIcon.d.ts +1 -1
  23. package/dist/HighlightedIcon/HighlightedIcon.js +2 -2
  24. package/dist/HighlightedIcon/HighlightedIcon.style.cjs +6 -6
  25. package/dist/HighlightedIcon/HighlightedIcon.style.d.ts +2 -2
  26. package/dist/HighlightedIcon/HighlightedIcon.style.js +6 -6
  27. package/dist/HighlightedIcon/HighlightedIcon.types.d.ts +2 -2
  28. package/dist/Inputs/components/Compose/Compose.style.cjs +1 -1
  29. package/dist/Inputs/components/Compose/Compose.style.js +1 -1
  30. package/dist/Loader/Loader.cjs +2 -2
  31. package/dist/Loader/Loader.js +2 -2
  32. package/dist/Loader/Loader.types.d.ts +2 -1
  33. package/dist/Loader/index.d.ts +1 -0
  34. package/dist/Menu/components/Trigger/components/Arrow/Arrow.style.cjs +1 -1
  35. package/dist/Menu/components/Trigger/components/Arrow/Arrow.style.js +1 -1
  36. package/dist/Popover/components/Content/components/WindowBar/WindowBar.types.d.ts +3 -2
  37. package/dist/Popover/components/Content/components/WindowBar/components/Compose/Compose.style.d.ts +2 -3
  38. package/dist/Popover/components/Content/components/WindowBar/components/Compose/Compose.types.d.ts +2 -2
  39. package/dist/ProgressBar/ProgressBar.style.cjs +1 -1
  40. package/dist/ProgressBar/ProgressBar.style.js +1 -1
  41. package/dist/SearchBar/components/FiltersSection/FiltersSection.style.cjs +1 -1
  42. package/dist/SearchBar/components/FiltersSection/FiltersSection.style.js +1 -1
  43. package/dist/SearchBar/components/SearchSection/components/Actions/components/ColumnSelector/ColumnSelector.cjs +2 -0
  44. package/dist/SearchBar/components/SearchSection/components/Actions/components/ColumnSelector/ColumnSelector.js +2 -0
  45. package/dist/Section/components/Header/components/CollapseButton/CollapseButton.style.cjs +1 -1
  46. package/dist/Section/components/Header/components/CollapseButton/CollapseButton.style.js +1 -1
  47. package/dist/Select/components/Trigger/components/Arrow/Arrow.style.cjs +1 -1
  48. package/dist/Select/components/Trigger/components/Arrow/Arrow.style.js +1 -1
  49. package/dist/Select/components/Trigger/components/Compose/Compose.style.cjs +1 -1
  50. package/dist/Select/components/Trigger/components/Compose/Compose.style.js +1 -1
  51. package/dist/SideBar/SideBar.cjs +3 -1
  52. package/dist/SideBar/SideBar.js +3 -1
  53. package/dist/SideBar/SideBar.style.cjs +1 -1
  54. package/dist/SideBar/SideBar.style.js +1 -1
  55. package/dist/SideBar/components/Button/Button.style.cjs +3 -3
  56. package/dist/SideBar/components/Button/Button.style.js +3 -3
  57. package/dist/SideBar/components/Divider/Divider.style.cjs +1 -1
  58. package/dist/SideBar/components/Divider/Divider.style.js +1 -1
  59. package/dist/SideBar/components/Header/Header.style.cjs +4 -0
  60. package/dist/SideBar/components/Header/Header.style.js +4 -0
  61. package/dist/SideBar/components/Item/Item.style.cjs +1 -1
  62. package/dist/SideBar/components/Item/Item.style.js +1 -1
  63. package/dist/SideBar/components/Item/components/Text/Text.style.cjs +1 -1
  64. package/dist/SideBar/components/Item/components/Text/Text.style.js +1 -1
  65. package/dist/SideBar/components/SideBarLogo/SideBarLogo.style.cjs +1 -1
  66. package/dist/SideBar/components/SideBarLogo/SideBarLogo.style.js +1 -1
  67. package/dist/Stepper/components/Step/components/Icon/Icon.style.cjs +1 -1
  68. package/dist/Stepper/components/Step/components/Icon/Icon.style.js +1 -1
  69. package/dist/Switch/components/Switcher/Switcher.style.cjs +3 -0
  70. package/dist/Switch/components/Switcher/Switcher.style.js +3 -0
  71. package/dist/ThemeModeSwitch/ThemeModeSwitch.style.cjs +1 -1
  72. package/dist/ThemeModeSwitch/ThemeModeSwitch.style.js +1 -1
  73. package/dist/Toast/Toaster.cjs +30 -4
  74. package/dist/Toast/Toaster.js +30 -4
  75. package/dist/Toast/Toaster.style.cjs +1 -1
  76. package/dist/Toast/Toaster.style.js +1 -1
  77. package/dist/Toast/components/ReducedMotionTransition/ReducedMotionTransition.cjs +22 -0
  78. package/dist/Toast/components/ReducedMotionTransition/ReducedMotionTransition.d.ts +3 -0
  79. package/dist/Toast/components/ReducedMotionTransition/ReducedMotionTransition.js +22 -0
  80. package/dist/Toast/core/mapping.helpers.cjs +9 -0
  81. package/dist/Toast/core/mapping.helpers.js +9 -0
  82. package/package.json +3 -3
  83. package/skills/redis-ui-components/references/Loader.md +14 -8
  84. package/skills/redis-ui-components/references/Popover.md +1 -1
  85. package/skills/redis-ui-components/references/Tooltip.md +1 -1
@@ -26,6 +26,8 @@ const ColumnSelector = ({
26
26
  customContainer: true,
27
27
  children: jsxRuntime.jsxRuntimeExports.jsxs(ToggleButton.default, {
28
28
  pressed: isOpen,
29
+ onPressedChange: () => {
30
+ },
29
31
  "aria-description": shouldShowFilterIndication ? "Filter Active" : void 0,
30
32
  children: [jsxRuntime.jsxRuntimeExports.jsx(Button.default.Icon, {
31
33
  icon: redisUiIcons.ColumnsIcon
@@ -24,6 +24,8 @@ const ColumnSelector = ({
24
24
  customContainer: true,
25
25
  children: jsxRuntimeExports.jsxs(ToggleButton, {
26
26
  pressed: isOpen,
27
+ onPressedChange: () => {
28
+ },
27
29
  "aria-description": shouldShowFilterIndication ? "Filter Active" : void 0,
28
30
  children: [jsxRuntimeExports.jsx(Button.Icon, {
29
31
  icon: ColumnsIcon
@@ -25,6 +25,6 @@ const SectionCollapseButton = _styled__default.default(IconButton.default).withC
25
25
  const SectionCollapseIcon = _styled__default.default(redisUiIcons.ChevronDownIcon).withConfig({
26
26
  displayName: "CollapseButtonstyle__SectionCollapseIcon",
27
27
  componentId: "RedisUI__sc-e7t43f-1"
28
- })(["transition:transform 0.1s;button[data-state='open'] &{transform:rotate(180deg);}"]);
28
+ })(["transition:transform 0.1s;@media (prefers-reduced-motion:reduce){transition:none;}button[data-state='open'] &{transform:rotate(180deg);}"]);
29
29
  exports.SectionCollapseButton = SectionCollapseButton;
30
30
  exports.SectionCollapseIcon = SectionCollapseIcon;
@@ -21,7 +21,7 @@ const SectionCollapseButton = _styled(IconButton).withConfig({
21
21
  const SectionCollapseIcon = _styled(ChevronDownIcon).withConfig({
22
22
  displayName: "CollapseButtonstyle__SectionCollapseIcon",
23
23
  componentId: "RedisUI__sc-e7t43f-1"
24
- })(["transition:transform 0.1s;button[data-state='open'] &{transform:rotate(180deg);}"]);
24
+ })(["transition:transform 0.1s;@media (prefers-reduced-motion:reduce){transition:none;}button[data-state='open'] &{transform:rotate(180deg);}"]);
25
25
  export {
26
26
  SectionCollapseButton,
27
27
  SectionCollapseIcon
@@ -7,5 +7,5 @@ const _styled__default = /* @__PURE__ */ _interopDefault(_styled);
7
7
  const ArrowIconContainer = _styled__default.default(SelfContained.SelfContained).withConfig({
8
8
  displayName: "Arrowstyle__ArrowIconContainer",
9
9
  componentId: "RedisUI__sc-x3vprr-0"
10
- })(["[data-state='open'] &{rotate:180deg;}[data-state='closed'] &{rotate:0deg;}transition:rotate 0.5s;flex:none;"]);
10
+ })(["[data-state='open'] &{rotate:180deg;}[data-state='closed'] &{rotate:0deg;}transition:rotate 0.5s;@media (prefers-reduced-motion:reduce){transition:none;}flex:none;"]);
11
11
  exports.ArrowIconContainer = ArrowIconContainer;
@@ -3,7 +3,7 @@ import { SelfContained } from "../../../../../Helpers/SelfContained.js";
3
3
  const ArrowIconContainer = _styled(SelfContained).withConfig({
4
4
  displayName: "Arrowstyle__ArrowIconContainer",
5
5
  componentId: "RedisUI__sc-x3vprr-0"
6
- })(["[data-state='open'] &{rotate:180deg;}[data-state='closed'] &{rotate:0deg;}transition:rotate 0.5s;flex:none;"]);
6
+ })(["[data-state='open'] &{rotate:180deg;}[data-state='closed'] &{rotate:0deg;}transition:rotate 0.5s;@media (prefers-reduced-motion:reduce){transition:none;}flex:none;"]);
7
7
  export {
8
8
  ArrowIconContainer
9
9
  };
@@ -82,7 +82,7 @@ const getStateStyle = (theme) => {
82
82
  const TriggerContainer = _styled__default.default(index.Trigger).withConfig({
83
83
  displayName: "Composestyle__TriggerContainer",
84
84
  componentId: "RedisUI__sc-txq0dy-0"
85
- })(["display:flex;flex-wrap:nowrap;overflow:hidden;align-items:center;box-sizing:border-box;transition:border-color 0.2s ease-in;width:100%;justify-content:start;text-align:start;", ";", ";"], () => {
85
+ })(["display:flex;flex-wrap:nowrap;overflow:hidden;align-items:center;box-sizing:border-box;transition:border-color 0.2s ease-in;@media (prefers-reduced-motion:reduce){transition:none;}width:100%;justify-content:start;text-align:start;", ";", ";"], () => {
86
86
  const style = redisUiStyles.useTheme().components.select;
87
87
  return _styled.css`
88
88
  ${css_utils.styleFromTokens({
@@ -78,7 +78,7 @@ const getStateStyle = (theme) => {
78
78
  const TriggerContainer = _styled(Trigger).withConfig({
79
79
  displayName: "Composestyle__TriggerContainer",
80
80
  componentId: "RedisUI__sc-txq0dy-0"
81
- })(["display:flex;flex-wrap:nowrap;overflow:hidden;align-items:center;box-sizing:border-box;transition:border-color 0.2s ease-in;width:100%;justify-content:start;text-align:start;", ";", ";"], () => {
81
+ })(["display:flex;flex-wrap:nowrap;overflow:hidden;align-items:center;box-sizing:border-box;transition:border-color 0.2s ease-in;@media (prefers-reduced-motion:reduce){transition:none;}width:100%;justify-content:start;text-align:start;", ";", ";"], () => {
82
82
  const style = useTheme().components.select;
83
83
  return css`
84
84
  ${styleFromTokens({
@@ -3,6 +3,7 @@ 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 index = require("../node_modules/@radix-ui/react-id/dist/index.cjs");
6
+ const redisUiStyles = require("@redislabsdev/redis-ui-styles");
6
7
  const SideBar_context = require("./SideBar.context.cjs");
7
8
  const Provider = require("../Tooltip/Provider/Provider.cjs");
8
9
  const SideBarLogo = require("./components/SideBarLogo/SideBarLogo.cjs");
@@ -21,9 +22,10 @@ const SideBar = Object.assign(({
21
22
  ...rest
22
23
  }) => {
23
24
  const [transitionEnd, setTransitionEnd] = React.useState(true);
25
+ const prefersReducedMotion = redisUiStyles.usePrefersReducedMotion();
24
26
  const sidebarId = index.useId();
25
27
  const handleTransitionChange = (end) => {
26
- setTransitionEnd(end);
28
+ setTransitionEnd(prefersReducedMotion ? true : end);
27
29
  };
28
30
  return jsxRuntime.jsxRuntimeExports.jsx(SideBarThemeProvider.SideBarThemeProvider, {
29
31
  children: jsxRuntime.jsxRuntimeExports.jsx(SideBar_context.SideBarContextProvider, {
@@ -1,6 +1,7 @@
1
1
  import { j as jsxRuntimeExports } from "../node_modules/react/jsx-runtime.js";
2
2
  import { useState } from "react";
3
3
  import { useId } from "../node_modules/@radix-ui/react-id/dist/index.js";
4
+ import { usePrefersReducedMotion } from "@redislabsdev/redis-ui-styles";
4
5
  import { SideBarContextProvider } from "./SideBar.context.js";
5
6
  import TooltipProvider from "../Tooltip/Provider/Provider.js";
6
7
  import SideBarLogo from "./components/SideBarLogo/SideBarLogo.js";
@@ -19,9 +20,10 @@ const SideBar = Object.assign(({
19
20
  ...rest
20
21
  }) => {
21
22
  const [transitionEnd, setTransitionEnd] = useState(true);
23
+ const prefersReducedMotion = usePrefersReducedMotion();
22
24
  const sidebarId = useId();
23
25
  const handleTransitionChange = (end) => {
24
- setTransitionEnd(end);
26
+ setTransitionEnd(prefersReducedMotion ? true : end);
25
27
  };
26
28
  return jsxRuntimeExports.jsx(SideBarThemeProvider, {
27
29
  children: jsxRuntimeExports.jsx(SideBarContextProvider, {
@@ -22,7 +22,7 @@ const useRootStateStyle = (getStyle) => {
22
22
  const SideBarContainer = _styled__default.default(FlexGroup.FlexGroup).withConfig({
23
23
  displayName: "SideBarstyle__SideBarContainer",
24
24
  componentId: "RedisUI__sc-suwica-0"
25
- })(["position:relative;height:100%;transition:width 0.6s;", ""], () => useRootStateStyle((theme) => _styled.css`
25
+ })(["position:relative;height:100%;transition:width 0.6s;@media (prefers-reduced-motion:reduce){transition:none;}", ""], () => useRootStateStyle((theme) => _styled.css`
26
26
  box-shadow: ${theme.shadow};
27
27
  background-color: ${theme.bgColor};
28
28
  width: ${theme.width};
@@ -18,7 +18,7 @@ const useRootStateStyle = (getStyle) => {
18
18
  const SideBarContainer = _styled(FlexGroup).withConfig({
19
19
  displayName: "SideBarstyle__SideBarContainer",
20
20
  componentId: "RedisUI__sc-suwica-0"
21
- })(["position:relative;height:100%;transition:width 0.6s;", ""], () => useRootStateStyle((theme) => css`
21
+ })(["position:relative;height:100%;transition:width 0.6s;@media (prefers-reduced-motion:reduce){transition:none;}", ""], () => useRootStateStyle((theme) => css`
22
22
  box-shadow: ${theme.shadow};
23
23
  background-color: ${theme.bgColor};
24
24
  width: ${theme.width};
@@ -9,7 +9,7 @@ const _styled__default = /* @__PURE__ */ _interopDefault(_styled);
9
9
  const SideBarButton = _styled__default.default(Button.default).withConfig({
10
10
  displayName: "Buttonstyle__SideBarButton",
11
11
  componentId: "RedisUI__sc-ngkny4-0"
12
- })(["flex-shrink:0;margin:0 auto;display:flex;position:relative;", " padding:0;transition:width 0.7s;min-width:unset;"], () => SideBar_utils.useStateStyle((theme) => _styled.css`
12
+ })(["flex-shrink:0;margin:0 auto;display:flex;position:relative;", " padding:0;transition:width 0.7s;min-width:unset;@media (prefers-reduced-motion:reduce){transition:none;}"], () => SideBar_utils.useStateStyle((theme) => _styled.css`
13
13
  height: ${theme.button.height};
14
14
  width: ${theme.button.width};
15
15
  `));
@@ -25,11 +25,11 @@ const appear = _styled.keyframes`
25
25
  const FadeInAnimationText = _styled__default.default.span.withConfig({
26
26
  displayName: "Buttonstyle__FadeInAnimationText",
27
27
  componentId: "RedisUI__sc-ngkny4-1"
28
- })(["animation:", " 0.3s forwards;"], appear);
28
+ })(["animation:", " 0.3s forwards;@media (prefers-reduced-motion:reduce){animation:none;}"], appear);
29
29
  const FadeInAnimationSvg = _styled__default.default.span.withConfig({
30
30
  displayName: "Buttonstyle__FadeInAnimationSvg",
31
31
  componentId: "RedisUI__sc-ngkny4-2"
32
- })(["display:flex;animation:", " 0.5s forwards;"], appear);
32
+ })(["display:flex;animation:", " 0.5s forwards;@media (prefers-reduced-motion:reduce){animation:none;}"], appear);
33
33
  const TooltipContent = _styled__default.default(Tooltip.default.Content.Text).withConfig({
34
34
  displayName: "Buttonstyle__TooltipContent",
35
35
  componentId: "RedisUI__sc-ngkny4-3"
@@ -5,7 +5,7 @@ import Tooltip from "../../../Tooltip/Tooltip.js";
5
5
  const SideBarButton = _styled(Button).withConfig({
6
6
  displayName: "Buttonstyle__SideBarButton",
7
7
  componentId: "RedisUI__sc-ngkny4-0"
8
- })(["flex-shrink:0;margin:0 auto;display:flex;position:relative;", " padding:0;transition:width 0.7s;min-width:unset;"], () => useStateStyle((theme) => css`
8
+ })(["flex-shrink:0;margin:0 auto;display:flex;position:relative;", " padding:0;transition:width 0.7s;min-width:unset;@media (prefers-reduced-motion:reduce){transition:none;}"], () => useStateStyle((theme) => css`
9
9
  height: ${theme.button.height};
10
10
  width: ${theme.button.width};
11
11
  `));
@@ -21,11 +21,11 @@ const appear = keyframes`
21
21
  const FadeInAnimationText = _styled.span.withConfig({
22
22
  displayName: "Buttonstyle__FadeInAnimationText",
23
23
  componentId: "RedisUI__sc-ngkny4-1"
24
- })(["animation:", " 0.3s forwards;"], appear);
24
+ })(["animation:", " 0.3s forwards;@media (prefers-reduced-motion:reduce){animation:none;}"], appear);
25
25
  const FadeInAnimationSvg = _styled.span.withConfig({
26
26
  displayName: "Buttonstyle__FadeInAnimationSvg",
27
27
  componentId: "RedisUI__sc-ngkny4-2"
28
- })(["display:flex;animation:", " 0.5s forwards;"], appear);
28
+ })(["display:flex;animation:", " 0.5s forwards;@media (prefers-reduced-motion:reduce){animation:none;}"], appear);
29
29
  const TooltipContent = _styled(Tooltip.Content.Text).withConfig({
30
30
  displayName: "Buttonstyle__TooltipContent",
31
31
  componentId: "RedisUI__sc-ngkny4-3"
@@ -7,7 +7,7 @@ const _styled__default = /* @__PURE__ */ _interopDefault(_styled);
7
7
  const SideBarDivider = _styled__default.default.div.withConfig({
8
8
  displayName: "Dividerstyle__SideBarDivider",
9
9
  componentId: "RedisUI__sc-191o8ht-0"
10
- })(["background-clip:content-box;transition:all 1s;flex:none;", ";"], ({
10
+ })(["background-clip:content-box;transition:all 1s;flex:none;@media (prefers-reduced-motion:reduce){transition:none;}", ";"], ({
11
11
  fullWidthWhenExpanded,
12
12
  fullWidth,
13
13
  noMargin
@@ -3,7 +3,7 @@ import { useStateStyle } from "../../SideBar.utils.js";
3
3
  const SideBarDivider = _styled.div.withConfig({
4
4
  displayName: "Dividerstyle__SideBarDivider",
5
5
  componentId: "RedisUI__sc-191o8ht-0"
6
- })(["background-clip:content-box;transition:all 1s;flex:none;", ";"], ({
6
+ })(["background-clip:content-box;transition:all 1s;flex:none;@media (prefers-reduced-motion:reduce){transition:none;}", ";"], ({
7
7
  fullWidthWhenExpanded,
8
8
  fullWidth,
9
9
  noMargin
@@ -28,6 +28,10 @@ const SideBarToggleButton = _styled__default.default.button.withConfig({
28
28
  transition: all 0.3s ease;
29
29
  right: ${isExpanded ? theme.collapseButton.rightExpanded : theme.collapseButton.rightCollapsed};
30
30
 
31
+ @media (prefers-reduced-motion: reduce) {
32
+ transition: none;
33
+ }
34
+
31
35
  ::before {
32
36
  // half-width background + shadow
33
37
  filter: drop-shadow(${theme.collapseButton.filterShadow});
@@ -24,6 +24,10 @@ const SideBarToggleButton = _styled.button.withConfig({
24
24
  transition: all 0.3s ease;
25
25
  right: ${isExpanded ? theme.collapseButton.rightExpanded : theme.collapseButton.rightCollapsed};
26
26
 
27
+ @media (prefers-reduced-motion: reduce) {
28
+ transition: none;
29
+ }
30
+
27
31
  ::before {
28
32
  // half-width background + shadow
29
33
  filter: drop-shadow(${theme.collapseButton.filterShadow});
@@ -11,7 +11,7 @@ const maps = [css_utils.tokenMaps.bgColor, css_utils.tokenMaps.textColor];
11
11
  const SideBarItem = _styled__default.default.li.withConfig({
12
12
  displayName: "Itemstyle__SideBarItem",
13
13
  componentId: "RedisUI__sc-rtt1mk-0"
14
- })(["position:relative;display:flex;justify-content:flex-start;align-items:center;cursor:pointer;text-decoration:none;transition:background 0.3s;&:focus-visible{outline:", " solid ", ";outline-offset:-", ";}", ";& > svg{transition:inherit;}"], () => redisUiStyles.useTheme().core.focus.size, () => redisUiStyles.useTheme().core.focus.color, () => redisUiStyles.useTheme().core.focus.size, () => {
14
+ })(["position:relative;display:flex;justify-content:flex-start;align-items:center;cursor:pointer;text-decoration:none;transition:background 0.3s;@media (prefers-reduced-motion:reduce){transition:none;}&:focus-visible{outline:", " solid ", ";outline-offset:-", ";}", ";& > svg{transition:inherit;}"], () => redisUiStyles.useTheme().core.focus.size, () => redisUiStyles.useTheme().core.focus.color, () => redisUiStyles.useTheme().core.focus.size, () => {
15
15
  return SideBar_utils.useStateStyle(({
16
16
  item: theme
17
17
  }) => {
@@ -7,7 +7,7 @@ const maps = [tokenMaps.bgColor, tokenMaps.textColor];
7
7
  const SideBarItem = _styled.li.withConfig({
8
8
  displayName: "Itemstyle__SideBarItem",
9
9
  componentId: "RedisUI__sc-rtt1mk-0"
10
- })(["position:relative;display:flex;justify-content:flex-start;align-items:center;cursor:pointer;text-decoration:none;transition:background 0.3s;&:focus-visible{outline:", " solid ", ";outline-offset:-", ";}", ";& > svg{transition:inherit;}"], () => useTheme().core.focus.size, () => useTheme().core.focus.color, () => useTheme().core.focus.size, () => {
10
+ })(["position:relative;display:flex;justify-content:flex-start;align-items:center;cursor:pointer;text-decoration:none;transition:background 0.3s;@media (prefers-reduced-motion:reduce){transition:none;}&:focus-visible{outline:", " solid ", ";outline-offset:-", ";}", ";& > svg{transition:inherit;}"], () => useTheme().core.focus.size, () => useTheme().core.focus.color, () => useTheme().core.focus.size, () => {
11
11
  return useStateStyle(({
12
12
  item: theme
13
13
  }) => {
@@ -8,7 +8,7 @@ const _styled__default = /* @__PURE__ */ _interopDefault(_styled);
8
8
  const SideBarItemText = _styled__default.default(Typography.default.Body).withConfig({
9
9
  displayName: "Textstyle__SideBarItemText",
10
10
  componentId: "RedisUI__sc-17tjfvd-0"
11
- })(["transition:width 0.6s,opacity 0.4s;opacity:", ";"], () => {
11
+ })(["transition:width 0.6s,opacity 0.4s;@media (prefers-reduced-motion:reduce){transition:none;}opacity:", ";"], () => {
12
12
  const {
13
13
  isExpanded,
14
14
  transitionEnd
@@ -4,7 +4,7 @@ import Typography from "../../../../../Typography/Typography.js";
4
4
  const SideBarItemText = _styled(Typography.Body).withConfig({
5
5
  displayName: "Textstyle__SideBarItemText",
6
6
  componentId: "RedisUI__sc-17tjfvd-0"
7
- })(["transition:width 0.6s,opacity 0.4s;opacity:", ";"], () => {
7
+ })(["transition:width 0.6s,opacity 0.4s;@media (prefers-reduced-motion:reduce){transition:none;}opacity:", ";"], () => {
8
8
  const {
9
9
  isExpanded,
10
10
  transitionEnd
@@ -7,7 +7,7 @@ const _styled__default = /* @__PURE__ */ _interopDefault(_styled);
7
7
  const SideBarLogo = _styled__default.default.span.withConfig({
8
8
  displayName: "SideBarLogostyle__SideBarLogo",
9
9
  componentId: "RedisUI__sc-1u1jhxg-0"
10
- })(["display:flex;z-index:1;transition:padding-left 0.2s;", ""], () => SideBar_utils.useStateStyle((theme) => _styled.css`
10
+ })(["display:flex;z-index:1;transition:padding-left 0.2s;@media (prefers-reduced-motion:reduce){transition:none;}", ""], () => SideBar_utils.useStateStyle((theme) => _styled.css`
11
11
  padding-left: ${theme.logo.offset};
12
12
  `));
13
13
  exports.SideBarLogo = SideBarLogo;
@@ -3,7 +3,7 @@ import { useStateStyle } from "../../SideBar.utils.js";
3
3
  const SideBarLogo = _styled.span.withConfig({
4
4
  displayName: "SideBarLogostyle__SideBarLogo",
5
5
  componentId: "RedisUI__sc-1u1jhxg-0"
6
- })(["display:flex;z-index:1;transition:padding-left 0.2s;", ""], () => useStateStyle((theme) => css`
6
+ })(["display:flex;z-index:1;transition:padding-left 0.2s;@media (prefers-reduced-motion:reduce){transition:none;}", ""], () => useStateStyle((theme) => css`
7
7
  padding-left: ${theme.logo.offset};
8
8
  `));
9
9
  export {
@@ -9,7 +9,7 @@ const _styled__default = /* @__PURE__ */ _interopDefault(_styled);
9
9
  const Container = _styled__default.default.div.withConfig({
10
10
  displayName: "Iconstyle__Container",
11
11
  componentId: "RedisUI__sc-1ojkwgp-0"
12
- })(["display:flex;align-items:center;justify-content:center;flex:none;line-height:0;transition:all 0.3s ease;width:", ";height:", ";", ""], () => redisUiStyles.useTheme().components.stepper.step.indicator.size, () => redisUiStyles.useTheme().components.stepper.step.indicator.size, () => {
12
+ })(["display:flex;align-items:center;justify-content:center;flex:none;line-height:0;transition:all 0.3s ease;@media (prefers-reduced-motion:reduce){transition:none;}width:", ";height:", ";", ""], () => redisUiStyles.useTheme().components.stepper.step.indicator.size, () => redisUiStyles.useTheme().components.stepper.step.indicator.size, () => {
13
13
  const {
14
14
  states
15
15
  } = redisUiStyles.useTheme().components.stepper.step;
@@ -5,7 +5,7 @@ import { StepperStepState } from "../../Step.types.js";
5
5
  const Container = _styled.div.withConfig({
6
6
  displayName: "Iconstyle__Container",
7
7
  componentId: "RedisUI__sc-1ojkwgp-0"
8
- })(["display:flex;align-items:center;justify-content:center;flex:none;line-height:0;transition:all 0.3s ease;width:", ";height:", ";", ""], () => useTheme().components.stepper.step.indicator.size, () => useTheme().components.stepper.step.indicator.size, () => {
8
+ })(["display:flex;align-items:center;justify-content:center;flex:none;line-height:0;transition:all 0.3s ease;@media (prefers-reduced-motion:reduce){transition:none;}width:", ";height:", ";", ""], () => useTheme().components.stepper.step.indicator.size, () => useTheme().components.stepper.step.indicator.size, () => {
9
9
  const {
10
10
  states
11
11
  } = useTheme().components.stepper.step;
@@ -110,6 +110,9 @@ const SwitcherCompose = _styled__default.default(index.Root).attrs(() => {
110
110
  border-radius: ${style.borderRadius};
111
111
  padding: 0;
112
112
  transition: all 0.3s ease, outline-offset 0ms, outline 0ms;
113
+ @media (prefers-reduced-motion: reduce) {
114
+ transition: none;
115
+ }
113
116
  cursor: pointer;
114
117
  overflow: hidden;
115
118
  ${redisUiStyles.getFocusStyle()};
@@ -106,6 +106,9 @@ const SwitcherCompose = _styled(Root).attrs(() => {
106
106
  border-radius: ${style.borderRadius};
107
107
  padding: 0;
108
108
  transition: all 0.3s ease, outline-offset 0ms, outline 0ms;
109
+ @media (prefers-reduced-motion: reduce) {
110
+ transition: none;
111
+ }
109
112
  cursor: pointer;
110
113
  overflow: hidden;
111
114
  ${getFocusStyle()};
@@ -7,7 +7,7 @@ const _styled__default = /* @__PURE__ */ _interopDefault(_styled);
7
7
  const ThemeModeSwitch = _styled__default.default.button.withConfig({
8
8
  displayName: "ThemeModeSwitchstyle__ThemeModeSwitch",
9
9
  componentId: "RedisUI__sc-6b0pvc-0"
10
- })(["all:unset;cursor:pointer;box-sizing:border-box;transition:all ", "ms ease,outline 0ms,outline-offset 0ms;&[data-mounting]{transition:none;}", " ", ""], ({
10
+ })(["all:unset;cursor:pointer;box-sizing:border-box;transition:all ", "ms ease,outline 0ms,outline-offset 0ms;&[data-mounting]{transition:none;}@media (prefers-reduced-motion:reduce){transition:none;}", " ", ""], ({
11
11
  $durationMs
12
12
  }) => $durationMs, () => {
13
13
  const theme = redisUiStyles.useTheme().components.themeModeSwitch;
@@ -3,7 +3,7 @@ import { useTheme, getFocusStyle } from "@redislabsdev/redis-ui-styles";
3
3
  const ThemeModeSwitch = _styled.button.withConfig({
4
4
  displayName: "ThemeModeSwitchstyle__ThemeModeSwitch",
5
5
  componentId: "RedisUI__sc-6b0pvc-0"
6
- })(["all:unset;cursor:pointer;box-sizing:border-box;transition:all ", "ms ease,outline 0ms,outline-offset 0ms;&[data-mounting]{transition:none;}", " ", ""], ({
6
+ })(["all:unset;cursor:pointer;box-sizing:border-box;transition:all ", "ms ease,outline 0ms,outline-offset 0ms;&[data-mounting]{transition:none;}@media (prefers-reduced-motion:reduce){transition:none;}", " ", ""], ({
7
7
  $durationMs
8
8
  }) => $durationMs, () => {
9
9
  const theme = useTheme().components.themeModeSwitch;
@@ -2,11 +2,37 @@
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
3
  const jsxRuntime = require("../node_modules/react/jsx-runtime.cjs");
4
4
  const React = require("react");
5
+ const redisUiStyles = require("@redislabsdev/redis-ui-styles");
6
+ const ReducedMotionTransition = require("./components/ReducedMotionTransition/ReducedMotionTransition.cjs");
5
7
  const Toaster_style = require("./Toaster.style.cjs");
6
- const Toaster = React.forwardRef((props, ref) => jsxRuntime.jsxRuntimeExports.jsx(Toaster_style.ToasterContainer, {
7
- ref,
8
- ...props
9
- }));
8
+ const getReducedMotionStyle = (style, autoClose) => {
9
+ if (typeof autoClose !== "number") {
10
+ return style;
11
+ }
12
+ return {
13
+ ...style,
14
+ "--redis-ui-toast-progress-duration": `${autoClose}ms`
15
+ };
16
+ };
17
+ const Toaster = React.forwardRef((props, ref) => {
18
+ const {
19
+ autoClose,
20
+ style,
21
+ ...restProps
22
+ } = props;
23
+ const prefersReducedMotion = redisUiStyles.usePrefersReducedMotion();
24
+ const reducedMotionProps = prefersReducedMotion ? {
25
+ transition: ReducedMotionTransition.default,
26
+ style: getReducedMotionStyle(style, autoClose)
27
+ } : void 0;
28
+ return jsxRuntime.jsxRuntimeExports.jsx(Toaster_style.ToasterContainer, {
29
+ ref,
30
+ autoClose,
31
+ style: prefersReducedMotion ? void 0 : style,
32
+ ...restProps,
33
+ ...reducedMotionProps
34
+ });
35
+ });
10
36
  Toaster.displayName = "Toaster";
11
37
  const Toaster$1 = Toaster;
12
38
  exports.default = Toaster$1;
@@ -1,10 +1,36 @@
1
1
  import { j as jsxRuntimeExports } from "../node_modules/react/jsx-runtime.js";
2
2
  import { forwardRef } from "react";
3
+ import { usePrefersReducedMotion } from "@redislabsdev/redis-ui-styles";
4
+ import ReducedMotionTransition from "./components/ReducedMotionTransition/ReducedMotionTransition.js";
3
5
  import { ToasterContainer } from "./Toaster.style.js";
4
- const Toaster = forwardRef((props, ref) => jsxRuntimeExports.jsx(ToasterContainer, {
5
- ref,
6
- ...props
7
- }));
6
+ const getReducedMotionStyle = (style, autoClose) => {
7
+ if (typeof autoClose !== "number") {
8
+ return style;
9
+ }
10
+ return {
11
+ ...style,
12
+ "--redis-ui-toast-progress-duration": `${autoClose}ms`
13
+ };
14
+ };
15
+ const Toaster = forwardRef((props, ref) => {
16
+ const {
17
+ autoClose,
18
+ style,
19
+ ...restProps
20
+ } = props;
21
+ const prefersReducedMotion = usePrefersReducedMotion();
22
+ const reducedMotionProps = prefersReducedMotion ? {
23
+ transition: ReducedMotionTransition,
24
+ style: getReducedMotionStyle(style, autoClose)
25
+ } : void 0;
26
+ return jsxRuntimeExports.jsx(ToasterContainer, {
27
+ ref,
28
+ autoClose,
29
+ style: prefersReducedMotion ? void 0 : style,
30
+ ...restProps,
31
+ ...reducedMotionProps
32
+ });
33
+ });
8
34
  Toaster.displayName = "Toaster";
9
35
  const Toaster$1 = Toaster;
10
36
  export {
@@ -9,5 +9,5 @@ const _styled__default = /* @__PURE__ */ _interopDefault(_styled);
9
9
  const ToasterContainer = _styled__default.default(reactToastify_esm.ToastContainer).withConfig({
10
10
  displayName: "Toasterstyle__ToasterContainer",
11
11
  componentId: "RedisUI__sc-zfvdgq-0"
12
- })(["--toastify-toast-min-height:auto;--toastify-toast-width:auto;--toastify-font-family:inherit;& .Toastify__toast,& .Toastify__toast-body{padding:0;margin-bottom:", ";overflow:visible;background:none;color:black;box-shadow:none;}& .Toastify__toast-body{margin:0;}& .Toastify__progress-bar{visibility:hidden !important;}& .Toastify__close-button{display:none;}"], () => redisUiStyles.useTheme().components.toast.toaster.gap);
12
+ })(["--toastify-toast-min-height:auto;--toastify-toast-width:auto;--toastify-font-family:inherit;@media (prefers-reduced-motion:reduce){& .Toastify__progress-bar--animated{animation-duration:var(--redis-ui-toast-progress-duration,0.01ms) !important;}}& .Toastify__toast,& .Toastify__toast-body{padding:0;margin-bottom:", ";overflow:visible;background:none;color:black;box-shadow:none;}& .Toastify__toast-body{margin:0;}& .Toastify__progress-bar{visibility:hidden !important;}& .Toastify__close-button{display:none;}"], () => redisUiStyles.useTheme().components.toast.toaster.gap);
13
13
  exports.ToasterContainer = ToasterContainer;
@@ -5,7 +5,7 @@ import { useTheme } from "@redislabsdev/redis-ui-styles";
5
5
  const ToasterContainer = _styled(Q).withConfig({
6
6
  displayName: "Toasterstyle__ToasterContainer",
7
7
  componentId: "RedisUI__sc-zfvdgq-0"
8
- })(["--toastify-toast-min-height:auto;--toastify-toast-width:auto;--toastify-font-family:inherit;& .Toastify__toast,& .Toastify__toast-body{padding:0;margin-bottom:", ";overflow:visible;background:none;color:black;box-shadow:none;}& .Toastify__toast-body{margin:0;}& .Toastify__progress-bar{visibility:hidden !important;}& .Toastify__close-button{display:none;}"], () => useTheme().components.toast.toaster.gap);
8
+ })(["--toastify-toast-min-height:auto;--toastify-toast-width:auto;--toastify-font-family:inherit;@media (prefers-reduced-motion:reduce){& .Toastify__progress-bar--animated{animation-duration:var(--redis-ui-toast-progress-duration,0.01ms) !important;}}& .Toastify__toast,& .Toastify__toast-body{padding:0;margin-bottom:", ";overflow:visible;background:none;color:black;box-shadow:none;}& .Toastify__toast-body{margin:0;}& .Toastify__progress-bar{visibility:hidden !important;}& .Toastify__close-button{display:none;}"], () => useTheme().components.toast.toaster.gap);
9
9
  export {
10
10
  ToasterContainer
11
11
  };
@@ -0,0 +1,22 @@
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 ReducedMotionTransition = ({
6
+ children,
7
+ done,
8
+ isIn,
9
+ playToast
10
+ }) => {
11
+ React.useLayoutEffect(() => {
12
+ if (isIn) {
13
+ playToast();
14
+ return;
15
+ }
16
+ done();
17
+ }, [done, isIn, playToast]);
18
+ return jsxRuntime.jsxRuntimeExports.jsx(jsxRuntime.jsxRuntimeExports.Fragment, {
19
+ children
20
+ });
21
+ };
22
+ exports.default = ReducedMotionTransition;
@@ -0,0 +1,3 @@
1
+ import type { ToastTransitionProps } from 'react-toastify';
2
+ declare const ReducedMotionTransition: ({ children, done, isIn, playToast }: ToastTransitionProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default ReducedMotionTransition;
@@ -0,0 +1,22 @@
1
+ import { j as jsxRuntimeExports } from "../../../node_modules/react/jsx-runtime.js";
2
+ import { useLayoutEffect } from "react";
3
+ const ReducedMotionTransition = ({
4
+ children,
5
+ done,
6
+ isIn,
7
+ playToast
8
+ }) => {
9
+ useLayoutEffect(() => {
10
+ if (isIn) {
11
+ playToast();
12
+ return;
13
+ }
14
+ done();
15
+ }, [done, isIn, playToast]);
16
+ return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {
17
+ children
18
+ });
19
+ };
20
+ export {
21
+ ReducedMotionTransition as default
22
+ };
@@ -1,6 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const reactToastify_esm = require("../../packages/components/node_modules/react-toastify/dist/react-toastify.esm.cjs");
4
+ const getProgressDurationStyle = (autoClose) => {
5
+ if (typeof autoClose !== "number") {
6
+ return void 0;
7
+ }
8
+ return {
9
+ "--redis-ui-toast-progress-duration": `${autoClose}ms`
10
+ };
11
+ };
4
12
  const extractContextProps = (props) => ({
5
13
  variant: "informative",
6
14
  liveRole: "alert",
@@ -22,6 +30,7 @@ const cleanupOptions = (options) => ({
22
30
  // use dummy theme (later custom themes can be used)
23
31
  role: "group",
24
32
  // mark main container as group
33
+ progressStyle: getProgressDurationStyle(options == null ? void 0 : options.autoClose),
25
34
  ...(options == null ? void 0 : options.role) ? {
26
35
  liveRole: options == null ? void 0 : options.role
27
36
  } : {}
@@ -1,4 +1,12 @@
1
1
  import { toast as B } from "../../packages/components/node_modules/react-toastify/dist/react-toastify.esm.js";
2
+ const getProgressDurationStyle = (autoClose) => {
3
+ if (typeof autoClose !== "number") {
4
+ return void 0;
5
+ }
6
+ return {
7
+ "--redis-ui-toast-progress-duration": `${autoClose}ms`
8
+ };
9
+ };
2
10
  const extractContextProps = (props) => ({
3
11
  variant: "informative",
4
12
  liveRole: "alert",
@@ -20,6 +28,7 @@ const cleanupOptions = (options) => ({
20
28
  // use dummy theme (later custom themes can be used)
21
29
  role: "group",
22
30
  // mark main container as group
31
+ progressStyle: getProgressDurationStyle(options == null ? void 0 : options.autoClose),
23
32
  ...(options == null ? void 0 : options.role) ? {
24
33
  liveRole: options == null ? void 0 : options.role
25
34
  } : {}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@redis-ui/components",
3
3
  "license": "UNLICENSED",
4
- "version": "43.2.1",
4
+ "version": "44.0.1",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "repository": "git@github.com:redislabsdev/redis-ui.git",
@@ -28,8 +28,8 @@
28
28
  "test": "vitest"
29
29
  },
30
30
  "peerDependencies": {
31
- "@redis-ui/icons": "^6.8.5",
32
- "@redis-ui/styles": "^14.15.0",
31
+ "@redis-ui/icons": "^6.9.2",
32
+ "@redis-ui/styles": "^15.0.0",
33
33
  "react": "^17.0.0 || ^18.0.0",
34
34
  "react-dom": "^17.0.0 || ^18.0.0",
35
35
  "styled-components": "^5.0.0"