primer_view_components 0.0.38 → 0.0.39
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 +65 -27
- data/app/assets/javascripts/primer_view_components.js +1 -1
- data/app/assets/javascripts/primer_view_components.js.map +1 -1
- data/app/components/primer/auto_complete.rb +1 -1
- data/app/components/primer/auto_complete/item.rb +1 -1
- data/app/components/primer/avatar_component.rb +22 -3
- data/app/components/primer/avatar_stack_component.rb +1 -1
- data/app/components/primer/base_button.rb +1 -1
- data/app/components/primer/base_component.rb +7 -6
- data/app/components/primer/blankslate_component.rb +4 -1
- data/app/components/primer/border_box_component.rb +1 -1
- data/app/components/primer/box_component.rb +1 -1
- data/app/components/primer/breadcrumb_component.rb +1 -1
- data/app/components/primer/button_component.html.erb +9 -0
- data/app/components/primer/button_component.rb +39 -5
- data/app/components/primer/button_group.rb +1 -1
- data/app/components/primer/button_marketing_component.rb +1 -1
- data/app/components/primer/clipboard_copy.rb +1 -1
- data/app/components/primer/clipboard_copy_component.js +4 -6
- data/app/components/primer/clipboard_copy_component.ts +4 -6
- data/app/components/primer/close_button.rb +4 -2
- data/app/components/primer/component.rb +16 -2
- data/app/components/primer/counter_component.rb +1 -1
- data/app/components/primer/details_component.rb +1 -1
- data/app/components/primer/dropdown/menu_component.rb +1 -1
- data/app/components/primer/dropdown_component.rb +1 -1
- data/app/components/primer/flash_component.rb +1 -1
- data/app/components/primer/flex_component.rb +1 -1
- data/app/components/primer/flex_item_component.rb +20 -1
- data/app/components/primer/heading_component.rb +3 -3
- data/app/components/primer/hidden_text_expander.rb +1 -1
- data/app/components/primer/icon_button.rb +48 -0
- data/app/components/primer/label_component.rb +1 -1
- data/app/components/primer/layout_component.rb +1 -1
- data/app/components/primer/link_component.rb +1 -1
- data/app/components/primer/markdown_component.rb +1 -1
- data/app/components/primer/menu_component.rb +1 -1
- data/app/components/primer/octicon_component.rb +35 -10
- data/app/components/primer/popover_component.rb +1 -1
- data/app/components/primer/progress_bar_component.rb +1 -1
- data/app/components/primer/spinner_component.rb +1 -1
- data/app/components/primer/state_component.rb +1 -1
- data/app/components/primer/subhead_component.rb +1 -1
- data/app/components/primer/tab_container_component.rb +1 -1
- data/app/components/primer/tab_nav_component.rb +1 -1
- data/app/components/primer/text_component.rb +1 -1
- data/app/components/primer/time_ago_component.rb +1 -1
- data/app/components/primer/timeline_item_component.rb +1 -1
- data/app/components/primer/tooltip_component.rb +1 -1
- data/app/components/primer/truncate.rb +1 -1
- data/app/components/primer/underline_nav_component.rb +1 -1
- data/app/lib/primer/classify.rb +7 -32
- data/app/lib/primer/classify/cache.rb +19 -14
- data/app/lib/primer/classify/flex.rb +111 -0
- data/app/lib/primer/classify/functional_border_colors.rb +1 -2
- data/app/lib/primer/fetch_or_fallback_helper.rb +2 -2
- data/app/lib/primer/octicon/cache.rb +38 -0
- data/lib/primer/view_components/version.rb +1 -1
- data/static/statuses.json +1 -1
- metadata +7 -6
- data/app/components/primer/button_component.rb.orig +0 -138
- data/app/components/primer/foo_bar.d.ts +0 -1
- data/app/components/primer/foo_bar.js +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
module Primer
|
|
4
|
-
# Use TabContainer to create tabbed content with keyboard support. This component does not add any styles.
|
|
4
|
+
# Use `TabContainer` to create tabbed content with keyboard support. This component does not add any styles.
|
|
5
5
|
# It only provides the tab functionality. If you want styled Tabs you can look at <%= link_to_component(Primer::TabNavComponent) %>.
|
|
6
6
|
#
|
|
7
7
|
# This component requires javascript.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
module Primer
|
|
4
|
-
# Use TabNav to style navigation with a tab-based selected state, typically used for navigation placed at the top of the page.
|
|
4
|
+
# Use `TabNav` to style navigation with a tab-based selected state, typically used for navigation placed at the top of the page.
|
|
5
5
|
class TabNavComponent < Primer::Component
|
|
6
6
|
include Primer::TabbedComponentHelper
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
module Primer
|
|
4
|
-
#
|
|
4
|
+
# `Text` is a wrapper component that will apply typography styles to the text inside.
|
|
5
5
|
class TextComponent < Primer::Component
|
|
6
6
|
status :beta
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
module Primer
|
|
4
|
-
# Use
|
|
4
|
+
# Use `TimeAgo` to display a time relative to how long ago it was. This component requires JavaScript.
|
|
5
5
|
class TimeAgoComponent < Primer::Component
|
|
6
6
|
status :beta
|
|
7
7
|
|
|
@@ -19,7 +19,7 @@ module Primer
|
|
|
19
19
|
|
|
20
20
|
# Badge that will be connected to other TimelineItems.
|
|
21
21
|
#
|
|
22
|
-
# @param icon [String] Name of
|
|
22
|
+
# @param icon [String] Name of <%= link_to_octicons %> to use.
|
|
23
23
|
# @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
|
|
24
24
|
renders_one :badge, "BadgeComponent"
|
|
25
25
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
module Primer
|
|
4
|
-
#
|
|
4
|
+
# `Tooltip` is a wrapper component that will apply a tooltip to the provided content.
|
|
5
5
|
class TooltipComponent < Primer::Component
|
|
6
6
|
DIRECTION_DEFAULT = :n
|
|
7
7
|
ALIGN_DEFAULT = :default
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
module Primer
|
|
4
|
-
# Use
|
|
4
|
+
# Use `UnderlineNav` to style navigation with a minimal
|
|
5
5
|
# underlined selected state, typically used for navigation placed at the top
|
|
6
6
|
# of the page.
|
|
7
7
|
class UnderlineNavComponent < Primer::Component
|
data/app/lib/primer/classify.rb
CHANGED
|
@@ -3,13 +3,8 @@
|
|
|
3
3
|
module Primer
|
|
4
4
|
# :nodoc:
|
|
5
5
|
class Classify
|
|
6
|
-
DIRECTION_KEY = :direction
|
|
7
|
-
JUSTIFY_CONTENT_KEY = :justify_content
|
|
8
|
-
ALIGN_ITEMS_KEY = :align_items
|
|
9
6
|
DISPLAY_KEY = :display
|
|
10
7
|
SPACING_KEYS = Primer::Classify::Spacing::KEYS
|
|
11
|
-
RESPONSIVE_KEYS = ([DISPLAY_KEY, DIRECTION_KEY, JUSTIFY_CONTENT_KEY, ALIGN_ITEMS_KEY, :col, :float] + SPACING_KEYS).freeze
|
|
12
|
-
BREAKPOINTS = ["", "-sm", "-md", "-lg", "-xl"].freeze
|
|
13
8
|
|
|
14
9
|
# Keys where we can simply translate { key: value } into ".key-value"
|
|
15
10
|
CONCAT_KEYS = SPACING_KEYS + %i[hide position v float col text box_shadow].freeze
|
|
@@ -22,16 +17,15 @@ module Primer
|
|
|
22
17
|
VERTICAL_ALIGN_KEY = :vertical_align
|
|
23
18
|
WORD_BREAK_KEY = :word_break
|
|
24
19
|
TEXT_KEYS = %i[text_align font_weight].freeze
|
|
25
|
-
FLEX_KEY = :flex
|
|
26
|
-
FLEX_GROW_KEY = :flex_grow
|
|
27
|
-
FLEX_SHRINK_KEY = :flex_shrink
|
|
28
|
-
ALIGN_SELF_KEY = :align_self
|
|
29
20
|
WIDTH_KEY = :width
|
|
30
21
|
HEIGHT_KEY = :height
|
|
31
22
|
BOX_SHADOW_KEY = :box_shadow
|
|
32
23
|
VISIBILITY_KEY = :visibility
|
|
33
24
|
ANIMATION_KEY = :animation
|
|
34
25
|
|
|
26
|
+
BREAKPOINTS = ["", "-sm", "-md", "-lg", "-xl"].freeze
|
|
27
|
+
RESPONSIVE_KEYS = ([DISPLAY_KEY, :col, :float] + SPACING_KEYS + Primer::Classify::Flex::RESPONSIVE_KEYS).freeze
|
|
28
|
+
|
|
35
29
|
BOOLEAN_MAPPINGS = {
|
|
36
30
|
underline: {
|
|
37
31
|
mappings: [
|
|
@@ -89,6 +83,7 @@ module Primer
|
|
|
89
83
|
BORDER_MARGIN_KEYS +
|
|
90
84
|
TYPOGRAPHY_KEYS +
|
|
91
85
|
TEXT_KEYS +
|
|
86
|
+
Primer::Classify::Flex::KEYS +
|
|
92
87
|
[
|
|
93
88
|
BORDER_KEY,
|
|
94
89
|
BORDER_COLOR_KEY,
|
|
@@ -98,13 +93,6 @@ module Primer
|
|
|
98
93
|
DISPLAY_KEY,
|
|
99
94
|
VERTICAL_ALIGN_KEY,
|
|
100
95
|
WORD_BREAK_KEY,
|
|
101
|
-
DIRECTION_KEY,
|
|
102
|
-
JUSTIFY_CONTENT_KEY,
|
|
103
|
-
ALIGN_ITEMS_KEY,
|
|
104
|
-
FLEX_KEY,
|
|
105
|
-
FLEX_GROW_KEY,
|
|
106
|
-
FLEX_SHRINK_KEY,
|
|
107
|
-
ALIGN_SELF_KEY,
|
|
108
96
|
WIDTH_KEY,
|
|
109
97
|
HEIGHT_KEY,
|
|
110
98
|
BOX_SHADOW_KEY,
|
|
@@ -120,7 +108,7 @@ module Primer
|
|
|
120
108
|
extracted_results[:class] = [
|
|
121
109
|
validated_class_names(classes),
|
|
122
110
|
extracted_results.delete(:classes)
|
|
123
|
-
].compact.join(" ").presence
|
|
111
|
+
].compact.join(" ").strip.presence
|
|
124
112
|
|
|
125
113
|
extracted_results[:style] = [
|
|
126
114
|
extracted_results.delete(:styles),
|
|
@@ -216,21 +204,8 @@ module Primer
|
|
|
216
204
|
memo[:classes] << "#{key.to_s.dasherize}-#{val}"
|
|
217
205
|
elsif key == BORDER_RADIUS_KEY
|
|
218
206
|
memo[:classes] << "rounded-#{val}"
|
|
219
|
-
elsif key
|
|
220
|
-
memo[:classes] <<
|
|
221
|
-
elsif key == JUSTIFY_CONTENT_KEY
|
|
222
|
-
formatted_value = val.to_s.gsub(/(flex\_|space\_)/, "")
|
|
223
|
-
memo[:classes] << "flex#{breakpoint}-justify-#{formatted_value}"
|
|
224
|
-
elsif key == ALIGN_ITEMS_KEY
|
|
225
|
-
memo[:classes] << "flex#{breakpoint}-items-#{val.to_s.gsub('flex_', '')}"
|
|
226
|
-
elsif key == FLEX_KEY
|
|
227
|
-
memo[:classes] << "flex-#{val}"
|
|
228
|
-
elsif key == FLEX_GROW_KEY
|
|
229
|
-
memo[:classes] << "flex-grow-#{val}"
|
|
230
|
-
elsif key == FLEX_SHRINK_KEY
|
|
231
|
-
memo[:classes] << "flex-shrink-#{val}"
|
|
232
|
-
elsif key == ALIGN_SELF_KEY
|
|
233
|
-
memo[:classes] << "flex-self-#{val}"
|
|
207
|
+
elsif Primer::Classify::Flex::KEYS.include?(key)
|
|
208
|
+
memo[:classes] << Primer::Classify::Flex.classes(key, val, breakpoint)
|
|
234
209
|
elsif key == WIDTH_KEY || key == HEIGHT_KEY
|
|
235
210
|
if val == :fit || val == :fill
|
|
236
211
|
memo[:classes] << "#{key}-#{val}"
|
|
@@ -40,18 +40,18 @@ module Primer
|
|
|
40
40
|
)
|
|
41
41
|
|
|
42
42
|
preload(
|
|
43
|
-
keys: Primer::Classify::DIRECTION_KEY,
|
|
44
|
-
values:
|
|
43
|
+
keys: Primer::Classify::Flex::DIRECTION_KEY,
|
|
44
|
+
values: Primer::Classify::Flex::DIRECTION_VALUES
|
|
45
45
|
)
|
|
46
46
|
|
|
47
47
|
preload(
|
|
48
|
-
keys: Primer::Classify::JUSTIFY_CONTENT_KEY,
|
|
49
|
-
values:
|
|
48
|
+
keys: Primer::Classify::Flex::JUSTIFY_CONTENT_KEY,
|
|
49
|
+
values: Primer::Classify::Flex::JUSTIFY_CONTENT_VALUES
|
|
50
50
|
)
|
|
51
51
|
|
|
52
52
|
preload(
|
|
53
|
-
keys: Primer::Classify::ALIGN_ITEMS_KEY,
|
|
54
|
-
values:
|
|
53
|
+
keys: Primer::Classify::Flex::ALIGN_ITEMS_KEY,
|
|
54
|
+
values: Primer::Classify::Flex::ALIGN_ITEMS_VALUES
|
|
55
55
|
)
|
|
56
56
|
|
|
57
57
|
preload(
|
|
@@ -61,12 +61,12 @@ module Primer
|
|
|
61
61
|
|
|
62
62
|
preload(
|
|
63
63
|
keys: [Primer::Classify::COLOR_KEY],
|
|
64
|
-
values:
|
|
64
|
+
values: Primer::Classify::FunctionalTextColors::OPTIONS
|
|
65
65
|
)
|
|
66
66
|
|
|
67
67
|
preload(
|
|
68
68
|
keys: [Primer::Classify::BG_KEY],
|
|
69
|
-
values:
|
|
69
|
+
values: Primer::Classify::FunctionalBackgroundColors::OPTIONS
|
|
70
70
|
)
|
|
71
71
|
|
|
72
72
|
preload(
|
|
@@ -90,18 +90,23 @@ module Primer
|
|
|
90
90
|
)
|
|
91
91
|
|
|
92
92
|
preload(
|
|
93
|
-
keys: Primer::Classify::FLEX_KEY,
|
|
94
|
-
values:
|
|
93
|
+
keys: Primer::Classify::Flex::FLEX_KEY,
|
|
94
|
+
values: Primer::Classify::Flex::FLEX_VALUES
|
|
95
95
|
)
|
|
96
96
|
|
|
97
97
|
preload(
|
|
98
|
-
keys:
|
|
99
|
-
values:
|
|
98
|
+
keys: Primer::Classify::Flex::GROW_KEY,
|
|
99
|
+
values: Primer::Classify::Flex::GROW_VALUES
|
|
100
100
|
)
|
|
101
101
|
|
|
102
102
|
preload(
|
|
103
|
-
keys:
|
|
104
|
-
values:
|
|
103
|
+
keys: Primer::Classify::Flex::SHRINK_KEY,
|
|
104
|
+
values: Primer::Classify::Flex::SHRINK_VALUES
|
|
105
|
+
)
|
|
106
|
+
|
|
107
|
+
preload(
|
|
108
|
+
keys: Primer::Classify::Flex::ALIGN_SELF_KEY,
|
|
109
|
+
values: Primer::Classify::Flex::ALIGN_SELF_VALUES
|
|
105
110
|
)
|
|
106
111
|
|
|
107
112
|
preload(
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Primer
|
|
4
|
+
class Classify
|
|
5
|
+
# Handler for PrimerCSS flex classes.
|
|
6
|
+
class Flex
|
|
7
|
+
extend Primer::FetchOrFallbackHelper
|
|
8
|
+
|
|
9
|
+
FLEX_KEY = :flex
|
|
10
|
+
FLEX_VALUES = [1, :auto].freeze
|
|
11
|
+
|
|
12
|
+
WRAP_KEY = :flex_wrap
|
|
13
|
+
WRAP_MAPPINGS = {
|
|
14
|
+
wrap: "flex-wrap",
|
|
15
|
+
nowrap: "flex-nowrap",
|
|
16
|
+
reverse: "flex-wrap-reverse"
|
|
17
|
+
}.freeze
|
|
18
|
+
|
|
19
|
+
SHRINK_KEY = :flex_shrink
|
|
20
|
+
SHRINK_VALUES = [0].freeze
|
|
21
|
+
|
|
22
|
+
GROW_KEY = :flex_grow
|
|
23
|
+
GROW_VALUES = [0].freeze
|
|
24
|
+
|
|
25
|
+
ALIGN_SELF_KEY = :align_self
|
|
26
|
+
ALIGN_SELF_VALUES = [:auto, :start, :end, :center, :baseline, :stretch].freeze
|
|
27
|
+
|
|
28
|
+
DIRECTION_KEY = :direction
|
|
29
|
+
DIRECTION_VALUES = [:column, :column_reverse, :row, :row_reverse].freeze
|
|
30
|
+
|
|
31
|
+
JUSTIFY_CONTENT_KEY = :justify_content
|
|
32
|
+
JUSTIFY_CONTENT_VALUES = [:flex_start, :flex_end, :center, :space_between, :space_around].freeze
|
|
33
|
+
|
|
34
|
+
ALIGN_ITEMS_KEY = :align_items
|
|
35
|
+
ALIGN_ITEMS_VALUES = [:flex_start, :flex_end, :center, :baseline, :stretch].freeze
|
|
36
|
+
|
|
37
|
+
KEYS = [FLEX_KEY, WRAP_KEY, SHRINK_KEY, GROW_KEY, ALIGN_SELF_KEY, DIRECTION_KEY, JUSTIFY_CONTENT_KEY, ALIGN_ITEMS_KEY].freeze
|
|
38
|
+
RESPONSIVE_KEYS = [DIRECTION_KEY, JUSTIFY_CONTENT_KEY, ALIGN_ITEMS_KEY].freeze
|
|
39
|
+
|
|
40
|
+
class << self
|
|
41
|
+
def classes(key, value, breakpoint)
|
|
42
|
+
send(key, value, breakpoint)
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
private
|
|
46
|
+
|
|
47
|
+
def flex(value, _breakpoint)
|
|
48
|
+
generate(
|
|
49
|
+
value: value,
|
|
50
|
+
allowed_values: FLEX_VALUES,
|
|
51
|
+
prefix: "flex"
|
|
52
|
+
)
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def flex_shrink(value, _breakpoint)
|
|
56
|
+
generate(
|
|
57
|
+
value: value,
|
|
58
|
+
allowed_values: SHRINK_VALUES,
|
|
59
|
+
prefix: "flex-shrink"
|
|
60
|
+
)
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def flex_grow(value, _breakpoint)
|
|
64
|
+
generate(
|
|
65
|
+
value: value,
|
|
66
|
+
allowed_values: GROW_VALUES,
|
|
67
|
+
prefix: "flex-grow"
|
|
68
|
+
)
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
def align_self(value, _breakpoint)
|
|
72
|
+
generate(
|
|
73
|
+
value: value,
|
|
74
|
+
allowed_values: ALIGN_SELF_VALUES,
|
|
75
|
+
prefix: "flex-self"
|
|
76
|
+
)
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
def flex_wrap(value, _breakpoint)
|
|
80
|
+
WRAP_MAPPINGS[fetch_or_fallback(WRAP_MAPPINGS.keys, value)]
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
def direction(value, breakpoint)
|
|
84
|
+
val = fetch_or_fallback(DIRECTION_VALUES, value)
|
|
85
|
+
|
|
86
|
+
"flex#{breakpoint}-#{val.to_s.dasherize}"
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
def justify_content(value, breakpoint)
|
|
90
|
+
val = fetch_or_fallback(JUSTIFY_CONTENT_VALUES, value)
|
|
91
|
+
|
|
92
|
+
formatted_value = val.to_s.gsub(/(flex\_|space\_)/, "")
|
|
93
|
+
"flex#{breakpoint}-justify-#{formatted_value}"
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
def align_items(value, breakpoint)
|
|
97
|
+
val = fetch_or_fallback(ALIGN_ITEMS_VALUES, value)
|
|
98
|
+
|
|
99
|
+
formatted_value = val.to_s.gsub("flex_", "")
|
|
100
|
+
"flex#{breakpoint}-items-#{formatted_value}"
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
def generate(value:, allowed_values:, prefix:)
|
|
104
|
+
val = fetch_or_fallback(allowed_values, value)
|
|
105
|
+
|
|
106
|
+
"#{prefix}-#{val}"
|
|
107
|
+
end
|
|
108
|
+
end
|
|
109
|
+
end
|
|
110
|
+
end
|
|
111
|
+
end
|
|
@@ -25,10 +25,10 @@ module Primer
|
|
|
25
25
|
|
|
26
26
|
InvalidValueError = Class.new(StandardError)
|
|
27
27
|
|
|
28
|
-
def fetch_or_fallback(allowed_values, given_value, fallback = nil, deprecated_values:
|
|
28
|
+
def fetch_or_fallback(allowed_values, given_value, fallback = nil, deprecated_values: nil)
|
|
29
29
|
if allowed_values.include?(given_value)
|
|
30
30
|
given_value
|
|
31
|
-
elsif deprecated_values
|
|
31
|
+
elsif deprecated_values&.include?(given_value)
|
|
32
32
|
ActiveSupport::Deprecation.warn("#{given_value} is deprecated and will be removed in a future version.") unless Rails.env.production? || silence_deprecations?
|
|
33
33
|
|
|
34
34
|
given_value
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Primer
|
|
4
|
+
module Octicon
|
|
5
|
+
# :nodoc:
|
|
6
|
+
class Cache
|
|
7
|
+
LOOKUP = {} # rubocop:disable Style/MutableConstant
|
|
8
|
+
# Preload the top 20 used icons.
|
|
9
|
+
PRELOADED_ICONS = [:alert, :check, :"chevron-down", :clippy, :clock, :"dot-fill", :info, :"kebab-horizontal", :link, :lock, :mail, :pencil, :plus, :question, :repo, :search, :"shield-lock", :star, :trash, :x].freeze
|
|
10
|
+
|
|
11
|
+
class << self
|
|
12
|
+
def read(key)
|
|
13
|
+
LOOKUP[key]
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
# Cache size limit.
|
|
17
|
+
def limit
|
|
18
|
+
500
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def set(key, value)
|
|
22
|
+
LOOKUP[key] = value
|
|
23
|
+
|
|
24
|
+
# Remove first item when the cache is too large.
|
|
25
|
+
LOOKUP.shift if LOOKUP.size > limit
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def clear!
|
|
29
|
+
LOOKUP.clear
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def preload!
|
|
33
|
+
PRELOADED_ICONS.each { |icon| Primer::OcticonComponent.new(icon: icon) }
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
data/static/statuses.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"Primer::AutoComplete":"beta","Primer::AutoComplete::Item":"beta","Primer::AvatarComponent":"beta","Primer::AvatarStackComponent":"beta","Primer::BaseButton":"beta","Primer::BaseComponent":"beta","Primer::BlankslateComponent":"beta","Primer::BorderBoxComponent":"beta","Primer::BoxComponent":"stable","Primer::BreadcrumbComponent":"beta","Primer::BreadcrumbComponent::ItemComponent":"alpha","Primer::ButtonComponent":"beta","Primer::ButtonGroup":"beta","Primer::ButtonMarketingComponent":"alpha","Primer::ClipboardCopy":"alpha","Primer::CloseButton":"
|
|
1
|
+
{"Primer::AutoComplete":"beta","Primer::AutoComplete::Item":"beta","Primer::AvatarComponent":"beta","Primer::AvatarStackComponent":"beta","Primer::BaseButton":"beta","Primer::BaseComponent":"beta","Primer::BlankslateComponent":"beta","Primer::BorderBoxComponent":"beta","Primer::BoxComponent":"stable","Primer::BreadcrumbComponent":"beta","Primer::BreadcrumbComponent::ItemComponent":"alpha","Primer::ButtonComponent":"beta","Primer::ButtonGroup":"beta","Primer::ButtonMarketingComponent":"alpha","Primer::ClipboardCopy":"alpha","Primer::CloseButton":"beta","Primer::CounterComponent":"beta","Primer::DetailsComponent":"beta","Primer::Dropdown::MenuComponent":"alpha","Primer::DropdownComponent":"alpha","Primer::DropdownMenuComponent":"deprecated","Primer::FlashComponent":"beta","Primer::FlexComponent":"alpha","Primer::FlexItemComponent":"deprecated","Primer::HeadingComponent":"beta","Primer::HiddenTextExpander":"alpha","Primer::IconButton":"alpha","Primer::LabelComponent":"beta","Primer::LayoutComponent":"alpha","Primer::LinkComponent":"beta","Primer::MarkdownComponent":"alpha","Primer::MenuComponent":"alpha","Primer::Navigation::TabComponent":"alpha","Primer::OcticonComponent":"beta","Primer::PopoverComponent":"beta","Primer::ProgressBarComponent":"beta","Primer::SpinnerComponent":"beta","Primer::StateComponent":"beta","Primer::SubheadComponent":"beta","Primer::TabContainerComponent":"alpha","Primer::TabNavComponent":"alpha","Primer::TextComponent":"beta","Primer::TimeAgoComponent":"beta","Primer::TimelineItemComponent":"beta","Primer::TimelineItemComponent::BadgeComponent":"alpha","Primer::TooltipComponent":"alpha","Primer::Truncate":"beta","Primer::UnderlineNavComponent":"alpha"}
|
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.39
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- GitHub Open Source
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2021-04-
|
|
11
|
+
date: 2021-04-29 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: actionview
|
|
@@ -39,7 +39,7 @@ dependencies:
|
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
40
|
version: 5.0.0
|
|
41
41
|
- !ruby/object:Gem::Dependency
|
|
42
|
-
name:
|
|
42
|
+
name: octicons
|
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
|
44
44
|
requirements:
|
|
45
45
|
- - ">="
|
|
@@ -342,8 +342,8 @@ files:
|
|
|
342
342
|
- app/components/primer/box_component.rb
|
|
343
343
|
- app/components/primer/breadcrumb_component.html.erb
|
|
344
344
|
- app/components/primer/breadcrumb_component.rb
|
|
345
|
+
- app/components/primer/button_component.html.erb
|
|
345
346
|
- app/components/primer/button_component.rb
|
|
346
|
-
- app/components/primer/button_component.rb.orig
|
|
347
347
|
- app/components/primer/button_group.html.erb
|
|
348
348
|
- app/components/primer/button_group.rb
|
|
349
349
|
- app/components/primer/button_marketing_component.rb
|
|
@@ -367,10 +367,9 @@ files:
|
|
|
367
367
|
- app/components/primer/flash_component.rb
|
|
368
368
|
- app/components/primer/flex_component.rb
|
|
369
369
|
- app/components/primer/flex_item_component.rb
|
|
370
|
-
- app/components/primer/foo_bar.d.ts
|
|
371
|
-
- app/components/primer/foo_bar.js
|
|
372
370
|
- app/components/primer/heading_component.rb
|
|
373
371
|
- app/components/primer/hidden_text_expander.rb
|
|
372
|
+
- app/components/primer/icon_button.rb
|
|
374
373
|
- app/components/primer/label_component.rb
|
|
375
374
|
- app/components/primer/layout_component.html.erb
|
|
376
375
|
- app/components/primer/layout_component.rb
|
|
@@ -413,6 +412,7 @@ files:
|
|
|
413
412
|
- app/lib/primer/class_name_helper.rb
|
|
414
413
|
- app/lib/primer/classify.rb
|
|
415
414
|
- app/lib/primer/classify/cache.rb
|
|
415
|
+
- app/lib/primer/classify/flex.rb
|
|
416
416
|
- app/lib/primer/classify/functional_background_colors.rb
|
|
417
417
|
- app/lib/primer/classify/functional_border_colors.rb
|
|
418
418
|
- app/lib/primer/classify/functional_colors.rb
|
|
@@ -420,6 +420,7 @@ files:
|
|
|
420
420
|
- app/lib/primer/classify/spacing.rb
|
|
421
421
|
- app/lib/primer/fetch_or_fallback_helper.rb
|
|
422
422
|
- app/lib/primer/join_style_arguments_helper.rb
|
|
423
|
+
- app/lib/primer/octicon/cache.rb
|
|
423
424
|
- app/lib/primer/status/dsl.rb
|
|
424
425
|
- app/lib/primer/tabbed_component_helper.rb
|
|
425
426
|
- app/lib/primer/test_selector_helper.rb
|