@redis-ui/components 43.2.1 → 44.0.2

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 (86) hide show
  1. package/README.md +53 -429
  2. package/dist/Badge/Badge.types.cjs +1 -1
  3. package/dist/Badge/Badge.types.d.ts +1 -1
  4. package/dist/Badge/Badge.types.js +1 -1
  5. package/dist/Badge/BadgeIcon.cjs +1 -0
  6. package/dist/Badge/BadgeIcon.js +2 -1
  7. package/dist/BoxSelectionGroup/components/Item/components/Compose/Compose.style.cjs +1 -1
  8. package/dist/BoxSelectionGroup/components/Item/components/Compose/Compose.style.js +1 -1
  9. package/dist/Button/Button.style.cjs +4 -0
  10. package/dist/Button/Button.style.js +4 -0
  11. package/dist/ButtonGroup/components/Button/Button.style.cjs +1 -1
  12. package/dist/ButtonGroup/components/Button/Button.style.js +1 -1
  13. package/dist/Drawer/Drawer.cjs +12 -2
  14. package/dist/Drawer/Drawer.js +12 -2
  15. package/dist/Drawer/components/Content/Content.style.cjs +1 -1
  16. package/dist/Drawer/components/Content/Content.style.js +1 -1
  17. package/dist/Drawer/components/Overlay/Overlay.style.cjs +1 -1
  18. package/dist/Drawer/components/Overlay/Overlay.style.js +1 -1
  19. package/dist/Drawer/hooks/useReducedMotionLifecycleSync.cjs +41 -0
  20. package/dist/Drawer/hooks/useReducedMotionLifecycleSync.d.ts +15 -0
  21. package/dist/Drawer/hooks/useReducedMotionLifecycleSync.js +41 -0
  22. package/dist/HighlightedIcon/HighlightedIcon.cjs +2 -2
  23. package/dist/HighlightedIcon/HighlightedIcon.d.ts +1 -1
  24. package/dist/HighlightedIcon/HighlightedIcon.js +2 -2
  25. package/dist/HighlightedIcon/HighlightedIcon.style.cjs +6 -6
  26. package/dist/HighlightedIcon/HighlightedIcon.style.d.ts +2 -2
  27. package/dist/HighlightedIcon/HighlightedIcon.style.js +6 -6
  28. package/dist/HighlightedIcon/HighlightedIcon.types.d.ts +2 -2
  29. package/dist/Inputs/components/Compose/Compose.style.cjs +1 -1
  30. package/dist/Inputs/components/Compose/Compose.style.js +1 -1
  31. package/dist/Loader/Loader.cjs +2 -2
  32. package/dist/Loader/Loader.js +2 -2
  33. package/dist/Loader/Loader.types.d.ts +2 -1
  34. package/dist/Loader/index.d.ts +1 -0
  35. package/dist/Menu/components/Trigger/components/Arrow/Arrow.style.cjs +1 -1
  36. package/dist/Menu/components/Trigger/components/Arrow/Arrow.style.js +1 -1
  37. package/dist/Popover/components/Content/components/WindowBar/WindowBar.types.d.ts +3 -2
  38. package/dist/Popover/components/Content/components/WindowBar/components/Compose/Compose.style.d.ts +2 -3
  39. package/dist/Popover/components/Content/components/WindowBar/components/Compose/Compose.types.d.ts +2 -2
  40. package/dist/ProgressBar/ProgressBar.style.cjs +1 -1
  41. package/dist/ProgressBar/ProgressBar.style.js +1 -1
  42. package/dist/SearchBar/components/FiltersSection/FiltersSection.style.cjs +1 -1
  43. package/dist/SearchBar/components/FiltersSection/FiltersSection.style.js +1 -1
  44. package/dist/SearchBar/components/SearchSection/components/Actions/components/ColumnSelector/ColumnSelector.cjs +2 -0
  45. package/dist/SearchBar/components/SearchSection/components/Actions/components/ColumnSelector/ColumnSelector.js +2 -0
  46. package/dist/Section/components/Header/components/CollapseButton/CollapseButton.style.cjs +1 -1
  47. package/dist/Section/components/Header/components/CollapseButton/CollapseButton.style.js +1 -1
  48. package/dist/Select/components/Trigger/components/Arrow/Arrow.style.cjs +1 -1
  49. package/dist/Select/components/Trigger/components/Arrow/Arrow.style.js +1 -1
  50. package/dist/Select/components/Trigger/components/Compose/Compose.style.cjs +1 -1
  51. package/dist/Select/components/Trigger/components/Compose/Compose.style.js +1 -1
  52. package/dist/SideBar/SideBar.cjs +3 -1
  53. package/dist/SideBar/SideBar.js +3 -1
  54. package/dist/SideBar/SideBar.style.cjs +1 -1
  55. package/dist/SideBar/SideBar.style.js +1 -1
  56. package/dist/SideBar/components/Button/Button.style.cjs +3 -3
  57. package/dist/SideBar/components/Button/Button.style.js +3 -3
  58. package/dist/SideBar/components/Divider/Divider.style.cjs +1 -1
  59. package/dist/SideBar/components/Divider/Divider.style.js +1 -1
  60. package/dist/SideBar/components/Header/Header.style.cjs +4 -0
  61. package/dist/SideBar/components/Header/Header.style.js +4 -0
  62. package/dist/SideBar/components/Item/Item.style.cjs +1 -1
  63. package/dist/SideBar/components/Item/Item.style.js +1 -1
  64. package/dist/SideBar/components/Item/components/Text/Text.style.cjs +1 -1
  65. package/dist/SideBar/components/Item/components/Text/Text.style.js +1 -1
  66. package/dist/SideBar/components/SideBarLogo/SideBarLogo.style.cjs +1 -1
  67. package/dist/SideBar/components/SideBarLogo/SideBarLogo.style.js +1 -1
  68. package/dist/Stepper/components/Step/components/Icon/Icon.style.cjs +1 -1
  69. package/dist/Stepper/components/Step/components/Icon/Icon.style.js +1 -1
  70. package/dist/Switch/components/Switcher/Switcher.style.cjs +3 -0
  71. package/dist/Switch/components/Switcher/Switcher.style.js +3 -0
  72. package/dist/ThemeModeSwitch/ThemeModeSwitch.style.cjs +1 -1
  73. package/dist/ThemeModeSwitch/ThemeModeSwitch.style.js +1 -1
  74. package/dist/Toast/Toaster.cjs +30 -4
  75. package/dist/Toast/Toaster.js +30 -4
  76. package/dist/Toast/Toaster.style.cjs +1 -1
  77. package/dist/Toast/Toaster.style.js +1 -1
  78. package/dist/Toast/components/ReducedMotionTransition/ReducedMotionTransition.cjs +22 -0
  79. package/dist/Toast/components/ReducedMotionTransition/ReducedMotionTransition.d.ts +3 -0
  80. package/dist/Toast/components/ReducedMotionTransition/ReducedMotionTransition.js +22 -0
  81. package/dist/Toast/core/mapping.helpers.cjs +9 -0
  82. package/dist/Toast/core/mapping.helpers.js +9 -0
  83. package/package.json +3 -3
  84. package/skills/redis-ui-components/references/Loader.md +14 -8
  85. package/skills/redis-ui-components/references/Popover.md +1 -1
  86. package/skills/redis-ui-components/references/Tooltip.md +1 -1
@@ -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.2",
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"
@@ -12,7 +12,7 @@ import { Loader } from '@redislabsdev/redis-ui-components';
12
12
 
13
13
  | Prop | Type | Default | Description |
14
14
  |------|------|---------|-------------|
15
- | size | `string` | theme default | Custom loader size |
15
+ | size | `LoaderSize` | `'XL'` | Predefined loader size |
16
16
  | inline | `boolean` | `false` | Renders the loader inline with surrounding content |
17
17
  | loaderText | `string` | - | Text shown next to the loader |
18
18
  | dataTestId | `string` | - | Deprecated test id for the SVG element |
@@ -23,6 +23,10 @@ import { Loader } from '@redislabsdev/redis-ui-components';
23
23
 
24
24
  `'regular' | 'pending' | 'inverse'`
25
25
 
26
+ ### `LoaderSize`
27
+
28
+ `'XS' | 'S' | 'M' | 'L' | 'XL'`
29
+
26
30
  ## Examples
27
31
 
28
32
  ### Playground
@@ -30,20 +34,22 @@ import { Loader } from '@redislabsdev/redis-ui-components';
30
34
  ```tsx
31
35
  import { Loader } from '@redislabsdev/redis-ui-components';
32
36
 
33
- <Loader size="5rem" inline={false} loaderText="" variant="regular" />
37
+ <Loader size="XL" inline={false} loaderText="" variant="regular" />
34
38
  ```
35
39
 
36
- ### CustomSize
40
+ ### Sizes
37
41
 
38
- > Loaders can have a custom size by providing a value to the `size` prop. If you do not provide a value to the `size` prop, the size of the loader will be set to `5rem`.
42
+ > Loaders support predefined t-shirt sizes. If you do not provide a value to the `size` prop, the size of the loader will default to `XL`.
39
43
 
40
44
  ```tsx
41
45
  import { Loader } from '@redislabsdev/redis-ui-components';
42
46
 
43
47
  <>
44
- <Loader size="3rem" />
45
- <Loader />
46
- <Loader size="7rem" />
48
+ <Loader size="XS" />
49
+ <Loader size="S" />
50
+ <Loader size="M" />
51
+ <Loader size="L" />
52
+ <Loader size="XL" />
47
53
  </>
48
54
  ```
49
55
 
@@ -94,7 +100,7 @@ const inverseBackground = theme.semantic.color.icon.neutral500;
94
100
 
95
101
  ## Notes
96
102
 
97
- - `size` falls back to the theme default when omitted.
103
+ - `size` falls back to `M` when omitted.
98
104
  - `loaderText` replaces the hidden accessibility label.
99
105
  - `inline` changes the layout but not the loading semantics.
100
106
  - `dataTestId` is deprecated; use `data-testid` instead.
@@ -506,7 +506,7 @@ function AsyncContentComponent() {
506
506
  }, []);
507
507
 
508
508
  return loading ? (
509
- <Loader size="15" />
509
+ <Loader size="S" />
510
510
  ) : (
511
511
  <div>
512
512
  <p>Async content:</p>
@@ -550,7 +550,7 @@ function AsyncContentComponent() {
550
550
  }, []);
551
551
 
552
552
  return loading ? (
553
- <Loader size="15" />
553
+ <Loader size="S" />
554
554
  ) : (
555
555
  <div>
556
556
  <p>Async content:</p>