@trackunit/react-components 0.1.271 → 0.1.273
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.js +35 -0
- package/index.esm.js +34 -1
- package/package.json +1 -1
- package/src/components/Page/Page.d.ts +20 -0
- package/src/components/Page/Page.variants.d.ts +4 -0
- package/src/components/Page/PageContent.d.ts +17 -0
- package/src/components/Page/index.d.ts +2 -0
- package/src/components/index.d.ts +1 -0
package/index.cjs.js
CHANGED
|
@@ -1908,6 +1908,39 @@ const useModal = ({ closeOnOutsideClick } = {}) => {
|
|
|
1908
1908
|
};
|
|
1909
1909
|
};
|
|
1910
1910
|
|
|
1911
|
+
const cvaPage = cssClassVarianceUtilities.cvaMerge(["grid", "h-full"], {
|
|
1912
|
+
variants: {
|
|
1913
|
+
layout: {
|
|
1914
|
+
content: ["grid-rows-1"],
|
|
1915
|
+
"header-content": "grid-rows-min-fr",
|
|
1916
|
+
"sidebar-content": ["grid-cols-[360px_minmax(0,1fr)]", "grid-rows-1"],
|
|
1917
|
+
none: [],
|
|
1918
|
+
},
|
|
1919
|
+
},
|
|
1920
|
+
defaultVariants: {
|
|
1921
|
+
layout: "none",
|
|
1922
|
+
},
|
|
1923
|
+
});
|
|
1924
|
+
const cvaPageContent = cssClassVarianceUtilities.cvaMerge(["overflow-auto", "p-4", "md:p-6", "lg:p-8"]);
|
|
1925
|
+
|
|
1926
|
+
/**
|
|
1927
|
+
* Renders the page component. Adds padding and layout to the page.
|
|
1928
|
+
*/
|
|
1929
|
+
const Page = ({ layout, className, children, dataTestId }) => {
|
|
1930
|
+
return (jsxRuntime.jsx("div", { className: cvaPage({ className, layout }), "data-testid": dataTestId || "page", children: children }));
|
|
1931
|
+
};
|
|
1932
|
+
|
|
1933
|
+
/**
|
|
1934
|
+
* Renders the content of a page.
|
|
1935
|
+
* Applies padding to content. To be used within a <Page/>
|
|
1936
|
+
*
|
|
1937
|
+
* @param {PageContentProps} props - The component props.
|
|
1938
|
+
* @returns {React.ReactNode} - The rendered component.
|
|
1939
|
+
*/
|
|
1940
|
+
const PageContent = ({ className, children, dataTestId }) => {
|
|
1941
|
+
return (jsxRuntime.jsx("div", { className: cvaPageContent({ className }), "data-testid": dataTestId || "page-content", children: children }));
|
|
1942
|
+
};
|
|
1943
|
+
|
|
1911
1944
|
const cvaNotice = cssClassVarianceUtilities.cvaMerge(["flex", "items-center"]);
|
|
1912
1945
|
const cvaNoticeLabel = cssClassVarianceUtilities.cvaMerge(["pl-1", "pr-1", "font-medium", "text-sm"], {
|
|
1913
1946
|
variants: {
|
|
@@ -3117,6 +3150,8 @@ exports.ModalBackdrop = ModalBackdrop;
|
|
|
3117
3150
|
exports.MoreMenu = MoreMenu;
|
|
3118
3151
|
exports.Notice = Notice;
|
|
3119
3152
|
exports.PackageNameStoryComponent = PackageNameStoryComponent;
|
|
3153
|
+
exports.Page = Page;
|
|
3154
|
+
exports.PageContent = PageContent;
|
|
3120
3155
|
exports.PageHeader = PageHeader;
|
|
3121
3156
|
exports.Pagination = Pagination;
|
|
3122
3157
|
exports.Popover = Popover;
|
package/index.esm.js
CHANGED
|
@@ -1877,6 +1877,39 @@ const useModal = ({ closeOnOutsideClick } = {}) => {
|
|
|
1877
1877
|
};
|
|
1878
1878
|
};
|
|
1879
1879
|
|
|
1880
|
+
const cvaPage = cvaMerge(["grid", "h-full"], {
|
|
1881
|
+
variants: {
|
|
1882
|
+
layout: {
|
|
1883
|
+
content: ["grid-rows-1"],
|
|
1884
|
+
"header-content": "grid-rows-min-fr",
|
|
1885
|
+
"sidebar-content": ["grid-cols-[360px_minmax(0,1fr)]", "grid-rows-1"],
|
|
1886
|
+
none: [],
|
|
1887
|
+
},
|
|
1888
|
+
},
|
|
1889
|
+
defaultVariants: {
|
|
1890
|
+
layout: "none",
|
|
1891
|
+
},
|
|
1892
|
+
});
|
|
1893
|
+
const cvaPageContent = cvaMerge(["overflow-auto", "p-4", "md:p-6", "lg:p-8"]);
|
|
1894
|
+
|
|
1895
|
+
/**
|
|
1896
|
+
* Renders the page component. Adds padding and layout to the page.
|
|
1897
|
+
*/
|
|
1898
|
+
const Page = ({ layout, className, children, dataTestId }) => {
|
|
1899
|
+
return (jsx("div", { className: cvaPage({ className, layout }), "data-testid": dataTestId || "page", children: children }));
|
|
1900
|
+
};
|
|
1901
|
+
|
|
1902
|
+
/**
|
|
1903
|
+
* Renders the content of a page.
|
|
1904
|
+
* Applies padding to content. To be used within a <Page/>
|
|
1905
|
+
*
|
|
1906
|
+
* @param {PageContentProps} props - The component props.
|
|
1907
|
+
* @returns {React.ReactNode} - The rendered component.
|
|
1908
|
+
*/
|
|
1909
|
+
const PageContent = ({ className, children, dataTestId }) => {
|
|
1910
|
+
return (jsx("div", { className: cvaPageContent({ className }), "data-testid": dataTestId || "page-content", children: children }));
|
|
1911
|
+
};
|
|
1912
|
+
|
|
1880
1913
|
const cvaNotice = cvaMerge(["flex", "items-center"]);
|
|
1881
1914
|
const cvaNoticeLabel = cvaMerge(["pl-1", "pr-1", "font-medium", "text-sm"], {
|
|
1882
1915
|
variants: {
|
|
@@ -3061,4 +3094,4 @@ const useVisibilityChange = ({ onChange, targetState = "hidden" }) => {
|
|
|
3061
3094
|
}, [onChange, targetState]);
|
|
3062
3095
|
};
|
|
3063
3096
|
|
|
3064
|
-
export { Alert, Badge, Button, Card, CardBody, CardFooter, CardHeader, Collapse, CopyableText, DayPicker, DayRangePicker, Drawer, EmptyState, ExternalLink, Heading, Icon, IconButton, Indicator, MenuItem, MenuList, Modal, ModalBackdrop, MoreMenu, Notice, PackageNameStoryComponent, PageHeader, Pagination, Popover, PopoverContent, PopoverTitle, PopoverTrigger, Prompt, ROLE_CARD, SectionHeader, Sidebar, SkeletonLines, Spacer, Spinner, StarButton, Tab, TabContent, TabList, Tabs, Tag, Text, Timeline, TimelineElement, Tooltip, ValueBar, WidgetBody, cvaButton, cvaButtonPrefixSuffix, cvaButtonSpinner, cvaButtonSpinnerContainer, cvaClickable, cvaIconButton, cvaIndicator, cvaIndicatorIcon, cvaIndicatorIconBackground, cvaIndicatorLabel, cvaIndicatorPing, cvaMenuItem, cvaMenuItemLabel, cvaMenuItemPrefix, cvaMenuItemSuffix, docs, getDevicePixelRatio, getValueBarColorByValue, iconColorNames, iconPalette, setLocalStorage, useClickOutside, useContainerProps, useContinuousTimeout, useDebounce, useDevicePixelRatio, useGeometry, useHover, useIsFirstRender, useIsFullscreen, useIsTextCutOff, useLocalStorage, useLocalStorageReducer, useModal, useOptionallyElevatedState, useOverflowItems, usePopoverContext, usePrompt, useResize, useSelfUpdatingRef, useTimeout, useVisibilityChange };
|
|
3097
|
+
export { Alert, Badge, Button, Card, CardBody, CardFooter, CardHeader, Collapse, CopyableText, DayPicker, DayRangePicker, Drawer, EmptyState, ExternalLink, Heading, Icon, IconButton, Indicator, MenuItem, MenuList, Modal, ModalBackdrop, MoreMenu, Notice, PackageNameStoryComponent, Page, PageContent, PageHeader, Pagination, Popover, PopoverContent, PopoverTitle, PopoverTrigger, Prompt, ROLE_CARD, SectionHeader, Sidebar, SkeletonLines, Spacer, Spinner, StarButton, Tab, TabContent, TabList, Tabs, Tag, Text, Timeline, TimelineElement, Tooltip, ValueBar, WidgetBody, cvaButton, cvaButtonPrefixSuffix, cvaButtonSpinner, cvaButtonSpinnerContainer, cvaClickable, cvaIconButton, cvaIndicator, cvaIndicatorIcon, cvaIndicatorIconBackground, cvaIndicatorLabel, cvaIndicatorPing, cvaMenuItem, cvaMenuItemLabel, cvaMenuItemPrefix, cvaMenuItemSuffix, docs, getDevicePixelRatio, getValueBarColorByValue, iconColorNames, iconPalette, setLocalStorage, useClickOutside, useContainerProps, useContinuousTimeout, useDebounce, useDevicePixelRatio, useGeometry, useHover, useIsFirstRender, useIsFullscreen, useIsTextCutOff, useLocalStorage, useLocalStorageReducer, useModal, useOptionallyElevatedState, useOverflowItems, usePopoverContext, usePrompt, useResize, useSelfUpdatingRef, useTimeout, useVisibilityChange };
|
package/package.json
CHANGED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { VariantProps } from "@trackunit/css-class-variance-utilities";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { CommonProps } from "../../common";
|
|
4
|
+
import { cvaPage } from "./Page.variants";
|
|
5
|
+
/**
|
|
6
|
+
* The layout of the page.
|
|
7
|
+
*/
|
|
8
|
+
export type Layout = VariantProps<typeof cvaPage>["layout"];
|
|
9
|
+
/**
|
|
10
|
+
* The props for the page component.
|
|
11
|
+
*/
|
|
12
|
+
export interface PageProps extends CommonProps {
|
|
13
|
+
layout: Layout;
|
|
14
|
+
children?: React.ReactNode;
|
|
15
|
+
dataTestId?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Renders the page component. Adds padding and layout to the page.
|
|
19
|
+
*/
|
|
20
|
+
export declare const Page: ({ layout, className, children, dataTestId }: PageProps) => JSX.Element;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const cvaPage: (props?: ({
|
|
2
|
+
layout?: "content" | "header-content" | "sidebar-content" | "none" | null | undefined;
|
|
3
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
4
|
+
export declare const cvaPageContent: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { CommonProps } from "../../common";
|
|
3
|
+
/**
|
|
4
|
+
* The props for the page content component.
|
|
5
|
+
*/
|
|
6
|
+
interface PageContentProps extends CommonProps {
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Renders the content of a page.
|
|
11
|
+
* Applies padding to content. To be used within a <Page/>
|
|
12
|
+
*
|
|
13
|
+
* @param {PageContentProps} props - The component props.
|
|
14
|
+
* @returns {React.ReactNode} - The rendered component.
|
|
15
|
+
*/
|
|
16
|
+
export declare const PageContent: ({ className, children, dataTestId }: PageContentProps) => JSX.Element;
|
|
17
|
+
export {};
|