primer_view_components 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 25626f31190d4622e822db5eb8f435f103c0a77668cb78c1db16eec60ac4dfb9
4
- data.tar.gz: e551785879e69a0bd7c2ae62a97a39f311dc3dbc415bc5dade637d97fa297910
3
+ metadata.gz: ee845a3614e0d347957e7f16cf83750c9616bc63828d6ef9adaac62d6b5eb18d
4
+ data.tar.gz: 24d5d20ee47acdc6ed411c0ec609870fa7b8788d1debbdf15001a7851f7be54f
5
5
  SHA512:
6
- metadata.gz: 6a77219748e0c7018f789df844cd6f6e83159b2fef82a5b81985c277d0427d85442e4e14c6f9934e387afc3f1d2291f31a3d88c9630c8f4910bae992d39a0188
7
- data.tar.gz: 15b0b2a9faa1603f57d263a2a6b18f2eb4e1aa325d8c261bfce9f803571ae9a5075b1d51f8a5f3bf31bc7f12662dbe914f7380f71518fe6896b947f2d000757b
6
+ metadata.gz: ade2e2c9febaa32e5be37d60efe47c5ef8c7b17f41602e6f470bee8c21a499ab98ff52992aa484c4de3ab2f40f654f1ddc226fa1ac45077285e4349834dec542
7
+ data.tar.gz: 3d1eed4c85f4d513234f6ea9cdde584f83e54f7f2b6cf9197137b8e0ca6eeb6f15e2f51798b411d502452f910c5d1309ef0c1269b2b91559920048a2dfeb05f8
@@ -1,6 +1,14 @@
1
- # main
1
+ # CHANGELOG
2
2
 
3
- # 0.0.8
3
+ ## main
4
+
5
+ ## 0.0.9
6
+
7
+ * BREAKING CHANGE: OcticonComponent no longer accepts `class` parameter; use `classes` instead.
8
+
9
+ *heynan0*
10
+
11
+ ## 0.0.8
4
12
 
5
13
  * Add support for border margins, such as: `border_top: 0`.
6
14
 
@@ -10,19 +18,17 @@
10
18
 
11
19
  *Joel Hawksley*
12
20
 
13
- ## Breaking changes
14
-
15
- * BlankslateComponent accepts `icon_size` instead of `icon_height`.
21
+ * BREAKING CHANGE: BlankslateComponent accepts `icon_size` instead of `icon_height`.
16
22
 
17
23
  *Joel Hawksley*
18
24
 
19
- # 0.0.7
25
+ ## 0.0.7
20
26
 
21
27
  * Use `octicons_helper` v11.0.0.
22
28
 
23
29
  *Joel Hawksley*
24
30
 
25
- # 0.0.6
31
+ ## 0.0.6
26
32
 
27
33
  * Updated the invalid class name error message
28
34
 
@@ -40,21 +46,19 @@
40
46
 
41
47
  *Manuel Puyol*
42
48
 
43
- ## Breaking changes
44
-
45
- * Changed `DetailsComponent` summary and body to be slots
49
+ * BREAKING CHANGE: Changed `DetailsComponent` summary and body to be slots
46
50
 
47
51
  *Manuel Puyol*
48
52
 
49
- # 0.0.5
53
+ ## 0.0.5
50
54
 
51
55
  * Add support for box_shadow
52
56
  * Add components:
53
- * Popover
57
+ * Popover
54
58
 
55
59
  *Sarah Vessels*
56
60
 
57
- # 0.0.4
61
+ ## 0.0.4
58
62
 
59
63
  * Added support for mx: and my: :auto.
60
64
 
@@ -63,19 +67,20 @@
63
67
  * Added support for custom layout sizes.
64
68
 
65
69
  *Manuel Puyol*
66
- # 0.0.3
70
+
71
+ ## 0.0.3
67
72
 
68
73
  * Add support for responsive `float` style argument.
69
74
 
70
75
  *Joel Hawksley*
71
76
 
72
77
  * Add components:
73
- * Avatar
74
- * Blankslate
78
+ * Avatar
79
+ * Blankslate
75
80
 
76
81
  *Manuel Puyol, Ben Emdon*
77
82
 
78
- # 0.0.1
83
+ ## 0.0.1
79
84
 
80
85
  * Add initial gem configuration.
81
86
 
@@ -90,24 +95,24 @@
90
95
  *Manuel Puyol*
91
96
 
92
97
  * Add components:
93
- * BorderBox
94
- * Box
95
- * Breadcrumb
96
- * Button
97
- * Counter
98
- * Details
99
- * Dropdown
100
- * Flex
101
- * FlexItem
102
- * Heading
103
- * Label
104
- * Layout
105
- * Link
106
- * ProgressBar
107
- * State
108
- * Subhead
109
- * Text
110
- * TimelineItem
111
- * UnderlineNav
98
+ * BorderBox
99
+ * Box
100
+ * Breadcrumb
101
+ * Button
102
+ * Counter
103
+ * Details
104
+ * Dropdown
105
+ * Flex
106
+ * FlexItem
107
+ * Heading
108
+ * Label
109
+ * Layout
110
+ * Link
111
+ * ProgressBar
112
+ * State
113
+ * Subhead
114
+ * Text
115
+ * TimelineItem
116
+ * UnderlineNav
112
117
 
113
118
  *Manuel Puyol*
data/README.md CHANGED
@@ -88,6 +88,7 @@ Some components have their own specific arguments, but they can all be styled wi
88
88
  | `box_shadow` | `box-shadow-<value>` | `box_shadow: :medium` → `.box-shadow-medium` |
89
89
 
90
90
  #### Boolean arguments
91
+
91
92
  | Component arguments | True | False |
92
93
  | -------------- | ------- | ------ |
93
94
  | `underline` | `underline: true` → `.text-underline` | `underline: false` → `.no-underline` |
@@ -116,7 +117,7 @@ The same label using `Primer::HeadingComponent`:
116
117
 
117
118
  ## Contributing
118
119
 
119
- Bug reports and pull requests are welcome on GitHub at https://github.com/primer/view_components. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
120
+ Bug reports and pull requests are welcome on GitHub at [https://github.com/primer/view_components](https://github.com/primer/view_components). This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
120
121
 
121
122
  ### Setting up
122
123
 
@@ -126,8 +127,7 @@ Run
126
127
  script/setup
127
128
  ```
128
129
 
129
- to install all necessary dependencies
130
-
130
+ To install all necessary dependencies.
131
131
 
132
132
  ### Running tests
133
133
 
@@ -137,16 +137,20 @@ To run the full test suite:
137
137
  bundle exec rake
138
138
  ```
139
139
 
140
- ### Storybook
140
+ ### Writing documentation
141
+
142
+ Documentation is written as [YARD](https://yardoc.org/) comments directly in the source code, compiled into Markdown via `rake docs:build` and served by [Doctocat](https://github.com/primer/doctocat).
141
143
 
142
- *We recommend having [overmind](https://github.com/DarthSim/overmind) installed to run both rails and storybook, but it is not required.*
144
+ ### Storybook / Documentation
143
145
 
144
- To run storybook:
146
+ To run Storybook and the documentation site, run:
145
147
 
146
148
  ```bash
147
- script/storybook
149
+ script/dev
148
150
  ```
149
151
 
152
+ _Note: Overmind is required to run script/dev._
153
+
150
154
  ### Developing with another app
151
155
 
152
156
  In your `Gemfile`, change:
@@ -171,6 +175,16 @@ you can check it in your app.
171
175
 
172
176
  Document components with [YARD](https://yardoc.org/). Docs are published to [RubyDoc.info](https://rubydoc.info/github/primer/view_components).
173
177
 
178
+ ## Deploying to Heroku
179
+
180
+ We have both `staging` and `production` environments. To deploy Storybook to Heroku, run the following in `#primer-view-components-ops`:
181
+
182
+ ```bash
183
+ .deploy primer-view-components</branch> to <environment>
184
+ ```
185
+
186
+ If no `branch` is passed, `main` will be deployed.
187
+
174
188
  ## License
175
189
 
176
190
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -3,7 +3,7 @@
3
3
  <%= render(Primer::OcticonComponent.new(
4
4
  icon: @icon,
5
5
  size: @icon_size,
6
- class: "blankslate-icon"
6
+ classes: "blankslate-icon"
7
7
  )) %>
8
8
  <% end %>
9
9
 
@@ -34,19 +34,19 @@ module Primer
34
34
  **kwargs
35
35
  )
36
36
  @kwargs = kwargs
37
- @kwargs[:tag] = fetch_or_fallback(TAG_OPTIONS, tag.to_sym, DEFAULT_TAG)
37
+ @kwargs[:tag] = fetch_or_fallback(TAG_OPTIONS, tag, DEFAULT_TAG)
38
38
 
39
39
  if @kwargs[:tag] == :a
40
40
  @kwargs[:role] = :button
41
41
  else
42
- @kwargs[:type] = type.to_sym
42
+ @kwargs[:type] = type
43
43
  end
44
44
 
45
45
  @kwargs[:classes] = class_names(
46
46
  "btn",
47
47
  kwargs[:classes],
48
- BUTTON_TYPE_MAPPINGS[fetch_or_fallback(BUTTON_TYPE_OPTIONS, button_type.to_sym, DEFAULT_BUTTON_TYPE)],
49
- VARIANT_MAPPINGS[fetch_or_fallback(VARIANT_OPTIONS, variant.to_sym, DEFAULT_VARIANT)],
48
+ BUTTON_TYPE_MAPPINGS[fetch_or_fallback(BUTTON_TYPE_OPTIONS, button_type, DEFAULT_BUTTON_TYPE)],
49
+ VARIANT_MAPPINGS[fetch_or_fallback(VARIANT_OPTIONS, variant, DEFAULT_VARIANT)],
50
50
  "BtnGroup-item" => group_item
51
51
  )
52
52
  end
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Primer
4
+ # Use Primer::CounterComponent to add a count to navigational elements and buttons.
4
5
  class CounterComponent < Primer::Component
5
6
  DEFAULT_SCHEME = :default
6
7
  SCHEME_MAPPINGS = {
@@ -24,7 +24,7 @@ module Primer
24
24
  @kwargs[:tag] = :details
25
25
  @kwargs[:classes] = class_names(
26
26
  kwargs[:classes],
27
- OVERLAY_MAPPINGS[fetch_or_fallback(OVERLAY_MAPPINGS.keys, overlay.to_sym, OVERLAY_DEFAULT)],
27
+ OVERLAY_MAPPINGS[fetch_or_fallback(OVERLAY_MAPPINGS.keys, overlay, OVERLAY_DEFAULT)],
28
28
  "details-reset" => reset
29
29
  )
30
30
  end
@@ -22,7 +22,7 @@ module Primer
22
22
  @kwargs[:classes] = class_names(
23
23
  @kwargs[:classes],
24
24
  "flash",
25
- VARIANT_MAPPINGS[fetch_or_fallback(VARIANT_MAPPINGS.keys, variant.to_sym, DEFAULT_VARIANT)],
25
+ VARIANT_MAPPINGS[fetch_or_fallback(VARIANT_MAPPINGS.keys, variant, DEFAULT_VARIANT)],
26
26
  "flash-full": full
27
27
  )
28
28
  @kwargs[:mb] ||= spacious ? 4 : nil
@@ -13,7 +13,7 @@ module Primer
13
13
 
14
14
  def initialize(responsive: false, side: DEFAULT_SIDE, sidebar_col: DEFAULT_SIDEBAR_COL, **kwargs)
15
15
  @kwargs = kwargs
16
- @side = fetch_or_fallback(ALLOWED_SIDES, side.to_sym, DEFAULT_SIDE)
16
+ @side = fetch_or_fallback(ALLOWED_SIDES, side, DEFAULT_SIDE)
17
17
  @responsive = responsive
18
18
  @kwargs[:classes] = class_names(
19
19
  "gutter-condensed gutter-lg",
@@ -16,8 +16,13 @@ module Primer
16
16
  def initialize(icon:, size: SIZE_DEFAULT, **kwargs)
17
17
  @icon, @kwargs = icon, kwargs
18
18
 
19
- @kwargs[:height] = SIZE_MAPPINGS[size.to_sym]
20
- @kwargs[:class] = class_names(@kwargs[:class], Primer::Classify.call(**@kwargs)[:class])
19
+ @kwargs[:class] = Primer::Classify.call(**@kwargs)[:class]
20
+ @kwargs[:height] ||= SIZE_MAPPINGS[size]
21
+
22
+ # Filter out classify options to prevent them from becoming invalid html attributes.
23
+ # Note height and width are both classify options and valid html attributes.
24
+ octicon_helper_options = @kwargs.slice(:height, :width)
25
+ @kwargs = @kwargs.except(*Primer::Classify::VALID_KEYS, :classes).merge(octicon_helper_options)
21
26
  end
22
27
 
23
28
  def call
@@ -5,7 +5,7 @@ module Primer
5
5
  module VERSION
6
6
  MAJOR = 0
7
7
  MINOR = 0
8
- PATCH = 8
8
+ PATCH = 9
9
9
 
10
10
  STRING = [MAJOR, MINOR, PATCH].join(".")
11
11
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: primer_view_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitHub Open Source
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-14 00:00:00.000000000 Z
11
+ date: 2020-10-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -70,6 +70,20 @@ dependencies:
70
70
  - - "<"
71
71
  - !ruby/object:Gem::Version
72
72
  version: 12.0.0
73
+ - !ruby/object:Gem::Dependency
74
+ name: listen
75
+ requirement: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - "~>"
78
+ - !ruby/object:Gem::Version
79
+ version: '3.0'
80
+ type: :development
81
+ prerelease: false
82
+ version_requirements: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - "~>"
85
+ - !ruby/object:Gem::Version
86
+ version: '3.0'
73
87
  - !ruby/object:Gem::Dependency
74
88
  name: minitest
75
89
  requirement: !ruby/object:Gem::Requirement
@@ -168,7 +182,7 @@ dependencies:
168
182
  - - "~>"
169
183
  - !ruby/object:Gem::Version
170
184
  version: 0.9.25
171
- description:
185
+ description:
172
186
  email:
173
187
  - opensource+primer_view_components@github.com
174
188
  executables: []
@@ -229,7 +243,7 @@ licenses:
229
243
  - MIT
230
244
  metadata:
231
245
  allowed_push_host: https://rubygems.org
232
- post_install_message:
246
+ post_install_message:
233
247
  rdoc_options: []
234
248
  require_paths:
235
249
  - lib
@@ -245,7 +259,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
245
259
  version: '0'
246
260
  requirements: []
247
261
  rubygems_version: 3.1.2
248
- signing_key:
262
+ signing_key:
249
263
  specification_version: 4
250
264
  summary: ViewComponents for the Primer Design System
251
265
  test_files: []