@pushwoosh/dumb-components 1.1.72 → 1.1.73

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.
@@ -78,6 +78,7 @@ export const DropdownMenu = ({
78
78
  style: floatingStyles,
79
79
  "$color": color,
80
80
  "$width": width,
81
+ "$fitContent": windowWidth === null && !fullWidth,
81
82
  "$scrollable": isScrollable,
82
83
  "$zIndex": menuZIndex
83
84
  }, typeof children === 'function' ? children() : children));
@@ -56,6 +56,7 @@ export declare const Place: import("styled-components").StyledComponent<"div", a
56
56
  } & {
57
57
  $color?: string;
58
58
  $width: number | null;
59
+ $fitContent?: boolean;
59
60
  $zIndex?: number;
60
61
  $scrollable?: boolean;
61
62
  }, "$gridAutoFlow">;
@@ -2,14 +2,20 @@ import styled, { css } from 'styled-components';
2
2
  import { Color, Shadow, ShapeRadius } from '@pushwoosh/kit-constants';
3
3
  import { Vertical } from '@pushwoosh/kit-helpers';
4
4
  const scrollableCss = css(["max-height:248px;overflow-y:auto;"]);
5
+ const getWidth = ($width, $fitContent) => {
6
+ if ($fitContent) return 'max-content';
7
+ if ($width) return `${$width}px`;
8
+ return 'auto';
9
+ };
5
10
  export const Place = styled(Vertical).withConfig({
6
11
  displayName: "Place",
7
12
  componentId: "sc-ij8wqc-0"
8
13
  })(["border:1px solid ", ";background:", ";width:", ";min-width:140px;max-width:480px;", " border-radius:", ";box-shadow:", ";z-index:", ";"], Color.FORM, ({
9
14
  $color
10
15
  }) => $color || Color.FROZEN, ({
11
- $width
12
- }) => $width ? `${$width}px` : 'auto', ({
16
+ $width,
17
+ $fitContent
18
+ }) => getWidth($width, $fitContent), ({
13
19
  $scrollable
14
20
  }) => $scrollable && scrollableCss, ShapeRadius.CONTROL, Shadow.REGULAR, ({
15
21
  $zIndex
@@ -40,7 +40,6 @@ export function StatisticCard(props) {
40
40
  return React.createElement(StatValue, null, typeof value === 'number' ? formatNumber(value, 'spaced') : value);
41
41
  }, [isLoading, value, valueSubtext]);
42
42
  const resolvedRightSlot = rightSlot ?? (actions ? React.createElement(DropdownMenu, {
43
- windowWidth: 230,
44
43
  renderHandler: ({
45
44
  onClick,
46
45
  ref,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushwoosh/dumb-components",
3
- "version": "1.1.72",
3
+ "version": "1.1.73",
4
4
  "description": "React components to build Pushwoosh products",
5
5
  "main": "index.js",
6
6
  "module": "index.js",