playbook_ui 12.24.0.pre.alpha.alphatestforselfhostfak720 → 12.24.0.pre.alpha.play833boldoptionfortitle2and3717
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/app/pb_kits/playbook/pb_icon/_icon.tsx +1 -1
- data/app/pb_kits/playbook/pb_icon/icon.rb +1 -1
- data/app/pb_kits/playbook/pb_title/_title.scss +1 -0
- data/app/pb_kits/playbook/pb_title/_title.tsx +2 -1
- data/app/pb_kits/playbook/pb_title/docs/_title_default.html.erb +1 -1
- data/app/pb_kits/playbook/pb_title/title.rb +8 -1
- data/app/pb_kits/playbook/pb_title/title.test.js +2 -2
- data/lib/playbook/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: e94d873152c1cc2e61164252945bf8886d4f8d78f9f7171d88c2c1122fd2a773
|
4
|
+
data.tar.gz: 5ef03ff135408bcfa5ad9a487be278bbbb2d96030c0da367a85ed4446c76ea30
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 68709ae639291c9b472725adfef76aeac599bdf467ebd4a113a7933f4d6a7d4d3a234cf8eff64eaa8b7fcbaf6fb9efb25992a0f99e2b6de05d515753604fd1d5
|
7
|
+
data.tar.gz: 73908e6af09435d622d57a90a211da2d7e353fbb94ec6490f41650ebe8032a1fe233068e6baf2e4687fe04d45f4020516eadd0e45375f86f9d47fb2094fc949e
|
@@ -33,7 +33,7 @@ module Playbook
|
|
33
33
|
values: ["lg", "xs", "sm", "1x", "2x", "3x", "4x", "5x", "6x", "7x", "8x", "9x", "10x", nil],
|
34
34
|
default: nil
|
35
35
|
prop :font_style, type: Playbook::Props::Enum,
|
36
|
-
values: %w[far fas fab
|
36
|
+
values: %w[far fas fab],
|
37
37
|
default: "far"
|
38
38
|
prop :spin, type: Playbook::Props::Boolean,
|
39
39
|
default: false
|
@@ -21,13 +21,13 @@ const Title = (props: TitleProps): React.ReactElement => {
|
|
21
21
|
if (props.variant) deprecatedProps('Title', ['variant']) //variant prop is deprecated, use color instead
|
22
22
|
const {
|
23
23
|
aria = {},
|
24
|
-
bold = true,
|
25
24
|
children,
|
26
25
|
className,
|
27
26
|
color,
|
28
27
|
data = {},
|
29
28
|
id,
|
30
29
|
size = 3,
|
30
|
+
bold = size === 3 ? false : true,
|
31
31
|
tag = 'h3',
|
32
32
|
text,
|
33
33
|
variant = null,
|
@@ -35,6 +35,7 @@ const Title = (props: TitleProps): React.ReactElement => {
|
|
35
35
|
|
36
36
|
const ariaProps: {[key: string]: string | number} = buildAriaProps(aria)
|
37
37
|
const dataProps: {[key: string]: string | number} = buildDataProps(data)
|
38
|
+
|
38
39
|
const getBold = bold ? '' : 'thin'
|
39
40
|
const classes = classnames(
|
40
41
|
buildCss('pb_title_kit', `size_${size}`, variant, color, getBold),
|
@@ -7,5 +7,5 @@
|
|
7
7
|
|
8
8
|
<%= pb_rails("title", props: { text: "Title 1", tag: "h1", size: 1 }) %>
|
9
9
|
<%= pb_rails("title", props: { text: "Title 2", tag: "h2", size: 2 }) %>
|
10
|
-
<%= pb_rails("title", props: { text: "Title 3", tag: "h3", size: 3 }) %>
|
10
|
+
<%= pb_rails("title", props: { text: "Title 3", tag: "h3", size: 3, color: "success"}) %>
|
11
11
|
<%= pb_rails("title", props: { text: "Title 4", tag: "h4", size: 4 }) %>
|
@@ -17,7 +17,14 @@ module Playbook
|
|
17
17
|
values: [nil, "link"],
|
18
18
|
default: nil,
|
19
19
|
deprecated: true
|
20
|
-
|
20
|
+
|
21
|
+
def initialize(props)
|
22
|
+
props[:bold] = [1, 2, 4].include?(props[:size]) unless props.key?(:bold)
|
23
|
+
props[:bold] = false if props[:size].nil? && !props.key?(:bold)
|
24
|
+
super(props)
|
25
|
+
end
|
26
|
+
|
27
|
+
prop :bold, type: Playbook::Props::Boolean
|
21
28
|
|
22
29
|
def classname
|
23
30
|
generate_classname("pb_title_kit", size, variant, color, is_bold)
|
@@ -12,7 +12,7 @@ test('returns namespaced class name', () => {
|
|
12
12
|
)
|
13
13
|
|
14
14
|
const kit = screen.getByTestId('primary-test')
|
15
|
-
expect(kit).toHaveClass('
|
15
|
+
expect(kit).toHaveClass('pb_title_kit_size_3_thin')
|
16
16
|
})
|
17
17
|
|
18
18
|
test('with thin font weight', () => {
|
@@ -38,5 +38,5 @@ test('with colors', () => {
|
|
38
38
|
)
|
39
39
|
|
40
40
|
const kit = screen.getByTestId('primary-test')
|
41
|
-
expect(kit).toHaveClass('
|
41
|
+
expect(kit).toHaveClass('pb_title_kit_size_3_success_thin')
|
42
42
|
})
|
data/lib/playbook/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: playbook_ui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 12.24.0.pre.alpha.
|
4
|
+
version: 12.24.0.pre.alpha.play833boldoptionfortitle2and3717
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Power UX
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2023-
|
12
|
+
date: 2023-05-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: actionpack
|