Skip to content

Commit d8d3951

Browse files
authored
Merge pull request #193 from opf/bump/primer-upstream
Bump primer upstream v19.24.1
2 parents 2d206b9 + 15aa2af commit d8d3951

9 files changed

Lines changed: 1361 additions & 2647 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@openproject/octicons": patch
3+
---
4+
5+
Allow `data-component` attribute to be overridden by consumers

lib/octicons_angular/package-lock.json

Lines changed: 1296 additions & 2632 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/octicons_gem/lib/octicons/octicon.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,11 @@ def initialize(symbol, options = {})
1313
@width = octicon["width"]
1414
@height = octicon["height"]
1515
@keywords = octicon["keywords"]
16-
@options = options.dup
16+
@options = { "data-component": "Octicon" }.merge(options.dup)
1717
@options.merge!({
1818
class: classes,
1919
viewBox: viewbox,
20-
version: "1.1",
21-
"data-component": "Octicon"
20+
version: "1.1"
2221
})
2322
@options.merge!(size)
2423
@options.merge!(a11y)

lib/octicons_gem/test/octicon_test.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,5 +140,11 @@
140140
icon = octicon("x")
141141
assert_includes icon.to_svg, "data-component=\"Octicon\""
142142
end
143+
144+
it "allows data-component to be overridden" do
145+
icon = octicon("x", "data-component": "CustomComponent")
146+
assert_includes icon.to_svg, "data-component=\"CustomComponent\""
147+
refute_includes icon.to_svg, "data-component=\"Octicon\""
148+
end
143149
end
144150
end

lib/octicons_node/yarn.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3408,9 +3408,9 @@ path-type@^4.0.0:
34083408
integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==
34093409

34103410
picomatch@^2.2.1, picomatch@^2.2.3:
3411-
version "2.2.3"
3412-
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.3.tgz#465547f359ccc206d3c48e46a1bcb89bf7ee619d"
3413-
integrity sha512-KpELjfwcCDUb9PeigTs2mBJzXUPzAuP2oPcA989He8Rte0+YUAjw1JVedDhuTKPkHjSYzMN3npC9luThGYEKdg==
3411+
version "2.3.2"
3412+
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.2.tgz#5a942915e26b372dc0f0e6753149a16e6b1c5601"
3413+
integrity sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==
34143414

34153415
pify@^2.0.0:
34163416
version "2.3.0"

lib/octicons_react/src/__tests__/octicon.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ describe('An icon component', () => {
1919
expect(container.querySelector('svg')).toHaveAttribute('data-component', 'Octicon')
2020
})
2121

22+
it('allows data-component to be overridden', () => {
23+
const {container} = render(<AlertIcon data-component="CustomComponent" />)
24+
expect(container.querySelector('svg')).toHaveAttribute('data-component', 'CustomComponent')
25+
})
26+
2227
it('sets `role="img"` if `aria-label` is provided', () => {
2328
render(<AlertIcon aria-label="Alert" />)
2429
expect(screen.getByLabelText('Alert')).toHaveAttribute('role', 'img')

lib/octicons_react/src/createIconComponent.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export function createIconComponent(name, defaultClassName, getSVGData) {
3838
return (
3939
<svg
4040
ref={forwardedRef}
41+
data-component="Octicon"
4142
{...rest}
4243
aria-hidden={labelled ? undefined : 'true'}
4344
tabIndex={tabIndex}
@@ -53,7 +54,6 @@ export function createIconComponent(name, defaultClassName, getSVGData) {
5354
id={id}
5455
display="inline-block"
5556
overflow="visible"
56-
data-component="Octicon"
5757
style={{
5858
verticalAlign,
5959
...style

lib/octicons_styled/src/__tests__/octicon.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,16 @@ describe('An icon component', () => {
1717
expect(container.querySelector('svg')).toHaveClass('foo')
1818
})
1919

20+
it('has `data-component="Octicon"` attribute by default', () => {
21+
const {container} = render(<AlertIcon />)
22+
expect(container.querySelector('svg')).toHaveAttribute('data-component', 'Octicon')
23+
})
24+
25+
it('allows data-component to be overridden', () => {
26+
const {container} = render(<AlertIcon data-component="CustomComponent" />)
27+
expect(container.querySelector('svg')).toHaveAttribute('data-component', 'CustomComponent')
28+
})
29+
2030
it('respects the verticalAlign prop', () => {
2131
const {container} = render(<AlertIcon verticalAlign="middle" />)
2232
expect(container.querySelector('svg')).toHaveStyle({verticalAlign: 'middle'})

yarn.lock

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -411,11 +411,6 @@
411411
resolved "https://registry.yarnpkg.com/@sindresorhus/merge-streams/-/merge-streams-2.3.0.tgz#719df7fb41766bc143369eaa0dd56d8dc87c9958"
412412
integrity sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==
413413

414-
"@trysound/sax@0.2.0":
415-
version "0.2.0"
416-
resolved "https://registry.yarnpkg.com/@trysound/sax/-/sax-0.2.0.tgz#cccaab758af56761eb7bf37af6f03f326dd798ad"
417-
integrity sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA==
418-
419414
"@types/estree@^1.0.0":
420415
version "1.0.8"
421416
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.8.tgz#958b91c991b1867ced318bedea0e215ee050726e"
@@ -4019,6 +4014,11 @@ safe-regex-test@^1.0.3:
40194014
resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a"
40204015
integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==
40214016

4017+
sax@^1.5.0:
4018+
version "1.6.0"
4019+
resolved "https://registry.yarnpkg.com/sax/-/sax-1.6.0.tgz#da59637629307b97e7c4cb28e080a7bc38560d5b"
4020+
integrity sha512-6R3J5M4AcbtLUdZmRv2SygeVaM7IhrLXu9BmnOGmmACak8fiUtOsYNWUS4uK7upbmHIBbLBeFeI//477BKLBzA==
4021+
40224022
"semver@2 || 3 || 4 || 5":
40234023
version "5.7.2"
40244024
resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.2.tgz#48d55db737c3287cd4835e17fa13feace1c41ef8"
@@ -4203,7 +4203,7 @@ stream-transform@^2.1.3:
42034203
dependencies:
42044204
mixme "^0.5.1"
42054205

4206-
"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.2.0, string-width@^4.2.3:
4206+
"string-width-cjs@npm:string-width@^4.2.0":
42074207
version "4.2.3"
42084208
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
42094209
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
@@ -4229,6 +4229,15 @@ string-width@^4.1.0:
42294229
is-fullwidth-code-point "^3.0.0"
42304230
strip-ansi "^6.0.0"
42314231

4232+
string-width@^4.2.0, string-width@^4.2.3:
4233+
version "4.2.3"
4234+
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
4235+
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
4236+
dependencies:
4237+
emoji-regex "^8.0.0"
4238+
is-fullwidth-code-point "^3.0.0"
4239+
strip-ansi "^6.0.1"
4240+
42324241
string-width@^5.0.1, string-width@^5.1.2:
42334242
version "5.1.2"
42344243
resolved "https://registry.yarnpkg.com/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794"
@@ -4307,7 +4316,7 @@ string_decoder@^1.1.1:
43074316
dependencies:
43084317
safe-buffer "~5.2.0"
43094318

4310-
"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1:
4319+
"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
43114320
version "6.0.1"
43124321
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
43134322
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
@@ -4321,6 +4330,13 @@ strip-ansi@^4.0.0:
43214330
dependencies:
43224331
ansi-regex "^3.0.0"
43234332

4333+
strip-ansi@^6.0.0, strip-ansi@^6.0.1:
4334+
version "6.0.1"
4335+
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
4336+
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
4337+
dependencies:
4338+
ansi-regex "^5.0.1"
4339+
43244340
strip-ansi@^7.0.1, strip-ansi@^7.1.0:
43254341
version "7.1.0"
43264342
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45"
@@ -4772,7 +4788,7 @@ word-wrap@^1.2.5:
47724788
resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.5.tgz#d2c45c6dd4fbce621a66f136cbe328afd0410b34"
47734789
integrity sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==
47744790

4775-
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0:
4791+
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0":
47764792
version "7.0.0"
47774793
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
47784794
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
@@ -4790,6 +4806,15 @@ wrap-ansi@^6.2.0:
47904806
string-width "^4.1.0"
47914807
strip-ansi "^6.0.0"
47924808

4809+
wrap-ansi@^7.0.0:
4810+
version "7.0.0"
4811+
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
4812+
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
4813+
dependencies:
4814+
ansi-styles "^4.0.0"
4815+
string-width "^4.1.0"
4816+
strip-ansi "^6.0.0"
4817+
47934818
wrap-ansi@^8.1.0:
47944819
version "8.1.0"
47954820
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214"

0 commit comments

Comments
 (0)