primer_view_components 0.51.2 → 0.51.3
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 +6 -0
- data/lib/primer/classify.rb +22 -2
- data/lib/primer/view_components/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2ccb5842e06eb0bcde7e1907bdca34f89aafdb8efcac45535df837839d3fe033
|
|
4
|
+
data.tar.gz: 70d79f5632ce73c7f530e100e38d52e12616e95e7d9573c470c1e4fecd77a634
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7b7304189663358409ae51385f014359f9e8309d1ef9e38e4ae7e7b9c1bf64f67ab805bc669cb674b038e2d16d993fccc9c7a79afcdcf88dc53af4e378d53b04
|
|
7
|
+
data.tar.gz: e394c1972460b4e54e742b397ff395bf864bd9cd6eb6355c4fbd96e03195ed0574f63622a7c19049093f04e1ed71bd472281ef020f0040694a157424094f54d4
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
2
|
|
|
3
|
+
## 0.51.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#3997](https://github.com/primer/view_components/pull/3997) [`35c30b2`](https://github.com/primer/view_components/commit/35c30b22abc7dd3989b3034eab4cff788ee2f179) Thanks [@siddharthkp](https://github.com/siddharthkp)! - Add `tmp-` prefixed duplicate classes for margin and padding utilities. System arguments like `mb: 3` now output both `mb-3` and `tmp-mb-3` classes to support CSS namespace migration.
|
|
8
|
+
|
|
3
9
|
## 0.51.2
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
data/lib/primer/classify.rb
CHANGED
|
@@ -24,6 +24,20 @@ module Primer
|
|
|
24
24
|
|
|
25
25
|
LOOKUP = Primer::Classify::Utilities::UTILITIES
|
|
26
26
|
|
|
27
|
+
# Keys that should have tmp- prefixed duplicates for CSS namespace migration
|
|
28
|
+
SPACING_KEYS = Set.new(%i[m mt mb ml mr mx my p pt pb pl pr px py]).freeze
|
|
29
|
+
|
|
30
|
+
# Pre-computed tmp- prefixed strings to avoid runtime allocation
|
|
31
|
+
TMP_PREFIX_CACHE = SPACING_KEYS.each_with_object({}) do |key, cache|
|
|
32
|
+
next unless LOOKUP[key]
|
|
33
|
+
|
|
34
|
+
LOOKUP[key].each_value do |classnames|
|
|
35
|
+
classnames.each do |cls|
|
|
36
|
+
cache[cls] = -"tmp-#{cls}" if cls
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end.freeze
|
|
40
|
+
|
|
27
41
|
class << self
|
|
28
42
|
# Utility for mapping component configuration into Primer CSS class names.
|
|
29
43
|
#
|
|
@@ -75,7 +89,10 @@ module Primer
|
|
|
75
89
|
# in the lookup table.
|
|
76
90
|
found = (LOOKUP[key][item][brk] rescue nil) || validate(key, item, brk)
|
|
77
91
|
# rubocop:enable Style/RescueModifier
|
|
78
|
-
|
|
92
|
+
if found
|
|
93
|
+
result << found
|
|
94
|
+
result << TMP_PREFIX_CACHE[found] if TMP_PREFIX_CACHE.key?(found)
|
|
95
|
+
end
|
|
79
96
|
brk += 1
|
|
80
97
|
end
|
|
81
98
|
else
|
|
@@ -84,7 +101,10 @@ module Primer
|
|
|
84
101
|
# rubocop:disable Style/RescueModifier
|
|
85
102
|
found = (LOOKUP[key][val][0] rescue nil) || validate(key, val, 0)
|
|
86
103
|
# rubocop:enable Style/RescueModifier
|
|
87
|
-
|
|
104
|
+
if found
|
|
105
|
+
result << found
|
|
106
|
+
result << TMP_PREFIX_CACHE[found] if TMP_PREFIX_CACHE.key?(found)
|
|
107
|
+
end
|
|
88
108
|
end
|
|
89
109
|
end
|
|
90
110
|
end.join(" ")
|
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.51.
|
|
4
|
+
version: 0.51.3
|
|
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: 2026-03-
|
|
11
|
+
date: 2026-03-31 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: actionview
|