playbook_ui 9.14.1 → 9.17.0
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_radio/_radio.jsx +3 -1
- data/app/pb_kits/playbook/pb_radio/_radio.scss +10 -0
- data/app/pb_kits/playbook/pb_radio/docs/_radio_alignment.html.erb +27 -0
- data/app/pb_kits/playbook/pb_radio/docs/_radio_alignment.jsx +36 -0
- data/app/pb_kits/playbook/pb_radio/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_radio/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_radio/radio.rb +7 -1
- data/app/pb_kits/playbook/pb_timestamp/_timestamp.jsx +1 -3
- data/lib/playbook/version.rb +2 -2
- metadata +15 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 910e4092e8a35d776f1c8aaed3d3affffcbccf5482fa1dd25b0bbeccb8410ca6
|
4
|
+
data.tar.gz: 57aa2a44fd3a8c8fc691774ddf9e484dd461db2386fbdf05e049a699c9186f87
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8737b69eda6c1ed2abc12765f42e69ce15c184ae118726539f3dae3921fde3397dc1d8db8f2f2b5ed2c479483008189546cf78ccb6e72763c3c2d80b184ca2b4
|
7
|
+
data.tar.gz: 42feb68b57bd9e3f3752062d277365f33b5bbbc1757e042dfffa8d5c9b70bab3fde1d2649e3ba70a1122201dfa5c61c194a6f97fa592c84e573ff75f921a160d
|
@@ -9,6 +9,7 @@ import { globalProps } from '../utilities/globalProps.js'
|
|
9
9
|
|
10
10
|
type RadioProps = {
|
11
11
|
aria?: object,
|
12
|
+
alignment?: String,
|
12
13
|
checked?: Boolean,
|
13
14
|
children?: Node,
|
14
15
|
className?: String,
|
@@ -25,6 +26,7 @@ type RadioProps = {
|
|
25
26
|
|
26
27
|
const Radio = ({
|
27
28
|
aria = {},
|
29
|
+
alignment = '',
|
28
30
|
children,
|
29
31
|
className,
|
30
32
|
dark = false,
|
@@ -40,7 +42,7 @@ const Radio = ({
|
|
40
42
|
}: RadioProps, ref) => {
|
41
43
|
const ariaProps = buildAriaProps(aria)
|
42
44
|
const dataProps = buildDataProps(data)
|
43
|
-
const classes = classnames(buildCss('pb_radio_kit'), { error }, { dark }, globalProps(props), className)
|
45
|
+
const classes = classnames(buildCss('pb_radio_kit'), { error }, { dark }, globalProps(props), alignment, className)
|
44
46
|
|
45
47
|
return (
|
46
48
|
<label
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<%= pb_rails("flex") do %>
|
2
|
+
<%= pb_rails("radio", props: {
|
3
|
+
alignment: "vertical",
|
4
|
+
text: "Power",
|
5
|
+
input_options: {
|
6
|
+
tabindex: 0
|
7
|
+
},
|
8
|
+
margin_right: "sm",
|
9
|
+
name: "group 1",
|
10
|
+
value: "Power"
|
11
|
+
}) %>
|
12
|
+
|
13
|
+
<%= pb_rails("radio", props: {
|
14
|
+
alignment: "vertical",
|
15
|
+
text: "Nitro",
|
16
|
+
margin_right: "sm",
|
17
|
+
name: "group 1",
|
18
|
+
value: "Nitro"
|
19
|
+
}) %>
|
20
|
+
|
21
|
+
<%= pb_rails("radio", props: {
|
22
|
+
alignment: "vertical",
|
23
|
+
text: "Google",
|
24
|
+
name: "group 1",
|
25
|
+
value: "Google"
|
26
|
+
}) %>
|
27
|
+
<% end %>
|
@@ -0,0 +1,36 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import { Flex, Radio } from '../../'
|
3
|
+
|
4
|
+
const RadioAlignment = () => {
|
5
|
+
return (
|
6
|
+
<Flex>
|
7
|
+
<Radio
|
8
|
+
alignment="vertical"
|
9
|
+
label="Power"
|
10
|
+
marginRight="sm"
|
11
|
+
name="Group2"
|
12
|
+
tabIndex={0}
|
13
|
+
value="Power"
|
14
|
+
/>
|
15
|
+
<br />
|
16
|
+
<Radio
|
17
|
+
alignment="vertical"
|
18
|
+
defaultChecked={false}
|
19
|
+
label="Nitro"
|
20
|
+
marginRight="sm"
|
21
|
+
name="Group2"
|
22
|
+
value="Nitro"
|
23
|
+
/>
|
24
|
+
<br />
|
25
|
+
<Radio
|
26
|
+
alignment="vertical"
|
27
|
+
defaultChecked={false}
|
28
|
+
label="Google"
|
29
|
+
name="Group2"
|
30
|
+
value="Google"
|
31
|
+
/>
|
32
|
+
</Flex>
|
33
|
+
)
|
34
|
+
}
|
35
|
+
|
36
|
+
export default RadioAlignment
|
@@ -5,6 +5,8 @@ require "action_view"
|
|
5
5
|
module Playbook
|
6
6
|
module PbRadio
|
7
7
|
class Radio < Playbook::KitBase
|
8
|
+
prop :alignment, type: Playbook::Props::String,
|
9
|
+
default: ""
|
8
10
|
prop :checked, type: Playbook::Props::Boolean,
|
9
11
|
default: false
|
10
12
|
prop :error, type: Playbook::Props::Boolean,
|
@@ -19,7 +21,7 @@ module Playbook
|
|
19
21
|
default: "radio_text"
|
20
22
|
|
21
23
|
def classname
|
22
|
-
generate_classname("pb_radio_kit") + error_class
|
24
|
+
generate_classname("pb_radio_kit") + error_class + alignment_class
|
23
25
|
end
|
24
26
|
|
25
27
|
def selected
|
@@ -35,6 +37,10 @@ module Playbook
|
|
35
37
|
def error_class
|
36
38
|
error ? " error" : ""
|
37
39
|
end
|
40
|
+
|
41
|
+
def alignment_class
|
42
|
+
alignment == "vertical" ? " vertical" : ""
|
43
|
+
end
|
38
44
|
end
|
39
45
|
end
|
40
46
|
end
|
@@ -82,8 +82,6 @@ const Timestamp = (props: TimestampProps) => {
|
|
82
82
|
return `Last updated ${userDisplay} ${dateTimestamp.value.fromNow()}`
|
83
83
|
}
|
84
84
|
|
85
|
-
const datetimeOrText = timestamp ? fullDateDisplay() : text
|
86
|
-
|
87
85
|
const captionText = () => {
|
88
86
|
switch (variant) {
|
89
87
|
case 'updated':
|
@@ -91,7 +89,7 @@ const Timestamp = (props: TimestampProps) => {
|
|
91
89
|
case 'elapsed':
|
92
90
|
return formatElapsedString(userDisplay, timeDisplay)
|
93
91
|
default:
|
94
|
-
return showDate ?
|
92
|
+
return showDate ? timestamp ? fullDateDisplay() : text : fullTimeDisplay()
|
95
93
|
}
|
96
94
|
}
|
97
95
|
|
data/lib/playbook/version.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: playbook_ui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 9.
|
4
|
+
version: 9.17.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Power UX
|
8
8
|
- Power Devs
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2021-
|
12
|
+
date: 2021-06-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: actionpack
|
@@ -299,22 +299,22 @@ dependencies:
|
|
299
299
|
name: rspec-rails
|
300
300
|
requirement: !ruby/object:Gem::Requirement
|
301
301
|
requirements:
|
302
|
-
- - ">="
|
303
|
-
- !ruby/object:Gem::Version
|
304
|
-
version: 3.8.0
|
305
302
|
- - "~>"
|
306
303
|
- !ruby/object:Gem::Version
|
307
304
|
version: '3.8'
|
305
|
+
- - ">="
|
306
|
+
- !ruby/object:Gem::Version
|
307
|
+
version: 3.8.0
|
308
308
|
type: :development
|
309
309
|
prerelease: false
|
310
310
|
version_requirements: !ruby/object:Gem::Requirement
|
311
311
|
requirements:
|
312
|
-
- - ">="
|
313
|
-
- !ruby/object:Gem::Version
|
314
|
-
version: 3.8.0
|
315
312
|
- - "~>"
|
316
313
|
- !ruby/object:Gem::Version
|
317
314
|
version: '3.8'
|
315
|
+
- - ">="
|
316
|
+
- !ruby/object:Gem::Version
|
317
|
+
version: 3.8.0
|
318
318
|
- !ruby/object:Gem::Dependency
|
319
319
|
name: rubocop
|
320
320
|
requirement: !ruby/object:Gem::Requirement
|
@@ -1536,6 +1536,8 @@ files:
|
|
1536
1536
|
- app/pb_kits/playbook/pb_radio/_radio.scss
|
1537
1537
|
- app/pb_kits/playbook/pb_radio/docs/_description.md
|
1538
1538
|
- app/pb_kits/playbook/pb_radio/docs/_footer.md
|
1539
|
+
- app/pb_kits/playbook/pb_radio/docs/_radio_alignment.html.erb
|
1540
|
+
- app/pb_kits/playbook/pb_radio/docs/_radio_alignment.jsx
|
1539
1541
|
- app/pb_kits/playbook/pb_radio/docs/_radio_custom.html.erb
|
1540
1542
|
- app/pb_kits/playbook/pb_radio/docs/_radio_custom.jsx
|
1541
1543
|
- app/pb_kits/playbook/pb_radio/docs/_radio_default.html.erb
|
@@ -2157,7 +2159,7 @@ homepage: http://playbook.powerapp.cloud
|
|
2157
2159
|
licenses:
|
2158
2160
|
- MIT
|
2159
2161
|
metadata: {}
|
2160
|
-
post_install_message:
|
2162
|
+
post_install_message:
|
2161
2163
|
rdoc_options: []
|
2162
2164
|
require_paths:
|
2163
2165
|
- lib
|
@@ -2172,8 +2174,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
2172
2174
|
- !ruby/object:Gem::Version
|
2173
2175
|
version: '0'
|
2174
2176
|
requirements: []
|
2175
|
-
|
2176
|
-
|
2177
|
+
rubyforge_project:
|
2178
|
+
rubygems_version: 2.7.3
|
2179
|
+
signing_key:
|
2177
2180
|
specification_version: 4
|
2178
2181
|
summary: Playbook Design System
|
2179
2182
|
test_files: []
|