tungsten 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -417,7 +417,10 @@ module Tungsten
417
417
  tag = capture(&block).html_safe
418
418
 
419
419
  tick = content_tag(:span, class: 'tick') {''}
420
- label = content_tag(:span, class: 'label-text') { options.delete(:label) || name }
420
+
421
+ classnames = ['label-text']
422
+ classnames << 'hidden' if options.delete(:hidden_label)
423
+ label = content_tag(:span, class: classnames.join(' ')) { options.delete(:label) || name }
421
424
 
422
425
  options[:class] ||= ' '
423
426
  options[:class] << "#{label_class( options.delete(:type) )} tick-box"
@@ -468,7 +471,7 @@ module Tungsten
468
471
  if labels = options['external_labels']
469
472
  if labels.is_a?(Hash)
470
473
  labels.each do |label, value|
471
- l = label.to_s.downcase.dasherize
474
+ l = dasherize(label.to_s.downcase)
472
475
  data['external-label-'+l] = value.join(';')
473
476
  end
474
477
  end
@@ -511,6 +514,11 @@ module Tungsten
511
514
  html_options = {"class" => classnames, "type" => "range", "min" => options['min'], "max" => options['max'], "value" => options['value'] }.update('data' => data)
512
515
  tag :input, html_options
513
516
  end
517
+
518
+ def dasherize(input)
519
+ input.gsub(/[\W,_]/, '-').gsub(/-{2,}/, '-')
520
+ end
521
+
514
522
  alias :range_input_tag :slider_input_tag
515
523
  end
516
524
  end
@@ -1,3 +1,3 @@
1
1
  module Tungsten
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
@@ -89,4 +89,4 @@ function move(o){document.documentElement.scrollTop=o,document.body.parentNode.s
89
89
  });
90
90
 
91
91
 
92
- //# sourceMappingURL=/assets/tungsten/code-0.1.4.map.json
92
+ //# sourceMappingURL=/assets/tungsten/code-0.1.5.map.json
@@ -1,3 +1,4 @@
1
+ @charset "UTF-8";
1
2
  .white-text {
2
3
  color: #fff; }
3
4
 
@@ -739,15 +740,15 @@ table.ruled tfoot th, table.ruled tbody tr:nth-child(n+2) th, table.ruled tbody
739
740
  table.ruled thead th {
740
741
  border-bottom: 1px solid #dfe3e6; }
741
742
 
742
- table.outlined {
743
+ table.outlined, table.doc-table {
743
744
  border-collapse: collapse; }
744
- table.outlined td, table.outlined th {
745
+ table.outlined td, table.outlined th, table.doc-table td, table.doc-table th {
745
746
  border: 1px solid #dfe3e6; }
746
747
 
747
748
  table.striped tbody tr:nth-child(2n+1) th, table.striped tbody tr:nth-child(2n+1) td {
748
749
  background: #f0f3f6; }
749
750
 
750
- table.stretched {
751
+ table.stretched, table.doc-table {
751
752
  table-layout: fixed;
752
753
  min-width: 100%; }
753
754
 
@@ -781,13 +782,13 @@ table.filled th:last-child, table.filled td:last-child {
781
782
  text-align: center;
782
783
  text-decoration: none;
783
784
  border: 0;
784
- padding: 12px 15px;
785
+ padding: 8px 12px;
785
786
  background: #fff;
786
787
  border-radius: 2px;
787
788
  -webkit-transition: color 0.25s, background 0.25s, box-shadow 0.25s;
788
789
  transition: color 0.25s, background 0.25s, box-shadow 0.25s; }
789
- table .button, .card .button, .button-group .button, .button.small {
790
- padding: 8px 12px; }
790
+ .button.large {
791
+ padding: 12px 15px; }
791
792
  .button, .button:visited {
792
793
  color: inherit;
793
794
  box-shadow: 0 0 0 1px rgba(15, 33, 46, 0.1), 0 1px 3px rgba(15, 33, 46, 0.15); }
@@ -1325,7 +1326,7 @@ form.button_to {
1325
1326
  pointer-events: none;
1326
1327
  font-size: inherit;
1327
1328
  position: absolute;
1328
- top: 0.9em;
1329
+ top: 0.8em;
1329
1330
  left: 0.8em;
1330
1331
  padding: 1px 0 0 1px;
1331
1332
  -webkit-transform-origin: left top 0;
@@ -1352,7 +1353,8 @@ label.tick-box {
1352
1353
  flex-direction: row;
1353
1354
  -webkit-box-align: center;
1354
1355
  -ms-flex-align: center;
1355
- align-items: center; }
1356
+ align-items: center;
1357
+ cursor: pointer; }
1356
1358
  label.tick-box *, label.tick-box *:after, label.tick-box *:before {
1357
1359
  -webkit-transition-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1.275);
1358
1360
  transition-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1.275); }
@@ -1474,11 +1476,11 @@ label.tick-box input[type=checkbox]:focus:checked + .tick:before, label.tick-box
1474
1476
  color: transparent;
1475
1477
  font-size: 0; }
1476
1478
  .check-switch-panel {
1477
- width: 44px;
1478
- height: 24px;
1479
+ width: 40px;
1480
+ height: 22px;
1479
1481
  background: rgba(15, 33, 46, 0.1);
1480
1482
  position: relative;
1481
- border-radius: 24px;
1483
+ border-radius: 22px;
1482
1484
  -webkit-transition-property: background, box-shadow, border-color;
1483
1485
  transition-property: background, box-shadow, border-color;
1484
1486
  box-shadow: 0 0 0 1px rgba(15, 33, 46, 0.1) inset, 0 0 0 transparent; }
@@ -1487,9 +1489,9 @@ label.tick-box input[type=checkbox]:focus:checked + .tick:before, label.tick-box
1487
1489
  height: 18px;
1488
1490
  background: #fff;
1489
1491
  position: absolute;
1490
- bottom: 3px;
1491
- left: 4px;
1492
- border-radius: 24px;
1492
+ bottom: 2px;
1493
+ left: 2px;
1494
+ border-radius: 22px;
1493
1495
  -webkit-transition-property: -webkit-transform;
1494
1496
  transition-property: -webkit-transform;
1495
1497
  transition-property: transform;
@@ -1503,6 +1505,9 @@ label.tick-box input[type=checkbox]:focus:checked + .tick:before, label.tick-box
1503
1505
  position: absolute; }
1504
1506
  .check-switch input:focus ~ .check-switch-panel, .check-switch input:hover:not([disabled]) ~ .check-switch-panel, .check-switch input:active ~ .check-switch-panel {
1505
1507
  background: rgba(15, 33, 46, 0.2); }
1508
+ .check-switch input:focus ~ .check-switch-panel .check-switch-tick, .check-switch input:hover:not([disabled]) ~ .check-switch-panel .check-switch-tick, .check-switch input:active ~ .check-switch-panel .check-switch-tick {
1509
+ -webkit-transform: scale(1.1);
1510
+ transform: scale(1.1); }
1506
1511
  input:checked + .check-switch-panel .check-switch-tick {
1507
1512
  -webkit-transform: translate3d(18px, 0, 0);
1508
1513
  transform: translate3d(18px, 0, 0); }
@@ -1511,6 +1516,9 @@ input:checked + .check-switch-panel {
1511
1516
  .check-switch input:checked:focus ~ .check-switch-panel, .check-switch input:checked:hover:not([disabled]) ~ .check-switch-panel, .check-switch input:checked:active ~ .check-switch-panel {
1512
1517
  background: #008ef3;
1513
1518
  box-shadow: 0 0 0 1px #006dff inset, 0 0 0 transparent; }
1519
+ .check-switch input:checked:focus ~ .check-switch-panel .check-switch-tick, .check-switch input:checked:hover:not([disabled]) ~ .check-switch-panel .check-switch-tick, .check-switch input:checked:active ~ .check-switch-panel .check-switch-tick {
1520
+ -webkit-transform: scale(1.1) translate3d(16px, 0, 0);
1521
+ transform: scale(1.1) translate3d(16px, 0, 0); }
1514
1522
 
1515
1523
  label.valid {
1516
1524
  color: #2ac84f; }
@@ -1576,3 +1584,386 @@ label.invalid input:focus, label.invalid input:hover:not([disabled]), label.inva
1576
1584
  background: #8c9ba5; }
1577
1585
  .invalid .validation-message .validation-message-text {
1578
1586
  background: #dd2f41; }
1587
+
1588
+ .empty-label[data-slider-label] {
1589
+ display: none; }
1590
+
1591
+ input[type=range] {
1592
+ -webkit-appearance: none;
1593
+ -moz-appearance: none;
1594
+ width: 100%;
1595
+ margin: 0;
1596
+ cursor: pointer;
1597
+ position: relative;
1598
+ z-index: 4;
1599
+ height: 16px;
1600
+ background: transparent; }
1601
+ input[type=range]:focus {
1602
+ outline: none; }
1603
+ input[type=range]::-webkit-slider-thumb {
1604
+ -webkit-appearance: none; }
1605
+ input[type=range]::-moz-slider-thumb {
1606
+ -moz-appearance: none; }
1607
+ input[type=range]::-ms-track {
1608
+ width: 100%;
1609
+ cursor: pointer;
1610
+ background: transparent;
1611
+ border-color: transparent;
1612
+ color: transparent; }
1613
+ input[type=range]::-moz-focus-outer {
1614
+ border: 0; }
1615
+ input[type=range]::-moz-range-track {
1616
+ border: inherit;
1617
+ background: transparent; }
1618
+ input[type=range]::-moz-range-thumb {
1619
+ box-shadow: rgba(0, 0, 0, 0.4) 0 0 0 1px, rgba(0, 0, 0, 0.4) 0 1px 1px inset;
1620
+ border: 6px solid #fff;
1621
+ background: rgba(15, 33, 46, 0.2);
1622
+ box-sizing: border-box;
1623
+ height: 19px;
1624
+ width: 19px;
1625
+ border-radius: 100%;
1626
+ position: relative;
1627
+ top: 3px;
1628
+ -webkit-transition: all .15s ease-in;
1629
+ transition: all .15s ease-in; }
1630
+ input[type=range]::-moz-range-thumb:after {
1631
+ box-sizing: border-box;
1632
+ content: "";
1633
+ position: absolute;
1634
+ left: -15px;
1635
+ right: -15px;
1636
+ top: -15px;
1637
+ bottom: -15px; }
1638
+ input[type=range]::-moz-range-thumb:active {
1639
+ background: #5aaafa;
1640
+ box-shadow: 0 0 2px 2px #5aaafa, rgba(0, 0, 0, 0.4) 0 1px 1px inset; }
1641
+ input[type=range]::-webkit-slider-thumb {
1642
+ box-shadow: rgba(0, 0, 0, 0.4) 0 0 0 1px, rgba(0, 0, 0, 0.4) 0 1px 1px inset;
1643
+ border: 6px solid #fff;
1644
+ background: rgba(15, 33, 46, 0.2);
1645
+ box-sizing: border-box;
1646
+ height: 19px;
1647
+ width: 19px;
1648
+ border-radius: 100%;
1649
+ position: relative;
1650
+ top: 3px;
1651
+ -webkit-transition: all .15s ease-in;
1652
+ transition: all .15s ease-in; }
1653
+ input[type=range]::-webkit-slider-thumb:after {
1654
+ box-sizing: border-box;
1655
+ content: "";
1656
+ position: absolute;
1657
+ left: -15px;
1658
+ right: -15px;
1659
+ top: -15px;
1660
+ bottom: -15px; }
1661
+ input[type=range]::-webkit-slider-thumb:active {
1662
+ background: #5aaafa;
1663
+ box-shadow: 0 0 2px 2px #5aaafa, rgba(0, 0, 0, 0.4) 0 1px 1px inset; }
1664
+ input[type=range]::-ms-thumb {
1665
+ box-shadow: rgba(0, 0, 0, 0.4) 0 0 0 1px, rgba(0, 0, 0, 0.4) 0 1px 1px inset;
1666
+ border: 6px solid #fff;
1667
+ background: rgba(15, 33, 46, 0.2);
1668
+ box-sizing: border-box;
1669
+ height: 19px;
1670
+ width: 19px;
1671
+ border-radius: 100%;
1672
+ position: relative;
1673
+ top: 3px;
1674
+ -webkit-transition: all .15s ease-in;
1675
+ transition: all .15s ease-in; }
1676
+ input[type=range]::-ms-thumb:after {
1677
+ box-sizing: border-box;
1678
+ content: "";
1679
+ position: absolute;
1680
+ left: -15px;
1681
+ right: -15px;
1682
+ top: -15px;
1683
+ bottom: -15px; }
1684
+ input[type=range]::-ms-thumb:active {
1685
+ background: #5aaafa;
1686
+ box-shadow: 0 0 2px 2px #5aaafa, rgba(0, 0, 0, 0.4) 0 1px 1px inset; }
1687
+ input[type=range]:focus::-moz-range-thumb {
1688
+ background: #5aaafa;
1689
+ box-shadow: 0 0 2px 2px #5aaafa, rgba(0, 0, 0, 0.4) 0 1px 1px inset; }
1690
+ input[type=range]:focus::-webkit-slider-thumb {
1691
+ background: #5aaafa;
1692
+ box-shadow: 0 0 2px 2px #5aaafa, rgba(0, 0, 0, 0.4) 0 1px 1px inset; }
1693
+ input[type=range]:focus::-ms-thumb {
1694
+ background: #5aaafa;
1695
+ box-shadow: 0 0 2px 2px #5aaafa, rgba(0, 0, 0, 0.4) 0 1px 1px inset; }
1696
+ input[type=range]:after {
1697
+ position: absolute;
1698
+ content: "";
1699
+ left: 4px;
1700
+ right: 4px;
1701
+ top: 6px;
1702
+ height: 5px;
1703
+ background: #f5f7fa;
1704
+ z-index: -1;
1705
+ border-radius: 4px;
1706
+ box-shadow: rgba(15, 33, 46, 0.2) 0 0 0 1px; }
1707
+ input[type=range]::-moz-slider-track {
1708
+ height: 16px;
1709
+ background: transparent; }
1710
+ input[type=range]::-moz-slider-track:after {
1711
+ position: absolute;
1712
+ content: "";
1713
+ left: 4px;
1714
+ right: 4px;
1715
+ top: 6px;
1716
+ height: 5px;
1717
+ background: #f5f7fa;
1718
+ z-index: -1;
1719
+ border-radius: 4px;
1720
+ box-shadow: rgba(15, 33, 46, 0.2) 0 0 0 1px; }
1721
+ input[type=range]::-ms-track {
1722
+ height: 16px;
1723
+ background: transparent; }
1724
+ input[type=range]::-ms-track:after {
1725
+ position: absolute;
1726
+ content: "";
1727
+ left: 4px;
1728
+ right: 4px;
1729
+ top: 6px;
1730
+ height: 5px;
1731
+ background: #f5f7fa;
1732
+ z-index: -1;
1733
+ border-radius: 4px;
1734
+ box-shadow: rgba(15, 33, 46, 0.2) 0 0 0 1px; }
1735
+ input[type=range].slider-input {
1736
+ margin: 0; }
1737
+ input[type=range].slider-input:after {
1738
+ display: none; }
1739
+ input[type=range].slider-input::-moz-slider-track:after {
1740
+ display: none; }
1741
+ input[type=range].slider-input::-ms-track:after {
1742
+ display: none; }
1743
+
1744
+ input::-moz-focus-inner {
1745
+ border: 0; }
1746
+
1747
+ .slider-container {
1748
+ position: relative;
1749
+ padding: .5em 0; }
1750
+ @media all and (min-width: 400px) {
1751
+ .slider-container {
1752
+ display: -webkit-box;
1753
+ display: -ms-flexbox;
1754
+ display: flex;
1755
+ -webkit-box-orient: horizontal;
1756
+ -webkit-box-direction: normal;
1757
+ -ms-flex-flow: row nowrap;
1758
+ flex-flow: row nowrap;
1759
+ -webkit-box-align: center;
1760
+ -ms-flex-align: center;
1761
+ align-items: center; }
1762
+ .slider-container.with-label {
1763
+ max-width: 320px; } }
1764
+ .slider-container.line-labels {
1765
+ padding: vr(1) 0 0; }
1766
+
1767
+ .slider-input-container {
1768
+ position: relative;
1769
+ -webkit-box-flex: 1;
1770
+ -ms-flex: 1 0 auto;
1771
+ flex: 1 0 auto;
1772
+ /*margin: .6em 0;*/ }
1773
+
1774
+ .slider-track {
1775
+ height: 0px;
1776
+ display: -webkit-box;
1777
+ display: -ms-flexbox;
1778
+ display: flex;
1779
+ -webkit-box-align: center;
1780
+ -ms-flex-align: center;
1781
+ align-items: center;
1782
+ -webkit-box-orient: horizontal;
1783
+ -webkit-box-direction: normal;
1784
+ -ms-flex-flow: row wrap;
1785
+ flex-flow: row wrap;
1786
+ -webkit-box-pack: justify;
1787
+ -ms-flex-pack: justify;
1788
+ justify-content: space-between;
1789
+ margin: 0 10px 0 9px;
1790
+ position: relative;
1791
+ top: -12px; }
1792
+
1793
+ .slider-segment {
1794
+ position: relative; }
1795
+
1796
+ .slider-segment-mark:before, .slider-segment-mark:after {
1797
+ position: absolute;
1798
+ content: "";
1799
+ width: 13px;
1800
+ height: 13px;
1801
+ top: -4px;
1802
+ left: -5px;
1803
+ box-sizing: border-box;
1804
+ border-radius: 100%; }
1805
+ .slider-segment-mark:before {
1806
+ background: #fff;
1807
+ border: #f5f7fa 3px solid;
1808
+ box-shadow: rgba(15, 33, 46, 0.2) 0 0 0 1px inset;
1809
+ z-index: 3; }
1810
+ .slider-segment-mark:after {
1811
+ box-shadow: rgba(15, 33, 46, 0.2) 0 0 0 1px;
1812
+ z-index: 0; }
1813
+
1814
+ .slider-fills {
1815
+ position: absolute;
1816
+ left: 9px;
1817
+ right: 10px;
1818
+ top: 9px;
1819
+ height: 5px;
1820
+ z-index: 1;
1821
+ display: -webkit-box;
1822
+ display: -ms-flexbox;
1823
+ display: flex; }
1824
+
1825
+ .slider-fill {
1826
+ -webkit-box-flex: 1;
1827
+ -ms-flex-positive: 1;
1828
+ flex-grow: 1;
1829
+ height: 5px;
1830
+ position: relative;
1831
+ box-sizing: border-box;
1832
+ background: #f5f7fa;
1833
+ border-left: 1px solid transparent;
1834
+ border-right: 1px solid rgba(15, 33, 46, 0.2); }
1835
+ .slider-fill:before {
1836
+ content: "";
1837
+ position: absolute;
1838
+ top: 0px;
1839
+ left: 0px;
1840
+ right: 0px;
1841
+ bottom: 0px;
1842
+ box-shadow: rgba(15, 33, 46, 0.2) 0 0 0 1px;
1843
+ z-index: -1; }
1844
+ .slider-fill:first-child {
1845
+ border-left: 1px solid rgba(15, 33, 46, 0.2); }
1846
+ .slider-fill:first-child, .slider-fill:first-child:before {
1847
+ border-top-left-radius: 5px;
1848
+ border-bottom-left-radius: 5px; }
1849
+ .slider-fill:first-child:before {
1850
+ left: 0px; }
1851
+ .slider-fill:last-child, .slider-fill:last-child:before {
1852
+ border-top-right-radius: 5px;
1853
+ border-bottom-right-radius: 5px; }
1854
+ .slider-fill:last-child:before {
1855
+ right: 0px; }
1856
+
1857
+ .slider-input.no-segments ~ .slider-fills .slider-fill, .slider-input[max='100'] ~ .slider-fills .slider-fill {
1858
+ border-right: 0; }
1859
+
1860
+ .slider-line-label {
1861
+ position: absolute;
1862
+ white-space: nowrap;
1863
+ font-size: 12px;
1864
+ z-index: 3;
1865
+ height: 1.25;
1866
+ top: -28px;
1867
+ right: -30px;
1868
+ left: -28px;
1869
+ text-align: center; }
1870
+
1871
+ .slider-segment:first-child .slider-line-label {
1872
+ left: -9px;
1873
+ right: auto;
1874
+ text-align: left; }
1875
+ .slider-segment:first-child .slider-line-label:before {
1876
+ left: 8px; }
1877
+
1878
+ .slider-segment:last-child .slider-line-label {
1879
+ right: -11px;
1880
+ left: auto;
1881
+ text-align: right; }
1882
+ .slider-segment:last-child .slider-line-label:before {
1883
+ right: 9px; }
1884
+
1885
+ .slider-label {
1886
+ background: #fff;
1887
+ border-radius: 3px;
1888
+ box-shadow: rgba(15, 33, 46, 0.2) 0 0 0 1px;
1889
+ font-size: 14px;
1890
+ padding: 4px 8px;
1891
+ position: relative;
1892
+ text-align: center; }
1893
+ @media all and (min-width: 400px) {
1894
+ .slider-label {
1895
+ white-space: nowrap;
1896
+ position: absolute;
1897
+ top: 50%;
1898
+ -webkit-transform: translatey(-50%);
1899
+ transform: translatey(-50%);
1900
+ -webkit-transform-style: preserve-3d;
1901
+ transform-style: preserve-3d; }
1902
+ .slider-label:after, .slider-label:before {
1903
+ content: ""; } }
1904
+ .slider-label:after, .slider-label:before {
1905
+ position: absolute;
1906
+ width: 0;
1907
+ height: 0;
1908
+ top: 50%;
1909
+ -webkit-transform: translatey(-50%);
1910
+ transform: translatey(-50%);
1911
+ -webkit-transform-style: preserve-3d;
1912
+ transform-style: preserve-3d;
1913
+ border-top: 7px solid transparent;
1914
+ border-bottom: 7px solid transparent; }
1915
+ .slider-label > * + *:before {
1916
+ content: " — "; }
1917
+ @media all and (min-width: 400px) {
1918
+ .slider-label > * + * {
1919
+ display: block; }
1920
+ .slider-label > * + *:before {
1921
+ content: ""; } }
1922
+ .slider-label [class*=big] {
1923
+ font-size: 1.15em; }
1924
+ .slider-label [class*=small] {
1925
+ font-size: .8em; }
1926
+
1927
+ [data-slider-label]:after {
1928
+ content: attr(data-after); }
1929
+ [data-slider-label]:before {
1930
+ content: attr(data-before); }
1931
+
1932
+ @media all and (min-width: 400px) {
1933
+ .slider-label.align-right {
1934
+ margin-left: 10px;
1935
+ left: 100%;
1936
+ text-align: left; } }
1937
+ .slider-label.align-right:before, .slider-label.align-right:after {
1938
+ left: -7px;
1939
+ border-right: 7px solid rgba(15, 33, 46, 0.2); }
1940
+ .slider-label.align-right:after {
1941
+ border-right-color: #fff;
1942
+ left: -6px; }
1943
+
1944
+ @media all and (min-width: 400px) {
1945
+ .slider-label.align-left {
1946
+ margin-right: 10px;
1947
+ right: 100%;
1948
+ text-align: right; } }
1949
+ .slider-label.align-left:before, .slider-label.align-left:after {
1950
+ right: -7px;
1951
+ border-top: 7px solid transparent;
1952
+ border-left: 7px solid rgba(15, 33, 46, 0.2);
1953
+ border-bottom: 7px solid transparent; }
1954
+ .slider-label.align-left:after {
1955
+ border-left-color: #fff;
1956
+ right: -6px; }
1957
+
1958
+ .slider-input.fill ~ .slider-fills .slider-fill[data-index].filled {
1959
+ background: #5aaafa;
1960
+ border-right-color: #1f8bf8; }
1961
+ .slider-input.fill ~ .slider-fills .slider-fill[data-index].filled:first-child {
1962
+ border-left-color: #1f8bf8; }
1963
+ .slider-input.fill ~ .slider-fills .slider-fill[data-index].filled:before {
1964
+ box-shadow: #1f8bf8 0 0 0 1px; }
1965
+ .slider-input.fill ~ .slider-track .filled .slider-segment-mark[data-index]:before {
1966
+ border-color: #5aaafa;
1967
+ box-shadow: #1f8bf8 0 0 0 1px inset; }
1968
+ .slider-input.fill ~ .slider-track .filled .slider-segment-mark[data-index]:after {
1969
+ box-shadow: #1f8bf8 0 0 0 1px; }