shipyard-framework 0.3.9 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 81c1f04d38253055bc768970e7bd4cab221962cd
4
- data.tar.gz: b6cde186407073f394509616e6a58b8922a2917c
3
+ metadata.gz: 825fc52001c93f3e001233bf5a454dccc704a734
4
+ data.tar.gz: a42500ccb5558fb4ee0b63a11ab3d7de2763bd2e
5
5
  SHA512:
6
- metadata.gz: b7a09476a9799f56ba4b2baa2fb680c438f683afb0aa75c293584f855bd5de9421c1ac31de0ef7d5e5f640ad92158aa629f311e665a180bf17543a38de078b22
7
- data.tar.gz: a937446bb6a8d0a0e7eb32c3e5a6e9ecd7182d4fc0e80057e1e0b8e8426b9dd5c45367e7834bbb8fc1da398b1c84f63fdc72f022515302b39fb5668c8823ca63
6
+ metadata.gz: 7f7d963f9562ff0864ea17d2767f7bcc6a98de75608ae85dc6b2d3524cf251ae36b024386a3d9feb9cfbfe21283ee91f27dc0bef19e35ed9456706b86f6e98d5
7
+ data.tar.gz: d6b81befa4d7eb079e0b4b164d2587474adcc070b705b2a05979251edf6cbd5e277cefe78e680b98026228bbc708bdbcecc59bbc0305a6dfeabf3bae4a733219
@@ -3,6 +3,7 @@
3
3
  @import shipyard/components/alerts
4
4
  @import shipyard/components/boxes
5
5
  @import shipyard/components/forms
6
+ @import shipyard/components/form-errors
6
7
  @import shipyard/components/input-switch
7
8
  @import shipyard/components/empty
8
9
  @import shipyard/components/modals
@@ -1,9 +1,11 @@
1
1
  @import shipyard/variables/colors
2
+ @import shipyard/functions/map-merge-options
2
3
  @import shipyard/functions/color
3
4
  @import shipyard/variables/color_utilities
4
5
  @import shipyard/variables/typography
5
6
  @import shipyard/variables/grid
6
7
  @import shipyard/variables/misc
8
+ @import shipyard/variables/components
7
9
  @import shipyard/mixins/box-model
8
10
  @import shipyard/mixins/selectors
9
11
  @import shipyard/mixins/responsive
@@ -0,0 +1,23 @@
1
+ +component('form-error')
2
+
3
+ +sub-component('container')
4
+ padding: 20px
5
+ margin: 15px 0
6
+
7
+ +sub-component('text')
8
+ margin: 0 0 15px
9
+
10
+ +sub-component('list')
11
+ list-style: none
12
+
13
+ +sub-component('item')
14
+ &:before
15
+ content: ""
16
+ border: 1px solid rgba(#fff,.5)
17
+ margin: 0 15px 0 1px
18
+ display: inline-block
19
+ border-radius: 50%
20
+ +width-height(6px)
21
+ vertical-align: middle
22
+ position: relative
23
+ top: -1px
@@ -99,28 +99,20 @@
99
99
  &::after
100
100
  position: absolute
101
101
  &::before
102
- top: 6px
103
- right: 6px
104
102
  z-index: 1
105
103
  content: "*"
106
- line-height: 18px
107
- font-weight: $bold
108
- color: darken($purple, 13%)
104
+ +component-styles(required-asterisk)
109
105
  +when('error')
110
- color: #fff
106
+ +component-styles(required-asterisk-error)
111
107
  &::after
112
- top: 2px
113
- right: 2px
114
108
  content: ""
115
109
  display: block
110
+ border-style: solid
116
111
  border-radius: 0 3px 0 0
117
- border: 12px solid transparent
118
- background: $border-color-light
119
- border-left-color: #fff
120
- border-bottom-color: #fff
112
+ border-color: transparent
113
+ +component-styles(required-corner)
121
114
  +when('error')
122
- border-top-color: $red
123
- border-right-color: $red
115
+ +component-styles(required-corner-error)
124
116
 
125
117
  &-full
126
118
  width: 100%
@@ -140,31 +132,3 @@
140
132
  border-radius: 4px
141
133
  +respond-to(padding, (x0: 10px 15px, x1: 15px 20px))
142
134
  margin: 0
143
-
144
- .form-error
145
- &-container
146
- background: $red
147
- border-radius: 5px
148
- color: #fff
149
- padding: 20px
150
- margin: 15px 0
151
- text-shadow: 0 1px 1px rgba($gray-darkest, .1)
152
- &-text
153
- margin: 0 0 15px
154
- font-weight: $bold
155
- &-list
156
- list-style: none
157
- margin: 0
158
- &-item
159
- color: #fff
160
- font-weight: $medium
161
- &:before
162
- content: ""
163
- border: 1px solid rgba(#fff,.5)
164
- margin: 0 15px 0 1px
165
- display: inline-block
166
- border-radius: 50%
167
- +width-height(6px)
168
- vertical-align: middle
169
- position: relative
170
- top: -1px
@@ -0,0 +1,10 @@
1
+ @function map-merge-options($defaults, $options)
2
+ $result: $defaults
3
+
4
+ @each $key, $value in $options
5
+ @if (not map-has-key($result, $key)) or (type-of(map-get($result, $key)) != type-of($value)) or (not (type-of(map-get($result, $key)) == map and type-of($value) == map))
6
+ $result: map-merge($result, ($key: $value))
7
+ @else
8
+ $result: map-merge($result, ($key: map-merge-options(map-get($result, $key), $value)))
9
+
10
+ @return $result
@@ -8,6 +8,7 @@
8
8
  $sub-component: "#{$component}-#{$name}" !global
9
9
  &-#{$name}
10
10
  @content
11
+ +component-styles($name)
11
12
 
12
13
  @mixin extend($modifier: null)
13
14
  @if $modifier
@@ -21,6 +22,12 @@
21
22
  @else if $component && map-get($z-index, $component)
22
23
  z-index: map-get($z-index, $component)
23
24
 
25
+ @mixin component-styles($modifier)
26
+ $component-styles: map-get($components, $component)
27
+ @if $component-styles
28
+ @each $property, $value in map-get($component-styles, $modifier)
29
+ #{$property}: $value
30
+
24
31
  // Uses the base component class defined earlier (e.g. "alert").
25
32
  //
26
33
  // Notes:
@@ -0,0 +1,43 @@
1
+ $component-defaults: (
2
+ input: (
3
+ required-asterisk: (
4
+ top: 6px,
5
+ right: 6px,
6
+ line-height: 18px,
7
+ font-weight: $bold,
8
+ color: darken($purple, 13%)
9
+ ),
10
+ required-asterisk-error: (
11
+ color: #fff
12
+ ),
13
+ required-corner: (
14
+ top: 2px,
15
+ right: 2px,
16
+ border-width: 12px,
17
+ border-top-color: $border-color-light,
18
+ border-right-color: $border-color-light
19
+ ),
20
+ required-corner-error: (
21
+ border-top-color: $red,
22
+ border-right-color: $red
23
+ )
24
+ ),
25
+ form-error: (
26
+ container: (
27
+ color: #fff,
28
+ background: $red,
29
+ border-radius: 5px,
30
+ text-shadow: 0 1px 1px rgba($gray-darkest, .1)
31
+ ),
32
+ text: (
33
+ font-weight: $bold
34
+ ),
35
+ item: (
36
+ color: #fff,
37
+ font-weight: $medium
38
+ )
39
+ )
40
+ ) !default;
41
+
42
+ $component-options: () !default;
43
+ $components: map-merge-options($component-defaults, $component-options);
@@ -1,3 +1,3 @@
1
1
  module Shipyard
2
- VERSION = '0.3.9'
2
+ VERSION = '0.4.0'
3
3
  end
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- shipyard-framework (0.3.9)
4
+ shipyard-framework (0.4.0)
5
5
  actionview (~> 5.0)
6
6
 
7
7
  GEM
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shipyard-framework
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.9
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shipyard
@@ -96,6 +96,7 @@ files:
96
96
  - assets/stylesheets/shipyard/components/_boxes.sass
97
97
  - assets/stylesheets/shipyard/components/_buttons.sass
98
98
  - assets/stylesheets/shipyard/components/_empty.sass
99
+ - assets/stylesheets/shipyard/components/_form-errors.sass
99
100
  - assets/stylesheets/shipyard/components/_forms.sass
100
101
  - assets/stylesheets/shipyard/components/_hamburger.sass
101
102
  - assets/stylesheets/shipyard/components/_hero.sass
@@ -108,6 +109,7 @@ files:
108
109
  - assets/stylesheets/shipyard/core/_reset.sass
109
110
  - assets/stylesheets/shipyard/core/_type.sass
110
111
  - assets/stylesheets/shipyard/functions/_color.sass
112
+ - assets/stylesheets/shipyard/functions/_map-merge-options.sass
111
113
  - assets/stylesheets/shipyard/mixins/_box-model.sass
112
114
  - assets/stylesheets/shipyard/mixins/_components.sass
113
115
  - assets/stylesheets/shipyard/mixins/_positioning.sass
@@ -119,6 +121,7 @@ files:
119
121
  - assets/stylesheets/shipyard/utilities/_positioning.sass
120
122
  - assets/stylesheets/shipyard/variables/_color_utilities.sass
121
123
  - assets/stylesheets/shipyard/variables/_colors.scss
124
+ - assets/stylesheets/shipyard/variables/_components.scss
122
125
  - assets/stylesheets/shipyard/variables/_grid.sass
123
126
  - assets/stylesheets/shipyard/variables/_misc.sass
124
127
  - assets/stylesheets/shipyard/variables/_typography.sass