diff --git a/semantic/src/themes/tripwire/modules/checkbox.overrides b/semantic/src/themes/tripwire/modules/checkbox.overrides index 774b6da..1986db7 100644 --- a/semantic/src/themes/tripwire/modules/checkbox.overrides +++ b/semantic/src/themes/tripwire/modules/checkbox.overrides @@ -42,16 +42,21 @@ height: 16px; padding: 2px; right: 1px; +} +.ui.toggle.checkbox label::hover:before { + + background-color: #f1f1f1; + } .ui.toggle.checkbox label:after { background-color: white; - box-shadow: 0 2px 5px rgba(0, 0, 0, .3) !important; + box-shadow: none; position: absolute; content: '' !important; opacity: 1; z-index: 2; - border: none; + border: 1px solid #e4e6e7; width: 14px; height: 14px; top: 0px; @@ -62,6 +67,13 @@ } +/* Active */ + +.ui.toggle.checkbox input:checked ~ .box:after, +.ui.toggle.checkbox input:checked ~ label:after { + left: (@toggleLaneWidth - @toggleHandleSize) + 0.35rem; +} + /*-------------- Radio ---------------*/ @@ -87,6 +99,7 @@ top: @radioTop; left: @radioLeft; border-color: @grey; + border-width: 2px; } @@ -98,9 +111,10 @@ width: @radioSize; height: @radioSize; line-height: @radioSize; - + background-color: @grey !important; } + /* Radio Checkbox */ .ui.radio.checkbox .box:after, .ui.radio.checkbox label:after { @@ -139,7 +153,19 @@ top: @radioTop; left: @radioLeft; border-color: @blue; +} +.ui.radio.checkbox.disabled .box:hover::before, +.ui.radio.checkbox.disabled label:hover::before { + content: ''; + transform: none; + + width: @radioSize; + height: @radioSize; + border-radius: @circularRadius; + top: @radioTop; + left: @radioLeft; + border-color: @grey; } /* Active */ @@ -153,6 +179,59 @@ background-color: @radioActiveBulletColor; border-color: @grey; } +.ui.radio.checkbox input:checked ~ .box:hover::before, +.ui.radio.checkbox input:checked ~ label:hover::before { + background-color: @radioActiveBackground; + border-color: @blue; +} +.ui.radio.checkbox input:checked ~ .box:hover::after, +.ui.radio.checkbox input:checked ~ label:hover::after { + background-color: @radioActiveBulletColor; + border-color: @blue; +} + +.ui.radio.checkbox .box:hover::after, +.ui.radio.checkbox label:hover::after { + border: none; + content: '' !important; + width: @radioSize; + height: @radioSize; + line-height: @radioSize; + background-color: @blue !important; +} + +.ui.radio.checkbox.disabled .box:hover::after, +.ui.radio.checkbox.disabled label:hover::after { + border: none; + content: '' !important; + width: @radioSize; + height: @radioSize; + line-height: @radioSize; + background-color: @grey !important; +} + +/* Active */ +.ui.radio.checkbox.disabled input:checked ~ .box:before, +.ui.radio.checkbox.disabled input:checked ~ label:before { + background-color: @radioActiveBackground; + border-color: @grey; +} +.ui.radio.checkbox.disabled input:checked ~ .box:after, +.ui.radio.checkbox.disabled input:checked ~ label:after { + background-color: @radioActiveBulletColor; + border-color: @grey; +} +.ui.radio.checkbox.disabled input:checked ~ .box:hover::before, +.ui.radio.checkbox.disabled input:checked ~ label:hover::before { + background-color: @radioActiveBackground; + border-color: @grey; +} +.ui.radio.checkbox.disabled input:checked ~ .box:hover::after, +.ui.radio.checkbox.disabled input:checked ~ label:hover::after { + background-color: @radioActiveBulletColor; + border-color: @grey; +} + /* Active Focus */ .ui.radio.checkbox input:focus:checked ~ .box:before, @@ -163,3 +242,115 @@ .ui.radio.checkbox input:focus:checked ~ label:after { background-color: @radioActiveFocusBulletColor; } + + +/*-------------- + Box +---------------*/ + + +.ui.checkbox .box, +.ui.checkbox label { + cursor: auto; + position: relative; + display: block; + padding-left: @labelDistance; + outline: none; + font-size: @labelFontSize; +} + +.ui.checkbox .box:before, +.ui.checkbox label:before { + position: absolute; + top: 0px; + left: 0px; + + width: @checkboxSize; + height: @checkboxSize; + content: ''; + + background: @checkboxBackground; + border-radius: @checkboxBorderRadius; + + transition: @checkboxTransition; + border: @checkboxBorder; +} + +/*-------------- + Checkmark +---------------*/ + + + +.ui.checkbox .box:hover::before, +.ui.checkbox label:hover::before { + background: @checkboxHoverBackground; + border-color: @blue; +} + + +.ui.checkbox .box:after, +.ui.checkbox label:after { + position: absolute; + font-size: @checkboxCheckFontSize; + top: @checkboxCheckTop; + left: @checkboxCheckLeft; + width: @checkboxCheckSize; + height: @checkboxCheckSize; + text-align: center; + + opacity: 0; + color: @grey; + transition: @checkboxTransition; + + + +} + +/*-------------- + Active +---------------*/ + +.ui.checkbox input:checked ~ .box:before, +.ui.checkbox input:checked ~ label:before { + background: @checkboxActiveBackground; + opacity: 1; + border-color: @grey; +} +.ui.checkbox input:checked ~ .box:after, +.ui.checkbox input:checked ~ label:after { + opacity: 1; + color: @grey; +} + +.ui.checkbox input:checked ~ .box:hover::before, +.ui.checkbox input:checked ~ label:hover::before { + background: @checkboxActiveBackground; + opacity: 1; + border-color: @blue; +} +.ui.checkbox input:checked ~ .box:hover::after, +.ui.checkbox input:checked ~ label:hover::after { + opacity: 1; + color: @blue; +} + + + +.ui.checkbox.disabled input:checked ~ .box:hover::before, +.ui.checkbox.disabled input:checked ~ label:hover::before { + background: @checkboxActiveBackground; + opacity: 1; + border-color: @grey; +} +.ui.checkbox.disabled input:checked ~ .box:hover::after, +.ui.checkbox.disabled input:checked ~ label:hover::after { + opacity: 1; + color: @grey; +} + +.ui.checkbox.disabled .box:hover::before, +.ui.checkbox.disabled label:hover::before { + background: @checkboxHoverBackground; + border-color: @grey; +} \ No newline at end of file diff --git a/semantic/src/themes/tripwire/modules/checkbox.variables b/semantic/src/themes/tripwire/modules/checkbox.variables index 6cdc97a..95fc5db 100644 --- a/semantic/src/themes/tripwire/modules/checkbox.variables +++ b/semantic/src/themes/tripwire/modules/checkbox.variables @@ -3,7 +3,7 @@ *******************************/ @textColor: @grey; -@checkboxSize: 17px; +@checkboxSize: 20px; @checkboxColor: @textColor; @checkboxLineHeight: @checkboxSize; @@ -13,8 +13,8 @@ /* Checkbox */ @checkboxBackground: @white; -@checkboxBorder: 1px solid @solidBorderColor; -@checkboxBorderRadius: @3px; +@checkboxBorder: 2px solid @grey; +@checkboxBorderRadius: 2px; @checkboxTransition: border @defaultDuration @defaultEasing, opacity @defaultDuration @defaultEasing, diff --git a/src/components/charts/CircleChart/Circle.jsx b/src/components/charts/CircleChart/Circle.jsx index 6ae0939..f933bc3 100644 --- a/src/components/charts/CircleChart/Circle.jsx +++ b/src/components/charts/CircleChart/Circle.jsx @@ -1,5 +1,5 @@ import React from 'react' -import colorPallete from '../../colorPallete'; +import colorPallete from '../../colorPallete' var d3 = Object.assign({}, require('d3-shape')) const twoPi = Math.PI * 2 diff --git a/stories/controls.stories.js b/stories/controls.stories.js index 08392db..bca32b2 100644 --- a/stories/controls.stories.js +++ b/stories/controls.stories.js @@ -1,6 +1,6 @@ import React from 'react' import { storiesOf } from '@kadira/storybook' -import { Radio, Dropdown, Input, Button, Popup } from 'semantic-ui-react' +import { Radio, Dropdown, Input, Button, Popup, Checkbox } from 'semantic-ui-react' import FavoriteButton from '../src/components/FavoriteButton' import StopStartButton from '../src/components/StopStartButton' import PaginationControl from '../src/components/PaginationControl' @@ -49,8 +49,47 @@ storiesOf('Interactive Controls', module) )) .add('Radio Button', () => ( - +
+
+ + Standard +
+
+ + Disabled +
+
+ + Checked Disabled +
+
+ Reference Semantic UI documentation for usage: here +
)) + .add('Checkbox', () => ( +
+
+ + Standard +
+
+ + Checked +
+
+ + Disabled +
+
+ + Checked Disabled +
+ +
+ Reference Semantic UI documentation for usage: here +
+ )) + .add('Dropdown Menu', () => ( )) diff --git a/stories/tables.stories.js b/stories/tables.stories.js index 30ae300..34093b3 100644 --- a/stories/tables.stories.js +++ b/stories/tables.stories.js @@ -95,4 +95,3 @@ storiesOf('Tables', module) )) -