diff --git a/components/SLDSMenuPicklist/List.jsx b/components/SLDSMenuList/List.jsx
similarity index 100%
rename from components/SLDSMenuPicklist/List.jsx
rename to components/SLDSMenuList/List.jsx
diff --git a/components/SLDSMenuPicklist/ListItem.jsx b/components/SLDSMenuList/ListItem.jsx
similarity index 100%
rename from components/SLDSMenuPicklist/ListItem.jsx
rename to components/SLDSMenuList/ListItem.jsx
diff --git a/components/SLDSMenuPicklist/ListItemLabel.jsx b/components/SLDSMenuList/ListItemLabel.jsx
similarity index 98%
rename from components/SLDSMenuPicklist/ListItemLabel.jsx
rename to components/SLDSMenuList/ListItemLabel.jsx
index 7341857efe..00df703f41 100644
--- a/components/SLDSMenuPicklist/ListItemLabel.jsx
+++ b/components/SLDSMenuList/ListItemLabel.jsx
@@ -18,7 +18,7 @@ const propTypes = {
isHighlighted: React.PropTypes.bool,
isSelected: React.PropTypes.bool,
label: React.PropTypes.string,
- value: React.PropTypes.string,
+ value: React.PropTypes.any,
};
const defaultProps = {
data: {},
diff --git a/components/SLDSMenuList/index.jsx b/components/SLDSMenuList/index.jsx
new file mode 100644
index 0000000000..6551da9246
--- /dev/null
+++ b/components/SLDSMenuList/index.jsx
@@ -0,0 +1,155 @@
+/*
+Copyright (c) 2015, salesforce.com, inc. All rights reserved.
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+Neither the name of salesforce.com, inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+import React from "react";
+import ReactDOM from "react-dom";
+import isEqual from "lodash.isequal";
+
+import {KEYS, EventUtil} from "../utils";
+import SLDSIcon from "../SLDSIcon";
+import List from "./List";
+import ListItemLabel from "./ListItemLabel";
+
+const displayName = "SLDSMenuList";
+const propTypes = {
+ className: React.PropTypes.string,
+ /**
+ * If true, renders checkmark icon on the selected Menu Item.
+ */
+ checkmark: React.PropTypes.bool,
+ label: React.PropTypes.string,
+ /**
+ * Custom element that overrides the default Menu Item component.
+ */
+ listItemRenderer: React.PropTypes.node,
+ /**
+ * If true, component renders specifically to work inside Modal.
+ */
+ onClick: React.PropTypes.func,
+ onSelect: React.PropTypes.func,
+ /**
+ * Menu item data.
+ */
+ options: React.PropTypes.array.isRequired,
+};
+const defaultProps = {
+ checkmark: true
+};
+
+/**
+ * The SLDSMenuPicklist component is a variant of the Ligtning Design System Menu component.
+ */
+class SLDSMenuPicklist extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ highlightedIndex: 0,
+ isOpen: false,
+ lastBlurredIndex: -1,
+ lastBlurredTimeStamp: -1,
+ selectedIndex: this.props.selectedIndex,
+ /* triggerId is the id of the element that triggers the Menu to open.
+ * Need this for aria-labelledby on
in Menu for accessibility. */
+ triggerId: this.props.label ? this.props.label.replace(/\s+/g, '') + '_Button': 'Picklist_Button',
+ };
+
+ }
+
+ componentWillUnmount(){
+ this.isUnmounting = true;
+ }
+
+ componentDidUpdate( prevProps, prevState) {
+ if(this.state.lastBlurredTimeStamp !== prevState.lastBlurredTimeStamp){
+ if(this.state.lastBlurredIndex === this.state.highlightedIndex){
+ this.handleClose();
+ }
+ }
+ if(this.state.selectedIndex !== prevState.selectedIndex){
+ this.handleClose();
+ }
+
+ if(this.props.selectedIndex !== prevProps.selectedIndex ||
+ !isEqual(this.props.options, prevProps.options)){
+ if (this.props.selectedIndex !== this.state.selectedIndex) {
+ this.handleSelect(this.props.selectedIndex);
+ }
+ }
+ }
+
+ handleSelect(index) {
+ this.setState({selectedIndex: index})
+ if(this.props.onSelect){
+ this.props.onSelect(index);
+ }
+ }
+
+ handleClose() {
+ if(this.props.onCancel){
+ this.props.onCancel();
+ }
+ }
+
+ handleMouseDown(event){
+ EventUtil.trapImmediate(event);
+ }
+
+ handleUpdateHighlighted(nextIndex){
+ this.setState({highlightedIndex: nextIndex});
+ }
+
+ handleListBlur(){
+ if(this.props.onListBlur){
+ this.props.onListBlur();
+ }
+ }
+
+ handleCancel () {
+ if(this.props.onCancel){
+ this.props.onCancel();
+ }
+ }
+
+ getListItemRenderer() {
+ return this.props.listItemRenderer?this.props.listItemRenderer:ListItemLabel;
+ }
+
+ handleListItemBlur (index, relatedTarget) {
+ this.setState({
+ lastBlurredIndex: index,
+ lastBlurredTimeStamp: Date.now()
+ });
+ }
+
+ render() {
+ return ;
+ }
+
+}
+
+
+SLDSMenuPicklist.displayName = displayName;
+SLDSMenuPicklist.propTypes = propTypes;
+SLDSMenuPicklist.defaultProps = defaultProps;
+
+module.exports = SLDSMenuPicklist;
+module.exports.ListItemLabel = ListItemLabel;
+
diff --git a/components/SLDSMenuPicklist/index.jsx b/components/SLDSMenuPicklist/index.jsx
index a2dca9852a..ca0ecf3735 100644
--- a/components/SLDSMenuPicklist/index.jsx
+++ b/components/SLDSMenuPicklist/index.jsx
@@ -14,9 +14,8 @@ import isEqual from "lodash.isequal";
import SLDSPopover from "../SLDSPopover";
import {KEYS, EventUtil} from "../utils";
import SLDSIcon from "../SLDSIcon";
-import List from "./List";
-import ListItem from "./ListItem";
-import ListItemLabel from "./ListItemLabel";
+import List from "../SLDSMenuList/List";
+import ListItemLabel from "../SLDSMenuList/ListItemLabel";
const displayName = "SLDSMenuPicklist";
const propTypes = {
@@ -298,6 +297,5 @@ SLDSMenuPicklist.propTypes = propTypes;
SLDSMenuPicklist.defaultProps = defaultProps;
module.exports = SLDSMenuPicklist;
-module.exports.ListItem = ListItem;
module.exports.ListItemLabel = ListItemLabel;
diff --git a/components/SLDSTimepicker/index.jsx b/components/SLDSTimepicker/index.jsx
new file mode 100644
index 0000000000..bbdaf5ba78
--- /dev/null
+++ b/components/SLDSTimepicker/index.jsx
@@ -0,0 +1,270 @@
+/*
+Copyright (c) 2015, salesforce.com, inc. All rights reserved.
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+Neither the name of salesforce.com, inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+'use strict';
+
+import React from 'react';
+import ReactDOM from 'react-dom';
+import SLDSPopover from '../SLDSPopover';
+import InputIcon from '../SLDSIcon/InputIcon';
+import SLDSMenuList from '../SLDSMenuList';
+import ListItemLabel from '../SLDSMenuList/ListItemLabel';
+
+import {KEYS,EventUtil} from '../utils';
+
+const displayName = 'SLDSTimepicker';
+const propTypes = {
+
+ /**
+ * Time formatting function
+ */
+ formatter: React.PropTypes.func,
+
+ /**
+ * Parsing date string into Date
+ */
+ parser: React.PropTypes.func,
+
+ /**
+ * Date
+ */
+ value: React.PropTypes.instanceOf(Date),
+
+ stepInMinutes: React.PropTypes.number,
+
+ strValue: React.PropTypes.string,
+
+
+
+};
+const defaultProps = {
+ formatter (date) {
+ if(date){
+ return date.toLocaleTimeString(navigator.language, {hour: '2-digit', minute:'2-digit'});
+ }
+ },
+ onDateChange (date) {
+ console.log('onDateChange should be defined');
+ },
+ parser (timeStr) {
+ const date = new Date();
+ const dateStr = date.toLocaleString(navigator.language, {year: 'numeric', month: 'numeric', day: 'numeric'});
+ return new Date(dateStr+' '+timeStr);
+ },
+ placeholder: 'Pick Time',
+ value: null,
+ stepInMinutes: 30
+};
+
+module.exports = React.createClass({
+
+ displayName: displayName,
+
+ propTypes: propTypes,
+
+ getDefaultProps(){
+ return defaultProps;
+ },
+
+ getInitialState(){
+ return {
+ isOpen:false,
+ value:this.props.value,
+ strValue:this.props.strValue,
+ options:this.getOptions()
+ };
+ },
+
+ handleChange(date, strValue) {
+ this.setState({
+ value:date,
+ strValue:strValue,
+ isOpen:false
+ });
+ if(this.props.onDateChange){
+ this.props.onDateChange(date, strValue);
+ }
+ },
+
+ handleClose() {
+ this.setState({isOpen:false});
+ this.setFocus();
+ },
+
+ handleClick() {
+ this.setState({isOpen:true});
+ },
+
+ handleFocus() {
+// this.setState({isOpen:true})
+ },
+
+ handleBlur() {
+// this.setState({isOpen:false})
+ },
+
+ setFocus () {
+ if(this.isMounted()){
+ ReactDOM.findDOMNode(this.refs.date).focus();
+ }
+ },
+
+ parseDate(strValue) {
+ const d = this.props.parser(strValue);
+ if ( Object.prototype.toString.call(d) === "[object Date]" ) {
+ if ( !isNaN( d.getTime() ) ) {
+ return d;
+ }
+ }
+ return new Date();
+ },
+
+ getOptions() {
+ const d = new Date();
+ let options = [];
+ d.setHours(0);
+ d.setMinutes(0);
+ d.setSeconds(0);
+ d.setMilliseconds(0);
+ const curDate = new Date(d);
+ while(d.getDate() === curDate.getDate()){
+ const formatted = this.props.formatter(curDate);
+ options.push({
+ label:formatted,
+ value:new Date(curDate)
+ });
+ curDate.setMinutes(curDate.getMinutes()+this.props.stepInMinutes);
+ }
+ return options;
+ },
+
+ getListItemRenderer() {
+ return this.props.listItemRenderer?this.props.listItemRenderer:ListItemLabel;
+ },
+
+ getValueByIndex(index){
+ const option = this.state.options[index];
+ if(option){
+ return this.state.options[index];
+ }
+ },
+
+ handleSelect(index) {
+ const val = this.getValueByIndex(index);
+ if(val && val.value){
+ this.handleChange(val.value, val.label);
+ }
+ this.handleClose();
+ },
+
+ handleCancel(){
+ this.handleClose();
+ },
+
+ getPopoverContent() {
+ return ;
+ },
+
+ getSimplePopover() {
+ return (
+ !this.props.disabled && this.state.isOpen?
+