@laerdal/life-react-components 1.7.0-dev.4 → 1.7.0-dev.6.full

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 (215) hide show
  1. package/dist/Accordion/ContentAccordion.cjs +1 -1
  2. package/dist/Accordion/ContentAccordion.cjs.map +1 -1
  3. package/dist/Accordion/ContentAccordion.js +2 -2
  4. package/dist/Accordion/ContentAccordion.js.map +1 -1
  5. package/dist/Accordion/styles.cjs +1 -1
  6. package/dist/Accordion/styles.cjs.map +1 -1
  7. package/dist/Accordion/styles.js +2 -2
  8. package/dist/Accordion/styles.js.map +1 -1
  9. package/dist/Banners/Banner.cjs +3 -3
  10. package/dist/Banners/Banner.cjs.map +1 -1
  11. package/dist/Banners/Banner.js +3 -3
  12. package/dist/Banners/Banner.js.map +1 -1
  13. package/dist/Banners/styles.cjs +1 -1
  14. package/dist/Banners/styles.cjs.map +1 -1
  15. package/dist/Banners/styles.js +1 -1
  16. package/dist/Banners/styles.js.map +1 -1
  17. package/dist/Button/BackButton.cjs +2 -2
  18. package/dist/Button/BackButton.cjs.map +1 -1
  19. package/dist/Button/BackButton.js +3 -3
  20. package/dist/Button/BackButton.js.map +1 -1
  21. package/dist/Button/Button.cjs +8 -21
  22. package/dist/Button/Button.cjs.map +1 -1
  23. package/dist/Button/Button.d.ts +1 -0
  24. package/dist/Button/Button.js +9 -22
  25. package/dist/Button/Button.js.map +1 -1
  26. package/dist/Button/Iconbutton.cjs +14 -27
  27. package/dist/Button/Iconbutton.cjs.map +1 -1
  28. package/dist/Button/Iconbutton.d.ts +2 -0
  29. package/dist/Button/Iconbutton.js +15 -28
  30. package/dist/Button/Iconbutton.js.map +1 -1
  31. package/dist/Card/Card.cjs +1 -1
  32. package/dist/Card/Card.cjs.map +1 -1
  33. package/dist/Card/Card.js +2 -2
  34. package/dist/Card/Card.js.map +1 -1
  35. package/dist/Chips/ChipStyles.cjs +2 -2
  36. package/dist/Chips/ChipStyles.cjs.map +1 -1
  37. package/dist/Chips/ChipStyles.js +3 -3
  38. package/dist/Chips/ChipStyles.js.map +1 -1
  39. package/dist/Dropdown/BasicDropdown.cjs +1 -0
  40. package/dist/Dropdown/BasicDropdown.cjs.map +1 -1
  41. package/dist/Dropdown/BasicDropdown.js +2 -1
  42. package/dist/Dropdown/BasicDropdown.js.map +1 -1
  43. package/dist/Dropdown/ChipDropdownInput.cjs +1 -1
  44. package/dist/Dropdown/ChipDropdownInput.cjs.map +1 -1
  45. package/dist/Dropdown/ChipDropdownInput.js +1 -1
  46. package/dist/Dropdown/ChipDropdownInput.js.map +1 -1
  47. package/dist/Dropdown/CommonStyling.cjs +7 -5
  48. package/dist/Dropdown/CommonStyling.cjs.map +1 -1
  49. package/dist/Dropdown/CommonStyling.js +7 -6
  50. package/dist/Dropdown/CommonStyling.js.map +1 -1
  51. package/dist/Dropdown/DropdownContent.cjs +3 -1
  52. package/dist/Dropdown/DropdownContent.cjs.map +1 -1
  53. package/dist/Dropdown/DropdownContent.js +3 -1
  54. package/dist/Dropdown/DropdownContent.js.map +1 -1
  55. package/dist/Footer/Components/FooterDropdownLinks.cjs +6 -3
  56. package/dist/Footer/Components/FooterDropdownLinks.cjs.map +1 -1
  57. package/dist/Footer/Components/FooterDropdownLinks.js +6 -4
  58. package/dist/Footer/Components/FooterDropdownLinks.js.map +1 -1
  59. package/dist/Footer/Components/FooterNewsletterAndSocialSection.cjs +5 -3
  60. package/dist/Footer/Components/FooterNewsletterAndSocialSection.cjs.map +1 -1
  61. package/dist/Footer/Components/FooterNewsletterAndSocialSection.js +5 -4
  62. package/dist/Footer/Components/FooterNewsletterAndSocialSection.js.map +1 -1
  63. package/dist/Footer/Components/FooterTop.cjs +2 -1
  64. package/dist/Footer/Components/FooterTop.cjs.map +1 -1
  65. package/dist/Footer/Components/FooterTop.js +3 -2
  66. package/dist/Footer/Components/FooterTop.js.map +1 -1
  67. package/dist/GlobalNavigationBar/Avatar.cjs +5 -7
  68. package/dist/GlobalNavigationBar/Avatar.cjs.map +1 -1
  69. package/dist/GlobalNavigationBar/Avatar.js +5 -8
  70. package/dist/GlobalNavigationBar/Avatar.js.map +1 -1
  71. package/dist/GlobalNavigationBar/Logo.cjs +9 -6
  72. package/dist/GlobalNavigationBar/Logo.cjs.map +1 -1
  73. package/dist/GlobalNavigationBar/Logo.d.ts +2 -1
  74. package/dist/GlobalNavigationBar/Logo.js +9 -7
  75. package/dist/GlobalNavigationBar/Logo.js.map +1 -1
  76. package/dist/GlobalNavigationBar/MainMenu.cjs +11 -13
  77. package/dist/GlobalNavigationBar/MainMenu.cjs.map +1 -1
  78. package/dist/GlobalNavigationBar/MainMenu.js +10 -13
  79. package/dist/GlobalNavigationBar/MainMenu.js.map +1 -1
  80. package/dist/GlobalNavigationBar/RightSideNav.cjs +3 -5
  81. package/dist/GlobalNavigationBar/RightSideNav.cjs.map +1 -1
  82. package/dist/GlobalNavigationBar/RightSideNav.js +2 -5
  83. package/dist/GlobalNavigationBar/RightSideNav.js.map +1 -1
  84. package/dist/GlobalNavigationBar/mobile/CommonStyles.cjs +1 -1
  85. package/dist/GlobalNavigationBar/mobile/CommonStyles.cjs.map +1 -1
  86. package/dist/GlobalNavigationBar/mobile/CommonStyles.js +2 -2
  87. package/dist/GlobalNavigationBar/mobile/CommonStyles.js.map +1 -1
  88. package/dist/GlobalNavigationBar/mobile/MobileMenu.cjs +1 -1
  89. package/dist/GlobalNavigationBar/mobile/MobileMenu.cjs.map +1 -1
  90. package/dist/GlobalNavigationBar/mobile/MobileMenu.js +2 -2
  91. package/dist/GlobalNavigationBar/mobile/MobileMenu.js.map +1 -1
  92. package/dist/HyperLink/styling.cjs +1 -1
  93. package/dist/HyperLink/styling.cjs.map +1 -1
  94. package/dist/HyperLink/styling.js +1 -1
  95. package/dist/HyperLink/styling.js.map +1 -1
  96. package/dist/InputFields/Checkbox.cjs +2 -2
  97. package/dist/InputFields/Checkbox.cjs.map +1 -1
  98. package/dist/InputFields/Checkbox.js +3 -3
  99. package/dist/InputFields/Checkbox.js.map +1 -1
  100. package/dist/InputFields/DatepickerField.cjs +4 -4
  101. package/dist/InputFields/DatepickerField.cjs.map +1 -1
  102. package/dist/InputFields/DatepickerField.js +5 -5
  103. package/dist/InputFields/DatepickerField.js.map +1 -1
  104. package/dist/InputFields/QuickSearch.cjs +119 -96
  105. package/dist/InputFields/QuickSearch.cjs.map +1 -1
  106. package/dist/InputFields/QuickSearch.js +119 -96
  107. package/dist/InputFields/QuickSearch.js.map +1 -1
  108. package/dist/InputFields/RadioButton.cjs +2 -2
  109. package/dist/InputFields/RadioButton.cjs.map +1 -1
  110. package/dist/InputFields/RadioButton.js +3 -3
  111. package/dist/InputFields/RadioButton.js.map +1 -1
  112. package/dist/InputFields/SearchBar.cjs +3 -3
  113. package/dist/InputFields/SearchBar.cjs.map +1 -1
  114. package/dist/InputFields/SearchBar.js +3 -3
  115. package/dist/InputFields/SearchBar.js.map +1 -1
  116. package/dist/InputFields/Textarea.cjs +1 -1
  117. package/dist/InputFields/Textarea.cjs.map +1 -1
  118. package/dist/InputFields/Textarea.js +1 -1
  119. package/dist/InputFields/Textarea.js.map +1 -1
  120. package/dist/InputFields/components/SearchBarInput.cjs +6 -8
  121. package/dist/InputFields/components/SearchBarInput.cjs.map +1 -1
  122. package/dist/InputFields/components/SearchBarInput.d.ts +0 -3
  123. package/dist/InputFields/components/SearchBarInput.js +4 -5
  124. package/dist/InputFields/components/SearchBarInput.js.map +1 -1
  125. package/dist/InputFields/components/SearchField.cjs +29 -19
  126. package/dist/InputFields/components/SearchField.cjs.map +1 -1
  127. package/dist/InputFields/components/SearchField.d.ts +8 -8
  128. package/dist/InputFields/components/SearchField.js +25 -18
  129. package/dist/InputFields/components/SearchField.js.map +1 -1
  130. package/dist/InputFields/styling.cjs +6 -8
  131. package/dist/InputFields/styling.cjs.map +1 -1
  132. package/dist/InputFields/styling.js +7 -8
  133. package/dist/InputFields/styling.js.map +1 -1
  134. package/dist/List/ListRow.cjs +5 -2
  135. package/dist/List/ListRow.cjs.map +1 -1
  136. package/dist/List/ListRow.js +5 -3
  137. package/dist/List/ListRow.js.map +1 -1
  138. package/dist/MenuItem/MenuItem.cjs +1 -0
  139. package/dist/MenuItem/MenuItem.cjs.map +1 -1
  140. package/dist/MenuItem/MenuItem.js +2 -1
  141. package/dist/MenuItem/MenuItem.js.map +1 -1
  142. package/dist/Modals/ModalContainer.cjs +12 -36
  143. package/dist/Modals/ModalContainer.cjs.map +1 -1
  144. package/dist/Modals/ModalContainer.d.ts +3 -8
  145. package/dist/Modals/ModalContainer.js +12 -37
  146. package/dist/Modals/ModalContainer.js.map +1 -1
  147. package/dist/Modals/ModalDialog.cjs +2 -2
  148. package/dist/Modals/ModalDialog.cjs.map +1 -1
  149. package/dist/Modals/ModalDialog.js +2 -2
  150. package/dist/Modals/ModalDialog.js.map +1 -1
  151. package/dist/NavItem/NavItem.cjs +1 -1
  152. package/dist/NavItem/NavItem.cjs.map +1 -1
  153. package/dist/NavItem/NavItem.js +2 -2
  154. package/dist/NavItem/NavItem.js.map +1 -1
  155. package/dist/Paginator/Paginator.cjs +1 -1
  156. package/dist/Paginator/Paginator.cjs.map +1 -1
  157. package/dist/Paginator/Paginator.js +2 -2
  158. package/dist/Paginator/Paginator.js.map +1 -1
  159. package/dist/QuizButton/QuizButton.cjs +4 -8
  160. package/dist/QuizButton/QuizButton.cjs.map +1 -1
  161. package/dist/QuizButton/QuizButton.js +5 -9
  162. package/dist/QuizButton/QuizButton.js.map +1 -1
  163. package/dist/SegmentControl/SegmentControl.cjs +1 -1
  164. package/dist/SegmentControl/SegmentControl.cjs.map +1 -1
  165. package/dist/SegmentControl/SegmentControl.js +2 -2
  166. package/dist/SegmentControl/SegmentControl.js.map +1 -1
  167. package/dist/Switcher/SwitcherMenuItem.cjs +1 -1
  168. package/dist/Switcher/SwitcherMenuItem.cjs.map +1 -1
  169. package/dist/Switcher/SwitcherMenuItem.js +2 -2
  170. package/dist/Switcher/SwitcherMenuItem.js.map +1 -1
  171. package/dist/Table/TableStyles.cjs +4 -4
  172. package/dist/Table/TableStyles.cjs.map +1 -1
  173. package/dist/Table/TableStyles.js +5 -5
  174. package/dist/Table/TableStyles.js.map +1 -1
  175. package/dist/Tabs/HorizontalTabs.cjs +1 -1
  176. package/dist/Tabs/HorizontalTabs.cjs.map +1 -1
  177. package/dist/Tabs/HorizontalTabs.js +2 -2
  178. package/dist/Tabs/HorizontalTabs.js.map +1 -1
  179. package/dist/Tabs/TabLink.cjs +5 -2
  180. package/dist/Tabs/TabLink.cjs.map +1 -1
  181. package/dist/Tabs/TabLink.js +5 -3
  182. package/dist/Tabs/TabLink.js.map +1 -1
  183. package/dist/Tabs/VerticalTabs.cjs.map +1 -1
  184. package/dist/Tabs/VerticalTabs.js.map +1 -1
  185. package/dist/Toasters/Toast.cjs +2 -0
  186. package/dist/Toasters/Toast.cjs.map +1 -1
  187. package/dist/Toasters/Toast.js +2 -0
  188. package/dist/Toasters/Toast.js.map +1 -1
  189. package/dist/Toggles/ToggleSwitch.cjs +8 -6
  190. package/dist/Toggles/ToggleSwitch.cjs.map +1 -1
  191. package/dist/Toggles/ToggleSwitch.js +8 -6
  192. package/dist/Toggles/ToggleSwitch.js.map +1 -1
  193. package/dist/Toggles/TogglerStyles.cjs +2 -2
  194. package/dist/Toggles/TogglerStyles.cjs.map +1 -1
  195. package/dist/Toggles/TogglerStyles.js +3 -3
  196. package/dist/Toggles/TogglerStyles.js.map +1 -1
  197. package/dist/common/FocusVisible.cjs +24 -1
  198. package/dist/common/FocusVisible.cjs.map +1 -1
  199. package/dist/common/FocusVisible.js +24 -1
  200. package/dist/common/FocusVisible.js.map +1 -1
  201. package/dist/common/InputStyling.cjs +1 -1
  202. package/dist/common/InputStyling.cjs.map +1 -1
  203. package/dist/common/InputStyling.js +2 -2
  204. package/dist/common/InputStyling.js.map +1 -1
  205. package/dist/styles/focus-styles.cjs +22 -0
  206. package/dist/styles/focus-styles.cjs.map +1 -0
  207. package/dist/styles/focus-styles.d.ts +2 -0
  208. package/dist/styles/focus-styles.js +9 -0
  209. package/dist/styles/focus-styles.js.map +1 -0
  210. package/dist/styles/index.cjs +60 -0
  211. package/dist/styles/index.cjs.map +1 -1
  212. package/dist/styles/index.d.ts +1 -0
  213. package/dist/styles/index.js +1 -0
  214. package/dist/styles/index.js.map +1 -1
  215. package/package.json +1 -1
@@ -43,7 +43,7 @@ var getBorderRadiusStyle = function getBorderRadiusStyle(props) {
43
43
  }
44
44
  };
45
45
 
46
- var StyledIconButton = _styledComponents.default.button(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n border-width: 0;\n cursor: pointer;\n height: 48px;\n width: 48px;\n background: transparent;\n\n display: ", ";\n ", " {\n display: block;\n }\n\n border-radius: ", ";\n div {\n height: 36px;\n width: 36px;\n border-radius: ", ";\n display: flex;\n justify-content: center;\n align-items: center;\n svg {\n height: ", ";\n width: ", ";\n padding: 0;\n }\n }\n &:only-child {\n margin: 0;\n }\n &:disabled {\n cursor: not-allowed;\n }\n &:focus:not(:disabled) {\n outline: none;\n div {\n outline: none;\n }\n }\n &:active:not(:disabled) {\n div {\n box-shadow: none !important;\n }\n }\n"])), function (props) {
46
+ var StyledIconButton = _styledComponents.default.button(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n border-width: 0;\n cursor: pointer;\n height: 48px;\n width: 48px;\n background: transparent;\n position: relative;\n\n display: ", ";\n ", " {\n display: block;\n }\n\n border-radius: ", ";\n div {\n height: 36px;\n width: 36px;\n border-radius: ", ";\n display: flex;\n justify-content: center;\n align-items: center;\n svg {\n height: ", ";\n width: ", ";\n padding: 0;\n }\n }\n &:only-child {\n margin: 0;\n }\n &:disabled {\n cursor: not-allowed;\n }\n\n &:focus {\n ", "\n }\n"])), function (props) {
47
47
  return props.hideOnLowWidth ? 'none' : 'block';
48
48
  }, _styles.BREAKPOINTS.MEDIUM, function (props) {
49
49
  return props.borderRadius ? "".concat(props.borderRadius, "px") : '4px';
@@ -51,27 +51,25 @@ var StyledIconButton = _styledComponents.default.button(_templateObject || (_tem
51
51
  return props.unsetIconSize ? 'unset' : '24px';
52
52
  }, function (props) {
53
53
  return props.unsetIconSize ? 'unset' : '24px';
54
+ }, function (props) {
55
+ return props.invertFocus ? _styles.invertedFocusStyles : _styles.focusStyles;
54
56
  });
55
57
 
56
- var StyledPrimaryIconButton = (0, _styledComponents.default)(StyledIconButton)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n div {\n background-color: ", ";\n\n svg {\n fill: ", ";\n path {\n fill: ", ";\n }\n }\n }\n &:focus:not(:disabled) {\n div {\n background-color: ", " !important;\n box-shadow: 0px 4px 12px rgba(46, 127, 161, 0.25), 0px 0px 8px #2e7fa1;\n }\n div svg path,\n div svg {\n fill: ", ";\n }\n }\n &:hover:not(:disabled) {\n div {\n background-color: ", ";\n }\n div svg path,\n div svg {\n fill: ", ";\n }\n }\n &:active:not(:disabled) {\n div {\n background: ", ";\n }\n div svg path,\n div svg {\n fill: ", ";\n }\n }\n &:disabled {\n div {\n background-color: ", ";\n }\n svg {\n path {\n fill: ", ";\n }\n fill: ", ";\n }\n }\n\n"])), function (props) {
58
+ var StyledPrimaryIconButton = (0, _styledComponents.default)(StyledIconButton)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n div {\n background-color: ", ";\n\n svg {\n fill: ", ";\n path {\n fill: ", ";\n }\n }\n }\n &:hover:not(:disabled) {\n div {\n background-color: ", ";\n }\n div svg path,\n div svg {\n fill: ", ";\n }\n }\n &:active:not(:disabled) {\n div {\n background: ", ";\n }\n div svg path,\n div svg {\n fill: ", ";\n }\n }\n &:disabled {\n div {\n background-color: ", ";\n }\n svg {\n path {\n fill: ", ";\n }\n fill: ", ";\n }\n }\n\n"])), function (props) {
57
59
  return props.useTransparentBackground ? 'transparent' : _styles.COLORS.primary_500;
58
60
  }, function (props) {
59
61
  return props.iconColor || _styles.COLORS.white;
60
62
  }, function (props) {
61
63
  return props.iconColor || _styles.COLORS.white;
62
- }, function (props) {
63
- return props.focusBackgroundColor || _styles.COLORS.primary_700;
64
- }, _styles.COLORS.white, _styles.COLORS.primary_700, _styles.COLORS.white, _styles.COLORS.primary_800, _styles.COLORS.white, _styles.COLORS.neutral_200, _styles.COLORS.white, _styles.COLORS.white);
64
+ }, _styles.COLORS.primary_700, _styles.COLORS.white, _styles.COLORS.primary_800, _styles.COLORS.white, _styles.COLORS.neutral_200, _styles.COLORS.white, _styles.COLORS.white);
65
65
  exports.StyledPrimaryIconButton = StyledPrimaryIconButton;
66
- var StyledSecondaryIconButton = (0, _styledComponents.default)(StyledIconButton)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n div {\n background-color: ", ";\n\n svg {\n fill: ", ";\n path {\n fill: ", ";\n }\n }\n }\n\n &:focus:not(:disabled) {\n div {\n background-color: ", ";\n box-shadow: 0px 0px 8px ", ", 0px 4px 12px rgba(46, 127, 161, 0.25);\n }\n div svg path,\n div svg {\n fill: ", ";\n }\n }\n \n &:hover:not(:disabled) {\n div {\n background-color: ", ";\n }\n div svg path,\n div svg {\n fill: ", ";\n }\n }\n &:active:not(:disabled) {\n div {\n background: ", ";\n }\n div svg path,\n div svg {\n fill: ", ";\n }\n }\n\n &:disabled {\n div {\n background-color: ", ";\n }\n svg {\n path {\n fill: ", ";\n }\n fill: ", ";\n }\n }\n\n"])), function (props) {
66
+ var StyledSecondaryIconButton = (0, _styledComponents.default)(StyledIconButton)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n div {\n background-color: ", ";\n\n svg {\n fill: ", ";\n path {\n fill: ", ";\n }\n }\n }\n \n &:hover:not(:disabled) {\n div {\n background-color: ", ";\n }\n div svg path,\n div svg {\n fill: ", ";\n }\n }\n &:active:not(:disabled) {\n div {\n background: ", ";\n }\n div svg path,\n div svg {\n fill: ", ";\n }\n }\n\n &:disabled {\n div {\n background-color: ", ";\n }\n svg {\n path {\n fill: ", ";\n }\n fill: ", ";\n }\n }\n\n"])), function (props) {
67
67
  return props.useTransparentBackground ? 'transparent' : _styles.COLORS.white;
68
68
  }, function (props) {
69
69
  return props.iconColor || _styles.COLORS.neutral_600;
70
70
  }, function (props) {
71
71
  return props.iconColor || _styles.COLORS.neutral_600;
72
- }, function (props) {
73
- return props.focusBackgroundColor || 'transparent';
74
- }, _styles.COLORS.primary_500, _styles.COLORS.neutral_600, _styles.COLORS.primary_20, _styles.COLORS.primary_700, _styles.COLORS.primary_100, _styles.COLORS.primary_800, function (props) {
72
+ }, _styles.COLORS.primary_20, _styles.COLORS.primary_700, _styles.COLORS.primary_100, _styles.COLORS.primary_800, function (props) {
75
73
  return props.useTransparentBackground ? 'transparent' : _styles.COLORS.white;
76
74
  }, _styles.COLORS.neutral_300, _styles.COLORS.neutral_300);
77
75
  exports.StyledSecondaryIconButton = StyledSecondaryIconButton;
@@ -95,18 +93,10 @@ var IconButton = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
95
93
  focusBackgroundColor = _ref.focusBackgroundColor,
96
94
  type = _ref.type,
97
95
  hidden = _ref.hidden,
98
- style = _ref.style;
99
-
100
- var isPressingEnterOrSpace = function isPressingEnterOrSpace(e) {
101
- if (e.key === 'Enter' || e.key === ' ') {
102
- e.stopPropagation();
103
- return true;
104
- }
105
-
106
- return false;
107
- }; // Let's render button
108
-
96
+ style = _ref.style,
97
+ invertFocus = _ref.invertFocus;
109
98
 
99
+ // Let's render button
110
100
  switch (variant) {
111
101
  case 'secondary':
112
102
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledSecondaryIconButton, {
@@ -118,9 +108,6 @@ var IconButton = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
118
108
  event.stopPropagation();
119
109
  action(event);
120
110
  },
121
- onKeyDown: function onKeyDown(e) {
122
- return isPressingEnterOrSpace(e) ? action() : null;
123
- },
124
111
  disabled: disabled,
125
112
  hideOnLowWidth: hideOnLowWidth || false,
126
113
  inMobileMenu: isInMobileMenu,
@@ -133,6 +120,7 @@ var IconButton = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
133
120
  onKeyPress: onKeyPress,
134
121
  hidden: hidden,
135
122
  style: style,
123
+ invertFocus: invertFocus,
136
124
  focusBackgroundColor: focusBackgroundColor,
137
125
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
138
126
  children: children
@@ -151,9 +139,6 @@ var IconButton = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
151
139
  event.stopPropagation();
152
140
  action(event);
153
141
  },
154
- onKeyDown: function onKeyDown(e) {
155
- return isPressingEnterOrSpace(e) ? action() : null;
156
- },
157
142
  disabled: disabled,
158
143
  hideOnLowWidth: hideOnLowWidth || false,
159
144
  inMobileMenu: isInMobileMenu,
@@ -166,6 +151,7 @@ var IconButton = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
166
151
  onKeyPress: onKeyPress,
167
152
  hidden: hidden,
168
153
  style: style,
154
+ invertFocus: invertFocus,
169
155
  focusBackgroundColor: focusBackgroundColor,
170
156
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
171
157
  children: children
@@ -190,7 +176,8 @@ IconButton.propTypes = {
190
176
  onKeyPress: _propTypes.default.func,
191
177
  focusBackgroundColor: _propTypes.default.string,
192
178
  children: _propTypes.default.node,
193
- hidden: _propTypes.default.bool
179
+ hidden: _propTypes.default.bool,
180
+ invertFocus: _propTypes.default.bool
194
181
  };
195
182
  var _default = IconButton;
196
183
  exports.default = _default;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Button/Iconbutton.tsx"],"names":["getBorderRadius","props","borderRadius","getBorderRadiusStyle","radius","flatEdge","StyledIconButton","styled","button","hideOnLowWidth","BREAKPOINTS","MEDIUM","unsetIconSize","StyledPrimaryIconButton","useTransparentBackground","COLORS","primary_500","iconColor","white","focusBackgroundColor","primary_700","primary_800","neutral_200","StyledSecondaryIconButton","neutral_600","primary_20","primary_100","neutral_300","IconButton","React","forwardRef","ref","id","variant","shape","action","isInMobileMenu","children","disabled","tabIndex","onKeyPress","type","hidden","style","isPressingEnterOrSpace","e","key","stopPropagation","event","defaultOnMouseDownHandler"],"mappings":";;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;;;;;AAcA,IAAMA,eAAe,GAAG,SAAlBA,eAAkB,CAACC,KAAD;AAAA,SAA4BA,KAAK,CAACC,YAAN,aAAwBD,KAAK,CAACC,YAA9B,UAAiD,KAA7E;AAAA,CAAxB;;AAEA,IAAMC,oBAAoB,GAAG,SAAvBA,oBAAuB,CAACF,KAAD,EAA2B;AACtD,MAAMG,MAAM,GAAGJ,eAAe,CAACC,KAAD,CAA9B;;AACA,UAAOA,KAAK,CAACI,QAAb;AAEI,SAAK,MAAL;AACI,2BAAcD,MAAd,cAAwBA,MAAxB;;AAEJ,SAAK,OAAL;AACI,uBAAUA,MAAV,sBAA4BA,MAA5B;;AAEJ,SAAK,MAAL;AACA;AACI,uBAAUA,MAAV;AAVR;AAYD,CAdD;;AAgBA,IAAME,gBAAgB,GAAGC,0BAAOC,MAAV,+vBAOT,UAACP,KAAD;AAAA,SAAYA,KAAK,CAACQ,cAAN,GAAuB,MAAvB,GAAgC,OAA5C;AAAA,CAPS,EAQlBC,oBAAYC,MARM,EAYH,UAACV,KAAD;AAAA,SAAYA,KAAK,CAACC,YAAN,aAAwBD,KAAK,CAACC,YAA9B,UAAiD,KAA7D;AAAA,CAZG,EAgBDC,oBAhBC,EAqBN,UAACF,KAAD;AAAA,SAAYA,KAAK,CAACW,aAAN,GAAsB,OAAtB,GAAgC,MAA5C;AAAA,CArBM,EAsBP,UAACX,KAAD;AAAA,SAAYA,KAAK,CAACW,aAAN,GAAsB,OAAtB,GAAgC,MAA5C;AAAA,CAtBO,CAAtB;;AA6CO,IAAMC,uBAAuB,GAAG,+BAAOP,gBAAP,CAAH,82BAEZ,UAACL,KAAD;AAAA,SAAYA,KAAK,CAACa,wBAAN,GAAiC,aAAjC,GAAiDC,eAAOC,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H,CAAD;AAAA,iBAAYD,sBAAsB,CAACC,CAAD,CAAtB,GAA4BV,MAAM,EAAlC,GAAuC,IAAnD;AAAA,SAPb;AAQE,QAAA,QAAQ,EAAEG,QARZ;AASE,QAAA,cAAc,EAAE7B,cAAc,IAAI,KATpC;AAUE,QAAA,YAAY,EAAE2B,cAVhB;AAWE,QAAA,wBAAwB,EAAEtB,wBAX5B;AAYE,QAAA,SAAS,EAAEG,SAZb;AAaE,QAAA,aAAa,EAAEL,aAbjB;AAcE,QAAA,QAAQ,EAAE2B,QAAQ,IAAI,CAdxB;AAeE,QAAA,YAAY,EAAErC,YAAY,IAAIgC,KAAK,KAAK,UAA1B,GAAuC,EAAvC,GAA4C,CAf5D;AAgBE,QAAA,WAAW,EAAEe,iCAhBf;AAiBE,QAAA,UAAU,EAAET,UAjBd;AAkBE,QAAA,MAAM,EAAEE,MAlBV;AAmBE,QAAA,KAAK,EAAEC,KAnBT;AAoBE,QAAA,oBAAoB,EAAExB,oBApBxB;AAAA,+BAqBE;AAAA,oBAAMkB;AAAN;AArBF,QADF;AA5BJ;AAsDD,CArFkB,CAAnB;;;AArBEL,EAAAA,E;AACAC,EAAAA,O,4BAAU,S,EAAY,W;AACtBC,EAAAA,K,4BAAQ,Q,EAAW,U;AACnBC,EAAAA,M;AACA1B,EAAAA,c;AAEA2B,EAAAA,c;AACAE,EAAAA,Q;AACAxB,EAAAA,wB;AACAG,EAAAA,S;AACAL,EAAAA,a;AACA2B,EAAAA,Q;AACArC,EAAAA,Y;AACAsC,EAAAA,U;AACArB,EAAAA,oB;AAEAkB,EAAAA,Q;AACAK,EAAAA,M;;eA2Fad,U","sourcesContent":["import React from 'react';\nimport styled, {css, CSSProperties} from 'styled-components';\n\nimport { BREAKPOINTS, COLORS } from '../styles';\nimport {defaultOnMouseDownHandler} from '../common';\n\ninterface HeaderItemProps {\n hideOnLowWidth: boolean;\n inMobileMenu?: boolean;\n useTransparentBackground?: boolean;\n iconColor?: string;\n unsetIconSize?: boolean;\n borderRadius?: number;\n shape?: string;\n flatEdge?: string;\n focusBackgroundColor?: string;\n}\n\nconst getBorderRadius = (props:HeaderItemProps) => (props.borderRadius ? `${props.borderRadius}px` : '4px');\n\nconst getBorderRadiusStyle = (props:HeaderItemProps) => {\n const radius = getBorderRadius(props);\n switch(props.flatEdge)\n {\n case 'left':\n return `0px ${radius} ${radius} 0px`;\n\n case 'right':\n return `${radius} 0px 0px ${radius}`;\n\n case 'none':\n default:\n return `${radius}`;\n }\n};\n\nconst StyledIconButton = styled.button<HeaderItemProps>`\n border-width: 0;\n cursor: pointer;\n height: 48px;\n width: 48px;\n background: transparent;\n\n display: ${(props) => (props.hideOnLowWidth ? 'none' : 'block')};\n ${BREAKPOINTS.MEDIUM} {\n display: block;\n }\n\n border-radius: ${(props) => (props.borderRadius ? `${props.borderRadius}px` : '4px')};\n div {\n height: 36px;\n width: 36px;\n border-radius: ${getBorderRadiusStyle};\n display: flex;\n justify-content: center;\n align-items: center;\n svg {\n height: ${(props) => (props.unsetIconSize ? 'unset' : '24px')};\n width: ${(props) => (props.unsetIconSize ? 'unset' : '24px')};\n padding: 0;\n }\n }\n &:only-child {\n margin: 0;\n }\n &:disabled {\n cursor: not-allowed;\n }\n &:focus:not(:disabled) {\n outline: none;\n div {\n outline: none;\n }\n }\n &:active:not(:disabled) {\n div {\n box-shadow: none !important;\n }\n }\n`;\n\nexport const StyledPrimaryIconButton = styled(StyledIconButton)`\n div {\n background-color: ${(props) => (props.useTransparentBackground ? 'transparent' : COLORS.primary_500)};\n\n svg {\n fill: ${(props) => props.iconColor || COLORS.white};\n path {\n fill: ${(props) => props.iconColor || COLORS.white};\n }\n }\n }\n &:focus:not(:disabled) {\n div {\n background-color: ${(props) => props.focusBackgroundColor || COLORS.primary_700} !important;\n box-shadow: 0px 4px 12px rgba(46, 127, 161, 0.25), 0px 0px 8px #2e7fa1;\n }\n div svg path,\n div svg {\n fill: ${COLORS.white};\n }\n }\n &:hover:not(:disabled) {\n div {\n background-color: ${COLORS.primary_700};\n }\n div svg path,\n div svg {\n fill: ${COLORS.white};\n }\n }\n &:active:not(:disabled) {\n div {\n background: ${COLORS.primary_800};\n }\n div svg path,\n div svg {\n fill: ${COLORS.white};\n }\n }\n &:disabled {\n div {\n background-color: ${COLORS.neutral_200};\n }\n svg {\n path {\n fill: ${COLORS.white};\n }\n fill: ${COLORS.white};\n }\n }\n\n`;\n\nexport const StyledSecondaryIconButton = styled(StyledIconButton)`\n div {\n background-color: ${(props) => (props.useTransparentBackground ? 'transparent' : COLORS.white)};\n\n svg {\n fill: ${(props) => props.iconColor || COLORS.neutral_600};\n path {\n fill: ${(props) => props.iconColor || COLORS.neutral_600};\n }\n }\n }\n\n &:focus:not(:disabled) {\n div {\n background-color: ${(props) => props.focusBackgroundColor || 'transparent'};\n box-shadow: 0px 0px 8px ${COLORS.primary_500}, 0px 4px 12px rgba(46, 127, 161, 0.25);\n }\n div svg path,\n div svg {\n fill: ${COLORS.neutral_600};\n }\n }\n \n &:hover:not(:disabled) {\n div {\n background-color: ${COLORS.primary_20};\n }\n div svg path,\n div svg {\n fill: ${COLORS.primary_700};\n }\n }\n &:active:not(:disabled) {\n div {\n background: ${COLORS.primary_100};\n }\n div svg path,\n div svg {\n fill: ${COLORS.primary_800};\n }\n }\n\n &:disabled {\n div {\n background-color: ${(props) => (props.useTransparentBackground ? 'transparent' : COLORS.white)};\n }\n svg {\n path {\n fill: ${COLORS.neutral_300};\n }\n fill: ${COLORS.neutral_300};\n }\n }\n\n`;\n\nexport interface IconButtonProps {\n id?: string;\n variant?: 'primary' | 'secondary';\n shape?: 'square' | 'circular';\n action: (event?: React.MouseEvent<HTMLButtonElement>) => void;\n hideOnLowWidth?: boolean;\n flatEdge?: 'right' | 'left' | 'none' | undefined;\n isInMobileMenu?: boolean;\n disabled?: boolean;\n useTransparentBackground?: boolean;\n iconColor?: string;\n unsetIconSize?: boolean;\n tabIndex?: number;\n borderRadius?: number;\n onKeyPress?: React.KeyboardEventHandler<HTMLButtonElement>;\n focusBackgroundColor?: string;\n type?: 'submit' | 'reset' | 'button' | undefined;\n children?: React.ReactNode;\n hidden?: boolean;\n style?: CSSProperties | undefined;\n}\n\nconst IconButton = React.forwardRef<HTMLButtonElement, IconButtonProps>(({\n id,\n variant,\n shape,\n action,\n hideOnLowWidth,\n isInMobileMenu,\n children,\n useTransparentBackground,\n disabled,\n iconColor,\n unsetIconSize,\n tabIndex,\n flatEdge,\n borderRadius,\n onKeyPress,\n focusBackgroundColor,\n type,\n hidden,\n style\n}: IconButtonProps, ref) => {\n\n const isPressingEnterOrSpace = (e: React.KeyboardEvent) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.stopPropagation();\n return true;\n }\n return false;\n };\n\n // Let's render button\n switch (variant) {\n case 'secondary':\n return (\n <StyledSecondaryIconButton\n id={id}\n type={type ?? 'button'}\n data-testid={id}\n ref={ref}\n onClick={(event: React.MouseEvent<HTMLButtonElement>) => {event.stopPropagation(); action(event);}}\n onKeyDown={(e: any) => isPressingEnterOrSpace(e) ? action() : null}\n disabled={disabled}\n hideOnLowWidth={hideOnLowWidth || false}\n inMobileMenu={isInMobileMenu}\n useTransparentBackground={useTransparentBackground}\n iconColor={iconColor}\n unsetIconSize={unsetIconSize}\n tabIndex={tabIndex || 0}\n borderRadius={borderRadius || shape === 'circular' ? 18 : 0}\n onMouseDown={defaultOnMouseDownHandler}\n onKeyPress={onKeyPress}\n hidden={hidden}\n style={style}\n focusBackgroundColor={focusBackgroundColor}>\n <div>{children}</div>\n </StyledSecondaryIconButton>\n );\n case 'primary':\n default:\n return (\n <StyledPrimaryIconButton\n id={id}\n type={type ?? 'button'}\n data-testid={id}\n flatEdge={flatEdge}\n ref={ref}\n onClick={(event: React.MouseEvent<HTMLButtonElement>) => {event.stopPropagation(); action(event);}}\n onKeyDown={(e: any) => isPressingEnterOrSpace(e) ? action() : null}\n disabled={disabled}\n hideOnLowWidth={hideOnLowWidth || false}\n inMobileMenu={isInMobileMenu}\n useTransparentBackground={useTransparentBackground}\n iconColor={iconColor}\n unsetIconSize={unsetIconSize}\n tabIndex={tabIndex || 0}\n borderRadius={borderRadius || shape === 'circular' ? 18 : 0}\n onMouseDown={defaultOnMouseDownHandler}\n onKeyPress={onKeyPress}\n hidden={hidden}\n style={style}\n focusBackgroundColor={focusBackgroundColor}>\n <div>{children}</div>\n </StyledPrimaryIconButton>\n );\n }\n});\n\nexport default IconButton;\n"],"file":"Iconbutton.cjs"}
1
+ {"version":3,"sources":["../../src/Button/Iconbutton.tsx"],"names":["getBorderRadius","props","borderRadius","getBorderRadiusStyle","radius","flatEdge","StyledIconButton","styled","button","hideOnLowWidth","BREAKPOINTS","MEDIUM","unsetIconSize","invertFocus","invertedFocusStyles","focusStyles","StyledPrimaryIconButton","useTransparentBackground","COLORS","primary_500","iconColor","white","primary_700","primary_800","neutral_200","StyledSecondaryIconButton","neutral_600","primary_20","primary_100","neutral_300","IconButton","React","forwardRef","ref","id","variant","shape","action","isInMobileMenu","children","disabled","tabIndex","onKeyPress","focusBackgroundColor","type","hidden","style","event","stopPropagation","defaultOnMouseDownHandler"],"mappings":";;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;;;;;AAeA,IAAMA,eAAe,GAAG,SAAlBA,eAAkB,CAACC,KAAD;AAAA,SAA4BA,KAAK,CAACC,YAAN,aAAwBD,KAAK,CAACC,YAA9B,UAAiD,KAA7E;AAAA,CAAxB;;AAEA,IAAMC,oBAAoB,GAAG,SAAvBA,oBAAuB,CAACF,KAAD,EAA2B;AACtD,MAAMG,MAAM,GAAGJ,eAAe,CAACC,KAAD,CAA9B;;AACA,UAAOA,KAAK,CAACI,QAAb;AAEI,SAAK,MAAL;AACI,2BAAcD,MAAd,cAAwBA,MAAxB;;AAEJ,SAAK,OAAL;AACI,uBAAUA,MAAV,sBAA4BA,MAA5B;;AAEJ,SAAK,MAAL;AACA;AACI,uBAAUA,MAAV;AAVR;AAYD,CAdD;;AAgBA,IAAME,gBAAgB,GAAGC,0BAAO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c,KAAD,EAAiD;AAACA,UAAAA,KAAK,CAACC,eAAN;AAAyBX,UAAAA,MAAM,CAACU,KAAD,CAAN;AAAe,SANrG;AAOE,QAAA,QAAQ,EAAEP,QAPZ;AAQE,QAAA,cAAc,EAAE/B,cAAc,IAAI,KARpC;AASE,QAAA,YAAY,EAAE6B,cAThB;AAUE,QAAA,wBAAwB,EAAErB,wBAV5B;AAWE,QAAA,SAAS,EAAEG,SAXb;AAYE,QAAA,aAAa,EAAER,aAZjB;AAaE,QAAA,QAAQ,EAAE6B,QAAQ,IAAI,CAbxB;AAcE,QAAA,YAAY,EAAEvC,YAAY,IAAIkC,KAAK,KAAK,UAA1B,GAAuC,EAAvC,GAA4C,CAd5D;AAeE,QAAA,WAAW,EAAEa,iCAff;AAgBE,QAAA,UAAU,EAAEP,UAhBd;AAiBE,QAAA,MAAM,EAAEG,MAjBV;AAkBE,QAAA,KAAK,EAAEC,KAlBT;AAmBE,QAAA,WAAW,EAAEjC,WAnBf;AAoBE,QAAA,oBAAoB,EAAE8B,oBApBxB;AAAA,+BAqBE;AAAA,oBAAMJ;AAAN;AArBF,QADF;AA5BJ;AAsDD,CA9EkB,CAAnB;;;AAtBEL,EAAAA,E;AACAC,EAAAA,O,4BAAU,S,EAAY,W;AACtBC,EAAAA,K,4BAAQ,Q,EAAW,U;AACnBC,EAAAA,M;AACA5B,EAAAA,c;AAEA6B,EAAAA,c;AACAE,EAAAA,Q;AACAvB,EAAAA,wB;AACAG,EAAAA,S;AACAR,EAAAA,a;AACA6B,EAAAA,Q;AACAvC,EAAAA,Y;AACAwC,EAAAA,U;AACAC,EAAAA,oB;AAEAJ,EAAAA,Q;AACAM,EAAAA,M;AAEAhC,EAAAA,W;;eAmFaiB,U","sourcesContent":["import React from 'react';\nimport styled, {css, CSSProperties} from 'styled-components';\n\nimport {BREAKPOINTS, COLORS, focusStyles, invertedFocusStyles} from '../styles';\nimport {defaultOnMouseDownHandler} from '../common';\n\ninterface HeaderItemProps {\n hideOnLowWidth: boolean;\n inMobileMenu?: boolean;\n useTransparentBackground?: boolean;\n iconColor?: string;\n unsetIconSize?: boolean;\n borderRadius?: number;\n shape?: string;\n flatEdge?: string;\n focusBackgroundColor?: string;\n invertFocus?: boolean;\n}\n\nconst getBorderRadius = (props:HeaderItemProps) => (props.borderRadius ? `${props.borderRadius}px` : '4px');\n\nconst getBorderRadiusStyle = (props:HeaderItemProps) => {\n const radius = getBorderRadius(props);\n switch(props.flatEdge)\n {\n case 'left':\n return `0px ${radius} ${radius} 0px`;\n\n case 'right':\n return `${radius} 0px 0px ${radius}`;\n\n case 'none':\n default:\n return `${radius}`;\n }\n};\n\nconst StyledIconButton = styled.button<HeaderItemProps>`\n border-width: 0;\n cursor: pointer;\n height: 48px;\n width: 48px;\n background: transparent;\n position: relative;\n\n display: ${(props) => (props.hideOnLowWidth ? 'none' : 'block')};\n ${BREAKPOINTS.MEDIUM} {\n display: block;\n }\n\n border-radius: ${(props) => (props.borderRadius ? `${props.borderRadius}px` : '4px')};\n div {\n height: 36px;\n width: 36px;\n border-radius: ${getBorderRadiusStyle};\n display: flex;\n justify-content: center;\n align-items: center;\n svg {\n height: ${(props) => (props.unsetIconSize ? 'unset' : '24px')};\n width: ${(props) => (props.unsetIconSize ? 'unset' : '24px')};\n padding: 0;\n }\n }\n &:only-child {\n margin: 0;\n }\n &:disabled {\n cursor: not-allowed;\n }\n\n &:focus {\n ${props => props.invertFocus ? invertedFocusStyles : focusStyles}\n }\n`;\n\nexport const StyledPrimaryIconButton = styled(StyledIconButton)`\n div {\n background-color: ${(props) => (props.useTransparentBackground ? 'transparent' : COLORS.primary_500)};\n\n svg {\n fill: ${(props) => props.iconColor || COLORS.white};\n path {\n fill: ${(props) => props.iconColor || COLORS.white};\n }\n }\n }\n &:hover:not(:disabled) {\n div {\n background-color: ${COLORS.primary_700};\n }\n div svg path,\n div svg {\n fill: ${COLORS.white};\n }\n }\n &:active:not(:disabled) {\n div {\n background: ${COLORS.primary_800};\n }\n div svg path,\n div svg {\n fill: ${COLORS.white};\n }\n }\n &:disabled {\n div {\n background-color: ${COLORS.neutral_200};\n }\n svg {\n path {\n fill: ${COLORS.white};\n }\n fill: ${COLORS.white};\n }\n }\n\n`;\n\nexport const StyledSecondaryIconButton = styled(StyledIconButton)`\n div {\n background-color: ${(props) => (props.useTransparentBackground ? 'transparent' : COLORS.white)};\n\n svg {\n fill: ${(props) => props.iconColor || COLORS.neutral_600};\n path {\n fill: ${(props) => props.iconColor || COLORS.neutral_600};\n }\n }\n }\n \n &:hover:not(:disabled) {\n div {\n background-color: ${COLORS.primary_20};\n }\n div svg path,\n div svg {\n fill: ${COLORS.primary_700};\n }\n }\n &:active:not(:disabled) {\n div {\n background: ${COLORS.primary_100};\n }\n div svg path,\n div svg {\n fill: ${COLORS.primary_800};\n }\n }\n\n &:disabled {\n div {\n background-color: ${(props) => (props.useTransparentBackground ? 'transparent' : COLORS.white)};\n }\n svg {\n path {\n fill: ${COLORS.neutral_300};\n }\n fill: ${COLORS.neutral_300};\n }\n }\n\n`;\n\nexport interface IconButtonProps {\n id?: string;\n variant?: 'primary' | 'secondary';\n shape?: 'square' | 'circular';\n action: (event?: React.MouseEvent<HTMLButtonElement>) => void;\n hideOnLowWidth?: boolean;\n flatEdge?: 'right' | 'left' | 'none' | undefined;\n isInMobileMenu?: boolean;\n disabled?: boolean;\n useTransparentBackground?: boolean;\n iconColor?: string;\n unsetIconSize?: boolean;\n tabIndex?: number;\n borderRadius?: number;\n onKeyPress?: React.KeyboardEventHandler<HTMLButtonElement>;\n focusBackgroundColor?: string;\n type?: 'submit' | 'reset' | 'button' | undefined;\n children?: React.ReactNode;\n hidden?: boolean;\n style?: CSSProperties | undefined;\n invertFocus?: boolean;\n}\n\nconst IconButton = React.forwardRef<HTMLButtonElement, IconButtonProps>(({\n id,\n variant,\n shape,\n action,\n hideOnLowWidth,\n isInMobileMenu,\n children,\n useTransparentBackground,\n disabled,\n iconColor,\n unsetIconSize,\n tabIndex,\n flatEdge,\n borderRadius,\n onKeyPress,\n focusBackgroundColor,\n type,\n hidden,\n style,\n invertFocus\n}: IconButtonProps, ref) => {\n\n // Let's render button\n switch (variant) {\n case 'secondary':\n return (\n <StyledSecondaryIconButton\n id={id}\n type={type ?? 'button'}\n data-testid={id}\n ref={ref}\n onClick={(event: React.MouseEvent<HTMLButtonElement>) => {event.stopPropagation(); action(event);}}\n disabled={disabled}\n hideOnLowWidth={hideOnLowWidth || false}\n inMobileMenu={isInMobileMenu}\n useTransparentBackground={useTransparentBackground}\n iconColor={iconColor}\n unsetIconSize={unsetIconSize}\n tabIndex={tabIndex || 0}\n borderRadius={borderRadius || shape === 'circular' ? 18 : 0}\n onMouseDown={defaultOnMouseDownHandler}\n onKeyPress={onKeyPress}\n hidden={hidden}\n style={style}\n invertFocus={invertFocus}\n focusBackgroundColor={focusBackgroundColor}>\n <div>{children}</div>\n </StyledSecondaryIconButton>\n );\n case 'primary':\n default:\n return (\n <StyledPrimaryIconButton\n id={id}\n type={type ?? 'button'}\n data-testid={id}\n flatEdge={flatEdge}\n ref={ref}\n onClick={(event: React.MouseEvent<HTMLButtonElement>) => {event.stopPropagation(); action(event);}}\n disabled={disabled}\n hideOnLowWidth={hideOnLowWidth || false}\n inMobileMenu={isInMobileMenu}\n useTransparentBackground={useTransparentBackground}\n iconColor={iconColor}\n unsetIconSize={unsetIconSize}\n tabIndex={tabIndex || 0}\n borderRadius={borderRadius || shape === 'circular' ? 18 : 0}\n onMouseDown={defaultOnMouseDownHandler}\n onKeyPress={onKeyPress}\n hidden={hidden}\n style={style}\n invertFocus={invertFocus}\n focusBackgroundColor={focusBackgroundColor}>\n <div>{children}</div>\n </StyledPrimaryIconButton>\n );\n }\n});\n\nexport default IconButton;\n"],"file":"Iconbutton.cjs"}
@@ -10,6 +10,7 @@ interface HeaderItemProps {
10
10
  shape?: string;
11
11
  flatEdge?: string;
12
12
  focusBackgroundColor?: string;
13
+ invertFocus?: boolean;
13
14
  }
14
15
  export declare const StyledPrimaryIconButton: import("styled-components").StyledComponent<"button", any, HeaderItemProps, never>;
15
16
  export declare const StyledSecondaryIconButton: import("styled-components").StyledComponent<"button", any, HeaderItemProps, never>;
@@ -33,6 +34,7 @@ export interface IconButtonProps {
33
34
  children?: React.ReactNode;
34
35
  hidden?: boolean;
35
36
  style?: CSSProperties | undefined;
37
+ invertFocus?: boolean;
36
38
  }
37
39
  declare const IconButton: React.ForwardRefExoticComponent<IconButtonProps & React.RefAttributes<HTMLButtonElement>>;
38
40
  export default IconButton;
@@ -5,7 +5,7 @@ var _templateObject, _templateObject2, _templateObject3;
5
5
 
6
6
  import React from 'react';
7
7
  import styled from 'styled-components';
8
- import { BREAKPOINTS, COLORS } from '../styles';
8
+ import { BREAKPOINTS, COLORS, focusStyles, invertedFocusStyles } from '../styles';
9
9
  import { defaultOnMouseDownHandler } from '../common';
10
10
  import { jsx as _jsx } from "react/jsx-runtime";
11
11
 
@@ -29,7 +29,7 @@ var getBorderRadiusStyle = function getBorderRadiusStyle(props) {
29
29
  }
30
30
  };
31
31
 
32
- var StyledIconButton = styled.button(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n border-width: 0;\n cursor: pointer;\n height: 48px;\n width: 48px;\n background: transparent;\n\n display: ", ";\n ", " {\n display: block;\n }\n\n border-radius: ", ";\n div {\n height: 36px;\n width: 36px;\n border-radius: ", ";\n display: flex;\n justify-content: center;\n align-items: center;\n svg {\n height: ", ";\n width: ", ";\n padding: 0;\n }\n }\n &:only-child {\n margin: 0;\n }\n &:disabled {\n cursor: not-allowed;\n }\n &:focus:not(:disabled) {\n outline: none;\n div {\n outline: none;\n }\n }\n &:active:not(:disabled) {\n div {\n box-shadow: none !important;\n }\n }\n"])), function (props) {
32
+ var StyledIconButton = styled.button(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n border-width: 0;\n cursor: pointer;\n height: 48px;\n width: 48px;\n background: transparent;\n position: relative;\n\n display: ", ";\n ", " {\n display: block;\n }\n\n border-radius: ", ";\n div {\n height: 36px;\n width: 36px;\n border-radius: ", ";\n display: flex;\n justify-content: center;\n align-items: center;\n svg {\n height: ", ";\n width: ", ";\n padding: 0;\n }\n }\n &:only-child {\n margin: 0;\n }\n &:disabled {\n cursor: not-allowed;\n }\n\n &:focus {\n ", "\n }\n"])), function (props) {
33
33
  return props.hideOnLowWidth ? 'none' : 'block';
34
34
  }, BREAKPOINTS.MEDIUM, function (props) {
35
35
  return props.borderRadius ? "".concat(props.borderRadius, "px") : '4px';
@@ -37,25 +37,23 @@ var StyledIconButton = styled.button(_templateObject || (_templateObject = _tagg
37
37
  return props.unsetIconSize ? 'unset' : '24px';
38
38
  }, function (props) {
39
39
  return props.unsetIconSize ? 'unset' : '24px';
40
+ }, function (props) {
41
+ return props.invertFocus ? invertedFocusStyles : focusStyles;
40
42
  });
41
- export var StyledPrimaryIconButton = styled(StyledIconButton)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n div {\n background-color: ", ";\n\n svg {\n fill: ", ";\n path {\n fill: ", ";\n }\n }\n }\n &:focus:not(:disabled) {\n div {\n background-color: ", " !important;\n box-shadow: 0px 4px 12px rgba(46, 127, 161, 0.25), 0px 0px 8px #2e7fa1;\n }\n div svg path,\n div svg {\n fill: ", ";\n }\n }\n &:hover:not(:disabled) {\n div {\n background-color: ", ";\n }\n div svg path,\n div svg {\n fill: ", ";\n }\n }\n &:active:not(:disabled) {\n div {\n background: ", ";\n }\n div svg path,\n div svg {\n fill: ", ";\n }\n }\n &:disabled {\n div {\n background-color: ", ";\n }\n svg {\n path {\n fill: ", ";\n }\n fill: ", ";\n }\n }\n\n"])), function (props) {
43
+ export var StyledPrimaryIconButton = styled(StyledIconButton)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n div {\n background-color: ", ";\n\n svg {\n fill: ", ";\n path {\n fill: ", ";\n }\n }\n }\n &:hover:not(:disabled) {\n div {\n background-color: ", ";\n }\n div svg path,\n div svg {\n fill: ", ";\n }\n }\n &:active:not(:disabled) {\n div {\n background: ", ";\n }\n div svg path,\n div svg {\n fill: ", ";\n }\n }\n &:disabled {\n div {\n background-color: ", ";\n }\n svg {\n path {\n fill: ", ";\n }\n fill: ", ";\n }\n }\n\n"])), function (props) {
42
44
  return props.useTransparentBackground ? 'transparent' : COLORS.primary_500;
43
45
  }, function (props) {
44
46
  return props.iconColor || COLORS.white;
45
47
  }, function (props) {
46
48
  return props.iconColor || COLORS.white;
47
- }, function (props) {
48
- return props.focusBackgroundColor || COLORS.primary_700;
49
- }, COLORS.white, COLORS.primary_700, COLORS.white, COLORS.primary_800, COLORS.white, COLORS.neutral_200, COLORS.white, COLORS.white);
50
- export var StyledSecondaryIconButton = styled(StyledIconButton)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n div {\n background-color: ", ";\n\n svg {\n fill: ", ";\n path {\n fill: ", ";\n }\n }\n }\n\n &:focus:not(:disabled) {\n div {\n background-color: ", ";\n box-shadow: 0px 0px 8px ", ", 0px 4px 12px rgba(46, 127, 161, 0.25);\n }\n div svg path,\n div svg {\n fill: ", ";\n }\n }\n \n &:hover:not(:disabled) {\n div {\n background-color: ", ";\n }\n div svg path,\n div svg {\n fill: ", ";\n }\n }\n &:active:not(:disabled) {\n div {\n background: ", ";\n }\n div svg path,\n div svg {\n fill: ", ";\n }\n }\n\n &:disabled {\n div {\n background-color: ", ";\n }\n svg {\n path {\n fill: ", ";\n }\n fill: ", ";\n }\n }\n\n"])), function (props) {
49
+ }, COLORS.primary_700, COLORS.white, COLORS.primary_800, COLORS.white, COLORS.neutral_200, COLORS.white, COLORS.white);
50
+ export var StyledSecondaryIconButton = styled(StyledIconButton)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n div {\n background-color: ", ";\n\n svg {\n fill: ", ";\n path {\n fill: ", ";\n }\n }\n }\n \n &:hover:not(:disabled) {\n div {\n background-color: ", ";\n }\n div svg path,\n div svg {\n fill: ", ";\n }\n }\n &:active:not(:disabled) {\n div {\n background: ", ";\n }\n div svg path,\n div svg {\n fill: ", ";\n }\n }\n\n &:disabled {\n div {\n background-color: ", ";\n }\n svg {\n path {\n fill: ", ";\n }\n fill: ", ";\n }\n }\n\n"])), function (props) {
51
51
  return props.useTransparentBackground ? 'transparent' : COLORS.white;
52
52
  }, function (props) {
53
53
  return props.iconColor || COLORS.neutral_600;
54
54
  }, function (props) {
55
55
  return props.iconColor || COLORS.neutral_600;
56
- }, function (props) {
57
- return props.focusBackgroundColor || 'transparent';
58
- }, COLORS.primary_500, COLORS.neutral_600, COLORS.primary_20, COLORS.primary_700, COLORS.primary_100, COLORS.primary_800, function (props) {
56
+ }, COLORS.primary_20, COLORS.primary_700, COLORS.primary_100, COLORS.primary_800, function (props) {
59
57
  return props.useTransparentBackground ? 'transparent' : COLORS.white;
60
58
  }, COLORS.neutral_300, COLORS.neutral_300);
61
59
  var IconButton = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
@@ -77,18 +75,10 @@ var IconButton = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
77
75
  focusBackgroundColor = _ref.focusBackgroundColor,
78
76
  type = _ref.type,
79
77
  hidden = _ref.hidden,
80
- style = _ref.style;
81
-
82
- var isPressingEnterOrSpace = function isPressingEnterOrSpace(e) {
83
- if (e.key === 'Enter' || e.key === ' ') {
84
- e.stopPropagation();
85
- return true;
86
- }
87
-
88
- return false;
89
- }; // Let's render button
90
-
78
+ style = _ref.style,
79
+ invertFocus = _ref.invertFocus;
91
80
 
81
+ // Let's render button
92
82
  switch (variant) {
93
83
  case 'secondary':
94
84
  return /*#__PURE__*/_jsx(StyledSecondaryIconButton, {
@@ -100,9 +90,6 @@ var IconButton = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
100
90
  event.stopPropagation();
101
91
  action(event);
102
92
  },
103
- onKeyDown: function onKeyDown(e) {
104
- return isPressingEnterOrSpace(e) ? action() : null;
105
- },
106
93
  disabled: disabled,
107
94
  hideOnLowWidth: hideOnLowWidth || false,
108
95
  inMobileMenu: isInMobileMenu,
@@ -115,6 +102,7 @@ var IconButton = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
115
102
  onKeyPress: onKeyPress,
116
103
  hidden: hidden,
117
104
  style: style,
105
+ invertFocus: invertFocus,
118
106
  focusBackgroundColor: focusBackgroundColor,
119
107
  children: /*#__PURE__*/_jsx("div", {
120
108
  children: children
@@ -133,9 +121,6 @@ var IconButton = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
133
121
  event.stopPropagation();
134
122
  action(event);
135
123
  },
136
- onKeyDown: function onKeyDown(e) {
137
- return isPressingEnterOrSpace(e) ? action() : null;
138
- },
139
124
  disabled: disabled,
140
125
  hideOnLowWidth: hideOnLowWidth || false,
141
126
  inMobileMenu: isInMobileMenu,
@@ -148,6 +133,7 @@ var IconButton = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
148
133
  onKeyPress: onKeyPress,
149
134
  hidden: hidden,
150
135
  style: style,
136
+ invertFocus: invertFocus,
151
137
  focusBackgroundColor: focusBackgroundColor,
152
138
  children: /*#__PURE__*/_jsx("div", {
153
139
  children: children
@@ -171,7 +157,8 @@ IconButton.propTypes = {
171
157
  onKeyPress: _pt.func,
172
158
  focusBackgroundColor: _pt.string,
173
159
  children: _pt.node,
174
- hidden: _pt.bool
160
+ hidden: _pt.bool,
161
+ invertFocus: _pt.bool
175
162
  };
176
163
  export default IconButton;
177
164
  //# sourceMappingURL=Iconbutton.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Button/Iconbutton.tsx"],"names":["React","styled","BREAKPOINTS","COLORS","defaultOnMouseDownHandler","getBorderRadius","props","borderRadius","getBorderRadiusStyle","radius","flatEdge","StyledIconButton","button","hideOnLowWidth","MEDIUM","unsetIconSize","StyledPrimaryIconButton","useTransparentBackground","primary_500","iconColor","white","focusBackgroundColor","primary_700","primary_800","neutral_200","StyledSecondaryIconButton","neutral_600","primary_20","primary_100","neutral_300","IconButton","forwardRef","ref","id","variant","shape","action","isInMobileMenu","children","disabled","tabIndex","onKeyPress","type","h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EAAAA,M;;AA2FF,eAAeb,UAAf","sourcesContent":["import React from 'react';\nimport styled, {css, CSSProperties} from 'styled-components';\n\nimport { BREAKPOINTS, COLORS } from '../styles';\nimport {defaultOnMouseDownHandler} from '../common';\n\ninterface HeaderItemProps {\n hideOnLowWidth: boolean;\n inMobileMenu?: boolean;\n useTransparentBackground?: boolean;\n iconColor?: string;\n unsetIconSize?: boolean;\n borderRadius?: number;\n shape?: string;\n flatEdge?: string;\n focusBackgroundColor?: string;\n}\n\nconst getBorderRadius = (props:HeaderItemProps) => (props.borderRadius ? `${props.borderRadius}px` : '4px');\n\nconst getBorderRadiusStyle = (props:HeaderItemProps) => {\n const radius = getBorderRadius(props);\n switch(props.flatEdge)\n {\n case 'left':\n return `0px ${radius} ${radius} 0px`;\n\n case 'right':\n return `${radius} 0px 0px ${radius}`;\n\n case 'none':\n default:\n return `${radius}`;\n }\n};\n\nconst StyledIconButton = styled.button<HeaderItemProps>`\n border-width: 0;\n cursor: pointer;\n height: 48px;\n width: 48px;\n background: transparent;\n\n display: ${(props) => (props.hideOnLowWidth ? 'none' : 'block')};\n ${BREAKPOINTS.MEDIUM} {\n display: block;\n }\n\n border-radius: ${(props) => (props.borderRadius ? `${props.borderRadius}px` : '4px')};\n div {\n height: 36px;\n width: 36px;\n border-radius: ${getBorderRadiusStyle};\n display: flex;\n justify-content: center;\n align-items: center;\n svg {\n height: ${(props) => (props.unsetIconSize ? 'unset' : '24px')};\n width: ${(props) => (props.unsetIconSize ? 'unset' : '24px')};\n padding: 0;\n }\n }\n &:only-child {\n margin: 0;\n }\n &:disabled {\n cursor: not-allowed;\n }\n &:focus:not(:disabled) {\n outline: none;\n div {\n outline: none;\n }\n }\n &:active:not(:disabled) {\n div {\n box-shadow: none !important;\n }\n }\n`;\n\nexport const StyledPrimaryIconButton = styled(StyledIconButton)`\n div {\n background-color: ${(props) => (props.useTransparentBackground ? 'transparent' : COLORS.primary_500)};\n\n svg {\n fill: ${(props) => props.iconColor || COLORS.white};\n path {\n fill: ${(props) => props.iconColor || COLORS.white};\n }\n }\n }\n &:focus:not(:disabled) {\n div {\n background-color: ${(props) => props.focusBackgroundColor || COLORS.primary_700} !important;\n box-shadow: 0px 4px 12px rgba(46, 127, 161, 0.25), 0px 0px 8px #2e7fa1;\n }\n div svg path,\n div svg {\n fill: ${COLORS.white};\n }\n }\n &:hover:not(:disabled) {\n div {\n background-color: ${COLORS.primary_700};\n }\n div svg path,\n div svg {\n fill: ${COLORS.white};\n }\n }\n &:active:not(:disabled) {\n div {\n background: ${COLORS.primary_800};\n }\n div svg path,\n div svg {\n fill: ${COLORS.white};\n }\n }\n &:disabled {\n div {\n background-color: ${COLORS.neutral_200};\n }\n svg {\n path {\n fill: ${COLORS.white};\n }\n fill: ${COLORS.white};\n }\n }\n\n`;\n\nexport const StyledSecondaryIconButton = styled(StyledIconButton)`\n div {\n background-color: ${(props) => (props.useTransparentBackground ? 'transparent' : COLORS.white)};\n\n svg {\n fill: ${(props) => props.iconColor || COLORS.neutral_600};\n path {\n fill: ${(props) => props.iconColor || COLORS.neutral_600};\n }\n }\n }\n\n &:focus:not(:disabled) {\n div {\n background-color: ${(props) => props.focusBackgroundColor || 'transparent'};\n box-shadow: 0px 0px 8px ${COLORS.primary_500}, 0px 4px 12px rgba(46, 127, 161, 0.25);\n }\n div svg path,\n div svg {\n fill: ${COLORS.neutral_600};\n }\n }\n \n &:hover:not(:disabled) {\n div {\n background-color: ${COLORS.primary_20};\n }\n div svg path,\n div svg {\n fill: ${COLORS.primary_700};\n }\n }\n &:active:not(:disabled) {\n div {\n background: ${COLORS.primary_100};\n }\n div svg path,\n div svg {\n fill: ${COLORS.primary_800};\n }\n }\n\n &:disabled {\n div {\n background-color: ${(props) => (props.useTransparentBackground ? 'transparent' : COLORS.white)};\n }\n svg {\n path {\n fill: ${COLORS.neutral_300};\n }\n fill: ${COLORS.neutral_300};\n }\n }\n\n`;\n\nexport interface IconButtonProps {\n id?: string;\n variant?: 'primary' | 'secondary';\n shape?: 'square' | 'circular';\n action: (event?: React.MouseEvent<HTMLButtonElement>) => void;\n hideOnLowWidth?: boolean;\n flatEdge?: 'right' | 'left' | 'none' | undefined;\n isInMobileMenu?: boolean;\n disabled?: boolean;\n useTransparentBackground?: boolean;\n iconColor?: string;\n unsetIconSize?: boolean;\n tabIndex?: number;\n borderRadius?: number;\n onKeyPress?: React.KeyboardEventHandler<HTMLButtonElement>;\n focusBackgroundColor?: string;\n type?: 'submit' | 'reset' | 'button' | undefined;\n children?: React.ReactNode;\n hidden?: boolean;\n style?: CSSProperties | undefined;\n}\n\nconst IconButton = React.forwardRef<HTMLButtonElement, IconButtonProps>(({\n id,\n variant,\n shape,\n action,\n hideOnLowWidth,\n isInMobileMenu,\n children,\n useTransparentBackground,\n disabled,\n iconColor,\n unsetIconSize,\n tabIndex,\n flatEdge,\n borderRadius,\n onKeyPress,\n focusBackgroundColor,\n type,\n hidden,\n style\n}: IconButtonProps, ref) => {\n\n const isPressingEnterOrSpace = (e: React.KeyboardEvent) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.stopPropagation();\n return true;\n }\n return false;\n };\n\n // Let's render button\n switch (variant) {\n case 'secondary':\n return (\n <StyledSecondaryIconButton\n id={id}\n type={type ?? 'button'}\n data-testid={id}\n ref={ref}\n onClick={(event: React.MouseEvent<HTMLButtonElement>) => {event.stopPropagation(); action(event);}}\n onKeyDown={(e: any) => isPressingEnterOrSpace(e) ? action() : null}\n disabled={disabled}\n hideOnLowWidth={hideOnLowWidth || false}\n inMobileMenu={isInMobileMenu}\n useTransparentBackground={useTransparentBackground}\n iconColor={iconColor}\n unsetIconSize={unsetIconSize}\n tabIndex={tabIndex || 0}\n borderRadius={borderRadius || shape === 'circular' ? 18 : 0}\n onMouseDown={defaultOnMouseDownHandler}\n onKeyPress={onKeyPress}\n hidden={hidden}\n style={style}\n focusBackgroundColor={focusBackgroundColor}>\n <div>{children}</div>\n </StyledSecondaryIconButton>\n );\n case 'primary':\n default:\n return (\n <StyledPrimaryIconButton\n id={id}\n type={type ?? 'button'}\n data-testid={id}\n flatEdge={flatEdge}\n ref={ref}\n onClick={(event: React.MouseEvent<HTMLButtonElement>) => {event.stopPropagation(); action(event);}}\n onKeyDown={(e: any) => isPressingEnterOrSpace(e) ? action() : null}\n disabled={disabled}\n hideOnLowWidth={hideOnLowWidth || false}\n inMobileMenu={isInMobileMenu}\n useTransparentBackground={useTransparentBackground}\n iconColor={iconColor}\n unsetIconSize={unsetIconSize}\n tabIndex={tabIndex || 0}\n borderRadius={borderRadius || shape === 'circular' ? 18 : 0}\n onMouseDown={defaultOnMouseDownHandler}\n onKeyPress={onKeyPress}\n hidden={hidden}\n style={style}\n focusBackgroundColor={focusBackgroundColor}>\n <div>{children}</div>\n </StyledPrimaryIconButton>\n );\n }\n});\n\nexport default IconButton;\n"],"file":"Iconbutton.js"}
1
+ {"version":3,"sources":["../../src/Button/Iconbutton.tsx"],"names":["React","styled","BREAKPOINTS","COLORS","focusStyles","invertedFocusStyles","defaultOnMouseDownHandler","getBorderRadius","props","borderRadius","getBorderRadiusStyle","radius","flatEdge","StyledIconButton","button","hideOnLowWidth","MEDIUM","unsetIconSize","invertFocus","StyledPrimaryIconButton","useTransparentBackground","primary_500","iconColor","white","primary_700","primary_800","neutral_200","StyledSecondaryIconButton","neutral_600","primary_20","primary_100","neutral_300","IconButton","forwardRef","ref","id","variant","shape","action","isInMobileMenu","children","disabled","tabIndex","onKeyPress","focusBackgroundColor","type","hidden","style","event","stopPropagation"],"mappings":";;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,MAAP,MAAyC,mBAAzC;AAEA,SAAQC,WAAR,EAAqBC,MAArB,EAA6BC,WAA7B,EAA0CC,mBAA1C,QAAoE,WAApE;AACA,SAAQC,yBAAR,QAAwC,WAAxC;;;AAeA,IAAMC,eAAe,GAAG,SAAlBA,eAAkB,CAACC,KAAD;AAAA,SAA4BA,KAAK,CAACC,YAAN,aAAwBD,KAAK,CAACC,YAA9B,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J;AAAN;AArBF,QADF;AA5BJ;AAsDD,CA9EkB,CAAnB;;AAtBEL,EAAAA,E;AACAC,EAAAA,O,aAAU,S,EAAY,W;AACtBC,EAAAA,K,aAAQ,Q,EAAW,U;AACnBC,EAAAA,M;AACAvB,EAAAA,c;AAEAwB,EAAAA,c;AACAE,EAAAA,Q;AACArB,EAAAA,wB;AACAE,EAAAA,S;AACAL,EAAAA,a;AACAyB,EAAAA,Q;AACAjC,EAAAA,Y;AACAkC,EAAAA,U;AACAC,EAAAA,oB;AAEAJ,EAAAA,Q;AACAM,EAAAA,M;AAEA5B,EAAAA,W;;AAmFF,eAAec,UAAf","sourcesContent":["import React from 'react';\nimport styled, {css, CSSProperties} from 'styled-components';\n\nimport {BREAKPOINTS, COLORS, focusStyles, invertedFocusStyles} from '../styles';\nimport {defaultOnMouseDownHandler} from '../common';\n\ninterface HeaderItemProps {\n hideOnLowWidth: boolean;\n inMobileMenu?: boolean;\n useTransparentBackground?: boolean;\n iconColor?: string;\n unsetIconSize?: boolean;\n borderRadius?: number;\n shape?: string;\n flatEdge?: string;\n focusBackgroundColor?: string;\n invertFocus?: boolean;\n}\n\nconst getBorderRadius = (props:HeaderItemProps) => (props.borderRadius ? `${props.borderRadius}px` : '4px');\n\nconst getBorderRadiusStyle = (props:HeaderItemProps) => {\n const radius = getBorderRadius(props);\n switch(props.flatEdge)\n {\n case 'left':\n return `0px ${radius} ${radius} 0px`;\n\n case 'right':\n return `${radius} 0px 0px ${radius}`;\n\n case 'none':\n default:\n return `${radius}`;\n }\n};\n\nconst StyledIconButton = styled.button<HeaderItemProps>`\n border-width: 0;\n cursor: pointer;\n height: 48px;\n width: 48px;\n background: transparent;\n position: relative;\n\n display: ${(props) => (props.hideOnLowWidth ? 'none' : 'block')};\n ${BREAKPOINTS.MEDIUM} {\n display: block;\n }\n\n border-radius: ${(props) => (props.borderRadius ? `${props.borderRadius}px` : '4px')};\n div {\n height: 36px;\n width: 36px;\n border-radius: ${getBorderRadiusStyle};\n display: flex;\n justify-content: center;\n align-items: center;\n svg {\n height: ${(props) => (props.unsetIconSize ? 'unset' : '24px')};\n width: ${(props) => (props.unsetIconSize ? 'unset' : '24px')};\n padding: 0;\n }\n }\n &:only-child {\n margin: 0;\n }\n &:disabled {\n cursor: not-allowed;\n }\n\n &:focus {\n ${props => props.invertFocus ? invertedFocusStyles : focusStyles}\n }\n`;\n\nexport const StyledPrimaryIconButton = styled(StyledIconButton)`\n div {\n background-color: ${(props) => (props.useTransparentBackground ? 'transparent' : COLORS.primary_500)};\n\n svg {\n fill: ${(props) => props.iconColor || COLORS.white};\n path {\n fill: ${(props) => props.iconColor || COLORS.white};\n }\n }\n }\n &:hover:not(:disabled) {\n div {\n background-color: ${COLORS.primary_700};\n }\n div svg path,\n div svg {\n fill: ${COLORS.white};\n }\n }\n &:active:not(:disabled) {\n div {\n background: ${COLORS.primary_800};\n }\n div svg path,\n div svg {\n fill: ${COLORS.white};\n }\n }\n &:disabled {\n div {\n background-color: ${COLORS.neutral_200};\n }\n svg {\n path {\n fill: ${COLORS.white};\n }\n fill: ${COLORS.white};\n }\n }\n\n`;\n\nexport const StyledSecondaryIconButton = styled(StyledIconButton)`\n div {\n background-color: ${(props) => (props.useTransparentBackground ? 'transparent' : COLORS.white)};\n\n svg {\n fill: ${(props) => props.iconColor || COLORS.neutral_600};\n path {\n fill: ${(props) => props.iconColor || COLORS.neutral_600};\n }\n }\n }\n \n &:hover:not(:disabled) {\n div {\n background-color: ${COLORS.primary_20};\n }\n div svg path,\n div svg {\n fill: ${COLORS.primary_700};\n }\n }\n &:active:not(:disabled) {\n div {\n background: ${COLORS.primary_100};\n }\n div svg path,\n div svg {\n fill: ${COLORS.primary_800};\n }\n }\n\n &:disabled {\n div {\n background-color: ${(props) => (props.useTransparentBackground ? 'transparent' : COLORS.white)};\n }\n svg {\n path {\n fill: ${COLORS.neutral_300};\n }\n fill: ${COLORS.neutral_300};\n }\n }\n\n`;\n\nexport interface IconButtonProps {\n id?: string;\n variant?: 'primary' | 'secondary';\n shape?: 'square' | 'circular';\n action: (event?: React.MouseEvent<HTMLButtonElement>) => void;\n hideOnLowWidth?: boolean;\n flatEdge?: 'right' | 'left' | 'none' | undefined;\n isInMobileMenu?: boolean;\n disabled?: boolean;\n useTransparentBackground?: boolean;\n iconColor?: string;\n unsetIconSize?: boolean;\n tabIndex?: number;\n borderRadius?: number;\n onKeyPress?: React.KeyboardEventHandler<HTMLButtonElement>;\n focusBackgroundColor?: string;\n type?: 'submit' | 'reset' | 'button' | undefined;\n children?: React.ReactNode;\n hidden?: boolean;\n style?: CSSProperties | undefined;\n invertFocus?: boolean;\n}\n\nconst IconButton = React.forwardRef<HTMLButtonElement, IconButtonProps>(({\n id,\n variant,\n shape,\n action,\n hideOnLowWidth,\n isInMobileMenu,\n children,\n useTransparentBackground,\n disabled,\n iconColor,\n unsetIconSize,\n tabIndex,\n flatEdge,\n borderRadius,\n onKeyPress,\n focusBackgroundColor,\n type,\n hidden,\n style,\n invertFocus\n}: IconButtonProps, ref) => {\n\n // Let's render button\n switch (variant) {\n case 'secondary':\n return (\n <StyledSecondaryIconButton\n id={id}\n type={type ?? 'button'}\n data-testid={id}\n ref={ref}\n onClick={(event: React.MouseEvent<HTMLButtonElement>) => {event.stopPropagation(); action(event);}}\n disabled={disabled}\n hideOnLowWidth={hideOnLowWidth || false}\n inMobileMenu={isInMobileMenu}\n useTransparentBackground={useTransparentBackground}\n iconColor={iconColor}\n unsetIconSize={unsetIconSize}\n tabIndex={tabIndex || 0}\n borderRadius={borderRadius || shape === 'circular' ? 18 : 0}\n onMouseDown={defaultOnMouseDownHandler}\n onKeyPress={onKeyPress}\n hidden={hidden}\n style={style}\n invertFocus={invertFocus}\n focusBackgroundColor={focusBackgroundColor}>\n <div>{children}</div>\n </StyledSecondaryIconButton>\n );\n case 'primary':\n default:\n return (\n <StyledPrimaryIconButton\n id={id}\n type={type ?? 'button'}\n data-testid={id}\n flatEdge={flatEdge}\n ref={ref}\n onClick={(event: React.MouseEvent<HTMLButtonElement>) => {event.stopPropagation(); action(event);}}\n disabled={disabled}\n hideOnLowWidth={hideOnLowWidth || false}\n inMobileMenu={isInMobileMenu}\n useTransparentBackground={useTransparentBackground}\n iconColor={iconColor}\n unsetIconSize={unsetIconSize}\n tabIndex={tabIndex || 0}\n borderRadius={borderRadius || shape === 'circular' ? 18 : 0}\n onMouseDown={defaultOnMouseDownHandler}\n onKeyPress={onKeyPress}\n hidden={hidden}\n style={style}\n invertFocus={invertFocus}\n focusBackgroundColor={focusBackgroundColor}>\n <div>{children}</div>\n </StyledPrimaryIconButton>\n );\n }\n});\n\nexport default IconButton;\n"],"file":"Iconbutton.js"}
@@ -40,7 +40,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
40
40
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
41
41
 
42
42
  var CardTopLevelContainer = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n background-color: ", ";\n\n box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.15);\n border-radius: 8px;\n\n border: 1px solid transparent;\n background-clip: padding-box;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n\n ", "\n"])), _.COLORS.white, function (props) {
43
- return props.interactionType == InteractionType.Clickable && !props.disabled ? "\n\n &:active, &.active-state {\n box-shadow: 0px 8px 16px 2px rgba(0, 0, 0, 0.15);\n border: 1px solid ".concat(_.COLORS.neutral_200, ";\n }\n\n &:hover:focus, &:hover {\n outline: none;\n overflow: visible;\n border-width: 0px;\n border: 1px solid ").concat(_.COLORS.neutral_200, ";\n box-shadow: 0px 8px 16px 2px rgba(0, 0, 0, 0.15);\n }\n \n &:focus, &.focus-state {\n border-width: 0px;\n border: 1px solid ").concat(_.COLORS.neutral_200, ";\n outline: none;\n overflow: hidden;\n box-shadow: 0px 4px 12px 2px rgba(46, 127, 161, 0.25), 0px 0px 8px 2px #2E7FA1;\n }") : "";
43
+ return props.interactionType == InteractionType.Clickable && !props.disabled ? "\n\n &:active, &.active-state {\n box-shadow: 0px 8px 16px 2px rgba(0, 0, 0, 0.15);\n border: 1px solid ".concat(_.COLORS.neutral_200, ";\n }\n\n &:hover:focus, &:hover {\n outline: none;\n overflow: visible;\n border-width: 0px;\n border: 1px solid ").concat(_.COLORS.neutral_200, ";\n box-shadow: 0px 8px 16px 2px rgba(0, 0, 0, 0.15);\n }\n \n &:focus, &.focus-state {\n ").concat(_.focusStyles, "\n }") : "";
44
44
  });
45
45
 
46
46
  exports.CardTopLevelContainer = CardTopLevelContainer;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Card/Card.tsx"],"names":["CardTopLevelContainer","styled","div","COLORS","white","props","interactionType","InteractionType","Clickable","disabled","neutral_200","Card","None","onCardClicked","topSectionProps","middleSectionProps","bottomSectionProps","rootRef","React","useRef","onCardClick","current","blur"],"mappings":";;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;AAEO,IAAMA,qBAAqB,GAAGC,0BAAOC,GAAV,iVACZC,SAAOC,KADK,EAY9B,UAAAC,KAAK;AAAA,SACLA,KAAK,CAACC,eAAN,IAAyBC,eAAe,CAACC,SAAzC,IAAsD,CAACH,KAAK,CAACI,QAA7D,kIAKsBN,SAAOO,WAL7B,yJAYsBP,SAAOO,WAZ7B,sKAkBsBP,SAAOO,WAlB7B,wJADK;AAAA,CAZyB,CAA3B;;;IAuCKH,e;;;WAAAA,e;AAAAA,EAAAA,e,CAAAA,e;AAAAA,EAAAA,e,CAAAA,e;AAAAA,EAAAA,e,CAAAA,e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HzB;AAAA,IADF;AAOD,CAxBD;;;AAREA,EAAAA,e;AACAO,EAAAA,a;AACAJ,EAAAA,Q;;eAgCaE,I","sourcesContent":["import * as React from 'react';\nimport styled from 'styled-components';\nimport CardTopSection, { CardTopSectionProps } from './CardTopSection';\nimport CardMiddleSection, { CardMiddleSectionProps } from './CardMiddleSection';\nimport CardBottomSection, { CardBottomSectionProps } from './CardBottomSection';\nimport { COLORS, CommonInteractionStyling } from '..';\n\nexport const CardTopLevelContainer = styled.div<{ interactionType: InteractionType; disabled: boolean; }>`\n background-color: ${COLORS.white};\n\n box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.15);\n border-radius: 8px;\n\n border: 1px solid transparent;\n background-clip: padding-box;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n\n ${props =>\n props.interactionType == InteractionType.Clickable && !props.disabled\n ? `\n\n &:active, &.active-state {\n box-shadow: 0px 8px 16px 2px rgba(0, 0, 0, 0.15);\n border: 1px solid ${COLORS.neutral_200};\n }\n\n &:hover:focus, &:hover {\n outline: none;\n overflow: visible;\n border-width: 0px;\n border: 1px solid ${COLORS.neutral_200};\n box-shadow: 0px 8px 16px 2px rgba(0, 0, 0, 0.15);\n }\n \n &:focus, &.focus-state {\n border-width: 0px;\n border: 1px solid ${COLORS.neutral_200};\n outline: none;\n overflow: hidden;\n box-shadow: 0px 4px 12px 2px rgba(46, 127, 161, 0.25), 0px 0px 8px 2px #2E7FA1;\n }`\n : ``}\n`;\n\nexport enum InteractionType {\n None,\n Clickable,\n Selectable,\n}\n\nexport interface CardProps {\n interactionType: InteractionType;\n onCardClicked: () => {};\n disabled: boolean;\n topSectionProps?: CardTopSectionProps;\n middleSectionProps?: CardMiddleSectionProps;\n bottomSectionProps?: CardBottomSectionProps;\n}\n\nconst Card: React.FunctionComponent<CardProps> = ({\n interactionType = InteractionType.None,\n onCardClicked,\n topSectionProps,\n middleSectionProps,\n bottomSectionProps,\n disabled\n}: CardProps) => {\n const rootRef = React.useRef<HTMLDivElement>(null);\n\n const onCardClick = () => {\n if (interactionType == InteractionType.Clickable) {\n if(onCardClicked) onCardClicked();\n rootRef.current?.blur();\n }\n };\n\n return (\n <CardTopLevelContainer disabled={disabled} ref={rootRef} tabIndex={interactionType == InteractionType.Clickable && !disabled ? 0 : -1} interactionType={interactionType} onClick={onCardClick}>\n {topSectionProps && <CardTopSection {...topSectionProps} disabled={disabled} interactionType={interactionType} />}\n {middleSectionProps && <CardMiddleSection {...middleSectionProps} disabled={disabled} interactionType={interactionType} />}\n {bottomSectionProps && <CardBottomSection {...bottomSectionProps} disabled={disabled} interactionType={interactionType} />}\n </CardTopLevelContainer>\n );\n};\n\nexport default Card;\n"],"file":"Card.cjs"}
1
+ {"version":3,"sources":["../../src/Card/Card.tsx"],"names":["CardTopLevelContainer","styled","div","COLORS","white","props","interactionType","InteractionType","Clickable","disabled","neutral_200","focusStyles","Card","None","onCardClicked","topSectionProps","middleSectionProps","bottomSectionProps","rootRef","React","useRef","onCardClick","current","blur"],"mappings":";;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;AAEO,IAAMA,qBAAqB,GAAGC,0BAAOC,GAAV,iVACZC,SAAOC,KADK,EAY9B,UAAAC,KAAK;AAAA,SACLA,KAAK,CAACC,eAAN,IAAyBC,eAAe,CAACC,SAAzC,IAAsD,CAACH,KAAK,CAACI,QAA7D,kIAKsBN,SAAOO,WAL7B,yJAYsBP,SAAOO,WAZ7B,4HAiBMC,aAjBN,iBADK;AAAA,CAZyB,CAA3B;;;IAmCKJ,e;;;WAAAA,e;AAAAA,EAAAA,e,CAAAA,e;AAAAA,EAAAA,e,CAAAA,e;AAAAA,EAAAA,e,CAAAA,e;GAAAA,e,+BAAAA,e;;AAeZ,IAAMK,IAAwC,GAAG,SAA3CA,IAA2C,OAOhC;AAAA,kCANfN,eAMe;AAAA,MANfA,eAMe,qCANGC,eAAe,CAACM,IAMnB;AAAA,MALfC,aAKe,QALfA,aAKe;AAAA,MAJfC,eAIe,QAJfA,eAIe;AAAA,MAHfC,kBAGe,QAHfA,kBAGe;AAAA,MAFfC,kBAEe,QAFfA,kBAEe;AAAA,MADfR,QACe,QADfA,QACe;AACf,MAAMS,OAAO,GAAGC,KAAK,CAACC,MAAN,CAA6B,IAA7B,CAAhB;;AAEA,MAAMC,WAAW,GAAG,SAAdA,WAAc,GAAM;AACxB,QAAIf,eAAe,IAAIC,eAAe,CAACC,SAAvC,EAAkD;AAAA;;AAChD,UAAGM,aAAH,EAAkBA,aAAa;AAC/B,0BAAAI,OAAO,CAACI,OAAR,sEAAiBC,IAAjB;AACD;AACF,GALD;;AAOA,sBACE,sBAAC,qBAAD;AAAuB,IAAA,QAAQ,EAAEd,QAAjC;AAA2C,IAAA,GAAG,EAAES,OAAhD;AAAyD,IAAA,QAAQ,EAAEZ,eAAe,IAAIC,eAAe,CAACC,SAAnC,IAAgD,CAACC,QAAjD,GAA4D,CAA5D,GAAgE,CAAC,CAApI;AAAuI,IAAA,eAAe,EAAEH,eAAxJ;AAAyK,IAAA,OAAO,EAAEe,WAAlL;AAAA,eACGN,eAAe,iBAAI,qBAAC,uBAAD,kCAAoBA,eAApB;AAAqC,MAAA,QAAQ,EAAEN,QAA/C;AAAyD,MAAA,eAAe,EAAEH;AAA1E,OADtB,EAEGU,kBAAkB,iBAAI,qBAAC,0BAAD,kCAAuBA,kBAAvB;AAA2C,MAAA,QAAQ,EAAEP,QAArD;AAA+D,MAAA,eAAe,EAAEH;AAAhF,OAFzB,EAGGW,kBAAkB,iBAAI,qBAAC,0BAAD,kCAAuBA,kBAAvB;AAA2C,MAAA,QAAQ,EAAER,QAArD;AAA+D,MAAA,eAAe,EAAEH;AAAhF,OAHzB;AAAA,IADF;AAOD,CAxBD;;;AAREA,EAAAA,e;AACAQ,EAAAA,a;AACAL,EAAAA,Q;;eAgCaG,I","sourcesContent":["import * as React from 'react';\nimport styled from 'styled-components';\nimport CardTopSection, { CardTopSectionProps } from './CardTopSection';\nimport CardMiddleSection, { CardMiddleSectionProps } from './CardMiddleSection';\nimport CardBottomSection, { CardBottomSectionProps } from './CardBottomSection';\nimport {COLORS, CommonInteractionStyling, focusStyles} from '..';\n\nexport const CardTopLevelContainer = styled.div<{ interactionType: InteractionType; disabled: boolean; }>`\n background-color: ${COLORS.white};\n\n box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.15);\n border-radius: 8px;\n\n border: 1px solid transparent;\n background-clip: padding-box;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n\n ${props =>\n props.interactionType == InteractionType.Clickable && !props.disabled\n ? `\n\n &:active, &.active-state {\n box-shadow: 0px 8px 16px 2px rgba(0, 0, 0, 0.15);\n border: 1px solid ${COLORS.neutral_200};\n }\n\n &:hover:focus, &:hover {\n outline: none;\n overflow: visible;\n border-width: 0px;\n border: 1px solid ${COLORS.neutral_200};\n box-shadow: 0px 8px 16px 2px rgba(0, 0, 0, 0.15);\n }\n \n &:focus, &.focus-state {\n ${focusStyles}\n }`\n : ``}\n`;\n\nexport enum InteractionType {\n None,\n Clickable,\n Selectable,\n}\n\nexport interface CardProps {\n interactionType: InteractionType;\n onCardClicked: () => {};\n disabled: boolean;\n topSectionProps?: CardTopSectionProps;\n middleSectionProps?: CardMiddleSectionProps;\n bottomSectionProps?: CardBottomSectionProps;\n}\n\nconst Card: React.FunctionComponent<CardProps> = ({\n interactionType = InteractionType.None,\n onCardClicked,\n topSectionProps,\n middleSectionProps,\n bottomSectionProps,\n disabled\n}: CardProps) => {\n const rootRef = React.useRef<HTMLDivElement>(null);\n\n const onCardClick = () => {\n if (interactionType == InteractionType.Clickable) {\n if(onCardClicked) onCardClicked();\n rootRef.current?.blur();\n }\n };\n\n return (\n <CardTopLevelContainer disabled={disabled} ref={rootRef} tabIndex={interactionType == InteractionType.Clickable && !disabled ? 0 : -1} interactionType={interactionType} onClick={onCardClick}>\n {topSectionProps && <CardTopSection {...topSectionProps} disabled={disabled} interactionType={interactionType} />}\n {middleSectionProps && <CardMiddleSection {...middleSectionProps} disabled={disabled} interactionType={interactionType} />}\n {bottomSectionProps && <CardBottomSection {...bottomSectionProps} disabled={disabled} interactionType={interactionType} />}\n </CardTopLevelContainer>\n );\n};\n\nexport default Card;\n"],"file":"Card.cjs"}
package/dist/Card/Card.js CHANGED
@@ -13,11 +13,11 @@ import styled from 'styled-components';
13
13
  import CardTopSection from './CardTopSection';
14
14
  import CardMiddleSection from './CardMiddleSection';
15
15
  import CardBottomSection from './CardBottomSection';
16
- import { COLORS } from '..';
16
+ import { COLORS, focusStyles } from '..';
17
17
  import { jsx as _jsx } from "react/jsx-runtime";
18
18
  import { jsxs as _jsxs } from "react/jsx-runtime";
19
19
  export var CardTopLevelContainer = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n background-color: ", ";\n\n box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.15);\n border-radius: 8px;\n\n border: 1px solid transparent;\n background-clip: padding-box;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n\n ", "\n"])), COLORS.white, function (props) {
20
- return props.interactionType == InteractionType.Clickable && !props.disabled ? "\n\n &:active, &.active-state {\n box-shadow: 0px 8px 16px 2px rgba(0, 0, 0, 0.15);\n border: 1px solid ".concat(COLORS.neutral_200, ";\n }\n\n &:hover:focus, &:hover {\n outline: none;\n overflow: visible;\n border-width: 0px;\n border: 1px solid ").concat(COLORS.neutral_200, ";\n box-shadow: 0px 8px 16px 2px rgba(0, 0, 0, 0.15);\n }\n \n &:focus, &.focus-state {\n border-width: 0px;\n border: 1px solid ").concat(COLORS.neutral_200, ";\n outline: none;\n overflow: hidden;\n box-shadow: 0px 4px 12px 2px rgba(46, 127, 161, 0.25), 0px 0px 8px 2px #2E7FA1;\n }") : "";
20
+ return props.interactionType == InteractionType.Clickable && !props.disabled ? "\n\n &:active, &.active-state {\n box-shadow: 0px 8px 16px 2px rgba(0, 0, 0, 0.15);\n border: 1px solid ".concat(COLORS.neutral_200, ";\n }\n\n &:hover:focus, &:hover {\n outline: none;\n overflow: visible;\n border-width: 0px;\n border: 1px solid ").concat(COLORS.neutral_200, ";\n box-shadow: 0px 8px 16px 2px rgba(0, 0, 0, 0.15);\n }\n \n &:focus, &.focus-state {\n ").concat(focusStyles, "\n }") : "";
21
21
  });
22
22
  export var InteractionType;
23
23
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Card/Card.tsx"],"names":["React","styled","CardTopSection","CardMiddleSection","CardBottomSection","COLORS","CardTopLevelContainer","div","white","props","interactionType","InteractionType","Clickable","disabled","neutral_200","Card","None","onCardClicked","topSectionProps","middleSectionProps","bottomSectionProps","rootRef","useRef","onCardClick","current","blur"],"mappings":";;;;;;;;;;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,cAAP,MAAoD,kBAApD;AACA,OAAOC,iBAAP,MAA0D,qBAA1D;AACA,OAAOC,iBAAP,MAA0D,qBAA1D;AACA,SAASC,MAAT,QAAiD,IAAjD;;;AAEA,OAAO,IAAMC,qBAAqB,GAAGL,MAAM,CAACM,GAAV,mUACZF,MAAM,CAACG,KADK,EAY9B,UAAAC,KAAK;AAAA,SACLA,KAAK,CAACC,eAAN,IAAyBC,eAAe,CAACC,SAAzC,IAAsD,CAACH,KAAK,CAACI,QAA7D,kIAKsBR,MAAM,CAACS,WAL7B,yJAYsBT,MAAM,CAACS,WAZ7B,sKAkBsBT,MAAM,CAACS,WAlB7B,wJADK;AAAA,CAZyB,CAA3B;AAuCP,WAAYH,eAAZ;;WAAYA,e;AAAAA,EAAAA,e,CAAAA,e;AAAAA,EAAAA,e,CAAAA,e;AAAAA,EAAAA,e,CAAAA,e;GAAAA,e,KAAAA,e;;AAeZ,IAAMI,IAAwC,GAAG,SAA3CA,IAA2C,OAOhC;AAAA,kCANfL,eAMe;AAAA,MANfA,eAMe,qCANGC,eAAe,CAACK,IAMnB;AAAA,MALfC,aAKe,QALfA,aAKe;AAAA,MAJfC,eAIe,QAJfA,eAIe;AAAA,MAHfC,kBAGe,QAHfA,kBAGe;AAAA,MAFfC,kBAEe,QAFfA,kBAEe;AAAA,MADfP,QACe,QADfA,QACe;AACf,MAAMQ,OAAO,GAAGrB,KAAK,CAACsB,MAAN,CAA6B,IAA7B,CAAhB;;AAEA,MAAMC,WAAW,GAAG,SAAdA,WAAc,GAAM;AACxB,QAAIb,eAAe,IAAIC,eAAe,CAACC,SAAvC,EAAkD;AAAA;;AAChD,UAAGK,aAAH,EAAkBA,aAAa;AAC/B,0BAAAI,OAAO,CAACG,OAAR,sEAAiBC,IAAjB;AACD;AACF,GALD;;AAOA,sBACE,MAAC,qBAAD;AAAuB,IAAA,QAAQ,EAAEZ,QAAjC;AAA2C,IAAA,GAAG,EAAEQ,OAAhD;AAAyD,IAAA,QAAQ,EAAEX,eAAe,IAAIC,eAAe,CAACC,SAAnC,IAAgD,CAACC,QAAjD,GAA4D,CAA5D,GAAgE,CAAC,CAApI;AAAuI,IAAA,eAAe,EAAEH,eAAxJ;AAAyK,IAAA,OAAO,EAAEa,WAAlL;AAAA,eACGL,eAAe,iBAAI,KAAC,cAAD,kCAAoBA,eAApB;AAAqC,MAAA,QAAQ,EAAEL,QAA/C;AAAyD,MAAA,eAAe,EAAEH;AAA1E,OADtB,EAEGS,kBAAkB,iBAAI,KAAC,iBAAD,kCAAuBA,kBAAvB;AAA2C,MAAA,QAAQ,EAAEN,QAArD;AAA+D,MAAA,eAAe,EAAEH;AAAhF,OAFzB,EAGGU,kBAAkB,iBAAI,KAAC,iBAAD,kCAAuBA,kBAAvB;AAA2C,MAAA,QAAQ,EAAEP,QAArD;AAA+D,MAAA,eAAe,EAAEH;AAAhF,OAHzB;AAAA,IADF;AAOD,CAxBD;;;AAREA,EAAAA,e;AACAO,EAAAA,a;AACAJ,EAAAA,Q;;AAgCF,eAAeE,IAAf","sourcesContent":["import * as React from 'react';\nimport styled from 'styled-components';\nimport CardTopSection, { CardTopSectionProps } from './CardTopSection';\nimport CardMiddleSection, { CardMiddleSectionProps } from './CardMiddleSection';\nimport CardBottomSection, { CardBottomSectionProps } from './CardBottomSection';\nimport { COLORS, CommonInteractionStyling } from '..';\n\nexport const CardTopLevelContainer = styled.div<{ interactionType: InteractionType; disabled: boolean; }>`\n background-color: ${COLORS.white};\n\n box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.15);\n border-radius: 8px;\n\n border: 1px solid transparent;\n background-clip: padding-box;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n\n ${props =>\n props.interactionType == InteractionType.Clickable && !props.disabled\n ? `\n\n &:active, &.active-state {\n box-shadow: 0px 8px 16px 2px rgba(0, 0, 0, 0.15);\n border: 1px solid ${COLORS.neutral_200};\n }\n\n &:hover:focus, &:hover {\n outline: none;\n overflow: visible;\n border-width: 0px;\n border: 1px solid ${COLORS.neutral_200};\n box-shadow: 0px 8px 16px 2px rgba(0, 0, 0, 0.15);\n }\n \n &:focus, &.focus-state {\n border-width: 0px;\n border: 1px solid ${COLORS.neutral_200};\n outline: none;\n overflow: hidden;\n box-shadow: 0px 4px 12px 2px rgba(46, 127, 161, 0.25), 0px 0px 8px 2px #2E7FA1;\n }`\n : ``}\n`;\n\nexport enum InteractionType {\n None,\n Clickable,\n Selectable,\n}\n\nexport interface CardProps {\n interactionType: InteractionType;\n onCardClicked: () => {};\n disabled: boolean;\n topSectionProps?: CardTopSectionProps;\n middleSectionProps?: CardMiddleSectionProps;\n bottomSectionProps?: CardBottomSectionProps;\n}\n\nconst Card: React.FunctionComponent<CardProps> = ({\n interactionType = InteractionType.None,\n onCardClicked,\n topSectionProps,\n middleSectionProps,\n bottomSectionProps,\n disabled\n}: CardProps) => {\n const rootRef = React.useRef<HTMLDivElement>(null);\n\n const onCardClick = () => {\n if (interactionType == InteractionType.Clickable) {\n if(onCardClicked) onCardClicked();\n rootRef.current?.blur();\n }\n };\n\n return (\n <CardTopLevelContainer disabled={disabled} ref={rootRef} tabIndex={interactionType == InteractionType.Clickable && !disabled ? 0 : -1} interactionType={interactionType} onClick={onCardClick}>\n {topSectionProps && <CardTopSection {...topSectionProps} disabled={disabled} interactionType={interactionType} />}\n {middleSectionProps && <CardMiddleSection {...middleSectionProps} disabled={disabled} interactionType={interactionType} />}\n {bottomSectionProps && <CardBottomSection {...bottomSectionProps} disabled={disabled} interactionType={interactionType} />}\n </CardTopLevelContainer>\n );\n};\n\nexport default Card;\n"],"file":"Card.js"}
1
+ {"version":3,"sources":["../../src/Card/Card.tsx"],"names":["React","styled","CardTopSection","CardMiddleSection","CardBottomSection","COLORS","focusStyles","CardTopLevelContainer","div","white","props","interactionType","InteractionType","Clickable","disabled","neutral_200","Card","None","onCardClicked","topSectionProps","middleSectionProps","bottomSectionProps","rootRef","useRef","onCardClick","current","blur"],"mappings":";;;;;;;;;;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,cAAP,MAAoD,kBAApD;AACA,OAAOC,iBAAP,MAA0D,qBAA1D;AACA,OAAOC,iBAAP,MAA0D,qBAA1D;AACA,SAAQC,MAAR,EAA0CC,WAA1C,QAA4D,IAA5D;;;AAEA,OAAO,IAAMC,qBAAqB,GAAGN,MAAM,CAACO,GAAV,mUACZH,MAAM,CAACI,KADK,EAY9B,UAAAC,KAAK;AAAA,SACLA,KAAK,CAACC,eAAN,IAAyBC,eAAe,CAACC,SAAzC,IAAsD,CAACH,KAAK,CAACI,QAA7D,kIAKsBT,MAAM,CAACU,WAL7B,yJAYsBV,MAAM,CAACU,WAZ7B,4HAiBMT,WAjBN,iBADK;AAAA,CAZyB,CAA3B;AAmCP,WAAYM,eAAZ;;WAAYA,e;AAAAA,EAAAA,e,CAAAA,e;AAAAA,EAAAA,e,CAAAA,e;AAAAA,EAAAA,e,CAAAA,e;GAAAA,e,KAAAA,e;;AAeZ,IAAMI,IAAwC,GAAG,SAA3CA,IAA2C,OAOhC;AAAA,kCANfL,eAMe;AAAA,MANfA,eAMe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["import * as React from 'react';\nimport styled from 'styled-components';\nimport CardTopSection, { CardTopSectionProps } from './CardTopSection';\nimport CardMiddleSection, { CardMiddleSectionProps } from './CardMiddleSection';\nimport CardBottomSection, { CardBottomSectionProps } from './CardBottomSection';\nimport {COLORS, CommonInteractionStyling, focusStyles} from '..';\n\nexport const CardTopLevelContainer = styled.div<{ interactionType: InteractionType; disabled: boolean; }>`\n background-color: ${COLORS.white};\n\n box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.15);\n border-radius: 8px;\n\n border: 1px solid transparent;\n background-clip: padding-box;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n\n ${props =>\n props.interactionType == InteractionType.Clickable && !props.disabled\n ? `\n\n &:active, &.active-state {\n box-shadow: 0px 8px 16px 2px rgba(0, 0, 0, 0.15);\n border: 1px solid ${COLORS.neutral_200};\n }\n\n &:hover:focus, &:hover {\n outline: none;\n overflow: visible;\n border-width: 0px;\n border: 1px solid ${COLORS.neutral_200};\n box-shadow: 0px 8px 16px 2px rgba(0, 0, 0, 0.15);\n }\n \n &:focus, &.focus-state {\n ${focusStyles}\n }`\n : ``}\n`;\n\nexport enum InteractionType {\n None,\n Clickable,\n Selectable,\n}\n\nexport interface CardProps {\n interactionType: InteractionType;\n onCardClicked: () => {};\n disabled: boolean;\n topSectionProps?: CardTopSectionProps;\n middleSectionProps?: CardMiddleSectionProps;\n bottomSectionProps?: CardBottomSectionProps;\n}\n\nconst Card: React.FunctionComponent<CardProps> = ({\n interactionType = InteractionType.None,\n onCardClicked,\n topSectionProps,\n middleSectionProps,\n bottomSectionProps,\n disabled\n}: CardProps) => {\n const rootRef = React.useRef<HTMLDivElement>(null);\n\n const onCardClick = () => {\n if (interactionType == InteractionType.Clickable) {\n if(onCardClicked) onCardClicked();\n rootRef.current?.blur();\n }\n };\n\n return (\n <CardTopLevelContainer disabled={disabled} ref={rootRef} tabIndex={interactionType == InteractionType.Clickable && !disabled ? 0 : -1} interactionType={interactionType} onClick={onCardClick}>\n {topSectionProps && <CardTopSection {...topSectionProps} disabled={disabled} interactionType={interactionType} />}\n {middleSectionProps && <CardMiddleSection {...middleSectionProps} disabled={disabled} interactionType={interactionType} />}\n {bottomSectionProps && <CardBottomSection {...bottomSectionProps} disabled={disabled} interactionType={interactionType} />}\n </CardTopLevelContainer>\n );\n};\n\nexport default Card;\n"],"file":"Card.js"}
@@ -23,11 +23,11 @@ var ChipContent = _styledComponents.default.div(_templateObject2 || (_templateOb
23
23
 
24
24
  exports.ChipContent = ChipContent;
25
25
 
26
- var ChipContainer = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n display: inline-block;\n cursor: pointer;\n\n &.medium {\n ", " {\n gap: 6px;\n padding: 10px 16px;\n\n ", "\n .chip-icon {\n height: 20px;\n width: 20px;\n\n svg {\n height: 20px;\n width: 20px;\n }\n }\n }\n\n .with-action-right {\n padding-right: 38px;\n\n .action-right {\n right: -2px;\n }\n }\n\n }\n\n &.large {\n ", " {\n gap: 8px;\n padding: 12px 20px;\n\n ", "\n .chip-icon {\n height: 24px;\n width: 24px;\n\n svg {\n height: 24px;\n width: 24px;\n }\n }\n }\n\n .with-action-right {\n padding-right: 48px;\n\n .action-right {\n right: 4px;\n }\n }\n\n }\n\n &.normal {\n color: ", ";\n\n ", " {\n background-color: ", ";\n }\n }\n\n &.normal:focus {\n ", " {\n background-color: ", ";\n box-shadow: 0 4px 12px rgba(46, 127, 161, 0.25), 0 0 8px #2E7FA1;\n }\n }\n\n &.normal:hover:not(.action-within) {\n ", " {\n background-color: ", ";\n }\n }\n\n &.normal:active:not(.action-within) {\n ", " {\n background-color: ", ";\n box-shadow: none;\n }\n }\n\n\n &.outline {\n color: ", ";\n\n ", " {\n background-color: ", ";\n border: 2px solid ", ";\n }\n }\n\n &.outline:focus {\n ", " {\n border: none;\n box-shadow: 0 4px 12px rgba(46, 127, 161, 0.25), 0 0 8px #2E7FA1;\n }\n }\n\n &.outline:hover:not(.action-within) {\n ", " {\n background-color: ", ";\n border: 2px solid ", ";\n color: ", ";\n }\n }\n\n &.outline:active:not(.action-within) {\n ", " {\n background-color: ", ";\n border: 2px solid ", ";\n color: ", ";\n box-shadow: none;\n }\n }\n\n &:focus {\n outline: none;\n\n ", " {\n border: none !important;\n }\n }\n\n //account for border \n &.small.outline:not(:focus):not(.disabled) {\n ", " {\n padding: 2px 10px;\n }\n }\n\n &.medium.outline:not(:focus):not(.disabled) {\n ", " {\n padding: 8px 14px;\n }\n }\n\n &.large.outline:not(:focus):not(.disabled) {\n ", " {\n padding: 10px 18px;\n }\n }\n\n &.warning {\n ", " {\n background-color: ", ";\n color: ", ";\n }\n }\n\n &.warning:focus {\n ", " {\n box-shadow: 0 4px 12px rgba(46, 127, 161, 0.25), 0 0 8px #2E7FA1;\n }\n }\n\n &.warning:hover:not(.action-within) {\n ", " {\n background: ", ";\n color: ", ";\n }\n }\n\n &.warning:active:not(.action-within) {\n ", " {\n background: ", ";\n color: ", ";\n box-shadow: none;\n }\n }\n\n &.error {\n ", " {\n background-color: ", ";\n color: ", ";\n }\n }\n\n &.error:focus {\n ", " {\n box-shadow: 0 4px 12px rgba(46, 127, 161, 0.25), 0 0 8px #2E7FA1;\n }\n }\n\n &.error:hover:not(.action-within) {\n ", " {\n background: ", ";\n color: ", ";\n }\n }\n\n &.error:active:not(.action-within) {\n ", " {\n background: ", ";\n color: ", ";\n box-shadow: none;\n }\n }\n\n\n .action-right:focus {\n outline: none;\n }\n\n .action-right:focus .chip-icon {\n box-shadow: 0px 4px 12px rgba(46, 127, 161, 0.25), 0px 0px 8px #2E7FA1;\n background-color: ", ";\n }\n\n .action-right:hover .chip-icon {\n background-color: ", ";\n }\n\n .action-right:active .chip-icon {\n background-color: ", ";\n }\n\n .action-right.disabled .chip-icon {\n background-color: transparent;\n color: ", ";\n }\n\n &.warning {\n .action-right:focus .chip-icon {\n background-color: ", ";\n color: ", ";\n }\n\n .action-right:hover .chip-icon {\n background-color: ", ";\n color: ", ";\n }\n\n .action-right:active .chip-icon {\n background-color: ", ";\n color: ", ";\n }\n\n .action-right.disabled .chip-icon {\n background-color: transparent;\n color: ", ";\n }\n }\n\n &.error {\n .action-right:focus .chip-icon {\n background-color: ", ";\n color: ", ";\n }\n\n .action-right:hover .chip-icon {\n background-color: ", ";\n color: ", ";\n }\n\n .action-right:active .chip-icon {\n background-color: ", ";\n color: ", ";\n }\n\n .action-right.disabled .chip-icon {\n background-color: transparent;\n color: ", ";\n }\n }\n\n\n &.disabled {\n cursor: not-allowed;\n\n ", " {\n pointer-events: none;\n }\n\n ", " {\n border: none !important;\n background-color: ", " !important;\n color: ", " !important;\n box-shadow: none !important;\n }\n }\n"])), ChipContent, (0, _styles.ComponentSStyling)(_styles.ComponentTextStyle.Bold, null), ChipContent, (0, _styles.ComponentMStyling)(_styles.ComponentTextStyle.Bold, null), _styles.COLORS.white, ChipContent, _styles.COLORS.primary_500, ChipContent, _styles.COLORS.primary_700, ChipContent, _styles.COLORS.primary_700, ChipContent, _styles.COLORS.primary_800, _styles.COLORS.neutral_600, ChipContent, _styles.COLORS.white, _styles.COLORS.neutral_200, ChipContent, ChipContent, _styles.COLORS.primary_20, _styles.COLORS.primary_200, _styles.COLORS.primary_700, ChipContent, _styles.COLORS.primary_100, _styles.COLORS.primary_300, _styles.COLORS.primary_800, ChipContent, ChipContent, ChipContent, ChipContent, ChipContent, _styles.COLORS.warning_100, _styles.COLORS.warning_600, ChipContent, ChipContent, _styles.COLORS.warning_200, _styles.COLORS.warning_700, ChipContent, _styles.COLORS.warning_300, _styles.COLORS.warning_800, ChipContent, _styles.COLORS.critical_100, _styles.COLORS.critical_600, ChipContent, ChipContent, _styles.COLORS.critical_200, _styles.COLORS.critical_700, ChipContent, _styles.COLORS.critical_300, _styles.COLORS.critical_800, _styles.COLORS.primary_700, _styles.COLORS.primary_700, _styles.COLORS.primary_800, _styles.COLORS.primary_300, _styles.COLORS.warning_200, _styles.COLORS.warning_700, _styles.COLORS.warning_200, _styles.COLORS.warning_700, _styles.COLORS.warning_300, _styles.COLORS.warning_800, _styles.COLORS.primary_300, _styles.COLORS.critical_200, _styles.COLORS.critical_700, _styles.COLORS.critical_200, _styles.COLORS.critical_700, _styles.COLORS.critical_300, _styles.COLORS.critical_800, _styles.COLORS.primary_300, ChipContentContainer, ChipContent, _styles.COLORS.neutral_100, _styles.COLORS.neutral_300);
26
+ var ChipContainer = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n display: inline-block;\n cursor: pointer;\n position: relative;\n\n &.medium {\n ", " {\n gap: 6px;\n padding: 10px 16px;\n\n ", "\n .chip-icon {\n height: 20px;\n width: 20px;\n\n svg {\n height: 20px;\n width: 20px;\n }\n }\n }\n\n .with-action-right {\n padding-right: 38px;\n\n .action-right {\n right: -2px;\n }\n }\n\n }\n\n &.large {\n ", " {\n gap: 8px;\n padding: 12px 20px;\n\n ", "\n .chip-icon {\n height: 24px;\n width: 24px;\n\n svg {\n height: 24px;\n width: 24px;\n }\n }\n }\n\n .with-action-right {\n padding-right: 48px;\n\n .action-right {\n right: 4px;\n }\n }\n\n }\n\n &:focus {\n ", "\n }\n\n &.normal {\n color: ", ";\n\n ", " {\n background-color: ", ";\n }\n }\n\n &.normal:hover:not(.action-within) {\n ", " {\n background-color: ", ";\n }\n }\n\n &.normal:active:not(.action-within) {\n ", " {\n background-color: ", ";\n }\n }\n\n\n &.outline {\n color: ", ";\n\n ", " {\n background-color: ", ";\n border: 2px solid ", ";\n }\n }\n\n &.outline:hover:not(.action-within) {\n ", " {\n background-color: ", ";\n border: 2px solid ", ";\n color: ", ";\n }\n }\n\n &.outline:active:not(.action-within) {\n ", " {\n background-color: ", ";\n border: 2px solid ", ";\n color: ", ";\n }\n }\n\n //account for border \n &.small.outline:not(.disabled) {\n ", " {\n padding: 2px 10px;\n }\n }\n\n &.medium.outline:not(.disabled) {\n ", " {\n padding: 8px 14px;\n }\n }\n\n &.large.outline:not(.disabled) {\n ", " {\n padding: 10px 18px;\n }\n }\n\n &.warning {\n ", " {\n background-color: ", ";\n color: ", ";\n }\n }\n\n &.warning:hover:not(.action-within) {\n ", " {\n background: ", ";\n color: ", ";\n }\n }\n\n &.warning:active:not(.action-within) {\n ", " {\n background: ", ";\n color: ", ";\n }\n }\n\n &.error {\n ", " {\n background-color: ", ";\n color: ", ";\n }\n }\n\n\n &.error:hover:not(.action-within) {\n ", " {\n background: ", ";\n color: ", ";\n }\n }\n\n &.error:active:not(.action-within) {\n ", " {\n background: ", ";\n color: ", ";\n }\n }\n\n\n .action-right:focus {\n ", "\n }\n\n .action-right:hover .chip-icon {\n background-color: ", ";\n }\n\n .action-right:active .chip-icon {\n background-color: ", ";\n }\n\n .action-right.disabled .chip-icon {\n background-color: transparent;\n color: ", ";\n }\n\n &.warning {\n\n .action-right:hover .chip-icon {\n background-color: ", ";\n color: ", ";\n }\n\n .action-right:active .chip-icon {\n background-color: ", ";\n color: ", ";\n }\n\n .action-right.disabled .chip-icon {\n background-color: transparent;\n color: ", ";\n }\n }\n\n &.error {\n .action-right:hover .chip-icon {\n background-color: ", ";\n color: ", ";\n }\n\n .action-right:active .chip-icon {\n background-color: ", ";\n color: ", ";\n }\n\n .action-right.disabled .chip-icon {\n background-color: transparent;\n color: ", ";\n }\n }\n\n\n &.disabled {\n cursor: not-allowed;\n\n ", " {\n pointer-events: none;\n }\n\n ", " {\n border: none !important;\n background-color: ", " !important;\n color: ", " !important;\n }\n }\n"])), ChipContent, (0, _styles.ComponentSStyling)(_styles.ComponentTextStyle.Bold, null), ChipContent, (0, _styles.ComponentMStyling)(_styles.ComponentTextStyle.Bold, null), _styles.focusStyles, _styles.COLORS.white, ChipContent, _styles.COLORS.primary_500, ChipContent, _styles.COLORS.primary_700, ChipContent, _styles.COLORS.primary_800, _styles.COLORS.neutral_600, ChipContent, _styles.COLORS.white, _styles.COLORS.neutral_200, ChipContent, _styles.COLORS.primary_20, _styles.COLORS.primary_200, _styles.COLORS.primary_700, ChipContent, _styles.COLORS.primary_100, _styles.COLORS.primary_300, _styles.COLORS.primary_800, ChipContent, ChipContent, ChipContent, ChipContent, _styles.COLORS.warning_100, _styles.COLORS.warning_600, ChipContent, _styles.COLORS.warning_200, _styles.COLORS.warning_700, ChipContent, _styles.COLORS.warning_300, _styles.COLORS.warning_800, ChipContent, _styles.COLORS.critical_100, _styles.COLORS.critical_600, ChipContent, _styles.COLORS.critical_200, _styles.COLORS.critical_700, ChipContent, _styles.COLORS.critical_300, _styles.COLORS.critical_800, _styles.focusStyles, _styles.COLORS.primary_700, _styles.COLORS.primary_800, _styles.COLORS.primary_300, _styles.COLORS.warning_200, _styles.COLORS.warning_700, _styles.COLORS.warning_300, _styles.COLORS.warning_800, _styles.COLORS.primary_300, _styles.COLORS.critical_200, _styles.COLORS.critical_700, _styles.COLORS.critical_300, _styles.COLORS.critical_800, _styles.COLORS.primary_300, ChipContentContainer, ChipContent, _styles.COLORS.neutral_100, _styles.COLORS.neutral_300);
27
27
 
28
28
  exports.ChipContainer = ChipContainer;
29
29
 
30
- var ChipInputContainer = _styledComponents.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n min-height: 56px;\n height: auto;\n width: 100%;\n border-radius: 4px;\n border: 2px solid transparent;\n box-shadow: inset 0px 0px 0px 1px ", ";\n background-color: #fff;\n box-sizing: border-box;\n padding: 16px 16px 8px 16px;\n cursor: text;\n outline: none;\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n\n ", "\n color: ", " !important;\n\n &.warning,\n &.warning:hover,\n &.warning:focus {\n box-shadow: inset 0px 0px 0px 2px ", ";\n }\n\n &.error,\n &.error:hover,\n &.error:focus {\n box-shadow: inset 0px 0px 0px 2px ", ";\n }\n\n > div {\n margin-right: 8px;\n margin-bottom: 8px;\n }\n\n &.active {\n box-shadow: inset 0px 0px 0px 2px ", ";\n }\n\n &:hover {\n box-shadow: inset 0px 0px 0px 2px ", ";\n }\n"])), _styles.COLORS.neutral_400, (0, _styles.ComponentMStyling)(_styles.ComponentTextStyle.Regular, _styles.COLORS.black), _styles.COLORS.black, _styles.COLORS.warning_500, _styles.COLORS.critical_500, _styles.COLORS.primary_800, _styles.COLORS.primary_700);
30
+ var ChipInputContainer = _styledComponents.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n min-height: 56px;\n height: auto;\n width: 100%;\n border-radius: 4px;\n border: 2px solid transparent;\n box-shadow: inset 0px 0px 0px 1px ", ";\n background-color: #fff;\n box-sizing: border-box;\n padding: 16px 16px 8px 16px;\n cursor: text;\n outline: none;\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n\n ", "\n color: ", " !important;\n\n &.warning,\n &.warning:hover {\n box-shadow: inset 0px 0px 0px 2px ", ";\n }\n\n &.error,\n &.error:hover {\n box-shadow: inset 0px 0px 0px 2px ", ";\n }\n\n > div {\n margin-right: 8px;\n margin-bottom: 8px;\n }\n\n &.active {\n box-shadow: inset 0px 0px 0px 2px ", ";\n }\n\n &:hover {\n box-shadow: inset 0px 0px 0px 2px ", ";\n }\n"])), _styles.COLORS.neutral_400, (0, _styles.ComponentMStyling)(_styles.ComponentTextStyle.Regular, _styles.COLORS.black), _styles.COLORS.black, _styles.COLORS.warning_500, _styles.COLORS.critical_500, _styles.COLORS.primary_800, _styles.COLORS.primary_700);
31
31
 
32
32
  exports.ChipInputContainer = ChipInputContainer;
33
33
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Chips/ChipStyles.ts"],"names":["ChipContentContainer","styled","div","ChipContent","ComponentTextStyle","Bold","ChipContainer","COLORS","white","primary_500","primary_700","primary_800","neutral_600","neutral_200","primary_20","primary_200","primary_100","primary_300","warning_100","warning_600","warning_200","warning_700","warning_300","warning_800","critical_100","critical_600","critical_200","critical_700","critical_300","critical_800","neutral_100","neutral_300","ChipInputContainer","neutral_400","Regular","black","warning_500","critical_500","RequiredStar","span","ChipInputEl","input"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;;;AAEO,IAAM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A/LI,EAoMpBxB,WApMoB,EAqMNI,eAAOqB,YArMD,EAsMXrB,eAAOsB,YAtMI,EAkNFtB,eAAOG,WAlNL,EAsNFH,eAAOG,WAtNL,EA0NFH,eAAOI,WA1NL,EA+NbJ,eAAOU,WA/NM,EAoOAV,eAAOa,WApOP,EAqOXb,eAAOc,WArOI,EAyOAd,eAAOa,WAzOP,EA0OXb,eAAOc,WA1OI,EA8OAd,eAAOe,WA9OP,EA+OXf,eAAOgB,WA/OI,EAoPXhB,eAAOU,WApPI,EA0PAV,eAAOmB,YA1PP,EA2PXnB,eAAOoB,YA3PI,EA+PApB,eAAOmB,YA/PP,EAgQXnB,eAAOoB,YAhQI,EAoQApB,eAAOqB,YApQP,EAqQXrB,eAAOsB,YArQI,EA0QXtB,eAAOU,WA1QI,EAkRpBjB,oBAlRoB,EAsRpBG,WAtRoB,EAwRAI,eAAOuB,WAxRP,EAyRXvB,eAAOwB,WAzRI,CAAnB;;;;AAgSA,IAAMC,kBAAkB,GAAG/B,0BAAOC,GAAV,o2BAMOK,eAAO0B,WANd,EAgB3B,+BAAkB7B,2BAAmB8B,OAArC,EAA8C3B,eAAO4B,KAArD,CAhB2B,EAiBpB5B,eAAO4B,KAjBa,EAsBS5B,eAAO6B,WAtBhB,EA4BS7B,eAAO8B,YA5BhB,EAqCS9B,eAAOI,WArChB,EAyCSJ,eAAOG,WAzChB,CAAxB;;;;AA6CA,IAAM4B,YAAY,GAAGrC,0BAAOsC,IAAV,6NACdhC,eAAO8B,YADO,CAAlB;;;;AAUA,IAAMG,WAAW,GAAGvC,0BAAOwC,KAAV,qQASpB,+BAAkBrC,2BAAmB8B,OAArC,EAA8C3B,eAAO4B,KAArD,CAToB,EAUb5B,eAAO4B,KAVM,CAAjB","sourcesContent":["/**\n * Import third-party libraries.\n */\nimport styled from 'styled-components';\n\n/**\n * Import custom style properties.\n */\nimport {COLORS, ComponentMStyling, ComponentSStyling, ComponentTextStyle, ComponentXSStyling} from '../styles';\n\nexport const ChipContentContainer = styled.div`\n display: flex;\n align-items: center;\n min-height: 48px;\n`;\n\nexport const ChipContent = styled.div`\n ${ComponentXSStyling(ComponentTextStyle.Bold, null)}\n\n position: relative;\n display: flex;\n gap: 4px;\n align-items: center;\n min-height: 24px;\n box-sizing: border-box;\n border-radius: 24px;\n padding: 4px 12px;\n\n .chip-icon {\n height: 16px;\n width: 16px;\n border-radius: 50%;\n\n svg {\n height: 16px;\n width: 16px;\n }\n }\n\n .icon-left {\n margin-left: -4px;\n }\n\n .icon-right {\n margin-right: -4px;\n }\n\n .action-right {\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: center;\n height: 48px;\n width: 48px;\n right: -8px;\n }\n\n &.with-action-right {\n position: relative;\n padding-right: 28px;\n }\n\n`;\n\nexport const ChipContainer = styled.div`\n display: inline-block;\n cursor: pointer;\n\n &.medium {\n ${ChipContent} {\n gap: 6px;\n padding: 10px 16px;\n\n ${ComponentSStyling(ComponentTextStyle.Bold, null)}\n .chip-icon {\n height: 20px;\n width: 20px;\n\n svg {\n height: 20px;\n width: 20px;\n }\n }\n }\n\n .with-action-right {\n padding-right: 38px;\n\n .action-right {\n right: -2px;\n }\n }\n\n }\n\n &.large {\n ${ChipContent} {\n gap: 8px;\n padding: 12px 20px;\n\n ${ComponentMStyling(ComponentTextStyle.Bold, null)}\n .chip-icon {\n height: 24px;\n width: 24px;\n\n svg {\n height: 24px;\n width: 24px;\n }\n }\n }\n\n .with-action-right {\n padding-right: 48px;\n\n .action-right {\n right: 4px;\n }\n }\n\n }\n\n &.normal {\n color: ${COLORS.white};\n\n ${ChipContent} {\n background-color: ${COLORS.primary_500};\n }\n }\n\n &.normal:focus {\n ${ChipContent} {\n background-color: ${COLORS.primary_700};\n box-shadow: 0 4px 12px rgba(46, 127, 161, 0.25), 0 0 8px #2E7FA1;\n }\n }\n\n &.normal:hover:not(.action-within) {\n ${ChipContent} {\n background-color: ${COLORS.primary_700};\n }\n }\n\n &.normal:active:not(.action-within) {\n ${ChipContent} {\n background-color: ${COLORS.primary_800};\n box-shadow: none;\n }\n }\n\n\n &.outline {\n color: ${COLORS.neutral_600};\n\n ${ChipContent} {\n background-color: ${COLORS.white};\n border: 2px solid ${COLORS.neutral_200};\n }\n }\n\n &.outline:focus {\n ${ChipContent} {\n border: none;\n box-shadow: 0 4px 12px rgba(46, 127, 161, 0.25), 0 0 8px #2E7FA1;\n }\n }\n\n &.outline:hover:not(.action-within) {\n ${ChipContent} {\n background-color: ${COLORS.primary_20};\n border: 2px solid ${COLORS.primary_200};\n color: ${COLORS.primary_700};\n }\n }\n\n &.outline:active:not(.action-within) {\n ${ChipContent} {\n background-color: ${COLORS.primary_100};\n border: 2px solid ${COLORS.primary_300};\n color: ${COLORS.primary_800};\n box-shadow: none;\n }\n }\n\n &:focus {\n outline: none;\n\n ${ChipContent} {\n border: none !important;\n }\n }\n\n //account for border \n &.small.outline:not(:focus):not(.disabled) {\n ${ChipContent} {\n padding: 2px 10px;\n }\n }\n\n &.medium.outline:not(:focus):not(.disabled) {\n ${ChipContent} {\n padding: 8px 14px;\n }\n }\n\n &.large.outline:not(:focus):not(.disabled) {\n ${ChipContent} {\n padding: 10px 18px;\n }\n }\n\n &.warning {\n ${ChipContent} {\n background-color: ${COLORS.warning_100};\n color: ${COLORS.warning_600};\n }\n }\n\n &.warning:focus {\n ${ChipContent} {\n box-shadow: 0 4px 12px rgba(46, 127, 161, 0.25), 0 0 8px #2E7FA1;\n }\n }\n\n &.warning:hover:not(.action-within) {\n ${ChipContent} {\n background: ${COLORS.warning_200};\n color: ${COLORS.warning_700};\n }\n }\n\n &.warning:active:not(.action-within) {\n ${ChipContent} {\n background: ${COLORS.warning_300};\n color: ${COLORS.warning_800};\n box-shadow: none;\n }\n }\n\n &.error {\n ${ChipContent} {\n background-color: ${COLORS.critical_100};\n color: ${COLORS.critical_600};\n }\n }\n\n &.error:focus {\n ${ChipContent} {\n box-shadow: 0 4px 12px rgba(46, 127, 161, 0.25), 0 0 8px #2E7FA1;\n }\n }\n\n &.error:hover:not(.action-within) {\n ${ChipContent} {\n background: ${COLORS.critical_200};\n color: ${COLORS.critical_700};\n }\n }\n\n &.error:active:not(.action-within) {\n ${ChipContent} {\n background: ${COLORS.critical_300};\n color: ${COLORS.critical_800};\n box-shadow: none;\n }\n }\n\n\n .action-right:focus {\n outline: none;\n }\n\n .action-right:focus .chip-icon {\n box-shadow: 0px 4px 12px rgba(46, 127, 161, 0.25), 0px 0px 8px #2E7FA1;\n background-color: ${COLORS.primary_700};\n }\n\n .action-right:hover .chip-icon {\n background-color: ${COLORS.primary_700};\n }\n\n .action-right:active .chip-icon {\n background-color: ${COLORS.primary_800};\n }\n\n .action-right.disabled .chip-icon {\n background-color: transparent;\n color: ${COLORS.primary_300};\n }\n\n &.warning {\n .action-right:focus .chip-icon {\n background-color: ${COLORS.warning_200};\n color: ${COLORS.warning_700};\n }\n\n .action-right:hover .chip-icon {\n background-color: ${COLORS.warning_200};\n color: ${COLORS.warning_700};\n }\n\n .action-right:active .chip-icon {\n background-color: ${COLORS.warning_300};\n color: ${COLORS.warning_800};\n }\n\n .action-right.disabled .chip-icon {\n background-color: transparent;\n color: ${COLORS.primary_300};\n }\n }\n\n &.error {\n .action-right:focus .chip-icon {\n background-color: ${COLORS.critical_200};\n color: ${COLORS.critical_700};\n }\n\n .action-right:hover .chip-icon {\n background-color: ${COLORS.critical_200};\n color: ${COLORS.critical_700};\n }\n\n .action-right:active .chip-icon {\n background-color: ${COLORS.critical_300};\n color: ${COLORS.critical_800};\n }\n\n .action-right.disabled .chip-icon {\n background-color: transparent;\n color: ${COLORS.primary_300};\n }\n }\n\n\n &.disabled {\n cursor: not-allowed;\n\n ${ChipContentContainer} {\n pointer-events: none;\n }\n\n ${ChipContent} {\n border: none !important;\n background-color: ${COLORS.neutral_100} !important;\n color: ${COLORS.neutral_300} !important;\n box-shadow: none !important;\n }\n }\n`;\n\n\nexport const ChipInputContainer = styled.div`\n min-height: 56px;\n height: auto;\n width: 100%;\n border-radius: 4px;\n border: 2px solid transparent;\n box-shadow: inset 0px 0px 0px 1px ${COLORS.neutral_400};\n background-color: #fff;\n box-sizing: border-box;\n padding: 16px 16px 8px 16px;\n cursor: text;\n outline: none;\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n\n ${ComponentMStyling(ComponentTextStyle.Regular, COLORS.black)}\n color: ${COLORS.black} !important;\n\n &.warning,\n &.warning:hover,\n &.warning:focus {\n box-shadow: inset 0px 0px 0px 2px ${COLORS.warning_500};\n }\n\n &.error,\n &.error:hover,\n &.error:focus {\n box-shadow: inset 0px 0px 0px 2px ${COLORS.critical_500};\n }\n\n > div {\n margin-right: 8px;\n margin-bottom: 8px;\n }\n\n &.active {\n box-shadow: inset 0px 0px 0px 2px ${COLORS.primary_800};\n }\n\n &:hover {\n box-shadow: inset 0px 0px 0px 2px ${COLORS.primary_700};\n }\n`;\n\nexport const RequiredStar = styled.span`\n color: ${COLORS.critical_500};\n font-size: 28px;\n line-height: 12px;\n float: right;\n font-weight: 700;\n position: relative;\n top: 10px;\n`;\n\nexport const ChipInputEl = styled.input`\n height: 40px;\n width: auto;\n display: inline-flex;\n border: none;\n outline: none;\n margin-top: 5px;\n margin-bottom: 8px;\n\n ${ComponentMStyling(ComponentTextStyle.Regular, COLORS.black)}\n color: ${COLORS.black} !important;\n`;\n"],"file":"ChipStyles.cjs"}
1
+ {"version":3,"sources":["../../src/Chips/ChipStyles.ts"],"names":["ChipContentContainer","styled","div","ChipContent","ComponentTextStyle","Bold","ChipContainer","focusStyles","COLORS","white","primary_500","primary_700","primary_800","neutral_600","neutral_200","primary_20","primary_200","primary_100","primary_300","warning_100","warning_600","warning_200","warning_700","warning_300","warning_800","critical_100","critical_600","critical_200","critical_700","critical_300","critical_800","neutral_100","neutral_300","ChipInputContainer","neutral_400","Regular","black","warning_500","critical_500","RequiredStar","span","ChipInputEl","input"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;;;AASO,IAAMA,oBAAoB,GAAGC,0BAAOC,GAAV,o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OI,WArLL,EA0LbJ,eAAOU,WA1LM,EAgMAV,eAAOa,WAhMP,EAiMXb,eAAOc,WAjMI,EAqMAd,eAAOe,WArMP,EAsMXf,eAAOgB,WAtMI,EA2MXhB,eAAOU,WA3MI,EAiNAV,eAAOmB,YAjNP,EAkNXnB,eAAOoB,YAlNI,EAsNApB,eAAOqB,YAtNP,EAuNXrB,eAAOsB,YAvNI,EA4NXtB,eAAOU,WA5NI,EAoOpBlB,oBApOoB,EAwOpBG,WAxOoB,EA0OAK,eAAOuB,WA1OP,EA2OXvB,eAAOwB,WA3OI,CAAnB;;;;AAgPA,IAAMC,kBAAkB,GAAGhC,0BAAOC,GAAV,8zBAMOM,eAAO0B,WANd,EAgB3B,+BAAkB9B,2BAAmB+B,OAArC,EAA8C3B,eAAO4B,KAArD,CAhB2B,EAiBpB5B,eAAO4B,KAjBa,EAqBS5B,eAAO6B,WArBhB,EA0BS7B,eAAO8B,YA1BhB,EAmCS9B,eAAOI,WAnChB,EAuCSJ,eAAOG,WAvChB,CAAxB;;;;AA2CA,IAAM4B,YAAY,GAAGtC,0BAAOuC,IAAV,6NACdhC,eAAO8B,YADO,CAAlB;;;;AAUA,IAAMG,WAAW,GAAGxC,0BAAOyC,KAAV,qQASpB,+BAAkBtC,2BAAmB+B,OAArC,EAA8C3B,eAAO4B,KAArD,CAToB,EAUb5B,eAAO4B,KAVM,CAAjB","sourcesContent":["/**\n * Import third-party libraries.\n */\nimport styled from 'styled-components';\n\n/**\n * Import custom style properties.\n */\nimport {\n COLORS,\n ComponentMStyling,\n ComponentSStyling,\n ComponentTextStyle,\n ComponentXSStyling,\n focusStyles\n} from '../styles';\n\nexport const ChipContentContainer = styled.div`\n display: flex;\n align-items: center;\n min-height: 48px;\n`;\n\nexport const ChipContent = styled.div`\n ${ComponentXSStyling(ComponentTextStyle.Bold, null)}\n\n position: relative;\n display: flex;\n gap: 4px;\n align-items: center;\n min-height: 24px;\n box-sizing: border-box;\n border-radius: 24px;\n padding: 4px 12px;\n\n .chip-icon {\n height: 16px;\n width: 16px;\n border-radius: 50%;\n\n svg {\n height: 16px;\n width: 16px;\n }\n }\n\n .icon-left {\n margin-left: -4px;\n }\n\n .icon-right {\n margin-right: -4px;\n }\n\n .action-right {\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: center;\n height: 48px;\n width: 48px;\n right: -8px;\n }\n\n &.with-action-right {\n position: relative;\n padding-right: 28px;\n }\n\n`;\n\nexport const ChipContainer = styled.div`\n display: inline-block;\n cursor: pointer;\n position: relative;\n\n &.medium {\n ${ChipContent} {\n gap: 6px;\n padding: 10px 16px;\n\n ${ComponentSStyling(ComponentTextStyle.Bold, null)}\n .chip-icon {\n height: 20px;\n width: 20px;\n\n svg {\n height: 20px;\n width: 20px;\n }\n }\n }\n\n .with-action-right {\n padding-right: 38px;\n\n .action-right {\n right: -2px;\n }\n }\n\n }\n\n &.large {\n ${ChipContent} {\n gap: 8px;\n padding: 12px 20px;\n\n ${ComponentMStyling(ComponentTextStyle.Bold, null)}\n .chip-icon {\n height: 24px;\n width: 24px;\n\n svg {\n height: 24px;\n width: 24px;\n }\n }\n }\n\n .with-action-right {\n padding-right: 48px;\n\n .action-right {\n right: 4px;\n }\n }\n\n }\n\n &:focus {\n ${focusStyles}\n }\n\n &.normal {\n color: ${COLORS.white};\n\n ${ChipContent} {\n background-color: ${COLORS.primary_500};\n }\n }\n\n &.normal:hover:not(.action-within) {\n ${ChipContent} {\n background-color: ${COLORS.primary_700};\n }\n }\n\n &.normal:active:not(.action-within) {\n ${ChipContent} {\n background-color: ${COLORS.primary_800};\n }\n }\n\n\n &.outline {\n color: ${COLORS.neutral_600};\n\n ${ChipContent} {\n background-color: ${COLORS.white};\n border: 2px solid ${COLORS.neutral_200};\n }\n }\n\n &.outline:hover:not(.action-within) {\n ${ChipContent} {\n background-color: ${COLORS.primary_20};\n border: 2px solid ${COLORS.primary_200};\n color: ${COLORS.primary_700};\n }\n }\n\n &.outline:active:not(.action-within) {\n ${ChipContent} {\n background-color: ${COLORS.primary_100};\n border: 2px solid ${COLORS.primary_300};\n color: ${COLORS.primary_800};\n }\n }\n\n //account for border \n &.small.outline:not(.disabled) {\n ${ChipContent} {\n padding: 2px 10px;\n }\n }\n\n &.medium.outline:not(.disabled) {\n ${ChipContent} {\n padding: 8px 14px;\n }\n }\n\n &.large.outline:not(.disabled) {\n ${ChipContent} {\n padding: 10px 18px;\n }\n }\n\n &.warning {\n ${ChipContent} {\n background-color: ${COLORS.warning_100};\n color: ${COLORS.warning_600};\n }\n }\n\n &.warning:hover:not(.action-within) {\n ${ChipContent} {\n background: ${COLORS.warning_200};\n color: ${COLORS.warning_700};\n }\n }\n\n &.warning:active:not(.action-within) {\n ${ChipContent} {\n background: ${COLORS.warning_300};\n color: ${COLORS.warning_800};\n }\n }\n\n &.error {\n ${ChipContent} {\n background-color: ${COLORS.critical_100};\n color: ${COLORS.critical_600};\n }\n }\n\n\n &.error:hover:not(.action-within) {\n ${ChipContent} {\n background: ${COLORS.critical_200};\n color: ${COLORS.critical_700};\n }\n }\n\n &.error:active:not(.action-within) {\n ${ChipContent} {\n background: ${COLORS.critical_300};\n color: ${COLORS.critical_800};\n }\n }\n\n\n .action-right:focus {\n ${focusStyles}\n }\n\n .action-right:hover .chip-icon {\n background-color: ${COLORS.primary_700};\n }\n\n .action-right:active .chip-icon {\n background-color: ${COLORS.primary_800};\n }\n\n .action-right.disabled .chip-icon {\n background-color: transparent;\n color: ${COLORS.primary_300};\n }\n\n &.warning {\n\n .action-right:hover .chip-icon {\n background-color: ${COLORS.warning_200};\n color: ${COLORS.warning_700};\n }\n\n .action-right:active .chip-icon {\n background-color: ${COLORS.warning_300};\n color: ${COLORS.warning_800};\n }\n\n .action-right.disabled .chip-icon {\n background-color: transparent;\n color: ${COLORS.primary_300};\n }\n }\n\n &.error {\n .action-right:hover .chip-icon {\n background-color: ${COLORS.critical_200};\n color: ${COLORS.critical_700};\n }\n\n .action-right:active .chip-icon {\n background-color: ${COLORS.critical_300};\n color: ${COLORS.critical_800};\n }\n\n .action-right.disabled .chip-icon {\n background-color: transparent;\n color: ${COLORS.primary_300};\n }\n }\n\n\n &.disabled {\n cursor: not-allowed;\n\n ${ChipContentContainer} {\n pointer-events: none;\n }\n\n ${ChipContent} {\n border: none !important;\n background-color: ${COLORS.neutral_100} !important;\n color: ${COLORS.neutral_300} !important;\n }\n }\n`;\n\nexport const ChipInputContainer = styled.div`\n min-height: 56px;\n height: auto;\n width: 100%;\n border-radius: 4px;\n border: 2px solid transparent;\n box-shadow: inset 0px 0px 0px 1px ${COLORS.neutral_400};\n background-color: #fff;\n box-sizing: border-box;\n padding: 16px 16px 8px 16px;\n cursor: text;\n outline: none;\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n\n ${ComponentMStyling(ComponentTextStyle.Regular, COLORS.black)}\n color: ${COLORS.black} !important;\n\n &.warning,\n &.warning:hover {\n box-shadow: inset 0px 0px 0px 2px ${COLORS.warning_500};\n }\n\n &.error,\n &.error:hover {\n box-shadow: inset 0px 0px 0px 2px ${COLORS.critical_500};\n }\n\n > div {\n margin-right: 8px;\n margin-bottom: 8px;\n }\n\n &.active {\n box-shadow: inset 0px 0px 0px 2px ${COLORS.primary_800};\n }\n\n &:hover {\n box-shadow: inset 0px 0px 0px 2px ${COLORS.primary_700};\n }\n`;\n\nexport const RequiredStar = styled.span`\n color: ${COLORS.critical_500};\n font-size: 28px;\n line-height: 12px;\n float: right;\n font-weight: 700;\n position: relative;\n top: 10px;\n`;\n\nexport const ChipInputEl = styled.input`\n height: 40px;\n width: auto;\n display: inline-flex;\n border: none;\n outline: none;\n margin-top: 5px;\n margin-bottom: 8px;\n\n ${ComponentMStyling(ComponentTextStyle.Regular, COLORS.black)}\n color: ${COLORS.black} !important;\n`;\n"],"file":"ChipStyles.cjs"}