@hlf-fe/pulmo-ui 1.2.0 → 1.3.0
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/components/layout/container/container.d.ts +5 -1
- package/dist/components/layout/container/container.js +4 -3
- package/dist/components/modules/entry-list/entry-list.d.ts +2 -1
- package/dist/components/modules/entry-list/entry-list.js +2 -2
- package/dist/components/surfaces/paper/paper.d.ts +10 -0
- package/dist/components/surfaces/paper/paper.js +11 -0
- package/dist/components/surfaces/paper/paper.stories.d.ts +12 -0
- package/dist/components/surfaces/paper/paper.stories.js +69 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +2 -0
- package/dist/models/theme.d.ts +23 -0
- package/dist/models/theme.js +1 -0
- package/dist/styles/mixins/theme-mixins/theme-mixins.d.ts +5 -0
- package/dist/styles/mixins/theme-mixins/theme-mixins.js +37 -0
- package/dist/styles/mixins/theme-mixins.d.ts +5 -0
- package/dist/styles/mixins/theme-mixins.js +38 -0
- package/package.json +1 -1
|
@@ -6,5 +6,9 @@ export type ContainerProps = {
|
|
|
6
6
|
maxWidth?: Sizes;
|
|
7
7
|
className?: string;
|
|
8
8
|
} & CSSTypes;
|
|
9
|
-
export declare const Container:
|
|
9
|
+
export declare const Container: import("react").ForwardRefExoticComponent<{
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
maxWidth?: Sizes;
|
|
12
|
+
className?: string;
|
|
13
|
+
} & CSSTypes & import("react").RefAttributes<HTMLDivElement>>;
|
|
10
14
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
2
3
|
import { siteWidthRow, siteWidthRowXL, siteWidthRowS } from "../../../styles/mixins";
|
|
3
4
|
import styled from "styled-components";
|
|
4
5
|
const MAX_WIDTH = {
|
|
@@ -9,9 +10,9 @@ const MAX_WIDTH = {
|
|
|
9
10
|
const getMaxWidth = (size) => {
|
|
10
11
|
return MAX_WIDTH?.[size];
|
|
11
12
|
};
|
|
12
|
-
export const Container = ({ children, className, maxWidth = "lg", position = "static", display = "block", }) => {
|
|
13
|
-
return (_jsx(Div, { className: className, maxWidth: getMaxWidth(maxWidth), display: display, position: position, children: children }));
|
|
14
|
-
};
|
|
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 }));
|
|
15
|
+
});
|
|
15
16
|
const Div = styled.div `
|
|
16
17
|
${({ maxWidth }) => maxWidth};
|
|
17
18
|
display: ${({ display }) => display};
|
|
@@ -4,6 +4,7 @@ export type EntryListProps = {
|
|
|
4
4
|
};
|
|
5
5
|
export type EntryListItemProps = {
|
|
6
6
|
children: React.ReactNode;
|
|
7
|
+
as?: "div" | "li";
|
|
7
8
|
};
|
|
8
9
|
export type EntryListHeadingProps = {
|
|
9
10
|
children: React.ReactNode;
|
|
@@ -22,6 +23,6 @@ export type EntryListTextProps = {
|
|
|
22
23
|
color?: string;
|
|
23
24
|
};
|
|
24
25
|
export declare const EntryList: ({ children }: EntryListProps) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
-
export declare const EntryListItem: ({ children }: EntryListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export declare const EntryListItem: ({ children, as }: EntryListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
26
27
|
export declare const EntryListText: ({ children, fontSizeMobile, fontSizeDesktop, breakpoint, bold, as, color, }: EntryListTextProps) => import("react/jsx-runtime").JSX.Element;
|
|
27
28
|
export declare const EntryListHeading: ({ children, fontSizeMobile, fontSizeDesktop, as, breakpoint, }: EntryListHeadingProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -5,8 +5,8 @@ import { media } from "../../../styles/mixins";
|
|
|
5
5
|
export const EntryList = ({ children }) => {
|
|
6
6
|
return _jsx(List, { children: children });
|
|
7
7
|
};
|
|
8
|
-
export const EntryListItem = ({ children }) => {
|
|
9
|
-
return _jsx(ListItem, { children: children });
|
|
8
|
+
export const EntryListItem = ({ children, as = "li" }) => {
|
|
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
12
|
return (_jsx(Text, { as: as, fontSizeMobile: fontSizeMobile, fontSizeDesktop: fontSizeDesktop, breakpoint: breakpoint, bold: bold, color: color, children: children }));
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { THEME_COLORS_BY_HEX, THEME_COLORS_BY_NAME, THEME_ELEVATION, SIZE_SM, SIZE_MD, SIZE_LG } from "../../../models/theme";
|
|
3
|
+
export type PaperProps = {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
className?: string;
|
|
6
|
+
backgroundColor?: THEME_COLORS_BY_NAME | THEME_COLORS_BY_HEX;
|
|
7
|
+
borderRadius?: SIZE_SM | SIZE_MD | SIZE_LG;
|
|
8
|
+
elevation?: THEME_ELEVATION;
|
|
9
|
+
};
|
|
10
|
+
export declare const Paper: ({ className, children, backgroundColor, borderRadius, elevation, }: PaperProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
import { themeColors, themeBorderRadius, themeElevation, } from "../../../styles/mixins/theme-mixins";
|
|
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 }));
|
|
6
|
+
};
|
|
7
|
+
const Container = styled.div `
|
|
8
|
+
background-color: ${({ backgroundColor }) => themeColors(backgroundColor)};
|
|
9
|
+
border-radius: ${({ borderRadius }) => themeBorderRadius(borderRadius)};
|
|
10
|
+
box-shadow: ${({ elevation }) => themeElevation(elevation)};
|
|
11
|
+
`;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { Paper } from "./paper";
|
|
3
|
+
declare const meta: Meta<typeof Paper>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Paper>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const Purple: Story;
|
|
8
|
+
export declare const Green: Story;
|
|
9
|
+
export declare const Blue: Story;
|
|
10
|
+
export declare const Pink: Story;
|
|
11
|
+
export declare const Yellow: Story;
|
|
12
|
+
export declare const WhiteWithElevation: Story;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Paper } from "./paper";
|
|
3
|
+
import { Decorator } from "../../../components/decorator/decorator";
|
|
4
|
+
import { EntryListHeading, EntryListText, } from "../../../components/modules/entry-list/entry-list";
|
|
5
|
+
const meta = {
|
|
6
|
+
title: "Surfaces/Paper",
|
|
7
|
+
component: Paper,
|
|
8
|
+
decorators: [
|
|
9
|
+
(Story) => (_jsx(Decorator, { maxWidth: "400px", children: _jsx(Story, {}) })),
|
|
10
|
+
],
|
|
11
|
+
};
|
|
12
|
+
export default meta;
|
|
13
|
+
const DummyContent = () => (_jsxs("div", { style: { padding: "20px" }, children: [_jsx(EntryListText, { fontSizeDesktop: 14, color: "#545454", children: "2025-05-11" }), _jsx(EntryListHeading, { children: "In volutpat est eu dolor efficitur" }), _jsxs(EntryListText, { children: [_jsxs(EntryListText, { as: "span", fontSizeMobile: 12, fontSizeDesktop: 14, children: ["Nulla facilisi:", " "] }), _jsx(EntryListText, { as: "span", fontSizeMobile: 12, fontSizeDesktop: 14, bold: true, children: "volutpat, XiO, MD, Condimentum Ultricies" })] }), _jsx(EntryListText, { children: "Aliquam erat volutpat. Nulla facilisi. Vestibulum eget ullamcorper elit. Praesent mattis arcu ante, in gravida eros pharetra sit amet." }), _jsx(EntryListText, { children: "Praesent mattis arcu ante, in gravida eros pharetra sit amet. Etiam ac enim lorem. Proin euismod vulputate faucibus." })] }));
|
|
14
|
+
export const Default = {
|
|
15
|
+
args: {
|
|
16
|
+
backgroundColor: "white",
|
|
17
|
+
elevation: 0,
|
|
18
|
+
borderRadius: "md",
|
|
19
|
+
},
|
|
20
|
+
render: (args) => (_jsx(Paper, { ...args, children: _jsx(DummyContent, {}) })),
|
|
21
|
+
};
|
|
22
|
+
export const Purple = {
|
|
23
|
+
args: {
|
|
24
|
+
backgroundColor: "purple",
|
|
25
|
+
elevation: 0,
|
|
26
|
+
borderRadius: "md",
|
|
27
|
+
},
|
|
28
|
+
render: (args) => (_jsx(Paper, { ...args, children: _jsx(DummyContent, {}) })),
|
|
29
|
+
};
|
|
30
|
+
export const Green = {
|
|
31
|
+
args: {
|
|
32
|
+
backgroundColor: "green",
|
|
33
|
+
elevation: 0,
|
|
34
|
+
borderRadius: "md",
|
|
35
|
+
},
|
|
36
|
+
render: (args) => (_jsx(Paper, { ...args, children: _jsx(DummyContent, {}) })),
|
|
37
|
+
};
|
|
38
|
+
export const Blue = {
|
|
39
|
+
args: {
|
|
40
|
+
backgroundColor: "blue",
|
|
41
|
+
elevation: 0,
|
|
42
|
+
borderRadius: "md",
|
|
43
|
+
},
|
|
44
|
+
render: (args) => (_jsx(Paper, { ...args, children: _jsx(DummyContent, {}) })),
|
|
45
|
+
};
|
|
46
|
+
export const Pink = {
|
|
47
|
+
args: {
|
|
48
|
+
backgroundColor: "pink",
|
|
49
|
+
elevation: 0,
|
|
50
|
+
borderRadius: "md",
|
|
51
|
+
},
|
|
52
|
+
render: (args) => (_jsx(Paper, { ...args, children: _jsx(DummyContent, {}) })),
|
|
53
|
+
};
|
|
54
|
+
export const Yellow = {
|
|
55
|
+
args: {
|
|
56
|
+
backgroundColor: "yellow",
|
|
57
|
+
elevation: 0,
|
|
58
|
+
borderRadius: "md",
|
|
59
|
+
},
|
|
60
|
+
render: (args) => (_jsx(Paper, { ...args, children: _jsx(DummyContent, {}) })),
|
|
61
|
+
};
|
|
62
|
+
export const WhiteWithElevation = {
|
|
63
|
+
args: {
|
|
64
|
+
backgroundColor: "white",
|
|
65
|
+
elevation: 1,
|
|
66
|
+
borderRadius: "md",
|
|
67
|
+
},
|
|
68
|
+
render: (args) => (_jsx(Paper, { ...args, children: _jsx(DummyContent, {}) })),
|
|
69
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -16,7 +16,8 @@ import { type AccordionItemProps } from "./components/layout/accordion/accordion
|
|
|
16
16
|
import { type NavigationCellProps } from "./components/navigation/nav-cell/nav-cell";
|
|
17
17
|
import { type NavigationItemProps } from "./components/navigation/nav-item/nav-item";
|
|
18
18
|
import { type CardBannerProps } from "./components/surfaces/cards/card-banner/card-banner";
|
|
19
|
-
|
|
19
|
+
import { type PaperProps } from "./components/surfaces/paper/paper";
|
|
20
|
+
export type { ButtonProps, LoadingButtonProps, TextButtonProps, EmailSignupFormProps, ImageProps, ContainerProps, AlertProps, EntryListHeadingProps, EntryListTextProps, PaginationProps, NavigationCellProps, NavigationItemProps, CardBannerProps, PaperProps, };
|
|
20
21
|
export { CloseIcon } from "./components/icons/close-icon/close-icon";
|
|
21
22
|
export { ExclamationMarkIcon } from "./components/icons/exclamation-mark-icon/exclamation-mark-icon";
|
|
22
23
|
export { WarningIcon } from "./components/icons/warning-icon/warning-icon";
|
|
@@ -49,3 +50,4 @@ export declare const AccordionItem: import("react").FC<AccordionItemProps>;
|
|
|
49
50
|
export declare const NavigationCell: import("react").FC<NavigationCellProps>;
|
|
50
51
|
export declare const NavigationItem: import("react").FC<NavigationItemProps>;
|
|
51
52
|
export declare const CardBanner: import("react").FC<CardBannerProps>;
|
|
53
|
+
export declare const Paper: import("react").FC<PaperProps>;
|
package/dist/index.js
CHANGED
|
@@ -19,6 +19,7 @@ import { Accordion as AccordionComponent, AccordionItem as AccordionItemComponen
|
|
|
19
19
|
import { NavigationCell as NavigationCellComponent, } from "./components/navigation/nav-cell/nav-cell";
|
|
20
20
|
import { NavigationItem as NavigationItemComponent, } from "./components/navigation/nav-item/nav-item";
|
|
21
21
|
import { CardBanner as CardBannerComponent, } from "./components/surfaces/cards/card-banner/card-banner";
|
|
22
|
+
import { Paper as PaperComponent, } from "./components/surfaces/paper/paper";
|
|
22
23
|
// Icons
|
|
23
24
|
export { CloseIcon } from "./components/icons/close-icon/close-icon";
|
|
24
25
|
export { ExclamationMarkIcon } from "./components/icons/exclamation-mark-icon/exclamation-mark-icon";
|
|
@@ -51,3 +52,4 @@ export const AccordionItem = withDefaultTheme(AccordionItemComponent);
|
|
|
51
52
|
export const NavigationCell = withDefaultTheme(NavigationCellComponent);
|
|
52
53
|
export const NavigationItem = withDefaultTheme(NavigationItemComponent);
|
|
53
54
|
export const CardBanner = withDefaultTheme(CardBannerComponent);
|
|
55
|
+
export const Paper = withDefaultTheme(PaperComponent);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export type THEME_COLOR_HEX_PURPLE = "#e6d1e5";
|
|
2
|
+
export type THEME_COLOR_HEX_GREEN = "#d6ebe3";
|
|
3
|
+
export type THEME_COLOR_HEX_BLUE = "#d1e4ed";
|
|
4
|
+
export type THEME_COLOR_HEX_PINK = "#fbdfd9";
|
|
5
|
+
export type THEME_COLOR_HEX_WHITE = "#ffffff";
|
|
6
|
+
export type THEME_COLORS_YELLOW = "#ffecc4";
|
|
7
|
+
export type THEME_COLORS_TRANSPARENT = "transparent";
|
|
8
|
+
export type THEME_COLOR_PURPLE = "purple";
|
|
9
|
+
export type THEME_COLOR_GREEN = "green";
|
|
10
|
+
export type THEME_COLOR_BLUE = "blue";
|
|
11
|
+
export type THEME_COLOR_PINK = "pink";
|
|
12
|
+
export type THEME_COLOR_WHITE = "white";
|
|
13
|
+
export type THEME_COLOR_YELLOW = "yellow";
|
|
14
|
+
export type THEME_COLOR_TRANSPARENT = "transparent";
|
|
15
|
+
export type SIZE_NONE = "none";
|
|
16
|
+
export type SIZE_SM = "sm";
|
|
17
|
+
export type SIZE_MD = "md";
|
|
18
|
+
export type SIZE_LG = "lg";
|
|
19
|
+
export type SIZE_XL = "xl";
|
|
20
|
+
export type SIZES = SIZE_NONE | SIZE_SM | SIZE_MD | SIZE_LG | SIZE_XL;
|
|
21
|
+
export type THEME_ELEVATION = 0 | 1;
|
|
22
|
+
export type THEME_COLORS_BY_HEX = THEME_COLOR_HEX_PURPLE | THEME_COLOR_HEX_GREEN | THEME_COLOR_HEX_BLUE | THEME_COLOR_HEX_PINK | THEME_COLOR_HEX_WHITE | THEME_COLORS_YELLOW | THEME_COLORS_TRANSPARENT;
|
|
23
|
+
export type THEME_COLORS_BY_NAME = THEME_COLOR_PURPLE | THEME_COLOR_GREEN | THEME_COLOR_BLUE | THEME_COLOR_PINK | THEME_COLOR_WHITE | THEME_COLOR_YELLOW | THEME_COLOR_TRANSPARENT;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { THEME_COLORS_BY_HEX, THEME_COLORS_BY_NAME, SIZES } from "../../../models/theme";
|
|
2
|
+
export declare const themeColors: (color: THEME_COLORS_BY_HEX | THEME_COLORS_BY_NAME) => string;
|
|
3
|
+
export declare const themeSpacing: (size: SIZES) => string;
|
|
4
|
+
export declare const themeBorderRadius: (size: "sm" | "md" | "lg") => string;
|
|
5
|
+
export declare const themeElevation: (elevation: 0 | 1) => string;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { COLORS, THEME_SPACING } from "../../../styles/theme";
|
|
2
|
+
import { rem } from "../../../styles/units";
|
|
3
|
+
export const themeColors = (color) => {
|
|
4
|
+
const THEME_COLORS = {
|
|
5
|
+
green: COLORS.mint,
|
|
6
|
+
blue: COLORS.skyBlue,
|
|
7
|
+
purple: COLORS.lavender,
|
|
8
|
+
pink: COLORS.pink,
|
|
9
|
+
white: COLORS.white,
|
|
10
|
+
};
|
|
11
|
+
return THEME_COLORS[color] || color;
|
|
12
|
+
};
|
|
13
|
+
export const themeSpacing = (size) => {
|
|
14
|
+
const THEME_SPACING_SIZES = {
|
|
15
|
+
sm: THEME_SPACING.sm,
|
|
16
|
+
md: THEME_SPACING.md,
|
|
17
|
+
lg: THEME_SPACING.lg,
|
|
18
|
+
xl: THEME_SPACING.xl,
|
|
19
|
+
none: "0",
|
|
20
|
+
};
|
|
21
|
+
return THEME_SPACING_SIZES[size] || THEME_SPACING.md;
|
|
22
|
+
};
|
|
23
|
+
export const themeBorderRadius = (size) => {
|
|
24
|
+
const BORDER_RADIUS = {
|
|
25
|
+
sm: rem(6),
|
|
26
|
+
md: rem(8),
|
|
27
|
+
lg: rem(12),
|
|
28
|
+
};
|
|
29
|
+
return BORDER_RADIUS[size] || BORDER_RADIUS.sm;
|
|
30
|
+
};
|
|
31
|
+
export const themeElevation = (elevation) => {
|
|
32
|
+
const ELEVETION = {
|
|
33
|
+
0: "none",
|
|
34
|
+
1: `0 ${rem(4)} ${rem(16)} 0 rgba(0, 0, 0, 0.08)`,
|
|
35
|
+
};
|
|
36
|
+
return ELEVETION[elevation] || ELEVETION[0];
|
|
37
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { THEME_COLORS_BY_HEX, THEME_COLORS_BY_NAME, SIZES } from "../../models/theme";
|
|
2
|
+
export declare const themeColors: (color: THEME_COLORS_BY_HEX | THEME_COLORS_BY_NAME) => any;
|
|
3
|
+
export declare const themeSpacing: (size: SIZES) => string;
|
|
4
|
+
export declare const themeBorderRadius: (size: "sm" | "md" | "lg") => string;
|
|
5
|
+
export declare const themeElevation: (elevation: 0 | 1) => string;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { COLORS, THEME_SPACING } from "../../styles/theme";
|
|
2
|
+
import { rem } from "../../styles/units";
|
|
3
|
+
export const themeColors = (color) => {
|
|
4
|
+
const THEME_COLORS = {
|
|
5
|
+
green: COLORS.mint,
|
|
6
|
+
blue: COLORS.skyBlue,
|
|
7
|
+
purple: COLORS.lavender,
|
|
8
|
+
pink: COLORS.pink,
|
|
9
|
+
white: COLORS.white,
|
|
10
|
+
yellow: COLORS.yellowLight,
|
|
11
|
+
};
|
|
12
|
+
return THEME_COLORS[color] || color;
|
|
13
|
+
};
|
|
14
|
+
export const themeSpacing = (size) => {
|
|
15
|
+
const THEME_SPACING_SIZES = {
|
|
16
|
+
sm: THEME_SPACING.sm,
|
|
17
|
+
md: THEME_SPACING.md,
|
|
18
|
+
lg: THEME_SPACING.lg,
|
|
19
|
+
xl: THEME_SPACING.xl,
|
|
20
|
+
none: "0",
|
|
21
|
+
};
|
|
22
|
+
return THEME_SPACING_SIZES[size] || THEME_SPACING.md;
|
|
23
|
+
};
|
|
24
|
+
export const themeBorderRadius = (size) => {
|
|
25
|
+
const BORDER_RADIUS = {
|
|
26
|
+
sm: rem(6),
|
|
27
|
+
md: rem(8),
|
|
28
|
+
lg: rem(12),
|
|
29
|
+
};
|
|
30
|
+
return BORDER_RADIUS[size] || BORDER_RADIUS.sm;
|
|
31
|
+
};
|
|
32
|
+
export const themeElevation = (elevation) => {
|
|
33
|
+
const ELEVETION = {
|
|
34
|
+
0: "none",
|
|
35
|
+
1: `0 ${rem(4)} ${rem(16)} 0 rgba(0, 0, 0, 0.08)`,
|
|
36
|
+
};
|
|
37
|
+
return ELEVETION[elevation] || ELEVETION[0];
|
|
38
|
+
};
|