tao_ui 0.1.3 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/lib/assets/icons/{loading.svg → Loading.svg} +0 -0
  3. data/lib/assets/icons/close.svg +12 -0
  4. data/lib/assets/javascripts/tao/ui/dialog/element.coffee +61 -0
  5. data/lib/assets/javascripts/tao/ui/dialog/index.coffee +4 -0
  6. data/lib/assets/javascripts/tao/ui/icons/{basic.coffee → base.coffee} +2 -1
  7. data/lib/assets/javascripts/tao/ui/icons/index.coffee +4 -4
  8. data/lib/assets/javascripts/tao/ui/index.coffee +4 -1
  9. data/lib/assets/javascripts/tao/ui/mobile/index.coffee +3 -2
  10. data/lib/assets/javascripts/tao/ui/mobile/slide_box/element.coffee +7 -0
  11. data/lib/assets/javascripts/tao/ui/mobile/slide_box/index.coffee +4 -0
  12. data/lib/assets/javascripts/tao/ui/popover/create.coffee +18 -0
  13. data/lib/assets/javascripts/tao/ui/popover/direction.coffee +76 -0
  14. data/lib/assets/javascripts/tao/ui/popover/element.coffee +99 -0
  15. data/lib/assets/javascripts/tao/ui/popover/index.coffee +5 -0
  16. data/lib/assets/javascripts/tao/ui/popover/position.coffee +83 -0
  17. data/lib/assets/javascripts/tao/ui/shared/slide_box/element/base.coffee +76 -0
  18. data/lib/assets/javascripts/tao/ui/{ujs.coffee → shared/ujs.coffee} +22 -1
  19. data/lib/assets/javascripts/tao/ui/slide_box/element.coffee +7 -0
  20. data/lib/assets/javascripts/tao/ui/slide_box/index.coffee +4 -0
  21. data/lib/assets/stylesheets/tao/ui/_mixins.scss +2 -2
  22. data/lib/assets/stylesheets/tao/ui/_variables.scss +2 -2
  23. data/lib/assets/stylesheets/tao/ui/basic.scss +11 -139
  24. data/lib/assets/stylesheets/tao/ui/buttons.scss +3 -54
  25. data/lib/assets/stylesheets/tao/ui/code.scss +1 -55
  26. data/lib/assets/stylesheets/tao/ui/dialog.scss +78 -0
  27. data/lib/assets/stylesheets/tao/ui/icons.scss +1 -17
  28. data/lib/assets/stylesheets/tao/ui/index.scss +3 -0
  29. data/lib/assets/stylesheets/tao/ui/mobile/_mixins.scss +2 -2
  30. data/lib/assets/stylesheets/tao/ui/mobile/_variables.scss +2 -2
  31. data/lib/assets/stylesheets/tao/ui/mobile/basic.scss +1 -1
  32. data/lib/assets/stylesheets/tao/ui/mobile/buttons.scss +1 -1
  33. data/lib/assets/stylesheets/tao/ui/mobile/code.scss +1 -1
  34. data/lib/assets/stylesheets/tao/ui/mobile/icons.scss +1 -1
  35. data/lib/assets/stylesheets/tao/ui/mobile/index.scss +1 -0
  36. data/lib/assets/stylesheets/tao/ui/mobile/slide_box.scss +48 -0
  37. data/lib/assets/stylesheets/tao/ui/mobile/tables.scss +1 -1
  38. data/lib/assets/stylesheets/tao/ui/mobile/variables/_base.scss +1 -2
  39. data/lib/assets/stylesheets/tao/ui/popover.scss +178 -0
  40. data/lib/assets/stylesheets/tao/ui/shared/_basic.scss +128 -0
  41. data/lib/assets/stylesheets/tao/ui/shared/_buttons.scss +65 -0
  42. data/lib/assets/stylesheets/tao/ui/shared/_code.scss +54 -0
  43. data/lib/assets/stylesheets/tao/ui/shared/_icons.scss +16 -0
  44. data/lib/assets/stylesheets/tao/ui/shared/_slide_box.scss +80 -0
  45. data/lib/assets/stylesheets/tao/ui/shared/_tables.scss +38 -0
  46. data/lib/assets/stylesheets/tao/ui/{mixins → shared/mixins}/_base.scss +0 -0
  47. data/lib/assets/stylesheets/tao/ui/{mixins → shared/mixins}/_buttons.scss +2 -4
  48. data/lib/assets/stylesheets/tao/ui/shared/variables/_base.scss +48 -0
  49. data/lib/assets/stylesheets/tao/ui/shared/variables/_buttons.scss +93 -0
  50. data/lib/assets/stylesheets/tao/ui/shared/variables/_tables.scss +2 -0
  51. data/lib/assets/stylesheets/tao/ui/slide_box.scss +16 -0
  52. data/lib/assets/stylesheets/tao/ui/tables.scss +3 -41
  53. data/lib/assets/stylesheets/tao/ui/variables/_base.scss +3 -42
  54. data/lib/generators/tao/icons/USAGE +2 -2
  55. data/lib/generators/tao/icons/templates/icons.coffee.erb +1 -1
  56. data/lib/tao_ui/components/dialog_component.rb +25 -0
  57. data/lib/tao_ui/components/icon_component.rb +7 -8
  58. data/lib/tao_ui/components/popover_component.rb +17 -0
  59. data/lib/tao_ui/components/slide_box_component.rb +21 -0
  60. data/lib/tao_ui/components.rb +3 -5
  61. data/lib/tao_ui/engine.rb +4 -1
  62. data/lib/tao_ui/version.rb +1 -1
  63. data/lib/views/components/tao_ui/components/_dialog.html.erb +10 -0
  64. data/lib/views/components/tao_ui/components/_popover.html.erb +10 -0
  65. data/lib/views/components/tao_ui/components/_slide_box.html.erb +8 -0
  66. metadata +79 -25
  67. data/lib/assets/stylesheets/tao/ui/mobile/mixins/_base.scss +0 -1
  68. data/lib/assets/stylesheets/tao/ui/mobile/mixins/_buttons.scss +0 -1
  69. data/lib/assets/stylesheets/tao/ui/mobile/variables/_buttons.scss +0 -1
  70. data/lib/assets/stylesheets/tao/ui/mobile/variables/_tables.scss +0 -1
  71. data/lib/assets/stylesheets/tao/ui/variables/_buttons.scss +0 -84
  72. data/lib/assets/stylesheets/tao/ui/variables/_tables.scss +0 -2
@@ -0,0 +1,25 @@
1
+ module TaoUi
2
+ module Components
3
+ class DialogComponent < TaoOnRails::Components::Base
4
+
5
+ def initialize view, options
6
+ super
7
+
8
+ unless @options[:with_close_button].in? [true, false]
9
+ @options[:with_close_button] = true
10
+ end
11
+ end
12
+
13
+ def self.component_name
14
+ :dialog
15
+ end
16
+
17
+ private
18
+
19
+ def default_options
20
+ {class: 'tao-dialog'}
21
+ end
22
+
23
+ end
24
+ end
25
+ end
@@ -7,15 +7,8 @@ module TaoUi
7
7
  attr_reader :name
8
8
 
9
9
  def initialize view, name, options = {}
10
- super view, options
11
-
12
10
  @name = name.to_s.dasherize
13
-
14
- if @options[:class].present?
15
- @options[:class] += " icon icon-#{@name}"
16
- else
17
- @options[:class] = "icon icon-#{@name}"
18
- end
11
+ super view, options
19
12
  end
20
13
 
21
14
  def render
@@ -26,6 +19,12 @@ module TaoUi
26
19
  :icon
27
20
  end
28
21
 
22
+ private
23
+
24
+ def default_options
25
+ {class: ['icon', "icon-#{@name}"]}
26
+ end
27
+
29
28
  end
30
29
  end
31
30
  end
@@ -0,0 +1,17 @@
1
+ module TaoUi
2
+ module Components
3
+ class PopoverComponent < TaoOnRails::Components::Base
4
+
5
+ def self.component_name
6
+ :popover
7
+ end
8
+
9
+ private
10
+
11
+ def default_options
12
+ {class: 'tao-popover'}
13
+ end
14
+
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,21 @@
1
+ require 'tao_on_rails/components/base'
2
+
3
+ module TaoUi
4
+ module Components
5
+ class SlideBoxComponent < TaoOnRails::Components::Base
6
+
7
+ def initialize view, options
8
+ super
9
+
10
+ unless @options[:with_close_button].in? [true, false]
11
+ @options[:with_close_button] = true
12
+ end
13
+ end
14
+
15
+ def self.component_name
16
+ :slide_box
17
+ end
18
+
19
+ end
20
+ end
21
+ end
@@ -1,6 +1,4 @@
1
1
  require 'tao_ui/components/icon_component'
2
-
3
- module TaoUi
4
- module Components
5
- end
6
- end
2
+ require 'tao_ui/components/slide_box_component'
3
+ require 'tao_ui/components/popover_component'
4
+ require 'tao_ui/components/dialog_component'
data/lib/tao_ui/engine.rb CHANGED
@@ -3,6 +3,9 @@ require 'tao_ui/components'
3
3
 
4
4
  module TaoUi
5
5
  class Engine < ::Rails::Engine
6
- isolate_namespace TaoUi
6
+
7
+ config.i18n.load_path += Dir[config.root.join('config', 'locales', '**', '*.{rb,yml}')]
8
+ paths['app/views'] << 'lib/views'
9
+
7
10
  end
8
11
  end
@@ -1,3 +1,3 @@
1
1
  module TaoUi
2
- VERSION = '0.1.3'
2
+ VERSION = '0.2.0'
3
3
  end
@@ -0,0 +1,10 @@
1
+ <%= content_tag component.tag_name, component.html_options do %>
2
+ <div class="tao-dialog-wrapper">
3
+ <div class="tao-dialog-content">
4
+ <%= yield %>
5
+ </div>
6
+ <%= link_to 'javascripts:;', class: 'link-close', title: component.t(:close) do %>
7
+ <%= tao_icon :close %>
8
+ <% end %>
9
+ </div>
10
+ <% end %>
@@ -0,0 +1,10 @@
1
+ <%= content_tag component.tag_name, component.html_options do %>
2
+ <div class="tao-popover-content">
3
+ <%= yield %>
4
+ </div>
5
+ <div class="tao-popover-arrow">
6
+ <i class="arrow arrow-shadow"></i>
7
+ <i class="arrow arrow-border"></i>
8
+ <i class="arrow arrow-basic"></i>
9
+ </div>
10
+ <% end %>
@@ -0,0 +1,8 @@
1
+ <%= content_tag component.tag_name, component.html_options do %>
2
+ <div class="slide-box-content">
3
+ <%= yield %>
4
+ </div>
5
+ <%= link_to 'javascript:;', class: 'link-close', title: component.t(:close) do %>
6
+ <%= tao_icon :close %>
7
+ <% end %>
8
+ <% end %>
metadata CHANGED
@@ -1,57 +1,85 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tao_ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - farthinker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-21 00:00:00.000000000 Z
11
+ date: 2017-06-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: rails
14
+ name: tao_on_rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 5.0.3
19
+ version: 0.9.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 5.0.3
26
+ version: 0.9.0
27
27
  - !ruby/object:Gem::Dependency
28
- name: tao_on_rails
28
+ name: sqlite3
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: nokogiri
29
43
  requirement: !ruby/object:Gem::Requirement
30
44
  requirements:
31
45
  - - "~>"
32
46
  - !ruby/object:Gem::Version
33
- version: 0.8.0
34
- type: :runtime
47
+ version: 1.8.0
48
+ type: :development
35
49
  prerelease: false
36
50
  version_requirements: !ruby/object:Gem::Requirement
37
51
  requirements:
38
52
  - - "~>"
39
53
  - !ruby/object:Gem::Version
40
- version: 0.8.0
54
+ version: 1.8.0
41
55
  - !ruby/object:Gem::Dependency
42
- name: sqlite3
56
+ name: blade
43
57
  requirement: !ruby/object:Gem::Requirement
44
58
  requirements:
45
59
  - - "~>"
46
60
  - !ruby/object:Gem::Version
47
- version: '1.3'
61
+ version: 0.7.0
48
62
  type: :development
49
63
  prerelease: false
50
64
  version_requirements: !ruby/object:Gem::Requirement
51
65
  requirements:
52
66
  - - "~>"
53
67
  - !ruby/object:Gem::Version
54
- version: '1.3'
68
+ version: 0.7.0
69
+ - !ruby/object:Gem::Dependency
70
+ name: blade-sauce_labs_plugin
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 0.7.0
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 0.7.0
55
83
  description: UI library based on tao
56
84
  email:
57
85
  - farthinker@gmail.com
@@ -62,12 +90,25 @@ files:
62
90
  - LICENSE
63
91
  - README.md
64
92
  - Rakefile
65
- - lib/assets/icons/loading.svg
66
- - lib/assets/javascripts/tao/ui/icons/basic.coffee
93
+ - lib/assets/icons/Loading.svg
94
+ - lib/assets/icons/close.svg
95
+ - lib/assets/javascripts/tao/ui/dialog/element.coffee
96
+ - lib/assets/javascripts/tao/ui/dialog/index.coffee
97
+ - lib/assets/javascripts/tao/ui/icons/base.coffee
67
98
  - lib/assets/javascripts/tao/ui/icons/index.coffee
68
99
  - lib/assets/javascripts/tao/ui/index.coffee
69
100
  - lib/assets/javascripts/tao/ui/mobile/index.coffee
70
- - lib/assets/javascripts/tao/ui/ujs.coffee
101
+ - lib/assets/javascripts/tao/ui/mobile/slide_box/element.coffee
102
+ - lib/assets/javascripts/tao/ui/mobile/slide_box/index.coffee
103
+ - lib/assets/javascripts/tao/ui/popover/create.coffee
104
+ - lib/assets/javascripts/tao/ui/popover/direction.coffee
105
+ - lib/assets/javascripts/tao/ui/popover/element.coffee
106
+ - lib/assets/javascripts/tao/ui/popover/index.coffee
107
+ - lib/assets/javascripts/tao/ui/popover/position.coffee
108
+ - lib/assets/javascripts/tao/ui/shared/slide_box/element/base.coffee
109
+ - lib/assets/javascripts/tao/ui/shared/ujs.coffee
110
+ - lib/assets/javascripts/tao/ui/slide_box/element.coffee
111
+ - lib/assets/javascripts/tao/ui/slide_box/index.coffee
71
112
  - lib/assets/stylesheets/tao/ui/_custom.scss
72
113
  - lib/assets/stylesheets/tao/ui/_globals.scss
73
114
  - lib/assets/stylesheets/tao/ui/_mixins.scss
@@ -75,10 +116,9 @@ files:
75
116
  - lib/assets/stylesheets/tao/ui/basic.scss
76
117
  - lib/assets/stylesheets/tao/ui/buttons.scss
77
118
  - lib/assets/stylesheets/tao/ui/code.scss
119
+ - lib/assets/stylesheets/tao/ui/dialog.scss
78
120
  - lib/assets/stylesheets/tao/ui/icons.scss
79
121
  - lib/assets/stylesheets/tao/ui/index.scss
80
- - lib/assets/stylesheets/tao/ui/mixins/_base.scss
81
- - lib/assets/stylesheets/tao/ui/mixins/_buttons.scss
82
122
  - lib/assets/stylesheets/tao/ui/mobile/_custom.scss
83
123
  - lib/assets/stylesheets/tao/ui/mobile/_globals.scss
84
124
  - lib/assets/stylesheets/tao/ui/mobile/_mixins.scss
@@ -88,24 +128,38 @@ files:
88
128
  - lib/assets/stylesheets/tao/ui/mobile/code.scss
89
129
  - lib/assets/stylesheets/tao/ui/mobile/icons.scss
90
130
  - lib/assets/stylesheets/tao/ui/mobile/index.scss
91
- - lib/assets/stylesheets/tao/ui/mobile/mixins/_base.scss
92
- - lib/assets/stylesheets/tao/ui/mobile/mixins/_buttons.scss
131
+ - lib/assets/stylesheets/tao/ui/mobile/slide_box.scss
93
132
  - lib/assets/stylesheets/tao/ui/mobile/tables.scss
94
133
  - lib/assets/stylesheets/tao/ui/mobile/variables/_base.scss
95
- - lib/assets/stylesheets/tao/ui/mobile/variables/_buttons.scss
96
- - lib/assets/stylesheets/tao/ui/mobile/variables/_tables.scss
134
+ - lib/assets/stylesheets/tao/ui/popover.scss
135
+ - lib/assets/stylesheets/tao/ui/shared/_basic.scss
136
+ - lib/assets/stylesheets/tao/ui/shared/_buttons.scss
137
+ - lib/assets/stylesheets/tao/ui/shared/_code.scss
138
+ - lib/assets/stylesheets/tao/ui/shared/_icons.scss
139
+ - lib/assets/stylesheets/tao/ui/shared/_slide_box.scss
140
+ - lib/assets/stylesheets/tao/ui/shared/_tables.scss
141
+ - lib/assets/stylesheets/tao/ui/shared/mixins/_base.scss
142
+ - lib/assets/stylesheets/tao/ui/shared/mixins/_buttons.scss
143
+ - lib/assets/stylesheets/tao/ui/shared/variables/_base.scss
144
+ - lib/assets/stylesheets/tao/ui/shared/variables/_buttons.scss
145
+ - lib/assets/stylesheets/tao/ui/shared/variables/_tables.scss
146
+ - lib/assets/stylesheets/tao/ui/slide_box.scss
97
147
  - lib/assets/stylesheets/tao/ui/tables.scss
98
148
  - lib/assets/stylesheets/tao/ui/variables/_base.scss
99
- - lib/assets/stylesheets/tao/ui/variables/_buttons.scss
100
- - lib/assets/stylesheets/tao/ui/variables/_tables.scss
101
149
  - lib/generators/tao/icons/USAGE
102
150
  - lib/generators/tao/icons/icons_generator.rb
103
151
  - lib/generators/tao/icons/templates/icons.coffee.erb
104
152
  - lib/tao_ui.rb
105
153
  - lib/tao_ui/components.rb
154
+ - lib/tao_ui/components/dialog_component.rb
106
155
  - lib/tao_ui/components/icon_component.rb
156
+ - lib/tao_ui/components/popover_component.rb
157
+ - lib/tao_ui/components/slide_box_component.rb
107
158
  - lib/tao_ui/engine.rb
108
159
  - lib/tao_ui/version.rb
160
+ - lib/views/components/tao_ui/components/_dialog.html.erb
161
+ - lib/views/components/tao_ui/components/_popover.html.erb
162
+ - lib/views/components/tao_ui/components/_slide_box.html.erb
109
163
  - vendor/assets/stylesheets/normalize.css
110
164
  homepage: https://github.com/mycolorway/tao_ui
111
165
  licenses:
@@ -119,7 +173,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
119
173
  requirements:
120
174
  - - ">="
121
175
  - !ruby/object:Gem::Version
122
- version: '0'
176
+ version: 2.3.1
123
177
  required_rubygems_version: !ruby/object:Gem::Requirement
124
178
  requirements:
125
179
  - - ">="
@@ -127,7 +181,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
127
181
  version: '0'
128
182
  requirements: []
129
183
  rubyforge_project:
130
- rubygems_version: 2.5.1
184
+ rubygems_version: 2.6.11
131
185
  signing_key:
132
186
  specification_version: 4
133
187
  summary: Tao UI
@@ -1 +0,0 @@
1
- @import 'tao/ui/mixins/base';
@@ -1 +0,0 @@
1
- @import 'tao/ui/mixins/buttons';
@@ -1 +0,0 @@
1
- @import 'tao/ui/variables/buttons';
@@ -1 +0,0 @@
1
- @import 'tao/ui/variables/tables';
@@ -1,84 +0,0 @@
1
- $button-font-size: $font-size !default;
2
- $button-line-height: 1.5 !default;
3
- $button-padding: 0.5em 1em !default;
4
-
5
- $small-button-font-size: $font-size-xs !default;
6
- $small-button-line-height: 1.5 !default;
7
- $small-button-padding: 0.25em 0.5em !default;
8
-
9
- $default-button-colors: (
10
- normal: (
11
- bg: $white-color,
12
- text: $ui-color,
13
- border: #e3e3e3
14
- ),
15
- hover: (
16
- bg: $lighter-grey-color,
17
- text: $white-color,
18
- border: $lighter-grey-color
19
- ),
20
- active: (
21
- bg: $grey-color,
22
- text: $white-color,
23
- border: $grey-color
24
- ),
25
- disable: (
26
- bg: $white-color,
27
- text: $lightest-grey-color,
28
- border: #f1f1f1
29
- )
30
- ) !default;
31
-
32
- $primary-button-colors: (
33
- normal: (
34
- bg: $ui-color,
35
- text: $white-color,
36
- border: $ui-color
37
- ),
38
- hover: (
39
- bg: lighten($ui-color, 10%),
40
- text: $white-color,
41
- border: lighten($ui-color, 10%)
42
- ),
43
- active: (
44
- bg: darken($ui-color, 10%),
45
- text: $white-color,
46
- border: darken($ui-color, 10%)
47
- ),
48
- disable: (
49
- bg: $lighter-grey-bg-color,
50
- text: $lightest-grey-color,
51
- border: #e6e6e6
52
- )
53
- ) !default;
54
-
55
- $warning-button-colors: map-merge($default-button-colors, (
56
- normal: (
57
- bg: $white-color,
58
- text: lighten($red-color, 10%),
59
- border: #e3e3e3
60
- ),
61
- hover: (
62
- bg: lighten($red-color, 10%),
63
- text: $white-color,
64
- border: lighten($red-color, 10%)
65
- )
66
- )) !default;
67
-
68
- $primary-warning-button-colors: map-merge($primary-button-colors, (
69
- normal: (
70
- bg: $red-color,
71
- border: $red-color,
72
- text: $white-color
73
- ),
74
- hover: (
75
- bg: lighten($red-color, 10%),
76
- text: $white-color,
77
- border: lighten($red-color, 10%)
78
- ),
79
- active: (
80
- bg: darken($red-color, 10%),
81
- text: $white-color,
82
- border: darken($red-color, 10%)
83
- )
84
- )) !default;
@@ -1,2 +0,0 @@
1
- $table-border-color: #eeeeee !default;
2
- $table-row-hover-color: $lighter-grey-bg-color !default;