visits-style 1.4.3 → 1.4.4

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.
@@ -22,6 +22,11 @@ export interface Props extends HTMLAttributes<HTMLDivElement> {
22
22
  * @default '0.85rem'
23
23
  */
24
24
  padding?: string;
25
+ /**
26
+ * モーダルの縦並びを設定します。
27
+ * @default 'center'
28
+ */
29
+ verticalAlign?: 'start' | 'center' | 'end';
25
30
  }
26
- export default function Modal({ show, children, timeout, padding, closeModal, closeOnOverlay, closeOnEsc, onExited, ...rest }: Props): import("react/jsx-runtime").JSX.Element;
31
+ export default function Modal({ show, children, timeout, padding, verticalAlign, closeModal, closeOnOverlay, closeOnEsc, onExited, ...rest }: Props): import("react/jsx-runtime").JSX.Element;
27
32
  export declare const ModalContent: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, import("../../elements/Box").Props>>;
package/dist/index.cjs.js CHANGED
@@ -853,6 +853,7 @@ function Modal({
853
853
  children,
854
854
  timeout = 200,
855
855
  padding = "0.85rem",
856
+ verticalAlign = "center",
856
857
  closeModal,
857
858
  closeOnOverlay,
858
859
  closeOnEsc,
@@ -903,7 +904,7 @@ function Modal({
903
904
  exitRef.current = onExited;
904
905
  return /* @__PURE__ */ jsxRuntime.jsx(Portal$1, { children: isMounted ? /* @__PURE__ */ jsxRuntime.jsx(Overlay, { lockScroll: true, "data-testid": "vs-modal-overlay", onClick: handleOverlayClose, style: {
905
906
  padding
906
- }, children: /* @__PURE__ */ jsxRuntime.jsx(Wrapper$2, { ref: refs.setFloating, role: "dialog", ...getFloatingProps({
907
+ }, $verticalAlign: verticalAlign, children: /* @__PURE__ */ jsxRuntime.jsx(Wrapper$2, { ref: refs.setFloating, role: "dialog", ...getFloatingProps({
907
908
  ...rest,
908
909
  style: styles,
909
910
  onClick: stopPropagation
@@ -912,7 +913,23 @@ function Modal({
912
913
  const Overlay = /* @__PURE__ */ styledComponents.styled(react.FloatingOverlay).withConfig({
913
914
  displayName: "Modal__Overlay",
914
915
  componentId: "sc-pb7lhx-0"
915
- })([" display:flex;display:grid;place-items:center;align-items:center;justify-content:center;background:", ";z-index:9997;"], ({
916
+ })([" display:flex;display:grid;place-items:", ";align-items:", ";justify-content:center;background:", ";z-index:9997;"], ({
917
+ $verticalAlign
918
+ }) => {
919
+ if ($verticalAlign === "start")
920
+ return "flex-start";
921
+ if ($verticalAlign === "end")
922
+ return "flex-end";
923
+ return "center";
924
+ }, ({
925
+ $verticalAlign
926
+ }) => {
927
+ if ($verticalAlign === "start")
928
+ return "flex-start";
929
+ if ($verticalAlign === "end")
930
+ return "flex-end";
931
+ return "center";
932
+ }, ({
916
933
  theme
917
934
  }) => theme.backdrop);
918
935
  const Wrapper$2 = /* @__PURE__ */ styledComponents.styled.div.withConfig({
@@ -1014,7 +1031,7 @@ function Toast({
1014
1031
  const ToastList = /* @__PURE__ */ styledComponents.styled.ul.withConfig({
1015
1032
  displayName: "Toast__ToastList",
1016
1033
  componentId: "sc-8192b2-0"
1017
- })(["display:flex;flex-direction:column;z-index:9999;pointer-events:none;overflow:hidden;li + li{margin-top:", ";}"], ({
1034
+ })(["display:flex;flex-direction:column;z-index:9999;overflow:hidden;li + li{margin-top:", ";}"], ({
1018
1035
  $space
1019
1036
  }) => $space);
1020
1037
 
package/dist/index.es.js CHANGED
@@ -845,6 +845,7 @@ function Modal({
845
845
  children,
846
846
  timeout = 200,
847
847
  padding = "0.85rem",
848
+ verticalAlign = "center",
848
849
  closeModal,
849
850
  closeOnOverlay,
850
851
  closeOnEsc,
@@ -895,7 +896,7 @@ function Modal({
895
896
  exitRef.current = onExited;
896
897
  return /* @__PURE__ */ jsx(Portal$1, { children: isMounted ? /* @__PURE__ */ jsx(Overlay, { lockScroll: true, "data-testid": "vs-modal-overlay", onClick: handleOverlayClose, style: {
897
898
  padding
898
- }, children: /* @__PURE__ */ jsx(Wrapper$2, { ref: refs.setFloating, role: "dialog", ...getFloatingProps({
899
+ }, $verticalAlign: verticalAlign, children: /* @__PURE__ */ jsx(Wrapper$2, { ref: refs.setFloating, role: "dialog", ...getFloatingProps({
899
900
  ...rest,
900
901
  style: styles,
901
902
  onClick: stopPropagation
@@ -904,7 +905,23 @@ function Modal({
904
905
  const Overlay = /* @__PURE__ */ styled(FloatingOverlay).withConfig({
905
906
  displayName: "Modal__Overlay",
906
907
  componentId: "sc-pb7lhx-0"
907
- })([" display:flex;display:grid;place-items:center;align-items:center;justify-content:center;background:", ";z-index:9997;"], ({
908
+ })([" display:flex;display:grid;place-items:", ";align-items:", ";justify-content:center;background:", ";z-index:9997;"], ({
909
+ $verticalAlign
910
+ }) => {
911
+ if ($verticalAlign === "start")
912
+ return "flex-start";
913
+ if ($verticalAlign === "end")
914
+ return "flex-end";
915
+ return "center";
916
+ }, ({
917
+ $verticalAlign
918
+ }) => {
919
+ if ($verticalAlign === "start")
920
+ return "flex-start";
921
+ if ($verticalAlign === "end")
922
+ return "flex-end";
923
+ return "center";
924
+ }, ({
908
925
  theme
909
926
  }) => theme.backdrop);
910
927
  const Wrapper$2 = /* @__PURE__ */ styled.div.withConfig({
@@ -1006,7 +1023,7 @@ function Toast({
1006
1023
  const ToastList = /* @__PURE__ */ styled.ul.withConfig({
1007
1024
  displayName: "Toast__ToastList",
1008
1025
  componentId: "sc-8192b2-0"
1009
- })(["display:flex;flex-direction:column;z-index:9999;pointer-events:none;overflow:hidden;li + li{margin-top:", ";}"], ({
1026
+ })(["display:flex;flex-direction:column;z-index:9999;overflow:hidden;li + li{margin-top:", ";}"], ({
1010
1027
  $space
1011
1028
  }) => $space);
1012
1029
 
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "visits-style",
3
3
  "repository": "https://github.com/visits-works/visits-style",
4
4
  "homepage": "https://github.com/visits-works/visits-style",
5
- "version": "1.4.3",
5
+ "version": "1.4.4",
6
6
  "type": "module",
7
7
  "main": "./dist/index.cjs.js",
8
8
  "module": "./dist/index.es.js",