primer_view_components 0.0.8 → 0.0.9
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 +4 -4
- data/CHANGELOG.md +41 -36
- data/README.md +21 -7
- data/app/components/primer/blankslate_component.html.erb +1 -1
- data/app/components/primer/button_component.rb +4 -4
- data/app/components/primer/counter_component.rb +1 -0
- data/app/components/primer/details_component.rb +1 -1
- data/app/components/primer/flash_component.rb +1 -1
- data/app/components/primer/layout_component.rb +1 -1
- data/app/components/primer/octicon_component.rb +7 -2
- data/lib/primer/view_components/version.rb +1 -1
- metadata +20 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ee845a3614e0d347957e7f16cf83750c9616bc63828d6ef9adaac62d6b5eb18d
|
|
4
|
+
data.tar.gz: 24d5d20ee47acdc6ed411c0ec609870fa7b8788d1debbdf15001a7851f7be54f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ade2e2c9febaa32e5be37d60efe47c5ef8c7b17f41602e6f470bee8c21a499ab98ff52992aa484c4de3ab2f40f654f1ddc226fa1ac45077285e4349834dec542
|
|
7
|
+
data.tar.gz: 3d1eed4c85f4d513234f6ea9cdde584f83e54f7f2b6cf9197137b8e0ca6eeb6f15e2f51798b411d502452f910c5d1309ef0c1269b2b91559920048a2dfeb05f8
|
data/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
|
-
#
|
|
1
|
+
# CHANGELOG
|
|
2
2
|
|
|
3
|
-
|
|
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
|
-
|
|
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
|
-
|
|
25
|
+
## 0.0.7
|
|
20
26
|
|
|
21
27
|
* Use `octicons_helper` v11.0.0.
|
|
22
28
|
|
|
23
29
|
*Joel Hawksley*
|
|
24
30
|
|
|
25
|
-
|
|
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
|
-
|
|
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
|
-
|
|
53
|
+
## 0.0.5
|
|
50
54
|
|
|
51
55
|
* Add support for box_shadow
|
|
52
56
|
* Add components:
|
|
53
|
-
|
|
57
|
+
* Popover
|
|
54
58
|
|
|
55
59
|
*Sarah Vessels*
|
|
56
60
|
|
|
57
|
-
|
|
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
|
-
|
|
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
|
-
|
|
74
|
-
|
|
78
|
+
* Avatar
|
|
79
|
+
* Blankslate
|
|
75
80
|
|
|
76
81
|
*Manuel Puyol, Ben Emdon*
|
|
77
82
|
|
|
78
|
-
|
|
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
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
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
|
-
|
|
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
|
-
###
|
|
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
|
-
|
|
144
|
+
### Storybook / Documentation
|
|
143
145
|
|
|
144
|
-
To run
|
|
146
|
+
To run Storybook and the documentation site, run:
|
|
145
147
|
|
|
146
148
|
```bash
|
|
147
|
-
script/
|
|
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).
|
|
@@ -34,19 +34,19 @@ module Primer
|
|
|
34
34
|
**kwargs
|
|
35
35
|
)
|
|
36
36
|
@kwargs = kwargs
|
|
37
|
-
@kwargs[:tag] = fetch_or_fallback(TAG_OPTIONS, 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
|
|
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
|
|
49
|
-
VARIANT_MAPPINGS[fetch_or_fallback(VARIANT_OPTIONS, 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
|
|
@@ -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
|
|
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
|
|
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
|
|
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[:
|
|
20
|
-
@kwargs[:
|
|
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
|
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.
|
|
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-
|
|
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: []
|