@vitality-ds/components 5.7.0-alpha.0 → 5.7.0-alpha.11

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.
Files changed (185) hide show
  1. package/dist/AuditTrail/components/AuditItem/index.spec.js +14 -13
  2. package/dist/AuditTrail/components/IconAvatar/index.js +3 -4
  3. package/dist/AuditTrail/constants.js +21 -20
  4. package/dist/Breadcrumbs/components/Breadcrumb/index.js +3 -3
  5. package/dist/Button/components/ButtonIcon/styles/BaseButtonIcon.styles.js +27 -30
  6. package/dist/Callout/constants.js +16 -15
  7. package/dist/Callout/hooks/useCalloutContent.js +1 -1
  8. package/dist/Callout/index.js +10 -14
  9. package/dist/Callout/styles/BaseCalloutIconContainer.styles.js +12 -2
  10. package/dist/Chip/components/Checkbox/constants.js +4 -4
  11. package/dist/Chip/components/ChipIcon/index.js +2 -2
  12. package/dist/Chip/components/RemoveButton/index.js +4 -4
  13. package/dist/Chip/components/RemoveButton/styles/BaseRemoveButtonButton.styles.js +4 -1
  14. package/dist/Chip/styles/BaseChip.styles.js +1 -1
  15. package/dist/ComboButton/index.js +2 -2
  16. package/dist/Dialog/components/DialogHeader/index.js +4 -5
  17. package/dist/Dialog/constants.js +3 -3
  18. package/dist/DropdownMenu/components/Content/index.js +5 -6
  19. package/dist/DropdownMenu/components/IconContainer/index.js +1 -1
  20. package/dist/DropdownMenu/styles/Content.styles.js +4 -1
  21. package/dist/Form/FormField/index.js +4 -4
  22. package/dist/Form/HelperMessage/index.js +4 -4
  23. package/dist/IconButton/index.js +2 -2
  24. package/dist/IconButton/styles/BaseIconButton.styles.js +7 -3
  25. package/dist/Input/DatePicker/components/Calendar/index.js +3 -3
  26. package/dist/Input/DatePicker/index.js +2 -2
  27. package/dist/Input/DateRangePicker/index.js +4 -6
  28. package/dist/Input/DateRangePicker/styles/ExtrasContainers.js +7 -2
  29. package/dist/Input/PasswordInput/constants.js +3 -3
  30. package/dist/Input/SearchInput/index.js +2 -2
  31. package/dist/Input/Select/SearchSelectInput/index.js +2 -2
  32. package/dist/Input/Select/components/Chip/MultiValueRemove/index.js +4 -4
  33. package/dist/Input/Select/components/ClearButton/index.js +4 -4
  34. package/dist/Input/Select/components/DropdownIndicator/index.js +7 -7
  35. package/dist/Input/TextInput/components/IconAdornment/index.js +1 -2
  36. package/dist/Input/TextInput/components/IconAdornment/styles/BaseIconWrapper.styles.js +6 -2
  37. package/dist/Input/TextInput/components/IconButtonAdornment/index.js +1 -4
  38. package/dist/Input/TextInput/components/IconButtonAdornment/styles/BaseIconButtonWrapper.styles.js +1 -6
  39. package/dist/Input/TextInput/components/SpinnerAdornment/index.js +1 -1
  40. package/dist/Input/TextInput/components/SpinnerAdornment/styles/BaseSpinnerWrapper.styles.js +1 -1
  41. package/dist/LucideProvider/index.js +18 -0
  42. package/dist/LucideProvider/types.js +1 -0
  43. package/dist/Provider/index.js +3 -1
  44. package/dist/Sidebar/components/SidebarCloseButton/index.js +2 -2
  45. package/dist/StatusBadge/components/StatusBadgeIcon/styles/BaseStatusBadge.styles.js +20 -1
  46. package/dist/StatusBadge/constants.js +9 -6
  47. package/dist/StatusBadge/logic.spec.js +13 -6
  48. package/dist/StatusBadge/styles/BaseStatusBadge.styles.js +27 -1
  49. package/dist/Switch/index.js +4 -4
  50. package/dist/Table/components/Cells/RowActions/constants.js +5 -5
  51. package/dist/Table/components/Cells/RowActions/styles/BaseIconButtonCell.styles.js +3 -0
  52. package/dist/Table/components/Cells/SortableHeader/components/SortableIcon/index.js +3 -4
  53. package/dist/Table/components/Cells/SortableHeader/components/SortableIcon/styles/BaseSortableIconContainer.styles.js +3 -1
  54. package/dist/Table/components/Cells/SortableHeader/components/SortedIcon/index.js +4 -4
  55. package/dist/Table/components/Cells/SortableHeader/components/SortedIcon/styles/BaseSortedIconContainer.js +4 -2
  56. package/dist/Table/components/MemoizedCell/constants.js +4 -1
  57. package/dist/Table/components/MemoizedCell/logic.js +6 -5
  58. package/dist/Table/components/MemoizedCell/logic.spec.js +24 -0
  59. package/dist/Table/components/Pagination/index.js +3 -3
  60. package/dist/Table/components/States/Error/index.js +5 -4
  61. package/dist/Tabs/index.js +18 -8
  62. package/dist/Toaster/components/CloseIconButton/index.js +4 -4
  63. package/dist/Toaster/components/Toast/constants.js +6 -6
  64. package/dist/Toaster/components/Toast/helpers/getVariantsByColorScale.js +2 -4
  65. package/dist/Toaster/components/Toast/index.js +2 -1
  66. package/dist/Toaster/components/Toast/logic.spec.js +6 -6
  67. package/dist/Toaster/components/Toast/styles/BaseToast.styles.js +3 -0
  68. package/dist/Typography/styles/BaseTypography.styles.js +128 -127
  69. package/dist/components/src/AuditTrail/components/IconAvatar/types.d.ts +1 -2
  70. package/dist/components/src/AuditTrail/logic.d.ts +1 -2
  71. package/dist/components/src/AuditTrail/types.d.ts +1 -2
  72. package/dist/components/src/Button/components/ButtonIcon/styled.d.ts +3 -46
  73. package/dist/components/src/Button/components/ButtonIcon/styles/BaseButtonIcon.styles.d.ts +3 -46
  74. package/dist/components/src/Callout/styled.d.ts +408 -1
  75. package/dist/components/src/Callout/styles/BaseCalloutIconContainer.styles.d.ts +14 -1
  76. package/dist/components/src/Callout/types.d.ts +4 -4
  77. package/dist/components/src/Chip/components/ChipIcon/types.d.ts +2 -3
  78. package/dist/components/src/Chip/types.d.ts +3 -4
  79. package/dist/components/src/Dialog/types.d.ts +4 -4
  80. package/dist/components/src/DropdownMenu/components/DropdownMenuItem/types.d.ts +2 -3
  81. package/dist/components/src/Form/FormField/constants.d.ts +2 -2
  82. package/dist/components/src/IconButton/styled.d.ts +12 -4
  83. package/dist/components/src/IconButton/styles/BaseIconButton.styles.d.ts +6 -2
  84. package/dist/components/src/IconButton/types.d.ts +3 -4
  85. package/dist/components/src/Input/PasswordInput/types.d.ts +3 -2
  86. package/dist/components/src/Input/SearchInput/types.d.ts +2 -3
  87. package/dist/components/src/Input/Select/AsyncSelect/index.d.ts +1 -1
  88. package/dist/components/src/Input/Select/SearchSelectInput/index.d.ts +1 -1
  89. package/dist/components/src/Input/Select/types.d.ts +2 -2
  90. package/dist/components/src/Input/TextInput/components/IconAdornment/types.d.ts +3 -7
  91. package/dist/components/src/Link/styled.d.ts +3 -259
  92. package/dist/components/src/LucideProvider/index.d.ts +4 -0
  93. package/dist/components/src/LucideProvider/types.d.ts +7 -0
  94. package/dist/components/src/Provider/types.d.ts +10 -1
  95. package/dist/components/src/StatusBadge/styled.d.ts +6 -0
  96. package/dist/components/src/StatusBadge/styles/BaseStatusBadge.styles.d.ts +2 -0
  97. package/dist/components/src/StatusBadge/types.d.ts +1 -1
  98. package/dist/components/src/Table/components/Cells/Icon/types.d.ts +3 -4
  99. package/dist/components/src/Table/components/Cells/RowActions/constants.d.ts +4 -5
  100. package/dist/components/src/Table/components/Cells/SortableHeader/components/SortedIcon/styled.d.ts +2 -0
  101. package/dist/components/src/Table/components/Cells/SortableHeader/components/SortedIcon/styles/BaseSortedIconContainer.d.ts +2 -0
  102. package/dist/components/src/Table/components/MemoizedCell/constants.d.ts +1 -0
  103. package/dist/components/src/Tabs/index.d.ts +1 -1
  104. package/dist/components/src/Tabs/types.d.ts +2 -6
  105. package/dist/components/src/Toaster/components/Toast/constants.d.ts +5 -6
  106. package/dist/components/src/Toaster/components/Toast/helpers/getVariantsByColorScale.d.ts +2 -4
  107. package/dist/components/src/Toaster/components/Toast/styled.d.ts +13 -20
  108. package/dist/components/src/Toaster/components/Toast/styles/BaseToast.styles.d.ts +13 -20
  109. package/dist/components/src/Typography/styled.d.ts +3 -259
  110. package/dist/components/src/Typography/styles/BaseTypography.styles.d.ts +3 -313
  111. package/dist/components/src/helpers/test/findSVGs.d.ts +3 -2
  112. package/dist/esm/AuditTrail/components/AuditItem/index.spec.js +15 -14
  113. package/dist/esm/AuditTrail/components/IconAvatar/index.js +3 -4
  114. package/dist/esm/AuditTrail/constants.js +22 -21
  115. package/dist/esm/Breadcrumbs/components/Breadcrumb/index.js +2 -2
  116. package/dist/esm/Button/components/ButtonIcon/styles/BaseButtonIcon.styles.js +27 -29
  117. package/dist/esm/Callout/constants.js +13 -12
  118. package/dist/esm/Callout/hooks/useCalloutContent.js +1 -1
  119. package/dist/esm/Callout/index.js +10 -14
  120. package/dist/esm/Callout/styles/BaseCalloutIconContainer.styles.js +12 -2
  121. package/dist/esm/Chip/components/Checkbox/constants.js +4 -4
  122. package/dist/esm/Chip/components/ChipIcon/index.js +2 -2
  123. package/dist/esm/Chip/components/RemoveButton/index.js +4 -4
  124. package/dist/esm/Chip/components/RemoveButton/styles/BaseRemoveButtonButton.styles.js +4 -1
  125. package/dist/esm/Chip/styles/BaseChip.styles.js +1 -1
  126. package/dist/esm/ComboButton/index.js +2 -2
  127. package/dist/esm/Dialog/components/DialogHeader/index.js +4 -5
  128. package/dist/esm/Dialog/constants.js +3 -3
  129. package/dist/esm/DropdownMenu/components/Content/index.js +4 -5
  130. package/dist/esm/DropdownMenu/components/IconContainer/index.js +1 -1
  131. package/dist/esm/DropdownMenu/styles/Content.styles.js +4 -1
  132. package/dist/esm/Form/FormField/index.js +3 -3
  133. package/dist/esm/Form/HelperMessage/index.js +4 -4
  134. package/dist/esm/IconButton/index.js +2 -2
  135. package/dist/esm/IconButton/styles/BaseIconButton.styles.js +7 -3
  136. package/dist/esm/Input/DatePicker/components/Calendar/index.js +1 -1
  137. package/dist/esm/Input/DatePicker/index.js +2 -2
  138. package/dist/esm/Input/DateRangePicker/index.js +4 -6
  139. package/dist/esm/Input/DateRangePicker/styles/ExtrasContainers.js +6 -2
  140. package/dist/esm/Input/PasswordInput/constants.js +3 -3
  141. package/dist/esm/Input/SearchInput/index.js +1 -1
  142. package/dist/esm/Input/Select/SearchSelectInput/index.js +1 -1
  143. package/dist/esm/Input/Select/components/Chip/MultiValueRemove/index.js +4 -4
  144. package/dist/esm/Input/Select/components/ClearButton/index.js +4 -4
  145. package/dist/esm/Input/Select/components/DropdownIndicator/index.js +7 -7
  146. package/dist/esm/Input/TextInput/components/IconAdornment/index.js +1 -2
  147. package/dist/esm/Input/TextInput/components/IconAdornment/styles/BaseIconWrapper.styles.js +6 -3
  148. package/dist/esm/Input/TextInput/components/IconButtonAdornment/index.js +1 -4
  149. package/dist/esm/Input/TextInput/components/IconButtonAdornment/styles/BaseIconButtonWrapper.styles.js +1 -6
  150. package/dist/esm/Input/TextInput/components/SpinnerAdornment/index.js +1 -1
  151. package/dist/esm/Input/TextInput/components/SpinnerAdornment/styles/BaseSpinnerWrapper.styles.js +1 -1
  152. package/dist/esm/LucideProvider/index.js +11 -0
  153. package/dist/esm/LucideProvider/types.js +1 -0
  154. package/dist/esm/Provider/index.js +3 -1
  155. package/dist/esm/Sidebar/components/SidebarCloseButton/index.js +2 -2
  156. package/dist/esm/StatusBadge/components/StatusBadgeIcon/styles/BaseStatusBadge.styles.js +20 -1
  157. package/dist/esm/StatusBadge/constants.js +8 -5
  158. package/dist/esm/StatusBadge/logic.spec.js +11 -4
  159. package/dist/esm/StatusBadge/styles/BaseStatusBadge.styles.js +27 -1
  160. package/dist/esm/Switch/index.js +4 -4
  161. package/dist/esm/Table/components/Cells/RowActions/constants.js +4 -4
  162. package/dist/esm/Table/components/Cells/RowActions/styles/BaseIconButtonCell.styles.js +3 -0
  163. package/dist/esm/Table/components/Cells/SortableHeader/components/SortableIcon/index.js +3 -4
  164. package/dist/esm/Table/components/Cells/SortableHeader/components/SortableIcon/styles/BaseSortableIconContainer.styles.js +3 -1
  165. package/dist/esm/Table/components/Cells/SortableHeader/components/SortedIcon/index.js +4 -4
  166. package/dist/esm/Table/components/Cells/SortableHeader/components/SortedIcon/styles/BaseSortedIconContainer.js +4 -2
  167. package/dist/esm/Table/components/MemoizedCell/constants.js +3 -0
  168. package/dist/esm/Table/components/MemoizedCell/logic.js +7 -6
  169. package/dist/esm/Table/components/MemoizedCell/logic.spec.js +24 -0
  170. package/dist/esm/Table/components/Pagination/index.js +1 -1
  171. package/dist/esm/Table/components/States/Error/index.js +5 -4
  172. package/dist/esm/Tabs/index.js +18 -8
  173. package/dist/esm/Toaster/components/CloseIconButton/index.js +4 -4
  174. package/dist/esm/Toaster/components/Toast/constants.js +4 -4
  175. package/dist/esm/Toaster/components/Toast/helpers/getVariantsByColorScale.js +2 -4
  176. package/dist/esm/Toaster/components/Toast/index.js +2 -1
  177. package/dist/esm/Toaster/components/Toast/logic.spec.js +4 -4
  178. package/dist/esm/Toaster/components/Toast/styles/BaseToast.styles.js +3 -0
  179. package/dist/esm/Typography/styles/BaseTypography.styles.js +128 -127
  180. package/dist/esm/helpers/logic/get-component-from-lookup.spec.js +3 -3
  181. package/dist/esm/helpers/test/findSVGs.js +17 -7
  182. package/dist/helpers/logic/get-component-from-lookup.spec.js +3 -3
  183. package/dist/helpers/test/findSVGs.js +17 -7
  184. package/dist/tsconfig.tsbuildinfo +1 -1
  185. package/package.json +5 -4
@@ -2,13 +2,15 @@ import { colorUseCases, css, getColorScaleValueByUseCase } from "@vitality-ds/sy
2
2
  var text = colorUseCases.text;
3
3
  export default css({
4
4
  color: getColorScaleValueByUseCase("neutral", text.lowContrast),
5
+ height: "1rem",
6
+ width: "1rem",
5
7
  variants: {
6
8
  sortBy: {
7
9
  descending: {
8
- transform: "rotate(270deg)"
10
+ transform: "rotate(180deg)"
9
11
  },
10
12
  ascending: {
11
- transform: "rotate(90deg)"
13
+ transform: "rotate(0deg)"
12
14
  }
13
15
  }
14
16
  }
@@ -2,6 +2,9 @@ import { AsyncSelectCell, ButtonCell, CreatableSelectCell, CurrencyInputCell, Da
2
2
  import CustomCell from "../Cells/Custom";
3
3
  import SearchSelectInputCell from "../Cells/SearchSelectInput";
4
4
  export var DEFAULT_EMPTY_PLACEHOLDER = "-";
5
+
6
+ // Cell types that can safely render a placeholder with only `children`
7
+ export var PLACEHOLDER_SAFE_CELL_TYPES = ["text", "number"];
5
8
  var errorGetCellProps = function errorGetCellProps(componentName) {
6
9
  // eslint-disable-next-line no-console
7
10
  console.error("[Vitality] You're trying to render a ".concat(componentName, " cell. But no getCellProps function was given to the column as a result nothing could be rendered. Please refer to https://vitalitydesignsystem.com/components/table for an implementation."));
@@ -1,6 +1,5 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- import { TextCell } from "../Cells";
3
- import { CELL_TYPES, DEFAULT_EMPTY_PLACEHOLDER } from "./constants";
2
+ import { CELL_TYPES, DEFAULT_EMPTY_PLACEHOLDER, PLACEHOLDER_SAFE_CELL_TYPES } from "./constants";
4
3
  function isCellContentsEmpty(rowData, colId, computedCellProps) {
5
4
  return rowData[colId] !== 0 && !rowData[colId] && !computedCellProps;
6
5
  }
@@ -9,14 +8,16 @@ function getCellType(cellType, _ref, rowData, emptyPlaceholderText) {
9
8
  getCellProps = _ref.getCellProps;
10
9
  var computedCellProps = typeof getCellProps === "function" && getCellProps(colId, rowData);
11
10
  if (isCellContentsEmpty(rowData, colId, computedCellProps)) {
11
+ var _ref2 = PLACEHOLDER_SAFE_CELL_TYPES.includes(cellType) ? CELL_TYPES[cellType] : CELL_TYPES.text,
12
+ EmptyComponent = _ref2.component;
12
13
  return {
13
- as: TextCell,
14
+ as: EmptyComponent,
14
15
  children: emptyPlaceholderText || DEFAULT_EMPTY_PLACEHOLDER
15
16
  };
16
17
  }
17
- var _ref2 = CELL_TYPES[cellType] || CELL_TYPES.text,
18
- Component = _ref2.component,
19
- defaultGetCellProps = _ref2.getCellProps;
18
+ var _ref3 = CELL_TYPES[cellType] || CELL_TYPES.text,
19
+ Component = _ref3.component,
20
+ defaultGetCellProps = _ref3.getCellProps;
20
21
  var getCellPropsFn = getCellProps || defaultGetCellProps;
21
22
  return _extends({}, getCellPropsFn(colId, rowData), {
22
23
  as: Component
@@ -68,6 +68,30 @@ describe("getCellType function", function () {
68
68
  expect(data.as).toEqual(NumberCell);
69
69
  expect(data.children).toEqual("12");
70
70
  });
71
+ it("Should return a NumberCell with placeholder when number cell is empty", function () {
72
+ rowData.number = "";
73
+ var data = getCellType("number", {
74
+ colId: "number"
75
+ }, rowData, null);
76
+ expect(data.as).toEqual(NumberCell);
77
+ expect(data.children).toEqual("-");
78
+ });
79
+ it("Should fall back to TextCell with placeholder when link cell is empty", function () {
80
+ rowData.link = "";
81
+ var data = getCellType("link", {
82
+ colId: "link"
83
+ }, rowData, null);
84
+ expect(data.as).toEqual(TextCell);
85
+ expect(data.children).toEqual("-");
86
+ });
87
+ it("Should fall back to TextCell with placeholder when icon cell is empty", function () {
88
+ rowData.icon = "";
89
+ var data = getCellType("icon", {
90
+ colId: "icon"
91
+ }, rowData, null);
92
+ expect(data.as).toEqual(TextCell);
93
+ expect(data.children).toEqual("-");
94
+ });
71
95
  it("Should return an statusBadge with a console error", function () {
72
96
  var logSpy = jest.spyOn(global.console, "error");
73
97
  var data = getCellType("statusBadge", {
@@ -1,4 +1,4 @@
1
- import { ChevronLeft, ChevronRight } from "@vitality-ds/icons";
1
+ import { ChevronLeft, ChevronRight } from "lucide-react";
2
2
  import React from "react";
3
3
  import IconButton from "../../../IconButton";
4
4
  import { Select } from "../../../Input/Select";
@@ -1,4 +1,4 @@
1
- import { Error } from "@vitality-ds/icons";
1
+ import { CircleAlert } from "lucide-react";
2
2
  import React from "react";
3
3
  import Button from "../../../../Button";
4
4
  import { EMPTY_OBJ } from "../../../../helpers/logic/empties";
@@ -20,9 +20,10 @@ export function ErrorState(_ref) {
20
20
  align: "center",
21
21
  direction: size === "compact" ? "horizontal" : "vertical"
22
22
  }, /*#__PURE__*/React.createElement(Stack, {
23
- direction: "horizontal"
24
- }, /*#__PURE__*/React.createElement(Error, {
25
- color: "critical"
23
+ direction: "horizontal",
24
+ align: "center"
25
+ }, /*#__PURE__*/React.createElement(CircleAlert, {
26
+ color: "var(--vitality-colors-critical11)"
26
27
  }), /*#__PURE__*/React.createElement(Typography, {
27
28
  color: "critical"
28
29
  }, errorMessage)), errorButtonProps && onClick && /*#__PURE__*/React.createElement(Button, {
@@ -9,27 +9,37 @@ function Tabs(_ref) {
9
9
  tabAlignment = _ref.tabAlignment,
10
10
  tabsData = _ref.tabsData,
11
11
  tabListAriaLabel = _ref.tabListAriaLabel,
12
- defaultValue = _ref.defaultValue;
12
+ defaultValue = _ref.defaultValue,
13
+ value = _ref.value,
14
+ onValueChange = _ref.onValueChange,
15
+ orientation = _ref.orientation,
16
+ dir = _ref.dir,
17
+ activationMode = _ref.activationMode;
13
18
  return /*#__PURE__*/React.createElement(Root, {
14
- defaultValue: defaultValue || ((_tabsData$ = tabsData[0]) === null || _tabsData$ === void 0 ? void 0 : _tabsData$.value)
19
+ defaultValue: defaultValue || ((_tabsData$ = tabsData[0]) === null || _tabsData$ === void 0 ? void 0 : _tabsData$.value),
20
+ value: value,
21
+ onValueChange: onValueChange,
22
+ orientation: orientation,
23
+ dir: dir,
24
+ activationMode: activationMode
15
25
  }, /*#__PURE__*/React.createElement(BaseTabsListContainer, null, /*#__PURE__*/React.createElement(BaseTabsList, {
16
26
  tabAlignment: tabAlignment,
17
27
  "aria-label": tabListAriaLabel
18
28
  }, tabsData.map(function (_ref2) {
19
- var value = _ref2.value,
29
+ var tabValue = _ref2.value,
20
30
  label = _ref2.label,
21
31
  disabled = _ref2.disabled;
22
32
  return /*#__PURE__*/React.createElement(Tab, {
23
- key: value,
24
- value: value,
33
+ key: tabValue,
34
+ value: tabValue,
25
35
  disabled: disabled
26
36
  }, label);
27
37
  })), additionalActions), tabsData.map(function (_ref3) {
28
- var value = _ref3.value,
38
+ var tabValue = _ref3.value,
29
39
  contentRenderer = _ref3.contentRenderer;
30
40
  return /*#__PURE__*/React.createElement(TabContent, {
31
- key: value,
32
- value: value
41
+ key: tabValue,
42
+ value: tabValue
33
43
  }, contentRenderer(tabsData));
34
44
  }));
35
45
  }
@@ -1,4 +1,4 @@
1
- import { Close } from "@vitality-ds/icons";
1
+ import { X } from "lucide-react";
2
2
  import React, { useContext } from "react";
3
3
  import Tooltip from "../../../Tooltip";
4
4
  import { ToastContext } from "../../ToastProvider";
@@ -11,9 +11,9 @@ function CloseIconButton(_ref) {
11
11
  }, /*#__PURE__*/React.createElement(BaseCloseIconButton, {
12
12
  type: type,
13
13
  onClick: onClose
14
- }, /*#__PURE__*/React.createElement(Close, {
15
- size: "sm",
16
- color: "inherit"
14
+ }, /*#__PURE__*/React.createElement(X, {
15
+ size: "1rem",
16
+ color: "currentColor"
17
17
  })));
18
18
  }
19
19
  export default CloseIconButton;
@@ -1,13 +1,13 @@
1
- import { Completed, Error, Info } from "@vitality-ds/icons";
1
+ import { CircleAlert, CircleCheck, Info } from "lucide-react";
2
2
  var TOAST_TYPES = {
3
3
  success: {
4
- icon: Completed
4
+ icon: CircleCheck
5
5
  },
6
6
  warning: {
7
- icon: Error
7
+ icon: CircleAlert
8
8
  },
9
9
  error: {
10
- icon: Error
10
+ icon: CircleAlert
11
11
  },
12
12
  info: {
13
13
  icon: Info
@@ -6,10 +6,8 @@ function getVariantsByColorScale(colorScale) {
6
6
  return {
7
7
  backgroundColor: getColorScaleValueByUseCase(colorScale, backgrounds.app),
8
8
  color: getColorScaleValueByUseCase(colorScale, text.hiContrast),
9
- svg: {
10
- path: {
11
- fill: getColorScaleValueByUseCase(colorScale, text.lowContrast)
12
- }
9
+ "svg.icon": {
10
+ color: getColorScaleValueByUseCase(colorScale, text.lowContrast)
13
11
  },
14
12
  borderColor: "".concat(getColorScaleValueByUseCase(colorScale, text.hiSaturation), " ").concat(getColorScaleValueByUseCase(colorScale, borders.uiElement), " ").concat(getColorScaleValueByUseCase(colorScale, borders.uiElement))
15
13
  };
@@ -15,7 +15,8 @@ function Toast(_ref) {
15
15
  return /*#__PURE__*/React.createElement(BaseToast, {
16
16
  type: type
17
17
  }, !hideIcon && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(IconComponent, {
18
- size: "sm"
18
+ size: "1rem",
19
+ className: "icon"
19
20
  })), /*#__PURE__*/React.createElement(BaseContent, null, title && /*#__PURE__*/React.createElement(Typography, {
20
21
  variant: "display200"
21
22
  }, title), message && /*#__PURE__*/React.createElement(Typography, null, message)), /*#__PURE__*/React.createElement(CloseIconButton, {
@@ -1,20 +1,20 @@
1
- import { Completed, Error, Info } from "@vitality-ds/icons";
1
+ import { CircleAlert, CircleCheck, Info } from "lucide-react";
2
2
  import { getIconFromType } from "./logic";
3
3
  describe("getIconFromType", function () {
4
4
  it("should return the icon for the success toast type", function () {
5
5
  var type = "success";
6
6
  var icon = getIconFromType(type);
7
- expect(icon).toEqual(Completed);
7
+ expect(icon).toEqual(CircleCheck);
8
8
  });
9
9
  it("should return the icon for the warning toast type", function () {
10
10
  var type = "warning";
11
11
  var icon = getIconFromType(type);
12
- expect(icon).toEqual(Error);
12
+ expect(icon).toEqual(CircleAlert);
13
13
  });
14
14
  it("should return the icon for the error toast type", function () {
15
15
  var type = "error";
16
16
  var icon = getIconFromType(type);
17
- expect(icon).toEqual(Error);
17
+ expect(icon).toEqual(CircleAlert);
18
18
  });
19
19
  it("should return the icon for the info toast type", function () {
20
20
  var type = "info";
@@ -11,6 +11,9 @@ export default css({
11
11
  boxSizing: "border-box",
12
12
  padding: "$md",
13
13
  gap: "$sm",
14
+ "svg.icon": {
15
+ verticalAlign: "middle"
16
+ },
14
17
  variants: {
15
18
  type: {
16
19
  success: getVariantsByColorScale("success"),
@@ -1,7 +1,5 @@
1
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
1
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
3
2
  import _extends from "@babel/runtime/helpers/extends";
4
- import { BaseIcon } from "@vitality-ds/icons";
5
3
  import { colorUseCases, css, getColorScaleValueByUseCase } from "@vitality-ds/system";
6
4
  import { AVAILABLE_MAX_LINES, AVAILABLE_VARIANTS } from "../constants/variants";
7
5
  import { getMaxLines, getMaxLinesVariants, getVariantStyles } from "./helpers";
@@ -9,137 +7,140 @@ var text = colorUseCases.text;
9
7
  var overflowSharedStyles = {
10
8
  overflow: "hidden"
11
9
  };
12
- export default css(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
10
+ export default css({
13
11
  fontFamily: "$default",
14
12
  fontSize: "inherit",
15
13
  // Reset browser default margins added to certain semantic HTML elements
16
- marginBlock: 0
17
- }, "& > ".concat(BaseIcon), {
18
- // Aligning Icons to text baseline = most Icons have 2px inner bottom spacing -> 2/24 * 2 = 0.2 rounded up
19
- marginTop: "-.2em"
20
- }), "variants", {
21
- /**
22
- * Set the text element's text alignment
23
- */
24
- textAlign: {
25
- start: {
26
- textAlign: "start"
27
- },
28
- end: {
29
- textAlign: "end"
30
- },
31
- left: {
32
- textAlign: "left"
33
- },
34
- right: {
35
- textAlign: "right"
36
- },
37
- center: {
38
- textAlign: "center"
39
- },
40
- justify: {
41
- textAlign: "justify"
42
- },
43
- matchParent: {
44
- textAlign: "match-parent"
45
- }
46
- },
47
- /**
48
- * Allows you to handle CSS text overflow behaviour
49
- */
50
- textOverflow: {
51
- ellipsis: _extends({}, overflowSharedStyles, {
52
- textOverflow: "ellipsis"
53
- }),
54
- clip: _extends({}, overflowSharedStyles, {
55
- textOverflow: "clip"
56
- })
57
- },
58
- /**
59
- * Allows you to handle CSS white space behaviour
60
- */
61
- wrap: {
62
- "true": _extends({}, overflowSharedStyles, {
63
- whiteSpace: "break-spaces"
64
- }),
65
- "false": _extends({}, overflowSharedStyles, {
66
- whiteSpace: "nowrap"
67
- })
14
+ marginBlock: 0,
15
+ "& > svg.lucide": {
16
+ verticalAlign: "baseline"
68
17
  },
69
- /**
70
- * Sets the color of the text.
71
- */
72
- color: {
73
- inherit: {
74
- color: "inherit"
75
- },
76
- hiContrast: {
77
- color: getColorScaleValueByUseCase("greyA", text.hiContrast)
78
- },
79
- primary: {
80
- color: getColorScaleValueByUseCase("primary", text.hiSaturation)
81
- },
82
- lowContrast: {
83
- color: getColorScaleValueByUseCase("greyA", text.lowContrast)
84
- },
85
- disabled: {
86
- color: getColorScaleValueByUseCase("greyA", text.disabled)
87
- },
88
- accent: {
89
- color: getColorScaleValueByUseCase("accent", text.hiSaturation)
90
- },
91
- info: {
92
- color: getColorScaleValueByUseCase("info", text.hiSaturation)
93
- },
94
- moderate: {
95
- color: getColorScaleValueByUseCase("yellow", text.hiSaturation)
96
- },
97
- critical: {
98
- color: getColorScaleValueByUseCase("critical", text.hiSaturation)
18
+ variants: {
19
+ /**
20
+ * Set the text element's text alignment
21
+ */
22
+ textAlign: {
23
+ start: {
24
+ textAlign: "start"
25
+ },
26
+ end: {
27
+ textAlign: "end"
28
+ },
29
+ left: {
30
+ textAlign: "left"
31
+ },
32
+ right: {
33
+ textAlign: "right"
34
+ },
35
+ center: {
36
+ textAlign: "center"
37
+ },
38
+ justify: {
39
+ textAlign: "justify"
40
+ },
41
+ matchParent: {
42
+ textAlign: "match-parent"
43
+ }
99
44
  },
100
- warning: {
101
- color: getColorScaleValueByUseCase("warning", text.hiSaturation)
45
+ /**
46
+ * Allows you to handle CSS text overflow behaviour
47
+ */
48
+ textOverflow: {
49
+ ellipsis: _extends({}, overflowSharedStyles, {
50
+ textOverflow: "ellipsis"
51
+ }),
52
+ clip: _extends({}, overflowSharedStyles, {
53
+ textOverflow: "clip"
54
+ })
55
+ },
56
+ /**
57
+ * Allows you to handle CSS white space behaviour
58
+ */
59
+ wrap: {
60
+ "true": _extends({}, overflowSharedStyles, {
61
+ whiteSpace: "break-spaces"
62
+ }),
63
+ "false": _extends({}, overflowSharedStyles, {
64
+ whiteSpace: "nowrap"
65
+ })
66
+ },
67
+ /**
68
+ * Sets the color of the text.
69
+ */
70
+ color: {
71
+ inherit: {
72
+ color: "inherit"
73
+ },
74
+ hiContrast: {
75
+ color: getColorScaleValueByUseCase("greyA", text.hiContrast)
76
+ },
77
+ primary: {
78
+ color: getColorScaleValueByUseCase("primary", text.hiSaturation)
79
+ },
80
+ lowContrast: {
81
+ color: getColorScaleValueByUseCase("greyA", text.lowContrast)
82
+ },
83
+ disabled: {
84
+ color: getColorScaleValueByUseCase("greyA", text.disabled)
85
+ },
86
+ accent: {
87
+ color: getColorScaleValueByUseCase("accent", text.hiSaturation)
88
+ },
89
+ info: {
90
+ color: getColorScaleValueByUseCase("info", text.hiSaturation)
91
+ },
92
+ moderate: {
93
+ color: getColorScaleValueByUseCase("yellow", text.hiSaturation)
94
+ },
95
+ critical: {
96
+ color: getColorScaleValueByUseCase("critical", text.hiSaturation)
97
+ },
98
+ warning: {
99
+ color: getColorScaleValueByUseCase("warning", text.hiSaturation)
100
+ },
101
+ success: {
102
+ color: getColorScaleValueByUseCase("success", text.hiSaturation)
103
+ }
102
104
  },
103
- success: {
104
- color: getColorScaleValueByUseCase("success", text.hiSaturation)
105
+ /**
106
+ * Customises the font size and weight to a pre-set option.
107
+ */
108
+ variant: {
109
+ inherit: getVariantStyles("inherit"),
110
+ caption: getVariantStyles("$caption"),
111
+ button: getVariantStyles("$button"),
112
+ body: getVariantStyles("$body"),
113
+ paragraph: _extends({}, getVariantStyles("$body"), {
114
+ "& + &": {
115
+ marginTop: "$md"
116
+ }
117
+ }),
118
+ sectionSubtitle: getVariantStyles("$sectionSubtitle"),
119
+ sectionTitle: getVariantStyles("$sectionTitle"),
120
+ pageTitle: getVariantStyles("$pageTitle"),
121
+ display100: getVariantStyles("$display100"),
122
+ display200: getVariantStyles("$display200"),
123
+ display300: getVariantStyles("$display300"),
124
+ display400: getVariantStyles("$display400"),
125
+ display500: getVariantStyles("$display500"),
126
+ display600: getVariantStyles("$display600"),
127
+ display700: getVariantStyles("$display700"),
128
+ display800: getVariantStyles("$display800"),
129
+ display900: getVariantStyles("$display900")
130
+ },
131
+ /**
132
+ * Sets a limit on the maximum number of lines to display.
133
+ */
134
+ maxLines: {
135
+ 1: getMaxLines(1, "$body"),
136
+ 2: getMaxLines(2, "$body"),
137
+ 3: getMaxLines(3, "$body")
105
138
  }
106
139
  },
107
- /**
108
- * Customises the font size and weight to a pre-set option.
109
- */
110
- variant: {
111
- inherit: getVariantStyles("inherit"),
112
- caption: getVariantStyles("$caption"),
113
- button: getVariantStyles("$button"),
114
- body: getVariantStyles("$body"),
115
- paragraph: _extends({}, getVariantStyles("$body"), {
116
- "& + &": {
117
- marginTop: "$md"
118
- }
119
- }),
120
- sectionSubtitle: getVariantStyles("$sectionSubtitle"),
121
- sectionTitle: getVariantStyles("$sectionTitle"),
122
- pageTitle: getVariantStyles("$pageTitle"),
123
- display100: getVariantStyles("$display100"),
124
- display200: getVariantStyles("$display200"),
125
- display300: getVariantStyles("$display300"),
126
- display400: getVariantStyles("$display400"),
127
- display500: getVariantStyles("$display500"),
128
- display600: getVariantStyles("$display600"),
129
- display700: getVariantStyles("$display700"),
130
- display800: getVariantStyles("$display800"),
131
- display900: getVariantStyles("$display900")
132
- },
133
- /**
134
- * Sets a limit on the maximum number of lines to display.
135
- */
136
- maxLines: {
137
- 1: getMaxLines(1, "$body"),
138
- 2: getMaxLines(2, "$body"),
139
- 3: getMaxLines(3, "$body")
140
+ compoundVariants: _toConsumableArray(getMaxLinesVariants(AVAILABLE_MAX_LINES, AVAILABLE_VARIANTS)),
141
+ "ul, ol": {
142
+ listStylePosition: "inside",
143
+ paddingInlineStart: 0,
144
+ marginBlock: "inherit"
140
145
  }
141
- }), "compoundVariants", _toConsumableArray(getMaxLinesVariants(AVAILABLE_MAX_LINES, AVAILABLE_VARIANTS))), "ul, ol", {
142
- listStylePosition: "inside",
143
- paddingInlineStart: 0,
144
- marginBlock: "inherit"
145
- }));
146
+ });
@@ -1,4 +1,4 @@
1
- import { Pdf } from "@vitality-ds/icons";
1
+ import { Paperclip } from "lucide-react";
2
2
  import React from "react";
3
3
  import IconButton from "../../IconButton";
4
4
  import getComponentFromLookup from "./get-component-from-lookup";
@@ -12,7 +12,7 @@ describe("getComponentFromLookup", function () {
12
12
  var trigger = {
13
13
  type: "iconButton",
14
14
  props: {
15
- icon: /*#__PURE__*/React.createElement(Pdf, null),
15
+ icon: /*#__PURE__*/React.createElement(Paperclip, null),
16
16
  tooltipContent: "Content"
17
17
  }
18
18
  };
@@ -26,7 +26,7 @@ describe("getComponentFromLookup", function () {
26
26
  var trigger = {
27
27
  type: "iconButton",
28
28
  props: {
29
- icon: /*#__PURE__*/React.createElement(Pdf, null),
29
+ icon: /*#__PURE__*/React.createElement(Paperclip, null),
30
30
  tooltipContent: "Content",
31
31
  disabled: true
32
32
  }
@@ -1,14 +1,24 @@
1
+ import { render } from "@testing-library/react";
2
+ import React from "react";
3
+
1
4
  /**
2
5
  * RTL doesn't let you search directly though a component because it only considers what is rendered. because of this we can either apply a test id 🤮
3
6
  * @param container
4
- * @param IconFunctionComponent
7
+ * @param IconComponent
5
8
  * @returns an array of all matching elements within that test container
6
9
  */
7
- var findSVGs = function findSVGs(container, IconFunctionComponent) {
8
- var pathChildren = IconFunctionComponent({}).props.children;
9
- if (Array.isArray(pathChildren)) {
10
- return container.querySelectorAll("path[d=\"".concat(pathChildren[0].props.d, "\"]"));
11
- }
12
- return container.querySelectorAll("path[d=\"".concat(pathChildren.props.d, "\"]"));
10
+ var findSVGs = function findSVGs(container, IconComponent) {
11
+ var probe = document.createElement("div");
12
+ document.body.appendChild(probe);
13
+ var _render = render(/*#__PURE__*/React.createElement(IconComponent), {
14
+ container: probe
15
+ }),
16
+ unmount = _render.unmount;
17
+ var firstPath = probe.querySelector("path");
18
+ var d = firstPath === null || firstPath === void 0 ? void 0 : firstPath.getAttribute("d");
19
+ unmount();
20
+ probe.remove();
21
+ if (!d) return container.querySelectorAll("path[data-no-match]");
22
+ return container.querySelectorAll("path[d=\"".concat(d, "\"]"));
13
23
  };
14
24
  export default findSVGs;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- var _icons = require("@vitality-ds/icons");
4
+ var _lucideReact = require("lucide-react");
5
5
  var _react = _interopRequireDefault(require("react"));
6
6
  var _IconButton = _interopRequireDefault(require("../../IconButton"));
7
7
  var _getComponentFromLookup = _interopRequireDefault(require("./get-component-from-lookup"));
@@ -15,7 +15,7 @@ describe("getComponentFromLookup", function () {
15
15
  var trigger = {
16
16
  type: "iconButton",
17
17
  props: {
18
- icon: /*#__PURE__*/_react["default"].createElement(_icons.Pdf, null),
18
+ icon: /*#__PURE__*/_react["default"].createElement(_lucideReact.Paperclip, null),
19
19
  tooltipContent: "Content"
20
20
  }
21
21
  };
@@ -29,7 +29,7 @@ describe("getComponentFromLookup", function () {
29
29
  var trigger = {
30
30
  type: "iconButton",
31
31
  props: {
32
- icon: /*#__PURE__*/_react["default"].createElement(_icons.Pdf, null),
32
+ icon: /*#__PURE__*/_react["default"].createElement(_lucideReact.Paperclip, null),
33
33
  tooltipContent: "Content",
34
34
  disabled: true
35
35
  }
@@ -1,20 +1,30 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
6
7
  exports["default"] = void 0;
8
+ var _react = require("@testing-library/react");
9
+ var _react2 = _interopRequireDefault(require("react"));
7
10
  /**
8
11
  * RTL doesn't let you search directly though a component because it only considers what is rendered. because of this we can either apply a test id 🤮
9
12
  * @param container
10
- * @param IconFunctionComponent
13
+ * @param IconComponent
11
14
  * @returns an array of all matching elements within that test container
12
15
  */
13
- var findSVGs = function findSVGs(container, IconFunctionComponent) {
14
- var pathChildren = IconFunctionComponent({}).props.children;
15
- if (Array.isArray(pathChildren)) {
16
- return container.querySelectorAll("path[d=\"".concat(pathChildren[0].props.d, "\"]"));
17
- }
18
- return container.querySelectorAll("path[d=\"".concat(pathChildren.props.d, "\"]"));
16
+ var findSVGs = function findSVGs(container, IconComponent) {
17
+ var probe = document.createElement("div");
18
+ document.body.appendChild(probe);
19
+ var _render = (0, _react.render)(/*#__PURE__*/_react2["default"].createElement(IconComponent), {
20
+ container: probe
21
+ }),
22
+ unmount = _render.unmount;
23
+ var firstPath = probe.querySelector("path");
24
+ var d = firstPath === null || firstPath === void 0 ? void 0 : firstPath.getAttribute("d");
25
+ unmount();
26
+ probe.remove();
27
+ if (!d) return container.querySelectorAll("path[data-no-match]");
28
+ return container.querySelectorAll("path[d=\"".concat(d, "\"]"));
19
29
  };
20
30
  var _default = exports["default"] = findSVGs;