@monolith-forensics/monolith-ui 1.2.9 → 1.2.91
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/FormSection/FormSection.d.ts +2 -1
- package/dist/FormSection/FormSection.js +6 -2
- package/dist/Typography/Typography.d.ts +20 -0
- package/dist/Typography/Typography.js +122 -0
- package/dist/Typography/index.d.ts +1 -0
- package/dist/Typography/index.js +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +3 -2
|
@@ -4,6 +4,7 @@ interface FormSectionProps {
|
|
|
4
4
|
className?: string;
|
|
5
5
|
title?: string;
|
|
6
6
|
defaultOpen?: boolean;
|
|
7
|
+
allowCollapse?: boolean;
|
|
7
8
|
}
|
|
8
|
-
declare const FormSection: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<FormSectionProps, never>> & string & Omit<({ className, title, children, defaultOpen }: FormSectionProps) => import("react/jsx-runtime").JSX.Element, keyof import("react").Component<any, {}, any>>;
|
|
9
|
+
declare const FormSection: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<FormSectionProps, never>> & string & Omit<({ className, title, children, defaultOpen, allowCollapse }: FormSectionProps) => import("react/jsx-runtime").JSX.Element, keyof import("react").Component<any, {}, any>>;
|
|
9
10
|
export default FormSection;
|
|
@@ -2,9 +2,13 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { ChevronDownIcon } from "lucide-react";
|
|
3
3
|
import { useState } from "react";
|
|
4
4
|
import styled from "styled-components";
|
|
5
|
-
const FormSection = styled(({ className, title, children, defaultOpen = true }) => {
|
|
5
|
+
const FormSection = styled(({ className, title, children, defaultOpen = true, allowCollapse = true }) => {
|
|
6
6
|
const [open, setOpen] = useState(defaultOpen);
|
|
7
|
-
return (_jsxs("div", { className: className, children: [_jsxs("div", { className: "section-header", onClick: (e) =>
|
|
7
|
+
return (_jsxs("div", { className: className, children: [_jsxs("div", { className: "section-header", onClick: (e) => {
|
|
8
|
+
if (allowCollapse) {
|
|
9
|
+
setOpen(!open);
|
|
10
|
+
}
|
|
11
|
+
}, children: [_jsx("h3", { children: title }), _jsx("div", { className: "section-line" }), !!allowCollapse ? _jsx(ChevronDownIcon, { size: 18, className: open ? "open" : "" }) : ""] }), _jsx("div", { className: "section-content", "data-open": open, children: children })] }));
|
|
8
12
|
}) `
|
|
9
13
|
h3 {
|
|
10
14
|
margin: 0;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
type TypographyVariant = "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "subtitle1" | "subtitle2" | "body1" | "body2" | "button" | "caption" | "overline";
|
|
3
|
+
type TypographyAlign = "inherit" | "left" | "center" | "right" | "justify";
|
|
4
|
+
type TypographyDisplay = "initial" | "block" | "inline" | "inline-block" | "none";
|
|
5
|
+
interface TypographyProps extends React.HTMLAttributes<HTMLElement> {
|
|
6
|
+
variant?: TypographyVariant;
|
|
7
|
+
component?: React.ElementType;
|
|
8
|
+
align?: TypographyAlign;
|
|
9
|
+
color?: string;
|
|
10
|
+
display?: TypographyDisplay;
|
|
11
|
+
noWrap?: boolean;
|
|
12
|
+
gutterBottom?: boolean;
|
|
13
|
+
paragraph?: boolean;
|
|
14
|
+
children?: React.ReactNode;
|
|
15
|
+
className?: string;
|
|
16
|
+
style?: React.CSSProperties;
|
|
17
|
+
}
|
|
18
|
+
declare const Typography: React.ForwardRefExoticComponent<TypographyProps & React.RefAttributes<HTMLElement>>;
|
|
19
|
+
export default Typography;
|
|
20
|
+
export type { TypographyProps, TypographyVariant, TypographyAlign, TypographyDisplay, };
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import styled, { css } from "styled-components";
|
|
14
|
+
import React from "react";
|
|
15
|
+
const variantStyles = {
|
|
16
|
+
h1: css `
|
|
17
|
+
font-size: 2.5rem;
|
|
18
|
+
font-weight: 700;
|
|
19
|
+
line-height: 1.2;
|
|
20
|
+
margin-bottom: 0.25em;
|
|
21
|
+
`,
|
|
22
|
+
h2: css `
|
|
23
|
+
font-size: 2rem;
|
|
24
|
+
font-weight: 700;
|
|
25
|
+
line-height: 1.3;
|
|
26
|
+
margin-bottom: 0.25em;
|
|
27
|
+
|
|
28
|
+
`,
|
|
29
|
+
h3: css `
|
|
30
|
+
font-size: 1.5rem;
|
|
31
|
+
font-weight: 600;
|
|
32
|
+
line-height: 1.25;
|
|
33
|
+
margin-bottom: 0.25em;
|
|
34
|
+
`,
|
|
35
|
+
h4: css `
|
|
36
|
+
font-size: 1.35rem;
|
|
37
|
+
font-weight: 600;
|
|
38
|
+
line-height: 1.4;
|
|
39
|
+
margin-bottom: 0.25em;
|
|
40
|
+
`,
|
|
41
|
+
h5: css `
|
|
42
|
+
font-size: 1.25rem;
|
|
43
|
+
font-weight: 600;
|
|
44
|
+
line-height: 1.4;
|
|
45
|
+
margin-bottom: 0.25em;
|
|
46
|
+
`,
|
|
47
|
+
h6: css `
|
|
48
|
+
font-size: 1.1rem;
|
|
49
|
+
font-weight: 600;
|
|
50
|
+
line-height: 1.4;
|
|
51
|
+
margin-bottom: 0.25em;
|
|
52
|
+
`,
|
|
53
|
+
subtitle1: css `
|
|
54
|
+
font-size: 1rem;
|
|
55
|
+
font-weight: 400;
|
|
56
|
+
line-height: 1.5;
|
|
57
|
+
letter-spacing: 0.00938em;
|
|
58
|
+
`,
|
|
59
|
+
subtitle2: css `
|
|
60
|
+
font-size: 0.875rem;
|
|
61
|
+
font-weight: 500;
|
|
62
|
+
line-height: 1.57;
|
|
63
|
+
letter-spacing: 0.00714em;
|
|
64
|
+
`,
|
|
65
|
+
body1: css `
|
|
66
|
+
font-size: 1rem;
|
|
67
|
+
font-weight: 400;
|
|
68
|
+
line-height: 1.5;
|
|
69
|
+
letter-spacing: 0.00938em;
|
|
70
|
+
`,
|
|
71
|
+
body2: css `
|
|
72
|
+
font-size: 0.875rem;
|
|
73
|
+
font-weight: 400;
|
|
74
|
+
line-height: 1.43;
|
|
75
|
+
letter-spacing: 0.01071em;
|
|
76
|
+
`,
|
|
77
|
+
button: css `
|
|
78
|
+
font-size: 0.875rem;
|
|
79
|
+
font-weight: 500;
|
|
80
|
+
line-height: 1.75;
|
|
81
|
+
letter-spacing: 0.02857em;
|
|
82
|
+
text-transform: uppercase;
|
|
83
|
+
`,
|
|
84
|
+
caption: css `
|
|
85
|
+
font-size: 0.75rem;
|
|
86
|
+
font-weight: 400;
|
|
87
|
+
line-height: 1.66;
|
|
88
|
+
letter-spacing: 0.03333em;
|
|
89
|
+
`,
|
|
90
|
+
overline: css `
|
|
91
|
+
font-size: 0.75rem;
|
|
92
|
+
font-weight: 400;
|
|
93
|
+
line-height: 2.66;
|
|
94
|
+
letter-spacing: 0.08333em;
|
|
95
|
+
text-transform: uppercase;
|
|
96
|
+
`,
|
|
97
|
+
};
|
|
98
|
+
const baseStyles = css `
|
|
99
|
+
margin: 0;
|
|
100
|
+
${({ variant = "body1" }) => variantStyles[variant]}
|
|
101
|
+
${({ color }) => color && `color: ${color};`}
|
|
102
|
+
${({ align }) => align && `text-align: ${align};`}
|
|
103
|
+
${({ display }) => display && `display: ${display};`}
|
|
104
|
+
${({ noWrap }) => noWrap &&
|
|
105
|
+
css `
|
|
106
|
+
overflow: hidden;
|
|
107
|
+
text-overflow: ellipsis;
|
|
108
|
+
white-space: nowrap;
|
|
109
|
+
`}
|
|
110
|
+
${({ gutterBottom }) => gutterBottom && "margin-bottom: 0.35em;"}
|
|
111
|
+
${({ paragraph }) => paragraph && "margin-bottom: 16px;"}
|
|
112
|
+
`;
|
|
113
|
+
const StyledTypography = styled.div `
|
|
114
|
+
${baseStyles}
|
|
115
|
+
`;
|
|
116
|
+
const Typography = React.forwardRef((_a, ref) => {
|
|
117
|
+
var { variant = "body1", component, children, style } = _a, props = __rest(_a, ["variant", "component", "children", "style"]);
|
|
118
|
+
const Component = component || (variant.startsWith("h") ? variant : "p");
|
|
119
|
+
return (_jsx(StyledTypography, Object.assign({ as: Component, ref: ref, variant: variant, style: style }, props, { children: children })));
|
|
120
|
+
});
|
|
121
|
+
Typography.displayName = "Typography";
|
|
122
|
+
export default Typography;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./Typography";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./Typography";
|
package/dist/index.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ export { default as Input } from "./Input";
|
|
|
24
24
|
export { default as Tooltip } from "./Tooltip";
|
|
25
25
|
export { default as Pill } from "./Pill";
|
|
26
26
|
export { default as Calendar } from "./Calendar";
|
|
27
|
+
export { default as Typography } from "./Typography";
|
|
27
28
|
export { default as MonolithUIProvider } from "./MonolithUIProvider";
|
|
28
29
|
export { useMonolithUITheme } from "./MonolithUIProvider";
|
|
29
30
|
export { default as RichTextEditor, Extensions, SlashCommands, Controls, } from "./RichTextEditor";
|
package/dist/index.js
CHANGED
|
@@ -20,6 +20,7 @@ export { default as Input } from "./Input";
|
|
|
20
20
|
export { default as Tooltip } from "./Tooltip";
|
|
21
21
|
export { default as Pill } from "./Pill";
|
|
22
22
|
export { default as Calendar } from "./Calendar";
|
|
23
|
+
export { default as Typography } from "./Typography";
|
|
23
24
|
export { default as MonolithUIProvider } from "./MonolithUIProvider";
|
|
24
25
|
export { useMonolithUITheme } from "./MonolithUIProvider";
|
|
25
26
|
export { default as RichTextEditor, Extensions, SlashCommands, Controls, } from "./RichTextEditor";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@monolith-forensics/monolith-ui",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.91",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"author": "Matt Danner (Monolith Forensics LLC)",
|
|
@@ -71,5 +71,6 @@
|
|
|
71
71
|
"@types/react-window": "^1.8.8",
|
|
72
72
|
"@types/spark-md5": "^3.0.4",
|
|
73
73
|
"typescript": "^5.5.4"
|
|
74
|
-
}
|
|
74
|
+
},
|
|
75
|
+
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
|
|
75
76
|
}
|