pebble-web 2.7.1 → 2.8.0

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pebble-web",
3
- "version": "2.7.1",
3
+ "version": "2.8.0",
4
4
  "author": "ritz078 <rkritesh078@gmail.com>",
5
5
  "license": "MIT",
6
6
  "main": "dist/pebble-web.js",
@@ -44,12 +44,12 @@
44
44
  "utility-types": "^3.10.0"
45
45
  },
46
46
  "devDependencies": {
47
- "pebble-shared": "^2.7.0"
47
+ "pebble-shared": "^2.8.0"
48
48
  },
49
49
  "greenkeeper": {
50
50
  "ignore": [
51
51
  "rheostat"
52
52
  ]
53
53
  },
54
- "gitHead": "d569cdeb12f659905b61f0642b91a5b3c1371784"
54
+ "gitHead": "e72252d18d05ea6d917fcfa1d042e12fead90019"
55
55
  }
@@ -21,14 +21,16 @@ const Button: React.FunctionComponent<ButtonProps> = ({
21
21
  className,
22
22
  showRipple = true,
23
23
  loading,
24
+ filled,
24
25
  size = "small",
25
26
  buttonProps
26
27
  }: ButtonProps) => {
27
28
  const disableAction = disabled || loading;
28
29
 
29
- const filled = size !== "x-small";
30
+ const _filled = size !== "x-small" && filled !== false;
31
+
30
32
  const _className = cx(
31
- getButtonStyle(size, type, !!showShadow, filled),
33
+ getButtonStyle(size, type, !!showShadow, _filled),
32
34
  className
33
35
  );
34
36
 
@@ -38,9 +38,12 @@ const modifiers = {
38
38
  };
39
39
 
40
40
  export default class DateInput extends React.PureComponent<
41
- DateInputProps,
41
+ DateInputProps & typeof DateInput.defaultProps,
42
42
  DateInputState
43
43
  > {
44
+ static defaultProps = {
45
+ placement: "bottom-start"
46
+ };
44
47
  state: Readonly<DateInputState> = {
45
48
  stringInput: ""
46
49
  };
@@ -85,12 +88,21 @@ export default class DateInput extends React.PureComponent<
85
88
  placeholder,
86
89
  value: propsValue,
87
90
  disabled,
88
- errorMessage
91
+ errorMessage,
92
+ placement,
93
+ wrapperClassName,
94
+ initiallyOpen
89
95
  } = this.props;
90
96
 
97
+ const _wrapperClassName = cx(wrapperStyle, wrapperClassName);
98
+
99
+ const _dropDownClassName = cx(
100
+ dropDownClassName,
101
+ this.props.dropDownClassName
102
+ );
91
103
  return (
92
104
  <DropDown
93
- dropDownClassName={dropDownClassName}
105
+ dropDownClassName={_dropDownClassName}
94
106
  labelComponent={({ toggleDropdown }) => (
95
107
  <Rifm
96
108
  value={this.state.stringInput}
@@ -102,7 +114,7 @@ export default class DateInput extends React.PureComponent<
102
114
  onChange={noop}
103
115
  type={"tel"}
104
116
  value={value}
105
- placeholder={placeholder}
117
+ placeholder={`${placeholder} DD/MM/YYYY`}
106
118
  onClick={() => {
107
119
  if (disabled) return;
108
120
  toggleDropdown();
@@ -120,9 +132,10 @@ export default class DateInput extends React.PureComponent<
120
132
  )}
121
133
  </Rifm>
122
134
  )}
123
- className={wrapperStyle}
124
- placement="bottom-start"
135
+ className={_wrapperClassName}
136
+ placement={placement}
125
137
  modifiers={modifiers}
138
+ initiallyOpen={initiallyOpen}
126
139
  >
127
140
  {({ toggle }) => (
128
141
  <>
@@ -80,7 +80,7 @@ class SideBar extends React.PureComponent<SidebarProps> {
80
80
  <Ink />
81
81
  </div>
82
82
 
83
- <div style={{ overflowY: "scroll", height: "100vh" }}>
83
+ <div style={{ overflowY: "scroll", height: "100%" }}>
84
84
  {children}
85
85
  </div>
86
86
  </animated.div>
@@ -25,5 +25,5 @@ export const errorStyle = css({
25
25
  backgroundColor: colors.red.lightest,
26
26
  color: colors.red.darker,
27
27
  textAlign: "left",
28
- padding: "11px 30px",
29
- })
28
+ padding: "11px 30px"
29
+ });
@@ -1,6 +1,7 @@
1
1
  import { SimpleInputProps } from "./Input";
2
2
  import { Omit } from "utility-types";
3
3
  import { DateSingle } from "./Calendar";
4
+ import { Placement } from "popper.js";
4
5
 
5
6
  export interface DateInputProps {
6
7
  onChange: (date?: number) => void;
@@ -10,6 +11,10 @@ export interface DateInputProps {
10
11
  calendarProps?: DateSingle;
11
12
  disabled?: boolean;
12
13
  errorMessage?: string;
14
+ placement?: Placement;
15
+ wrapperClassName?: string;
16
+ dropDownClassName?: string;
17
+ initiallyOpen?: boolean;
13
18
  }
14
19
 
15
20
  export interface DateInputState {