package
Dropdown menu from Talk by teambition
npm install react-lite-layeredGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Latest published Feb 1, 2016
latest
Dialog, Modals, Popover, Overlay components from Talk by Teambition.
Demo http://ui.talk.ai/react-lite-layered/
Inspired by http://stackoverflow.com/a/26789089/883571
Notice,
0.1.xis using React0.14.x, while0.0.xwas using React0.13.
This module contains 6 layered components. There are some common properties:
show(bool.isRequired) controls visibilityname(string, defaults to default), CSS hook "is-for-#{name}"T = React.PropTypes
propTypes:
# this component accepts children
name: T.string
title: T.string
onCloseClick: T.func.isRequired
showCornerClose: T.bool
show: T.bool.isRequiredpropTypes:
# this component accepts children
title: T.string
name: T.string
onPopoverClose: T.func
positionAlgorithm: T.func # could be customized
baseArea: T.object.isRequired # top, right, down, left
showClose: T.bool.isRequired
show: T.bool.isRequiredbaseArea(object.isRequired) positions get from Element.getBoundingClientRect
positionAlgorithm(func, optional) if given, takes in baseArea and returns CSS styles
propTypes:
# this component accepts children
show: T.bool.isRequired
name: T.stringNotice: click content to close overlay, not the black area.
T = React.PropTypes
propTypes:
# this component accepts children
name: T.string
title: T.string
onCloseClick: T.func.isRequired
showCornerClose: T.bool
show: T.bool.isRequiredChild structure
div
.header (fixed at top)
.content (scrollable)
.footer (fixed at bottom)T = React.PropTypes
propTypes:
# this component accepts children
name: T.string
title: T.string
onCloseClick: T.func.isRequired
showCornerClose: T.bool
show: T.bool.isRequiredTransition component with timeout. Read more at: https://github.com/facebook/react/issues/1326
These modules contains bussiness logics of Teambition. I will suggest copy code and make create you own.
And the layered mixin is tricky. I hope it improved in the future.
npm i --save react-lite-layeredRead src/demo/main.jsx(compiles with Babel) for details:
import {default as React} from 'react';
import {Popover, Modal, Overlay} from 'react-lite-layered';
import './modal.css';
import './popover.css';
import './overlay.css';
import './fade.css';
import './demo.css';
var App = React.createClass({
displayName: 'page-app',
getInitialState: function () {
return {
showModal: false,
showPopover: false,
showOverlay: false
npm iYou need a static file server for the HTML files. Personally I suggest using Nginx.
Develop:
gulp html # regenerate index.html
webpack-dev-server --hot # enable live-reloadingor simply
npm run devBuild (Pack and optimize js, reivision js and add entry in index.html):
gulp buildMIT
boshen
boshenc@gmail.com
Estimated unpacked size across 25 packages.
14.3 MB
Includes dependencies.
7 direct · 4 outdated
^0.14.7
19.3.1
^0.7.2
2.15.0
^2.0.0
2.2.1
^0.14.7
19.3.1
^2.2.3
2.5.1
^0.1.2
0.1.3
15.6.2