@trackunit/react-components 0.1.237 → 0.1.239

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-components",
3
- "version": "0.1.237",
3
+ "version": "0.1.239",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
@@ -1,6 +1,6 @@
1
- /// <reference types="react" />
2
1
  import { ActivityColors, CriticalityColors, GeneralColors, IntentColors, RentalStatusColors, SitesColors, UtilizationColors } from "@trackunit/ui-design-tokens";
3
2
  import { IconName } from "@trackunit/ui-icons";
3
+ import { CSSProperties } from "react";
4
4
  import { CommonProps, Size } from "../../common/CommonProps";
5
5
  export type IconColors = IntentColors | GeneralColors | CriticalityColors | ActivityColors | UtilizationColors | SitesColors | RentalStatusColors;
6
6
  export declare const iconPalette: {
@@ -205,7 +205,11 @@ export declare const iconPalette: {
205
205
  readonly 50: "239 246 255";
206
206
  readonly 100: "219 234 254";
207
207
  readonly 200: "191 219 254";
208
- readonly 300: "147 197 253";
208
+ readonly 300: "147 197 253"; /**
209
+ * Select if the icon should be rendered as solid or outline.
210
+ * Default value depends on the Size prop, mini == solid, medium == solid, large == outline.
211
+ * Trackunit icons might not support both outline and Solid.
212
+ */
209
213
  readonly 400: "96 165 250";
210
214
  readonly 500: "59 130 246";
211
215
  readonly 600: "37 99 235";
@@ -305,7 +309,7 @@ export type IconProps = DiscriminatedIconProps & CommonProps & {
305
309
  *
306
310
  * @memberof IconProps
307
311
  */
308
- style?: Record<string, string>;
312
+ style?: CSSProperties;
309
313
  };
310
314
  /**
311
315
  * - The Icon component is used to display an Icon.
@@ -315,5 +319,5 @@ export type IconProps = DiscriminatedIconProps & CommonProps & {
315
319
  * @param {IconProps} props - The props for the Icon component
316
320
  * @returns {JSX.Element} Icon component
317
321
  */
318
- export declare const Icon: ({ name, size, className, dataTestId, color, onClick, type, style, forwardedRef, }: IconProps) => JSX.Element | null;
322
+ export declare const Icon: ({ name, size, className, dataTestId, color, onClick, type, style, forwardedRef, }: IconProps) => JSX.Element;
319
323
  export {};
@@ -15,6 +15,10 @@ export interface PageHeaderProps extends CommonProps {
15
15
  * The link to which user is redirected to if user clicks on the tip.
16
16
  */
17
17
  link?: string;
18
+ /**
19
+ * Display text of the specified link
20
+ */
21
+ linkText?: string;
18
22
  /**
19
23
  * Additional actions to be rendered along with the header.
20
24
  */
@@ -51,4 +55,4 @@ export interface PageHeaderProps extends CommonProps {
51
55
  * @param {PageHeaderProps} props - The props for the PageHeader component
52
56
  * @returns {JSX.Element} PageHeader component
53
57
  */
54
- export declare const PageHeader: ({ className, dataTestId, action, showLoading, description, link, title, tag, backTo, tagColor, children, tabsList, }: PageHeaderProps) => JSX.Element;
58
+ export declare const PageHeader: ({ className, dataTestId, action, showLoading, description, link, title, tag, backTo, tagColor, children, tabsList, linkText, }: PageHeaderProps) => JSX.Element;
@@ -6,3 +6,5 @@ export declare const cvaPageHeaderHeading: (props?: import("class-variance-autho
6
6
  export declare const cvaPageHeaderHeadingContainer: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
7
7
  export declare const cvaPageHeaderHeadingAccessoriesContainer: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
8
8
  export declare const cvaPageHeaderChildContainer: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
9
+ export declare const cvaPageHeaderDescriptionAndLinkContainer: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
10
+ export declare const cvaPageHeaderLink: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
@@ -20,7 +20,5 @@ export interface SkeletonLinesProps extends CommonProps {
20
20
  }
21
21
  /**
22
22
  * Display placeholder lines before the data gets loaded to reduce load-time frustration.
23
-
24
23
  */
25
24
  export declare const SkeletonLines: import("react").MemoExoticComponent<({ margin, lines, height, width, className, dataTestId }: SkeletonLinesProps) => JSX.Element>;
26
- export default SkeletonLines;
@@ -1,7 +1,10 @@
1
+ import { Placement } from "@floating-ui/react";
1
2
  import * as React from "react";
2
3
  import { CommonProps } from "../../common";
3
- import { PopoverPlacement } from "../Popover";
4
+ import { IconProps } from "../Icon/Icon";
4
5
  import { TextType } from "../Text";
6
+ export type ToolTipVariant = "icon" | "none";
7
+ export type TooltipPlacement = Placement | "auto";
5
8
  export interface TooltipProps extends CommonProps {
6
9
  /**
7
10
  * The text to be displayed in the tooltip.
@@ -10,7 +13,7 @@ export interface TooltipProps extends CommonProps {
10
13
  /**
11
14
  * Where the tooltip should preferentially be placed.
12
15
  */
13
- placement?: PopoverPlacement;
16
+ placement?: TooltipPlacement;
14
17
  /**
15
18
  * Child nodes
16
19
  */
@@ -27,11 +30,21 @@ export interface TooltipProps extends CommonProps {
27
30
  * Type of content.
28
31
  */
29
32
  contentTextType?: TextType;
33
+ /**
34
+ * The props for setting the icon on this tip.
35
+ */
36
+ iconProps?: Omit<IconProps, "type">;
30
37
  }
31
38
  /**
32
- * The Tooltip component is used to show helpful tips or contextual information to the users.
39
+ * Tooltips display additional information upon hover. The information included should be contextual, helpful, and nonessential while providing that extra ability to communicate and give clarity to a user.
40
+ *
41
+ * Tooltips should be used sparingly and contain succinct, supplementary information, and they should contain read-only text. **❗️Do not include interactive elements in tooltips ** (no links, buttons, etc). Interactive elements in tooltips are inaccessible since tooltips do not receive focus.
42
+ *
43
+ * **Do use** tooltips to expose names of icon buttons that lack visual labels, when more information is useful in helping a user understand the context, when an element needs additional explanation, or use when defining a term or inline item.
44
+ *
45
+ * **Do not use** tooltips to include information that is necessary for the user to complete their task. Use helper text that is always visible and accessible for vital information.
33
46
 
34
47
  * @param {TooltipProps} props - The props for the Tooltip component
35
48
  * @returns {JSX.Element} Tooltip component
36
49
  */
37
- export declare const Tooltip: ({ children, dataTestId, disabled, className, ...rest }: TooltipProps) => JSX.Element;
50
+ export declare const Tooltip: ({ children, dataTestId, disabled, className, label, placement, mode, contentTextType, iconProps, }: TooltipProps) => JSX.Element;
@@ -1,6 +1,14 @@
1
1
  export declare const cvaTooltipFlexContainer: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
2
+ export declare const cvaTooltipIcon: (props?: ({
3
+ color?: "light" | "dark" | null | undefined;
4
+ defaultVariants?: "color" | null | undefined;
5
+ } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
2
6
  export declare const cvaTooltipPopover: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
3
- export declare const cvaTooltipContainer: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
4
- export declare const cvaTooltipContent: (props?: ({
7
+ export declare const cvaTooltipPopoverTail: (props?: ({
8
+ placement?: "top" | "top-start" | "top-end" | "bottom" | "bottom-start" | "bottom-end" | "left" | "left-start" | "left-end" | "right" | "right-start" | "right-end" | null | undefined;
9
+ mode?: "light" | "dark" | null | undefined;
10
+ } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
11
+ export declare const cvaTooltipPopoverContainer: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
12
+ export declare const cvaTooltipPopoverContent: (props?: ({
5
13
  color?: "light" | "dark" | null | undefined;
6
14
  } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
@@ -7,7 +7,3 @@ export declare const cvaButton: (props?: ({
7
7
  disabled?: boolean | null | undefined;
8
8
  variant?: "transparent" | "filled" | null | undefined;
9
9
  } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
10
- export declare const cvaButtonSpinner: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
11
- export declare const cvaIconButtonContainer: (props?: ({
12
- size?: "small" | "medium" | "large" | null | undefined;
13
- } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
@@ -30,7 +30,6 @@ export * from "./Tabs/Tabs";
30
30
  export * from "./Tag";
31
31
  export * from "./Text";
32
32
  export * from "./Timeline/Timeline";
33
- export * from "./Tip";
34
33
  export * from "./Tooltip";
35
34
  export * from "./ValueBar";
36
35
  export * from "./Widget";
@@ -1,27 +0,0 @@
1
- import { MakePropertyOptional, MappedOmit } from "@trackunit/shared-utils";
2
- import * as React from "react";
3
- import { CommonProps } from "../../common";
4
- import { IconProps } from "../Icon/Icon";
5
- import { TooltipProps } from "../Tooltip";
6
- export interface TipProps extends CommonProps, Pick<TooltipProps, "placement" | "mode"> {
7
- /**
8
- * Child nodes to render inside the tip.
9
- */
10
- children: React.ReactNode | string;
11
- /**
12
- * The props for setting the icon on this tip.
13
- */
14
- iconProps?: MakePropertyOptional<MappedOmit<IconProps, "size" | "type">, "name">;
15
- /**
16
- * Shows an icon with link as the href attribute inside the tip.
17
- */
18
- link?: string;
19
- }
20
- /**
21
- * The Tip component is used to show helpful tips or contextual information to the users.
22
- * The tip can optionally be rendered as an anchor tag, which redirects to users to an external link on click.
23
-
24
- * @param {TipProps} props - The props for the Tip component
25
- * @returns {JSX.Element} Tip component
26
- */
27
- export declare const Tip: ({ children, iconProps, dataTestId, className, placement, mode, link, }: TipProps) => JSX.Element;
@@ -1,4 +0,0 @@
1
- export declare const cvaTip: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
2
- export declare const cvaTipContent: (props?: ({
3
- color?: "light" | "dark" | null | undefined;
4
- } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
@@ -1 +0,0 @@
1
- export * from "./Tip";