@trackunit/react-components 1.4.114 → 1.4.115

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 CHANGED
@@ -3893,7 +3893,7 @@ const cvaWidgetBodyDensityContainer = cssClassVarianceUtilities.cvaMerge([
3893
3893
  compact: "gap-3 p-3",
3894
3894
  comfortable: "gap-4 p-4",
3895
3895
  spacious: "gap-4 p-6",
3896
- auto: "p-2",
3896
+ auto: "gap-2 p-2",
3897
3897
  },
3898
3898
  },
3899
3899
  defaultVariants: {
@@ -3911,8 +3911,48 @@ const cvaWidgetBodyDensityContainer = cssClassVarianceUtilities.cvaMerge([
3911
3911
  * @param {WidgetBodyProps} props - The props for the WidgetBody component
3912
3912
  * @returns {ReactElement} WidgetBody component
3913
3913
  */
3914
- const WidgetBody = ({ density = "auto", children, dataTestId, className, disableGap }) => {
3915
- return (jsxRuntime.jsx("div", { className: cvaWidgetBodyDensityContainer({ density, disableGap, className }), "data-testid": dataTestId, children: children }));
3914
+ const WidgetBody = ({ density = "auto", children, dataTestId, className, disableGap, direction = "column", }) => {
3915
+ return (jsxRuntime.jsx("div", { className: cvaWidgetBodyDensityContainer({ density, disableGap, className, direction }), "data-testid": dataTestId, children: children }));
3916
+ };
3917
+
3918
+ const cvaWidgetEditBodyDensityContainer = cssClassVarianceUtilities.cvaMerge(["min-w-96", "w-96"], {
3919
+ variants: {
3920
+ disableGap: {
3921
+ true: "gap-0",
3922
+ false: "",
3923
+ },
3924
+ direction: {
3925
+ row: "flex-row",
3926
+ "row-reverse": "flex-row-reverse",
3927
+ column: "flex-col",
3928
+ "column-reverse": "flex-col-reverse",
3929
+ },
3930
+ density: {
3931
+ none: "",
3932
+ dense: "gap-1 p-2",
3933
+ compact: "gap-3 p-3",
3934
+ comfortable: "gap-4 p-4",
3935
+ spacious: "gap-4 p-6",
3936
+ auto: "gap-2 p-2",
3937
+ },
3938
+ },
3939
+ defaultVariants: {
3940
+ disableGap: false,
3941
+ direction: "column",
3942
+ density: "auto",
3943
+ },
3944
+ });
3945
+
3946
+ /**
3947
+ * The WidgetBody component should be used to inform the user of important information.
3948
+ *
3949
+ * @summary For applying padding and gap to a Widget.
3950
+ * @description The padding must live here, and not on the Widget itself, as to not inset the scrollbar in case of overflow
3951
+ * @param {WidgetEditBodyProps} props - The props for the WidgetEditBody component
3952
+ * @returns {ReactElement} WidgetBody component
3953
+ */
3954
+ const WidgetEditBody = ({ density = "auto", children, dataTestId, className, disableGap, }) => {
3955
+ return (jsxRuntime.jsx("div", { className: cvaWidgetEditBodyDensityContainer({ density, disableGap, className }), "data-testid": dataTestId, children: children }));
3916
3956
  };
3917
3957
 
3918
3958
  const cvaZStackContainer = cssClassVarianceUtilities.cvaMerge(["grid", "grid-cols-1", "grid-rows-1"]);
@@ -4022,6 +4062,7 @@ exports.Tooltip = Tooltip;
4022
4062
  exports.ValueBar = ValueBar;
4023
4063
  exports.VirtualizedList = VirtualizedList;
4024
4064
  exports.WidgetBody = WidgetBody;
4065
+ exports.WidgetEditBody = WidgetEditBody;
4025
4066
  exports.ZStack = ZStack;
4026
4067
  exports.cvaButton = cvaButton;
4027
4068
  exports.cvaButtonPrefixSuffix = cvaButtonPrefixSuffix;
package/index.esm.js CHANGED
@@ -3891,7 +3891,7 @@ const cvaWidgetBodyDensityContainer = cvaMerge([
3891
3891
  compact: "gap-3 p-3",
3892
3892
  comfortable: "gap-4 p-4",
3893
3893
  spacious: "gap-4 p-6",
3894
- auto: "p-2",
3894
+ auto: "gap-2 p-2",
3895
3895
  },
3896
3896
  },
3897
3897
  defaultVariants: {
@@ -3909,8 +3909,48 @@ const cvaWidgetBodyDensityContainer = cvaMerge([
3909
3909
  * @param {WidgetBodyProps} props - The props for the WidgetBody component
3910
3910
  * @returns {ReactElement} WidgetBody component
3911
3911
  */
3912
- const WidgetBody = ({ density = "auto", children, dataTestId, className, disableGap }) => {
3913
- return (jsx("div", { className: cvaWidgetBodyDensityContainer({ density, disableGap, className }), "data-testid": dataTestId, children: children }));
3912
+ const WidgetBody = ({ density = "auto", children, dataTestId, className, disableGap, direction = "column", }) => {
3913
+ return (jsx("div", { className: cvaWidgetBodyDensityContainer({ density, disableGap, className, direction }), "data-testid": dataTestId, children: children }));
3914
+ };
3915
+
3916
+ const cvaWidgetEditBodyDensityContainer = cvaMerge(["min-w-96", "w-96"], {
3917
+ variants: {
3918
+ disableGap: {
3919
+ true: "gap-0",
3920
+ false: "",
3921
+ },
3922
+ direction: {
3923
+ row: "flex-row",
3924
+ "row-reverse": "flex-row-reverse",
3925
+ column: "flex-col",
3926
+ "column-reverse": "flex-col-reverse",
3927
+ },
3928
+ density: {
3929
+ none: "",
3930
+ dense: "gap-1 p-2",
3931
+ compact: "gap-3 p-3",
3932
+ comfortable: "gap-4 p-4",
3933
+ spacious: "gap-4 p-6",
3934
+ auto: "gap-2 p-2",
3935
+ },
3936
+ },
3937
+ defaultVariants: {
3938
+ disableGap: false,
3939
+ direction: "column",
3940
+ density: "auto",
3941
+ },
3942
+ });
3943
+
3944
+ /**
3945
+ * The WidgetBody component should be used to inform the user of important information.
3946
+ *
3947
+ * @summary For applying padding and gap to a Widget.
3948
+ * @description The padding must live here, and not on the Widget itself, as to not inset the scrollbar in case of overflow
3949
+ * @param {WidgetEditBodyProps} props - The props for the WidgetEditBody component
3950
+ * @returns {ReactElement} WidgetBody component
3951
+ */
3952
+ const WidgetEditBody = ({ density = "auto", children, dataTestId, className, disableGap, }) => {
3953
+ return (jsx("div", { className: cvaWidgetEditBodyDensityContainer({ density, disableGap, className }), "data-testid": dataTestId, children: children }));
3914
3954
  };
3915
3955
 
3916
3956
  const cvaZStackContainer = cvaMerge(["grid", "grid-cols-1", "grid-rows-1"]);
@@ -3959,4 +3999,4 @@ const cvaClickable = cvaMerge([
3959
3999
  },
3960
4000
  });
3961
4001
 
3962
- export { ActionRenderer, Alert, Badge, Breadcrumb, BreadcrumbContainer, Button, Card, CardBody, CardFooter, CardHeader, Collapse, CompletionStatusIndicator, CopyableText, EmptyState, EmptyValue, ExternalLink, Heading, Icon, IconButton, Indicator, KPI, KPICard, MenuDivider, MenuItem, MenuList, MoreMenu, Notice, PackageNameStoryComponent, Page, PageContent, PageHeader, PageHeaderKpiMetrics, PageHeaderSecondaryActions, PageHeaderTitle, Pagination, Polygon, Popover, PopoverContent, PopoverTitle, PopoverTrigger, Portal, Prompt, ROLE_CARD, SectionHeader, Sidebar, SkeletonLines, Spacer, Spinner, StarButton, Tab, TabContent, TabList, Tabs, Tag, Text, ToggleGroup, ToggleItem, Tooltip, ValueBar, VirtualizedList, WidgetBody, ZStack, cvaButton, cvaButtonPrefixSuffix, cvaButtonSpinner, cvaButtonSpinnerContainer, cvaClickable, cvaContainerStyles, cvaIconButton, cvaImgStyles, cvaIndicator, cvaIndicatorIcon, cvaIndicatorIconBackground, cvaIndicatorLabel, cvaIndicatorPing, cvaInteractableItem, cvaMenuItem, cvaMenuItemLabel, cvaMenuItemPrefix, cvaMenuItemStyle, cvaMenuItemSuffix, cvaPageHeader, cvaPageHeaderContainer, cvaPageHeaderHeading, cvaToggleGroup, cvaToggleItem, cvaToggleItemText, cvaVirtualizedList, cvaVirtualizedListContainer, cvaVirtualizedListItem, cvaZStackContainer, cvaZStackItem, docs, getDevicePixelRatio, getValueBarColorByValue, iconColorNames, iconPalette, useClickOutside, useContainerBreakpoints, useContinuousTimeout, useDebounce, useDevicePixelRatio, useElevatedReducer, useElevatedState, useGeometry, useHover, useIsFirstRender, useIsFullscreen, useIsTextTruncated, useOverflowItems, usePopoverContext, usePrompt, useResize, useScrollDetection, useSelfUpdatingRef, useTimeout, useViewportBreakpoints, useWatch, useWindowActivity };
4002
+ export { ActionRenderer, Alert, Badge, Breadcrumb, BreadcrumbContainer, Button, Card, CardBody, CardFooter, CardHeader, Collapse, CompletionStatusIndicator, CopyableText, EmptyState, EmptyValue, ExternalLink, Heading, Icon, IconButton, Indicator, KPI, KPICard, MenuDivider, MenuItem, MenuList, MoreMenu, Notice, PackageNameStoryComponent, Page, PageContent, PageHeader, PageHeaderKpiMetrics, PageHeaderSecondaryActions, PageHeaderTitle, Pagination, Polygon, Popover, PopoverContent, PopoverTitle, PopoverTrigger, Portal, Prompt, ROLE_CARD, SectionHeader, Sidebar, SkeletonLines, Spacer, Spinner, StarButton, Tab, TabContent, TabList, Tabs, Tag, Text, ToggleGroup, ToggleItem, Tooltip, ValueBar, VirtualizedList, WidgetBody, WidgetEditBody, ZStack, cvaButton, cvaButtonPrefixSuffix, cvaButtonSpinner, cvaButtonSpinnerContainer, cvaClickable, cvaContainerStyles, cvaIconButton, cvaImgStyles, cvaIndicator, cvaIndicatorIcon, cvaIndicatorIconBackground, cvaIndicatorLabel, cvaIndicatorPing, cvaInteractableItem, cvaMenuItem, cvaMenuItemLabel, cvaMenuItemPrefix, cvaMenuItemStyle, cvaMenuItemSuffix, cvaPageHeader, cvaPageHeaderContainer, cvaPageHeaderHeading, cvaToggleGroup, cvaToggleItem, cvaToggleItemText, cvaVirtualizedList, cvaVirtualizedListContainer, cvaVirtualizedListItem, cvaZStackContainer, cvaZStackItem, docs, getDevicePixelRatio, getValueBarColorByValue, iconColorNames, iconPalette, useClickOutside, useContainerBreakpoints, useContinuousTimeout, useDebounce, useDevicePixelRatio, useElevatedReducer, useElevatedState, useGeometry, useHover, useIsFirstRender, useIsFullscreen, useIsTextTruncated, useOverflowItems, usePopoverContext, usePrompt, useResize, useScrollDetection, useSelfUpdatingRef, useTimeout, useViewportBreakpoints, useWatch, useWindowActivity };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-components",
3
- "version": "1.4.114",
3
+ "version": "1.4.115",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
@@ -13,6 +13,10 @@ export interface WidgetBodyProps extends CommonProps {
13
13
  * Child elements to render in the body
14
14
  */
15
15
  children: ReactNode | null;
16
+ /**
17
+ * Direction of the body
18
+ */
19
+ direction?: "row" | "column";
16
20
  }
17
21
  /**
18
22
  * The WidgetBody component should be used to inform the user of important information.
@@ -22,4 +26,4 @@ export interface WidgetBodyProps extends CommonProps {
22
26
  * @param {WidgetBodyProps} props - The props for the WidgetBody component
23
27
  * @returns {ReactElement} WidgetBody component
24
28
  */
25
- export declare const WidgetBody: ({ density, children, dataTestId, className, disableGap }: WidgetBodyProps) => import("react/jsx-runtime").JSX.Element;
29
+ export declare const WidgetBody: ({ density, children, dataTestId, className, disableGap, direction, }: WidgetBodyProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,25 @@
1
+ import { ReactNode } from "react";
2
+ import { CommonProps, Density } from "../../common";
3
+ export interface WidgetEditBodyProps extends CommonProps {
4
+ /**
5
+ * Sets gap, padding and margin.
6
+ */
7
+ density?: Density;
8
+ /**
9
+ * Set gap to be 0px (not preferable)
10
+ */
11
+ disableGap?: boolean;
12
+ /**
13
+ * Child elements to render in the body
14
+ */
15
+ children: ReactNode | null;
16
+ }
17
+ /**
18
+ * The WidgetBody component should be used to inform the user of important information.
19
+ *
20
+ * @summary For applying padding and gap to a Widget.
21
+ * @description The padding must live here, and not on the Widget itself, as to not inset the scrollbar in case of overflow
22
+ * @param {WidgetEditBodyProps} props - The props for the WidgetEditBody component
23
+ * @returns {ReactElement} WidgetBody component
24
+ */
25
+ export declare const WidgetEditBody: ({ density, children, dataTestId, className, disableGap, }: WidgetEditBodyProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ export declare const cvaWidgetEditBodyDensityContainer: (props?: ({
2
+ disableGap?: boolean | null | undefined;
3
+ direction?: "row" | "row-reverse" | "column" | "column-reverse" | null | undefined;
4
+ density?: "none" | "dense" | "compact" | "comfortable" | "spacious" | "auto" | null | undefined;
5
+ } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
@@ -1 +1,2 @@
1
1
  export * from "./WidgetBody";
2
+ export * from "./WidgetEditBody";