@trackunit/react-components 0.1.267 → 0.1.269
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
|
@@ -1907,6 +1907,61 @@ const useModal = ({ closeOnOutsideClick } = {}) => {
|
|
|
1907
1907
|
};
|
|
1908
1908
|
};
|
|
1909
1909
|
|
|
1910
|
+
const cvaNotice = cssClassVarianceUtilities.cvaMerge(["flex", "items-center"]);
|
|
1911
|
+
const cvaNoticeLabel = cssClassVarianceUtilities.cvaMerge(["pl-1", "pr-1", "font-medium", "text-sm"], {
|
|
1912
|
+
variants: {
|
|
1913
|
+
color: {
|
|
1914
|
+
primary: "text-primary-600",
|
|
1915
|
+
secondary: "text-secondary-600",
|
|
1916
|
+
accent: "text-accent-600",
|
|
1917
|
+
neutral: "text-neutral-600",
|
|
1918
|
+
info: "text-info-600",
|
|
1919
|
+
success: "text-success-600",
|
|
1920
|
+
warning: "text-warning-600",
|
|
1921
|
+
danger: "text-danger-600",
|
|
1922
|
+
black: "text-black",
|
|
1923
|
+
white: "text-white",
|
|
1924
|
+
},
|
|
1925
|
+
},
|
|
1926
|
+
defaultVariants: {
|
|
1927
|
+
color: "neutral",
|
|
1928
|
+
},
|
|
1929
|
+
});
|
|
1930
|
+
const cvaNoticeIcon = cssClassVarianceUtilities.cvaMerge(["rounded-full", "items-center", "justify-center", "flex", "relative"], {
|
|
1931
|
+
variants: {
|
|
1932
|
+
color: {
|
|
1933
|
+
primary: "text-primary-600",
|
|
1934
|
+
secondary: "text-secondary-600",
|
|
1935
|
+
accent: "text-accent-600",
|
|
1936
|
+
neutral: "text-neutral-600",
|
|
1937
|
+
info: "text-info-600",
|
|
1938
|
+
success: "text-success-600",
|
|
1939
|
+
warning: "text-warning-600",
|
|
1940
|
+
danger: "text-danger-600",
|
|
1941
|
+
black: "text-black",
|
|
1942
|
+
white: "text-white",
|
|
1943
|
+
},
|
|
1944
|
+
},
|
|
1945
|
+
defaultVariants: {
|
|
1946
|
+
color: "neutral",
|
|
1947
|
+
},
|
|
1948
|
+
});
|
|
1949
|
+
|
|
1950
|
+
/**
|
|
1951
|
+
* Notices are non-interactive elements that communicate information that the user needs to see, without directly prompting an action button.
|
|
1952
|
+
*
|
|
1953
|
+
* _**Do use** notices to communicate non-essential information that does not necessarily require action to be taken._
|
|
1954
|
+
*
|
|
1955
|
+
* _**Do not use** notices for essential information (use `<Alert/>` instead), or to communicate information related to the state of an asset (use `<Indicator/>` instead)._
|
|
1956
|
+
|
|
1957
|
+
* @param {NoticeProps} props - The props for the Notice component
|
|
1958
|
+
* @returns {JSX.Element} Notice component
|
|
1959
|
+
*/
|
|
1960
|
+
const Notice = (_a) => {
|
|
1961
|
+
var { dataTestId, icon, label, color = "neutral", withLabel = true, className } = _a, rest = __rest(_a, ["dataTestId", "icon", "label", "color", "withLabel", "className"]);
|
|
1962
|
+
return (jsxRuntime.jsx(Tooltip, { className: className, disabled: withLabel, label: label, placement: "bottom", children: jsxRuntime.jsxs("div", Object.assign({ "aria-label": label, className: cvaNotice(), "data-testid": dataTestId }, rest, { children: [jsxRuntime.jsx("div", { className: cvaNoticeIcon({ color }), "data-testid": dataTestId ? `${dataTestId}-icon` : "notice-icon", children: icon }), label !== undefined && withLabel ? (jsxRuntime.jsx("div", { className: cvaNoticeLabel({ color }), "data-testid": dataTestId ? `${dataTestId}-label` : "notice-label", children: label })) : null] })) }));
|
|
1963
|
+
};
|
|
1964
|
+
|
|
1910
1965
|
const cvaPageHeaderContainer = cssClassVarianceUtilities.cvaMerge(["bg-white", "tu-page-header"], {
|
|
1911
1966
|
variants: {
|
|
1912
1967
|
withBorder: {
|
|
@@ -3059,6 +3114,7 @@ exports.MenuList = MenuList;
|
|
|
3059
3114
|
exports.Modal = Modal;
|
|
3060
3115
|
exports.ModalBackdrop = ModalBackdrop;
|
|
3061
3116
|
exports.MoreMenu = MoreMenu;
|
|
3117
|
+
exports.Notice = Notice;
|
|
3062
3118
|
exports.PackageNameStoryComponent = PackageNameStoryComponent;
|
|
3063
3119
|
exports.PageHeader = PageHeader;
|
|
3064
3120
|
exports.Pagination = Pagination;
|
package/index.esm.js
CHANGED
|
@@ -1876,6 +1876,61 @@ const useModal = ({ closeOnOutsideClick } = {}) => {
|
|
|
1876
1876
|
};
|
|
1877
1877
|
};
|
|
1878
1878
|
|
|
1879
|
+
const cvaNotice = cvaMerge(["flex", "items-center"]);
|
|
1880
|
+
const cvaNoticeLabel = cvaMerge(["pl-1", "pr-1", "font-medium", "text-sm"], {
|
|
1881
|
+
variants: {
|
|
1882
|
+
color: {
|
|
1883
|
+
primary: "text-primary-600",
|
|
1884
|
+
secondary: "text-secondary-600",
|
|
1885
|
+
accent: "text-accent-600",
|
|
1886
|
+
neutral: "text-neutral-600",
|
|
1887
|
+
info: "text-info-600",
|
|
1888
|
+
success: "text-success-600",
|
|
1889
|
+
warning: "text-warning-600",
|
|
1890
|
+
danger: "text-danger-600",
|
|
1891
|
+
black: "text-black",
|
|
1892
|
+
white: "text-white",
|
|
1893
|
+
},
|
|
1894
|
+
},
|
|
1895
|
+
defaultVariants: {
|
|
1896
|
+
color: "neutral",
|
|
1897
|
+
},
|
|
1898
|
+
});
|
|
1899
|
+
const cvaNoticeIcon = cvaMerge(["rounded-full", "items-center", "justify-center", "flex", "relative"], {
|
|
1900
|
+
variants: {
|
|
1901
|
+
color: {
|
|
1902
|
+
primary: "text-primary-600",
|
|
1903
|
+
secondary: "text-secondary-600",
|
|
1904
|
+
accent: "text-accent-600",
|
|
1905
|
+
neutral: "text-neutral-600",
|
|
1906
|
+
info: "text-info-600",
|
|
1907
|
+
success: "text-success-600",
|
|
1908
|
+
warning: "text-warning-600",
|
|
1909
|
+
danger: "text-danger-600",
|
|
1910
|
+
black: "text-black",
|
|
1911
|
+
white: "text-white",
|
|
1912
|
+
},
|
|
1913
|
+
},
|
|
1914
|
+
defaultVariants: {
|
|
1915
|
+
color: "neutral",
|
|
1916
|
+
},
|
|
1917
|
+
});
|
|
1918
|
+
|
|
1919
|
+
/**
|
|
1920
|
+
* Notices are non-interactive elements that communicate information that the user needs to see, without directly prompting an action button.
|
|
1921
|
+
*
|
|
1922
|
+
* _**Do use** notices to communicate non-essential information that does not necessarily require action to be taken._
|
|
1923
|
+
*
|
|
1924
|
+
* _**Do not use** notices for essential information (use `<Alert/>` instead), or to communicate information related to the state of an asset (use `<Indicator/>` instead)._
|
|
1925
|
+
|
|
1926
|
+
* @param {NoticeProps} props - The props for the Notice component
|
|
1927
|
+
* @returns {JSX.Element} Notice component
|
|
1928
|
+
*/
|
|
1929
|
+
const Notice = (_a) => {
|
|
1930
|
+
var { dataTestId, icon, label, color = "neutral", withLabel = true, className } = _a, rest = __rest(_a, ["dataTestId", "icon", "label", "color", "withLabel", "className"]);
|
|
1931
|
+
return (jsx(Tooltip, { className: className, disabled: withLabel, label: label, placement: "bottom", children: jsxs("div", Object.assign({ "aria-label": label, className: cvaNotice(), "data-testid": dataTestId }, rest, { children: [jsx("div", { className: cvaNoticeIcon({ color }), "data-testid": dataTestId ? `${dataTestId}-icon` : "notice-icon", children: icon }), label !== undefined && withLabel ? (jsx("div", { className: cvaNoticeLabel({ color }), "data-testid": dataTestId ? `${dataTestId}-label` : "notice-label", children: label })) : null] })) }));
|
|
1932
|
+
};
|
|
1933
|
+
|
|
1879
1934
|
const cvaPageHeaderContainer = cvaMerge(["bg-white", "tu-page-header"], {
|
|
1880
1935
|
variants: {
|
|
1881
1936
|
withBorder: {
|
|
@@ -3005,4 +3060,4 @@ const useVisibilityChange = ({ onChange, targetState = "hidden" }) => {
|
|
|
3005
3060
|
}, [onChange, targetState]);
|
|
3006
3061
|
};
|
|
3007
3062
|
|
|
3008
|
-
export { Alert, Badge, Button, Card, CardBody, CardFooter, CardHeader, Collapse, CopyableText, DayPicker, DayRangePicker, Drawer, EmptyState, ExternalLink, Heading, Icon, IconButton, Indicator, MenuItem, MenuList, Modal, ModalBackdrop, MoreMenu, 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 };
|
|
3063
|
+
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 };
|
package/package.json
CHANGED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { GeneralColors, IntentColors } from "@trackunit/ui-design-tokens";
|
|
3
|
+
import { CommonProps } from "../../common/CommonProps";
|
|
4
|
+
export interface NoticeProps extends CommonProps {
|
|
5
|
+
/**
|
|
6
|
+
* The icon to be rendered inside the indicator component
|
|
7
|
+
*/
|
|
8
|
+
icon: JSX.Element;
|
|
9
|
+
/**
|
|
10
|
+
* A color token used to style the icon and the icon background
|
|
11
|
+
*/
|
|
12
|
+
color?: GeneralColors | IntentColors;
|
|
13
|
+
/**
|
|
14
|
+
* A text label to be displayed next to the icon
|
|
15
|
+
*/
|
|
16
|
+
label?: string;
|
|
17
|
+
/**
|
|
18
|
+
* A boolean parameter to display or hide label and instead show as html title on hover, default value is true
|
|
19
|
+
*/
|
|
20
|
+
withLabel?: boolean;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Notices are non-interactive elements that communicate information that the user needs to see, without directly prompting an action button.
|
|
24
|
+
*
|
|
25
|
+
* _**Do use** notices to communicate non-essential information that does not necessarily require action to be taken._
|
|
26
|
+
*
|
|
27
|
+
* _**Do not use** notices for essential information (use `<Alert/>` instead), or to communicate information related to the state of an asset (use `<Indicator/>` instead)._
|
|
28
|
+
|
|
29
|
+
* @param {NoticeProps} props - The props for the Notice component
|
|
30
|
+
* @returns {JSX.Element} Notice component
|
|
31
|
+
*/
|
|
32
|
+
export declare const Notice: ({ dataTestId, icon, label, color, withLabel, className, ...rest }: NoticeProps) => JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const cvaNotice: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|
|
2
|
+
export declare const cvaNoticeLabel: (props?: ({
|
|
3
|
+
color?: "primary" | "secondary" | "accent" | "neutral" | "info" | "success" | "warning" | "danger" | "black" | "white" | null | undefined;
|
|
4
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
5
|
+
export declare const cvaNoticeIcon: (props?: ({
|
|
6
|
+
color?: "primary" | "secondary" | "accent" | "neutral" | "info" | "success" | "warning" | "danger" | "black" | "white" | null | undefined;
|
|
7
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Notice";
|