@hlf-fe/pulmo-ui 1.5.10 → 1.5.11

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.
@@ -8,6 +8,7 @@ export type ContainerProps = {
8
8
  innerContainerWidth?: string;
9
9
  alignBlock?: "center" | "left";
10
10
  innerWidth?: number;
11
+ gutters?: boolean;
11
12
  } & CSSTypes;
12
13
  export declare const Container: import("react").ForwardRefExoticComponent<{
13
14
  children: ReactNode;
@@ -16,5 +17,6 @@ export declare const Container: import("react").ForwardRefExoticComponent<{
16
17
  innerContainerWidth?: string;
17
18
  alignBlock?: "center" | "left";
18
19
  innerWidth?: number;
20
+ gutters?: boolean;
19
21
  } & CSSTypes & import("react").RefAttributes<HTMLDivElement>>;
20
22
  export {};
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
- import { siteWidthRow, siteWidthRowMd, siteWidthRowXL, siteWidthRowS, siteWidthRowAuto, } from "../../../styles/mixins";
3
+ import { siteWidthRow, siteWidthRowMd, siteWidthRowXL, siteWidthRowS, siteWidthRowAuto, siteWidthOnly, } from "../../../styles/mixins";
4
4
  import { rem } from "../../../styles/units";
5
5
  import styled from "styled-components";
6
6
  const MAX_WIDTH = {
@@ -22,14 +22,15 @@ const getMaxWidth = (size) => {
22
22
  const getInnerWidth = (size) => {
23
23
  return INNER_WIDTH?.[size];
24
24
  };
25
- export const Container = forwardRef(({ children, className, maxWidth = "lg", position = "static", display = "block", alignBlock = "center", innerWidth, }, ref) => {
25
+ export const Container = forwardRef(({ children, className, maxWidth = "lg", position = "static", display = "block", alignBlock = "center", innerWidth, gutters = true, }, ref) => {
26
26
  const containerWidth = alignBlock === "left" ? "lg" : maxWidth;
27
27
  const innerContainerWidth = alignBlock == "left" ? getInnerWidth(maxWidth) : innerWidth;
28
28
  const content = innerContainerWidth ? (_jsx(Inner, { "$innerContainerWidth": innerContainerWidth, children: children })) : (children);
29
- return (_jsx(Div, { ref: ref, className: className, "$maxWidth": getMaxWidth(containerWidth), "$display": display, "$position": position, children: content }));
29
+ return (_jsx(Div, { ref: ref, className: className, "$maxWidth": getMaxWidth(containerWidth), "$display": display, "$position": position, "$gutters": gutters, "$size": containerWidth, children: content }));
30
30
  });
31
31
  const Div = styled.div `
32
- ${({ $maxWidth }) => $maxWidth};
32
+ ${({ $maxWidth, $gutters }) => $gutters && $maxWidth};
33
+ ${({ $gutters, $size }) => !$gutters && $size && siteWidthOnly($size)};
33
34
  display: ${({ $display }) => $display};
34
35
  position: ${({ $position }) => $position};
35
36
  `;
package/dist/index.d.ts CHANGED
@@ -41,11 +41,12 @@ export declare const EmailSignupForm: import("react").FC<EmailSignupFormProps>;
41
41
  export declare const Image: import("react").FC<ImageProps>;
42
42
  export declare const Container: import("react").ForwardRefExoticComponent<{
43
43
  children: import("react").ReactNode;
44
- maxWidth?: "auto" | "sm" | "md" | "lg" | "xl";
44
+ maxWidth?: "sm" | "md" | "lg" | "xl" | "auto";
45
45
  className?: string;
46
46
  innerContainerWidth?: string;
47
47
  alignBlock?: "center" | "left";
48
48
  innerWidth?: number;
49
+ gutters?: boolean;
49
50
  } & {
50
51
  position?: import("csstype").Property.Position | undefined;
51
52
  display?: import("csstype").Property.Display | undefined;
@@ -18,6 +18,13 @@ export declare const siteWidthRowMd: () => import("styled-components").RuleSet<o
18
18
  export declare const siteWidthRow: () => import("styled-components").RuleSet<object>;
19
19
  export declare const siteWidthRowXL: () => import("styled-components").RuleSet<object>;
20
20
  export declare const siteWidthRowAuto: () => import("styled-components").RuleSet<object>;
21
+ /**
22
+ * Returns only max-width without any gutters (margin/padding).
23
+ * Use this when embedding content inside an existing container.
24
+ * Includes margin: 0 auto for centering when max-width is set.
25
+ */
26
+ export type SiteWidthSize = "sm" | "md" | "lg" | "xl" | "auto";
27
+ export declare const siteWidthOnly: (size: SiteWidthSize) => import("styled-components").RuleSet<object>;
21
28
  export declare const fullWidthRow: () => import("styled-components").RuleSet<object>;
22
29
  export declare const fontSize: {
23
30
  XS: () => import("styled-components").RuleSet<object>;
@@ -165,6 +165,21 @@ export const siteWidthRowXL = () => css `
165
165
  export const siteWidthRowAuto = () => css `
166
166
  width: auto;
167
167
  `;
168
+ const SITE_WIDTH_VALUES = {
169
+ sm: VARIABLES.siteWidthS,
170
+ md: rem(800),
171
+ lg: VARIABLES.siteWidth,
172
+ xl: VARIABLES.siteWidthXL,
173
+ auto: "none",
174
+ };
175
+ export const siteWidthOnly = (size) => css `
176
+ max-width: ${SITE_WIDTH_VALUES[size]};
177
+ ${size !== "auto" &&
178
+ css `
179
+ margin-left: auto;
180
+ margin-right: auto;
181
+ `}
182
+ `;
168
183
  export const fullWidthRow = () => css `
169
184
  padding-top: ${SPACING.spacingL};
170
185
  padding-right: ${SPACING.spacingXS};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hlf-fe/pulmo-ui",
3
3
  "private": false,
4
- "version": "1.5.10",
4
+ "version": "1.5.11",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",