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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '099f458c4b890ec0eda8fb5201d9698e855b2e5baccfb2421cc6af707d901d43'
4
- data.tar.gz: a05aeccfc91828e6baef3c65b573e839e8e4da5756b846c5cb1321cb6f1bb7bf
3
+ metadata.gz: 2ccb5842e06eb0bcde7e1907bdca34f89aafdb8efcac45535df837839d3fe033
4
+ data.tar.gz: 70d79f5632ce73c7f530e100e38d52e12616e95e7d9573c470c1e4fecd77a634
5
5
  SHA512:
6
- metadata.gz: 9e18cee20be82c8b23576d10fab5f469f1a318596935b508cfd1807b642271e87eb8212d6cd568e20d3ab2ca76679239a6e46382c5dd94730ca52c8fcf8c6a8d
7
- data.tar.gz: 5dfcddb690e3ce3ee97952c1217c8048525dd16f10748c6ba536e646fe5ffdcb06b079475b55d564b84743e14e468d8fd313a2fea91834dc1e994de79b3d6c4e
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
@@ -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
- result << found if found
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
- result << found if found
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(" ")
@@ -6,7 +6,7 @@ module Primer
6
6
  module VERSION
7
7
  MAJOR = 0
8
8
  MINOR = 51
9
- PATCH = 2
9
+ PATCH = 3
10
10
 
11
11
  STRING = [MAJOR, MINOR, PATCH].join(".")
12
12
  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.51.2
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 00:00:00.000000000 Z
11
+ date: 2026-03-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionview