@trackunit/react-components 1.4.34 → 1.4.36
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 +10 -23
- package/index.esm.js +10 -23
- package/package.json +1 -1
- package/src/components/Notice/Notice.d.ts +3 -3
- package/src/components/Notice/Notice.variants.d.ts +3 -3
package/index.cjs.js
CHANGED
|
@@ -1839,10 +1839,10 @@ const cvaCollapseHeader = cssClassVarianceUtilities.cvaMerge([
|
|
|
1839
1839
|
"transition-all",
|
|
1840
1840
|
], {
|
|
1841
1841
|
variants: {
|
|
1842
|
-
expanded: { true: ["border-secondary-200", "border-b", "border-solid"
|
|
1842
|
+
expanded: { true: ["border-secondary-200", "border-b", "border-solid"], false: "" },
|
|
1843
1843
|
},
|
|
1844
1844
|
});
|
|
1845
|
-
const cvaCollapseLabelContainer = cssClassVarianceUtilities.cvaMerge(["flex", "items-center", "
|
|
1845
|
+
const cvaCollapseLabelContainer = cssClassVarianceUtilities.cvaMerge(["flex", "items-center", "w-full", "justify-between"]);
|
|
1846
1846
|
const cvaCollapsible = cssClassVarianceUtilities.cvaMerge(["block", "relative"], {
|
|
1847
1847
|
variants: {
|
|
1848
1848
|
extraPadding: {
|
|
@@ -1865,7 +1865,7 @@ const cvaCollapseAnimated = cssClassVarianceUtilities.cvaMerge(["overflow-y-hidd
|
|
|
1865
1865
|
const cvaChevronIcon = cssClassVarianceUtilities.cvaMerge(["transition-transform"], {
|
|
1866
1866
|
variants: {
|
|
1867
1867
|
expanded: {
|
|
1868
|
-
true: "rotate-
|
|
1868
|
+
true: "rotate-180",
|
|
1869
1869
|
false: "",
|
|
1870
1870
|
},
|
|
1871
1871
|
},
|
|
@@ -1900,7 +1900,7 @@ const Collapse = ({ id, initialExpanded = false, onToggle, label, children, clas
|
|
|
1900
1900
|
}
|
|
1901
1901
|
setExpanded(!expanded);
|
|
1902
1902
|
}, [expanded, onToggle]);
|
|
1903
|
-
return (jsxRuntime.jsxs("div", { className: cvaCollapse({ className }), "data-testid": dataTestId, children: [jsxRuntime.
|
|
1903
|
+
return (jsxRuntime.jsxs("div", { className: cvaCollapse({ className }), "data-testid": dataTestId, children: [jsxRuntime.jsx("div", { "aria-controls": id, "aria-expanded": expanded, className: cvaCollapseHeader({ expanded, className: headerClassName }), onClick: handleClick, role: "button", children: jsxRuntime.jsxs("div", { className: cvaCollapseLabelContainer(), children: [jsxRuntime.jsx(Text, { id: LABEL_ID, type: "span", weight: "bold", children: label }), jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [headerAddon ? headerAddon : null, jsxRuntime.jsx(Icon, { ariaLabelledBy: LABEL_ID, className: cvaChevronIcon({ expanded }), name: "ChevronUp", size: "medium" })] })] }) }), jsxRuntime.jsx(Collapsible, { expanded: expanded, extraPadding: extraPadding, id: id, children: expanded || animate ? children : null })] }));
|
|
1904
1904
|
};
|
|
1905
1905
|
const Collapsible = ({ children, expanded, id, extraPadding }) => {
|
|
1906
1906
|
const ref = react.useRef(null);
|
|
@@ -3044,22 +3044,15 @@ const cvaNotice = cssClassVarianceUtilities.cvaMerge(["flex", "items-center"]);
|
|
|
3044
3044
|
const cvaNoticeLabel = cssClassVarianceUtilities.cvaMerge(["pl-1", "pr-1", "font-medium", "text-sm"], {
|
|
3045
3045
|
variants: {
|
|
3046
3046
|
color: {
|
|
3047
|
-
primary: "text-primary-600",
|
|
3048
|
-
secondary: "text-secondary-600",
|
|
3049
3047
|
neutral: "text-neutral-400",
|
|
3050
|
-
info: "text-info-
|
|
3051
|
-
success: "text-success-
|
|
3052
|
-
warning: "text-warning-
|
|
3053
|
-
danger: "text-danger-
|
|
3054
|
-
black: "text-black",
|
|
3055
|
-
white: "text-white",
|
|
3056
|
-
critical: "text-critical-500",
|
|
3057
|
-
low: "text-low-500",
|
|
3048
|
+
info: "text-info-700",
|
|
3049
|
+
success: "text-success-700",
|
|
3050
|
+
warning: "text-warning-700",
|
|
3051
|
+
danger: "text-danger-700",
|
|
3058
3052
|
},
|
|
3059
3053
|
size: {
|
|
3060
3054
|
small: "text-xs",
|
|
3061
3055
|
medium: "text-sm",
|
|
3062
|
-
large: "text-base",
|
|
3063
3056
|
},
|
|
3064
3057
|
},
|
|
3065
3058
|
defaultVariants: {
|
|
@@ -3070,17 +3063,11 @@ const cvaNoticeLabel = cssClassVarianceUtilities.cvaMerge(["pl-1", "pr-1", "font
|
|
|
3070
3063
|
const cvaNoticeIcon = cssClassVarianceUtilities.cvaMerge(["rounded-full", "items-center", "justify-center", "flex", "relative"], {
|
|
3071
3064
|
variants: {
|
|
3072
3065
|
color: {
|
|
3073
|
-
|
|
3074
|
-
secondary: "text-secondary-600",
|
|
3075
|
-
neutral: "text-neutral-300",
|
|
3066
|
+
neutral: "text-neutral-400",
|
|
3076
3067
|
info: "text-info-600",
|
|
3077
3068
|
success: "text-success-600",
|
|
3078
|
-
warning: "text-warning-
|
|
3069
|
+
warning: "text-warning-500",
|
|
3079
3070
|
danger: "text-danger-600",
|
|
3080
|
-
black: "text-black",
|
|
3081
|
-
white: "text-white",
|
|
3082
|
-
critical: "text-critical-500",
|
|
3083
|
-
low: "text-low-500",
|
|
3084
3071
|
},
|
|
3085
3072
|
},
|
|
3086
3073
|
defaultVariants: {
|
package/index.esm.js
CHANGED
|
@@ -1837,10 +1837,10 @@ const cvaCollapseHeader = cvaMerge([
|
|
|
1837
1837
|
"transition-all",
|
|
1838
1838
|
], {
|
|
1839
1839
|
variants: {
|
|
1840
|
-
expanded: { true: ["border-secondary-200", "border-b", "border-solid"
|
|
1840
|
+
expanded: { true: ["border-secondary-200", "border-b", "border-solid"], false: "" },
|
|
1841
1841
|
},
|
|
1842
1842
|
});
|
|
1843
|
-
const cvaCollapseLabelContainer = cvaMerge(["flex", "items-center", "
|
|
1843
|
+
const cvaCollapseLabelContainer = cvaMerge(["flex", "items-center", "w-full", "justify-between"]);
|
|
1844
1844
|
const cvaCollapsible = cvaMerge(["block", "relative"], {
|
|
1845
1845
|
variants: {
|
|
1846
1846
|
extraPadding: {
|
|
@@ -1863,7 +1863,7 @@ const cvaCollapseAnimated = cvaMerge(["overflow-y-hidden", "transition-all"], {
|
|
|
1863
1863
|
const cvaChevronIcon = cvaMerge(["transition-transform"], {
|
|
1864
1864
|
variants: {
|
|
1865
1865
|
expanded: {
|
|
1866
|
-
true: "rotate-
|
|
1866
|
+
true: "rotate-180",
|
|
1867
1867
|
false: "",
|
|
1868
1868
|
},
|
|
1869
1869
|
},
|
|
@@ -1898,7 +1898,7 @@ const Collapse = ({ id, initialExpanded = false, onToggle, label, children, clas
|
|
|
1898
1898
|
}
|
|
1899
1899
|
setExpanded(!expanded);
|
|
1900
1900
|
}, [expanded, onToggle]);
|
|
1901
|
-
return (jsxs("div", { className: cvaCollapse({ className }), "data-testid": dataTestId, children: [
|
|
1901
|
+
return (jsxs("div", { className: cvaCollapse({ className }), "data-testid": dataTestId, children: [jsx("div", { "aria-controls": id, "aria-expanded": expanded, className: cvaCollapseHeader({ expanded, className: headerClassName }), onClick: handleClick, role: "button", children: jsxs("div", { className: cvaCollapseLabelContainer(), children: [jsx(Text, { id: LABEL_ID, type: "span", weight: "bold", children: label }), jsxs("div", { className: "flex items-center gap-2", children: [headerAddon ? headerAddon : null, jsx(Icon, { ariaLabelledBy: LABEL_ID, className: cvaChevronIcon({ expanded }), name: "ChevronUp", size: "medium" })] })] }) }), jsx(Collapsible, { expanded: expanded, extraPadding: extraPadding, id: id, children: expanded || animate ? children : null })] }));
|
|
1902
1902
|
};
|
|
1903
1903
|
const Collapsible = ({ children, expanded, id, extraPadding }) => {
|
|
1904
1904
|
const ref = useRef(null);
|
|
@@ -3042,22 +3042,15 @@ const cvaNotice = cvaMerge(["flex", "items-center"]);
|
|
|
3042
3042
|
const cvaNoticeLabel = cvaMerge(["pl-1", "pr-1", "font-medium", "text-sm"], {
|
|
3043
3043
|
variants: {
|
|
3044
3044
|
color: {
|
|
3045
|
-
primary: "text-primary-600",
|
|
3046
|
-
secondary: "text-secondary-600",
|
|
3047
3045
|
neutral: "text-neutral-400",
|
|
3048
|
-
info: "text-info-
|
|
3049
|
-
success: "text-success-
|
|
3050
|
-
warning: "text-warning-
|
|
3051
|
-
danger: "text-danger-
|
|
3052
|
-
black: "text-black",
|
|
3053
|
-
white: "text-white",
|
|
3054
|
-
critical: "text-critical-500",
|
|
3055
|
-
low: "text-low-500",
|
|
3046
|
+
info: "text-info-700",
|
|
3047
|
+
success: "text-success-700",
|
|
3048
|
+
warning: "text-warning-700",
|
|
3049
|
+
danger: "text-danger-700",
|
|
3056
3050
|
},
|
|
3057
3051
|
size: {
|
|
3058
3052
|
small: "text-xs",
|
|
3059
3053
|
medium: "text-sm",
|
|
3060
|
-
large: "text-base",
|
|
3061
3054
|
},
|
|
3062
3055
|
},
|
|
3063
3056
|
defaultVariants: {
|
|
@@ -3068,17 +3061,11 @@ const cvaNoticeLabel = cvaMerge(["pl-1", "pr-1", "font-medium", "text-sm"], {
|
|
|
3068
3061
|
const cvaNoticeIcon = cvaMerge(["rounded-full", "items-center", "justify-center", "flex", "relative"], {
|
|
3069
3062
|
variants: {
|
|
3070
3063
|
color: {
|
|
3071
|
-
|
|
3072
|
-
secondary: "text-secondary-600",
|
|
3073
|
-
neutral: "text-neutral-300",
|
|
3064
|
+
neutral: "text-neutral-400",
|
|
3074
3065
|
info: "text-info-600",
|
|
3075
3066
|
success: "text-success-600",
|
|
3076
|
-
warning: "text-warning-
|
|
3067
|
+
warning: "text-warning-500",
|
|
3077
3068
|
danger: "text-danger-600",
|
|
3078
|
-
black: "text-black",
|
|
3079
|
-
white: "text-white",
|
|
3080
|
-
critical: "text-critical-500",
|
|
3081
|
-
low: "text-low-500",
|
|
3082
3069
|
},
|
|
3083
3070
|
},
|
|
3084
3071
|
defaultVariants: {
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { GeneralColors, IntentColors } from "@trackunit/ui-design-tokens";
|
|
2
2
|
import { ReactElement } from "react";
|
|
3
3
|
import { CommonProps } from "../../common/CommonProps";
|
|
4
4
|
export interface NoticeProps extends CommonProps {
|
|
@@ -9,11 +9,11 @@ export interface NoticeProps extends CommonProps {
|
|
|
9
9
|
/**
|
|
10
10
|
* A color token used to style the icon and the icon background
|
|
11
11
|
*/
|
|
12
|
-
color?:
|
|
12
|
+
color?: Extract<GeneralColors, "neutral"> | IntentColors;
|
|
13
13
|
/**
|
|
14
14
|
* The size of the label's text
|
|
15
15
|
*/
|
|
16
|
-
size?: "small" | "medium"
|
|
16
|
+
size?: "small" | "medium";
|
|
17
17
|
/**
|
|
18
18
|
* A text label to be displayed next to the icon
|
|
19
19
|
*/
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export declare const cvaNotice: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|
|
2
2
|
export declare const cvaNoticeLabel: (props?: ({
|
|
3
|
-
color?: "
|
|
4
|
-
size?: "small" | "medium" |
|
|
3
|
+
color?: "neutral" | "info" | "success" | "warning" | "danger" | null | undefined;
|
|
4
|
+
size?: "small" | "medium" | null | undefined;
|
|
5
5
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
6
6
|
export declare const cvaNoticeIcon: (props?: ({
|
|
7
|
-
color?: "
|
|
7
|
+
color?: "neutral" | "info" | "success" | "warning" | "danger" | null | undefined;
|
|
8
8
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|