@pushwoosh/dumb-components 1.0.14 → 1.0.15

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.
@@ -6,6 +6,7 @@ const defaultPlacements = ['top-start', 'top-end', 'bottom-start', 'bottom-end']
6
6
  export const DropdownMenu = ({
7
7
  renderHandler,
8
8
  children,
9
+ isScrollable,
9
10
  menuZIndex,
10
11
  menuPlacement
11
12
  }) => {
@@ -41,6 +42,7 @@ export const DropdownMenu = ({
41
42
  }), isOpen && React.createElement(Place, {
42
43
  ref: refs.setFloating,
43
44
  style: floatingStyles,
45
+ "$scrollable": isScrollable,
44
46
  "$zIndex": menuZIndex
45
47
  }, typeof children === 'function' ? children() : children));
46
48
  };
@@ -12,6 +12,7 @@ export declare const Place: import("styled-components").StyledComponent<"div", a
12
12
  $gridAutoFlow: string;
13
13
  } & {
14
14
  $zIndex?: number;
15
+ $scrollable?: boolean;
15
16
  }, "$gridAutoFlow">;
16
17
  export declare const DropdownMenuSection: import("styled-components").StyledComponent<"div", any, {
17
18
  $alignContent?: "end" | "start" | "center" | "space-between" | "space-around" | "space-evenly" | "stretch" | undefined;
@@ -1,10 +1,13 @@
1
- import styled from 'styled-components';
1
+ import styled, { css } from 'styled-components';
2
2
  import { Color, Shadow, ShapeRadius, Spacing } from '@pushwoosh/kit-constants';
3
3
  import { Vertical } from '@pushwoosh/kit-helpers';
4
+ const scrollableCss = css(["max-height:248px;overflow-y:auto;"]);
4
5
  export const Place = styled(Vertical).withConfig({
5
6
  displayName: "Place",
6
7
  componentId: "sc-ij8wqc-0"
7
- })(["border:1px solid ", ";background-color:", ";min-width:200px;max-height:300px;overflow-y:auto;border-radius:", ";box-shadow:", ";z-index:", ";"], Color.FORM, Color.FROZEN, ShapeRadius.CONTROL, Shadow.REGULAR, ({
8
+ })(["border:1px solid ", ";background-color:", ";min-width:140px;", " border-radius:", ";box-shadow:", ";z-index:", ";"], Color.FORM, Color.FROZEN, ({
9
+ $scrollable
10
+ }) => $scrollable && scrollableCss, ShapeRadius.CONTROL, Shadow.REGULAR, ({
8
11
  $zIndex
9
12
  }) => $zIndex || 10);
10
13
  export const DropdownMenuSection = styled(Vertical).withConfig({
@@ -8,6 +8,7 @@ export type HandlerProps = {
8
8
  export type DropdownMenuProps = {
9
9
  renderHandler: (args: HandlerProps) => ReactNode;
10
10
  children: (() => ReactNode) | ReactNode;
11
+ isScrollable?: boolean;
11
12
  menuZIndex?: number;
12
13
  menuPlacement?: Placement;
13
14
  };
@@ -3,12 +3,14 @@ import { Button } from '../../../Button';
3
3
  import { DropdownMenu } from '../DropdownMenu';
4
4
  export const DropdownMenuButton = ({
5
5
  label,
6
+ isScrollable,
6
7
  menuZIndex,
7
8
  menuPlacement,
8
9
  children,
9
10
  ...buttonProps
10
11
  }) => {
11
12
  return React.createElement(DropdownMenu, {
13
+ isScrollable: isScrollable,
12
14
  menuZIndex: menuZIndex,
13
15
  menuPlacement: menuPlacement,
14
16
  renderHandler: ({
@@ -3,6 +3,7 @@ import { type ReactNode } from 'react';
3
3
  import { type RequiredButtonProps } from '../../../Button';
4
4
  export type DropdownMenuButtonProps = {
5
5
  label: ReactNode;
6
+ isScrollable?: boolean;
6
7
  menuZIndex?: number;
7
8
  menuPlacement?: Placement;
8
9
  color: RequiredButtonProps['color'];
@@ -3,7 +3,7 @@ import { Color, Spacing, UnitSize } from '@pushwoosh/kit-constants';
3
3
  export const DropdownMenuItemStyled = styled.button.withConfig({
4
4
  displayName: "DropdownMenuItemStyled",
5
5
  componentId: "sc-1wmyvxp-0"
6
- })(["appearance:none;display:flex;align-items:center;padding:0 ", ";height:", ";border:none;color:", ";background:none;cursor:pointer;&:hover{background:", ";color:", ";}&:disabled{color:", ";cursor:not-allowed;}"], Spacing.S3, UnitSize.FIELD_HEIGHT, ({
6
+ })(["appearance:none;display:flex;align-items:center;padding:0 ", ";height:", ";border:none;color:", ";background:none;cursor:pointer;&:hover{background:", ";color:", ";}&:disabled{color:", ";cursor:not-allowed;}"], Spacing.S4, UnitSize.FIELD_HEIGHT, ({
7
7
  $active,
8
8
  $danger
9
9
  }) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushwoosh/dumb-components",
3
- "version": "1.0.14",
3
+ "version": "1.0.15",
4
4
  "description": "React components to build Pushwoosh products",
5
5
  "main": "index.js",
6
6
  "module": "index.js",