@hlf-fe/pulmo-ui 1.5.1 → 1.5.2

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.
@@ -17,9 +17,9 @@ export type ButtonProps = {
17
17
  children: ReactNode;
18
18
  };
19
19
  export type StyledButtonProps = {
20
- inverted?: boolean;
21
- btnSize?: "s" | "m" | "l";
22
- fullWidthMobile?: boolean;
23
- fullWidth?: boolean;
20
+ $inverted?: boolean;
21
+ $btnSize?: "s" | "m" | "l";
22
+ $fullWidthMobile?: boolean;
23
+ $fullWidth?: boolean;
24
24
  };
25
25
  export declare const Button: ({ type, onClick, className, inverted, disabled, btnSize, fullWidth, fullWidthMobile, dataTest, tabIndex, children, to, href, target, }: ButtonProps) => import("react/jsx-runtime").JSX.Element;
@@ -4,18 +4,8 @@ import { media, buttonSize } from "../../../styles/mixins";
4
4
  import { rem } from "../../../styles/units";
5
5
  import { Link } from "gatsby";
6
6
  export const Button = ({ type = "submit", onClick, className = "", inverted = false, disabled = false, btnSize = "m", fullWidth, fullWidthMobile, dataTest, tabIndex, children, to, href, target, }) => {
7
- const commonProps = {
8
- className,
9
- onClick,
10
- inverted,
11
- btnSize,
12
- fullWidth,
13
- fullWidthMobile,
14
- "data-test": dataTest,
15
- tabIndex,
16
- };
17
7
  const asElement = to ? Link : href ? "a" : "button";
18
- return (_jsx(StyledButton, { as: asElement, ...commonProps, ...(to ? { to } : {}), ...(href
8
+ return (_jsx(StyledButton, { "$inverted": inverted, "$btnSize": btnSize, "$fullWidthMobile": fullWidthMobile, "$fullWidth": fullWidth, as: asElement, className: className, onClick: onClick, "data-test": dataTest, tabIndex: tabIndex, ...(to ? { to } : {}), ...(href
19
9
  ? {
20
10
  href,
21
11
  target,
@@ -31,22 +21,23 @@ const StyledButton = styled.button `
31
21
  font-family: ${({ theme }) => theme.valueBold};
32
22
  font-weight: 400;
33
23
  text-decoration: none;
34
- color: ${({ theme, inverted }) => (inverted ? theme.red : theme.white)};
35
- width: ${({ fullWidthMobile }) => (fullWidthMobile ? "100%" : "fit-content")};
36
- background-color: ${({ theme, inverted }) => inverted ? theme.white : theme.red};
24
+ color: ${({ theme, $inverted }) => ($inverted ? theme.red : theme.white)};
25
+ width: ${({ $fullWidthMobile }) => $fullWidthMobile ? "100%" : "fit-content"};
26
+ background-color: ${({ theme, $inverted }) => $inverted ? theme.white : theme.red};
37
27
  line-height: 2.5;
38
28
  border-radius: ${rem(5)};
39
- border-color: ${({ theme, inverted }) => inverted ? theme.red : "transparent"};
29
+ border-color: ${({ theme, $inverted }) => $inverted ? theme.red : "transparent"};
40
30
  transition: background-color 0.3s ease-out;
41
31
  border-style: solid;
32
+ cursor: pointer;
42
33
 
43
34
  &:disabled {
44
35
  cursor: default;
45
36
  opacity: 0.6;
46
37
  }
47
38
 
48
- ${({ btnSize }) => {
49
- switch (btnSize) {
39
+ ${({ $btnSize }) => {
40
+ switch ($btnSize) {
50
41
  case "s":
51
42
  return buttonSize.S;
52
43
  case "m":
@@ -58,16 +49,16 @@ const StyledButton = styled.button `
58
49
  }
59
50
  }}
60
51
 
61
- ${({ theme, inverted, fullWidth }) => css `
52
+ ${({ theme, $inverted, $fullWidth }) => css `
62
53
  ${media.M `
63
- width: ${fullWidth ? "100%" : "fit-content"};
54
+ width: ${$fullWidth ? "100%" : "fit-content"};
64
55
  font-size: ${rem(18)};
65
56
  `}
66
57
 
67
58
  &:not(:disabled) {
68
59
  ${media.L `
69
60
  &:hover, :active, :focus-visible {
70
- background-color: ${inverted ? theme.red : theme.redHover};
61
+ background-color: ${$inverted ? theme.red : theme.redHover};
71
62
  color: ${theme.white};
72
63
  }
73
64
 
@@ -1,2 +1,2 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- export const ExternalIcon = ({ className = "" }) => (_jsx("svg", { className: className, width: "16px", height: "16px", viewBox: "0 0 16 16", version: "1.1", xmlns: "http://www.w3.org/2000/svg", children: _jsx("g", { stroke: "none", "stroke-width": "1", fill: "none", fillRule: "evenodd", children: _jsx("g", { transform: "translate(-428.000000, -10860.000000)", fill: "currentColor", fillRule: "nonzero", children: _jsx("path", { d: "M433,10861 C433.552285,10861 434,10861.4477 434,10862 C434,10862.5523 433.552285,10863 433,10863 L431,10863 C430.447715,10863 430,10863.4477 430,10864 L430,10873 C430,10873.5523 430.447715,10874 431,10874 L440,10874 C440.552285,10874 441,10873.5523 441,10873 L441,10871 C441,10870.4477 441.447715,10870 442,10870 C442.552285,10870 443,10870.4477 443,10871 L443,10873 C443,10874.6569 441.656854,10876 440,10876 L431,10876 C429.343146,10876 428,10874.6569 428,10873 L428,10864 C428,10862.3431 429.343146,10861 431,10861 L433,10861 Z M443,10860 L443.019354,10860.0002 C443.042681,10860.0006 443.065995,10860.0019 443.08925,10860.004 L443,10860 C443.05062,10860 443.100362,10860.0038 443.148961,10860.011 C443.165949,10860.0136 443.183375,10860.0167 443.200726,10860.0202 C443.222746,10860.0246 443.244436,10860.0298 443.26584,10860.0357 C443.281463,10860.0401 443.296851,10860.0447 443.312143,10860.0497 C443.331798,10860.0561 443.351579,10860.0633 443.371059,10860.0711 C443.388796,10860.0782 443.406098,10860.0857 443.423222,10860.0937 C443.443891,10860.1034 443.464294,10860.1138 443.484277,10860.1249 C443.496394,10860.1315 443.508613,10860.1386 443.520709,10860.146 C443.546275,10860.1617 443.571131,10860.1785 443.595159,10860.1963 C443.602603,10860.2018 443.609842,10860.2073 443.617022,10860.2129 C443.680182,10860.2626 443.737448,10860.3198 443.787214,10860.3832 L443.707107,10860.2929 C443.742501,10860.3283 443.774687,10860.3657 443.803665,10860.4047 C443.82151,10860.4289 443.838281,10860.4537 443.853933,10860.4793 C443.861393,10860.4914 443.868501,10860.5036 443.875329,10860.5159 C443.886206,10860.5357 443.896623,10860.5561 443.906346,10860.5769 C443.914321,10860.5939 443.921804,10860.6112 443.928775,10860.6287 C443.936684,10860.6484 443.943878,10860.6682 443.950453,10860.6883 C443.955271,10860.7031 443.959902,10860.7185 443.964155,10860.734 C443.970166,10860.7556 443.97536,10860.7773 443.979835,10860.7992 C443.983298,10860.8166 443.986372,10860.8341 443.988982,10860.8515 C443.992033,10860.8715 443.994467,10860.8921 443.996262,10860.9129 C443.997844,10860.9317 443.998905,10860.9497 443.999483,10860.9677 C443.999818,10860.9778 444,10860.9889 444,10861 L444,10867 C444,10867.5523 443.552285,10868 443,10868 C442.447715,10868 442,10867.5523 442,10867 L442,10863.414 L433.707107,10871.7071 C433.316582,10872.0976 432.683418,10872.0976 432.292893,10871.7071 C431.902369,10871.3166 431.902369,10870.6834 432.292893,10870.2929 L440.584,10862 L437,10862 C436.487164,10862 436.064493,10861.614 436.006728,10861.1166 L436,10861 C436,10860.4477 436.447715,10860 437,10860 L443,10860 Z" }) }) }) }));
2
+ export const ExternalIcon = ({ className = "" }) => (_jsx("svg", { className: className, width: "16px", height: "16px", viewBox: "0 0 16 16", version: "1.1", xmlns: "http://www.w3.org/2000/svg", children: _jsx("g", { stroke: "none", strokeWidth: "1", fill: "none", fillRule: "evenodd", children: _jsx("g", { transform: "translate(-428.000000, -10860.000000)", fill: "currentColor", fillRule: "nonzero", children: _jsx("path", { d: "M433,10861 C433.552285,10861 434,10861.4477 434,10862 C434,10862.5523 433.552285,10863 433,10863 L431,10863 C430.447715,10863 430,10863.4477 430,10864 L430,10873 C430,10873.5523 430.447715,10874 431,10874 L440,10874 C440.552285,10874 441,10873.5523 441,10873 L441,10871 C441,10870.4477 441.447715,10870 442,10870 C442.552285,10870 443,10870.4477 443,10871 L443,10873 C443,10874.6569 441.656854,10876 440,10876 L431,10876 C429.343146,10876 428,10874.6569 428,10873 L428,10864 C428,10862.3431 429.343146,10861 431,10861 L433,10861 Z M443,10860 L443.019354,10860.0002 C443.042681,10860.0006 443.065995,10860.0019 443.08925,10860.004 L443,10860 C443.05062,10860 443.100362,10860.0038 443.148961,10860.011 C443.165949,10860.0136 443.183375,10860.0167 443.200726,10860.0202 C443.222746,10860.0246 443.244436,10860.0298 443.26584,10860.0357 C443.281463,10860.0401 443.296851,10860.0447 443.312143,10860.0497 C443.331798,10860.0561 443.351579,10860.0633 443.371059,10860.0711 C443.388796,10860.0782 443.406098,10860.0857 443.423222,10860.0937 C443.443891,10860.1034 443.464294,10860.1138 443.484277,10860.1249 C443.496394,10860.1315 443.508613,10860.1386 443.520709,10860.146 C443.546275,10860.1617 443.571131,10860.1785 443.595159,10860.1963 C443.602603,10860.2018 443.609842,10860.2073 443.617022,10860.2129 C443.680182,10860.2626 443.737448,10860.3198 443.787214,10860.3832 L443.707107,10860.2929 C443.742501,10860.3283 443.774687,10860.3657 443.803665,10860.4047 C443.82151,10860.4289 443.838281,10860.4537 443.853933,10860.4793 C443.861393,10860.4914 443.868501,10860.5036 443.875329,10860.5159 C443.886206,10860.5357 443.896623,10860.5561 443.906346,10860.5769 C443.914321,10860.5939 443.921804,10860.6112 443.928775,10860.6287 C443.936684,10860.6484 443.943878,10860.6682 443.950453,10860.6883 C443.955271,10860.7031 443.959902,10860.7185 443.964155,10860.734 C443.970166,10860.7556 443.97536,10860.7773 443.979835,10860.7992 C443.983298,10860.8166 443.986372,10860.8341 443.988982,10860.8515 C443.992033,10860.8715 443.994467,10860.8921 443.996262,10860.9129 C443.997844,10860.9317 443.998905,10860.9497 443.999483,10860.9677 C443.999818,10860.9778 444,10860.9889 444,10861 L444,10867 C444,10867.5523 443.552285,10868 443,10868 C442.447715,10868 442,10867.5523 442,10867 L442,10863.414 L433.707107,10871.7071 C433.316582,10872.0976 432.683418,10872.0976 432.292893,10871.7071 C431.902369,10871.3166 431.902369,10870.6834 432.292893,10870.2929 L440.584,10862 L437,10862 C436.487164,10862 436.064493,10861.614 436.006728,10861.1166 L436,10861 C436,10860.4477 436.447715,10860 437,10860 L443,10860 Z" }) }) }) }));
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import styled, { css } from "styled-components";
3
3
  export const ChevronDownIcon = ({ className }) => (_jsx("svg", { width: "16px", height: "16px", viewBox: "0 0 16 16", version: "1.1", xmlns: "http://www.w3.org/2000/svg", fill: "#333333", className: className, children: _jsx("path", { d: "M2.29289322,5.29289322 C2.65337718,4.93240926 3.22060824,4.90467972 3.61289944,5.20970461 L3.70710678,5.29289322 L8,9.585 L12.2928932,5.29289322 C12.6533772,4.93240926 13.2206082,4.90467972 13.6128994,5.20970461 L13.7071068,5.29289322 C14.0675907,5.65337718 14.0953203,6.22060824 13.7902954,6.61289944 L13.7071068,6.70710678 L8.70710678,11.7071068 C8.34662282,12.0675907 7.77939176,12.0953203 7.38710056,11.7902954 L7.29289322,11.7071068 L2.29289322,6.70710678 C1.90236893,6.31658249 1.90236893,5.68341751 2.29289322,5.29289322 Z" }) }));
4
- export const ToggableChevron = ({ toggled, disableCircle = true, rotation, className, }) => (_jsx(Chevron, { toggled: toggled, disableCircle: disableCircle, rotation: rotation, className: className, children: _jsx(ChevronDownIcon, {}) }));
4
+ export const ToggableChevron = ({ toggled, disableCircle = true, rotation, className, }) => (_jsx(Chevron, { "$isToggled": toggled, "$disableCircle": disableCircle, "$rotation": rotation, className: className, children: _jsx(ChevronDownIcon, {}) }));
5
5
  const Chevron = styled.div `
6
6
  width: 22px;
7
7
  height: 22px;
@@ -12,9 +12,9 @@ const Chevron = styled.div `
12
12
  justify-content: center;
13
13
  align-items: center;
14
14
 
15
- ${({ toggled, disableCircle, rotation }) => css `
16
- transform: scaleY(${toggled ? -1 : 1})
17
- ${rotation && `rotate(${rotation}deg)`};
18
- border-width: ${toggled || disableCircle ? 0 : 1};
15
+ ${({ $isToggled, $disableCircle, $rotation }) => css `
16
+ transform: scaleY(${$isToggled ? -1 : 1})
17
+ ${$rotation && `rotate(${$rotation}deg)`};
18
+ border-width: ${$isToggled || $disableCircle ? 0 : 1};
19
19
  `};
20
20
  `;
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import styled from "styled-components";
3
3
  export const ToggablePlusMinusIcon = ({ isOpen = false, width = 14, height = 14, className = "", }) => {
4
- return (_jsxs(Svg, { className: className, xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 160 160", width: width, height: height, isOpen: isOpen, children: [_jsx(Rect, { isOpen: isOpen, x: "70", width: "20", height: "160" }), _jsx(Rect, { y: "70", width: "160", height: "20" })] }));
4
+ return (_jsxs(Svg, { className: className, xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 160 160", width: width, height: height, "$isOpen": isOpen, children: [_jsx(Rect, { "$isOpen": isOpen, x: "70", width: "20", height: "160" }), _jsx(Rect, { y: "70", width: "160", height: "20" })] }));
5
5
  };
6
6
  const Svg = styled.svg `
7
7
  cursor: pointer;
@@ -9,5 +9,5 @@ const Svg = styled.svg `
9
9
  const Rect = styled.rect `
10
10
  transition: transform 250ms ease-in-out;
11
11
  transform-origin: 50% 50%;
12
- transform: ${({ isOpen }) => (!isOpen ? "scaleY(1)" : "scaleY(0)")};
12
+ transform: ${({ $isOpen }) => (!$isOpen ? "scaleY(1)" : "scaleY(0)")};
13
13
  `;
@@ -29,7 +29,7 @@ export const Dropdown = ({ prefix, items, id, className, onItemSelected, initial
29
29
  });
30
30
  }
31
31
  }, [isOpen]);
32
- return (_jsxs(Container, { className: className, ref: ref, children: [_jsxs(DropdownButton, { id: id, onClick: () => setIsOpen(!isOpen), "aria-haspopup": "menu", "aria-controls": "dropdown-menu", isOpen: isOpen, children: [_jsxs(TextContainer, { children: [prefix && _jsx(Prefix, { children: `${prefix}:` }), _jsx(Label, { children: selectedItem?.label })] }), _jsx(StyledToggle, { toggled: isOpen })] }), _jsx(Content, { id: "dropdown-menu", "aria-expanded": isOpen, "aria-hidden": !isOpen, role: "menu", children: items.map((item, i) => (_jsx(DropdownListItem, { label: item.label, onClick: () => {
32
+ return (_jsxs(Container, { className: className, ref: ref, children: [_jsxs(DropdownButton, { id: id, onClick: () => setIsOpen(!isOpen), "aria-haspopup": "menu", "aria-controls": "dropdown-menu", "$isOpen": isOpen, children: [_jsxs(TextContainer, { children: [prefix && _jsx(Prefix, { children: `${prefix}:` }), _jsx(Label, { children: selectedItem?.label })] }), _jsx(StyledToggle, { toggled: isOpen })] }), _jsx(Content, { id: "dropdown-menu", "aria-expanded": isOpen, "aria-hidden": !isOpen, role: "menu", children: items.map((item, i) => (_jsx(DropdownListItem, { label: item.label, onClick: () => {
33
33
  setIsOpen(false);
34
34
  setItem(item);
35
35
  onItemSelected(item);
@@ -48,17 +48,17 @@ const DropdownButton = styled.button `
48
48
  font-size: ${rem(16)};
49
49
  background-color: ${({ theme }) => theme.white};
50
50
  border: ${rem(1)} solid ${({ theme }) => theme.grayTransparent};
51
- border-radius: ${({ isOpen }) => isOpen ? `${rem(5)} ${rem(5)} 0 0` : rem(5)};
52
- border-bottom: ${({ isOpen, theme }) => isOpen ? "none" : `$(${rem(1)}) solid ${theme.grayTransparent}`};
51
+ border-radius: ${({ $isOpen }) => $isOpen ? `${rem(5)} ${rem(5)} 0 0` : rem(5)};
52
+ border-bottom: ${({ $isOpen, theme }) => $isOpen ? "none" : `$(${rem(1)}) solid ${theme.grayTransparent}`};
53
53
  padding: 0 ${rem(14)};
54
54
  cursor: pointer;
55
55
 
56
- ${({ isOpen, theme }) => {
56
+ ${({ $isOpen, theme }) => {
57
57
  return css `
58
58
  ${media.M `
59
59
  &:hover, :focus-visible {
60
60
  border: ${rem(1)} solid ${theme.gray};
61
- border-bottom: ${isOpen ? "none" : `${rem(1)} solid ${theme.gray}`};
61
+ border-bottom: ${$isOpen ? "none" : `${rem(1)} solid ${theme.gray}`};
62
62
  }
63
63
  `}
64
64
  `;
@@ -27,6 +27,6 @@ export type TextFieldProps = {
27
27
  export type StyledTextFieldProps = {
28
28
  icon?: string;
29
29
  variant?: "default" | "rounded";
30
- startAdornment?: ReactNode;
30
+ $startAdornment?: ReactNode;
31
31
  };
32
32
  export declare const TextField: import("react").ForwardRefExoticComponent<TextFieldProps & import("react").RefAttributes<HTMLInputElement>>;
@@ -20,7 +20,7 @@ const variantInputStyles = {
20
20
  `,
21
21
  };
22
22
  export const TextField = forwardRef(({ dataTest, value, name, type = "text", variant = "default", placeholder, onChange, onBlur, onFocus, onKeyDown, className, ariaLabel, ariaDescribedBy, register, errors, pattern, inputMode = "text", startAdornment, endAdornment, }, ref) => {
23
- return (_jsxs(InputContainer, { children: [_jsxs(InputWrapper, { className: className, variant: variant, startAdornment: startAdornment, children: [startAdornment && _jsx(StartAdornment, { children: startAdornment }), _jsx(StyledInput, { "data-test": dataTest, variant: variant, value: value, ref: ref, type: type, id: name, name: name, placeholder: placeholder, onChange: onChange, onBlur: onBlur, onFocus: onFocus, onKeyDown: onKeyDown, "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy, inputMode: inputMode, pattern: pattern, startAdornment: startAdornment, ...register }), endAdornment && _jsx(EndAdornment, { children: endAdornment })] }), errors && name && _jsx(FormError, { errors: errors, name: name })] }));
23
+ return (_jsxs(InputContainer, { children: [_jsxs(InputWrapper, { className: className, variant: variant, "$startAdornment": startAdornment, children: [startAdornment && _jsx(StartAdornment, { children: startAdornment }), _jsx(StyledInput, { "data-test": dataTest, variant: variant, value: value, ref: ref, type: type, id: name, name: name, placeholder: placeholder, onChange: onChange, onBlur: onBlur, onFocus: onFocus, onKeyDown: onKeyDown, "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy, inputMode: inputMode, pattern: pattern, "$startAdornment": startAdornment, ...register }), endAdornment && _jsx(EndAdornment, { children: endAdornment })] }), errors && name && _jsx(FormError, { errors: errors, name: name })] }));
24
24
  });
25
25
  TextField.displayName = "TextField";
26
26
  const InputContainer = styled.div `
@@ -45,7 +45,7 @@ const StyledInput = styled.input `
45
45
  }
46
46
 
47
47
  ${({ variant }) => variantInputStyles[variant]};
48
- padding-left: ${({ startAdornment }) => (startAdornment ? rem(40) : rem(20))};
48
+ padding-left: ${({ $startAdornment }) => $startAdornment ? rem(40) : rem(20)};
49
49
  `;
50
50
  const StartAdornment = styled.div `
51
51
  position: absolute;
@@ -39,13 +39,13 @@ export const AccordionItem = ({ heading, headingLevel, panelId, regionId, initia
39
39
  setPanelState(isClosed ? PanelState.OPENING : PanelState.CLOSING);
40
40
  };
41
41
  const isExpanded = panelState !== PanelState.CLOSED;
42
- return (_jsxs(AccordionPanel, { children: [_jsx(StyledHeading, { as: headingLevel, children: _jsxs(StyledButton, { "data-test": `accordion-header${isExpanded ? "-expanded" : ""}`, id: panelId, "aria-expanded": isExpanded, "aria-controls": regionId, onClick: togglePanel, children: [_jsx(Text, { children: heading }), _jsx(StyledToggablePlusMinusIcon, { isOpen: isExpanded })] }) }), _jsx(AccodrionContent, { "data-test": "accordion-content", ref: ref, id: regionId, role: "region", "aria-labelledby": panelId, contentHeight: height, useAutoHeight: panelState === PanelState.OPENED, onTransitionEnd: onAnimationComplete, children: _jsx(Content, { hidden: !isExpanded, children: children }) })] }));
42
+ return (_jsxs(AccordionPanel, { children: [_jsx(StyledHeading, { as: headingLevel, children: _jsxs(StyledButton, { "data-test": `accordion-header${isExpanded ? "-expanded" : ""}`, id: panelId, "aria-expanded": isExpanded, "aria-controls": regionId, onClick: togglePanel, children: [_jsx(Text, { children: heading }), _jsx(StyledToggablePlusMinusIcon, { isOpen: isExpanded })] }) }), _jsx(AccodrionContent, { "data-test": "accordion-content", ref: ref, id: regionId, role: "region", "aria-labelledby": panelId, "$contentHeight": height, "$useAutoHeight": panelState === PanelState.OPENED, onTransitionEnd: onAnimationComplete, children: _jsx(Content, { hidden: !isExpanded, children: children }) })] }));
43
43
  };
44
44
  const AccodrionContent = styled.div `
45
45
  overflow: hidden;
46
46
  transition: height 0.3s ease-in-out;
47
- height: ${({ contentHeight }) => `${contentHeight}px`};
48
- height: ${({ useAutoHeight }) => useAutoHeight && "auto"};
47
+ height: ${({ $contentHeight }) => `${$contentHeight}px`};
48
+ height: ${({ $useAutoHeight }) => $useAutoHeight && "auto"};
49
49
  `;
50
50
  const Content = styled.div `
51
51
  padding: ${rem(15)} 0;
@@ -11,10 +11,10 @@ const getMaxWidth = (size) => {
11
11
  return MAX_WIDTH?.[size];
12
12
  };
13
13
  export const Container = forwardRef(({ children, className, maxWidth = "lg", position = "static", display = "block", }, ref) => {
14
- return (_jsx(Div, { ref: ref, className: className, maxWidth: getMaxWidth(maxWidth), display: display, position: position, children: children }));
14
+ return (_jsx(Div, { ref: ref, className: className, "$maxWidth": getMaxWidth(maxWidth), display: display, position: position, children: children }));
15
15
  });
16
16
  const Div = styled.div `
17
- ${({ maxWidth }) => maxWidth};
17
+ ${({ $maxWidth }) => $maxWidth};
18
18
  display: ${({ display }) => display};
19
19
  position: ${({ position }) => position};
20
20
  `;
@@ -9,10 +9,10 @@ export const EntryListItem = ({ children, as = "li" }) => {
9
9
  return _jsx(ListItem, { as: as, children: children });
10
10
  };
11
11
  export const EntryListText = ({ children, fontSizeMobile = 14, fontSizeDesktop = 16, breakpoint = "M", bold = false, as = "p", color, }) => {
12
- return (_jsx(Text, { as: as, fontSizeMobile: fontSizeMobile, fontSizeDesktop: fontSizeDesktop, breakpoint: breakpoint, bold: bold, color: color, children: children }));
12
+ return (_jsx(Text, { as: as, "$fontSizeMobile": fontSizeMobile, "$fontSizeDesktop": fontSizeDesktop, "$breakpoint": breakpoint, "$bold": bold, color: color, children: children }));
13
13
  };
14
14
  export const EntryListHeading = ({ children, fontSizeMobile = 18, fontSizeDesktop = 20, as = "h2", breakpoint = "M", }) => {
15
- return (_jsx(Heading, { as: as, fontSizeMobile: fontSizeMobile, fontSizeDesktop: fontSizeDesktop, breakpoint: breakpoint, children: children }));
15
+ return (_jsx(Heading, { as: as, "$fontSizeMobile": fontSizeMobile, "$fontSizeDesktop": fontSizeDesktop, "$breakpoint": breakpoint, children: children }));
16
16
  };
17
17
  const List = styled.ul `
18
18
  list-style: none;
@@ -27,10 +27,10 @@ const ListItem = styled.li `
27
27
  }
28
28
  `;
29
29
  const responsiveFont = css `
30
- font-size: ${({ fontSizeMobile }) => rem(fontSizeMobile)};
30
+ font-size: ${({ $fontSizeMobile }) => rem($fontSizeMobile)};
31
31
 
32
- ${({ fontSizeDesktop, breakpoint }) => media[breakpoint] `
33
- font-size: ${rem(fontSizeDesktop)};
32
+ ${({ $fontSizeDesktop, $breakpoint }) => media[$breakpoint] `
33
+ font-size: ${rem($fontSizeDesktop)};
34
34
  `}
35
35
  `;
36
36
  const Heading = styled.h2 `
@@ -41,7 +41,7 @@ const Heading = styled.h2 `
41
41
  `;
42
42
  const Text = styled.p `
43
43
  color: ${({ theme, color }) => (color ? color : theme.blackLight)};
44
- font-family: ${({ theme, bold }) => bold ? theme.valueBold : theme.valueRegular};
44
+ font-family: ${({ theme, $bold }) => $bold ? theme.valueBold : theme.valueRegular};
45
45
 
46
46
  ${responsiveFont}
47
47
  &:last-child {
@@ -1,5 +1,6 @@
1
1
  import { SanityImage } from "../../../models/sanity-types";
2
2
  type LinkItem = {
3
+ id?: string;
3
4
  externalUrl: string;
4
5
  internalLink: {
5
6
  slug: {
@@ -5,10 +5,10 @@ import { media } from "../../../styles/mixins";
5
5
  import { rem } from "../../../styles/units";
6
6
  import styled from "styled-components";
7
7
  export const Footer = ({ linkColumns, footerLogo }) => {
8
- return (_jsxs(OuterContainer, { children: [_jsx(ColumnContainer, { children: linkColumns.map(({ heading, items }) => {
9
- return (_jsxs(Column, { children: [heading && _jsx(Heading, { children: heading }), items?.map((item) => {
10
- return (_jsx(StyledLink, { value: { reference: item }, children: item?.webUrlName }));
11
- })] }));
8
+ return (_jsxs(OuterContainer, { children: [_jsx(ColumnContainer, { children: linkColumns.map(({ heading, items }, i) => {
9
+ return (_jsxs(Column, { children: [heading && _jsx(Heading, { children: heading }), items?.map((item, i) => {
10
+ return (_jsx(StyledLink, { value: { reference: item }, children: item?.webUrlName }, `${item?.id}${i}`));
11
+ })] }, `${heading}-${i}`));
12
12
  }) }), _jsx(StyledImage, { image: footerLogo?.asset })] }));
13
13
  };
14
14
  const OuterContainer = styled.div `
@@ -3,4 +3,4 @@ export type NavigationCellProps = {
3
3
  active?: boolean;
4
4
  onToggleCell: () => void;
5
5
  };
6
- export declare const NavigationCell: ({ title, active, onToggleCell }: NavigationCellProps) => import("react/jsx-runtime").JSX.Element;
6
+ export declare const NavigationCell: ({ title, active, onToggleCell, }: NavigationCellProps) => import("react/jsx-runtime").JSX.Element;
@@ -3,7 +3,7 @@ import styled, { css } from "styled-components";
3
3
  import { media } from "../../../styles/mixins";
4
4
  import { rem } from "../../../styles/units";
5
5
  import { ToggableChevron } from "../../../components/icons/toggable-chevron/toggable-chevron";
6
- export const NavigationCell = ({ title, active, onToggleCell }) => (_jsx(StyledListItem, { children: _jsxs(NavCell, { "data-test": "nav-cell", active: active, onClick: onToggleCell, children: [title, _jsx(StyledToggle, { toggled: active })] }) }));
6
+ export const NavigationCell = ({ title, active, onToggleCell, }) => (_jsx(StyledListItem, { children: _jsxs(NavCell, { "data-test": "nav-cell", "$active": active, onClick: onToggleCell, children: [title, _jsx(StyledToggle, { toggled: active })] }) }));
7
7
  const StyledListItem = styled.li `
8
8
  display: inline-block;
9
9
  height: 100%;
@@ -45,12 +45,13 @@ const NavCell = styled.button `
45
45
  font-family: ${theme.valueBold};
46
46
  `};
47
47
 
48
- ${({ active }) => active && css `
49
- ${({ theme }) => css `
50
- color: ${theme.red};
51
- box-shadow: inset 0 -4px 0 ${theme.red};
48
+ ${({ $active }) => $active &&
49
+ css `
50
+ ${({ theme }) => css `
51
+ color: ${theme.red};
52
+ box-shadow: inset 0 -4px 0 ${theme.red};
53
+ `};
52
54
  `};
53
- `};
54
55
  `;
55
56
  const StyledToggle = styled(ToggableChevron).attrs({
56
57
  disableCircle: true,
@@ -58,10 +59,11 @@ const StyledToggle = styled(ToggableChevron).attrs({
58
59
  margin-left: ${rem(4)};
59
60
 
60
61
  svg {
61
- ${(props) => props.toggled && css `
62
- ${({ theme }) => css `
63
- fill: ${theme.red};
62
+ ${(props) => props.toggled &&
63
+ css `
64
+ ${({ theme }) => css `
65
+ fill: ${theme.red};
66
+ `};
64
67
  `};
65
- `};
66
68
  }
67
69
  `;
@@ -41,7 +41,7 @@ export const Pagination = ({ numberOfPages, currentPage, isMobile = true, locale
41
41
  total - 1,
42
42
  ];
43
43
  };
44
- return (numberOfPages > 0 && (_jsxs(StyledList, { children: [_jsx(StyleListItem, { children: _jsx(PaginationArrow, { isDisabled: isFirstPage, "aria-label": prePage, onClick: (e) => goToPage(e, pageIndex - 1), children: _jsx(ChevronLeftIcon, { width: 12, height: 12, color: isFirstPage ? COLORS.grayDark : COLORS.blackLight }) }) }), getVisiblePages(pageIndex, numberOfPages, isMobile).map((page, index) => (_jsx(StyleListItem, { children: page === "..." ? (_jsx(Ellipsis, { children: "\u2026" })) : (_jsx(PaginationItem, { isSelected: pageIndex === page, onClick: (e) => goToPage(e, page), children: page + 1 })) }, index))), _jsx(StyleListItem, { children: _jsx(PaginationArrow, { isDisabled: isLastPage, "aria-label": nextPage, onClick: (e) => goToPage(e, pageIndex + 1), children: _jsx(ChevronRightIcon, { width: 12, height: 12, color: isLastPage ? COLORS.grayDark : COLORS.blackLight }) }) })] })));
44
+ return (numberOfPages > 0 && (_jsxs(StyledList, { children: [_jsx(StyleListItem, { children: _jsx(PaginationArrow, { "$isDisabled": isFirstPage, "aria-label": prePage, onClick: (e) => goToPage(e, pageIndex - 1), children: _jsx(ChevronLeftIcon, { width: 12, height: 12, color: isFirstPage ? COLORS.grayDark : COLORS.blackLight }) }) }), getVisiblePages(pageIndex, numberOfPages, isMobile).map((page, index) => (_jsx(StyleListItem, { children: page === "..." ? (_jsx(Ellipsis, { children: "\u2026" })) : (_jsx(PaginationItem, { "$isSelected": pageIndex === page, onClick: (e) => goToPage(e, page), children: page + 1 })) }, index))), _jsx(StyleListItem, { children: _jsx(PaginationArrow, { "$isDisabled": isLastPage, "aria-label": nextPage, onClick: (e) => goToPage(e, pageIndex + 1), children: _jsx(ChevronRightIcon, { width: 12, height: 12, color: isLastPage ? COLORS.grayDark : COLORS.blackLight }) }) })] })));
45
45
  };
46
46
  const StyledList = styled.ul `
47
47
  margin: 0 auto;
@@ -77,7 +77,7 @@ const PaginationItem = styled.button `
77
77
  border: ${rem(1)} solid ${theme.blackLight};
78
78
  `};
79
79
 
80
- ${({ theme, isSelected }) => isSelected &&
80
+ ${({ theme, $isSelected }) => $isSelected &&
81
81
  css `
82
82
  background-color: ${theme.blackLight};
83
83
  border-color: transparent;
@@ -95,7 +95,7 @@ const PaginationArrow = styled.button `
95
95
  border-radius: ${rem(5)};
96
96
  background-color: ${({ theme }) => theme.white};
97
97
 
98
- ${({ isDisabled }) => isDisabled &&
98
+ ${({ $isDisabled }) => $isDisabled &&
99
99
  css `
100
100
  pointer-events: none;
101
101
  cursor: default;
@@ -2,10 +2,10 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import styled from "styled-components";
3
3
  import { themeColors, themeBorderRadius, themeElevation, } from "../../../styles/mixins/theme-mixins";
4
4
  export const Paper = ({ className, children, backgroundColor = "white", borderRadius = "md", elevation = backgroundColor === "#ffffff" ? 1 : 0, }) => {
5
- return (_jsx(Container, { className: className, backgroundColor: backgroundColor, borderRadius: borderRadius, elevation: elevation, children: children }));
5
+ return (_jsx(Container, { className: className, "$backgroundColor": backgroundColor, "$borderRadius": borderRadius, "$elevation": elevation, children: children }));
6
6
  };
7
7
  const Container = styled.div `
8
- background-color: ${({ backgroundColor }) => themeColors(backgroundColor)};
9
- border-radius: ${({ borderRadius }) => themeBorderRadius(borderRadius)};
10
- box-shadow: ${({ elevation }) => themeElevation(elevation)};
8
+ background-color: ${({ $backgroundColor }) => themeColors($backgroundColor)};
9
+ border-radius: ${({ $borderRadius }) => themeBorderRadius($borderRadius)};
10
+ box-shadow: ${({ $elevation }) => themeElevation($elevation)};
11
11
  `;
@@ -1 +1,3 @@
1
- export declare const withDefaultTheme: <T extends object>(Component: React.ComponentType<T>) => React.FC<T>;
1
+ import React from "react";
2
+ export declare function withDefaultTheme<P>(Component: React.ComponentType<P>): React.FC<P>;
3
+ export declare function withDefaultThemeWithRef<P>(Component: React.ForwardRefExoticComponent<React.PropsWithoutRef<P> & React.RefAttributes<any>>): React.ForwardRefExoticComponent<React.PropsWithoutRef<P> & React.RefAttributes<any>>;
@@ -1,8 +1,18 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { useContext } from "react";
3
- import { THEME_SETTINGS } from "../styles/theme";
2
+ import { useContext, forwardRef } from "react";
4
3
  import { ThemeContext, ThemeProvider } from "styled-components";
5
- export const withDefaultTheme = (Component) => (props) => {
6
- const theme = useContext(ThemeContext);
7
- return theme ? (_jsx(Component, { ...props })) : (_jsx(ThemeProvider, { theme: THEME_SETTINGS, children: _jsx(Component, { ...props }) }));
8
- };
4
+ import { THEME_SETTINGS } from "../styles/theme";
5
+ export function withDefaultTheme(Component) {
6
+ const ComponentWithTheme = (props) => {
7
+ const theme = useContext(ThemeContext);
8
+ return theme ? (_jsx(Component, { ...props })) : (_jsx(ThemeProvider, { theme: THEME_SETTINGS, children: _jsx(Component, { ...props }) }));
9
+ };
10
+ return ComponentWithTheme;
11
+ }
12
+ export function withDefaultThemeWithRef(Component) {
13
+ const ComponentWithTheme = forwardRef((props, ref) => {
14
+ const theme = useContext(ThemeContext);
15
+ return theme ? (_jsx(Component, { ...props, ref: ref })) : (_jsx(ThemeProvider, { theme: THEME_SETTINGS, children: _jsx(Component, { ...props, ref: ref }) }));
16
+ });
17
+ return ComponentWithTheme;
18
+ }
package/dist/index.d.ts CHANGED
@@ -39,7 +39,14 @@ export declare const FormLabel: import("react").FC<FormLabelProps>;
39
39
  export declare const TextField: import("react").FC<TextFieldProps>;
40
40
  export declare const EmailSignupForm: import("react").FC<EmailSignupFormProps>;
41
41
  export declare const Image: import("react").FC<ImageProps>;
42
- export declare const Container: import("react").FC<ContainerProps>;
42
+ export declare const Container: import("react").ForwardRefExoticComponent<{
43
+ children: import("react").ReactNode;
44
+ maxWidth?: "sm" | "lg" | "xl";
45
+ className?: string;
46
+ } & {
47
+ position?: import("csstype").Property.Position | undefined;
48
+ display?: import("csstype").Property.Display | undefined;
49
+ } & import("react").RefAttributes<any>>;
43
50
  export declare const EntryList: import("react").FC<EntryListProps>;
44
51
  export declare const EntryListItem: import("react").FC<EntryListItemProps>;
45
52
  export declare const EntryListText: import("react").FC<EntryListTextProps>;
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { withDefaultTheme } from "./hoc/withDefaultTheme";
1
+ import { withDefaultTheme, withDefaultThemeWithRef, } from "./hoc/withDefaultTheme";
2
2
  // Buttons
3
3
  import { Button as ButtonComponent, } from "./components/buttons/button/button";
4
4
  import { TextButton as TextButtonComponent, } from "./components/buttons/text-button/text-button";
@@ -46,7 +46,7 @@ export const FormLabel = withDefaultTheme(FormLabelComponent);
46
46
  export const TextField = withDefaultTheme(TextFieldComponent);
47
47
  export const EmailSignupForm = withDefaultTheme(EmailSignupFormComponent);
48
48
  export const Image = withDefaultTheme(ImageComponent);
49
- export const Container = withDefaultTheme(ContainerComponent);
49
+ export const Container = withDefaultThemeWithRef(ContainerComponent);
50
50
  export const EntryList = withDefaultTheme(EntryListComponent);
51
51
  export const EntryListItem = withDefaultTheme(EntryListItemComponent);
52
52
  export const EntryListText = withDefaultTheme(EntryListTextComponent);
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.1",
4
+ "version": "1.5.2",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",