pebble-web 2.4.2 → 2.5.1

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.4.2",
3
+ "version": "2.5.1",
4
4
  "author": "ritz078 <rkritesh078@gmail.com>",
5
5
  "license": "MIT",
6
6
  "main": "dist/pebble-web.js",
@@ -44,11 +44,12 @@
44
44
  "utility-types": "^3.10.0"
45
45
  },
46
46
  "devDependencies": {
47
- "pebble-shared": "^2.3.2"
47
+ "pebble-shared": "^2.4.1"
48
48
  },
49
49
  "greenkeeper": {
50
50
  "ignore": [
51
51
  "rheostat"
52
52
  ]
53
- }
53
+ },
54
+ "gitHead": "8641dd853d02540c71da6cce7ea46429d310d04d"
54
55
  }
@@ -5,7 +5,8 @@ import {
5
5
  dateClass,
6
6
  dropDownClassName,
7
7
  inputStyle,
8
- wrapperStyle
8
+ wrapperStyle,
9
+ errorStyle
9
10
  } from "./styles/Date.styles";
10
11
  import Calendar from "./Calendar";
11
12
  import Input from "./Input";
@@ -83,7 +84,8 @@ export default class DateInput extends React.PureComponent<
83
84
  inputProps,
84
85
  placeholder,
85
86
  value: propsValue,
86
- disabled
87
+ disabled,
88
+ errorMessage
87
89
  } = this.props;
88
90
 
89
91
  return (
@@ -123,17 +125,20 @@ export default class DateInput extends React.PureComponent<
123
125
  modifiers={modifiers}
124
126
  >
125
127
  {({ toggle }) => (
126
- <Calendar
127
- hideShadow
128
- className={dateClass}
129
- selected={propsValue ? new Date(propsValue) : undefined}
130
- {...calendarProps}
131
- range={false}
132
- onChange={date => {
133
- this.onCalendarDateChange(date);
134
- toggle();
135
- }}
136
- />
128
+ <>
129
+ <Calendar
130
+ hideShadow
131
+ className={dateClass}
132
+ selected={propsValue ? new Date(propsValue) : undefined}
133
+ {...calendarProps}
134
+ range={false}
135
+ onChange={date => {
136
+ this.onCalendarDateChange(date);
137
+ toggle();
138
+ }}
139
+ />
140
+ {errorMessage && <div className={errorStyle}>{errorMessage}</div>}
141
+ </>
137
142
  )}
138
143
  </DropDown>
139
144
  );
@@ -1,4 +1,6 @@
1
1
  import { css } from "emotion";
2
+ import { colors } from "pebble-shared";
3
+ import { typography } from "../../theme";
2
4
  import { inputMarginBottom } from "./Input.styles";
3
5
 
4
6
  export const dateClass = css({
@@ -17,3 +19,11 @@ export const inputStyle = css({
17
19
  export const wrapperStyle = css({
18
20
  marginBottom: 20
19
21
  });
22
+
23
+ export const errorStyle = css({
24
+ ...typography.s.bold,
25
+ backgroundColor: colors.red.lightest,
26
+ color: colors.red.darker,
27
+ textAlign: "left",
28
+ padding: "11px 30px",
29
+ })
@@ -9,6 +9,7 @@ export interface DateInputProps {
9
9
  inputProps?: Omit<SimpleInputProps, "value" | "onChange" | "placeholder">;
10
10
  calendarProps?: DateSingle;
11
11
  disabled?: boolean;
12
+ errorMessage?: string;
12
13
  }
13
14
 
14
15
  export interface DateInputState {