@pushwoosh/dumb-components 1.1.80 → 1.1.81

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.
@@ -3,7 +3,7 @@ import { Color } from '@pushwoosh/kit-constants';
3
3
  import { Horizontal, useClickAway, Vertical } from '@pushwoosh/kit-helpers';
4
4
  import { CalendarIcon } from '@pushwoosh/kit-icons';
5
5
  import { stringifyValue } from './helpers';
6
- import { PopoverContent } from './styles';
6
+ import { PopoverContent, PresetsContainer } from './styles';
7
7
  import { Button } from '../../Button';
8
8
  import { Chip } from '../../Chip';
9
9
  import { Popover } from '../../Popover';
@@ -15,7 +15,8 @@ export const CalendarDropdown = props => {
15
15
  buttonColor = 'secondary',
16
16
  buttonSize = 'field',
17
17
  buttonTextCustom,
18
- allowEmpty
18
+ allowEmpty,
19
+ buttonView
19
20
  } = props;
20
21
  const isRangePicker = mode === 'range-date' || mode === 'range-datetime';
21
22
  const withTime = mode === 'single-datetime' || mode === 'range-datetime';
@@ -59,6 +60,7 @@ export const CalendarDropdown = props => {
59
60
  }, React.createElement(Button, {
60
61
  boxRef: buttonRef,
61
62
  type: "button",
63
+ view: buttonView,
62
64
  size: buttonSize,
63
65
  color: buttonColor,
64
66
  icon: React.createElement(CalendarIcon, {
@@ -77,17 +79,7 @@ export const CalendarDropdown = props => {
77
79
  }, React.createElement(PopoverContent, {
78
80
  "$isShaking": isShaking,
79
81
  onAnimationEnd: () => setIsShaking(false)
80
- }, React.createElement(Vertical, null, presets && presets.length > 0 && React.createElement(Horizontal, {
81
- "$padding": {
82
- horizontal: 16,
83
- vertical: 12
84
- },
85
- "$border": {
86
- bottom: `1px solid ${Color.DIVIDER}`
87
- },
88
- "$justifyContent": "start",
89
- "$gap": 4
90
- }, presets.map((preset, i) => React.createElement(Chip, {
82
+ }, React.createElement(Vertical, null, presets && presets.length > 0 && React.createElement(PresetsContainer, null, presets.map((preset, i) => React.createElement(Chip, {
91
83
  key: i,
92
84
  onClick: () => onChangeHandler(preset.value)
93
85
  }, preset.label))), React.createElement(Horizontal, {
@@ -1,3 +1,4 @@
1
1
  export declare const PopoverContent: import("styled-components").StyledComponent<"div", any, {
2
2
  $isShaking?: boolean;
3
3
  }, never>;
4
+ export declare const PresetsContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -6,4 +6,8 @@ export const PopoverContent = styled.div.withConfig({
6
6
  componentId: "sc-h6jz87-0"
7
7
  })(["overflow:hidden;box-shadow:", ";background:", ";", ""], Shadow.REGULAR, Color.CLEAR, ({
8
8
  $isShaking
9
- }) => $isShaking && css(["animation:", " 0.4s ease-in-out;"], shakeAnimation));
9
+ }) => $isShaking && css(["animation:", " 0.4s ease-in-out;"], shakeAnimation));
10
+ export const PresetsContainer = styled.div.withConfig({
11
+ displayName: "PresetsContainer",
12
+ componentId: "sc-h6jz87-1"
13
+ })(["display flex;flex-wrap:wrap;padding:12px 16px;border-bottom:1px solid ", ";justify-content:start;gap:4px;"], Color.DIVIDER);
@@ -5,6 +5,7 @@ import type { DateStruct, DateTimeStruct, RangeValue, TzValue } from '../types';
5
5
  interface BaseProps {
6
6
  buttonSize?: RequiredButtonProps['size'];
7
7
  buttonColor?: RequiredButtonProps['color'];
8
+ buttonView?: RequiredButtonProps['view'];
8
9
  buttonTextCustom?: string;
9
10
  allowEmpty?: boolean;
10
11
  }
package/Chip/styles.js CHANGED
@@ -4,9 +4,11 @@ import { variants } from './Chip.constants';
4
4
  export const ChipStyled = styled.div.withConfig({
5
5
  displayName: "ChipStyled",
6
6
  componentId: "sc-e2g39l-0"
7
- })(["display:inline-flex;min-height:24px;padding:0 ", " 0 8px;align-items:center;gap:4px;cursor:default;border-radius:4px;color:", ";background:", ";font-weight:400;line-height:140%;& > .closeIcon{cursor:pointer;transition:transform 0.2s;&:hover{transform:scale(1.3);}}"], ({
7
+ })(["display:inline-flex;min-height:24px;padding:0 ", " 0 8px;align-items:center;gap:4px;cursor:", ";border-radius:4px;color:", ";background:", ";font-weight:400;line-height:140%;& > .closeIcon{transition:transform 0.2s;&:hover{transform:scale(1.3);}}"], ({
8
8
  $closeable
9
9
  }) => $closeable ? '4px' : '8px', ({
10
+ $readOnly
11
+ }) => $readOnly ? 'default' : 'pointer', ({
10
12
  $variant,
11
13
  $selected,
12
14
  $readOnly
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushwoosh/dumb-components",
3
- "version": "1.1.80",
3
+ "version": "1.1.81",
4
4
  "description": "React components to build Pushwoosh products",
5
5
  "main": "index.js",
6
6
  "module": "index.js",