uniform-ui 2.3.6 → 3.0.0.beta2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/lib/assets/javascripts/uniform.es5.js +1 -1
  3. data/lib/assets/javascripts/uniform.js +8 -21
  4. data/lib/assets/javascripts/uniform/checkbox.js +59 -16
  5. data/lib/assets/javascripts/uniform/component.js +20 -4
  6. data/lib/assets/javascripts/uniform/dropdown.js +78 -209
  7. data/lib/assets/javascripts/uniform/floating-label-input.js +63 -0
  8. data/lib/assets/javascripts/uniform/icons.js +12 -3
  9. data/lib/assets/javascripts/uniform/modal.js +13 -12
  10. data/lib/assets/javascripts/uniform/popover.js +45 -26
  11. data/lib/assets/javascripts/uniform/resizer.js +26 -30
  12. data/lib/assets/javascripts/uniform/select.js +188 -220
  13. data/lib/assets/javascripts/uniform/tooltip.js +11 -11
  14. data/lib/assets/stylesheets/uniform.scss +3 -7
  15. data/lib/assets/stylesheets/uniform/base.scss +20 -1
  16. data/lib/assets/stylesheets/uniform/components/buttons.scss +171 -184
  17. data/lib/assets/stylesheets/uniform/components/checkbox.scss +104 -0
  18. data/lib/assets/stylesheets/uniform/components/container.scss +3 -2
  19. data/lib/assets/stylesheets/uniform/components/dropdown.scss +8 -5
  20. data/lib/assets/stylesheets/uniform/components/floating-label-input.scss +29 -0
  21. data/lib/assets/stylesheets/uniform/components/input-group.scss +30 -0
  22. data/lib/assets/stylesheets/uniform/components/label.scss +21 -16
  23. data/lib/assets/stylesheets/uniform/components/loaders.scss +28 -51
  24. data/lib/assets/stylesheets/uniform/components/nav.scss +50 -87
  25. data/lib/assets/stylesheets/uniform/components/pointer.scss +83 -0
  26. data/lib/assets/stylesheets/uniform/components/select.scss +97 -107
  27. data/lib/assets/stylesheets/uniform/components/table.scss +31 -138
  28. data/lib/assets/stylesheets/uniform/components/thumb.scss +40 -25
  29. data/lib/assets/stylesheets/uniform/components/z-input.scss +20 -0
  30. data/lib/assets/stylesheets/uniform/defaults.scss +31 -7
  31. data/lib/assets/stylesheets/uniform/functions.scss +32 -7
  32. data/lib/assets/stylesheets/uniform/mixins.scss +110 -57
  33. data/lib/assets/stylesheets/uniform/utilities.scss +53 -0
  34. data/lib/assets/stylesheets/uniform/utilities/background.scss +9 -0
  35. data/lib/assets/stylesheets/uniform/utilities/borders.scss +85 -0
  36. data/lib/assets/stylesheets/uniform/utilities/effects.scss +172 -0
  37. data/lib/assets/stylesheets/uniform/utilities/layout.scss +174 -0
  38. data/lib/assets/stylesheets/uniform/utilities/position.scss +42 -0
  39. data/lib/assets/stylesheets/uniform/utilities/sizing.scss +54 -0
  40. data/lib/assets/stylesheets/uniform/utilities/spacing.scss +62 -0
  41. data/lib/assets/stylesheets/uniform/utilities/text.scss +158 -0
  42. data/lib/assets/stylesheets/uniform/variables.scss +104 -44
  43. data/lib/uniform/version.rb +1 -1
  44. metadata +24 -48
  45. data/lib/assets/javascripts/uniform.jquery.js +0 -152
  46. data/lib/assets/javascripts/uniform/dom-helpers.js +0 -158
  47. data/lib/assets/javascripts/uniform/floating-label.js +0 -54
  48. data/lib/assets/stylesheets/uniform-print.scss +0 -1
  49. data/lib/assets/stylesheets/uniform/components.scss +0 -11
  50. data/lib/assets/stylesheets/uniform/components/alert.scss +0 -72
  51. data/lib/assets/stylesheets/uniform/components/card.scss +0 -93
  52. data/lib/assets/stylesheets/uniform/components/form.scss +0 -149
  53. data/lib/assets/stylesheets/uniform/components/form/checkbox-collection.scss +0 -103
  54. data/lib/assets/stylesheets/uniform/components/form/checkbox.scss +0 -58
  55. data/lib/assets/stylesheets/uniform/components/form/floating-label.scss +0 -65
  56. data/lib/assets/stylesheets/uniform/components/form/input-group.scss +0 -56
  57. data/lib/assets/stylesheets/uniform/components/form/tristate.scss +0 -88
  58. data/lib/assets/stylesheets/uniform/components/grid.scss +0 -179
  59. data/lib/assets/stylesheets/uniform/components/row.scss +0 -67
  60. data/lib/assets/stylesheets/uniform/components/tooltip.scss +0 -41
  61. data/lib/assets/stylesheets/uniform/helpers.scss +0 -133
  62. data/lib/assets/stylesheets/uniform/helpers/border.scss +0 -28
  63. data/lib/assets/stylesheets/uniform/helpers/colors.scss +0 -24
  64. data/lib/assets/stylesheets/uniform/helpers/margin.scss +0 -27
  65. data/lib/assets/stylesheets/uniform/helpers/padding.scss +0 -9
  66. data/lib/assets/stylesheets/uniform/helpers/position.scss +0 -20
  67. data/lib/assets/stylesheets/uniform/helpers/sizes.scss +0 -38
  68. data/lib/assets/stylesheets/uniform/helpers/text.scss +0 -152
  69. data/lib/assets/stylesheets/uniform/print/grid.scss +0 -50
@@ -0,0 +1,83 @@
1
+ .uniformPointer{
2
+ position:relative;
3
+ margin: 7px 0 0 0;
4
+ &:after{
5
+ clip-path: polygon(-45% -45%, 145% -45%, 145% 145%);
6
+ z-index: 1;
7
+ position:absolute;
8
+ top: 0;
9
+ left: 50%;
10
+ margin: -6px 0 0 -7px;
11
+ transform: rotate(-45deg);
12
+ width: 14px;
13
+ height: 14px;
14
+ overflow: hidden;
15
+ content: "";
16
+ border-style: solid;
17
+ border-width: inherit;
18
+ box-shadow: inherit;
19
+ background: inherit;
20
+ border: inherit;
21
+ }
22
+ // covers overlap with container
23
+ &:before {
24
+ content: '';
25
+ position: absolute;
26
+ background: inherit;
27
+ z-index: 2;
28
+ height: 2px;
29
+ width: 40px;
30
+ margin-left: -20px;
31
+ top: 0;
32
+ left: 50%;
33
+ }
34
+ &.-right{
35
+ margin: 0 7px 0 0;
36
+ &:after{
37
+ left: auto;
38
+ top: 50%;
39
+ right: 0;
40
+ margin: -7px -6px 0 0;
41
+ transform: rotate(45deg);
42
+ }
43
+ &:before {
44
+ margin-left: 0;
45
+ margin-top: -20px;
46
+ height: 40px;
47
+ width: 2px;
48
+ top: 50%;
49
+ right: 0;
50
+ left: auto;
51
+ }
52
+ }
53
+ &.-left{
54
+ margin: 0 0 0 7px;
55
+ &:after{
56
+ left: 0;
57
+ top: 50%;
58
+ margin: -7px 0 0 -6px;
59
+ transform: rotate(-135deg);
60
+ }
61
+ &:before {
62
+ margin-left: 0;
63
+ margin-top: -20px;
64
+ height: 40px;
65
+ width: 2px;
66
+ left: 0;
67
+ top: 50%;
68
+ }
69
+ }
70
+ &.-bottom{
71
+ margin: 0 0 7px 0;
72
+ &:after{
73
+ top: auto;
74
+ bottom: 0;
75
+ margin: 0 0 -6px -7px;
76
+ transform: rotate(-225deg);
77
+ }
78
+ &:before{
79
+ top: auto;
80
+ bottom: 0;
81
+ }
82
+ }
83
+ }
@@ -1,147 +1,137 @@
1
- select.uniformSelect{
2
- display:none;
3
- }
4
-
5
- .uniformSelect-edit{
6
- @include text-overflow;
7
- position:relative;
8
- text-align: left;
9
- padding-right: 1.8em;
1
+ .uniformSelect{
2
+ --border-color: #{red(color('gray-40'))}, #{green(color('gray-40'))}, #{blue(color('gray-40'))};
3
+ appearance: none;
4
+ outline: none;
5
+ vertical-align: middle;
6
+ display: inline-grid;
7
+ grid-template-columns: auto auto;
8
+ grid-template-rows: auto;
9
+ grid-template-areas: "value indicator";
10
+ align-items: center;
11
+ padding: 0 0.25em;
12
+ background: white;
13
+ select{
14
+ display: none;
15
+ }
10
16
  &.active{
11
- .uniformSelect-edit-icon{
17
+ box-shadow: 0 0 0 2px rgba(var(--focus-color), 1), inset 2px 2px 3px rgba(black, 0.2);
18
+ .uniformSelect-indicator{
12
19
  svg{
13
20
  transform: rotate(180deg);
14
21
  }
15
22
  }
16
23
  }
17
- .uniformSelect-edit-icon{
18
- font-size:2em;
19
- @include position-v-center();
20
- right:0;
21
- z-index:0;
22
- line-height: 0;
23
- svg{
24
- fill: color('gray-darker');
25
- transition: transform 0.2s;
26
- }
27
- }
28
- &.-invert{
29
- background: color('gray');
30
- color: white;
31
- border-color: color('gray-dark');
32
- .uniformSelect-edit-icon{
33
- svg {
34
- fill: white;
35
- }
36
- }
37
- }
38
- .uniformSelect-selection{
39
- font-size: 0.8em;
40
- padding: 0.1em;
41
- padding-left: 0.2em;
42
- border: 1px solid color('gray');
43
- background: color('gray-lighter');
44
- display:inline-block;
45
- border-radius: 0.25em;
46
- }
47
- .uniformSelect-remove{
48
- display: inline-block;
49
- width: 1em;
50
- height: 0.8em;
51
- margin-left: 0.25em;
52
- position: relative;
53
- &:after,
54
- &:before{
55
- content: "";
56
- width: 1px;
57
- height: 1em;
58
- transform-origin: 50% 50%;
59
- transform: rotate(-45deg);
60
- background: color('gray');
61
- position:absolute;
62
- left: 50%;
63
- top: 0;
64
- }
65
- &:before{
66
- transform: rotate(45deg);
67
- }
68
- &:hover{
69
- &:after,
70
- &:before{
71
- background: color('red');
72
- }
73
- }
24
+ &:focus{
25
+ box-shadow: 0 0 0 2px rgba(var(--focus-color), 1);
74
26
  }
75
27
  }
76
28
 
29
+ .uniformSelect-placeholder,
30
+ .uniformSelect-value {
31
+ grid-area: value;
32
+ white-space: nowrap;
33
+ }
34
+ .uniformSelect-placeholder{
35
+ opacity: 0;
36
+ user-select: none;
37
+ }
38
+ .uniformSelect-value{
39
+ z-index: 2;
40
+ text-align: left;
41
+ }
42
+ .uniformSelect-indicator{
43
+ padding-left: 0.25em;
44
+ grid-area: indicator;
45
+ svg{
46
+ width: 1.4em;
47
+ transition: transform 0.2s;
48
+ }
49
+ }
77
50
  .uniformSelect-options{
78
-
79
- box-shadow: 0 0 15px 1px rgba(black, 0.2), 0 0 2px 1px rgba(black, 0.1) ;
80
51
  background: white;
52
+ box-shadow: 0 0 15px 1px rgba(black, 0.2), 0 0 2px 1px rgba(black, 0.1);
81
53
  button{
82
54
  appearance: none;
83
55
  outline: none;
84
56
  border: none;
85
57
  background: none;
86
- width: 100%;
87
- padding: 0.5em;
58
+ display: block;
59
+ min-width: 100%;
60
+ padding: 0.5em 1.5em;
61
+ text-align: left;
62
+ position: relative;
63
+ &.hide{
64
+ display: none;
65
+ }
88
66
  &:hover{
89
67
  background: lighten(color('blue'), 45);
90
68
  }
69
+ &.active{
70
+ color: color('blue-60');
71
+ font-weight: bold;
72
+ &:after{
73
+ position: absolute;
74
+ left: 0.25em;
75
+ top: 50%;
76
+ transform: translateY(-50%);
77
+ background-image: icon-check(#{color('blue-40')});
78
+ background-size: contain;
79
+ content: '';
80
+ width: 1em;
81
+ height: 1em;
82
+ }
83
+ }
91
84
  }
92
-
93
- .uniformSelect-options-actions{
94
- border-top: 1px solid color('gray');
95
- border-bottom: 1px solid color('gray');
96
- background: color('background');
85
+ .uniformSelect-actions{
86
+ border-top: 1px solid color('gray-20');
87
+ border-bottom: 1px solid color('gray-20');
88
+ background: darken(white, 5);
97
89
  padding: 0.5em;
98
90
  &:empty{
99
- display:none;
91
+ display: none;
100
92
  }
101
93
  }
102
94
  .uniformSelect-show-all {
103
95
  color: color('blue');
104
96
  background: none;
97
+ text-align:center;
105
98
  &:hover{
106
99
  background: none;
107
100
  }
108
101
  }
109
102
  .uniformSelect-done{
110
103
  border-radius: 0.25em;
111
- border: 1px solid color('gray');
104
+ border: 1px solid color('gray-20');
105
+ background: white;
106
+ text-align:center;
112
107
  background: white;
113
- }
114
- }
115
- .uniformSelect-option{
116
- position:relative;
117
- cursor: pointer;
118
- &.active{
119
- box-shadow:none;
120
- color: color('green-dark');
121
- padding-left: 2.5em !important;
122
- font-weight: bold;
123
- }
124
- .uniformSelect-option-icon{
125
- fill: color('green');
126
- position: absolute;
127
- top: 0.2em;
128
- left: 0.2em;
129
- font-size: 1.5em;
130
108
  }
131
109
  }
132
110
 
133
- .uniformSelect-modal{
134
- width: 100vw;
135
- min-height: 100vh;
136
- padding: 1em;
137
- button{
138
- margin-bottom: 0.5em;
139
- border: 1px solid color('gray');
140
- &.uniformSelect-done{
141
- margin-bottom: 0;
142
- }
111
+
112
+
113
+ .uniformSelect-selection{
114
+ display: inline-flex;
115
+ align-items: center;
116
+ font-size: 0.8em;
117
+ margin: 0.2em 0;
118
+ padding: 0;
119
+ line-height: 1;
120
+ padding-left:0.5em;
121
+ background: darken(color('gray-10'), 5);
122
+ border-radius: 0.25em;
123
+ span{
124
+ flex: 1 1 auto;
143
125
  }
144
- .uniformSelect-options-actions{
145
- margin: 0 -1em;
126
+ .uniformSelect-remove{
127
+ padding: 0.2em;
128
+ flex: 0 1 auto;
129
+ svg {
130
+ width: 0.8em;
131
+ height: auto;
132
+ }
133
+ &:hover{
134
+ fill: color('red');
135
+ }
146
136
  }
147
137
  }
@@ -1,161 +1,54 @@
1
- @include size-rules('.table'){
2
- display:table;
3
- width:100%;
4
- & > *,
5
- .row > *{
6
- display:table-cell;
7
- float:none;
8
- &.-top{
9
- vertical-align:top;
10
- }
11
- &.-middle > *{
12
- vertical-align:middle;
13
- }
14
- }
15
- .row{
16
- display:table-row;
17
- }
18
- }
19
- .cell-top{
20
- vertical-align: top;
21
- td, th{
22
- vertical-align: top;
23
- }
24
- }
25
-
26
- .cell-middle{
27
- vertical-align: middle;
28
- td, th{
29
- vertical-align: middle;
30
- }
31
- }
1
+ @include responsive-rule('.layout-fixed'){ table-layout: fixed;}
32
2
 
33
3
  .uniformTable{
34
4
  width:100%;
35
- .row > *,
36
- tr td,
5
+
6
+ td,
37
7
  th {
38
8
  padding: 0.5em;
39
- border-bottom: 1px solid color('gray-light');
40
9
  }
41
10
 
42
- &.tight{
43
- .row > *,
44
- tr td,
45
- th {
46
- padding: 0.2em 0.5em;
11
+ tr + tr {
12
+ td,
13
+ th{
14
+ border-top-width: 1px;
47
15
  }
48
16
  }
49
17
 
50
- &.tight-more{
51
- .row > *,
52
- tr td,
53
- th {
54
- padding: 0 0.5em;
18
+ &.-snug{
19
+ td,
20
+ th,
21
+ .table-cell {
22
+ padding: 0.2em 0.5em;
55
23
  }
56
24
  }
57
25
 
58
- &.no-pad{
59
- .row > *,
60
- tr td,
61
- th {
62
- padding-left: 0;
63
- padding-right: 0;
26
+ &.-tight{
27
+ td,
28
+ th,
29
+ .table-cell {
30
+ padding: 0 0.5em;
64
31
  }
65
32
  }
66
33
 
67
- .head > *,
68
- thead th{
69
- color: color('gray-dark');
70
- border-bottom: 1px solid color('gray');
71
- }
72
-
73
- .head.dark > *,
74
- thead.dark th{
75
- background: lighten(color('background'), 2);
76
- }
77
-
78
- tr.middle > td,
79
- td.middle,
80
- &.middle > *,
81
- .middle{
82
- vertical-align:middle;
83
- }
84
-
85
- tr.bottom > td,
86
- td.bottom,
87
- &.bottom > *,
88
- .bottom{
89
- vertical-align:bottom;
90
- }
91
-
92
- tr.top > td,
93
- td.top,
94
- &.top > *,
95
- .top{
96
- vertical-align:top;
97
- }
98
-
99
- &.hover{
100
- tr:hover td{
101
- background: lighten(color('blue'), 50);
34
+ &.-striped{
35
+ tr:nth-child(2n+1){
36
+ background-color: transparent;
102
37
  }
103
38
  }
104
39
 
105
- .row:last-of-type,
106
- tr:last-of-type{
107
- td, th{
108
- border-bottom: none;
109
- }
110
- }
111
- &.invert{
112
- .row > *,
113
- td, th{
114
- border-bottom-color: color('gray-dark');
115
- }
116
- }
117
- }
118
-
119
- .uniformTableDotLeaders{
120
- line-height: 1;
121
- table-layout: fixed;
122
- & > * > td,
123
- & > * > * > td,
124
- & > * > th,
125
- & > * > * > th{
126
- padding-top:0.3em;
127
- padding-bottom: 0.3em;
128
- vertical-align:bottom;
129
- }
130
-
131
- & > * > td,
132
- & > * > * > td{
133
- padding-left:0.5em;
134
- }
135
-
136
- & > * > th,
137
- & > * > * > th{
138
- background: icon-circle(6, 8, 1, color('gray'));
139
- background-repeat: repeat-x;
140
- background-position: left bottom;
141
- span{
142
- background-color: white;
143
- padding-right: 0.5em;
144
- position: relative;
145
- }
146
- }
147
- & > thead{
148
- & > * > th{
149
- background:none;
40
+ //----------------------------------------------------------------
41
+ // Head
42
+ //----------------------------------------------------------------
43
+ thead{
44
+ tr:last-child{
45
+ border-bottom-width: 1px;
150
46
  }
151
47
  }
152
- &.bg-background{
153
- & > * > th,
154
- & > * > * > th{
155
- background-image:radial-gradient(black 1px, color('background') 0px);
156
- span{
157
- background-color: color('background');
158
- }
159
- }
48
+
49
+ th{
50
+ font-weight: bold;
51
+ text-transform: uppercase;
52
+ font-size: 0.8em;
160
53
  }
161
54
  }