@trackunit/react-components 0.1.175 → 0.1.176
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 +165 -152
- package/index.esm.js +165 -153
- package/package.json +1 -1
- package/src/common/PackageNameStoryComponent.d.ts +12 -0
- package/src/components/Alert/Alert.d.ts +1 -1
- package/src/components/Badge/Badge.d.ts +1 -1
- package/src/components/Card/Card.d.ts +1 -1
- package/src/components/Card/CardFooter.d.ts +1 -1
- package/src/components/Card/CardHeader.d.ts +1 -1
- package/src/components/Collapse/Collapse.d.ts +1 -1
- package/src/components/CopyableText/CopyableText.d.ts +1 -1
- package/src/components/DayPicker/DayPicker.d.ts +1 -1
- package/src/components/DayPicker/DayPickerPopover.d.ts +1 -1
- package/src/components/DayPicker/DayRangePicker.d.ts +1 -1
- package/src/components/Drawer/Drawer.d.ts +1 -1
- package/src/components/EmptyState/EmptyState.d.ts +1 -1
- package/src/components/ExternalLink/ExternalLink.d.ts +1 -1
- package/src/components/Heading/Heading.d.ts +1 -1
- package/src/components/Icon/Icon.d.ts +1 -1
- package/src/components/Indicator/Indicator.d.ts +1 -1
- package/src/components/Menu/MenuItem/MenuItem.d.ts +1 -1
- package/src/components/Menu/MenuList/MenuList.d.ts +1 -1
- package/src/components/Modal/Modal.d.ts +1 -0
- package/src/components/Modal/ModalBackdrop.d.ts +1 -1
- package/src/components/Modal/useModal.d.ts +1 -1
- package/src/components/PageHeader/PageHeader.d.ts +1 -1
- package/src/components/Pagination/Pagination.d.ts +1 -1
- package/src/components/Popover/Popover.d.ts +1 -1
- package/src/components/Popover/PopoverTitle.d.ts +1 -1
- package/src/components/Prompt/Prompt.d.ts +1 -1
- package/src/components/SectionHeader/SectionHeader.d.ts +1 -1
- package/src/components/Sidebar/Sidebar.d.ts +1 -1
- package/src/components/SkeletonLines/SkeletonLines.d.ts +1 -0
- package/src/components/Spacer/Spacer.d.ts +1 -1
- package/src/components/Spinner/Spinner.d.ts +1 -1
- package/src/components/Tag/Tag.d.ts +1 -1
- package/src/components/Text/Text.d.ts +1 -1
- package/src/components/Timeline/Timeline.d.ts +1 -1
- package/src/components/Tip/Tip.d.ts +1 -1
- package/src/components/Tooltip/Tooltip.d.ts +1 -1
- package/src/components/ValueBar/ValueBar.d.ts +1 -1
- package/src/components/ValueBar/ValueBarHelper.d.ts +4 -4
- package/src/components/buttons/BackToTopButton/BackToTopButton.d.ts +1 -1
- package/src/components/buttons/Button/Button.d.ts +1 -1
- package/src/components/buttons/IconButton/IconButton.d.ts +3 -0
- package/src/components/buttons/StarButton/StarButton.d.ts +1 -1
- package/src/index.d.ts +1 -0
package/index.cjs.js
CHANGED
|
@@ -65,6 +65,43 @@ const useContainerProps = ({ className, dataTestId }) => {
|
|
|
65
65
|
return containerProps;
|
|
66
66
|
};
|
|
67
67
|
|
|
68
|
+
/******************************************************************************
|
|
69
|
+
Copyright (c) Microsoft Corporation.
|
|
70
|
+
|
|
71
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
72
|
+
purpose with or without fee is hereby granted.
|
|
73
|
+
|
|
74
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
75
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
76
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
77
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
78
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
79
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
80
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
81
|
+
***************************************************************************** */
|
|
82
|
+
|
|
83
|
+
function __rest$1(s, e) {
|
|
84
|
+
var t = {};
|
|
85
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
86
|
+
t[p] = s[p];
|
|
87
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
88
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
89
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
90
|
+
t[p[i]] = s[p[i]];
|
|
91
|
+
}
|
|
92
|
+
return t;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
96
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
97
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
98
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
99
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
100
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
101
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
|
|
68
105
|
const cvaIcon = cssClassVarianceUtilities.cvaMerge(["aspect-square", "inline-grid", "relative"], {
|
|
69
106
|
variants: {
|
|
70
107
|
color: {
|
|
@@ -156,7 +193,7 @@ const iconColorNames = Object.keys(iconPalette).map(key => key.toLowerCase()); /
|
|
|
156
193
|
* - The Icon component is used to display an Icon.
|
|
157
194
|
* - Icons are semantic vector graphics that adds character and improves the visual appeal of elements when combined with.
|
|
158
195
|
* - All the [HeroIcons](https://heroicons.dev/) as well as custom Trackunit icons are available.
|
|
159
|
-
|
|
196
|
+
|
|
160
197
|
* @param {IconProps} props - The props for the Icon component
|
|
161
198
|
* @returns {JSX.Element} Icon component
|
|
162
199
|
*/
|
|
@@ -173,42 +210,88 @@ const Icon = ({ name, size = "large", className, dataTestId, color, onClick, fil
|
|
|
173
210
|
return (jsxRuntime.jsx("span", { className: cvaIcon({ color, size, className }), onClick: onClick, "data-testid": dataTestId, ref: forwardedRef, children: jsxRuntime.jsx("svg", { viewBox: "0 0 24 24", "data-testid": dataTestId ? `${dataTestId}-${iconName}` : iconName, style: fillColor ? Object.assign(Object.assign({}, style), { fill: fillColor }) : Object.assign({}, style), children: jsxRuntime.jsx("use", { href: href[correctIconType] }) }) }));
|
|
174
211
|
};
|
|
175
212
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
213
|
+
const cvaTag = cssClassVarianceUtilities.cvaMerge([
|
|
214
|
+
"inline-flex",
|
|
215
|
+
"justify-center",
|
|
216
|
+
"items-center",
|
|
217
|
+
"rounded-full",
|
|
218
|
+
"py-1",
|
|
219
|
+
"px-2",
|
|
220
|
+
"text-center",
|
|
221
|
+
"whitespace-nowrap",
|
|
222
|
+
"h-min",
|
|
223
|
+
"min-w-[1.5rem]",
|
|
224
|
+
"font-medium",
|
|
225
|
+
"truncate",
|
|
226
|
+
"max-w-full",
|
|
227
|
+
"w-min",
|
|
228
|
+
"text-xs",
|
|
229
|
+
], {
|
|
230
|
+
variants: {
|
|
231
|
+
size: {
|
|
232
|
+
small: "px-2 py-px",
|
|
233
|
+
medium: "",
|
|
234
|
+
},
|
|
235
|
+
layout: {
|
|
236
|
+
withIcon: "gap-2 pr-1",
|
|
237
|
+
default: "",
|
|
238
|
+
},
|
|
239
|
+
color: {
|
|
240
|
+
primary: "bg-primary-100 text-primary-700",
|
|
241
|
+
secondary: "bg-secondary-100 text-secondary-700",
|
|
242
|
+
accent: "bg-accent-100 text-accent-700",
|
|
243
|
+
neutral: "bg-neutral-100 text-neutral-700",
|
|
244
|
+
black: "bg-neutral-100 text-neutral-700",
|
|
245
|
+
white: "bg-white-100 text-white-700",
|
|
246
|
+
info: "bg-info-100 text-info-700",
|
|
247
|
+
success: "bg-success-100 text-success-700",
|
|
248
|
+
warning: "bg-warning-100 text-warning-700",
|
|
249
|
+
danger: "bg-danger-100 text-danger-700",
|
|
250
|
+
good: "bg-good-100 text-good-700",
|
|
251
|
+
low: "bg-low-100 text-low-700",
|
|
252
|
+
critical: "bg-critical-100 text-critical-700",
|
|
253
|
+
working: "bg-working-100 text-working-700",
|
|
254
|
+
stopped: "bg-stopped-100 text-stopped-700",
|
|
255
|
+
idle: "bg-idle-100 text-idle-700",
|
|
256
|
+
unknown: "bg-unknown-100 text-unknown-700",
|
|
257
|
+
moving: "bg-neutral-100 text-neutral-700",
|
|
258
|
+
active: "bg-neutral-100 text-neutral-700",
|
|
259
|
+
},
|
|
260
|
+
},
|
|
261
|
+
defaultVariants: {
|
|
262
|
+
size: "medium",
|
|
263
|
+
layout: "default",
|
|
264
|
+
color: "primary",
|
|
265
|
+
},
|
|
266
|
+
});
|
|
267
|
+
const cvaTagIconContainer = cssClassVarianceUtilities.cvaMerge(["inline-flex", "self-center"]);
|
|
268
|
+
const cvaTagIcon = cssClassVarianceUtilities.cvaMerge(["cursor-pointer", "transition-opacity", "hover:opacity-70"]);
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* The tag component is used to categorize elements in the ui.
|
|
272
|
+
*
|
|
273
|
+
* This could be to tell the state of an asset, or label a page as Beta.
|
|
274
|
+
*
|
|
275
|
+
* The tag is also used in multiselect components to show selected options.
|
|
276
|
+
*
|
|
277
|
+
* **Do:** Use short labels for easy scanning.
|
|
278
|
+
|
|
279
|
+
* @param {TagProps} props - The props for the tag component
|
|
280
|
+
* @returns {JSX.Element} tag component
|
|
281
|
+
*/
|
|
282
|
+
const Tag = React__namespace.forwardRef((_a, ref) => {
|
|
283
|
+
var { className, dataTestId, children, size = "medium", onClose, color = "primary", disabled = false } = _a; __rest$1(_a, ["className", "dataTestId", "children", "size", "onClose", "color", "disabled"]);
|
|
284
|
+
return (jsxRuntime.jsxs("span", { className: cvaTag({ className, size, color, layout: Boolean(onClose) ? "withIcon" : "default" }), "data-testid": dataTestId && `${dataTestId}-tag`, ref: ref, children: [children, Boolean(onClose) && !disabled && (
|
|
285
|
+
// a fix for multiselect deselecting tags working together with fade out animation
|
|
286
|
+
jsxRuntime.jsx("div", { className: cvaTagIconContainer(), onMouseDown: onClose, children: jsxRuntime.jsx(Icon, { name: "XCircle", dataTestId: dataTestId + "Icon", type: "solid", size: size, style: { WebkitTransition: "-webkit-transform 0.150s" }, className: cvaTagIcon() }) }))] }));
|
|
287
|
+
});
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* A component used to display the package name and version in the Storybook docs.
|
|
291
|
+
*/
|
|
292
|
+
const PackageNameStoryComponent = ({ packageJSON }) => {
|
|
293
|
+
return (jsxRuntime.jsxs("div", { className: "flex gap-2", children: [jsxRuntime.jsx(Tag, { color: "secondary", children: packageJSON === null || packageJSON === void 0 ? void 0 : packageJSON.name }), jsxRuntime.jsxs(Tag, { color: "secondary", children: ["v", packageJSON === null || packageJSON === void 0 ? void 0 : packageJSON.version] })] }));
|
|
294
|
+
};
|
|
212
295
|
|
|
213
296
|
const cvaText = cssClassVarianceUtilities.cvaMerge(["text-black", "m-0", "relative", "text-sm", "font-normal"], {
|
|
214
297
|
variants: {
|
|
@@ -269,7 +352,7 @@ const cvaText = cssClassVarianceUtilities.cvaMerge(["text-black", "m-0", "relati
|
|
|
269
352
|
* ### When to use
|
|
270
353
|
*
|
|
271
354
|
* Use Text when you want to show a text section, use Heading if you want to show a heading.
|
|
272
|
-
|
|
355
|
+
|
|
273
356
|
* @param {TextProps} props - The props for the Text component
|
|
274
357
|
* @returns {JSX.Element} Text component
|
|
275
358
|
*/
|
|
@@ -338,7 +421,7 @@ const cvaSpinnerContainer = cssClassVarianceUtilities.cvaMerge(["box-border", "p
|
|
|
338
421
|
* Use a spinner component for any action that cannot be performed instantly and will only require a short time (between 1 to 5 seconds) to process.
|
|
339
422
|
*
|
|
340
423
|
* Use when retrieving or refreshing small data amounts, such as status.
|
|
341
|
-
|
|
424
|
+
|
|
342
425
|
* @param {SpinnerProps} props - The props for the Spinner component
|
|
343
426
|
* @returns {JSX.Element} Spinner component
|
|
344
427
|
*/
|
|
@@ -536,7 +619,7 @@ const cvaIconButtonContainer = cssClassVarianceUtilities.cvaMerge(["w-5", "h-5",
|
|
|
536
619
|
|
|
537
620
|
/**
|
|
538
621
|
* Buttons allow users to perform an action when triggered.
|
|
539
|
-
|
|
622
|
+
|
|
540
623
|
* @param {ButtonProps} props - The props for the Button component
|
|
541
624
|
* @returns {JSX.Element} Button component
|
|
542
625
|
*/
|
|
@@ -550,6 +633,9 @@ const Button$1 = React__namespace.forwardRef((_a, ref) => {
|
|
|
550
633
|
tabIndex, disabled: disabled || loading, className: cvaButton({ rounded: circular, disabled, size, square, color, variant, fullWidth, className }), "aria-label": title, "data-testid": dataTestId, children: (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [loading && jsxRuntime.jsx(Spinner, { className: cvaButtonSpinner(), centering: "vertically" }), prefix, children, suffix] })) }, rest));
|
|
551
634
|
});
|
|
552
635
|
|
|
636
|
+
/**
|
|
637
|
+
* The IconButton is used for a button with an icon.
|
|
638
|
+
*/
|
|
553
639
|
const IconButton = React__namespace.forwardRef((_a, ref) => {
|
|
554
640
|
var { icon, size = "small", square = true, loading, disabled } = _a, rest = __rest$1(_a, ["icon", "size", "square", "loading", "disabled"]);
|
|
555
641
|
return (jsxRuntime.jsx(Button$1, Object.assign({ size: size, square: square, disabled: disabled || loading, ref: ref }, rest, { children: jsxRuntime.jsx("div", { className: cvaIconButtonContainer({ size }), children: loading ? jsxRuntime.jsx(Spinner, { size: size }) : icon }) })));
|
|
@@ -557,7 +643,7 @@ const IconButton = React__namespace.forwardRef((_a, ref) => {
|
|
|
557
643
|
|
|
558
644
|
/**
|
|
559
645
|
* The StarButton component is used for favorite actions or similar.
|
|
560
|
-
|
|
646
|
+
|
|
561
647
|
* @param {StarButtonProps} props - The props for the StarButton component
|
|
562
648
|
* @returns {JSX.Element} StarButton component
|
|
563
649
|
*/
|
|
@@ -632,7 +718,7 @@ const cvaAlertIconContainer = cssClassVarianceUtilities.cvaMerge(["self-start",
|
|
|
632
718
|
|
|
633
719
|
/**
|
|
634
720
|
* The Alert component should be used to inform the user of important information.
|
|
635
|
-
|
|
721
|
+
|
|
636
722
|
* @param {AlertProps} props - The props for the Alert component
|
|
637
723
|
* @returns {JSX.Element} Alert component
|
|
638
724
|
*/
|
|
@@ -704,7 +790,7 @@ const cvaBadge = cssClassVarianceUtilities.cvaMerge([
|
|
|
704
790
|
|
|
705
791
|
/**
|
|
706
792
|
* The Badge component is used to display a notification badge with an optional number value.
|
|
707
|
-
|
|
793
|
+
|
|
708
794
|
* @param {BadgeProps} props - The props for the Badge component
|
|
709
795
|
* @returns {JSX.Element} Badge component
|
|
710
796
|
*/
|
|
@@ -814,7 +900,7 @@ const ROLE_CARD = "region";
|
|
|
814
900
|
/**
|
|
815
901
|
* The Card component is a container for UI elements, and is the main component of the modal.
|
|
816
902
|
* To get the most out of the Card, use it in combination with the CardHeader, CardBody and CardFooter.
|
|
817
|
-
|
|
903
|
+
|
|
818
904
|
* @param {CardProps} props - The props for the Card component
|
|
819
905
|
* @returns {JSX.Element} Card component
|
|
820
906
|
*/
|
|
@@ -839,7 +925,7 @@ const CardBody = ({ density = "auto", children, dataTestId, className, disableGa
|
|
|
839
925
|
* A simple footer intended to use with Cards and Modals.
|
|
840
926
|
* Currently only intended to contain Buttons.
|
|
841
927
|
* The buttons justifies to the right, but if you style a button with "margin-right: auto" it will move to the left
|
|
842
|
-
|
|
928
|
+
|
|
843
929
|
* @param {CardFooterProps} props - The props for the CardFooter component
|
|
844
930
|
* @returns {JSX.Element} CardFooter component
|
|
845
931
|
*/
|
|
@@ -884,7 +970,7 @@ const cvaHeading = cssClassVarianceUtilities.cvaMerge(["m-0", "leading-normal",
|
|
|
884
970
|
|
|
885
971
|
/**
|
|
886
972
|
* The Heading is used for a heading of a section (h1,h2,h3,h4).
|
|
887
|
-
|
|
973
|
+
|
|
888
974
|
* @param {HeadingProps} props - The props for the Heading component
|
|
889
975
|
* @returns {JSX.Element} Heading component
|
|
890
976
|
*/
|
|
@@ -901,7 +987,7 @@ const Heading = (_a) => {
|
|
|
901
987
|
|
|
902
988
|
/**
|
|
903
989
|
* Header for Cards and Modals.
|
|
904
|
-
|
|
990
|
+
|
|
905
991
|
* @param {CardHeaderProps} props - The props for the CardHeader component
|
|
906
992
|
* @returns {JSX.Element} CardHeader component
|
|
907
993
|
*/
|
|
@@ -1237,7 +1323,7 @@ const cvaCollapseIcon = cssClassVarianceUtilities.cvaMerge(["ease-in-out", "dura
|
|
|
1237
1323
|
|
|
1238
1324
|
/**
|
|
1239
1325
|
* The Collapse component is used to condense non-important information.
|
|
1240
|
-
|
|
1326
|
+
|
|
1241
1327
|
* @param {CollapseProps} props - The props for the Collapse component
|
|
1242
1328
|
* @returns {JSX.Element} Collapse component
|
|
1243
1329
|
*/
|
|
@@ -1283,7 +1369,7 @@ const cvaCopyableText = cssClassVarianceUtilities.cvaMerge([
|
|
|
1283
1369
|
|
|
1284
1370
|
/**
|
|
1285
1371
|
* The CopyableText component is used where the user should have easy access to copy information.
|
|
1286
|
-
|
|
1372
|
+
|
|
1287
1373
|
* @param {CopyableTextProps} props - The props for the CopyableText component
|
|
1288
1374
|
* @returns {JSX.Element} CopyableText component
|
|
1289
1375
|
*/
|
|
@@ -14831,7 +14917,7 @@ const useLocale = (language) => {
|
|
|
14831
14917
|
|
|
14832
14918
|
/**
|
|
14833
14919
|
* The DayPicker component is used when the user needs to select a date.
|
|
14834
|
-
|
|
14920
|
+
|
|
14835
14921
|
* @param {DayPickerProps} props - The props for the DayPicker component
|
|
14836
14922
|
* @returns {JSX.Element} DayPicker component
|
|
14837
14923
|
*/
|
|
@@ -18819,7 +18905,7 @@ const usePopoverContext = () => {
|
|
|
18819
18905
|
*
|
|
18820
18906
|
* To render the content of the popover, use the `<PopoverContent />` component.
|
|
18821
18907
|
*
|
|
18822
|
-
|
|
18908
|
+
|
|
18823
18909
|
* @param {PopoverProps} props The props for the popover
|
|
18824
18910
|
* @returns {JSX.Element} A Popover Context Provider containing the children
|
|
18825
18911
|
*/
|
|
@@ -18850,7 +18936,7 @@ const PopoverContent = React__default["default"].forwardRef(function PopoverCont
|
|
|
18850
18936
|
|
|
18851
18937
|
/**
|
|
18852
18938
|
* The PopoverTitle component.
|
|
18853
|
-
|
|
18939
|
+
|
|
18854
18940
|
* @param {PopoverTitleProps} props - The props for the PopoverTitle component
|
|
18855
18941
|
* @returns {JSX.Element} PopoverTitle component
|
|
18856
18942
|
*/
|
|
@@ -18874,7 +18960,7 @@ const PopoverTrigger = React.forwardRef(function PopoverTrigger(_a, propRef) {
|
|
|
18874
18960
|
|
|
18875
18961
|
/**
|
|
18876
18962
|
* The DayPickerPopover component returns a button which when clicked shows the daypicker.
|
|
18877
|
-
|
|
18963
|
+
|
|
18878
18964
|
* @param {DayPickerPopoverProps} props - The props for the DayPickerPopover component
|
|
18879
18965
|
* @returns {JSX.Element} DayPickerPopover component
|
|
18880
18966
|
*/
|
|
@@ -18884,7 +18970,7 @@ const DayPickerPopover = ({ disabledDays, className, dataTestId, selectedDay, on
|
|
|
18884
18970
|
|
|
18885
18971
|
/**
|
|
18886
18972
|
* The DayRangePicker component should be used when the user needs to select a range of dates.
|
|
18887
|
-
|
|
18973
|
+
|
|
18888
18974
|
* @param {DayRangePickerProps} props - The props for the DayRangePicker component
|
|
18889
18975
|
* @returns {JSX.Element} DayRangePicker component
|
|
18890
18976
|
*/
|
|
@@ -18928,7 +19014,7 @@ const cvaDrawerCard = cssClassVarianceUtilities.cvaMerge(["fixed", "z-toast"], {
|
|
|
18928
19014
|
|
|
18929
19015
|
/**
|
|
18930
19016
|
* The drawer provides a slideover which can be used to provide access to different locations in the application.
|
|
18931
|
-
|
|
19017
|
+
|
|
18932
19018
|
* @param {DrawerProps} props - The props for the Drawer component
|
|
18933
19019
|
* @returns {JSX.Element} Drawer component
|
|
18934
19020
|
*/
|
|
@@ -18968,6 +19054,7 @@ const cvaSkeletonLine = cssClassVarianceUtilities.cvaMerge([
|
|
|
18968
19054
|
|
|
18969
19055
|
/**
|
|
18970
19056
|
* Display placeholder lines before the data gets loaded to reduce load-time frustration.
|
|
19057
|
+
|
|
18971
19058
|
*/
|
|
18972
19059
|
const SkeletonLines = React.memo(({ margin = "10px 0", lines = 1, height, width = "100%", className, dataTestId }) => {
|
|
18973
19060
|
const skeletonLines = [];
|
|
@@ -19011,7 +19098,7 @@ var WorkerWithSign = "8df3d27593b5fba4.svg";
|
|
|
19011
19098
|
* Component representing an empty state.
|
|
19012
19099
|
* Use this component when there is no data to display or when an error occurs.
|
|
19013
19100
|
*
|
|
19014
|
-
|
|
19101
|
+
|
|
19015
19102
|
* @param {EmptyStateProps} props props
|
|
19016
19103
|
* @returns {JSX.Element} component
|
|
19017
19104
|
* @example
|
|
@@ -19056,7 +19143,7 @@ const cvaExternalLink = cssClassVarianceUtilities.cvaMerge(["underline", "text-p
|
|
|
19056
19143
|
|
|
19057
19144
|
/**
|
|
19058
19145
|
* The external link component is used to link to an external page outside the Trackunit Manager.
|
|
19059
|
-
|
|
19146
|
+
|
|
19060
19147
|
* @param {ExternalLinkProps} props - The props for the external link component
|
|
19061
19148
|
* @returns {JSX.Element} External Link component
|
|
19062
19149
|
*/
|
|
@@ -19081,7 +19168,7 @@ const cvaTooltipContent = cssClassVarianceUtilities.cvaMerge("max-w-sm rounded p
|
|
|
19081
19168
|
|
|
19082
19169
|
/**
|
|
19083
19170
|
* The Tooltip component is used to show helpful tips or contextual information to the users.
|
|
19084
|
-
|
|
19171
|
+
|
|
19085
19172
|
* @param {TooltipProps} props - The props for the Tooltip component
|
|
19086
19173
|
* @returns {JSX.Element} Tooltip component
|
|
19087
19174
|
*/
|
|
@@ -19189,7 +19276,7 @@ const cvaIndicatorIconBackground = cssClassVarianceUtilities.cvaMerge(["rounded-
|
|
|
19189
19276
|
* _**Do use** indicators to communicate essential aspects of the state of an asset._
|
|
19190
19277
|
*
|
|
19191
19278
|
* _**Do not use** indicators for non-essential information, or to communicate information unrelated to the state of an asset._
|
|
19192
|
-
|
|
19279
|
+
|
|
19193
19280
|
* @param {IndicatorProps} props - The props for the Indicator component
|
|
19194
19281
|
* @returns {JSX.Element} Indicator component
|
|
19195
19282
|
*/
|
|
@@ -19267,7 +19354,7 @@ const cvaMenuItemPrefix = cssClassVarianceUtilities.cvaMerge(["self-center", "fl
|
|
|
19267
19354
|
|
|
19268
19355
|
/**
|
|
19269
19356
|
* The MenuItem component is used to display a menu, primarily meant to be used in a list form.
|
|
19270
|
-
|
|
19357
|
+
|
|
19271
19358
|
* @param {MenuItemProps} props - The props for the MenuItem component
|
|
19272
19359
|
* @returns {JSX.Element} MenuItem component
|
|
19273
19360
|
*/
|
|
@@ -19302,7 +19389,7 @@ const cvaMenuListDivider = cssClassVarianceUtilities.cvaMerge([
|
|
|
19302
19389
|
|
|
19303
19390
|
/**
|
|
19304
19391
|
* The MenuList component is used for menus and selects.
|
|
19305
|
-
|
|
19392
|
+
|
|
19306
19393
|
* @param {MenuListProps} props - The props for the MenuList component
|
|
19307
19394
|
* @returns {JSX.Element} MenuList component
|
|
19308
19395
|
*/
|
|
@@ -19368,7 +19455,7 @@ const cvaModalBackdrop = cssClassVarianceUtilities.cvaMerge([
|
|
|
19368
19455
|
|
|
19369
19456
|
/**
|
|
19370
19457
|
* The Backdrop for the modal.
|
|
19371
|
-
|
|
19458
|
+
|
|
19372
19459
|
* @param {ModalBackdropProps} props - The props for the ModalBackdrop component
|
|
19373
19460
|
* @returns {JSX.Element} ModalBackdrop component
|
|
19374
19461
|
*/
|
|
@@ -19389,6 +19476,7 @@ const ModalBackdrop = ({ children, isVisible, onClick }) => {
|
|
|
19389
19476
|
* - Modals are used to present critical information or request user input needed to complete a user's workflow.
|
|
19390
19477
|
* - Modals interrupt a user's workflow by design.
|
|
19391
19478
|
* - The modal component provides a foundation for creating dialogs, lightboxes, etc.
|
|
19479
|
+
|
|
19392
19480
|
*/
|
|
19393
19481
|
const Modal = React__namespace.forwardRef(({ isOpen, children, dataTestId, className, role = "", onDismissClick = () => {
|
|
19394
19482
|
return;
|
|
@@ -19638,7 +19726,7 @@ var usePortal = /*@__PURE__*/getDefaultExportFromCjs(usePortal$1);
|
|
|
19638
19726
|
|
|
19639
19727
|
/**
|
|
19640
19728
|
* The useModal component should be used to inform the user of important information.
|
|
19641
|
-
|
|
19729
|
+
|
|
19642
19730
|
* @param {UseModalProps} props - The props for the useModal hook
|
|
19643
19731
|
* @returns {*} useModal return
|
|
19644
19732
|
*/
|
|
@@ -19668,82 +19756,6 @@ const useModal = ({ closeOnOutsideClick } = {}) => {
|
|
|
19668
19756
|
};
|
|
19669
19757
|
};
|
|
19670
19758
|
|
|
19671
|
-
const cvaTag = cssClassVarianceUtilities.cvaMerge([
|
|
19672
|
-
"inline-flex",
|
|
19673
|
-
"justify-center",
|
|
19674
|
-
"items-center",
|
|
19675
|
-
"rounded-full",
|
|
19676
|
-
"py-1",
|
|
19677
|
-
"px-2",
|
|
19678
|
-
"text-center",
|
|
19679
|
-
"whitespace-nowrap",
|
|
19680
|
-
"h-min",
|
|
19681
|
-
"min-w-[1.5rem]",
|
|
19682
|
-
"font-medium",
|
|
19683
|
-
"truncate",
|
|
19684
|
-
"max-w-full",
|
|
19685
|
-
"w-min",
|
|
19686
|
-
"text-xs",
|
|
19687
|
-
], {
|
|
19688
|
-
variants: {
|
|
19689
|
-
size: {
|
|
19690
|
-
small: "px-2 py-px",
|
|
19691
|
-
medium: "",
|
|
19692
|
-
},
|
|
19693
|
-
layout: {
|
|
19694
|
-
withIcon: "gap-2 pr-1",
|
|
19695
|
-
default: "",
|
|
19696
|
-
},
|
|
19697
|
-
color: {
|
|
19698
|
-
primary: "bg-primary-100 text-primary-700",
|
|
19699
|
-
secondary: "bg-secondary-100 text-secondary-700",
|
|
19700
|
-
accent: "bg-accent-100 text-accent-700",
|
|
19701
|
-
neutral: "bg-neutral-100 text-neutral-700",
|
|
19702
|
-
black: "bg-neutral-100 text-neutral-700",
|
|
19703
|
-
white: "bg-white-100 text-white-700",
|
|
19704
|
-
info: "bg-info-100 text-info-700",
|
|
19705
|
-
success: "bg-success-100 text-success-700",
|
|
19706
|
-
warning: "bg-warning-100 text-warning-700",
|
|
19707
|
-
danger: "bg-danger-100 text-danger-700",
|
|
19708
|
-
good: "bg-good-100 text-good-700",
|
|
19709
|
-
low: "bg-low-100 text-low-700",
|
|
19710
|
-
critical: "bg-critical-100 text-critical-700",
|
|
19711
|
-
working: "bg-working-100 text-working-700",
|
|
19712
|
-
stopped: "bg-stopped-100 text-stopped-700",
|
|
19713
|
-
idle: "bg-idle-100 text-idle-700",
|
|
19714
|
-
unknown: "bg-unknown-100 text-unknown-700",
|
|
19715
|
-
moving: "bg-neutral-100 text-neutral-700",
|
|
19716
|
-
active: "bg-neutral-100 text-neutral-700",
|
|
19717
|
-
},
|
|
19718
|
-
},
|
|
19719
|
-
defaultVariants: {
|
|
19720
|
-
size: "medium",
|
|
19721
|
-
layout: "default",
|
|
19722
|
-
color: "primary",
|
|
19723
|
-
},
|
|
19724
|
-
});
|
|
19725
|
-
const cvaTagIconContainer = cssClassVarianceUtilities.cvaMerge(["inline-flex", "self-center"]);
|
|
19726
|
-
const cvaTagIcon = cssClassVarianceUtilities.cvaMerge(["cursor-pointer", "transition-opacity", "hover:opacity-70"]);
|
|
19727
|
-
|
|
19728
|
-
/**
|
|
19729
|
-
* The tag component is used to categorize elements in the ui.
|
|
19730
|
-
*
|
|
19731
|
-
* This could be to tell the state of an asset, or label a page as Beta.
|
|
19732
|
-
*
|
|
19733
|
-
* The tag is also used in multiselect components to show selected options.
|
|
19734
|
-
*
|
|
19735
|
-
* **Do:** Use short labels for easy scanning.
|
|
19736
|
-
*
|
|
19737
|
-
* @param {TagProps} props - The props for the tag component
|
|
19738
|
-
* @returns {JSX.Element} tag component
|
|
19739
|
-
*/
|
|
19740
|
-
const Tag = React__namespace.forwardRef((_a, ref) => {
|
|
19741
|
-
var { className, dataTestId, children, size = "medium", onClose, color = "primary", disabled = false } = _a; __rest$1(_a, ["className", "dataTestId", "children", "size", "onClose", "color", "disabled"]);
|
|
19742
|
-
return (jsxRuntime.jsxs("span", { className: cvaTag({ className, size, color, layout: Boolean(onClose) ? "withIcon" : "default" }), "data-testid": dataTestId && `${dataTestId}-tag`, ref: ref, children: [children, Boolean(onClose) && !disabled && (
|
|
19743
|
-
// a fix for multiselect deselecting tags working together with fade out animation
|
|
19744
|
-
jsxRuntime.jsx("div", { className: cvaTagIconContainer(), onMouseDown: onClose, children: jsxRuntime.jsx(Icon, { name: "XCircle", dataTestId: dataTestId + "Icon", type: "solid", size: size, style: { WebkitTransition: "-webkit-transform 0.150s" }, className: cvaTagIcon() }) }))] }));
|
|
19745
|
-
});
|
|
19746
|
-
|
|
19747
19759
|
const cvaTip = cssClassVarianceUtilities.cvaMerge("flex text-slate-300 transition hover:text-slate-500");
|
|
19748
19760
|
const cvaTipContent = cssClassVarianceUtilities.cvaMerge("flex max-w-sm items-center gap-2 rounded p-2 text-sm", {
|
|
19749
19761
|
variants: {
|
|
@@ -19760,7 +19772,7 @@ const cvaTipContent = cssClassVarianceUtilities.cvaMerge("flex max-w-sm items-ce
|
|
|
19760
19772
|
/**
|
|
19761
19773
|
* The Tip component is used to show helpful tips or contextual information to the users.
|
|
19762
19774
|
* The tip can optionally be rendered as an anchor tag, which redirects to users to an external link on click.
|
|
19763
|
-
|
|
19775
|
+
|
|
19764
19776
|
* @param {TipProps} props - The props for the Tip component
|
|
19765
19777
|
* @returns {JSX.Element} Tip component
|
|
19766
19778
|
*/
|
|
@@ -19798,7 +19810,7 @@ const cvaPageHeaderChildContainer = cssClassVarianceUtilities.cvaMerge(["flex",
|
|
|
19798
19810
|
* Pageheader component is used to display a page header.
|
|
19799
19811
|
*
|
|
19800
19812
|
* PageHeader can be used to highlight the page topic, display important information about the page, and carry the action items related to the current page.
|
|
19801
|
-
|
|
19813
|
+
|
|
19802
19814
|
* @param {PageHeaderProps} props - The props for the PageHeader component
|
|
19803
19815
|
* @returns {JSX.Element} PageHeader component
|
|
19804
19816
|
*/
|
|
@@ -19811,7 +19823,7 @@ const cvaPaginationText = cssClassVarianceUtilities.cvaMerge("whitespace-nowrap"
|
|
|
19811
19823
|
|
|
19812
19824
|
/**
|
|
19813
19825
|
* Pagination Description. It could be used when you need navigation for your paging feature.
|
|
19814
|
-
|
|
19826
|
+
|
|
19815
19827
|
* @param {IPaginationProps} props - The props for the Pagination component
|
|
19816
19828
|
* @returns {JSX.Element} Pagination component
|
|
19817
19829
|
*/
|
|
@@ -19877,7 +19889,7 @@ function useConfirmExit(confirmExit, when = true) {
|
|
|
19877
19889
|
}
|
|
19878
19890
|
/**
|
|
19879
19891
|
* The usePrompt hook.
|
|
19880
|
-
|
|
19892
|
+
|
|
19881
19893
|
* @param {string} message -
|
|
19882
19894
|
* @param {boolean} when -
|
|
19883
19895
|
* @returns {void} void
|
|
@@ -21273,7 +21285,7 @@ const cvaSpacer = cssClassVarianceUtilities.cvaMerge([], {
|
|
|
21273
21285
|
|
|
21274
21286
|
/**
|
|
21275
21287
|
* The Spacer component is used for adding a bit of space in the ui.
|
|
21276
|
-
|
|
21288
|
+
|
|
21277
21289
|
* @param {SpacerProps} props - The props for the Spacer component
|
|
21278
21290
|
* @returns {JSX.Element} Spacer component
|
|
21279
21291
|
*/
|
|
@@ -21283,7 +21295,7 @@ const Spacer = ({ size = "medium", border = false, dataTestId, className }) => {
|
|
|
21283
21295
|
|
|
21284
21296
|
/**
|
|
21285
21297
|
* The SectionHeader component is used on sections to set the section title.
|
|
21286
|
-
|
|
21298
|
+
|
|
21287
21299
|
* @param {SectionHeaderProps} props - The props for the section header component
|
|
21288
21300
|
* @returns {JSX.Element} SectionHeader component
|
|
21289
21301
|
*/
|
|
@@ -21366,7 +21378,7 @@ const useOverflowItems = ({ threshold = 1, childUniqueIdentifierAttribute = "id"
|
|
|
21366
21378
|
* - **_The sidebar is just a wrapper. You are responsible for styling the children._**
|
|
21367
21379
|
*
|
|
21368
21380
|
* When using this component make sure to add `setupIntersectionObserver();` to your jest.setup.ts file.
|
|
21369
|
-
|
|
21381
|
+
|
|
21370
21382
|
* @param {SidebarProps} props - The props for the Sidebar component
|
|
21371
21383
|
* @returns {JSX.Element} Sidebar component
|
|
21372
21384
|
*/
|
|
@@ -21422,7 +21434,7 @@ const cvaTimelineDot = cssClassVarianceUtilities.cvaMerge(["flex", "space-x-4",
|
|
|
21422
21434
|
* - with an indicator (dot)
|
|
21423
21435
|
* - a header (next to the dot)
|
|
21424
21436
|
* - and a body.
|
|
21425
|
-
|
|
21437
|
+
|
|
21426
21438
|
* @param {TimelineProps} props - The props for the Timeline component
|
|
21427
21439
|
* @returns {JSX.Element} Timeline component
|
|
21428
21440
|
*/
|
|
@@ -21481,7 +21493,7 @@ const cvaValueBarText = cssClassVarianceUtilities.cvaMerge([], {
|
|
|
21481
21493
|
|
|
21482
21494
|
/**
|
|
21483
21495
|
* Helper function to get normalized score in range 0-1 used by the ValueBar
|
|
21484
|
-
|
|
21496
|
+
|
|
21485
21497
|
* @param {number} value - value for which score should be returned
|
|
21486
21498
|
* @param {number} min - min range value
|
|
21487
21499
|
* @param {number} max - max range value
|
|
@@ -21498,7 +21510,7 @@ const getScore = (value, min, max) => {
|
|
|
21498
21510
|
};
|
|
21499
21511
|
/**
|
|
21500
21512
|
* Helper function to get default color used by the ValueBar
|
|
21501
|
-
|
|
21513
|
+
|
|
21502
21514
|
* @param {number} score - score number for which color should be returned
|
|
21503
21515
|
* @returns {string} color value
|
|
21504
21516
|
*/
|
|
@@ -21513,7 +21525,7 @@ const getDefaultFillColor = (score) => {
|
|
|
21513
21525
|
};
|
|
21514
21526
|
/**
|
|
21515
21527
|
* Helper function to get custom color used by the ValueBar
|
|
21516
|
-
|
|
21528
|
+
|
|
21517
21529
|
* @param {number} score - score number for which color should be returned
|
|
21518
21530
|
* @param {LevelColors} levelColors - custom colors and levels definitions
|
|
21519
21531
|
* @returns {string} color value
|
|
@@ -21530,7 +21542,7 @@ const getFillColor = (score, levelColors) => {
|
|
|
21530
21542
|
};
|
|
21531
21543
|
/**
|
|
21532
21544
|
* Helper function to get color used by the ValueBar
|
|
21533
|
-
|
|
21545
|
+
|
|
21534
21546
|
* @param {number} value - value for which color should be returned
|
|
21535
21547
|
* @param {number} min - min range value
|
|
21536
21548
|
* @param {number} max - max range value
|
|
@@ -21544,7 +21556,7 @@ const getValueBarColorByValue = (value, min, max, levelColors) => {
|
|
|
21544
21556
|
|
|
21545
21557
|
/**
|
|
21546
21558
|
* ValueBar component is used to display value on a colorful bar within provided range.
|
|
21547
|
-
|
|
21559
|
+
|
|
21548
21560
|
* @param {ValueBarProps} props - The props for the ValueBar component
|
|
21549
21561
|
* @returns {JSX.Element} ValueBar component
|
|
21550
21562
|
*/
|
|
@@ -39289,6 +39301,7 @@ exports.MenuList = MenuList;
|
|
|
39289
39301
|
exports.Modal = Modal;
|
|
39290
39302
|
exports.ModalBackdrop = ModalBackdrop;
|
|
39291
39303
|
exports.MoreMenu = MoreMenu;
|
|
39304
|
+
exports.PackageNameStoryComponent = PackageNameStoryComponent;
|
|
39292
39305
|
exports.PageHeader = PageHeader;
|
|
39293
39306
|
exports.Pagination = Pagination;
|
|
39294
39307
|
exports.Popover = Popover;
|