Skip to content

Commit

Permalink
Rename KuiCheckbox to KuiCheckboxGroup and remove top padding on firs…
Browse files Browse the repository at this point in the history
…t item.
  • Loading branch information
cjcenizal committed Aug 14, 2017
1 parent b47651b commit bdc1134
Show file tree
Hide file tree
Showing 14 changed files with 164 additions and 110 deletions.
229 changes: 139 additions & 90 deletions ui_framework/dist/ui_framework_theme_dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -563,80 +563,12 @@ table {
transform: translateY(2px);
/* 1 */ }

.kuiForm__error {
font-size: 14px;
font-size: 0.875rem;
line-height: 18px;
list-style: disc;
margin-left: 32px; }

.kuiForm__errors {
margin-bottom: 16px; }

.kuiFormRow {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
position: relative;
max-width: 400px; }
.kuiFormRow + * {
margin-top: 24px; }
.kuiFormRow.kuiFormRow--withIcon input {
padding-left: 40px; }
.kuiFormRow.kuiFormRow--dropdown input {
padding-left: 12px;
padding-right: 40px; }
.kuiFormRow.kuiFormRow--select .kuiFormRow__icon {
left: auto;
right: 12px; }
.kuiFormRow .kuiFormRow__label {
font-size: 12px;
padding-bottom: 8px;
cursor: pointer;
transition: all 150ms cubic-bezier(0.694, 0.0482, 0.335, 1);
font-weight: 500;
-webkit-box-ordinal-group: 0;
-webkit-order: -1;
-ms-flex-order: -1;
order: -1; }
.kuiFormRow .kuiFormRow__helpText {
font-size: 12px;
padding: 8px 0;
color: #D9D9D9; }
.kuiFormRow .kuiFormRow__error {
font-size: 12px;
padding: 8px 0;
color: #bf4d4d; }
.kuiFormRow .kuiFormRow__error + * {
padding-top: 0; }
.kuiFormRow .kuiFormRow__icon {
position: absolute;
top: 32px;
left: 12px; }
.kuiFormRow input:focus + label,
.kuiFormRow select:focus + label,
.kuiFormRow textarea:focus + label {
color: #4da1c0; }
.kuiFormRow.kuiFormRow--invalid .kuiFormRow__label {
color: #bf4d4d !important; }
.kuiFormRow.kuiFormRow--invalid input[type="text"],
.kuiFormRow.kuiFormRow--invalid input[type="password"],
.kuiFormRow.kuiFormRow--invalid input[type="number"],
.kuiFormRow.kuiFormRow--invalid input[type="search"],
.kuiFormRow.kuiFormRow--invalid select,
.kuiFormRow.kuiFormRow--invalid textarea {
box-shadow: 0 4px 4px -2px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.16), inset 0 0 0 0 #222, inset 0 -2px 0 0 #bf4d4d !important; }

/**
* 1. Override invalid state with focus state.
*/
.kuiCheckbox {
position: relative;
height: 24px;
margin-top: 8px; }
height: 24px; }
.kuiCheckbox .kuiCheckbox__label {
position: absolute;
padding-left: 32px;
Expand Down Expand Up @@ -672,69 +604,171 @@ table {
-webkit-mask: url("../src/components/icon/assets/check.svg") center center no-repeat;
mask: url("../src/components/icon/assets/check.svg") center center no-repeat; }

.kuiCheckboxGroup__item + .kuiCheckboxGroup__item {
margin-top: 8px; }

.kuiFieldNumber {
min-width: 256px;
max-width: 400px;
width: 100%;
border: none;
font-size: 14px;
font-family: "Roboto", Helvetica, Arial, sans-serif;
padding: 12px;
color: #F5F5F5;
min-width: 256px;
background: #262626;
box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.08), inset -400px 0 0 0 #262626;
transition: box-shadow 250ms ease-in, background 250ms ease-in;
max-width: 400px;
border-radius: 0; }
.kuiFieldNumber:invalid {
/* 1 */
box-shadow: 0 4px 4px -2px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.16), inset 0 0 0 0 #222, inset 0 -2px 0 0 #bf4d4d; }
.kuiFieldNumber:focus {
/* 1 */
background: #222;
box-shadow: 0 4px 4px -2px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.16), inset 0 0 0 0 #222, inset 0 -2px 0 0 #4da1c0; }
.kuiFieldNumber--withIcon {
padding-left: 40px; }

.kuiFieldPassword {
min-width: 256px;
max-width: 400px;
width: 100%;
border: none;
font-size: 14px;
font-family: "Roboto", Helvetica, Arial, sans-serif;
padding: 12px;
color: #F5F5F5;
min-width: 256px;
background: #262626;
box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.08), inset -400px 0 0 0 #262626;
transition: box-shadow 250ms ease-in, background 250ms ease-in;
max-width: 400px;
border-radius: 0; }
border-radius: 0;
padding-left: 40px; }
.kuiFieldPassword:invalid {
/* 1 */
box-shadow: 0 4px 4px -2px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.16), inset 0 0 0 0 #222, inset 0 -2px 0 0 #bf4d4d; }
.kuiFieldPassword:focus {
/* 1 */
background: #222;
box-shadow: 0 4px 4px -2px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.16), inset 0 0 0 0 #222, inset 0 -2px 0 0 #4da1c0; }

.kuiFieldSearch {
min-width: 256px;
max-width: 400px;
width: 100%;
border: none;
font-size: 14px;
font-family: "Roboto", Helvetica, Arial, sans-serif;
padding: 12px;
color: #F5F5F5;
min-width: 256px;
background: #262626;
box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.08), inset -400px 0 0 0 #262626;
transition: box-shadow 250ms ease-in, background 250ms ease-in;
max-width: 400px;
border-radius: 0; }
border-radius: 0;
padding-left: 40px; }
.kuiFieldSearch:invalid {
/* 1 */
box-shadow: 0 4px 4px -2px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.16), inset 0 0 0 0 #222, inset 0 -2px 0 0 #bf4d4d; }
.kuiFieldSearch:focus {
/* 1 */
background: #222;
box-shadow: 0 4px 4px -2px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.16), inset 0 0 0 0 #222, inset 0 -2px 0 0 #4da1c0; }

.kuiFieldText {
min-width: 256px;
max-width: 400px;
width: 100%;
border: none;
font-size: 14px;
font-family: "Roboto", Helvetica, Arial, sans-serif;
padding: 12px;
color: #F5F5F5;
min-width: 256px;
background: #262626;
box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.08), inset -400px 0 0 0 #262626;
transition: box-shadow 250ms ease-in, background 250ms ease-in;
max-width: 400px;
border-radius: 0; }
.kuiFieldText:invalid {
/* 1 */
box-shadow: 0 4px 4px -2px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.16), inset 0 0 0 0 #222, inset 0 -2px 0 0 #bf4d4d; }
.kuiFieldText:focus {
/* 1 */
background: #222;
box-shadow: 0 4px 4px -2px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.16), inset 0 0 0 0 #222, inset 0 -2px 0 0 #4da1c0; }
.kuiFieldText--withIcon {
padding-left: 40px; }

.kuiForm__error {
font-size: 14px;
font-size: 0.875rem;
line-height: 18px;
list-style: disc;
margin-left: 32px; }

.kuiForm__errors {
margin-bottom: 16px; }

.kuiFormControlLayout {
min-width: 256px;
max-width: 400px;
width: 100%;
display: inline-block;
position: relative; }

.kuiFormControlLayout__icon {
position: absolute;
top: 12px;
left: 12px; }

.kuiFormControlLayout__icon--right {
left: auto;
right: 12px; }

.kuiFormErrorText {
font-size: 12px;
padding: 8px 0;
color: #bf4d4d; }

.kuiFormHelpText {
font-size: 12px;
padding: 8px 0;
color: #D9D9D9; }

/**
* 1. Focused state overrides invalid state.
*/
.kuiFormLabel {
font-size: 12px;
margin-bottom: 8px;
cursor: pointer;
transition: all 150ms cubic-bezier(0.694, 0.0482, 0.335, 1);
font-weight: 500; }
.kuiFormLabel.kuiFormLabel-isInvalid {
color: #bf4d4d;
/* 1 */ }
.kuiFormLabel.kuiFormLabel-isFocused {
color: #4da1c0;
/* 1 */ }

/**
* 1. Coerce inline form elements to behave as block-level elements.
*/
.kuiFormRow {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
/* 1 */
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
/* 1 */
max-width: 400px; }
.kuiFormRow + * {
margin-top: 24px; }
.kuiFormRow .kuiFormRow__text + .kuiFormRow__text {
padding-top: 0; }

.kuiRange {
-webkit-appearance: none;
Expand Down Expand Up @@ -808,22 +842,32 @@ table {
width: 16px;
margin-top: 0; }

/**
* 1. Leave room for caret.
*/
.kuiSelect {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
min-width: 256px;
max-width: 400px;
width: 100%;
border: none;
font-size: 14px;
font-family: "Roboto", Helvetica, Arial, sans-serif;
padding: 12px;
color: #F5F5F5;
min-width: 256px;
background: #262626;
box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.08), inset -400px 0 0 0 #262626;
transition: box-shadow 250ms ease-in, background 250ms ease-in;
max-width: 400px;
border-radius: 0; }
border-radius: 0;
padding-right: 40px;
/* 1 */
-webkit-appearance: none;
-moz-appearance: none;
appearance: none; }
.kuiSelect:invalid {
/* 1 */
box-shadow: 0 4px 4px -2px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.16), inset 0 0 0 0 #222, inset 0 -2px 0 0 #bf4d4d; }
.kuiSelect:focus {
/* 1 */
background: #222;
box-shadow: 0 4px 4px -2px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.16), inset 0 0 0 0 #222, inset 0 -2px 0 0 #4da1c0; }
.kuiSelect::-ms-expand {
Expand Down Expand Up @@ -931,18 +975,23 @@ table {
left: -40px; }

.kuiTextArea {
min-width: 256px;
max-width: 400px;
width: 100%;
border: none;
font-size: 14px;
font-family: "Roboto", Helvetica, Arial, sans-serif;
padding: 12px;
color: #F5F5F5;
min-width: 256px;
background: #262626;
box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.08), inset -400px 0 0 0 #262626;
transition: box-shadow 250ms ease-in, background 250ms ease-in;
max-width: 400px;
border-radius: 0; }
.kuiTextArea:invalid {
/* 1 */
box-shadow: 0 4px 4px -2px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.16), inset 0 0 0 0 #222, inset 0 -2px 0 0 #bf4d4d; }
.kuiTextArea:focus {
/* 1 */
background: #222;
box-shadow: 0 4px 4px -2px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.16), inset 0 0 0 0 #222, inset 0 -2px 0 0 #4da1c0; }

Expand Down
6 changes: 4 additions & 2 deletions ui_framework/dist/ui_framework_theme_light.css
Original file line number Diff line number Diff line change
Expand Up @@ -568,8 +568,7 @@ table {
*/
.kuiCheckbox {
position: relative;
height: 24px;
margin-top: 8px; }
height: 24px; }
.kuiCheckbox .kuiCheckbox__label {
position: absolute;
padding-left: 32px;
Expand Down Expand Up @@ -605,6 +604,9 @@ table {
-webkit-mask: url("../src/components/icon/assets/check.svg") center center no-repeat;
mask: url("../src/components/icon/assets/check.svg") center center no-repeat; }

.kuiCheckboxGroup__item + .kuiCheckboxGroup__item {
margin-top: 8px; }

.kuiFieldNumber {
min-width: 256px;
max-width: 400px;
Expand Down
4 changes: 2 additions & 2 deletions ui_framework/doc_site/src/views/form/form_controls.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';

import {
KuiCheckbox,
KuiCheckboxGroup,
KuiFieldNumber,
KuiFieldPassword,
KuiFieldSearch,
Expand Down Expand Up @@ -76,7 +76,7 @@ export default () => (
<br />
<br />

<KuiCheckbox
<KuiCheckboxGroup
options={[
{ id: '0', label: 'Option one', onChange: () => {} },
{ id: '1', label: 'Option two is checked by default', checked: true, onChange: () => {} },
Expand Down
4 changes: 2 additions & 2 deletions ui_framework/doc_site/src/views/form/form_rows.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';

import {
KuiCheckbox,
KuiCheckboxGroup,
KuiFieldNumber,
KuiFieldPassword,
KuiFieldSearch,
Expand Down Expand Up @@ -119,7 +119,7 @@ export default () => {
id={makeId()}
label="Checkboxes"
>
<KuiCheckbox options={checkboxOptions} />
<KuiCheckboxGroup options={checkboxOptions} />
</KuiFormRow>
</KuiForm>
);
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`KuiCheckboxGroup is rendered 1`] = `<div />`;
Loading

0 comments on commit bdc1134

Please sign in to comment.