@trackunit/react-components 0.0.135 → 0.0.136

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.
@@ -18,6 +18,14 @@ export interface IndicatorProps extends CommonProps {
18
18
  * A boolean parameter to display or hide icon background, default value is true
19
19
  */
20
20
  withBackground?: boolean;
21
+ /**
22
+ * A boolean parameter to display or hide label and instead show as html title on hover, default value is true
23
+ */
24
+ withLabel?: boolean;
25
+ /**
26
+ * A boolean parameter to make the indicator ping thus drawing more attention, default value is false
27
+ */
28
+ ping?: boolean;
21
29
  }
22
30
  /**
23
31
  * Indicators are non-interactive elements that communicate essential aspects of the state of an asset.
@@ -31,4 +39,4 @@ export interface IndicatorProps extends CommonProps {
31
39
  * @param {IndicatorProps} props - The props for the Indicator component
32
40
  * @returns {JSX.Element} Indicator component
33
41
  */
34
- export declare const Indicator: ({ dataTestId, icon, label, color, withBackground, ...rest }: IndicatorProps) => JSX.Element;
42
+ export declare const Indicator: ({ dataTestId, icon, label, color, withBackground, withLabel, ping, ...rest }: IndicatorProps) => JSX.Element;
@@ -43,10 +43,31 @@ export declare const activityColors: {
43
43
  readonly UNKNOWN: "unknown";
44
44
  };
45
45
  export declare type ActivityColors = typeof colors[keyof typeof activityColors];
46
+ /**
47
+ * The Rental status color palette
48
+ * Should be available in any component that could be used to display the rental status of an asset
49
+ */
50
+ export declare const rentalStatusColors: {
51
+ readonly ON_RENT: "ON_RENT";
52
+ readonly RETURNED: "RETURNED";
53
+ readonly AVAILABLE: "AVAILABLE";
54
+ readonly PICKUP_READY: "PICKUP_READY";
55
+ readonly TRANSFER: "TRANSFER";
56
+ readonly IN_REPAIR: "IN_REPAIR";
57
+ readonly OTHER_RENTAL_STATUS: "OTHER_RENTAL_STATUS";
58
+ };
59
+ export declare type RentalStatusColors = typeof colors[keyof typeof rentalStatusColors];
46
60
  /**
47
61
  * The full color palette
48
62
  */
49
63
  export declare const colors: {
64
+ readonly ON_RENT: "ON_RENT";
65
+ readonly RETURNED: "RETURNED";
66
+ readonly AVAILABLE: "AVAILABLE";
67
+ readonly PICKUP_READY: "PICKUP_READY";
68
+ readonly TRANSFER: "TRANSFER";
69
+ readonly IN_REPAIR: "IN_REPAIR";
70
+ readonly OTHER_RENTAL_STATUS: "OTHER_RENTAL_STATUS";
50
71
  readonly WORKING: "working";
51
72
  readonly IDLE: "idle";
52
73
  readonly STOPPED: "stopped";
package/index.js CHANGED
@@ -348,11 +348,25 @@ const activityColors = {
348
348
  STOPPED: "stopped",
349
349
  UNKNOWN: "unknown"
350
350
  };
351
+ /**
352
+ * The Rental status color palette
353
+ * Should be available in any component that could be used to display the rental status of an asset
354
+ */
355
+
356
+ const rentalStatusColors = {
357
+ ON_RENT: "ON_RENT",
358
+ RETURNED: "RETURNED",
359
+ AVAILABLE: "AVAILABLE",
360
+ PICKUP_READY: "PICKUP_READY",
361
+ TRANSFER: "TRANSFER",
362
+ IN_REPAIR: "IN_REPAIR",
363
+ OTHER_RENTAL_STATUS: "OTHER_RENTAL_STATUS"
364
+ };
351
365
  /**
352
366
  * The full color palette
353
367
  */
354
368
 
355
- const colors = Object.assign(Object.assign(Object.assign(Object.assign({}, generalColors), intentColors), criticalityColors), activityColors);
369
+ const colors = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, generalColors), intentColors), criticalityColors), activityColors), rentalStatusColors);
356
370
 
357
371
  const IconSizeClassMap = {
358
372
  small: tws`tu-icon--small`,
@@ -2640,20 +2654,26 @@ const Indicator$1 = _a => {
2640
2654
  icon,
2641
2655
  label,
2642
2656
  color = colors.UNKNOWN,
2643
- withBackground = true
2657
+ withBackground = true,
2658
+ withLabel = true,
2659
+ ping = false
2644
2660
  } = _a,
2645
- rest = __rest(_a, ["dataTestId", "icon", "label", "color", "withBackground"]);
2661
+ rest = __rest(_a, ["dataTestId", "icon", "label", "color", "withBackground", "withLabel", "ping"]);
2646
2662
 
2647
2663
  return jsxs(Container$4, Object.assign({
2648
2664
  "$color": color,
2649
2665
  "data-testid": dataTestId
2650
2666
  }, rest, {
2651
- children: [jsx(IconBackground, Object.assign({
2667
+ title: !withLabel ? label : undefined
2668
+ }, {
2669
+ children: [jsxs(IconBackground, Object.assign({
2652
2670
  "data-testid": dataTestId ? `${dataTestId}-background` : "indicator-background",
2653
2671
  "$withBackground": withBackground
2654
2672
  }, {
2655
- children: icon
2656
- })), label !== undefined && jsx(Label$2, Object.assign({
2673
+ children: [ping && jsx(Ping, {
2674
+ "data-testid": dataTestId ? `${dataTestId}-ping` : "indicator-ping"
2675
+ }), icon]
2676
+ })), label !== undefined && withLabel && jsx(Label$2, Object.assign({
2657
2677
  "data-testid": dataTestId ? `${dataTestId}-label` : "indicator-label"
2658
2678
  }, {
2659
2679
  children: label
@@ -2725,6 +2745,9 @@ const IconBackground = tw.div`
2725
2745
  const Label$2 = tw.div`
2726
2746
  tu-indicator__label
2727
2747
  `;
2748
+ const Ping = tw.span`
2749
+ tu-indicator__ping
2750
+ `;
2728
2751
 
2729
2752
  /**
2730
2753
  * The LegendItem component is used to show form legends.
@@ -5349,4 +5372,4 @@ const Layout = tw.div`
5349
5372
  tu-layout-TwoColumnLayout
5350
5373
  `;
5351
5374
 
5352
- export { ActionButton, Alert, AnimatedPopover, Badge, BaseInput, Button, Card, CardBody, CardFooter, CardHeader, Chart, Checkbox, Collapse, CopyableText, CreatableSelect, DateField, DateInput, DayPicker, DayPickerPopover, DayRangePicker, DensityContainer, FilterListMapLayout, FormGroup, FullWidthRepeatingLayout, GridArea, Heading, Icon$1 as Icon, IconButton, Indicator$1 as Indicator, IntrinsicallyResponsiveGrid, Label$3 as Label, LegendItem, MenuItem, MenuList, MinTopFullContentLayout, Modal, ModalBackdrop, MultiSelectMenuItem, NumberField, NumberInput, PageHeading, PopoverLifecycle, PopoverList, PopoverListItem, PopoverTitle, Prompt, ROLE_CARD, RadioGroup, RadioItem, Select, SingleSelectMenuItem, SkeletonLines, Spacer, Spinner, StarButton, Tag, Text$1 as Text, TextArea, TextAreaField, TextField, TextInput, Timeline, TimelineElement, Tip, TitleNavContentLayout, Toggle, Tooltip, TwoColumnLayout, ValueBar, activityColors, colors, criticalityColors, docs, generalColors, getOrderedOptions, getValueBarColorByValue, intentColors, isMultiValue, useContainerProps, useCustomComponents, useDebounce, useLocalStorage, useModal, usePopover, usePrompt, useTimeout };
5375
+ export { ActionButton, Alert, AnimatedPopover, Badge, BaseInput, Button, Card, CardBody, CardFooter, CardHeader, Chart, Checkbox, Collapse, CopyableText, CreatableSelect, DateField, DateInput, DayPicker, DayPickerPopover, DayRangePicker, DensityContainer, FilterListMapLayout, FormGroup, FullWidthRepeatingLayout, GridArea, Heading, Icon$1 as Icon, IconButton, Indicator$1 as Indicator, IntrinsicallyResponsiveGrid, Label$3 as Label, LegendItem, MenuItem, MenuList, MinTopFullContentLayout, Modal, ModalBackdrop, MultiSelectMenuItem, NumberField, NumberInput, PageHeading, PopoverLifecycle, PopoverList, PopoverListItem, PopoverTitle, Prompt, ROLE_CARD, RadioGroup, RadioItem, Select, SingleSelectMenuItem, SkeletonLines, Spacer, Spinner, StarButton, Tag, Text$1 as Text, TextArea, TextAreaField, TextField, TextInput, Timeline, TimelineElement, Tip, TitleNavContentLayout, Toggle, Tooltip, TwoColumnLayout, ValueBar, activityColors, colors, criticalityColors, docs, generalColors, getOrderedOptions, getValueBarColorByValue, intentColors, isMultiValue, rentalStatusColors, useContainerProps, useCustomComponents, useDebounce, useLocalStorage, useModal, usePopover, usePrompt, useTimeout };
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@trackunit/react-components",
3
- "version": "0.0.135",
3
+ "version": "0.0.136",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "dependencies": {
7
- "@trackunit/css-core": "0.0.48",
7
+ "@trackunit/css-core": "0.0.49",
8
8
  "@trackunit/tailwind-styled-components": "0.0.43",
9
9
  "react": "17.0.1",
10
10
  "@trackunit/ui-design-tokens": "0.0.42",