@wistia/ui 0.8.24-beta.04ae01e6.4365e98 → 0.8.24

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/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  /*
3
- * @license @wistia/ui v0.8.24-beta.04ae01e6.4365e98
3
+ * @license @wistia/ui v0.8.24
4
4
  *
5
5
  * Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
6
6
  *
@@ -10978,36 +10978,6 @@ var useFocusRestore = () => {
10978
10978
 
10979
10979
  // src/components/Modal/ModalContent.tsx
10980
10980
  var import_jsx_runtime243 = require("react/jsx-runtime");
10981
- var alignTopStyles = import_styled_components64.css`
10982
- --wui-modal-translate-y: 0;
10983
-
10984
- top: 0;
10985
- `;
10986
- var alignVerticalCenterStyles = import_styled_components64.css`
10987
- --wui-modal-translate-y: -50%;
10988
-
10989
- top: 50%;
10990
- `;
10991
- var alignBottomStyles = import_styled_components64.css`
10992
- --wui-modal-translate-y: 0;
10993
-
10994
- bottom: 0;
10995
- `;
10996
- var alignHorizontalCenterStyles = import_styled_components64.css`
10997
- --wui-modal-translate-x: -50%;
10998
-
10999
- left: 50%;
11000
- `;
11001
- var alignRightStyles = import_styled_components64.css`
11002
- --wui-modal-translate-x: 0;
11003
-
11004
- right: 0;
11005
- `;
11006
- var alignLeftStyles = import_styled_components64.css`
11007
- --wui-modal-translate-x: 0;
11008
-
11009
- left: 0;
11010
- `;
11011
10981
  var StyledModalContent = (0, import_styled_components64.default)(import_react_dialog3.Content)`
11012
10982
  background-color: var(--wui-color-bg-app);
11013
10983
  box-sizing: border-box;
@@ -11023,48 +10993,39 @@ var StyledModalContent = (0, import_styled_components64.default)(import_react_di
11023
10993
  z-index: var(--wui-zindex-modal);
11024
10994
 
11025
10995
  ${mq.smAndUp} {
11026
- --wui-modal-screen-offset: var(--wui-space-05);
11027
- --wui-modal-max-height: calc(100vh - var(--wui-modal-screen-offset) * 2);
11028
- --wui-modal-max-width: calc(100vw - var(--wui-modal-screen-offset) * 2);
11029
-
11030
- top: unset;
11031
- left: unset;
11032
- ${({ $alignVertical }) => $alignVertical === "top" && alignTopStyles}
11033
- ${({ $alignVertical }) => $alignVertical === "center" && alignVerticalCenterStyles}
11034
- ${({ $alignVertical }) => $alignVertical === "bottom" && alignBottomStyles}
11035
- ${({ $alignHorizontal }) => $alignHorizontal === "center" && alignHorizontalCenterStyles}
11036
- ${({ $alignHorizontal }) => $alignHorizontal === "right" && alignRightStyles}
11037
- ${({ $alignHorizontal }) => $alignHorizontal === "left" && alignLeftStyles}
11038
- animation: contentShow var(--wui-motion-duration-03) var(--wui-motion-ease-out);
10996
+ animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
11039
10997
  border-radius: var(--wui-border-radius-03);
10998
+ left: 50%;
10999
+ margin: var(--wui-space-02);
11040
11000
  height: ${({ $fullHeight }) => $fullHeight ? "min-content" : "auto"};
11041
- max-height: var(--wui-modal-max-height);
11001
+ max-height: 90vh;
11042
11002
  ${({ $fullHeight }) => $fullHeight ? "min-height: calc(100vh - 48px);" : ""}
11043
- max-width: var(--wui-modal-max-width);
11044
- translate: var(--wui-modal-translate-x) var(--wui-modal-translate-y);
11003
+ max-width: 90vw;
11004
+ top: 50%;
11005
+ transform: translate(-50%, -50%);
11045
11006
  min-width: ${({ $width }) => $width ?? DEFAULT_MODAL_WIDTH};
11046
11007
  width: ${({ $width }) => $width ?? DEFAULT_MODAL_WIDTH};
11047
11008
  }
11048
11009
 
11049
11010
  @keyframes contentShow {
11050
11011
  from {
11051
- scale: 0.96;
11012
+ opacity: 0;
11013
+ transform: translate(-50%, -48%) scale(0.96);
11052
11014
  }
11053
11015
 
11054
11016
  to {
11055
- scale: 1;
11017
+ opacity: 1;
11018
+ transform: translate(-50%, -50%) scale(1);
11056
11019
  }
11057
11020
  }
11058
11021
  `;
11059
11022
  var ModalContent = (0, import_react52.forwardRef)(
11060
- ({ fullHeight, width, alignHorizontal, alignVertical, children, ...props }, ref) => {
11023
+ ({ fullHeight, width, children, ...props }, ref) => {
11061
11024
  useFocusRestore();
11062
11025
  return /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(
11063
11026
  StyledModalContent,
11064
11027
  {
11065
11028
  ref,
11066
- $alignHorizontal: alignHorizontal,
11067
- $alignVertical: alignVertical,
11068
11029
  $fullHeight: fullHeight,
11069
11030
  $width: width,
11070
11031
  "aria-describedby": void 0,
@@ -11079,6 +11040,7 @@ var ModalContent = (0, import_react52.forwardRef)(
11079
11040
  var import_react53 = require("react");
11080
11041
  var import_styled_components65 = __toESM(require("styled-components"));
11081
11042
  var import_jsx_runtime244 = require("react/jsx-runtime");
11043
+ var backdropAnimationDuration = 150;
11082
11044
  var alignVerticalMap = {
11083
11045
  stretch: "normal",
11084
11046
  top: "start",
@@ -11092,7 +11054,9 @@ var alignHorizontalMap = {
11092
11054
  };
11093
11055
  var BackdropComponent = import_styled_components65.default.div`
11094
11056
  align-items: ${({ $alignVertical }) => alignVerticalMap[$alignVertical]};
11095
- animation-name: backdropShow var(--wui-motion-duration-03) var(--wui-motion-ease-out);
11057
+ animation-name: backdropShow;
11058
+ animation-duration: ${() => `${backdropAnimationDuration}ms`};
11059
+ animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
11096
11060
  background: var(--wui-color-backdrop);
11097
11061
  display: flex;
11098
11062
  inset: 0;
@@ -11136,7 +11100,6 @@ var DEFAULT_MODAL_WIDTH = "532px";
11136
11100
  var ModalBody = import_styled_components66.default.div`
11137
11101
  flex-direction: column;
11138
11102
  display: flex;
11139
- flex: 1 0 0;
11140
11103
  order: 2;
11141
11104
  `;
11142
11105
  var Modal = (0, import_react54.forwardRef)(
@@ -11150,8 +11113,6 @@ var Modal = (0, import_react54.forwardRef)(
11150
11113
  onRequestClose,
11151
11114
  title,
11152
11115
  width = DEFAULT_MODAL_WIDTH,
11153
- alignHorizontal = "center",
11154
- alignVertical = "center",
11155
11116
  ...props
11156
11117
  }, ref) => {
11157
11118
  return /* @__PURE__ */ (0, import_jsx_runtime245.jsx)(
@@ -11169,8 +11130,6 @@ var Modal = (0, import_react54.forwardRef)(
11169
11130
  ModalContent,
11170
11131
  {
11171
11132
  ref,
11172
- alignHorizontal,
11173
- alignVertical,
11174
11133
  fullHeight,
11175
11134
  onOpenAutoFocus: (event) => {
11176
11135
  if ((0, import_type_guards42.isNotNil)(initialFocusRef) && initialFocusRef.current) {