@trackunit/react-components 0.1.171 → 0.1.173
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 +209 -209
- package/index.esm.js +209 -209
- package/package.json +6 -6
- package/src/components/DayPicker/DayPickerPopover.d.ts +1 -1
- package/src/components/Icon/Icon.d.ts +6 -1
- package/src/components/Menu/MenuList/MenuList.d.ts +1 -1
- package/src/components/ValueBar/index.d.ts +1 -1
- package/src/components/buttons/index.d.ts +1 -1
- package/src/components/index.d.ts +1 -1
- package/src/index.d.ts +1 -1
package/index.cjs.js
CHANGED
|
@@ -4,11 +4,11 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
var React = require('react');
|
|
7
|
-
var cssClassVarianceUtilities = require('@trackunit/css-class-variance-utilities');
|
|
8
7
|
var uiDesignTokens = require('@trackunit/ui-design-tokens');
|
|
9
8
|
var uiIcons = require('@trackunit/ui-icons');
|
|
10
9
|
var IconSpriteOutline = require('@trackunit/ui-icons/icons-sprite-outline.svg');
|
|
11
10
|
var IconSpriteSolid = require('@trackunit/ui-icons/icons-sprite-solid.svg');
|
|
11
|
+
var cssClassVarianceUtilities = require('@trackunit/css-class-variance-utilities');
|
|
12
12
|
var ReactDOM = require('react-dom');
|
|
13
13
|
var reactRouterDom = require('react-router-dom');
|
|
14
14
|
|
|
@@ -65,6 +65,114 @@ const useContainerProps = ({ className, dataTestId }) => {
|
|
|
65
65
|
return containerProps;
|
|
66
66
|
};
|
|
67
67
|
|
|
68
|
+
const cvaIcon = cssClassVarianceUtilities.cvaMerge(["aspect-square", "inline-grid", "relative"], {
|
|
69
|
+
variants: {
|
|
70
|
+
color: {
|
|
71
|
+
primary: "text-primary-600",
|
|
72
|
+
secondary: "text-secondary-600",
|
|
73
|
+
accent: "text-accent-600",
|
|
74
|
+
neutral: "text-neutral-600",
|
|
75
|
+
info: "text-info-600",
|
|
76
|
+
success: "text-success-600",
|
|
77
|
+
warning: "text-warning-600",
|
|
78
|
+
danger: "text-danger-600",
|
|
79
|
+
good: "text-good-600",
|
|
80
|
+
low: "text-low-600",
|
|
81
|
+
critical: "text-critical-600",
|
|
82
|
+
working: "text-working-600",
|
|
83
|
+
idle: "text-idle-600",
|
|
84
|
+
moving: "text-moving",
|
|
85
|
+
active: "text-active",
|
|
86
|
+
stopped: "text-stopped-600",
|
|
87
|
+
unknown: "text-unknown-600",
|
|
88
|
+
default: "text-current",
|
|
89
|
+
black: "text-black",
|
|
90
|
+
white: "text-white",
|
|
91
|
+
unused: {
|
|
92
|
+
300: "text-red-300",
|
|
93
|
+
400: "text-red-400",
|
|
94
|
+
},
|
|
95
|
+
utilized: { 400: "text-blue-400", 600: "text-blue-600" },
|
|
96
|
+
heavily_utilized: { 300: "text-amber-300", 500: "text-amber-500" },
|
|
97
|
+
unknown_utilization: { 300: "text-neutral-300", 600: "text-neutral-600" },
|
|
98
|
+
site: {
|
|
99
|
+
area: "text-blue-600",
|
|
100
|
+
classic_poi: "text-neutral-500",
|
|
101
|
+
classic_zone: "text-neutral-500",
|
|
102
|
+
depot: "text-emerald-500",
|
|
103
|
+
work_place: "text-violet-600",
|
|
104
|
+
construction_site: "text-amber-500",
|
|
105
|
+
unknown: "text-neutral-500",
|
|
106
|
+
},
|
|
107
|
+
on_rent: { 100: uiDesignTokens.rentalStatusPalette.ON_RENT[100], 600: uiDesignTokens.rentalStatusPalette.ON_RENT[600] },
|
|
108
|
+
returned: { 100: uiDesignTokens.rentalStatusPalette.RETURNED[100], 600: uiDesignTokens.rentalStatusPalette.RETURNED[600] },
|
|
109
|
+
available: { 100: uiDesignTokens.rentalStatusPalette.AVAILABLE[100], 600: uiDesignTokens.rentalStatusPalette.AVAILABLE[600] },
|
|
110
|
+
pickup_ready: { 100: uiDesignTokens.rentalStatusPalette.PICKUP_READY[100], 600: uiDesignTokens.rentalStatusPalette.PICKUP_READY[600] },
|
|
111
|
+
transfer: { 100: uiDesignTokens.rentalStatusPalette.TRANSFER[100], 600: uiDesignTokens.rentalStatusPalette.TRANSFER[600] },
|
|
112
|
+
in_repair: { 100: uiDesignTokens.rentalStatusPalette.IN_REPAIR[100], 600: uiDesignTokens.rentalStatusPalette.IN_REPAIR[600] },
|
|
113
|
+
other_rental_status: {
|
|
114
|
+
100: uiDesignTokens.rentalStatusPalette.OTHER_RENTAL_STATUS[100],
|
|
115
|
+
600: uiDesignTokens.rentalStatusPalette.OTHER_RENTAL_STATUS[100],
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
size: {
|
|
119
|
+
small: "w-4",
|
|
120
|
+
medium: "w-5",
|
|
121
|
+
large: "w-6",
|
|
122
|
+
font: "w-[1em]",
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
defaultVariants: {
|
|
126
|
+
color: "default",
|
|
127
|
+
size: "large",
|
|
128
|
+
},
|
|
129
|
+
});
|
|
130
|
+
cssClassVarianceUtilities.cvaMerge([], {
|
|
131
|
+
variants: {
|
|
132
|
+
iconType: {
|
|
133
|
+
solid: "fill-current stroke-transparent",
|
|
134
|
+
outline: "fill-transparent stroke-current",
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
});
|
|
138
|
+
cssClassVarianceUtilities.cvaMerge([
|
|
139
|
+
"relative",
|
|
140
|
+
"aspect-square",
|
|
141
|
+
"after:content-['']",
|
|
142
|
+
"after:absolute",
|
|
143
|
+
"after:h-2",
|
|
144
|
+
"after:w-2",
|
|
145
|
+
"after:bg-current",
|
|
146
|
+
"after:rounded-full",
|
|
147
|
+
"after:inset-1/2",
|
|
148
|
+
"after:-translate-x-1/2",
|
|
149
|
+
"after:-translate-y-1/2",
|
|
150
|
+
"after:opacity-50",
|
|
151
|
+
]);
|
|
152
|
+
|
|
153
|
+
const iconPalette = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, uiDesignTokens.intentPalette), uiDesignTokens.generalPalette), uiDesignTokens.criticalityPalette), uiDesignTokens.activityPalette), uiDesignTokens.utilizationPalette), uiDesignTokens.sitesPalette), uiDesignTokens.rentalStatusPalette);
|
|
154
|
+
const iconColorNames = Object.keys(iconPalette).map(key => key.toLowerCase()); // This users the object in the Object.keys() to infer the type of the keys.
|
|
155
|
+
/**
|
|
156
|
+
* - The Icon component is used to display an Icon.
|
|
157
|
+
* - Icons are semantic vector graphics that adds character and improves the visual appeal of elements when combined with.
|
|
158
|
+
* - All the [HeroIcons](https://heroicons.dev/) as well as custom Trackunit icons are available.
|
|
159
|
+
*
|
|
160
|
+
* @param {IconProps} props - The props for the Icon component
|
|
161
|
+
* @returns {JSX.Element} Icon component
|
|
162
|
+
*/
|
|
163
|
+
const Icon = ({ name, size = "large", className, dataTestId, color, onClick, fillColor, type, style, forwardedRef, }) => {
|
|
164
|
+
const correctIconType = React__namespace.useMemo(() => (type ? type : size === "large" ? "outline" : "solid"), [type, size]);
|
|
165
|
+
const iconName = uiIcons.iconNames[name];
|
|
166
|
+
if (!iconName) {
|
|
167
|
+
return null;
|
|
168
|
+
}
|
|
169
|
+
const href = {
|
|
170
|
+
solid: `${IconSpriteSolid__default["default"]}#${iconName}`,
|
|
171
|
+
outline: `${IconSpriteOutline__default["default"]}#${iconName}`,
|
|
172
|
+
};
|
|
173
|
+
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
|
+
};
|
|
175
|
+
|
|
68
176
|
/******************************************************************************
|
|
69
177
|
Copyright (c) Microsoft Corporation.
|
|
70
178
|
|
|
@@ -102,6 +210,85 @@ function __awaiter(thisArg, _arguments, P, generator) {
|
|
|
102
210
|
});
|
|
103
211
|
}
|
|
104
212
|
|
|
213
|
+
const cvaText = cssClassVarianceUtilities.cvaMerge(["text-black", "m-0", "relative", "text-sm", "font-normal"], {
|
|
214
|
+
variants: {
|
|
215
|
+
align: {
|
|
216
|
+
left: "text-left",
|
|
217
|
+
right: "text-right",
|
|
218
|
+
center: "text-center",
|
|
219
|
+
},
|
|
220
|
+
italic: {
|
|
221
|
+
true: "italic",
|
|
222
|
+
false: "",
|
|
223
|
+
},
|
|
224
|
+
uppercase: {
|
|
225
|
+
true: "uppercase",
|
|
226
|
+
false: "",
|
|
227
|
+
},
|
|
228
|
+
underline: {
|
|
229
|
+
true: [
|
|
230
|
+
"underline",
|
|
231
|
+
"after:bg-inherit",
|
|
232
|
+
"after:content-none",
|
|
233
|
+
"after:absolute",
|
|
234
|
+
"after:w-full",
|
|
235
|
+
"after:h-0.5",
|
|
236
|
+
"after:bottom-0",
|
|
237
|
+
"after:left-0",
|
|
238
|
+
],
|
|
239
|
+
false: "",
|
|
240
|
+
},
|
|
241
|
+
weight: {
|
|
242
|
+
normal: "font-normal",
|
|
243
|
+
bold: "font-medium",
|
|
244
|
+
thick: "font-semibold",
|
|
245
|
+
},
|
|
246
|
+
size: {
|
|
247
|
+
small: "text-xs",
|
|
248
|
+
medium: "text-sm",
|
|
249
|
+
large: "text-base",
|
|
250
|
+
},
|
|
251
|
+
inverted: {
|
|
252
|
+
true: "text-white",
|
|
253
|
+
false: "",
|
|
254
|
+
},
|
|
255
|
+
subtle: {
|
|
256
|
+
true: "opacity-70",
|
|
257
|
+
false: "",
|
|
258
|
+
},
|
|
259
|
+
disabled: {
|
|
260
|
+
true: "opacity-50",
|
|
261
|
+
false: "",
|
|
262
|
+
},
|
|
263
|
+
},
|
|
264
|
+
});
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* The Text component is used to apply Trackunit default typography styles to text.
|
|
268
|
+
*
|
|
269
|
+
* ### When to use
|
|
270
|
+
*
|
|
271
|
+
* Use Text when you want to show a text section, use Heading if you want to show a heading.
|
|
272
|
+
*
|
|
273
|
+
* @param {TextProps} props - The props for the Text component
|
|
274
|
+
* @returns {JSX.Element} Text component
|
|
275
|
+
*/
|
|
276
|
+
const Text = (_a) => {
|
|
277
|
+
var { children, type = "p", size = "medium", align = "left", weight = "normal", underline = false, inverted = false, subtle = false, italicize = false, uppercase = false, disabled = false, className, dataTestId } = _a, rest = __rest$1(_a, ["children", "type", "size", "align", "weight", "underline", "inverted", "subtle", "italicize", "uppercase", "disabled", "className", "dataTestId"]);
|
|
278
|
+
return React__namespace.createElement(type, Object.assign({ className: cvaText({
|
|
279
|
+
inverted,
|
|
280
|
+
uppercase,
|
|
281
|
+
align,
|
|
282
|
+
italic: italicize,
|
|
283
|
+
size,
|
|
284
|
+
underline,
|
|
285
|
+
weight,
|
|
286
|
+
subtle,
|
|
287
|
+
disabled,
|
|
288
|
+
className,
|
|
289
|
+
}), "data-testid": dataTestId, children }, rest));
|
|
290
|
+
};
|
|
291
|
+
|
|
105
292
|
const cvaSpinner = cssClassVarianceUtilities.cvaMerge([
|
|
106
293
|
"bg-transparent",
|
|
107
294
|
"rounded-full",
|
|
@@ -269,7 +456,7 @@ const cvaButton = cssClassVarianceUtilities.cvaMerge([
|
|
|
269
456
|
false: [],
|
|
270
457
|
},
|
|
271
458
|
variant: {
|
|
272
|
-
transparent: "bg-transparent disabled:hover:bg-transparent
|
|
459
|
+
transparent: "border-none bg-transparent disabled:hover:bg-transparent",
|
|
273
460
|
filled: "",
|
|
274
461
|
},
|
|
275
462
|
},
|
|
@@ -368,114 +555,6 @@ const IconButton = React__namespace.forwardRef((_a, ref) => {
|
|
|
368
555
|
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 }) })));
|
|
369
556
|
});
|
|
370
557
|
|
|
371
|
-
const cvaIcon = cssClassVarianceUtilities.cvaMerge(["aspect-square", "inline-grid", "relative"], {
|
|
372
|
-
variants: {
|
|
373
|
-
color: {
|
|
374
|
-
primary: "text-primary-600",
|
|
375
|
-
secondary: "text-secondary-600",
|
|
376
|
-
accent: "text-accent-600",
|
|
377
|
-
neutral: "text-neutral-600",
|
|
378
|
-
info: "text-info-600",
|
|
379
|
-
success: "text-success-600",
|
|
380
|
-
warning: "text-warning-600",
|
|
381
|
-
danger: "text-danger-600",
|
|
382
|
-
good: "text-good-600",
|
|
383
|
-
low: "text-low-600",
|
|
384
|
-
critical: "text-critical-600",
|
|
385
|
-
working: "text-working-600",
|
|
386
|
-
idle: "text-idle-600",
|
|
387
|
-
moving: "text-moving",
|
|
388
|
-
active: "text-active",
|
|
389
|
-
stopped: "text-stopped-600",
|
|
390
|
-
unknown: "text-unknown-600",
|
|
391
|
-
default: "text-current",
|
|
392
|
-
black: "text-black",
|
|
393
|
-
white: "text-white",
|
|
394
|
-
unused: {
|
|
395
|
-
300: "text-red-300",
|
|
396
|
-
400: "text-red-400",
|
|
397
|
-
},
|
|
398
|
-
utilized: { 400: "text-blue-400", 600: "text-blue-600" },
|
|
399
|
-
heavily_utilized: { 300: "text-amber-300", 500: "text-amber-500" },
|
|
400
|
-
unknown_utilization: { 300: "text-neutral-300", 600: "text-neutral-600" },
|
|
401
|
-
site: {
|
|
402
|
-
area: "text-blue-600",
|
|
403
|
-
classic_poi: "text-neutral-500",
|
|
404
|
-
classic_zone: "text-neutral-500",
|
|
405
|
-
depot: "text-emerald-500",
|
|
406
|
-
work_place: "text-violet-600",
|
|
407
|
-
construction_site: "text-amber-500",
|
|
408
|
-
unknown: "text-neutral-500",
|
|
409
|
-
},
|
|
410
|
-
on_rent: { 100: uiDesignTokens.rentalStatusPalette.ON_RENT[100], 600: uiDesignTokens.rentalStatusPalette.ON_RENT[600] },
|
|
411
|
-
returned: { 100: uiDesignTokens.rentalStatusPalette.RETURNED[100], 600: uiDesignTokens.rentalStatusPalette.RETURNED[600] },
|
|
412
|
-
available: { 100: uiDesignTokens.rentalStatusPalette.AVAILABLE[100], 600: uiDesignTokens.rentalStatusPalette.AVAILABLE[600] },
|
|
413
|
-
pickup_ready: { 100: uiDesignTokens.rentalStatusPalette.PICKUP_READY[100], 600: uiDesignTokens.rentalStatusPalette.PICKUP_READY[600] },
|
|
414
|
-
transfer: { 100: uiDesignTokens.rentalStatusPalette.TRANSFER[100], 600: uiDesignTokens.rentalStatusPalette.TRANSFER[600] },
|
|
415
|
-
in_repair: { 100: uiDesignTokens.rentalStatusPalette.IN_REPAIR[100], 600: uiDesignTokens.rentalStatusPalette.IN_REPAIR[600] },
|
|
416
|
-
other_rental_status: {
|
|
417
|
-
100: uiDesignTokens.rentalStatusPalette.OTHER_RENTAL_STATUS[100],
|
|
418
|
-
600: uiDesignTokens.rentalStatusPalette.OTHER_RENTAL_STATUS[100],
|
|
419
|
-
},
|
|
420
|
-
},
|
|
421
|
-
size: {
|
|
422
|
-
small: "w-4",
|
|
423
|
-
medium: "w-5",
|
|
424
|
-
large: "w-6",
|
|
425
|
-
font: "w-[1em]",
|
|
426
|
-
},
|
|
427
|
-
},
|
|
428
|
-
defaultVariants: {
|
|
429
|
-
color: "default",
|
|
430
|
-
size: "large",
|
|
431
|
-
},
|
|
432
|
-
});
|
|
433
|
-
cssClassVarianceUtilities.cvaMerge([], {
|
|
434
|
-
variants: {
|
|
435
|
-
iconType: {
|
|
436
|
-
solid: "fill-current stroke-transparent",
|
|
437
|
-
outline: "fill-transparent stroke-current",
|
|
438
|
-
},
|
|
439
|
-
},
|
|
440
|
-
});
|
|
441
|
-
cssClassVarianceUtilities.cvaMerge([
|
|
442
|
-
"relative",
|
|
443
|
-
"aspect-square",
|
|
444
|
-
"after:content-['']",
|
|
445
|
-
"after:absolute",
|
|
446
|
-
"after:h-2",
|
|
447
|
-
"after:w-2",
|
|
448
|
-
"after:bg-current",
|
|
449
|
-
"after:rounded-full",
|
|
450
|
-
"after:inset-1/2",
|
|
451
|
-
"after:-translate-x-1/2",
|
|
452
|
-
"after:-translate-y-1/2",
|
|
453
|
-
"after:opacity-50",
|
|
454
|
-
]);
|
|
455
|
-
|
|
456
|
-
const iconPalette = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, uiDesignTokens.intentPalette), uiDesignTokens.generalPalette), uiDesignTokens.criticalityPalette), uiDesignTokens.activityPalette), uiDesignTokens.utilizationPalette), uiDesignTokens.sitesPalette), uiDesignTokens.rentalStatusPalette);
|
|
457
|
-
const iconColorNames = Object.keys(iconPalette).map(key => key.toLowerCase()); // This users the object in the Object.keys() to infer the type of the keys.
|
|
458
|
-
/**
|
|
459
|
-
* - The Icon component is used to display an Icon.
|
|
460
|
-
* - Icons are semantic vector graphics that adds character and improves the visual appeal of elements when combined with.
|
|
461
|
-
* - All the [HeroIcons](https://heroicons.dev/) as well as custom Trackunit icons are available.
|
|
462
|
-
*
|
|
463
|
-
* @param {IconProps} props - The props for the Icon component
|
|
464
|
-
* @returns {JSX.Element} Icon component
|
|
465
|
-
*/
|
|
466
|
-
const Icon = ({ name, size = "large", className, dataTestId, color, onClick, fillColor, type, style, forwardedRef, }) => {
|
|
467
|
-
const correctIconType = React__namespace.useMemo(() => (type ? type : size === "large" ? "outline" : "solid"), [type, size]);
|
|
468
|
-
const iconName = uiIcons.iconNames[name];
|
|
469
|
-
if (!iconName) {
|
|
470
|
-
return null;
|
|
471
|
-
}
|
|
472
|
-
const href = {
|
|
473
|
-
solid: `${IconSpriteSolid__default["default"]}#${iconName}`,
|
|
474
|
-
outline: `${IconSpriteOutline__default["default"]}#${iconName}`,
|
|
475
|
-
};
|
|
476
|
-
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] }) }) }));
|
|
477
|
-
};
|
|
478
|
-
|
|
479
558
|
/**
|
|
480
559
|
* The StarButton component is used for favorite actions or similar.
|
|
481
560
|
*
|
|
@@ -486,85 +565,6 @@ const StarButton = ({ starred, onClick }) => {
|
|
|
486
565
|
return (jsxRuntime.jsx("div", { onClick: onClick, "data-test-id": "starred-filter", children: jsxRuntime.jsx(Icon, { name: "Star", color: starred ? "primary" : "neutral", type: starred ? "solid" : "outline", size: "medium" }) }));
|
|
487
566
|
};
|
|
488
567
|
|
|
489
|
-
const cvaText = cssClassVarianceUtilities.cvaMerge(["text-black", "m-0", "relative", "text-sm", "font-normal"], {
|
|
490
|
-
variants: {
|
|
491
|
-
align: {
|
|
492
|
-
left: "text-left",
|
|
493
|
-
right: "text-right",
|
|
494
|
-
center: "text-center",
|
|
495
|
-
},
|
|
496
|
-
italic: {
|
|
497
|
-
true: "italic",
|
|
498
|
-
false: "",
|
|
499
|
-
},
|
|
500
|
-
uppercase: {
|
|
501
|
-
true: "uppercase",
|
|
502
|
-
false: "",
|
|
503
|
-
},
|
|
504
|
-
underline: {
|
|
505
|
-
true: [
|
|
506
|
-
"underline",
|
|
507
|
-
"after:bg-inherit",
|
|
508
|
-
"after:content-none",
|
|
509
|
-
"after:absolute",
|
|
510
|
-
"after:w-full",
|
|
511
|
-
"after:h-0.5",
|
|
512
|
-
"after:bottom-0",
|
|
513
|
-
"after:left-0",
|
|
514
|
-
],
|
|
515
|
-
false: "",
|
|
516
|
-
},
|
|
517
|
-
weight: {
|
|
518
|
-
normal: "font-normal",
|
|
519
|
-
bold: "font-medium",
|
|
520
|
-
thick: "font-semibold",
|
|
521
|
-
},
|
|
522
|
-
size: {
|
|
523
|
-
small: "text-xs",
|
|
524
|
-
medium: "text-sm",
|
|
525
|
-
large: "text-base",
|
|
526
|
-
},
|
|
527
|
-
inverted: {
|
|
528
|
-
true: "text-white",
|
|
529
|
-
false: "",
|
|
530
|
-
},
|
|
531
|
-
subtle: {
|
|
532
|
-
true: "opacity-70",
|
|
533
|
-
false: "",
|
|
534
|
-
},
|
|
535
|
-
disabled: {
|
|
536
|
-
true: "opacity-50",
|
|
537
|
-
false: "",
|
|
538
|
-
},
|
|
539
|
-
},
|
|
540
|
-
});
|
|
541
|
-
|
|
542
|
-
/**
|
|
543
|
-
* The Text component is used to apply Trackunit default typography styles to text.
|
|
544
|
-
*
|
|
545
|
-
* ### When to use
|
|
546
|
-
*
|
|
547
|
-
* Use Text when you want to show a text section, use Heading if you want to show a heading.
|
|
548
|
-
*
|
|
549
|
-
* @param {TextProps} props - The props for the Text component
|
|
550
|
-
* @returns {JSX.Element} Text component
|
|
551
|
-
*/
|
|
552
|
-
const Text = (_a) => {
|
|
553
|
-
var { children, type = "p", size = "medium", align = "left", weight = "normal", underline = false, inverted = false, subtle = false, italicize = false, uppercase = false, disabled = false, className, dataTestId } = _a, rest = __rest$1(_a, ["children", "type", "size", "align", "weight", "underline", "inverted", "subtle", "italicize", "uppercase", "disabled", "className", "dataTestId"]);
|
|
554
|
-
return React__namespace.createElement(type, Object.assign({ className: cvaText({
|
|
555
|
-
inverted,
|
|
556
|
-
uppercase,
|
|
557
|
-
align,
|
|
558
|
-
italic: italicize,
|
|
559
|
-
size,
|
|
560
|
-
underline,
|
|
561
|
-
weight,
|
|
562
|
-
subtle,
|
|
563
|
-
disabled,
|
|
564
|
-
className,
|
|
565
|
-
}), "data-testid": dataTestId, children }, rest));
|
|
566
|
-
};
|
|
567
|
-
|
|
568
568
|
const cvaAlert = cssClassVarianceUtilities.cvaMerge(["flex", "relative", "p-4", "rounded"], {
|
|
569
569
|
variants: {
|
|
570
570
|
color: {
|
|
@@ -600,7 +600,7 @@ const cvaAlertContent = cssClassVarianceUtilities.cvaMerge(["grow"], {
|
|
|
600
600
|
variants: {
|
|
601
601
|
layout: {
|
|
602
602
|
default: "",
|
|
603
|
-
inline: "flex items-center
|
|
603
|
+
inline: "flex w-full items-center",
|
|
604
604
|
},
|
|
605
605
|
},
|
|
606
606
|
defaultVariants: {
|
|
@@ -18915,10 +18915,10 @@ const cvaDrawerOverlay = cssClassVarianceUtilities.cvaMerge([
|
|
|
18915
18915
|
const cvaDrawerCard = cssClassVarianceUtilities.cvaMerge(["fixed", "z-toast"], {
|
|
18916
18916
|
variants: {
|
|
18917
18917
|
position: {
|
|
18918
|
-
left: "top-0 left-0
|
|
18919
|
-
right: "top-0 right-0
|
|
18920
|
-
bottom: "right-0 left-0 bottom-0
|
|
18921
|
-
top: "top-0 left-0
|
|
18918
|
+
left: "animate-slide-in-left top-0 left-0 h-full rounded-l-none",
|
|
18919
|
+
right: "animate-slide-in-right top-0 right-0 h-full rounded-r-none",
|
|
18920
|
+
bottom: "animate-slide-in-bottom right-0 left-0 bottom-0 w-full rounded-b-none",
|
|
18921
|
+
top: "animate-slide-in-top top-0 left-0 w-full rounded-t-none",
|
|
18922
18922
|
},
|
|
18923
18923
|
},
|
|
18924
18924
|
defaultVariants: {
|
|
@@ -19067,11 +19067,11 @@ const ExternalLink = ({ rel = "noreferrer", target = "_blank", href, className,
|
|
|
19067
19067
|
const cvaTooltipFlexContainer = cssClassVarianceUtilities.cvaMerge("inline-flex");
|
|
19068
19068
|
const cvaTooltipPopover = cssClassVarianceUtilities.cvaMerge("pointer-events-none origin-center");
|
|
19069
19069
|
cssClassVarianceUtilities.cvaMerge("pointer-events-none origin-center");
|
|
19070
|
-
const cvaTooltipContent = cssClassVarianceUtilities.cvaMerge("
|
|
19070
|
+
const cvaTooltipContent = cssClassVarianceUtilities.cvaMerge("max-w-sm rounded p-2", {
|
|
19071
19071
|
variants: {
|
|
19072
19072
|
color: {
|
|
19073
|
-
light: "shadow-md
|
|
19074
|
-
dark: "
|
|
19073
|
+
light: "bg-white shadow-md",
|
|
19074
|
+
dark: "bg-neutral-800 text-white",
|
|
19075
19075
|
},
|
|
19076
19076
|
},
|
|
19077
19077
|
defaultVariants: {
|
|
@@ -19152,8 +19152,8 @@ const cvaIndicatorIconBackground = cssClassVarianceUtilities.cvaMerge(["rounded-
|
|
|
19152
19152
|
working: "bg-working-100 text-working-600",
|
|
19153
19153
|
idle: "bg-idle-100 text-idle-600",
|
|
19154
19154
|
stopped: "bg-stopped-100 text-stopped-600",
|
|
19155
|
-
moving: "bg-neutral-100
|
|
19156
|
-
active: "bg-neutral-100
|
|
19155
|
+
moving: "text-moving bg-neutral-100",
|
|
19156
|
+
active: "text-active bg-neutral-100",
|
|
19157
19157
|
unknown: "bg-unknown-100 text-unknown-600",
|
|
19158
19158
|
unused: "bg-unused-300 text-unused-400",
|
|
19159
19159
|
utilized: "bg-utilized-400 text-utilized-600",
|
|
@@ -19219,7 +19219,7 @@ const cvaMenuItem = cssClassVarianceUtilities.cvaMerge([
|
|
|
19219
19219
|
false: "",
|
|
19220
19220
|
},
|
|
19221
19221
|
disabled: {
|
|
19222
|
-
true: "!bg-slate-100
|
|
19222
|
+
true: "pointer-events-none !bg-slate-100",
|
|
19223
19223
|
false: "",
|
|
19224
19224
|
},
|
|
19225
19225
|
focused: {
|
|
@@ -19288,7 +19288,7 @@ const MenuItem = ({ className, dataTestId, label, size, children, selected, focu
|
|
|
19288
19288
|
const cvaMenuList = cssClassVarianceUtilities.cvaMerge(["shadow-md", "rounded-lg", "z-20", "bg-white", "p-1", "border", "border-slate-300", "gap-1", "grid"], {
|
|
19289
19289
|
variants: {
|
|
19290
19290
|
stickyHeader: {
|
|
19291
|
-
true: "grid
|
|
19291
|
+
true: "grid-rows-min-fr grid overflow-y-hidden !p-0",
|
|
19292
19292
|
false: "",
|
|
19293
19293
|
},
|
|
19294
19294
|
},
|
|
@@ -19691,7 +19691,7 @@ const cvaTag = cssClassVarianceUtilities.cvaMerge([
|
|
|
19691
19691
|
medium: "",
|
|
19692
19692
|
},
|
|
19693
19693
|
layout: {
|
|
19694
|
-
withIcon: "pr-1
|
|
19694
|
+
withIcon: "gap-2 pr-1",
|
|
19695
19695
|
default: "",
|
|
19696
19696
|
},
|
|
19697
19697
|
color: {
|
|
@@ -19744,12 +19744,12 @@ const Tag = React__namespace.forwardRef((_a, ref) => {
|
|
|
19744
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
19745
|
});
|
|
19746
19746
|
|
|
19747
|
-
const cvaTip = cssClassVarianceUtilities.cvaMerge("flex
|
|
19748
|
-
const cvaTipContent = cssClassVarianceUtilities.cvaMerge("
|
|
19747
|
+
const cvaTip = cssClassVarianceUtilities.cvaMerge("flex text-slate-300 transition hover:text-slate-500");
|
|
19748
|
+
const cvaTipContent = cssClassVarianceUtilities.cvaMerge("flex max-w-sm items-center gap-2 rounded p-2 text-sm", {
|
|
19749
19749
|
variants: {
|
|
19750
19750
|
color: {
|
|
19751
|
-
light: "shadow-md
|
|
19752
|
-
dark: "
|
|
19751
|
+
light: "bg-white shadow-md",
|
|
19752
|
+
dark: "bg-neutral-800 text-white",
|
|
19753
19753
|
},
|
|
19754
19754
|
},
|
|
19755
19755
|
defaultVariants: {
|
|
@@ -19803,7 +19803,7 @@ const cvaPageHeaderChildContainer = cssClassVarianceUtilities.cvaMerge(["flex",
|
|
|
19803
19803
|
* @returns {JSX.Element} PageHeader component
|
|
19804
19804
|
*/
|
|
19805
19805
|
const PageHeader = ({ className, dataTestId, action, showLoading, description, link, title, tag, backTo, tagColor, children, }) => {
|
|
19806
|
-
return (jsxRuntime.jsxs("div", { className: cvaPageHeader({ className: `${className} tu-page-header` }), "data-testid": dataTestId, children: [jsxRuntime.jsxs("div", { className: cvaPageHeaderHeadingAccessoriesContainer(), "data-testid": dataTestId && `${dataTestId}-heading-container`, children: [jsxRuntime.jsxs("div", { className: cvaPageHeaderHeadingContainer(), children: [backTo && (jsxRuntime.jsx(IconButton, { to: backTo, color: "tertiary", variant: "transparent", size: "small", icon: jsxRuntime.jsx(Icon, { name: "ArrowLeft" }) })), jsxRuntime.jsx("h1", { className: cvaPageHeaderHeading(), "data-testid": dataTestId && `${dataTestId}-heading`, children: title }), description && !showLoading && (jsxRuntime.jsx(Tip, { dataTestId: dataTestId && `${dataTestId}-tip`, iconProps: { name: "QuestionMarkCircle" }, link: link, children: description }))] }), tag && !showLoading && jsxRuntime.jsx(Tag, { dataTestId: dataTestId, color: tagColor, children: tag }), showLoading && jsxRuntime.jsx(Spinner, { dataTestId: dataTestId && `${dataTestId}-spinner`, centering: "vertically" }), action] }), jsxRuntime.jsx("div", { className: cvaPageHeaderChildContainer(), children: children })] }));
|
|
19806
|
+
return (jsxRuntime.jsxs("div", { className: cvaPageHeader({ className: `${className} tu-page-header` }), "data-testid": dataTestId, children: [jsxRuntime.jsxs("div", { className: cvaPageHeaderHeadingAccessoriesContainer(), "data-testid": dataTestId && `${dataTestId}-heading-container`, children: [jsxRuntime.jsxs("div", { className: cvaPageHeaderHeadingContainer(), children: [backTo && (jsxRuntime.jsx(IconButton, { to: backTo, color: "tertiary", variant: "transparent", size: "small", icon: jsxRuntime.jsx(Icon, { name: "ArrowLeft" }) })), jsxRuntime.jsx("h1", { className: cvaPageHeaderHeading(), "data-testid": dataTestId && `${dataTestId}-heading`, children: title }), description && !showLoading && (jsxRuntime.jsx(Tip, { dataTestId: dataTestId && `${dataTestId}-tip`, iconProps: { name: "QuestionMarkCircle" }, link: link, children: description }))] }), tag && !showLoading && (jsxRuntime.jsx(Tag, { dataTestId: dataTestId, color: tagColor, children: tag })), showLoading && jsxRuntime.jsx(Spinner, { dataTestId: dataTestId && `${dataTestId}-spinner`, centering: "vertically" }), action] }), jsxRuntime.jsx("div", { className: cvaPageHeaderChildContainer(), children: children })] }));
|
|
19807
19807
|
};
|
|
19808
19808
|
|
|
19809
19809
|
const cvaPagination = cssClassVarianceUtilities.cvaMerge(["flex", "items-center", "gap-1"]);
|
|
@@ -21288,7 +21288,7 @@ const Spacer = ({ size = "medium", border = false, dataTestId, className }) => {
|
|
|
21288
21288
|
* @returns {JSX.Element} SectionHeader component
|
|
21289
21289
|
*/
|
|
21290
21290
|
const SectionHeader = ({ title, subtitle, dataTestId, addons }) => {
|
|
21291
|
-
return (jsxRuntime.jsxs("div", { className: "flex flex-col", children: [jsxRuntime.jsx(q, { children: jsxRuntime.jsx(W, { title: title }) }), jsxRuntime.jsxs("div", { className: "
|
|
21291
|
+
return (jsxRuntime.jsxs("div", { className: "flex flex-col", children: [jsxRuntime.jsx(q, { children: jsxRuntime.jsx(W, { title: title }) }), jsxRuntime.jsxs("div", { className: "mb-2 flex flex-row gap-2", children: [jsxRuntime.jsxs("div", { className: "flex grow flex-col gap-2", children: [jsxRuntime.jsx(Heading, { variant: "secondary", dataTestId: dataTestId, children: title }), subtitle && (jsxRuntime.jsx(Heading, { variant: "subtitle", subtle: true, children: subtitle }))] }), addons && jsxRuntime.jsx("div", { className: "flex gap-2", children: addons })] }), jsxRuntime.jsx(Spacer, { size: "small" })] }));
|
|
21292
21292
|
};
|
|
21293
21293
|
|
|
21294
21294
|
const cvaSidebar = cssClassVarianceUtilities.cvaMerge(["apply grid", "grid-cols-fr-min", "items-center"]);
|
|
@@ -21470,7 +21470,7 @@ const cvaValueBarProgress = cssClassVarianceUtilities.cvaMerge(["h-full", "round
|
|
|
21470
21470
|
const cvaValueBarText = cssClassVarianceUtilities.cvaMerge([], {
|
|
21471
21471
|
variants: {
|
|
21472
21472
|
size: {
|
|
21473
|
-
small: "font-bold
|
|
21473
|
+
small: "text-sm font-bold",
|
|
21474
21474
|
large: "drop-shadow-lg",
|
|
21475
21475
|
},
|
|
21476
21476
|
},
|
package/index.esm.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import React__default, { useRef, useCallback, useEffect, useState, useLayoutEffect, useMemo, createContext, forwardRef, useContext, isValidElement, cloneElement, memo, Children, Component, useReducer } from 'react';
|
|
4
|
-
import { cvaMerge } from '@trackunit/css-class-variance-utilities';
|
|
5
4
|
import { rentalStatusPalette, intentPalette, generalPalette, criticalityPalette, activityPalette, utilizationPalette, sitesPalette, color } from '@trackunit/ui-design-tokens';
|
|
6
5
|
import { iconNames } from '@trackunit/ui-icons';
|
|
7
6
|
import IconSpriteOutline from '@trackunit/ui-icons/icons-sprite-outline.svg';
|
|
8
7
|
import IconSpriteSolid from '@trackunit/ui-icons/icons-sprite-solid.svg';
|
|
8
|
+
import { cvaMerge } from '@trackunit/css-class-variance-utilities';
|
|
9
9
|
import * as ReactDOM from 'react-dom';
|
|
10
10
|
import ReactDOM__default, { createPortal } from 'react-dom';
|
|
11
11
|
import { UNSAFE_NavigationContext } from 'react-router-dom';
|
|
@@ -36,6 +36,114 @@ const useContainerProps = ({ className, dataTestId }) => {
|
|
|
36
36
|
return containerProps;
|
|
37
37
|
};
|
|
38
38
|
|
|
39
|
+
const cvaIcon = cvaMerge(["aspect-square", "inline-grid", "relative"], {
|
|
40
|
+
variants: {
|
|
41
|
+
color: {
|
|
42
|
+
primary: "text-primary-600",
|
|
43
|
+
secondary: "text-secondary-600",
|
|
44
|
+
accent: "text-accent-600",
|
|
45
|
+
neutral: "text-neutral-600",
|
|
46
|
+
info: "text-info-600",
|
|
47
|
+
success: "text-success-600",
|
|
48
|
+
warning: "text-warning-600",
|
|
49
|
+
danger: "text-danger-600",
|
|
50
|
+
good: "text-good-600",
|
|
51
|
+
low: "text-low-600",
|
|
52
|
+
critical: "text-critical-600",
|
|
53
|
+
working: "text-working-600",
|
|
54
|
+
idle: "text-idle-600",
|
|
55
|
+
moving: "text-moving",
|
|
56
|
+
active: "text-active",
|
|
57
|
+
stopped: "text-stopped-600",
|
|
58
|
+
unknown: "text-unknown-600",
|
|
59
|
+
default: "text-current",
|
|
60
|
+
black: "text-black",
|
|
61
|
+
white: "text-white",
|
|
62
|
+
unused: {
|
|
63
|
+
300: "text-red-300",
|
|
64
|
+
400: "text-red-400",
|
|
65
|
+
},
|
|
66
|
+
utilized: { 400: "text-blue-400", 600: "text-blue-600" },
|
|
67
|
+
heavily_utilized: { 300: "text-amber-300", 500: "text-amber-500" },
|
|
68
|
+
unknown_utilization: { 300: "text-neutral-300", 600: "text-neutral-600" },
|
|
69
|
+
site: {
|
|
70
|
+
area: "text-blue-600",
|
|
71
|
+
classic_poi: "text-neutral-500",
|
|
72
|
+
classic_zone: "text-neutral-500",
|
|
73
|
+
depot: "text-emerald-500",
|
|
74
|
+
work_place: "text-violet-600",
|
|
75
|
+
construction_site: "text-amber-500",
|
|
76
|
+
unknown: "text-neutral-500",
|
|
77
|
+
},
|
|
78
|
+
on_rent: { 100: rentalStatusPalette.ON_RENT[100], 600: rentalStatusPalette.ON_RENT[600] },
|
|
79
|
+
returned: { 100: rentalStatusPalette.RETURNED[100], 600: rentalStatusPalette.RETURNED[600] },
|
|
80
|
+
available: { 100: rentalStatusPalette.AVAILABLE[100], 600: rentalStatusPalette.AVAILABLE[600] },
|
|
81
|
+
pickup_ready: { 100: rentalStatusPalette.PICKUP_READY[100], 600: rentalStatusPalette.PICKUP_READY[600] },
|
|
82
|
+
transfer: { 100: rentalStatusPalette.TRANSFER[100], 600: rentalStatusPalette.TRANSFER[600] },
|
|
83
|
+
in_repair: { 100: rentalStatusPalette.IN_REPAIR[100], 600: rentalStatusPalette.IN_REPAIR[600] },
|
|
84
|
+
other_rental_status: {
|
|
85
|
+
100: rentalStatusPalette.OTHER_RENTAL_STATUS[100],
|
|
86
|
+
600: rentalStatusPalette.OTHER_RENTAL_STATUS[100],
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
size: {
|
|
90
|
+
small: "w-4",
|
|
91
|
+
medium: "w-5",
|
|
92
|
+
large: "w-6",
|
|
93
|
+
font: "w-[1em]",
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
defaultVariants: {
|
|
97
|
+
color: "default",
|
|
98
|
+
size: "large",
|
|
99
|
+
},
|
|
100
|
+
});
|
|
101
|
+
cvaMerge([], {
|
|
102
|
+
variants: {
|
|
103
|
+
iconType: {
|
|
104
|
+
solid: "fill-current stroke-transparent",
|
|
105
|
+
outline: "fill-transparent stroke-current",
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
});
|
|
109
|
+
cvaMerge([
|
|
110
|
+
"relative",
|
|
111
|
+
"aspect-square",
|
|
112
|
+
"after:content-['']",
|
|
113
|
+
"after:absolute",
|
|
114
|
+
"after:h-2",
|
|
115
|
+
"after:w-2",
|
|
116
|
+
"after:bg-current",
|
|
117
|
+
"after:rounded-full",
|
|
118
|
+
"after:inset-1/2",
|
|
119
|
+
"after:-translate-x-1/2",
|
|
120
|
+
"after:-translate-y-1/2",
|
|
121
|
+
"after:opacity-50",
|
|
122
|
+
]);
|
|
123
|
+
|
|
124
|
+
const iconPalette = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, intentPalette), generalPalette), criticalityPalette), activityPalette), utilizationPalette), sitesPalette), rentalStatusPalette);
|
|
125
|
+
const iconColorNames = Object.keys(iconPalette).map(key => key.toLowerCase()); // This users the object in the Object.keys() to infer the type of the keys.
|
|
126
|
+
/**
|
|
127
|
+
* - The Icon component is used to display an Icon.
|
|
128
|
+
* - Icons are semantic vector graphics that adds character and improves the visual appeal of elements when combined with.
|
|
129
|
+
* - All the [HeroIcons](https://heroicons.dev/) as well as custom Trackunit icons are available.
|
|
130
|
+
*
|
|
131
|
+
* @param {IconProps} props - The props for the Icon component
|
|
132
|
+
* @returns {JSX.Element} Icon component
|
|
133
|
+
*/
|
|
134
|
+
const Icon = ({ name, size = "large", className, dataTestId, color, onClick, fillColor, type, style, forwardedRef, }) => {
|
|
135
|
+
const correctIconType = React.useMemo(() => (type ? type : size === "large" ? "outline" : "solid"), [type, size]);
|
|
136
|
+
const iconName = iconNames[name];
|
|
137
|
+
if (!iconName) {
|
|
138
|
+
return null;
|
|
139
|
+
}
|
|
140
|
+
const href = {
|
|
141
|
+
solid: `${IconSpriteSolid}#${iconName}`,
|
|
142
|
+
outline: `${IconSpriteOutline}#${iconName}`,
|
|
143
|
+
};
|
|
144
|
+
return (jsx("span", { className: cvaIcon({ color, size, className }), onClick: onClick, "data-testid": dataTestId, ref: forwardedRef, children: 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: jsx("use", { href: href[correctIconType] }) }) }));
|
|
145
|
+
};
|
|
146
|
+
|
|
39
147
|
/******************************************************************************
|
|
40
148
|
Copyright (c) Microsoft Corporation.
|
|
41
149
|
|
|
@@ -73,6 +181,85 @@ function __awaiter(thisArg, _arguments, P, generator) {
|
|
|
73
181
|
});
|
|
74
182
|
}
|
|
75
183
|
|
|
184
|
+
const cvaText = cvaMerge(["text-black", "m-0", "relative", "text-sm", "font-normal"], {
|
|
185
|
+
variants: {
|
|
186
|
+
align: {
|
|
187
|
+
left: "text-left",
|
|
188
|
+
right: "text-right",
|
|
189
|
+
center: "text-center",
|
|
190
|
+
},
|
|
191
|
+
italic: {
|
|
192
|
+
true: "italic",
|
|
193
|
+
false: "",
|
|
194
|
+
},
|
|
195
|
+
uppercase: {
|
|
196
|
+
true: "uppercase",
|
|
197
|
+
false: "",
|
|
198
|
+
},
|
|
199
|
+
underline: {
|
|
200
|
+
true: [
|
|
201
|
+
"underline",
|
|
202
|
+
"after:bg-inherit",
|
|
203
|
+
"after:content-none",
|
|
204
|
+
"after:absolute",
|
|
205
|
+
"after:w-full",
|
|
206
|
+
"after:h-0.5",
|
|
207
|
+
"after:bottom-0",
|
|
208
|
+
"after:left-0",
|
|
209
|
+
],
|
|
210
|
+
false: "",
|
|
211
|
+
},
|
|
212
|
+
weight: {
|
|
213
|
+
normal: "font-normal",
|
|
214
|
+
bold: "font-medium",
|
|
215
|
+
thick: "font-semibold",
|
|
216
|
+
},
|
|
217
|
+
size: {
|
|
218
|
+
small: "text-xs",
|
|
219
|
+
medium: "text-sm",
|
|
220
|
+
large: "text-base",
|
|
221
|
+
},
|
|
222
|
+
inverted: {
|
|
223
|
+
true: "text-white",
|
|
224
|
+
false: "",
|
|
225
|
+
},
|
|
226
|
+
subtle: {
|
|
227
|
+
true: "opacity-70",
|
|
228
|
+
false: "",
|
|
229
|
+
},
|
|
230
|
+
disabled: {
|
|
231
|
+
true: "opacity-50",
|
|
232
|
+
false: "",
|
|
233
|
+
},
|
|
234
|
+
},
|
|
235
|
+
});
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* The Text component is used to apply Trackunit default typography styles to text.
|
|
239
|
+
*
|
|
240
|
+
* ### When to use
|
|
241
|
+
*
|
|
242
|
+
* Use Text when you want to show a text section, use Heading if you want to show a heading.
|
|
243
|
+
*
|
|
244
|
+
* @param {TextProps} props - The props for the Text component
|
|
245
|
+
* @returns {JSX.Element} Text component
|
|
246
|
+
*/
|
|
247
|
+
const Text = (_a) => {
|
|
248
|
+
var { children, type = "p", size = "medium", align = "left", weight = "normal", underline = false, inverted = false, subtle = false, italicize = false, uppercase = false, disabled = false, className, dataTestId } = _a, rest = __rest$1(_a, ["children", "type", "size", "align", "weight", "underline", "inverted", "subtle", "italicize", "uppercase", "disabled", "className", "dataTestId"]);
|
|
249
|
+
return React.createElement(type, Object.assign({ className: cvaText({
|
|
250
|
+
inverted,
|
|
251
|
+
uppercase,
|
|
252
|
+
align,
|
|
253
|
+
italic: italicize,
|
|
254
|
+
size,
|
|
255
|
+
underline,
|
|
256
|
+
weight,
|
|
257
|
+
subtle,
|
|
258
|
+
disabled,
|
|
259
|
+
className,
|
|
260
|
+
}), "data-testid": dataTestId, children }, rest));
|
|
261
|
+
};
|
|
262
|
+
|
|
76
263
|
const cvaSpinner = cvaMerge([
|
|
77
264
|
"bg-transparent",
|
|
78
265
|
"rounded-full",
|
|
@@ -240,7 +427,7 @@ const cvaButton = cvaMerge([
|
|
|
240
427
|
false: [],
|
|
241
428
|
},
|
|
242
429
|
variant: {
|
|
243
|
-
transparent: "bg-transparent disabled:hover:bg-transparent
|
|
430
|
+
transparent: "border-none bg-transparent disabled:hover:bg-transparent",
|
|
244
431
|
filled: "",
|
|
245
432
|
},
|
|
246
433
|
},
|
|
@@ -339,114 +526,6 @@ const IconButton = React.forwardRef((_a, ref) => {
|
|
|
339
526
|
return (jsx(Button$1, Object.assign({ size: size, square: square, disabled: disabled || loading, ref: ref }, rest, { children: jsx("div", { className: cvaIconButtonContainer({ size }), children: loading ? jsx(Spinner, { size: size }) : icon }) })));
|
|
340
527
|
});
|
|
341
528
|
|
|
342
|
-
const cvaIcon = cvaMerge(["aspect-square", "inline-grid", "relative"], {
|
|
343
|
-
variants: {
|
|
344
|
-
color: {
|
|
345
|
-
primary: "text-primary-600",
|
|
346
|
-
secondary: "text-secondary-600",
|
|
347
|
-
accent: "text-accent-600",
|
|
348
|
-
neutral: "text-neutral-600",
|
|
349
|
-
info: "text-info-600",
|
|
350
|
-
success: "text-success-600",
|
|
351
|
-
warning: "text-warning-600",
|
|
352
|
-
danger: "text-danger-600",
|
|
353
|
-
good: "text-good-600",
|
|
354
|
-
low: "text-low-600",
|
|
355
|
-
critical: "text-critical-600",
|
|
356
|
-
working: "text-working-600",
|
|
357
|
-
idle: "text-idle-600",
|
|
358
|
-
moving: "text-moving",
|
|
359
|
-
active: "text-active",
|
|
360
|
-
stopped: "text-stopped-600",
|
|
361
|
-
unknown: "text-unknown-600",
|
|
362
|
-
default: "text-current",
|
|
363
|
-
black: "text-black",
|
|
364
|
-
white: "text-white",
|
|
365
|
-
unused: {
|
|
366
|
-
300: "text-red-300",
|
|
367
|
-
400: "text-red-400",
|
|
368
|
-
},
|
|
369
|
-
utilized: { 400: "text-blue-400", 600: "text-blue-600" },
|
|
370
|
-
heavily_utilized: { 300: "text-amber-300", 500: "text-amber-500" },
|
|
371
|
-
unknown_utilization: { 300: "text-neutral-300", 600: "text-neutral-600" },
|
|
372
|
-
site: {
|
|
373
|
-
area: "text-blue-600",
|
|
374
|
-
classic_poi: "text-neutral-500",
|
|
375
|
-
classic_zone: "text-neutral-500",
|
|
376
|
-
depot: "text-emerald-500",
|
|
377
|
-
work_place: "text-violet-600",
|
|
378
|
-
construction_site: "text-amber-500",
|
|
379
|
-
unknown: "text-neutral-500",
|
|
380
|
-
},
|
|
381
|
-
on_rent: { 100: rentalStatusPalette.ON_RENT[100], 600: rentalStatusPalette.ON_RENT[600] },
|
|
382
|
-
returned: { 100: rentalStatusPalette.RETURNED[100], 600: rentalStatusPalette.RETURNED[600] },
|
|
383
|
-
available: { 100: rentalStatusPalette.AVAILABLE[100], 600: rentalStatusPalette.AVAILABLE[600] },
|
|
384
|
-
pickup_ready: { 100: rentalStatusPalette.PICKUP_READY[100], 600: rentalStatusPalette.PICKUP_READY[600] },
|
|
385
|
-
transfer: { 100: rentalStatusPalette.TRANSFER[100], 600: rentalStatusPalette.TRANSFER[600] },
|
|
386
|
-
in_repair: { 100: rentalStatusPalette.IN_REPAIR[100], 600: rentalStatusPalette.IN_REPAIR[600] },
|
|
387
|
-
other_rental_status: {
|
|
388
|
-
100: rentalStatusPalette.OTHER_RENTAL_STATUS[100],
|
|
389
|
-
600: rentalStatusPalette.OTHER_RENTAL_STATUS[100],
|
|
390
|
-
},
|
|
391
|
-
},
|
|
392
|
-
size: {
|
|
393
|
-
small: "w-4",
|
|
394
|
-
medium: "w-5",
|
|
395
|
-
large: "w-6",
|
|
396
|
-
font: "w-[1em]",
|
|
397
|
-
},
|
|
398
|
-
},
|
|
399
|
-
defaultVariants: {
|
|
400
|
-
color: "default",
|
|
401
|
-
size: "large",
|
|
402
|
-
},
|
|
403
|
-
});
|
|
404
|
-
cvaMerge([], {
|
|
405
|
-
variants: {
|
|
406
|
-
iconType: {
|
|
407
|
-
solid: "fill-current stroke-transparent",
|
|
408
|
-
outline: "fill-transparent stroke-current",
|
|
409
|
-
},
|
|
410
|
-
},
|
|
411
|
-
});
|
|
412
|
-
cvaMerge([
|
|
413
|
-
"relative",
|
|
414
|
-
"aspect-square",
|
|
415
|
-
"after:content-['']",
|
|
416
|
-
"after:absolute",
|
|
417
|
-
"after:h-2",
|
|
418
|
-
"after:w-2",
|
|
419
|
-
"after:bg-current",
|
|
420
|
-
"after:rounded-full",
|
|
421
|
-
"after:inset-1/2",
|
|
422
|
-
"after:-translate-x-1/2",
|
|
423
|
-
"after:-translate-y-1/2",
|
|
424
|
-
"after:opacity-50",
|
|
425
|
-
]);
|
|
426
|
-
|
|
427
|
-
const iconPalette = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, intentPalette), generalPalette), criticalityPalette), activityPalette), utilizationPalette), sitesPalette), rentalStatusPalette);
|
|
428
|
-
const iconColorNames = Object.keys(iconPalette).map(key => key.toLowerCase()); // This users the object in the Object.keys() to infer the type of the keys.
|
|
429
|
-
/**
|
|
430
|
-
* - The Icon component is used to display an Icon.
|
|
431
|
-
* - Icons are semantic vector graphics that adds character and improves the visual appeal of elements when combined with.
|
|
432
|
-
* - All the [HeroIcons](https://heroicons.dev/) as well as custom Trackunit icons are available.
|
|
433
|
-
*
|
|
434
|
-
* @param {IconProps} props - The props for the Icon component
|
|
435
|
-
* @returns {JSX.Element} Icon component
|
|
436
|
-
*/
|
|
437
|
-
const Icon = ({ name, size = "large", className, dataTestId, color, onClick, fillColor, type, style, forwardedRef, }) => {
|
|
438
|
-
const correctIconType = React.useMemo(() => (type ? type : size === "large" ? "outline" : "solid"), [type, size]);
|
|
439
|
-
const iconName = iconNames[name];
|
|
440
|
-
if (!iconName) {
|
|
441
|
-
return null;
|
|
442
|
-
}
|
|
443
|
-
const href = {
|
|
444
|
-
solid: `${IconSpriteSolid}#${iconName}`,
|
|
445
|
-
outline: `${IconSpriteOutline}#${iconName}`,
|
|
446
|
-
};
|
|
447
|
-
return (jsx("span", { className: cvaIcon({ color, size, className }), onClick: onClick, "data-testid": dataTestId, ref: forwardedRef, children: 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: jsx("use", { href: href[correctIconType] }) }) }));
|
|
448
|
-
};
|
|
449
|
-
|
|
450
529
|
/**
|
|
451
530
|
* The StarButton component is used for favorite actions or similar.
|
|
452
531
|
*
|
|
@@ -457,85 +536,6 @@ const StarButton = ({ starred, onClick }) => {
|
|
|
457
536
|
return (jsx("div", { onClick: onClick, "data-test-id": "starred-filter", children: jsx(Icon, { name: "Star", color: starred ? "primary" : "neutral", type: starred ? "solid" : "outline", size: "medium" }) }));
|
|
458
537
|
};
|
|
459
538
|
|
|
460
|
-
const cvaText = cvaMerge(["text-black", "m-0", "relative", "text-sm", "font-normal"], {
|
|
461
|
-
variants: {
|
|
462
|
-
align: {
|
|
463
|
-
left: "text-left",
|
|
464
|
-
right: "text-right",
|
|
465
|
-
center: "text-center",
|
|
466
|
-
},
|
|
467
|
-
italic: {
|
|
468
|
-
true: "italic",
|
|
469
|
-
false: "",
|
|
470
|
-
},
|
|
471
|
-
uppercase: {
|
|
472
|
-
true: "uppercase",
|
|
473
|
-
false: "",
|
|
474
|
-
},
|
|
475
|
-
underline: {
|
|
476
|
-
true: [
|
|
477
|
-
"underline",
|
|
478
|
-
"after:bg-inherit",
|
|
479
|
-
"after:content-none",
|
|
480
|
-
"after:absolute",
|
|
481
|
-
"after:w-full",
|
|
482
|
-
"after:h-0.5",
|
|
483
|
-
"after:bottom-0",
|
|
484
|
-
"after:left-0",
|
|
485
|
-
],
|
|
486
|
-
false: "",
|
|
487
|
-
},
|
|
488
|
-
weight: {
|
|
489
|
-
normal: "font-normal",
|
|
490
|
-
bold: "font-medium",
|
|
491
|
-
thick: "font-semibold",
|
|
492
|
-
},
|
|
493
|
-
size: {
|
|
494
|
-
small: "text-xs",
|
|
495
|
-
medium: "text-sm",
|
|
496
|
-
large: "text-base",
|
|
497
|
-
},
|
|
498
|
-
inverted: {
|
|
499
|
-
true: "text-white",
|
|
500
|
-
false: "",
|
|
501
|
-
},
|
|
502
|
-
subtle: {
|
|
503
|
-
true: "opacity-70",
|
|
504
|
-
false: "",
|
|
505
|
-
},
|
|
506
|
-
disabled: {
|
|
507
|
-
true: "opacity-50",
|
|
508
|
-
false: "",
|
|
509
|
-
},
|
|
510
|
-
},
|
|
511
|
-
});
|
|
512
|
-
|
|
513
|
-
/**
|
|
514
|
-
* The Text component is used to apply Trackunit default typography styles to text.
|
|
515
|
-
*
|
|
516
|
-
* ### When to use
|
|
517
|
-
*
|
|
518
|
-
* Use Text when you want to show a text section, use Heading if you want to show a heading.
|
|
519
|
-
*
|
|
520
|
-
* @param {TextProps} props - The props for the Text component
|
|
521
|
-
* @returns {JSX.Element} Text component
|
|
522
|
-
*/
|
|
523
|
-
const Text = (_a) => {
|
|
524
|
-
var { children, type = "p", size = "medium", align = "left", weight = "normal", underline = false, inverted = false, subtle = false, italicize = false, uppercase = false, disabled = false, className, dataTestId } = _a, rest = __rest$1(_a, ["children", "type", "size", "align", "weight", "underline", "inverted", "subtle", "italicize", "uppercase", "disabled", "className", "dataTestId"]);
|
|
525
|
-
return React.createElement(type, Object.assign({ className: cvaText({
|
|
526
|
-
inverted,
|
|
527
|
-
uppercase,
|
|
528
|
-
align,
|
|
529
|
-
italic: italicize,
|
|
530
|
-
size,
|
|
531
|
-
underline,
|
|
532
|
-
weight,
|
|
533
|
-
subtle,
|
|
534
|
-
disabled,
|
|
535
|
-
className,
|
|
536
|
-
}), "data-testid": dataTestId, children }, rest));
|
|
537
|
-
};
|
|
538
|
-
|
|
539
539
|
const cvaAlert = cvaMerge(["flex", "relative", "p-4", "rounded"], {
|
|
540
540
|
variants: {
|
|
541
541
|
color: {
|
|
@@ -571,7 +571,7 @@ const cvaAlertContent = cvaMerge(["grow"], {
|
|
|
571
571
|
variants: {
|
|
572
572
|
layout: {
|
|
573
573
|
default: "",
|
|
574
|
-
inline: "flex items-center
|
|
574
|
+
inline: "flex w-full items-center",
|
|
575
575
|
},
|
|
576
576
|
},
|
|
577
577
|
defaultVariants: {
|
|
@@ -18886,10 +18886,10 @@ const cvaDrawerOverlay = cvaMerge([
|
|
|
18886
18886
|
const cvaDrawerCard = cvaMerge(["fixed", "z-toast"], {
|
|
18887
18887
|
variants: {
|
|
18888
18888
|
position: {
|
|
18889
|
-
left: "top-0 left-0
|
|
18890
|
-
right: "top-0 right-0
|
|
18891
|
-
bottom: "right-0 left-0 bottom-0
|
|
18892
|
-
top: "top-0 left-0
|
|
18889
|
+
left: "animate-slide-in-left top-0 left-0 h-full rounded-l-none",
|
|
18890
|
+
right: "animate-slide-in-right top-0 right-0 h-full rounded-r-none",
|
|
18891
|
+
bottom: "animate-slide-in-bottom right-0 left-0 bottom-0 w-full rounded-b-none",
|
|
18892
|
+
top: "animate-slide-in-top top-0 left-0 w-full rounded-t-none",
|
|
18893
18893
|
},
|
|
18894
18894
|
},
|
|
18895
18895
|
defaultVariants: {
|
|
@@ -19038,11 +19038,11 @@ const ExternalLink = ({ rel = "noreferrer", target = "_blank", href, className,
|
|
|
19038
19038
|
const cvaTooltipFlexContainer = cvaMerge("inline-flex");
|
|
19039
19039
|
const cvaTooltipPopover = cvaMerge("pointer-events-none origin-center");
|
|
19040
19040
|
cvaMerge("pointer-events-none origin-center");
|
|
19041
|
-
const cvaTooltipContent = cvaMerge("
|
|
19041
|
+
const cvaTooltipContent = cvaMerge("max-w-sm rounded p-2", {
|
|
19042
19042
|
variants: {
|
|
19043
19043
|
color: {
|
|
19044
|
-
light: "shadow-md
|
|
19045
|
-
dark: "
|
|
19044
|
+
light: "bg-white shadow-md",
|
|
19045
|
+
dark: "bg-neutral-800 text-white",
|
|
19046
19046
|
},
|
|
19047
19047
|
},
|
|
19048
19048
|
defaultVariants: {
|
|
@@ -19123,8 +19123,8 @@ const cvaIndicatorIconBackground = cvaMerge(["rounded-full", "items-center", "ju
|
|
|
19123
19123
|
working: "bg-working-100 text-working-600",
|
|
19124
19124
|
idle: "bg-idle-100 text-idle-600",
|
|
19125
19125
|
stopped: "bg-stopped-100 text-stopped-600",
|
|
19126
|
-
moving: "bg-neutral-100
|
|
19127
|
-
active: "bg-neutral-100
|
|
19126
|
+
moving: "text-moving bg-neutral-100",
|
|
19127
|
+
active: "text-active bg-neutral-100",
|
|
19128
19128
|
unknown: "bg-unknown-100 text-unknown-600",
|
|
19129
19129
|
unused: "bg-unused-300 text-unused-400",
|
|
19130
19130
|
utilized: "bg-utilized-400 text-utilized-600",
|
|
@@ -19190,7 +19190,7 @@ const cvaMenuItem = cvaMerge([
|
|
|
19190
19190
|
false: "",
|
|
19191
19191
|
},
|
|
19192
19192
|
disabled: {
|
|
19193
|
-
true: "!bg-slate-100
|
|
19193
|
+
true: "pointer-events-none !bg-slate-100",
|
|
19194
19194
|
false: "",
|
|
19195
19195
|
},
|
|
19196
19196
|
focused: {
|
|
@@ -19259,7 +19259,7 @@ const MenuItem = ({ className, dataTestId, label, size, children, selected, focu
|
|
|
19259
19259
|
const cvaMenuList = cvaMerge(["shadow-md", "rounded-lg", "z-20", "bg-white", "p-1", "border", "border-slate-300", "gap-1", "grid"], {
|
|
19260
19260
|
variants: {
|
|
19261
19261
|
stickyHeader: {
|
|
19262
|
-
true: "grid
|
|
19262
|
+
true: "grid-rows-min-fr grid overflow-y-hidden !p-0",
|
|
19263
19263
|
false: "",
|
|
19264
19264
|
},
|
|
19265
19265
|
},
|
|
@@ -19662,7 +19662,7 @@ const cvaTag = cvaMerge([
|
|
|
19662
19662
|
medium: "",
|
|
19663
19663
|
},
|
|
19664
19664
|
layout: {
|
|
19665
|
-
withIcon: "pr-1
|
|
19665
|
+
withIcon: "gap-2 pr-1",
|
|
19666
19666
|
default: "",
|
|
19667
19667
|
},
|
|
19668
19668
|
color: {
|
|
@@ -19715,12 +19715,12 @@ const Tag = React.forwardRef((_a, ref) => {
|
|
|
19715
19715
|
jsx("div", { className: cvaTagIconContainer(), onMouseDown: onClose, children: jsx(Icon, { name: "XCircle", dataTestId: dataTestId + "Icon", type: "solid", size: size, style: { WebkitTransition: "-webkit-transform 0.150s" }, className: cvaTagIcon() }) }))] }));
|
|
19716
19716
|
});
|
|
19717
19717
|
|
|
19718
|
-
const cvaTip = cvaMerge("flex
|
|
19719
|
-
const cvaTipContent = cvaMerge("
|
|
19718
|
+
const cvaTip = cvaMerge("flex text-slate-300 transition hover:text-slate-500");
|
|
19719
|
+
const cvaTipContent = cvaMerge("flex max-w-sm items-center gap-2 rounded p-2 text-sm", {
|
|
19720
19720
|
variants: {
|
|
19721
19721
|
color: {
|
|
19722
|
-
light: "shadow-md
|
|
19723
|
-
dark: "
|
|
19722
|
+
light: "bg-white shadow-md",
|
|
19723
|
+
dark: "bg-neutral-800 text-white",
|
|
19724
19724
|
},
|
|
19725
19725
|
},
|
|
19726
19726
|
defaultVariants: {
|
|
@@ -19774,7 +19774,7 @@ const cvaPageHeaderChildContainer = cvaMerge(["flex", "flex-wrap", "gap-x-6", "i
|
|
|
19774
19774
|
* @returns {JSX.Element} PageHeader component
|
|
19775
19775
|
*/
|
|
19776
19776
|
const PageHeader = ({ className, dataTestId, action, showLoading, description, link, title, tag, backTo, tagColor, children, }) => {
|
|
19777
|
-
return (jsxs("div", { className: cvaPageHeader({ className: `${className} tu-page-header` }), "data-testid": dataTestId, children: [jsxs("div", { className: cvaPageHeaderHeadingAccessoriesContainer(), "data-testid": dataTestId && `${dataTestId}-heading-container`, children: [jsxs("div", { className: cvaPageHeaderHeadingContainer(), children: [backTo && (jsx(IconButton, { to: backTo, color: "tertiary", variant: "transparent", size: "small", icon: jsx(Icon, { name: "ArrowLeft" }) })), jsx("h1", { className: cvaPageHeaderHeading(), "data-testid": dataTestId && `${dataTestId}-heading`, children: title }), description && !showLoading && (jsx(Tip, { dataTestId: dataTestId && `${dataTestId}-tip`, iconProps: { name: "QuestionMarkCircle" }, link: link, children: description }))] }), tag && !showLoading && jsx(Tag, { dataTestId: dataTestId, color: tagColor, children: tag }), showLoading && jsx(Spinner, { dataTestId: dataTestId && `${dataTestId}-spinner`, centering: "vertically" }), action] }), jsx("div", { className: cvaPageHeaderChildContainer(), children: children })] }));
|
|
19777
|
+
return (jsxs("div", { className: cvaPageHeader({ className: `${className} tu-page-header` }), "data-testid": dataTestId, children: [jsxs("div", { className: cvaPageHeaderHeadingAccessoriesContainer(), "data-testid": dataTestId && `${dataTestId}-heading-container`, children: [jsxs("div", { className: cvaPageHeaderHeadingContainer(), children: [backTo && (jsx(IconButton, { to: backTo, color: "tertiary", variant: "transparent", size: "small", icon: jsx(Icon, { name: "ArrowLeft" }) })), jsx("h1", { className: cvaPageHeaderHeading(), "data-testid": dataTestId && `${dataTestId}-heading`, children: title }), description && !showLoading && (jsx(Tip, { dataTestId: dataTestId && `${dataTestId}-tip`, iconProps: { name: "QuestionMarkCircle" }, link: link, children: description }))] }), tag && !showLoading && (jsx(Tag, { dataTestId: dataTestId, color: tagColor, children: tag })), showLoading && jsx(Spinner, { dataTestId: dataTestId && `${dataTestId}-spinner`, centering: "vertically" }), action] }), jsx("div", { className: cvaPageHeaderChildContainer(), children: children })] }));
|
|
19778
19778
|
};
|
|
19779
19779
|
|
|
19780
19780
|
const cvaPagination = cvaMerge(["flex", "items-center", "gap-1"]);
|
|
@@ -21259,7 +21259,7 @@ const Spacer = ({ size = "medium", border = false, dataTestId, className }) => {
|
|
|
21259
21259
|
* @returns {JSX.Element} SectionHeader component
|
|
21260
21260
|
*/
|
|
21261
21261
|
const SectionHeader = ({ title, subtitle, dataTestId, addons }) => {
|
|
21262
|
-
return (jsxs("div", { className: "flex flex-col", children: [jsx(q, { children: jsx(W, { title: title }) }), jsxs("div", { className: "
|
|
21262
|
+
return (jsxs("div", { className: "flex flex-col", children: [jsx(q, { children: jsx(W, { title: title }) }), jsxs("div", { className: "mb-2 flex flex-row gap-2", children: [jsxs("div", { className: "flex grow flex-col gap-2", children: [jsx(Heading, { variant: "secondary", dataTestId: dataTestId, children: title }), subtitle && (jsx(Heading, { variant: "subtitle", subtle: true, children: subtitle }))] }), addons && jsx("div", { className: "flex gap-2", children: addons })] }), jsx(Spacer, { size: "small" })] }));
|
|
21263
21263
|
};
|
|
21264
21264
|
|
|
21265
21265
|
const cvaSidebar = cvaMerge(["apply grid", "grid-cols-fr-min", "items-center"]);
|
|
@@ -21441,7 +21441,7 @@ const cvaValueBarProgress = cvaMerge(["h-full", "rounded"], {
|
|
|
21441
21441
|
const cvaValueBarText = cvaMerge([], {
|
|
21442
21442
|
variants: {
|
|
21443
21443
|
size: {
|
|
21444
|
-
small: "font-bold
|
|
21444
|
+
small: "text-sm font-bold",
|
|
21445
21445
|
large: "drop-shadow-lg",
|
|
21446
21446
|
},
|
|
21447
21447
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-components",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.173",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@floating-ui/react": "0.25.4",
|
|
11
11
|
"@trackunit/css-class-variance-utilities": "0.0.14",
|
|
12
|
-
"@trackunit/css-core": "0.0.
|
|
13
|
-
"@trackunit/shared-utils": "0.0.
|
|
14
|
-
"@trackunit/ui-design-tokens": "0.0.
|
|
15
|
-
"@trackunit/ui-icons": "0.0.
|
|
12
|
+
"@trackunit/css-core": "0.0.96",
|
|
13
|
+
"@trackunit/shared-utils": "0.0.11",
|
|
14
|
+
"@trackunit/ui-design-tokens": "0.0.78",
|
|
15
|
+
"@trackunit/ui-icons": "0.0.78",
|
|
16
16
|
"date-fns": "2.29.3",
|
|
17
17
|
"lodash": "4.17.21",
|
|
18
18
|
"react": "18.2.0",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"react-router-dom": "6.11.2",
|
|
22
22
|
"react-use": "17.4.0",
|
|
23
23
|
"react-useportal": "1.0.18",
|
|
24
|
-
"zod": "3.
|
|
24
|
+
"zod": "3.22.3"
|
|
25
25
|
},
|
|
26
26
|
"module": "./index.esm.js",
|
|
27
27
|
"main": "./index.cjs.js",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { Matcher } from "react-day-picker";
|
|
3
3
|
import { CommonProps, Size } from "../../common/CommonProps";
|
|
4
|
-
import { ButtonColor } from "../buttons";
|
|
5
4
|
import { PopoverPlacement } from "../Popover";
|
|
5
|
+
import { ButtonColor } from "../buttons";
|
|
6
6
|
export interface DayPickerPopoverProps extends CommonProps {
|
|
7
7
|
disabledDays?: Matcher | Matcher[] | undefined;
|
|
8
8
|
onDaySelect: (day: Date) => void;
|
|
@@ -190,7 +190,12 @@ export declare const iconPalette: {
|
|
|
190
190
|
readonly 300: "212 212 212";
|
|
191
191
|
readonly 400: "163 163 163";
|
|
192
192
|
readonly 500: "115 115 115";
|
|
193
|
-
readonly 600: "82 82 82";
|
|
193
|
+
readonly 600: "82 82 82"; /**
|
|
194
|
+
* The size of the icon.
|
|
195
|
+
* Small = 16x16px, medium = 20x20px, Large = 24x24px.
|
|
196
|
+
* Default value is Large.
|
|
197
|
+
* If a custom size is needed, set it in the className.
|
|
198
|
+
*/
|
|
194
199
|
readonly 700: "64 64 64";
|
|
195
200
|
readonly 800: "38 38 38";
|
|
196
201
|
readonly 900: "23 23 23";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { MenuItemProps } from "../MenuItem/MenuItem";
|
|
3
2
|
import { CommonProps } from "../../../common";
|
|
3
|
+
import { MenuItemProps } from "../MenuItem/MenuItem";
|
|
4
4
|
export interface MenuListItemProps extends MenuItemProps {
|
|
5
5
|
showDivider?: boolean;
|
|
6
6
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export * from "./Alert";
|
|
2
2
|
export * from "./Badge";
|
|
3
|
-
export * from "./buttons";
|
|
4
3
|
export * from "./Card";
|
|
5
4
|
export * from "./Collapse";
|
|
6
5
|
export * from "./CopyableText";
|
|
@@ -29,3 +28,4 @@ export * from "./Timeline/Timeline";
|
|
|
29
28
|
export * from "./Tip";
|
|
30
29
|
export * from "./Tooltip";
|
|
31
30
|
export * from "./ValueBar";
|
|
31
|
+
export * from "./buttons";
|
package/src/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export * from "./common";
|
|
2
2
|
export * from "./components";
|
|
3
|
-
export * from "./components/buttons/shared/Button.variants";
|
|
4
3
|
export * from "./components/Clickable/Clickable.variants";
|
|
5
4
|
export * from "./components/Indicator/Indicator.variants";
|
|
6
5
|
export * from "./components/Menu/MenuItem/MenuItem.variants";
|
|
6
|
+
export * from "./components/buttons/shared/Button.variants";
|
|
7
7
|
export * from "./hooks";
|