7z��'�m����&5�N// ========================================================================== // Animations – Selective animations from Animate.css - http://daneden.me/animate // ========================================================================== // Fade In @keyframes fadeIn { 0% { opacity: 0; } 100% { opacity: 1; } } .fade-in { animation-name: fadeIn; } // Fade In Down @keyframes fadeInDown { 0% { opacity: 0; transform: translate3d(0, -30px, 0); } 100% { opacity: 1; transform: none; } } .fade-in-down { animation-name: fadeInDown; } // Fade In Down Big @keyframes fadeInDownBig { 0% { opacity: 0; transform: translate3d(0, -100%, 0); } 100% { opacity: 1; transform: none; } } .fade-in-down-big { animation-name: fadeInDownBig; } // Fade In Left @keyframes fadeInLeft { 0% { opacity: 0; transform: translate3d(-30px, 0, 0); } 100% { opacity: 1; transform: none; } } .fade-in-left { animation-name: fadeInLeft; } // Fade In Left Big @keyframes fadeInLeftBig { 0% { opacity: 0; transform: translate3d(-100%, 0, 0); } 100% { opacity: 1; transform: none; } } .fade-in-left-big { animation-name: fadeInLeftBig; } // Fade In Right @keyframes fadeInRight { 0% { opacity: 0; transform: translate3d(30px, 0, 0); } 100% { opacity: 1; transform: none; } } .fade-in-right { animation-name: fadeInRight; } // Fade In Right Big @keyframes fadeInRightBig { 0% { opacity: 0; transform: translate3d(100%, 0, 0); } 100% { opacity: 1; transform: none; } } .fade-in-right-big { animation-name: fadeInRightBig; } // Fade In Up @keyframes fadeInUp { 0% { opacity: 0; transform: translate3d(0, 30px, 0); } 100% { opacity: 1; transform: none; } } .fade-in-up { animation-name: fadeInUp; } // Fade In Up Big @keyframes fadeInUpBig { 0% { opacity: 0; transform: translate3d(0, 100%, 0); } 100% { opacity: 1; transform: none; } } .fade-in-up-big { animation-name: fadeInUpBig; }// ========================================================================== // Base – Assets // ========================================================================== // Custom Buttons .button { border: 1px solid #d7d7d7; background-color: #f3f3f3; line-height: normal; padding: .5em 1em; text-decoration: none; color: #363636; display: inline-block; -webkit-transition: all 0.3s; -moz-transition: all 0.3s; transition: all 0.3s; &:hover, &:active { text-decoration: none; } &:hover { background: #f9f9f9; } } .button-primary { // Add your styles here } .button-secondary { // Add your styles here } // Button Styled as Link .button-link { color: @base-link-color; text-decoration: underline; border: 0; background: transparent; padding: 0; &:hover { text-decoration: none; } &:active { outline: 0; } } // Custom Select .select { overflow: hidden; position: relative; display: block; &:before { content: ""; border: 6px solid transparent; border-top-color: #676767; top: 50%; right: 10px; margin-top: -3px; pointer-events: none; position: absolute; } select { -webkit-appearance: none; -moz-appearance: none; height: 35px; width: 100%; padding: 0 10px; line-height: normal; border: 1px solid @base-field-border-color; background: #fff; display: block; } select::-ms-expand { display: none; } select:focus { border-color: @base-field-border-color-focus; } select:-moz-focusring { color: transparent; text-shadow: 0 0 0 @base-field-color; border-color: @base-field-border-color-focus; } }// ========================================================================== // Base – Blockquote // ========================================================================== blockquote, .blockquote { font-family: @base-blockquote-font-family; font-weight: @base-font-weight; color: @base-blockquote-color; font-style: italic; margin: 3em 0; p { .font-size(@base-blockquote-font-size); .line-height(@base-blockquote-line-height); margin-bottom: .4em; } cite { .font-size(@base-font-size - 3); .line-height(@base-line-height - 3); font-weight: @font-700; font-style: normal; color: @base-blockquote-cite-color; } }// ========================================================================== // Base – Code // ========================================================================== code, kbd, pre, samp { .font-size(@base-code-font-size); .line-height(@base-code-line-height); word-wrap: break-word; font-family: @base-code-font-family; color: @base-code-color; background-color: @base-code-background-color; font-weight: normal; padding: 5px; white-space: pre-wrap; } pre { padding: 10px; overflow: auto; border: 1px solid @base-code-border-color; }// ========================================================================== // Base – Forms // ========================================================================== // Form, Fieldset and Legend fieldset, legend { border: 0; margin: 0; padding: 0; } legend { .font-size(@base-font-size + 2); .line-height(@base-line-height + 2); font-weight: @font-700; } .form { padding-top: 1em; padding-bottom: 1em; } // All Form Elements label, button, input, optgroup, select, textarea { color: @base-field-color; font: inherit; margin: 0; } // Inputs input { line-height: normal; } input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="number"], input[type="date"] { height: 36px; padding: 0 10px; background-color: #fff; border: 1px solid #ccc; -webkit-appearance: none; -moz-appearance: textfield; -webkit-border-radius: 0; border-radius: 0; &:focus { border-color: @base-field-border-color-focus; outline: 0; } } input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; } input[type="date"]::-webkit-inner-spin-button { display: none; -webkit-appearance: none; } input[type="checkbox"], input[type="radio"] { box-sizing: border-box; padding: 0; } input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { height: auto; } input[type="search"] { -webkit-appearance: textfield; -moz-appearance: textfield; -moz-box-sizing: content-box; -webkit-box-sizing: content-box; box-sizing: content-box; } input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; } // Text Area textarea { background-color: #fff; border: 1px solid @base-field-border-color; overflow: auto; &:focus { border-color: @base-field-border-color-focus; outline: 0; } } // Select select { text-transform: none; height: 36px; padding: 0 10px; background-color: #fff; border: 1px solid @base-field-border-color; &:focus { border-color: @base-field-border-color-focus; outline: 0; } } optgroup { font-weight: @font-700; } // Buttons button { overflow: visible; text-transform: none; } button, html input[type="button"], input[type="reset"], input[type="submit"] { -webkit-appearance: button; cursor: pointer; } button[disabled], html input[disabled] { cursor: default; } button::-moz-focus-inner, input::-moz-focus-inner { border: 0; padding: 0; } // Placeholder Colour ::-webkit-input-placeholder { color: @base-placeholder-color; } :-moz-placeholder { color: @base-placeholder-color; } ::-moz-placeholder { color: @base-placeholder-color; } :-ms-input-placeholder { color: @base-placeholder-color; }// ========================================================================== // Base – Global // ========================================================================== // Body body { font-family: @base-font-family; .font-size(@base-font-size); .line-height(@base-line-height); color: @base-font-color; font-weight: @base-font-weight; background: @base-background-color; } // Paragraph p { margin: 0 0 1em 0; } // Links a { color: @base-link-color; background: transparent; text-decoration: underline; &:active, &:hover { outline: 0; text-decoration: none; } } // Headings h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6 { font-family: @heading-font-family; margin: 0; } h1, .h1 { .font-size(@h1-font-size); .line-height(@h1-line-height); margin-top: .7em; margin-bottom: .5em; color: @h1-color; font-weight: @h1-font-weight; } h2, .h2 { .font-size(@h2-font-size); .line-height(@h2-line-height); margin-top: 1.4em; margin-bottom: .2em; color: @h2-color; font-weight: @h2-font-weight; } h3, .h3 { .font-size(@h3-font-size); .line-height(@h3-line-height); margin-top: 1em; margin-bottom: .2em; color: @h3-color; font-weight: @h3-font-weight; } h4, .h4 { .font-size(@h4-font-size); .line-height(@h4-line-height); margin-top: 1em; margin-bottom: .2em; color: @h4-color; font-weight: @h4-font-weight; } h5, .h5 { .font-size(@h5-font-size); .line-height(@h5-line-height); margin-top: 1em; margin-bottom: .1em; color: @h5-color; font-weight: @h5-font-weight; } h6, .h6 { .font-size(@h6-font-size); .line-height(@h6-line-height); margin-top: 1em; margin-bottom: .1em; color: @h6-color; font-weight: @h6-font-weight; } // Bold and Italics b, strong, .strong { font-weight: @font-700; } em, .em { font-style: italic; } // Abbreviation abbr[title], .abbr[title] { border-bottom: 1px dotted; } // Definition dfn { font-style: italic; } // Small small, .small { font-size: 80%; } // Mark mark, .mark { background: #ff0; color: #000; } // Sub and Sup sub, .sub, sup, .sup { font-size: 75%; line-height: 0; position: relative; vertical-align: baseline; } sup, .sup { top: -0.5em; } sub, .sub { bottom: -0.25em; } // Del del, .del { text-decoration: line-through; } // Images figure { margin: 1em 40px; } // Horizontal Rules hr, .hr { -moz-box-sizing: content-box; box-sizing: content-box; height: 1px; background: #eee; border: 0; margin-top: 1em; margin-bottom: 1em; }// ========================================================================== // Base – Non-Responsive Grid // ========================================================================== // Micro Clearfix - http://nicolasgallagher.com/micro-clearfix-hack/ .clear:before, .clear:after { content: " "; display: table; } .clear:after { clear: both; } .row:before, .row:after { content: ""; display: table; } .row:after { clear: both; } .row { position: relative; margin-left: -@grid-gutter; margin-right: -@grid-gutter; } // Mobile Container .container { padding-left: @grid-gutter; padding-right: @grid-gutter; margin-left: auto; margin-right: auto; width: @container-desktop; } .container-full { padding-left: 0; padding-right: 0; margin-left: auto; margin-right: auto; } // Grid Columns - Global Rules .col-1, .col-2, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9, .col-10, .col-11, .col-12 { padding-left: @grid-gutter; padding-right: @grid-gutter; position: relative; float: left; } // Grid .generate-grid (12); .generate-grid (@index) when (@index > 0) { .generate-grid (@index - 1); .col-@{index} { width: @index / 12 * 100%; } } // Push Offsets .generate-push-offsets (11); .generate-push-offsets (@index) when (@index > 0) { .generate-push-offsets (@index - 1); .push-@{index} { left: @index / 12 * 100%; } } // Pull Offsets .generate-pull-offsets (11); .generate-pull-offsets (@index) when (@index > 0) { .generate-pull-offsets (@index - 1); .pull-@{index} { left: -@index / 12 * 100%; } }// ========================================================================== // Base – Mobile-First Grid // ========================================================================== // Micro Clearfix - http://nicolasgallagher.com/micro-clearfix-hack/ .clear:before, .clear:after { content: " "; display: table; } .clear:after { clear: both; } .row:before, .row:after { content: ""; display: table; } .row:after { clear: both; } .row { position: relative; margin-left: -@grid-gutter; margin-right: -@grid-gutter; } // Mobile Container .container { padding-left: @grid-gutter; padding-right: @grid-gutter; margin-left: auto; margin-right: auto; } .container-full { padding-left: 0; padding-right: 0; margin-left: auto; margin-right: auto; } // Tablet Container @media only screen and (min-width: @breakpoint-tablet) { .container, .container-full { width: @container-tablet; } .container-tablet { width: @container-tablet; padding-left: @grid-gutter-tablet; padding-right: @grid-gutter-tablet; margin-left: auto; margin-right: auto; } .container-full-tablet { width: @container-tablet; margin-left: auto; margin-right: auto; padding-left: 0; padding-right: 0; } } // Desktop Container @media only screen and (min-width: @breakpoint-desktop) { .container, .container-full { width: @container-desktop; } .container-desktop { width: @container-desktop; padding-left: @grid-gutter-desktop; padding-right: @grid-gutter-desktop; margin-left: auto; margin-right: auto; } .container-full-desktop { width: @container-desktop; margin-left: auto; margin-right: auto; padding-left: 0; padding-right: 0; } } // HD Container @media only screen and (min-width: @breakpoint-hd) { .container, .container-full { width: @container-hd; } .container-hd { width: @container-hd; padding-left: @grid-gutter-hd; padding-right: @grid-gutter-hd; margin-left: auto; margin-right: auto; } .container-full-hd { width: @container-hd; margin-left: auto; margin-right: auto; padding-left: 0; padding-right: 0; } } // Mobile-first Grid Columns - Global Rules .col-1, .col-2, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9, .col-10, .col-11, .col-12 { padding-left: @grid-gutter; padding-right: @grid-gutter; position: relative; float: left; } // Mobile-first Grid .generate-grid (12); .generate-grid (@index) when (@index > 0) { .generate-grid (@index - 1); .col-@{index} { width: @index / 12 * 100%; } } // Mobile Push Offsets .generate-push-offsets (11); .generate-push-offsets (@index) when (@index > 0) { .generate-push-offsets (@index - 1); .push-@{index} { left: @index / 12 * 100%; } } // Mobile Pull Offsets .generate-pull-offsets (11); .generate-pull-offsets (@index) when (@index > 0) { .generate-pull-offsets (@index - 1); .pull-@{index} { left: -@index / 12 * 100%; } } // Mobile Rows .generate-row-top (60); .generate-row-top (@index) when (@index > 0) { .generate-row-top (@index - 5); .row-top-@{index} { padding-top: @index * 1px; } } .generate-row-bottom (60); .generate-row-bottom (@index) when (@index > 0) { .generate-row-bottom (@index - 5); .row-bottom-@{index} { padding-bottom: @index * 1px; } } // Tablet Grid @media only screen and (min-width: @breakpoint-tablet) { // Tablet Grid Columns - Global Rules .col-1-tablet, .col-2-tablet, .col-3-tablet, .col-4-tablet, .col-5-tablet, .col-6-tablet, .col-7-tablet, .col-8-tablet, .col-9-tablet, .col-10-tablet, .col-11-tablet, .col-12-tablet { padding-left: @grid-gutter-tablet; padding-right: @grid-gutter-tablet; position: relative; float: left; } // Tablet Grid .generate-grid-tablet (12); .generate-grid-tablet (@index) when (@index > 0) { .generate-grid-tablet (@index - 1); .col-@{index}-tablet { width: @index / 12 * 100%; } } // Tablet Push Offsets .generate-push-offsets-tablet (11); .generate-push-offsets-tablet (@index) when (@index > 0) { .generate-push-offsets-tablet (@index - 1); .push-@{index}-tablet { left: @index / 12 * 100%; } } // Tablet Pull Offsets .generate-pull-offsets-tablet (11); .generate-pull-offsets-tablet (@index) when (@index > 0) { .generate-pull-offsets-tablet (@index - 1); .pull-@{index}-tablet { left: -@index / 12 * 100%; } } // Tablet Rows .generate-row-top-tablet (60); .generate-row-top-tablet (@index) when (@index > 0) { .generate-row-top-tablet (@index - 5); .row-top-@{index}-tablet { padding-top: @index * 1px; } } .generate-row-bottom-tablet (60); .generate-row-bottom-tablet (@index) when (@index > 0) { .generate-row-bottom-tablet (@index - 5); .row-bottom-@{index}-tablet { padding-bottom: @index * 1px; } } } // Desktop Grid @media only screen and (min-width: @breakpoint-desktop) { // Desktop Grid Columns - Global Rules .col-1-desktop, .col-2-desktop, .col-3-desktop, .col-4-desktop, .col-5-desktop, .col-6-desktop, .col-7-desktop, .col-8-desktop, .col-9-desktop, .col-10-desktop, .col-11-desktop, .col-12-desktop { padding-left: @grid-gutter-desktop; padding-right: @grid-gutter-desktop; position: relative; float: left; } // Desktop Grid .generate-grid-desktop (12); .generate-grid-desktop (@index) when (@index > 0) { .generate-grid-desktop (@index - 1); .col-@{index}-desktop { width: @index / 12 * 100%; } } // Desktop Push Offsets .generate-push-offsets-desktop (11); .generate-push-offsets-desktop (@index) when (@index > 0) { .generate-push-offsets-desktop (@index - 1); .push-@{index}-desktop { left: @index / 12 * 100%; } } // Desktop Pull Offsets .generate-pull-offsets-desktop (11); .generate-pull-offsets-desktop (@index) when (@index > 0) { .generate-pull-offsets-desktop (@index - 1); .pull-@{index}-desktop { left: -@index / 12 * 100%; } } // Desktop Rows .generate-row-top-desktop (60); .generate-row-top-desktop (@index) when (@index > 0) { .generate-row-top-desktop (@index - 5); .row-top-@{index}-desktop { padding-top: @index * 1px; } } .generate-row-bottom-desktop (60); .generate-row-bottom-desktop (@index) when (@index > 0) { .generate-row-bottom-desktop (@index - 5); .row-bottom-@{index}-desktop { padding-bottom: @index * 1px; } } } // HD Grid @media only screen and (min-width: @breakpoint-hd) { // HD Grid Columns - Global Rules .col-1-hd, .col-2-hd, .col-3-hd, .col-4-hd, .col-5-hd, .col-6-hd, .col-7-hd, .col-8-hd, .col-9-hd, .col-10-hd, .col-11-hd, .col-12-hd { padding-left: @grid-gutter-hd; padding-right: @grid-gutter-hd; position: relative; float: left; } // HD Grid .generate-grid-hd (12); .generate-grid-hd (@index) when (@index > 0) { .generate-grid-hd (@index - 1); .col-@{index}-hd { width: @index / 12 * 100%; } } // HD Push Offsets .generate-push-offsets-hd (11); .generate-push-offsets-hd (@index) when (@index > 0) { .generate-push-offsets-hd (@index - 1); .push-@{index}-hd { left: @index / 12 * 100%; } } // HD Pull Offsets .generate-pull-offsets-hd (11); .generate-pull-offsets-hd (@index) when (@index > 0) { .generate-pull-offsets-hd (@index - 1); .pull-@{index}-hd { left: -@index / 12 * 100%; } } // HD Rows .generate-row-top-hd (60); .generate-row-top-hd (@index) when (@index > 0) { .generate-row-top-hd (@index - 5); .row-top-@{index}-hd { padding-top: @index * 1px; } } .generate-row-bottom-hd (60); .generate-row-bottom-hd (@index) when (@index > 0) { .generate-row-bottom-hd (@index - 5); .row-bottom-@{index}-hd { padding-bottom: @index * 1px; } } }// ========================================================================== // Base – Helpers // ========================================================================== // General Resets .no-margin { margin: 0; } .no-padding { padding: 0; } .no-float { float: none; } .no-background { background: transparent; } .no-border { border: 0; } .no-select { -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; cursor: default; } // Font Weights .font-100 { font-weight: @font-100; } .font-200 { font-weight: @font-200; } .font-300 { font-weight: @font-300; } .font-400 { font-weight: @font-400; } .font-500 { font-weight: @font-500; } .font-600 { font-weight: @font-600; } .font-700 { font-weight: @font-700; } .font-800 { font-weight: @font-800; } .font-900 { font-weight: @font-900; } // Font Styles .font-normal { font-style: normal; } .font-italic { font-style: italic; } // Text Modifications .uppercase { text-transform: uppercase; } .lowercase { text-transform: lowercase; } .capitalize { text-transform: capitalize; } // Text Alignments .text-left { text-align: left; } .text-right { text-align: right; } .text-center { text-align: center; } .text-justify { text-align: justify; } // Positions .relative { position: relative; } .absolute { position: absolute; } .static { position: static; } .fixed { position: fixed; } // Display Types .none { display: none; } .block { display: block; } .inline-block { display: inline-block; } .inline { display: inline; } // Flex Types .flex { display: flex; } .flex-row { flex-direction: row; } .flex-column { flex-direction: column; } .flex-space-around { justify-content: space-around; } .flex-space-between { justify-content: space-between; } .flex-start { justify-content: flex-start; } .flex-center { justify-content: center; } .flex-end { justify-content: flex-end; } .flex-wrap { flex-wrap: wrap; } .flex-nowrap { flex-wrap: nowrap; } // Floats .left { float: left; } .right { float: right; } // Alignments .center-element { float: none; margin-left: auto; margin-right: auto; } // Hide only visually, but have it available for screenreaders: : h5bp.com/v .sr { border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; } // Lists .list-unstyled { list-style: none; margin: 0; padding: 0; li { margin: 0; padding: 0; } } .list-inline { list-style: none; margin: 0; padding: 0; li { margin: 0; padding: 0; display: inline-block; } } // Images .img-fluid { max-width: 100%; } // Image Positions .img-left { float: left; margin-right: 20px; } .img-right { float: right; margin-left: 20px; } // Grouped Fields .field-group { padding-top: .5em; padding-bottom: .5em; overflow: hidden; label { padding-top: 8px; } } .field { width: 100%; } // Disable Element .disabled { pointer-events: none; opacity: .5; } // Checkbox and Radio .checkbox, .radio { display: inline-block; position: relative; margin-top: .5em; margin-bottom: .5em; label { padding-left: 20px; padding-top: 0; display: inline-block; } input[type="checkbox"], input[type="radio"] { position: absolute; top: 4px; left: 0; } } // Animations .animate { .animate(1s); } .animate-infinite { -webkit-animation-iteration-count: infinite; animation-iteration-count: infinite; } // Tablet Helpers @media only screen and (min-width: @breakpoint-tablet) { // General Resets .no-float-tablet { float: none; } .no-padding-tablet { padding: 0; } .no-margin-tablet { margin: 0; } // Positions .relative-tablet { position: relative; } .absolute-tablet { position: absolute; } .static-tablet { position: static; } .fixed-tablet { position: fixed; } // Display Types .none-tablet { display: none; } .block-tablet { display: block; } .inline-block-tablet { display: inline-block; } .inline-tablet { display: inline; } // Floats .left-tablet { float: left; } .right-tablet { float: right; } // Text Alignments .text-left-tablet { text-align: left; } .text-right-tablet { text-align: right; } .text-center-tablet { text-align: center; } .text-justify-tablet { text-align: justify; } // Grid Resets .no-col-tablet { width: auto; float: none; } .no-push-tablet, .no-pull-tablet { left: 0; } } // Desktop Helpers @media only screen and (min-width: @breakpoint-desktop) { // General Resets .no-float-desktop { float: none; } .no-padding-desktop { padding: 0; } .no-margin-desktop { margin: 0; } // Positions .relative-desktop { position: relative; } .absolute-desktop { position: absolute; } .static-desktop { position: static; } .fixed-desktop { position: fixed; } // Display Types .none-desktop { display: none; } .block-desktop { display: block; } .inline-block-desktop { display: inline-block; } .inline-desktop { display: inline; } // Floats .left-desktop { float: left; } .right-desktop { float: right; } // Text Alignments .text-left-desktop { text-align: left; } .text-right-desktop { text-align: right; } .text-center-desktop { text-align: center; } .text-justify-desktop { text-align: justify; } // Grid Resets .no-col-desktop { width: auto; float: none; } .no-push-desktop, .no-pull-desktop { left: 0; } } // HD Helpers @media only screen and (min-width: @breakpoint-hd) { // General Resets .no-float-hd { float: none; } .no-padding-hd { padding: 0; } .no-margin-hd { margin: 0; } // Positions .relative-hd { position: relative; } .absolute-hd { position: absolute; } .static-hd { position: static; } .fixed-hd { position: fixed; } // Display Types .none-hd { display: none; } .block-hd { display: block; } .inline-block-hd { display: inline-block; } .inline-hd { display: inline; } // Floats .left-hd { float: left; } .right-hd { float: right; } // Text Alignments .text-left-hd { text-align: left; } .text-right-hd { text-align: right; } .text-center-hd { text-align: center; } .text-justify-hd { text-align: justify; } // Grid Resets .no-col-hd { width: auto; float: none; } .no-push-hd, .no-pull-hd { left: 0; } } // Print Helpers @media print { // General Resets .no-float-print { float: none; } .no-padding-print { padding: 0; } .no-margin-print { margin: 0; } // Display Types .none-print { display: none; } .block-print { display: block; } .inline-block-print { display: inline-block; } .inline-print { display: inline; } // Text Alignments .text-left-print { text-align: left; } .text-right-print { text-align: right; } .text-center-print { text-align: center; } .text-justify-print { text-align: justify; } // Grid Resets .no-col-print { width: auto; float: none; } .no-push-print, .no-pull-print { left: 0; } }// ========================================================================== // Base – Lists // ========================================================================== ul, ol { margin: 1em 0 2em 0; padding: 0 0 0 40px; li { margin-bottom: 5px; } } dl { &:before, &:after { content: " "; display: table; } &:after { clear: both; } dt { float: left; width: 25%; display: block; font-weight: @font-400; } dd { overflow: hidden; display: block; } }// ========================================================================== // Base – Mixins // ========================================================================== // Font sizes (primary sizing in `rem` units with a fallback of `px`) // Example usage .font-size(18); .font-size (@size) { @remValue: @size / 16; @pxValue: (@size); font-size: ~"@{pxValue}px"; /*font-size: ~"@{remValue}rem";*/ } // Line height sizes (primary sizing in `rem` units with a fallback of `px`) // Example usage .line-height(22); .line-height (@size) { @remValue: @size / 16; @pxValue: (@size); line-height: ~"@{pxValue}px"; /*line-height: ~"@{remValue}rem";*/ } // SVG background with PNG fallback // Example Usage .svg-bg("img/banner.svg", "img/banner.png", 50%, 50%, no-repeat); .bg-svg(@svg, @png, @x: 0, @y: 0, @repeat: no-repeat) { background: url(@svg) @x @y @repeat; .no-svg & { background: url(@png) @x @y @repeat; } } // Background Color with Opacity // Example Usage: .bg-rgba(#111, 50%); .bg-rgba(@color,@alpha) { @rgba: rgba(red(@color), green(@color), blue(@color), @alpha); @argb: argb(@rgba); background-color: @color; background-color: @rgba; } // Animations // Example Usage .animation(1s); .animate(@duration: 1s) { animation-duration: @duration; animation-fill-mode: both; } // SVG Fill - http://zslabs.com/articles/svg-background-fill/#update-2 // Example usage: .svg-fill("img/icon.svg", "#555"); .svg-fill(@src, @fill: ~"") when not (@fill = '') { @data-uri: data-uri('image/svg+xml;charset=UTF-8', "src/@{src}"); @replace-src: replace("@{data-uri}", "fill\%3D\%22\%23[\w]{3,6}\%22", escape('fill="@{fill}"'), "g"); background-image:e(@replace-src); } // SVG Fill - http://zslabs.com/articles/svg-background-fill/#update-2 // Example usage: .svg-fill("img/icon.svg"); .svg-fill(@src, @fill: ~"") when (@fill = ~'') { @data-uri: data-uri('image/svg+xml;charset=UTF-8', "src/@{src}"); background-image:e("@{data-uri}"); } // Not enough mixins? – Please make some suggestions or contribute more! :)// All Elements *, *:before, *:after { background: transparent; color: #000; box-shadow: none; text-shadow: none; } // Links a, a:visited { text-decoration: underline; } a[href]:after { content: " (" attr(href) ")"; } a[href^="#"]:after, a[href^="javascript:"]:after { content: ""; } // Code and Blockquotes pre, blockquote { page-break-inside: avoid; } // Tables thead { display: table-header-group; } tr { page-break-inside: avoid; } // Images img { page-break-inside: avoid; max-width: 100%;} // Typography p, h2, h3 { orphans: 3; widows: 3; } h2, h3 { page-break-after: avoid; } abbr[title]:after { content: " (" attr(title) ")"; }// ========================================================================== // Base – Global Resets // ========================================================================== // Border Box *, *:before, *:after { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } // HTML Font / Text Size Resets html { font-size: 100%; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; } html, button, input, select, textarea { font-family: sans-serif; } // HTML5 Elements article, aside, details, figcaption, figure, footer, header, hgroup, main, nav, section, summary { display: block; } // Remove Default Margins body, form, fieldset, legend, input, select, textarea, button { margin: 0; } // Audio and Video Elements audio, canvas, progress, video { display: inline-block; vertical-align: baseline; } audio:not([controls]) { display: none; height: 0; } // Hidden Elements [hidden], template { display: none; } // Images img { border: 0; } svg:not(:root) { overflow: hidden; }// ========================================================================== // Base – Tables // ========================================================================== caption { .font-size(@base-font-size + 2); line-height: normal; font-weight: @font-700; text-align: left; padding: .5em 0; border-bottom: 1px solid #d7d7d7; } table { .font-size(@base-font-size - 2); border-collapse: collapse; border-spacing: 0; width: 100%; margin: 1em 0; text-align: left; thead, tbody, tfoot { td, th { color: #585858; padding: .8em .5em; border-bottom: 1px solid #e9e9e9; } } }// ========================================================================== // Base – Variables // ========================================================================== // Global Typography @base-background-color: #fff; @base-font-family: sans-serif; @base-font-size: 16; @base-line-height: 22; @base-font-weight: 400; @base-font-color: #585858; @base-link-color: #cd5c5c; // Font Weights @font-100: 100; @font-200: 200; @font-300: 300; @font-400: 400; @font-500: 500; @font-600: 600; @font-700: 700; @font-800: 800; @font-900: 900; // Headings @heading-font-family: sans-serif; @h1-font-size: 32; @h1-line-height: 38; @h1-font-weight: @font-400; @h1-color: #343434; @h2-font-size: 26; @h2-line-height: 32; @h2-font-weight: @font-400; @h2-color: #343434; @h3-font-size: 22; @h3-line-height: 28; @h3-font-weight: @font-400; @h3-color: #343434; @h4-font-size: 18; @h4-line-height: 24; @h4-font-weight: @font-400; @h4-color: #343434; @h5-font-size: 16; @h5-line-height: 22; @h5-font-weight: @font-400; @h5-color: #343434; @h6-font-size: 14; @h6-line-height: 20; @h6-font-weight: @font-400; @h6-color: #343434; // Blockquotes @base-blockquote-font-family: sans-serif; @base-blockquote-font-size: 22; @base-blockquote-line-height: 28; @base-blockquote-color: #424242; @base-blockquote-cite-color: #777; // Code @base-code-font-family: 'courier new', monospace, serif; @base-code-font-size: 13; @base-code-line-height: 18; @base-code-color: #272727; @base-code-background-color: #f1f1f1; @base-code-border-color: #d7d7d7; // Forms @base-placeholder-color: #999; @base-field-color: #222; @base-field-border-color: #ccc; @base-field-border-color-focus: #f7c723; // Grid Containers @container-mobile: 100%; @container-tablet: 720px; @container-desktop: 960px; @container-hd: 1120px; // Grid Gutters @grid-gutter: 15px; @grid-gutter-tablet: 15px; @grid-gutter-desktop: 15px; @grid-gutter-hd: 15px; // Responsive Breakpoints @breakpoint-tablet: (@container-tablet + 20); @breakpoint-desktop: (@container-desktop + 20); @breakpoint-hd: (@container-hd + 20);style.less/* ========================================================================== // Base Stylesheet - http://getbase.org // Author: Matthew Hartman - http://www.matthewhartman.com.au/ // Version: 2.8.3 - Last Updated: March 23, 2016 ========================================================================== */ @import "base/_variables"; @import "base/_mixins"; @import "base/_resets"; @import "base/_global"; @import "base/_lists"; @import "base/_blockquotes"; @import "base/_tables"; @import "base/_code"; @import "base/_forms"; @import "base/_assets"; @import "base/_grid"; // @import "base/_grid-non-responsive"; // Helpers @import "base/_helpers"; @import "_mobile-styles"; // Tablet Styles @media only screen and (min-width: @breakpoint-tablet) { @import "_tablet-styles"; } // Desktop Styles @media only screen and (min-width: @breakpoint-desktop) { @import "_desktop-styles"; } // HD Styles @media only screen and (min-width: @breakpoint-hd) { @import "_hd-styles"; } // Animations @import "base/_animations"; // Print Styles @media print { @import "base/_print"; }// ========================================================================== // Desktop Custom Styles // ========================================================================== // ========================================================================== // HD Custom Styles // ========================================================================== // ========================================================================== // Mobile Custom Styles // ========================================================================== // ========================================================================== // Tablet Custom Styles // ========================================================================== 'use strict'; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); Object.defineProperty(exports, "__esModule", { value: true }); var _react = require('react'); var _react2 = _interopRequireDefault(_react); var _classnames = require('classnames'); var _classnames2 = _interopRequireDefault(_classnames); var _essenceCore = require('essence-core'); require('./appbar.less'); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // require('!css!less!./appbar.less'); var AppBar = (function (_React$Component) { _inherits(AppBar, _React$Component); function AppBar(props) { _classCallCheck(this, AppBar); var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(AppBar).call(this, props)); _this.state = { classes: (0, _classnames2.default)('e-appbar clearfix', _this.props.className, _this.props.classes) }; return _this; } _createClass(AppBar, [{ key: 'componentDidMount', value: function componentDidMount() { var body = document.querySelector('body'); var documentSize = _essenceCore.Utils.Client.documentSize(); switch (documentSize) { case 1: body.style.marginTop = '48px'; break; case 2: body.style.marginTop = '56px'; break; case 3: default: body.style.marginTop = '64px'; break; } } }, { key: 'render', value: function render() { return _react2.default.createElement( 'div', _extends({}, this.props, { className: this.state.classes }), this.props.children ); } }]); return AppBar; })(_react2.default.Component); module.exports = AppBar;@import '../../essence-core/src/less/mixins.less'; @import '../../essence-core/src/less/globals.less'; @import '../../essence-core/src/less/styles/text.less'; .e-appbar { position: fixed; top: 0; left: 0; z-index: 3; width: 100%; line-height: @e-unit*5; background: #FAFAFA; color: #000; box-sizing: border-box; cursor: pointer; .e-shadow-1(); .clearfix(); button { min-width: 0; padding: 0; margin: 0; border-radius: 50%; z-index: 1; height: @e-unit*5; width: @e-unit*5; font-size: @e-unit*3; i { padding: 0; } } i { font-size: @e-unit*3; line-height: @e-unit*5; } > span { padding-left: @e-unit*2.5; color: inherit; } ::-webkit-input-placeholder { /* WebKit, Blink, Edge */ color: @e-color-white; } :-moz-placeholder { /* Mozilla Firefox 4 to 18 */ color: @e-color-white; opacity: 1; } ::-moz-placeholder { /* Mozilla Firefox 19+ */ color: @e-color-white; opacity: 1; } :-ms-input-placeholder { /* Internet Explorer 10-11 */ color: @e-color-white; } input.e-input { border-bottom: 1px solid @e-color-white !important; } .e-input:focus ~ .e-input-efects:after, .e-input.focus ~ .e-input-efects:after { background-color: @e-color-white !important; } fieldset[disabled] .e-input, .e-input-group .e-input, .e-input { border-bottom: 1px solid @e-color-white !important; } .e-input-group .e-input-efects:before { background-color: @e-color-white ; } > nav { padding: 0 @e-unit; span { span { float: left; } } } .search-block { .close { width: 0; .transition(all 0.2s); height: @e-unit*3.75; line-height: @e-unit*3.75; } .open { width: @e-unit*15; .transition(all 0.2s); height: @e-unit*3.75; line-height: @e-unit*3.75; input { padding-bottom: 0; height: @e-unit*3.75; line-height: @e-unit*3.75; &:focus{ padding-bottom: 0; height: @e-unit*3.75; line-height: @e-unit*3.75; } } } } } @media (min-width: 769px) { // Tablet/Desktop .e-appbar{ height: @e-unit*8; padding: @e-unit*1.5; } } @media (min-width: 480px) and (max-width:768px) { // Mobile Portrait .e-appbar{ height: @e-unit*7; padding: @e-unit @e-unit*0.5; } } @media (max-width: 479px) { // Mobile Landscape .e-appbar{ height: @e-unit*6; padding: @e-unit*0.5; } } { "name": "essence-appbar", "version": "1.0.7", "description": "Essence AppBar - AppBar component", "author": "Hetmann W. Iohan ", "homepage": "http://getessence.io/", "license": "MIT", "repository": "git://github.com/Evo-Forge/Essence", "main": "lib/appbar.js", "scripts": { "babel": "babel --presets react,es2015 src --out-dir lib && cp src/appbar.less lib/appbar.less", "webpack": "NODE_ENV=production webpack -p --config webpack.config.js" }, "keywords": [ "color palette", "component", "essence", "google material", "grid lists", "javascript", "less css", "less", "lesscss", "material components", "material design framework", "material design", "material", "module", "react component", "react components", "react native", "react", "react-component", "template", "templates", "tile", "tiles", "UI component", "UI kit", "UI kits", "UI", "widget", "appbar", "app bar", "menu", "navigation", "nav bar", "navbar" ], "devDependencies": { "react": "^0.14.x" }, "peerDependencies": { "react": "^0.14.x" }, "dependencies": { "classnames": "^2.x", "essence-core": "^1.x" } } # Essence AppBar - AppBar component ### How to use ```js import ClassNames from 'classnames'; import AppBar from 'essence-appbar'; import Input from 'essence-input'; import Menu from 'essence-menu'; import Toast from 'essence-toast'; class AppBarTest extends React.Component { constructor(props) { super(props); this.state = { search: 'close', toast: false, classes: ClassNames( this.props.classes, this.props.className ) }; } renderSearch() { let classes = ClassNames('e-no-margin e-text-white e-left', this.state.search); return ( ); } renderToast() { if (this.state.toast) { return ( Adaugat la Favorite ); } return; } toggleSearch() { this.setState({ search: (this.state.search === 'close' ? 'open' : 'close') }); } toggleToast() { var toastStatus = !this.state.toast; this.setState({ toast: toastStatus }); } render() { return( ); } render() { return this.renderBtn(); } } module.exports = Btn;@import '../../essence-core/src/less/mixins.less'; // General buttons properties .e-btn { display: inline-block; min-height: @btn-unit*4.5; line-height: @btn-unit*4.5; padding: 0 @btn-unit*3; border: 0; margin:@btn-unit; cursor: pointer; .border-radius(@btn-unit*0.25); background-clip: padding-box; text-transform: uppercase; font-size: @btn-unit*1.75; &:hover:not(.flat) { .e-shadow-2(); } &:focus { border: 0; outline: none; } &:disabled { pointer-events: none; box-shadow: none ; opacity: 0.5; } } .e-dialog .e-btn { padding: 0 @btn-unit; } .flat { &:extend(.e-btn all); background-color: transparent ; border: none ; min-width: @btn-unit*11; font-weight: 500; padding: 0 @btn-unit; &:hover , &:focus { background-color:darken(hsl(0,0%,100%), 10%) ; } &:active { background-color:darken(hsl(0,0%,100%), 20%) ; } } //Floating action button =FAB : with e-btn inherited .fab { &:extend(.e-btn all); z-index: 1; display: inline-block; width: @btn-unit*7; height: @btn-unit*7; padding: 0; margin: @btn-unit*2; background-color: @fab-color; text-align: center; .border-radius(50%); background-clip: border-box; .e-shadow-1(); i { padding: @btn-unit*2; display: inline-block; width: @btn-unit*3; height: @btn-unit*3; line-height: @btn-unit*3; font-size: @btn-unit*3; text-align: center; font-size: @btn-unit*3; } &:hover { .e-shadow-3(); } &:active { } &:focus { outline: none; } } //Floating action button mini : with e-btn-fab inherited .fab-mini { &:extend(.fab all); height: @btn-unit*5; width: @btn-unit*5; i { padding: @btn-unit; } } //Raised button : with e-btn inherited .raised { &:extend(.e-btn all); .e-shadow-1(); min-width: @btn-unit*8; padding: 0 @btn-unit*2; color:#fff; &:hover , &:focus { color: #fff; } &:active { color: #fff; } } // special functions colors : default, primary, succes, info, warning, danger .e-btn-default { background-color:@e-color-grey-500; color:#000 !important; &:hover , &:focus { background-color:@e-color-grey-600; } &:active { background-color:@e-color-grey-700; } } .e-btn-primary { background-color:@e-color-blue-500; color:#fff; &:hover , &:focus { background-color:@e-color-blue-600; } &:active { background-color:@e-color-blue-700; } } .e-btn-succes { background-color: @e-color-green-500; color:#fff; &:hover , &:focus { background-color:@e-color-green-600; } &:active { background-color:@e-color-green-700; } } .e-btn-info { background-color: @e-color-light-blue-500; color:#fff; &:hover , &:focus { background-color:@e-color-light-blue-600; } &:active { background-color:@e-color-light-blue-700; } } .e-btn-warning { background-color: @e-color-orange-500; color:#fff; &:hover , &:focus { background-color:@e-color-orange-600; } &:active { background-color:@e-color-orange-700; } } .e-btn-danger { background-color: @e-color-red-500; color:#fff; &:hover , &:focus { background-color:@e-color-red-600; } &:active { background-color:@e-color-red-700; } }var path = require('path'); var react = require('react'); var webpack = require('webpack'); module.exports = { entry: { 'button': path.resolve(__dirname, './src/button.jsx') }, output: { path: path.resolve(__dirname, './lib'), filename: '[name].js' }, module: { loaders: [ { test: /\.jsx?$/, loader: 'babel-loader', exclude: /node_modules/, query: { presets: ['es2015', 'react'] } }, { test: /\.less$/, loader: 'style-loader!css-loader!less-loader' }, { test: /\.css$/, loader: 'style-loader!css-loader' } ] }, plugins: [ new webpack.optimize.UglifyJsPlugin({ compress: { warnings: true }, }), ] };var Card = require('./lib/card.js'); var CardContent = require('./lib/content.js'); var CardFooter = require('./lib/footer.js'); var CardHeader = require('./lib/header.js'); exports.Card = Card; exports.CardContent = CardContent; exports.CardFooter = CardFooter; exports.CardHeader = CardHeader;'use strict'; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); var _react = require('react'); var _react2 = _interopRequireDefault(_react); var _classnames = require('classnames'); var _classnames2 = _interopRequireDefault(_classnames); require('./card.less'); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // require('!css!less!./card.less'); var Card = (function (_React$Component) { _inherits(Card, _React$Component); function Card(props) { _classCallCheck(this, Card); var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(Card).call(this, props)); _this.state = { classes: (0, _classnames2.default)(_this.props.classes, _this.props.className, 'card') }; return _this; } _createClass(Card, [{ key: 'render', value: function render() { return _react2.default.createElement( 'div', _extends({}, this.props, { className: this.state.classes }), this.props.children ); } }]); return Card; })(_react2.default.Component); module.exports = Card;@import '../../essence-core/src/less/mixins.less'; /*Start*/ .card{ &:extend(.clearfix all); margin-bottom: 30px; overflow: hidden; .border-radius(2px); -webkit-box-shadow: 0 3px 10px rgba(0, 0, 0, 0.23), 0 3px 10px rgba(0, 0, 0, 0.16); -moz-box-shadow: 0 3px 10px rgba(0, 0, 0, 0.23), 0 3px 10px rgba(0, 0, 0, 0.16); box-shadow: 0 3px 10px rgba(0, 0, 0, 0.23), 0 3px 10px rgba(0, 0, 0, 0.16); .card-header{ padding: (@e-unit * 2); .card-header-image{ float: left; margin-right: (@e-unit * 2); border-radius: 50%; overflow: hidden; height: 60px; width: 60px; } .card-header-text { float: left; h2{ color: @e-color-grey-700; } h3{ color:@e-color-grey-400; line-height: @e-line-height-computed; } } } .card-main-image{ position: relative; padding: 0; .e-headline { color: #fff; position: absolute; bottom: (@e-unit * 2); left: (@e-unit * 2); } img { display: block; width: 100%; height: auto; } } .card-supporting-text{ padding: (@e-unit * 2); p { font-size: 14px; line-height: @e-line-height-computed; color: lighten(@e-text-color, 13%); text-transform: normal; margin: 0; } } .card-suplimentary-actions { &:extend(.clearfix all); padding: @e-unit; border-top: 1px solid #ccc; & button { margin: 0; } } .left-image { float: left; width: 25%; img { display: block; max-width: 100%; } } .content-after-image { float: left; width: 75%; } [class^="e-btn-"] { min-width: 0; padding: 0 @e-unit; } }'use strict'; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); var _react = require('react'); var _react2 = _interopRequireDefault(_react); var _classnames = require('classnames'); var _classnames2 = _interopRequireDefault(_classnames); require('./card.less'); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // require('!css!less!./card.less'); var CardContent = (function (_React$Component) { _inherits(CardContent, _React$Component); function CardContent(props) { _classCallCheck(this, CardContent); var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(CardContent).call(this, props)); _this.state = { classes: (0, _classnames2.default)('card-supporting-text', _this.props.classes, _this.props.className) }; return _this; } _createClass(CardContent, [{ key: 'render', value: function render() { return _react2.default.createElement( 'div', _extends({}, this.props, { className: this.state.classes }), this.props.children ); } }]); return CardContent; })(_react2.default.Component); module.exports = CardContent;'use strict'; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); var _react = require('react'); var _react2 = _interopRequireDefault(_react); var _classnames = require('classnames'); var _classnames2 = _interopRequireDefault(_classnames); require('./card.less'); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // require('!css!less!./card.less'); var CardFooter = (function (_React$Component) { _inherits(CardFooter, _React$Component); function CardFooter(props) { _classCallCheck(this, CardFooter); var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(CardFooter).call(this, props)); _this.state = { classes: (0, _classnames2.default)('card-suplimentary-actions', 'clearfix', _this.props.classes, _this.props.className) }; return _this; } _createClass(CardFooter, [{ key: 'render', value: function render() { return _react2.default.createElement( 'div', _extends({}, this.props, { className: this.state.classes }), this.props.children ); } }]); return CardFooter; })(_react2.default.Component); module.exports = CardFooter;'use strict'; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); var _react = require('react'); var _react2 = _interopRequireDefault(_react); var _classnames = require('classnames'); var _classnames2 = _interopRequireDefault(_classnames); require('./card.less'); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // require('!css!less!./card.less'); var CardHeader = (function (_React$Component) { _inherits(CardHeader, _React$Component); function CardHeader(props) { _classCallCheck(this, CardHeader); var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(CardHeader).call(this, props)); _this.state = { classes: (0, _classnames2.default)('card-header', 'clearfix', _this.props.classes, _this.props.className) }; return _this; } _createClass(CardHeader, [{ key: 'render', value: function render() { return _react2.default.createElement( 'div', _extends({}, this.props, { className: this.state.classes }), this.props.children ); } }]); return CardHeader; })(_react2.default.Component); module.exports = CardHeader;{ "name": "essence-card", "version": "1.0.6", "description": "Essence Card - Card component", "author": "Hetmann W. Iohan ", "homepage": "http://getessence.io/", "license": "MIT", "repository": "git://github.com/Evo-Forge/Essence", "main": "index.js", "scripts": { "babel": "babel --presets react,es2015 src --out-dir lib && cp src/card.less lib/card.less", "webpack": "NODE_ENV=production webpack -p --config webpack.config.js" }, "keywords": [ "color palette", "component", "essence", "google material", "grid lists", "javascript", "less css", "less", "lesscss", "material components", "material design framework", "material design", "material", "module", "react component", "react components", "react native", "react", "react-component", "template", "templates", "tile", "tiles", "UI component", "UI kit", "UI kits", "UI", "widget", "card", "cards", "paper card", "google card", "swiper", "tinder", "carousel", "usercard" ], "devDependencies": { "react": "^0.14.x" }, "peerDependencies": { "react": "^0.14.x" }, "dependencies": { "classnames": "^2.x", "essence-core": "^1.x" } } # Essence Card - Card component #### Option: - `classes` or `className`: css style class name **NOTE**: CardHeader, CardContent or CardFooter can be use or ignored as a child in Card component ### How to use ```js import {Card, CardHeader, CardContent, CardFooter} from 'essence-card'; Card header Card content Card footer with action buttons ```import React from 'react'; import ClassNames from 'classnames'; import './card.less'; // require('!css!less!./card.less'); class Card extends React.Component { constructor(props) { super(props); this.state = { classes: ClassNames( this.props.classes, this.props.className, 'card' ), }; } render() { return (
{this.props.children}
); } } module.exports = Card;@import '../../essence-core/src/less/mixins.less'; /*Start*/ .card{ &:extend(.clearfix all); margin-bottom: 30px; overflow: hidden; .border-radius(2px); -webkit-box-shadow: 0 3px 10px rgba(0, 0, 0, 0.23), 0 3px 10px rgba(0, 0, 0, 0.16); -moz-box-shadow: 0 3px 10px rgba(0, 0, 0, 0.23), 0 3px 10px rgba(0, 0, 0, 0.16); box-shadow: 0 3px 10px rgba(0, 0, 0, 0.23), 0 3px 10px rgba(0, 0, 0, 0.16); .card-header{ padding: (@e-unit * 2); .card-header-image{ float: left; margin-right: (@e-unit * 2); border-radius: 50%; overflow: hidden; height: 60px; width: 60px; } .card-header-text { float: left; h2{ color: @e-color-grey-700; } h3{ color:@e-color-grey-400; line-height: @e-line-height-computed; } } } .card-main-image{ position: relative; padding: 0; .e-headline { color: #fff; position: absolute; bottom: (@e-unit * 2); left: (@e-unit * 2); } img { display: block; width: 100%; height: auto; } } .card-supporting-text{ padding: (@e-unit * 2); p { font-size: 14px; line-height: @e-line-height-computed; color: lighten(@e-text-color, 13%); text-transform: normal; margin: 0; } } .card-suplimentary-actions { &:extend(.clearfix all); padding: @e-unit; border-top: 1px solid #ccc; & button { margin: 0; } } .left-image { float: left; width: 25%; img { display: block; max-width: 100%; } } .content-after-image { float: left; width: 75%; } [class^="e-btn-"] { min-width: 0; padding: 0 @e-unit; } }import React from 'react'; import ClassNames from 'classnames'; import './card.less'; // require('!css!less!./card.less'); class CardContent extends React.Component { constructor(props) { super(props); this.state = { classes: ClassNames( 'card-supporting-text', this.props.classes, this.props.className ) }; } render() { return (
{this.props.children}
); } } module.exports = CardContent;import React from 'react'; import ClassNames from 'classnames'; import './card.less'; // require('!css!less!./card.less'); class CardFooter extends React.Component { constructor(props) { super(props); this.state = { classes: ClassNames( 'card-suplimentary-actions', 'clearfix', this.props.classes, this.props.className ) }; } render() { return (
{this.props.children}
); } } module.exports = CardFooter;import React from 'react'; import ClassNames from 'classnames'; import './card.less'; // require('!css!less!./card.less'); class CardHeader extends React.Component { constructor(props) { super(props); this.state = { classes: ClassNames( 'card-header', 'clearfix', this.props.classes, this.props.className ) }; } render() { return (
{this.props.children}
); } } module.exports = CardHeader;var path = require('path'); var react = require('react'); var webpack = require('webpack'); module.exports = { entry: { 'card': path.resolve(__dirname, './src/card.jsx'), 'content': path.resolve(__dirname, './src/content.jsx'), 'footer': path.resolve(__dirname, './src/footer.jsx'), 'header': path.resolve(__dirname, './src/header.jsx') }, output: { path: path.resolve(__dirname, './lib'), filename: '[name].js' }, module: { loaders: [ { test: /\.jsx?$/, loader: 'babel-loader', exclude: /node_modules/, query: { presets: ['es2015', 'react'] } }, { test: /\.less$/, loader: 'style-loader!css-loader!less-loader' }, { test: /\.css$/, loader: 'style-loader!css-loader' } ] }, plugins: [ new webpack.optimize.UglifyJsPlugin({ compress: { warnings: true }, }), ] };'use strict'; var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); var _react = require('react'); var _react2 = _interopRequireDefault(_react); var _classnames = require('classnames'); var _classnames2 = _interopRequireDefault(_classnames); require('./chip.less'); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var Chip = (function (_React$Component) { _inherits(Chip, _React$Component); function Chip(props) { _classCallCheck(this, Chip); var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(Chip).call(this, props)); _this.state = { selected: 0, value: '', iconColor: _this.props.iconColor, classes: (0, _classnames2.default)('chips', _this.props.classes, _this.props.className) }; return _this; } _createClass(Chip, [{ key: 'componentWillReceiveProps', value: function componentWillReceiveProps(nextProps) { this.setState({ iconColor: nextProps.iconColor, classes: (0, _classnames2.default)('chips', nextProps.classes, nextProps.className) }); } }, { key: 'selectContact', value: function selectContact(data) { this.setState({ selected: data.index, value: data.value }); } }, { key: 'renderContact', value: function renderContact() { var self = this; var contacts = null; var contact = this.props.data && this.props.data.contact ? this.props.data.contact : false; if (contact) { contacts = _react2.default.Children.map(contact, function (child, key) { var selectedClass = self.state.selected === key ? ' selected' : ''; return _react2.default.createElement( 'li', { onClick: self.selectContact.bind(self, { index: key, value: child }), onTouch: self.selectContact.bind(self, { index: key, value: child }), key: 'chip-contact-' + key, className: 'contact' + (key === 0 ? ' first' : '') + selectedClass }, child, key === 0 ? _react2.default.createElement( 'span', null, 'x' ) : '' ); }); } return contacts; } }, { key: 'renderIcon', value: function renderIcon() { return this.props.data.icon ? _react2.default.createElement( 'span', { className: (0, _classnames2.default)('icon', this.state.iconColor) }, this.props.data.icon ) : _react2.default.createElement('span', { className: 'empty' }); } }, { key: 'handleClose', value: function handleClose() { if (this.props.data && this.props.data.onClose) { // +hide chip } return this.props.data && this.props.data.onClose ? this.props.data.onClose() : null; } }, { key: 'renderClose', value: function renderClose() { return this.props.data.deletable ? _react2.default.createElement('a', { href: '#!', onClick: this.handleClose.bind(this), className: 'deletable' }) : null; } }, { key: 'renderInput', value: function renderInput() { return _react2.default.createElement('input', { defaulValue: this.state.value, type: 'hidden', name: this.props.data && this.props.data.name ? this.props.data.name : 'chip' }); } }, { key: 'renderChildren', value: function renderChildren() { var _this2 = this; var childs = _react2.default.Children.map(this.props.data.text, function (child, key) { return child; }); return _react2.default.createElement( 'li', { key: 'chip-item', ref: function ref(_ref) { return _this2.chipItem = _ref; } }, this.renderIcon(), childs, this.renderClose() ); } }, { key: 'render', value: function render() { return _react2.default.createElement( 'span', null, this.renderInput(), _react2.default.createElement( 'ul', { key: 'chip-list', className: this.state.classes }, this.renderChildren() ) ); } }]); return Chip; })(_react2.default.Component); Chip.defaultProps = { data: null, iconColor: null }; module.exports = Chip;@import '../../essence-core/src/less/mixins.less'; ul.chips { list-style: none; padding: 0; margin: 0; height: (@e-unit * 4); line-height: (@e-unit * 4); display: inline-block; border: (@e-unit * (0.125)) solid @e-color-grey-300; background: @e-color-grey-300; .border-radius( (@e-unit * 2) ); margin-right: (@e-unit * 0.5); &:hover { background: @e-color-grey-700; border: (@e-unit * (0.125)) solid @e-color-grey-700; .transition(all 0.2s); li { .e-text-white(); .deletable { color: @e-color-grey-700; background: @e-color-white; opacity: 1; } .icon { background: @e-color-grey-500; } } } li { cursor: default; font-size: 1.3rem; color: rgba(0, 0, 0, 0.87); position: relative; padding-right: (@e-unit * 1.5); .deletable { cursor: default; width: (@e-unit * 2.5); height: (@e-unit * 2.5); background: @e-color-black; display: block; line-height: (@e-unit * 2.5); text-align: center; .border-radius(50%); color: @e-color-white; opacity: .54; float: right; margin: (@e-unit * 0.75) (@e-unit * (-0.5)) 0 (@e-unit * (0.5)); &:after { content: "\00d7"; display: inline-block; } } .icon { margin: (@e-unit * (-0.125)) (@e-unit) 0 (@e-unit * (-0.25)); .border-radius(50%); background-color: @e-color-teal-500; width: (@e-unit * 4.25); height: (@e-unit * 4.25); text-align: center; line-height: (@e-unit * 4.25); display: block; float: left; font-size: (@e-unit * 2); color: @e-color-white; font-weight: 100; } .empty { float: left; width: (@e-unit * 1.5); height: (@e-unit * 4); display: block; } } } 'use strict'; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); var _react = require('react'); var _react2 = _interopRequireDefault(_react); var _classnames = require('classnames'); var _classnames2 = _interopRequireDefault(_classnames); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var ChipItem = (function (_React$Component) { _inherits(ChipItem, _React$Component); function ChipItem(props) { _classCallCheck(this, ChipItem); var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(ChipItem).call(this, props)); _this.state = { classes: (0, _classnames2.default)(_this.props.classes, _this.props.className, { 'e-chip': true, 'clearfix': true, 'press': false, 'focus': false, 'first': _this.props.first, 'active': _this.props.active, 'open': false }), isOpen: _this.props.open }; return _this; } _createClass(ChipItem, [{ key: 'renderImage', value: function renderImage() { return _react2.default.createElement( 'div', { className: 'e-chip-image e-left' }, _react2.default.createElement('img', { src: this.props.image, alt: this.props.imageAlt, onClick: this.setClick.bind(this), onTouch: this.setClick.bind(this) }) ); } }, { key: 'renderText', value: function renderText() { if (!this.props.name) return; return _react2.default.createElement( 'div', { className: 'e-chip-text e-left' }, _react2.default.createElement( 'span', { onClick: this.setClick.bind(this), onTouch: this.setClick.bind(this), className: 'e-chip-name' }, this.props.name ), _react2.default.createElement( 'span', { onClick: this.setClick.bind(this), onTouch: this.setClick.bind(this), className: 'e-chip-adress' }, this.props.email ) ); } }, { key: 'handleClasses', value: function handleClasses(ev) { return { 'e-chip': true, 'clearfix': true, 'press': false, 'focus': ev.type === 'mouseenter', 'active': this.props.active, 'open': this.state.isOpen }; } }, { key: 'setFocus', value: function setFocus(ev) { this.setState({ classes: (0, _classnames2.default)(this.props.classes, this.props.className, this.handleClasses(ev)) }); ev.preventDefault(); } }, { key: 'setClick', value: function setClick(ev) { var targetID = ev.target.id; this.setState({ classes: (0, _classnames2.default)(this.props.classes, this.props.className, this.handleClasses(ev), 'active') }); if (!this.state.isOpen) { this.openChip(); } ev.preventDefault(); } }, { key: 'openChip', value: function openChip() { this.setState({ isOpen: true }); this.props.handleOpenChip(); } }, { key: 'componentDidMount', value: function componentDidMount() { this.setState({ classes: (0, _classnames2.default)(this.props.classes, this.props.className, this.handleClasses(this)) }); } }, { key: 'renderCloseButton', value: function renderCloseButton() { if (!this.props.active) return; return _react2.default.createElement('button', { className: 'e-close-btn e-right', onClick: this.props.handleCloseChip.bind(this) }); } }, { key: 'renderChip', value: function renderChip() { return _react2.default.createElement( 'div', _extends({}, this.props, { className: this.state.classes, onClick: this.setClick.bind(this), onMouseEnter: this.setFocus.bind(this), onMouseOut: this.setFocus.bind(this) }), this.renderImage(), this.renderText(), this.renderCloseButton() ); } }, { key: 'render', value: function render() { var displayChip = this.props.open || this.props.first ? 'block' : 'none'; return _react2.default.createElement( 'div', { style: { display: displayChip } }, this.renderChip() ); } }]); return ChipItem; })(_react2.default.Component); module.exports = ChipItem;{ "name": "essence-chip", "version": "1.0.9", "description": "Essence Chip - Chip & ChipItem components", "author": "Hetmann W. Iohan ", "homepage": "http://getessence.io/", "license": "MIT", "repository": "git://github.com/Evo-Forge/Essence", "main": "lib/chip.js", "scripts": { "babel": "babel --presets react,es2015 src --out-dir lib && cp src/chip.less lib/chip.less", "webpack": "NODE_ENV=production webpack -p --config webpack.config.js" }, "keywords": [ "color palette", "component", "essence", "google material", "grid lists", "javascript", "less css", "less", "lesscss", "material components", "material design framework", "material design", "material", "module", "react component", "react components", "react native", "react", "react-component", "template", "templates", "tile", "tiles", "UI component", "UI kit", "UI kits", "UI", "widget", "chip", "text chip", "icon chip", "contact chip" ], "devDependencies": { "react": "^0.14.x" }, "peerDependencies": { "react": "^0.14.x" }, "dependencies": { "classnames": "^2.x", "essence-core": "^1.x" } } # Essence Chip - Chip component ### How to use Options: - **data**: object with properties: - **name**: string for input name, default: chip - **text**: string or html or component - **icon**: string or image url - **deletable**: boolean ( **true** or **false** ) - default: **false** - **onClose**: callback for on closing chip component - **iconColor**: string from the Colors list **NOTE**: use the example below to customize your own chips ```js import Chip from 'essence-chip'; var redbullChip = { name: 'redbullChip', text: [Redbull, (interest)], icon: 'R', deletable: true, onClose: ( function () { console.log('redbullChip chip'); } ) } var goproChip = { name: 'goproChip', text: [GoPRO, (interest)], icon: 'G', deletable: true, onClose: ( function () { console.log('goproChip chip'); } ) } class ChipTest extends React.Component { constructor(props) { super(props); this.state = { classes: ClassNames( this.props.classes, this.props.className ) }; } render() { return ( ); } }; ``` import React from 'react'; import ClassNames from 'classnames'; import './chip.less'; class Chip extends React.Component { constructor(props) { super(props); this.state = { selected: 0, value: '', iconColor: this.props.iconColor, classes: ClassNames( 'chips', this.props.classes, this.props.className ) }; } componentWillReceiveProps(nextProps) { this.setState({ iconColor: nextProps.iconColor, classes: ClassNames( 'chips', nextProps.classes, nextProps.className ) }); } selectContact(data) { this.setState({ selected: data.index, value: data.value }); } renderContact() { let self = this; let contacts = null; let contact = (this.props.data && this.props.data.contact) ? this.props.data.contact : false; if (contact) { contacts = React.Children.map(contact, function (child, key) { let selectedClass = self.state.selected === key ? ' selected' : ''; return (
  • {child} {(key === 0 ? (x) : '')}
  • ) }); } return (contacts); } renderIcon() { return ( this.props.data.icon ? {this.props.data.icon} : ); } handleClose() { if (this.props.data && this.props.data.onClose) { // +hide chip } return (this.props.data && this.props.data.onClose) ? this.props.data.onClose() : null; } renderClose() { return ( this.props.data.deletable ? : null ); } renderInput() { return ( ); } renderChildren() { let childs = React.Children.map(this.props.data.text, function (child, key) { return child; }); return (
  • this.chipItem = ref}> {this.renderIcon()} {childs} {this.renderClose()}
  • ) } render() { return ( {this.renderInput()}
      {this.renderChildren()}
    ); } } Chip.defaultProps = { data: null, iconColor: null }; module.exports = Chip;@import '../../essence-core/src/less/mixins.less'; ul.chips { list-style: none; padding: 0; margin: 0; height: (@e-unit * 4); line-height: (@e-unit * 4); display: inline-block; border: (@e-unit * (0.125)) solid @e-color-grey-300; background: @e-color-grey-300; .border-radius( (@e-unit * 2) ); margin-right: (@e-unit * 0.5); &:hover { background: @e-color-grey-700; border: (@e-unit * (0.125)) solid @e-color-grey-700; .transition(all 0.2s); li { .e-text-white(); .deletable { color: @e-color-grey-700; background: @e-color-white; opacity: 1; } .icon { background: @e-color-grey-500; } } } li { cursor: default; font-size: 1.3rem; color: rgba(0, 0, 0, 0.87); position: relative; padding-right: (@e-unit * 1.5); .deletable { cursor: default; width: (@e-unit * 2.5); height: (@e-unit * 2.5); background: @e-color-black; display: block; line-height: (@e-unit * 2.5); text-align: center; .border-radius(50%); color: @e-color-white; opacity: .54; float: right; margin: (@e-unit * 0.75) (@e-unit * (-0.5)) 0 (@e-unit * (0.5)); &:after { content: "\00d7"; display: inline-block; } } .icon { margin: (@e-unit * (-0.125)) (@e-unit) 0 (@e-unit * (-0.25)); .border-radius(50%); background-color: @e-color-teal-500; width: (@e-unit * 4.25); height: (@e-unit * 4.25); text-align: center; line-height: (@e-unit * 4.25); display: block; float: left; font-size: (@e-unit * 2); color: @e-color-white; font-weight: 100; } .empty { float: left; width: (@e-unit * 1.5); height: (@e-unit * 4); display: block; } } } import React from 'react'; import ClassNames from 'classnames'; class ChipItem extends React.Component { constructor(props) { super(props); this.state = { classes: ClassNames( this.props.classes, this.props.className, { 'e-chip': true, 'clearfix': true, 'press': false, 'focus': false, 'first': this.props.first, 'active': this.props.active, 'open': false } ), isOpen: this.props.open }; } renderImage() { return (
    ); } renderText() { if (!this.props.name) return; return (
    {this.props.name} {this.props.email}
    ); } handleClasses(ev) { return ( { 'e-chip': true, 'clearfix': true, 'press': false, 'focus': (ev.type === 'mouseenter'), 'active': this.props.active, 'open': this.state.isOpen } ); } setFocus(ev) { this.setState({ classes: ClassNames( this.props.classes, this.props.className, this.handleClasses(ev) ) }); ev.preventDefault(); } setClick(ev) { let targetID = ev.target.id; this.setState({ classes: ClassNames( this.props.classes, this.props.className, this.handleClasses(ev), 'active' ) }); if (!this.state.isOpen) { this.openChip(); } ev.preventDefault(); } openChip() { this.setState({ isOpen: true }); this.props.handleOpenChip(); } componentDidMount() { this.setState({ classes: ClassNames( this.props.classes, this.props.className, this.handleClasses(this) ) }); } renderCloseButton() { if (!this.props.active) return; return (