@trackunit/react-components 0.1.97 → 0.1.100

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, addon }) => {
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 })), addon] }), subtitle && (jsxRuntime.jsx(Heading$1, Object.assign({ variant: "subtitle", subtle: true }, { children: subtitle }))), jsxRuntime.jsx(Spacer, { minHeight: "normal" })] }));
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 `tu-section-header`;
1760
- const StyledFlex = tailwindStyledComponents.tw.div `tu-section-header__flex`;
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
@@ -192,14 +192,3 @@
192
192
  hover:bg-transparent;
193
193
  }
194
194
  }
195
-
196
- .tu-section-header {
197
- @apply w-full;
198
-
199
- &__flex {
200
- @apply flex
201
- items-center
202
- flex-wrap-reverse
203
- gap-2;
204
- }
205
- }
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, addon }) => {
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 })), addon] }), subtitle && (jsx(Heading$1, Object.assign({ variant: "subtitle", subtle: true }, { children: subtitle }))), jsx(Spacer, { minHeight: "normal" })] }));
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 `tu-section-header`;
1733
- const StyledFlex = tw.div `tu-section-header__flex`;
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,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-components",
3
- "version": "0.1.97",
3
+ "version": "0.1.100",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "dependencies": {
@@ -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
- addon?: ReactNode;
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, addon }: SectionHeaderProps) => JSX.Element;
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;