Skip to content

Commit 0b893da

Browse files
committed
Add hover/focus style to Timepicker and Datepicker
1 parent 04d3667 commit 0b893da

File tree

6 files changed

+51
-4
lines changed

6 files changed

+51
-4
lines changed

components/date-picker/index.jsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,15 +207,17 @@ module.exports = React.createClass({
207207
<input
208208
id={this.inputRefName()}
209209
ref='date'
210-
className='slds-input'
210+
className='slds-input slds-button--neutral slds-text-align--left'
211211
type='text'
212212
placeholder={this.props.placeholder}
213213
value={this.state.strValue}
214214
onKeyDown={this.handleKeyDown}
215215
onChange={this.handleInputChange}
216216
onClick={this.handleClick}
217217
onBlur={this.handleBlur}
218-
onFocus={this.handleFocus}/>
218+
onFocus={this.handleFocus}
219+
style={{cursor: 'pointer'}}
220+
/>
219221
</div>
220222
</div>
221223
{this.popover()}

components/time-picker/index.jsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,15 +255,17 @@ module.exports = React.createClass({
255255
<input
256256
name='date'
257257
ref='date'
258-
className='slds-input'
258+
className='slds-input slds-button--neutral slds-text-align--left'
259259
type='text'
260260
placeholder={this.props.placeholder}
261261
value={this.state.strValue}
262262
onKeyDown={this.handleKeyDown}
263263
onChange={this.handleInputChange}
264264
onClick={this.handleClick}
265265
onBlur={this.handleBlur}
266-
onFocus={this.handleFocus}/>
266+
onFocus={this.handleFocus}
267+
style={{cursor: 'pointer'}}
268+
/>
267269
</div>
268270
</div>
269271
{this.props.modal?this.getModalPopover():this.getSimplePopover()}

stories/date-picker/index.jsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/* eslint-disable indent */
2+
3+
import React from 'react';
4+
import { storiesOf, action } from '@kadira/storybook';
5+
6+
import { DATE_PICKER } from '../../utilities/constants';
7+
import Datepicker from '../../components/date-picker';
8+
9+
const getDatepicker = props => (
10+
<Datepicker {...props} />
11+
);
12+
13+
const handleDateChange = (date) => {
14+
console.log('>>> onDateChange ', date);
15+
}
16+
17+
storiesOf(DATE_PICKER, module)
18+
.addDecorator(getStory => <div className="slds-p-around--medium">{getStory()}</div>)
19+
.add('Base', () => getDatepicker({ onDateChange: handleDateChange }))
20+

stories/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ export default from './button';
55
export default from './card';
66
export default from './context-bar';
77
export default from './data-table';
8+
export default from './date-picker';
89
export default from './forms/input';
910
export default from './forms/input/inline';
1011
export default from './icon';
1112
export default from './spinner';
13+
export default from './time-picker';

stories/time-picker/index.jsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/* eslint-disable indent */
2+
3+
import React from 'react';
4+
import { storiesOf, action } from '@kadira/storybook';
5+
6+
import { TIME_PICKER } from '../../utilities/constants';
7+
import Timepicker from '../../components/time-picker';
8+
9+
const getTimepicker = props => (
10+
<Timepicker {...props} />
11+
);
12+
13+
const handleDateChange = (date, inputStr) => {
14+
console.log('>>> onDateChange ', date, ' inputStr: ',inputStr);
15+
}
16+
17+
storiesOf(TIME_PICKER, module)
18+
.addDecorator(getStory => <div className="slds-p-around--medium">{getStory()}</div>)
19+
.add('Base', () => getTimepicker({ stepInMinutes: 30, onDateChange: handleDateChange }))
20+

utilities/constants.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,4 @@ export const LOOKUP = 'SLDSLookup';
3434
export const MEDIA_OBJECT = 'SLDSMediaObject';
3535
export const MENU_DROPDOWN = 'SLDSMenuDropdown';
3636
export const SPINNER = 'SLDSSpinner';
37+
export const TIME_PICKER = 'SLDSTimepicker';

0 commit comments

Comments
 (0)