@wistia/ui 0.8.24 → 0.8.25-beta.4819d442.362e6db

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