@mitodl/smoot-design 1.2.0 → 1.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.
@@ -7,7 +7,7 @@ const Grid2_1 = require("@mui/material/Grid2");
7
7
  const Stack_1 = require("@mui/material/Stack");
8
8
  const react_1 = require("@remixicon/react");
9
9
  const test_1 = require("@storybook/test");
10
- const story_utils_1 = require("@/story-utils");
10
+ const story_utils_1 = require("../../story-utils");
11
11
  const ICONS = {
12
12
  None: undefined,
13
13
  ArrowBackIcon: React.createElement(react_1.RiArrowLeftLine, null),
@@ -7,7 +7,7 @@ const Grid2_1 = require("@mui/material/Grid2");
7
7
  const Stack_1 = require("@mui/material/Stack");
8
8
  const react_1 = require("@remixicon/react");
9
9
  const test_1 = require("@storybook/test");
10
- const story_utils_1 = require("@/story-utils");
10
+ const story_utils_1 = require("../../story-utils");
11
11
  const ICONS = {
12
12
  None: undefined,
13
13
  ArrowBackIcon: React.createElement(react_1.RiArrowLeftLine, null),
@@ -7,7 +7,7 @@ const Stack_1 = require("@mui/material/Stack");
7
7
  const Grid2_1 = require("@mui/material/Grid2");
8
8
  const react_1 = require("@remixicon/react");
9
9
  const test_1 = require("@storybook/test");
10
- const story_utils_1 = require("@/story-utils");
10
+ const story_utils_1 = require("../../story-utils");
11
11
  const Typography_1 = require("@mui/material/Typography");
12
12
  const SIZES = (0, story_utils_1.enumValues)({
13
13
  small: true,
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ScrollSnap = void 0;
4
- const composeRefs_1 = require("@/utils/composeRefs");
4
+ const composeRefs_1 = require("../../utils/composeRefs");
5
5
  const styled_1 = require("@emotion/styled");
6
6
  const React = require("react");
7
7
  /**
@@ -36,14 +36,16 @@ const ScrollSnap = React.forwardRef(function ScrollSnap({ children, threshold =
36
36
  * 3. Then scroll to bottom (if needed)
37
37
  *
38
38
  * In this way, we can measure the scroll position before the new content is set.
39
+ *
40
+ * In React 19, this started requiring useLayoutEffect.
39
41
  */
40
- React.useEffect(() => {
42
+ React.useLayoutEffect(() => {
41
43
  if (!el.current)
42
44
  return;
43
45
  wasAtBottom.current = distanceFromBottom(el.current) < threshold;
44
46
  setContent(children);
45
47
  }, [children, threshold]);
46
- React.useEffect(() => {
48
+ React.useLayoutEffect(() => {
47
49
  if (!el.current)
48
50
  return;
49
51
  const atBottom = distanceFromBottom(el.current) < threshold;
@@ -5,7 +5,7 @@ const React = require("react");
5
5
  const ScrollSnap_1 = require("./ScrollSnap");
6
6
  const styled_1 = require("@emotion/styled");
7
7
  const en_1 = require("@faker-js/faker/locale/en");
8
- const useInterval_1 = require("@/utils/useInterval");
8
+ const useInterval_1 = require("../../utils/useInterval");
9
9
  const Slider_1 = require("@mui/material/Slider");
10
10
  const Stack_1 = require("@mui/material/Stack");
11
11
  const Typography_1 = require("@mui/material/Typography");
@@ -4,7 +4,7 @@ exports.SrAnnouncer = void 0;
4
4
  const React = require("react");
5
5
  const VisuallyHidden_1 = require("../VisuallyHidden/VisuallyHidden");
6
6
  const react_1 = require("react");
7
- const useDevCheckStable_1 = require("@/utils/useDevCheckStable");
7
+ const useDevCheckStable_1 = require("../../utils/useDevCheckStable");
8
8
  const DEFAULT_PROPS = {
9
9
  loadingMessages: [
10
10
  { delay: 1500, text: "Loading" },
@@ -8,7 +8,7 @@ const Stack_1 = require("@mui/material/Stack");
8
8
  const Grid_1 = require("@mui/material/Grid");
9
9
  const react_1 = require("@remixicon/react");
10
10
  const test_1 = require("@storybook/test");
11
- const story_utils_1 = require("@/story-utils");
11
+ const story_utils_1 = require("../../story-utils");
12
12
  const SIZES = (0, story_utils_1.enumValues)({
13
13
  small: true,
14
14
  medium: true,
@@ -14,7 +14,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
14
14
  const React = require("react");
15
15
  const react_1 = require("@testing-library/react");
16
16
  const FormHelpers_1 = require("./FormHelpers");
17
- const ThemeProvider_1 = require("@/components/ThemeProvider/ThemeProvider");
17
+ const ThemeProvider_1 = require("../../../components/ThemeProvider/ThemeProvider");
18
18
  const en_1 = require("@faker-js/faker/locale/en");
19
19
  const assertDescription = ({ text, total, exists, }) => {
20
20
  var _a;
@@ -4,7 +4,7 @@ import Grid from "@mui/material/Grid2";
4
4
  import Stack from "@mui/material/Stack";
5
5
  import { RiArrowLeftLine, RiDeleteBinLine, RiTestTubeLine, } from "@remixicon/react";
6
6
  import { fn } from "@storybook/test";
7
- import { enumValues } from "@/story-utils";
7
+ import { enumValues } from "../../story-utils";
8
8
  const ICONS = {
9
9
  None: undefined,
10
10
  ArrowBackIcon: React.createElement(RiArrowLeftLine, null),
@@ -4,7 +4,7 @@ import Grid from "@mui/material/Grid2";
4
4
  import Stack from "@mui/material/Stack";
5
5
  import { RiArrowLeftLine, RiDeleteBinLine, RiTestTubeLine, RiMailLine, } from "@remixicon/react";
6
6
  import { fn } from "@storybook/test";
7
- import { enumValues } from "@/story-utils";
7
+ import { enumValues } from "../../story-utils";
8
8
  const ICONS = {
9
9
  None: undefined,
10
10
  ArrowBackIcon: React.createElement(RiArrowLeftLine, null),
@@ -4,7 +4,7 @@ import Stack from "@mui/material/Stack";
4
4
  import Grid from "@mui/material/Grid2";
5
5
  import { RiCalendarLine, RiCloseLine, RiSearchLine } from "@remixicon/react";
6
6
  import { fn } from "@storybook/test";
7
- import { enumValues } from "@/story-utils";
7
+ import { enumValues } from "../../story-utils";
8
8
  import Typography from "@mui/material/Typography";
9
9
  const SIZES = enumValues({
10
10
  small: true,
@@ -1,4 +1,4 @@
1
- import { composeRefs } from "@/utils/composeRefs";
1
+ import { composeRefs } from "../../utils/composeRefs";
2
2
  import styled from "@emotion/styled";
3
3
  import * as React from "react";
4
4
  /**
@@ -33,14 +33,16 @@ const ScrollSnap = React.forwardRef(function ScrollSnap({ children, threshold =
33
33
  * 3. Then scroll to bottom (if needed)
34
34
  *
35
35
  * In this way, we can measure the scroll position before the new content is set.
36
+ *
37
+ * In React 19, this started requiring useLayoutEffect.
36
38
  */
37
- React.useEffect(() => {
39
+ React.useLayoutEffect(() => {
38
40
  if (!el.current)
39
41
  return;
40
42
  wasAtBottom.current = distanceFromBottom(el.current) < threshold;
41
43
  setContent(children);
42
44
  }, [children, threshold]);
43
- React.useEffect(() => {
45
+ React.useLayoutEffect(() => {
44
46
  if (!el.current)
45
47
  return;
46
48
  const atBottom = distanceFromBottom(el.current) < threshold;
@@ -2,7 +2,7 @@ import * as React from "react";
2
2
  import { ScrollSnap } from "./ScrollSnap";
3
3
  import styled from "@emotion/styled";
4
4
  import { faker } from "@faker-js/faker/locale/en";
5
- import { useInterval } from "@/utils/useInterval";
5
+ import { useInterval } from "../../utils/useInterval";
6
6
  import Slider from "@mui/material/Slider";
7
7
  import Stack from "@mui/material/Stack";
8
8
  import Typography from "@mui/material/Typography";
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
2
  import { VisuallyHidden } from "../VisuallyHidden/VisuallyHidden";
3
3
  import { useEffect } from "react";
4
- import { useDevCheckStable } from "@/utils/useDevCheckStable";
4
+ import { useDevCheckStable } from "../../utils/useDevCheckStable";
5
5
  const DEFAULT_PROPS = {
6
6
  loadingMessages: [
7
7
  { delay: 1500, text: "Loading" },
@@ -5,7 +5,7 @@ import Stack from "@mui/material/Stack";
5
5
  import Grid from "@mui/material/Grid";
6
6
  import { RiSearchLine, RiCalendarLine, RiCloseLine } from "@remixicon/react";
7
7
  import { fn } from "@storybook/test";
8
- import { enumValues } from "@/story-utils";
8
+ import { enumValues } from "../../story-utils";
9
9
  const SIZES = enumValues({
10
10
  small: true,
11
11
  medium: true,
@@ -12,7 +12,7 @@ var __rest = (this && this.__rest) || function (s, e) {
12
12
  import * as React from "react";
13
13
  import { render, screen } from "@testing-library/react";
14
14
  import { FormFieldWrapper } from "./FormHelpers";
15
- import { ThemeProvider } from "@/components/ThemeProvider/ThemeProvider";
15
+ import { ThemeProvider } from "../../../components/ThemeProvider/ThemeProvider";
16
16
  import { faker } from "@faker-js/faker/locale/en";
17
17
  const assertDescription = ({ text, total, exists, }) => {
18
18
  var _a;