@q2devel/q2-storybook 1.0.37 → 1.0.38
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.
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
level
|
|
4
|
-
children:
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
interface HeadingProps {
|
|
3
|
+
level?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
4
|
+
children: ReactNode;
|
|
5
5
|
className?: string;
|
|
6
6
|
id?: string;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export
|
|
7
|
+
}
|
|
8
|
+
declare const Heading: ({ level, children, className, id, }: HeadingProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default Heading;
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
+
'use client';
|
|
1
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { buildClassesByJoining } from
|
|
3
|
-
|
|
3
|
+
import { buildClassesByJoining } from '../../utils/StyleHelper';
|
|
4
|
+
const Heading = ({ level = 1, children, className = '', id, }) => {
|
|
4
5
|
const Tag = `h${level}`;
|
|
5
6
|
const baseStyles = {
|
|
6
|
-
1:
|
|
7
|
-
2:
|
|
8
|
-
3:
|
|
9
|
-
4:
|
|
10
|
-
5:
|
|
11
|
-
6:
|
|
7
|
+
1: 'text-4xl font-bold mt-12 mb-8 text-gray-900',
|
|
8
|
+
2: 'text-3xl font-semibold text-gray-900',
|
|
9
|
+
3: 'text-2xl font-semibold text-gray-900',
|
|
10
|
+
4: 'text-xl font-medium text-gray-900',
|
|
11
|
+
5: 'text-lg font-medium text-gray-900',
|
|
12
|
+
6: 'text-base font-medium text-gray-900',
|
|
12
13
|
};
|
|
13
14
|
return (_jsx(Tag, { id: id, className: buildClassesByJoining(baseStyles[level], className), children: children }));
|
|
14
|
-
}
|
|
15
|
+
};
|
|
16
|
+
export default Heading;
|