@shoplflow/base 0.26.1 → 0.26.3

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.d.cts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as React$1 from 'react';
3
- import React__default, { ElementType, ComponentPropsWithoutRef, ReactNode, ReactElement, ImgHTMLAttributes, ComponentPropsWithRef, CSSProperties, HTMLAttributes, InputHTMLAttributes, MouseEvent, Ref } from 'react';
3
+ import React__default, { ElementType, ComponentPropsWithoutRef, ReactNode, ReactElement, ImgHTMLAttributes, ForwardRefExoticComponent, PropsWithoutRef, RefAttributes, CSSProperties, HTMLAttributes, ComponentPropsWithRef, InputHTMLAttributes, MouseEvent, Ref } from 'react';
4
4
  import { $Values } from '@shoplflow/utils';
5
5
  import { IconSource } from '@shoplflow/shopl-assets';
6
6
  import { IconSource as IconSource$1 } from '@shoplflow/hada-assets';
@@ -279,7 +279,7 @@ interface AvatarOptionProps extends SizeVariantProps<AvatarSizeVariantType>, Img
279
279
  declare const Avatar: ({ src, badge, ...rest }: AvatarProps) => react_jsx_runtime.JSX.Element;
280
280
 
281
281
  declare type StackGenericProps<T extends StringElementType = 'div'> = RenderConfigProps & StackProps & HTMLPropsWithoutRef<T>;
282
- declare type StackComponentType = <T extends StringElementType = 'div'>(props: StackGenericProps<T> & Pick<ComponentPropsWithRef<T>, 'ref'>) => ReactElement | null;
282
+ declare type StackComponentType = ForwardRefExoticComponent<PropsWithoutRef<StackGenericProps> & RefAttributes<HTMLElement>>;
283
283
  declare type MotionStackComponentType<T extends StringElementType = 'div'> = CustomDomComponent<RenderConfigProps & HTMLPropsWithoutRef<T> & StackProps>;
284
284
  interface StackProps extends StackOptionProps, ChildrenProps {
285
285
  }
@@ -350,7 +350,7 @@ declare const StyledStack: _emotion_styled.StyledComponent<{
350
350
  } & StackOptionProps, React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
351
351
 
352
352
  declare type StackContainerGenericProps<T extends StringElementType = 'div'> = RenderConfigProps & StackContainerProps & HTMLPropsWithoutRef<T>;
353
- declare type StackContainerComponentType = <T extends StringElementType = 'div'>(props: StackContainerGenericProps<T> & Pick<ComponentPropsWithRef<T>, 'ref'>) => ReactElement | null;
353
+ declare type StackContainerComponentType = ForwardRefExoticComponent<PropsWithoutRef<StackContainerGenericProps> & RefAttributes<HTMLElement>>;
354
354
  declare type MotionStackContainerComponentType<T extends StringElementType = 'div'> = CustomDomComponent<RenderConfigProps & HTMLPropsWithoutRef<T> & StackContainerProps>;
355
355
  interface StackContainerProps extends StackContainerOptionProps, ChildrenProps {
356
356
  }
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as React$1 from 'react';
3
- import React__default, { ElementType, ComponentPropsWithoutRef, ReactNode, ReactElement, ImgHTMLAttributes, ComponentPropsWithRef, CSSProperties, HTMLAttributes, InputHTMLAttributes, MouseEvent, Ref } from 'react';
3
+ import React__default, { ElementType, ComponentPropsWithoutRef, ReactNode, ReactElement, ImgHTMLAttributes, ForwardRefExoticComponent, PropsWithoutRef, RefAttributes, CSSProperties, HTMLAttributes, ComponentPropsWithRef, InputHTMLAttributes, MouseEvent, Ref } from 'react';
4
4
  import { $Values } from '@shoplflow/utils';
5
5
  import { IconSource } from '@shoplflow/shopl-assets';
6
6
  import { IconSource as IconSource$1 } from '@shoplflow/hada-assets';
@@ -279,7 +279,7 @@ interface AvatarOptionProps extends SizeVariantProps<AvatarSizeVariantType>, Img
279
279
  declare const Avatar: ({ src, badge, ...rest }: AvatarProps) => react_jsx_runtime.JSX.Element;
280
280
 
281
281
  declare type StackGenericProps<T extends StringElementType = 'div'> = RenderConfigProps & StackProps & HTMLPropsWithoutRef<T>;
282
- declare type StackComponentType = <T extends StringElementType = 'div'>(props: StackGenericProps<T> & Pick<ComponentPropsWithRef<T>, 'ref'>) => ReactElement | null;
282
+ declare type StackComponentType = ForwardRefExoticComponent<PropsWithoutRef<StackGenericProps> & RefAttributes<HTMLElement>>;
283
283
  declare type MotionStackComponentType<T extends StringElementType = 'div'> = CustomDomComponent<RenderConfigProps & HTMLPropsWithoutRef<T> & StackProps>;
284
284
  interface StackProps extends StackOptionProps, ChildrenProps {
285
285
  }
@@ -350,7 +350,7 @@ declare const StyledStack: _emotion_styled.StyledComponent<{
350
350
  } & StackOptionProps, React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
351
351
 
352
352
  declare type StackContainerGenericProps<T extends StringElementType = 'div'> = RenderConfigProps & StackContainerProps & HTMLPropsWithoutRef<T>;
353
- declare type StackContainerComponentType = <T extends StringElementType = 'div'>(props: StackContainerGenericProps<T> & Pick<ComponentPropsWithRef<T>, 'ref'>) => ReactElement | null;
353
+ declare type StackContainerComponentType = ForwardRefExoticComponent<PropsWithoutRef<StackContainerGenericProps> & RefAttributes<HTMLElement>>;
354
354
  declare type MotionStackContainerComponentType<T extends StringElementType = 'div'> = CustomDomComponent<RenderConfigProps & HTMLPropsWithoutRef<T> & StackContainerProps>;
355
355
  interface StackContainerProps extends StackContainerOptionProps, ChildrenProps {
356
356
  }
package/dist/index.js CHANGED
@@ -589,7 +589,7 @@ var createStackComponent2 = (stackOption) => forwardRef(function Stack2(_j, ref)
589
589
  margin,
590
590
  padding
591
591
  }, rest), {
592
- "data-shoplflow": "Stack",
592
+ "data-shoplflow": "StackContainer",
593
593
  children: rest.children
594
594
  })
595
595
  );
@@ -698,13 +698,19 @@ var getModalWidthFromSize = (size2) => {
698
698
  return MODAL_SIZE_M;
699
699
  }
700
700
  };
701
- var getModalBodyTopBottomPadding = (isIncludeHeader) => {
701
+ var getModalBodyTopBottomPadding = (isIncludeHeader, sizeVar) => {
702
702
  if (isIncludeHeader) {
703
703
  return css`
704
704
  padding-top: 16px;
705
705
  padding-bottom: 24px;
706
706
  `;
707
707
  }
708
+ if (sizeVar === "FULL") {
709
+ return css`
710
+ padding-top: 0;
711
+ padding-bottom: 0;
712
+ `;
713
+ }
708
714
  return css`
709
715
  padding-top: 24px;
710
716
  padding-bottom: 24px;
@@ -770,7 +776,7 @@ var BodyContainer = styled6.div`
770
776
  min-height: ${({ minHeight }) => minHeight}px;
771
777
  max-height: ${({ maxHeight }) => maxHeight}px;
772
778
  flex: 1;
773
- ${({ isIncludeHeader }) => getModalBodyTopBottomPadding(isIncludeHeader)}
779
+ ${({ isIncludeHeader, sizeVar }) => getModalBodyTopBottomPadding(isIncludeHeader, sizeVar)}
774
780
  `;
775
781
  var ModalBodyContainerInner = styled6.div`
776
782
  display: grid;
@@ -787,6 +793,9 @@ var ModalBodyContent = styled6.div`
787
793
  height: 100%;
788
794
  box-sizing: border-box;
789
795
  padding: 0 24px;
796
+ ${({ sizeVar }) => sizeVar === "FULL" && css`
797
+ padding: 0;
798
+ `};
790
799
  background: ${colorTokens.neutral0};
791
800
  `;
792
801
  var FooterContainer = styled6.div`
@@ -970,21 +979,30 @@ var ModalBody = ({
970
979
  }
971
980
  return autoHeightMax;
972
981
  };
973
- return /* @__PURE__ */ jsx(BodyContainer, { isIncludeHeader, minHeight: setAutoHeightMin(), maxHeight: setAutoHeightMax(), children: /* @__PURE__ */ jsx(
974
- ScrollArea_default,
982
+ return /* @__PURE__ */ jsx(
983
+ BodyContainer,
975
984
  {
976
- id: `scrollbar`,
977
- universal: true,
978
- autoHeight: !modalContainerHeight,
979
- autoHeightMin: setAutoHeightMin(),
980
- autoHeightMax: setContentHeightMax(),
981
- style: {
982
- height: "100%",
983
- overflow: "hidden"
984
- },
985
- children: /* @__PURE__ */ jsx(ModalBodyContainerInner, { children: /* @__PURE__ */ jsx(ModalBodyContent, { isIncludeHeader, sizeVar, children }) })
985
+ isIncludeHeader,
986
+ sizeVar,
987
+ minHeight: setAutoHeightMin(),
988
+ maxHeight: setAutoHeightMax(),
989
+ children: /* @__PURE__ */ jsx(
990
+ ScrollArea_default,
991
+ {
992
+ id: `scrollbar`,
993
+ universal: true,
994
+ autoHeight: !modalContainerHeight,
995
+ autoHeightMin: setAutoHeightMin(),
996
+ autoHeightMax: setContentHeightMax(),
997
+ style: {
998
+ height: "100%",
999
+ overflow: "hidden"
1000
+ },
1001
+ children: /* @__PURE__ */ jsx(ModalBodyContainerInner, { children: /* @__PURE__ */ jsx(ModalBodyContent, { isIncludeHeader, sizeVar, children }) })
1002
+ }
1003
+ )
986
1004
  }
987
- ) });
1005
+ );
988
1006
  };
989
1007
  var ModalBody_default = ModalBody;
990
1008
  var ModalHeader = ({ children }) => {