@pushwoosh/dumb-components 1.1.137 → 1.1.138

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.
@@ -1,6 +1,7 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useContext } from 'react';
3
- import { DropdownMenuItemStyled } from './styles';
3
+ import { CheckIcon } from '@pushwoosh/kit-icons';
4
+ import { DropdownMenuItemStyled, DropdownMenuIconStyled } from './styles';
4
5
  import { DropdownContext } from '../../context';
5
6
  export const DropdownMenuItem = ({
6
7
  children,
@@ -16,7 +17,7 @@ export const DropdownMenuItem = ({
16
17
  console.error('DropdownMenuItem must be inside DropdownMenu');
17
18
  }
18
19
  }
19
- return _jsx(DropdownMenuItemStyled, {
20
+ return _jsxs(DropdownMenuItemStyled, {
20
21
  "$active": isActive,
21
22
  "$danger": isDanger,
22
23
  onClick: () => {
@@ -27,6 +28,10 @@ export const DropdownMenuItem = ({
27
28
  },
28
29
  disabled: disabled,
29
30
  "data-active": isActive || undefined,
30
- children: children
31
+ children: [children, isActive && _jsx(DropdownMenuIconStyled, {
32
+ children: _jsx(CheckIcon, {
33
+ size: "small"
34
+ })
35
+ })]
31
36
  });
32
37
  };
@@ -1 +1 @@
1
- export { DropdownMenuItemStyled } from '../../shared/styles';
1
+ export { DropdownMenuItemStyled, DropdownMenuIconStyled } from '../../shared/styles';
@@ -1 +1 @@
1
- export { DropdownMenuItemStyled } from '../../shared/styles';
1
+ export { DropdownMenuItemStyled, DropdownMenuIconStyled } from '../../shared/styles';
@@ -20,3 +20,4 @@ export declare const DropdownMenuItemStyled: import("styled-components").StyledC
20
20
  $active?: boolean;
21
21
  $danger?: boolean;
22
22
  }, never>;
23
+ export declare const DropdownMenuIconStyled: import("styled-components").StyledComponent<"span", any, {}, never>;
@@ -23,10 +23,14 @@ export const Place = styled(Vertical).withConfig({
23
23
  export const DropdownMenuItemStyled = styled.button.withConfig({
24
24
  displayName: "DropdownMenuItemStyled",
25
25
  componentId: "sc-hlq2pz-1"
26
- })(["appearance:none;display:flex;align-items:center;white-space:nowrap;padding:0 12px;min-height:", ";border:none;overflow:hidden;color:", ";background:none;cursor:pointer;&:hover{background:", ";color:", ";}&:disabled{color:", ";cursor:not-allowed;}"], UnitSize.FIELD_HEIGHT, ({
26
+ })(["appearance:none;display:flex;align-items:center;justify-content:space-between;gap:8px;white-space:nowrap;padding:0 12px;min-height:", ";border:none;overflow:hidden;color:", ";background:none;cursor:pointer;&:hover{background:", ";color:", ";}&:disabled{color:", ";cursor:not-allowed;}"], UnitSize.FIELD_HEIGHT, ({
27
27
  $active,
28
28
  $danger
29
29
  }) => {
30
30
  if ($danger) return Color.DANGER;
31
31
  return $active ? Color.PRIMARY : Color.MAIN;
32
- }, Color.SOFT_LIGHT, Color.MAIN, Color.LOCKED);
32
+ }, Color.SOFT_LIGHT, Color.MAIN, Color.LOCKED);
33
+ export const DropdownMenuIconStyled = styled.span.withConfig({
34
+ displayName: "DropdownMenuIconStyled",
35
+ componentId: "sc-hlq2pz-2"
36
+ })(["margin:-2px 0 0;line-height:0;"]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushwoosh/dumb-components",
3
- "version": "1.1.137",
3
+ "version": "1.1.138",
4
4
  "description": "React components to build Pushwoosh products",
5
5
  "main": "index.js",
6
6
  "module": "index.js",