@trackunit/react-components 0.1.97 → 0.1.99
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/index.cjs
CHANGED
|
@@ -1753,11 +1753,18 @@ const Space = tailwindStyledComponents.tw.div `
|
|
|
1753
1753
|
* @param {SectionHeaderProps} props - The props for the section header component
|
|
1754
1754
|
* @returns {JSX.Element} SectionHeader component
|
|
1755
1755
|
*/
|
|
1756
|
-
const SectionHeader = ({ title, subtitle, dataTestId,
|
|
1757
|
-
return (jsxRuntime.jsxs(SectionHeaderContainer, { children: [jsxRuntime.jsx(reactHelmetAsync.HelmetProvider, { children: jsxRuntime.jsx(reactHelmetAsync.Helmet, { title: title }) }), jsxRuntime.jsxs(StyledFlex, { children: [jsxRuntime.jsx(Heading$1, Object.assign({ variant: "secondary", dataTestId: dataTestId }, { children: title })),
|
|
1756
|
+
const SectionHeader = ({ title, subtitle, dataTestId, addons }) => {
|
|
1757
|
+
return (jsxRuntime.jsxs(SectionHeaderContainer, { children: [jsxRuntime.jsx(reactHelmetAsync.HelmetProvider, { children: jsxRuntime.jsx(reactHelmetAsync.Helmet, { title: title }) }), jsxRuntime.jsxs(StyledFlex, Object.assign({ className: "flex-row mb-2" }, { children: [jsxRuntime.jsxs(StyledFlex, Object.assign({ className: "flex-col grow" }, { children: [jsxRuntime.jsx(Heading$1, Object.assign({ variant: "secondary", dataTestId: dataTestId }, { children: title })), subtitle && (jsxRuntime.jsx(Heading$1, Object.assign({ variant: "subtitle", subtle: true }, { children: subtitle })))] })), addons && jsxRuntime.jsx(StyledFlex, { children: addons })] })), jsxRuntime.jsx(Spacer, { minHeight: "normal" })] }));
|
|
1758
1758
|
};
|
|
1759
|
-
const SectionHeaderContainer = tailwindStyledComponents.tw.div `
|
|
1760
|
-
|
|
1759
|
+
const SectionHeaderContainer = tailwindStyledComponents.tw.div `
|
|
1760
|
+
tu-section-header
|
|
1761
|
+
flex
|
|
1762
|
+
flex-col
|
|
1763
|
+
`;
|
|
1764
|
+
const StyledFlex = tailwindStyledComponents.tw.div `
|
|
1765
|
+
flex
|
|
1766
|
+
gap-2
|
|
1767
|
+
`;
|
|
1761
1768
|
|
|
1762
1769
|
/**
|
|
1763
1770
|
* A hook used to detect what children are overflowing a container.
|
package/index.css
CHANGED
package/index.js
CHANGED
|
@@ -1726,11 +1726,18 @@ const Space = tw.div `
|
|
|
1726
1726
|
* @param {SectionHeaderProps} props - The props for the section header component
|
|
1727
1727
|
* @returns {JSX.Element} SectionHeader component
|
|
1728
1728
|
*/
|
|
1729
|
-
const SectionHeader = ({ title, subtitle, dataTestId,
|
|
1730
|
-
return (jsxs(SectionHeaderContainer, { children: [jsx(HelmetProvider, { children: jsx(Helmet, { title: title }) }), jsxs(StyledFlex, { children: [jsx(Heading$1, Object.assign({ variant: "secondary", dataTestId: dataTestId }, { children: title })),
|
|
1729
|
+
const SectionHeader = ({ title, subtitle, dataTestId, addons }) => {
|
|
1730
|
+
return (jsxs(SectionHeaderContainer, { children: [jsx(HelmetProvider, { children: jsx(Helmet, { title: title }) }), jsxs(StyledFlex, Object.assign({ className: "flex-row mb-2" }, { children: [jsxs(StyledFlex, Object.assign({ className: "flex-col grow" }, { children: [jsx(Heading$1, Object.assign({ variant: "secondary", dataTestId: dataTestId }, { children: title })), subtitle && (jsx(Heading$1, Object.assign({ variant: "subtitle", subtle: true }, { children: subtitle })))] })), addons && jsx(StyledFlex, { children: addons })] })), jsx(Spacer, { minHeight: "normal" })] }));
|
|
1731
1731
|
};
|
|
1732
|
-
const SectionHeaderContainer = tw.div `
|
|
1733
|
-
|
|
1732
|
+
const SectionHeaderContainer = tw.div `
|
|
1733
|
+
tu-section-header
|
|
1734
|
+
flex
|
|
1735
|
+
flex-col
|
|
1736
|
+
`;
|
|
1737
|
+
const StyledFlex = tw.div `
|
|
1738
|
+
flex
|
|
1739
|
+
gap-2
|
|
1740
|
+
`;
|
|
1734
1741
|
|
|
1735
1742
|
/**
|
|
1736
1743
|
* A hook used to detect what children are overflowing a container.
|
package/package.json
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
2
|
import { CommonProps } from "../../common/CommonProps";
|
|
3
|
-
import "./SectionHeader.css";
|
|
4
3
|
export interface SectionHeaderProps extends CommonProps {
|
|
5
4
|
/**
|
|
6
5
|
* The title of the section.
|
|
@@ -13,7 +12,7 @@ export interface SectionHeaderProps extends CommonProps {
|
|
|
13
12
|
/**
|
|
14
13
|
* The addon could be used to tell the state of a section header.
|
|
15
14
|
*/
|
|
16
|
-
|
|
15
|
+
addons?: ReactNode;
|
|
17
16
|
}
|
|
18
17
|
/**
|
|
19
18
|
* The SectionHeader component is used on sections to set the section title.
|
|
@@ -21,4 +20,4 @@ export interface SectionHeaderProps extends CommonProps {
|
|
|
21
20
|
* @param {SectionHeaderProps} props - The props for the section header component
|
|
22
21
|
* @returns {JSX.Element} SectionHeader component
|
|
23
22
|
*/
|
|
24
|
-
export declare const SectionHeader: ({ title, subtitle, dataTestId,
|
|
23
|
+
export declare const SectionHeader: ({ title, subtitle, dataTestId, addons }: SectionHeaderProps) => JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CommonProps, Size } from "../../../common";
|
|
2
|
+
export type BackToTopColor = "primary" | "secondary";
|
|
3
|
+
export interface StyledBackToTopProps {
|
|
4
|
+
$color?: BackToTopColor;
|
|
5
|
+
}
|
|
6
|
+
export interface BackToTopProps extends CommonProps {
|
|
7
|
+
color?: BackToTopColor;
|
|
8
|
+
size?: Size;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* BackToTopButton appears at the bottom-right corner of the screen when the user scrolls down the page. When clicked, the page scrolls smoothly to the top.
|
|
12
|
+
*
|
|
13
|
+
*/
|
|
14
|
+
export declare const BackToTopButton: ({ color, size, dataTestId }: BackToTopProps) => JSX.Element;
|